Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Aug 23, 2022
    • Cam Saul's avatar
      [Toucan 2 Prep] Replace the `IObjectPermissions` protocol with multimethods (#24917) · 241f2179
      Cam Saul authored
      * [Toucan 2 prep] Don't invoke Toucan models as functions
      
      * Some fixes
      
      * Test fixes
      
      * Test fix
      
      * [Toucan 2 prep] Don't call `type` or `class` on Toucan models
      
      * Test fixes
      
      * More test fixes :wrench:
      
      * Replace perms protocol with multimethods; derive models from perms policy keywords
      
      * Test fixes :wrench:
      
      * Appease Eastwood
      
      * Fix errors now that App has been merged in
      
      * Empty commit to trigger CI
      Unverified
      241f2179
  2. Aug 22, 2022
  3. Aug 12, 2022
    • Cam Saul's avatar
      Enable Kondo for tests part 2: enable `:unused-binding` linter and fix warnings (#24748) · adf45182
      Cam Saul authored
      * Fix some small things
      
      * Add Kondo to deps.edn to be able to debug custom hooks from REPL
      
      * Fix macroexpansion hook for with-temp* without values
      
      * Test config (WIP)
      
      * More misc fixes
      
      * Disable :inline-def for tests
      
      * More misc fixes
      
      * Fix $ids and mbql-query kondo hooks.
      
      * Fix with-temporary-setting-values with namespaced symbols
      
      * More misc fixes
      
      * Fix the rest of the easy ones
      
      * Fix hook for mt/dataset
      
      * Horrible hack to work around https://github.com/clj-kondo/clj-kondo/issues/1773 . Custom linter for mbql-query macro
      
      * Fix places calling mbql-query with a keyword table name
      
      * Fix the last few errors in test/
      
      * Fix errors in enterprise/test and shared/test
      
      * Fix driver test errors
      
      * Enable linters on CI
      
      * Enable unresolved-namespace linter for tests
      
      * Appease the namespace linter again
      
      * Test fixes
      
      * Enable unused-binding linter for test/ => 293 warnings
      
      * 259 warnings
      
      * 234 warnings
      
      * => 114 warnings
      
      * Fix the rest of the unused binding warnings in test/
      
      * Fix unused binding errors in enterprise/backend/test
      
      * Fix unused binding lint errors in driver tests
      
      * Test fix :wrench:
      
      * Assure Kondo that something is in fact used
      Unverified
      adf45182
    • Cam Saul's avatar
      Enable Kondo for tests (part 1) (#24736) · bc4acbd2
      Cam Saul authored
      * Fix some small things
      
      * Add Kondo to deps.edn to be able to debug custom hooks from REPL
      
      * Fix macroexpansion hook for with-temp* without values
      
      * Test config (WIP)
      
      * More misc fixes
      
      * Disable :inline-def for tests
      
      * More misc fixes
      
      * Fix $ids and mbql-query kondo hooks.
      
      * Fix with-temporary-setting-values with namespaced symbols
      
      * More misc fixes
      
      * Fix the rest of the easy ones
      
      * Fix hook for mt/dataset
      
      * Horrible hack to work around https://github.com/clj-kondo/clj-kondo/issues/1773 . Custom linter for mbql-query macro
      
      * Fix places calling mbql-query with a keyword table name
      
      * Fix the last few errors in test/
      
      * Fix errors in enterprise/test and shared/test
      
      * Fix driver test errors
      
      * Enable linters on CI
      
      * Enable unresolved-namespace linter for tests
      
      * Appease the namespace linter again
      
      * Test fixes
      Unverified
      bc4acbd2
  4. Aug 11, 2022
    • Cam Saul's avatar
      Enable clj-kondo for driver namespaces (#24728) · 047a336b
      Cam Saul authored
      * Enable clj-kondo for driver namespaces
      
      * Fix CI command
      
      * Fix CI config (?)
      
      * Try hardcoding the driver directories in CI config
      
      * Fix some busted stuff
      
      * Enable the redundant fn wrapper linter
      
      * Appease the namespace linter
      Unverified
      047a336b
  5. Aug 05, 2022
    • Case Nelson's avatar
      Add generic with-action for action tests (#24418) · 6cfc3fe4
      Case Nelson authored
      Combined `with-query-action` and `with-http-action` into `with-action`
      that also allows options to be provided to override the created
      action.
      
      Chose to make `options-map` required, unlike with-temp, so kondo can use
      `let` to lint the macro rather than having to create a new hook.
      Unverified
      6cfc3fe4
  6. Aug 04, 2022
  7. Jul 26, 2022
  8. Jul 25, 2022
    • Case Nelson's avatar
      [Actions] Add emitter and action tests (#24199) · e6aded3d
      Case Nelson authored
      * wip
      
      * Update kondo hook for with-temp*
      
      `with-temp*` allows for unpaired bindings if you just want the default
      model. This would break the `let` that the hook was binding if you had
      an unpaired temp model followed by others.
      
      * Adding tests for emitters and actions
      
      Test hydration of :emitters
      
      Test hydration of :action
      
      Test http emitter execution
      
      Test emitter crud
      
      Test failure cases around emitter execution
      
      Small consistency changes made to non-test code that shouldn't affect happy path FE code, largely 404 checking and keyword/string consistency.
      
      * Fix unused requires
      
      * Fix macro resolution
      Unverified
      e6aded3d
  9. Jul 19, 2022
    • Cam Saul's avatar
      Implement `:bulk/update` Action (backend) (#24036) · bd913c87
      Cam Saul authored
      * `:bulk/update`
      
      * Some refactoring. Add error handling and tests for `:bulk/update`
      
      * Remove unused namespace
      
      * PR feedback and some bug fixes
      
      * Make sure bulk/delete fails if you have all PK columns and also non-PK columns
      
      * Implement caching mechanism for Actions
      
      * Fix more `bulk/delete` tests for Postgres
      
      * Disable kondo error for `u/key-by` being deprecated
      
      * Fix duplicate test setup code in `bulk/delete` tests
      
      * Fix CircleCI job skipping magic: `$CIRCLE_STAGE` has been renamed to `$CIRCLE_JOB`
      
      * Fix Presto JDBC failures from `NOT NULL` column
      
      * Fix GA Card Save expected status code
      
      * Fix error message differences between Postgres versions
      
      * Update Snowflake DDL statements tests
      
      * Fix redundant `let` expressions
      
      * handle different error messages for different PG versions
      Unverified
      bd913c87
  10. Jul 14, 2022
  11. Jul 08, 2022
    • Braden Shepherdson's avatar
      Add serialization hierarchy, serialize Database, Table and Field (#23622) · c952c87c
      Braden Shepherdson authored
      Serialization of Databases, Tables, Fields
      
      This brought a few core changes:
      - Add `serdes-entity-id` to abstract the field used for the ID
      - Pass the options to `extract-one` so it can eg. do encryption things.
      - Handle dates in YAML storage and ingestion
      - `:serdes/meta` now holds the entire hierarchy, not just the leaf model+ID pair.
      
      There's an open problem here about the right way to handle secrets like
      a database's password. Do we assume both sides have the same
      `MB_ENCRYPTION_SECRET_KEY`? Provide a serdes-specific password the user
      just made up, and every secret gets decrypted with the source key, encrypted with
      the serdes key, stored, decrypted with the serdes key, and encrypted with
      the destination key?
      Unverified
      c952c87c
  12. Jul 07, 2022
  13. Jun 16, 2022
  14. May 31, 2022
  15. May 19, 2022
    • Cam Saul's avatar
      `defsetting` setter functions should end in `!` (#22800) · 9dd96b3c
      Cam Saul authored
      * `defsetting` setter functions should end in `!`
      
      * Fix typo
      
      * Update .clj-kondo/hooks/metabase/models/setting.clj
      
      * Fix clj-kondo for Toucan defmodel not emitting a docstring
      
      * Remove `^:private` metadata on a couple of Settings since it makes Eastwood fussy
      Unverified
      9dd96b3c
  16. May 18, 2022
    • Bryan Maass's avatar
      Pod writeback up to delete unreverted (#22789) · 51fcdb8f
      Bryan Maass authored
      
      * Add `experimental-enable-actions` feature flag (#22559)
      
      * Add `experimental-enable-actions` feature flag
      
      * Simplify Ring middleware
      
      * Sort namespaces
      
      * Make sure api.actions is loaded
      
      * Add Database-local Setting for enabling Actions for a specific Database
      
      * SQL JDBC Delete Row Action (#22608)
      
      * SQL JDBC Delete Action [ci skip]
      
      * Add note about parsing values [ci skip]
      
      * transition to using mbql for actions/row/:action
      
      - TODO: how to setup a qp store?
      - TODO: better way to keywordize filters?
      
      * some cleanup [ci skip]
      
      * better message on delet statement conflicts
      
      - and a test
      
      * mt/with-everything-store -> seed store manually [ci skip]
      
      * fix some test input
      
      * get more tests passing
      
      * add more validation tests
      
      * privatize catch-throw
      
      * plug in and alter tests to use with-actions-test-data
      
      Co-authored-by: default avatarBryan Maass <bryan.maass@gmail.com>
      
      * Destructible version of `test-data` dataset for testing writeback actions (#22692)
      
      * Destructible version of `test-data` dataset for testing the actions stuff
      
      * Revert new precondition
      
      * Make sure api.actions is loaded
      
      * remove keep-me for api.actions
      
      Co-authored-by: default avatarCam Saul <1455846+camsaul@users.noreply.github.com>
      Co-authored-by: default avatarCam Saul <github@camsaul.com>
      Unverified
      51fcdb8f
  17. May 17, 2022
    • Bryan Maass's avatar
      Revert backend api actions (#22755) · 3acbe649
      Bryan Maass authored
      * Revert "Revert new precondition"
      
      This reverts commit 1f97a4d6ccfdaa92ff82fd0256f08f3512c3c5e7.
      
      * Revert "plug in and alter tests to use with-actions-test-data"
      
      This reverts commit 2f33cb47b700b1da106adf54d41928c5956978d0.
      
      * Revert "Add Database-local Setting for enabling Actions for a specific Database"
      
      This reverts commit a52f8d0a478a31bb1f1b4a6693abf8f8e658d9cf.
      
      * Revert "Make sure api.actions is loaded"
      
      This reverts commit 7d7b913a7a0d64cbe2b6907f389d994a1130c0f5.
      
      * Revert "Add `experimental-enable-actions` feature flag (#22559)"
      
      This reverts commit 9b313752.
      
      * Revert "SQL JDBC Delete Row Action (#22608)"
      
      This reverts commit d6864f38.
      
      * Remove actions api docs
      
      * Revert "Destructible version of `test-data` dataset for testing writeback actions (#22692)"
      
      This reverts commit 15c57d9a.
      
      * keep around a few misc improvements
      
      * removes precondition
      
      - {:pre [(nil? (namespace symb))]}
      
      * various fixes that needn't be reverted
      Unverified
      3acbe649
  18. May 13, 2022
    • Case Nelson's avatar
      Update persist model api permissions for EE (#22601) · f302d582
      Case Nelson authored
      * Update persist model api permissions for EE
      
      On OSS, only Admins can enable model cache in `Settings/Cache`,
      enable database model cache in `Settings/Databases` and cache individual models.
      
      On EE/Pro, users with `Settings access` application permissions can enable model
      cache in `Settings/Cache` and users with `Manage database` can enable model
      cache for a database.
      
      * Add tests for application permissions
      Unverified
      f302d582
  19. May 09, 2022
  20. May 02, 2022
    • Braden Shepherdson's avatar
      One Clojure lint to rule them all (#22213) · 390d10e5
      Braden Shepherdson authored
      Background:
      
      We had two lint configs: lint-config.edn which was enfored by Github Actions, and
      .clj-kondo/config.edn, the default location used by editors.
      
      
      Problem:
      
      Patchy enforcement of the (larger) config in .clj-kondo/config.edn since not
      everyone uses an editor.
      
      Some new lint, like canonical namespace aliases (#21738, #19930) is not enforced
      automatically and has begun to bit-rot.
      
      Solution:
      
      Combine both configs, fix any outstanding lint, and update our tooling to use
      the unified config.
      
      Caveats:
      
      Anyone who has their local editor configured to use lint-config.edn will have
      their linting broken by this change.
      Unverified
      390d10e5
  21. Apr 27, 2022
    • Noah Moss's avatar
      Migrate LDAP code to using `defenterprise` (#21687) · 2167b788
      Noah Moss authored
      * scaffolding, docstring & arg parsing
      
      * tweaks
      
      * registry and basic oss->ee dispatch
      
      * stubbed defenterprise-ee
      
      * full defenterprise-ee impl
      
      * fix build and tweak docstring
      
      * remove debug code
      
      * basic tests
      
      * use defonce
      
      * support for :any feature
      
      * schema support
      
      * fix schema test
      
      * switch to using format
      
      * support for schema on return val
      
      * tweak macro
      
      * move schema validation to submacros
      
      * do ee fn resolution at runtime
      
      * do conditionals at macro-expansion time
      
      * adjust semantics & refactor
      
      * fix test
      
      * add memoization for ee resolution
      
      * fix tests
      
      * emit register-mapping! call to avoid eval
      
      * call starts-with on symbol
      
      * remove schema support
      
      * use spec for arg parsing, generate fns, and remove :error fallback option
      
      * clean ns
      
      * change schema alias to schema
      
      * add :arglists meta and small refactor
      
      * refactor
      
      * move EE logic to fn
      
      * validate that the correct args are passed in EE/OSS namespaces, and make :feature required
      
      * remove logic for handling nil :feature
      
      * fix lint errors
      
      * fix ee macros
      
      * defenterprise-schema macro & tests
      
      * clean ns
      
      * propogate metadata
      
      * don't memoize ee resolution in dev to make debugging easier
      
      * dont do ee fn resolution during macroexpansion
      
      * migrate LDAP functions to defenterprise
      
      * lint
      
      * require ee ns separately so that EE settings are available
      
      * revert change to function mocked in tests
      
      * add back code lost in merge
      
      * clean ns
      
      * clean ns again
      
      * minor refactor and cleanup
      
      * major refactor
      
      * fix defenterprise-schema syntax
      
      * fix import
      
      * major refactor
      
      * update docstrings
      
      * more docstring tweaks
      
      * try to fix lint error on ldap PR
      
      * add lint-as mappings for defenterprise and defenterprise-schema to clj-kondo config
      
      * clj-kondo/ignore use of spec alias
      
      * use destructuring in arg lists since it's now supported
      
      * add docstring to def emitted by macro, and some formatting tweaks
      Unverified
      2167b788
  22. Apr 26, 2022
    • dpsutton's avatar
      Enable :unsorted-required-namespaces and lint cleanups (#22087) · b519dd8a
      dpsutton authored
      ```
      ❯ clj-kondo --lint src:shared/src
      src/metabase/api/common/validation.clj:2:33: warning: Inconsistent alias. Expected str instead of string.
      src/metabase/api/database.clj:664:5: warning: Redundant let expression.
      src/metabase/api/table.clj:18:45: warning: Inconsistent alias. Expected field-values instead of sync.field-values.
      src/metabase/cmd.clj:123:5: warning: unused binding docs
      src/metabase/db/data_migrations.clj:15:52: warning: Inconsistent alias. Expected perms-group instead of group.
      src/metabase/db/data_migrations.clj:55:15: warning: #'metabase.db.data-migrations/data-migrations is deprecated
      src/metabase/db/data_migrations.clj:62:24: warning: #'metabase.db.data-migrations/data-migrations is deprecated
      src/metabase/db/data_migrations.clj:63:7: warning: #'metabase.db.data-migrations/run-migration-if-needed! is deprecated
      src/metabase/db/data_migrations.clj:154:1: warning: #'metabase.db.data-migrations/defmigration is deprecated
      src/metabase/db/data_migrations.clj:201:1: warning: #'metabase.db.data-migrations/defmigration is deprecated
      src/metabase/db/setup.clj:59:5: warning: Missing catch or finally in try
      src/metabase/driver/postgres.clj:18:63: warning: Inconsistent alias. Expected sql-jdbc.describe-table instead of sql-jdbc.sync.describe-table.
      src/metabase/driver/postgres.clj:304:9: warning: unused binding nfc-path
      src/metabase/driver/postgres.clj:323:60: warning: unused binding fields-fields
      src/metabase/driver/sql_jdbc/sync/describe_table.clj:253:39: error: Expected: set or nil, received: seq.
      src/metabase/driver/sql_jdbc/sync/describe_table.clj:254:39: error: Expected: set or nil, received: seq.
      src/metabase/driver/sql_jdbc/sync/describe_table.clj:333:11: warning: unused binding map-inner
      src/metabase/models/secret.clj:248:23: warning: use :else as the catch-all test expression in cond
      src/metabase/pulse/render/body.clj:216:64: warning: unused binding cols
      src/metabase/task/refresh_slack_channel_user_cache.clj:52:25: error: clojurewerkz.quartzite.schedule.simple/with-interval-in-seconds is called with 1 arg but expects 2
      linting took 5988ms, errors: 3, warnings: 17
      ```
      
      ```
      ❯ clj-kondo --lint src:shared/src
      src/metabase/task/refresh_slack_channel_user_cache.clj:52:25: error: clojurewerkz.quartzite.schedule.simple/with-interval-in-seconds is called with 1 arg but expects 2
      linting took 5270ms, errors: 1, warnings: 0
      ```
      
      Want to call out a few things:
      
      The following all related to the new paths into json feature. Wanted
      howon to verify that nothing got dropped with these unused bindings.
      
      ```
      src/metabase/driver/postgres.clj:304:9: warning: unused binding nfc-path
      src/metabase/driver/postgres.clj:323:60: warning: unused binding fields-fields
      src/metabase/driver/sql_jdbc/sync/describe_table.clj:253:39: error: Expected: set or nil, received: seq.
      src/metabase/driver/sql_jdbc/sync/describe_table.clj:254:39: error: Expected: set or nil, received: seq.
      src/metabase/driver/sql_jdbc/sync/describe_table.clj:333:11: warning: unused binding map-inner
      ```
      Unverified
      b519dd8a
  23. Apr 19, 2022
  24. Mar 23, 2022
  25. Mar 04, 2022
  26. Feb 24, 2022
  27. Feb 10, 2022
    • Michiel Borkent's avatar
      Linting improvements (#20424) · 8f119d64
      Michiel Borkent authored
      * honeysql var improvements
      
      * Define routes
      
      * Define routes
      
      * define-routes improvement
      
      * honeysql helpers
      
      * honesql
      
      * abs in clojure 1.11
      
      * fix logic unresolved vars
      
      * deprecated
      
      * deprecated var warnings
      
      * undo replace
      Unverified
      8f119d64
  28. Feb 03, 2022
  29. Jan 25, 2022
  30. Oct 19, 2021
Loading