This project is mirrored from https://github.com/metabase/metabase.
Pull mirroring updated .
- May 24, 2022
-
-
Ariya Hidayat authored
* add some basic unit tests
-
Alexander Polyankin authored
-
Nemanja Glumac authored
-
Alexander Lesnenko authored
-
Benoit Vinay authored
* DimensionOptions to TypeScript * New package for DimensionOptions * Constructor properties updated * Fix for name property * Misc * Removed IDimensionOptions * Renamed interfaces
-
Nemanja Glumac authored
-
- May 23, 2022
-
-
Nemanja Glumac authored
-
dpsutton authored
we assert that the schedule gets randomized and it is no longer one of the default schedules. We need to make sure that it cannot return one of the default schedules in that case :). Low probability (1 in 58) but with 28 test suites run for each commit it starts to add up and becomes Flaky™
-
Nemanja Glumac authored
-
Ariya Hidayat authored
-
Ariya Hidayat authored
-
dpsutton authored
Settings require db access so cannot be called at read/require time. Not until we have initialized the db are setting values possible to be read.
-
dpsutton authored
* Handle `nil` cache during initial cache population this bug only happens soon after startup. The general idea of the cache is that we repopulate if needed, and other threads can use the stale version while repopulating. This is valid except at startup before the cache has finished populating. The `(setting.cache/cache)` value will still be nil to other threads while the first thread populates it. this is a race but sounds like an unlikely one to hit in practice. But we have a special case: `site-url`. We have middleware that checks the site-url on every api request and sets it if it is nil. So if an instance gets two requests before the cache has been populated, it will set it to whatever value is in the headers, overriding whatever has been set in the UI. The following snippet was how i diagnosed this. But to simulate startup you can just `(require 'metabase.models.setting.cache :reload)` to get back to an "empty" cache and let the threads race each other. I also put high contention on reloading by dropping the millisecond cache update interval to 7 milliseconds. But this refresh interval does not matter: we just fall back to the old version of the cache. It is only the initial cache population that is using `nil` as a current cache. ```clojure public-settings=> (let [mismatch1 (atom []) mismatch2 (atom []) iterations 100000 latch (java.util.concurrent.CountDownLatch. 2) nil-value (atom [])] (future (dotimes [_ iterations] (let [value (site-url) cache (metabase.models.setting.cache/cache)] (when (not= value "http://localhost:3000") (swap! mismatch1 conj value)) (when (not= (get cache "site-url") "http://localhost:3000") (swap! nil-value conj cache)))) (.countDown latch)) (future (dotimes [_ iterations] (let [value (site-url) cache (metabase.models.setting.cache/cache)] (when (not= value "http://localhost:3000") (swap! mismatch2 conj value)) (when (not= (get cache "site-url") "http://localhost:3000") (swap! nil-value conj cache)))) (.countDown latch)) (.await latch) (def nil-value nil-value) [(count @mismatch1) (take 10 @mismatch1) (count @mismatch2) (take 10 @mismatch2)]) [0 () 1616 (nil nil nil nil nil nil nil nil nil nil)] ``` * Don't attempt to get setting values from db/cache before db ready * We check `db-is-setup?` above this level db check has to happen higher up at `db-or-cache-value` as neither the db will work, nor the cache based on selecting from the db, if the db is not set up. * Remove some of the nested whens (thanks howon) Lots of nesting due to requiring and checking for nil of the required var. This can never really be nil but just to overly cautiously guard, put in an or with the `(constantly false)`. Combine the two predicates into a single `and` and then swap our homegrown `(when (seq x) x)` for the equivalent `(not-empty x)`.
-
- May 20, 2022
-
-
Dalton authored
-
Dalton authored
* Add useMostRecentCall hook * Infer types
-
Alexander Lesnenko authored
-
Ryan Laurie authored
-
Alexander Lesnenko authored
* fix usage of invalid value for scatter bubbles * wait until chart renders
-
Mahatthana (Kelvin) Nomsawadi authored
* Delete unused action `SET_DATABASE_CREATION_STEP` * Delete unused reducer and its dependencies * Simplify database form
-
- May 19, 2022
-
-
Dalton authored
* Convert TokenField to TypeScript * Move TokenField code to own folder * Dedup --> _.unique
-
Case Nelson authored
Since this information is used in the model cache logging screen accessible by monitoring users, :monitoring rather than :setting permission is the correct one.
-
Ariya Hidayat authored
-
Ariya Hidayat authored
-
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
-
Dalton authored
-
Diogo Mendes authored
-
Ariya Hidayat authored
* switch to TypeScript, add type annotations * refine prop definition * support Storybook * add some basic unit tests
-
Nick Fitzpatrick authored
Allow font selection in embedded widgets
-
Anton Kulyk authored
* Add `PLUGIN_MODEL_PERSISTENCE` plugin * Remove persist/unpersist actions * Move model cache control to enterprise folder * Move model cache management to enterprise folder * Add `setPersisted` method to `Question` * Refresh state when toggling model level persistence
-
Ngoc Khuat authored
-
Diogo Mendes authored
-
Mahatthana (Kelvin) Nomsawadi authored
-
Alexander Polyankin authored
-
- May 18, 2022
-
-
Jeff Bruemmer authored
-
Natalie authored
-
metamben authored
Reading settings in top-level form causes problems, see https://github.com/metabase/metabase/issues/22790 for details.
-
Alexander Lesnenko authored
* dashboard click behavior: fix passing multiple value parameters * add a dashboard test
-
Cam Saul authored
-
Jeff Bruemmer authored
-
- May 17, 2022
-
-
Bryan Maass authored
* bumps outdated deps versions to be current * un-upgrade h2 and jetty * un-upgrade joda-time and kixi/stats * drop Java 8 support in circle CI config - things that used to rely on be-tests-java-8-ee now rely on be-tests-java-11-ee * remove java 8 from github health check matrix * revert toucan to 1.17.0 * revert mariadb java client to 2.7.5 * Back to 18, and handle new behavior toucan used to just look in *.models.<model-name> for models and just give up apparently. I made a feature that toucan will look in a model registry to create models rather than using the convention https://github.com/metabase/toucan/commit/762ad69defc1477423fa9423e9320ed318f7cfe7 but now we're getting errors in these tests about maps vs models. ```clojure revision_test.clj:154 Check that revisions+details pulls in user info and adds description expected: [#metabase.models.revision.RevisionInstance{:is_reversion false, :is_creation false, :message nil, :user {:id 1, :common_name "Rasta Toucan", :first_name "Rasta", :last_name "Toucan"}, :diff {:o1 nil, :o2 {:name "Tips Created by Day", :serialized true}}, :description nil}] actual: (#metabase.models.revision.RevisionInstance{:description nil, :is_creation false, :is_reversion false, :user {:id 1, :first_name "Rasta", :last_name "Toucan", :common_name "Rasta Toucan"}, :message nil, :diff {:o1 nil, :o2 #metabase.models.revision_test.FakedCardInstance{:name "Tips Created by Day", :serialized true}}}) ``` The only difference here is `:o2` is a `metabase.models.revision_test.FakedCardInstance` but still has the same keys, `:name`, and `:serialized`. So all is well, we're just able to make the model. So a few different fixes. Some are use `partial=` which doesn't care about record/map distinction. Some are just make the model, and some are turning them into maps for revision strings (which more closely mimics what the real revision stuff does): ```clojure (defn default-diff-map "Default implementation of `diff-map` which simply uses clojures `data/diff` function and sets the keys `:before` and `:after`." [_ o1 o2] (when o1 (let [[before after] (data/diff o1 o2)] {:before before :after after}))) (defn default-diff-str "Default implementation of `diff-str` which simply uses clojures `data/diff` function and passes that on to `diff-string`." [entity o1 o2] (when-let [[before after] (data/diff o1 o2)] (diff-string (:name entity) before after))) ``` So all in all this change impacts nothing in the app itself, because those models follow convention and are correct in `metabase.models.<model-name>` and are thus "modelified": ```clojure revision-test=> (revision/revisions Card 1) [#metabase.models.revision.RevisionInstance{:is_creation true, :model_id 1, :id 1, :is_reversion false, :user_id 2, :timestamp #object[java.time.OffsetDateTime "0x77e037f" "2021-10-28T15:10:19.828539Z"], :object #metabase.models.card.CardInstance {:description nil, :archived false, :collection_position nil, :table_id 5, :database_id 2, :enable_embedding false, :collection_id nil, :query_type :query, :name "ECVYUHSWQJYMSOCIFHQC", :creator_id 2, :made_public_by_id nil, :embedding_params nil, :cache_ttl 1234, :dataset_query {:database 2, :type :query, :query {:source-table 5, :aggregation [[:count]]}}, :id 1, :display :scalar, :visualization_settings {:global {:title nil}}, :dataset false, :public_uuid nil}, :message nil, :model "Card"}] ``` so the model/no-model is just arbitrary distinction in the test. All of them in the actual app are turned into models: ```clojure (defn- do-post-select-for-object "Call the appropriate `post-select` methods (including the type functions) on the `:object` this Revision recorded. This is important for things like Card revisions, where the `:dataset_query` property needs to be normalized when coming out of the DB." [{:keys [model], :as revision}] ;; in some cases (such as tests) we have 'fake' models that cannot be resolved normally; don't fail entirely in ;; those cases (let [model (u/ignore-exceptions (db/resolve-model (symbol model)))] (cond-> revision ;; this line would not find a model previously for FakedCard and ;; just return the map. But now the registry in toucan _finds_ the ;; model defintion and returns the model'd map model (update :object (partial models/do-post-select model))))) (u/strict-extend (class Revision) models/IModel (merge models/IModelDefaults {:types (constantly {:object :json}) :pre-insert pre-insert :pre-update (fn [& _] (throw (Exception. (tru "You cannot update a Revision!")))) :post-select do-post-select-for-object})) ``` * try using mssql-jdbc 10.2.1.jre11 - Important that we get off the jre8 version * various fixes that needn't be reverted * Revert "various fixes that needn't be reverted" This reverts commit 2a820db0743d0062eff63366ebe7bc78b852e81f. * go back to using circle ci's java 11 docker image * java-16 (?) -> java-17 * Revert "go back to using circle ci's java 11 docker image" This reverts commit b9b14c535a689f701d7e2541081164288c988c4e. Co-authored-by:
dan sutton <dan@dpsutton.com>
-