Compare commits

...

920 Commits

Author SHA1 Message Date
github-automation-metabase
6f82f1ebb9 🤖 backported "Remove old llms.txt superseded by Jekyll plugin on docs site" (#69134)
Remove old llms.txt superseded by Jekyll plugin on docs site (#69132)

remove llms.txt and llms-embedding-full.txt superseded by Jekyll build plugin

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2026-02-12 03:47:47 +07:00
github-automation-metabase
27561a4aad 🤖 backported "Added MB_MONITOR_PERFORMANCE option" (#69362) 2026-02-10 16:50:28 -06:00
github-automation-metabase
625948debc 🤖 backported "Don't use the deprecated enable-query-caching value" (#69312)
Don't use the deprecated enable-query-caching value (#69256)

Don't use the deprecated enable-query-caching value which may have been stored as "false" in the database.

Co-authored-by: Nathan Voxland <nathan@metabase.com>
2026-02-10 16:20:53 +00:00
github-automation-metabase
13d037e0e3 🤖 backported "Do a rollback before discard all" (#69191) 2026-02-05 20:29:00 +00:00
github-automation-metabase
bb3c617e4e 🤖 backported "[Athena] Correctly recognize :base_type when db type is uppercase" (#69112)
[Athena] Correctly recognize `:base_type` when db type is uppercase (#68369)

Athena's JDBC driver returns type names with the same capitalization as
the user types into the admin interface, but the
`sql-jdbc.sync/database-type->base-type` implementation for Athena only
recognized lower-case names (which are the defaults, I gather).

I think most databases don't have this problem, since they ignore the
case you typed in e.g. `CREATE TABLE` statements and have the JDBC
driver always return the canonical spelling of the type names.

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2026-02-04 15:28:54 +00:00
Stas Gavrylov
8bfe4f9a7c OpenAPI->TS: Compile all changes from master to double-backport (#68841)
* OpenAPI->TS: Compile all changes from master to backport

* Update yarn.lock file

* OpenAPI->TS: Bring OpenAPI Check CI workflow

* Fix missing comma

* Remove unused field from openapi-ts config

* Bring docstring changes from api/common.clj

* Remove unrelated changes from open_api.clj

* Remove unrelated changes from open_api_test.clj

* Update OpenAPI schema (240dd55...d31f28d)

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: dpsutton <dan@dpsutton.com>
2026-02-04 11:29:19 +02:00
github-automation-metabase
95b9396a41 🤖 backported "Better error handling in queue listeners" (#69012) 2026-02-03 20:37:44 -06:00
github-automation-metabase
d073436357 🤖 backported "Keep field-values for detail-only fields" (#68817)
Keep field-values for detail-only fields (#67540)

* Keep field-values for detail-only fields

Closes #10851

* Make sure old-preview-display is set

* Fix test

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
Co-authored-by: dpsutton <dan@dpsutton.com>
2026-02-04 01:00:52 +00:00
github-automation-metabase
0873f2e0c6 🤖 backported "Fix reindex connection management" (#69008)
Fix reindex connection management (#68973)

Move reindex connection management to use a connection only around the writes, not try to use a connection across all writes, which may commit and therefore close server-side cursors still being used to read the next batch.

Co-authored-by: Nathan Voxland <nathan@metabase.com>
Co-authored-by: dpsutton <dan@dpsutton.com>
2026-02-04 00:24:55 +00:00
github-automation-metabase
2319a66e2f 🤖 backported "Bigquery and snowflake failing test QUE-3013" (#69016)
* Bigquery and snowflake failing test QUE-3013 (#68916)

BigQuery can't do case statements with different types in each branch. Other dbs can. This fixes a test that ran a case statement with different types to skip BigQuery, but it adds a new assertion to check correct behavior without it.

This also corrects a fault in the SnowFlake driver that incorrectly assumed that convertTimezone() returned a timestamp_ntz but it returns a timestamp_tz. This wraps it in a cast back to timestamp_ntz.

* Whitespace

---------

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2026-02-03 17:03:50 -06:00
github-automation-metabase
320b04c0f3 🤖 backported "Search Indexing: Cache card schema upgrades" (#69035)
Search Indexing: Cache card schema upgrades (#68912)

Co-authored-by: Nathan Voxland <nathan@metabase.com>
2026-02-03 22:24:41 +00:00
github-automation-metabase
27df742758 🤖 backported "Case statements with/without defaults" QUE-3013 (#68850)
* Don't double-convert expressions with convertTimezone() (#68740)

In the case statement, the default case did not TIMEZONE() to alter the timezone. The cases with TIMEZONE() returned a timestamp. The default case without TIMEZONE() returned timestamptz. Postgres reconciled the different types by converting all of them to timestamptz. So the timestamp was altered (by TIMEZONE()), but a new UTC timestamp was added (by the cast).

When the post-processor formats the rows, it checks that the metadata for the column has :converted_timezone. If it has that, it is formatted in the converted timezone, and since it's UTC, it will convert it again, a second time, which is incorrect.

The fix here is to check if the returned column is a timestamptz and strip it before formatting. We assume the database has already done the conversion. This avoids the second conversion.

* Fix import problem

---------

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2026-02-03 22:10:40 +00:00
github-automation-metabase
4257006930 🤖 backported "Change log level from info to debug for ignored params on qp" (#68832)
Change log level from info to debug for ignored params on qp (#68748)

reducing a bit more the verbosity of our logs, this time on cards with old metadata

Co-authored-by: da <paoliniluis@gmail.com>
Co-authored-by: dpsutton <dan@dpsutton.com>
2026-02-03 19:10:53 +00:00
Nicola Mometto
707d411054 [manual backport] mysql insert-col->val fix (#69007)
backport mysql insert-col->val from a07c3b654e
2026-02-03 17:00:14 +00:00
github-automation-metabase
4e967623b6 🤖 backported "Delete fuzzing workflow" (#68888) 2026-02-03 14:24:58 +13:00
github-automation-metabase
673b299dfb 🤖 backported "implicit joins get implicit fields added" (#68747)
* implicit joins get implicit fields added (#68394)

Say you are doing an implicit join from orders to products in order to summarize by products.category. Previously, with implicit joins, we join with the actual products table instead of a select blah from products wrapper, and so the various fields returned by the join were returned under their original name. However, the code would abbreviate excessively long column names from the joined table and break the query.

That difference was due to add-implicit-fields running before add-implicit-joins. Explicit joins got implicit fields added, while implicit joins didn't get those fields. This pr runs add-implicit-fields a second time after add-implicit-joins, which makes implicit and explicit joins compile to the same (correct) sql.

* Fix bigquery implicit join tests

* rename dataset to fix caching

* bump tests

* update comments to account for data loading hacks

* make athena tests use current version of test-data

* revert comment changes because of other work

* bump tests

---------

Co-authored-by: William <william@metabase.com>
2026-02-02 08:46:41 -05:00
github-automation-metabase
240dd55dd5 🤖 backported "Flip mariadb during table editing support check" (#68736)
Flip mariadb during table editing support check (#68171)

Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2026-01-27 17:08:22 +00:00
github-automation-metabase
b7c0de7541 🤖 backported "prometheus metrics for jvm startup" (#68735)
prometheus metrics for jvm startup (#68728)

logs:
```
2026-01-27 15:02:23,442 INFO util.queue :: Starting listener field-value-invalidate with 1 threads 🎧
2026-01-27 15:02:23,448 INFO util.queue :: Starting listener search-index-update with 1 threads 🎧
2026-01-27 15:02:23,448 INFO core.core :: Metabase Initialization COMPLETE
2026-01-27 15:02:23,453 INFO core.core :: Metabase Initialization COMPLETE in 4.8 s (JVM uptime: 57.8 s)
```

metrics:

```
❯ http get :9191/metrics | grep startup
metabase_startup_jvm_to_complete_millis 57764.0
metabase_startup_init_duration_millis 4816.0
```

Note that there two different notions of startup time: from jvm
instantiation, and from before init! was called. This maintains the two
separately so we can diagnose if class load time gets longer
independently of amount of work we do during startup itself

Co-authored-by: dpsutton <dan@dpsutton.com>
2026-01-27 16:40:52 +00:00
dpsutton
b0a2e3cdb8 more defensive checking (#68709)
I have a suspicion that the token check query is taking a long
time. Timestamps in some logs are

2026-01-27 00:06:11.561	{"m":"Checking with the MetaStore to see whether token...
2026-01-27 00:06:28.951	{"lvl":"INFO","lgr":"metabase.premium-features.token-check","cluster":"metabase-1","m":"Reporting Metabase stats:
2026-01-27 00:06:28.951
{"lvl":"INFO","lgr":"metabase.premium-features.token-check","cluster":"metabase-1","m":"Reporting
Metabase stats: Cannot throw exception because the return value of \"java.lang.Throwable.getCause()\" is null"

So:
I'm memoizing the token request stats for 2 minutes. This is not long
enough to affect reported numbers, just to make sure that we
successively checking we don't need to hit the db again

and don't rethrow an empty (.getCause e). I don't understand why it
would be empty at all but I'm defensive here and logging
2026-01-27 10:30:03 -06:00
github-automation-metabase
4e4ec4debf 🤖 backported "Don't duplicate uploads in admin page" (#68696)
Don't duplicate uploads in admin page (#68077)

Co-authored-by: Nathan Voxland <nathan@metabase.com>
2026-01-26 21:31:59 +00:00
github-automation-metabase
cae9e8f41c 🤖 backported "try to prevent deadlocks in impersonation tests" (#68694)
try to prevent deadlocks in impersonation tests (#68690)

Co-authored-by: dpsutton <dan@dpsutton.com>
2026-01-26 20:58:07 +00:00
github-automation-metabase
442578ab1b 🤖 backported "Better logging around token checks" (#68689)
Better logging around token checks (#68625)

* Better logging around token checks

We used to just log we were checking but not give error responses. So it
would look like a ton of token checks for no real reason.

Now includes error responses if any, and also include logs when engaging
the token check circuit breaker, and when it is "half open", when it
lets one real token check happen every 30 seconds to see if the service
is back.

```
2026-01-23 12:26:47,175 INFO premium-features.token-check :: Checking with the MetaStore to see whether token 'f325...d01a' is valid...
2026-01-23 12:26:47,186 INFO premium-features.token-check :: Reporting Metabase stats: {:embedding-dashboard-count 0, :enabled-embedding-sdk false, :internal-users 1, :embedding-question-count 0, :query_executions_static_embed 0, :query_executions_public_link 0, :domains 1, :metabot-usage-date 2026-01-22, :enabled-embedding-static false, :enabled-embedding-simple false, :metabot-queries 0, :external-users 0, :metabot-tokens 0, :query_executions_simple_embed 0, :enabled-embedding-interactive false, :query_executions_internal 0, :metabot-users 0, :query_executions_sdk_embed 0, :query_executions_interactive_embed 0, :users 1}
2026-01-23 12:26:49,190 INFO premium-features.token-check :: Error checking token: Connect timed out †
2026-01-23 12:26:49,194 INFO premium-features.token-check :: Checking with the MetaStore to see whether token 'f325...d01a' is valid...
2026-01-23 12:26:49,201 INFO premium-features.token-check :: Reporting Metabase stats: {:embedding-dashboard-count 0, :enabled-embedding-sdk false, :internal-users 1, :embedding-question-count 0, :query_executions_static_embed 0, :query_executions_public_link 0, :domains 1, :metabot-usage-date 2026-01-22, :enabled-embedding-static false, :enabled-embedding-simple false, :metabot-queries 0, :external-users 0, :metabot-tokens 0, :query_executions_simple_embed 0, :enabled-embedding-interactive false, :query_executions_internal 0, :metabot-users 0, :query_executions_sdk_embed 0, :query_executions_interactive_embed 0, :users 1}
2026-01-23 12:26:51,205 INFO premium-features.token-check :: Engaging circuit breaker in token check ††
2026-01-23 12:26:51,206 INFO premium-features.token-check :: Error checking token: Connect timed out
2026-01-23 12:27:44,548 INFO premium-features.token-check :: In token check circuit breaker but attempting check
2026-01-23 12:27:44,551 INFO premium-features.token-check :: Checking with the MetaStore to see whether token 'f325...d01a' is valid...
2026-01-23 12:27:44,565 INFO premium-features.token-check :: Reporting Metabase stats: {:embedding-dashboard-count 0, :enabled-embedding-sdk false, :internal-users 1, :embedding-question-count 0, :query_executions_static_embed 0, :query_executions_public_link 0, :domains 1, :metabot-usage-date 2026-01-22, :enabled-embedding-static false, :enabled-embedding-simple false, :metabot-queries 0, :external-users 0, :metabot-tokens 0, :query_executions_simple_embed 0, :enabled-embedding-interactive false, :query_executions_internal 0, :metabot-users 0, :query_executions_sdk_embed 0, :query_executions_interactive_embed 0, :users 1}
2026-01-23 12:27:46,574 INFO premium-features.token-check :: Engaging circuit breaker in token check
2026-01-23 12:27:46,575 INFO premium-features.token-check :: Error checking token: Connect timed out

...
2026-01-23 12:32:50,432 INFO premium-features.token-check :: In token check circuit breaker but attempting check †††
2026-01-23 12:32:50,433 INFO premium-features.token-check :: Checking with the MetaStore to see whether token 'f325...d01a' is valid...
2026-01-23 12:32:50,444 INFO premium-features.token-check :: Reporting Metabase stats: {:embedding-dashboard-count 0, :enabled-embedding-sdk false, :internal-users 1, :embedding-question-count 0, :query_executions_static_embed 0, :query_executions_public_link 0, :domains 1, :metabot-usage-date 2026-01-22, :enabled-embedding-static false, :enabled-embedding-simple false, :metabot-queries 0, :external-users 0, :metabot-tokens 0, :query_executions_simple_embed 0, :enabled-embedding-interactive false, :query_executions_internal 0, :metabot-users 0, :query_executions_sdk_embed 0, :query_executions_interactive_embed 0, :users 1}
2026-01-23 12:32:52,450 INFO premium-features.token-check :: Engaging circuit breaker in token check
2026-01-23 12:32:52,450 INFO premium-features.token-check :: Error checking token: Connect timed out
```

The highlights are now we include:
- † `Error checkign token: Connect timed out` the error response when
appropriate
- †† `Engaging circuit breaker in token check` when we engage the
circuit breaker to no longer do real token checks
- ††† `In token check circuit breaker but attempting check` indicating
we are doing a real one from the circuit breaker to determine if the
service is restored

* Whew. Lots of stuff

add a namespace to the circuit breaker keyword:
`:token-check/circuit-breaker`. Change the keyword holding
`:token-check/app-db-not-ready` to cause. I had used reason but nothing
checked that.

this is because want to log when a token check fails, but not when it is
- failure due to circuit breaker
- failure due to appdb not ready yet.

token checks can happen anywhere and with an enormous frequency. they
fail before the appdb is setup (we can't check settigns yet) and of
course they fail during the circuit breaker opening. that's the point of
the circuit breaker. So we don't have to log these.

We _do_ want to log other failures.

We also want to do some prometheus metrics. Here's a journey:
You previously couldn't import the prometheus analytics namespace
because analytics.settings required appearance.settings. It does so
because a docstring in analytics settings used to include Metabase in
the string. I removed that so now it says "in order to help us
improve". And then things would be smooth sailing.

Except we had an issue.

```
026-01-23 20:50:03,514 INFO analytics.prometheus :: Starting prometheus metrics collector
2026-01-23 20:50:03,539 INFO analytics.prometheus :: Starting prometheus metrics web-server on port 9191
thread229238 we made the system!
thread229238 and now we are done with the lock!
2026-01-23 20:50:03,607 INFO analytics.prometheus :: Starting prometheus metrics web-server on port 9191
2026-01-23 20:50:03,611 ERROR premium-features.token-check :: Error validating token: Failed to initialize Prometheus on port 9,191
2026-01-23 20:50:03,611 INFO analytics.prometheus :: Starting prometheus metrics web-server on port 9191
2026-01-23 20:50:03,612 INFO analytics.prometheus :: Starting prometheus metrics web-server on port 9191
2026-01-23 20:50:03,614 INFO analytics.prometheus :: Starting prometheus metrics web-server on port 9191
2026-01-23 20:50:03,616 INFO analytics.prometheus :: Starting prometheus metrics web-server on port 9191
2026-01-23 20:50:03,617 INFO analytics.prometheus :: Starting prometheus metrics web-server on port 9191
2026-01-23 20:50:03,618 INFO analytics.prometheus :: Starting prometheus metrics web-server on port 9191
2026-01-23 20:50:03,619 INFO analytics.prometheus :: Starting prometheus metrics web-server on port 9191
2026-01-23 20:50:03,619 INFO analytics.prometheus :: Starting prometheus metrics web-server on port 9191
2026-01-23 20:50:03,653 INFO core.core :: Setting up prometheus metrics
```

We have locking around the system but it is starting tons of times! Lots
of debugging, swearing that this can't happen. but then i finally threw
in my favorite trick: `(clojure.repl/pst (Exception. "how did we get
here"))`. And it turns out we are doing this:

1. token check fails, so we call `prometheus/inc!`
2. inc is helpful, sees system isn't yet setup, and sets it up for us
3. Setup metric system
4. setup metrics in system
5. we hit the following code which gets initial values for labels

```clojure
(defn- initial-labelled-metric-values []
  (for [metric (keys (methods known-labels))
        labels (known-labels metric)]
    {:metric metric
     :labels labels
     :value  (initial-value metric labels)}))
```
6. We hit the following search code about which search we have

```clojure
(defmethod analytics/initial-value :metabase-search/engine-active
  [_ {:keys [engine]}]
  (if (search.engine/supported-engine? (keyword "search.engine" engine))
  1 0))
```

7. This takes us to semantic search:

```clojure
(defmethod search.engine/supported-engine? :search.engine/semantic [_]
  (try
    (supported?)
    (catch Exception e
      (log/warn e "Semantic search engine not supported")
      false)))
```

8. `supported?` here checks to see if you support a particular search
impelementation, which of course depends on _YOUR FEATURES_.
9. Checking features fails, so we should increment our prometheus
counter
10. the system is not yet initialized yet. Let's initialize it. (this is
also step 2)

So I have added a simple `inc-if-initialized!` function. It's not
important if the system is down. It's ok if these events are lost. The
system will be initialized in core anyways.

```
❯ http get :9191/metrics | grep metabase_token
 HELP metabase_token_check_attempt_total Total number of token checks. Includes a status label.
 TYPE metabase_token_check_attempt_total counter
metabase_token_check_attempt_total{status="failure",} 8.0
```

logs:

```
2026-01-23 22:58:26,668 INFO premium-features.token-check :: Checking with the MetaStore to see whether token '82bf...c3fe' is valid...
2026-01-23 22:58:28,706 INFO premium-features.token-check :: Error checking token: Connect timed out
2026-01-23 22:58:28,750 INFO core.core :: Setting up prometheus metrics
2026-01-23 22:58:28,751 INFO analytics.prometheus :: Starting prometheus metrics collector
2026-01-23 22:58:28,789 INFO premium-features.token-check :: Checking with the MetaStore to see whether token '82bf...c3fe' is valid...
2026-01-23 22:58:30,793 INFO premium-features.token-check :: Error checking token: Connect timed out
2026-01-23 22:58:30,798 INFO analytics.prometheus :: Starting prometheus metrics web-server on port 9191
...

2026-01-23 22:58:53,441 INFO premium-features.token-check :: Checking with the MetaStore to see whether token '82bf...c3fe' is valid... {mb-quartz-job-type=SyncAndAnalyzeDatabase}
...
2026-01-23 22:58:55,445 INFO premium-features.token-check :: Engaging circuit breaker in token check {mb-quartz-job-type=SyncAndAnalyzeDatabase}
2026-01-23 22:58:55,445 INFO premium-features.token-check :: Error checking token: Connect timed out {mb-quartz-job-type=SyncAndAnalyzeDatabase}
```

```
Exception how here??
	metabase.analytics.prometheus/setup! (prometheus.clj:584)
	metabase.analytics.prometheus/setup! (prometheus.clj:576)
	metabase.analytics.prometheus/inc! (prometheus.clj:668)
	metabase.analytics.prometheus/inc! (prometheus.clj:658)
	metabase.analytics.prometheus/inc! (prometheus.clj:665)
	metabase.analytics.prometheus/inc! (prometheus.clj:658)
	metabase.premium-features.token-check/error-catching-token-checker/reify--98262 (token_check.clj:431)
	metabase.premium-features.token-check/check-token (token_check.clj:488)
	metabase.premium-features.token-check/check-token (token_check.clj:484)
	metabase.premium-features.token-check/check-token (token_check.clj:486)
	metabase.premium-features.token-check/check-token (token_check.clj:484)
	metabase.premium-features.token-check/eval98325/*token-features*98348--98349 (token_check.clj:534)
	metabase.premium-features.token-check/eval98325/fn--98353 (token_check.clj:529)
	metabase.premium-features.token-check/has-feature? (token_check.clj:575)
	metabase.premium-features.token-check/has-feature? (token_check.clj:569)
	clojure.lang.Var.invoke (Var.java:386)
	metabase.premium-features.defenterprise/check-feature (defenterprise.clj:41)
	metabase.premium-features.defenterprise/check-feature (defenterprise.clj:35)
	metabase.premium-features.defenterprise/dynamic-ee-oss-fn/fn--71956 (defenterprise.clj:53)
	metabase.search.semantic.core/eval180600/fn--180601 (core.clj:58)
	clojure.lang.MultiFn.invoke (MultiFn.java:229)
	metabase.search.core/eval139302/fn--139304 (core.clj:77)
	clojure.lang.MultiFn.invoke (MultiFn.java:234)
	metabase.analytics.prometheus/initial-labelled-metric-values/iter--97802--97808/fn--97809/iter--97804--97810/fn--97811 (prometheus.clj:521)
	clojure.lang.LazySeq.force (LazySeq.java:50)
	clojure.lang.LazySeq.realize (LazySeq.java:89)
	clojure.lang.LazySeq.seq (LazySeq.java:106)
	clojure.lang.RT.seq (RT.java:555)
	clojure.core/seq--5488 (core.clj:139)
	clojure.core/concat/fn--5579 (core.clj:727)
	clojure.lang.LazySeq.force (LazySeq.java:50)
	clojure.lang.LazySeq.realize (LazySeq.java:89)
	clojure.lang.LazySeq.seq (LazySeq.java:106)
	clojure.lang.Cons.next (Cons.java:41)
	clojure.lang.RT.next (RT.java:733)
	clojure.core/next--5472 (core.clj:64)
	clojure.core/next--5472 (core.clj:64)
	metabase.analytics.prometheus/setup-metrics! (prometheus.clj:546)
	metabase.analytics.prometheus/setup-metrics! (prometheus.clj:533)
	metabase.analytics.prometheus/make-prometheus-system (prometheus.clj:60)
	metabase.analytics.prometheus/make-prometheus-system (prometheus.clj:55)
	metabase.analytics.prometheus/setup!/fn--97866 (prometheus.clj:591)
	metabase.analytics.prometheus/setup! (prometheus.clj:590)
	metabase.analytics.prometheus/setup! (prometheus.clj:576)
	metabase.analytics.prometheus/inc! (prometheus.clj:668)
	metabase.analytics.prometheus/inc! (prometheus.clj:658)
	metabase.analytics.prometheus/inc! (prometheus.clj:665)
	metabase.analytics.prometheus/inc! (prometheus.clj:658)
	metabase.premium-features.token-check/error-catching-token-checker/reify--98262 (token_check.clj:431)
	metabase.premium-features.token-check/check-token (token_check.clj:488)
```

* module config fixup

Co-authored-by: dpsutton <dan@dpsutton.com>
2026-01-26 14:55:55 -06:00
github-automation-metabase
f574132a4d 🤖 backported "Delete from cache in batches of 1000" (#68686)
Delete from cache in batches of 1000 (#68622)

There's apparently an instance on cloud that is trying to remove 70k queries from the cache at once, and postgres
doesn't allow 70k params to a query.  Batching the deletes in groups of 1000 should fix that.

Co-authored-by: William <william@metabase.com>
2026-01-26 18:06:51 +00:00
Timothy S. Dean
4bbb8e6337 👨 backported "Delete invalid source-card-ids on native SQL questions" (#68576)
* Delete invalid `source-card-id`s on native SQL questions (#68100)

When a user creates a question based on a model, `source_card_id` was set to the model's ID. If that question was later converted to native SQL, `source_card_id` wouldn't get cleared. This means that deleting the model would cause the question to be deleted even though they no longer have any relationship to one another.

The code fix won't help anyone whose data is already incorrect, so this adds a migration to correct the inconsistent data. I added an assertion to the t2 hook to catch this at dev time in the future. And ultimately, the delete cascade seems overkill, so there's a migration to replace that with SET NULL instead.

* Move 057 migrations to 056.
2026-01-24 00:08:06 +00:00
github-automation-metabase
26581fa3ec 🤖 backported "handle empty error message" (#68617)
handle empty error message (#68581)

Fixes https://github.com/metabase/metabase/issues/68578

This issue is not about the stack overflow per-se but blowing up on a
string includes:

```javascript
{
  "app": "metabase",
  "time": "2026-01-22T12:08:53.660601485Z",
  "stream": "stderr",
  "app_version": "v1.57.10-X01",
  "message": "Exception in thread \"Thread-41\" java.lang.NullPointerException: Cannot invoke \"Object.toString()\" because \"s\" is null
at clojure.string$includes_QMARK_.invokeStatic(string.clj:377)
at clojure.string$includes_QMARK_.invoke(string.clj:373)
at metabase.app_db.cluster_lock$retryable_QMARK_.invokeStatic(cluster_lock.clj:27)
at metabase.app_db.cluster_lock$retryable_QMARK_.invoke(cluster_lock.clj:19)
at metabase.app_db.cluster_lock$do_with_cluster_lock.invokeStatic(cluster_lock.clj:87)
at metabase.app_db.cluster_lock$do_with_cluster_lock.invoke(cluster_lock.clj:65)
at metabase.app_db.cluster_lock$do_with_cluster_lock.invokeStatic(cluster_lock.clj:79)
at metabase.app_db.cluster_lock$do_with_cluster_lock.invoke(cluster_lock.clj:65)
at metabase.search.task.search_index$init_BANG_.invokeStatic(search_index.clj:36)
at metabase.search.task.search_index$init_BANG_.invoke(search_index.clj:32)
at clojure.lang.AFn.run(AFn.java:22)
at java.base/java.lang.Thread.run(Unknown Source)",
  "namespace": "hosting-eb9b3875e12d465a",
  "container": "metabase",
  "cluster": "metabase-1",
  "_p": "F"
}
```

The error message itself comes from a stackoverflow which perhaps does
not have a message? Either way, it's possible for this to be missing so
be a bit defensive

Co-authored-by: dpsutton <dan@dpsutton.com>
2026-01-23 23:59:12 +00:00
github-automation-metabase
b6bfc67f8a 🤖 backported "Tweak data loading behavior for a test after MySQL 9.6.0 release" (#68644)
Tweak data loading behavior for a test after MySQL 9.6.0 release (#68634)

Closes DEV-1289

### Description

Within the last day or two, `metabase.query-processor-test.remapping-test/self-referencing-test` began failing on MySQL Latest. I hypothesize this has to do with the [latest release](https://dev.mysql.com/doc/relnotes/mysql/9.6/en/news-9-6-0.html) fixing an unknown bug around batch inserts in InnoDB and the deprecation of a recusive [sic] fk-related flag.

The error is thrown not in the test conditions, but in the test setup -- MySQL apparently now checks foreign key constraints row-per-row even on a batch insert.

This adds a flag that the test can set which changes the test data-loading behavior to disable the FK check before insertion and re-enable it after.

Co-authored-by: Timothy S. Dean <timothy.dean@metabase.com>
2026-01-23 23:33:25 +00:00
github-automation-metabase
97636e8418 🤖 backported "If a dashboard is back to just one tab, auto-assign all cards to that tab" (#68637)
If a dashboard is back to just one tab, auto-assign all cards to that tab (#68201)

Co-authored-by: Nathan Voxland <nathan@metabase.com>
2026-01-23 21:00:22 +00:00
github-automation-metabase
d36ca222e3 🤖 backported "Bump toucan2 version to fix dashboards sometimes failing to load" (#68504)
Bump toucan2 version to fix dashboards sometimes failing to load (#68494)

If the first table mentioned by a dashboard has no fields (presumably because the table and its field are all
inactive), /api/dashboard/<id>/query_metadata would fail due to a toucan2 bug.  This bumps toucan2 to fix the bug and
adds a test to verify that this case now works.

Co-authored-by: William <william@metabase.com>
2026-01-21 22:20:00 +00:00
github-automation-metabase
e26512d0fe 🤖 backported "Fix flaky test that uses readonly db that lacks permissions" (#68513)
Fix flaky test that uses readonly db that lacks permissions (#68417)

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2026-01-21 21:30:22 +00:00
github-automation-metabase
f848c870cd 🤖 backported "Deduplicate field refs by ignoring :source-field-name unless it matters" (#68486)
Deduplicate field refs by ignoring `:source-field-name` unless it matters (#68166)

* Tentative fix for #67808 -- deduplicate by ignoring :source-field-name if possible

* Make sure `:fields` remains a vector

* Add note

* cljfmt

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2026-01-21 17:54:29 +00:00
github-automation-metabase
f021e1d2af 🤖 backported "Transforms job runs keep trying other transforms if one fails." (#68317)
Transforms job runs keep trying other transforms if one fails. (#68141)

Previously, when running a transform job (e.g., daily), it would fail if a single transform in the run failed. This PR makes it so that the job continues to run transforms that don't depend on any failed transform. As previously, if any transform in the run fails, the job is marked as failed.

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2026-01-21 11:07:41 -06:00
github-automation-metabase
0ee8c79be2 🤖 backported "Fix Horror Show fingerprint OOMs" (#68437)
Fix Horror Show fingerprint OOMs (#68391)

* Fix Horror Show fingerprint OOMs

This may likely fix many OOMs that others are seeing. Anyone with large
schema will likely benefit from this.

```clojure
(let [database (toucan2.core/select-one :model/Database :id 2)]
  (metabase.sync.analyze.fingerprint/fingerprint-fields-for-db!
    database (fn [s t] (println "synced " s "for " (:name t)))))
```

This is how we fingerprint fields. DB 2 here is "Horror Show", a
database with 200 tables, each of which has 900 fields in it. This
database has zero rows in it, it it just a large schema.

Syncing this recently has caused huge cpu spikes and then OOM errors
until the instance is killed.

Profiling locally with

```
MB_JETTY_PORT=3091 java "$(socket-repl 6091)" -Xmx2g -jar metabase.jar
```
and visual vm hooked up, I run

```clojure
(let [database (toucan2.core/select-one :model/Database :id 2)]
  (metabase.sync.analyze.fingerprint/fingerprint-fields-for-db!
    database (fn [s t] (println "synced " s "for " (:name t)))))
```

And observe this behavior:
The ram usage approaches the 2gb limit and then bounces there. The CPU
begins to spike erratically and spend 10% of its time in GC.

Taking a heap dump we can see that we have 2.8 million ResultSetMetaData
objects occuping 183 Mb.

The ResultSetMetaData are closed over and kept in the metadata of the
snake hating maps stored in the cached metadata provider.

This brings into stark relief one simple way to fix this: don't use a
caching metadata provider. This PR just raising the body of the
fingerprint-tables-for-db function to not include
`(qp.store/with-metadata-provider (u/the-id database)` . There is no
benefit to caching here as this is an enumeration of the database. It is
by design not meant to reuse anything. If we didn't OOM we would end up
with 200 tables and 200*900 = 180,000 fields in the cache, each of which
was accessed only once.

That is what this PR fixes.

I also followed one other thread: why are we holding so many
ResultSetMetaData objects in memory. This seems to come about from a
change in https://github.com/metabase/metabase/pull/62330 specifically
this line:
https://github.com/metabase/metabase/blob/master/src/metabase/lib_be/metadata/jvm.clj#L63

```clojure
(mu/defn instance->metadata
  "Convert a (presumably) Toucan 2 instance of an application database model with `snake_case` keys to a MLv2 style
  metadata instance with `:lib/type` and `kebab-case` keys."
  [instance      :- :map
   metadata-type :- :keyword]
  (let [normalize (if-let [schema (get metadata-type->schema metadata-type)]
                    (fn [instance]
                      (lib.normalize/normalize schema instance))
                    identity)]
    (-> instance
        (perf/update-keys memoized-kebab-key)
        (assoc :lib/type metadata-type)
        normalize
        u.snake-hating-map/snake-hating-map
        ;; the line below here captures the result coming back from
        ;; toucan and has a closure over
        ;; toucan2.jdbc.read/make-column-thunk which has a closure over
        ;; (.getMetaData rset)
        (vary-meta assoc :metabase/toucan-instance instance))))
```

As it stands without any changes, the instance gets quite unstable and
falls over. If you comment out the `var-meta` form above, the graph
returns to a very normal sawtooth graph of memory usage and
reclaimation. But central to this is that it does not need to retain any
of this memory at all. But without this metadata containing the instance
and db classes, we only cache the table and field data and the
fingerprinting can finish. When we cache this stuff and also
inadvertently keep these db classes, we quite quickly run out of
headroom and the instance becomes unstable and falls over.

* fix kondo lint (removes a legacy usage as well :) 💰

Co-authored-by: dpsutton <dan@dpsutton.com>
2026-01-21 16:29:48 +00:00
github-automation-metabase
ef060d829c 🤖 backported "Prevent exception in cleanup masking the original exception" (#68472)
Prevent exception in cleanup masking the original exception (#68371)

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2026-01-21 15:28:51 +00:00
github-automation-metabase
d4cafa2108 🤖 backported "Custom ref schema that reuses the cache" (#68458)
Custom ref schema that reuses the cache (#68379)

Add ref schema caching

Introduces a custom :ref IntoSchema that permits
reuse of Schema objects for references when safe to do so.

Early tests indicate a dramatic reduction in heap retention, after
loading a single dashboard, I see a 10x resident heap reduction from ~300MB to ~30MB.

It should also act as knot tie / runtime combinatorics limiter, so we should not see 'leaky' growth at runtime.

More work could be done as there are still _some_ gaps here.
- Bare pointers (keywords) can still lead to exponential allocation
- We do not cache when :documentation is present on the ref
  (as it would specialise the Schema object delivered for that specific reference)

Co-authored-by: Dan Stone <wotbrew@gmail.com>
2026-01-21 11:01:01 +00:00
Edward Paget
ca329483c0 Fix: Actions attached to models inside of Library(synced collection) break remote sync (#68252) (#68430)
Fixes #68215

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Code[bot] <noreply@anthropic.com>
Co-authored-by: Ed Paget <ed@metabse.coma>
2026-01-20 15:34:38 -08:00
github-automation-metabase
e948f51e30 🤖 backported: implicit join UNIX coercion fix (#67704) -&- implicit join breakout fix (#67480) (#68314)
Backport for both #67480 and #68164

Co-authored-by: Timothy Dean <timothy@timothydean.dev>
2026-01-19 10:32:50 -07:00
github-automation-metabase
215a22e578 🤖 backported "Report datetime insights even if columns is PK or FK" (#68359)
Report datetime insights even if columns is PK or FK (#67536)

Closes #35281

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2026-01-19 16:26:10 +00:00
github-automation-metabase
1b73e01f9f 🤖 backported "Use Soft/Weak references for malli cache entries" (#68340)
Use Soft/Weak references for malli cache entries (#68076)

Co-authored-by: Dan Stone <wotbrew@gmail.com>
2026-01-19 14:48:13 +00:00
github-automation-metabase
7b55c76cbe 🤖 backported "Fix flaky assertion for "sdk iframe embedding fires ready event after iframe is loaded"" (#68346)
Fix flaky assertion for "sdk iframe embedding fires ready event after iframe is loaded" (#68336)

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2026-01-19 13:00:34 +00:00
github-automation-metabase
eadec9c77f 🤖 backported "Fix filters not closing properly on native SQL questions" (#68258)
Fix filters not closing properly on native SQL questions (#68216)

Co-authored-by: kevinkelleher12 <kevin.kelleher@metabase.com>
2026-01-15 21:36:31 +00:00
github-automation-metabase
38338eb110 🤖 backported "Log error instead of warning if a subscription is not sent through the channel rather than a warning" (#68245)
Log error instead of warning if a subscription is not sent through the channel rather than a warning (#68214)

* Why is it a warning when it should be an error?

* Fix error logging format in notification worker

* Improve error logging in notification send process

Fix silly mistakes that I do when I'm sleepy

Co-authored-by: da <paoliniluis@gmail.com>
2026-01-15 17:14:17 +00:00
github-automation-metabase
2d4fdacba1 🤖 backported "Cleanup additional space to properly build Sample Apps" (#68233)
Cleanup additional space to properly build Sample Apps (#68229)

Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2026-01-15 13:54:23 +00:00
github-automation-metabase
0b4d45a57e 🤖 backported "Uxw 2596 color range on table crashes it if values span a large scale" (#68134)
Uxw 2596 color range on table crashes it if values span a large scale (#68022)

# Conflicts:
#	e2e/test/scenarios/models/models-list-view.cy.spec.js
#	jest.config.js
#	jest.tz.unit.conf.js
#	yarn.lock

Co-authored-by: Jakub Chodorowicz <jakub.chodorowicz@metabase.com>
2026-01-15 10:36:56 +01:00
github-automation-metabase
4fedb3dc8f 🤖 backported "Increase verbosity in the caching middleware" (#68206)
Increase verbosity in the caching middleware (#68121)

* Increase verbosity in the caching middleware

* Fix linter

* Make it simpler

* Broke so many tests

* Make the linter happy

* Fix tests (going back to old implementation)

Co-authored-by: da <paoliniluis@gmail.com>
2026-01-14 21:42:36 +00:00
github-automation-metabase
f1c4f2d07a 🤖 backported "Cache Main App/Embed JS fonts" (#68203)
Cache Main App/Embed JS fonts (#68120)

Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2026-01-14 20:30:37 +00:00
Alexander Polyankin
ac345f85ff Fix: Having : as a special character in the DB name breaks the UI for Clickhouse (#68013)
Fix: Having : as a special character in the DB name breaks the UI for Clickhouse (#68013)
2026-01-14 13:44:13 -05:00
github-automation-metabase
891a14357b 🤖 backported "UXW-2586: Acquire locks before changing data permissions" (#68074)
UXW-2586: Acquire locks before changing data permissions (#67201)

* Acquire locks before changing data permissions

Data permission have a read-modify-write cycle:

- we read the existing permissions to see what's currently set
- then we decide what to do (e.g. delete the existing DB level
  permissions to write a granular table-level permission)
- then we do the write

This has a race condition if multiple Metabase instances are modifying
permissions at the same time.

For example, say we have:

Initial state: `{:db_id 1 :table_id nil :perm_value :unrestricted}`

Instance A: set table 1 to :blocked
Instance B: set database to :blocked

T1: A reads state, sees db-level permission, plans to expand to table-level
T2: B reads state, sees db-level permission, plans to replace it
T3: A deletes db-level, inserts table-level rows for all tables
T4: B deletes db-level (no-op), inserts new db-level :blocked

Result (CORRUPT):
```
{:db_id 1 :table_id 1 :perm_value :blocked}      ;; from A
{:db_id 1 :table_id 2 :perm_value :unrestricted} ;; from A
{:db_id 1 :table_id nil :perm_value :blocked}    ;; from B
```

Both db-level AND table-level permissions now exist.

For the permissions API, we take a cluster lock, but sync operations
bypassed this cluster lock. This PR creates a lower-level cluster lock
per `[database, group, perm-type]` so only one instance/thread can do
the read/decide/write cycle for a particular db/group/perm at a time.

* Add a test for race conditions setting data perms

This took a while before I was able to track down the fact that using
`(mt/with-temp )` caused both threads to share the same connection, so
they could obtain the lock simultaneously 🤦

* Use a slightly coarser lock

I realized that if an instance has a huge number of groups, we'll obtain
a lock and ask Postgres to maintain an active savepoint for each group,
which might be untenable.

I think the best solution here is to use slightly coarser locks. This
might increase contention slightly, since we won't be able to change
permissions for `db 1, group 1, perm type view-data` at the same time
that we change permissions for `db 1, group 2, perm type view-data`. But
I think the tradeoff here is necessary.

Co-authored-by: John Swanson <john.swanson@metabase.com>
2026-01-14 07:14:49 -08:00
github-automation-metabase
ffca85b8bb 🤖 backported "Disable regex lookaheads/lookbehinds for Snowflake driver" (#68094)
Disable regex lookaheads/lookbehinds for Snowflake driver (#68084)

Co-authored-by: bryan <bryan.maass@gmail.com>
2026-01-13 18:13:09 +00:00
github-automation-metabase
f60f26b5f2 🤖 backported "If the entity id is unknown when calling the export API, throw an error" (#68099)
If the entity id is unknown when calling the export API, throw an error (#68040)

Co-authored-by: Nathan Voxland <nathan@metabase.com>
2026-01-13 00:00:01 +00:00
github-automation-metabase
efed959587 🤖 backported "fix: limit can_run_adhoc_query hydration" (#68033)
fix: limit can_run_adhoc_query hydration (#68028)

We can't hydrate unbounded collections of cards with the
can_run_adhoc_query hydration since it linearly adds db queries to the
request. Users with > 10000k can have severe CPU/memory issues
processing this.

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2026-01-12 15:46:19 -06:00
github-automation-metabase
692749b697 🤖 backported "UXW-64 Fix table cell formatting for temporal breakout by week" (#68089)
UXW-64 Fix table cell formatting for temporal breakout by week (#67477)

* UXW-64 Fix table cell formatting for temporal breakout by week

* Review fixes

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2026-01-12 21:37:56 +00:00
github-automation-metabase
06acac4e8c 🤖 backported "Fix funnel viz to handle increasing data" (#68082)
Fix funnel viz to handle increasing data (#68031)

Co-authored-by: kevinkelleher12 <kevin.kelleher@metabase.com>
2026-01-12 18:31:46 +00:00
github-automation-metabase
cee02f53bb 🤖 backported "fix(sdk): fix crashes on React 19 due to findDOMNode on Gauge and Modal" (#68059)
fix(sdk): fix crashes on React 19 due to findDOMNode on Gauge and Modal (#67953)

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2026-01-12 12:28:32 +00:00
github-automation-metabase
67a3c78675 🤖 backported "Avoid joins of remote_sync_object with actual tables" (#67655) 2026-01-09 12:12:58 -06:00
github-automation-metabase
b469b1271f perms for moving collections with archived kids (#67728) (#67987)
Previously if you had:

```
A (curate)
  B (curate)
    C (no permissions)
      D (curate)
```

Then if C was archived, you would be unable to move or archive A or
B.

Co-authored-by: John Swanson <john.swanson@metabase.com>
2026-01-09 16:51:33 +00:00
github-automation-metabase
72b5bf6305 Update llms.txt and llms-full.txt (release-x.57.x) (#67990)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <actions@github.com>
2026-01-09 15:51:45 +00:00
github-automation-metabase
b6ffcf55ef fix(embed-js, sdk): Properly handle restricted collection access in MetabaseBrowser (#67907)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2026-01-08 18:54:42 +04:00
github-automation-metabase
0c78cc4bd5 Fix flaky "shows a static dashboard using drills" e2e (#67874) (#67911)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2026-01-08 13:58:49 +00:00
Nicolò Pretto
67d1219642 chore(sdk): checklist steps for 58 release on the release 57 branch (#67861)
* chore(sdk): checklist steps for 58 release on the release 57 branch

* remove unused input

* fix typo

* remove from summary too
2026-01-08 14:10:48 +01:00
github-automation-metabase
b7b3ca2932 chore(sdk): move setting cypress baseUrl to global beforeEach for sdk tests (#66308) (#67547)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2026-01-07 12:47:31 +01:00
github-automation-metabase
8086f8ccbb Fix pie chart label not visible on dark theme (#67639) (#67791)
* Fix `text-secondary` not working on dark theme on charts

* Support all colors so it's easier to reason about

* Add tests

* Fix type error

* Revert part of the code that's not used anymore

* Add test snapshots

* Make overriding font more consistency across environments

e.g. From storybook to SDK to the main app.

* Fix formatting

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2026-01-07 02:40:45 +00:00
github-automation-metabase
fe1094c76d Add a tooltip message if model persistence is unsupported for a database (#67566) (#67828)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2026-01-06 21:39:25 +00:00
github-automation-metabase
3a3440afbc 🤖 backported "[Metabot] Metabot error boundary" (#67803)
* [Metabot] Metabot error boundary (#67749)

* fix icon sizing issue

---------

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
2026-01-06 14:46:56 -06:00
github-automation-metabase
8208922941 Fix MB in an iframe running on a subpath (#67724) (#67788)
* fix MB in an iframe running on a subpath

* fix

* extracted out the util fn and added unit tests for it

* addressed comments

* fixed unit tests

Co-authored-by: Sébastien <sebastien@metabase.com>
2026-01-06 16:34:58 +01:00
github-automation-metabase
cfaa19f095 backported "fix(embed-js, sdk): Don't close InteractiveQuestion editor on Filters change"
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2026-01-06 13:07:11 +04:00
github-automation-metabase
2b7598d459 Fix parsing of :ERROR chunks in metabase-enterprise.metabot-v3.util/aisdk->messages (#67674) (#67758)
* Fix parsing of :ERROR chunks in metabase-enterprise.metabot-v3.util/aisdk->messages

There was a typo in the case expr where :ERROR chunks were being handled like :DATA chunks, but in fact should be
handled like :TEXT chunks. This was resulting in an error like

    1. Unhandled java.lang.ClassCastException
       class java.lang.String cannot be cast to class
       clojure.lang.Associative (java.lang.String is in module java.base
       of loader 'bootstrap'; clojure.lang.Associative is in unnamed
       module of loader 'app')
                       RT.java:  847  clojure.lang.RT/assoc
                      core.clj:  193  clojure.core/assoc
                      core.clj:  192  clojure.core/assoc
                      util.clj:   56  metabase-enterprise.metabot-v3.util/aisdk->messages/fn/fn
                      ...

whenever an :ERROR chunk was encountered as we tried to ASSOC a string where we were expecting a map.

https://v4.ai-sdk.dev/docs/ai-sdk-ui/stream-protocol#text-part
https://v4.ai-sdk.dev/docs/ai-sdk-ui/stream-protocol#error-part

059d904d6e/ai_service/ai_sdk.py (L50)
059d904d6e/ai_service/ai_sdk.py (L203)
059d904d6e/ai_service/ai_sdk.py (L324)

* Add some error chunk parsing tests to aisdk-line-parse-test

* Mark aisdk-line-parse-test as ^:parallel

This does io to read some files, but should be threadsafe as no other tests read or modify those files.

* Add make-mock-error-stream-response test util

And rename make-mock-stream-response to make-mock-text-stream-response

* Add client-error-test to test streaming-request with error chunks in response

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2026-01-06 00:40:24 +00:00
github-automation-metabase
aa79ea6c20 Patch malli to avoid OOM related to recursive memoization (#67733) (#67743)
This is a temporary fix until https://github.com/metosin/malli/pull/1250 gets merged into Malli.
2026-01-06 00:42:30 +03:00
github-automation-metabase
6f267eb753 Handle unroutable token checks (#67698) (#67735)
We have a grace periods and circuit breakers for token checks. But one
issue is that if the token check doesn't throw an error we can't catch
it.

An easy way to see this is to use a local network address that won't
respond like 192.168.random.random (i used 192.168.40.40) then see the
behavior. Without the timeouts, the threads all just get stuck here and
the page never loads. With timeouts, you'll see a few stutters until the
circuit breaker steps in, at which point you have a non-enterprise
version.

https://www.loom.com/share/6ae056dc126b48c9abe8a7ad9366fd05

Co-authored-by: dpsutton <dan@dpsutton.com>
2026-01-05 21:41:37 +00:00
github-automation-metabase
9353943af9 [Metabot] Update Metabot icon (#67741) (#67751)
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2026-01-05 19:59:20 +00:00
github-automation-metabase
11a1620ad6 Clarify permissions model for suggested prompts generation (#67656) (#67740)
* Run suggested prompts generator as admin & fix test

* Add a prompt suggestions GET perms test

* small cleanups

* use mbql5

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2026-01-05 19:51:07 +00:00
github-automation-metabase
736177bb59 Measure all columns to provide expand option (#67429) (#67509)
Co-authored-by: Fraser <fraser@metabase.com>
2026-01-05 23:22:27 +13:00
github-automation-metabase
62b0bcc458 Improve formatting and clarity in serialization.md (#67587) (#67690)
Updated curl command formatting and clarified instructions for exporting and importing Metabase data.

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2026-01-02 15:44:38 +00:00
github-automation-metabase
4b6908ba18 Extra remapped fields (#67601) (#67664)
* kick ci

* Disable remaps when calculating columns for a query.

* Add tests for result_metadata remappings

* Add comments

* Whitespace

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-12-31 20:25:53 +00:00
github-automation-metabase
fee4df8a63 [dashboards] Handle parallel FKs with dashboard filter values (#66287) (#67662)
Fixes #65838.

This issue was about dashboard filters showing the wrong value when
the filter was bound to an FK field from a table with multiple FKs to
the same foreign table. The dashboard parameters logic on the BE was
choosing which FK to use for the filter values arbitrarily, meaning that
binding the filter to one of them would work fine, but the other would
give incoherent results.

The fix is to be deliberate about selecting the parameter's column. That
doesn't solve all ambiguous cases, but we really can't help if there's
a multi-hop join that has parallel edges in the middle!

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-12-31 17:35:26 +00:00
github-automation-metabase
f2746fe3c9 Hopeful fix for the ooms that betterment is running into. (#67482) (#67589)
* Hopeful fix for the ooms that betterment is running into.

Note that this will only work once macaw is updated and metabase is using the new version of macaw.  Until that
happens, this change is a noop.

* bump macaw for context stripping

https://github.com/metabase/macaw/pull/123

here's the gist:

```clojure
core-test=> (let [base {:select [:a :b :c]
                        :from   [:foo]
                        :where  [:= :foo.a [:inline "baz"]]}]
              (-> {:union-all (for [_ (range 3)]
                                base)}
                  sql/format
                  first
                  (components {:strip-contexts? true})
                  :columns
                  ))
                  ;; replacing #{} with <set> so git doens't comment it out
<set>{{:component {:table "foo", :column "a"}}
  {:component {:table "foo", :column "b"}}
  {:component {:table "foo", :column "c"}}}
core-test=> (let [base {:select [:a :b :c]
                        :from   [:foo]
                        :where  [:= :foo.a [:inline "baz"]]}]
              (-> {:union-all (for [_ (range 3)]
                                base)}
                  sql/format
                  first
                  (components )
                  :columns
                  ))
                  ;; replacing #{} with <set> so git doesn't comment it out
 <set>{{:component {:table "foo", :column "b"},
   :context
   (#object[com.metabase.macaw.AstWalker$ScopeInstance 0x6343d805 "com.metabase.macaw.AstWalker$ScopeInstance@6343d805"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x761965fc "com.metabase.macaw.AstWalker$ScopeInstance@761965fc"])}
  {:component {:table "foo", :column "a"},
   :context
   (#object[com.metabase.macaw.AstWalker$ScopeInstance 0x6343d805 "com.metabase.macaw.AstWalker$ScopeInstance@6343d805"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x761965fc "com.metabase.macaw.AstWalker$ScopeInstance@761965fc"])}
  {:component {:table "foo", :column "a"},
   :context
   (#object[com.metabase.macaw.AstWalker$ScopeInstance 0x761965fc "com.metabase.macaw.AstWalker$ScopeInstance@761965fc"])}
  {:component {:table "foo", :column "a"},
   :context
   (#object[com.metabase.macaw.AstWalker$ScopeInstance 0x4de719cd "com.metabase.macaw.AstWalker$ScopeInstance@4de719cd"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x76f86e4f "com.metabase.macaw.AstWalker$ScopeInstance@76f86e4f"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x6343d805 "com.metabase.macaw.AstWalker$ScopeInstance@6343d805"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x761965fc "com.metabase.macaw.AstWalker$ScopeInstance@761965fc"])}
  {:component {:table "foo", :column "c"},
   :context
   (#object[com.metabase.macaw.AstWalker$ScopeInstance 0x6343d805 "com.metabase.macaw.AstWalker$ScopeInstance@6343d805"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x761965fc "com.metabase.macaw.AstWalker$ScopeInstance@761965fc"])}
  {:component {:table "foo", :column "b"},
   :context
   (#object[com.metabase.macaw.AstWalker$ScopeInstance 0x1241e96a "com.metabase.macaw.AstWalker$ScopeInstance@1241e96a"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x6343d805 "com.metabase.macaw.AstWalker$ScopeInstance@6343d805"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x761965fc "com.metabase.macaw.AstWalker$ScopeInstance@761965fc"])}
  {:component {:table "foo", :column "a"},
   :context
   (#object[com.metabase.macaw.AstWalker$ScopeInstance 0x542edf1d "com.metabase.macaw.AstWalker$ScopeInstance@542edf1d"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x2e474cfd "com.metabase.macaw.AstWalker$ScopeInstance@2e474cfd"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x761965fc "com.metabase.macaw.AstWalker$ScopeInstance@761965fc"])}
  {:component {:table "foo", :column "b"},
   :context
   (#object[com.metabase.macaw.AstWalker$ScopeInstance 0x761965fc "com.metabase.macaw.AstWalker$ScopeInstance@761965fc"])}
  {:component {:table "foo", :column "a"},
   :context
   (#object[com.metabase.macaw.AstWalker$ScopeInstance 0x459ed576 "com.metabase.macaw.AstWalker$ScopeInstance@459ed576"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x38a0b358 "com.metabase.macaw.AstWalker$ScopeInstance@38a0b358"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x1241e96a "com.metabase.macaw.AstWalker$ScopeInstance@1241e96a"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x6343d805 "com.metabase.macaw.AstWalker$ScopeInstance@6343d805"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x761965fc "com.metabase.macaw.AstWalker$ScopeInstance@761965fc"])}
  {:component {:table "foo", :column "c"},
   :context
   (#object[com.metabase.macaw.AstWalker$ScopeInstance 0x761965fc "com.metabase.macaw.AstWalker$ScopeInstance@761965fc"])}
  {:component {:table "foo", :column "a"},
   :context
   (#object[com.metabase.macaw.AstWalker$ScopeInstance 0x1241e96a "com.metabase.macaw.AstWalker$ScopeInstance@1241e96a"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x6343d805 "com.metabase.macaw.AstWalker$ScopeInstance@6343d805"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x761965fc "com.metabase.macaw.AstWalker$ScopeInstance@761965fc"])}
  {:component {:table "foo", :column "c"},
   :context
   (#object[com.metabase.macaw.AstWalker$ScopeInstance 0x1241e96a "com.metabase.macaw.AstWalker$ScopeInstance@1241e96a"]
    #object[com.metabase.m
acaw.AstWalker$ScopeInstance 0x6343d805 "com.metabase.macaw.AstWalker$ScopeInstance@6343d805"]
    #object[com.metabase.macaw.AstWalker$ScopeInstance 0x761965fc
    "com.metabase.macaw.AstWalker$ScopeInstance@761965fc"])}}
```

---------

Co-authored-by: William <william@metabase.com>
Co-authored-by: dan sutton <dan@dpsutton.com>
2025-12-30 15:04:13 -06:00
github-automation-metabase
0489d1d332 bumping deps: (#67638) (#67644)
- https://github.com/metabase/metabase/security/code-scanning/543
  about snowflake's of grpc netty shaded. We already have this
  version elsewhere so now it matches
- https://github.com/metabase/metabase/security/code-scanning/549
  and https://github.com/metabase/metabase/security/code-scanning/557
  issue in databricks. We bumped that and now it uses the new coordinate
  `at.yawk.lz4/lz4-java 1.10.1`
- https://github.com/metabase/metabase/security/code-scanning/496 bump commons-lang3.
  actually just exclude it from the driver jar so it will be found on parent
  classpath with coordinate from deps.edn: `{:mvn/version "3.19.0"}`

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-12-30 11:53:05 -06:00
github-automation-metabase
a20a359982 bump log4j (#67393) (#67641)
* bump log4j

* bump snowflake in hope of clearing advisory

https://github.com/metabase/metabase/security/code-scanning/543

> This file introduces a vulnerable io.grpc:grpc-netty-shaded package
> with a high severity vulnerability.

* bump netty shaded

https://github.com/metabase/metabase/security/code-scanning/543

* bump aws s3 for io.netty:netty-codec-http2

https://github.com/metabase/metabase/security/code-scanning/536

before bump:
    . io.netty/netty-codec-http2 4.1.126.Final

after dump:
❯ clj -X:deps tree :extra '{:deps {software.amazon.awssdk/s3 {:mvn/version "2.40.13"}}}' | grep http2
    . io.netty/netty-codec-http2 4.1.130.Final

* bump netty-codec-http

from software.amazon.awssdk/s3

before:
    . io.netty/netty-codec-http 4.1.126.Final

https://github.com/metabase/metabase/security/code-scanning/534

* bump athena to 3.7.0

ran workflow at
https://github.com/metabase/metabase/actions/runs/20439789522/job/58729767910

https://github.com/metabase/metabase/actions/workflows/athena.yml to
publish the 3.7.0 version

* include driver change to force running drivers

* sort deps edn

* attempt to solve l4z issues

weirdness is that this version might move some stuff? we'll see if it
works.

* Revert "attempt to solve l4z issues"

This reverts commit 03d845eeea.

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-12-30 11:33:44 -06:00
github-automation-metabase
d4fcaabb1e Normalize aggregation references, sort maps and remove all uuids (#67521) (#67611)
* Normalize aggregation references, sort maps and remove all uuids

Fixes QUE-2916

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-12-30 11:00:02 -05:00
github-automation-metabase
dd0eef05c7 Fix empty cards with no results making dashboard longer than expected (#67581) (#67633)
* Prevent unnecessary height calculation

* Prioritize local layout from `react-grid-layout` for height calculation

* Refix the issue for real

* Add tests

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-12-30 13:21:15 +00:00
github-automation-metabase
b3ddf95055 fix: hide editing toggle for unsupported engines (#67564) (#67629)
* fix: hide untested and unsupported db engines in table editing section

* move allowed engines to constants file

* test: add hidden editing toggle test case

Co-authored-by: Jakub Chodorowicz <jakub.chodorowicz@metabase.com>
2025-12-30 11:19:08 +00:00
github-automation-metabase
190ce77239 Update generated docs (release-x.57.x) (#67621)
Co-authored-by: github-actions <github-actions@github.com>
2025-12-30 00:05:26 -05:00
github-automation-metabase
b2527d01ca Re-introduce: Upload failed e2e test artifacts for quarantined tests (#67600) (#67607)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-12-29 21:39:51 +00:00
github-automation-metabase
2166857f8d Fix model metadata e2e flake (#67522) (#67597)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-12-29 18:52:31 +00:00
github-automation-metabase
479fe86c3f Fix object detail flake #39477 (#67442) (#67596)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-12-29 18:47:23 +00:00
github-automation-metabase
1e04c9106b Default to base-type when it differs from effective type (#67486) (#67591)
* Default to base-type when it differs from effective type

* Make 'er parallel

* Does this clause make it better?

* Remove parallel.

* New test and fix for two literals

* Use y-type for effective type

* Update test to try number

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-12-29 18:26:42 +00:00
github-automation-metabase
bda89fc3c1 Disable nonworking email and URL extractions for BigQuery and 7 other broken drivers (#66982) (#67472)
* Add failing test for #63822, DEV-1190

* Add new feature flag

* Update FE config

* Fix tests 🔧

* Disable for 7 more drivers

* Fix MySQL + MariaDB

* Fix TypeScript

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-12-29 10:23:21 -08:00
github-automation-metabase
0688646ae1 fix: custom home page settings are not being exported (#67550) (#67579)
* fix: custom home page settings are not being exported

* fix: update seralization baseline test

Co-authored-by: Jakub Chodorowicz <jakub.chodorowicz@metabase.com>
2025-12-29 10:02:17 +00:00
github-automation-metabase
bffaefa18c Prevent black background loaded with light full-app embedding (#67544) (#67553)
* Prevent black background loaded with light full-app embedding

* Fix tests

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-12-26 13:53:23 +00:00
github-automation-metabase
f03c1a9dea note on SQL download perms (#67464) (#67558)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-12-26 13:06:12 +00:00
github-automation-metabase
513dd9ec43 fix(sdk-package, sdk-bundle, embed-js): Don't expose question in SDK's entityTypes (#67534) (#67543)
* Don't expose `question` in SDK's `entityTypes`

Because it's only applicable to staged picker

* Fix type

* Clarify the use of `question` in SDK's `entityTypes`

* Fix SDK not building

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-12-26 11:00:46 +00:00
github-automation-metabase
13aff097b0 Use actual metadata in a Notebook in Embedding SDK/Embed JS (#67453) (#67532)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-12-25 12:07:32 +00:00
github-automation-metabase
cb53bf6447 fix: add filter clauses to support min max required for age binning (#67448) (#67529)
Co-authored-by: Jakub Chodorowicz <jakub.chodorowicz@metabase.com>
2025-12-25 11:19:14 +00:00
github-automation-metabase
ed2066d458 Apply field settings to parameter field widget (#67428) (#67498)
Co-authored-by: Fraser <fraser@metabase.com>
2025-12-25 07:42:18 +00:00
github-automation-metabase
90d36153b7 Custom headers (#67502) (#67515)
* added vars
* added tests

Co-authored-by: Roman Abdulmanov <roman@metabase.com>
2025-12-24 15:05:34 +00:00
github-automation-metabase
5d27dfdd11 fix: respect time format in exclude date picker filter QUE-2611 (#67384) (#67505)
* fix: respect time format in exlude date picker filter QUE-2611

* rework: move constant out of function body

* test: fix failing tests due to lack of redux provider

* fix: add missing redux  provider in story

* test: improve testing logic for ExcludeDatePicker

* internal: use specialized useSetting hook

* test: adjust looping with async action

Co-authored-by: Jakub Chodorowicz <jakub.chodorowicz@metabase.com>
2025-12-24 10:14:21 +00:00
github-automation-metabase
338e01e925 Check that the number was parsed correctly (#67403) (#67459)
* Check that the number was parsed correctly

* Don't parse int columns that are remapped

* oops, remove old change

* Better fix and specific test

* kick ci

* kick ci

* Make sure it still hits the bigint branch

* Move check into parseNumber()

* Move check back to value.tsx

* Single describe in tests

* Add blank lines (fe-lint)

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-12-23 17:00:28 +00:00
metamben
bee49a0766 Add debug logging to the OOM path (#67455) 2025-12-23 16:28:55 +00:00
github-automation-metabase
2467fae4bb Docs: Metabot inline SQL editing (#67362) (#67434)
* Docs: inline SQL editing

* Optimized 1 images, saved 35.9 KB (13.6% smaller)

* typos

* Update docs/ai/metabot.md



* Update docs/ai/metabot.md



* Update docs/ai/metabot.md



* small edit

---------

Co-authored-by: Abed Habli <154609371+abdhabli@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-12-23 09:16:52 +00:00
github-automation-metabase
d8ca7ad088 Fix adding two DIFFERENT implicit joins with the SAME generated alias (#67411) (#67423)
* Fix adding two DIFFERENT implicit joins with the same generated alias

* Part 2 of #67411 fix

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-12-23 02:41:43 +00:00
github-automation-metabase
a390d266af Allow temporal args for - (#67397) (#67406)
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-12-23 00:28:55 +00:00
github-automation-metabase
31f72b07a4 [Metabot] Natural language query entry point (#66737) (#67383)
* prototype

* open chat sidebar on navigate

* update copy for new route

* use nlq profile and make sticky, redirect to empty query builder if no navigate_to is recieved

* responsiveness

* move code to enterprise folder

* imple error states, better loading state

* handle user leaving the page while a response is being loaded

* lint fix, change inline sql shortcut key, disable prompt suggestions and fade out once a prompt has been sent

* fix e2e test

* add test coverage, update copy

* fix failing e2e tests

* attempt to fix e2e flake

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-12-22 17:48:12 -06:00
github-automation-metabase
c571d7d128 🤖 backported "fix: improve search performance with tables" (#67108)
* fix: improve search performance with tables (#67055)

* fixup! delete extra specs

---------

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Edward Paget <ed.paget@gmail.com>
2025-12-22 14:37:18 -08:00
github-automation-metabase
e5d179f379 Log each entity as it gets dependency-backfilled at debug level (#67378) (#67398)
Log each entity (card) as its dependencies get backfilled by the job. This is to be able to see if there is a particular entity that's causing the OOM.

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-12-22 21:54:14 +00:00
github-automation-metabase
0c6e3db6fd Update generated docs (release-x.57.x) (#67353)
Co-authored-by: github-actions <github-actions@github.com>
2025-12-22 12:41:19 -05:00
github-automation-metabase
4bbe7e98f1 Allow arbitrary expressions inside :is-null and :not-null in MBQL 4 schema (#67326) (#67348)
* Support arbitrary expressions inside `:is-null` and `:not-null`

* Remove unnecessary blank line in schema_test.cljc

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-12-21 23:13:22 +00:00
github-automation-metabase
89bced14da Allow :aggregation refs inside (aggregation) expressions in MBQL 4 schema (#67311) (#67343)
* Allow :aggregation refs inside expressions in MBQL 4 schema

* Test + Kondo fix

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-12-21 14:11:55 -08:00
github-automation-metabase
1857a7ac26 Use snake_case for MetabotCodeEdit and MetabotCodeEditorBufferContext fields (#67231) (#67335)
For consistency with other types shared between metabase and ai-service.

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-12-20 00:48:29 +00:00
github-automation-metabase
c1652979f7 [Metabot] Inline SQL entry point (#66688) (#67329)
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-12-19 18:17:58 -06:00
github-automation-metabase
b956d92a1a MBQL 4 => MBQL 5 conversion should ignore invalid expressions (#67305) (#67324)
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-12-20 00:06:35 +00:00
github-automation-metabase
18144d4d3c [Metabot] Multi-convo support (#66864) (#67313)
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-12-19 17:12:35 -06:00
github-automation-metabase
481847ed1d Fix trend lines when aggregating by datetime (#65873) (#67299)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-12-19 21:03:03 +00:00
github-automation-metabase
8efc7029f9 Add mbql time schema test (#67182) (#67206)
* Add test

* Move test to temporal-test

* Openapi json

* Add second time string

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-12-19 17:30:07 +00:00
github-automation-metabase
1054d88ef2 Resolved conflicts (#67176)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-12-19 11:10:09 -06:00
github-automation-metabase
ecec82ba43 Don't do implicit joins through sensitive FKs (#67056) (#67193)
* WIP

* Working test! (it reproduces)

* Fhew! I found it!

* Remove printlns

* Also remove sensitive fks in calculation

* Remove stray marker comment

* Move tests to fields-test

* Exclude :retired too

* Move tests and add one for retired

* Add another retired

* Better tests

* Appease the kondo

* Fix broken test

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-12-19 16:22:30 +00:00
github-automation-metabase
9a7a8ad739 Cleanup docker build caches when building sample apps on CI (#67268) (#67286)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-12-19 16:20:33 +00:00
github-automation-metabase
b7e9d0aad9 Several MBQL 4 normalization fixes 🔧 (#67203) (#67233)
* Fix normalization of MBQL 4 `:aggregation-options` with a `nil` options map

* Update tests

* Fix normalization of Template Tag :options

* Allow raw values as expression definitions

* Automatically remove :ident from joins

* Properly handle aggregations expressions that contain `:if` (alias for `:case`)

* Allow `:coalesce`, `:if`, and `:case` as datetime exprs in MBQL 4

* Test & Kondo fixes 🔧

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-12-18 18:06:23 -08:00
github-automation-metabase
8fb3ddd4b6 Fix grammar of billing period for Metabase AI (#67191) (#67217)
Fixes: 2b76c38e1f
Closes: https://github.com/metabase/metabase/pull/67053#issuecomment-3671353062

Co-authored-by: Dennis Schridde <63082+devurandom@users.noreply.github.com>
2025-12-18 22:02:32 +00:00
github-automation-metabase
0e7e4a5319 Remove models and metrics section from settings (#67174) (#67198)
Removed section on adding models and metrics to Metabot collection.

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-12-18 18:56:53 +00:00
github-automation-metabase
fd6a2deadf Change Metabase AI price to be based on quantity for whole billing period (#67053) (#67187)
### Description

We want to communicate per-billing-period quantities with customer, instead of always communicate monthly quantities.  Invoiced totals will stay the same.

### How to verify

Describe the steps to verify that the changes are working as expected.

1. Ensure you have a token with the `offer-metabase-ai-tiered` feature, but without the `metabot-v3` feature.
2. Navigate to `/admin/metabot` and see the quantities as per billing period, and not per month.

### Checklist

- [x] Tests have been added/updated to cover changes in this PR

Fixes: 2b76c38e1f
Closes: https://metaboat.slack.com/archives/C07RMUQ0GE5/p1765907134400039

Co-authored-by: Dennis Schridde <63082+devurandom@users.noreply.github.com>
2025-12-18 13:13:15 -05:00
github-automation-metabase
6cdc5d5768 Update generated docs (release-x.57.x) (#67144)
Co-authored-by: github-actions <github-actions@github.com>
2025-12-18 02:45:15 +00:00
github-automation-metabase
5f4b2b02b2 collection-id only works with shallow=true (#64476) (#66971)
Document that we only use `collection-id` when `shallow=true`.

Co-authored-by: John Swanson <john.d.swanson@gmail.com>
2025-12-17 16:48:17 -08:00
github-automation-metabase
e8409d133d 🤖 backported "UXW-2451 Fix opposite light/dark mode colors leaking when table is present" (#67101)
* UXW-2451 Fix opposite light/dark mode colors leaking when table is present (#67017)

* WIP UXW-2451 Fixes issue where changing light/dark mode messes up color variables by removing nested providers in useBodyCellMeasure which probably breaks other things

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>

* Update Loki Snapshots

---------

Co-authored-by: Brad Anderson <brad@metabase.com>
2025-12-17 15:05:14 -05:00
github-automation-metabase
8121fba901 Manage Table Metadata permission is enough to sync table schema (#65866) (#67045) 2025-12-17 13:22:39 -06:00
github-automation-metabase
a2a85750cc [o11y] Log + metrics for lib.convert/clean making material changes (#67094) (#67098)
This generally indicates an MBQL 4 -> 5 conversion issue, and we need
the signal in the 57 rollout.

Also improves the detail of the logging for when `:dataset_query {}`.

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-12-17 17:47:56 +00:00
github-automation-metabase
26b3151114 docs - australia (#67039) (#67092)
* Add Australia (Sydney) to available regions

Added Australia (Sydney) to the list of regions.

* Add Asia Pacific (Sydney) IP addresses to whitelist

Added IP addresses for the Asia Pacific (Sydney) region.

* Reorder South America IP addresses section

* Update cloud region list in change-region.md

Removed duplicate entry for Australia (Sydney) and updated Asia Pacific region.

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-12-17 15:05:59 +00:00
github-automation-metabase
5a45101c85 Revert "Quick ci test disabling (#63030)" (#66912) (#66950)
This reverts commit 9191713854.

used to do this in-house but now we use trunk for this. Old way has
ultimate flexibility. But trunk has some really nice workflows built
in (reporting, creating issues in linear, etc).

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-12-17 14:27:06 +00:00
github-automation-metabase
ef249e1602 fix: card serdes/descendants misses metrics (#67029) (#67062)
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-12-17 03:29:26 +00:00
github-automation-metabase
5eaae2e96b Skip fields with inactive table. (#66967) (#67018)
* Skip fields with inactive table.

* Remove redundant let

* Better fix.

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-12-16 17:18:26 -05:00
github-automation-metabase
ff735a653e Fix bad normalization for the :text function in MBQL 4 (#67031) (#67038)
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-12-16 14:20:02 -05:00
github-automation-metabase
d7c4d26075 Update generated docs (release-x.57.x) (#66996)
Co-authored-by: github-actions <github-actions@github.com>
2025-12-16 10:30:52 -05:00
github-automation-metabase
8a2b64e372 Output container logs for Sample App CI (#67003) (#67016)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-12-16 14:55:09 +00:00
github-automation-metabase
727272c22e Fix clickhouse uuid filtering (#66852) (#66882)
* fix uuid filtering

* rewrite tests to be more structured

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-12-16 14:54:29 +00:00
github-automation-metabase
a16c977d15 Trust the model's FK semantic type even for MBQL models (#66788) (#66849)
* Trust the model's FK semantic type even for MBQL models

Fixes #48427

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-12-16 14:34:57 +00:00
github-automation-metabase
cc3ffc95b9 No 500 on deactivating user (#66621) (#66850)
Fixes https://github.com/metabase/metabase/issues/66599

Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-12-16 14:09:49 +00:00
github-automation-metabase
698826e9c8 Don't offer drill-throughs when top-level column doesn't exist (#66907) (#66987)
The summary: we are offering drill-throughs on custom columns defined after aggregation, but those custom columns don't exist in the base query. The error presented in such a way that `lib.underlying/top-level-column` for a dimension was returning `nil`, and we were happily putting that `nil` into the query we constructed.

I created a utility to filter dimensions by whether or not the top-level-column can be resolved, and used this for the underlying-records drill-through (from the original issue) as well as the pivot drill-through (which behaved similarly). If no dimensions have a top-level column, the drill-through is not available. If some do, we offer the partial drill-through.

Co-authored-by: Timothy S. Dean <timothy.dean@metabase.com>
2025-12-16 00:12:47 +00:00
github-automation-metabase
91395e614d metadata.cljs: always prefer lib/source over source (#66858) (#66980)
`source` is a legacy key on the frontend that gets translated to `lib/source`. Some maps are using both `source` and `lib/source`, and the translation layer translates keys and values in completely separate steps. When the time comes to translate the legacy value of `source` into a valid value for `lib/source`, the code can't tell what the key was originally named. So already-valid values were going through the translation process, producing invalid values (e.g., `:source/source/aggregations`).

This adds a step to object parsing to detect that both keys are present; when they are, it sets an option to simply skip `source` during the parsing; secondly, it adds a step in the value parsing to check whether the value is already a keyword namespaced by `source/`.

Co-authored-by: Timothy S. Dean <timothy.dean@metabase.com>
2025-12-15 23:15:16 +00:00
github-automation-metabase
2af7273bd0 Normalize invalid :widget-types correctly (#66965) (#66975)
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-12-15 22:35:15 +00:00
github-automation-metabase
07f973850b remove orphan package.json (#66974) (#66979)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-12-15 22:24:44 +00:00
github-automation-metabase
47e2168aef Fix mongo native preview of queries with variables (#66959) (#66973)
* decode strings before formatting

* require lib.metadata

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-12-15 22:12:22 +00:00
github-automation-metabase
cb806c70e9 [perf] Fix a sneaky infinite loop in a prod-only error case (#66955) (#66962)
`util.perf/mapv` checks the `count` of all its collection args, so it's
not safe to call with an infinite `seq`.

`lib.metadata.result-metadata/merge-cols` was doing exactly that in the
case where there was a mismatch between the column counts from lib and
driver. It was passing `(concat short-list (repeat nil))` to `mapv` and
causing an infinite loop!

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-12-15 20:02:49 +00:00
Edward Paget
155cfbbf49 feat: support remote-syncs from 58 -> 57 (#66895) 2025-12-15 13:32:40 -06:00
github-automation-metabase
fc746f38d7 Restore theme preference after login (#66892) (#66956)
* fix: restore theme preference after login

* test: add theme restoring e2e sequence

* test: perform manual sign-in for better reproduction

* docs: explain new `useEffect` call on `ColorSchemeProvider.tsx`

* fix: experimentally replace colorscheme change listening method

Co-authored-by: Gabriel Moreno <gabriel@metabase.com>
2025-12-15 19:10:51 +00:00
github-automation-metabase
167bba3276 Support relative-datetime in legacy mbql (#66214) (#66818)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-12-15 17:57:37 +00:00
github-automation-metabase
01e29d4be8 Update generated docs (release-x.57.x) (#66924)
Co-authored-by: github-actions <github-actions@github.com>
2025-12-15 11:46:27 -05:00
github-automation-metabase
65bc5117c8 [o11y] Add a new metric to count unique cards with blank queries (#66903) (#66951)
Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-12-15 11:30:42 -05:00
github-automation-metabase
e2364db1be add input for the logs-artifact-suffix (#66738) (#66747)
also fix where the name comes from on the mysql job (it uses version not
job)

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-12-15 10:08:54 -06:00
github-automation-metabase
f0885f1c21 Trying to fix the infamous app palette loki flaky (#66935) (#66946)
* Trying to fix the infamous app palette loki flaky

* .

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-12-15 14:58:26 +00:00
Nicolò Pretto
fbfa02eed0 EMB-1129 on release 57 (#66889) 2025-12-15 10:05:53 +00:00
github-automation-metabase
e259ffed11 UXW-2484 fix chart tooltip color (#66855) (#66901)
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-12-12 21:24:08 +00:00
github-automation-metabase
07f85e3b98 [perf] Add metric for lib.computed/weak-map size; speculative fixes (#66404) (#66883)
OOMs in cloud are linked to this weak map retaining too much. The
exported heap dump reports are suggestive but not conclusive, and I
can't reproduce locally.

Adds `:metabase-query-processor/computed-weak-map-queries` to measure
the size of the weak map. That should sawtooth with GCs as it
accumulates queries and then discards them, but we'll see if it rises
forever on the problem instances.

This also adjusts the caching for a `MetadataProvider`-level entity
(`:metadata/card`) from the weak map to the `MetadataProvider`'s
internal cache. That's speculative, since there's no evidence to link
it to the issue, but it should be at least as effective a cache and
there's less risk of accidentally retaining too much.

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-12-12 19:08:53 +00:00
github-automation-metabase
dc421b317c 🤖 backported "fix: apply deep serialization sort for remote-sync" (#66879)
* fix: apply deep serialization sort for remote-sync (#66846)

* fixup! remove snapshot call

---------

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Edward Paget <ed.paget@gmail.com>
2025-12-12 16:59:14 +00:00
github-automation-metabase
b214449583 [retry] Rewrite metabase.util.retry to use diehard instead of resilience4j (#66177) (#66704)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-12-12 18:56:18 +02:00
github-automation-metabase
093b58e6db fix(sdk-bundle): Fix can't drill numeric string ID dashboard (#66819) (#66871)
* Fix can't drill numeric string ID dashboard

* Address when ID is an empty string

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-12-12 14:59:27 +00:00
github-automation-metabase
45a7b79e97 UXW-2537 fix row/bar viz crash after native query column rename (#66786) (#66856)
* UXW-2537 fix row/bar viz crash after native query column rename

* Fix unit tests

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-12-12 14:32:36 +00:00
github-automation-metabase
478f39d873 fixes a flaky (#66822) (#66873)
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-12-12 12:27:18 +00:00
github-automation-metabase
506bf3dedf 🤖 backported "Show a spinner button for the Download button when exporting" (#66830)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-12-12 13:42:51 +04:00
github-automation-metabase
bac64a06ed Fix for the limit in the static embed context (#66811) (#66825)
Co-authored-by: Roman Abdulmanov <roman@metabase.com>
2025-12-12 09:06:16 +00:00
github-automation-metabase
c443d6a0a0 Embed necessary part of crypto-random dependency and remove it (#66016) (#66703)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-12-12 07:02:22 +00:00
github-automation-metabase
3af4595e6b Hide analytics-dev-mode setting from generated docs (#66794) (#66848)
docs scoop up all settings and has ways to avoid. In
`metabase.cmd.env-var-dox/avoid?` This had a docstring and then an extra
docstring. We can just copy the nice docstring to the docstring slot and
put `:doc false`.

```clojure
(defn- avoid?
  "Used to filter out environment variables with high foot-gun indices."
  [env-var]
  (or (false? (:doc env-var))
      (false? (:can-read-from-env? env-var))
              ;; Ideally, we'd move off of this list completely,
              ;; but not all environment variables are defsettings.
      (contains? env-vars-not-to-mess-with (format-prefix env-var))))
```

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-12-12 03:48:51 +00:00
dpsutton
54af30e62c use performance get-in (#66759)
Here's a handwavy sequence of events (i don't think being more precise
has benefits):

bronsa merges a pr using get-in at a time when it is fine
https://github.com/metabase/metabase/pull/66430. Sashko added a
performance get-in to
master (https://github.com/metabase/metabase/pull/65889).  Eric makes a
PR against master and sees random failing stuff fixes it
there (https://github.com/metabase/metabase/pull/66719). In eric’s
backport the backport of the performance get-in hasn’t made it back yet
so he has to fix this and not include
it (https://github.com/metabase/metabase/pull/66729/commits and
003a2305a3).
Sashko’s backport finally lands in 57 so just a dumb dance to
this. Nothing alarming and an easy fix
2025-12-11 15:43:46 -06:00
github-automation-metabase
e899eb8420 Don't add newline to commented out clauses in native query preview (#66700) (#66838)
* only replace clause if it's not commented

* add tests

* remove sql formatting on frontend

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-12-11 20:00:57 +00:00
github-automation-metabase
7b1a438dc9 Fix user attribute filters against implicitly joined tables that are also sandboxed (#66790) (#66799)
# Conflicts:
#	enterprise/backend/test/metabase_enterprise/sandbox/query_processor/middleware/sandboxing_test.clj

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-12-11 19:16:07 +00:00
github-automation-metabase
4efded0d3a 🤖 backported "UXW-285 filter not accessible questions in data picker" (#66774)
* UXW-285 filter not accessible questions in data picker (#66483)

* UXW-285 filter not accessible questions in data picker

# Conflicts:
#	frontend/src/metabase-types/api/collection.ts

* Fix CI

* Fix e2e

* Fix CI, add e2e

* Add fix for big picker

* fix: CI

* Fix e2e tests
# Conflicts:
#	e2e/support/helpers/e2e-ui-elements-helpers.js
#	e2e/test/scenarios/data-studio/table-collection-permissions.cy.spec.ts
#	frontend/src/metabase/common/components/Pickers/CollectionPicker/components/CollectionItemList.tsx
#	frontend/src/metabase/common/components/Pickers/DataPicker/utils.ts
#	frontend/src/metabase/common/components/Pickers/MiniPicker/components/MiniPickerItemList.tsx

* Fix CI

* Fix e2e test

---------

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-12-11 18:40:37 +00:00
github-automation-metabase
5e3b9c1289 fix broken text wrapping in tables in documents (#65254) (#66826)
* fix broken text wrapping in tables in documents

* render measure root in a portal

Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-12-11 17:09:40 +00:00
github-automation-metabase
b7f53b8e45 Prevent looping past current-schema-version when already past it (#66785) (#66816)
* Prevent looping past current-schema-version when already past it.

* Add test for upgrade-card-schema-to-latest

* Make test parallel

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-12-11 12:04:01 -05:00
github-automation-metabase
e7bf5195b8 Optimize u/index-by when used with vf (#66800) (#66802)
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2025-12-11 13:32:38 +00:00
github-automation-metabase
9e9967c0e8 docs: debetify metabot (#66676) (#66793)
* metabot unbetaying

* Apply suggestions from code review



---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-12-10 23:21:27 +00:00
github-automation-metabase
e9e9771e26 🤖 backported "Treat postgres bit strings as text" (#66760)
* Treat postgres bit strings as text (#66618)

* treat bit strings as text

* Add tests

* cast bit string values instead of fields

* only use string value if bit type

* fix kondo

* Add comment

* kondo

---------

Co-authored-by: Riley Thompson <riley@metabase.com>
Co-authored-by: Riley Thompson <rileythompson99@gmail.com>
2025-12-10 16:36:29 -06:00
github-automation-metabase
2bdb301391 🤖 backported "Include segments in dependencies graph" (#66604)
* backport merge

* indent migrations

* kondo

* fix tests

* fix tests again

* fix fe

* remove fe test

---------

Co-authored-by: Riley Thompson <rileythompson99@gmail.com>
2025-12-10 20:36:54 +00:00
github-automation-metabase
85923ec9da handle uploads from matrix jobs (#66732) (#66734)
motivating example:
we ran the redshift tests, and had three failures: redshift 1, redshift
2, and redshift transforms.

redshifts 1 and 2 timedout at 60 minutes. But the log upload failed
because the python transform tests failed in 24 minutes and then
uploaded:

from the transform failure run:

```
Run actions/upload-artifact@v4
  with:
    name: test-logs-be-tests-redshift-ee
    path: logs/test-log.json
    retention-days: 1
    if-no-files-found: warn
    compression-level: 6
    overwrite: false
    include-hidden-files: false
  env:
    CI: true
    ...
With the provided path, there will be 1 file uploaded
Artifact name is valid!
Root directory input is valid!
Beginning upload of artifact content to blob storage
Uploaded bytes 1072768
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact zip is 267d4b085d49ca4d682fedca97832fecb603bbb5a52c0e1d99bd4daa49984ba3
Finalizing artifact upload
Artifact test-logs-be-tests-redshift-ee.zip successfully finalized. Artifact ID 4816135520
Artifact test-logs-be-tests-redshift-ee has been successfully uploaded! Final size is 1072768 bytes. Artifact ID is 4816135520
```

And then from the redshift tests:

```
Run actions/upload-artifact@v4
  with:
    name: test-logs-be-tests-redshift-ee
    path: logs/test-log.json
    retention-days: 1
    if-no-files-found: warn
    compression-level: 6
    overwrite: false
    include-hidden-files: false
  env:
    CI: true
    ...
With the provided path, there will be 1 file uploaded
Artifact name is valid!
Root directory input is valid!
Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
```

The same happens on redshift part 1.

```
Error: Failed to CreateArtifact: Received non-retryable error: Failed
request: (409) Conflict: an artifact with this name already exists on
the workflow run
```

This just introduces on the driver action to look for a
logs-artifact-suffix and use it if present. And on driver jobs that use
a matrix include the matrix.job.name (or matrix.version.name depending
on the exact structure).

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-12-10 15:04:40 +00:00
github-automation-metabase
747434808b fix: format week of year ordinal string safely (#66667) (#66675)
* check if we should remove square brackets from week of year ordinal

* add tests

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-12-10 14:39:54 +00:00
github-automation-metabase
96aaaeae2b [perf] Add and use m.u.performance/get-in (#65889) (#66705)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-12-10 12:50:53 +00:00
github-automation-metabase
ade3e5cb91 note on metabot context (#66707) (#66755)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-12-10 12:50:31 +00:00
github-automation-metabase
b88ce88262 Fix query normalization issues in v57 (#66722) (#66731)
* Fix query normalization issues in v57

* Remain strict when saving a query

* replace bad dataset_query with legacy_query

* Test fixes 🔧

* Test/Kondo fix 🔧

---------

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
Co-authored-by: dan sutton <dan@dpsutton.com>
2025-12-09 20:34:06 -05:00
github-automation-metabase
ce28d036c6 🤖 backported "Make card schema upgrade 23 a no-op" (#66729)
* Make card schema upgrade 23 a no-op (#66719)

* Make card schema upgrade 23 a no-op

* Fix kondo error

* Yay, fix kondo error in other file

* Appease the module check

* Use clojure.core/get-in

* kick ci

* kick ci

---------

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-12-09 17:22:22 -05:00
github-automation-metabase
7cc52e04cc Fix #66585: Updates static embeds to omit color-scheme settings to preserve legacy transparent iframe behavior (#66662) (#66709)
* #66585 Updates static embeds to omit color-scheme settings to preserve legacy transparent iframe behavior

* support public embed too (#66693)

* support public embed too

* Imports isPublicEmbedding to prevent app crash

---------



---------

Co-authored-by: Brad Anderson <brad@metabase.com>
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-12-09 22:03:45 +00:00
github-automation-metabase
21a7a0471f docs - note on Metabot usage (#66702) (#66730)
* note on Metabot usage

* clean up

* clarification

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-12-09 21:37:01 +00:00
github-automation-metabase
b1b9c78f55 Revert "Hide cursor in the readonly native editor (#63774)" (#66727) (#66728)
This reverts commit f901d08b1c.

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-12-09 21:02:14 +00:00
github-automation-metabase
fc3f70112c UXW-2448 fix untime error with viz settings (#66657) (#66724)
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-12-09 19:54:30 +00:00
github-automation-metabase
f4854b4052 fix: strip some attached dwh config keys on update (#66594) (#66613)
We considered a few options before settling on this one:
1. replace usecase with private HM API
2. disallow db updates via config.yml
3. add config.yml update semantics
4. work around this particular use of config.yml for cloud dwh

1 would be a fair bit of work and testing, 2 could break existing
customers, 3 was a bit of a rabbit hole, and 4 was hacky.

We decided for 1 long term, 4 short term in https://metaboat.slack.com/archives/C010ZSXQY87/p1764869574808769.

Fix https://linear.app/metabase/issue/CLO-4581/metabase-cloud-storage-gets-set-by-default-in-the-upload-csv-everytime

Co-authored-by: Filipe Silva <filipematossilva@gmail.com>
2025-12-09 19:20:35 +00:00
github-automation-metabase
0e25fc64a3 Fix gauge trims decimal parts of ranges (#66714) (#66718)
* fix floating point numbers usage in gauge

* trigger change only if changed

Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-12-09 19:20:03 +00:00
github-automation-metabase
817212a7f6 Show different copy on Metabot AI purchase page after trial (#66706) (#66716)
### Description

In https://github.com/metabase/metabase/pull/65343 we added a page to purchase Metabase AI (Metabot).  Now we are improving the text to:
* Show information about trial only if Metabot was not already trialed
* Improve wording regarding multiple questions / messages in chat

### How to verify

1. Ensure you have a token with the `offer-metabase-ai-tiered` feature, but without the `metabot-v3` feature.
2. Check that the subscription associated with the token had either with (test case 1) or without (test case 2) the `metabase-ai` or the `metabase-ai-tiered` add-on.
3. Navigate to `/admin/metabot` and see the page look like in the mock ups.

### Checklist

- [x] Tests have been added/updated to cover changes in this PR

Closes: https://linear.app/metabase/issue/CLO-4673/show-different-copy-on-metabot-ai-purchase-page-after-trial
Closes: https://linear.app/metabase/issue/CLO-4688/copy-correction-in-the-admin-panel

Co-authored-by: Dennis Schridde <63082+devurandom@users.noreply.github.com>
2025-12-09 19:01:34 +00:00
github-automation-metabase
57c00fc2b3 Native query parsing understands queries with dependent ctes (#66139) (#66691)
If you have a query like "WITH query_a AS (...), query_b AS (select ... from query_a) SELECT ... from query_b",
native query parsing understood that query_b in the final query referred to query_b in the WITH, but it didn't realize
that query_a in query_b referred to query_a in the WITH.  Now, it should understand these sorts of depedent ctes.

Co-authored-by: William <william@metabase.com>
2025-12-09 19:00:58 +00:00
github-automation-metabase
264d2f9bca Editable usage analytics (#66430) (#66694)
* feat: db managemtn

* WIP: load yamls

* wip: transform

* feat: just toggle on load-analytics-content

* feat: export

* chore: user-email

* analytics-dev-mode

* wip: startup logic

* require ns for init

* kondo

* wip: export route

* wip

* fix api

* feat: download button

* refactor

* fix db yaml

* fix: skip db for import

* chore: move stuff around

* use is-audit-dev toggle

* internal setting

* tighter control on export

* lint FE

* perf

* lint fe

* jar aware

* feat: PR-Env-analytics-dev

* chore: use timer

* fail unless postgres

* tests

* fix tests

* throw out of future

* delete old shell command

* feat: mage commands

* fix: test

* fixes for mage commands

* chore: return schema

* cleanup

* fixes to mage commands

* fix: is-audit-dev can always connect, it's appdb

* update checked out analytics to latest format

* reset on teardown

* reinstate even if no edit

* add analytics:finalize for convenience

* exclude qrtz and liquidbase tables

* Update frontend/src/metabase/status/components/AnalyticsExportStatus/AnalyticsExportStatus.tsx



* Update frontend/src/metabase/collections/components/CollectionHeader/CollectionExportAnalytics.tsx



* Update frontend/src/metabase/collections/components/CollectionHeader/CollectionExportAnalytics.tsx



* address review comments

* relativize

* remove needless == true

* missing io/file

---------

Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Uladzimir Havenchyk <uladzimir@metabase.com>
2025-12-09 18:58:01 +00:00
github-automation-metabase
53009fe5f9 Upgrade NextJS again (#66547) (#66699)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-12-09 17:08:47 +01:00
github-automation-metabase
58d923bede Replace a solitary usage of clojure.data.xml with clojure.xml (#66573) (#66639)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-12-09 16:04:16 +00:00
github-automation-metabase
e3fa177188 [equality] Implement faster inequality operation for Long arguments (#65642) (#66640)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-12-09 16:04:08 +00:00
github-automation-metabase
02e9e6cfde closes emb 1021 flaky test again (#66541) (#66708)
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-12-09 16:02:33 +00:00
github-automation-metabase
a33d3ff509 Include "all entries for" in mt/all-entries-for (#66668) (#66682)
this should get all audit log entries for a given model and
model-id. but previously it was using t2/select-one. now it uses
t2/select. whoops

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-12-08 23:41:26 +00:00
github-automation-metabase
e06e09e669 Add schema 23 upgrade (#66601) (#66672)
* If dataset_query is empty and legacy_query is not, copy legacy query over

* Fix kondo errors and bump schema to 23

* Remove parens

* Baseline update

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-12-08 17:18:26 -06:00
github-automation-metabase
dc4b0b51d5 Fix issue where having a metabot block inside a document prevents it from loading when publicly shared (#66564) (#66628)
Co-authored-by: Brad Anderson <brad@metabase.com>
2025-12-08 17:54:46 -05:00
github-automation-metabase
23b2efbeb6 add events when making cards/dash public or retracting (#64582) (#66666)
* add events when making cards/dash pubic or retracting

https://github.com/metabase/metabase/issues/64417

When we make a card public, we put a uuid on it and include
`made_public_by_id`. But when you retract the public link, we remove
both bits of information. This is a nice invariant but it removes
information about who publicized a card.

Imagine a card is discovered by have been public. Of course you want to
immediately remove it. But this erases the audit trail (so to speak) of
who made it public. It is not a great idea to delay remediation during
the investigation. Now you can just consult the audit log

* make events

* formatting

* clean up tests a bit

tests were a bit wack. We should have utility functions to get audit
events. Also noticed we are going off of the object id and ignoring the
object. Could lead to gross issues if there's dashboard with id 4 in
there and also card with id 4. so require model on new one

* fmt

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-12-08 20:31:12 +00:00
github-automation-metabase
e2a822d6c3 UXW-2257 fix theme override after table render (#66620) (#66647)
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-12-08 19:45:34 +03:00
github-automation-metabase
d3234654c8 add starburst ssh (#66568) (#66650)
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-12-08 15:27:49 +00:00
github-automation-metabase
acdea2e127 backport merge (#66606)
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-12-08 14:48:05 +00:00
github-automation-metabase
bc1e202df2 handle users with no first or last names in document comments (#66468) (#66484)
Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-12-08 09:40:48 -04:00
github-automation-metabase
2c05088ca9 [QP] If a :field ref by ID needs fallback metadata, include :join-alias (#66563) (#66591)
Fixes #66464.

This was a corner case in `lib.field.resolution` and `qp.util.add-alias-info`
that regressed in 57. It made the QP less smart about repairing a certain
class of broken queries, which regrettably exist in the wild.

The breakage in question was a `:field` ref in later stage, which had a
numeric field ID and a `:join-alias`. If that field ID was not actually
returned as part of the join anymore, fallback metadata would be
generated by looking up the field by ID. That "works" for non-joined
fields but for an explicitly joined field it would use
`source."SOME_FIELD"` rather than `"The Join Alias"."SOME_FIELD"`, which
causes SQL compilation to fail.

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-12-08 12:08:18 +00:00
github-automation-metabase
50e5ecaed7 Bump org.apache.tika/tika-core from 3.2.2 to 3.2.3 (#63799) (#66635)
Inspect dependency changes here:

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-12-07 17:21:36 +00:00
github-automation-metabase
5b5725c24d bump the hive jdbc library (#66523) (#66626)
Co-authored-by: bryan <bryan.maass@gmail.com>
2025-12-06 01:28:47 +00:00
github-automation-metabase
ee916f0a72 implement driver.sql/json-field-length for druid-jdbc driver (#66525) (#66611)
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-12-05 21:28:56 +00:00
github-automation-metabase
d4eca926bf Cache trunk between runs (#66602) (#66616)
Trunk action supports `use-cache` that should prevent us hitting
GitHub's API rate limits.

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-12-05 20:51:38 +00:00
github-automation-metabase
6ca7573c9d Add :aggregation as valid argument to a filter. (#66560) (#66609)
Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-12-05 19:31:00 +00:00
Jeff Bruemmer
e2c5265428 update docker compose to pin postgres and add volume (#66608) 2025-12-05 13:26:50 -05:00
github-automation-metabase
7a3fbdd93b fix: add correct valueFormat for DateInput (GIT-8486, #65480) (#66298) (#66595)
* fix: add correct valueFormat for DateInput (GIT-8486, #65480)

* GIT-8486 add cleanup after changing locales

Co-authored-by: Egor Grushin <egorgrushin@gmail.com>
2025-12-05 16:10:31 +00:00
github-automation-metabase
d1123a2cb1 Adjust layout of Metabot purchase page and add video demo (#66580) (#66589)
### Description

In https://github.com/metabase/metabase/pull/65343 we added a page to purchase Metabase AI (Metabot).  Now we are improving the layout and content to better present the product.

### How to verify

1. Ensure you have a token with the `offer-metabase-ai-tiered` feature, but without the `metabot-v3` and `offer-metabase-ai` features.
2. Navigate to `/admin/metabot` and see the page look like in the mock ups.

### Checklist

- [x] Tests have been added/updated to cover changes in this PR

Closes: https://linear.app/metabase/issue/CLO-4669/make-small-changes-to-ai-page-in-admin

Co-authored-by: Dennis Schridde <63082+devurandom@users.noreply.github.com>
2025-12-05 16:03:40 +00:00
github-automation-metabase
665a201ba5 🤖 backported "fix: show confirmation on escape, clickoutside and browser's back actions for SidebarCacheForm" (#66518)
🤖 backported "fix: show confirmation on escape, clickoutside and browser's back actions for SidebarCacheForm" (#66518)
2025-12-05 11:47:28 +00:00
github-automation-metabase
915bd811ce Closes EMB-1042 removed flaky e2e test and adds a unit test instead (#66424) (#66552)
* Closes EMB-1042 removed flaky e2e test and adds a unit test instead

* yeah no timeout

* fixed poor rebase

* better use of fetchmock in unit test

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-12-05 12:23:11 +01:00
github-automation-metabase
562fb5dc35 Remove transducers and core.logic deps (#66510) (#66570)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-12-05 01:26:23 +00:00
github-automation-metabase
11675fb536 docs - update quickstart (#66527) (#66565)
* fix up quickstart

* versions

* consolidate clones

* fix link

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-12-04 22:23:27 +00:00
github-automation-metabase
edb07af899 When setting settings, include 5 minute cookie of updated timestamp (#66338) (#66553)
* When setting settings, include 5 minute cookie of updated timestamp

if other instances have outdated settings cache, this cookie will let
them know what the requestor has seen. The instance can then know it is
out of date. This won't help for instances that aren't hit by the person
setting the setting.

Motivating example is someone who is doing an embedding onboarding
checklist. And then hits a new instance that hasn't yet loaded the "show
embedding homepage" setting so it flips back to the regular
homepage. The hope here is the person doing this checklist will let the
other instance know it is out of date, reload the settings cache and
then see the embedding setting.

* Interesting strategy here for cookies.

I hated that the route would would set a cookie at a particular key, do
timestamp stuff, etc. I know ring is a map and abstraction, but i added
a new paradigm:

```clojure
(defn- add-settings-last-updated-cookie
  "Add a cookie with the current settings-last-updated timestamp to the response."
  [response]
  (assoc-in response [:mb/cookies :cookie/settings-cache-timestamp] true))
```

This means that just the middleware is responsible for checking and
setting this key. This was largely driven by two different namespaces
having a private def of:

```clojure
(def ^:private settings-last-updated-cookie-name "metabase.SETTINGS_LAST_UPDATED")
```

And it's nice if the ring map can indicate to this middleware to handle
all the key and timestamp stuff and it just has to indicate to set this
with `cookie/settings-cache-timestamp`.

So the request looks like this:

```clojure
{:status 204
 :headers {"X-Frame-Options" "DENY"
           "X-XSS-Protection" "1; mode=block"
           "Last-Modified" "Mon, 1 Dec 2025 17:09:59 GMT"
           "Strict-Transport-Security" "max-age=31536000"
           "X-Permitted-Cross-Domain-Policies" "none"
           "Cache-Control" "max-age=0, no-cache, must-revalidate, proxy-revalidate"
           "X-Content-Type-Options" "nosniff"
           "Content-Security-Policy" "...<lots of junk>..."
           "Expires" "Tue, 03 Jul 2001 06:00:00 GMT"}
 :body nil
 :mb/cookies {:cookie/settings-cache-timestamp true} ;; <---- our new addition
 :cookies {"metabase.DEVICE" {:value "60ac9454-9dd1-439a-afa1-921ff029686d"
                              :http-only true
                              :path "/"
                              :expires "Fri, 1 Dec 2045 17:09:59 GMT"
                              :same-site :lax}}}
```

And then in practice, it looks like this:

Set the setting and get a cookie with the timestamp in response:

```
❯ http put :3000/api/setting/site-name value=foo x-api-key:$KEY
HTTP/1.1 204 No Content
...
Set-Cookie: metabase.SETTINGS_LAST_UPDATED=2025-12-01+17%3A28%3A15.450873%2B00; Path=/; Max-Age=300; SameSite=Lax
...
```

Simulate sending to another instance with a timestamp that exceeds the
currently know timestamp (i'll increment the hour based sent back in
this response)

```
❯ http get :3000/api/user/current x-api-key:$KEY Cookie:metabase.SETTINGS_LAST_UPDATED="2025-12-01+18%3A23%3A51.059155%2B00" | jq '.date_joined'
"2025-12-01T16:51:08.137822Z"
```
(note the 18 vs the 17)

And the logs are this:

```
INFO middleware.settings-cache :: Settings cookie indicates cache is out of date. Refreshing...
DEBUG middleware.log :: GET /api/user/current 200 19ms (11 DB calls) App DB connections: 0/4 Jetty threads: 5/50 (5 idle, 0 queued) (245 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 346}
```

* fixes:

- logged known timestamp not weird cookie value
- timestamp is optional, so handle that
- typo in log konwn -> known

* Add tests, add functionality

tests:
ensure it (a) sets the cookie, (b) honors the cookie, and when it
restores the cache, to set the cookie so it doesn't keep thrashing. But
presumably it won't since it's up to date. My "in the future" version is
a bit synthetic.

Functionality wise, updating the cache now returns and this will saet
the header with the most recent cache setting

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-12-04 17:31:13 +00:00
github-automation-metabase
0c2f3c3ae5 Bump com.microsoft.sqlserver/mssql-jdbc from 13.2.0.jre11 to 13.2.1.jre11 (#64831) (#66524)
Inspect dependency changes here:
2025-12-03 20:50:20 +00:00
github-automation-metabase
bdbc7ccc3c 🤖 backported "Persist selected theme in account settings" (#66487)
* Persist selected theme in account settings (#66250)

* Persist selected theme in account settings

* Persist selected theme in account settings

* Add e2e

* Add e2e

* Review fixes

* Refactor initial value get to fix e2e tests

* fix e2e

* Fix BE module test

* Fix CI

---------

Co-authored-by: John Swanson <john.d.swanson@gmail.com>

* Fix CI

---------

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
Co-authored-by: John Swanson <john.d.swanson@gmail.com>
2025-12-03 20:38:57 +00:00
github-automation-metabase
e30dbf89f5 use json unquote (#66512) (#66520)
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-12-03 19:17:34 +00:00
github-automation-metabase
c429dd22f7 Renamed Library to Synced Collection (#65447) (#66515)
Renamed Library to Synced Collection

Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-12-03 18:34:32 +00:00
github-automation-metabase
4aeaa42ad8 Continue sync even if a table fails (#66432) (#66507)
* Add reproduction test

* Fix for clickhouse

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-12-03 17:45:47 +00:00
github-automation-metabase
a9704d2e51 Closes EMB-1069 create new embed -> embed (#66457) (#66508)
* Closes EMB-1069 create new embed - embed

* .

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-12-03 16:58:13 +00:00
github-automation-metabase
ad5a5e56d2 flaky flaky, eggs and baky (#66312) (#66509)
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-12-03 16:51:11 +00:00
github-automation-metabase
e54c6f283a UXW-804 Fix collection name & description character limits (#66380) (#66479)
* feat: add `maxLength` attributes to collection `name` and `description`

* test: update suites for `CollectionHeader`

* feat: update max length validation for `CollectionInfoSidebar`

* feat: update max length validation for `NewCollectionDialog`

* test: update `CollectionInfoSidebar` and `CollectionCaption` tests

* style: update toast color

* refactor: remove unreachable checks & assertions

* test: remove unnecessary checks and render spread

Co-authored-by: Gabriel Moreno <gabriel@metabase.com>
2025-12-03 14:47:31 +00:00
github-automation-metabase
faf6e3d5bc fix(sdk-cli): Fixes CLI quickstart not passing in the proper revision in query (#66493) (#66494)
* Fixes CLI quickstart not passing in the proper revision in query

* .

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-12-03 10:51:59 +00:00
github-automation-metabase
597a9421ac Fixes 60942 (#61080) (#66488)
Fixes https://github.com/metabase/metabase/issues/60942

Co-authored-by: LP <paoliniluis@gmail.com>
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-12-03 00:29:56 +00:00
github-automation-metabase
63b11ed233 UXW-2404 Remove toggle to disable anonymous analytics on cloud (#66469) (#66480)
* fix: hide anonymous tracking toggle on cloud plans

* test: update general settings page suite

* fix: feedback on testing & token feature extraction

Co-authored-by: Gabriel Moreno <gabriel@metabase.com>
2025-12-02 20:24:43 +00:00
github-automation-metabase
c6883be6df Closes EMB-1055 static embedding without a theme defaults to dark mode or system settings (#66320) (#66476)
* Closes EMB-1055 static embedding without a theme defaults to dark mode or system settings

* types

* .

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-12-02 17:23:18 +00:00
github-automation-metabase
2536114ff7 🤖 backported "Lets not log when a user cancels a query" (#66470)
* Lets not log when a user cancels a query (#66292)

* Lets not log when a user cancels a query

look how gross this is

```
2025-11-25 23:03:09,543 ERROR middleware.catch-exceptions :: Error processing query: ERROR: canceling statement due to user request
{:database_id 613,
 :parameterized false,
 :started_at #t "2025-11-25T23:03:03.698696Z[UTC]",
 :via
 [{:status :failed,
   :class clojure.lang.ExceptionInfo,
   :error "Error executing query: ERROR: canceling statement due to user request",
   :stacktrace
   ["--> driver.sql_jdbc.execute$execute_reducible_query$fn__452061$fn__452062.invoke(execute.clj:772)"
    "driver.sql_jdbc.execute$execute_reducible_query$fn__452061.invoke(execute.clj:767)"
    "driver.sql_jdbc.execute$eval451741$fn__451742$fn__451743.invoke(execute.clj:422)"
    "driver.sql_jdbc.execute$fn__451652$do_with_resolved_connection451651__451653.invoke(execute.clj:347)"
    "driver.sql_jdbc.execute$fn__451652$fn__451658.invoke(execute.clj:327)"
    "driver.sql_jdbc.execute$eval451741$fn__451742.invoke(execute.clj:416)"
    "driver.sql_jdbc.execute$execute_reducible_query.invokeStatic(execute.clj:760)"
    "driver.sql_jdbc.execute$execute_reducible_query.invoke(execute.clj:749)"
    ...
     :state "57014",
 :error_type :invalid-query,
 :json_query
 {:lib/type "mbql/query",
  :stages [{:native "select 1, pg_sleep(40)", :lib/type "mbql.stage/native", :template-tags {}}],
  :database 613,
  :parameters [],
  :middleware {:js-int-to-string? true, :userland-query? true, :add-default-userland-constraints? true}},
 :status :failed,
 :class org.postgresql.util.PSQLException,
 :stacktrace
 ["org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2734)"
  "org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2421)"
  "org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:372)"
  "org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:518)"
  "org.postgresql.jdbc.PgStatement.execute(PgStatement.java:435)"
  "org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:357)"
  "org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:342)"
  "org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:318)"
  ...
    "query_processor.streaming$_streaming_response$fn__108781$fn__108782$fn__108783.invoke(streaming.clj:225)"
  "query_processor.streaming$_streaming_response$fn__108781$fn__108782.invoke(streaming.clj:223)"
  "query_processor.streaming$do_with_streaming_rff.invokeStatic(streaming.clj:214)"
  "query_processor.streaming$do_with_streaming_rff.invoke(streaming.clj:201)"
  "query_processor.streaming$_streaming_response$fn__108781.invoke(streaming.clj:220)"
  "server.streaming_response$do_f_STAR_.invokeStatic(streaming_response.clj:83)"
  "server.streaming_response$do_f_STAR_.invoke(streaming_response.clj:81)"
  "server.streaming_response$do_f_async$task__108307.invoke(streaming_response.clj:98)"],
 :card_id nil,
 :context :ad-hoc,
 :error "ERROR: canceling statement due to user request",
 :row_count 0,
 :running_time 0,
 :data {:rows [], :cols []}}

2025-11-25 23:03:09,570 DEBUG middleware.log :: POST /api/dataset 202 [ASYNC: canceled] 5888ms (8 DB calls) App DB connections: 0/6 Jetty threads: 5/50 (4 idle, 0 queued) (228 total active threads) Queries in flight: 0 (0 queued); postgres DB 613 connections: 0/1 (0 threads blocked) {:metabase-user-id 1}
```

how embarassing. we're just canceling a query. we don't need a stacktrace.

and after:

```
2025-11-25 23:39:40,197 DEBUG middleware.log :: POST /api/dataset 202 [ASYNC: canceled] 3076ms (8 DB calls) App DB connections: 1/10 Jetty threads: 4/50 (2 idle, 0 queued) (233 total active threads) Queries in flight: 0 (0 queued); postgres DB 613 connections: 0/2 (0 threads blocked) {:metabase-user-id 1}
```

note the post is cancelled but no big stack trace

* postgres test

* format file

* move postgres tests into postgres

* improve tests

---------

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-12-02 11:19:18 -06:00
github-automation-metabase
4343c39629 Update generated docs (release-x.57.x) (#66453)
Co-authored-by: github-actions <github-actions@github.com>
2025-12-02 10:08:57 -05:00
github-automation-metabase
6d73d4b478 Closes EMB-1063 docs url (#66460) (#66463)
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-12-02 14:47:28 +00:00
github-automation-metabase
ec54fec881 Use backfill specific event to prevent card revisions (#66401) (#66423)
* use backfill specific event

* fix kondo

* add test

* fix config modules

* add migration

* remove migrations

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-12-02 12:05:39 +00:00
github-automation-metabase
2c3e1ff6ce UXW-2310 Fix upsell CTA misalignment & stepper card overflow on custom fonts (#66443) (#66445)
* fix: avoid breaking spaces on upsell CTA link

* fix: exchange `h` for `mih` on stepper card components and allow for flexible height

Co-authored-by: Gabriel Moreno <gabriel@metabase.com>
2025-12-01 23:51:35 +00:00
github-automation-metabase
800adad31d Update generated docs (release-x.57.x) (#66414)
Co-authored-by: github-actions <github-actions@github.com>
2025-12-01 16:22:48 -05:00
github-automation-metabase
fcac869e99 remove env vars that now have defsettings (#66434) (#66436)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-12-01 20:19:46 +00:00
github-automation-metabase
d92f548398 Docs: DBs for editable tables (#66276) (#66435)
* Add Metabase Sample Database to editable tables support

Updated the list of databases that support editable tables to include Metabase Sample Database.

* Update docs/data-modeling/editable-tables.md

* Update docs/data-modeling/editable-tables.md

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-12-01 19:10:02 +00:00
github-automation-metabase
b645842b29 Update generated docs (release-x.57.x) (#66303)
Co-authored-by: github-actions <github-actions@github.com>
2025-12-01 13:44:05 -05:00
github-automation-metabase
51ced1920d Closed connection with many fields (#66051) (#66429)
Fix legacy path (for snowflake with large number of fields)

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-12-01 17:12:34 +00:00
github-automation-metabase
a868e1b529 Update selector for loki test in Palette.stories (#66333) (#66370)
Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-12-01 11:14:04 -04:00
Timofey Kachalov
85f146f7a2 Don't show SDK settings in OSS version (#66402) 2025-12-01 19:06:51 +04:00
github-automation-metabase
3a2f3c3a57 [perf] More efficient validator-cache old key eviction (#65890) (#66408)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-11-29 19:07:00 +00:00
github-automation-metabase
bfd7e331ca [MBQL lib] Allow string literals as arg to aggregations like :max (#66220) (#66316)
Fixes #66199.

`metabase.legacy-mbql.schema`, now used for normalizing MBQL 4 in
place of the old bespoke normalization in earlier versions, regressed in
this weird but legitimate use case: Writing a custom aggregation like
`MAX("String Literal")`.

That's an odd thing to do, but it can be useful to provide a label in an
aggregated query. This is the MBQL equivalent of
`(SELECT ..., 'A' as label FROM ...) UNION ALL (SELECT ..., 'B' as label ...)`

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-11-28 14:00:01 +00:00
github-automation-metabase
919e4b9167 updating watermark svg color and opacity (#66339) (#66375)
* updating watermark svg color and opacity

* static viz development mark has same color and opacity as dynamic viz

Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-11-27 17:24:31 +00:00
github-automation-metabase
ee07dee89f Fix broken PDF export layout due to CSP violation for inline styles (#66337) (#66371)
Co-authored-by: Anderson <ands.alves.nunes@gmail.com>
2025-11-27 14:44:32 +00:00
github-automation-metabase
22c711ea8f fix false positive logs (#66325) (#66366)
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2025-11-27 14:39:24 +00:00
github-automation-metabase
a4b4f742e9 Make file-path triggers more robust (#66311) (#66367)
This pull request refactors and streamlines the configuration for CI workflows and file path groupings in .github/file-paths.yaml and updates related workflow logic in .github/workflows/run-tests.yml. The changes focus on consolidating shared configuration, improving maintainability, and removing redundant or unused path groups.

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-27 15:19:18 +01:00
github-automation-metabase
291a18dec6 UXW-1778 remove chart hover effects when exporting to png (#66200) (#66329)
* UXW-1778 remove chart hover effects when exporting to png

* Fix typing and unit tests

* review fix

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-11-26 21:13:16 -05:00
github-automation-metabase
b8d55429bf Add :database_type to metabot tools that return column metadata (#66302) (#66350)
* Add :database_type to metabot tools that return column metadata

Add :database_type to metabot tools that return column metadata in order to give metabot information about the real
database type when generating SQL.

Examples of places the :database_type now appears:

- :used_tables in :user_is_viewing context
- {table,card,metric}-details
- get-query-details
- enhanced-database-tables

* Fix test after rebase onto #66271

Fix get-table-details-database-type-test after rebase (1) use new field-id formatting (2) get-table-details no longer returns implicitly-joinable fields
in the top-level `:fields`.

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-11-27 00:47:36 +00:00
github-automation-metabase
ddd6a8f3c7 Revised approach to related_tables and consistent field IDs for implicitly-joined fields (#66271) (#66346)
* More flexible approach to resolving columns from metabot field_ids

* fix one field-stats-test

* fix field-stats-test

* support nano-ids in field ids (?)

* remove some dead code

* Exclude implicitly joinable fields when fetching cols for table

* try switching field format to use dash

* fix field IDs in a number of tests

* Kondo

* add some unit tests for new field parsing & column lookup helper fns

* Fix more tests

* Fix more tests

* fix regex

* New approach -- use wide field IDs in related_tables and add a related_by field for each table

* Fix some tests

* remove unneeded table

* cleanup, new test

* Revert to passing in & matching on expected prefix

* Address tyler's comments

* accept a regex for the prefix as well

* add back small malli group-by fix from the last PR - removed unintentionally during revision

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-11-26 21:44:30 +00:00
github-automation-metabase
3f0396d1f7 Add warning for when mismatch in serdes version during loading (#66140) (#66344)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-11-26 21:14:18 +00:00
github-automation-metabase
c1fd52467e UXW-2228 Properly mention available subscription & alert channels for non-admins (#66273) (#66323)
* fix: add missing channels to copy & rendering logic

Mentioned webhooks and Slack where necessary to stay consistent with the
admin UI

* fix: standardize lowercase 'admin' & prefer 'email' over 'SMTP'

* fix: remove extra comma on wording

* test: adjust e2e test assertions

* test: add `DashboardSubscriptionMenuItem.unit.spec.tsx`

* test: extract single case from `describe` block

* test: fix subscriptions e2e case & text lookup on alert spec

Co-authored-by: Gabriel Moreno <gabriel@metabase.com>
2025-11-26 15:44:59 +00:00
github-automation-metabase
6448cc06b9 fix: anchor table info popover to bottom (#66226) (#66247)
Since `position` was set to `top`, the popover had little space to
expand upwards, and the box was cut-off before reaching the anchor
point.

Co-authored-by: Gabriel Moreno <gantoreno@gmail.com>
Co-authored-by: Gabriel Moreno <gabriel@metabase.com>
2025-11-26 15:44:44 +00:00
github-automation-metabase
6f045a11a1 Get user attributes from attributes map (#66274) (#66321)
* Get user attributes from attributes map

* fixup! e2e test

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-11-26 15:09:42 +00:00
github-automation-metabase
d63ee75f63 update file path to include tsx extension for component tests (#66254) (#66310)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-11-26 10:10:11 +00:00
github-automation-metabase
3446900d0a GDGT-1252: Respect show mini bar chart setting in list view (#66012) (#66241)
* GDGT-1252: Make list view consider mini-bar-chart setting

* GDGT-1252: Fix incorrect model settings update when changing columns settings

* GDGT-1252: e2e test

* GDGT-1252: Fix unit test for ListViewItem

* GDGT-1252: Address PR comments. Minor refactoring

* GDGT-1252: Refactor DatasetEditor to get rid of modelSettings hack

* GDGT-1252: Update e2e test to cover settings persistence

* Update Loki Snapshots

* Revert Loki update

---------

Co-authored-by: Stas Gavrylov <stas@metabase.com>
2025-11-26 08:44:13 +00:00
github-automation-metabase
1780161984 Split Redshift driver tests into two jobs (#66289) (#66290)
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-26 00:25:35 +00:00
github-automation-metabase
4575d505dc Always pass the input conditions to sdk jobs (#66269) (#66284)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-25 22:06:21 +00:00
github-automation-metabase
dacf4b3268 Update generated docs (release-x.57.x) (#66231)
Co-authored-by: github-actions <github-actions@github.com>
2025-11-25 21:35:10 +00:00
github-automation-metabase
78a9f634ca Add :database_engine to metabot table-details and card-details (#66227) (#66278)
These tools already included :database_id in the results; we now include the :database_engine as well, to give metabot
a reminder about which SQL dialect it should generate.

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-11-25 21:21:01 +00:00
github-automation-metabase
85c6adb389 add deprecation support to defendpoint dox-gen (#66053) (#66268)
Co-authored-by: bryan <bryan.maass@gmail.com>
2025-11-25 19:53:53 +00:00
github-automation-metabase
4421e6e842 ci(sdk): only setup specific enterprise plugins in sdk unit tests as needed (#66238) (#66270)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-11-25 19:34:01 +00:00
github-automation-metabase
a150ca7cbc 🤖 backported "Run JAR health check only on master and release branches" (#66256)
* Run JAR health check only on master and release branches (#66237)

* Fix JAR health check condition logic (#66266)

Addresses this finding by the Claude code review:
https://github.com/metabase/metabase/pull/66237#discussion_r2560704357

---------

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-25 20:25:29 +01:00
github-automation-metabase
5a86603d43 Move audit installation before search initialization again (#66222) (#66260)
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-11-25 19:24:11 +00:00
github-automation-metabase
e12dd9c230 [QP] Allow one-sided :number/between parameter values (#65987) (#66019)
Fixes #65714.

These are sent as `:number/<=` or `:number/>=` and the validation was
too strict from 57 onward. Added a test for none, min, max, and both
ends of a Between filter.

Co-authored-by: Braden Shepherdson <braden@metabase.com>
Co-authored-by: dpsutton <dan@dpsutton.com>
2025-11-25 15:11:15 +00:00
github-automation-metabase
62185a439e chore(sdk): remove excessive logs in sdk fixup script (#66133) (#66146)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-11-25 14:37:15 +00:00
github-automation-metabase
492a74538f docs - fix docstring (#66134) (#66141)
* doc string

* edit

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-25 13:50:51 +00:00
github-automation-metabase
b1cc6c38b6 Fix purchase page for paid Metabase AI add-on for non-store users (#66086) (#66229)
### Description

Missing billing information is treated as an error for purposes of
displaying the purchase page with prices.  Non-store users cannot
retrieve billing information.  Thus, previously, they would always see
an error page: "Error fetching information about available add-ons."
With this change, they see the "Please ask a Metabase Store Admin" page
as intended.

We achieve this by splitting the page content for store users from that
of non-store users.  Only the former needs to load data (billing and
add-on information), so only that page needs `LoadingAndErrorWrapper`.
For store users we show no dynamic content that could fail to load
(apart from a store user's email address, which we gracefully omit if
it is missing).

### How to verify

1. Ensure you have a token with the `offer-metabase-ai-tiered`
   feature, but without the `metabot-v3` and `offer-metabase-ai`
   features.
2. As a Metabase user with an email address that *does not* match any
   of the token's organization's store user email addresses, navigate
   to `/admin/metabot` and see "Please ask a Metabase Store Admin".
3. As a Metabase user with an email address that *does* match any
   of the token's organization's store user email addresses, navigate
   to `/admin/metabot` and see the purchase page with tier selector.

### Checklist

- [x] Tests have been added/updated to cover changes in this PR

Fixes: 2b76c38e1f
Closes: https://metaboat.slack.com/archives/C07RMUQ0GE5/p1763644357893079

Co-authored-by: Dennis Schridde <63082+devurandom@users.noreply.github.com>
2025-11-25 02:57:21 +00:00
github-automation-metabase
0d8a03e84e Improve how skipped SDK tests are handled (#66211) (#66224)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-24 22:52:57 +00:00
github-automation-metabase
cda078513d Move audit installation after search init; change some logs to debug (#66045) (#66195)
* Move audit installation after search init; change some logs to debug

* change another warn to debug

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-11-24 22:04:21 +00:00
github-automation-metabase
f285c79bfe Fix #65501 - Resets search back to first page when filters change (#66104) (#66218)
Co-authored-by: Brad Anderson <brad@metabase.com>
2025-11-24 16:22:42 -05:00
github-automation-metabase
b08483c3d0 Cancel jobs in bigquery (#66054) (#66213)
* cancel bigquery jobs

* move .cancel to promise handling

* wrap .cancel in try catch finally

* use getqueryresults instead of .query

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-11-24 20:11:08 +00:00
github-automation-metabase
820b98d43c Two quality-of-life improvements for @-mentions (#66131) (#66216)
* QoL improvements for @-mentions

* Add a unit test for new tab click behavior

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-11-24 20:03:45 +00:00
github-automation-metabase
5c0a472444 Make sure 'Pull changes' button is not truncated on remote sync settings (#65932) (#65963)
Co-authored-by: Anderson <ands.alves.nunes@gmail.com>
2025-11-24 19:36:14 +00:00
github-automation-metabase
4af5e3012f Fix trend viz dates diff calculation for a year unit (#65985) (#66201)
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-11-24 16:46:55 +00:00
github-automation-metabase
666377d876 Fix uberjar fetching for SDK host-apps (#66194) (#66196)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-24 15:16:33 +00:00
github-automation-metabase
a3abc1e8f1 Add translation for boolean dash filter value (#66050) (#66191)
* Add translation for boolean dash filter value

* Fix CI

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-11-24 14:31:57 +00:00
github-automation-metabase
371be27f83 Fix timeseries value detection (#66161) (#66162)
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-11-24 14:19:51 +00:00
github-automation-metabase
2824b0188a Prevent driver tests (#66156) (#66164)
Co-authored-by: dpsutton <dan@dpsutton.com>
Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
2025-11-24 14:46:16 +01:00
github-automation-metabase
5dadd4d393 Closes EMB-1037 preview_embed endpoint for filter search (#66077) (#66115)
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-11-24 12:21:43 +01:00
github-automation-metabase
5de1be6b3b Parallelize embedding SDK package and uberjar builds (#66122) (#66186)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-24 11:11:48 +00:00
Nemanja Glumac
5b81c3ef53 Manual backport of the recent caches changes (#66145) 2025-11-22 00:37:09 +01:00
github-automation-metabase
7856184a38 Clean up backend-test matrix (#66158) (#66160)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-22 00:33:30 +01:00
github-automation-metabase
4e0046b23f Fetch uberjar using a proper action (#66165) (#66166)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-21 23:27:30 +00:00
github-automation-metabase
f06c5d7d96 Fix flaky Remote Sync test (#65862) (#66159)
Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-11-21 20:12:54 +00:00
github-automation-metabase
568dde39b2 Remove redundant static-viz files changed condition (#66138) (#66142)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-21 16:54:19 +00:00
github-automation-metabase
aff83af2e3 Add empty state to native query DB dropdown (#66090) (#66127)
* add global search to db dropdown

* Add tests

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-11-21 15:49:26 +00:00
github-automation-metabase
0f71481d47 docs - light weeding (#66023) (#66092)
* spelling

* docstring

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-21 08:59:53 -05:00
github-automation-metabase
17d40f681f Consolidate embedding CI workflows (#66075) (#66119)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-21 12:18:05 +00:00
github-automation-metabase
17b47b91fb Closes EMB-1038 wrong endpoint for embed maps preview (#66063) (#66114)
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-11-21 08:46:42 +00:00
github-automation-metabase
35ee104a5d minimal tests to be run when the label is minimal-tests (#66024) (#66100)
* minimal tests to be run when the label is `minimal-tests`

* include enterprise tests, fix syntax

* bump CI

* don't fail if label is absent

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-11-20 21:45:21 +00:00
github-automation-metabase
2dc1acfd9f chore(sdk): fix sdk storybook (#66078) (#66085)
* chore(sdk): fix sdk storybook

* use rootRepoPath for appConfig

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-11-20 18:26:53 +00:00
github-automation-metabase
9155867efa refactor(embed-js): Move EmbedJS + EmbedJS wizard files to OSS folder (#66067)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-11-20 16:47:04 +04:00
github-automation-metabase
2de6ecf19a chore(sdk,ci): fix stress tests for sdk tests (#66065) (#66068)
* chore(sdk,ci): fix stress tests for sdk tests

* fix baseUrl, cypress explodes if we pass it in ct test config

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-11-20 11:18:32 +00:00
github-automation-metabase
03302b0086 Nicola/glossary creator api (#65961) (#65970)
* feat: glossary, actually add creator_id on create endpoints

* feat: add creator_id tests on api

Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
2025-11-20 10:54:41 +00:00
github-automation-metabase
d032ca1774 Add creator to transform content view, and include glossary (#65957) (#65960)
* feat: add creator_id to content view for transforms

* feat: add creator to glossary

* feat: glossary entries in content

* add creator test

* missing creator_id

Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
2025-11-20 10:03:54 +00:00
github-automation-metabase
2d94d4ab0b Add bottom padding for Attach results as files section (#62483) (#66064)
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2025-11-20 10:00:03 +00:00
github-automation-metabase
48d495387a [Metabot] Request cancellation (#65511) (#66052)
* fix cut not removing text from input

* ensure we fetch all data for all possible models for smart links

* remove unused comment

* fixes smart links in metabot input sometimes degrading into their text representation and fixes some cases where wrong model name ("model" instead of "dataset") was used for metabot links

* fix unit tests

* ui for cancelling a request, handles state updates for canceled requests

* press esc to cancel metabot request, fix state being incorrect on requests after an aborted request

* add test coverage for ui, update test utils to enable aborting requests in unit tests, small bits of clean up

* add tests to processStream function

* update snapshot

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-11-20 00:08:27 +00:00
github-automation-metabase
c074825e5c Change images for development and production settings (#66039) (#66041)
Updated images in the remote sync documentation to reflect new settings.

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-11-19 20:55:08 +00:00
github-automation-metabase
280ccdb0e0 Update plans-blockquote inclusion for documents (#66038) (#66040)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-11-19 20:54:23 +00:00
github-automation-metabase
babb5a6357 fix: allow analytics collection perms to be set (#65927) (#65974)
* fix: allow analytics collection perms to be set

In #65098, we did not fully replicate the behavior of the old graph
endpoint where collection namespacing rules aren't applied to the
"analytics" namespace. Collections in this namespace can be modified as
though they are part of the root `nil` namespace. The bug was in
removing collections not part of the targetted namespace of the
`update-graph!` funciton from the graph to update.

This restores the old behavior by not excluding collection permissions
updates for collections in the "analytics" namespace in the
`remove-collections-from-other-namespaces` function.

it also updates our tests for the collection graph to make sure mock
analytics collections have the right namespace set rather than a `nil` namespace.

* fixup! reset revisions

* fixup! tests to EE module fix tests in EE module

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-11-19 18:13:19 +00:00
github-automation-metabase
a7cbdac451 fix(docs): fix sdk docs not being generated correctly (#66030) (#66031)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-11-19 12:15:20 -05:00
github-automation-metabase
a9e5197ba8 Fix incorrect tooltip metric sum in row chart (#65938) (#65969)
* Fix incorrect tooltip metric sum in row chart

* Review fixes

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-11-19 16:22:10 +00:00
github-automation-metabase
f8fec179a0 docs - X version note and cleanup (#65756) (#66017)
* X version note and cleanup

* note on hotfix x

* edit

* note on beta

* changelog link

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-19 14:19:02 +00:00
github-automation-metabase
699633dbdb Cache yarn in CI (#65946) (#66013)
Co-authored-by: Fraser <fraser@metabase.com>
2025-11-19 15:03:14 +01:00
github-automation-metabase
2d2126dfd0 De-clutter the Cypress (nodejs) Module runner (#65881) (#66000)
Running Cypress tests doesn't have to be hard.

This PR is moving us in a direction where (1) there's some logic that sets up the environment for e2e testing, and then (2) there's a simple command to invoke cypress (aka "decoupling" or "separation of concerns")

Cypress only needs to know which config to look at. It contains all the information it needs to run.

There are two ways to invoke Cypress:

1. Cypress cli
2. Cypress Module API (programmatic entry point)

They should be compatible and interchangeable. Anything you pass to the node module as options can be passed as individual flags to the cli.

```
npx cypress run --config-file path/to/some/config --spec path/to/spec.cy.spec.ts
```

is equivalent to

```
cypress.run({ configFile: "path/to/some/config", spec: "path/to/spec.cy.spec.ts" });
```

This PR removes all abstractions from the actual node module runner.

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-19 14:03:54 +01:00
github-automation-metabase
87af82b30c Closes EMB-982 embedding stuck on 404 when navigating with postMessage (#65662) (#65962)
* Closes EMB-982 postmessage 404

* actual fix

* .

* .

* .

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-11-19 12:55:25 +00:00
github-automation-metabase
ff97dff2ad Docs: reusing snippet parameters (#65723) (#66008)
* reusing snippet parameters

* Update docs/questions/native-editor/snippets.md



* updating the section

---------

Co-authored-by: Abed Habli <154609371+abdhabli@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-19 12:30:16 +00:00
github-automation-metabase
6b828bd31b Metabot tool endpoitns should support MBQL5 (#65844) (#66003)
* Metabot tool endpoitns should support MBQL5

* Update filter tool to work with MBQL 5

* Fix find-outliers-wrong-query-test

Was attempting to assoc-in/dissoc-in MBQL4 query keys on an MBQL5 query.

---------

Co-authored-by: Thomas Schmidt <thomas@metabase.com>
Co-authored-by: Mike Appleby <86076+appleby@users.noreply.github.com>
2025-11-19 11:52:18 +00:00
github-automation-metabase
539aa28a27 GDGT-1235 Fix flaky dashboard parameters test (#65902) (#65997)
* Fix flaky test

* Remove broken findDashCardAction helper

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-11-19 09:10:53 +00:00
github-automation-metabase
3cebdd609a Bump Malli to 0.20.0 (#65909) (#65971)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-11-19 07:44:28 +00:00
github-automation-metabase
edae47056d Closes EMB-1021 flaky test e2e tests metabase browser read only mode (#65851) (#65965)
* .

* .

* .

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-11-19 07:33:45 +00:00
github-automation-metabase
76447a8970 Update label placeholder text to Optional for Gauge visualization (#65989) (#65992)
* Update label placeholder text to Optional for Gauge visualization

* Update unit test

Co-authored-by: eliotmetabase <eliot@metabase.com>
2025-11-19 01:38:49 +00:00
github-automation-metabase
5b5e814d9e Turn off db routing for clickhouse and it's trick. (#65984) (#65990)
* Turn off db routing for clickhouse and it's trick.

DB routing needs a "degree of freedom" to run the exact same query
against a different schema/db/instance whatever. Clickhouse only has
database.table. so to db route on the same clickhouse instance you have
to omit the database and let it resolve during query time.

`select * from db.table` can't work. Have to do `select * from table`
and let the connection dictate db1 or db2.

In 56, tables look like this:

```clojure
{:name "upload_records_10k_20251118164620", :schema "db_eafc4346850f435e"}
```

In 57, now they look like this for single db clickhouse things:

```clojure
{:name "upload_records_10k_20251118164620", :schema nil}
```

There are two critical problems here:
1. When uploading, it's not aware to omit the schema. So a table is
created with that schema. During the next sync that table is archived
and a new one with a nil'd schema is created. So the model created for
the uploaded CSV would break as it points to an inactive table. This has
a further compounding issue because now there "appear" to be two schema:
the faked nil one and also a new one like `db_eafc...`.
2. But _all_ tables will be archived in the same manner which were
initially found in 56 or below. These tables will be marked as inactive
and new ones created. Meaning all mbql queries based on clickhouse will
fail.

I wanted to revert this change but there's actually a bit more in the PR
and some conflicts. It also does more than just enabling db-routing so I
think we can perhaps undo the damage in this way more easily.

* remove outdated test

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-11-19 00:30:58 +00:00
github-automation-metabase
4401e6cda7 Fix order by custom expression aggregations (#65937) (#65983)
* fix bigquery order by aggregate custom expression

* add import

* make test work for all drivers

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-11-18 19:46:58 +00:00
github-automation-metabase
49021029f2 🤖 backported "move sdk bundle code to the oss folder" (#65966)
* move sdk bundle code to the oss folder (#65753)

* move the actual sdk folders

* update rspack config and eslint config

* fix relative import in CommonSdkStoryWrapper

* allow default exports in preview.tsx

* update eslint config to allow imports from frontend/src/embedding-sdk-shared

* remove legacy eslint disable directive

* temporarily 'disable' eslint-disable-next-line no-external-references-for-sdk-package-code that has not been ported yet

* update rspack config to use new paths

* update jest config to use new paths

* add `embedding-sdk-package` to restricted imports

* copy eslint files to apply to the new sdk folders

* add eslint-disable-next-line no-restricted-imports to some places where we need emotion

* fix jest setup

* add and use setupEmbeddingSdkEnterprisePlugins

* use `useSetting` instead of `getApplicationColors` to remove enterprise import

* move defineMetabaseAuthConfig to embedding-sdk-shared

* move MetabotProvider to embedding-sdk-bundle

* fix docs generation issue about types

* fix prettier ignore file

* move back tests to ee folder

* remove ../../../ from imports

* fix eslint issues

* fix, again, jest config :sad:

* chore: empty commit to make ci restart

* chore: empty commit to make ci restart

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-11-18 19:07:53 +01:00
github-automation-metabase
bb0e49070b Revise quickstart options for Embedded Analytics SDK (#65830) (#65980)
Reorganized quickstart section for clarity based on user setup.

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-11-18 17:51:19 +00:00
github-automation-metabase
9a0b9d08b9 Allow content-disposition header in cross-origin requests (#65918) (#65951)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-11-18 08:54:21 +00:00
github-automation-metabase
a17766bcea Update snowflake string filtering (#65853) (#65939)
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-11-17 23:13:05 +00:00
github-automation-metabase
a33ecaec07 docs - remote sync rename (#65933) (#65940)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-17 22:32:29 +00:00
github-automation-metabase
a4e15a7fd2 Bump io.netty/netty-common from 4.1.124.Final to 4.2.7.Final (#64827) (#65935)
* Bump io.netty/netty-common from 4.1.124.Final to 4.2.7.Final

Inspect dependency changes here:

* Consolidate deps bumps

---------

Co-authored-by: Cam Saul <github@camsaul.com>
2025-11-17 22:27:32 +00:00
github-automation-metabase
d3c570c727 qp catches circular queries involving both sql and mbql cards (#65875) (#65934)
Co-authored-by: William <william@metabase.com>
2025-11-17 22:10:35 +00:00
github-automation-metabase
087e4ef815 [QP] Allow multiple dashboard/card params to exist, if only one is set (#64428) (#65930)
Fixes #64135.

Previously this code would throw if multiple dashboard and/or card
params were bound to the same SQL variable. Now multiple links are
allowed, provided that only one is actually given a value.

Actually, this logic de-duplicates the values, so if multiple filters
all set the same value, that also works.

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-11-17 21:39:57 +00:00
github-automation-metabase
5b55d9bf7e Better human readable table-data-event for audit-log (#65907) (#65924)
* abstract action-v2-execute events behind table-data-edit for audit-log

* add test

* chore: still publish

Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
2025-11-17 20:02:37 +00:00
github-automation-metabase
6cb0b37ac6 Run Codespell on docs/ (#65925) (#65926)
* Run Codespell on docs/

* Only run of docs/

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-17 19:41:56 +00:00
github-automation-metabase
d04e2f913b Correctly sync routed databases in task (#65441) (#65921)
* Correctly sync routed databases in task

Before:

```clojure
(sync-and-analyze-database*! 598)
2025-11-04 21:30:48,550 INFO task.sync-databases :: Starting sync task for Database 598.
2025-11-04 21:30:48,626 INFO sync.util :: STARTING: Sync metadata for sqlite Database 598 ''airlines'' (free: 0.54G, total: 1.02G, ratio: 0.53)
2025-11-04 21:30:48,650 ERROR sync.fetch-metadata :: Error while fetching metadata with 'db-metadata'
clojure.lang.ExceptionInfo: Anonymous users cannot access a database with routing enabled.
	at
        metabase_enterprise.database_routing.common$router_db_or_id__GT_destination_db_id.invokeStatic(common.clj:30)
        ....
2025-11-04 21:30:48,660 WARN sync.util :: Error in sync step Sync metadata for sqlite Database 598 ''airlines''
clojure.lang.ExceptionInfo: Anonymous users cannot access a database with routing enabled.
2025-11-04 21:30:48,668 INFO sync.util :: FINISHED: Sync metadata for sqlite Database 598 ''airlines'' (42.6 ms) (free: 0.54G, total: 1.02G, ratio: 0.53)
2025-11-04 21:30:48,669 INFO sync.util :: STARTING: Analyze data for sqlite Database 598 ''airlines'' (free: 0.54G, total: 1.02G, ratio: 0.53)
2025-11-04 21:30:48,678 INFO sync.util :: STARTING: step ''fingerprint-fields'' for sqlite Database 598 ''airlines'' (free: 0.54G, total: 1.02G, ratio: 0.53)
```

And afterwards:

```clojure
2025-11-04 21:31:57,593 INFO task.sync-databases :: Starting sync task for Database 598.
2025-11-04 21:31:57,643 INFO sync.util :: STARTING: Sync metadata for sqlite Database 598 ''airlines'' (free: 0.50G, total: 1.02G, ratio: 0.50)
2025-11-04 21:31:57,666 INFO sql-jdbc.execute :: Obtaining a fresh resilient connection
2025-11-04 21:31:57,671 INFO sync.describe-database :: "Tweets": SELECT privileges confirmed
2025-11-04 21:31:57,684 INFO sync.util :: STARTING: step ''sync-dbms-version'' for sqlite Database 598 ''airlines'' (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,693 INFO sync.util :: FINISHED: step ''sync-dbms-version'' for sqlite Database 598 ''airlines'' (9.0 ms) (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,693 INFO sync.util :: STARTING: step ''sync-timezone'' for sqlite Database 598 ''airlines'' (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,696 INFO sync-metadata.sync-timezone :: :sqlite database 598 default timezone is "UTC"
2025-11-04 21:31:57,700 INFO sync.util :: FINISHED: step ''sync-timezone'' for sqlite Database 598 ''airlines'' (7.1 ms) (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,701 INFO sync.util :: STARTING: step ''sync-tables'' for sqlite Database 598 ''airlines'' (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,706 INFO sync-metadata.tables :: :is_writable of Table 6058 ''Tweets'' changed from null to null
2025-11-04 21:31:57,715 INFO sync.util :: FINISHED: step ''sync-tables'' for sqlite Database 598 ''airlines'' (14.1 ms) (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,715 INFO sync.util :: STARTING: step ''sync-fields'' for sqlite Database 598 ''airlines'' (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,743 INFO sync.util :: FINISHED: step ''sync-fields'' for sqlite Database 598 ''airlines'' (27.3 ms) (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,743 INFO sync.util :: STARTING: step ''sync-fks'' for sqlite Database 598 ''airlines'' (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,755 INFO sync.util :: FINISHED: step ''sync-fks'' for sqlite Database 598 ''airlines'' (12.0 ms) (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,755 INFO sync.util :: STARTING: step ''sync-indexes'' for sqlite Database 598 ''airlines'' (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,758 INFO sync.util :: FINISHED: step ''sync-indexes'' for sqlite Database 598 ''airlines'' (3.1 ms) (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,758 INFO sync.util :: STARTING: step ''sync-metabase-metadata'' for sqlite Database 598 ''airlines'' (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,762 INFO sync.util :: FINISHED: step ''sync-metabase-metadata'' for sqlite Database 598 ''airlines'' (4.0 ms) (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,771 INFO sync.util :: FINISHED: Sync metadata for sqlite Database 598 ''airlines'' (128.4 ms) (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,771 INFO sync.util :: STARTING: Analyze data for sqlite Database 598 ''airlines'' (free: 0.50G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,783 INFO sync.util :: STARTING: step ''fingerprint-fields'' for sqlite Database 598 ''airlines'' (free: 0.49G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,794 INFO sync.analyze :: fingerprint-fields Analyzed [************······································] 😒   25% Table 6058 ''Tweets''
2025-11-04 21:31:57,801 INFO sync.util :: FINISHED: step ''fingerprint-fields'' for sqlite Database 598 ''airlines'' (17.8 ms) (free: 0.49G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,801 INFO sync.util :: STARTING: step ''classify-fields'' for sqlite Database 598 ''airlines'' (free: 0.49G, total: 1.02G, ratio: 0.49)
2025-11-04 21:31:57,806 INFO sync.analyze :: classify-fields Analyzed [*************************·························] 😬   50% Table 6058 ''Tweets''
2025-11-04 21:31:57,809 INFO sync.util :: FINISHED: step ''classify-fields'' for sqlite Database 598 ''airlines'' (7.7 ms) (free: 0.49G, total: 1.02G, ratio: 0.48)
2025-11-04 21:31:57,809 INFO sync.util :: STARTING: step ''classify-tables'' for sqlite Database 598 ''airlines'' (free: 0.49G, total: 1.02G, ratio: 0.48)
2025-11-04 21:31:57,817 INFO sync.analyze :: classify-tables Analyzed [*************************************·············] 😋   75% Table 6058 ''Tweets''
2025-11-04 21:31:57,822 INFO sync.util :: FINISHED: step ''classify-tables'' for sqlite Database 598 ''airlines'' (13.0 ms) (free: 0.49G, total: 1.02G, ratio: 0.48)
2025-11-04 21:31:57,827 INFO sync.util :: FINISHED: Analyze data for sqlite Database 598 ''airlines'' (55.4 ms) (free: 0.49G, total: 1.02G, ratio: 0.48)
```

* add a test

this was the best i could do at first. Whats annoying is that sync steps
are so resilient to errors that it's hard to get their return values. So
kinda hate that i'm checking the database log table for task history but
here we are.

* way better tests

* reorder requires

* update module config

* some cloud dbs have multiple tables in the same catalog

the definition of the dataset is:

```clojure
[["t"
  [{:field-name "f", :base-type :type/Text}]
  [["original-foo"]
   ["original-bar"]]]]
```

But cloud databases often fake the separation with things like
prepending the dataset name to the table name to simulate separation
while using only a single catalog or equivalent

* typo

* assert positive integer on total tables

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-11-17 19:03:19 +00:00
github-automation-metabase
7393384666 EAJS wizard should derive a lighter dashboard background color (#65547) (#65919)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-11-17 17:11:23 +00:00
github-automation-metabase
4c1ac01406 Remove custom embedding SDK cors config (#65910) (#65911)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-17 17:13:59 +01:00
github-automation-metabase
c1319ab25a Simplify Snowplow Cypress helpers (#65859) (#65899)
* Remove custom describeWithSnowplow constructs

* Update tests

* Update dev docs

* Log message when sending Snowplow request

* Rename empty describe to 'Snowplow analytics'

* Remove 'describeWithSnowplow' from ESLint rules

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-17 14:06:51 +01:00
github-automation-metabase
62d7ffc4f1 Fix dashboard.backgroundColor: transparent breaking dashboard PDF export (#65847) (#65894)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-11-17 10:19:34 +00:00
github-automation-metabase
f89b726e11 Preparation for moving sdk code to oss folder (#65428) (#65852)
* implement plugins for auth

* move some stuff to the oss folder as those file create issues later on

* make embedding-sdk:docs:generate pass

* move metabot to use plugins

* remove imports from package from other folders

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-11-17 08:46:09 +00:00
github-automation-metabase
2edc17db37 Remove e2e tests for info popovers in field picker (#65883) (#65888)
Removed multiple tests related to info popovers for field picker options and saved questions.

This behavior is already covered with a unit test at:
`frontend/src/metabase/common/components/MetadataInfo/ColumnInfoIcon/ColumnInfoIcon.unit.spec.tsx`

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-17 00:11:45 +00:00
github-automation-metabase
4e6462dad2 Don't set last_used_param_values for public (#64432) (#65876)
Fixes UXW-216

Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-11-15 00:22:23 +00:00
github-automation-metabase
a3c1f5c8ff Fix batch-upsert! method for heterogeneous entries (#65177) (#65877)
* Fix the update keys for postgres search idx upsert

The upsert keys were calculated by looking at the first entry we were
inserting and removing `:id`, `:model`, and `:model_id`.

But the entries are not necessarily homogeneous. In this case, the first
entry is a dashboard (has no `:dashboard_id`) and the second entry is a
card (yes `:dashboard_id`).

This meant we never actually updated the dashboard_id when updating a card.

I attempted to add a test for this:

```
(deftest updates-work-properly
  (mt/with-test-user :rasta
    (mt/with-temp [:model/Dashboard {dash-id :id} {}]
      (let [card-name (str (random-uuid))
            card-id-1 (:id (mt/user-http-request :rasta :post 200 "card/" {:name card-name
                                                                           :collection_id nil
                                                                           :database_id 1
                                                                           :display "table"
                                                                           :creator_id (mt/user->id :rasta)
                                                                           :visualization_settings {}
                                                                           :dataset_query {:type "native" :native {:query "select 123"}
                                                                                           :database 1}}))
            card-id-2 (:id (mt/user-http-request :rasta :post 200 "card/" {:name card-name
                                                                           :collection_id nil
                                                                           :database_id 1
                                                                           :display "table"
                                                                           :creator_id (mt/user->id :rasta)
                                                                           :visualization_settings {}
                                                                           :dataset_query {:type "native" :native {:query "select 123"}
                                                                                           :database 1}}))]
        (mt/user-http-request :rasta :put 200 (str "card/" card-id-1) {:dashboard_id dash-id})
        (is (= [card-name]
               (map :name (:data (mt/user-http-request :rasta :get 200 "search" :q card-name)))))))))
```

The good news is that this test passes after my change. The bad news is
that it also passes without my change. I think what's going on is that
the behavior is different with `*force-sync*` on/off: in async mode, we
get the full batch that contains the updates for `[dashboard, card]`.
In synchronous mode, we get separate batches for `[dashboard]` and then
`[card]`.

I think we might want to rework tests somehow - it would be quite nice
to be able to still run things asynchronously but drain the queue before
making assertions, so the behavior wouldn't be different between
tests/prod.

* add a test

Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-11-15 00:13:19 +00:00
github-automation-metabase
d3168f6c68 Replace snowflake test password auth with key pair auth (#65522) (#65869)
* replace password with key pair auth

* re enable snowflake tests

* add private key env var

* update private key details for temp dbs

* small changes

* fix describe database test

* fix multi method params

* update test

* update test

* try fix

* check CI

i noticed that this tests pass if we don't put a connection-uri in
there. I'm not sure what the original intent was, but the following
works just fine:

```
{:url "jdbc❄️//<account>.snowflakecomputing.com/?schema=INFORMATION_SCHEMA",
 :properties {"use-password" "false",
              "connection-uri" "jdbc❄️//<account>.snowflakecomputing.com/?user=<user>CI&private_key_file=%2Fprivate%2Fvar%2Ffolders%2F1d%2F3ns5s1gs7xjgb09bh1yb6wpc0000gn%2FT%2Fmetabase-secret_8808579641027884666.tmp&schema=INFORMATION_SCHEMA",
              "client_session_keep_alive" "true",
              "timezone" "UTC",
              "warehouse" "<warehouse>",
              "user" "<user>",
              "ssl" "true",
              "private_key_file" "/var/folders/1d/3ns5s1gs7xjgb09bh1yb6wpc0000gn/T/metabase-secret_8808579641027884666.tmp",
              "week_start" "7",
              "application" "Metabase_Metabase",
              "account" "<account>",
              "db" "\"<db>\"",
              "time_output_format" "HH24:MI:SS.FF3",
              "client_metadata_request_use_connection_ctx" "true"}}
```

When it goes through clojure.java.jdbc. Somehow we are getting a
connection string that doesn't play nice. I _think_ it may just be an
issue with snowflake but i'm not positive.

* remove parallel test markers

* remove parallel marker

when running tests locally with these removed:

```clojure
(run/find-and-run-tests-repl {:only 'metabase.driver.snowflake-test})
...
Ran 49 tests in 116.525 seconds
502 assertions, 1 failure, 0 errors.
{:test 49, :pass 501, :fail 1, :error 0, :type :summary, :duration 116525.006833, :single-threaded 32, :parallel 17}
```
yields only one expected error. Previously using regular stuff also
worked

```clojure
snowflake-test=> (run-tests)

Testing metabase.driver.snowflake-test

Ran 49 tests containing 502 assertions.
1 failures, 0 errors.
{:test 49, :pass 501, :fail 1, :error 0, :type :summary}
```

(again the single test that failed). but using the CLI tool i would get
errors when running them in parallel.

* fixup stupid snowflake

1. i don't know why we are running into multithreading issues now. But
i've removed those tags and the issues are gone.
2.

```clojure
snowflake-test=> (let [spec {:connection-uri "jdbc❄️//account.snowflakecomputing.com/?schema=INFORMATION_SCHEMA&user=<user>&password=<password>&db=%22v5_airports%22"}]
                   [(jdbc/query spec ["select CURRENT_DATABASE() db"])
                    (jdbc/query spec ["select CURRENT_SCHEMA() db"])])
 [({:db "v5_airports"}) ({:db "INFORMATION_SCHEMA"})]
snowflake-test=> (let [spec {:connection-uri "jdbc❄️//account.snowflakecomputing.com/?schema=INFORMATION_SCHEMA&user=<user>&password=<password>&db=v5_airports"}]
                   [(jdbc/query spec ["select CURRENT_DATABASE() db"])
                    (jdbc/query spec ["select CURRENT_SCHEMA() db"])])
[({:db nil}) ({:db nil})]
```

In the above, note that putting the db in the connection string _and
url-encoding it_ (it's already quoted) is necessary.

* conditionally add db

in tests there's not a database so just be smart about it:

```clojure
{:warehouse "<warehouse>",
 :additional-options nil,
 :timezone "UTC",
 :db nil,
 :account "<account>",
 :use-password false,
 :time_output_format "HH24:MI:SS.FF3",
 :user "<user>",
 :subname "//<account>.snowflakecomputing.com/"}
```

* address pr comments

* remove outdated comment

pretty freaky comment eh? I added this when i commented out the
`handle-conn-uri` call underneath it and it caused tests to pass. That
was helpful in identifying the mechanism, but not a good solution. Put a
comment here so that that was not a final state, forgot to remove
comment when we got to a proper final state and `handle-conn-uri` was
fixed.

---------

Co-authored-by: Riley Thompson <riley@metabase.com>
Co-authored-by: dan sutton <dan@dpsutton.com>
2025-11-14 21:53:38 +00:00
github-automation-metabase
851a53b163 [QP] Only label remaps for columns that actually need it (#65860) (#65868)
Fixes #65726.

If you implicitly joined a field that happened to be the target of a
remapping, the QP was labeling it as `:remapped_from` the FK even
though (a) it wasn't really remapped and (b) there was no
corresponding FK column marked as `:remapped_to` the target column.

(Eg. `Orders.PRODUCT_ID` is remapped to `Products.TITLE`. Then I
implicitly join `Products.TITLE` directly and the QP marks it as
remapped from `Orders.PRODUCT_ID` even though it wasn't.)

That caused the FE to do odd things like drop and relabel columns.

This change adjusts the QP so it will ignore plausible remappings that
don't actually get returned from the last stage.

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-11-14 19:48:36 +00:00
github-automation-metabase
0f37bd54c6 Suppress liquibase output (#65858) (#65864)
We get a bunch of this useless stuff in CI:

```
Placeholder until other changesets

UPDATE SUMMARY
Run:                        641
Previously run:               0
Filtered out:                69
-------------------------------
Total change sets:          710

FILTERED CHANGE SETS SUMMARY
DBMS mismatch:               69
```

Looking for this in liquibase this is not logged but printed to the
console :(.

It goes through this:

```java
    private static void writeMessage(String message, UpdateSummaryOutputEnum showSummaryOutput, OutputStream outputStream) throws LiquibaseException {
        switch (showSummaryOutput) {
            case CONSOLE:
                writeToOutput(outputStream, message);
                break;
            case LOG:
                writeToLog(message);
                break;
            default:
                writeToOutput(outputStream, message);
                writeToLog(message);
        }
    }
```

So we want that enum to be LOG.

```clojure
liquibase=> (clojure.reflect/reflect liquibase.Liquibase)
{:bases #{java.lang.Object java.lang.AutoCloseable},
 :flags #{:public},
 :members #{ ,,,
             #clojure.reflect.Method{:name setShowSummaryOutput,
                                    :return-type void,
                                    :declaring-class liquibase.Liquibase,
                                    :parameter-types [liquibase.UpdateSummaryOutputEnum],
                                    :exception-types [],
                                    :flags #{:public}}
          ,,,}}
```

So easy fix. Set this enum and hopefully it shuts up.

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-11-14 18:48:48 +00:00
github-automation-metabase
befd9bc11e Fix athena sync 65728 (#65777) (#65863)
* claude fix

* simplify

* handle nested fields for athena

* nfc have position 0

* set non leafs as details only

* clean up parser and add tests

* whitespace

* disable nested fields

* kondo

* kondo

* disable nested schema test

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-11-14 18:31:15 +00:00
github-automation-metabase
32f724e094 Fix append for CSVs with really long column names with shared prefixes (#65793) (#65856)
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2025-11-14 17:17:49 +00:00
github-automation-metabase
0f6df45cf4 docs - document links new charts (#65828) (#65861)
* links and new charts

* links

* edits

* Update docs/documents/introduction.md

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-11-14 17:14:40 +00:00
github-automation-metabase
f03f9fbd6b Revert param values from query results (#65841) (#65850)
* Revert "Adjust cards-with-filters to work with action cards (#65805)"

This reverts commit d6b857a2c6.

* Revert "Fix mapping of params to later query stages (#65651)"

This reverts commit c98e640426.

* Revert "Compute param values from card results (#64318)"

This reverts commit 2693173e7f.

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-11-14 15:05:56 +00:00
github-automation-metabase
dfdf323be1 fix(sdk-bundle): Fix EditableDashboard sometimes doesn't show the correct tab (#65802) (#65836)
* Fix SDK save dashboard question to not show collection/dashboard picker

* Fix EditableDashboard sometimes doesn't show the correct tab on first render

* Add an assertion

* left some breadcrumbs

* Update unit tests to be async

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-11-14 04:27:26 +00:00
github-automation-metabase
7521a727d7 remove flaky tag (#65741) (#65829)
Co-authored-by: Fraser <fraser@metabase.com>
2025-11-13 23:00:40 +00:00
github-automation-metabase
2a122f4720 Fix code that populates :used_tables in metabot context (#65787) (#65827)
* Fix code that populates :used_tables in metabot context

This was causing :used_tables to be absent in the :user_is_viewing
context, limiting metabot's ability to get sql fixing right without
information about the available tables and their fields.

Call lib-be/normalize-query and lib/native-only-query? in
metabase-enterprise.metabot-v3.context/query-for-sql-parsing and
likewise use lib funcs to get template-tags in
metabase-enterprise.metabot-v3.query-analyzer.parameter-substitution/replace-tags

* Update ai-sql-fixer and tests to work with MBQL5 queries

* Fix metabot-v3.table-utils-test to use MBQL5 queries

Conflicts:
	enterprise/backend/test/metabase_enterprise/metabot_v3/context_test.clj

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-11-13 22:41:47 +00:00
github-automation-metabase
cfe47f65d8 Rename handleLink.tsx to handlelink.tsx (#65821) (#65822)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-11-13 20:07:37 +00:00
github-automation-metabase
8f80d29ca5 🤖 backported "Add purchase page for paid Metabase AI add-on" (#65764)
In #62513 we added a page to offer a Metabase AI (Metabot) trial.  Now
we want to offer to purchase the paid Metabot add-on.

### How to verify

1. Ensure you have a token with the `offer-metabase-ai-tiered`
   feature, but without the `metabot-v3` and `offer-metabase-ai`
   features.
2. Ensure you have a Metabase API key linked to that same token.
3. Navigate to `/admin/metabot` and see a page offering you to purchase
   different quantities of Metabot queries.
4. Select a quantity (or go with the default of 500), check "I agree",
   then click "confirm purchase".
5. Confirm that your token now has the `metabot-v3` feature and the
   associated subscription has an appropriate Metabase AI product.

### Checklist

- [x] Tests have been added/updated to cover changes in this PR

### Notes

* Rename MetabotPurchasePage to MetabotTrialPage
  - and add the page for the purchase of the paid add-on as
    `MetabotPurchasePage`, to make the name more clearly represent the
    purpose (paid vs. trial).
* Move frontend client for /api/ee/cloud-add-ons into metabase-enterprise/api
* Use ts-pattern instead of hand-crafted type guards in Metabot trial page
* Don't swallow errors when submitting Metabot purchase form
* Create Redux selector to derive isStoreUser
* Test failures to purchase Metabot trial
* Adjust implementation of POST /api/ee/cloud-add-ons/:product-type to dashes instead of underscores
* Require accepting terms of service for Metabot trial
* Move RTK and Formik error handling for Metabot into utils.ts
* Avoid use of any type in Metabot Formik error handling
* Improve control flow with side effects
* Fix typo in log message

This also backports "Proxy apis for store to get plan and addons (#65423)",
but without the python-execution bits.

Closes: https://linear.app/metabase/issue/CLO-4423/allow-to-buy-metabase-ai-from-the-admin-under-a-token-feature
References: https://github.com/metabase/metabase/pull/62513
Co-authored-by: Benoit Vinay <ben@metabase.com>
Co-authored-by: Ngoc Khuat <ngoc@metabase.com>
2025-11-13 13:48:28 -06:00
github-automation-metabase
43ecb497ba Adjust cards-with-filters to work with action cards (#65805) (#65815)
* Fix cards-with-filters, not all cards have with mapped filters dataset_query

* Check also dataset-query

* Comments

* Test

* grammar

* Update src/metabase/parameters/dashboard.clj



---------

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-11-13 18:56:35 +00:00
github-automation-metabase
40d36dca3e fix(sdk-bundle): Temporarily hide the incompatibility banner (#65813) (#65817)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-11-13 18:53:56 +00:00
github-automation-metabase
9bd81795d7 docs: click behavior limitation (#65809) (#65811)
* Add click behavior setup information to introduction

* Update docs/embedding/sdk/introduction.md



---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-13 17:10:13 +00:00
github-automation-metabase
4b6b34b243 🤖 backported "Update the delete button copy for better UX" (#65746)
* Update the delete button copy for better UX (#65688)

* Update the delete button copy for better UX

* Apply suggestions from code review

Co-authored-by: Phoomparin Mano <poom@metabase.com>

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>

* Update screen reader description to match the new menu copy (#65747)

* Update screen reader description to match the new menu copy

* Update frontend/src/metabase/embedding/components/ArchiveButton.tsx

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>

---------

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
2025-11-13 14:21:41 +00:00
github-automation-metabase
23cc43cfe0 Preserve document cards width on reorder (#65768) (#65776)
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-11-13 14:12:02 +00:00
github-automation-metabase
708a98d0de Fix mapping of params to later query stages (#65651) (#65791)
* Fix nested field mapping

* whitespace

* Update src/metabase/lib/util.cljc



* Remarks

---------

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-11-13 09:16:44 +00:00
github-automation-metabase
70c241c54b Closes EMB-988 flaky test (#65745) (#65795)
* closes EMB-988 flaky test

* .

* .

* .

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-11-13 09:06:26 +00:00
Oleksandr Solovyov
9076976e5b [backport] request cancellation (#65461) (#65538) (#65660) (#65790)
* metabot: handle (and propagate) request cancellation (#65461)

* metabot request cancelation (#65538)

this time it is actually working and tests are synchronized with real-world behavior

* request cancelation: this time for real (#65660)

Transfer-Encoding: chunked will cause Apache HttpClient to wrap body in ContentLengthInputStream,
which, in turn, quote: "NEVER closes the underlying stream".

So 'with-open' closing the stream was never propagated. And the new test with transfer-encoding
header captures that.
2025-11-13 10:56:07 +02:00
github-automation-metabase
589f4e828a docs(sdk): Update Readme version references and published npm version to 0.57.0 (#65792) 2025-11-13 08:25:04 +00:00
Mahatthana (Kelvin) Nomsawadi
69f9d59928 Correct the gold release version for real (#65789) 2025-11-13 07:52:27 +00:00
Mahatthana (Kelvin) Nomsawadi
38ea9f7461 Update package version, removing beta (#65784) 2025-11-13 07:17:13 +00:00
Mahatthana (Kelvin) Nomsawadi
8392dcfe11 Update release process (#65781) 2025-11-13 03:49:41 +00:00
github-automation-metabase
cbfee21573 Documents new questions (#65504) (#65775)
* Temp

* Add creation modal for structured questions

* Added full implementation for structured questions

* Added full implementation for structured questions

* Added full implementation for native questions

* Refactor question type picker to menu items

* Add proper keyboard navigation, add premissions check

* Add basic e2e tests

* Add basic e2e tests

* Fix types

* Fix types

* Fix types

* Self review

* Self review

* Review fixes - default display, native title

* Add e2e for viz

* Fix unit tests

* Fix e2e tests

* Fix e2e tests

* fix saving an empty question

* Review fixes

* Fix issue with keyboard trigger

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-11-13 00:17:09 +00:00
github-automation-metabase
fa13300e22 Remove unused mb_user_defaults env var (#65725) (#65770)
Cloud never used this to pre-fill the user on MB setup.
We have the same functionality with way less code available today, either way.

Instead of:
```
/setup/user_defaults#123456
```

do this:
```
/setup?first_name=John&last_name=Doe
```

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-12 22:42:06 +00:00
github-automation-metabase
407082383f Load plugin manifest in e2e run mode (#65729) (#65771)
When we introduced a new e2e run mode, we didn't realize this piece of code needs to be updated as well.
For people who were running the backend from source (but using e2e mode) some drivers might not have worked. Example:
```
"message": "No method in multimethod 'connection-properties' for dispatch value: :sqlite"
```

This commit fixes that.

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-12 22:21:47 +00:00
github-automation-metabase
70a18f22c9 docs: more new plugins + typechecked snippet for links (#65767) (#65769)
* new plugins

* Update docs/embedding/sdk/plugins.md



---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-12 21:23:02 +00:00
github-automation-metabase
c00c11a24e Feat: Document link editing (#65399) (#65766)
Co-authored-by: Brad Anderson <brad@metabase.com>
2025-11-12 20:47:23 +00:00
github-automation-metabase
f26616f20e Allow return to focus body of Documents (#65732) (#65763)
Co-authored-by: Maz Ameli <maz@metabase.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
2025-11-12 20:46:30 +00:00
github-automation-metabase
2c8548406b docs(sdk): Update Readme version references and published npm version to 0.57.0-beta.1 (#65762) 2025-11-12 19:41:39 +00:00
github-automation-metabase
0926566cc7 document MB_NOTIFICATION_TEMP_FILE_SIZE_MAX_BYTES (#65751) (#65757)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-12 19:28:45 +00:00
github-automation-metabase
ec2b517940 Update chart colors explanation in appearance.md (#65758) (#65759)
Clarified the explanation regarding the order of chart colors.

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-11-12 19:19:23 +00:00
github-automation-metabase
0f01091a3b docs: dependencies polish (#65754) (#65755)
* dependencies polish

* Optimized 2 images, saved 109.1 KB (48.5% smaller)

* reword

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-11-12 18:11:47 +00:00
github-automation-metabase
3a59aab82f Fix static embedding or public embed outside iframe not working with #theme (#65740) (#65749)
* Fix static embedding or public embed outside iframe not working with #theme

* Add tests

* Make embedding prefix/suffix naming consistent

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-11-12 16:04:07 +00:00
github-automation-metabase
991dd69883 unstemmed words should still appear in search (#64560) (#65744)
This is done by putting them in the full-text index using a 'simple' stemmer, just with a lower priority than a normal
stemmed words are.

Fixes #60649

Co-authored-by: Oleksandr Solovyov <alexander@solovyov.net>
2025-11-12 11:31:10 +00:00
github-automation-metabase
b203488f1c Closes UXW-2237 click on admin logo error (#65581) (#65738)
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-11-12 06:41:49 +00:00
github-automation-metabase
8536c5c60c Fix: UXW-2235 Prevents 403s from SmartLinks from hiding the whole document (#65609) (#65721)
* UXW-2235 Prevents 403s from SmartLinks from preventing the whole document from showing (SmartLink renders with "No access" version instead)

* UXW-2235 Adds e2e tests

Co-authored-by: Brad Anderson <brad@metabase.com>
2025-11-11 21:53:07 +00:00
github-automation-metabase
b5d440f44c changelog link (#65717) (#65722)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-11 21:30:50 +00:00
github-automation-metabase
50c6890b0c Add /livez and /readyz endpoints (#64479) (#65719)
* Add /livez and /readyz endpoints

* nit comment

* Update tests with new endpoints

* Update src/metabase/server/routes.clj



* bad bot

* fix tests

* fix license test failure

https://github.com/metabase/metabase/pull/65034 bumped some jetty deps
from 12.0.24 to 12.1.3. Along for the ride came a new org:

```
org.eclipse.jetty.ee9.websocket/jetty-ee9-websocket-jetty-server 12.1.3
  X org.eclipse.jetty.ee9/jetty-ee9-servlet 12.1.3 :use-top
  . org.eclipse.jetty.ee9/jetty-ee9-webapp 12.1.3
    . org.eclipse.jetty/jetty-xml 12.1.3
      . org.eclipse.jetty/jetty-util 12.1.3
      X org.slf4j/slf4j-api 2.0.17 :use-top
    . org.eclipse.jetty.ee/jetty-ee-webapp 12.1.3 <--- new
```

This has a new org of `org.eclipse.jetty.ee` and no discernable license
in the pom or the jar.

Refresher we look in the pom for things like

```
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
```

or in the jar for some common names of licenses, like in this mysql
connector jar:

```
  -rw-r--r--     134  18-Sep-2023 19:11:56  INFO_SRC
  -rw-r--r--   71049  18-Sep-2023 19:11:56  LICENSE
  -rw-r--r--    1624  18-Sep-2023 19:11:56  README
  -rw-r--r--     846  18-Sep-2023 19:12:04  META-INF/INDEX.LIST
```

I didn't see a license at either of these spots, but consulted
https://mvnrepository.com/artifact/org.eclipse.jetty.ee/jetty-ee-webapp
to see it listed as Apache 2.0 and EPL 2.0

---------

Co-authored-by: Rodrigo López Dato <rodrigo@metabase.com>
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
Co-authored-by: dan sutton <dan@dpsutton.com>
2025-11-11 21:30:23 +00:00
github-automation-metabase
f09aaf057f generate command docs (#65608) (#65711)
* generate command dox

* clean-up

* restore command.md

* clean-up

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-11 17:31:57 +00:00
github-automation-metabase
7d7af0545a [perf] Improve quadratic lookups in add-alias-info (#65595) (#65709)
Part of #64774.

Replaces quadratic (refs * columns) search in `add-alias-info` with map lookups
by ID and `:lib/source-column-alias`. They don't always succeed, but I ran the tests with a fallback case
that checked the old quadratic way too - in no case does the new match fail but the old way succeed.

- Speeds up the basic query of wide tables (see `qp.perf-test`) about 7x, from 8825ms to 1435ms.
- Reduces the big user query from #64774 from 205ms to 145ms on my machine.

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-11-11 17:03:57 +00:00
github-automation-metabase
70ec7e7884 [perf] Remove unnecessary MBQL 4 -> 5 -> 4 round trips in SQL drivers (#65509) (#65698)
Part of #64774.

Now that most of the query processor machinery has been ported to use MBQL 5 and the `metabase.lib.core`
functionality, there were several needless round trips between MBQL 4 and 5.

The `driver.sql.qp/preprocess` function was converting queries from MBQL 5 to 4 up front,
and then each of three inner operations (now implemented in MBQL 5) were wrapped to convert 4 to 5 and back.

Removing this wasted effort reduced the time on my machine for the big user query from #64774 from 205ms to 145ms.

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-11-11 16:21:37 +00:00
github-automation-metabase
cef18f9600 Fix flaky 'models.cy.spec.js' test (#65690) (#65696)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-11-11 15:16:42 +00:00
github-automation-metabase
d0baa1526b docs: Update api changelog (#65663) (#65694)
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-11-11 14:53:01 +00:00
github-automation-metabase
4bac750de2 Remove unused metabase.util.formatting.numbers and metabase.util.formatting.time (#63791) (#65391)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-11-11 13:46:05 +01:00
github-automation-metabase
b914a342e2 [Metabot] Misc. bug fixes (#65255) (#65673)
* fix cut not removing text from input

* ensure we fetch all data for all possible models for smart links

* remove unused comment

* fixes smart links in metabot input sometimes degrading into their text representation and fixes some cases where wrong model name ("model" instead of "dataset") was used for metabot links

* fix unit tests

* fix phantom selection when cutting value from input (context: https://github.com/metabase/metabase/pull/65255\#pullrequestreview-3436250849)

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-11-11 13:44:06 +01:00
github-automation-metabase
0712b14ddb fix(sdk): Accept an entity id as a target collection id for CreateQuestionModal (#64601) (#65617)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-11-11 12:30:09 +00:00
github-automation-metabase
4d510c6fc4 Close New Modals when pathname is changing (#65472) (#65656)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-11-11 11:26:27 +00:00
github-automation-metabase
cf7228e6b5 Avoid DDL races in redshift sync (relation does not exist error) (#65546) (#65587)
- catalog metadata is not transactional in redshift
- calls like pg_catalog.has_schema_privilege when using a string argument will resolve the oid of the schema/table etc
- if the oid cannot be resolved (e.g. table/schema does not exist) an error is thrown

We occasionally see sync failed due to relation does not exist, one cause might be concurrent test runs / cleanup deleting tables/schemas while running.

I have fixed the first half of the union to use the oid form of these calls which will result in NULL instead of an error while racing with DDL in other runs.

Need to research on external tables before changing the external table sub-query: probably want to join to svv_external_schemas and use the oid there, but not 100% yet.

Co-authored-by: Dan Stone <wotbrew@gmail.com>
2025-11-11 10:12:23 +00:00
github-automation-metabase
096b37cc1f fix: update harbormaster API use, and support public openapi schema (#65549) (#65650)
* fix: update harbormaster API use

The Harbormaster API was updated to use snake_case in all params
and returns in https://github.com/metabase/harbormaster/pull/6663.

There's an backwards compatible interim period where it will support both kebab-case and snake_case in params, and keep existing returns.
The changes in this PR will make Metabase forwards and backwards compatible with the Harbormaster API changes.

After the interim period, the Harbormaster API will only take and return snake_case data.

* feat: support missing api key on hm.client/call

The OpenAPI spec is now public and the api key is not mandatory.

Co-authored-by: Filipe Silva <filipematossilva@gmail.com>
2025-11-11 10:11:04 +00:00
github-automation-metabase
024336ad4b [perf] New MetadataProvider and query derived from a real perf issue (#65508) (#65606)
This has been a very valuable benchmark for processing complex queries,
especially large `:case` statements and nested aggregations.

Adding it with some REPL-able benchmarks in `query-processor.perf-test`.

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-11-11 06:48:21 +00:00
github-automation-metabase
db24323e27 Drop clipboardy (#65675) (#65679)
Co-authored-by: Fraser <fraser@metabase.com>
2025-11-11 04:30:44 +00:00
github-automation-metabase
6cd419141b Fix postgres bytea truncation (#65569) (#65678)
* fix postgres bytea truncation

* use = over =?

* Add issue ref in test

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-11-10 23:37:10 +00:00
github-automation-metabase
30301eb32c Fix Collection Tree Collapsing (#65620) (#65659)
* actually just be smart

* consistent change detection

* remove dead code

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-11-10 23:36:12 +00:00
github-automation-metabase
838be58fb3 Remove-replace cleans up empty first stages when reasonable (#65565) (#65670)
If you have an empty first stage followed by "real" later stages, the frontend produces duplicate buttons in the query
builder.  Cleaning those stages up removes those buttons.

Co-authored-by: William <william@metabase.com>
2025-11-10 23:18:56 +00:00
github-automation-metabase
0b4f0379aa Metabot /debug mode to show tool calls (#64811) (#65677)
* add debug message type for tool calls

* rename toolCalls -> activeToolCalls

* Basic debug mode slash command to hide/show tool calls

* ToolCallDetailsModal + better formatting

* Fix type

* Fix types, some simplification

* Address minor bot comments

* small changes

* move AgentToolCallMessage into its own file and add copy buttons + tool call id to modal

* fix copied value

* add unit tests

* move failure case further downstream to mitigate any possible customer issue

* ci fixes

---------

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
2025-11-10 21:38:02 +00:00
github-automation-metabase
261a373ad1 Cell count for notifications temp storage (#65518) (#65671)
* ditch our manual batches of rows for bufferedwriter

Q: Why did we use a manual batch at first?
A: i noticed it was super slow and worked around this. Then realized i
was gzipping it so that was the actual slowdown. The batching was
already done and it didn't hurt anything.

Q: Why get rid of it then?
A: want to move to "cell" based counting. Rows are fine until they get
really wide and then 300 columns * 5,000 rows = 1,500,000 cells in
memory at once. Put some strings in there and we blow up. So lets switch
to cell counting rather than row counting. This is way easier if we only
care about number of rows or cells when holding them in memory. Don't
have to count the batch ourself when streaming. So if that goes row by
row, we just watch for the number of cells as the trigger to switch to
streaming and we are done.

```clojure
temp-storage-test=> (time
                      (mt/test-driver :postgres
                        (select-keys (mt/process-query (mt/native-query {:query "SELECT
    row_num AS id,
    -- Random Integer between 1 and 100000
    floor(random() * 100000 + 1)::INTEGER AS random_int,
    -- Random Float
    (random() * 1000)::NUMERIC(10, 4) AS random_float,
    -- Random Date within the last 5 years
    (current_date - (random() * 5 * 365)::INTEGER)::DATE AS random_date,
    -- Random Timestamp within the last 30 days
    (NOW() - (random() * 30 * '1 day'::interval)) AS random_timestamp,
    -- Random String: Generates a random alphanumeric string about 1000 characters long
    (
        SELECT string_agg(
            chr(
                (CASE WHEN random() < 0.5 THEN 65 ELSE 97 END) + (random() * 25)::INTEGER
            ),
            ''
        )
        FROM generate_series(1, 1000)
    ) AS random_string
FROM
    generate_series(1, 500000) AS row_num;"})
                                                       (temp-storage/notification-rff 2000 :testing))
                                     [:row_count :status :data.rows-file-size :notification/truncated?])))
"Elapsed time: 1457.921083 msecs"
{:row_count 15184,
 :status :completed,
 :data.rows-file-size 16369108,
 :notification/truncated? true}
```

* Switch to cell based counts, not rows

We found in practice some people might have queries with 300
columns. When we keep 5,000 of those in memory, we end up having
1,500,000 cells in memory at once. We then are open again to OOM
issues. So this swaps over to a cell basec count rather than rows to be
a bit more granular.

* Change from 2,000 rows to 20,000 cells

the thinking here is 2,000 rows with 10 values. It's pretty arbitrary though

* rename var for cells to disk threshold

* i have to delete this test because i used `time` in a comment block

* formatting fix

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-11-10 21:15:42 +00:00
github-automation-metabase
d53701ffe4 Display "previous results" when a join's conditions specify multiple lhs tables (#65239) (#65667)
When a join's conditions came from multiple tables, we used the first table as the table name, even though some of the cols came from a different table. We now display "Previous results" to denote that the lhs columns are from different tables.

Co-authored-by: William <william@metabase.com>
2025-11-10 18:37:00 +00:00
github-automation-metabase
3ea9af4582 fix: batch delete data perms (#65567) (#65657)
* fix: batch delete data perms

To workaround postgresql parameter limits in the delete query

* Update src/metabase/permissions/models/data_permissions.clj



* Update src/metabase/permissions/models/data_permissions.clj



* Update data_permissions.clj

---------

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2025-11-10 15:35:29 +00:00
github-automation-metabase
aab36af6e0 Gdgt 910 rework look and feel of color settings in gauge (#65552) (#65629)
* updated segments ui

* sober up the needle

* setting up unit tests

* make gauge needle opaque

* remove key, update unit test

Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-11-10 13:13:01 +00:00
Nicolò Pretto
ed601509bb remove embedding team from codeowners on release branch (#65648) 2025-11-10 10:14:10 +01:00
github-automation-metabase
d393b51aaa Fall back to the staging token check (#65474) (#65582)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-10 08:54:15 +01:00
github-automation-metabase
3899b067c6 Closes EMB-970 move some callbacks to MetabaseGlobalPluginsConfig (#65590) (#65634)
* Closes EMB-970 move some callbacks to MetabaseGlobalPluginsConfig

* types

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-11-10 04:15:15 +00:00
github-automation-metabase
866c8bc215 [insights] Convert BigDecimals into Doubles early in the pipeline (#65234) (#65640)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-11-10 00:35:43 +00:00
github-automation-metabase
1b3bc1182e [normalize] Optimize metabase.lib.schema.util (#63470) (#65636)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-11-08 23:11:00 +00:00
github-automation-metabase
69327af9f7 [flake] Increase test timeout in metabase.app-db.liquibase-test (#64814) (#65488)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-11-08 21:30:30 +00:00
github-automation-metabase
51a17b7a1b [mage] Use Babashka to run cljfmt on staged files in git pre-commit hook (#65026) (#65489)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-11-08 21:21:55 +00:00
github-automation-metabase
075ae6649c Add creator_id for transform (#65388) (#65446)
* Add creator_id for transform

Closes QUE-2715

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-11-08 09:57:36 +00:00
github-automation-metabase
42197eabb1 Remove special embedding-sdk e2e test case (#65594) (#65619)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-08 00:15:23 +00:00
github-automation-metabase
68fe321aea docs: new sdk click and link behavior (#65627) (#65632)
* new click and link behavior

* Apply suggestions from code review



* handle handlelink

* fix typo

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-07 23:27:51 +00:00
github-automation-metabase
2341bea438 Use transparency instead of white for table color ranges (#65426) (#65626)
* Use transparency instead of white for table color ranges

* adding visual tests

Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-11-07 21:53:46 +00:00
github-automation-metabase
45b76ce7f6 docs - remote sync edit (#65625) (#65628)
* turning off remote sync

* theme toggling in command palette

* edtis

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-07 21:19:09 +00:00
github-automation-metabase
39e89ed0fa update color scheme for google button (#65558) (#65611)
* update color scheme for google button

* Adding a comment like I was supposed to

Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-11-07 20:04:52 +00:00
github-automation-metabase
003d3c8d3c Document supported databases for model persistence (#65621) (#65622)
Added section listing databases that support model persistence.

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-11-07 19:26:45 +00:00
github-automation-metabase
8e6a3851e2 fix(modular): fix downloads on dashboards loaded by entityIds (#65613) (#65615)
* fix(modular): fix downloads on dashboards loaded by entityIds

* tests

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-11-07 18:40:30 +00:00
github-automation-metabase
3a3afd037e UXW-2179 Replace 'Add to dashboard' modal with a toast (#65400) (#65570)
* UXW-2179 Replace 'Add to dashboard' modal with a toast

* fix some e2e tests

* Fix more e2e tests

* Fix more e2e tests

* Fix more e2e tests

* Design fix

* Fix e2e

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-11-07 17:10:06 +00:00
github-automation-metabase
4949afecc8 Update generated docs (release-x.57.x) (#65614)
Co-authored-by: github-actions <github-actions@github.com>
2025-11-07 17:02:30 +00:00
github-automation-metabase
d27b04c202 fixed flaky (#65599) (#65603)
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-11-07 15:24:56 +00:00
github-automation-metabase
2db8cf4c7f Add flag to skip search reindexing on import (#65537) (#65554)
* Add flag to skip search reindexing when loading entities

* Test flag

Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2025-11-07 08:44:28 -06:00
github-automation-metabase
da205abf6c fix(embed-js): black background is shown on systems with dark mode preferences (#65534) (#65591)
* reverts the color-scheme meta tag

* adds the color scheme meta tag if entry point is not embed-sdk

* add backend tests for color-scheme meta tags

* add a cypress test for color-scheme

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-11-07 14:29:46 +00:00
github-automation-metabase
b0b0c5e927 Fix docs scalar version (#65553) (#65579)
* Fix docs

it throws an error in the js console about webassembly not having the
right permissions

Two ways to fix: give permissions, or rollback to a version that works.

I'm pinning to a version that works since we are close to a release.

39.2 breaks, 39.1 works.
I'm also including the recommended stylesheets

In the meantime, i'm going to investigate
resources/openapi/index_external.html.mustache as i'm not sure what uses
this and if it needs to be updated or deleted. Perhaps used by `clojure
-M:ee:doc api-documentation`?

* switch template to pinned 39.1 version

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-11-06 23:35:35 -05:00
github-automation-metabase
c2a115fcc6 docs - metabot can use the glossary (#65562) (#65563)
* metabot can use the glossary

* link to glossary

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-06 21:55:24 +00:00
github-automation-metabase
8e80912ffe docs: for for for for for for (#65559) (#65561)
* Fix typo in 'Checking for breaking changes' section

* Fix typo in 'Checking for breaking changes' section

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-11-06 21:16:40 +00:00
github-automation-metabase
e319751425 docs: dependencies on save (#65450) (#65557)
* Add breaking changes detection information

Added section on checking for breaking changes when saving questions, models, or metrics.

* Add breaking changes check to model editing documentation

Added section on checking for breaking changes when saving a model.

* Apply suggestions from code review



---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-06 20:26:40 +00:00
Ryan Laurie
56d583d251 backport release log workflow update (#65490) 2025-11-06 10:51:04 -07:00
github-automation-metabase
51a3de2534 docs - remote sync (#65443) (#65550)
* embedding collections

* image, edits, and embedding example

* various edits

* edits

* edits and images

* more edits

* Optimized 4 images, saved 235.2 KB (36.0% smaller)

* library to synced collection

* fix links

* Update docs/installation-and-operation/remote-sync.md



* Update docs/installation-and-operation/remote-sync.md



* edits

* edits



* edits

* more edits

* clean up

* edit

* clean up

* dev instance

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-11-06 17:39:50 +00:00
github-automation-metabase
0809740cc5 feat: make metabot logo follow the bran colors (#65358) (#65483)
# Conflicts:
#	frontend/src/metabase/common/components/MetabotLogo/MetabotLogo.stories.tsx

# Conflicts:
#	loki.config.js

Co-authored-by: Jakub Chodorowicz <jakub.chodorowicz@metabase.com>
2025-11-06 13:09:04 -04:00
github-automation-metabase
4ff061dc0b use new library icon for remote-synced collections (#65251) (#65539)
* show new library icon

* UXW-2115 Address PR feedback - makes it so only the Library uses the synced collection icon, not the nested subdirectories

* UXW-2115 Fix getCollectionType condition

* UXW-2115 Removes unnecessary type changes

* UXW-2115 Reverts changes for synced collection icon

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
2025-11-06 16:03:23 +00:00
github-automation-metabase
4bd67d9023 Update impersonation.md to include Starburst/Trino (#65542) (#65544)
Added Starburst/Trino to the list of supported databases for impersonation.

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-11-06 15:40:12 +00:00
github-automation-metabase
8e837e295d Updates 35 SVG illustrations (#65232) (#65368)
* Updates 35 SVG illustrations

The same asset now works well for both light and dark mode.

* branding OnboardingIllustration, adding cloug and bug metabot to metabot logo

* PR Feedback

---------

Co-authored-by: AlessioLaiso <7041012+AlessioLaiso@users.noreply.github.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2025-11-06 14:56:06 +00:00
github-automation-metabase
b06c657757 🤖 backported "Removing new badge for move questions into their dashboards" (#65506)
* removing new badge for move questions into their dashboards (#65485)

* Remove unneeded tests after #65485 (#65517)

---------

Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-06 09:30:47 -04:00
github-automation-metabase
ae408adb88 fix large command palette subtext elements, add loki testing (#65369) (#65429)
* fix large command palette subtext elements, add loki testing

* how did I miss this?

* updating Overlay demo

Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-11-06 13:29:18 +00:00
github-automation-metabase
c31bb26f7f Enhance onBeforeRequest into onBeforeRequestHandlers for Api class (#65195) (#65527)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-11-06 10:04:23 +00:00
github-automation-metabase
0485c08293 spark failure fix (#65502) (#65515)
* spark failure fix

I cannot run spark locally so from CI:

```
FAIL in metabase.driver.sparksql-test/friendly-inline-strings-in-convert-to-sql-test (sparksql_test.clj:67)

:sparksql
 The native query returned in query results should use user-friendly splicing
expected: "SELECT COUNT(*) AS `count` FROM `test_data`.`venues` AS `t1` WHERE `t1`.`name` = 'wow'"
  actual: "SELECT COUNT(*) AS `count` FROM `test_data`.`venues` AS `t1` WHERE `t1`.`name` = 'wow'"
    diff:
expected: "SELECT COUNT(*) AS `count` FROM `test_data`.`venues` AS `t1` WHERE `t1`.`name` = 'wow'"
  actual: "SELECT COUNT(*) AS `count` FROM `test_data`.`venues` AS `t1` WHERE `t1`.`name` = decode(unhex('776f77'), 'utf-8')"
```

Locally hit this on an m1 mac:

```
impl.get-or-create :: create-database! failed; destroying :sparksql database “test-data” {mb-test=metabase.driver.sparksql-test/friendly-inline-strings-in-convert-to-sql-test}
java.util.concurrent.TimeoutException: Timed out after 30.0 mins
```

* fix license test failure

https://github.com/metabase/metabase/pull/65034 bumped some jetty deps
from 12.0.24 to 12.1.3. Along for the ride came a new org:

```
org.eclipse.jetty.ee9.websocket/jetty-ee9-websocket-jetty-server 12.1.3
  X org.eclipse.jetty.ee9/jetty-ee9-servlet 12.1.3 :use-top
  . org.eclipse.jetty.ee9/jetty-ee9-webapp 12.1.3
    . org.eclipse.jetty/jetty-xml 12.1.3
      . org.eclipse.jetty/jetty-util 12.1.3
      X org.slf4j/slf4j-api 2.0.17 :use-top
    . org.eclipse.jetty.ee/jetty-ee-webapp 12.1.3 <--- new
```

This has a new org of `org.eclipse.jetty.ee` and no discernable license
in the pom or the jar.

Refresher we look in the pom for things like

```
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
```

or in the jar for some common names of licenses, like in this mysql
connector jar:

```
  -rw-r--r--     134  18-Sep-2023 19:11:56  INFO_SRC
  -rw-r--r--   71049  18-Sep-2023 19:11:56  LICENSE
  -rw-r--r--    1624  18-Sep-2023 19:11:56  README
  -rw-r--r--     846  18-Sep-2023 19:12:04  META-INF/INDEX.LIST
```

I didn't see a license at either of these spots, but consulted
https://mvnrepository.com/artifact/org.eclipse.jetty.ee/jetty-ee-webapp
to see it listed as Apache 2.0 and EPL 2.0

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-11-06 02:41:57 +00:00
github-automation-metabase
8237141ad5 Fix kondo failure in release-x.57.x branch (#65496) (#65510)
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-06 00:24:20 +01:00
github-automation-metabase
20eabf827b Make Trunk analytics always run (#65451) (#65512)
* Make Trunk analytics always run

This prevents false positives because Trunk analytics actio will now
always analyze test results, and compare them with their own test
quarantine list. It uses this information to know if it should fail the
job or let it pass.

* Introduce dry-run

When a PR is in a draft mode, we don't want to upload results but still
have to quarantine tests.

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-06 00:23:28 +01:00
github-automation-metabase
ab953c5f86 [perf] Add lib.computed, optimize wide tables and deep user queries (#65364) (#65435)
Part of #64774.

Hopefully this is sufficient to unblock users seeing the high CPU times
like in #64774. I discovered other, less significant performance issues
during this investigation that I'll be addressing in follow-up PRs.

The problem query and relevant table metadata from a helpful customer
was taking 950ms to preprocess and compile on my 2022 M1 Max, running
Metabase in dev mode but with Malli schema enforcement disabled.

The query is pretty big! It uses 3 tables with 200-300 columns each,
has several stages including some from a joined card, and ends up with
several stages doing two levels of aggregation. It also includes
several *huge* `:case` expressions.

The optimizations below have reduce the time required from 950ms to 310ms
on my machine. A 3x improvement, but I think there's more to be gained in
the follow-up PRs I mentioned.

Main optimizations:

- `lib.util/find-stage-index-and-clause-by-uuid` pre-computed and cached
  on each stage, saved 120ms on the above query.
- `lib.metadata.cached-provider/fields` attempts to pre-load the cache
  of individual `lib.metadata/field` calls, having just fetched them
  all, but it used the wrong key and they were all misses instead!
- `expression-metadata` and `aggregation-metadata` are recomputed over
  and over again by their stage and later stages; cache them by value
- `returned-columns` was cached at the top level and frequently missed
  because of dumb details like explicit stage 1 vs. -1 for last stage.
  - Switched it to caching on individual `returned-columns-method`s
    with more precise cache keys.

Both of the latter two are using a new caching approach: a weak map
using queries as keys. Since CLJ(S) maps are immutable, any change to
the query means a new pointer.

That's still far more eviction than optimal! Most edits to a query
don't actually invalidate most of the cached values! But it's a lot
better than what we had before, and because the map's keys are weak
references, the queries and their cached data are not retained any
longer than the query itself.

I also added a `qp.perf-test` namespace with some metadata providers
with 10-, 100-, 1000- and 10,000-column tables for testing.

So far the tests it performs are quite basic, though. I'll be adapting
the user-provided query into a test case in the future, since it's an
excellent real-world example of a complex but not pathological query.

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-11-05 20:58:26 +00:00
github-automation-metabase
04e0b77b79 docs : clarify subscription settings (#65179) (#65495)
* Update wording for subscriptions and alerts section

* Update docs/permissions/application.md



---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-05 19:13:17 +00:00
github-automation-metabase
ddc804c8eb Fix #50044 - Updates dashcard loading state so it shows the correct title while it's loading (#65363) (#65424)
Co-authored-by: Brad Anderson <brad@metabase.com>
2025-11-05 17:53:29 +00:00
github-automation-metabase
2d0457eb8b [qp] Reuse oridinarily compiled query as inline if it doesn't have params (#64651) (#65487)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-11-05 17:44:46 +00:00
github-automation-metabase
30c82bc82f [kondo] Encourage more m.util.performance functions in perf-sensitive namespaces (#65331) (#65338)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-11-05 17:31:05 +00:00
github-automation-metabase
938e4eeebb Toggle dark mode from command palette (#65359) (#65486)
* toggle dark mode from command palette

* I'm sorry I built this in a dumb way Ryan

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2025-11-05 17:22:23 +00:00
github-automation-metabase
7fb3e1c1ba upgrade to echarts v6 (#64139) (#65482)
* upgrade to echarts v6

* Update Loki Snapshots

* Fix BE test

* update gridlines helper function

* adjust test

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2025-11-05 17:12:52 +00:00
github-automation-metabase
d9459e71e2 docs(sdk): Update Readme version references and published npm version to 0.57.0-beta.0 (#65484) 2025-11-05 16:09:16 +00:00
Timofey Kachalov
c295a06a40 Adjust reviewers in sdk-release CI workflow (#65478) 2025-11-05 19:43:35 +04:00
github-automation-metabase
6c2d49633a Make sure /dirty is called when moving an entity out of the library (#65259) (#65476)
* Make sure /dirty is called when moving an entity out of the library

* Untouch embedding code / Clean up / Add some tests

* Check cache from both entities and RTK / Undo unnecessary changes

* Make sure getCollectionFromCollectionsTree gets collection from latest query

Co-authored-by: Anderson <ands.alves.nunes@gmail.com>
2025-11-05 15:08:31 +00:00
github-automation-metabase
6598a1a77f GDGT-1185: Columns appear twice in model list view until action taken (#65412) (#65475)
* List View: Fix incorrect bg color initialization

* GDGT-1185: Fix columns list initiation in ListView configuration screen

* GDGT-1185: Update e2e test

* GDGT-1185: Fix lint

* GDGT-1185: Fix unit tests

* GDGT-1185: Address PR comments

* GDGT-1185: Minor refactoring

Co-authored-by: Stas Gavrylov <stas@metabase.com>
2025-11-05 14:59:24 +00:00
github-automation-metabase
254e4fd3b9 Fix getNextSdkVersion helper (#65468)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-11-05 17:11:54 +04:00
github-automation-metabase
952045b2f1 Adjust parameter_mappings for a text dashcard when its variable is removed (#64463) (#65448)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-11-05 13:03:58 +00:00
Nicolò Pretto
144eb50221 57-beta changes for the sdk (#65420) 2025-11-05 10:31:25 +01:00
github-automation-metabase
4b781a0d48 Use stableStringify for PublicOrEmbedDashboardView story + add StrictUnion type (#65411) (#65460)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-11-05 09:26:53 +00:00
github-automation-metabase
1a062c85f4 Stabilize and deduplicate eslint cache (#65410) (#65458)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-05 08:52:16 +00:00
github-automation-metabase
14eb4d0831 Remove parsing from file download e2e tests (#65081) (#65440)
* Make e2e download tests more lightweight

* Fix helper to handle redirects

Co-authored-by: Fraser <fraser@metabase.com>
2025-11-04 22:06:41 +00:00
github-automation-metabase
651e92600d Adding collection name to recent documents (#65376) (#65438)
* Adding collection name to recent documents

* re-arranging e2e test

Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-11-04 21:42:33 +00:00
github-automation-metabase
f41b074b00 docs - various edits (#65422) (#65432)
* various edits

* edits

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-04 19:49:07 +00:00
github-automation-metabase
2d947df8fa remote sync analytics (#65129) (#65430)
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-11-04 19:13:30 +00:00
github-automation-metabase
9f8a16a21a [util] Explicitly test for BigDecimals in real-number? (#65202) (#65427)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-11-04 17:16:51 +00:00
github-automation-metabase
ea356f765d allow disabling remote sync (#65175) (#65425)
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-11-04 17:04:11 +00:00
github-automation-metabase
6f78e22b2e skip flaky UpsellBigCard loki specs (#65404) (#65407)
* skip flaky UpsellBigCard loki specs

* Update Loki Snapshots

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-11-04 15:46:01 +00:00
github-automation-metabase
8f550db631 V57 docs: updating Alerts + Model view (#65353) (#65414)
* update screenshot

* Updating model list view

* updating screenshots to Model view

* Optimized 4 images, saved 406.0 KB (50.9% smaller)

---------

Co-authored-by: Abed Habli <154609371+abdhabli@users.noreply.github.com>
2025-11-04 11:20:59 +00:00
github-automation-metabase
051c949f63 Correct interactive embed query execution count (#65336) (#65345)
* Simplify the FE API code

* Exclude static embed preview from being counted in analytics

* Update frontend/src/metabase/lib/api.js



* Clarify comments

* Add tests

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-04 03:17:59 +00:00
github-automation-metabase
f9827f2dc3 Recreate model index quartz triggers on job initialization when needed (#65394) (#65402)
* Recreate model index quartz triggers on job initialization when needed

* whitespace

* rename var + add comment

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-11-04 01:26:52 +00:00
github-automation-metabase
2fd19bbdbe fix: allow stacktraces to be suppressed in API (#65215) (#65285)
* fix: allow stacktraces to be suppressed in API

Allows administrators to configure their metabase instance using
MB_HIDE_STACKTRACES to prevent stacktraces from appearing in API
response. For standard responses it replaces unhandled exceptiosn with a
generic message and 500 response. For streaming responses it leaves the
error message and strips out the trace/via keys to prevent exception
info from leaking.

* fixup! dissoc traces from map errors

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-11-03 23:54:13 +00:00
github-automation-metabase
2fda4a26a3 token data (#65396) (#65397)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-03 21:47:53 +00:00
github-automation-metabase
92b2990182 json from data-url (#65374) (#65381)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-03 20:22:32 +00:00
github-automation-metabase
3577f4f6e7 UXW-2182 fix codemirror editor suggestions styles in light mode (#65367) (#65383)
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-11-03 19:46:09 +00:00
github-automation-metabase
81fd96c6fc UXW-2170 cleanup chart brush (#65313) (#65365)
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-11-03 19:43:31 +00:00
github-automation-metabase
6b41783976 UXW-2172 UXW-2174 remove Document cards click actions (#65191) (#65351)
* UXW-2172 UXW-2174 remove Document cards click actions

* Fix e2e

* UXW-2172 fix broken click actions for Document cards

* Restore e2e

* Fix typecheck

* review fixes

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-11-03 19:31:21 +00:00
github-automation-metabase
f71b169128 Restore calendar hover styles (#65361) (#65379)
* restore calendar hover styles

* fix calendar picker hover states

* remove unnecessary rule

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-11-03 19:11:43 +00:00
github-automation-metabase
4709110720 Updates 6 illustrations for dark mode (#65375) (#65380)
Co-authored-by: AlessioLaiso <7041012+AlessioLaiso@users.noreply.github.com>
2025-11-03 19:05:44 +00:00
Jeff Bruemmer
409eb9638f Revert "Revert "docs -remote sync (#65009)" (#65305)" (#65377)
This reverts commit 70ac109c30.
2025-11-03 13:39:49 -05:00
github-automation-metabase
560aba706f Add archived flag to graph endpoints (#65366) (#65371)
Fixes QUE-2708

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-11-03 17:29:56 +00:00
github-automation-metabase
400cca7fe5 filter for active fields (#65245) (#65360)
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-11-03 15:46:21 +00:00
github-automation-metabase
226ab1bf62 Fix suggested prompts schema and add test (#65299) (#65355)
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-11-03 15:38:56 +00:00
github-automation-metabase
a97dc5cf61 Compute param values from card results (#64318) (#65354)
* Compute param values from card results

seq for bool

Tests, multi-stage queries

Compute values also for params on nested stages

whitespace

Unused ns

Last stage check first

Docstring

Drop base query's last stage clauses

Address review remarks

Apply suggestions from code review



Remove redundant ops

Adjust for test

Search for col also in aggregated result columns

Look for breakoutable column only if source-uuid is present

* symb

* Rebase fix

* fix rebase, remove unused module

* post rebase, fix getting database id

* kondo

* Revamp

* limit

* Adjust the solution for impl joins

* Fix e2e

* Comment

* Cleanup

* Cleanup

* comment

* comment

* Update src/metabase/parameters/dashboard.clj



* indent

---------

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-11-03 15:28:40 +00:00
github-automation-metabase
c05f5ec9eb UXW-175 Fix visualization mode switch for pivot table (#65252) (#65352)
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-11-03 15:06:52 +00:00
Jeff Bruemmer
536e71d4cb docs - 57 api docs (#65308)
* api docs

* env var
2025-11-03 08:46:58 -05:00
github-automation-metabase
f04c507ac4 Disable CodeQL trap caching (#65275) (#65337)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-03 09:08:08 +00:00
github-automation-metabase
949cddcd2b Fix #64685 - Update brand colors in UI without needing refresh (#65292) (#65323)
* UXW-1991 Fixes various issues both new and old with the Branding page like the colors not updating until refresh and swatches not updating when setting colors back to their defaults

* UXW-1991 Uses hex format for brand colors placeholders

* UXW-1991 Fix persistence issues with setting/unsetting accent colors

Co-authored-by: Brad Anderson <brad@metabase.com>
2025-10-31 23:16:09 +00:00
github-automation-metabase
cc8e2c332a UXW-2183 Remove fullscreen dashboard night mode toggle (#65312) (#65321)
Co-authored-by: Brad Anderson <brad@metabase.com>
2025-10-31 22:53:37 +00:00
Ryan Laurie
3ae7763a1b Update translations 2025-10-30 (#65213) (#65314)
* Update translation sources 2025-10-30

* Update translations

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
2025-10-31 23:48:39 +01:00
github-automation-metabase
3edc9d2259 Remove mention of "night mode" and image (#65318) (#65319)
* Remove mention of "night mode" and image

Removed mention of 'Night mode' from fullscreen dashboard instructions.

* Delete dark mode/night mode image

Co-authored-by: Robert Kosara <rkosara@me.com>
2025-10-31 21:50:02 +00:00
dpsutton
a0e7336119 Don't count app-db not setup errors in circuit breaker (#65300)
we want to not hammer the network when things are down. But during
startup we don't need to circuit break these errors that we throw before
the app-db is read
2025-10-31 16:33:34 -05:00
github-automation-metabase
d810202021 Implement connection impersonation for starburst (#64972) (#65306)
* implemenet impersonation driver methods

* replace starburst impersonation

* use user as default role

* clean up

* enable starburst tests

* mount files to container

* add config files

* fix rules.json

* add starburst impersonation tests

* try fix

* remove old tests

* debug

* Debug'

* add volumes original way

* try again

* revert

* try docker run

* remove services

* add back accessc control

* enable impersonation

* exclude starburst tests again

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-10-31 20:14:50 +00:00
github-automation-metabase
82ede379eb Small edits to v57 docs about Glossary, dark mode, and progress bars (#65253) (#65309)
* Enhance glossary section with context for definitions

This is a smaller change than I expected, since glossary terms don't show up in searches yet. Might just cut this if it doesn't add anything useful. I also wasn't sure if we should mention Metabot here.

* Add dark mode options

Adds the available options and explains that you don't have to reload the page

* Add a little clarification to the computed goal example

This confused me, so I'm adding this little clarification

* Jeff's suggested change



* Remove the bit about LLMs again

---------

Co-authored-by: Robert Kosara <rkosara@me.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-10-31 19:01:09 +00:00
Jeff Bruemmer
70ac109c30 Revert "docs -remote sync (#65009)" (#65305)
This reverts commit c257c954fb.
2025-10-31 14:49:32 -04:00
github-automation-metabase
9a277a649e Metabot glossary integration (#65223) (#65274)
* Return glossary with user info

* Test glossary in response

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-10-31 16:58:01 +01:00
Nemanja Glumac
c43fc5726e Fix logs upload for drivers (#65257) (#65289)
* Fix logs upload for drivers

When we introduced `continue-on-error` to the "test" step, we had to
update the conditionals for the test report steps as well. I've
introduced a bug by checking for a failure, instead of saying - upload
test reports whenever the job is not successful.

Hint: test.outcome means "step status BEFORE continue-on-error overrides
the exit code"
2025-10-31 16:40:55 +01:00
github-automation-metabase
b21072994c Remove superfluous python setup from H2 driver test (#65272) (#65284)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-10-31 16:23:40 +01:00
github-automation-metabase
9ab49864c1 fix: pivoting json values (#65183) (#65278)
* fix: pivoting json values

* fixup! kondos in test

* Update frontend/src/metabase/lib/data_grid.js



---------

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-10-31 14:39:02 +00:00
github-automation-metabase
8e02fb7dd2 Fix: UXW-2171 Prevents "Edit Query" from clearing name on chart (#65224) (#65280)
Co-authored-by: Brad Anderson <brad@metabase.com>
2025-10-31 14:16:54 +00:00
github-automation-metabase
b53131f473 Sunset e2e cross-version tests (#65269) (#65277)
Context: https://metaboat.slack.com/archives/C0669P4AF9N/p1761905881175819

The requirements for new and updated attempt at solving this problem are documented in:
https://linear.app/metabase/issue/DEV-1042/design-reliable-cross-version-upgradedowngrade-test-strategy

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-10-31 14:11:29 +00:00
github-automation-metabase
4805c9f244 Fix deleted documents were editable (#65136) (#65276)
* Prevent trashed documents from being edited

* Add test

* Soften the test name tone

* Disallow even updating document when archived via API

* Add BE test

* Fix Cypress test issue reference

* Update tests after merging master

* Only check for archived when not unarchiving

* Don't check archived documents when archiving or unarchiving them

* Add missing condition from merging

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-10-31 12:59:29 +00:00
github-automation-metabase
894a2fb895 update hover colors in UserListElement (#65174) (#65243)
* update hover colors in UserListElement

* adjusting colors

* updating comment

Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-10-31 09:17:34 -03:00
github-automation-metabase
52517517f5 Fix env var doc gen (#65230) (#65270)
* fix issue with env var gen and some cleanup

* cleanup

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-10-31 11:42:20 +00:00
github-automation-metabase
52aba51798 remove registry (#65242) (#65264)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-10-31 03:46:19 +00:00
github-automation-metabase
9a33050c61 Optimize graph API endpoints (#65172) (#65263)
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-10-31 02:55:16 +00:00
github-automation-metabase
381fa1fdbd Upgrade CodeQL action version (#65250) (#65261)
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-10-31 01:16:46 +00:00
github-automation-metabase
bf17242cb9 [Metabot] Copy change for suggested prompts setting description (#65163) (#65237)
* update copy

* adjust copy for embedded metabot

* oops

* remove randomly

* fix test

* feedback

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-10-30 21:06:31 +00:00
github-automation-metabase
f1336e039f update document title compare to determine dirty state (#65229) (#65246)
Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-10-30 20:44:54 +00:00
github-automation-metabase
1233934a0d fix falsey check when removing card embed from document (#65222) (#65244)
Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-10-30 20:32:53 +00:00
github-automation-metabase
5bdc6d7000 fix(sdk): non-editable dashboard should not have "add a chart" button and title should be read-only (#65102) (#65241)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-10-30 20:21:24 +00:00
github-automation-metabase
81ac3c9ae5 return false instead of throw (#65225) (#65235)
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-10-30 19:39:21 +00:00
github-automation-metabase
dba578efad GDGT-1083: Improve visual design for new List view in Stats before v57 (#64957) (#65226)
* GDGT-1083: Add new icons

* Remove subtitle column. Restyle inputs. Extend icon selection

* GDGT-1083: Fix minor tags input styling issues

* GDGT-1083: Replace semantic colors with accent colors

* GDGT-1083: Add image column selection option

* GDGT-1083: Add placeholder for image column icon. Fix bug with selected icon

* GDGT-1083: Update formatted column values rendering rules

* GDGT-1083: Fix incorrect entity icon initialization

* GDGT-1083: Add range viz rendering for quantity/score columns

* GDGT-1083: Fix drag from ListViewColumnsSidebar

* GDGT-1083: Fix list header grid

* GDGT-1083: Fix State column styling

* GDGT-1083: Fix incorrect rendering for boolean columns

* GDGT-1083: Fix incorrect column rendering for empty cells

* GDGT-1083: Address design review comments

* GDGT-1083: Fix TS error

* GDGT-1083: Fix image column rendering

* GDGT-1083: Minor refactoring

* GDGT-1083: Update e2e est

* GDGT-1083: Add unit test for ListViewItem component

* GDGT-1083: Fix linter

* Fix eslint

* GDGT-1083: Resolve metabot comments

* GDGT-1083: Get rid of split_currency setting

* wip

* GDGT-1083: Address PR comments

* GDGT-1083: Address PR comments

* GDGT-1083: Replace switch logic with fns. Fix header layout bug

* GDGT-1083: Fix badges cursor in list view

* GDGT-1083: Fix cursor styling when dragging over full tags input

* GDGT-1083: Remove max-width

* GDGT-1083: Fix linter

* GDGT-1083: Fix lint

* GDGT-1083: Fix incorrect imgURL/avatarURL column rendering after refactoring

* Fix incorrect icon background color

* Fix incorrect category columns rendering

* Update Loki Snapshots

---------

Co-authored-by: Stas Gavrylov <stas@metabase.com>
2025-10-30 19:38:02 +00:00
Denis Berezin
0d66452695 UXW-2091 user without collection access to Our Analytics can't save documents (#65159) (#65216)
* UXW-2091 user without collection access to Our Analytics can't save documents

* fix typecheck

* Fix types

* Add e2e tests

(cherry picked from commit 9f0f6eb78c)
2025-10-30 22:11:31 +03:00
dpsutton
9edb741033 Token grace period (#64938) (#65208)
* Add a grace period to token checks

There's more work on this namespace to be done i think, but this is a
first cut at it. There's a lot of control flow by exceptions which is
how we jump around in here. Fundamentally this should be far
simpler. Will take a crack at that shortly. I also don't love that this
just hammers the `fetch-token-status` function and then memoizes inside
of that. Would prefer simpler layout of `token-features` function and
that can be aware of population issues.

Adds a simple protocol: GracePeriod, which has two functions: save! and
retrieve. On successful token check, we `save!` the response. On errors,
we `retrieve` previous responses. This obviously can be nil in the case
we have never had a successful response, and will become nil once the
grace period's internal notion of time expires.

This implementation is based on guava's cache which has a nifty
expireafterwrite functionality.

```
 (*token-features*) ;; call this function to simulate the check of features
Checking with the MetaStore to see whether token 'f325...d01a' is valid...
Reporting Metabase stats: {... user counts etc}
 -> #{"features come back"}
 ;; meanwhile clear cache to simulate elapsing of 12 hours

 (*token-features*) ;; call function again to simulate check of features
2025-10-22 21:30:26,620 INFO premium-features.token-check :: Checking with the MetaStore to see whether token 'f325...d01a' is valid...
2025-10-22 21:30:26,622 ERROR premium-features.token-check :: Error fetching token status from https://token-check.metabase.com:
clojure.lang.ExceptionInfo: network issues ;; hit network issue

2025-10-22 21:30:26,632 INFO premium-features.token-check :: Using token from grace period
->> #{graceperiod network features}
...

;; here after 5 seconds (in real life will be 36 hours)
2025-10-22 21:31:00,064 WARN premium-features.token-check :: Removing token: f325...d01a from grace period cache {mb-quartz-job-type=Cache}
```

* tests that updating value populates grace period cache

* couple changes

protect against storing nil value. guava cache doesn't like it so gone
it is.

added some tests:

```clojure
(testing "Setting a new value populates the grace period cache"
    (let [new-token (tu/random-token)]
      (binding [http/request (fn [& _] {:status 200
                                        :body "{\"valid\":true,\"status\":\"fake\",\"features\":[\"fake\",\"features\"]}"})]
        (mt/discard-setting-changes [premium-embedding-token]
          (premium-features.settings/premium-embedding-token! new-token)
          (is (= #{"fake" "features"} (token-check/*token-features*)))
          (is (= {:valid true :status "fake" :features ["fake" "features"]}
                 (token-check/retrieve token-check/grace-period new-token)))))))
```

But this ended up leaving a setting table value for this value. i don't
feel like looking into discard setting changes so i'm gonna just remove it

* attempt to simplify the api a bit

the thee important functions are now `token-information`, `harness` and
`decode-token`.

Everyone should use token-information. Harness hooks up the grace period
and retry strategies, and `decode-token` only cares about decoding a
token. It should return the token-status map {:valid true ...} or throw.

* fixup test

* clean up tests and rename a bit

* remove comment block

* remove commented out grace period

* bit of cleanup

* fix with-random-premium-token! macro

* function composes them instead of caller

rather than a caller needing to know all of the layers, i thread them
for you and let you provide all arugments in one function call.

dynamic var for needing to customize layers in tests. largely for
removing the circuit-breaker which is stateful and hard to restart if
you want to simulate errors in tests

* rename test
2025-10-30 13:59:20 -05:00
github-automation-metabase
c62d68c201 Update error message for remote sync dep checking (#65148) (#65217)
* Update error message for remote sync dep checking

Try to make these error messages less jargony because they are presented
by the user interface when dependency checking content fails.

Closes UXW-2142 and UXW-1879.

* Update some missed tests

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-10-30 17:35:45 +00:00
github-automation-metabase
6390717ce9 fix: improve collections graph performance (#65098) (#65211)
* fix: improve collections graph performance

Fixes performance generating and updating a collection graph by avoiding
the cross join of all negative permissions (blocks) between groups and
collections. Instead it builds sparse graph where missing entries for
group/collection paris can be assumed to be :none permissions.

In practice this drops a collection permission update on a graph of 5K
groups and 5K collections from a greater than 10min operation on my
local machine against MySQL to a .5s operation.

* fixup! explicilty disj :root in other places

* fixup! improve some docs

* fixup! improve more docs

* fixup! seq checks

* fixup! blank lines

* fixup! convert raw sql concat into honeysql

* fixup! e2e test

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-10-30 17:10:19 +00:00
github-automation-metabase
27abb898a5 Create appdb tables in its own connection (#65171) (#65219)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-10-30 16:43:59 +00:00
Alex Yarosh
c70bd40481 remove transforms (#65221) 2025-10-30 11:53:29 -04:00
github-automation-metabase
2e9f645974 remove border from dashboard header where header=false and no tabs (#65161) (#65214)
* remove border from dashboard header where header=false and no tabs

* move css code up to keep no border in fullscreen

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-10-30 15:43:17 +00:00
Damien Chambe
07172f56f7 Update DB2 driver and IBM i driver (#65190)
IBM i has a separate driver , different from DB2 LUW ( linux/unix/windows )
2025-10-30 08:56:12 -04:00
Ngoc Khuat
9f93683518 Usage analytics update v57 (#65055)
* Add documents to content view

* add document to audit_log

* added comment events to the audit log, publish events

* wip: transform events

* glossary

* reversion the content migrations

* include transforms in content

* remote sync audit events

* wip: action v2 event

* kondo

* fix action tests

* transform run event

* add tests for new events

* bump

* tests

* task data

* let's not change the old migration in case we might break the hashsum

* typo

* more typos

* fix bugs in h2/mysql

* add :previous-object

* fix tests

* move branch into details

* fix test

* fix: run tests only on ee

---------

Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
2025-10-30 10:43:48 +00:00
Sébastien
23574a80d5 Closes UXW-1993 tooltip columns in visualizer (#65042) 2025-10-30 07:05:27 +01:00
appleby
74113f603b Add :order-by to metabase-enterprise.transforms.api/get-transforms (#65162)
To ensure transforms are returned in a consistent order to and reduce test flakes.

https://metaboat.slack.com/archives/C5XHN8GLW/p1761753664842279
2025-10-30 01:11:13 +00:00
Cam Saul
622125d9d9 Disable Claude code review bot by default (#65184) 2025-10-29 21:04:51 -04:00
Sébastien Corbin
f6b1864d91 Add color-scheme meta tag for light and dark modes (#64324) 2025-10-29 18:20:16 -06:00
metamben
6b098da5de Normalize parameter type category/= to category (#65158)
* Normalize parameter type category/= to category

Stats had exactly one dashboard with one such parameter and that dashboard was immutable because the
before-update hook failed before any update could happen.
2025-10-29 23:42:40 +00:00
Ryan Laurie
6b09c0476c dont break scheduled patches (#65165) 2025-10-29 16:30:18 -06:00
Nathan Voxland
a94c284625 Remote-sync error handling improvements (#65072)
* - Improve remote-sync error messages
- Do a fetch when checking git settings to ensure the current version can be read and is being checked

* Validate git url

* Validate branch name in production mode

* Validate branch name in production mode

* Removed unneeded assoc

* Fixed formatting

* Code improvements

* Code improvements

* Allow direct path URLs

* Allow direct path URLs

* E2e Fixes

* E2e Fixes

* Allow empty branch to be passed
2025-10-29 14:15:33 -07:00
Nick Fitzpatrick
fdac82dba2 show a warning message when removing items from the library (#65169) 2025-10-29 14:00:31 -07:00
Denis Berezin
46b8b2791d UXW-1872 Fix some tooltips text color in dark theme (#65182) 2025-10-29 23:52:59 +03:00
Cam Saul
fd476e892b Fix slow metabase.core.modules-test/modules-config-up-to-date-test (#65168)
* Fix slow `metabase.core.modules-test/modules-config-up-to-date-test`

* Fix docstring location

* The bot caught something else
2025-10-29 12:30:22 -07:00
Timofey Kachalov
63f85c3706 feat(embed-js): Convert EmbedJS wizard into a modal (#65113) 2025-10-29 23:03:34 +04:00
Nick Fitzpatrick
9c6e1d1b7d Dark mode day 5 patch (#65099)
* Dark Mode Dashboard PDFS, bad solution for google login

* various fixes

* handfull of fixes

* PR Feedback

* stupid linter
2025-10-29 11:33:22 -07:00
Cam Saul
7d879a9a86 Legacy MBQL normalization overhaul: 3x faster and bug fixes (#65018)
* Legacy MBQL normalization overhaul

* Kondo + test fixes 🔧

* Cleanup and test fixes 🔧

* Code cleanup

* Test fixes 🔧

* Extra test 🔧

* Some test fixes 🔧

* Test fixes 🔧

* Test fixes 🔧

* Test fixes 🔧

* Fix SerDes test failure

* cljfmt

* Code cleanup

* Fix normalizing :datetime with bytes modes

* Fix legacy MBQL normalization of :datetime

* Handle broken case clauses

* Set Card metadata to nil when invalid

* Fixx

* Fix Kondo
2025-10-29 11:18:28 -07:00
Marcos
80ac5931a0 Fix x axis range calculation when undefined values are present (#65125)
* fix x axis range calculation when null values are present

* only remove undefined values

* rename variable instead of mutating function param
2025-10-29 15:11:14 -03:00
Jeff Bruemmer
fabb975482 docs - public documents and downloads (#65155)
* document public links and downloads

* edits

* link fixes

* Update docs/embedding/public-links.md
2025-10-29 17:57:05 +00:00
Timofey Kachalov
d1c40b6c81 Restore sdk backward compat tests (#65154) 2025-10-29 19:20:08 +04:00
Nemanja Glumac
95fa314e44 Delete superfluous test (#65153)
This is already covered in LicenseAndBillingSettings.unit.spec.tsx
2025-10-29 14:51:55 +00:00
Nick Fitzpatrick
5ded6d9623 Remote sync e2e followup (#65061)
* Fix/unskip some tests / try to make flaky FE test to pass in CI

* adding branching tests, unskipping admin tests

* PR Feedback

* PR Feedback

---------

Co-authored-by: Anderson <anderson@metabase.com>
2025-10-29 11:37:29 -03:00
Nick Fitzpatrick
4c160134ba only delay modal dismiss on success (#65127) 2025-10-29 11:29:06 -03:00
Nemanja Glumac
46894a8008 Update module ownership (#65150) 2025-10-29 15:11:48 +01:00
Nemanja Glumac
215a3c6c49 Fix the hard coded store api url in billing (#65135) 2025-10-29 14:05:30 +00:00
Jeff Bruemmer
4d14b02aa2 documents - add public links (#64630) 2025-10-29 13:38:57 +00:00
Noah Moss
6bcfc60eff Add source_type field to transforms with temporary backfill job (#64970)
* Add type field to transforms with temporary backfill job

* add a default value for tests

* add some new tests, fix serdes

* lint

* remove debugging defs

* revert serdes spec change

* Revert "remove transforms from serdes baseline (?)"

This reverts commit e8fc8fe80bfe15e00eb031b4050877f271b8081f.

* try again to fix serialization tests

* address bot comments

* Revert "try again to fix serialization tests"

This reverts commit 13d78664b79b7f13406d89e1f8f910610ea2cce9.

* Fix search ingestion functions to use :type field + some cleanup

* Update baseline to fix serialization test

* Revert "Update baseline to fix serialization test"

This reverts commit 60cb7909e5a73d04c42d36c915a32bb28d684e37.

* fix up comment

* reset serialization_baseline to version on master

* let's try this again: manually update baseline to add type field

* fix search tests by adding correct types to transfomrs

* update metabot tool apis

* fix revision test

* simplify test

* address feedback - move type setting to the model layer

* simplify tests

* Fix up transform serdes tests: remove top-level type fields and updated_at from being serialized, and fix shape of transforms in extraction tests

* set :type after select just in case; fix serdes tests again

* guard against empty source on select

* remove redundant search spec for transforms (introduced via a previous merge)

* switch from type to source_type to avoid conflict with type field on the frontend

* add better error handling
2025-10-29 08:51:20 -04:00
Timofey Kachalov
1bbe525200 Adjust sample-apps runner for the new token check (#65139) 2025-10-29 16:39:55 +04:00
Phoomparin Mano
83b0eb3174 fix(sdk): secondary background color is not mapped to theme (#65116) 2025-10-29 19:14:15 +07:00
Nicolò Pretto
eeb44b4b5a remove .local reference from rspack as .local lookup is slow and we can (#65060)
use .localhost
2025-10-29 12:08:53 +01:00
Nicola Mometto
0e20f5a8b8 respect column definition order for transform create-table (#65089)
* feat: respect column definition order for transform create-table

* add test
2025-10-29 10:10:51 +00:00
Sébastien
92dad88e6a Closes UXW-2112 preserve default colors when renaming breakout values in cartesian charts (#65053)
* Add tests for getSeriesColors with custom titles

* Closes UXW-2112 custom colors breakout labels

* .
2025-10-29 07:16:52 +01:00
Mahatthana (Kelvin) Nomsawadi
94e1c1e387 fix(sdk): Avoid portal root taking space under flex parents (#65088)
* Avoid portal root taking space under flex parents

* Add missing comment

* Preserve format
2025-10-29 02:32:02 +00:00
Nemanja Glumac
6c6b702b29 Enable Trunk Quarantine for general backend tests (#65128) 2025-10-29 02:17:39 +01:00
Aleksandr Lesnenko
38e2e81388 refetch settings after updating remote sync settings (#65124)
* refetch settings after updating remote sync settings

* specs
2025-10-29 01:00:45 +00:00
Nemanja Glumac
5b2fd35367 Enable Trunk Quarantine for drivers (#64995) 2025-10-29 01:24:54 +01:00
Cam Saul
527b8e8e9a Add custom Kondo linter for defendpoint query parameter naming (#65114)
* Add custom Kondo linter for defendpoint query parameter naming

* cljfmt
2025-10-28 17:17:25 -07:00
William
82ea0f4f7e Fix default tag values for temporal template tags (#65112)
This should stop the log spam and fix dependency backfilling
2025-10-28 17:31:41 -05:00
William
39ceced98f Add support for table-functions and selecting tables directly (#65074)
Basically, the same case found two unrelated bugs.  For one, we don't support table functions like `select * from
my_function()`.  For another, `select orders from orders` is also unsupported but apparently legal (at least in
postgres).  This updates sql parsing/validation to support both things.
2025-10-28 17:31:21 -05:00
Ryan Laurie
a67ad3b258 Correct tooltips across map zoom levels (#65080)
* better event handler attachment logic to account for array size change

* test tooltip correctness
2025-10-28 16:31:07 -06:00
Oleksandr Solovyov
bc6694c1a1 no more Workflows team (#64983) 2025-10-29 00:28:39 +02:00
Jeff Bruemmer
c257c954fb docs -remote sync (#65009)
* draft

* notes

* edits

* edits

* updates

* numbering and links

* edits

* edits

* typos
2025-10-28 22:00:23 +00:00
Nemanja Glumac
689d4f0e9b Run e2e tests using staging tokens (#65044)
This pull request updates the configuration and environment handling for E2E and compatibility tests, mainly to support running tests against a staging license/token server and to improve test reliability. The changes affect GitHub Actions workflows, environment variables, and some test and backend logic.

*Backend Logic for E2E Mode*

Added `is-e2e?` flag in core.clj to distinguish E2E test runs from dev/prod/test modes, allowing for custom behavior in E2E scenarios.
Modified token check logic in token_check.clj to allow E2E tests to use a staging server for license validation.
Changed store API settings in settings.clj to use staging endpoints when in dev or E2E mode, ensuring tests interact with the correct backend.
2025-10-28 22:57:14 +01:00
eliotmetabase
c831d2cabf Update error message to make it more obvious things will be deleted (#65117)
* Update error message to make it more obvious things will be deleted

* Better copy

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>

* Update button text as well

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-10-28 14:50:46 -07:00
metamben
bbb0074de4 Fix dependencies backfilling: ignore analysis errors (#65078)
* Fix dependencies backfilling: ignore analysis errors

Fixes QUE-2714

* Catch everything that can fly

* Rename error ignoring macro
2025-10-28 21:12:06 +00:00
Ryan Laurie
d3b69c4c86 DANGEROUSLY allow patches on red commits (#58260)
* DANGEROUSLY allow patches on red commits

* allow override sha

* throw on invalid override

* handle undefined
2025-10-28 13:34:57 -06:00
Cam Saul
ae17be3ee1 Add custom Kondo linter to enforce kebab-case in REST API routes (#65100)
* Add Kondo linter to enforce kebab-case in REST API routes

* Remove Claude guidelines (no longer needed)
2025-10-28 19:01:34 +00:00
Nathan Voxland
4f9dc213ed Fix some indexing race conditions (#64783) 2025-10-28 13:47:15 -05:00
Riley Thompson
280e416af4 exclude databricks from database-schema-filtering-test (#65106) 2025-10-28 18:35:43 +00:00
Alex Yarosh
5db25732ee Update documentation for MB_ATTACHMENT_ROW_LIMIT (#65104) 2025-10-28 18:16:34 +00:00
Oleksandr Yakushev
c51d5b5f79 [malli] Don't include docstrings in mu/defn when compiling CLJS (#63793) 2025-10-28 19:53:35 +02:00
Alexander Polyankin
5b8a087754 Fix search with documents (#65000) 2025-10-28 17:42:09 +00:00
Vamsi Peri
7611b467f3 Remove some instructions from CLAUDE.md (#65103)
Removed instructions and comments regarding emoji usage, spelling conventions, tarot card readings, and formatting for specific users.
2025-10-28 13:29:51 -04:00
Nicolò Pretto
9ac8f80da8 feat(sdk): adds handleLink to customize how links should be open (#64960)
* poc of handleLink

* safer implementation

* make it return a boolean to prevent default

* fix types?

* fix static viz build

* adds tests

* make tests more consistents with fns

* test return value undefined

* Update enterprise/frontend/src/embedding-sdk-shared/lib/sdk-global-plugins.ts

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>

* refactor plugin call

* fix types

* removed reduntant test

* change the api to use `{handled: boolean}`

* support links rendered as anchor tags, refactor the logic and tests

* add story

---------

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
2025-10-28 18:05:28 +01:00
Alexander Polyankin
6ef2472613 Prepare dependencies for v57 (#65093) 2025-10-28 16:25:13 +00:00
Phoomparin Mano
c24bea6939 Make HoverCard dropdown default to bg-primary (#65047)
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-10-28 23:19:13 +07:00
Edward Paget
8d09595bb8 Remove the instruction to indent docstrings (#65094)
* Remove the instruction to indent docstrings

* Remove example
2025-10-28 10:57:41 -05:00
Riley Thompson
4a23fc0ee0 Fix add interval honeysql form (#65091)
* add back driver hierarchy

* use driver instead of db-type
2025-10-28 15:28:54 +00:00
Sébastien
e23658dd9a Closes EMB-928 sdk popover flashing at 0,0 (#65086) 2025-10-28 16:17:45 +01:00
Mahatthana (Kelvin) Nomsawadi
afaee50a4c fix(sdk): Fix missing SDK CSS custom properties (#65084)
* Follow core app color order

* Add missing CSS custom properties

* Revert "Follow core app color order"

This reverts commit 01a6a17483.
2025-10-28 14:06:23 +00:00
Riley Thompson
0760630f10 Fix databricks multi-level-schema-wanted-catalogs-test (#65073)
* use schema inclusion filters

* fix test

* remove set dep
2025-10-27 23:16:02 +00:00
Noah Moss
27a078faf0 Move honeysql helper to simplify module dependencies (#64689)
* init branch

* FE - add codemirror diffing, add diff support to native query editor, fake a proposed query

* Add /ee/metabot-tools/get-transforms endpoint

Returns a sequence of all python or native query transforms.

BOT-391 [Backend] Create transform index tool API

* Add test that get-transforms does not include non-native MBQL transforms

* Add /ee/metabot-tools/get-transform-details endpoint

* allow opening metabot on transforms admin pages

* use transforms_codegen profile for metabot on transforms page

* send transform in context

* show metabot on edit + create transforms page

* accept tranform suggestions from metabot

* Cleanup malli schemas for get-transforms and get-transform-details

* add transform context on edit query page

* use transforms instead of data queries

* Parse out tables from transforms in metabot user context

* wip on creation flow

* hack in a message to metabot on save

* quick fix preview error not displaying correctly

* misc. fe improvements

* fix transform context on subsequent edits for the same transform

* half hacky way to use current editor state for context in transform editing

* Switch /ee/metabot-v3/get-transforms from :get to :post

This endpoint doesn't expect args of it's own in the body, but does accept the standard metabot conversation_id that
it echoes back.

* Show 'Apply Changes' button when a transform change is generated by the agent

* handle new transforms better

* Ensure we have a fallback for context items that don't have SQL to parse

* persist diff of transform to the conversation history

* temp - make metabot always visible on transforms admin pages

* Change button label to "Proposed changes to <transform>"

* copy change for create transform buttons in chat

* better hidden message ui

* hack - better emtpy convo text

* hide suggested prompts

* Add basic snippets tools

* ensure proposed queries go through nativeQuery.setQueryText so that template tags are parsed

* better todos

* even better todo list ui

* crude sidebar ui for query transforms diffs

* better suggestion chat ui

* good'nuff @mentions

* debug logging for search table bug

* further logging

* Ensure we parse template tags for transform edits in Metabot sidebar (#64001)

* cleaner, more copy/pastable, better flowing @mentions in metabot

* Fix metabot get-transforms api test to :post not :get

* Update metabot tools test with basic python transform tests

* Ensure transform :source and :target keys get snake cased when returned from metabot tool apis

* Add get-transform-python-library-details metabot tool api endpoint

* Enhance context with :used_tables for python transforms

* surface transforms in @-mention search

* some type fixes

* python FE progress

* python fe improvements + edit experience now works

* clear proposed on cancel

* fix accept in sidebar not saving

* better diff colors

* smaller todos

* cleaner code for todos

* improve ranking of transforms in search by hardcoding a last_viewed_at time in user-recency-expr

* first pass at nested @mentions

* Conditionally add transforms to model->db-model

* Add transforms-python to module deps for metabot

* Move native-query-transform? into transforms.util and re-use existing utils

metabot-v3.tools.transforms defined a couple of helper functions that were nearly identical to ones that have since
been added to transforms.util ns. Move some things around and make use of the existing transforms.util predicates,
which are now exported from the module's core namespace.

* lots of fe clean up

* prevent rewinding conversation for admin pages

* @mention solution that plays nicely with documents

* fix search bug

* fix type issues and few small feedback things

* Add transforms to search for Metabot (#64134)

* index transforms content

* Add support for transforms & query search in metabot search tool API

* fixup whitespace

* update to use new :fields syntax

* Fix up serach-native-query malli types

* Fix the 15-day interval for transforms to be db-agnostic

* move engine loading to metabase.search.init to break circular dep

* fix kondo

* Revert "Fix the 15-day interval for transforms to be db-agnostic"

This reverts commit 11b34e4cd4a8a5a0cf8041a1d82d487ed8c81025.

* add transform to set of appdb scorer models; unrevert db type fix

* fix kondo

* implement requisite multimethods for transforms not to error in in-place search engine

* ensure we enforce metabot/unknown contexts for transforms in in-place search backend as well

* fix filter test

* transform->postprocess to reduce naming ambiguity; add a basic transform ingestion test

* add a metabot result postprocessing test

* add transforms scoring test

* expand ingestion tests

* fix tests + kondo

* address feedback

* make suggestion models configurable for a Metabot instance

* fix @mention recents in documents, update suggestion sidebar component to not accept / reject items + calculate isViewing better

* quick fixes

* for rye guy

* Handful of fixes for transforms search (#64287)

* Add both search and search_v2 endpoints, and fix bug with search-native-query option

* add a docstring

* add a basic unit test for search-native-query option

* address comments

* better state management for suggested transofrms, move css around, clean up suggestion message code

* Update the list of source tables in Python editor when metabot changes it (#64258)

If metabot proposes changes to the list of input tables for a Python transform, update the PythonDataPicker component
to keep it in sync with the text of the transform source.

* python tables reference fix

* bug fixes and better state organization

* better draft support

* fix types

* add on leave modal, clear transforms on route leave, calc dirty state, fix onChange but for native query editor, better logic for showing cta text for transform suggestions

* Ensure transforms get deleted synchronously from the search index (#64382)

* Delete transforms from search index in t2/define-before-delete

* kondo

* fix up tests

* Stop pretending to snake_case transform source and target keys

The malli schemas were wrong, so these weren't actually getting snake_cased anyway.

See also:

https://github.com/metabase/ai-service/pull/387#discussion_r2414569482

* Fix failing test & kondo warning

* Add transforms dependency check API for metabot (#64542)

* WIP - add dependency check API for metabot

* omit bad_cards for now

* update return format

* add tests

* Fix fn call

* revert unneeded refactor

* Fix search transform-ingestion-test to use mt/native-query

* switch test to mt/native-query

* Fix module usage test

* fix up tests to use lib/native-query instead

* try to fix last test

* switch native-query-transform? to use lib.query/native?

* more mbql 5/metabase lib updates

* revert the 1-pixel fix

* Subtract a pixel when computing metabot chat filler height to avoid scrollbar flicker (#64690)

* Fix MetabotAgentSuggestionMessage only show "create" for new transforms (#64598)

https://metaboat.slack.com/archives/C09CR3MT1KR/p1760034396345789

* Surface broken cards from Metabot dependencies check API (#64781)

* fix missing sidebar diff after mbql5 change

* surface broken cards

* add test

* fix kondo

* remove unused code

* Fix up dep check question terminology & schema

* fix up test

* fix up another test

* address feedback

* Update the transform source schema to use ::queries.schema/query

* remove unused require

* address FE feedback

* fix modules config test

* @mentions tests and improvements

* couple of e2e tests fixes

* prevent leave confirmation when saving

* fix most of unit tests

* add back searchable models in metabot @mentions

* More tests for transform search + transform dependencies tool, and some new future-proofing read checks (#64896)

* add some future-proofing read checks to transform deps checks + related tests

* add some more transform search tests

* remove 404 check; move read check later in impl

* convert from toucan transform instance to metadata

* clean ns

* Move honeysql helper to simplify module dependencies

* fix more function calls in tests

* fix more calls

* fix (hopefully) last two calls

* kondo fix

* fix module config

* Fix detection of requires in threading macros

* Add metabase.driver.sql.query-processor back as a driver API namespace

* Add tests for metabot tools snippets and check-transform-dependencies endpoints (#64894)

* Add tests for metabot tools snippets API endpoints

* Add test for metabot tools check-transform-dependencies endpoint

* Remove trailing blank line to appease linter

* copy over appdb implementations of add-interval-honeysql-form to h2x; add back the sql.qp version for other drivers

* switch other driver methods back to sql.qp

* update relevant callsites

* move some test logic

* fix up error

* restore :added meta

* fix tests, move over one more pg timestamp helper

* oops, update callsites

* make function public

* add MetabotChatEditor.unit.spec.tsx

* add links.unit.spec.ts

* add AIMarkdown.unit.spec.tsx

* add MetabotAgentTodoMessage.unit.spec.tsx

* add MetabotAgentSuggestionMessage.unit.spec.tsx

* add metabot/state/reducer.unit.spec.ts w/ tests for suggested transforms state

* add e2e test coverage for create + update flow for both native sql + python transforms

* FE pr feedback and lint fix

* unit test fixes

* fix search test

* add temp metabot toggle button in admin nav

* fix a couple of failing FE tests

* attempt fix ci flake issue with metabot.unit.spec.tsx

* remove metabot-only restriction on transform search

* remove redundant logs in transform api endpoints to address ngoc's comment

* fix a number of transform search tests

* fix another test

* fix hopefully last search test

* bot feedback

* bot feedback

* fix function name

---------

Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
Co-authored-by: Mike Appleby <86076+appleby@users.noreply.github.com>
Co-authored-by: Mihael Konjevic <konjevic@gmail.com>
Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-10-27 21:53:34 +00:00
Nemanja Glumac
3177f079e8 Upgrade Mantine to v8.3.5 (#65050)
This commit removes our custom Mantine hooks patch because it was resolved upstream.
See: https://github.com/mantinedev/mantine/pull/8189
2025-10-27 21:13:25 +01:00
Nemanja Glumac
49c0589aa8 Remove mage tests from the core classpath (#65046) 2025-10-27 21:06:08 +01:00
William
57afac78ba Make native validation allow using current-level aliases in other clauses (#64701)
Make native validation allow using current-level aliases in other clauses

`select a as b from table where b > 1` wasn't passing validation because the b alias wasn't in scope in the where.
This should now be fixed.

Also, native validation keeps more context when generating references, which should allow for better error messages.
2025-10-27 19:15:57 +00:00
Nick Fitzpatrick
1fed0f701c Dark mode day 4 patch (#64996)
* document resize handles

* metrics background color

* update command palette, account profile to use new form components

* fixing button variant

* fix e2e
2025-10-27 18:58:44 +00:00
Nathan Voxland
e9950fdc21 Additional error handling in appdb reindexing (#65013) 2025-10-27 13:06:02 -05:00
Nemanja Glumac
02f7a885ee Bring back the inlined explicit deduplicate command to postinstall (#65058) 2025-10-27 17:05:41 +01:00
Nemanja Glumac
3def5f4ca9 Fix frontend coverage workflow (#65048)
Instrumentation adds a lot of overhead. Unfortunately, even 30 seconds timeout wasn't enough for some of our unit tests. We're doubling that value in order to minimize the chances of this workflow halting/failing again.

* Add workflow_dispatch trigger

* Rename workflow to 'Frontend Test Coverage'
2025-10-27 09:27:34 -06:00
Nemanja Glumac
fcd7a98745 Do not include already patched libraries in node_modules cache (#65052) 2025-10-27 14:49:59 +01:00
Phoomparin Mano
b025a5bfb7 Add horizontal padding on embedding hub when shown in homepage (#65051) 2025-10-27 20:27:13 +07:00
Phoomparin Mano
02467bd231 Design updates for static and interactive embedding settings (#64930) 2025-10-27 08:45:03 +00:00
Nemanja Glumac
ba60e617ba Temporarily patch the broken FE unit test that times out (#65027) 2025-10-27 09:36:29 +01:00
Nemanja Glumac
7738ae7271 Enable Trunk Quarantine for FE unit tests (#65022) 2025-10-27 11:50:20 +13:00
metamben
08c8d0f1f6 Add implicitly joined tables as dependencies (#65015)
* Add implicitly joined tables as dependencies

Fixes QUE-2705

* Simplify table ID collection

* Align local names with producer function names
2025-10-27 01:11:26 +03:00
Nemanja Glumac
bdef8558a9 Remove manual version resolution for nanoid (#65023)
It already resolves to a higher version than that
which was defined in a resolution.
2025-10-26 21:59:24 +01:00
Jeff Bruemmer
20c7cb44a3 docs - minor edits (#65021)
* minor edits

* Apply suggestions from code review
2025-10-26 15:00:19 +00:00
Uladzimir Havenchyk
90b57af0ae drop patch from cypress-esbuild-preprocessor (#65010) 2025-10-26 00:08:49 +02:00
Uladzimir Havenchyk
6ec03b098e chore: make bookmark button look the same as other action buttons (#64951)
* chore: make bookmark button look the same as other action buttons

* revert active state
2025-10-25 22:50:07 +03:00
Uladzimir Havenchyk
7b7d02442a deps: don't bring node polyfills into browser (#64740)
* deps: don't bring node polyfills into browser

* patch package

* fix lint

* bring back Buffer

* another attempt

* Revert "patch package"

This reverts commit 0aee5326018c25f3281400a9254c37fe2b4e7199.

* update password-generator

* try different config

* add fallback

* one more attempt

* one more attempt

* add back buffer

* one more time

* update rspack

* update rspack config

* drop crypto polyfill and patch package instead

* address review

* update patch
2025-10-25 06:54:41 +00:00
Maz Ameli
5decddf00c Simplify metabot icon (#65017) 2025-10-24 23:59:37 +00:00
John Swanson
bacdb174ee Remote Sync (#62686)
* Fix remote sync settings test

* Fix sync type setting validation test

* Fix check sync task type is production

* Update plain type to collection_type

* Cascade changes to collection type

* Update deps checks when collection type changes

* Fix task type check in export

* move setting check to api for better status report

* add tests for sync-type

* Don't mark newly created entities as updated or removed UXW-1806

* UXW-1821 enabled badge

* UXW-1818: hide branch picker and push button for non-admins

* cleanup and UXW-1814

* remove border from the branch picker button

* cleanup

* UXW-1829 update diff modal ui

* UXW-1807: token should appear masked

* Allow setting of nil token

* UXW-1833: show backend error when saving invalid git settings

* Add new collection update/create events

* Remove per collection imp/exp; change dirty status table

* Redo event handling add removed status

* Sync object table on syncs

* Fix status names

* Added /current-task/cancel API and track version in remote_sync_task

* Add is_remote_synced to api responses

* Fix adding is_remote_sync hydration

* Fixed compilation error

* remove hashp

* Fix loading is_remote_sync hydration

* Resolve ambiguous reference

* Fix n+1 detector

if it gets a heterogeneous set of things we should hydrate each type
separately.

* Add can-create? handlers

* remote sync: a few bugfixes and improvements from my bugbash (#64372)

* Set `collection.type` on archive/unarchive

When unarchiving or archiving collections that have the `remote-synced`
type, we need to set their new type appropriately.

When archiving, we should give them a normal (nil) type.

When unarchiving any collection *to* a remote-synced collection, we
should set the type to `remote-synced`.

* Allow serdes without archived items

and use it in remote sync export.

During dependency checking, we do *not* want to exclude archived items:
if card A uses card B, and card B is archived, we need to include Card B
in the list of dependencies! Otherwise we'll say that it's fine to
remote sync card A when it's not.

* Add tests

* Documents are descendants of collections

* don't include cards as document descendants

* fix tests, dashboard descendants args

* remove #p and unnecessary query

* remove another `#p`

* Update auto sync token to enable import job

* More is_remote_sync hydration fixes

* Fix lints and document oss serdes

* Fix cards to be valid for update events

* Don't actually import if nothing has changed in the remote repo

* Remove hashp

* UXW-1817: change branches should update content

* UXW-1813 ensure sync dirty state is properly invalidated

* UXW-1864 fix how collections changes appear in the diff

* Fix ee-available? check

* Improve is_remote_synced hydration

* Fix some more oss/ee issues

finish remote ChangeLog model

* fix invalidation on removal

* fix missing require

* Don't need to handle transforms directories specially

* fix tests to make sure state is fully reset

* remove duplicate require

* Fix deadlock on import

* Fixing tests

* Fix document tests

* Fix kondos

* handle removed sync_status

* UXW-1851: show moving out of synced collection error

* feature flag, misc fixes

* dirty state tracking for snippets

* Fix ns typo

* Add remote-sync token and config

* enforce remote_sync token feature on the FE

* allow cancelling the remote-sync

* Track timeline

* Force re-import when configuring for production mode

* Fixed compilation error

* Force re-import when configuring for production mode only when auto-sync is enabled

* Throwa 400 error if there are dirty objects when doing an import

* force import button

* Better archiving checks with remote synced collections

* Better tests for documents and remote-sync deps

* Remove hashp

* remote hashp

* Remove other hashp

* More consistent collection write checks

* Fix broken collection tests

* Fix broken documents tests

* improve imports/exports frontend

* Implement can-create? for timeline-event

* tweak copy

* Always update branch setting

* Initial Commit

* Fix more tests

* Remove bad parallel annotations

* Show error toast when adding a collection that has references outside of the repo

* reasonable structure, error handling

* timelines editing is less frequent, we can invalidate dirty state on any edit

* Fix dirty state api tests for mysql

* bring error details back

* Fix collection move tests

* Fix remove parallel from can_restore tests

Splitting this into smaller tests seems to introduce some kind of state
that causes tests to fail in parallel

* Fix make logs use unique names for be tests

* Bump toucan2 versions

* Fix var name

* Fix check that there are exportable collections

* Add test for exportable check

* Started on e2e test

* Fix issue with merge

* Fix arguments to card descendants

* Handle new ingestable interface

* Put back changes in cypress-runner

* Fix remaining failing enterprise tests

* Fix one set of app tests

* Clean remote sync state in obj tests

* single collection

* Fix unit test - enterprise getIcon function only applied when new feature is enabled (ResultItem.unit.spec.tsx)

* Fix ts issues / Clean up

* FE fixes

* Remove parallel annotations

* Fix missing import from merging master

* Fix the fix

* always create collection to sync

* no unsyncing

* Remove associating location to trash from search

* Prevent users from switching branches with unsynced changes + show warning

* Create remote-sync collection when it doesn't exist

* Prevent changing to production with unsynced changes

* Make sure dirty state refetches on admin settings load

* single synced collection ui update

* Cannot change to production mode when there are unsynced changes

* Fix failing query

* unquote branches

* fix eastwood

* fix timeline event publishing

* fix import

* Move dashboard remote sync api tests into ee

...where they can reference the setting

* Created /stash API and renamed create branch api to /create-branch

* Fix settings issue

* Fix remaining permissions message tests

* Make sure drop target always works for trash

* Add checks for if we're in trash elsewhere

* cleanup

* git-sync to remote-sync

* more git-sync to remote-sync

* Don't allow export if it overwrites an external commit

* - Don't assume a "main" branch
- Attempt an import when no remote-sync branch exists when enabling dev mode

* Fix creating remote sync library

* refactor to middleware

* hack: add a delay for refetching instance settings or dirty state after remote sync task finishes

* UXW-1953: confirmation flow when switching branches in prod

* Update modal when switching branches with dirty state / Component refactorings

* Create a branch off the last-used commit, not the branch itself

* Add options modal when trying to push while remote is ahead

* Support force option on export

* Update branch setting and complete task in txn

* Let export! set branch in stash and fix tests

* Fix PR feedback nits

* Update enterprise/backend/src/metabase_enterprise/remote_sync/api.clj

* Consistent documentation style in remote-sync

* Add option to pull from remote / Adjust push/pull icons / Adjust out-of-sync options modal

* modals UI polish

* constants clean up

* Add api schemas and make error messages consistent

* fix check-403 to write-check

* Apply suggestions from code review

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>

* Clean up a couple components / Move things around

* Address renaming suggestions

* Fix var names and bad merge

* double->float in schema

* Share error handling

* Update enterprise/backend/src/metabase_enterprise/remote_sync/settings.clj

* Update enterprise/backend/src/metabase_enterprise/remote_sync/settings.clj

* Update enterprise/backend/src/metabase_enterprise/remote_sync/settings.clj

* Addressing small PR comments

* Refetch properties when branch is created (current branch changed)

* Make sure /current-task is only called when import and export are not in progress

* Replace unset color variables

* Improve element padding on side panel

* Remove a couple trailing spaces reported by clj whitespace linter

* Show error when settings request fails / Make sure current-task also waits for the PUT settings mutation

* Fix document perm tests

* Allow empty remote-url, moved import and export calls to impl

* Fix minor prettier issue

* Fix another lil lint issue

* temp

* e2e push / pull

* Unify more of the import implementation

* fix CI failures

* fix mysql ci failures

* Address metabot critiques

* Address additional metabot feedback

* last round of docstring feedback

* library admin settings e2e

* Add attribution to TODO

* fix ws

* fix missed commiting file

* fix another missing file

* production switch branches

* More clojure like docstrings

* More docstring fixes

* adding branch switching test

* Address Nick's PR review comments (most of them)

* Fix more nits

* Resolving Nick's comments part 2

* Improving remote-sync settings handling

* attempt to repair synced_folder icon

* Fail if attempting to connect to an uninitialized repo

* correct the name of synced_collection.svg

* add new repository icon

* Add default-branch to source protocol

* Update Git Sync to Remote Sync in Admin settings (#64993)

* Make api docstrings and errors more generic

* Use check-400 to simplify api

* fix ws

* Rollback BaseSMTPConnectionForm.tsx (fixes a e2e test)

* fix e2e tests?

* Fix small merge issue

* Always use `last-version` instead of caring about import vs. export version

* starting warning modal tests

* Fetch source at the beginning of import/export operations

* Fix broken test

* Delete branches that were deleted on remote

* Fix missing test suffix

* Fix eastwood

* Adjust branching e2e test, skip failing tests

---------

Co-authored-by: Edward Paget <ed.paget@gmail.com>
Co-authored-by: Nathan Voxland <nathan@metabase.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Anderson <anderson@metabase.com>
Co-authored-by: eliotmetabase <eliot@metabase.com>
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Maz Ameli <maz@metabase.com>
2025-10-24 15:58:25 -07:00
metamben
bb6d7b1cbc Fix transform target table hydration (#64999) 2025-10-24 21:41:57 +00:00
Nemanja Glumac
f01ea21e37 Do not deduplicate js dependencies automatically (#65004) 2025-10-24 21:53:53 +02:00
Riley Thompson
e937214a8d Include documents and dashboards in dependencies (#64888) 2025-10-24 13:42:24 -04:00
Tyler Plude
d9060d941c [METABOT] Project Code Gen (#63313)
* init branch

* FE - add codemirror diffing, add diff support to native query editor, fake a proposed query

* Add /ee/metabot-tools/get-transforms endpoint

Returns a sequence of all python or native query transforms.

BOT-391 [Backend] Create transform index tool API

* Add test that get-transforms does not include non-native MBQL transforms

* Add /ee/metabot-tools/get-transform-details endpoint

* allow opening metabot on transforms admin pages

* use transforms_codegen profile for metabot on transforms page

* send transform in context

* show metabot on edit + create transforms page

* accept tranform suggestions from metabot

* Cleanup malli schemas for get-transforms and get-transform-details

* add transform context on edit query page

* use transforms instead of data queries

* Parse out tables from transforms in metabot user context

* wip on creation flow

* hack in a message to metabot on save

* quick fix preview error not displaying correctly

* misc. fe improvements

* fix transform context on subsequent edits for the same transform

* half hacky way to use current editor state for context in transform editing

* Switch /ee/metabot-v3/get-transforms from :get to :post

This endpoint doesn't expect args of it's own in the body, but does accept the standard metabot conversation_id that
it echoes back.

* Show 'Apply Changes' button when a transform change is generated by the agent

* handle new transforms better

* Ensure we have a fallback for context items that don't have SQL to parse

* persist diff of transform to the conversation history

* temp - make metabot always visible on transforms admin pages

* Change button label to "Proposed changes to <transform>"

* copy change for create transform buttons in chat

* better hidden message ui

* hack - better emtpy convo text

* hide suggested prompts

* Add basic snippets tools

* ensure proposed queries go through nativeQuery.setQueryText so that template tags are parsed

* better todos

* even better todo list ui

* crude sidebar ui for query transforms diffs

* better suggestion chat ui

* good'nuff @mentions

* debug logging for search table bug

* further logging

* Ensure we parse template tags for transform edits in Metabot sidebar (#64001)

* cleaner, more copy/pastable, better flowing @mentions in metabot

* Fix metabot get-transforms api test to :post not :get

* Update metabot tools test with basic python transform tests

* Ensure transform :source and :target keys get snake cased when returned from metabot tool apis

* Add get-transform-python-library-details metabot tool api endpoint

* Enhance context with :used_tables for python transforms

* surface transforms in @-mention search

* some type fixes

* python FE progress

* python fe improvements + edit experience now works

* clear proposed on cancel

* fix accept in sidebar not saving

* better diff colors

* smaller todos

* cleaner code for todos

* improve ranking of transforms in search by hardcoding a last_viewed_at time in user-recency-expr

* first pass at nested @mentions

* Conditionally add transforms to model->db-model

* Add transforms-python to module deps for metabot

* Move native-query-transform? into transforms.util and re-use existing utils

metabot-v3.tools.transforms defined a couple of helper functions that were nearly identical to ones that have since
been added to transforms.util ns. Move some things around and make use of the existing transforms.util predicates,
which are now exported from the module's core namespace.

* lots of fe clean up

* prevent rewinding conversation for admin pages

* @mention solution that plays nicely with documents

* fix search bug

* fix type issues and few small feedback things

* Add transforms to search for Metabot (#64134)

* index transforms content

* Add support for transforms & query search in metabot search tool API

* fixup whitespace

* update to use new :fields syntax

* Fix up serach-native-query malli types

* Fix the 15-day interval for transforms to be db-agnostic

* move engine loading to metabase.search.init to break circular dep

* fix kondo

* Revert "Fix the 15-day interval for transforms to be db-agnostic"

This reverts commit 11b34e4cd4a8a5a0cf8041a1d82d487ed8c81025.

* add transform to set of appdb scorer models; unrevert db type fix

* fix kondo

* implement requisite multimethods for transforms not to error in in-place search engine

* ensure we enforce metabot/unknown contexts for transforms in in-place search backend as well

* fix filter test

* transform->postprocess to reduce naming ambiguity; add a basic transform ingestion test

* add a metabot result postprocessing test

* add transforms scoring test

* expand ingestion tests

* fix tests + kondo

* address feedback

* make suggestion models configurable for a Metabot instance

* fix @mention recents in documents, update suggestion sidebar component to not accept / reject items + calculate isViewing better

* quick fixes

* for rye guy

* Handful of fixes for transforms search (#64287)

* Add both search and search_v2 endpoints, and fix bug with search-native-query option

* add a docstring

* add a basic unit test for search-native-query option

* address comments

* better state management for suggested transofrms, move css around, clean up suggestion message code

* Update the list of source tables in Python editor when metabot changes it (#64258)

If metabot proposes changes to the list of input tables for a Python transform, update the PythonDataPicker component
to keep it in sync with the text of the transform source.

* python tables reference fix

* bug fixes and better state organization

* better draft support

* fix types

* add on leave modal, clear transforms on route leave, calc dirty state, fix onChange but for native query editor, better logic for showing cta text for transform suggestions

* Ensure transforms get deleted synchronously from the search index (#64382)

* Delete transforms from search index in t2/define-before-delete

* kondo

* fix up tests

* Stop pretending to snake_case transform source and target keys

The malli schemas were wrong, so these weren't actually getting snake_cased anyway.

See also:

https://github.com/metabase/ai-service/pull/387#discussion_r2414569482

* Fix failing test & kondo warning

* Add transforms dependency check API for metabot (#64542)

* WIP - add dependency check API for metabot

* omit bad_cards for now

* update return format

* add tests

* Fix fn call

* revert unneeded refactor

* Fix search transform-ingestion-test to use mt/native-query

* switch test to mt/native-query

* Fix module usage test

* fix up tests to use lib/native-query instead

* try to fix last test

* switch native-query-transform? to use lib.query/native?

* more mbql 5/metabase lib updates

* revert the 1-pixel fix

* Subtract a pixel when computing metabot chat filler height to avoid scrollbar flicker (#64690)

* Fix MetabotAgentSuggestionMessage only show "create" for new transforms (#64598)

https://metaboat.slack.com/archives/C09CR3MT1KR/p1760034396345789

* Surface broken cards from Metabot dependencies check API (#64781)

* fix missing sidebar diff after mbql5 change

* surface broken cards

* add test

* fix kondo

* remove unused code

* Fix up dep check question terminology & schema

* fix up test

* fix up another test

* address feedback

* Update the transform source schema to use ::queries.schema/query

* remove unused require

* address FE feedback

* fix modules config test

* @mentions tests and improvements

* couple of e2e tests fixes

* prevent leave confirmation when saving

* fix most of unit tests

* add back searchable models in metabot @mentions

* More tests for transform search + transform dependencies tool, and some new future-proofing read checks (#64896)

* add some future-proofing read checks to transform deps checks + related tests

* add some more transform search tests

* remove 404 check; move read check later in impl

* convert from toucan transform instance to metadata

* clean ns

* Add tests for metabot tools snippets and check-transform-dependencies endpoints (#64894)

* Add tests for metabot tools snippets API endpoints

* Add test for metabot tools check-transform-dependencies endpoint

* Remove trailing blank line to appease linter

* add MetabotChatEditor.unit.spec.tsx

* add links.unit.spec.ts

* add AIMarkdown.unit.spec.tsx

* add MetabotAgentTodoMessage.unit.spec.tsx

* add MetabotAgentSuggestionMessage.unit.spec.tsx

* add metabot/state/reducer.unit.spec.ts w/ tests for suggested transforms state

* add e2e test coverage for create + update flow for both native sql + python transforms

* FE pr feedback and lint fix

* unit test fixes

* fix search test

* add temp metabot toggle button in admin nav

* fix a couple of failing FE tests

* attempt fix ci flake issue with metabot.unit.spec.tsx

* remove metabot-only restriction on transform search

* remove redundant logs in transform api endpoints to address ngoc's comment

* fix a number of transform search tests

* fix another test

* fix hopefully last search test

---------

Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
Co-authored-by: Mike Appleby <86076+appleby@users.noreply.github.com>
Co-authored-by: Noah Moss <noahbmoss@gmail.com>
Co-authored-by: Mihael Konjevic <konjevic@gmail.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-10-24 11:58:30 -05:00
Cam Saul
15b31fb834 nest-query => Lib (#64940)
* nest-query => Lib

* Fix schema

* Update changelog

* PR feedback from #64901

* Upgrade field resolution to handle CATEGORY_2 => CATEGORY

* Update docstring

* Test fix 🔧

* Test fixes 🔧

* Whoops commit new file

* Test fixes 🔧
2025-10-24 09:42:55 -07:00
Nemanja Glumac
ce56b8e398 Simplify and unify M2 and node-modules caches (#64955) 2025-10-24 18:18:51 +02:00
Sébastien
d2b54425f2 Closes EMB-906 custom branding images for SDK (#64946)
* .

* .

* types

* tidy up

* tidy up again

* tidy up again

* cleanup
2025-10-24 17:35:22 +02:00
metamben
8722548f6d Add permissions checks for the dependencies API (#64965) 2025-10-24 10:57:43 -04:00
Nemanja Glumac
8a542dd80a Introduce Metabase CI caching strategy (#64988) 2025-10-24 16:20:56 +02:00
Marcos
940d244d2d fix stuck loading in 'caching in questions and dashboards' admin section (#64799) 2025-10-24 11:15:50 -03:00
Alex Yarosh
33e9a2cc25 docs: ai chat component (#64989)
* ai chat component

* oops

* Update docs/embedding/embedded-analytics-js.md

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>

* Update docs/embedding/embedded-analytics-js.md

* Update docs/embedding/embedded-analytics-js.md

---------

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
2025-10-24 14:05:48 +00:00
Nick Fitzpatrick
9ddffb2edf handful of fixes (#64854)
* handful of fixes

* trash icon color, fix tooltip text in charts

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-10-24 09:48:04 -03:00
Uladzimir Havenchyk
c396990a98 fix(command palette): show different skeleton when no recent items (#64929)
* fix(command palette): show different skeleton when no recent items

* cleanup

* make props required

* fix typecheck

* remove default
2025-10-24 11:23:40 +00:00
github-automation-metabase
29f1dac45f Update generated docs (master) (#64975)
Co-authored-by: github-actions <github-actions@github.com>
2025-10-24 07:14:17 -04:00
Mahatthana (Kelvin) Nomsawadi
db9c8dcfbf Wait for timeline to refresh before clicking the checkbox (#64984) 2025-10-24 11:41:08 +01:00
Dan Stone
2dc59090e3 Connection closed flake during python-transform-timeout-status-test round 2 (#64947)
* Remove redundant transaction setting in timeout test

Did not fix flake as expected

* If in a transaction do not open the python log thread
2025-10-24 09:48:04 +00:00
Fraser
a13c7d234d Remove unused packages from package json (#64941) 2025-10-24 20:43:51 +13:00
Fraser
577b1d8fb6 Remove regenorator-runtime (#64942)
Generators are native in browsers now, this dep is not needed
2025-10-24 14:30:23 +13:00
Anderson
6586bba402 Removing docs/* for ignore (#64973)
Due to `useEngineDocMarkdownContent` changes the dynamic imports are needed for `import(`docs/databases/connections/${docFileName}.md`)`

Co-authored-by: Jonathan Sheely <jsheely@thirtytech.net>
2025-10-23 20:03:34 -03:00
dpsutton
686113d2d7 disable snowflake (#64962)
https://linear.app/metabase/issue/DEV-997/reenable-snowflake-in-ci

due date one week
2025-10-23 17:00:56 -05:00
John Swanson
a893803cfb Collections are delete-able (#64414)
* Collections are delete-able

The `can_delete` flag for collections was the only missing bit to have
collections be deletable, since I added an API endpoint to delete
collections a while ago! I thought FE work was required, doh.

Fixes UXW-1090

* Fix e2e tests
2025-10-23 13:16:52 -07:00
Cam Saul
aa200bc31f X-Rays => Lib (#64901)
* Rework X-Rays to use Lib

* Test change

* Fix the last few failing tests

* Remove dead code

* PR feedback

* Claude updates

* Fix typos

* Oops

* e2e test fix 🔧
2025-10-23 10:03:38 -07:00
Alexander Polyankin
1b03fa10a9 Dependency tracking graph (#64202)
* Search

* Search

* Search

* Search

* Search

* Search

* Search

* Search

* New format

* New format

* New format

* New format

* New format

* New format

* updated graph endpoint

* added /graph/node

* remove prn

* add ability to get graph for a single node

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* New format

* update graph api again

* Fix viz icon

* CSS hack

* CSS hack

* Fix layout jump

* Types

* Types

* Types

* Types

* Types

* Types

* Types

* Types

* Types

* Types

* Types

* Types

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix tests

* Fix tests

* Fix

* update api

* Fixes

* Add view count

* Add view count

* update api again

* Fix

* Fix

* Fix

* Fix

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* Add sorting

* api update

* Fix merge

* Fix merge

* Fix merge

* Search

* Search

* Search

* Search

* Search

* Search

* selection

* selection

* selection

* selection

* selection

* selection

* selection

* selection

* selection

* Fix selection

* Fix selection

* Fix selection

* Fix selection

* Fix selection

* Fix selection

* Fix selection

* Restrict transform search to admin users and add basic test

* Fix selection

* Fix selection

* Fix selection

* Fix selection

* Fix selection

* Fix selection

* Fix selection

* Fix selection

* Fix selection

* Fix selection

* Fix selection

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Info

* Info

* Add a bunch of fields to the data nodes

* Info

* Info

* Info

* Info

* Hydrate table fields in graph endpoints

* Info

* Info

* Info

* Info

* Info

* Info

* Hydrate table for transforms and db for tables

* Remove comment form

* Info

* Info

* Acknowledge that db id, schema, and table name form a key

* Info

* Info

* Info

* Fixes

* Fixes

* Adjust loading

* Add check

* Add check

* Fixes

* Fixes

* Tests

* Tests

* Tests

* Tests

* Tests

* Tests

* Tests

* Tests

* Tests

* Tests

* Tests

* Tests

* Tests

* Tests

* Tests

* Tests

* Fix compilation

* Tests

* Tests

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* UI updates

* Handle errors

* Handle errors

* Handle errors

* Handle errors

* Handle errors

* Remove view_count for non-questions

* Remove view_count for non-questions

* Remove view_count for non-questions

* Fix some tests

* Remove view_count for non-questions

* Fix one more test

* Add more tests

* Remove view_count for non-questions

* Remove view_count for non-questions

* Remove view_count for non-questions

* Remove view_count for non-questions

* Remove view_count for non-questions

* Remove view_count for non-questions

* Remove view_count for non-questions

* Remove view_count for non-questions

* Add e2e tests

* Add e2e tests

* Rename to dependents_count on FE

* Rename :dependents to :dependents_count in the BE

* Fix FE types

* Fix FE types

---------

Co-authored-by: William Zimrin <william@metabase.com>
Co-authored-by: Tamás Benkő <tamas@metabase.com>
2025-10-23 12:17:13 -04:00
Nemanja Glumac
ac8285254b Start utilizing the Trunk Quarantine for E2E tests (#64873) 2025-10-23 14:10:37 +02:00
Sébastien
1a8a04cf82 fix(sdk): Closes EMB-905 no error when embedding MB localhost->distant MB (#64835)
* Closes EMB-905 no error when embedding MB localhost->distant MB

* cleanup
2025-10-23 12:33:32 +02:00
Sébastien
750c6ebb22 Fixes "In HTML, <button> cannot be a descendant of <button>." error and removes console warnings (#64904)
* Removes many console NPE warnings

* button -> icon for widgetStatus

* role

* fixup

* padding

* fixed flaky
2025-10-23 11:56:09 +02:00
Nemanja Glumac
2c71824e61 Sane CI caches PoC - Cypress (#64932) 2025-10-23 13:53:08 +13:00
Nemanja Glumac
a58b2ebefc Remove unused add-to-project action (#64910) 2025-10-22 17:13:39 -07:00
Nathan Voxland
ac22d632bc Improve logging and recovery around errors in reindexing and create-table! (#64897) 2025-10-22 16:07:13 -05:00
Phoomparin Mano
b56f63252b Design polishes for modular embedding and embedding setup guide (#64893) 2025-10-23 03:14:52 +07:00
Uladzimir Havenchyk
62fceee952 fix: restore missing css after migration to new postcss-preset-env (#64874)
* fix: restore missing css after migration to new postcss-preset-env

* update comment

* Update postcss.config.js

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>

* proper fix

* fix comment

* remove path

---------

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
2025-10-22 22:36:56 +03:00
Phoomparin Mano
2feb85417d feat(sdk-bundle, embed-js): stacked layout updates for metabot question (#64573) 2025-10-22 19:16:44 +00:00
John Swanson
8dc5cec918 Remove :feature checks on some EE code (#64848)
* Assert premium features for some middleware

* Fix an existing bug

These tests started failing here, which revealed that they formerly
never actually were testing what they thought they were.

A few reasons:
- they turned on `advanced-permissions` feature by itself, so sandboxing
was always off here

- they set up sandboxing in a nonstandard way

- one had a typo so we weren't even wrapping the body with
`with-download-perms!` (it was a separate block entirely)

This hid the bug that some of the tests were intended to reproduce - if
a card used for sandboxing had a native query, then we required that you
have download permissions on the entire database, which is wrong.

* fix test

* make assertions with/without tokens for sandboxing

* Add comments about why `:feature :none`

* Update enterprise/backend/test/metabase_enterprise/sandbox/query_processor/middleware/sandboxing_test.clj

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>

* add a nicer docstring and change fn name

replace `any-native-unsandboxed-stage?` with
`any-native-stage-not-introduced-by-sandbox?`

* Block without feature enabled

* CR response

---------

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-10-22 11:20:12 -07:00
Phoomparin Mano
560a253192 Design polishes for EAJS embed wizard (#64895) 2025-10-23 01:19:07 +07:00
github-automation-metabase
753c645216 Update generated docs (master) (#64900)
Co-authored-by: github-actions <github-actions@github.com>
2025-10-22 14:10:00 -04:00
Anderson
bd18384233 Fix unnecessary redirects on Models & Metrics pages (#64489)
* Fix models and metrics links to prevent redirect from /question/:id-slug

* Fix e2e
2025-10-22 13:42:49 -03:00
Nicolò Pretto
67d603aa42 feat(sdk): plugins passed to the provider are passed down to the (#64920)
dashboard
2025-10-22 15:52:18 +00:00
Rodrigo López Dato
b9ac3ab886 Allow app and capacitor schemes as valid origins for Ionic apps (#64719)
* Allow any scheme for URLs, not just http/https

* Explicitly allow app:// and capacitor:// schemes

* fix flakiness in e2e test

* Only accept HTTP/HTTPS when no protocol is specified

---------

Co-authored-by: Uladzimir Havenchyk <uladzimir@metabase.com>
2025-10-22 11:02:11 -03:00
Nicolò Pretto
bef6cb6908 make mapQuestionClickActions intercept links and fix links to host app (#64623)
* ugly solution #1

* revert the ugly part

* refactor and tests

* fix(modular): make links/click behavior that link to the same origin as the host app work and open them on a new tab

* update tests to expect a click behavior

* clean up tests

* tests for the same domain issue

* add also basic support for links, just in case

* Update e2e/test-component/scenarios/embedding-sdk/dashboard-click-behavior.cy.spec.tsx

* refactor tests as per feedback to use mockIsEmbeddingSdk

* don't remove column settings
2025-10-22 15:07:59 +02:00
Nemanja Glumac
f573f15de1 Replace and remove use-table-list-query (#64772) 2025-10-22 10:33:01 +00:00
Kamil Mielnik
38bf19399d Update onboarding video (#64905) 2025-10-22 09:59:44 +00:00
Cam Saul
f3b85b3e33 Lib column unique key (#64889) 2025-10-22 09:54:57 +00:00
Nemanja Glumac
23f74a039f Update team members in team.json (#64902)
Removed 'kulyk' from Admin team and added multiple members to DevEx team.
2025-10-22 11:19:25 +02:00
Kamil Mielnik
3ad1913339 Separate favicon for dev env (#64845)
* Add separate favicon for dev env

* Don't use dev favicon if a custom one has been set

* Red favicon

* Format code
2025-10-22 16:16:37 +07:00
Dan Stone
e622f71034 Opt logging test out of slower drivers (#64903) 2025-10-22 09:03:45 +00:00
Mahatthana (Kelvin) Nomsawadi
abeef3b5a8 feat(sdk): Let end users archive items in the CollectionBrowser SDK component (#64561)
* Remove unnecessary default value

* Remove unnecessary export

* Show move to trash icon in CollectionBrowser

* Make the trash button easier to work with

* Add a dropdown

* Fix icon

* Archive resources in the collection browser

* Add tests

* Update UX

* Prevent external type change

* Remove custom style
2025-10-22 04:38:59 +01:00
Fraser
2637538cee Use more robust approach to detecting unmocked routes (#64508) 2025-10-22 16:14:26 +13:00
Maz Ameli
5aad91c383 fix border color (#64857) 2025-10-21 20:49:49 -04:00
Maz Ameli
5931cb0d0a Subtler Add Data button in side nav (#64745)
* subtler add data button in side nav

* fix tests

* update test

* fix unrelated broken test

* fix another unrelated broken test

* try fixing test again

* undo changes to unrelated tests

* Cursor's attempt at fixing related test
2025-10-21 15:49:01 -07:00
Cam Saul
8ad785fdbb Deprecate legacy MBQL utils (#64595)
* Deprecate legacy MBQL utils

* Deprecate legacy MBQL utils

* cljfmt

* Fix most tests except long native column names

* Kondo

* Test fixes 🔧

* Fix .clj versus .cljc in Lib

* Disable deprecation warnings

* Fix cljs

* Mega normalization improvements

* Kondo

* Another round of test fixes 🔧

* Schema fix 🔧

* PR feedback; test fixes

* Test fixes 🔧

* Fix BigQuery tests

* Test fix 🔧

* Test fixes 🔧

* Fix Card QP parameter normalization AGAIN 😆

* Oops

* Fix Claude code review

* Fix Claude code review

* Fix BigQuery tests
2025-10-21 15:29:36 -07:00
dpsutton
78308b14f9 Extend db connection timeout in tests (#64886)
* Extend db connection timeout in tests

We allow for 10 seconds in the app, and 3 seconds in test. I extend that
3 seconds to 5 seconds. This should really only affect bigquery.

In bigquery, we test if you "can connect" by connecting to the project
and then attmepting to find any datasets that you are able to see. This
is important because each test run connects to the same project but is
scoped down to fewer datsets. It's possible we could change this
behavior and return if you can list datasets at all, but it is nice if
you can see at least one dataset based on your inclusion and exclusion
filters.

For reference, the filters for my current CI run are:

```clojure
bigquery-cloud-sdk=> (update details :service-account-json (constantly "<<redacted>>"))
{:project-id nil,
 :service-account-json "<<redacted>>",
 :dataset-filters-type "inclusion",
 :dataset-filters-patterns "sha_4c3ca6238018e2b60025297f3e5c39671588adf2_QLGKZKIAOSQXOGGDURQY",
 :include-user-id-and-hash true,
 :project-id-from-credentials "metabase-bigquery-driver"}
```

In my repl, i'm seeing the following behavior:

```clojure
bigquery-cloud-sdk=> (time (let [client (database-details->client details)
                            project-id (get-project-id details)
                            datasets (.listDatasets client project-id (u/varargs BigQuery$DatasetListOption))
                            ]
                        (vec (for [^Dataset dataset (.iterateAll datasets)
                               :let [dataset-id (.. dataset getDatasetId getDataset)]
                               ]
                           dataset-id))))
"Elapsed time: 2692.292292 msecs"
["BQ_tupac_sightings"
 "Shakespeare"
 ...
 "v6_sample_dataset"]
bigquery-cloud-sdk=> (count *1)
273
```

So just enumerating all datasets takes ~2.7 seconds so we are flirting
with the fail limit of 3 seconds.

I extend this to 5 seconds and this should only give a bit of breathing
room to bigquery and everything else remains the same.

* fix flakiness in e2e test

---------

Co-authored-by: Uladzimir Havenchyk <uladzimir@metabase.com>
2025-10-21 17:15:28 -05:00
Alex Yarosh
3d5410d199 samesite (#64883) 2025-10-21 17:28:05 -04:00
Phoomparin Mano
497ef8ebe1 Embedding hub's checklist endpoint fails due to sample database changes (#64642) 2025-10-22 02:39:38 +07:00
Dan Stone
ec16936ff8 Add new columns to metabase_field for internal-tools/data-apps (#60263)
* Add migrations

* Add new columns to serde spec

* Update serde baseline

Will change again in follow up once sql-jdbc behaviour is ported

* Extend sql-jdbc describe-table

* Sync new field columns

* Extend field our-metadata to the new sync columns

* Fix tests

* Add postgres support new field columns

* Add generic driver tests for nullability and defaults

* Extend clickhouse test driver to :not-null? :default field defs

* Add new columns to mysql describe-fields-sql

* Add new features for better test specification

- :describe-is-nullable
- :describe-default-expr

In both cases if the feature is unsupported, the driver must return `nil` for the respective field metadata keyword.

* Add :database-is-generated test and driver feature

* Fix load-data inserts when rows empty

* Do not return generated-column-sql for redshift

* Fix snowflake-test/describe-table-test

* Fix bigquery load-tabledef when table has no rows

* Use generation_expression rather than :extra for mysql/mariadb

* Fixup driver features

* Amend pk-sync-test to verify the new :database_is_pk behaviour more explicitly as the semantic type changes

* Add sync tests for default/generated/nullable

* Formatting

* Add SQLite support for generated/nullable/default

* Add SQL-Server support for generated/nullable/default

* Only test dynamic dataset databases for now

* For druid JDBC all columns (apart from __time) are nullable

* Vertica does not support generated columns

* Starburst does not support generated columns

* Presto does not support generated columns

* Revert accidental database-required behaviour change

* Assert table synced

* Use def'd datasets rather than inline

* Oracle features

* Vertica features

* Opt starburst, presto out of defaults

* Add :test/create-table-without-data to deal with mongo

* Add some new lines to mig yml

* Add note about sync to driver test

* Do not spam logs for pk changes on upgrade

* Further logging guard refinement

* Fix migration conflicts
2025-10-21 17:59:51 +01:00
Dan Stone
c4cfe78c2c Fix devcontainer deprecated apt-keys call (#64879)
NodeSource should handle its own keys
2025-10-21 16:29:09 +01:00
github-automation-metabase
d0fff0402a Update generated docs (master) (#64858)
Co-authored-by: github-actions <github-actions@github.com>
2025-10-21 11:26:52 -04:00
Alex Yarosh
f267ce0c56 Revise impersonation permissions details (#64878)
Updated impersonation permissions documentation to clarify supported databases and row-level security for PostgreSQL.
2025-10-21 11:14:00 -04:00
Dan Stone
363ed3b959 Ensure idle_in_transaction_session_timeout is large enough during timeout test (#64866) 2025-10-21 15:53:19 +01:00
Noah Moss
b4c65c3299 [semantic search] Separate out embeddable_text from searchable_text and use labeled format for embedding (#64693)
* [Search] Separate out embeddable_text from searchable_text and use labeled format for embedding

* add embeddable_text to test data

* update mock-embeddings in tests to use new format for embeddable strings

* Fix more tests

* Fix more tests

* Fix last tests

* Fix last test

* improve comments & add a test that transform fns are not applied
2025-10-21 10:37:35 -04:00
Nemanja Glumac
195b18d690 Remove unused [ci nocache] CI option (#64852) 2025-10-21 16:36:53 +02:00
Phoomparin Mano
3a0e283b12 Move the SameSite cookie settings from interactive embedding to security tab (#64533) 2025-10-21 21:07:23 +07:00
github-automation-metabase
97c57e7bac chore(sdk): Update published npm version to 0.57.0-alpha.3 (#64870) 2025-10-21 12:43:23 +00:00
Mahatthana (Kelvin) Nomsawadi
92cea5d4f5 Fix download not getting parameters from visualized dashcards (#64754)
* Fix download not getting parameters from visualized dashcards

* Add E2E test

* Make test name clearer
2025-10-21 12:50:03 +01:00
Nemanja Glumac
dbf8855111 Ignore fn-deprecated warnings in cljs logs (#64867) 2025-10-21 13:46:49 +02:00
Kamil Mielnik
292a7c8058 Fix flaky test (#64863) 2025-10-21 11:12:32 +00:00
Dan Stone
83fdbaa65c Ensure field insertion order is consistent with :database-position (#62491)
Avoids FE ordering depending on hash iteration order on initial sync - in particular avoids
breakage in tests relying on id positionally if hashes change.
2025-10-21 09:07:58 +01:00
Mahatthana (Kelvin) Nomsawadi
0ab2b9f4f6 Fix flaky SDK tests (#64699)
* Remove double beforeEach setup probably from a mistake

* Fix the flaky test. I hope...

* Attempt to fix the test that failed the interception

* Revert change

* Fix the flake on Cypress CI
2025-10-21 04:50:17 +01:00
Timofey Kachalov
9d687287fe Fix build-e2e-matrix.unit.spec.js tests (#64851) 2025-10-20 23:51:27 +04:00
Phoomparin Mano
b5e93da266 fix(sdk-bundle, sdk-package): add missing focus color due to dark mode changes (#64641) 2025-10-21 02:15:15 +07:00
Nathan Voxland
78bf0474d6 Removed unneeded liquibase preconditions (#64694) 2025-10-20 11:11:33 -05:00
Nathan Voxland
b7bf8b6ecc Move the creation of the "card_view" tracking from the card APIs to query execution level (#64115) 2025-10-20 11:10:27 -05:00
Ngoc Khuat
65d95d9438 Polymorphic transforms (#64084) 2025-10-20 12:00:01 +00:00
Mahatthana (Kelvin) Nomsawadi
205bd075a9 Fix some events not shown on charts when grouping with different units (#64801)
* Fix some events not shown on charts when grouping with different units

* Take timezone into account

* Add tests

* Simplify return
2025-10-20 12:23:30 +01:00
Nemanja Glumac
0e8804a8cc Avoid setting up python transforms in every e2e test group (#64749) 2025-10-20 11:09:23 +00:00
Kamil Mielnik
6773707b3e Fix multiple flaky e2e tests (#64728)
* Unskip and unjail

* Modernize test

* Fix stubbing

* Remove tag

* Wait for sync to finish

* Fix flaky test

* Update test

* Unmark test as flaky

* Unmark tests as flaky

* Increase timeout

* Add const

* Fix flaky test

* Decrease flakiness

* Decrease flakiness

* Decrease flakiness

* Resync db

* Decrease flakiness

* Add a comment

* Fix flaky test

* Revert

* Out of jail

* Fix flake

* Decrease flakiness

* Try to decrease flakiness

* Revert "Try to decrease flakiness"

This reverts commit 38eadb47a3.

* Try to fix flakiness

* Fix

* Decrease flakiness

* Decrease flakiness

* Decrease flakiness

* Decrease flakiness

* Decrease flakiness

* Decrease flakiness

* Decrease flakiness

* Remove redundant blur

* Decrease flakiness

* Decrease flakiness

* Decrease flakiness

* Decrease flakiness

* Add comments
2025-10-20 16:57:52 +07:00
Uladzimir Havenchyk
3037854ee0 deps: upgrade rspack (#64800) 2025-10-20 09:53:15 +03:00
Sébastien
14b05dc189 Closes EMB-853 renamed legends get ignored by content translation (followup) (#64706)
* Closes EMB-853 for cartesian charts

* tests

* cleanup
2025-10-20 08:15:49 +02:00
Sébastien
20d149c48d Make switch to data button keyboard accessible/interactive (#64321)
* .

* fixed e2e

* toggle color
2025-10-20 08:14:58 +02:00
Nemanja Glumac
165c061afb Fix rspack alias type issue (#64770)
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-10-18 23:53:24 +02:00
Oleksandr Yakushev
2fce0a53a6 Bump Malli to 0.19.2 (#64593) 2025-10-18 19:03:04 +00:00
Nathan Voxland
fd2c44a380 Reduce reflection overhead in search (#64785) 2025-10-17 15:18:37 -05:00
Alexander Polyankin
b86eb24b0c Fix transform e2e tests (#64805) 2025-10-17 20:50:23 +03:00
Uladzimir Havenchyk
8eb405c96b speed up fe build by upgrading svgo (#64671) 2025-10-17 20:18:59 +03:00
Braden Shepherdson
dd5117bdb1 [QP] Fix convertTimezone exprs with no src TZ and SQL source (#64710)
Closes QUE-2613.

`convertTimezone` now checks the type of the field ref, since we might not know to make the compiled
column a timezone-backed column when the previous stage is a native query.
2025-10-17 12:39:44 -04:00
Romeo Van Snick
935fe5a0e5 CodeMirror editor small fixes and dark mode updates (#64791)
* Remove double border

* Remove overflowing corners on functionbrowser

* Fix HelpText header background in dark mode

* Remove dot in customexpression editor

* Fix dark mode completions in native editor

* Move color fixes to CodeMirror component

* Move CodeMirror cursor fix in darkmode to shared CodeMirror module

* Move completion styles to shared CodeMirror component

* Enable highlighting of partials in Python completions

* Remove more shared CM code

* Fix e2e test

* Fix timout in e2e test
2025-10-17 16:38:32 +02:00
Uladzimir Havenchyk
96750294f5 deps: upgrade packages we had duplicated in bundle (#64743)
* deps: upgrade packages we had duplicated in bundle

* update imports
2025-10-17 08:24:59 +00:00
Romeo Van Snick
19a811f282 Fix timeout in e2e test (#64796) 2025-10-17 07:22:00 +00:00
Oleksandr Yakushev
0be7ef31cf [perf] Introduce lean implementations of for and doseq (#64392) 2025-10-17 09:48:39 +03:00
Braden Shepherdson
7c76029e6b [perf] Use cached MetadataProvider on FE; reuse MP in /query_metadata (#64780)
This addresses most of QUE-2686 #64774 but a second PR is required to fix a
56-specific issue that doesn't apply to `master`.

The FE was not using the new
`lib.metadata.cached-provider/cached-metadata-provider` except where
it gets added by `lib/query`. Previously, the FE constructed the
*uncached* MP once (ish) and then passed it to `lib/query` many times.
Each of those queries got its MP wrapped with `cached-metadata-provider`
but the next time the query got converted via `lib/query` its cached
values (eg. `visible-columns`, `returned-columns`) were lost.

This PR wraps the `lib.js.metadata/metadata-provider*` with
`cached-metadata-provider` from the start, so the cached values have
the same lifespan as the `MetadataProvider`, rather than each individual
query.

I also noticed that `/query_metadata` requests don't use
`lib-be.metadata.jvm/with-metadata-provider-cache`, so they end up
recreating `MetadataProvider`s for the same underlying database over and
over. That increases AppDB traffic and CPU usage to recompute
`returned-columns` etc. repeatedly. Both of those scale fast with the
complexity of the query.
2025-10-17 05:34:59 +00:00
metamben
7ee5fffead Allow both db and dbname in Redshift connection details (#64748) 2025-10-17 05:08:59 +00:00
Romeo Van Snick
7491d37214 Do not reset collection selection after canceling action (#64766)
* Do not clear selection when canceling action

* Add repro for metabase#44911
2025-10-17 10:38:25 +11:00
Oleksandr Yakushev
fc98a81852 [malli] Use optimized postwalk when calculating schema-cache-key (#64655) 2025-10-17 01:19:36 +03:00
Oleksandr Yakushev
d76377e784 Fix two backend test flakes (#64782)
* Fix extract-nested-efficient-test flake

* Fix health-check-database-test flake
2025-10-17 00:23:49 +03:00
Oleksandr Yakushev
dddf6568c1 [util] Implement Seqable for rconcat to avoid crashing CIDER (#64656) 2025-10-16 23:12:59 +03:00
Alexander Polyankin
9fd8200087 Convert DataModel queries to MBQL lib (#64633) 2025-10-16 15:16:37 +00:00
Uladzimir Havenchyk
a9c06c5ece chore: speed up frontend build with upgrade of postcss plugin (#64670)
* speed up frontend build

* fix tests

* deduplicate

* add a comment

* deduplicate
2025-10-16 14:52:00 +00:00
Uladzimir Havenchyk
0a2aa0f087 deps: move html2canvas to a separate bundle (#64708) 2025-10-16 17:02:11 +03:00
Marcos
f42ea9842a Add Marcos and Rodrigo to slack map (#64773)
* add rodrigo and marcos to github slack map

* chore: add marcos and rodrigo to github-slack-map
2025-10-16 10:33:49 -03:00
Jeff Bruemmer
448ed2d9e0 fix script link (#64767) 2025-10-16 13:47:03 +02:00
Nicolò Pretto
0bcd797755 disable excessive spam in the prs caused by sdk build (#64733)
* disable excessive spam in the prs

* to-revert: change source code to trigger the build

* test2

* :shrugs:

* Revert "to-revert: change source code to trigger the build"

This reverts commit 37f6abb085.

* clean up and comment
2025-10-16 10:22:05 +02:00
Kamil Mielnik
1a645a55d6 Fix flaky embedding-reproductions test (#64702)
* Fix flaky test

* Increase timeout

* Decrease flakiness

* Fix flaky test

* Try with cypress-iframe

* Decrease flakiness

* Pass selector arg

* Move line

* Add a wait

* Fix test

* Add comment
2025-10-16 07:28:41 +00:00
Romeo Van Snick
d1cb9336da Cancel sql transform preview (#64726)
* Allow canceling SQL transform preview

* Add repro for metabase#64474
2025-10-16 13:14:30 +11:00
John Swanson
f569537850 Fix the fixup-viz-settings hack (#64746)
This fixup broke because QP started returning the db-shaped
viz-settings (e.g. `:table.columns`) instead of the normalized
viz-settings (e.g.
`:metabase.models.visualization-settings/table-columns `) under
`[:json_query :viz-settings]`.

The existing test for this fix did not catch the regression because the
shape of viz settings was faked out for testing, and did not get
transformed like real viz settings. `{:ver 2}` stayed as `{:ver 2}`,
while `{:table.columns []}` is transformed into
`{::visualization-settings/table-columns []}`
2025-10-15 22:07:16 +00:00
John Swanson
392a3ebc48 uxw-1935: mark settings as set by env var (#64569)
A few settings weren't wrapped with `SetByEnvVarWrapper`, so weren't
marked as un-modifiable.
2025-10-15 09:00:37 -07:00
Alexander Polyankin
9e401daa2e Ignore BE exception when checking dependencies (#64716) 2025-10-15 11:36:54 -04:00
Kamil Mielnik
f67961423a Fix flaky documents test (#64711)
* Use H.visitDocument

* Revert

* Decrease flakiness

* Fix chaining

* Revert

* Remove redundant within

* Fix
2025-10-15 17:06:03 +07:00
Kamil Mielnik
a4564a2e12 Unskip and update calendar test + fix date range picker text inputs not in sync with calendar inputs (#64603)
* Fix date range picker text inputs not in sync with calendar inputs (#64602)

* Unskip and update test

* Add repro for #64602

* Add unit tests

* Add issue tags

* Rename date to displayedDate
2025-10-15 05:49:47 +00:00
Alexander Polyankin
0cf0d86421 Deprecate fields in Question.create that are used to manipulate raw MBQL (#64715) 2025-10-15 02:20:50 +00:00
Alexander Polyankin
309e69774e Fix caching with drills (#64723) 2025-10-14 21:49:55 -04:00
Alexander Polyankin
5a880ebfb8 Use MBQL lib for table editing (#64722) 2025-10-14 20:50:33 -04:00
Nemanja Glumac
645543ff3e Remove deprecated radio form (#64679)
* Update the last instance of deprecated `FormRadioWidget`

This commit replaces a deprecated `FormRadioWidget` with the
`FormRadioGroup` component (which is a light wrapper around
the plain Radio.Group from Mantine).

* Remove the deprecated `FormRadio` component
2025-10-15 00:05:35 +02:00
Uladzimir Havenchyk
4b1ee493db chore: use standard colors for skeleton (#64588) 2025-10-14 19:36:38 +00:00
Alex Yarosh
db08e23530 docs: new place for alerts (#64688)
* Revise alert creation instructions in documentation

Updated instructions for creating alerts, including clearer steps and options for different alert types. Adjusted formatting for consistency and added details on editing and managing alerts.

* Enhance clarity in delete and restore documentation

Updated the documentation for deleting and restoring items to clarify the impact on related content and improve phrasing.

* Apply suggestions from code review

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-10-14 16:45:49 +00:00
Jeff Bruemmer
d5131a98f6 Update iframe resizer script source in documentation (#64718) 2025-10-14 15:46:28 +00:00
Brad Anderson
4f99d70ece UXW-88 Fixed issue where Show values for this series switch is hidden because of the default value for show_stack_values (#64691) 2025-10-14 11:24:04 -04:00
Nick Fitzpatrick
ed772da268 Dark mode Day 2 patches (#64549)
* lots of small fixes

* removing debug code

* adjusting e2e

* small adjustments

* whoops
2025-10-14 15:56:25 +02:00
Kamil Mielnik
1d88be2135 Refactor - Organize TablePicker (#64617)
* Move EmptyState, Search, and Tree to separate files

* Move hooks and constants out of utils

* Move components to a separate directory

* Fix import
2025-10-14 13:42:53 +00:00
Kamil Mielnik
d825953952 Fix flaky tests (#64700) 2025-10-14 17:31:52 +07:00
Kamil Mielnik
bf5799df15 UXW-311 [Sheets] Clicking notification should refresh the page (#64614)
* Fix UXW-311

* Add unit test

* Add tag
2025-10-14 09:23:23 +00:00
Kamil Mielnik
d5addc4c59 Fix flaky models/reproductions test (#64677)
* Fix flaky test

* Update e2e/test/scenarios/models/reproductions.cy.spec.ts

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>

* Update e2e/test/scenarios/models/reproductions.cy.spec.ts

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>

* Update e2e/test/scenarios/models/reproductions.cy.spec.ts

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-10-14 07:16:01 +00:00
Kamil Mielnik
fe858b408a Fix flaky onboarding/command-palette test (#64678)
* Fix flaky test

* Update comment
2025-10-14 13:30:27 +07:00
Kamil Mielnik
9c48cd347a Fix flaky test (#64681) 2025-10-14 13:30:19 +07:00
Kamil Mielnik
922845855d Fix command palette keyboard shorcut overflow on non-macs (#64606) 2025-10-13 19:54:43 +00:00
Nemanja Glumac
963be74964 Remove deprecated Lib.displayName (#64647) 2025-10-11 17:32:19 +02:00
William
062ba25fe8 add default noop implementation of native-query-deps (#64384)
We call native-query-deps on query save on mongo queries. This ensure that doesn't error, while still flagging if we don't implement native-query-deps for a driver that is supposed to support it.
2025-10-10 17:34:36 -05:00
Alex Yarosh
7d2275e326 docs: details view (#64645)
* details view

* Apply suggestions from code review

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-10-10 20:53:08 +00:00
dpsutton
db11feef9b use disk at query time of notification payload creation (#64390)
* use disk at query time of notification payload creation

We have some nice work to dump query results to disk if they are larger
than a row-count threshold. But this presupposes that results can fit
into memory. It's completely possible, and relatively easy, to do some
kind of "select *" operation in a dashboard where the only limit that
prevents billions of rows coming back is the excel limit we add in.

This tries to optimistically use the disk. If creates a new rff that has
two modes: in-memory and a gzipped dataoutput stream. The first is in
operation for the first 2,000 rows. If we never exceed this limit it
remains a regular reducing function. Once this threshold is exceeded, we
open a new file and stuff the rows in there and don't keep them in
memory any longer. This prevents us from having to hold the entire
result set in memory at once.

On the consumption side, we have a threshold such that if a file is
_larger_ than this, we won't attempt to load it and render it for static
viz. This is what lets us defensively decline to do an operation that
would reasonably lead to an OOM.

Optimizations for the future:
- give up on file creation once it exceeds the threshold size. We can
easily monitor the size of the file as we go and stop the transduction
or results.
- clear out files more frequently. This will probably litter lots of
temp files, some possibly quite large, on teh disk. We need to more
frequently clear them up. The directory is marked as deleteOnExit, but
we need to ensure we don't put lots of files in there during process
lifetime.
- better error rendering of "too large" error. Right now it hits the
default error rendering (previously it would oom). We can make this
better.
- explore how parallel we can get now. Presumably we are now quite
memory effecient. Can we go back to 3, or 10, worker threads?

* fix typo and reintroduce constant for row threshold

* more references to typo constant

* missed one somehow?

* include pulses (alerts) for autocommit off for downloads

we want to stream results. and now we do into a file so this can respect
the page size which only happens in pg when using autocommit false

* special error msg for too large results/dont attach large results

feedback that query results were too large

alerts also by default include results. let's check for the
render/too-large and not include them in that case. Was actually getting
a seq error on the deftype that holds the file. maybe want to give that
a seqable method?

* fix tests

we had an unrealized temp storage file going through

* unification all to streaming before moving to temp-storage

* move streaming to the temp-storage namespace

* don't deref results if no one wants attachments

* don't log the error here. it's pretty normal

* doc strings

* better logging and truncate results above threshold

once we are above the size that we won't read the file, we don't have to
keep piping results to it.

Concretely, what does this get us? If someone absentmindedly did
`select * from transactions` it could be 100s of GBs or more. Without
this, we would fill up the disk for the instance even though we don't
try to render it in the email. But once we know that there's no way we
will read the contents of the file, we really don't have to write to it
any longer.

* Make settings for size limit and whether to enforce

maybe someone has a beefy machine and they don't mind chugging through
843mb of query results to get a graph. they can easily set
`MB_ENFORCE_NOTIFICATION_TEMP_FILE_SIZE_LIMIT` to false and the old
behavior will be restored. If someone doesn't like the 10mb limit and
prefers a 50mb limit they can do
`MB_NOTIFICATION_TEMP_FILE_SIZE_MAX_BYTES=52428800` and then they will
have the higher limit

* Huge performance improvements

The real gist here is removing the gzip on the output. This was crushing
our performance. 18 seconds instead of ~4 seconds. Real bad. And it's
better to not gzip anyways. We really want to be tied pretty closely to
the size of the results. GZiping uses a ton of cpu and gets it very
compact. But we want a number that is pretty representative of the
results. Repeated values get gzipped down to almost nothing and then
they could still OOM the instance. But 50mb of results might get
squashed down to ~8mb of text. We want to be tethered close the size in
a csv or in memory.

Also changed the serialization to write chunks of rows and not a single
row. Its totally possible that the gzip fix did all of the work and
chunks or individual rows all get put together into the
bufferedoutputstream so it doesn't matter anyways. But the good thing is
that the format of this file is entirely the work of this namespace and
no one else gets to see it.

* Check for fidelity of regular results and disk based

timing wise: running the same card 356 (a join of people, products,
orders) and verify timing stays consistent (we are only 100ms longer
with disk)

```clojure
temp-storage=> (time
                 (-> (toucan2.core/select-one-fn :dataset_query :model/Card :id 356)
                     metabase.query-processor/process-query
                     :data :rows count))
"Elapsed time: 740.709583 msecs"
18760
temp-storage=>
(time (->
        (metabase.notification.payload.execute/execute-card 1 356)
        :result
        (select-keys [:notification/truncated?
                      :status :running_time
                      :data.rows-file-size
                      :data])
        (update :data (fn [d] (select-keys d [:rows])))))
"Elapsed time: 840.608 msecs"
{:status :completed,
 :running_time 724,
 :data.rows-file-size 8056845,
 :data {:rows #object[metabase.notification.payload.temp_storage.StreamingTempFileStorage
                      "0x3336077d"
                      {:status :pending, :val nil}]}}
```

Compare in memory results:

```clojure
temp-storage=> (let [card-id 356
                     regular-rows (-> (toucan2.core/select-one-fn :dataset_query :model/Card :id card-id)
                                      (metabase.query-processor/process-query)
                                      :data :rows)
                     disk-rows    (-> (metabase.notification.payload.execute/execute-card 1 356)
                                      :result :data :rows)
                     dereffed @disk-rows]
                 (doseq [[f results] [["/tmp/results.from-disk" dereffed]
                                      ["/tmp/results.from-qp" regular-rows]]]
                   (with-open [w (clojure.java.io/writer f)]
                     (doseq [row results]
                       (io/copy (str (pr-str row) \newline) w))))
                 [(= regular-rows dereffed) (= (count regular-rows) (count dereffed))])
[true true]
```

and then compare the files written above:

```shell
/tmp
❯ diff results.from-disk results.from-qp

/tmp
❯ echo $?
0
```

* weird postgres types

* postgres 12 didn't like gen_random_uuid so just hardcode one

everyone else promised they wouldn't use
7e3cd49d-bfe1-4620-83dd-0c163719175c for anything important

* formatting, lints

* alignment

* reformat, remove unused aliases

* remove errant comment

* cleanup logic and add some comments

unconditionally add to rowcount and in-memory collection of rows. For
two of three branches, this is "done": (1) collecting in memory, and (2)
streaming to disk but our "batch" isn't full. Only when the batch is a
multiple of 5,000 rows (number completely picked at random, balancing
this) we can then write the row block to disk.

Totally possible this can switch to just writing to disk on each row and
rely on the buffered writer to handle batching. But the use of the
in-memory collection being similar across almost all of the branches
makes this solution feel a bit cleaner for the moment.

also does things like inverting `if-not` so the short branch is at the
top and not hanging at the end where it's esay to miss.

* unify two file size settings

used to have some notion of `enforce` and `file-size-limits` Rather than
juggle both, you can just set the filesize to 0 to make it unbounded

* reuse human-readable-size in more places, fix some typos

* typos, fixes

* prometheus metrics

* followup to metrics

I’ve added a new metric
```clojure
   (prometheus/counter :metabase-notification/temp-storage
                       {:description "Number and type of temporary storage uses"
                        ;; memory, disk, above-threshold, truncated, not-limited
                        :labels [:storage]})
```

to record the different scenarios of query results:
- stayed in `memory`
- wrote them to `disk` but remained under the threshold
- wrote to disk and they went `above-threshold`
- wrote to disk and they went so far above threshold that we abandoned the query so the results were `truncated`
- wrote to disk but the limit was set to 0 so the results were `not-limited`

and these look like: (replaced # with ♯ so git message will include)

```
❯ http get :9191/metrics | grep temp
♯ HELP metabase_notification_temp_storage_total Number and type of temporary storage uses
♯ TYPE metabase_notification_temp_storage_total counter
metabase_notification_temp_storage_total{storage="memory",} 2.0
metabase_notification_temp_storage_total{storage="disk",} 2.0
metabase_notification_temp_storage_total{storage="truncated",} 2.0
```

* make predicates a bit more clojurey

* missed a refactor somehow

* better styling

thread the human readable size through

* styling changes

* bit of formatting

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-10-10 14:35:02 -05:00
Nicola Mometto
9abc92f46e fix: don't take from nil chan (#64589) 2025-10-10 19:20:36 +00:00
dpsutton
74e8f41ff0 turn off some more tests [ci skip] (#64640)
i’m turning off a few tests:

- "metabase-enterprise.transforms-python.transforms-api-test/python-transform-schema-change-integration-test" this
fails in redshift as seen here: https://github.com/metabase/metabase/actions/runs/18413981334/job/52473134679?pr=64390
cc @querying-be

- "metabase.warehouses.api-test/can-rescan-fieldvalues-for-a-db" as seen here:
https://github.com/metabase/metabase/actions/runs/18413981334/job/52473134684?pr=64390

- "metabase.warehouse-schema.api.table-test/update-table-sync-test" as seen here:
https://github.com/metabase/metabase/actions/runs/18413981334/job/52473134684?pr=64390 (same run)
2025-10-10 13:44:15 -05:00
Alex Yarosh
9a192e68de Revise embedding guide and emphasize user accounts (#64637)
Updated the embedding instructions and added a note on user accounts.
2025-10-10 18:31:10 +00:00
Alex Yarosh
5171f664bb doc: Add local currency label style (#64636)
* Add currency label style options to formatting.md

Added options for displaying currency labels in the formatting section.

* Clarify currency label style options

Updated the currency label style section to clarify options for displaying currency labels, including examples for Canadian dollars.

* Apply suggestions from code review

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-10-10 18:28:03 +00:00
Maz Ameli
763e923003 Follow-ons to dashboard chart improvements (#64308)
* subtler background lines on cartesian charts

* increase font size on cartesian charts and legends to 13px

* improve size and spacing of legends for pies and choropleths

* change legend color to text-primary

* change case and color of pie chart center subtext

* change small funnel text to 13px

* tweak the number of y-axis tick marks when set to auto for small charts

* Update Loki Snapshots

* Update Loki Snapshots

* update specs, polish

* specs

* specs

* cleanup

* Update Loki Snapshots

* subtler background lines on cartesian charts

* increase font size on cartesian charts and legends to 13px

* improve size and spacing of legends for pies and choropleths

* change legend color to text-primary

* change case and color of pie chart center subtext

* change small funnel text to 13px

* tweak the number of y-axis tick marks when set to auto for small charts

* Update Loki Snapshots

merge in updated loki tests

* update specs, polish

* specs

* specs

* cleanup

* Update Loki Snapshots

merge master's loki snapshots

* Update Loki Snapshots

* update be specs

* move border-subtle definition from colors.module to colors.ts

* table border color fixes

* fix overly thick dashboard heading border-bottom

* Cursor's attempt at fixing related tests

* Cursor again attempts to fix tests

* specs

* cleanup

* another attempt to fix specs

* Update Loki Snapshots

* fix cartesian chart and pivot table lines in dark mode

* Update Loki Snapshots

* attempt to fix chart test

* spec

* unrelated test fix but I need to merge this PR

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-10-10 11:13:29 -07:00
Alex Yarosh
02cd142074 docs: command palette update (#64634)
* command palette update

Updated keyboard shortcuts for opening the chat sidebar in Metabot documentation.

* Simplify custom action creation instructions

Removed instructions for creating a custom action from the command palette.

* Update appearance settings reference to 'Branding'

* Remove Metabot reference from exploration.md

Removed mention of asking Metabot in the exploration section.
2025-10-10 13:48:54 -04:00
Alex Yarosh
30e330a409 docs: ch transforms only for ch cloud (#64632)
Specify that ClickHouse transforms are only available on ClickHouse Cloud.
2025-10-10 13:29:21 -04:00
Alex Yarosh
43c6d9a938 docs: dark mode (#64534)
* dark mode

* Update docs/configuring-metabase/appearance.md

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>

* Update docs/people-and-groups/account-settings.md

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

---------

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-10-10 16:58:43 +00:00
github-automation-metabase
1c747783e1 Update generated docs (master) (#64597)
Co-authored-by: github-actions <github-actions@github.com>
2025-10-10 12:52:43 -04:00
Nicola Mometto
26e8fd90ed fix broken schema for python transforms (#64625) 2025-10-10 17:39:25 +01:00
Robert Kosara
7b47ae9236 Add boolean keywords to filters and expressions docs (#64592)
* Add 'boolean' to filters page

Added boolean expressions support to custom filter documentation.

* Add boolean keywords to expressions doc

Updated section on conditional operators to include comparison and boolean logic operators.

* Fix anchor so old links work

* Fix missing period

Co-authored-by: Alex Yarosh <alexandra@metabase.com>

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-10-10 16:36:48 +00:00
Nicolò Maria Mezzopera
d0cca704c6 Update GitHub team configuration (#64558)
* chore: update github team

* chore: remove team members from other teams
2025-10-10 16:23:42 +01:00
Uladzimir Havenchyk
dd2effb8f4 actual fix for infinite loop (#64612) 2025-10-10 14:53:28 +00:00
Edward Paget
0c93082c71 fix: ns for metadata provider cache (#64620) 2025-10-10 09:21:30 -05:00
Nicolò Pretto
49152f6a36 Make the e2e create a copy of the sample db, so it doesn't run into locking issues with core app (#64120)
* poc of allowing us to run the backend and the e2e at the same time

* use more scary name as suggested
2025-10-10 15:45:03 +02:00
Braden Shepherdson
21e9d33c66 [MBQL lib] Use :between filters for bucketed time fields (#64218)
When using the `underlying-records` drill ("See these Orders") on a bucketed temporal value, such as a data point in
a time series, use a `:between` filter with the endpoints of the bucket, rather than `:=`.

The queries work with `:=` (because the QP expands them to `:between`) but some parts of the filter UI
render it badly. With `:between`, the filter is rendered properly as a date range.
2025-10-10 13:37:42 +00:00
Braden Shepherdson
eb33b4991e [perf] Cache MetadataProviders for /dashboard/1/params/abc/values (#64541)
Fixes QUE-2651.

Use `lib-be.metadata.jvm/with-metadata-provider-cache` to avoid a pile of duplicate calls to
appdb while hydrating the dashboard.
2025-10-10 13:17:38 +00:00
Uladzimir Havenchyk
92a67eb3b7 skip tests broken after #63913 (#64611) 2025-10-10 07:59:32 -05:00
Jakub Chodorowicz
35f1f1903d Make Metabot logo gray when brand color customization is defined (#64566)
* Make Metabot logo gray when brand color customization is defined

* Add MetabotLogo stories and test them with Loki

Signed-off-by: Jakub Chodorowicz <jakub@chodorowicz.com>

---------

Signed-off-by: Jakub Chodorowicz <jakub@chodorowicz.com>
2025-10-10 14:37:51 +02:00
Timofey Kachalov
070963f9f9 Allow run-query overlay when query result has missing-required-parameter error (#64521) 2025-10-10 13:30:35 +04:00
Nicolò Pretto
3de66a09e8 tests(sdk): add tests for new mapQuestionClickActions behaviors (#64523) 2025-10-10 10:01:10 +02:00
Kamil Mielnik
6ab4cca8f2 DSN-79 In questions and metrics, Alerts shouldn't be within Sharing menu (#64510)
* Move QuestionAlertsMenuItem usage QuestionSharingMenu to QuestionMoreActionsMenu

* Fix divider logic

* Fix bogus skipToken usage

* Exclude models and some cases

* Add more permission checks

* Move QuestionAlertsMenuItem

* Fix permissions check

* Move unit tests

* Inline setup

* Move tests

* Fix modal situation

* Fix invalid export

* Rename dir

* Update onboarding

* Update tests

* Update tests

* Update tests

* Update tests

* Update tests

* Update tests

* Update tests

* Update tests

* Change order
2025-10-10 12:54:52 +07:00
Mahatthana (Kelvin) Nomsawadi
27d6352a93 Fix value between optional parameters without values not visible (#64550) 2025-10-10 04:56:37 +01:00
Fraser
b12bc41d58 Delete e2e Save modal test (#64350) 2025-10-10 15:48:35 +13:00
Fraser
14f4f37e34 Delete skipped relative time-view-rendering e2e test (#64499) 2025-10-10 15:48:10 +13:00
Fraser
accf8b0b06 Delete skipped filters repro e2e test (#64495) 2025-10-10 15:47:39 +13:00
Marcos
376daff947 fix transforms snippet sidebar add/edit button (#64575) 2025-10-09 18:00:00 -03:00
dpsutton
73d896e661 remove extra pg driver tests (#64581)
* remove extra pg driver tests

it is already covered in

```yaml
  be-tests-postgres:
    if: ${{ !inputs.skip }}
    runs-on: ubuntu-22.04
    timeout-minutes: 60
    strategy:
      fail-fast: false
      matrix:
        version:
          - name: Postgres 12.x
            junit-name: postgres-ee
            docker-image: postgres:12-alpine
            env:
              enable-ssl-tests: 'false'
          - name: Postgres Latest
            junit-name: postgres-latest-ee
            docker-image: postgres:latest
            env:
              enable-ssl-tests: 'true'
        job:
          - name: Driver Tests
            test-args: >-
              :only-tags [:mb/driver-tests]
            exclude-tag: ':mb/transforms-python-test'
```
.github/workflows/drivers.yml

* empty commit to run full drivers test suite
2025-10-09 15:01:11 -05:00
Uladzimir Havenchyk
4260236d61 chore: drop deprecated time handling utils (#64380)
* chore: drop deprecated time handling utils

* fix tz jest tests
2025-10-09 22:53:58 +03:00
lbrdnk
97df7676bd Catch errors in suggested prompts job (#64520)
* Catch connection error in suggested prompts job

* Rather catch any Exception
2025-10-09 21:51:11 +02:00
Cam Saul
1a73c0ac20 MBQL 5 over the wire (#63913)
* Misc Lib improvements

* Restore deleted function... for now

* N+1 hydration fix

* Update tests

* Test fix 🔧

* Mark more stuff in Legacy MBQL utils as deprecated

* Use Lib for query->source-card

* Update modules config

* Update tests 🔧

* Fix the X-Rays

* Test fix (Druid)

* Druid test fix 🔧

* Appease Kondo

* Normalize Card.dataset_query to MBQL 5

* Cleanup

* Some test fixes 🔧

* Fix tests in the parameters module

* Fix 2 more tests

* Fix most of the Dashboard tests

* All Dashboards tests passing

* Another pass: all tests in parameters module are passing again

* cljfmt

* Kondo

* Kondo

* Revert X-Ray changes

* X-Rays WIP

* Finally all X-Rays tests passing

* Kick CI

* People are writing new code doing legacy MBQL manipulation 😒

* I think everything is working now except for SerDes v1

* Test fixes 🔧

* Handful of test fixes 🔧

* Another test fix 🔧

* Kool fixes; delete SerDes v1

* I think I fixed all the failing tests

* Some Kondo fixes 🔧

* Maybe I fixed everything

* Ready to try CI again

* Restore accidentally-deleted namespace

* Fix almost all my complaints with #63248

* Commit lib-be.hash

* Test fixes

* Another test pass

* Kondo warnings

* Kondo (second pass)

* Fix stray parameter

* Test fix 🔧

* parameters.schema needs to be cljc

* Test fixes 🔧

* Test fixes 🔧

* Another round of test fixes 🔧

* cljfmt

* Kondo

* clj-kondo and cljfmt

* .clj => .cljc

* Fix cljs

* Test fixes 🔧

* Test fixes 🔧

* Add queryToJs() and jsToQuery()

* MySQL test fixes? 🔧

* Schema fix 🔧

* PR feedback

* Add DB migrations

* Support fetching legacy queries

* Init metadata provider cache automatically

* Fix migration

* Fix migrations (again)

* Oops check in missing file

* cljfmt, kondo, test fixes 🔧

* Fix build

* Fix MongoDB table-rows-sample

* Fix search for MySQL

* Appease FE linter

* Fix for internal queries

* MongoDB fix 🔧

* Update JS <=> Cljs query functions to take MP

* cljfmt

* Initial FE changes

* Initial FE changes

* Initial FE changes

* Initial FE changes

* Update FE helpers

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Hack

* Fix formatting; normalize before calling lib/query

* Fix for REAL

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix parameters substitution for JS parameter maps

* cljfmt

* Add note

* HACK

* Fix test

* Fix

* Another parameter normalization fix

* Remove X-Rays error

* X-Rays cleanup

* Additional validation for normalizing queries

* Fix

* Fix

* Fix metadata for empty Cards

* Fix

* Fix normalizing :lib/original-binning in :field refs

* Fix

* Correctly normalize MBQL 5 Metric definitions coming from JSON

* Fix

* fromJsQuery should throw on empty queries

* Fix test failure

* Fix

* Fix

* BE test fixes 🔧

* Fix

* Fix more backend tests; Kondo

* Fix

* Allow `=` in X-Rays REST API paths for now

* Fix

* Fix

* Fix

* Set card_id: null for actions

* Fix parameter mappings with card_id = -1

* Set card_id: null for actions

* Remove :lib/original-binning in underlying records drills

* Fix

* Fix

* Misc code cleanup

* Fix transform dependencies native validation

* Fix normalization of template tag :options

* Fix template tag schema

* Improved error message for FK details drill

* Minor tweaks

* Code cleanup

* Thank you Claude bot

* Fix Kondo from #64098

* Fix CLJS test

* Fix CLAUDE.md

* Fix

* Fix

* Don't stomp on valid database IDs with empty ones

* Fix

* Make lib.js/query= work on either JS or Cljs/MBQL 4 or 5

* Fix

* Fix

* Restore normalize

* Restore normalize

* Fix Cljs query caching

* Fix query hash

* Simplify fromJsQuery

* Restore test

* Fix cache

* Fix template tag ordering

* Fix cache issue FOR REALS

* Include batshit amount of nonsense in implicit actions viz settings fields

* Test fix 🔧

* Fix

* Fix

* Fix

* Fix with-template-tags not filtering out invalid tags

* Fix test failure

* Fix

* Fix

* Fix

* MySQL fix deadlocks in tests

* Restore throw code

* Oops

* Rollback connection changes and de-parallelize X-Ray tests

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-10-09 14:45:36 -04:00
Edward Paget
3cf2372445 fix: test log names need to be unique (#64577)
* fix: test log names need to be unique

* fixup! name of var
2025-10-09 18:39:20 +00:00
Braden Shepherdson
023de6e2d1 [QP] Don't remap FKs to their human-readable column if it's hidden (#64435)
Fixes QUE-2561

For example, in our Sample Database, `Orders.PRODUCT_ID` is remapped to
`Products.TITLE` by default. If you go to the **Table Metadata** in admin
and set `Products.TITLE` to "Do not include"
(which is `:visibility-type :sensitive` internally) it should not be
used for remapping.
2025-10-09 13:33:33 -04:00
Jakub Chodorowicz
cda1d6cd46 Uxw 231 auto scroll to selected entity picker item vertically (#64459)
* Add useEffectOnceIf hook

* Fix entity picker list not scrolling to chosen element

* Remove explicit dependencies

* Move useEffectOnceIf to VirtualizedList folder
2025-10-09 18:09:33 +02:00
Cam Saul
5e14ec7894 Skip Claude code review on draft PRs (#64574) 2025-10-09 16:02:48 +00:00
Cam Saul
46a869e3a4 Further restrict Claude PR review code action generated GH token perms (#64527) 2025-10-09 08:58:59 -07:00
metamben
9b0bfe3815 Fix base-type inference in pivot queries (#64472)
* Fix base-type inference in pivot queries

Fixes #64124
2025-10-09 17:30:00 +03:00
Kamil Mielnik
c291a439a5 Allow to opt out specific PR authors from claude-code-review GitHub workflow (#64554)
* Allow to opt out specific PR authors from claude-code-review GitHub workflow

* Exclude more users
2025-10-09 21:09:00 +07:00
dpsutton
5ce301dec0 bump netty common and buffer to 4.1.124.Final (#64537)
We had tried this previously, but the athena driver has these libraries
uberjar'd into it. So we need this to be in lockstep. See
https://github.com/metabase/metabase/pull/63894 for more info.

but i'll include some info here:
there are two copies on the classpath:

```clojure
user=> (enumeration-seq (.. (Thread/currentThread) getContextClassLoader (getResources "io/netty/buffer/ByteBufAllocator.class")))
(#object[java.net.URL 0x3bb34fe "jar:file:/private/tmp/fixed-athena/plugins/bigquery-cloud-sdk.metabase-driver.jar!/io/netty/buffer/ByteBufAllocator.class"]
 #object[java.net.URL 0x4ac1867d "jar:file:/private/tmp/fixed-athena/plugins/athena.metabase-driver.jar!/io/netty/buffer/ByteBufAllocator.class"])
```

one in the bigquery driver jar and one in the athena driver jar. The
bigquery driver jar has an explicit dep and we can control it
independently. The athena jar has it uberjar'd in and we can't control
it independently. So we want to make sure that we are relying on the
version that is (unfortunately) baked into athena.

For this we can see the athena 3.6.0 jar has the following
pom.properties file:
`META-INF/maven/io.netty/netty-buffer/pom.properties`

```properties
artifactId=netty-buffer
groupId=io.netty
version=4.1.124.Final
```

So we will pin that version in bigquery as well so we only have a
single version (but still two copies) on the classpath.

This way whichever classfile is resolved (and this can vary depending on
whether an athena db or bigquery db is synced first, or health checked)
it should behave the same
2025-10-09 08:04:06 -05:00
Phoomparin Mano
cc2991b4b3 Use non-whitelabeled blue color for Metabase logo (#64524) 2025-10-09 19:45:36 +07:00
Marcos
b9f1682706 Fix long snippet names overflow (#64469)
* fix long snippet names overflow

* add percent width so it uses most space both in SQL models and SQL editor

* fix sidebar width in transforms page

* for SnippetRow, use flex instead of width percentages, fix collection row

* fix snippetrow background so it expands snippet instead of inserting it into the editor
2025-10-09 09:35:16 -03:00
github-automation-metabase
e33d81c3e9 Update generated docs (master) (#64546)
Co-authored-by: github-actions <github-actions@github.com>
2025-10-09 08:25:12 -04:00
Kamil Mielnik
26edf3c9dd Hide shallow copy checkbox instead of disabling it (#64559) 2025-10-09 12:05:37 +00:00
Oleksandr Solovyov
af0b621eeb [serdes] do not say "Loading ..." if entity is not being loaded (#64461)
When investigating a separate issue I've noticed that we're logging "Loading ..." even for entities that are not actually being loaded. That's because we were printing this line when something is a dependency - even if it exists in the database and is not provided in the export.

This changes the approach somewhat, we will still have some indication we need some entity, but only at DEBUG level, and instead the "Loading ..." will appear only if we're genuinely about to read something from an export and put it in the database.

Not only it's easier to understand what's going on, it's going to be way less noisy.
2025-10-09 14:22:14 +03:00
Uladzimir Havenchyk
7c1f6a0e5f Command palette and search modal revamp (#64364)
* WRK-903 Update command palette modal (#64039)

* Remove metabot from command palette

* Remove footer

* Style search input

* Icon color

* Remove actions section when there is no search query

* Rename 'recent items' to 'recents'

* Show 10 recents by default

* Style item

* Update copy (Search results -> Results)

* Use project react import convention

* Move link to search results to group header

* Close palette on results link click

* Fix types

* Use disabled prop in useCommandPalette

* Update item bg

* Align search icon

* Update color whem is active

* Update table icon

* Fix wrong item being selected

* Use stack

* Fix icons shrinking

* Hide subtext on overflow

* Update unit tests

* Fix types

* Clean up

* Hide actions in a different way

* Update helper

* Remove redundant changes

* Update unit tests

* Update unit tests

* Update helper

* Update test

* Update test

* Update tests

* Update test

* Update test

* Update tests

* Add a border to search input

* Update test

* Simplify text overflow handling

* Avoid parent().parent()

* ESLint

* Improve assertion

* Improve assertion

* Remove borders between result groups in command palette

* update styles of the app bar (#64105)

* update styles of the app bar

* rework profilelink to ts

* fix some tests

* fix another e2e test

* update search style

* fix shortcuts conflict

* unify search buttons between oss and enterprise

* don't translate metakey

* fix colors

* let's have two keydown handlers

* fix test

* fix typecheck

* address review comments

* fix showplow event in test

* show metabot icon on small screens

* fix test

* do not show metabot button within iframe

* attempt to fix flaky test

* lint

* address review comments

* address review comments

* add a unit test

* update colors

* address comments

* update skeleton

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-10-09 12:34:46 +03:00
Phoomparin Mano
913bb086c3 Password reset should show confirmation toast (#64522) 2025-10-09 15:32:10 +07:00
Nicolò Pretto
5c3726248f feat(sdk)!: allow mapQuestionClickActions to run actions on click and clean the data we pass (#64425)
* support returning one action with "onClick" to call it immediately

* feat(sdk): add question to the clicked object, part of EMB-796

* feat(sdk): clean up the data we pass as `clicked`, part of EMB-796

makes export types checker happy

remove source

* add stories

* only require `onClick` for the "immediate" actions

* address feedback: fix type of onClick and add warning in case of wrong
shape
2025-10-09 10:28:06 +02:00
Timofey Kachalov
9c2513eb29 Set min width for DashCardActionsPanelContainer to fit content (#64525) 2025-10-09 11:42:17 +04:00
Cam Saul
c2515e7921 Remove rules about number of semicolons, Claude cannot understand them. (#64547)
* Remove rules about number of semicolons, Claude cannot understand them.

* Restore the docstring indentation rule
2025-10-09 05:59:47 +00:00
Cam Saul
0ee3c2ffae Make claude code review bot delete old comments (#64544) 2025-10-08 23:40:29 -06:00
Alex Yarosh
c0a07d369c docs: emphasize revoking SQL access for some permissions (#64539)
* docs: emphasize revoked SQL access for some permissions

Clarified permissions regarding native queries in Metabase.

* Update docs/permissions/data.md

* Update docs/permissions/data.md

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>

---------

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
2025-10-08 17:19:53 -04:00
Edward Paget
5eed781367 allow cc review to be skipped (#64538)
* allow cc review to be skipped

* Update .github/workflows/claude-code-review.yaml

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>

* trying to retrigger when labels change

---------

Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
2025-10-08 16:15:45 -05:00
Uladzimir Havenchyk
bbd050dd95 chore: replace moment with dayjs in time series (#64451)
* chore: replace moment with dayjs in time series

* create a util file

* add a note

* add tests

* update naming
2025-10-08 21:03:24 +00:00
Nick Fitzpatrick
00d21cf20d Fixup of Erroring Questions page (#64119)
* Fixing rerun selected functionality

* Commenting Props
2025-10-08 16:49:14 -04:00
Ryan Laurie
d4eee39154 Misc Dark Mode Fixes 1 (#64484)
* alert colors

* undo text color

* better modal contrast

* Update Saturated Yellow color, Update collection authority form picker

* tooltip secondary color

* Emoji picker transparancy

* make-yellow-not-💩

* fix types

* Update Loki Snapshots

* add border to ye olde model

* cleaning up after nick again

* Alert color and type adjustments

* dashboard autoconnect toast styling

* entity-picker e2e

* Update Loki Snapshots

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-10-08 16:07:50 -04:00
Alex Yarosh
371b2c2081 docs: python transforms (#64518)
* python transforms

* link

* Apply suggestions from code review

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

* feedback

* more feedback

* Apply suggestions from code review

* links

* Apply suggestions from code review

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-10-08 18:59:43 +00:00
Alex Yarosh
a48352c7c6 Update date format examples in formatting.md (#64530) 2025-10-08 14:38:41 -04:00
Cam Saul
dcef144251 Claude code review (experimental) (#64487)
* Claude code review (experimental)

* Run my job PLEASE!

* Fix syntax

* More guidelines

* Minor change to see if we can get some useful feedback

* Seriously run my damn workflow

* Add GH token

* Remove paths

* Appease Claude

* Tell Claude how to get the Clojure Style Guide

* Attempt Clojure style guide again

* Give Claude ReadFile perms for the style guide

* Move info about community style guide to CLAUDE.md

* Try again

* Another pass

* Seriously please follow Community style guidelines

* More advice.

* LEARN ABOUT TEST NAMING CLAUDE!!!!

* More advice

* Appease Kondo

* I have a lot to say I guess

* Iterate on CLAUDE.md

* Clarify module linter cheating rule

* CLAUDE u iz dumb

* Chaos

* Dumb as a rocc

* EVEN. MORE. GUIDELINES.

* Clarify semicolon rules more

* Threaten our AI overlords

* Are you dense?

* Annoyed

* BE SUPER DUPER EXPLICIT

* Fun time

* fun

* More dumb comment examples

* Clarify defmethod rules

* SERIOUSLY!!!

* I don't think Claude can count

* More examples of what to avoid

* U not listening

* Clarify

* Use emojys

* Parens

* Be. Even. More. Explicit. About. Semicolons.

* Be SUPER EXPLICIT

* Clarify

* Discourage `qp.store/with-metadata-provider`
2025-10-08 16:32:41 +00:00
Phoomparin Mano
2333182a53 fix(sdk-bundle): missing hover text color in summarization/grouping menus (#64515) 2025-10-08 21:50:05 +07:00
lbrdnk
c12d988306 Revert "Ajust e2e runner options (#64377)" (#64516)
This reverts commit 2375d46cbb.
2025-10-08 14:49:18 +00:00
github-automation-metabase
d19bc1dde6 Update generated docs (master) (#64498)
Co-authored-by: github-actions <github-actions@github.com>
2025-10-08 09:42:16 -04:00
Noah Moss
463ab32c31 Fix Firefox bug where models are not clickable until after selecting & unselecting text (#64491) 2025-10-08 09:29:47 -04:00
Timofey Kachalov
c6f8933e3e Extract SDK bundle error handling tests into a separate test suite (#64502) 2025-10-08 17:22:15 +04:00
Stas Gavrylov
f15ed1a734 WRK-907: [Bug][Data Editing] Do not offer to 'Add option' in FK fields (#64304)
* WRK-907: Remove 'create new' option from table action input for FK parameters

* Address PR comments

* Address PR comments

* Update e2e/test/scenarios/table-editing/table-editing.cy.spec.ts

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>

* Apply suggestions from code review

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-10-08 14:06:48 +02:00
Oleksandr Solovyov
54b3ad3455 [search] make verified dashboards appear when filtering for "verified" (#64462) 2025-10-08 11:56:24 +00:00
Nicola Mometto
6da9f0a911 use qp directly rather than reaching for internals for python transforms (#64452)
* refactor: use qp directly rather than reaching for internals

* fix sleep test

* kondo

* fix: copy chan, else QP closes it
2025-10-08 12:49:54 +01:00
Nicolò Pretto
82aba4c51d rename tests folder to stories (#64455) 2025-10-08 10:31:38 +00:00
Kamil Mielnik
2dfdc3683b DSN-69 Smart Scalar charts in dashboards shouldn't overflow their card (#64285)
* Move SmartScalar subcomponents to separate files

* Update getValueHeight to support multiple comparisons

* Fix dashcard header height

* Fix overflow with cheap tactics

* Hide all but 1 comparisons if they don't fit

* Fix line height

* Move PreviousValueComparison to its own directory

* Extract DetailCandidate

* Extract VariationPercent

* Extract DetailCandidate

* Remove inTooltip prop in VariationPercent

* Add hidden comparisons to the tooltip

* Update constant

* Add ellipsis badge

* Do not use " • " as text separator

* Make tooltip text white

* Wrap text in the tooltip

* Fix text alignment

* Revert static viz change

* Add e2e test

* Update tests

* Update Loki Snapshots

* Remove separator in static viz

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-10-08 17:27:38 +07:00
Nicolò Pretto
be441ae625 refactor(sdk): move trasnformSdkQuestion (#64458) 2025-10-08 11:58:27 +02:00
Romeo Van Snick
70d8fda6fa Humanize error messages (#63235)
* Allow passing error/friendly in malli schema's to declare them to be be safe for users to see

* Add a user-friendly error message when aggregations don't contain aggregations

* Allow :error/message to be a thunk

* Add repro for metabase#61893

* Use deferred-tru for error message

* Remove deferred-tru
2025-10-08 20:18:15 +11:00
Phoomparin Mano
eae65a4980 fix(sdk-bundle): fallback and warn on invalid layout in MetabotQuestion (#64478) 2025-10-08 16:16:59 +07:00
Dan Stone
11856c2aea Transform cancellation test & fixes (#63833)
* Fix regression with :async? requests

- callbacks were not passed and clj-http would throw

* Fix data correctness issue if cancelled during table read

Fixes an issue where cancellation during the read stage
could cause the python run to receive (and output) truncated/empty incorrect data and write back / succeed anyway.

* Add cancellation test

* Give script a bit more time for CI

* Disable cancellation test for problematic drivers

* Also disable redshift

* Also disable mongo

* Fix regression due to merge conflict
2025-10-08 08:55:41 +00:00
Dan Stone
3f8edd52ce Add column names / ordering to test-run output (#64448) 2025-10-08 08:53:10 +00:00
Timofey Kachalov
e4cd459865 refactor(sdk, embed-js): Additional code preparations for Anonymous Embedding (#64457) 2025-10-08 12:44:16 +04:00
Oleksandr Solovyov
7ff2822811 disable comments in an iframe (#64098)
* disable comments in an iframe

* Remove comments from UI for embedded scenario

* Make isWithinIframe check external for CommentsMenu

* Add e2e test to check that comments are not available in embedded app

* Update Loki Snapshots

---------

Co-authored-by: stasgavrylov <stasgavrylov@gmail.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-10-08 10:28:01 +02:00
Oleksandr Solovyov
4e7e3f10bc pivot download: use source alias name for matching columns (#64192) 2025-10-08 11:21:23 +03:00
Fraser
46c6bcd677 Error a test that accesses unmocked routes (#64311) 2025-10-08 16:19:43 +13:00
Oleksandr Solovyov
42d5d4f442 make db removal somewhat more efficient (#64366) 2025-10-08 05:53:06 +03:00
Romeo Van Snick
9683555c34 Fix disappearing drill icon (#64228)
* Add missing class to ClickActionIcon

* Remove superflous transition

* Move ClickActionsTextIcon to css

* Move ClickActionControl to css modules and metabase/ui

* Tweak css to match prevouis button height
2025-10-08 10:07:52 +11:00
Aleksandr Lesnenko
734dabb163 propagate original card title and description to visualizer cards (#64340)
* propagate original card title and description to visualizer cards

* specs

* fix broken clicking
2025-10-07 22:34:50 +00:00
Jeff Bruemmer
1e5fba41ed remove docs workflows (#64486) 2025-10-07 20:58:12 +00:00
Jeff Bruemmer
7e9bc67b16 Clarify usage of triple braces in config.yml (#64481) 2025-10-07 19:59:29 +00:00
Phoomparin Mano
a822e1dd94 Temporarily remove tooltip loki tests for embedded questions to unblock ci (#64467) 2025-10-08 02:06:44 +07:00
Phoomparin Mano
9eb0ae7700 feat(embed-js): add the Metabot experience to embed wizard (#64388) 2025-10-08 01:07:30 +07:00
Noah Moss
8a4a4273a7 fix local test failure by sorting related_table ids in metabot tool response (#64464) 2025-10-07 15:41:55 +00:00
lbrdnk
2375d46cbb Ajust e2e runner options (#64377) 2025-10-07 16:53:18 +02:00
Noah Moss
4215b09ac7 Split fields returned to metabot for cards/models into core fields and related_tables (#64385)
* Split fields returned for cards/models into core fields and related_tables

* Update tests, and fix implementation to always include :related_tables

* typo

* fix kondo

* add separate with_related_tables flag to get-table-details API

* add test for new flag

* fix malli recursive schema

* add back query-needed?

* support related-tables when fetching table details as well, not just models

* add get-table-details-related-tables-test

* don't overwrite tyler's 404 fix
2025-10-07 13:59:40 +00:00
github-automation-metabase
be91884957 Update generated docs (master) (#64440)
Co-authored-by: github-actions <github-actions@github.com>
2025-10-07 09:44:57 -04:00
Mahatthana (Kelvin) Nomsawadi
dae7df1c71 Fix long embedding test time (#64449)
* Fix long embedding test time

* Fix failed tests
2025-10-07 19:13:14 +07:00
Kamil Mielnik
8f037b0036 Add "Local symbol" option in "Currency label style" visualization setting (#64360)
* Extract lazy-evaluation of currencyMapCache to an iife

* Add getCurrencySymbolNative

* Add narrow symbol support

* Update unit tests

* Add test

* Add e2e test

* Fix issue with current value not being shown
2025-10-07 18:23:37 +07:00
Duarte Laia
0e247c2772 Fix #54317: Object detail navigation state doesn't reset (#55238)
* Fix #54317: Object detail navigation state doesn't reset
Added a verification that caps the selected object index.

* Fix #54317: Changed useState and reseted index.
Now using useEffect and reseting to the first index.

* Fix #54317: Added an e2e test

* Adjust test to new filters

---------

Co-authored-by: Sébastien <sebastien@metabase.com>
Co-authored-by: Jakub Chodorowicz <jakub.chodorowicz@metabase.com>
Co-authored-by: Jakub Chodorowicz <jakub@chodorowicz.com>
2025-10-07 12:00:54 +01:00
Fraser
d14019cd02 Delete skipped e2e download test that has BE tests (#64442) 2025-10-07 22:48:07 +13:00
Uladzimir Havenchyk
a5d6067de1 chore: migrate renderer_utils from moment to dayjs (#64413) 2025-10-07 12:40:11 +03:00
Timofey Kachalov
8f9a72345b Minor refactoring of services.js (#64408) 2025-10-07 13:18:01 +04:00
Fraser
f14ae0297b Unskip working pivot-tables test (#64349) 2025-10-07 13:35:59 +13:00
Vamsi Peri
952aeefd58 Dark mode (#64016)
* js source of truth for colors

* use more betterer colors

* keyboard shortcut for toggling dark mode

* Adds colorConfig for defining a light and dark color for each color variable

* Copies over dark colors from `dark-mode` branch (excluding variables that don't exist in colorConfig`

* Ports other style changes from `dark-mode` branch

* Revert 3301ed93693

* Ports mantine theme logic from `dark-mode` but uses SSOT colorConfig instead of SEMANTIC_COLOR_SCHEMES

* Fix TS errors

* Fix text color and random white bg on permissions table

* Removing a bunch of usages of JS color... probably breaking things

* Updates mantine color scheme when resolvedColorScheme changes

* a bunch more

* fix progress bars. shame on Nick

* Stubs out forcing light mantine theme when isEmbedding (since it has its own dark mode)

* Fix hard-to-read dark mode straggler caused by one-off bg color

* add orionAlphaInverse colors

* make lighthouse illustration work with CSS vars

* Fixes hover states of query builder header buttons in dark mode

* Updates PivotTables in dark mode to behave similarly to night mode

* Fix upsell CTA hover color in dark mode

* Tweaks admin nav dark mode color

* some small fixes

* Fixes some incorrect brand color values when white-labeling

* Tweaks admin nav bar colors and uses same colors on dark mode as light mode (if it ain't broke...)

* Fix gauge visualization text/input colors in dark mode

* Makes things legible and more consistent in query builder in dark mode

* Fixes a few filter chip stragglers in dark mode

* metabot visits the dark side

* Use ColorSchemeToggle for dashboard night mode button

* Prevents dashboard from using night mode when theme=night is set in the hash

* Update color.ts

* Revert "Prevents dashboard from using night mode when theme=night is set in the hash"

This reverts commit 06a504c088e31c60aca7c7550aa24a0f32edba6c.

* set color scheme for scrollbars

* hard to see toggle in database info

* Embedding and other fixed

* fix blue brand

* Uses canonical dark mode for dashboard night mode and static embedding's dark mode

* Fixes issue where Static Embedding preview pane doesn't show checkerboard background when "Dashboard background" is turned off

* Updates find-never-defined-css-variables.ts so it looks for defined variables in colors.ts. Removes references to now-removed base colors.

* Fixes some TS errors

* happy-ish static viz

* only resolve to color var if name is known

* type corrections, removing auto color scheme

* Passes storybook theme arg to ThemeProvider

* add konami code shortcut for Vamsi

* Fix dashboard context TS errors

* Fix runtime warning

* Prevents whitelabel colors from being used in colors.ts when token lacks whitelabel feature. Updates `filter` and `summarize` colors to use whitelabel value if present.

* re-enable updateColors

* happy types

* Updates storybook renderer to work with stories that set the theme via theme: "dark"

* Fix issue where DatesRangeSdk story doesn't pick up brand color

* green unit tests?

* Reverts unnecessary change carried over from original `dark-mode` POC which changed some loki/storybook backgrounds

* Fix issue where theme switching themes in Question embed previews doesn't appear to do anything

* handfull of e2e suites

* Revives some `theme` infrastructure needed to support `theme=transparent`

* Restores SdkError colors on dark mode (#64306)

* happy unit and e2e tests?

* Fix lint errors

* feat(sdk-bundle): use existing tooltip configuration for dark mode (#64325)

* fix card shadow crash

* backdrop color fix

* Refines ColorSchemeToggle. Color scheme is "auto" by default. When "auto", color scheme is automatically updated when browser/device settings is changed. Switching to the theme that's defined as the browser/device preference will set the color scheme to "auto".

* Adds clarifying "(system preference)" to color scheme toggle tooltip

* embedding e2e, unit tests

* Fix TS error

* update colorConfig for sdkThemeProvider

* force e2e to run in light mode

* Fix embedding-sdk:docs:generate error

* Updates ThemeProvider to ignore  from hash if we're outside of static embeds. This prevents old night mode dashboard urls from messing with the new dark mode.

* Fix issue where dark mode shortcut isn't pulling in the latest values (not toggling right)

* Replace hardcoded value with already-defined constant

* fix quotes in css

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* use firefox compatible scale

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* fix css quotes

* fix color scheme toggle

* fix test

* fix conflict

* update test

* PR Feedback

* fix embedding homepage flicker

* e2e adjustment

* adding text-hover, fixing checkbox border

* setup.cy green plz

* e2e test for toggling color scheme

* e2e plz

* type check

* e2e adjustment

* Update Loki Snapshots

* test colors in RGB

* OS check for shortcut

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
Co-authored-by: AlessioLaiso <7041012+AlessioLaiso@users.noreply.github.com>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-10-06 20:23:21 -04:00
Nemanja Glumac
3dffc9d900 Parameterize cloud-add-on API (#64424)
Instead of hard-coding a "metabase-ai" as the only add-on,
we're now parametrizing this endpoint to accept different
product types, which translates into buying different add-ons.
2025-10-07 00:06:11 +02:00
Fraser
09d2689976 Fix merge e2e timings step (#64405) 2025-10-07 10:48:44 +13:00
dpsutton
f6162a0cce Alternative fix for internal queries (#64376)
* Alternative fix for internal queries

reenable the admin screen for http://localhost:3000/admin/tools/errors

I know we aren't supposed to look at any piece of a query, including
type here, but there are a few reasons i'm doing so.

1. i don't know of any predicates in mbql lib for this
metabase.lib.core doesn't have a `native?` predicate, nor an `mbql?`
predicate. It does seem have predicates about stages but that doesn't
seem applicable here
2. even if it _did_, the internal query is not recognized by lib, so we
then have to teach it internal queries which means the other PR (#64375)
has to be implemented either way, defeating the purpose of this very
simple PR.

```clojure
user=> (metabase.lib.core/any-native-stage? {:limit 1,
                                             :type :internal,
                                             :fn "metabase-enterprise.audit-app.pages.queries/bad-table",
                                             :args [nil nil nil "last_run_at" "desc"],
                                             :offset 0,
                                             :parameters []})
Execution error (ExceptionInfo) at metabase.lib.walk.util/fn$fn (util.cljc:72).
Invalid input: {:lib/type ["missing required key, got: nil"], :stages ["missing required key, got: nil"]}
```

Why aren't there tests?
🤠
Want to contrast the two approaches first. Happy to backfill tests once
the approach is agreeable. This approach here is _very_ simple and lets
the working qp approach continue working without disturbing
metabase.lib. This seems pretty nice because ultimately these internal
queries should/will be replaced. But in the meantime, do we want to
teach lib about them, or just skirt it altogether?

* test that api works for these queries

* enable feature in test
2025-10-06 16:22:02 -05:00
John Swanson
b9b78a2f60 Show audit links for non-admins with perms (#64201)
If a user isn't an admin but has permission to view the Usage Analytics
collection they should see links in the card sidebar.
2025-10-06 13:39:41 -07:00
Timofey Kachalov
1a28ee25c3 refactor(embed-js): Refactor EmbedJS wizard to prepare it for No-user embedding (#64411) 2025-10-06 23:50:20 +04:00
Edward Paget
54919da812 Remove parallel annotation from tests (#64386) 2025-10-06 18:43:43 +00:00
Alex Yarosh
11fec69c5e docs: price change (#64426) 2025-10-06 14:17:23 -04:00
Dan Stone
d12930529f Add /ee/python-transforms/test-run to preview a run (#64362)
The python code is executed by the runner but its output is not saved back. The endpoint blocks
until the output is received.

Any objects in S3 should be deleted before the request returns (or will otherwise be collected via retention)

Limits:
- Run timeout is set to 60 seconds
- Samples up to 100 rows from each input table.
- Outputs up to 100 rows from the python output.
2025-10-06 17:25:10 +01:00
Nicolò Pretto
249e0a0d87 fix(modular): enable external click behavior; fallback to drills for internal click behaviors (#64320)
* fix(modular): enable external click behavior; fallback to drills for
internal click behaviors

* remove cy.pause
2025-10-06 17:48:16 +02:00
lbrdnk
ba8843298e Avoid use of analytics content for suggested prompts (#64370)
* Avoid use of analytics content for suggested prompts

* Docstring
2025-10-06 17:41:49 +02:00
Braden Shepherdson
33db17c7ed [QP] Push required implicitly joined fields down through stages (#64305)
Fixes #63245.

Add `:reversed? true` option to `lib.walk/walk-stages` that reverses the order.

Then use that option for `qp.middleware.add-implicit-joins/second-pass`, since that `second-pass`
is about making sure if stage N needs an implicitly joined column from the previous stage, that the
previous stage actually returns it. #63245 happens when the join clause and usage are 2+ stages apart.
Flipping the iteration order will push the need for the implicitly joined column through as many stages
as necessary.
2025-10-06 10:56:39 -04:00
Marcos
471b6f57e5 Fix wrong timezone in "exclude hours" filters (#64290)
* use local datetime instead of zoned  datetime when creating exclusion filters from parameters

* use local datetime instead of zoned datetime when creating exclusion filters from parameters
2025-10-06 11:10:59 -03:00
Denis Berezin
f7183cf1ca Fix card duplication on move to before flexcontainer (#64205) 2025-10-06 17:30:09 +04:00
github-automation-metabase
8666f82edb Bump io.github.metabase/hawk from 1.0.12 to 1.0.13 (#64395)
Inspect dependency changes here:
2025-10-06 13:29:07 +00:00
Phoomparin Mano
400b10f74c feat(sdk-bundle, embed-js): add metabase-metabot custom element for Embed JS (#64144) 2025-10-06 19:03:01 +07:00
Dan Stone
0d7e892036 Remove high cardinality run-id labels (#64358)
Poor prometheus
2025-10-06 12:49:05 +02:00
Timofey Kachalov
573b3c61a2 refactor(sdk-bundle): Adjust StaticQuestion and SqlParametersList visuals (#64313) 2025-10-06 14:16:35 +04:00
Nemanja Glumac
0af38ef8f0 Delete unused string util from metabase lib (#64389) 2025-10-06 09:38:55 +02:00
Mahatthana (Kelvin) Nomsawadi
7fcd8b3ef7 fix(sdk): Fix SDK TSC errors (#64328)
* Configure ESLint to prevent test files going into SDK build

* Fix SDK build to not include test files

* Fix the config to allow __support__/metadata

* Revert a file I thought was a test file

* Make rules consistent

* Clean up tsconfig pattern

* Make the error message less repeatable
2025-10-06 03:30:12 +01:00
Phoomparin Mano
38260ca608 Remove unused EmbeddingSetup components and hooks (#63841) 2025-10-04 07:05:14 +07:00
Edward Paget
e75dd496b8 fix: add test for join behavior for 64317 fix (#64335) 2025-10-03 15:34:01 -05:00
Edward Paget
c2bea1ca8a feat: card deep links in pulses (#61794)
* feat: card deep links in pulses

* fixup! new fn signature for render-notifications
2025-10-03 15:31:27 -05:00
Nemanja Glumac
52e3cf2142 Replace and remove the deprecated space utility (#64378) 2025-10-03 21:32:37 +02:00
Uladzimir Havenchyk
5b0164a622 chore: replace moment-timezone with dayjs for main app (#63334) 2025-10-03 18:01:51 +00:00
lbrdnk
cebbfb235f Fix localization number separators (#64300)
* Fix incorrect separator on FE and add guard to setting

* Reproduction

* when-some

* Add FE test

* naming

* Update frontend/src/metabase/admin/settings/components/widgets/FormattingWidget.unit.spec.tsx

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-10-03 19:25:52 +02:00
Roman Abdulmanov
f69789d465 removed triage notifications (#64369) 2025-10-03 16:18:23 +00:00
lbrdnk
e2334d688a Enable copying of iframe cards (#64232)
* Enable copying of iframe cards

* Use display to decide iframe type

* Add iframe card test
2025-10-03 17:25:05 +02:00
Stas Gavrylov
b71caeacdf WRK 905 Allow commenting on unsaved documents (#64237)
* WRK-905: Allow commenting on an unsaved document

* Fix e2e tests

* Remove 'disabled' prop from CommentsMenu. Remove force click in comments test

* Allow editing document when comments sidebar is opened

* Fix linting

* Fix e2e tests

* Address PR comments. Allow charts editing when comments sidebar is open
2025-10-03 16:32:20 +02:00
Jakub Chodorowicz
0fee338d56 Fix: cannot interact with DashCard actions panel while in edit mode on mobile devices (#64356) 2025-10-03 16:07:16 +02:00
github-automation-metabase
1216cee2ae Update generated docs (master) (#64348)
Co-authored-by: github-actions <github-actions@github.com>
2025-10-03 08:31:04 -04:00
Sébastien
9f1fb57177 Closes EMB-411 no more transparent cell background by default (#64288)
* Closes EMB-411 no more transparent cell background by default

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-10-03 11:44:04 +02:00
Sébastien
1c18e1023a Closes EMB-854 actually escape the single quote (#64323) 2025-10-03 11:43:37 +02:00
Phoomparin Mano
8cb9ca883d Change embed flow tracking to track step completions for funnel analysis (#63973) 2025-10-03 12:55:01 +07:00
Phoomparin Mano
384d0b5d3b Update alignment and copy for embedding hub (#64279) 2025-10-03 12:06:24 +07:00
Tyler Plude
1561702bdb Return error string in response when model ID is a question instead of 404 (#64342) 2025-10-02 17:25:51 -07:00
Riley Thompson
4d0eef7217 Store transform create/updates in revision table (#64247)
* store transform revisions

* Add tests

* remove unneeded arity

* fix whitespace

* include impl.transform in revisions.init

* move transform test to enterprise folder

* use =? and check unneeded keys were removed

* revert =? use

* dissoc source from transform comparison
2025-10-02 18:40:59 -04:00
Tyler Plude
cc6827ae8c [METABOT] Use limit in final search response (#64336)
* Limit default 50 search results

* tweak
2025-10-02 14:20:26 -07:00
ignacio
08dffba554 minimal change to dashboard caching steps (#64052)
* minimal change

* whoops

* whoops

* Update docs/configuring-metabase/caching.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update docs/configuring-metabase/caching.md

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-10-02 21:12:18 +00:00
Jeff Bruemmer
18b59c1b4d docs - notes on Metabot feedback (#64307)
* notes on feedback

* edit

* link
2025-10-02 17:02:18 -04:00
Anderson
d56be957f0 Show 'See it' link next to 'Saved' button after x-ray is saved as dashboard (#64265)
* Show 'See it' link next to 'Saved' button after x-ray is saved as dashboard

* Use Flex and Group mantine components

* use cy.log instead of JS comments

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>

* reverse the order of e2e assertions/actions

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>

* Fix tests

---------

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-10-02 17:09:05 -03:00
Edward Paget
6631ed5389 chore: Remove unused column-level middleware (#64326)
* chore: Remove unused column-level middleware

* fixup! update docstring
2025-10-02 19:55:30 +00:00
Noah Moss
16c4a16025 Fix edge case in to-tsquery-expr (#64330) 2025-10-02 19:15:21 +00:00
Edward Paget
2219786d93 fix: validate ldap server email before save (#62616)
Prevents the user from getting an ugly assertion error on login if the
ldap is misconfigured so we can't read a real email from the server response.
2025-10-02 18:46:33 +00:00
Phoomparin Mano
93052b8a8e Hide the step number circle in the setup flow when we only have one step (#64292) 2025-10-03 01:14:00 +07:00
Sébastien
e01cbfc87e Closes EMB-854 escape single quotes in embed code snippets (#64242)
* Closes EMB-854 escape single quotes in embed code snippets

* .

* .

* cleanup
2025-10-02 15:54:37 +02:00
Oleksandr Solovyov
899d6edb3c Mage run tests via nrepl (#64236) 2025-10-02 16:48:59 +03:00
Kamil Mielnik
5705ba7f81 Move SmartScalar subcomponents to separate files (#64283) 2025-10-02 19:44:59 +07:00
Cam Saul
0261a15e7b QP result metadata should always populate :lib/desired-column-alias (#64063)
* QP result metadata should always populate `:lib/desired-column-alias`

* Don't truncate desired column aliases for Table returned columns
2025-10-02 09:03:54 +00:00
Mahatthana (Kelvin) Nomsawadi
02cec9f38d fix(sdk): Allow token withoutexp, but raise a warning (#64238)
* Allow token without exp, but raise a warning

* Fix typing

* Fix wrong doc link anchor

* Fix doc link accessible label

* Add a test

* Fix sso endpoint calling repeating when jwt doesn't contain `exp`

* Fix unit tests

* Fix test for real!

* Fix test name typo

Co-authored-by: Nicolò Pretto <info@npretto.com>

* Use correct terminology "session"

Co-authored-by: Nicolò Pretto <info@npretto.com>

* Fix showing no EXP claim warning when the token is being fetched

Co-authored-by: Nicolò Pretto <info@npretto.com>

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-10-02 10:01:57 +01:00
Cam Saul
8fa9204d57 Fix formatting for native-query (#64291) 2025-10-02 01:43:18 -07:00
Nicolò Pretto
88229c321e fix(modular): links and type/URL columns should be rendered as clickable (#64243)
links
2025-10-02 10:19:43 +02:00
Timofey Kachalov
4d0d576c13 feat(sdk-bundle): Add SqlParametersList component for InteractiveQuestion and StaticQuestion (#64187) 2025-10-02 10:24:54 +04:00
Timofey Kachalov
7e4dfde94f Adjust sample apps setup (#64274) 2025-10-02 08:59:05 +04:00
William
85fc7cb3fd Dependencies tracking (#63248) 2025-10-01 22:37:16 -04:00
dpsutton
16dc5bece0 Log errors in downgrades (#64309)
Fixes https://github.com/metabase/metabase/issues/62179

Before (and bad) (wordwrap introduced for clarity):
```
2025-08-14 16:17:36,662 WARN app-db.liquibase :: The following
changesets were not rolled back. Likely because they are not in the
changelog file: v56.2025-06-05T16:48:48, v56.2025-06-06T20:11:53,
v56.2025-06-06T20:11:54, v56.2025-06-06T20:11:55,
v56.2025-06-06T20:11:56, v56.2025-06-06T20:11:58,
v56.2025-06-13T15:00:00, v56.2025-07-07T08:02:43,
v56.2025-07-17T20:11:55, v56.2025-07-17T20:11:56 2025-08-14 16:17:36,662
INFO liquibase.logging :: Successfully released change log lock ```
```

And now:

```
2025-10-01 16:00:19,326 INFO app-db.liquibase :: Rolling back app database schema to version 55
2025-10-01 16:00:19,326 INFO app-db.liquibase :: Going to roll back changeset v56.2025-07-17T20:11:56
Rolling Back Changeset: migrations/056_update_migrations.yaml::v56.2025-07-17T20:11:56::edpaget
2025-10-01 16:00:19,328 ERROR app-db.liquibase :: Error rolling back migration v56.2025-07-17T20:11:56
liquibase.exception.RollbackFailedException: liquibase.exception.DatabaseException: ERROR: column "jwt_attributes" does not exist
  Position: 41 [Failed SQL: (0) UPDATE core_user SET login_attributes = jwt_attributes WHERE sso_source = 'jwt']
  	at liquibase.changelog.ChangeSet.rollback(ChangeSet.java:1041)
        ...
Caused by: liquibase.exception.DatabaseException: ERROR: column "jwt_attributes" does not exist
  Position: 41 [Failed SQL: (0) UPDATE core_user SET login_attributes = jwt_attributes WHERE sso_source = 'jwt']
	at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:520)
       ... omitted
       ... 65 more
Caused by: org.postgresql.util.PSQLException: ERROR: column "jwt_attributes" does not exist
  Position: 41
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2734)
	... 70 more

2025-10-01 16:00:19,330 WARN app-db.liquibase :: The following
changesets were not rolled back. Likely because there were errors in
rollback (v56.2025-07-17T20:11:56): v56.2025-06-06T20:11:53,
v56.2025-06-06T20:11:54, v56.2025-06-06T20:11:55,
v56.2025-06-06T20:11:56, v56.2025-06-06T20:11:58,
v56.2025-06-13T15:00:00, v56.2025-07-07T08:02:43,
v56.2025-07-17T20:11:55, v56.2025-07-17T20:11:56 2025-10-01 16:00:19,330
INFO liquibase.logging :: Successfully released change log lock
```

How i recreated:
connected to a jar:
```
MB_DB_CONNECTION_URI="postgres://dan:password@localhost:5432/downgrade-checks" MB_JETTY_PORT=2999 java "$(socket-repl 6000)" -jar $JARS/1.56.6.2.jar
```

```sql
downgrade-checks=# alter table core_user drop column jwt_attributes;
ALTER TABLE
```

this will make a downgrade fail:
```yaml
  - changeSet:
      id: v56.2025-07-17T20:11:56
      author: edpaget
      comment: |
        Add sync login_attributes with jwt_attributes, we need to replace jwt_attributes
        with login attributes for users with sso_source jwt so that they will get the new
        behavior where login_attributes can override jwt_attributes
      changes:
        - sql: >-
           UPDATE core_user
           SET jwt_attributes = login_attributes, login_attributes = '{}'
           WHERE sso_source = 'jwt';
      rollback:
        - sql: >-
           UPDATE core_user
           SET login_attributes = jwt_attributes
           WHERE sso_source = 'jwt';
```

This will fail as the `jwt_attributes` column has been removed.

```
Error rolling back migration v56.2025-07-17T20:11:56
liquibase.exception.RollbackFailedException: liquibase.exception.DatabaseException: ERROR: column "jwt_attributes" does not exist
  Position: 41 [Failed SQL: (0) UPDATE core_user SET login_attributes = jwt_attributes WHERE sso_source = 'jwt']
```

And then connect to the jar again, redefine the changes here, and run

```clojure
  (let [data-source (metabase.app-db.core/data-source)]
    (with-open [conn (.getConnection ^javax.sql.DataSource data-source)]
      (with-liquibase [liquibase conn]
        (rollback-major-version! conn liquibase false))))
```
2025-10-01 17:59:50 -05:00
Nathan Voxland
3f15dcd0ad Better error handling when sync-tracking-atoms fails (#64132) 2025-10-01 16:42:11 -05:00
Phoomparin Mano
6e17e96bf0 feat(sdk-bundle): stacked and sidebar layouts for metabot questions (#64142) 2025-10-02 04:03:24 +07:00
Fraser
59dc6a1376 Remove skipped dashboard toast e2e tests (#64266) 2025-10-02 09:36:51 +13:00
John Swanson
4614a37972 Fix u/slugify function's max-length option (#64256)
* Fix `u/slugify` function's max-length option

`u/slugify` url-encoded non-ASCII characters, then took `max-length`
chars off the result.

Both make sense in isolation - but if we're slugifying, e.g., the string
勇士, with max-length 10, this results in:

- first, url encode non-ASCII characters => "%E5%8B%87%E5%A3%AB"
- then, take 10 characters => "%E5%8B%87%"

But a bare `%` character, as in the trailing character above, is not
valid URI syntax.

Discovered in [UXW-666: Users can't download results for questions with
long cyrillic names, error "URL
malformed"](https://linear.app/metabase/issue/UXW-666/users-cant-download-results-for-questions-with-long-cyrillic-names)
but there are probably more cases where this has caused mischief.

* fix test
2025-10-01 11:53:46 -07:00
Alex Yarosh
648039ca1a docs: don't overhype interactive embedding (#64299)
* docs: don't overhype interactive embedding

* Add in-page promo for embedding workshop

Added a promotional section for the embedding workshop.

* Update docs/embedding/interactive-embedding.md

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-10-01 18:46:48 +00:00
Jeff Bruemmer
2804f26f4b fix placeholder (#64240) 2025-10-01 14:30:33 -04:00
Alex Yarosh
158b78fb25 docs: clickhouse cloud (#64296) 2025-10-01 17:49:45 +00:00
Rodrigo López Dato
9b82a4d92d Add explicit import/export direction to serialization errors (#63777) 2025-10-01 20:30:33 +03:00
dpsutton
5fb41fd3b1 lower log level to debug for field ref issues (#64281)
These log lines will now be debug level warnings rather warning level warnings.
```
<lib.normalize>  Error normalizing MBQL 5
<lib.field.resolution>  We tried every trick we could think
<lib.join>  Failed to find matching column in join
```

Intrepid readers will also notice that moved "Resolved field %s to an
expression. ..." to debug as well.
2025-10-01 11:07:06 -05:00
Rodrigo López Dato
db70faad90 Show full timestamp for revision history entries on hover (#63256) 2025-10-01 15:07:42 +00:00
Alex Yarosh
dddf9d679c docs: serializing new entities (#64284)
Added document comments to the list of non-exported entities.
2025-10-01 10:26:54 -04:00
Uladzimir Havenchyk
c6c0bf73dd tests: wait for data in a flaky test (#64267) 2025-10-01 16:13:00 +03:00
John Swanson
c5da59566e Fix downloading tables grouped by datetime->int (#64245)
* Fix downloading tables grouped by datetime->int

The Linear task has a slightly more involved setup. I found that I could
replicate the issue with a slightly simpler setup:

- set up a simple query:
  - select COUNT from ORDERS
  - group by the day of the month
- log in as the sandboxed user
- try to download the card results (as CSV, XLSX, etc)
- see the error

Why does this happen? I found that, for a sandboxed user, the query
results show the "day of the month" column as having

```
         :base_type :type/DateTime,
         :database_type "TIMESTAMP",
         :effective_type :type/Integer,
```

while an admin user sees the same column as having

```
         :base_type :type/Integer,
         :database_type "INTEGER",
         :effective_type :type/Integer,
```

This seems bizarre and worth looking more into, but honestly shouldn't
really matter - if the effective type is an integer, we certainly
shouldn't be formatting it as a datetime.

`field-is-type?` is only used for checking whether a field is temporal
for formatting purposes, so I think this is a relatively low risk
change, and note that `metabase.lib.types.isa/temporal?` (the
replacement suggested by the deprecation notice for
`metabase.types.core/temporal-field?`) returns `false` for both
cases.

[UXW-660: Pivot tables with integer breakout columns fail to download as formatted XLSX for sandboxed tables](https://linear.app/metabase/issue/UXW-660/pivot-tables-with-integer-breakout-columns-fail-to-download-as)

* Write a test
2025-10-01 05:37:26 -07:00
Kamil Mielnik
f914bf8714 Update table editing e2e tests to not add or remove rows in Sample Database (#64273)
* Update the row deleting test to use writable db

* Update the row adding test to use writable db
2025-10-01 06:16:52 -05:00
Ngoc Khuat
448e9c8278 hide the python runner settings if hosted (#64233) 2025-10-01 08:18:44 +00:00
Nicola Mometto
0ac7bce92b Python runner timeouts (#64095)
* add python runner timeout as setting

* set timeout status

* add timeout status test

* appease kondo

* proper script

* Fix if: expr in upload runner logs

* Fix python runner log name

* Remove setting qualifier

* Add python-runner-timeout-seconds to FE settings type

* Ensure premium feature enabled so setting can be changed

---------

Co-authored-by: Dan Stone <wotbrew@gmail.com>
2025-10-01 09:15:08 +01:00
Romeo Van Snick
ccd8a11ee7 Add context to Save verb and fix similar translation issues (#64077)
* Add context to Save verb

* Add key

* Extract button from nested t

* Find other instances of nested c(...).jt`...${<x>...</x>}...` calls and unnest them
2025-10-01 17:58:46 +10:00
Ngoc Khuat
5164a08b2a Do not run transform test in postgres mysql (#64241) 2025-10-01 04:24:04 +00:00
Romeo Van Snick
e50317d86d Avoid extra interval with single interval in Bar chart (#64175)
* Remove extra interval tick when there is only one interval

* Add repro for metabase#63671

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-10-01 13:31:05 +10:00
Nathan Voxland
3800f7452a Support dbname for redshift in config files (#64069) 2025-09-30 22:21:49 -05:00
Romeo Van Snick
f89073a6bd Do not show error when loading (#64082)
* Pass isRunning to Visualization

* Hide error when query is running

* Add unit test for metabase#63410
2025-10-01 13:05:11 +10:00
Mahatthana (Kelvin) Nomsawadi
d848a88e64 Fix can't drill SQL questions in embedding SDK (#64083)
* Fix can't drill SQL questions in embedding SDK

* Add tests

* Fix the audit DB should not be able to see SQL

* Fix every CI check failing from updating from master

* Address code feedback, make it more clean

* Fix transducer order
2025-10-01 03:10:46 +01:00
Fraser
356025f41b Unskip issue 42049 reproduction (#63862) 2025-10-01 12:32:49 +13:00
Fraser
a0c2ebd9e9 Delete test for non-existent feature (#63683) 2025-10-01 09:51:40 +13:00
Alex Yarosh
c9bc786c60 remove actions from embedding overview (#64249)
Updated the requirement note for embedding types to clarify that a Pro and Enterprise plan is necessary.
2025-09-30 16:30:50 -04:00
Ramiro Nuñez Dosio
1f024e148d Revise README for clarity and updated links (#64194)
* Revise README for clarity and updated links

Update readme with 

- Product image (TBC which image)
- Update links to latest version (no redirects)
- Add mention of new features (Metabot AI and React SDK)
- Add community section

* Update README.md

Co-authored-by: alexandermkinn <85193003+alexandermkinn@users.noreply.github.com>

* Update README.md

Co-authored-by: alexandermkinn <85193003+alexandermkinn@users.noreply.github.com>

* Update Metabase product screenshot URL

Updated the product screenshot link in the README.

* Update README.md

Co-authored-by: Jeff Bruemmer <jeffbruemmer@gmail.com>

* Update README.md

Co-authored-by: Jeff Bruemmer <jeffbruemmer@gmail.com>

---------

Co-authored-by: alexandermkinn <85193003+alexandermkinn@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeffbruemmer@gmail.com>
2025-09-30 16:05:51 -04:00
Alex Yarosh
7c8a53c4d5 docs: pin shape (#64251)
* pin shape

* Update docs/questions/visualizations/map.md

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

* wording

Clarified limitations on data points for maps and added details about pin types.

* image

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-09-30 15:15:11 -04:00
John Swanson
bc28d50013 fix: make popular tables clickable (#64208)
Very silly bug, we were just populating the ID with the wrong
thing (`(:database-id table)` instead of `(:db_id table)`), so the FE
couldn't build links correctly.

There was a mismatch between `recent_views` and `popular_items`
endpoints. They have different queries, but are using the same
postprocessing function. So I needed to unify them: both now use
`:db_id`.
2025-09-30 11:31:59 -07:00
Timofey Kachalov
d0af14f90d Fix SegmentedControl colors (#64107) 2025-09-30 20:25:53 +04:00
Eric Normand
6afcf2aed5 Fix ssh tunneling for clickhouse (#63464)
* Fix ssh tunneling for clickhouse

* Remove questionmark

* Use kebab case keys

* Fix kondo;

This is also fixed in https://github.com/metabase/metabase/pull/63645,
so there may be a conflict.

* Don't squash exceptions.

* remove some tests, fix some tests

I removed some tests. Let's be very clear why this is happening. Push
back if you disagree:

```clojure
(deftest clickhouse-connection-fails-test
  (mt/test-driver :clickhouse
    (mt/with-temp [:model/Database db {:details (assoc (:details (mt/db)) :password "wrongpassword") :engine :clickhouse}]
      (testing "`driver/database-supports? :uploads` does not throw even if the connection fails."
        (is (false? (driver/database-supports? :clickhouse :uploads db)))
        (is (false? (driver/database-supports? :clickhouse :uploads nil))))
      (testing "`driver/database-supports? :connection-impersonation` does not throw even if the connection fails."
        (is (false? (driver/database-supports? :clickhouse :connection-impersonation db)))
        (is (false? (driver/database-supports? :clickhouse :connection-impersonation nil))))
      (testing (str "`sql-jdbc.conn/connection-details->spec` does not throw even if the connection fails, "
                    "and doesn't include the `select_sequential_consistency` parameter.")
        (is (nil? (:select_sequential_consistency (sql-jdbc.conn/connection-details->spec :clickhouse db))))
        (is (nil? (:select_sequential_consistency (sql-jdbc.conn/connection-details->spec :clickhouse nil))))))))
```

This test is _GONE_ because it's insane that we are testing that
`conneciton-details->spec` and `database-supports?` is resilient to
opening a connection to a server. That's nuts. We don't do that any
more. Should be the same as if checking `(+ 1 1)` doesn't open a network
connection. We get version information in

```clojure
(def ^:private ^{:arglists '([database])} get-clickhouse-version
  (memoize/ttl
   ^{:clojure.core.memoize/args-fn (fn [[database]] (:details database))}
   (fn [database]
     (sql-jdbc.execute/do-with-connection-with-options
      :clickhouse
      (sql-jdbc.conn/db->pooled-connection-spec database)
      nil
      (fn [^java.sql.Connection conn]
        (with-open [ver-stmt (.createStatement conn)
                    ver-rset (.executeQuery ver-stmt clickhouse-version-query)
                    cloud-stmt (.createStatement conn)
                    cloud-rset (.executeQuery cloud-stmt "SELECT value='1' FROM system.settings WHERE name='cloud_mode'")]
          (cond-> nil
            (.next ver-rset)
            (assoc :version          (.getString ver-rset 1)
                   :semantic-version {:major (.getInt ver-rset 2)
                                      :minor (.getInt ver-rset 3)})

            (.next cloud-rset)
            (assoc :cloud (.getBoolean cloud-rset 1)))))))
   :ttl/threshold default-cache-ttl))

(defmethod driver/dbms-version :clickhouse
  [_driver db]
  (get-clickhouse-version db))
```

We don't need to run this query every time you get a connection spec or
ask if the database supports something. We have the version and if it's
cloud and that's sufficient. The only reason it was opening a connection
was to run the cloud check (`select value=1 from system.settings where
name=cloud_mode`) above.

Also removed:
```clojure
(deftest impersonation-support-check-over-ssh-tunnel-test
  (testing "driver-supports? :connection-impersonation should work through an SSH tunnel (#62377)"
    ;; Use an in-memory SSH server that forwards to the correct port through localhost.
    ;; Since the real database is still reachable locally, it's possible for the driver to ignore the SSH tunnel and
    ;; still connect to the DB. So this test runs twice, once with all correct and once with an incorrect SSH
    ;; password. The latter check should fail (returning false for `driver-supports?`) if the SSH tunnel is being
    ;; respected.
    (mt/test-driver :clickhouse
      (let [username "username", password "password"]
        (with-open [ssh-server (driver.tu/basic-auth-ssh-server username password)]
          (doseq [[correct-password? ssh-password] [[true password] [false "wrong-password"]]]
            (memoize/memo-clear! @#'clickhouse.version/get-clickhouse-version)
            (let [ssh-port (.getPort ssh-server)]
              (with-ssh-tunnel! {:tunnel-enabled true
                                 :tunnel-host "localhost"
                                 :tunnel-auth-option "password"
                                 :tunnel-port ssh-port
                                 :tunnel-user username
                                 :tunnel-pass ssh-password}
                (testing (str "using " ssh-password)
                  (is (= correct-password?
                         (driver/database-supports? :clickhouse :connection-impersonation (mt/id)))))))))))))
```

Again, this is verifying connection resiliency in a call
to `(driver/database-supports? :clickhouse
:connection-impersonation (mt/id))` and ensuring that it uses the ssh
tunnel. This entire concern is gone, and a red flag that it ever
existed.

Changes:
a few tests used the `db` from `with-temp` to do stuff, but now that we
require them to have dbms_version i populated that

in the version check i thought i saw one in test going through with
`dbms-version` and not `dbms_version` so i'm checking both just to be
sure. it's a bit sloppy

* small changes and add back test

* handle dbms-version vs. dbms_version

* fix kondo

---------

Co-authored-by: Riley Thompson <riley@metabase.com>
Co-authored-by: dan sutton <dan@dpsutton.com>
Co-authored-by: Riley Thompson <rileythompson99@gmail.com>
2025-09-30 11:53:45 -04:00
yaojie
99d7d54af3 Set send-server-version? to false to hide Server version from response headers (#57257)
* Set send-server-version? to be false by default

* Update test
2025-09-30 16:40:19 +01:00
Dan Stone
1610538386 MariaDB transform cancellation fix (#64092) 2025-09-30 16:13:41 +01:00
Bergbok
1d94009c3d Update broken link in README (#63000) 2025-09-30 11:12:31 -04:00
Jeff Bruemmer
b8360b6da3 docs - document layout (#64209)
* document layout

* do stuff
2025-09-30 14:58:10 +00:00
Oleksandr Solovyov
cb13bdc086 simpler way to set token: mt/with-random-premium-token! (#64188) 2025-09-30 17:06:53 +03:00
Timofey Kachalov
1704f14bda refactor(sdk): Properly reinitialize metabaseConfig watcher for EmbedJS wizard (#64235) 2025-09-30 17:48:14 +04:00
John Swanson
593ecfb952 Use SQL SECURITY INVOKER for mysql views (#62537)
[UXW-263: Aurora MySQL AppDB can't create Metabase Analytics views
without using `SQL SECURITY
INVOKER`](https://linear.app/metabase/issue/UXW-263/aurora-mysql-appdb-cant-create-metabase-analytics-views-without-using)

Updates all the MySQL view creations to use `SQL SECURITY INVOKER`.
2025-09-30 06:07:10 -07:00
github-automation-metabase
611220c5e0 Update generated docs (master) (#64216)
Co-authored-by: github-actions <github-actions@github.com>
2025-09-30 08:56:57 -04:00
Dan Stone
b77f570c57 Add python runner logs as artifacts on failed tests (#64093)
* Factor out setup/log actions for python runner, use in driver tests

* Remove redundant cd

Co-authored-by: Nicolò Maria Mezzopera <nicolo.mezzopera@metabase.com>

---------

Co-authored-by: Nicolò Maria Mezzopera <nicolo.mezzopera@metabase.com>
2025-09-30 11:59:24 +01:00
Timofey Kachalov
8ba64b7bcd fix(sdk): Fix SDK refresh token race-conditions (#64094) 2025-09-30 13:09:58 +04:00
Nicola Mometto
e1dcfdab2e Do not realize objects in memory early for python transform results (#64034)
* partition documents for mongo insert

* feat: s3/read-to-stream

* don't keep files in memory, stream them

* fix tests

* proper types

* slurp conditionally

* replace_existing

* nil safe

* Tweak InputStream lifetimes

* Fix test now read-to-string returns nil

* Fix kondo / reflection

---------

Co-authored-by: Dan Stone <wotbrew@gmail.com>
2025-09-30 09:42:34 +01:00
Timofey Kachalov
5c9b282361 Update typedoc and its plugins versions (#64219) 2025-09-30 11:43:47 +04:00
Oleksandr Solovyov
cf5c7bd4c3 [search] better search for CamelCased tables and dbs (#64043) 2025-09-30 06:20:14 +00:00
Nemanja Glumac
46adff882f Fix metrics-collection e2e flake (#64204)
We're making the assertion a bit more flexible
without losing the confidence that this test
was supposed to give us when it was created.
2025-09-30 07:50:30 +02:00
Cam Saul
87923e1e1d Fix duplicate coercion on custom columns from joins (#63941)
* Fix duplicate coercion on custom columns from joins

* Fix #63991

* Test fixes 🔧

* Another round of test fixes 🔧

* Test fixes 🔧

* Kondo lint fixes 🔧
2025-09-29 22:16:56 -07:00
Romeo Van Snick
5bd544baf5 Fix native transform editor results UI warts (#64081)
* Pass className to native editor

* Add missing border on top of native editor

* Set minimal editor height so the results panel is always visible

* Move initial height calculation to hook
2025-09-30 14:04:22 +10:00
Anderson
f8d410f858 Change dark ClickHouse icon to be yellow (#64213) 2025-09-29 22:57:18 -03:00
Aleksandr Lesnenko
cfa62e4b8b original card description should be provided to visualizer (#64197) 2025-09-30 00:28:07 +00:00
Romeo Van Snick
fa2820320e Fix zoom and hover on map while editing (#64174)
* Add missing import

* Use late-binding for handlers so they can change without having to recreate markers

* Allow isEditing props to re-render Map component

* Allow disabling zoom control on maps

* Allow clicking the Map action buttons

* Disable zoom and hover when in editing mode

* Add repro for metabase#64138

* Fix e2e tests
2025-09-30 09:03:51 +10:00
Romeo Van Snick
33070f6e06 Fix completion results (#64080)
* Do not shrink grid rows in completion results

* Add e2e test for metabase#63711
2025-09-30 09:03:13 +10:00
Denis Berezin
f43c6462d8 Add support for special intl chars for email formatting (#64060)
* Add support for special intl chars for email formatting

* Fix review comments

* Fix unit tests
2025-09-30 00:16:28 +04:00
Brad Anderson
8f4ccdf2ba Fix #63904: Corrects dashcard selector usage (#64140)
* UXW-1766 Fixes issue where getDashboardHeaderParameters looks at all cached dashcards rather than just the ones from the currently viewed dashboard

* UXW-1766 Adds/updates unit tests
2025-09-29 13:20:34 -04:00
Nemanja Glumac
788bf01ea9 Report Metabot feedback directly to Harbormaster (#64040)
We're introducing a new endpoint in metabase/metabase. It sends the feedback to the backend which then (1) fetches the premium token and (2) constructs the correct store api URL with the same feedback as the payload. Our backend acts as a proxy because the api url contains the token and we can't send it from the FE.
2025-09-29 19:06:51 +02:00
Noah Moss
c4de2725e3 Extract native query content for search indexing rather than the entire dataset_query structure (#64125)
* Extract native query content for search indexing rather than the entire dataset_query structure

* remove inline def

* Fix doc string

* Update search spec field-fields logic to support the :fn syntax to fix test

* Remvoe query_type from expected card spec fields as we're no longer using it to detect native query changes

* Address feedback on :fn semantics, and add a more detailed docstring to define-spec macro
2025-09-29 12:17:17 -04:00
Braden Shepherdson
cd0965a299 [Vertica] Support Vertica UUID columns as :type/UUID (#62512) 2025-09-29 15:38:59 +00:00
Uladzimir Havenchyk
95452f41d3 feat: use new detail view in metadata preview (#63968)
* feat: use new detail view in metadata preview

* drop relationships

* fix e2e helper

* use correct '

* make table responsive

* update helper

* adjust values in tests

* use useSampleData

* rework approach

* update helper

* oops, lost changes

* restore test

* let's add table just in case

* another attempt

* responsive

* restore indexes

* rename index -> rowNumber

* show details group in more cases

* remove force: true

* fix index
2025-09-29 17:31:30 +03:00
John Swanson
b323ecd565 Add a timeout for slow LDAP (#63852)
When the LDAP server is slow, we should fall back to normal
authentication.

For now, use a configurable timeout, defaulting to 15 seconds - this
seems on the high side of reasonable.

[UXW-291: When LDAP is configured, then normal email logins can be blocked if LDAP server is slow/down](https://linear.app/metabase/issue/UXW-291/when-ldap-is-configured-then-normal-email-logins-can-be-blocked-if)
2025-09-29 07:08:10 -07:00
Edward Paget
b2939990fc fix: correct filtering for internal collections (#64065)
* fix: correct filtering for internal collections

* fixup! set is_sample flag on archived collection

filter out analytics namespace
2025-09-29 08:25:36 -05:00
Alexander Polyankin
c63dff0d7b Fixes viz settins for details-only columns (#64113) 2025-09-29 09:12:38 -04:00
John Swanson
521eed05c5 Do not URL-encode default redirect URL (#63965)
I think this was just a mistake - there's no need to URL-encode this and
it actually breaks the redirect.
2025-09-29 06:05:13 -07:00
John Swanson
e88afceba9 Index analytics collections (#64064)
These were excluded from the index, but they should really be in there.
2025-09-29 06:04:02 -07:00
John Swanson
ac2003368e When deleting DB, hide cards from search (#64112)
* When deleting DB, hide cards from search

We have a current issue with search: deleting items does not actually
remove them from search.

This is a particularly nasty version of this, because while usually a
delete follows an update (that marks the card as archived,
which *does* remove it from search), in this case we're just deleting
the items directly as part of an `ON DELETE CASCADE`.

This is a bit hacky, but for now we can just mark them as `archived`
before we delete them to hide them from search.

[UXW-602: Search API returns inexisting cards](https://linear.app/metabase/issue/UXW-602/search-api-returns-inexisting-cards)
2025-09-29 06:03:53 -07:00
Timofey Kachalov
1d2fc06b60 feat(embed-js): Add support of fetchRequestToken for embed-js (#64004) 2025-09-29 16:12:43 +04:00
4695 changed files with 782515 additions and 600298 deletions

View File

@@ -0,0 +1,420 @@
---
name: add-malli-schemas
description: Efficiently add Malli schemas to API endpoints in the Metabase codebase with proper patterns, validation timing, and error handling
---
# Add Malli Schemas to API Endpoints
This skill helps you efficiently and uniformly add Malli schemas to API endpoints in the Metabase codebase.
## Reference Files (Best Examples)
- `src/metabase/warehouses/api.clj` - Most comprehensive schemas, custom error messages
- `src/metabase/api_keys/api.clj` - Excellent response schemas
- `src/metabase/collections/api.clj` - Great named schema patterns
- `src/metabase/timeline/api/timeline.clj` - Clean, simple examples
## Quick Checklist
When adding Malli schemas to an endpoint:
- [ ] Route params have schemas
- [ ] Query params have schemas with `:optional true` and `:default` where appropriate
- [ ] Request body has a schema (for POST/PUT)
- [ ] Response schema is defined (using `:-` after route string)
- [ ] Use existing schema types from `ms` namespace when possible
- [ ] Consider creating named schemas for reusable or complex types
- [ ] Add contextual error messages for validation failures
## Basic Structure
### Complete Endpoint Example
```clojure
(mr/def ::Color [:enum "red" "blue" "green"])
(mr/def ::ResponseSchema
[:map
[:id pos-int?]
[:name string?]
[:color ::Color]
[:created_at ms/TemporalString]])
(api.macros/defendpoint :post "/:name" :- ::ResponseSchema
"Create a resource with a given name."
[;; Route Params:
{:keys [name]} :- [:map [:name ms/NonBlankString]]
;; Query Params:
{:keys [include archived]} :- [:map
[:include {:optional true} [:maybe [:= "details"]]]
[:archived {:default false} [:maybe ms/BooleanValue]]]
;; Body Params:
{:keys [color]} :- [:map [:color ::Color]]
]
;; endpoint implementation, ex:
{:id 99
:name (str "mr or mrs " name)
:color ({"red" "blue" "blue" "green" "green" "red"} color)
:created_at (t/format (t/formatter "yyyy-MM-dd'T'HH:mm:ssXXX") (t/zoned-date-time))}
)
```
## Common Schema Patterns
1. Route Params (the 5 in `api/user/id/5`)
2. Query Params (the sort+asc pair in `api/users?sort=asc`)
3. Body Params (the contents of a request body. Almost always decoded from json into edn)
4. The Raw Request map
Of the 4 arguments, deprioritize usage of the raw request unless necessary.
### Route Params
Always required, typically just a map with an ID:
```clojure
[{:keys [id]} :- [:map [:id ms/PositiveInt]]]
```
For multiple route params:
```clojure
[{:keys [id field-id]} :- [:map
[:id ms/PositiveInt]
[:field-id ms/PositiveInt]]]
```
### Query Params
Add properties for `{:optional true ...}` and `:default` values:
```clojure
{:keys [archived include limit offset]} :- [:map
[:archived {:default false} [:maybe ms/BooleanValue]]
[:include {:optional true} [:maybe [:= "tables"]]]
[:limit {:optional true} [:maybe ms/PositiveInt]]
[:offset {:optional true} [:maybe ms/PositiveInt]]]
```
### Request Body (POST/PUT)
```clojure
{:keys [name description parent_id]} :- [:map
[:name ms/NonBlankString]
[:description {:optional true} [:maybe ms/NonBlankString]]
[:parent_id {:optional true} [:maybe ms/PositiveInt]]]
```
### Response Schemas
#### Simple inline response:
```clojure
(api.macros/defendpoint :get "/:id" :- [:map
[:id pos-int?]
[:name string?]]
"Get a thing"
...)
```
#### Named schema for reuse:
```clojure
(mr/def ::Thing
[:map
[:id pos-int?]
[:name string?]
[:description [:maybe string?]]])
(api.macros/defendpoint :get "/:id" :- ::Thing
"Get a thing"
...)
(api.macros/defendpoint :get "/" :- [:sequential ::Thing]
"Get all things"
...)
```
## Common Schema Types
### From `metabase.util.malli.schema` (aliased as `ms`)
Prefer the schemas in the ms/* namespace, since they work better with our api infrastructure.
For example use `ms/PositiveInt` instead of `pos-int?`.
```clojure
ms/PositiveInt ;; Positive integer
ms/NonBlankString ;; Non-empty string
ms/BooleanValue ;; String "true"/"false" or boolean
ms/MaybeBooleanValue ;; BooleanValue or nil
ms/TemporalString ;; ISO-8601 date/time string (for REQUEST params only!)
ms/Map ;; Any map
ms/JSONString ;; JSON-encoded string
ms/PositiveNum ;; Positive number
ms/IntGreaterThanOrEqualToZero ;; 0 or positive
```
**IMPORTANT:** For response schemas, use `:any` for temporal fields, not `ms/TemporalString`!
Response schemas validate BEFORE JSON serialization, so they see Java Time objects.
### Built-in Malli Types
```clojure
:string ;; Any string
:boolean ;; true/false
:int ;; Any integer
:keyword ;; Clojure keyword
pos-int? ;; Positive integer predicate
[:maybe X] ;; X or nil
[:enum "a" "b" "c"] ;; One of these values
[:or X Y] ;; Schema that satisfies X or Y
[:and X Y] ;; Schema that satisfies X and Y
[:sequential X] ;; Sequential of Xs
[:set X] ;; Set of Xs
[:map-of K V] ;; Map with keys w/ schema K and values w/ schema V
[:tuple X Y Z] ;; Fixed-length tuple of schemas X Y Z
```
Avoid using sequence schemas unless completely necessary.
## Step-by-Step: Adding Schemas to an Endpoint
### Example: Adding return schema to `GET /api/field/:id/related`
**Before:**
```clojure
(api.macros/defendpoint :get "/:id/related"
"Return related entities."
[{:keys [id]} :- [:map [:id ms/PositiveInt]]]
(-> (t2/select-one :model/Field :id id) api/read-check xrays/related))
```
**Step 1:** Check what the function returns (look at `xrays/related`)
**Step 2:** Define response schema based on return type:
```clojure
(mr/def ::RelatedEntity
[:map
[:tables [:sequential [:map [:id pos-int?] [:name string?]]]]
[:fields [:sequential [:map [:id pos-int?] [:name string?]]]]])
```
**Step 3:** Add response schema to endpoint:
```clojure
(api.macros/defendpoint :get "/:id/related" :- ::RelatedEntity
"Return related entities."
[{:keys [id]} :- [:map [:id ms/PositiveInt]]]
(-> (t2/select-one :model/Field :id id) api/read-check xrays/related))
```
## Advanced Patterns
### Custom Error Messages
```clojure
(def DBEngineString
"Schema for a valid database engine name."
(mu/with-api-error-message
[:and
ms/NonBlankString
[:fn
{:error/message "Valid database engine"}
#(u/ignore-exceptions (driver/the-driver %))]]
(deferred-tru "value must be a valid database engine.")))
```
### Enum with Documentation
```clojure
(def PinnedState
(into [:enum {:error/message "pinned state must be 'all', 'is_pinned', or 'is_not_pinned'"}]
#{"all" "is_pinned" "is_not_pinned"}))
```
### Complex Nested Response
```clojure
(mr/def ::DashboardQuestionCandidate
[:map
[:id ms/PositiveInt]
[:name ms/NonBlankString]
[:description [:maybe string?]]
[:sole_dashboard_info
[:map
[:id ms/PositiveInt]
[:name ms/NonBlankString]
[:description [:maybe string?]]]]])
(mr/def ::DashboardQuestionCandidatesResponse
[:map
[:data [:sequential ::DashboardQuestionCandidate]]
[:total ms/PositiveInt]])
```
### Paginated Response Pattern
```clojure
(mr/def ::PaginatedResponse
[:map
[:data [:sequential ::Item]]
[:total integer?]
[:limit {:optional true} [:maybe integer?]]
[:offset {:optional true} [:maybe integer?]]])
```
## Common Pitfalls
### Don't: Forget `:maybe` for nullable fields
```clojure
[:description ms/NonBlankString] ;; WRONG - fails if nil
[:description [:maybe ms/NonBlankString]] ;; RIGHT - allows nil
```
### Don't: Forget `:optional true` for optional query params
```clojure
[:limit ms/PositiveInt] ;; WRONG - required but shouldn't be
[:limit {:optional true} [:maybe ms/PositiveInt]] ;; RIGHT
```
### Don't: Forget `:default` values for known params
```clojure
[:limit ms/PositiveInt] ;; WRONG - required but shouldn't be
[:limit {:optional true :default 0} [:maybe ms/PositiveInt]] ;; RIGHT
```
### Don't: Mix up route params, query params, and body
```clojure
;; WRONG - all in one map
[{:keys [id name archived]} :- [:map ...]]
;; RIGHT - separate destructuring
[{:keys [id]} :- [:map [:id ms/PositiveInt]]
{:keys [archived]} :- [:map [:archived {:default false} ms/BooleanValue]]
{:keys [name]} :- [:map [:name ms/NonBlankString]]]
```
### Don't: Use `ms/TemporalString` for Java Time objects in response schemas
```clojure
;; WRONG - Java Time objects aren't strings yet
[:date_joined ms/TemporalString]
;; RIGHT - schemas validate BEFORE JSON serialization
[:date_joined :any] ;; Java Time object, serialized to string by middleware
[:last_login [:maybe :any]] ;; Java Time object or nil
```
**Why:** Response schemas validate the internal Clojure data structures BEFORE they are serialized to JSON. Java Time objects like `OffsetDateTime` get converted to ISO-8601 strings by the JSON middleware, so the schema needs to accept the raw Java objects.
### Don't: Use `[:sequential X]` when the data is actually a set
```clojure
;; WRONG - group_ids is actually a set
[:group_ids {:optional true} [:sequential pos-int?]]
;; RIGHT - matches the actual data structure
[:group_ids {:optional true} [:maybe [:set pos-int?]]]
```
**Why:** Toucan hydration methods often return sets. The JSON middleware will serialize sets to arrays, but the schema validates before serialization.
### Don't: Create anonymous schemas for reused structures
Use `mr/def` for schemas used in multiple places:
```clojure
(mr/def ::User
[:map
[:id pos-int?]
[:email string?]
[:name string?]])
```
## Finding Return Types
1. **Look at the function being called**
```clojure
(api.macros/defendpoint :get "/:id"
[{:keys [id]}]
(t2/select-one :model/Field :id id)) ;; Returns a Field instance
```
2. **Check Toucan models for structure**
Look in `src/metabase/*/models/*.clj` for model definitions.
3. **Use clojure-mcp or REPL to inspect**
```bash
./bin/mage -repl '(require '\''metabase.xrays.core) (doc metabase.xrays.core/related)'
```
4. **Check tests**
Tests often show the expected response structure.
## Understanding Schema Validation Timing
**CRITICAL CONCEPT:** Schemas validate at different points in the request/response lifecycle:
### Request Parameter Schemas (Query/Body/Route)
- Validate AFTER JSON parsing
- Data is already deserialized (strings, numbers, booleans)
- Use `ms/TemporalString` for date/time inputs
- Use `ms/BooleanValue` for boolean query params
### Response Schemas
- Validate BEFORE JSON serialization
- Data is still in Clojure format (Java Time objects, sets, keywords)
- Use `:any` for Java Time objects
- Use `[:set X]` for sets
- Use `[:enum :keyword]` for keyword enums
### Serialization Flow
```
Request: JSON string → Parse → Coerce → Handler
Response: Handler → Schema Check → Encode → Serialize → JSON string
```
## Workflow Summary
1. **Read the endpoint** - understand what it does
2. **Identify params** - route, query, body
3. **Add parameter schemas** - use existing types from `ms`
4. **Determine return type** - check the implementation
5. **Define response schema** - inline or named with `mr/def`
6. **Test** - ensure the endpoint works and validates correctly
## Testing Your Schemas
After adding schemas, verify:
1. **Valid requests work** - test with correct data
2. **Invalid requests fail gracefully** - test with wrong types
3. **Optional params work** - test with/without optional params
4. **Error messages are clear** - check validation error responses
## Tips
- **Start simple** - begin with basic types, refine later
- **Reuse schemas** - if you see the same structure twice, make it a named schema
- **Be specific** - use `ms/PositiveInt` instead of `pos-int?`
- **Document intent** - add docstrings to named schemas
- **Follow conventions** - look at similar endpoints in the same namespace
- **Check the actual data** - use REPL to inspect what's actually returned before serialization
## Additional Resources
- [Malli Documentation](https://github.com/metosin/malli)
- Metabase Malli utilities: `src/metabase/util/malli/schema.clj`
- Metabase schema registry: `src/metabase/util/malli/registry.clj`

View File

@@ -25,6 +25,7 @@
:reduce-without-init {:level :warning}
:redundant-call {:level :warning}
:redundant-fn-wrapper {:level :warning}
:redundant-str-call {:level :warning}
:self-requiring-namespace {:level :warning}
:single-key-in {:level :warning}
:unsorted-imports {:level :warning}
@@ -55,20 +56,22 @@
;;
;; globally-enabled custom linters
;;
:metabase/check-defmulti-arglists {:level :warning}
:metabase/check-me-humanize {:level :warning}
:metabase/defsetting-must-specify-export {:level :warning}
:metabase/defsetting-namespace {:level :warning}
:metabase/mbql-query-first-arg {:level :warning}
:metabase/missing-test-expr-requires-in-cljs {:level :warning}
:metabase/modules {:level :warning} ; more config in `.clj-kondo/config/modules/config.edn`
:metabase/namespace-name {:level :warning}
:metabase/require-shape-checker {:level :warning}
:metabase/test-helpers-use-non-thread-safe-functions {:level :warning} ; more config in `.clj-kondo/config/test-helpers/config.edn`
:metabase/validate-logging {:level :warning}
:metabase/validate-mb-driver-tests {:level :warning}
:metabase/validate-mb-once {:level :warning}
:metabase/discourage-millis-duration {:level :warning}
:metabase/check-defmulti-arglists {:level :warning}
:metabase/check-me-humanize {:level :warning}
:metabase/defsetting-must-specify-export {:level :warning}
:metabase/defsetting-namespace {:level :warning}
:metabase/discourage-millis-duration {:level :warning}
:metabase/mbql-query-first-arg {:level :warning}
:metabase/missing-test-expr-requires-in-cljs {:level :warning}
:metabase/modules {:level :warning} ; more config in `.clj-kondo/config/modules/config.edn`
:metabase/namespace-name {:level :warning}
:metabase/require-shape-checker {:level :warning}
:metabase/test-helpers-use-non-thread-safe-functions {:level :warning} ; more config in `.clj-kondo/config/test-helpers/config.edn`
:metabase/validate-defendpoint-route-uses-kebab-case {:level :warning}
:metabase/validate-defendpoint-query-params-use-kebab-case {:level :warning}
:metabase/validate-logging {:level :warning}
:metabase/validate-mb-driver-tests {:level :warning}
:metabase/validate-mb-once {:level :warning}
:metabase/validate-deftest
{:level :warning
@@ -226,9 +229,6 @@
{:exclude
[(build.uberjar/with-duration-ms)
(cljs.test/is [=? malli=])
(clojure.core.logic/fresh)
(clojure.core.logic/matcha)
(clojure.core.logic/run)
(clojure.test/is [=? malli= qv=])
(clojure.tools.macro/macrolet)
instaparse.core/transform
@@ -273,6 +273,7 @@
clojure.java.jdbc/with-db-connection {:message "Use sql-jdbc.execute/do-with-connection-with-options (for drivers) or t2/with-connection (for the app DB) instead of jdbc/with-db-connection"}
clojure.java.jdbc/with-db-metadata {:message "Use sql-jdbc.execute/do-with-connection-with-options + .getMetaData instead of jdbc/with-db-metadata"}
clojure.pprint/pprint {:message "Use metabase.util.log instead of clojure.pprint/pprint"}
clojure.pprint/print-table {:message "Use metabase.util.log instead of printing directly to the console"}
clojure.string/lower-case {:message "Use metabase.util/lower-case-en instead of clojure.string/lower-case"}
clojure.string/upper-case {:message "Use metabase.util/upper-case-en instead of clojure.string/upper-case"}
compojure.core/context {:message "Use metabase.api.util.handlers/route-map-handler instead of compojure.core/context, it is much faster and supports OpenAPI spec generation"}
@@ -406,7 +407,6 @@
:lint-as
{cljs.cache/defcache clojure.core/deftype
clojure.core.cache/defcache clojure.core/deftype
clojure.core.logic/defne clj-kondo.lint-as/def-catch-all
clojure.test.check.clojure-test/defspec clojure.test/deftest
clojure.test.check.properties/for-all clojure.core/let
clojurewerkz.quartzite.jobs/defjob clojure.core/defn
@@ -488,8 +488,9 @@
metabase.util.malli/defn- schema.core/defn
metabase.util.malli/fn schema.core/fn
metabase.util.namespaces/import-fns potemkin/import-vars
metabase.util.performance/doseq clojure.core/doseq
metabase.util.performance/for clojure.core/for
metabase.util/with-timer-ms clojure.core/fn
metabase.xrays.domain-entities.malli/defn schema.core/defn
metabuild-common.core/with-open-jar-file-system clojure.core/let
metabuild-common.files/with-open-jar-file-system clojure.core/let
monger.operators/defoperator clojure.core/def
@@ -519,6 +520,7 @@
metabase-enterprise.advanced-permissions.models.permissions.application-permissions-test/with-new-group-and-current-graph hooks.common/with-two-top-level-bindings
metabase-enterprise.audit-app.pages-test/with-temp-objects hooks.common/with-one-binding
metabase-enterprise.cache.config-test/with-temp-persist-models hooks.common/with-seven-bindings
metabase-enterprise.metabot-v3.tools.dependencies-test/with-dependent-transforms! hooks.common/with-two-bindings
metabase-enterprise.semantic-search.db.connection/with-migrate-tx hooks.common/let-one-with-optional-value
metabase-enterprise.serialization.test-util/with-temp-dpc hooks.toucan2.tools.with-temp/with-temp
metabase-enterprise.transforms-python.drivers-test/with-test-table hooks.common/with-two-bindings
@@ -547,6 +549,8 @@
metabase.embedding.api.embed-test/with-temp-card hooks.common/let-one-with-optional-value
metabase.embedding.api.embed-test/with-temp-dashcard hooks.common/let-one-with-optional-value
metabase.legacy-mbql.schema.macros/defclause hooks.metabase.legacy-mbql.schemas.macros/defclause
metabase.legacy-mbql.schema.macros/defclause* hooks.metabase.legacy-mbql.schemas.macros/defclause*
metabase.legacy-mbql.schema.macros/one-of hooks.metabase.legacy-mbql.schemas.macros/one-of
metabase.lib.schema.mbql-clause/define-catn-mbql-clause hooks.metabase.lib.schema.mbql-clause/define-mbql-clause
metabase.lib.schema.mbql-clause/define-mbql-clause hooks.metabase.lib.schema.mbql-clause/define-mbql-clause
metabase.lib.schema.mbql-clause/define-tuple-mbql-clause hooks.metabase.lib.schema.mbql-clause/define-mbql-clause
@@ -573,8 +577,8 @@
metabase.pulse.models.pulse-test/with-pulse-in-collection! hooks.common/with-four-bindings
metabase.pulse.test-util/checkins-query-card hooks.metabase.test.data/$ids
metabase.queries.api.card-test/with-card-param-values-fixtures hooks.common/let-one-with-optional-value
metabase.queries.api.card-test/with-temp-native-card! hooks.common/with-two-bindings
metabase.queries.api.card-test/with-temp-native-card-with-params! hooks.common/with-two-bindings
metabase.queries.api.card-test/with-temp-native-card hooks.common/with-two-bindings
metabase.queries.api.card-test/with-temp-native-card-with-params hooks.common/with-two-bindings
metabase.query-processor-test.expressions-test/calculate-bird-scarcity hooks.metabase.query-processor-test.expressions-test/calculate-bird-scarcity
metabase.query-processor-test.filter-test/count-with-filter-clause hooks.metabase.test.data/$ids
metabase.query-processor.middleware.cache-test/with-mock-cache! hooks.common/with-two-bindings
@@ -624,10 +628,11 @@
metabase.test/with-non-admin-groups-no-root-collection-perms hooks.common/do*
metabase.test/with-persistence-enabled! hooks.metabase.model-persistence.test-util/with-persistence-enabled!
metabase.test/with-prometheus-system! hooks.common/with-two-bindings
metabase.test/with-random-premium-token! hooks.common/with-one-binding
metabase.test/with-temp hooks.toucan2.tools.with-temp/with-temp
metabase.test/with-temp-file hooks.metabase.test.util/with-temp-file
metabase.test/with-temporary-setting-values hooks.metabase.test.util/with-temporary-setting-values
metabase.users.api-test/with-temp-user-email! hooks.common/with-one-binding
metabase.users.api-test/with-temp-user-email! hooks.common/with-one-binding
metabase.util.i18n/deferred-trs hooks.metabase.util.i18n/deferred-trs
metabase.util.i18n/deferred-tru hooks.metabase.util.i18n/deferred-tru
metabase.util.i18n/trs hooks.metabase.util.i18n/trs
@@ -687,7 +692,6 @@
metabase.test/with-temporary-raw-setting-values macros.metabase.test.util/with-temporary-raw-setting-values
metabase.users.models.user-test/with-groups! macros.metabase.users.models.user-test/with-groups!
metabase.util.namespaces/import-fn macros.metabase.util.namespaces/import-fn
metabase.xrays.domain-entities.malli/define-getters-and-setters macros.metabase.xrays.domain-entities.malli/define-getters-and-setters
metabase.xrays.related-test/with-world macros.metabase.xrays.related-test/with-world}}
:config-in-comment
@@ -715,6 +719,8 @@
:name metabase-lib}
{:pattern "^metabase\\.lib\\..*"
:name metabase-lib-excluding-legacy-mbql}
{:pattern "^metabase\\.legacy-mbql\\..*"
:name legacy-mbql-namespaces}
;;
;; QP and driver source namespaces: `metabase.query-processor.*`, `metabase-enterprise.sandbox.query-processor.*`,
;; and `metabase.driver.*`, excluding `-test` namespaces.
@@ -729,7 +735,7 @@
;;
;; driver namespaces, including tests
;;
{:pattern "metabase\\.driver.*$"
{:pattern "metabase\\.driver(?:-api)?.*$"
:name driver-namespaces}
;;
;; Perf-sensitive namespaces are currently the union of metabase.lib.*, driver namespaces, and QP (without tests).
@@ -775,7 +781,14 @@
clojure.core/eval {:message "Don't use eval outside of tests"}}
:discouraged-namespace
{metabase.query-processor.store {:message "Please do not use the QP Store outside of legacy QP or driver code. Use MBQL 5/Lib or lib.metadata.jvm/applicaton-database-metadata-provider instead."}}}}
{metabase.legacy-mbql.jvm-util {:message "Avoid legacy MBQL utils, use Lib instead"}
metabase.legacy-mbql.normalize {:message "Avoid legacy MBQL normalization, use MBQL 5 + lib/normalize instead"}
metabase.legacy-mbql.predicates {:message "Avoid legacy MBQL utils, use Lib instead"}
metabase.legacy-mbql.schema {:message "Avoid the legacy MBQL schema, use MBQL 5 + lib.schema instead"}
metabase.legacy-mbql.schema.helpers {:message "Avoid the legacy MBQL schema, use MBQL 5 + lib.schema instead"}
metabase.legacy-mbql.schema.macros {:message "Avoid the legacy MBQL schema, use MBQL 5 + lib.schema instead"}
metabase.legacy-mbql.util {:message "Avoid legacy MBQL utils, use Lib instead"}
metabase.query-processor.store {:message "Please do not use the QP Store outside of legacy QP or driver code. Use MBQL 5/Lib or lib.metadata.jvm/applicaton-database-metadata-provider instead."}}}}
printable-namespaces
{:linters
@@ -817,34 +830,89 @@
toucan2.core {:message "Don't use application database inside Lib code"}}}}
metabase-lib-excluding-legacy-mbql
{:linters
{:discouraged-var
{metabase.legacy-mbql.util/unique-name-generator {:message "Use metabase.lib.util/unique-name-generator or non-truncating-unique-name-generator"}}}
{}
:discouraged-namespace
{metabase.legacy-mbql.js {:message "Avoid legacy MBQL utils in Lib; move things into Lib if needded."}
metabase.legacy-mbql.jvm-util {:message "Avoid legacy MBQL utils in Lib; move things into Lib if needded."}
metabase.legacy-mbql.predicates {:message "Avoid legacy MBQL utils in Lib; move things into Lib if needded."}
metabase.legacy-mbql.util {:message "Avoid legacy MBQL utils in Lib; move things into Lib if needded."}}}
legacy-mbql-namespaces
{:linters
{:discouraged-namespace
{metabase.legacy-mbql.jvm-util {:level :off}
metabase.legacy-mbql.normalize {:level :off}
metabase.legacy-mbql.predicates {:level :off}
metabase.legacy-mbql.schema {:level :off}
metabase.legacy-mbql.schema.helpers {:level :off}
metabase.legacy-mbql.schema.macros {:level :off}
metabase.legacy-mbql.util {:level :off}
metabase.query-processor.store {:level :off}}
;; the `metabase.legacy-mbql` stuff is all deprecated, so we don't need to warn inside the module about other stuff
;; in the module being marked deprecated or discouraged.
:deprecated-namespace {:level :off}
:deprecated-var {:level :off}}}
driver-namespaces
{:linters
{:discouraged-var
{metabase.driver/database-supports? {:level :off}}}}
{metabase.driver/database-supports? {:level :off}}
;; don't warn about the legacy MBQL namespaces being deprecated or discouraged in driver code now, we don't have a
;; real alternative YET so it's not a helpful warning.
:discouraged-namespace
{metabase.legacy-mbql.jvm-util {:level :off}
metabase.legacy-mbql.normalize {:level :off}
metabase.legacy-mbql.predicates {:level :off}
metabase.legacy-mbql.schema {:level :off}
metabase.legacy-mbql.schema.helpers {:level :off}
metabase.legacy-mbql.schema.macros {:level :off}
metabase.legacy-mbql.util {:level :off}
metabase.query-processor.store {:level :off}}
:deprecated-namespace
{:exclude
[metabase.driver.common.parameters
metabase.driver.common.parameters.dates
metabase.driver.common.parameters.operators
metabase.driver.common.parameters.parse
metabase.driver.common.parameters.values
metabase.legacy-mbql.jvm-util
metabase.legacy-mbql.normalize
metabase.legacy-mbql.predicates
metabase.legacy-mbql.schema
metabase.legacy-mbql.schema.helpers
metabase.legacy-mbql.schema.macros
metabase.legacy-mbql.util
metabase.query-processor.store]}
:deprecated-var
{:exclude
{metabase.legacy-mbql.schema.helpers/is-clause? {:namespaces ["metabase\\.driver.*"]}
metabase.legacy-mbql.schema.helpers/mbql-clause? {:namespaces ["metabase\\.driver.*"]}
metabase.legacy-mbql.util/query->source-table-id {:namespaces ["metabase\\.driver.*"]}
metabase.legacy-mbql.util/aggregation-at-index {:namespaces ["metabase\\.driver.*"]}
metabase.legacy-mbql.util/assoc-field-options {:namespaces ["metabase\\.driver.*"]}
metabase.legacy-mbql.util/expression-with-name {:namespaces ["metabase\\.driver.*"]}
metabase.legacy-mbql.util/field-options {:namespaces ["metabase\\.driver.*"]}
metabase.legacy-mbql.util/negate-filter-clause {:namespaces ["metabase\\.driver.*"]}
metabase.legacy-mbql.util/normalize-token {:namespaces ["metabase\\.driver.*"]}
metabase.legacy-mbql.util/update-field-options {:namespaces ["metabase\\.driver.*"]}}}}}
performance-sensitive
{:linters
{:discouraged-var
{clojure.core/every? {:message "Use metabase.util.performance/every?"}
{clojure.core/empty? {:message "Use metabase.util.performance/empty?"}
clojure.core/not-empty {:message "Use metabase.util.performance/not-empty"}
clojure.core/every? {:message "Use metabase.util.performance/every?"}
clojure.core/mapv {:message "Use metabase.util.performance/mapv"}
clojure.core/run! {:message "Use metabase.util.performance/run!"}
clojure.core/get-in {:message "Use metabase.util.performance/get-in"}
clojure.core/select-keys {:message "Use metabase.util.performance/select-keys"}
clojure.core/some {:message "Use metabase.util.performance/some"}
clojure.core/update-keys {:message "Use metabase.util.performance/update-keys"}
clojure.walk/keywordize-keys {:message "Use metabase.util.performance/keywordize-keys"}
clojure.walk/postwalk {:message "Use metabase.util.performance/postwalk"}
clojure.walk/prewalk {:message "Use metabase.util.performance/prewalk"}
clojure.walk/walk {:message "Use metabase.util.performance/walk"}}}}
clojure.walk/walk {:message "Use metabase.util.performance/walk"}
clojure.walk/for {:message "Use metabase.util.performance/for"}
clojure.walk/doseq {:message "Use metabase.util.performance/doseq"}}}}
qp-and-driver-source-namespaces
{:linters
@@ -865,16 +933,7 @@
metabase.lib.core/->legacy-MBQL {:level :off}}}}
qp-source-namespaces
{:linters
{:discouraged-namespace
{metabase.legacy-mbql.js {:message "Avoid legacy MBQL namespaces in the QP, use Lib instead"}
metabase.legacy-mbql.jvm-util {:message "Avoid legacy MBQL namespaces in the QP, use Lib instead"}
metabase.legacy-mbql.normalize {:message "Avoid legacy MBQL namespaces in the QP, use Lib instead"}
metabase.legacy-mbql.predicates {:message "Avoid legacy MBQL namespaces in the QP, use Lib instead"}
metabase.legacy-mbql.schema {:message "Avoid legacy MBQL namespaces in the QP, use Lib instead"}
metabase.legacy-mbql.schema.helpers {:message "Avoid legacy MBQL namespaces in the QP, use Lib instead"}
metabase.legacy-mbql.schema.macros {:message "Avoid legacy MBQL namespaces in the QP, use Lib instead"}
metabase.legacy-mbql.util {:message "Avoid legacy MBQL namespaces in the QP, use Lib instead"}}}}
{}
general-qp-and-driver-test-namespaces
{:linters

View File

@@ -46,7 +46,7 @@
;; you need to make
{:metabase/modules
{actions
{:team "Workflows"
{:team "Gadget"
:api #{metabase.actions.api
metabase.actions.args
metabase.actions.core
@@ -62,6 +62,7 @@
lib-be
model-persistence
models
parameters
permissions
public-sharing
queries
@@ -118,9 +119,9 @@
metabase.analyze.query-results}
:uses #{config
driver
legacy-mbql
lib
models
query-processor
sync
util}}
@@ -159,7 +160,8 @@
api-routes
{:team "UX West"
:api #{metabase.api-routes.core}
:api #{metabase.api-routes.cmd
metabase.api-routes.core}
:uses :any}
app-db
@@ -248,7 +250,7 @@
;; TODO -- way too many API namespaces.
channel
{:team "Workflows"
{:team "Gadget"
:api #{metabase.channel.api
metabase.channel.core
metabase.channel.email
@@ -317,7 +319,7 @@
app-db
classloader
config
legacy-mbql
models
query-processor
search
@@ -328,6 +330,8 @@
collections
{:team "UX West"
:api #{metabase.collections.api
metabase.collections.core
metabase.collections.init
metabase.collections.models.collection
metabase.collections.models.collection.root}
:uses #{api
@@ -335,19 +339,19 @@
app-db
audit-app
config
driver
eid-translation
events
legacy-mbql
lib-be
models
notification
permissions
premium-features
queries
remote-sync
request
revisions
search
settings
upload
util}}
@@ -366,10 +370,8 @@
content-translation
{:team "UX West"
:api #{metabase.content-translation.api
metabase.content-translation.models}
:uses #{api
premium-features
:api #{metabase.content-translation.models}
:uses #{premium-features
util}}
content-verification
@@ -393,7 +395,8 @@
metabase.dashboards.init
metabase.dashboards.models.dashboard
metabase.dashboards.models.dashboard-card
metabase.dashboards.models.dashboard-tab}
metabase.dashboards.models.dashboard-tab
metabase.dashboards.schema}
:uses #{actions
analytics
api
@@ -433,10 +436,7 @@
:api #{metabase.driver
metabase.driver.common
metabase.driver.common.parameters
metabase.driver.common.parameters.dates
metabase.driver.common.parameters.operators
metabase.driver.common.parameters.parse
metabase.driver.common.parameters.values
metabase.driver.ddl.interface
metabase.driver.h2
metabase.driver.impl
@@ -450,22 +450,34 @@
metabase.driver.sql-jdbc.execute.diagnostic
metabase.driver.sql-jdbc.sync
metabase.driver.sql.query-processor
metabase.driver.sql.query-processor.deprecated
metabase.driver.sql.util
metabase.driver.sync
metabase.driver.util}
:uses #{driver-api
util}}
:uses #{app-db
appearance
auth-provider
classloader
config
driver-api
events
legacy-mbql
lib
lib-be
premium-features
query-processor
settings
system
util
warehouse-schema
warehouses}}
driver-api
{:team "Drivers"
:api #{metabase.driver-api.core
metabase.driver-api.init}
:api #{metabase.driver-api.core}
:uses #{actions
api
app-db
appearance
auth-provider
classloader
config
connection-pool
@@ -484,8 +496,7 @@
system
upload
util
warehouse-schema
warehouses}}
warehouse-schema}}
eid-translation
{:team "UX West"
@@ -507,7 +518,7 @@
:uses #{analytics
api
config
driver
dashboards
eid-translation
events
models
@@ -536,7 +547,6 @@
:uses #{appearance
models
query-processor
system
types
util}}
@@ -550,12 +560,18 @@
util}}
glossary
{:team "Workflows"
{:team "Gadget"
:api #{metabase.glossary.api}
:uses #{api
events
models
util}}
graph
{:team "Querying"
:api #{metabase.graph.core}
:uses #{util}}
indexed-entities
{:team "UX West"
:api #{metabase.indexed-entities.api
@@ -581,11 +597,9 @@
legacy-mbql
{:team "Querying"
:api #{metabase.legacy-mbql.normalize
metabase.legacy-mbql.predicates
metabase.legacy-mbql.schema
metabase.legacy-mbql.util}
:uses #{lib
models
types
util}}
@@ -594,12 +608,15 @@
:api #{metabase.lib.binning
metabase.lib.binning.util
metabase.lib.card
metabase.lib.computed ; temporarily so that `qp.compile` can use it as lib memoization evolves
metabase.lib.convert ; Only so [[metabase.queries.models.card]] can set dynamic vars.
metabase.lib.core
metabase.lib.equality
metabase.lib.field
metabase.lib.field.resolution
metabase.lib.filter
metabase.lib.filter.desugar.jvm ; only so [[metabase.legacy-mbql.jvm-util]] can use defined regexes
metabase.lib.hierarchy
metabase.lib.init
metabase.lib.join.util
metabase.lib.metadata
@@ -609,10 +626,10 @@
metabase.lib.metadata.result-metadata
metabase.lib.normalize
metabase.lib.options
metabase.lib.parse
metabase.lib.query
metabase.lib.schema
metabase.lib.schema.actions
metabase.lib.schema.aggregation
metabase.lib.schema.binning
metabase.lib.schema.common
metabase.lib.schema.constraints
@@ -647,8 +664,7 @@
lib-be
{:team "Querying"
:api #{metabase.lib-be.core
metabase.lib-be.init
metabase.lib-be.metadata.jvm}
metabase.lib-be.init}
:uses #{lib
models
settings
@@ -702,8 +718,7 @@
models
{:team "DevEx"
:api #{metabase.models.dispatch
metabase.models.humanization
:api #{metabase.models.humanization
metabase.models.init
metabase.models.interface
metabase.models.resolution
@@ -715,7 +730,6 @@
classloader
legacy-mbql
lib
lib-be
settings
util}}
@@ -725,6 +739,7 @@
metabase.native-query-snippets.core}
:uses #{api
collections
events
lib
models
permissions
@@ -732,7 +747,7 @@
util}}
notification
{:team "Workflows"
{:team "Gadget"
:api #{metabase.notification.api
metabase.notification.core
metabase.notification.init
@@ -765,6 +780,7 @@
parameters
{:team "Querying"
:api #{metabase.parameters.chain-filter
metabase.parameters.core
metabase.parameters.custom-values
metabase.parameters.dashboard
metabase.parameters.field
@@ -775,13 +791,10 @@
:uses #{api
app-db
classloader
driver
legacy-mbql
lib
lib-be
models
query-processor
types
util
warehouse-schema
warehouses}}
@@ -800,6 +813,7 @@
lib
models
premium-features
remote-sync
request
settings
util
@@ -824,7 +838,8 @@
:api #{metabase.premium-features.api
metabase.premium-features.core
metabase.premium-features.init}
:uses #{api
:uses #{analytics
api
app-db
classloader
config
@@ -841,7 +856,6 @@
app-db
channel
config
driver
premium-features
settings
task
@@ -859,7 +873,6 @@
dashboards
events
lib
lib-be
models
parameters
queries
@@ -870,7 +883,7 @@
util}}
pulse
{:team "Workflows"
{:team "Gadget"
:api #{metabase.pulse.api
metabase.pulse.core
metabase.pulse.init}
@@ -882,6 +895,7 @@
config
driver
events
lib
models
notification
permissions
@@ -894,19 +908,6 @@
enterprise/advanced-permissions
enterprise/sandbox}}
python-runner
{:team "Workflows"
:api #{metabase.python-runner.api
metabase.python-runner.core
metabase.python-runner.init}
:uses #{api
driver
models
query-processor
request
util
enterprise/transforms}}
queries
{:team "Querying"
:api #{metabase.queries.api
@@ -928,7 +929,6 @@
eid-translation
embedding
events
legacy-mbql
lib
lib-be
models
@@ -974,10 +974,10 @@
metabase.query-processor.middleware.annotate
metabase.query-processor.middleware.cache-backend.db
metabase.query-processor.middleware.constraints
metabase.query-processor.middleware.fetch-source-query-legacy
metabase.query-processor.middleware.limit
metabase.query-processor.middleware.permissions
metabase.query-processor.middleware.wrap-value-literals
metabase.query-processor.parameters.dates
metabase.query-processor.parameters.operators
metabase.query-processor.pipeline
metabase.query-processor.pivot
@@ -1006,6 +1006,7 @@
batch-processing
cache
config
dashboards
driver
events
formatter
@@ -1020,14 +1021,20 @@
premium-features
queries
query-permissions
request
server
settings
system
types
users
util}}
remote-sync
{:team "UX West"
:api #{metabase.remote-sync.core
metabase.remote-sync.init}
:uses #{api
models
premium-features}}
request
{:team "UX West"
:api #{metabase.request.core
@@ -1084,12 +1091,14 @@
audit-app
collections
config
driver
events
lib
lib-be
models
permissions
premium-features
queries
query-processor
request
settings
startup
@@ -1104,7 +1113,8 @@
segments
{:team "Querying"
:api #{metabase.segments.api}
:api #{metabase.segments.api
metabase.segments.schema}
:uses #{api
events
legacy-mbql
@@ -1132,12 +1142,14 @@
core
driver
embedding
lib-be
premium-features
query-processor
request
session
settings
system
users
util
enterprise/sso}}
@@ -1152,7 +1164,6 @@
app-db
channel
config
driver
events
login-history
request
@@ -1187,10 +1198,8 @@
api
app-db
appearance
channel
config
events
permissions
request
session
settings
@@ -1237,6 +1246,7 @@
app-db
audit-app
config
database-routing
driver
events
lib
@@ -1296,6 +1306,9 @@
metabase.tiles.init}
:uses #{api
legacy-mbql
lib
lib-be
parameters
query-processor
settings
util}}
@@ -1307,6 +1320,8 @@
:uses #{analytics
api
collections
config
events
models
util}}
@@ -1324,10 +1339,8 @@
:uses #{analytics
api
appearance
collections
driver
events
legacy-mbql
lib
model-persistence
models
@@ -1350,9 +1363,12 @@
users
{:team "UX West"
:api #{metabase.users.api
metabase.users.core
metabase.users.init
metabase.users.models.user
metabase.users.models.user-parameter-value}
metabase.users.models.user-parameter-value
metabase.users.schema
metabase.users.settings}
:uses #{analytics
api
appearance
@@ -1492,18 +1508,19 @@
queries
query-permissions
query-processor
segments
settings
util
warehouse-schema}}
enterprise/action-v2
{:team "Workflows"
{:team "Gadget"
:api #{metabase-enterprise.action-v2.api
metabase-enterprise.action-v2.core
metabase-enterprise.action-v2.init}
:uses #{actions
api
driver
events
lib
models
query-processor
@@ -1534,7 +1551,6 @@
metabase-enterprise.advanced-permissions.common
metabase-enterprise.advanced-permissions.models.permissions.group-manager}
:uses #{api
legacy-mbql
lib
permissions
premium-features
@@ -1556,6 +1572,8 @@
:api #{metabase-enterprise.ai-sql-fixer.api}
:uses #{api
driver
lib
lib-be
query-processor
util
enterprise/metabot-v3}}
@@ -1565,7 +1583,6 @@
:api #{metabase-enterprise.ai-sql-generation.api}
:uses #{api
driver
models
util
enterprise/metabot-v3}}
@@ -1603,6 +1620,8 @@
query-permissions
query-processor
settings
setup
startup
sync
users
util
@@ -1618,7 +1637,14 @@
{:team "UX West"
:api #{metabase-enterprise.billing.api.routes}
:uses #{api
premium-features util}}
premium-features
store-api
util}}
enterprise/bookmarks
{:team "UX West"
:api #{}
:uses #{}}
enterprise/cache
{:team "UX West"
@@ -1635,14 +1661,16 @@
:uses #{api
events
premium-features
store-api
util
enterprise/harbormaster}}
enterprise/comments
{:team "Workflows"
{:team "UX West"
:api #{metabase-enterprise.comments.api
metabase-enterprise.comments.init}
:uses #{api
:uses #{analytics
api
channel
events
models
@@ -1652,8 +1680,7 @@
enterprise/content-translation
{:team "UX West"
:api #{metabase-enterprise.content-translation.dictionary
metabase-enterprise.content-translation.routes}
:api #{metabase-enterprise.content-translation.routes}
:uses #{api
content-translation
embedding
@@ -1675,24 +1702,15 @@
:uses :any}
enterprise/dashboard-subscription-filters
{:team "Workflows"
{:team "Querying"
:api #{}
:uses #{premium-features}}
enterprise/data-editing
{:team "Workflows"
:api #{metabase-enterprise.data-editing.api}
:uses #{actions
api
models
util}}
enterprise/database-replication
{:team "Cloud"
:api #{metabase-enterprise.database-replication.api
metabase-enterprise.database-replication.init}
:uses #{analytics
api
:uses #{api
driver
premium-features
settings
@@ -1716,11 +1734,37 @@
warehouse-schema
warehouses}}
enterprise/dependencies
{:team "Querying"
:api #{metabase-enterprise.dependencies.api
metabase-enterprise.dependencies.core
metabase-enterprise.dependencies.init}
:uses #{analyze
api
collections
driver
events
graph
lib
lib-be
models
native-query-snippets
permissions
premium-features
queries
query-processor
revisions
settings
task
util
enterprise/documents}}
enterprise/documents
{:team "UX West"
:api #{metabase-enterprise.documents.api
metabase-enterprise.documents.core
metabase-enterprise.documents.init}
metabase-enterprise.documents.init
metabase-enterprise.documents.prose-mirror}
:uses #{activity-feed
api
app-db
@@ -1728,13 +1772,13 @@
collections
events
models
permissions
premium-features
public-sharing
queries
query-permissions
query-processor
revisions
search
users
util
view-log}}
@@ -1756,7 +1800,6 @@
audit-app
embedding
premium-features
util
enterprise/sso}}
enterprise/gsheets
@@ -1819,6 +1862,7 @@
metabase-enterprise.metabot-v3.tools.api}
:uses #{api
app-db
audit-app
collections
config
driver
@@ -1826,6 +1870,7 @@
lib
lib-be
models
native-query-snippets
permissions
premium-features
pulse
@@ -1834,6 +1879,7 @@
search
server
settings
store-api
sync
system
task
@@ -1841,7 +1887,10 @@
util
warehouse-schema
warehouses
enterprise/documents}}
enterprise/dependencies
enterprise/documents
enterprise/transforms
enterprise/transforms-python}}
enterprise/permission-debug
{:team "UX West"
@@ -1859,6 +1908,35 @@
:uses #{premium-features
util}}
enterprise/public-sharing
{:team "UX West"
:api #{metabase-enterprise.public-sharing.api}
:uses #{api
events
premium-features
public-sharing
query-processor
util}}
enterprise/remote-sync
{:team "UX West"
:api #{metabase-enterprise.remote-sync.api
metabase-enterprise.remote-sync.core
metabase-enterprise.remote-sync.init}
:uses #{analytics
api
app-db
collections
events
models
premium-features
settings
startup
task
task-history
util
enterprise/serialization}}
enterprise/sandbox
{:team "UX West"
:api #{metabase-enterprise.sandbox.api.routes
@@ -1866,14 +1944,13 @@
:uses #{api
app-db
audit-app
classloader
driver
events
legacy-mbql
lib
models
permissions
premium-features
query-permissions
query-processor
request
users
@@ -1927,9 +2004,10 @@
enterprise/metabot-v3}}
enterprise/serialization
{:team "Workflows"
{:team "Querying"
:api #{metabase-enterprise.serialization.api
metabase-enterprise.serialization.cmd
metabase-enterprise.serialization.core
metabase-enterprise.serialization.v2.backfill-ids}
:uses #{analytics
api
@@ -1937,17 +2015,13 @@
appearance
collections
config
legacy-mbql
lib
logger
models
plugins
premium-features
search
settings
setup
util
warehouse-schema}}
util}}
enterprise/snippet-collections
{:team "Querying"
@@ -1975,7 +2049,6 @@
settings
sso
system
users
util
enterprise/scim}}
@@ -1999,39 +2072,38 @@
metabase-enterprise.transforms.core
metabase-enterprise.transforms.init
metabase-enterprise.transforms.instrumentation
metabase-enterprise.transforms.interface
metabase-enterprise.transforms.util}
:uses #{analytics
api
app-db
config
channel
driver
events
lib
lib-be
models
permissions
premium-features
queries
query-processor
request
revisions
search
settings
sync
task
task-history
upload
util
enterprise/transforms-python}}
util}}
enterprise/transforms-python
{:team "Querying"
:api #{metabase-enterprise.transforms-python.api
metabase-enterprise.transforms-python.execute
metabase-enterprise.transforms-python.init
metabase-enterprise.transforms-python.settings}
:uses #{api
metabase-enterprise.transforms-python.init}
:uses #{analytics
api
app-db
config
driver
models
query-processor
settings
util

View File

@@ -1,16 +0,0 @@
(ns macros.metabase.xrays.domain-entities.malli)
(defmacro define-getters-and-setters [schema & defs]
`(do
(comment ~schema) ;; Reference the schema
~@(for [[sym _path] (partition 2 defs)]
`(do
(defn ~(vary-meta sym
assoc :export true)
"docs" [_x#] nil)
(defn ~(vary-meta (symbol (str "with-" (name sym)))
assoc :export true)
"docs" [x# _new#] x#)
(defn ~(vary-meta (symbol (str (name sym) "-js"))
assoc :export true)
"docs" [x#] x#)))))

View File

@@ -1,7 +1,67 @@
(ns hooks.metabase.api.macros
(:require
[clj-kondo.hooks-api :as api]
[hooks.common]))
[clojure.string :as str]))
(defn- validate-route!
"Make sure the route uses kebab-case rather than snake_case."
[route]
(letfn [(validate-route-string! [route-string]
(when (and (api/string-node? route-string)
(str/includes? (api/sexpr route-string) "_"))
(api/reg-finding! (assoc (meta route-string)
:message "REST API routes and query params should use kebab-case, not snake_case"
:type :metabase/validate-defendpoint-route-uses-kebab-case))))]
(cond
(api/string-node? route)
(validate-route-string! route)
;; otherwise route is a vector like ["/abc/:d/" :d <regex>]
(api/vector-node? route)
(validate-route-string! (first (:children route))))))
(defn- validate-query-params!
"Make sure query params use kebab-case rather than snake_case.
This only works on inline schemas for now. If you define the schema elsewhere then we'd have to implement this
validation in Clojure-land since we can't resolve the schemas in Kondo. It should however still work on complicated
schemas like
[:merge <map-1> <map-2>]"
[query-param-schema-node]
(letfn [(map-schema? [node]
(and (api/vector-node? node)
(when-let [first-child (first (:children node))]
(and (api/keyword-node? first-child)
(= (api/sexpr first-child) :map)))))
(map-schema-keys [{:keys [children], :as _node}]
(let [child-schemas (if (api/map-node? (second children))
(drop 2 children)
(drop 1 children))]
(keep (fn [child-schema]
(when (api/vector-node? child-schema)
(when-let [k (first (:children child-schema))]
(when (api/keyword-node? k)
k))))
child-schemas)))
(validate-map-schema! [form]
;; only warn once per endpoint -- just once on the first bad node
(when-let [bad-node (some (fn [key-node]
(when (str/includes? (str (api/sexpr key-node)) "_")
key-node))
(map-schema-keys form))]
(api/reg-finding! (assoc (meta bad-node)
:message "REST API routes and query params should use kebab-case, not snake_case"
:type :metabase/validate-defendpoint-query-params-use-kebab-case))))
(validate! [node]
(cond
(and (api/vector-node? node)
(map-schema? node))
(validate-map-schema! node)
(api/vector-node? node)
(doseq [child (:children node)]
(validate! child))))]
(validate! query-param-schema-node)))
(defn defendpoint
[arg]
@@ -18,16 +78,21 @@
(cons nil more))
[params & body] more
[bindings schemas] (when (api/vector-node? params)
(loop [bindings [], schemas [], [x y & more] (:children params)]
(loop [bindings [], schemas [], [x y z & more] (:children params)]
(cond
(not x)
[bindings schemas]
(= (api/sexpr x) :-)
(recur bindings (conj schemas y) more)
(and (api/keyword-node? y)
(= (api/sexpr y) :-))
(recur (conj bindings x) (conj schemas z) more)
:else
(recur (conj bindings x) schemas (cons y more)))))]
(recur (conj bindings x) (conj schemas nil) (list* y z more)))))]
(validate-route! route)
(let [[_route-param-schema query-param-schema _body-param-schema] schemas]
(when query-param-schema
(validate-query-params! query-param-schema)))
(-> (api/list-node
(list
(api/token-node 'do)
@@ -54,3 +119,27 @@
body))))
(with-meta (meta node)))))]
(update arg :node update-defendpoint)))
(comment
(defn -defendpoint [form]
(-> {:node (-> form pr-str api/parse-string)}
defendpoint
:node
api/sexpr))
(defn x []
(-defendpoint '(api.macros/defendpoint :get "/:id/syncable_schemas" ; snake_case route should trigger a warning
"Returns a list of all syncable schemas found for the database `id`."
[{:keys [id]} :- [:map
[:id ms/PositiveInt]]
;; snake_case query parameter, should trigger a warning
{:keys [filter_by]} :- [:map
[:filter_by {:optional true} :string]]]
(let [db (get-database id)]
(api/check-403 (or (:is_attached_dwh db)
(and (mi/can-write? db)
(mi/can-read? db))))
(->> db
(driver/syncable-schemas (:engine db))
(vec)
(sort)))))))

View File

@@ -33,18 +33,36 @@
(defclause [ag:var var] field-or-expression FieldOrExpressionDef)
=>
(def ag:var [FieldOrExpressionDef])"
[{:keys [node]}]
(let [[_defclause clause-name-form & arg-specs] (:children node)]
{:node (-> (hooks/list-node
(list
(hooks/token-node 'def)
(unwrap-defclause-clause-name clause-name-form)
(hooks/string-node "Docstring.")
(collect-defclause-body-schemas arg-specs)))
(with-meta (meta node)))}))
[{:keys [node], :as x}]
(let [[_defclause clause-name & arg-specs] (:children node)]
(assoc x :node (-> (hooks/list-node
(list
(hooks/token-node 'do)
(-> (hooks/keyword-node (keyword "metabase.legacy-mbql.schema" (name (hooks/sexpr clause-name))))
(with-meta (meta clause-name))
(hooks/reg-keyword! 'metabase.legacy-mbql.schemas.macros/defclause))
(collect-defclause-body-schemas arg-specs)))
(with-meta (meta node))))))
(defn defclause*
"e.g.
(defclause [ag:var var] field-or-expression FieldOrExpressionDef)
=>
(def ag:var [FieldOrExpressionDef])"
[{:keys [node], :as x}]
(let [[_defclause clause-name schema] (:children node)]
(assoc x :node (-> (hooks/list-node
(list
(hooks/token-node 'do)
(-> (hooks/keyword-node (keyword "metabase.legacy-mbql.schema" (name (hooks/sexpr clause-name))))
(with-meta (meta clause-name))
(hooks/reg-keyword! 'metabase.legacy-mbql.schemas.macros/defclause*))
schema))
(with-meta (meta node))))))
(comment
(defn- defclause* [form]
(defn- expand-defclause [form]
(hooks/sexpr
(:node
(defclause
@@ -55,15 +73,35 @@
form)))}))))
(defn- x []
(defclause* '(defclause [ag:var var]
field-or-expression FieldOrExpressionDef)))
(expand-defclause '(defclause var
field-or-expression FieldOrExpressionDef)))
;; =>
(def ag:var "Docstring." [FieldOrExpressionDef])
(do :metabase.legacy-mbql.schema/var [FieldOrExpressionDef])
(defn- y []
(defclause* '(defclause var
x (some-list-schema)
y (optional FieldOrExpressionDef)
z (rest (some-other-schema)))))
(expand-defclause '(defclause var
x (some-list-schema)
y (optional FieldOrExpressionDef)
z (rest (some-other-schema)))))
;; =>
(def var "Docstring." [(some-list-schema) FieldOrExpressionDef (some-other-schema)]))
(do :metabase.legacy-mbql.schema/var [(some-list-schema) FieldOrExpressionDef (some-other-schema)]))
(defn one-of [{:keys [node], :as x}]
(let [[_one-of & schema-nodes] (:children node)
node' (-> (hooks/vector-node
(mapv (fn [schema-node]
(if (and (hooks/token-node? schema-node)
(simple-symbol? (hooks/sexpr schema-node)))
(-> (hooks/keyword-node (keyword "mteabase.legacy-mbql.schema" (name (hooks/sexpr schema-node))))
(with-meta (meta schema-node)))
schema-node))
schema-nodes))
(with-meta (meta node)))]
(assoc x :node node')))
(comment
(defn- expand-one-of [form]
(hooks/sexpr (:node (one-of {:node (hooks/parse-string (with-out-str (clojure.pprint/pprint form)))}))))
(defn- z []
(expand-one-of '(one-of absolute-datetime relative-datetime time))))

View File

@@ -119,10 +119,10 @@
reset-token-ttl-hours
retired-setting
retry-initial-interval
retry-max-attempts
retry-max-retries
retry-max-interval-millis
retry-multiplier
retry-randomization-factor
retry-jitter-factor
saml-application-name
saml-attribute-email
saml-attribute-firstname

View File

@@ -1,6 +1,6 @@
(ns hooks.metabase.test.util
(:require [clj-kondo.hooks-api :as hooks]
[hooks.common :as common]))
(:require
[clj-kondo.hooks-api :as hooks]))
(defn- namespaced-symbol-node? [node]
(when (hooks/token-node? node)

View File

@@ -1,6 +1,7 @@
(ns hooks.metabase.api.macros-test
(:require
[clj-kondo.hooks-api :as api]
[clj-kondo.impl.utils]
[clojure.test :refer :all]
[hooks.metabase.api.macros]))
@@ -69,3 +70,41 @@
(respond :x)
(catch Throwable e
(raise e))))))))
(defn- defendpoint [form]
(hooks.metabase.api.macros/defendpoint
{:node (-> form pr-str api/parse-string)}))
(defn- defendpoint-warnings
[form]
(binding [clj-kondo.impl.utils/*ctx* {:config {:linters {:metabase/validate-defendpoint-route-uses-kebab-case {:level :warning}
:metabase/validate-defendpoint-query-params-use-kebab-case {:level :warning}}}
:ignores (atom nil)
:findings (atom [])
:namespaces (atom {})}]
(defendpoint form)
@(:findings clj-kondo.impl.utils/*ctx*)))
(deftest ^:parallel validate-route-kebab-case-test
(is (=? [{:message "REST API routes and query params should use kebab-case, not snake_case"
:type :metabase/validate-defendpoint-route-uses-kebab-case
:row pos-int?
:col pos-int?}]
(defendpoint-warnings
'(api.macros/defendpoint :get "/:id/syncable_schemas" ; snake_case route should trigger a warning
"Returns a list of all syncable schemas found for the database `id`."
[{:keys [id]}]
id)))))
(deftest ^:parallel validate-query-params-kebab-case-test
(is (=? [{:message "REST API routes and query params should use kebab-case, not snake_case",
:type :metabase/validate-defendpoint-query-params-use-kebab-case
:row pos-int?
:col pos-int?}]
(defendpoint-warnings
'(api.macros/defendpoint :get "/:id/syncable-schemas"
"Returns a list of all syncable schemas found for the database `id`."
[{:keys [id]}
{:keys [filter_by]} :- [:map
[:filter_by {:optional true} :string]]]
id)))))

View File

@@ -43,9 +43,6 @@
with-meta [[:default]]
;; library stuff. Libraries that specify their own `:style/indent` specs are included in the section after this
;; since it is generated automatically.
clojure.core.logic/fresh [[:block 1]]
clojure.core.logic/matcha [[:block 1]]
clojure.core.logic/run [[:block 2]]
clojure.core.match/match [[:block 1]]
clojure.test.check.properties/for-all [[:block 1]]
clojure.test.check.properties/for-all* [[:block 1]]
@@ -163,8 +160,8 @@
metabase.models.interface/define-batched-hydration-method [[:inner 0]]
metabase.models.interface/define-simple-hydration-method [[:inner 0]]
metabase.parameters.chain-filter-test/with-clean-field-values-for-field [[:block 1]]
metabase.parameters.chain-filter-test/with-fk-field-to-field-remapping [[:block 0]]
metabase.parameters.chain-filter-test/with-human-readable-values-remapping [[:block 0]]
metabase.parameters.chain-filter-test/with-fk-field-to-field-remapping! [[:block 0]]
metabase.parameters.chain-filter-test/with-human-readable-values-remapping! [[:block 0]]
metabase.permissions.core/allow-changing-all-users-group-members [[:block 0]]
metabase.permissions.core/disable-perms-cache [[:block 0]]
metabase.public-sharing.api-test/with-sharing-enabled-and-temp-card-referencing [[:block 3]]
@@ -179,8 +176,8 @@
metabase.queries.api.card-test/with-cards-in-readable-collection [[:block 1]]
metabase.queries.api.card-test/with-cards-in-writeable-collection [[:block 1]]
metabase.queries.api.card-test/with-ordered-items [[:inner 0]]
metabase.queries.api.card-test/with-temp-native-card! [[:block 1]]
metabase.queries.api.card-test/with-temp-native-card-with-params! [[:block 1]]
metabase.queries.api.card-test/with-temp-native-card [[:block 1]]
metabase.queries.api.card-test/with-temp-native-card-with-params [[:block 1]]
metabase.query-processor-test.pipeline-queries-test/pmbql-query [[:block 1]]
metabase.query-processor-test.pipeline-queries-test/run-pmbql-query [[:block 1]]
metabase.query-processor.debug/debug> [[:block 0]]
@@ -232,7 +229,6 @@
metabase.test.data/$ids [[:inner 0]]
metabase.test.data/dataset [[:inner 0]]
metabase.test.data/mbql-query [[:inner 0]]
metabase.test.data/native-query [[:block 0]]
metabase.test.data/query [[:block 1]]
metabase.test.data/run-mbql-query [[:inner 0]]
metabase.test.data/with-empty-h2-app-db! [[:block 0]]
@@ -253,7 +249,6 @@
metabase.test/format-rows-by [[:default]]
metabase.test/let-url [[:block 1]]
metabase.test/mbql-query [[:inner 0]]
metabase.test/native-query [[:block 0]]
metabase.test/query [[:block 1]]
metabase.test/run-mbql-query [[:inner 0]]
metabase.test/test-driver [[:inner 0]]

23
.codespellignore Normal file
View File

@@ -0,0 +1,23 @@
Brite
afterAll
ags
altho
cancelation
cancelations
datas
edn
eduction
hasTables
horizontalX
horizontalY
juxt
methodd
notIn
pass-thru
ser
serieses
sortings
trs
trsn
tru
trun

3
.codespellrc Normal file
View File

@@ -0,0 +1,3 @@
[codespell]
skip = *.csv,*.edn,*.geojson,*.json,*.tsv,*.xml,docs/developers-guide/drivers/driver-tests.md,docs/developers-guide/e2e-tests.md,docs/questions/query-builder/expressions-list.md,docs/questions/visualizations/country-codes.md,e2e/test/scenarios/admin/i18n/content-translation/constants.ts,frontend/src/cljs,frontend/src/metabase/querying/expressions/tokenizer/lezer.js,frontend/src/metabase/static-viz/constants/char-sizes.ts,frontend/src/metabase/visualizations/lib/mapping_codes.ts,modules/drivers/mongo/src/metabase/driver/mongo/operators.clj
ignore-words = .codespellignore

View File

@@ -4,7 +4,6 @@ FROM mcr.microsoft.com/vscode/devcontainers/java:21
RUN ( curl -fsSL https://deb.nodesource.com/setup_22.x | bash ) \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com \
&& apt-get update && apt-get -y install --no-install-recommends nodejs yarn rlwrap fontconfig
# install Clojure

View File

@@ -1,5 +1,4 @@
.babel_cache
docs/*
target/*
.circleci
.cpcache

View File

@@ -118,7 +118,6 @@ module.exports = {
"And",
"When",
"Then",
"describeWithSnowplow",
],
},
],
@@ -136,7 +135,7 @@ module.exports = {
},
env: {
browser: true,
es6: true,
es2020: true,
commonjs: true,
jest: true,
"jest/globals": true,
@@ -203,6 +202,7 @@ module.exports = {
"frontend/src/metabase/admin/**/*",
"frontend/src/metabase/setup/**/*",
"enterprise/frontend/src/metabase-enterprise/whitelabel/**/*",
"enterprise/frontend/src/metabase-enterprise/embedding/**/*",
"frontend/lint/**/*",
"*.stories.*",
"**/.storybook/*",
@@ -347,5 +347,11 @@ module.exports = {
"import/no-commonjs": "off",
},
},
{
files: ["**/*.stories.tsx", "**/preview.tsx"],
rules: {
"import/no-default-export": "off",
},
},
],
};

12
.github/CODEOWNERS vendored
View File

@@ -1,12 +1,12 @@
# Before changing this file, make sure you have read how we use it:
# https://www.notion.so/metabase/Pull-Request-Code-Review-Guide-374f05df889748b69d67af753f9bc9b8?pvs=4#36550c04ceab40b5a8b8bee6264b090c
enterprise/frontend/src/embedding-sdk-package @metabase/embedding
enterprise/frontend/src/embedding-sdk-bundle @metabase/embedding
enterprise/frontend/src/embedding-sdk-shared @metabase/embedding
frontend/src/metabase/embedding-sdk @metabase/embedding
frontend/src/metabase/public/containers/PublicOrEmbeddedQuestion @metabase/embedding
frontend/src/metabase/public/containers/PublicOrEmbeddedDashboard @metabase/embedding
# enterprise/frontend/src/embedding-sdk-package @metabase/embedding
# enterprise/frontend/src/embedding-sdk-bundle @metabase/embedding
# enterprise/frontend/src/embedding-sdk-shared @metabase/embedding
# frontend/src/metabase/embedding-sdk @metabase/embedding
# frontend/src/metabase/public/containers/PublicOrEmbeddedQuestion @metabase/embedding
# frontend/src/metabase/public/containers/PublicOrEmbeddedDashboard @metabase/embedding
frontend/src/metabase/ui @metabase/core-frontend-ux-west
# snowplow/* @metabase/data
src/metabase/analytics/prometheus.clj @metabase/cloud-ops

View File

@@ -0,0 +1,36 @@
name: Cleanup Python Runner
description: Cleanup python-runner services and upload logs as artifacts
inputs:
upload-logs:
description: 'Whether to upload logs (typically on failure)'
required: false
default: 'false'
logs-artifact-suffix:
description: 'The unique name of the .zip artifact containing the logs'
required: false
default: ''
runs:
using: composite
steps:
- name: Cleanup python-runner services
if: always()
run: |
echo "Stopping python-runner services..."
if [ -d "python-runner" ]; then
cd python-runner
make stop || echo "WARNING: Failed to stop python runner"
fi
shell: bash
- name: Upload python-runner logs
if: ${{inputs.upload-logs == 'true' && inputs.logs-artifact-suffix != ''}}
uses: actions/upload-artifact@v4
with:
name: python-runner-logs-${{inputs.logs-artifact-suffix}}
path: |
python-runner.out.log
python-runner.err.log
retention-days: 1
if-no-files-found: warn

View File

@@ -17,8 +17,6 @@ runs:
- name: Prepare backend environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: cross-branch-migrations
- name: Run backend on base branch
run: |

View File

@@ -0,0 +1,37 @@
name: Get cache keys
description: |
Get deterministic cache keys for Maven and Node.js caches based on the centrally controlled cache prefix,
and the suffix based on the runner OS and the current week of the year.
outputs:
m2-cache-key:
description: "The cache key for the Maven cache."
value: ${{ steps.keys-factory.outputs.m2-cache-key }}
node-cache-key:
description: "The cache key for the Node.js cache."
value: ${{ steps.keys-factory.outputs.node-cache-key }}
eslint-cache-key:
description: "The cache key for Eslint cache"
value: ${{ steps.keys-factory.outputs.eslint-cache-key }}
cypress-cache-key:
description: "The cache key for Cypress cache"
value: ${{ steps.keys-factory.outputs.cypress-cache-key }}
runs:
using: "composite"
steps:
- name: Generate and output cache keys
id: keys-factory
run: |
M2_CACHE_PREFIX='M2'
NODE_CACHE_PREFIX='node-modules'
ESLINT_CACHE_PREFIX='eslint'
CYPRESS_CACHE_PREFIX='cypress'
WEEK_OF_YEAR=$(/bin/date "+%G-%V")
CACHE_SUFFIX="${{ runner.os }}-$WEEK_OF_YEAR"
echo "m2-cache-key=$M2_CACHE_PREFIX-$CACHE_SUFFIX" >> $GITHUB_OUTPUT
echo "node-cache-key=$NODE_CACHE_PREFIX-$CACHE_SUFFIX" >> $GITHUB_OUTPUT
echo "eslint-cache-key=$ESLINT_CACHE_PREFIX-$CACHE_SUFFIX" >> $GITHUB_OUTPUT
echo "cypress-cache-key=$CYPRESS_CACHE_PREFIX-$CACHE_SUFFIX" >> $GITHUB_OUTPUT
shell: bash

View File

@@ -0,0 +1,19 @@
name: Maximize disk space
description: Removes unused stuff from GH runner
runs:
using: "composite"
steps:
- name: Maximize build space
shell: bash
run: |
echo "-- Dotnet"
sudo rm -rf /usr/share/dotnet
echo "-- Android"
sudo rm -rf /usr/local/lib/android
echo "-- Haskell"
sudo rm -rf /opt/ghc
echo "-- CodeQL"
sudo rm -rf /opt/hostedtoolcache/CodeQL
df -h

View File

@@ -1,7 +1,7 @@
name: Prepare back-end environment
description: |
Prepare the backend. Installs jdk, Clojure, and fetches the cache for m2. The CI config fetchs `ci-test-config.json`
from master and lets us ignore tests at the var level if they are flaking.
Prepare the backend. Installs jdk, Clojure, and fetches the cache for m2.
The CI config fetches `ci-test-config.json` from master and lets us ignore tests at the var level if they are flaking.
inputs:
java-version:
required: true
@@ -9,10 +9,6 @@ inputs:
clojure-version:
required: true
default: '1.12.0.1488'
m2-cache-key:
description: 'Key to cache M2 packages from Maven Central'
required: true
default: 'm2'
runs:
using: "composite"
@@ -28,21 +24,15 @@ runs:
run: |
curl -O https://download.clojure.org/install/linux-install-${{ inputs.clojure-version }}.sh &&
sudo bash ./linux-install-${{ inputs.clojure-version }}.sh
- name: Fetch CI config
shell: bash
run: |
curl -o ci-test-config.json https://raw.githubusercontent.com/metabase/metabase/refs/heads/master/ci-test-config.json
- name: Check to see if dependencies should be cached
if: ${{ contains(github.event.head_commit.message, '[ci nocache]') }}
run: echo "Commit message includes [ci nocache]; dependencies will NOT be cached"
shell: bash
- name: Get M2 cache
uses: actions/cache@v4
if: ${{ !contains(github.event.head_commit.message, '[ci nocache]') }}
- name: Get M2 cache key
uses: ./.github/actions/get-cache-keys
id: get-cache-keys
- name: Restore M2 cache
uses: actions/cache/restore@v4
with:
path: |
~/.m2
~/.gitlibs
key: ${{ runner.os }}-${{ inputs.m2-cache-key }}-${{ hashFiles('**/deps.edn') }}
restore-keys: |
${{ runner.os }}-${{ inputs.m2-cache-key }}-
key: ${{ steps.get-cache-keys.outputs.m2-cache-key }}

View File

@@ -22,16 +22,16 @@ runs:
chrome-version: 1097615
id: setup-chrome
- name: Check to see if dependencies should be cached
if: ${{ contains(github.event.head_commit.message, '[ci nocache]') }}
run: echo "Commit message includes [ci nocache]; dependencies will NOT be cached"
shell: bash
- name: Get cache keys
uses: ./.github/actions/get-cache-keys
id: get-cache-keys
- name: Get Cypress cache
uses: actions/cache@v4
if: ${{ !contains(github.event.head_commit.message, '[ci nocache]') }}
uses: actions/cache/restore@v4
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-Cypress-${{ hashFiles('**/yarn.lock') }}
key: ${{ steps.get-cache-keys.outputs.cypress-cache-key }}
- name: Ensure that Cypress executable is ready
run: |
yarn cypress install

View File

@@ -3,6 +3,10 @@ inputs:
node-version:
description: "The version of Node.js to use, overriding .nvmrc"
required: false
apply-patches:
description: "Whether to patch frontend dependencies with patch-package."
required: true
default: "true"
runs:
using: "composite"
steps:
@@ -12,26 +16,42 @@ runs:
node-version: ${{ inputs.node-version }} # this overrides, if present
node-version-file: ".nvmrc"
- name: Check to see if dependencies should be cached
if: ${{ contains(github.event.head_commit.message, '[ci nocache]') }}
- name: Get cache keys
uses: ./.github/actions/get-cache-keys
id: get-cache-keys
- name: Restore M2 cache
uses: actions/cache/restore@v4
with:
path: |
~/.m2
~/.gitlibs
key: ${{ steps.get-cache-keys.outputs.m2-cache-key }}
- name: Get yarn cache directory
id: yarn-cache-dir
run: |
echo "Commit message includes [ci nocache]; dependencies will NOT be cached"
yarn cache clean
YARN_CACHE_DIR=$(yarn cache dir)
echo "Yarn cache directory: $YARN_CACHE_DIR"
echo "dir=$YARN_CACHE_DIR" >> $GITHUB_OUTPUT
shell: bash
- name: Get M2 cache
uses: actions/cache@v4
if: ${{ !contains(github.event.head_commit.message, '[ci nocache]') }}
with:
path: ~/.m2
key: ${{ runner.os }}-cljs-${{ hashFiles('**/shadow-cljs.edn') }}
- name: Get node_modules cache
uses: actions/cache@v4
- name: Restore node_modules cache
uses: actions/cache/restore@v4
id: node-modules-cache
if: ${{ !contains(github.event.head_commit.message, '[ci nocache]') }}
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock', '**/patches/*.patch') }}
path: |
${{ steps.yarn-cache-dir.outputs.dir }}
node_modules
key: ${{ steps.get-cache-keys.outputs.node-cache-key }}
- run: yarn install --frozen-lockfile --prefer-offline
# postinstall lifecycle hook can be dangerous in CI so we only run it locally (see package.json)
# If a job wants to patch packages, it does so explicitly in the CI. This setting is opt-out.
# For example, we never want to cache node_modules with patches already applied so cache-generator.yml skips that step.
- name: Clean install
run: yarn install --frozen-lockfile --prefer-offline
shell: bash
- name: Patch frontend dependencies
if: inputs.apply-patches == 'true'
run: yarn patch-package
shell: bash

View File

@@ -1,33 +0,0 @@
name: Run Embedding SDK Storybook
runs:
using: "composite"
steps:
- name: Prepare frontend environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Compile CLJS
run: yarn build-pure:cljs
shell: bash
- name: Build Storybook
run: yarn build-storybook-embedding-sdk
shell: bash
- name: Serve Storybook
run: yarn http-server storybook-static -p 6006 &
shell: bash
- name: Wait for Storybook to become available
run: |
echo "Waiting for Storybook to be served..."
while ! curl --silent --fail http://localhost:6006; do
sleep 5
echo "Retrying..."
done
echo "Storybook is being served!"
shell: bash

View File

@@ -0,0 +1,14 @@
name: Setup Python Runner
description: Setup python-runner for tests
inputs:
metabase-automation-token:
description: Token for accessing the python-runner repository
required: true
runs:
using: composite
steps:
- name: Setup python-runner
run: ./.github/scripts/setup-python-runner.sh
shell: bash
env:
METABASE_AUTOMATION_USER_TOKEN: ${{ inputs.metabase-automation-token }}

View File

@@ -9,29 +9,71 @@ inputs:
build-static-viz:
required: true
default: false
logs-artifact-suffix:
required: false
description: Suffix to append to the test logs artifact name to avoid conflicts in matrix jobs
outputs:
quarantine-skipped:
description: Whether the driver test was skipped due to quarantine
value: ${{ steps.check-driver.outputs.skip }}
runs:
using: "composite"
steps:
- name: Check if driver is ignored
id: check-driver
shell: bash
run: |
# If DRIVERS env var is not set, proceed with tests
if [ -z "$DRIVERS" ]; then
echo "No DRIVERS env var set. Proceeding with tests."
echo "skip=false" >> $GITHUB_OUTPUT
exit 0
fi
# Fetch CI config and check if driver should be skipped
curl -sSf -o ci-test-config.json https://raw.githubusercontent.com/metabase/ci-test-config/refs/heads/master/ci-test-config.json || true
# Check if the driver is in the ignored list (gracefully handle missing/invalid config)
IS_IGNORED=$(jq --arg driver "$DRIVERS" '.ignored.drivers // [] | contains([$driver])' ci-test-config.json 2>/dev/null || echo "false")
if [ "$IS_IGNORED" = "true" ]; then
echo "⚠️ Driver '$DRIVERS' is in the ignored list. Skipping tests."
echo "View the ignored list here: https://github.com/metabase/ci-test-config/blob/master/ci-test-config.json"
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "Driver '$DRIVERS' is not ignored. Proceeding with tests."
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Prepare back-end environment
if: steps.check-driver.outputs.skip != 'true'
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: driver
- name: Prepare front-end environment
if: ${{ steps.check-driver.outputs.skip != 'true' && inputs.build-static-viz == 'true' }}
uses: ./.github/actions/prepare-frontend
if: ${{ inputs.build-static-viz == 'true' }}
- name: Build static viz frontend
if: ${{ steps.check-driver.outputs.skip != 'true' && inputs.build-static-viz == 'true' }}
run: yarn build-static-viz
shell: bash
if: ${{ inputs.build-static-viz == 'true' }}
env:
MB_EDITION: ee
- name: Test database driver
if: steps.check-driver.outputs.skip != 'true'
run: clojure -X:dev:ci:ee:ee-dev:drivers:drivers-dev:test ${{ inputs.test-args }}
shell: bash
id: run-test
# Trunk Quarantine controls the final state of the run in the CI!
# Even if this step fails we let it pass, and then `trunk-io/analytics-uploader` determines
# whether to fail or to pass the whole job, based on the quarantine list.
continue-on-error: true
- name: Publish Test Report (JUnit)
uses: dorny/test-reporter@v1
if: failure()
# As per the documentation: https://docs.github.com/en/actions/reference/workflows-and-actions/contexts#steps-context
# test.outcome gives us access to the result before `continue-on-error` overrides it and sets it to 'success'.
# We want test reports even if the test step gets cancelled (e.g. times out), hence we match anything that is not a 'success'.
if: ${{ steps.run-test.outcome != 'success' && steps.check-driver.outputs.skip != 'true' }}
with:
path: "target/junit/**/*_test.xml"
name: JUnit Test Report ${{ inputs.junit-name }}
@@ -40,9 +82,11 @@ runs:
list-tests: failed
fail-on-error: false
- name: Upload Logs on Failure
if: always() && !success()
if: always() && steps.run-test.outcome != 'success' && steps.check-driver.outputs.skip != 'true'
uses: actions/upload-artifact@v4
with:
name: test-logs-${{ github.job }}
name: ${{ format('test-logs-{0}{1}', github.job, (inputs.logs-artifact-suffix == '' || inputs.logs-artifact-suffix == null) && '' || format('-{0}', inputs.logs-artifact-suffix)) }}
path: logs/test-log.json
retention-days: 1
# Failing to upload the artifact should never affect the outcome of the whole test run.
continue-on-error: true

41
.github/actions/update-cache/action.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Update cache
description: |
Update a GitHub Actions cache based on a provided path and key.
If a cache entry already exists for the given key, it is first removed.
This ensures immutability of cache entries, and prevents runtime errors.
inputs:
path:
description: "The path(s) to cache, separated by newlines."
required: true
key:
description: "The cache key to use."
required: true
runs:
using: "composite"
steps:
- name: Check if the cache entry exists
id: cache-lookup
uses: actions/cache/restore@v4
with:
path: ${{ inputs.path }}
key: ${{ inputs.key }}
lookup-only: true # Important bit: the action will not fetch anything, just check for the cache existence.
- name: Delete the cache entry if it exists
if: ${{ steps.cache-lookup.outputs.cache-hit == 'true' }}
run: |
echo "Cache entry found for key '${{ inputs.key }}'. Deleting it to ensure immutability."
gh api \
--method DELETE \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/actions/caches?key=${{ inputs.key }}
env:
GH_TOKEN: ${{ github.token }}
shell: bash
- name: Save the new cache entry
uses: actions/cache/save@v4
with:
path: ${{ inputs.path }}
key: ${{ inputs.key }}

View File

@@ -20,7 +20,7 @@ inputs:
required: true
variant:
required: false
default: ''
default: ""
runs:
using: "composite"
@@ -48,11 +48,12 @@ runs:
aws s3 cp ${OUTPUT_FILE}.zip s3://$BUCKET/$DATE/$GITHUB_RUN_ID/$GITHUB_RUN_ATTEMPT/
- name: Upload results to Trunk
if: ${{ always() && !(github.event_name == 'pull_request' && github.event.pull_request.draft == true) }}
if: always() # Important! This step must always run because it controls job's exit code.
uses: trunk-io/analytics-uploader@main
with:
junit-paths: ${{ inputs.input-path }}
variant: ${{ inputs.variant || inputs.output-name }}
org-slug: metabase
dry-run: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == true }} # quarantine, but do not upload results
token: ${{ inputs.trunk-api-token }}
continue-on-error: true
use-cache: true

View File

@@ -1,3 +1,5 @@
version: 1
name: "Metabase CodeQL config"
paths-ignore:

View File

@@ -11,15 +11,19 @@ shared_specs: &shared_specs
- "test/**/*.cljc"
- "test/**/*.cljs"
frontend_ci: &frontend_ci
shared_ci: &shared_ci
- ".github/actions/prepare-frontend/**"
- ".github/actions/prepare-backend/**"
- ".github/workflows/frontend.yml"
- ".github/workflows/run-tests.yml"
frontend_embedding_sdk_ci: &frontend_embedding_sdk_ci
- ".github/actions/prepare-frontend/**"
- ".github/actions/prepare-backend/**"
- ".github/workflows/*embedding-sdk*.yml"
shared_e2e: &shared_e2e
- "e2e/runner/**"
- "e2e/snapshot-creators/**"
- "e2e/support/**"
frontend_ci: &frontend_ci
- *shared_ci
- ".github/workflows/frontend.yml"
frontend_configs: &frontend_configs
- "yarn.lock"
@@ -41,14 +45,12 @@ frontend_sources: &frontend_sources
- "enterprise/frontend/!(test)**/**/{!(*.spec),}.{js,jsx,ts,tsx,css}"
- "frontend/!(test)**/**/{!(*.spec),}.{js,jsx,ts,tsx,css}"
# Used only in .github/workflows/conventional-commit-pr-title-reminder.yml
frontend_embedding_sources:
- "enterprise/frontend/src/{embedding,embedding-*}/**/{!(*.spec),}.{js,jsx,ts,tsx,css}"
- "enterprise/frontend/src/metabase-enterprise/{embedding,embedding-*}**/{!(*.spec),}.{js,jsx,ts,tsx,css}"
frontend_embedding_sdk_sources:
- *frontend_configs
- "enterprise/frontend/!(test)**/**/{!(*.spec),}.{js,jsx,ts,tsx,css}"
# Used only in .github/workflows/embedding-sdk-labels-reminder.yml
frontend_embedding_sdk_package_sources:
- "enterprise/frontend/src/embedding-sdk-package/**/!(*.spec).{js,jsx,ts,tsx,css}"
@@ -76,8 +78,7 @@ frontend_loki_ci: &frontend_loki_ci
- ".storybook/**"
backend_ci: &backend_ci
- ".github/actions/prepare-frontend/**"
- ".github/actions/prepare-backend/**"
- *shared_ci
- ".github/actions/test-driver/**"
- ".github/workflows/backend.yml"
- ".github/workflows/drivers.yml"
@@ -117,9 +118,9 @@ sources: &sources
- *backend_sources
e2e_ci: &e2e_ci
- ".github/actions/prepare-frontend/**"
- ".github/actions/prepare-backend/**"
- *shared_ci
- ".github/actions/prepare-uberjar-artifact/**"
- ".github/actions/fetch-artifact/action.yml"
- ".github/actions/e2e-prepare-containers/**"
- ".github/actions/prepare-cypress/**"
- ".github/workflows/e2e-*"
@@ -127,22 +128,27 @@ e2e_ci: &e2e_ci
e2e_specs: &e2e_specs
- e2e/!(test-host-app)**/*.cy.*.{js,ts}
e2e_cross_version: &e2e_cross_version
- ".github/workflows/e2e-cross-version.yml"
- "e2e/test/scenarios/cross-version/**"
embedding_sdk_ci: &embedding_sdk_ci
- *shared_ci
- ".github/actions/prepare-uberjar-artifact/**"
- ".github/actions/fetch-artifact/action.yml"
- ".github/actions/prepare-cypress/**"
- ".github/workflows/embedding-sdk*.yml"
e2e_embedding_sdk:
- *frontend_embedding_sdk_ci
- *sources
- "e2e/component/**/*.cy.*.{js,ts}"
e2e_embedding_sdk_compatibility:
embedding_sdk_components:
- *default
- *frontend_embedding_sdk_ci
- *embedding_sdk_ci
- *sources
- *shared_e2e
- "e2e/test-component/**/*.cy.*.{js,jsx,ts,tsx}"
embedding_sdk_host_sample_apps:
- *default
- *embedding_sdk_ci
- *frontend_sources
- *backend_sources
- *shared_e2e
- "e2e/embedding-sdk-host-apps/**"
- "e2e/runner/embedding-sdk/**"
- "e2e/test-host-app/**/*.cy.*.{js,ts}"
snowplow: &snowplow
@@ -170,6 +176,7 @@ yaml:
- "**/*.yaml"
codeql:
- ".github/workflows/codeql.yml"
- "frontend/src/**"
- "enterprise/frontend/src/**"

View File

@@ -21,7 +21,6 @@ const collectAndAverageTimings = async ({
const timingData = await downloadAndExtractArtifacts(
artifacts,
token,
github,
context,
);

View File

@@ -3,14 +3,8 @@
// grouping some specific tests together, other tests are split into chunks
const DEFAULT_SPEC_PATTERN = "./e2e/test/scenarios/**/*.cy.spec.*";
const EMBEDDING_SDK_SPEC_PATTERN =
"./e2e/test/scenarios/embedding-sdk/**.cy.spec.*";
const specialTestConfigs = [
{
name: "embedding-sdk",
specs: EMBEDDING_SDK_SPEC_PATTERN,
},
{
name: "oss-subset",
edition: "oss",
@@ -18,6 +12,7 @@ const specialTestConfigs = [
specs: DEFAULT_SPEC_PATTERN,
},
{ name: "mongo", tags: "@mongo", specs: DEFAULT_SPEC_PATTERN },
{ name: "python", tags: "@python", specs: DEFAULT_SPEC_PATTERN },
];
/**

View File

@@ -21,10 +21,10 @@ describe("buildMatrix", () => {
});
it("should apply default specs path when empty entry is provided", () => {
const result = testBuildMatrix("", 5);
const result = testBuildMatrix("", 6);
expect(result.regularChunks).toBe(2);
expect(result.config.length).toBe(5);
expect(result.regularChunks).toBe(3);
expect(result.config.length).toBe(6);
});
it("should name regular test groups sequentially", () => {
@@ -43,9 +43,9 @@ describe("buildMatrix", () => {
expect(result.regularChunks).toBe(0);
expect(result.config.length).toBe(3);
expect(result.config[0].name).toBe("embedding-sdk");
expect(result.config[1].name).toBe("oss-subset");
expect(result.config[2].name).toBe("mongo");
expect(result.config[0].name).toBe("oss-subset");
expect(result.config[1].name).toBe("mongo");
expect(result.config[2].name).toBe("python");
});
it("should correctly calculate regularChunks for non-default spec pattern", () => {
@@ -83,9 +83,9 @@ describe("buildMatrix", () => {
it("should return special test configs when default spec pattern is provided", () => {
const result = testBuildMatrix("./e2e/test/scenarios/**/*.cy.spec.*", 50);
expect(result.config[47].name).toBe("embedding-sdk");
expect(result.config[48].name).toBe("oss-subset");
expect(result.config[49].name).toBe("mongo");
expect(result.config[47].name).toBe("oss-subset");
expect(result.config[48].name).toBe("mongo");
expect(result.config[49].name).toBe("python");
});
it("should not return special test configs when non-default spec pattern is provided", () => {

View File

@@ -24,6 +24,7 @@ git clone --depth 1 https://${METABASE_AUTOMATION_USER_TOKEN}@github.com/metabas
if [ "$SKIP_START" = false ]; then
echo "Starting python-runner..."
cd python-runner
make run-ci
make run-ci 1> ../python-runner.out.log 2> ../python-runner.err.log
make logs 1>> ../python-runner.out.log 2>> ../python-runner.err.log &
cd ..
fi

49
.github/team.json vendored
View File

@@ -32,20 +32,6 @@
"lorem--ipsum"
]
},
{
"name": "Workflows",
"label": ".Team/Workflows",
"members": [
"qnkhuat",
"piranha",
"crisptrutski",
"spalt08",
"stasgavrylov",
"uladzimirdev",
"kulyk",
"kamilmielnik"
]
},
{
"name": "Admin Webapp",
"label": ".Team/AdminWebapp",
@@ -58,7 +44,10 @@
"label": ".Team/DevEx",
"members": [
"camsaul",
"escherize"
"dpsutton",
"escherize",
"fraserdrops",
"nemanjaglumac"
]
},
{
@@ -70,19 +59,10 @@
"retro",
"sloansparger",
"somtom",
"wotbrew",
"tsplude",
"lbrdnk",
"bronsa"
]
},
{
"name": "Product Growth",
"label": ".Team/ProductGrowth",
"members": [
"nemanjaglumac",
"chodorowicz",
"andsalves"
"piranha",
"crisptrutski"
]
},
{
@@ -111,7 +91,22 @@
"edpaget",
"deniskaber",
"alxnddr",
"bpander"
"bpander",
"andsalves"
]
},
{
"name": "Gadget",
"label": ".Team/Gadget",
"members": [
"nmezzopera",
"bronsa",
"wotbrew",
"qnkhuat",
"chodorowicz",
"kamilmielnik",
"stasgavrylov",
"uladzimirdev"
]
}
]

View File

@@ -255,12 +255,6 @@ jobs:
env:
enable-ssl-tests: 'true'
job:
- name: Driver Tests
build-static-viz: false
test-args: >-
:only-tags [:mb/driver-tests]
:exclude-tags [:mb/transforms-python-test]
exclude-tag: ':mb/transforms-python-test'
- name: Enterprise Tests
build-static-viz: false
test-args: >-

View File

@@ -23,7 +23,7 @@ jobs:
uses: actions/github-script@v7
with:
github-token: ${{ steps.generate-token.outputs.token }}
script: |
script: | #js
const fs = require('fs');
const teamConfig = JSON.parse(fs.readFileSync('.github/team.json', 'utf-8'));
const prAuthor = context.payload.pull_request.user.login;
@@ -65,10 +65,3 @@ jobs:
issue_number: prNumber,
labels: [team.label]
});
return team.projectUrl || null;
- uses: actions/add-to-project@v0.5.0
if: ${{ steps.auto-assign.outputs.result != 'null' }}
with:
project-url: ${{ steps.auto-assign.outputs.result }}
github-token: ${{ steps.generate-token.outputs.token }}

View File

@@ -15,8 +15,6 @@ jobs:
- uses: actions/checkout@v4
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cloverage"
- name: Build static viz frontend
run: yarn build-static-viz
env:

View File

@@ -21,8 +21,6 @@ jobs:
- uses: actions/checkout@v4
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'kondo'
- name: Run clj-kondo
run: ./bin/mage kondo
@@ -35,8 +33,6 @@ jobs:
- uses: actions/checkout@v4
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "eastwood"
- run: clojure -X:dev:ee:ee-dev:drivers:drivers-dev:test:eastwood
name: Run Eastwood linter
@@ -51,33 +47,33 @@ jobs:
job:
- name: Enterprise Tests
edition: ee
build-static-viz: 'false'
test-group-name: ee
test-args: >-
:only '"enterprise/backend/test"'
- name: EE App DB Tests (Part 1)
edition: ee
build-static-viz: 'true'
test-group-name: ee-app-db-1
test-args: >-
:only '["test" ".clj-kondo/test"]'
:partition/total 2
:partition/index 0
- name: EE App DB Tests (Part 2)
edition: ee
build-static-viz: 'true'
test-group-name: ee-app-db-2
test-args: >-
:only '["test" ".clj-kondo/test"]'
:partition/total 2
:partition/index 1
- name: OSS App DB Tests (Part 1)
edition: oss
build-static-viz: 'true'
test-group-name: oss-app-db-1
test-args: >-
:only '["test" ".clj-kondo/test"]'
:partition/total 2
:partition/index 0
- name: OSS App DB Tests (Part 2)
edition: oss
build-static-viz: 'true'
test-group-name: oss-app-db-2
test-args: >-
:only '["test" ".clj-kondo/test"]'
:partition/total 2
@@ -102,26 +98,15 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
if: ${{ matrix.job.build-static-viz == 'true' }}
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: be-tests
java-version: "${{ matrix.java-version }}"
# Depending on which files changed, we might either have to build static-viz
# from scratch or download the previously built artifact
- name: Build static-viz frontend
if: ${{ matrix.job.build-static-viz == 'true' && !inputs.skip }}
run: yarn build-static-viz
env:
MB_EDITION: ${{ matrix.job.edition }}
- name: Download Static Viz Bundle Artifact
if: ${{ matrix.job.build-static-viz == 'true' && !inputs.skip }}
uses: actions/download-artifact@v4
with:
name: static-viz-bundle-${{ github.sha }}
path: resources/frontend_client/app/dist
- name: "Test Java ${{ matrix.java-version }} ${{ matrix.job.name }}"
id: run-java-tests
@@ -129,6 +114,10 @@ jobs:
clojure -X:dev:ci:test:${{ matrix.job.edition }}:${{ matrix.job.edition }}-dev
:exclude-tags '[:mb/driver-tests ${{ env.__ADDITIONAL_EXCLUDED_TAG__ }}]'
${{ matrix.job.test-args }}
# Trunk Quarantine controls the final state of the run in the CI!
# Even if this step fails we let it pass, and then `trunk-io/analytics-uploader` determines
# whether to fail or to pass the whole job, based on the quarantine list.
continue-on-error: true
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
@@ -157,7 +146,7 @@ jobs:
if: always() && !success()
uses: actions/upload-artifact@v4
with:
name: test-logs-${{ matrix.java-version }}-${{ matrix.job.edition }}-${{ github.job }}
name: test-logs-${{ matrix.java-version }}-${{ matrix.job.edition }}-${{ github.job }}-${{ matrix.job.test-group-name }}
path: logs/test-log.json
retention-days: 1
@@ -175,8 +164,6 @@ jobs:
- uses: actions/checkout@v4
- name: Prepare backend
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: be-check
# TODO -- we should probably also check WITHOUT ee -- do a check with only OSS namespaces on the classpath
- name: Check namespaces
run: clojure -M:ee:drivers:check
@@ -190,8 +177,6 @@ jobs:
- uses: actions/checkout@v4
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'cljfmt'
- name: Run cljfmt
run: ./bin/mage cljfmt-all --force-check

View File

@@ -1,52 +0,0 @@
name: Bugs Slack Notification
on:
issues:
types:
- labeled
jobs:
on-issue-labeled:
runs-on: ubuntu-22.04
timeout-minutes: 5
if: |
github.event.label.name == '.Needs Triage' && contains(github.event.issue.labels.*.name, 'Type:Bug')
steps:
- name: Setting title
uses: actions/github-script@v7
id: vars
with:
script: |
core.setOutput('issue_title', ${{ toJson(github.event.issue.title) }}.replaceAll(/"/g, '\\"'));
- name: Check for labels containing team name
id: check_labels
run: |
labels_json=$(sed 's/&/\$/g' <<< '${{ toJson(github.event.issue.labels) }}')
echo "has_team_label=false" >> "$GITHUB_OUTPUT"
for label in "$labels_json"
do
if [[ $label == *".Team"* ]]; then
echo "Label contains the team name."
echo "has_team_label=true" >> "$GITHUB_OUTPUT"
break
fi
done
- name: Send the issue ${{ github.event.issue.number }} to Slack
id: slack
if: steps.check_labels.outputs.has_team_label == 'false'
uses: slackapi/slack-github-action@v1.26.0
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ steps.vars.outputs.issue_title }}\n${{ github.event.issue.html_url }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BUG_TRIAGE_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

View File

@@ -16,8 +16,6 @@ jobs:
- name: Prepare back-end environment
timeout-minutes: 5
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'build-scripts'
- name: Run build and release script tests
run: clojure -X:dev:drivers:build:build-dev:build-test:ci

132
.github/workflows/cache-generator.yml vendored Normal file
View File

@@ -0,0 +1,132 @@
# This workflow is the single source of truth for generating and updating various caches used by our CI pipeline.
# It sets the fresh cache each Monday but provides a manual trigger to update it on-demand.
#
# All other jobs only restore from this cache; *they never update it*!
# They should always use `actions/cache/restore@v4` because `actions/cache@v4` would attempt to save the cache.
#
# Our agreed-upon strategy is to use a deterministic cache key based on the week of the year.
# Jobs can utilize the prior week's cache if the current week's cache is not found.
#
#
# PRINCIPLES:
# - The cache is never wrong!
# - Caches are immutable once created.
# - Caches are for speeding up builds, not for correctness.
# - It is faster to download a large cache than to re-resolve missing dependencies.
#
#
# DESIGN:
#
# 1. Prepare
# - A job first prepares the local environment (e.g., installs JDK, Clojure, Node.js, etc.)
# - This fetches the dependencies from the cache (if it exists) and warms up the local cache for this workflow.
# 2. Resolve
# - The next step pre-resolves all dependencies, ensuring that the local cache is fully populated and up-to-date.
# 3. Update
# - The final step saves the local cache back to GitHub Actions cache with a deterministic key.
# - If a cache entry already exists for that key, it is deleted first to ensure immutability.
#
name: Cache Generator
on:
schedule:
- cron: "0 3 * * 1" # Mondays at 03:00 UTC
workflow_dispatch: # manually update the cache
concurrency:
group: cache-generator
cancel-in-progress: true
jobs:
get-cache-keys:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Get cache keys
uses: ./.github/actions/get-cache-keys
id: get-cache-keys
outputs:
m2-cache-key: ${{ steps.get-cache-keys.outputs.m2-cache-key }}
node-cache-key: ${{ steps.get-cache-keys.outputs.node-cache-key }}
eslint-cache-key: ${{ steps.get-cache-keys.outputs.eslint-cache-key }}
cypress-cache-key: ${{ steps.get-cache-keys.outputs.cypress-cache-key }}
generate-m2-cache:
runs-on: ubuntu-22.04
timeout-minutes: 15
needs: get-cache-keys
env:
M2_CACHE_KEY: ${{ needs.get-cache-keys.outputs.m2-cache-key }}
steps:
- uses: actions/checkout@v4
- name: Prepare backend
uses: ./.github/actions/prepare-backend
# Add or remove aliases to affect the cache size and its contents.
# Adjust to taste, then redeploy this workflow.
- name: Pre-resolve Clojure dependencies
run: clojure -A:build:dev:ee:ee-dev:drivers:drivers-dev:cljs -P
- name: Update M2 cache
uses: ./.github/actions/update-cache
with:
path: |
~/.m2
~/.gitlibs
key: ${{ env.M2_CACHE_KEY }}
generate-frontend-caches:
runs-on: ubuntu-22.04
timeout-minutes: 15
needs: get-cache-keys
env:
NODE_CACHE_KEY: ${{ needs.get-cache-keys.outputs.node-cache-key }}
ESLINT_CACHE_KEY: ${{ needs.get-cache-keys.outputs.eslint-cache-key }}
CYPRESS_CACHE_KEY: ${{ needs.get-cache-keys.outputs.cypress-cache-key }}
steps:
- uses: actions/checkout@v4
# `prepare-frontend` action (1) prepares Node.js and (2) fetches the node_modules cache if it exists.
# It then (3) runs `yarn install --frozen-lockfile --prefer-offline` which ensures the local cache is fully populated.
# IMPORTANT: Caching node_modules after patches are already applied will break any PR that attempts to either:
# - upgrade a patched library
# - change a patch
# Hence why we explicitly exclude patches from the cache (controlled by the `apply-patches` action input).
- name: Install front-end dependencies
uses: ./.github/actions/prepare-frontend
with:
apply-patches: "false"
- name: Get yarn cache directory
id: yarn-cache-dir
run: |
YARN_CACHE_DIR=$(yarn cache dir)
echo "Yarn cache directory: $YARN_CACHE_DIR"
echo "dir=$YARN_CACHE_DIR" >> $GITHUB_OUTPUT
- name: Ensure that Cypress executable is ready
run: |
yarn cypress install
yarn cypress cache path
yarn cypress cache list
yarn cypress verify
shell: bash
- name: Update node_modules cache
uses: ./.github/actions/update-cache
with:
path: |
${{ steps.yarn-cache-dir.outputs.dir }}
node_modules
key: ${{ env.NODE_CACHE_KEY }}
- name: Update eslint cache
uses: ./.github/actions/update-cache
with:
path: ${{ github.workspace}}/.eslintcache
key: ${{ env.ESLINT_CACHE_KEY }}
- name: Update Cypress cache
uses: ./.github/actions/update-cache
with:
path: ~/.cache/Cypress
key: ${{ env.CYPRESS_CACHE_KEY }}

View File

@@ -40,8 +40,6 @@ jobs:
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Compile CLJS
run: NODE_ENV=development yarn build-pure:cljs
- name: Publish to Chromatic

View File

@@ -0,0 +1,101 @@
name: "Claude Code Review"
on:
pull_request:
types:
- closed
- synchronize
- labeled
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}-claude-code-review
cancel-in-progress: true
jobs:
review:
if: |
(
github.event.action == 'closed' &&
github.event.pull_request.merged == true
) ||
contains(github.event.pull_request.labels.*.name, 'Claude Code Review')
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
persist-credentials: false
# Apparently comments on specific lines and top-level comments about the PR as a whole are TWO TOTALLY DIFFERENT
# TYPES OF THINGS. So we have to fetch and delete separately.
- name: Delete old Claude PR review comments
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
shell: bash
run: |
# Get old comment IDs from the bot
old_line_comment_ids=$(gh api "/repos/$REPO/pulls/$PR_NUMBER/comments" --jq '.[] | select(.user.login=="metabase-bot[bot]") | .id')
echo "Deleting line comments: $old_line_comment_ids"
# Delete each comment
for id in $old_line_comment_ids; do
gh api -X DELETE "/repos/$REPO/pulls/comments/$id"
echo "Deleted line comment $id"
done
# Get old top-level comment IDs (technically "issue" comments on the PR?)
old_top_level_comment_ids=$(gh api "/repos/$REPO/issues/$PR_NUMBER/comments" --jq '.[] | select(.user.login=="metabase-bot[bot]") | .id')
echo "Deleting top-level comments: $old_top_level_comment_ids"
# Delete each comment
for id in $old_top_level_comment_ids; do
gh api -X DELETE "/repos/$REPO/issues/comments/$id"
echo "Deleted top-level comment $id"
done
- name: Generate GitHub App Token for Claude
uses: actions/create-github-app-token@v1
id: claude-app-token
with:
app-id: ${{ secrets.METABASE_BOT_APP_ID }}
private-key: ${{ secrets.METABASE_BOT_APP_PRIVATE_KEY }}
permission-contents: read # Required for reading repository files and PR diffs
permission-pull-requests: write # Required for creating inline comments and PR comments
- name: Fetch Community Clojure Style Guide
run: >-
curl https://raw.githubusercontent.com/bbatsov/clojure-style-guide/refs/heads/master/README.adoc -o CLOJURE_STYLE_GUIDE.adoc
- uses: anthropics/claude-code-action@v1
timeout-minutes: 10
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
github_token: ${{ steps.claude-app-token.outputs.token }}
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}
Review this pull request with a focus on:
- Compliance with project coding standards and conventions
- Code quality and best practices
- Clear and correct docstrings
- Clear and correct comments explaining what the code is doing
DO NOT post any comments confirming that something is correct or congratulating someone for following our
guidelines -- only post comments for style violations or concerns.
Follow additional guidelines in the "Code Review Guidelines" section of CLAUDE.md .
Note: The PR branch is already checked out in the current working directory.
Use `gh pr comment` for top-level feedback.
Use `mcp__github_inline_comment__create_inline_comment` to highlight specific code issues.
Only post GitHub comments - don't submit review text as messages.
claude_args: |
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),ReadFile(CLOJURE_STYLE_GUIDE.adoc)"

View File

@@ -38,7 +38,5 @@ jobs:
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'cljs'
- name: Run Cljs tests
run: yarn run test-cljs

View File

@@ -30,9 +30,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v4
with:
languages: javascript
config-file: ./.github/codeql/codeql-config.yml
trap-caching: false
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v4

19
.github/workflows/codespell.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: Codespell
on:
push:
branches:
- 'master'
- 'release-**'
pull_request:
jobs:
codespell:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: codespell-project/actions-codespell@v1
with:
# keep this list in sync with the list in `mage/src/mage/codespell.yml`
path: >-
docs

View File

@@ -1,25 +1,28 @@
name: Test coverage
name: Frontend Test Coverage
on:
workflow_dispatch:
schedule:
- cron: '40 1 * * *' # every day at 1:40
jobs:
fe-test-coverage:
runs-on: ubuntu-22.04
timeout-minutes: 30
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Run frontend unit tests
run: yarn run test-unit --silent --coverage
run: |
yarn run test-unit \
--silent \
--coverage \
--testTimeout=60000
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: ./coverage/lcov.info
flags: front-end

View File

@@ -9,10 +9,6 @@ on:
description: "The branch to check out and create a PR against"
required: true
type: string
m2_cache_key_suffix:
description: "A unique suffix for the Maven cache key"
required: true
type: string
secrets:
automation_token:
description: "A token with permissions to create branches and PRs"
@@ -37,8 +33,6 @@ jobs:
- name: Prepare backend environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "auto-update-docs-${{ inputs.m2_cache_key_suffix }}"
- name: Generate environment variables documentation
id: generate_env_docs

View File

@@ -11,6 +11,5 @@ jobs:
uses: ./.github/workflows/docs-generate-base.yml
with:
target_branch: "master"
m2_cache_key_suffix: "master"
secrets:
automation_token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}

View File

@@ -11,6 +11,5 @@ jobs:
uses: ./.github/workflows/docs-generate-base.yml
with:
target_branch: "release-x.56.x"
m2_cache_key_suffix: "release"
secrets:
automation_token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}

View File

@@ -1,44 +0,0 @@
name: Docs Bump Detected
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
branches:
- 'master'
- 'release-x.[0-9]+.x'
paths:
- 'docs/**'
jobs:
push_workflow_to_docs_metabase_github_io_job:
runs-on: ubuntu-latest
env:
SOURCE_BRANCH: ${{ github.head_ref || github.ref }}
TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}
PR_NUMBER: ${{ github.event.pull_request.number }}
steps:
- name: Report changed docs files exist
run: |
echo "A PR with changes in the docs directory was detected."
echo "Sending workflow trigger to create/update the corresponding PR in docs repo."
echo "source branch: $SOURCE_BRANCH"
echo "target branch: $TARGET_BRANCH"
echo "pr number: $PR_NUMBER"
- name: Trigger repo dispatch
uses: actions/github-script@v7
with:
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
script: | #js
github.rest.repos.createDispatchEvent({
owner: "${{ github.repository_owner }}",
repo: "docs.metabase.github.io",
event_type: "docs_update",
client_payload: {
dispatch_type: "docs_update",
source_branch: process.env.SOURCE_BRANCH,
target_branch: process.env.TARGET_BRANCH,
pr_number: process.env.PR_NUMBER}});

View File

@@ -1,43 +0,0 @@
name: Docs Close Detected
on:
pull_request:
types:
- closed
branches:
- 'master'
- 'release-x.[0-9]+.x'
paths:
- 'docs/**'
jobs:
push_and_merge_workflow_to_docs_metabase_github_io_job:
if: github.event.pull_request.merged == false
runs-on: ubuntu-latest
env:
SOURCE_BRANCH: ${{ github.head_ref || github.ref }}
TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}
PR_NUMBER: ${{ github.event.pull_request.number }}
steps:
- name: Report changed docs files exist
run: |
echo "A PR with changes to the docs directory was closed."
echo "Sending workflow trigger to close corresponding PR in docs repo."
echo "source branch: $SOURCE_BRANCH"
echo "target branch: $TARGET_BRANCH"
echo "pr number: $PR_NUMBER"
- name: Trigger repo dispatch
uses: actions/github-script@v7
with:
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
script: | #js
github.rest.repos.createDispatchEvent({
owner: "${{ github.repository_owner }}",
repo: "docs.metabase.github.io",
event_type: "docs_close",
client_payload: {
dispatch_type: "docs_close",
source_branch: process.env.SOURCE_BRANCH,
target_branch: process.env.TARGET_BRANCH,
pr_number: process.env.PR_NUMBER}});

View File

@@ -1,43 +0,0 @@
name: Docs Merge Detected
on:
pull_request:
types:
- closed
branches:
- 'master'
- 'release-x.[0-9]+.x'
paths:
- 'docs/**'
jobs:
push_and_merge_workflow_to_docs_metabase_github_io_job:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
env:
SOURCE_BRANCH: ${{ github.head_ref || github.ref }}
TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}
PR_NUMBER: ${{ github.event.pull_request.number }}
steps:
- name: Report changed docs files exist
run: |
echo "A PR with changes to the docs directory was merged."
echo "Sending workflow trigger to merge corresponding PR in docs repo."
echo "source branch: $SOURCE_BRANCH"
echo "target branch: $TARGET_BRANCH"
echo "pr number: $PR_NUMBER"
- name: Trigger repo dispatch
uses: actions/github-script@v7
with:
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
script: | #js
github.rest.repos.createDispatchEvent({
owner: "${{ github.repository_owner }}",
repo: "docs.metabase.github.io",
event_type: "docs_merge",
client_payload: {
dispatch_type: "docs_merge",
source_branch: process.env.SOURCE_BRANCH,
target_branch: process.env.TARGET_BRANCH,
pr_number: process.env.PR_NUMBER}});

View File

@@ -85,6 +85,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test Athena driver
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-athena-ee'
@@ -93,7 +94,7 @@ jobs:
:exclude-tags [:mb/transforms-python-test]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -135,17 +136,19 @@ jobs:
- uses: actions/checkout@v4
- name: Setup python-runner
if: ${{ matrix.job.needs-python-runner == true }}
env:
METABASE_AUTOMATION_USER_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
run: ./.github/scripts/setup-python-runner.sh
uses: ./.github/actions/setup-python-runner
with:
metabase-automation-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Test BigQuery Cloud SDK driver
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-bigquery-cloud-sdk-ee'
test-args: ${{ matrix.job.test-args }}
logs-artifact-suffix: ${{ matrix.job.name }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -154,6 +157,12 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: Cleanup python-runner
if: ${{ always() && matrix.job.needs-python-runner == true }}
uses: ./.github/actions/cleanup-python-runner
with:
upload-logs: ${{ steps.test-driver.outcome == 'failure' }}
logs-artifact-suffix: ${{ matrix.job.name }} ${{ matrix.version.name }}
be-tests-clickhouse-ee:
if: ${{ !inputs.skip }}
@@ -183,9 +192,9 @@ jobs:
- uses: actions/checkout@v4
- name: Setup python-runner
if: ${{ matrix.job.needs-python-runner == true }}
env:
METABASE_AUTOMATION_USER_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
run: ./.github/scripts/setup-python-runner.sh
uses: ./.github/actions/setup-python-runner
with:
metabase-automation-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Add ClickHouse TLS instance to /etc/hosts
run: |
sudo echo "127.0.0.1 server.clickhouseconnect.test" | sudo tee -a /etc/hosts
@@ -202,13 +211,15 @@ jobs:
clickhouse_cluster_node2
nginx
- name: Test Clickhouse driver
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-clickhouse-ee'
test-args: ${{ matrix.job.test-args }}
logs-artifact-suffix: ${{ matrix.job.name }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -217,6 +228,12 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: Cleanup python-runner
if: ${{ always() && matrix.job.needs-python-runner == true }}
uses: ./.github/actions/cleanup-python-runner
with:
upload-logs: ${{ steps.test-driver.outcome == 'failure' }}
logs-artifact-suffix: ${{ matrix.job.name }} ${{ matrix.version.name }}
be-tests-druid-ee:
needs: determine-driver-skips
@@ -237,6 +254,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test Druid driver
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-druid-ee'
@@ -245,7 +263,7 @@ jobs:
:exclude-tags [:mb/transforms-python-test]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -274,6 +292,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test Druid JDBC driver
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-druid-jdbc-ee'
@@ -282,7 +301,7 @@ jobs:
:exclude-tags [:mb/transforms-python-test]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -311,6 +330,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test Databricks driver
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-databricks-ee'
@@ -319,7 +339,7 @@ jobs:
:exclude-tags [:mb/transforms-python-test]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -349,6 +369,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test Databricks driver with multi-catalog
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-databricks-multi-catalog-ee'
@@ -357,7 +378,7 @@ jobs:
:exclude-tags [:mb/transforms-python-test]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -376,11 +397,8 @@ jobs:
name: H2
steps:
- uses: actions/checkout@v4
- name: Setup python-runner
env:
METABASE_AUTOMATION_USER_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
run: ./.github/scripts/setup-python-runner.sh
- name: Test H2 driver
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-h2'
@@ -389,7 +407,7 @@ jobs:
:exclude-tags [:mb/transforms-python-test]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -431,7 +449,7 @@ jobs:
- name: Driver Tests
test-args: >-
:only-tags [:mb/driver-tests]
:exclude-tags [:mb/transforms-python-test]
exclude-tag: ':mb/transforms-python-test'
- name: Transforms Python Tests
test-args: >-
:only-tags [:mb/transforms-python-test]
@@ -491,20 +509,22 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup python-runner
#if: ${{ matrix.job.needs-python-runner == true }}
env:
METABASE_AUTOMATION_USER_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
run: ./.github/scripts/setup-python-runner.sh
if: ${{ matrix.job.needs-python-runner == true }}
uses: ./.github/actions/setup-python-runner
with:
metabase-automation-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Test ${{ matrix.version.name }}
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: ${{ matrix.version.junit-name }}
logs-artifact-suffix: ${{ matrix.version.name }}
test-args: >-
${{ matrix.job.test-args }}
:exclude-tags '[ ${{ matrix.job.exclude-tag }} ${{ env.__ADDITIONAL_EXCLUDED_TAG__ }}]'
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -513,6 +533,12 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: Cleanup python-runner
if: always()
uses: ./.github/actions/cleanup-python-runner
with:
upload-logs: ${{ steps.test-driver.outcome == 'failure' }}
logs-artifact-suffix: ${{ matrix.job.name }} ${{ matrix.version.name }}
be-tests-mongo:
needs: determine-driver-skips
@@ -556,17 +582,19 @@ jobs:
- uses: actions/checkout@v4
- name: Setup python-runner
if: ${{ matrix.job.needs-python-runner == true }}
env:
METABASE_AUTOMATION_USER_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
run: ./.github/scripts/setup-python-runner.sh
uses: ./.github/actions/setup-python-runner
with:
metabase-automation-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Test ${{ matrix.version.name }}
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: ${{ matrix.version.junit-name }}
test-args: ${{ matrix.job.test-args }}
logs-artifact-suffix: ${{ matrix.job.name }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -575,6 +603,12 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: Cleanup python-runner
if: ${{ always() && matrix.job.needs-python-runner == true }}
uses: ./.github/actions/cleanup-python-runner
with:
upload-logs: ${{ steps.test-driver.outcome == 'failure' }}
logs-artifact-suffix: ${{ matrix.job.name }} ${{ matrix.version.name }}
be-tests-mongo-ssl:
needs: determine-driver-skips
@@ -623,6 +657,7 @@ jobs:
curl https://raw.githubusercontent.com/metabase/metabase-qa/master/dbs/mongo/certificates/metaca.crt \
-o ./test_resources/ssl/mongo/metaca.crt
- name: Test ${{ matrix.version.name }}
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: ${{ matrix.version.junit-name }}
@@ -631,7 +666,7 @@ jobs:
:only-tags [:mb/driver-tests]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -658,6 +693,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test MongoDB driver (Sharded cluster)
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-mongo-sharded-cluster-ee'
@@ -665,7 +701,7 @@ jobs:
:only metabase.driver.mongo.sharded-cluster-test
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -730,15 +766,17 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test ${{ matrix.version.name }}
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: ${{ matrix.version.junit-name }}
logs-artifact-suffix: ${{ matrix.version.name }}
test-args: >-
:only-tags [:mb/driver-tests]
:exclude-tags [:mb/transforms-python-test]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -770,7 +808,7 @@ jobs:
- name: Driver Tests
test-args: >-
:only-tags [:mb/driver-tests]
:exclude-tags [:mb/transforms-python-test]
exclude-tag: ':mb/transforms-python-test'
- name: Transforms Python Tests
test-args: >-
:only-tags [:mb/transforms-python-test]
@@ -817,11 +855,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup python-runner
#if: ${{ matrix.job.needs-python-runner == true }}
env:
METABASE_AUTOMATION_USER_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
run: ./.github/scripts/setup-python-runner.sh
if: ${{ matrix.job.needs-python-runner == true }}
uses: ./.github/actions/setup-python-runner
with:
metabase-automation-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Test ${{ matrix.version.name }} (${{ matrix.job.name }})
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-${{ matrix.version.junit-name }}'
@@ -830,7 +869,7 @@ jobs:
:exclude-tags '[ ${{ matrix.job.exclude-tag }} ${{ env.__ADDITIONAL_EXCLUDED_TAG__ }}]'
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -839,6 +878,12 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: Cleanup python-runner
if: always()
uses: ./.github/actions/cleanup-python-runner
with:
upload-logs: ${{ steps.test-driver.outcome == 'failure' }}
logs-artifact-suffix: ${{ matrix.job.name }} ${{ matrix.version.name }}
be-tests-presto-jdbc-ee:
needs: determine-driver-skips
@@ -892,6 +937,7 @@ jobs:
-file /tmp/presto-ssl-ca.der
-trustcacerts
- name: Test Presto JDBC driver
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-presto-jdbc-ee'
@@ -900,7 +946,7 @@ jobs:
:exclude-tags [:mb/transforms-python-test]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -923,12 +969,22 @@ jobs:
test-args: >-
:only-tags [:mb/upload-tests]
:fail-fast? true
- name: Redshift (Excluding Upload Tests)
- name: Redshift (Excluding Upload Tests) Part 1
skip: false
test-args: >-
:only-tags [:mb/driver-tests]
:exclude-tags '[:mb/upload-tests :mb/transforms-python-test]'
:fail-fast? true
:partition/total 2
:partition/index 0
- name: Redshift (Excluding Upload Tests) Part 2
skip: false
test-args: >-
:only-tags [:mb/driver-tests]
:exclude-tags '[:mb/upload-tests :mb/transforms-python-test]'
:fail-fast? true
:partition/total 2
:partition/index 1
- name: Redshift Transforms Python Tests
skip: false
test-args: >-
@@ -949,19 +1005,21 @@ jobs:
- uses: actions/checkout@v4
- name: Setup python-runner
if: ${{ matrix.job.needs-python-runner == true }}
env:
METABASE_AUTOMATION_USER_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
run: ./.github/scripts/setup-python-runner.sh
uses: ./.github/actions/setup-python-runner
with:
metabase-automation-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Test ${{ matrix.job.name }}
id: test-driver
if: ${{ !matrix.job.skip }}
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-redshift-ee'
test-args: >-
${{ matrix.job.test-args }}
logs-artifact-suffix: ${{ matrix.job.name }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: ${{ !matrix.job.skip && !cancelled() }}
if: ${{ !matrix.job.skip && !cancelled() && steps.test-driver.outputs.quarantine-skipped != 'true' }}
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -970,10 +1028,17 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: Cleanup python-runner
if: ${{ always() && matrix.job.needs-python-runner == true }}
uses: ./.github/actions/cleanup-python-runner
with:
upload-logs: ${{ steps.test-driver.outcome == 'failure' }}
logs-artifact-suffix: ${{ matrix.job.name }} ${{ matrix.version.name }}
be-tests-snowflake-ee:
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
needs: determine-driver-skips
if: ${{ !inputs.skip && !(needs.determine-driver-skips.outputs.skip == 'true') }}
timeout-minutes: 60
strategy:
fail-fast: false
@@ -994,6 +1059,7 @@ jobs:
MB_SNOWFLAKE_TEST_USER: METABASE CI
MB_SNOWFLAKE_TEST_ACCOUNT: ${{ secrets.MB_SNOWFLAKE_TEST_ACCOUNT }}
MB_SNOWFLAKE_TEST_PASSWORD: ${{ secrets.MB_SNOWFLAKE_TEST_PASSWORD }}
MB_SNOWFLAKE_TEST_PRIVATE_KEY: ${{ secrets.MB_SNOWFLAKE_TEST_PRIVATE_KEY }}
MB_SNOWFLAKE_TEST_WAREHOUSE: ${{ secrets.MB_SNOWFLAKE_TEST_WAREHOUSE }}
MB_SNOWFLAKE_TEST_PK_USER: METABASE PK
MB_SNOWFLAKE_TEST_PK_PRIVATE_KEY: ${{ secrets.MB_SNOWFLAKE_TEST_PK_PRIVATE_KEY }}
@@ -1011,17 +1077,19 @@ jobs:
- uses: actions/checkout@v4
- name: Setup python-runner
if: ${{ matrix.job.needs-python-runner == true }}
env:
METABASE_AUTOMATION_USER_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
run: ./.github/scripts/setup-python-runner.sh
uses: ./.github/actions/setup-python-runner
with:
metabase-automation-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Test Snowflake driver
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-snowflake-ee'
test-args: ${{ matrix.job.test-args }}
logs-artifact-suffix: ${{ matrix.job.name }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -1030,6 +1098,12 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: Cleanup python-runner
if: ${{ always() && matrix.job.needs-python-runner == true }}
uses: ./.github/actions/cleanup-python-runner
with:
upload-logs: ${{ steps.test-driver.outcome == 'failure' }}
logs-artifact-suffix: ${{ matrix.job.name }} ${{ matrix.version.name }}
be-tests-sparksql-ee:
needs: determine-driver-skips
@@ -1048,6 +1122,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test Spark driver
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-sparksql-ee'
@@ -1056,7 +1131,7 @@ jobs:
:exclude-tags [:mb/transforms-python-test]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -1078,6 +1153,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test SQLite driver
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-sqlite-ee'
@@ -1086,7 +1162,7 @@ jobs:
:exclude-tags [:mb/transforms-python-test]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -1140,17 +1216,19 @@ jobs:
- uses: actions/checkout@v4
- name: Setup python-runner
if: ${{ matrix.job.needs-python-runner == true }}
env:
METABASE_AUTOMATION_USER_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
run: ./.github/scripts/setup-python-runner.sh
uses: ./.github/actions/setup-python-runner
with:
metabase-automation-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Test ${{ matrix.version.name }}
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: ${{ matrix.version.junit-name }}
test-args: ${{ matrix.job.test-args }}
logs-artifact-suffix: ${{ matrix.version.name }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -1159,6 +1237,12 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: Cleanup python-runner
if: ${{ always() && matrix.job.needs-python-runner == true }}
uses: ./.github/actions/cleanup-python-runner
with:
upload-logs: ${{ steps.test-driver.outcome == 'failure' }}
logs-artifact-suffix: ${{ matrix.job.name }} ${{ matrix.version.name }}
# TODO(dpsutton, 2025-08-20): Re-enable starburst when we figure out why it randomly dies in CI
# be-tests-starburst-ee:
@@ -1251,6 +1335,7 @@ jobs:
- name: Make plugins directory
run: mkdir plugins
- name: Test Vertica driver
id: test-driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-vertica-ee'
@@ -1259,7 +1344,7 @@ jobs:
:exclude-tags [:mb/transforms-python-test]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: always() && steps.test-driver.outputs.quarantine-skipped != 'true'
with:
input-path: ./target/junit/
output-name: ${{ github.job }}

View File

@@ -1,185 +0,0 @@
# Thi workflow does the backward compatibility tests
# between the Embedding SDK package of version N and Embedding SDK Bundle of version N - 1
# N - 1 is a target of a PR
name: Embedding SDK backward-compatibility E2E Component Tests
on:
workflow_call:
inputs:
cached-embedding-sdk-dist-artifact-name:
required: true
type: string
jobs:
files-changed:
name: "SDK backward-compatibility E2E > Check which files changed"
runs-on: ubuntu-22.04
timeout-minutes: 3
outputs:
e2e_embedding_sdk: ${{ steps.changes.outputs.e2e_embedding_sdk }}
steps:
- uses: actions/checkout@v4
- name: Test which files changed
uses: dorny/paths-filter@v3.0.0
id: changes
with:
token: ${{ github.token }}
filters: .github/file-paths.yaml
decide-target-ref:
runs-on: ubuntu-latest
outputs:
target-ref: ${{ steps.get-target-ref.outputs.value }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Decide ref to checkout
id: get-target-ref
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "value=${{ github.base_ref }}" >> "$GITHUB_OUTPUT"
else
echo "value=$(git rev-parse HEAD^1)" >> "$GITHUB_OUTPUT"
fi
# if this is a test on a release branch, we need to check the build requirements
get-build-requirements:
name: "SDK backward-compatibility E2E > [Backport only] Get build requirements"
needs: [decide-target-ref]
if: |
!cancelled() &&
contains(github.base_ref || github.ref, 'release-x')
runs-on: ubuntu-22.04
timeout-minutes: 10
outputs:
java_version: ${{ fromJson(steps.dependencies.outputs.result).java_version }}
node_version: ${{ fromJson(steps.dependencies.outputs.result).node_version }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.decide-target-ref.outputs.target-ref }}
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Get build dependencies
uses: actions/github-script@v7
id: dependencies
with:
script: | # js
const {
getBuildRequirements,
getVersionFromReleaseBranch,
} = require('${{ github.workspace }}/release/dist/index.cjs');
const targetBranchName = '${{ github.base_ref || github.ref }}';
const version = getVersionFromReleaseBranch(targetBranchName);
const requirements = getBuildRequirements(version);
return {
java_version: requirements.java,
node_version: requirements.node,
};
e2e-tests:
name: "SDK backward-compatibility E2E > Run e2e tests"
needs: [files-changed, decide-target-ref, get-build-requirements]
if: |
!cancelled() &&
needs.files-changed.outputs.e2e_embedding_sdk == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 45
env:
MB_EDITION: ee
DISPLAY: ""
# Any env starting with `CYPRESS_` will be available to all Cypress tests via `Cypress.env()`
# Example: you can get `CYPRESS_FOO` with `Cypress.env("FOO")`
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.MB_ALL_FEATURES_TOKEN }}
CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.MB_STARTER_CLOUD_TOKEN }}
CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.MB_PRO_CLOUD_TOKEN }}
CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.MB_PRO_SELF_HOSTED_TOKEN }}
CYPRESS_PULL_REQUEST_ID: ${{ github.event.pull_request.number || '' }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message || github.event.head.sha }}
TZ: US/Pacific # to make node match the instance tz
CYPRESS_CI: true
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.decide-target-ref.outputs.target-ref }}
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: uberjar
java-version: "${{ needs.get-build-requirements.outputs.java_version || 21 }}"
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
with:
node-version: "${{ needs.get-build-requirements.outputs.node_version }}"
- name: Build uberjar with ./bin/build.sh
run: ./bin/build.sh
- name: Retrieve Embedding SDK dist artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.cached-embedding-sdk-dist-artifact-name }}
path: ${{ github.workspace }}/resources/embedding-sdk
- name: Prepare Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
- name: Run Metabase
run: node e2e/runner/run_cypress_ci.js start
- name: Make app db snapshot
run: node e2e/runner/run_cypress_ci.js snapshot --browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run component tests for Embedding SDK
run: |
node e2e/runner/run_cypress_ci.js component \
--browser ${{ steps.cypress-prep.outputs.chrome-path }} \
--env grepTags="-@skip-backward-compatibility",grepOmitFiltered=true
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit
output-name: e2e-embedding-sdk
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: Upload Cypress Artifacts upon failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-recording-embedding-sdk-cross-version
path: |
./cypress
./logs/test.log
if-no-files-found: ignore
- name: Publish Summary
if: failure()
uses: actions/github-script@v7
with:
script: | #js
const {
generateReport,
parseReport,
formatSummary
} = require("./.github/scripts/handle-mochawesome-report.js");
const report = await generateReport();
const results = parseReport(report);
const summary = formatSummary(results);
await core.summary.addRaw(summary).write();

View File

@@ -1,206 +0,0 @@
name: E2E Component Tests for Embedding SDK
on:
workflow_call:
inputs:
cached-embedding-sdk-dist-artifact-name:
required: true
type: string
jobs:
files-changed:
name: "SDK e2e > Check which files changed"
runs-on: ubuntu-22.04
timeout-minutes: 3
outputs:
e2e_embedding_sdk: ${{ steps.changes.outputs.e2e_embedding_sdk }}
steps:
- uses: actions/checkout@v4
- name: Test which files changed
uses: dorny/paths-filter@v3.0.0
id: changes
with:
token: ${{ github.token }}
filters: .github/file-paths.yaml
# if this is a test on a release branch, we need to check the build requirements
get-build-requirements:
name: "SDK e2e > [Backport only] Get build requirements"
if: |
!cancelled() &&
contains(github.base_ref || github.ref, 'release-x')
runs-on: ubuntu-22.04
timeout-minutes: 10
outputs:
java_version: ${{ fromJson(steps.dependencies.outputs.result).java_version }}
node_version: ${{ fromJson(steps.dependencies.outputs.result).node_version }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Get build dependencies
uses: actions/github-script@v7
id: dependencies
with:
script: | # js
const {
getBuildRequirements,
getVersionFromReleaseBranch,
} = require('${{ github.workspace }}/release/dist/index.cjs');
const targetBranchName = '${{ github.base_ref || github.ref }}';
const version = getVersionFromReleaseBranch(targetBranchName);
const requirements = getBuildRequirements(version);
return {
java_version: requirements.java,
node_version: requirements.node,
};
build-uberjar:
name: "SDK e2e > Build uberjar"
needs: [files-changed, get-build-requirements]
if: |
!cancelled() &&
needs.files-changed.outputs.e2e_embedding_sdk == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 25
env:
MB_EDITION: ee
INTERACTIVE: false
# make sure that builds on release branches get licenses, because we use them for releases
SKIP_LICENSES: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
with:
node-version: "${{ needs.get-build-requirements.outputs.node_version }}"
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: uberjar
java-version: "${{ needs.get-build-requirements.outputs.java_version || 21 }}"
- name: Build uberjar with ./bin/build.sh
run: ./bin/build.sh
- name: Prepare uberjar artifact
uses: ./.github/actions/prepare-uberjar-artifact
with:
name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar-sdk-tests
e2e-tests:
name: "SDK e2e > Run e2e tests (React ${{ matrix.react-version }})"
needs: [get-build-requirements, build-uberjar]
if: |
!cancelled() &&
needs.build-uberjar.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 45
strategy:
matrix:
react-version: [18, 19]
fail-fast: false
env:
MB_EDITION: ee
DISPLAY: ""
# Any env starting with `CYPRESS_` will be available to all Cypress tests via `Cypress.env()`
# Example: you can get `CYPRESS_FOO` with `Cypress.env("FOO")`
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.MB_ALL_FEATURES_TOKEN }}
CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.MB_STARTER_CLOUD_TOKEN }}
CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.MB_PRO_CLOUD_TOKEN }}
CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.MB_PRO_SELF_HOSTED_TOKEN }}
CYPRESS_PULL_REQUEST_ID: ${{ github.event.pull_request.number || '' }}
CYPRESS_IS_EMBEDDING_SDK: "true"
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message || github.event.head.sha }}
TZ: US/Pacific # to make node match the instance tz
CYPRESS_CI: true
steps:
- uses: actions/checkout@v4
- name: Retrieve uberjar artifact for ee
uses: actions/download-artifact@v4
with:
name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar-sdk-tests
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare JDK ${{ needs.get-build-requirements.outputs.java_version || 21 }}
uses: actions/setup-java@v4
with:
java-version: ${{ needs.get-build-requirements.outputs.java_version || 21 }}
distribution: "temurin"
- name: Prepare Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Retrieve Embedding SDK dist artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.cached-embedding-sdk-dist-artifact-name }}
path: ${{ github.workspace }}/resources/embedding-sdk
- name: Run Metabase
run: node e2e/runner/run_cypress_ci.js start
- name: Make app db snapshot
run: node e2e/runner/run_cypress_ci.js snapshot --browser ${{ steps.cypress-prep.outputs.chrome-path }}
# Has to be run after the app db snapshot is made, as it is not compatible with React 19
- name: Change React version to ${{ matrix.react-version }}
run: ./bin/embedding-sdk/change-react-version.bash ${{ matrix.react-version }}
- name: Run component tests for Embedding SDK
run: node e2e/runner/run_cypress_ci.js component --browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit
output-name: e2e-embedding-sdk-react-${{ matrix.react-version }}
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: "SDK e2e > Upload Cypress Artifacts upon failure"
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-recording-embedding-sdk-react-${{ matrix.react-version }}
path: |
./cypress
./logs/test.log
if-no-files-found: ignore
- name: "SDK e2e > Publish Summary"
if: failure()
uses: actions/github-script@v7
with:
script: | #js
const {
generateReport,
parseReport,
formatSummary
} = require("./.github/scripts/handle-mochawesome-report.js");
const report = await generateReport();
const results = parseReport(report);
const summary = formatSummary(results);
await core.summary.addRaw(summary).write();

View File

@@ -1,171 +0,0 @@
name: E2E Cross-version Tests
on:
schedule:
- cron: '0 9 * * 1-5'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
files-changed:
name: Check which files changed
# don't run this workflow on a cron for forks
if: ${{ github.event_name != 'schedule' || github.repository == 'metabase/metabase' }}
runs-on: ubuntu-22.04
timeout-minutes: 3
outputs:
e2e_cross_version: ${{ steps.changes.outputs.e2e_cross_version }}
steps:
- uses: actions/checkout@v4
- name: Test which files changed
uses: dorny/paths-filter@v3.0.0
id: changes
with:
token: ${{ github.token }}
filters: .github/file-paths.yaml
cross-version-testing:
needs: files-changed
if: ${{ needs.files-changed.outputs.e2e_cross_version == 'true' || github.event_name == 'schedule'}}
runs-on: ubuntu-22.04
timeout-minutes: 20
strategy:
matrix:
version: [
# Major OSS upgrade
{ source: v0.42.2, target: v0.48.7 },
# OSS upgrade
{ source: v0.41.3.1, target: v0.42.2 },
# EE upgrade
{ source: v1.43.4, target: v1.44.0 },
# EE downgrade
{ source: v1.42.0, target: v1.41.3.1 },
# Cross-edition upgrade
{ source: v0.41.3.1, target: v1.42.2 }
]
fail-fast: false
env:
CROSS_VERSION_SOURCE: ${{ matrix.version.source }}
CROSS_VERSION_TARGET: ${{ matrix.version.target }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set source Docker image to OSS
run: |
echo "DOCKER_SOURCE_IMAGE=metabase/metabase:${{ matrix.version.source }}" >> $GITHUB_ENV
if: startsWith(matrix.version.source, 'v0')
- name: Set source Docker image to EE
run: |
echo "DOCKER_SOURCE_IMAGE=metabase/metabase-enterprise:${{ matrix.version.source }}" >> $GITHUB_ENV
if: startsWith(matrix.version.source, 'v1')
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Start Metabase ${{ matrix.version.source }}
run: |
docker run -d \
-v $PWD/my-metabase:/metabase.db \
-p 3000:3000 \
-e CYPRESS_MB_ALL_FEATURES_TOKEN=${{ secrets.MB_ALL_FEATURES_TOKEN }} \
-e CYPRESS_MB_STARTER_CLOUD_TOKEN=${{ secrets.MB_STARTER_CLOUD_TOKEN }} \
-e CYPRESS_MB_PRO_CLOUD_TOKEN=${{ secrets.MB_PRO_CLOUD_TOKEN }} \
-e CYPRESS_MB_PRO_SELF_HOSTED_TOKEN=${{ secrets.MB_PRO_SELF_HOSTED_TOKEN }} \
--name metabase-${{ matrix.version.source }} \
${{ env.DOCKER_SOURCE_IMAGE }}
- name: Wait for Metabase to start on port 3000
run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
- name: Prepare Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
- name: Run Cypress on the source
run: |
yarn cypress run \
--browser ${{ steps.cypress-prep.outputs.chrome-path }} \
--config-file e2e/test/scenarios/cross-version/source/shared/cross-version-source.config.js \
--spec e2e/test/scenarios/cross-version/source/**/*.cy.spec.js
- name: Stop Metabase ${{ matrix.version.source }}
run: docker stop metabase-${{ matrix.version.source }}
- name: Set target Docker image to OSS
run: |
echo "DOCKER_TARGET_IMAGE=metabase/metabase:${{ matrix.version.source }}" >> $GITHUB_ENV
if: startsWith(matrix.version.source, 'v0')
- name: Set target Docker image to EE
run: |
echo "DOCKER_TARGET_IMAGE=metabase/metabase-enterprise:${{ matrix.version.source }}" >> $GITHUB_ENV
if: startsWith(matrix.version.source, 'v1')
- name: Start Metabase ${{ matrix.version.target }}
run: |
docker run -d \
-v $PWD/my-metabase:/metabase.db \
-p 3001:3000 \
-e CYPRESS_MB_ALL_FEATURES_TOKEN=${{ secrets.MB_ALL_FEATURES_TOKEN }} \
-e CYPRESS_MB_STARTER_CLOUD_TOKEN=${{ secrets.MB_STARTER_CLOUD_TOKEN }} \
-e CYPRESS_MB_PRO_CLOUD_TOKEN=${{ secrets.MB_PRO_CLOUD_TOKEN }} \
-e CYPRESS_MB_PRO_SELF_HOSTED_TOKEN=${{ secrets.MB_PRO_SELF_HOSTED_TOKEN }} \
--name metabase-${{ matrix.version.target }} \
${{ env.DOCKER_TARGET_IMAGE }}
- name: Wait for Metabase to start on port 3001
run: while ! curl -s 'http://localhost:3001/api/health' | grep '{"status":"ok"}'; do sleep 1; done
- name: Run Cypress on the target
run: |
yarn cypress run \
--browser ${{ steps.cypress-prep.outputs.chrome-path }} \
--config-file e2e/test/scenarios/cross-version/target/shared/cross-version-target.config.js \
--spec e2e/test/scenarios/cross-version/target/**/*.cy.spec.js
- name: Upload Cypress Artifacts upon failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-artifacts-${{ matrix.version.source}}-to-${{ matrix.version.target }}
path: |
./cypress
if-no-files-found: ignore
notify-on-failure:
needs: cross-version-testing
if: ${{ always() && contains(needs.*.result, 'failure') && github.event_name == 'schedule' }}
name: Cross-version test failure
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/setup-node@v4
with:
node-version: lts/Jod # 22.x.x
- run: npm install @slack/web-api
- name: notify slack of failure
uses: actions/github-script@v7
with:
script: | # js
const FAILED_RUN_URL = "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}";
const REF_NAME = "${{ github.ref_name }}";
// notify slack of failure
const { WebClient } = require('@slack/web-api');
const slack = new WebClient('${{ secrets.SLACK_BOT_TOKEN }}');
await slack.chat.postMessage({
channel: 'engineering-ci',
text: 'Cross-version Tests Have Failed',
blocks: [
{
"type": "header",
"text": {
"type": "plain_text",
"text": `:broken_heart: Cross-version tests are failing on ${REF_NAME}`,
"emoji": true,
}
},
],
attachments: [{
color: "#BF40BF",
blocks: [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": `See <${FAILED_RUN_URL}|failing run details>.`
}
},
]
}]
});

View File

@@ -37,8 +37,26 @@ on:
default: true
jobs:
determine-test-type:
name: Determine test type
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
type: ${{ steps.detect.outputs.type }}
steps:
- name: Detect test type from spec path
id: detect
run: |
SPEC='${{ inputs.spec }}'
if [[ "$SPEC" == e2e/test-component/scenarios/embedding-sdk/* ]]; then
echo "type=component" >> $GITHUB_OUTPUT
else
echo "type=e2e" >> $GITHUB_OUTPUT
fi
workflow-summary:
name: Stress test inputs
needs: [determine-test-type]
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
@@ -48,6 +66,7 @@ jobs:
echo '' >> $GITHUB_STEP_SUMMARY
echo '- `branch`: ${{ github.ref_name }}' >> $GITHUB_STEP_SUMMARY
echo '- `spec`: ${{ inputs.spec }}' >> $GITHUB_STEP_SUMMARY
echo '- `test_type` (inferred): ${{ needs.determine-test-type.outputs.type }}' >> $GITHUB_STEP_SUMMARY
echo '- `burn_in`: ${{ inputs.burn_in }}' >> $GITHUB_STEP_SUMMARY
echo '- `grep`: "${{ inputs.grep }}"' >> $GITHUB_STEP_SUMMARY
echo '- `qa_db`: "${{ inputs.qa_db }}"' >> $GITHUB_STEP_SUMMARY
@@ -56,6 +75,7 @@ jobs:
echo 'triggered by: @${{ github.event.sender.login }}' >> $GITHUB_STEP_SUMMARY
stress-test-flake-fix:
needs: [determine-test-type]
runs-on: ubuntu-22.04
timeout-minutes: 60
name: Stress test E2E flake fix
@@ -63,10 +83,12 @@ jobs:
DISPLAY: ""
QA_DB_ENABLED: ${{ contains(fromJSON('["sql", "mongo"]'), inputs.qa_db) }}
CYPRESS_QA_DB_MONGO: ${{ inputs.qa_db == 'mongo' }}
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.MB_ALL_FEATURES_TOKEN }}
CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.MB_STARTER_CLOUD_TOKEN }}
CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.MB_PRO_CLOUD_TOKEN }}
CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.MB_PRO_SELF_HOSTED_TOKEN }}
MB_RUN_MODE: e2e
METASTORE_DEV_SERVER_URL: ${{ secrets.METASTORE_DEV_SERVER_URL }}
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.STAGING_MB_STARTER_CLOUD_TOKEN }}
CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.STAGING_MB_PRO_CLOUD_TOKEN }}
CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.STAGING_MB_PRO_SELF_HOSTED_TOKEN }}
MB_SNOWPLOW_AVAILABLE: true
MB_SNOWPLOW_URL: "http://localhost:9090" # Snowplow micro
MB_EDITION: ${{ inputs.mb_edition }}
@@ -98,6 +120,16 @@ jobs:
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
if: ${{ needs.determine-test-type.outputs.type == 'component' }}
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Build Embedding SDK package
if: ${{ needs.determine-test-type.outputs.type == 'component' }}
run: yarn build-embedding-sdk-package
- name: Prepare JDK 21
uses: actions/setup-java@v4
with:
@@ -116,12 +148,12 @@ jobs:
- name: Stress-test ${{ github.event.inputs.spec }} ${{ github.event.inputs.burn_in }} times
env:
GREP: ${{ github.event.inputs.grep }}
CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
run: |
node e2e/runner/run_cypress_ci.js e2e \
node e2e/runner/run_cypress_ci.js ${{ needs.determine-test-type.outputs.type }} \
--spec '${{ github.event.inputs.spec }}' \
--env burn=${{ github.event.inputs.burn_in }} \
--config-file e2e/support/cypress-stress-test.config.js \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
--config-file e2e/support/cypress-stress-test.config.js
- name: Upload Cypress Artifacts upon failure
uses: actions/upload-artifact@v4

View File

@@ -42,12 +42,14 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HASH: ${{ github.event.pull_request.head.sha || github.sha }}-${{ github.run_attempt }}
JOB_NAME: ${{ inputs.name }}
MB_RUN_MODE: "e2e"
METASTORE_DEV_SERVER_URL: ${{ secrets.METASTORE_DEV_SERVER_URL }}
# Any env starting with `CYPRESS_` will be available to all Cypress tests via `Cypress.env()`
# Example: you can get `CYPRESS_FOO` with `Cypress.env("FOO")`
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.MB_ALL_FEATURES_TOKEN }}
CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.MB_STARTER_CLOUD_TOKEN }}
CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.MB_PRO_CLOUD_TOKEN }}
CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.MB_PRO_SELF_HOSTED_TOKEN }}
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.STAGING_MB_STARTER_CLOUD_TOKEN }}
CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.STAGING_MB_PRO_CLOUD_TOKEN }}
CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.STAGING_MB_PRO_SELF_HOSTED_TOKEN }}
CYPRESS_PULL_REQUEST_ID: ${{ github.event.pull_request.number || '' }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message || github.event.head.sha }}
MB_EXPERIMENTAL_SEARCH_BLOCK_ON_QUEUE: true
@@ -57,7 +59,6 @@ jobs:
TZ: US/Pacific # to make node match the instance tz
CYPRESS_CI: true
CYPRESS_QA_DB_MONGO: ${{ inputs.name == 'mongo' }}
CYPRESS_IS_EMBEDDING_SDK: "${{ inputs.name == 'embedding-sdk' }}"
steps:
- uses: actions/checkout@v4
with:
@@ -65,6 +66,7 @@ jobs:
token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Setup python-runner
if: ${{ inputs.name == 'python' }}
env:
METABASE_AUTOMATION_USER_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
run: ./.github/scripts/setup-python-runner.sh
@@ -82,10 +84,6 @@ jobs:
mysql: ${{ inputs.name != 'mongo' }}
mongo: ${{ inputs.name == 'mongo' }}
- name: Run Embedding SDK Storybook
if: inputs.name == 'embedding-sdk'
uses: ./.github/actions/run-embedding-sdk-storybook
- name: Retrieve uberjar artifact for ${{ inputs.edition }}
uses: ./.github/actions/fetch-artifact
with:
@@ -122,9 +120,12 @@ jobs:
run: node e2e/runner/run_cypress_ci.js start
- name: Generate database snapshots
env:
CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
run: node e2e/runner/run_cypress_ci.js snapshot
- name: Run auto-split Cypress tests on ${{ inputs.name }}
id: split-e2e
if: ${{ !inputs.specs }}
env:
SPLIT: ${{ inputs.total_chunks }}
@@ -135,42 +136,54 @@ jobs:
# do not write cypress-split summary to github
SPLIT_SUMMARY: false
SPEC_PATH: ${{ env.specs || inputs.specs }}
CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
shell: bash
run: |
echo "Running tests with specs: $SPEC_PATH"
node e2e/runner/run_cypress_ci.js e2e \
--env grepTags="-@mongo+-@flaky+-@OSS+-@skip",grepOmitFiltered=true \
--spec "$SPEC_PATH" \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
--env grepTags="-@mongo+-@python+-@OSS+-@skip" \
--spec "$SPEC_PATH"
# Trunk Quarantine controls the final state of the run in the CI!
# Even if this step fails we let it pass, and then `trunk-io/analytics-uploader` determines
# whether to fail or to pass the whole job, based on the quarantine list.
continue-on-error: true
- name: Run Tagged EE Cypress tests on ${{ inputs.name }}
id: tagged-e2e
if: ${{ inputs.specs }}
shell: bash
env:
SPEC_PATH: ${{ env.specs || inputs.specs }}
CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
run: |
echo "Running tests with specs: $SPEC_PATH"
node e2e/runner/run_cypress_ci.js e2e \
--env grepTags="${{inputs.tags && format('{0}+-@skip', inputs.tags) || '-@skip'}}",grepOmitFiltered=true \
--spec "$SPEC_PATH" \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
--env grepTags="${{inputs.tags && format('{0}+-@skip', inputs.tags) || '-@skip'}}" \
--spec "$SPEC_PATH"
# Trunk Quarantine controls the final state of the run in the CI!
# Even if this step fails we let it pass, and then `trunk-io/analytics-uploader` determines
# whether to fail or to pass the whole job, based on the quarantine list.
continue-on-error: true
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit
# Related to our custom upload to S3
output-name: e2e-${{ inputs.name }}
variant: e2e-tests
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
# Related to Trunk uploader
variant: e2e-tests
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: Upload Cypress Artifacts upon failure
uses: actions/upload-artifact@v4
if: failure()
if: |
!cancelled() && (steps.split-e2e.outcome == 'failure' || steps.tagged-e2e.outcome == 'failure')
with:
name: cypress-recording-${{ inputs.name }}-${{ inputs.edition }}
path: |
@@ -180,10 +193,12 @@ jobs:
- name: Upload Failed Tests
uses: actions/upload-artifact@v4
if: failure()
if: |
!cancelled() && (steps.split-e2e.outcome == 'failure' || steps.tagged-e2e.outcome == 'failure')
with:
name: failed-tests-${{ inputs.name }}-${{ inputs.edition }}
path: ./cypress/test-results
if-no-files-found: ignore
- name: Extract chunk-specific changed timings
id: extract-timings

View File

@@ -73,20 +73,6 @@ jobs:
tags: ${{ matrix.tags }}
runner: ${{ matrix.runner }}
# run this separately to make it non-blocking
flaky-e2e-tests:
name: Flaky e2e Tests
uses: ./.github/workflows/e2e-test.yml
needs:
- e2e-matrix-builder
# skip flaky test run if only e2e specs changed as an optimization
if: |
!cancelled() && !inputs.skip && needs.e2e-matrix-builder.outputs.isDefaultSpecPattern == 'true'
secrets: inherit
with:
name: Flaky
tags: "@flaky"
collect-timings:
name: Collect E2E Timings
runs-on: ubuntu-22.04
@@ -118,7 +104,8 @@ jobs:
const fs = require('fs');
const path = require('path');
const chunkFiles = glob.sync('timing-files/*/chunkTimings.json');
const globber = await glob.create('timing-files/*/chunkTimings.json');
const chunkFiles = await globber.glob();
const specs = new Map();
chunkFiles.forEach(file => {
@@ -151,14 +138,12 @@ jobs:
e2e-tests-result:
needs:
- e2e-tests
- flaky-e2e-tests
runs-on: ubuntu-latest
timeout-minutes: 5
name: e2e-tests-result
if: always() && !cancelled()
env:
E2E_TESTS_RESULT: ${{ needs.e2e-tests.result }}
FLAKY_E2E_TESTS_RESULT: ${{ needs.flaky-e2e-tests.result }}
steps:
- name: Stub
if: ${{ needs.e2e-tests.result == 'skipped' }}
@@ -168,7 +153,6 @@ jobs:
if: ${{ needs.e2e-tests.result != 'skipped' }}
run: | # sh
echo "E2E Tests: ${{ needs.e2e-tests.result }}"
echo "Flaky E2E Tests: ${{ needs.flaky-e2e-tests.result }}"
if [ "${{ needs.e2e-tests.result }}" != "success" ]; then
echo "E2E Tests failed"

View File

@@ -0,0 +1,250 @@
name: Embedding SDK Component Tests
on:
workflow_call:
jobs:
sdk-component-tests:
name: "SDK component tests (React ${{ matrix.react-version }})"
runs-on: ubuntu-22.04
timeout-minutes: 45
strategy:
matrix:
react-version: [18, 19]
fail-fast: false
env:
MB_EDITION: ee
DISPLAY: ""
MB_RUN_MODE: "e2e"
METASTORE_DEV_SERVER_URL: ${{ secrets.METASTORE_DEV_SERVER_URL }}
# Any env starting with `CYPRESS_` will be available to all Cypress tests via `Cypress.env()`
# Example: you can get `CYPRESS_FOO` with `Cypress.env("FOO")`
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.STAGING_MB_STARTER_CLOUD_TOKEN }}
CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.STAGING_MB_PRO_CLOUD_TOKEN }}
CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.STAGING_MB_PRO_SELF_HOSTED_TOKEN }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message || github.event.head.sha }}
TZ: US/Pacific # to make node match the instance tz
CYPRESS_CI: true
steps:
- uses: actions/checkout@v4
- name: Retrieve uberjar artifact for ee
uses: ./.github/actions/fetch-artifact
with:
name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
extract-path: "target/uberjar"
output-name: "metabase.jar"
- name: Retrieve Embedding SDK dist artifact
uses: actions/download-artifact@v4
with:
name: embedding-sdk-${{ github.event.pull_request.head.sha || github.sha }}
path: ${{ github.workspace }}/resources/embedding-sdk
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: "temurin"
- name: Prepare Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
- name: Run Metabase
run: node e2e/runner/run_cypress_ci.js start
- name: Make app db snapshot
env:
CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
run: node e2e/runner/run_cypress_ci.js snapshot
# Has to be run after the app db snapshot is made, as it is not compatible with React 19
- name: Change React version to ${{ matrix.react-version }}
run: ./bin/embedding-sdk/change-react-version.bash ${{ matrix.react-version }}
- name: Run component tests for Embedding SDK
env:
CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
run: node e2e/runner/run_cypress_ci.js component
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit
output-name: e2e-embedding-sdk-react-${{ matrix.react-version }}
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: "SDK component tests > Upload Cypress Artifacts upon failure"
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-recording-embedding-sdk-react-${{ matrix.react-version }}
path: |
./cypress
./logs/test.log
if-no-files-found: ignore
- name: "SDK component tests > Publish Summary"
if: failure()
uses: actions/github-script@v7
with:
script: | #js
const {
generateReport,
parseReport,
formatSummary
} = require("./.github/scripts/handle-mochawesome-report.js");
const report = await generateReport();
const results = parseReport(report);
const summary = formatSummary(results);
await core.summary.addRaw(summary).write();
decide-target-ref:
runs-on: ubuntu-latest
outputs:
target-ref: ${{ steps.get-target-ref.outputs.value }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Decide ref to checkout
id: get-target-ref
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "value=${{ github.base_ref }}" >> "$GITHUB_OUTPUT"
else
echo "value=$(git rev-parse HEAD^1)" >> "$GITHUB_OUTPUT"
fi
# This job ensures that the Embedding SDK package from the current commit (N) works with the
# Embedding SDK Bundle (Metabase JAR) from the previous commit (N-1).
# N - 1 is a target of a pull request, or a literal previous commit when this job is run on push in a branch.
sdk-component-tests-backward-compatibility:
name: "SDK component tests (Backward compatibility)"
needs: [decide-target-ref]
runs-on: ubuntu-22.04
timeout-minutes: 45
env:
MB_EDITION: ee
DISPLAY: ""
MB_RUN_MODE: "e2e"
METASTORE_DEV_SERVER_URL: ${{ secrets.METASTORE_DEV_SERVER_URL }}
# Any env starting with `CYPRESS_` will be available to all Cypress tests via `Cypress.env()`
# Example: you can get `CYPRESS_FOO` with `Cypress.env("FOO")`
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.STAGING_MB_STARTER_CLOUD_TOKEN }}
CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.STAGING_MB_PRO_CLOUD_TOKEN }}
CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.STAGING_MB_PRO_SELF_HOSTED_TOKEN }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message || github.event.head.sha }}
TZ: US/Pacific # to make node match the instance tz
CYPRESS_CI: true
steps:
- name: Check out the code from the previous commit
uses: actions/checkout@v4
with:
ref: ${{ needs.decide-target-ref.outputs.target-ref }}
- name: Get the actual commit SHA from the checked out branch
id: get-commit-sha
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Attempt to retrieve the ee uberjar artifact from the previous commit
id: download-uberjar
uses: ./.github/actions/fetch-artifact
with:
name: metabase-ee-${{ steps.get-commit-sha.outputs.sha }}-uberjar
extract-path: "target/uberjar"
output-name: "metabase.jar"
continue-on-error: true # do not break the whole job if this step doesn't succeed
# Build the uberjar from the previous commit only if we couldn't fetch it.
# `step.foo.OUTCOME` is important because it looks at the step status *before* continue-on-error is applied.
# Do not confuse it with the `step.foo.conclusion`.
- name: Build MB uberjar from the commit N-1
if: steps.download-uberjar.outcome != 'success'
run: ./bin/build.sh
- name: Retrieve Embedding SDK dist artifact built from the current commit N
uses: actions/download-artifact@v4
with:
name: embedding-sdk-${{ github.event.pull_request.head.sha || github.sha }}
path: ${{ github.workspace }}/resources/embedding-sdk
- name: Prepare Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
- name: Run Metabase
run: node e2e/runner/run_cypress_ci.js start
- name: Make app db snapshot
env:
CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
run: node e2e/runner/run_cypress_ci.js snapshot
- name: Run component tests for Embedding SDK
env:
CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
run: |
node e2e/runner/run_cypress_ci.js component \
--env grepTags="-@skip-backward-compatibility"
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit
output-name: e2e-embedding-sdk
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: Upload Cypress Artifacts upon failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-recording-embedding-sdk-cross-version
path: |
./cypress
./logs/test.log
if-no-files-found: ignore
- name: Publish Summary
if: failure()
uses: actions/github-script@v7
with:
script: | #js
const {
generateReport,
parseReport,
formatSummary
} = require("./.github/scripts/handle-mochawesome-report.js");
const report = await generateReport();
const results = parseReport(report);
const summary = formatSummary(results);
await core.summary.addRaw(summary).write();

View File

@@ -1,78 +1,14 @@
name: "[NOT REQUIRED] SDK Compatibility tests"
on:
push:
branches:
- "master"
- "release-**"
pull_request:
types: [opened, synchronize, reopened]
branches:
- "master"
- "release-**"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
workflow_call:
jobs:
files-changed:
name: Check which files changed
runs-on: ubuntu-22.04
timeout-minutes: 3
outputs:
e2e_embedding_sdk_compatibility: ${{ steps.changes.outputs.e2e_embedding_sdk_compatibility }}
steps:
- uses: actions/checkout@v4
- name: Test which files changed
uses: dorny/paths-filter@v3.0.0
id: changes
with:
token: ${{ github.token }}
filters: .github/file-paths.yaml
# if this is a test on a release branch, we need to check the build requirements
get-build-requirements:
if: |
!cancelled() &&
contains(github.base_ref || github.ref, 'release-x')
runs-on: ubuntu-22.04
timeout-minutes: 10
outputs:
java_version: ${{ fromJson(steps.dependencies.outputs.result).java_version }}
node_version: ${{ fromJson(steps.dependencies.outputs.result).node_version }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Get build dependencies
uses: actions/github-script@v7
id: dependencies
with:
script: | # js
const {
getBuildRequirements,
getVersionFromReleaseBranch,
} = require('${{ github.workspace }}/release/dist/index.cjs');
const targetBranchName = '${{ github.base_ref || github.ref }}';
const version = getVersionFromReleaseBranch(targetBranchName);
const requirements = getBuildRequirements(version);
return {
java_version: requirements.java,
node_version: requirements.node,
};
get-sample-apps-data:
if: |
!cancelled()
runs-on: ubuntu-22.04
timeout-minutes: 10
env:
# we must support last two stable releases
# we must support the last two stable releases
SUPPORTED_RELEASES_COUNT: 2
TEST_SUITES: |
[
@@ -145,48 +81,6 @@ jobs:
matrix: []
};
build:
needs: [files-changed, get-build-requirements, get-sample-apps-data]
if: |
!cancelled() &&
needs.files-changed.outputs.e2e_embedding_sdk_compatibility == 'true' &&
fromJSON(needs.get-sample-apps-data.outputs.matrix)[0] != null
runs-on: ubuntu-22.04
timeout-minutes: 25
env:
MB_EDITION: ee
INTERACTIVE: false
# make sure that builds on release branches get licenses, because we use them for releases
SKIP_LICENSES: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
with:
node-version: "${{ needs.get-build-requirements.outputs.node_version }}"
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: uberjar
java-version: "${{ needs.get-build-requirements.outputs.java_version || 21 }}"
- name: Build uberjar with ./bin/build.sh
run: ./bin/build.sh
- name: Prepare uberjar artifact
uses: ./.github/actions/prepare-uberjar-artifact
with:
name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
- name: Build Embedding SDK package
run: yarn build-embedding-sdk-package
- name: Prepare Embedding SDK artifact
uses: actions/upload-artifact@v4
with:
name: embedding-sdk-${{ github.event.pull_request.head.sha || github.sha }}
path: resources/embedding-sdk
# In order to check compatibility between Sample Apps and Embedding SDK, the job for each sample app:
# - pulls a Sample App
# - starts it
@@ -194,13 +88,13 @@ jobs:
# The job is not required, though if it's failing better to be sure that it's not caused by a breaking change.
# For more details see `Sample Apps compatibility with Embedding SDK tests` in `enterprise/frontend/src/embedding-sdk-package/dev.md`
e2e-sample-apps-tests:
needs: [get-build-requirements, get-sample-apps-data, build]
needs: [get-sample-apps-data]
strategy:
matrix:
test_suite: ${{ fromJSON(needs.get-sample-apps-data.outputs.matrix) }}
environment: ["production", "development"]
if: |
!cancelled() && needs.build.result == 'success'
!cancelled() && needs.get-sample-apps-data.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 45
name: e2e-sample-app-${{ matrix.test_suite }}-tests-${{ matrix.environment }}-bundle
@@ -210,8 +104,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number || '' }}
HASH: ${{ github.event.pull_request.head.sha || github.sha }}-${{ github.run_attempt }}
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.MB_ALL_FEATURES_TOKEN }}
CYPRESS_IS_EMBEDDING_SDK: "true"
MB_RUN_MODE: e2e
METASTORE_DEV_SERVER_URL: ${{ secrets.METASTORE_DEV_SERVER_URL }}
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
TZ: US/Pacific # to make node match the instance tz
CYPRESS_CI: true
SAMPLE_APP_BRANCH_NAME: ${{ needs.get-sample-apps-data.outputs.branch_name }}
@@ -222,6 +117,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/maximize-disk-space
# We have to use the latest version that does not have this issue https://github.com/docker/compose/pull/12752
- name: Set up Docker Compose
uses: docker/setup-compose-action@v1
@@ -236,9 +133,11 @@ jobs:
echo "sample_app_name=${test_suite%-e2e}" >> "$GITHUB_OUTPUT"
- name: Retrieve uberjar artifact for ee
uses: actions/download-artifact@v4
uses: ./.github/actions/fetch-artifact
with:
name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
extract-path: "target/uberjar"
output-name: "metabase.jar"
- name: Retrieve Embedding SDK dist artifact
uses: actions/download-artifact@v4
@@ -290,11 +189,19 @@ jobs:
if: ${{ steps.check-sample-app-branch.outputs.sample_app_branch_exists == 'true' && matrix.test_suite != 'shoppy-e2e' }}
run: npx tsx ./e2e/runner/embedding-sdk/sample-apps/start-ci.ts ${{ matrix.test_suite }}
- name: Prune build cache
run: docker builder prune -af
- name: Log free disk space
run: df -h /
- name: Run e2e tests for Sample App
id: run-e2e-tests
if: ${{ steps.check-sample-app-branch.outputs.sample_app_branch_exists == 'true' }}
continue-on-error: true
run: node e2e/runner/run_cypress_ci.js ${{ matrix.test_suite }} --browser ${{ steps.cypress-prep.outputs.chrome-path }}
env:
CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
run: node e2e/runner/run_cypress_ci.js ${{ matrix.test_suite }}
- name: Upload Cypress Artifacts upon failure
uses: actions/upload-artifact@v4
@@ -318,7 +225,6 @@ jobs:
# The job is not required, though if it's failing better to be sure that it's not caused by a breaking change.
# For more details see `Embedding SDK integration tests with Host Apps` in `enterprise/frontend/src/embedding-sdk-package/dev.md`
e2e-host-apps-tests:
needs: [get-build-requirements, build]
strategy:
matrix:
test_suite:
@@ -329,8 +235,6 @@ jobs:
"angular-20-host-app-e2e",
]
environment: ["production", "development"]
if: |
!cancelled() && needs.build.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 45
name: e2e-host-app-${{ matrix.test_suite }}-tests-${{ matrix.environment }}-bundle
@@ -340,8 +244,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number || '' }}
HASH: ${{ github.event.pull_request.head.sha || github.sha }}-${{ github.run_attempt }}
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.MB_ALL_FEATURES_TOKEN }}
CYPRESS_IS_EMBEDDING_SDK: "true"
MB_RUN_MODE: e2e
METASTORE_DEV_SERVER_URL: ${{ secrets.METASTORE_DEV_SERVER_URL }}
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
TZ: US/Pacific # to make node match the instance tz
CYPRESS_CI: true
HOST_APP_ENVIRONMENT: ${{ matrix.environment }}
@@ -352,9 +257,11 @@ jobs:
- uses: actions/checkout@v4
- name: Retrieve uberjar artifact for ee
uses: actions/download-artifact@v4
uses: ./.github/actions/fetch-artifact
with:
name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
extract-path: "target/uberjar"
output-name: "metabase.jar"
- name: Retrieve Embedding SDK dist artifact
uses: actions/download-artifact@v4
@@ -387,7 +294,9 @@ jobs:
- name: Run e2e tests for Host App
id: run-e2e-tests
continue-on-error: true
run: node e2e/runner/run_cypress_ci.js ${{ matrix.test_suite }} --browser ${{ steps.cypress-prep.outputs.chrome-path }}
env:
CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
run: node e2e/runner/run_cypress_ci.js ${{ matrix.test_suite }}
- name: Upload Cypress Artifacts upon failure
uses: actions/upload-artifact@v4

View File

@@ -0,0 +1,31 @@
name: Embedding SDK Package Build
on:
workflow_call:
workflow_dispatch:
concurrency:
group: embedding-sdk-package-${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
build-sdk-package:
runs-on: ubuntu-22.04
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
- name: Build Embedding SDK package
run: |
# Remove the matchers to not report false positives on every PR
# unrelated to embedding (EMB-765)
echo "::remove-matcher owner=tsc::"
yarn build-embedding-sdk-package
- name: Prepare Embedding SDK artifact
uses: actions/upload-artifact@v4
with:
name: embedding-sdk-${{ github.event.pull_request.head.sha || github.sha }}
path: resources/embedding-sdk

View File

@@ -2,59 +2,39 @@ name: SDK
on:
workflow_call:
inputs:
cli-snippets-type-check:
description: "Whether to run cli snippets type check."
required: true
type: boolean
docs-snippets-type-check:
description: "Whether to run docs snippets type check."
required: true
type: boolean
documentation-validation:
description: "Whether to run documentation generation validation check."
required: true
type: boolean
component-tests:
description: "Whether to run component tests."
required: true
type: boolean
host-sample-apps-tests:
description: "Whether to run host and sample apps compatibility tests."
required: true
type: boolean
skip:
description: Whether to skip running tests due to one of the artifacts failing to build.
required: true
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
name: Check which files changed
runs-on: ubuntu-22.04
timeout-minutes: 3
outputs:
e2e_embedding_sdk: ${{ steps.changes.outputs.e2e_embedding_sdk }}
frontend_embedding_sdk_sources: ${{ steps.changes.outputs.frontend_embedding_sdk_sources }}
embedding_documentation: ${{ steps.changes.outputs.embedding_documentation }}
steps:
- uses: actions/checkout@v4
- name: Test which files changed
uses: dorny/paths-filter@v3.0.0
id: changes
with:
token: ${{ github.token }}
filters: .github/file-paths.yaml
build:
needs: [files-changed]
if: |
!cancelled() &&
(needs.files-changed.outputs.e2e_embedding_sdk == 'true' ||
needs.files-changed.outputs.frontend_embedding_sdk_sources == 'true' ||
needs.files-changed.outputs.embedding_documentation == 'true')
runs-on: ubuntu-22.04
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Build Embedding SDK package
run: yarn build-embedding-sdk-package
- name: Prepare Embedding SDK artifact
uses: actions/upload-artifact@v4
with:
name: embedding-sdk-${{ github.event.pull_request.head.sha || github.sha }}
path: resources/embedding-sdk
embedding-sdk-cli-snippets-type-check:
needs: [files-changed, build]
if: |
needs.files-changed.outputs.frontend_embedding_sdk_sources == 'true' &&
needs.build.result == 'success'
if: inputs.cli-snippets-type-check && !inputs.skip
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
@@ -70,10 +50,7 @@ jobs:
run: yarn run embedding-sdk:cli-snippets:type-check
embedding-sdk-docs-snippets-type-check:
needs: [files-changed, build]
if: |
needs.files-changed.outputs.embedding_documentation == 'true' &&
needs.build.result == 'success'
if: inputs.docs-snippets-type-check && !inputs.skip
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
@@ -89,10 +66,7 @@ jobs:
run: yarn run embedding-sdk:docs-snippets:type-check
embedding-sdk-api-documentation-generation-validation:
needs: [files-changed, build]
if: |
needs.files-changed.outputs.frontend_embedding_sdk_sources == 'true' &&
needs.build.result == 'success'
if: inputs.documentation-validation && !inputs.skip
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
@@ -138,29 +112,24 @@ jobs:
run: exit 1
# See `Component e2e tests` in `enterprise/frontend/src/embedding-sdk-package/dev.md`
sdk-e2e-tests:
name: "SDK e2e tests"
uses: ./.github/workflows/e2e-component-tests-embedding-sdk.yml
needs: [build]
embedding-sdk-component-tests:
name: "SDK component tests"
if: inputs.component-tests && !inputs.skip
uses: ./.github/workflows/embedding-sdk-component-tests.yml
secrets: inherit
with:
cached-embedding-sdk-dist-artifact-name: embedding-sdk-${{ github.event.pull_request.head.sha || github.sha }}
e2e-component-tests-embedding-sdk-backward-compatibility:
name: "SDK e2e backward compatibility tests"
uses: ./.github/workflows/e2e-component-tests-embedding-sdk-backward-compatibility.yml
needs: [build]
not-required-embedding-sdk-apps-compatibility-tests:
name: "SDK e2e tests for compatibility with (host/sample) apps"
if: inputs.host-sample-apps-tests && !inputs.skip
uses: ./.github/workflows/embedding-sdk-host-sample-apps-tests.yml
secrets: inherit
with:
cached-embedding-sdk-dist-artifact-name: embedding-sdk-${{ github.event.pull_request.head.sha || github.sha }}
embedding-sdk-tests-result:
needs:
- embedding-sdk-cli-snippets-type-check
- embedding-sdk-docs-snippets-type-check
- embedding-sdk-api-documentation-generation-validation
- sdk-e2e-tests
- e2e-component-tests-embedding-sdk-backward-compatibility
- embedding-sdk-component-tests
if: always() && !cancelled()
runs-on: ubuntu-latest
timeout-minutes: 5

View File

@@ -43,8 +43,6 @@ jobs:
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Build cljs
run: yarn build:cljs
- name: Stress-test ${{ github.event.inputs.spec }} ${{ github.event.inputs.burn_in }} times

View File

@@ -35,15 +35,16 @@ jobs:
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Get Eslint cache key
uses: ./.github/actions/get-cache-keys
id: get-cache-keys
- name: Restore ESLint cache
uses: actions/cache@v4
uses: actions/cache/restore@v4
with:
path: .eslintcache
key: eslintcache-${{ hashFiles('yarn.lock', '.eslintrc.js') }}
restore-keys: |
eslintcache-
path: ${{ github.workspace}}/.eslintcache
key: ${{ steps.get-cache-keys.outputs.eslint-cache-key }}
- name: Compile CLJS
run: yarn build-pure:cljs
- name: Find CSS variables that are used but never defined
@@ -65,8 +66,6 @@ jobs:
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- run: yarn build-pure:cljs
name: Compile CLJS
- run: yarn type-check-pure
@@ -90,10 +89,12 @@ jobs:
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Run frontend unit tests
run: yarn run test-unit --silent --shard=${{ matrix.shard }}/${{ env.SHARDS }}
# Trunk Quarantine controls the final state of the run in the CI!
# Even if this step fails we let it pass, and then `trunk-io/analytics-uploader` determines
# whether to fail or to pass the whole job, based on the quarantine list.
continue-on-error: true
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always() && github.event_name != 'workflow_dispatch'
@@ -116,8 +117,6 @@ jobs:
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Run frontend timezones tests
run: yarn run test-timezones

View File

@@ -1,62 +0,0 @@
name: Fuzzing
on:
workflow_dispatch:
push:
branches:
- "master"
- "release-**"
paths:
- "frontend/src/metabase/querying/expressions/**"
pull_request:
paths:
- "frontend/src/metabase/querying/expressions/**"
jobs:
fe-fuzz-lexifier:
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- run: yarn test-unit frontend/src/metabase/querying/expressions/pratt/fuzz.lexifier.unit.spec.ts
env:
MB_FUZZ: 1
name: Run fuzz testing on the lexifier
fe-fuzz-compiler:
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- run: yarn test-unit frontend/src/metabase/querying/expressions/fuzz.compiler.unit.spec.ts
env:
MB_FUZZ: 1
name: Run fuzz testing on the custom expression compiler
fe-fuzz-string-quoting:
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- run: yarn test-unit frontend/src/metabase/querying/expressions/fuzz.string.unit.spec.ts
env:
MB_FUZZ: 1
name: Run fuzz testing on the custom expression string quoter

View File

@@ -40,8 +40,6 @@ jobs:
ref: ${{ inputs.ref }}
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: generative-query-test
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend

View File

@@ -38,8 +38,6 @@ jobs:
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'i18n'
- name: Install xgettext if necessary
run: |
if ! command -v xgettext > /dev/null; then

View File

@@ -20,8 +20,6 @@ jobs:
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Compile CLJS
run: yarn build-pure:cljs

View File

@@ -47,8 +47,6 @@ jobs:
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Compile CLJS
run: NODE_ENV=development yarn build-pure:cljs

View File

@@ -2,7 +2,7 @@ name: Mage Tests
on:
pull_request:
paths: ["mage/**", "test/mage/**"]
paths: ["mage/**"]
jobs:
# run mage tests even if the rest of be isnt needed
@@ -13,8 +13,6 @@ jobs:
- uses: actions/checkout@v4
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'kondo'
- name: Setup Babashka
uses: turtlequeue/setup-babashka@v1.7.0
with:
@@ -24,4 +22,4 @@ jobs:
- name: bb task list
run: bb tasks
- name: Run mage tests
run: bb ./test/mage/runtests.clj
run: bb ./mage/test/mage/runtests.clj

View File

@@ -16,7 +16,5 @@ jobs:
- uses: actions/checkout@v4
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: lint-migrations
- name: Verify Liquibase Migrations
run: ./bin/mage lint-migrations

227
.github/workflows/minimal-tests.yml vendored Normal file
View File

@@ -0,0 +1,227 @@
name: Minimal Tests
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
# Only run if the PR has the minimal-tests label
check-label:
runs-on: ubuntu-latest
timeout-minutes: 1
outputs:
should-run: ${{ steps.check.outputs.result }}
steps:
- name: Check for minimal-tests label
id: check
run: |
if [[ "${{ contains(github.event.pull_request.labels.*.name, 'minimal-tests') }}" == "true" ]]; then
echo "result=true" >> $GITHUB_OUTPUT
else
echo "result=false" >> $GITHUB_OUTPUT
fi
# Postgres app-db tests - single version, single job
postgres-app-db-test:
needs: check-label
if: needs.check-label.outputs.should-run == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: postgres
MB_DB_TYPE: postgres
MB_DB_PORT: 5432
MB_DB_HOST: localhost
MB_DB_DBNAME: mb_test
MB_DB_USER: mb_test
MB_POSTGRESQL_TEST_USER: mb_test
services:
postgres:
image: postgres:latest
ports:
- "5432:5432"
env:
POSTGRES_USER: mb_test
POSTGRES_DB: mb_test
POSTGRES_HOST_AUTH_METHOD: trust
name: Postgres Latest EE App DB Tests (Part 1)
steps:
- uses: actions/checkout@v4
- name: Test Postgres App DB
uses: ./.github/actions/test-driver
with:
build-static-viz: true
junit-name: 'minimal-be-tests-postgres-ee'
test-args: >-
:only '["test" "enterprise/backend/test"]'
:exclude-tags '[:mb/driver-tests :mb/transforms-python-test]'
:partition/total 2
:partition/index 0
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
# Postgres driver tests
postgres-driver-test:
needs: check-label
if: needs.check-label.outputs.should-run == 'true'
runs-on: ubuntu-latest
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: postgres
MB_DB_TYPE: postgres
MB_DB_PORT: 5432
MB_DB_HOST: localhost
MB_DB_DBNAME: mb_test
MB_DB_USER: mb_test
MB_POSTGRESQL_TEST_USER: mb_test
services:
postgres:
image: postgres:latest
ports:
- "5432:5432"
env:
POSTGRES_USER: mb_test
POSTGRES_DB: mb_test
POSTGRES_HOST_AUTH_METHOD: trust
name: Postgres Latest Driver Tests
steps:
- uses: actions/checkout@v4
- name: Test Postgres Driver
uses: ./.github/actions/test-driver
with:
junit-name: 'minimal-be-tests-postgres-driver-ee'
test-args: >-
:only-tags [:mb/driver-tests]
:exclude-tags [:mb/transforms-python-test]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
# Frontend unit tests
frontend-unit-tests:
needs: check-label
if: needs.check-label.outputs.should-run == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 30
env:
JEST_JUNIT_OUTPUT_DIR: ./target/junit
JEST_JUNIT_OUTPUT_NAME: test-report-frontend-unit.xml
name: Frontend Unit Tests
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
- name: Run frontend unit tests
run: yarn run test-unit --silent
continue-on-error: true
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit
output-name: frontend-unit
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
# Summary job
minimal-tests-result:
needs:
- postgres-app-db-test
- postgres-driver-test
- frontend-unit-tests
runs-on: ubuntu-latest
timeout-minutes: 5
name: minimal-tests-result
if: always() && !cancelled()
steps:
- name: Check job status
uses: actions/github-script@v7
env:
needs: ${{ toJson(needs) }}
with:
script: | # js
const needs = JSON.parse(process.env.needs);
const jobs = Object.entries(needs).map(
([jobName, jobValues]) => ({
name: jobName,
result: jobValues.result
}));
// Check if all jobs either succeeded or were skipped
// Skipped jobs are acceptable (they were intentionally skipped when the label is absent)
const allPassedOrSkipped = jobs.every(job =>
job.result === 'success' || job.result === 'skipped'
);
// Check if any jobs actually failed (not skipped, not cancelled)
const anyFailed = jobs.some(job =>
job.result === 'failure'
);
if (allPassedOrSkipped && !anyFailed) {
console.log("");
console.log(" _------. ");
console.log(" / , \_ ");
console.log(" / / /{}\ |o\_ ");
console.log(" / \ `--' /-' \ ");
console.log(" | \ \ | ");
console.log(" | |`-, | ");
console.log(" / /__/)/ ");
console.log(" | | ");
console.log("");
console.log("All minimal tests have passed. Fast feedback achieved!");
process.exit(0);
}
// otherwise, something failed
console.log("");
console.log(" .::::::::::. .::::::::::. ");
console.log(" .::::''''''::::. .::::''''''::::. ");
console.log(" .:::' `::::.... ....::::' `:::. ");
console.log(" .::' `:::::::| |:::::::' `::. ");
console.log(" .::| |::::::|_ ___ __|::::::| |::. ");
console.log(" `--' |::::::|_()__()_|::::::| `--' ");
console.log(" ::: |::-o::| |::o-::| ::: ");
console.log(" `::. .|::::::| |::::::|. .::' ");
console.log(" `:::. .::\-----' `-----/::. .:::' ");
console.log(" `::::......::::' `::::......::::' ");
console.log(" `::::::::::' `::::::::::' ");
console.log("");
console.log("Minimal tests have failed.");
jobs.forEach((job) => {
if (job.result !== 'success' && job.result !== 'skipped') {
console.log(`${job.name} - ${job.result}`);
}
});
process.exit(1);

44
.github/workflows/openapi-check.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: OpenAPI Check
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
check-openapi-specs:
runs-on: ubuntu-22.04
timeout-minutes: 5
if: contains(github.event.pull_request.labels.*.name, 'openapi-self-healing')
steps:
- uses: actions/checkout@v4
with:
# we're intentionally using METABASE_AUTOMATION_USER_TOKEN to trigger the whole CI pipeline again
# after the self-healing commit is created
# if we used GITHUB_TOKEN, the self-healing commit would not trigger the CI pipeline again
token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
# fetch full git history to allow fetching the latest base branch commit and comparing changes
fetch-depth: 0
- name: Setup Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
- name: Generate version.properties
run: ./bin/build.sh :steps [:version]
- name: Get latest base branch commit
run: |
git fetch origin ${{ github.event.pull_request.base.ref }}
echo "LATEST_BASE_SHA=$(git rev-parse origin/${{ github.event.pull_request.base.ref }})" >> $GITHUB_ENV
- name: Check OpenAPI specs are up to date
env:
AUTO_COMMIT: "true"
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
BASE_SHA: ${{ env.LATEST_BASE_SHA }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_SHA: ${{ github.sha }}
run: ./bin/openapi-check.sh

View File

@@ -10,6 +10,15 @@ concurrency:
jobs:
pr-env:
if: ${{ github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'PR-Env') || github.event.label.name == 'PR-Env' }}
if: ${{ (github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'PR-Env') && !contains(github.event.pull_request.labels.*.name, 'PR-Env-analytics-dev')) || github.event.label.name == 'PR-Env' }}
uses: ./.github/workflows/pr-env-destroy.yml
secrets: inherit
with:
analytics_dev_mode: false
pr-env-analytics-dev:
if: ${{ (github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'PR-Env-analytics-dev')) || github.event.label.name == 'PR-Env-analytics-dev' }}
uses: ./.github/workflows/pr-env-destroy.yml
secrets: inherit
with:
analytics_dev_mode: false

View File

@@ -10,7 +10,7 @@ concurrency:
jobs:
uberjar:
if: ${{ github.event.label.name == 'PR-Env' }}
if: ${{ github.event.label.name == 'PR-Env' || github.event.label.name == 'PR-Env-analytics-dev' }}
uses: ./.github/workflows/uberjar.yml
secrets: inherit
@@ -19,3 +19,13 @@ jobs:
if: ${{ github.event.label.name == 'PR-Env' }}
uses: ./.github/workflows/pr-env.yml
secrets: inherit
with:
analytics_dev_mode: false
pr-env-analytics-dev:
needs: [uberjar]
if: ${{ github.event.label.name == 'PR-Env-analytics-dev' }}
uses: ./.github/workflows/pr-env.yml
secrets: inherit
with:
analytics_dev_mode: true

View File

@@ -3,6 +3,12 @@ run-name: Building Dynamic PR Environment for ${{ github.ref_name }} by @${{ git
on:
workflow_call:
inputs:
analytics_dev_mode:
description: 'Enable analytics development mode'
required: false
type: boolean
default: false
jobs:
build:
runs-on: ubuntu-latest
@@ -124,6 +130,7 @@ jobs:
PR_NUMBER: ${{ github.event.number }}
MB_PREMIUM_EMBEDDING_TOKEN: ${{ secrets.PR_ENV_MB_PREMIUM_EMBEDDING_TOKEN }}
SHA: ${{ github.event.pull_request.head.sha || github.sha }}
MB_ANALYTICS_DEV_MODE: ${{ inputs.analytics_dev_mode && 'true' || 'false' }}
- name: Deploy PR Review ENV
run: |
kubectl apply -f ./metabase.yml
@@ -139,3 +146,4 @@ jobs:
✅ Preview:
https://pr${{ github.event.number }}.coredev.metabase.com
🗒️ [login instructions](https://www.notion.so/metabase/Ephemeral-PR-Environments-c74a3710c87a460dbf4fc0007a001458)
📦 Deployment type: ${{ inputs.analytics_dev_mode && 'PR-Env-analytics-dev' || 'PR-Env' }}

View File

@@ -103,14 +103,16 @@ jobs:
env:
MB_EDITION: ${{ matrix.edition }}
DISPLAY: ""
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.MB_ALL_FEATURES_TOKEN }}
CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.MB_STARTER_CLOUD_TOKEN }}
CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.MB_PRO_CLOUD_TOKEN }}
CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.MB_PRO_SELF_HOSTED_TOKEN }}
MB_RUN_MODE: e2e
METASTORE_DEV_SERVER_URL: ${{ secrets.METASTORE_DEV_SERVER_URL }}
CYPRESS_MB_ALL_FEATURES_TOKEN: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
CYPRESS_MB_STARTER_CLOUD_TOKEN: ${{ secrets.STAGING_MB_STARTER_CLOUD_TOKEN }}
CYPRESS_MB_PRO_CLOUD_TOKEN: ${{ secrets.STAGING_MB_PRO_CLOUD_TOKEN }}
CYPRESS_MB_PRO_SELF_HOSTED_TOKEN: ${{ secrets.STAGING_MB_PRO_SELF_HOSTED_TOKEN }}
# these are needed for backwards compatibility with release branches earlier than v55, since
# this workflow always runs from master, but we run tests from the release branch
CYPRESS_ALL_FEATURES_TOKEN: ${{ secrets.MB_ALL_FEATURES_TOKEN }}
CYPRESS_NO_FEATURES_TOKEN: ${{ secrets.MB_STARTER_CLOUD_TOKEN }}
CYPRESS_ALL_FEATURES_TOKEN: ${{ secrets.STAGING_MB_ALL_FEATURES_TOKEN }}
CYPRESS_NO_FEATURES_TOKEN: ${{ secrets.STAGING_MB_STARTER_CLOUD_TOKEN }}
# disabled because of out of memory issues
# probably related to https://github.com/cypress-io/cypress/issues/27415
CYPRESS_NO_COMMAND_LOG: 1
@@ -159,19 +161,21 @@ jobs:
- name: Run a few important OSS Cypress tests as sanity check
if: ${{ matrix.edition == 'oss' }}
env:
CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
run: |
node e2e/runner/run_cypress_ci.js e2e \
--env grepTags="@smoke+-@EE",grepOmitFiltered=true \
--spec './e2e/test/scenarios/**/*.cy.spec.(js|ts)' \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
--env grepTags="@smoke+-@EE" \
--spec './e2e/test/scenarios/**/*.cy.spec.(js|ts)'
- name: Run a few important EE Cypress tests as sanity check
if: ${{ matrix.edition == 'ee' }}
env:
CYPRESS_BROWSER: ${{ steps.cypress-prep.outputs.chrome-path }}
run: |
node e2e/runner/run_cypress_ci.js e2e \
--env grepTags="@smoke+-@OSS",grepOmitFiltered=true \
--spec './e2e/test/scenarios/**/*.cy.spec.(js|ts)' \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
--env grepTags="@smoke+-@OSS" \
--spec './e2e/test/scenarios/**/*.cy.spec.(js|ts)'
- name: Upload Cypress Artifacts upon failure
uses: actions/upload-artifact@v4

View File

@@ -8,9 +8,9 @@ on:
description: "Branch we want to release the SDK from (to release from other branches use the workflow from those branches)"
type: choice
required: true
default: "master"
default: release-x.57.x
options:
- master
- release-x.57.x
concurrency:
# We want to ensure only one job is running at a time per branch because
@@ -254,8 +254,6 @@ jobs:
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "release-sdk"
- name: Run unit tests
run: yarn embedding-sdk:test-unit
@@ -277,8 +275,6 @@ jobs:
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "release-sdk"
- name: Bump published npm package version
# NOTE: this should happen before "Build SDK bundle" as we inject SDK version into the code during build step
@@ -349,8 +345,9 @@ jobs:
GH_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Edit PR adding useful information (using Metabase bot app)
# metabase/embedding team is added automatically as code owner of updated `package.template.json` file
run: |
gh pr edit --add-reviewer @metabase/embedding,albertoperdomo --add-label no-backport
gh pr edit --add-reviewer albertoperdomo --add-label no-backport
env:
GH_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
@@ -372,42 +369,16 @@ jobs:
name: metabase-sdk
path: sdk
- name: Compute master tag
id: compute-tag
run: |
if [ -n "${{ needs.determine-sdk-version.outputs.pre_release_label }}" ]; then
echo "masterTag=${{ needs.determine-sdk-version.outputs.pre_release_label }}" >> $GITHUB_OUTPUT
else
echo "masterTag=nightly" >> $GITHUB_OUTPUT
fi
- name: Publish to NPM
working-directory: sdk
run: |
echo //registry.npmjs.org/:_authToken=${{ secrets.NPM_RELEASE_TOKEN }} > .npmrc
npm publish --tag 57-stable
TAG=$(jq -r --null-input \
--arg branch "${{ inputs.branch }}" \
--arg masterTag "${{ steps.compute-tag.outputs.masterTag }}" '
{
"master": $masterTag,
"release-x.51.x": "51-stable",
"release-x.52.x": "52-stable",
"release-x.53.x": "53-stable",
"release-x.54.x": "54-stable",
"release-x.55.x": "55-stable",
"release-x.56.x": "56-stable"
}[$branch]'
)
echo "Resolved npm tag: $TAG"
npm publish --tag "$TAG"
- name: Add `latest` tag to the latest release branch (`release-x.55.x`) deployment
if: ${{ inputs.branch == 'release-x.56.x' }}
working-directory: sdk
run: |
npm dist-tag add @metabase/embedding-sdk-react@${{ env.sdk_version }} latest
# - name: Add `latest` tag to the latest release branch deployment
# working-directory: sdk
# run: |
# npm dist-tag add @metabase/embedding-sdk-react@${{ env.sdk_version }} latest
git-tag:
needs: [publish-npm, determine-sdk-version]

View File

@@ -47,7 +47,7 @@ jobs:
with:
script: | # js
const {
getVersionFromReleaseBranch,
getMajorVersionFromRef,
getMajorVersion,
} = require('${{ github.workspace }}/release/dist/index.cjs');
@@ -60,11 +60,10 @@ jobs:
}
// otherwise, get the version from the release branch name
const branch = context.payload.ref;
const version = getVersionFromReleaseBranch(branch);
const majorVersion = getMajorVersion(version);
const ref = context.payload.ref;
const majorVersion = getMajorVersionFromRef(ref);
console.log({ branch, version, majorVersion });
console.log({ ref, majorVersion });
core.exportVariable('VERSION', majorVersion);
- name: generate release Log

View File

@@ -8,6 +8,11 @@ on:
description: 'Major Metabase version (e.g. 45, 52, 68)'
type: number
required: true
override_sha:
description: DANGEROUSLY allow releasing from this commit sha, regardless of the state of CI (can be empty)
type: string
required: false
default: ''
schedule:
- cron: '0 21 * * 1-5' # every weekday at 4 pm EST/5 pm EDT
@@ -37,7 +42,7 @@ jobs:
const lastRelease = currentRelease - 1;
const AUTO_RELEASE_VERSIONS = [lastRelease, currentRelease];
async function releasePatchFor(majorVersion) {
async function releasePatchFor(majorVersion, overrideSha) {
const nextPatch = await getNextPatchVersion({
github,
owner: context.repo.owner,
@@ -45,7 +50,7 @@ jobs:
majorVersion,
});
const goodCommit = await getLatestGreenCommit({
const releaseCommit = overrideSha ?? await getLatestGreenCommit({
github,
owner: context.repo.owner,
repo: context.repo.repo,
@@ -56,25 +61,25 @@ jobs:
github,
owner: context.repo.owner,
repo: context.repo.repo,
ref: goodCommit,
ref: releaseCommit,
majorVersion: Number(majorVersion),
});
if (nextPatch && goodCommit && !hasBeenReleased) {
if (nextPatch && releaseCommit && !hasBeenReleased) {
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'tag-for-release.yml',
ref: 'refs/heads/master',
inputs: {
commit: goodCommit,
commit: releaseCommit,
version: nextPatch,
auto: true,
}
});
} else {
console.log(
{ nextPatch, goodCommit, hasBeenReleased }
{ nextPatch, releaseCommit, hasBeenReleased }
);
console.error(`No new patch version or no green commit found for v${majorVersion}`);
}
@@ -88,7 +93,15 @@ jobs:
throw new Error(`Invalid version number: ${inputVersion}`);
}
await releasePatchFor(inputVersion);
// only allow overriding the commit SHA for workflow_dispatch events with a provided sha
const overrideSha = String(context.payload?.inputs?.override_sha ?? '').trim();
const isValidOverride = overrideSha.length === 40;
if (!isValidOverride && overrideSha.length > 0) {
throw new Error(`Invalid override SHA provided: ${overrideSha}`);
}
await releasePatchFor(inputVersion, isValidOverride ? overrideSha : undefined);
} else { // scheduled release of AUTO_RELEASE_VERSIONS
await Promise.all(AUTO_RELEASE_VERSIONS.map(releasePatchFor));
}

View File

@@ -12,7 +12,7 @@ on:
jobs:
files-changed:
if: ${{ !contains(github.event.pull_request.labels.*.name,'ci skip') }}
if: ${{ !contains(github.event.pull_request.labels.*.name,'ci skip') && !contains(github.event.pull_request.labels.*.name,'minimal-tests') }}
name: Check which files changed
runs-on: ubuntu-22.04
timeout-minutes: 5
@@ -25,6 +25,10 @@ jobs:
frontend_all: ${{ steps.changes.outputs.frontend_all }}
frontend_sources: ${{ steps.changes.outputs.frontend_sources }}
documentation: ${{ steps.changes.outputs.documentation }}
embedding_documentation: ${{ steps.changes.outputs.embedding_documentation }}
embedding_sdk_components: ${{ steps.changes.outputs.embedding_sdk_components }}
embedding_sdk_host_sample_apps: ${{ steps.changes.outputs.embedding_sdk_host_sample_apps }}
embedding_sdk_ci: ${{ steps.changes.outputs.embedding_sdk_ci }}
steps:
- uses: actions/checkout@v4
- name: Test which files changed
@@ -36,51 +40,19 @@ jobs:
list-files: csv
filters: .github/file-paths.yaml
static-viz-files-changed:
name: Check whether static-viz files changed
if: ${{ !contains(github.event.pull_request.labels.*.name,'ci skip') }}
runs-on: ubuntu-22.04
timeout-minutes: 10
outputs:
static_viz: ${{ steps.static_viz.outputs.static_viz }}
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "files-changed"
- name: Build static-viz frontend
run: yarn build-static-viz
env:
MB_EDITION: ee
- name: Upload Static Viz Bundle Artifact
uses: actions/upload-artifact@v4
with:
name: static-viz-bundle-${{ github.sha }}
path: resources/frontend_client/app/dist
- name: Check for static viz changes
uses: dorny/paths-filter@v3.0.0
id: static_viz
with:
token: ${{ github.token }}
filters: .github/static-viz-sources.yaml
uberjar:
needs: [files-changed, static-viz-files-changed]
needs: [files-changed]
if: ${{ !cancelled() && !(needs.files-changed.outputs.documentation == 'true' && needs.files-changed.outputs.backend_all == 'false' && needs.files-changed.outputs.frontend_all == 'false' && needs.files-changed.outputs.e2e_all == 'false') }}
uses: ./.github/workflows/uberjar.yml
secrets: inherit
backend-tests:
if: ${{ !cancelled() && needs.files-changed.result == 'success' }}
needs: [files-changed, static-viz-files-changed]
needs: [files-changed]
uses: ./.github/workflows/backend.yml
secrets: inherit
with:
skip: ${{ needs.files-changed.outputs.backend_all != 'true' && needs.static-viz-files-changed.outputs.static_viz != 'true' }}
skip: ${{ needs.files-changed.outputs.backend_all != 'true' }}
semantic-search-tests:
needs: files-changed
@@ -124,18 +96,50 @@ jobs:
# list of changed specs files, then only specs are changed and we can run only those specs
specs: ${{ needs.files-changed.outputs.e2e_all_files == needs.files-changed.outputs.e2e_specs_files && needs.files-changed.outputs.e2e_specs_files || '' }}
embedding-sdk-package:
needs: [files-changed]
if: |
!cancelled() &&
(needs.files-changed.outputs.embedding_sdk_components == 'true' ||
needs.files-changed.outputs.frontend_sources == 'true' ||
needs.files-changed.outputs.embedding_documentation == 'true' ||
needs.files-changed.outputs.embedding_sdk_ci == 'true')
uses: ./.github/workflows/embedding-sdk-package-build.yml
secrets: inherit
sdk-tests:
needs: files-changed
needs: [uberjar, embedding-sdk-package, files-changed]
if: always()
uses: ./.github/workflows/embedding-sdk.yml
secrets: inherit
with:
cli-snippets-type-check: ${{ needs.files-changed.outputs.frontend_sources == 'true' }}
docs-snippets-type-check: ${{ needs.files-changed.outputs.embedding_documentation == 'true' }}
documentation-validation: ${{ needs.files-changed.outputs.frontend_sources == 'true' }}
component-tests: ${{ needs.files-changed.outputs.embedding_sdk_components == 'true' }}
host-sample-apps-tests: ${{ needs.files-changed.outputs.embedding_sdk_host_sample_apps == 'true' }}
skip: ${{ needs.embedding-sdk-package.result != 'success' || needs.uberjar.result != 'success' }}
pr-env:
needs: [uberjar]
if: |
!cancelled() &&
contains(github.event.pull_request.labels.*.name, 'PR-Env')
contains(github.event.pull_request.labels.*.name, 'PR-Env') &&
!contains(github.event.pull_request.labels.*.name, 'PR-Env-analytics-dev')
uses: ./.github/workflows/pr-env.yml
secrets: inherit
with:
analytics_dev_mode: false
pr-env-analytics-dev:
needs: [uberjar]
if: |
!cancelled() &&
contains(github.event.pull_request.labels.*.name, 'PR-Env-analytics-dev')
uses: ./.github/workflows/pr-env.yml
secrets: inherit
with:
analytics_dev_mode: true
containerize:
needs: [uberjar]

View File

@@ -23,8 +23,6 @@ jobs:
- uses: actions/checkout@v4
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'snyk'
- name: Generate all pom.xml
run: .github/scripts/write-poms.sh
- name: Upload pom files

View File

@@ -29,8 +29,6 @@ jobs:
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: manage-translations
- name: install gettext
run: sudo apt-get install gettext

View File

@@ -46,8 +46,6 @@ jobs:
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- run: yarn build-pure:cljs
name: Compile CLJS

View File

@@ -134,7 +134,6 @@ jobs:
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: uberjar
java-version: "${{ needs.get-build-requirements.outputs.java_version || 21 }}"
- name: Build
run: ./bin/build.sh
@@ -147,7 +146,13 @@ jobs:
runs-on: ubuntu-22.04
name: Is ${{ matrix.edition }} (java ${{ matrix.java-version }}) healthy?
needs: [build, check-existing-artifacts]
if: always() && !cancelled() && (needs.build.result == 'success' || (needs.check-existing-artifacts.outputs.should_build == 'false' && needs.check-existing-artifacts.outputs.ee_exists == 'true' && needs.check-existing-artifacts.outputs.oss_exists == 'true'))
# We only care about the explicit JAR health check on push to `master` and the `release-` branches.
# JARs created in random branches on PRs are 99% of the time treated as ephemeral, and used only in e2e tests.
# E2E tests already have a step where they wait for the instance health check.
if: |
always() && !cancelled() &&
(github.ref_name == 'master' || startsWith(github.ref_name, 'release-')) &&
(needs.build.result == 'success' || (needs.check-existing-artifacts.outputs.should_build == 'false' && needs.check-existing-artifacts.outputs.ee_exists == 'true' && needs.check-existing-artifacts.outputs.oss_exists == 'true'))
timeout-minutes: 10
strategy:
matrix:

View File

@@ -27,8 +27,6 @@ jobs:
token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'update-be-deps'
- name: Open PRs to Upgrade Backend Deps
uses: ./.github/actions/upgrade-backend-deps
with:

View File

@@ -16,7 +16,5 @@ jobs:
- uses: actions/checkout@v4
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'whitespace-linter'
- run: clojure -T:whitespace-linter lint
name: Run Whitespace Linter

1
.gitignore vendored
View File

@@ -104,6 +104,7 @@ dev/serialization_deltas/
*.tsbuildinfo
/trace-output/
/temp-types/
/frontend/src/metabase-types/openapi
**/cypress_sample_database.json
**/cypress_sample_instance_data.json

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Some files were not shown because too many files have changed in this diff Show More