Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Dec 09, 2022
  2. Dec 08, 2022
    • Cam Saul's avatar
      Add `=?` test expression type (#23982) · 43236c0a
      Cam Saul authored
      
      * ≈ [WIP] [ci skip]
      
      * Minor cleanup [ci skip]
      
      * Code cleanup. [ci skip]
      
      * Kondo in CI should fetch library configs
      
      * Bump Methodical version
      
      * Change name to `=?`
      
      * Add `#exactly` reader tag
      
      * Add `#schema` data reader
      
      * Fix dev deps indentation and add `algo.generic`
      
      * Add `approx=`
      
      * Improved version of `#approx`
      
      * Just check in third party Kondo config for now instead of fighting CI
      
      * Update test/metabase/test_runner/assert_exprs/approximately_equal_test.clj
      
      Co-authored-by: default avatarTim Macdonald <tim@metabase.com>
      
      * Address PR feedback and fix sequence comparison
      
      Co-authored-by: default avatarTim Macdonald <tim@metabase.com>
      Unverified
      43236c0a
    • Cam Saul's avatar
      Add import and export (SerDes v2) commands (#26984) · 3d5ddd9c
      Cam Saul authored
      * Add import and export (SerDes v2) commands
      
      * Allow use of deprecated dump/load in EE tests
      Unverified
      3d5ddd9c
    • Bryan Maass's avatar
      only query for db-metadata once per sync operation + scan each table for its PKs (#26810) · d3a98472
      Bryan Maass authored
      * memoize snowflake describe-database w/ 5 min ttl
      
      * pass in db-metadata where it is used,
      
      - rather than querying for it in random functions
      
      * update callsite of sync-tables-and-database!
      
      * let sync-metabase-metadata! look up db-metadata
      
      - only when needed
      
      * pass catalog (db), and schema to .getPrimaryKeys
      
      * let describe-table* add in the nil table-name
      
      * cleanup
      
      * use :snowflake instead of driver for inheritance
      
      * concurrent-sync-test should call describe-database once
      
      * cleaning up
      
      * call add-table-pks with 3 args
      
      * call add-table-pks with 3 args
      
      * try escaping entity names to appease Oracle Driver
      
      - Oracle wants the table-name to be escaped
      - escape is usually a no-op
      
      * pass driver to escape entity
      
      * pull get-table-pks into a multimethod,
      
      - handle the discrepancy directly in Oracle driver
      
      * remove inline def
      
      * fix colliding consistent-namespace linting
      
      - metabase.driver.sql-jdbc.common and
        metabase.driver.sql-jdbc.sync.common were
        mapped to sql-jdbc.common
      - metabase.driver.sql-jdbc.sync.common is now
        mapped to sql-jdbc.sync.common
      
      * fix reflection warnings
      
      * apply fix for getting oracle pks
      
      * nix an unused arg
      Unverified
      d3a98472
  3. Dec 02, 2022
  4. Dec 01, 2022
    • Noah Moss's avatar
      Extract sample DB to plugins directory on startup (#26828) · 726b659f
      Noah Moss authored
      * initial implementation
      
      * some refactor and improved error handling
      
      * another refactor
      
      * fix reflection warning
      
      * add test and more refactor
      
      * another test
      
      * misc comment improvements and formatting
      
      * fix tests
      
      * small refactor
      
      * fix function call
      
      * address tamas's comments
      Unverified
      726b659f
  5. Nov 23, 2022
  6. Oct 26, 2022
  7. Oct 20, 2022
    • Cam Saul's avatar
      Initialize Metabase with config from a file (#25986) · 5625fcb1
      Cam Saul authored
      
      * Initialize Metabase from a file
      
      * Code cleanup
      
      * Support optional template tags; more dox
      
      * Finish documentation for ns str
      
      * Force the first User to be an admin
      
      * Tests for DB creation
      
      * Add test to ensure that you can set User password with an {{env ...}} template
      
      * Remove data app permission code (#26016)
      
      * Revert "Use "apps" collection namespace for app collections (#25963)"
      
      This reverts commit a1894202.
      
      * Revert "Implement EE/Pro app permissions (#25764)"
      
      This reverts commit cf9b1bf5.
      
      * Revert "Implement global app permissions for the "All Users" group (#25679)"
      
      This reverts commit 63e950f2.
      
      * Revert "Require data permissions for executing actions (#25784)"
      
      This reverts commit 732bf6b1.
      
      * Revert "Prevent modifying app permissions via the collection endpoint (#25684)"
      
      This reverts commit 5d3f8279.
      
      * Revert "Implement DB specific execution permissions (#25629)"
      
      This reverts commit 141a13ce.
      
      * Revert "Introduce /execution/ permission (#25529)"
      
      This reverts commit 57cbb921.
      
      * Keep the app permission revision table
      
      * [Apps] Remove emitters (#25999)
      
      * [Apps] Remove emitters
      
      Emitters were created when we thought that we would be adding actions to
      multiple places in metabase. Instead we've coalesced to actions being a
      core feature of data-apps and are executed from within them. Attaching
      actions to models, as a form of re-use rather than a form of execution,
      means that actions can still be executed directly from a model, if we
      want to allow that in the future.
      
      * Fix lint errors
      
      * Move perform-action! tests out of the api.
      
      Since we want to keep the implicit bulk functionality but remove those
      endpoints move the tests to the actions namespace.
      
      * Fix linter
      
      * Change driver test to use function instead of endpoint
      
      Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
      Co-authored-by: default avatarCase Nelson <case@metabase.com>
      Unverified
      5625fcb1
  8. Oct 19, 2022
    • metamben's avatar
      Remove data app permission code (#26016) · b8c92cf1
      metamben authored
      * Revert "Use "apps" collection namespace for app collections (#25963)"
      
      This reverts commit a1894202.
      
      * Revert "Implement EE/Pro app permissions (#25764)"
      
      This reverts commit cf9b1bf5.
      
      * Revert "Implement global app permissions for the "All Users" group (#25679)"
      
      This reverts commit 63e950f2.
      
      * Revert "Require data permissions for executing actions (#25784)"
      
      This reverts commit 732bf6b1.
      
      * Revert "Prevent modifying app permissions via the collection endpoint (#25684)"
      
      This reverts commit 5d3f8279.
      
      * Revert "Implement DB specific execution permissions (#25629)"
      
      This reverts commit 141a13ce.
      
      * Revert "Introduce /execution/ permission (#25529)"
      
      This reverts commit 57cbb921.
      
      * Keep the app permission revision table
      Unverified
      b8c92cf1
    • metamben's avatar
      Use "apps" collection namespace for app collections (#25963) · a1894202
      metamben authored
      * Create app collections in the "apps" collection namespace
      
      * Add test macro for setting global app permissions for "All Users"
      
      * Introduce app permission audit table
      Unverified
      a1894202
  9. Sep 29, 2022
  10. Sep 26, 2022
    • Cam Saul's avatar
      Use `humane-are` lib for tests (#25606) · dc3db493
      Cam Saul authored
      * Switch to humane-are
      
      * Fix some busted `are`s
      
      * Remove unused namespaces
      Unverified
      dc3db493
    • dpsutton's avatar
      Substitute persisted queries in parameter card references (#25610) · 1ebae228
      dpsutton authored
      * Substitute persisted queries in parameter card references
      
      ```sql
      select o.total, o.quantity, model_p.category, model_p.title
      from orders o
      left join {{#14-pg-products}} model_p -- reference to products model
      on o.product_id = model_p.id
      limit 4
      ```
      
      Testing:
      
      I'm unhappy with how verbose the test is. At some point we're going to
      need a better, standardized way to test persistence. But the test makes
      a persisted table of the test-data.categories
      table (test/metabase/test/data/dataset_definitions/test-data.edn). It
      runs some sql to update the values in the table to turn `"Winery"` ->
      `"Winery from cached table"`, joins the two tables together to have both
      at once.
      
      There's a lot of moving pieces and the setup is a bit verbose. There's
      also no obvious place where these types of tests should go. We'll need
      to consolidate them in the future (and extend them).
      
      * persisted macro
      
      * docstring for `persisted-info-native-query`
      
      * alignments and small nits
      
      * Reuse persistence macro
      
      * clj-kondo cleanups
      
      * remove clj-kondo change before rebase
      Unverified
      1ebae228
  11. Sep 22, 2022
  12. 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
  13. Aug 22, 2022
  14. 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
  15. 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
  16. 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
  17. Aug 04, 2022
  18. Jul 26, 2022
  19. 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
  20. 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
  21. Jul 14, 2022
  22. 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
  23. Jul 07, 2022
  24. Jun 16, 2022
  25. May 31, 2022
  26. 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
  27. 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
  28. 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
  29. 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
  30. May 09, 2022
Loading