Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Mar 02, 2023
  2. Mar 01, 2023
  3. Feb 28, 2023
    • Bryan Maass's avatar
      Make chain filters viewable when collection permissions allow it (#28581) · b245a5cf
      Bryan Maass authored
      * Adds tests for chain filters security issue
      
      * add another test
      
      * Users with collection permissions can view chained filters for dashboard
      
      - this obeys sandboxing
      
      * Users with collection access should be allowed to view chain filters
      
      * add test + fix case for block filters
      
      * check with premium features
      
      * check premium features + revert with-premium-features in tests
      
      * remove block check
      
      * respond to review comments
      
      * ensure data-perms are there + check blocked
      
      * rewrite e2e test so that it actually tests chain filters
      
      * properly toggle linked filters on
      
      - don't use random classes, etc
      
      * rename *param-values-query* dynamic var
      
      * update chain-filter docstring
      
      * token-features should still be private
      Unverified
      b245a5cf
    • Noah Moss's avatar
      Env var to control retention of `query_execution` data (#28595) · 4059bd7b
      Noah Moss authored
      * initial implementation of query_execution retention policy
      
      * fix logic and add tests for setting
      
      * refactor and more tests
      
      * set default on cloud to 0
      
      * try to fix test by loading ee ns if available
      
      * address feedback and small refactors
      
      * interface file for truncate-audit-log
      
      * extract common definitions into an interface to avoid cyclic dependency
      
      * fix indentation
      Unverified
      4059bd7b
    • dpsutton's avatar
      Handle action db and model db different (#28616) · 76c56b41
      dpsutton authored
      
      * Ensure query action's db matches model id
      
      This is only a half-way measure. Needs some FE loving as well.
      
      The +New -> Action workflow lets you create an action. This starts with
      the user choosing the database, writing the action. On save it prompts
      you to choose a model it should live under. But this model's db and the
      db chosen originally are not checked in the FE.
      
      Ideally we only show models on that existing db, but it kinda seems
      weird to have an action do things to a random table and it live under a
      model that just needs to be on the db.
      
      * reword error message
      
      Co-authored-by: default avatarMaz Ameli <maz@metabase.com>
      
      * Check both databases for enabled actions when they disagree
      
      a custom action can have its own query which brings its own
      database. When creating a new custom action from the models detail page,
      these go hand in hand. When using the workflow from the "+New" button,
      the model is chosen at the last step, well after the action's db and
      query is set. And there's nothing holding these two together.
      
      Asked if this was a bug and was told no. But we want to make sure we
      check both for actions enabled.
      
      * fix lint
      
      ---------
      
      Co-authored-by: default avatarMaz Ameli <maz@metabase.com>
      Unverified
      76c56b41
    • Nemanja Glumac's avatar
      Unverified
      5848baee
    • dpsutton's avatar
      Delay substituting persisted native query until after analysis (#28739) · c4050fee
      dpsutton authored
      * Delay substituting persisted native query until after analysis
      
      We were substituting persisted queries into the query at too early a
      stage.
      
      Card 729 is a persisted model of `select * from categories`
      
      ```clojure
      {:type :query,
       :query {:source-table "card__729",
               :expressions {:adjective ["case"
                                         [[[">" ["field" 100 nil] 30]
                                           "expensive"]
                                          [[">" ["field" 100 nil] 20]
                                           "not too bad"]]
                                         {:default "its ok"}]},
               :aggregation [["count"]],
               :breakout [["expression" "adjective" nil]
                          ["field" 101 nil]]},
       :database 3,
       :parameters []}
      ```
      
      This would immediately get turned into an equivalent
      
      ```clojure
      {:type :query,
       :query {:source-table 12
               :persisted-info/native "select \"id\", \"ean\", \"title\", \"category\", \"vendor\", \"price\", \"rating\", \"created_at\" from \"metabase_cache_424a9_3\".\"model_729_products_r\""
               :expressions {:adjective ["case"
                                         [[[">" ["field" 100 nil] 30]
                                           "expensive"]
                                          [[">" ["field" 100 nil] 20]
                                           "not too bad"]]
                                         {:default "its ok"}]},
               :aggregation [["count"]],
               :breakout [["expression" "adjective" nil]
                          ["field" 101 nil]]},
       :database 3,
       :parameters []}
      ```
      
      And the obvious failure here is the use of `[:field 100 nil]` (price)
      against an inner query of `select ... price ... from cache_table`. This
      could break many queries and caused a flood of
      
      ```
      WARN middleware.fix-bad-references :: Bad :field clause [:field 100 #:metabase.query-processor.util.add-alias-info{:source-table :metabase.query-processor.util.add-alias-info/source, :source-alias "price"}] for field "products.price" at [:expressions "adjective" :case :>]: clause should have a :join-alias. Unable to infer an appropriate join. Query may not work as expected.
      WARN middleware.fix-bad-references :: Bad :field clause [:field 100 #:metabase.query-processor.util.add-alias-info{:source-table :metabase.query-processor.util.add-alias-info/source, :source-alias "price"}] for field "products.price" at [:expressions "adjective" :case :>]: clause should have a :join-alias. Unable to infer an appropriate join. Query may not work as expected.
      ```
      
      * forgot to commit new test file
      
      * Handle persisted before native
      
      * Add test for native models
      
      - have to populate the metadata. You can do this by running the query,
      but there are some requirements around the `:info` object to actually
      save it. So just take the more mechanical route
      - `wait-for-result` returns a time out value, but it's namespaced
      autoresolved to a namespace inside of the metabase.test forest and not
      mt itself. So easy to mess up and watch for the wrong keyword. Want an
      arity so i can check my own timeout value and throw a helpful error
      message. I checked around and noone seems to care. So not great, but at
      least people aren't checking `::mt/timed-out` when it should be
      `::tu.async/timed-out` or
      `:metabase.test.util.async/timed-out`. Possibly best scenario is we
      remove the autoresolved bit and have it return `:async/timed-out` or
      something stable.
      
      * properly compile the native query
      
      * bump timeout to set redshift metadata
      Unverified
      c4050fee
    • john-metabase's avatar
      Serdes v2 clean up collections option handling (#28745) · 0761928a
      john-metabase authored
      Cleans/fixes serdes v2 export :collections handling in cmd and API
      Unverified
      0761928a
    • Anton Kulyk's avatar
      Handle errors when enabling database actions (#28744) · 95f8bfb6
      Anton Kulyk authored
      * Handle errors when enabling database actions
      
      * Use more common error message fallback
      
      * Use `Promise<void>` for other `Sidebar` callbacks
      Unverified
      95f8bfb6
    • Alexander Polyankin's avatar
    • Nick Fitzpatrick's avatar
      Adding flex grow to card wrapper (#28728) · 16f3a8d2
      Nick Fitzpatrick authored
      
      * Adding flex grow to card wrapper
      
      * Optimize repro
      
      * fix height on cards
      
      ---------
      
      Co-authored-by: default avatarNemanja <31325167+nemanjaglumac@users.noreply.github.com>
      Co-authored-by: default avatarAleksandr Lesnenko <alxnddr@gmail.com>
      Co-authored-by: default avatarAleksandr Lesnenko <alxnddr@users.noreply.github.com>
      Unverified
      16f3a8d2
    • Anton Kulyk's avatar
      Handle opening archived and not existing actions via URL (#28493) · 3b698313
      Anton Kulyk authored
      * Handle archived and not existing actions
      
      * Handle model ID mismatch
      
      * Migrate to `fetch-mock`
      
      * Don't use URL helpers in tests
      
      * Fix action editor assertions in model detail tests
      Unverified
      3b698313
    • john-metabase's avatar
    • Cal Herries's avatar
    • Aleksandr Lesnenko's avatar
      Revert column settings changes (#28709) · 716aed38
      Aleksandr Lesnenko authored
      
      * Revert "Fixing Table isValid check (#28411)"
      
      This reverts commit 5e18759f.
      
      * Revert "GH 28304 and GH 28311 (#28314)"
      
      This reverts commit 47bad0d3.
      
      * revert column settings changes
      
      * object detail view
      
      * adjusting e2e tests
      
      ---------
      
      Co-authored-by: default avatarNick Fitzpatrick <nick@metabase.com>
      Unverified
      716aed38
    • Denis Berezin's avatar
    • Nemanja Glumac's avatar
      [Ci] Run workflows using `ubuntu-22.04` - batch 2 (#28656) · d9f638b9
      Nemanja Glumac authored
      * Run workflows using `ubuntu-22.04` - batch 2
      
      * Do not run `i18n` workflow on the latest Ubuntu
      Unverified
      d9f638b9
    • Nemanja Glumac's avatar
    • Ngoc Khuat's avatar
      Add tests for sandbox user apis (#28601) · ee44d788
      Ngoc Khuat authored
      * add tests for sandbox user apis
      Unverified
      ee44d788
Loading