Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Apr 17, 2024
  2. Apr 15, 2024
  3. Apr 12, 2024
  4. Apr 10, 2024
    • dpsutton's avatar
      Fix #39138 again (#40936) · b1e83541
      dpsutton authored
      * Fix #39138 again
      
      Fixes #40934
      
      Got unfixed somehow in #40578. seems like some file renames caught it off guard
      
      But the long and short is that its possible for a persisted model to end
      up in the state "refreshing" (possible an instance restart during
      refreshing). The refreshing job doesn't look for these so they become
      effectively invisible.
      
      Since the job to refresh them will only run one at a time cluster wide,
      any jobs that are in the "refreshing" state when the refresher begins to
      refresh are necessarilly stuck (no one else could currently be
      refreshing them). So we can just add them to the queue of models to
      refresh.
      
      ```clojure
      (jobs/defjob ^{org.quartz.DisallowConcurrentExecution true ;; <----
                     :doc "Refresh persisted tables job"}
        PersistenceRefresh [job-context]
        (refresh-job-fn! job-context))
      ```
      
      * Ensure ee/oss pathways are taken in tests
      
      Annoying little footgun here. CI does not run with an ee token, so in
      order to ensure that test pathway goes through ee version of a
      defenterprise we _must_ use the `mt/with-premium-features
      {:cache-granular-controls}`,  but we also want to ensure that it goes
      through the oss version.
      
      So two options, a `doseq` on both features (empty set and the feature
      that triggers this). But want a test in the enterprise folder as well to
      ensure.
      
      The real trickiness comes from running tests at a repl and CLI. My REPL
      always has an ee token in it. My command line always lacks that as
      well. So want to be explicit about the token features in effect at test
      time.
      
      That's why I'm essentially duplicating tests (ee in ee folder, oss in
      regular pathway)
      Unverified
      b1e83541
    • Cal Herries's avatar
    • Cal Herries's avatar
      Mitigate some redshift flakes (#41191) · 4c00bc49
      Cal Herries authored
      Unverified
      4c00bc49
  5. Apr 08, 2024
    • Alexander Solovyov's avatar
    • Alexander Solovyov's avatar
      cache invalidation (#40774) · 84642517
      Alexander Solovyov authored
      New endpoint accepts entity and entity ids in form of `database=1&dashboard=2&question=3`. If you don't supply
      `&include=overrides`, then it tries to find configs directly referencing supplied entities and updates their
      `invalidated_at`. If you supply `&include=overrides`, all the referenced cards are
      updated (`report_card.cache_invalidated_at`).
      
      Cache strategies then select the maximum `invalidated_at` in their logic. EE-only.
      
      resolves #40548
      Unverified
      84642517
  6. Apr 06, 2024
  7. Apr 04, 2024
  8. Apr 03, 2024
  9. Mar 27, 2024
    • John Swanson's avatar
      Allow group managers to view all people (#40619) · c6dd2765
      John Swanson authored
      Fixes #40328
      
      [Our documentation](https://www.metabase.com/docs/latest/people-and-groups/managing#group-managers) states that:
      
      > Group managers can:
      >
      > - View all people in the Admin settings > People tab.
      
      This fixes enforcement to be aligned with the documentation. This behavior makes sense, because as the docs also state, Group Managers should be allowed to *add* people to the group they manage, which they can only do if they can see those people!
      
      Initially, I also removed a faulty test, which was described as:
      ```
      ;; Non-segmented users are allowed to ask for a list of all of the users in the Metabase instance. Pulse email lists
      ;; are an example usage of this. Segmented users should not have that ability. Instead they should only see
      ;; themselves. This test checks that GET /api/user for a segmented user only returns themselves
      ```
      
      but actually failed to test this in a relevant way (because it was testing the `GET /api/user` endpoint rather than the `GET /api/user/recipients` endpoint). The test had continued to pass only because the user was the only member of the group they managed.
      
      I initially thought this behavior wasn't desired, but as it turns out, it *is* in fact documented behavior to disallow sandboxed users from seeing any email suggestions. Investigating, I found that a bug was allowing sandboxed users to see all users on the `/api/user/recipients` endpoint if the user-visibility setting was set to `:all`.
      
      Thus, the second commit fixes the bug and re-adds the (fixed) test. A sandboxed user now only sees their own user when hitting `/api/user/recipients`.
      Unverified
      c6dd2765
  10. Mar 26, 2024
  11. Mar 25, 2024
  12. Mar 22, 2024
  13. Mar 21, 2024
  14. Mar 20, 2024
    • Cam Saul's avatar
      E2E support for CRUD + running pMBQL queries; new MLv2 normalization [WIP] (#39969) · efffd589
      Cam Saul authored
      * E2E support for CRUD + running pMBQL queries; new MLv2 normalization
      
      * More work on improved normalization
      
      * Update schema references
      
      * Test fixes :wrench:
      
      * Move the MBQL parameters schema
      
      * Performance improvements
      
      * Improved pivot code etc.
      
      * Clean namespaces
      
      * Fixes :wrench:
      
      * Wow
      
      * Test fix :wrench:
      
      * Fixes
      
      * Actions should use strings for column names (fix :update-row and :create-row normalization)
      
      * MLv2 schema should check against keys for the other query type
      
      * Ok, have I fixed things?
      
      * More fixes :wrench:
      
      * Fix indentation
      
      * Another round of test fixes. :wrench:
      
      * Split pivot stuff off
      
      * Hopefully the last few test fixes :wrench:
      
      * We need to test normalization for queries that have keyword keys as well.
      
      * Fix Cljs i18n namespaces
      
      * Sort namespaces
      
      * Only test against H2
      
      * Test fixes :wrench:
      
      * Register MBQL clause schemas and test fixes :wrench:
      
      * Test fixes and PR feedback
      
      * Test fix
      
      * Remove the normalization tests
      
      * Test fixes :wrench:
      
      * Fix kondo
      
      * Test fix
      
      * Another fix
      
      * Test fix :wrench:
      Unverified
      efffd589
    • bryan's avatar
      Feature branch for airgap-token: Milestone 1 (#39733) · bcda8468
      bryan authored
      
      * decrypt and read values from airgap token
      
      - Adds notion of "AirgapToken"
      - Adds max-users and company optional fields to `TokenStatus`
      - Adds branch to `fetch-token-status*` for handling airgapped tokens
      
      * Add support for handling airgap tokens
      
      - validate airgap token valid-thru date
      
      * enforce user creation limits using airgap token
      
      * fix airgap token reads + fill in the token data
      
      * in oss mode don't try to read the airgap_ token
      
      * use airgap-token? helper
      
      * tighten the user-creation logic
      
      - make the check correct
      - account for archived users
      
      Co-authored-by: default avatarJohn Swanson <john.swanson@metabase.com>
      
      * check airgap user count
      
      setting premium-embedding-token
      app startup
      
      * move decryption code into ee namespace
      
      * add some tests for token decryption
      
      * fix tests and add tests
      
      * move ee features into ee tests
      
      * add typehint + warn on reflection
      
      * add a check for missing public key resource
      
      * respond to review
      
      - add docstring to AirgapToken
      - remove outdated comment
      - fix off-by-1 error
      
      * valid-now? takes a TokenStatus instead of a :map
      
      * revert usage of mt/with-temporary-setting-values
      
      ---------
      
      Co-authored-by: default avatarJohn Swanson <john.swanson@metabase.com>
      Unverified
      bcda8468
    • Alexander Solovyov's avatar
      Fix caching tests flakes (#40379) · 4eadd09e
      Alexander Solovyov authored
      Unverified
      4eadd09e
    • metamben's avatar
      Rename metric to legacy-metric (#39232) · 8e89c578
      metamben authored
      * Rename :model/Metric to :model/LegacyMetric
      * Rename ::lib.schema.metadata/metric tp ::lib.schema.metadata/legacy-metric
      * Rename models.metric/Metric to models.metric/LegacyMetric
      * Move /api/metric endpoints to /api/legacy-metric
      Unverified
      8e89c578
    • Alexander Solovyov's avatar
  15. Mar 18, 2024
  16. Mar 15, 2024
    • Cam Saul's avatar
      MLv2 normalization overhaul (#40142) · c27b6769
      Cam Saul authored
      * Wow
      
      * Test fix :wrench:
      
      * Fixes
      
      * Actions should use strings for column names (fix :update-row and :create-row normalization)
      
      * MLv2 schema should check against keys for the other query type
      
      * Ok, have I fixed things?
      
      * More fixes :wrench:
      
      * Fix indentation
      
      * Another round of test fixes. :wrench:
      
      * Hopefully the last few test fixes :wrench:
      
      * We need to test normalization for queries that have keyword keys as well.
      
      * Fix Cljs i18n namespaces
      
      * Sort namespaces
      
      * Only test against H2
      
      * Test fixes :wrench:
      
      * Register MBQL clause schemas and test fixes :wrench:
      
      * Test fixes and PR feedback
      
      * Test fix
      Unverified
      c27b6769
    • Noah Moss's avatar
      Remove activity table and model (#40017) · d01a7c8e
      Noah Moss authored
      Unverified
      d01a7c8e
  17. Mar 14, 2024
    • Tim Macdonald's avatar
      SQL Lineage: Track field usage, expose stale queries (#39707) · 3093f7c3
      Tim Macdonald authored
      * SQL Lineage: Create the QueryField model
      
      This links Cards (with native queries) to Fields, showing us which
      queries use which Fields.
      
      QueryFields are automatically maintained as part of the Card lifecycle
      
      Cards with stale queries (powered by QueryField info) are exposed via the `card?f=stale` API
      Unverified
      3093f7c3
  18. Mar 13, 2024
  19. Mar 11, 2024
    • Noah Moss's avatar
      Clean up unused perms code (#39875) · 8c279277
      Noah Moss authored
      Unverified
      8c279277
    • dpsutton's avatar
      Db api (#39731) · 1e7823d1
      dpsutton authored
      * first move to a db api
      
      * mdb.spec into mdb
      
      * mdb.u/isa -> mdb.query/isa
      
      * mdb.u/qualify -> mdb.query/qualify
      
      * last of mbql.u -> mbql.query and :gun:mbql.u:sparkler:
      
      * remove last of the mdb.connection/db-type and use from mdb/db-type
      
      * remove the last non-cmd usages of mdb.connection
      
      had some circularity in
      
      models.interface requires mdb/db-type for sql flavored "now"
      mdb requires db/setup
      which requires db/custom_migrations to ensure they are on cp
      custom migration requires json functions in models.interface
      
      so had to do a dynamic require for the db-type
      
      * get db-type from mdb not mdb.env
      
      * invoke `(mdb/app-db)` and not pass a var. lots of things fail
      
      * mdb.setup/migrate! into mdb with potemkin
      
      * remove get-connection. call .getConnection on the app-db
      
      perhaps invites clumsy usage outside of `with-open` if it's a top level
      function
      
      * namespace docstrings
      
      * last few and grab db.env/db-file into api ns
      
      * lint cleanup
      
      * addresses PR comments
      Unverified
      1e7823d1
    • Anton Kulyk's avatar
      Fixes for LLM auto-description (#39858) · a16b4d5c
      Anton Kulyk authored
      
      * Fix card summarize endpoint
      
      * Fix "AI features" setting section visibility
      
      * Add  setting
      
      * Use `ee-ai-features-enabled` setting
      
      * Add test for new LLM defsetting. Add note in settings UI
      
      ---------
      
      Co-authored-by: default avatarAdam James <adam.vermeer2@gmail.com>
      Co-authored-by: default avataradam-james <21064735+adam-james-v@users.noreply.github.com>
      Unverified
      a16b4d5c
  20. Mar 08, 2024
    • Cam Saul's avatar
      Convert QP to MLv2 (Part 1) (#39613) · 2dccd287
      Cam Saul authored
      * Keep fetch_source_query.clj
      
      * Copy fetch_source_query.clj into fetch_source_query_legacy.clj
      
      * Set back fetch_source_query.clj file
      
      * Convert QP to MLv2, part 1
      
      * Keep legacy implementation around for time being
      
      * Port thru convert-to-legacy
      
      * expand-macros is converted to legacy
      
      * Test fixes :wrench:
      
      * Test fixes and better keys
      
      * Test fixes
      
      * Test fixes :wrench:
      
      * More test fixes :wrench:
      
      * Test fix? :wrench:
      
      * Wow, maybe I finally fixed everything :wrench:
      
      * Last few test fixes :wrench:
      
      * PR feedback; lib.walk should support splicing in multiple replacement stages
      
      * Update fetch-source-query to use improved lib.walk
      
      * Have I fixed everything now? :wrench:
      
      * Remove stray println
      
      * Another MongoDB fix :wrench:
      
      * Remove the changes to expand-macros for now, we can do that in a follow-on PR.
      
      * Test fix
      
      * Test fix
      Unverified
      2dccd287
  21. Mar 07, 2024
  22. Mar 06, 2024
  23. Mar 04, 2024
Loading