Compare commits

...

1585 Commits

Author SHA1 Message Date
Eric Normand
b584b35cd9 Better tests 2025-12-01 15:19:51 -06:00
Eric Normand
a36cda7ffd Merge branch 'master' into representations 2025-12-01 15:19:00 -06:00
Cam Saul
7f68894e80 New deps graph tooling to power Mage test watching (#66345) 2025-12-01 19:53:40 +00:00
Eric Normand
151f143233 Whitespace 2025-12-01 13:42:15 -06:00
Eric Normand
e440239b79 Move question test 2025-12-01 13:40:24 -06:00
Eric Normand
0f41ae3925 Remove stray whitespace 2025-12-01 13:35:25 -06:00
Eric Normand
d4344c308e Use representations build from clojars 2025-12-01 13:33:17 -06:00
Ryan Laurie
b933496d37 Don't use entities for Icons (#65633)
* dont need entities for collections methinks

* entities don't handle icons anymore

* revert url change (for now)

* fix tests

* fix verified model icon

* consistent handling of verified model icons
2025-12-01 12:32:53 -07:00
Jeff Bruemmer
32d69c1a4f remove env vars that now have defsettings (#66434) 2025-12-01 19:23:55 +00:00
Alex Yarosh
7096051905 Docs: DBs for editable tables (#66276)
* 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
2025-12-01 14:07:10 -05:00
Nemanja Glumac
e88075f7d4 Fix snapshots for backport compatibility tests (#66433) 2025-12-01 19:50:28 +01:00
github-automation-metabase
13db04d7a0 Update generated docs (master) (#66300)
Co-authored-by: github-actions <github-actions@github.com>
2025-12-01 13:43:39 -05:00
Jeff Bruemmer
3ae80a41da don't run on draft prs (#66426) 2025-12-01 12:13:37 -05:00
Eric Normand
6414a9d73b Closed connection with many fields (#66051)
Fix legacy path (for snowflake with large number of fields)
2025-12-01 15:53:12 +00:00
Gabriel Moreno
19a79d96c1 Add gantoreno to team.json and github-slack-map.json (#66334)
* feat: add myself (gantoreno) to `team.json` and `github-slack-map.json`

* fix: correct username alphabetical order
2025-12-01 11:01:41 -04:00
Nemanja Glumac
637fa143ff Provide minimal sane defaults to the Cypress runner (#66398)
- If you decide to build the backend, you should run it
- There are no more derived options - everything is explicit
- Running Docker containers is a non-negotiable
    - Tests need these supporting services to run
    - If you really insist on not running them, either comment out those lines temporarily or do not use this script to set up the e2e environment
    - Because of this, there are no more custom envs `QA_DB_ENABLED` and `CYPRESS_QA_DB_MONGO`
- Alternative location (directory) for the e2e copy of the sample-application.db is now set to be `e2e/tmp` since it's already gitignored
2025-12-01 15:44:48 +01:00
Riley Thompson
8393eb2820 Use backfill specific event to prevent card revisions (#66401)
* use backfill specific event

* fix kondo

* add test

* fix config modules

* add migration

* remove migrations
2025-12-01 14:20:52 +00:00
Brad Anderson
e67f25b401 UXW-2209 Update datamodel tracking triggered_from (#66259)
* UXW-2209 Updates datamodel tracking triggered_from to be either "data_studio" or "admin" depending on where the metadata is being edited

* Updates e2e tests
2025-12-01 09:13:11 -05:00
Brad Anderson
39dfac795e UXW-2352 Fix issue where CopyCardForm resets when the destination collection is changed (#66275)
* UXW-2352 Fix issue where CopyCardForm resets when the destination collection is changed

* Unskips now-passing e2e tests

* Fix issue where Duplicate modal doesn't close on success
2025-12-01 09:12:42 -05:00
Egor Grushin
9bef191295 small ui fixes GDGT-1276 (#66406)
* fix GDGT-1276

* fix tests
2025-12-01 12:07:18 +00:00
Nathan Voxland
520de22c5e Fixed semantic-search filtering by collection (#66286) 2025-11-30 20:28:21 -06:00
Oleksandr Yakushev
67a99bb92d [perf] More efficient validator-cache old key eviction (#65890) 2025-11-29 20:03:33 +02:00
Nick Fitzpatrick
cbe07addba should show library (#66343)
* should show library

* tests

* more tests

* types

* uxw-2344

* I guess I forgot this?
2025-11-28 14:33:53 -04:00
Nemanja Glumac
4efe26824e Explicitly use the backend JAR for local Cypress runs (#66349)
The previous version of the build script (`build-for-test`) had a weird quirk that could be both confusing and dangerous. It was building a backend-only JAR in the same location and under same name as the full-blown, all-in-one Metabase JAR. This means that, by running Cypress locally, one could easily override the previously built healthy JAR. It's not catastrophic but it was confusing.

This PR makes it perfectly clear what we're doing, and there should be no conflicts between the JARs any longer.
2025-11-28 12:01:27 +00:00
Nemanja Glumac
b7ff644e78 Have a dedicated runner for SDK host/sample apps (#66378) 2025-11-28 10:09:03 +01:00
Nick Fitzpatrick
ccbda1251f updating watermark svg color and opacity (#66339)
* updating watermark svg color and opacity

* static viz development mark has same color and opacity as dynamic viz
2025-11-27 12:40:49 -04:00
Stas Gavrylov
a07c3b654e Incremental transforms (#65842)
* library collection search

* Fix e2e tests from group-16

* Fix a couple tests from group 42

* Fix e2e tests from group-17

* Fix e2e tests from group-18

* tests: add bulk publishing scenario

fix wrong collection link in case of root collection

* UXW-2315, UXW-2314

* UXW-2294

* more UXW-2315, UXW-2314

* more UXW-2315, UXW-2314

* correct collection types

* Remove Browsing Memory Feature

* Revert "Revert "Don't return library collections by default from APIs""

This reverts commit 814c49473b.

* Revert "Revert "Fixed null type filtering""

This reverts commit 25e0d78408.

* fetch full tree to have library collections visible

* show library in permissions

* Fixing tests

* fix infinite re-render in tree

* rewrite unit tests and fix max depth problem

* fix: publish property not validated in the tree view after table publishing

* Move bulk editing apis to enterprise (#65968)

* Make sidebar sticky

* test: bulk attribute actions for tables, schemas and dbs

* fix more unit tests

* Copy preview section tests

* Copy error handling tests

* Copy undos tests

* Update test

* test: update new ee endpoints paths

* Make new bulk table APIs ee-only (fe)
- Closes GDGT-1251

* Fix global H.DataModel.visit overrides

* Remove redundant cy.reload

* Remove redundant cy.reload

* add select/deselect tests

* use helper

* data picker using proper library endpoint. Fixing types I broke. Endless Shame

* Fix Tree skeleton resizing multiple times during loading
- Closes GDGT-1253

* Improve icon

* Fill content

* don't call getCollectionItems on database collection

* add search tests and support shift click in search

* default table publish collection

* fox: reset bulk form values when selection changes

* Fix e2e tests from group-19

* fix:  fix missing dependencies in useEffect gdgt-1245

* test: refactor test setup action order

* Fix e2e tests from group-20

* Fix e2e tests from group-22

* Fix e2e tests from group-23

* test: restore default db as the first step

* Kondo the kondo config

* default collections for metrics and models outside of data studio

* Move edit test to ee

* Fix list filtering now default is bronze

* Move bulk-edit-test to ee

* Fix table metadata for test

* Revert "Added `collection` argument to search"

This reverts commits:
- 21999e01
- b0f71c03ea
- 4fa0c3b422

* Fixed OSS loading of tables

* Fixed OSS loading of tables

* add tests for filtering

* Fix e2e tests from group 41 / joins-repros

* more tests

* Fix e2e tests from group-20

* Fix e2e tests from group-23

* Fix e2e tests from group-24

* Fix e2e tests from group-26

* Fix e2e tests from group-27

* Fix e2e tests from group-28

* Fix e2e tests from group-30

* constuct initial paths from library collections

* segments editor, hasEnabledNestedQueries

* Fix a couple more (something between groups 40 and 43)

* Fixed module config

* keyboard navigation

* Added library/tree API

* Fix some e2e tests from groups 40 and 42

* Fixing tests

* disable scoped search on the 'database collection', models.cy.spec should be passing now

* Fix e2e tests from group-33

* Minor cleanup

* Fix e2e tests from group-34

* Fixing tests

* Fix e2e tests from group 37 (except one depending on Recents tab)

* Starts fixing e2e tests from oss group

* cleanup

* wait to focus

* hide our analytics in the data studio

* Added library/tree API

* merge library and data studio

* change backend library flag validation to data-studio

* tidy things up

* Make bulk edit inputs non-clearable
- This prevents sending "empty" requests when clearing values
- And clearing does not really make sense here

* fix: test: table rescan and discard mocks are wrong

* fix: test: wrong mock in oss sync table schema

* Remove ^:parallel from bulk edit tests

They can contend and cause deadlocks

* fix: test: failure due to repeated mocking of same route

* test: refactor: cypress table tests

* Update e2e test

* Update e2e test

* Update e2e test

* fix browse nav section test

* Add missing token

* add check icon for published tables

* Removed unused import

* Updates some e2e tests from oss group, removes some now-invalid tests

* test: use default external db, skip transform test

* Starts fixing e2e tests from mongo group

* remove background from not active table in search

* specs

* Fix e2e tests from group-15

* hack fix ci while i'm on meetings

* scoped search is back

* Fix some e2e tests from group-32

* table picker fixes

* Fixed merge

* Fix e2e test from group-42

* merge fixes

* re-enable the recents tab on the data picker modal

* Avoid race condition on list-table-filtering-test

* fix embedding types

* mini picker unit tests

* Fixing tests

* ci, fixes

* fix library collection bugs

* cleanup data studio plugin

* fix lots of unit tests

* fix import

* fix

* Fixed unused import

* Fixed accidental #p

* ci

* revert util

* specs

* specs

* specs

* fix bug / bad type in SchemaFormSelect (#65995)

* Use actual anti join in GET /table query

* Remove old comments

* Activate token after restore

* test: unskip table metadata transform test

* test: fix search tables e2e test

* fix: test: selection in table picker

* Fix Source input disabled when filtering by Metabase transform
- Closes GDGT-1259

* test: fix: filter unused table

* Fix e2e test

* fix: test: datamodel toasts and errors

* Fix e2e test

* Fix e2e tests from group-9

* Fix flaky tests

* GDGT-1244: Fix DB tree virtualization (#66125)

* GDGT-1244: Fix tree virtualization. Replace top with translateY to improve performance

* GDGT-1244: Fix scroll bug. Refactor border styling

* bring back modeling empty state

* test: adjust publishing test

* Fix e2e test from group-22

* Fix e2e test from group-25

* fix allowing cross DB joins

* properly disable invalid items in MiniPicker

* Fix e2e test from group-26

* Fix straggler from oss group

* Starts fixing e2e tests from group-32

* unit test adjustments

* Fix remaining issue with e2e group 37

* fix item filtering

* Update Loki Snapshots

* add recent views to mini picker

* test recents and backparsing

* additional filtering test

* fix minipicker shows items it should not show

* Fixed :here in library API

* Fixed :here in library API

* UXW-2358 publishing outside of the data studio

* Fixed :here in library API

* snapshot

* Fix most e2e tests from group-32

* Lint fixes

* Fixed failing test

* revert fix

* Reapply "Added `collection` argument to search"

This reverts commit f28d9d5af9.

* Quick fix in CollectionPicker/utils.ts

* Fix flaky Remote Sync test (#65862)

* Clean up backend-test matrix (#66158)

* Fix timeseries value detection (#66161)

* Prevent driver tests (#66156)

Co-authored-by: Bryan Maass <bryan.maass@gmail.com>

* Fetch uberjar using a proper action (#66165)

* fix embedding column picking

* Trying CI with search_index.verified

* Fixed failing test

* Translate label

* Fixed failing test

* fix: published info not updated in the tree picker after deleting model

* fix: refactor: publish collection link tests

* Fixed failing test

* Fix remaining e2e tests from group-32

* FileUploadStatus unit test, quesiton reproductions

* create data studio plugin file

* fix hidden items some more

* Fix issue where confirmation modal closes then reopens again then closes again when you archive a dashboard

* fix dark mode

* UXW-2367

* UXW-2378

* Fixed merge issues

* this element is not visible because you can't even open incompatible sample database db

* Fix e2e test from group-14

* fix embedding data picker clicks

* filtering fixes for transforms

* UXW-2372

* update mini picker specs after a fix

* fix flaky join test

* Fixing in-place support for collections

* fix: cannot scroll search results

* ui: tweak search results checkbox spacing to match tree results

* fix: scroll position jump when entering field sort mode gdgt-1269

* Revert "fix: scroll position jump when entering field sort mode gdgt-1269"

This reverts commit bfecdec661.

* UXW-2279 Changes Data Studio's Glossary page background color to background-secondary

* Fix linters

* Fix e2e tests

* fixes for sqlserver

* fix driver changelog

* fix

* more fix

* fix: support params in bigq

* fix: inline params for sqlserver

* fix test

* fix: we do want the unique key

* fix: missing nil in test

* fix clickhouse

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
Co-authored-by: Anderson <anderson@metabase.com>
Co-authored-by: Jakub Chodorowicz <jakub@chodorowicz.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
Co-authored-by: Nathan Voxland <nathan@metabase.com>
Co-authored-by: Uladzimir Havenchyk <uladzimir@metabase.com>
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Dan Stone <wotbrew@gmail.com>
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
Co-authored-by: John Swanson <john.swanson@metabase.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
Co-authored-by: dpsutton <dan@dpsutton.com>
Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
2025-11-27 15:52:19 +00:00
Anderson
e80478b006 Prevent database sync status element to overlap pagination (#66225) 2025-11-27 11:16:01 -03:00
Anderson
c8d87bdf7b Do not allow setting up remote sync if git url is not set (#66281) 2025-11-27 11:14:41 -03:00
Anderson
e2ec2f6aff Fix broken PDF export layout due to CSP violation for inline styles (#66337) 2025-11-27 11:14:20 -03:00
Nick Fitzpatrick
ce9ac84ecc Update selector for loki test in Palette.stories (#66333) 2025-11-27 10:07:03 -04:00
Nemanja Glumac
66b5043940 Make file-path triggers more robust (#66311)
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.
2025-11-27 14:01:33 +01:00
Ngoc Khuat
2b607f547a fix false positive logs (#66325) 2025-11-27 12:50:47 +00:00
Jakub Chodorowicz
0400e1bf07 fix: scroll position jump when entering field sort mode gdgt-1269 (#66318)
* fix: scroll position jump when entering field sort mode gdgt-1269

* test: fix failing unit test selector

* fix: e2e test selectors

* fix: test selectors for sync button

* test: adjust sync button selector

* test: fix semantic selector

* Update enterprise/frontend/src/metabase-enterprise/data-studio/data-model/components/TableSection/TableSection.tsx

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-11-27 10:48:43 +01:00
appleby
df5abbd1b9 Add :database_type to metabot tools that return column metadata (#66302)
* 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`.
2025-11-26 23:32:44 +00:00
Egor Grushin
99fa786ec8 fix: flake test number 29943 (#66283)
* fix: flake test number 29943

* mark moveDnDKitElement as deprecated, fix singleused constant
2025-11-26 22:08:24 +00:00
Noah Moss
b561b5c8b9 Revised approach to related_tables and consistent field IDs for implicitly-joined fields (#66271)
* 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
2025-11-26 15:48:30 -05:00
Nathan Voxland
f2e8e294f8 Add warning for when mismatch in serdes version during loading (#66140) 2025-11-26 14:30:15 -06:00
Riley Thompson
8257c072a9 Revert "Bump com.clickhouse/clickhouse-jdbc from 0.8.4 to 0.9.2 (#64168)" (#66326)
This reverts commit 31f76f5856.
2025-11-26 17:59:28 +00:00
Denis Berezin
08770c8e8f UXW-1778 remove chart hover effects when exporting to png (#66200)
* UXW-1778 remove chart hover effects when exporting to png

* Fix typing and unit tests

* review fix
2025-11-26 19:02:51 +03:00
Nemanja Glumac
4ef178f794 Support building an uberjar with a custom filename (#66315)
* Make uberjar (artifact) file name configurable via env var

Add the ability to customize the output filename for the uberjar build
via the MB_JAR_FILENAME environment variable. This allows backend-only
test builds to use a separate filename (e.g., metabase-backend.jar)
to avoid overwriting the regular all-in-one metabase.jar.
2025-11-26 15:45:19 +00:00
Gabriel Moreno
89443cda94 UXW-2228 Properly mention available subscription & alert channels for non-admins (#66273)
* 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
2025-11-26 15:04:34 +00:00
Edward Paget
99fd1809cb Get user attributes from attributes map (#66274)
* Get user attributes from attributes map

* fixup! e2e test
2025-11-26 14:38:33 +00:00
Braden Shepherdson
868fb6da0a [MBQL lib] Allow string literals as arg to aggregations like :max (#66220)
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 ...)`
2025-11-26 13:28:57 +00:00
Nicolò Pretto
8a56f6b3bb update file path to include tsx extension for component tests (#66254) 2025-11-26 11:00:31 +01:00
github-automation-metabase
384d24a75b Bump org.clojure/tools.cli from 1.1.230 to 1.2.245 (#64159)
Inspect dependency changes here: https://github.com/clojure/tools.cli/blob/v1.2.245/CHANGELOG.md

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-26 00:04:43 +00:00
Cam Saul
e94dd16252 Split Redshift driver tests into two jobs (#66289) 2025-11-25 15:39:13 -08:00
Fraser
561d578043 Fix eslint cache (#66066) 2025-11-26 12:29:56 +13:00
github-automation-metabase
6f778c9269 Bump com.google.guava/guava from 33.4.8-jre to 33.5.0-jre (#63796)
Inspect dependency changes here:

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
Co-authored-by: bryan <bryan.maass@gmail.com>
2025-11-25 23:03:44 +00:00
bryan
9b93bfe279 Only real app-dbs should print setup instructions (#66255) 2025-11-25 23:03:06 +00:00
Nemanja Glumac
dc89b2bbeb Decouple the cleanup logic from running Cypress (#66236)
This pull request refactors the Cypress runner utility to simplify error handling and improve consistency in how test failures are reported. The main change is that runCypress now throws errors on test failures instead of relying on an external exit or cleanup function, which streamlines its usage across different scripts.

This ensures consistent error propagation and simplifies the control flow for callers.
2025-11-25 23:10:02 +01:00
github-automation-metabase
538ebb5f08 Bump cheshire/cheshire from 6.0.0 to 6.1.0 (#63217)
* Bump cheshire/cheshire from 6.0.0 to 6.1.0

Inspect dependency changes here: https://github.com/dakrone/cheshire/blob/6.1.0/ChangeLog.md

* update timestamps to match new cheshire parsing

---------

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
2025-11-25 22:02:13 +00:00
Nemanja Glumac
e4325d4e02 Always pass the input conditions to sdk jobs (#66269) 2025-11-25 22:56:17 +01:00
bryan
b453baf5ed Upgrades mage run-tests (#66108) 2025-11-25 21:42:28 +00:00
github-automation-metabase
773a588692 Bump org.apache.commons/commons-lang3 from 3.18.0 to 3.19.0 (#64150)
Inspect dependency changes here:

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
Co-authored-by: bryan <bryan.maass@gmail.com>
2025-11-25 21:38:24 +00:00
github-automation-metabase
31f76f5856 Bump com.clickhouse/clickhouse-jdbc from 0.8.4 to 0.9.2 (#64168)
Inspect dependency changes here:

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
Co-authored-by: bryan <bryan.maass@gmail.com>
2025-11-25 21:35:15 +00:00
github-automation-metabase
81f10bdb3c Update generated docs (master) (#66228)
Co-authored-by: github-actions <github-actions@github.com>
2025-11-25 21:34:41 +00:00
github-automation-metabase
3dcfbce301 Bump org.apache.calcite.avatica/avatica from 1.26.0 to 1.27.0 (#64402)
Inspect dependency changes here: https://github.com/apache/calcite-avatica/compare/avatica-1.26.0-rc0...avatica-1.27.0-rc0

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-25 21:17:19 +00:00
Eric Normand
ae23f598f0 Remove special representations workflow 2025-11-25 15:01:42 -06:00
appleby
5c10e2d7a3 Add :database_engine to metabot table-details and card-details (#66227)
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.
2025-11-25 12:03:13 -08:00
github-automation-metabase
53f51fa289 Bump org.apache.arrow/arrow-memory-netty from 17.0.0 to 18.3.0 (#64401)
* Bump org.apache.arrow/arrow-memory-netty from 17.0.0 to 18.3.0

Inspect dependency changes here:

* Upgrade arrow-memory-core to version 18.3.0

Updated the version of arrow-memory-core from 17.0.0 to 18.3.0.

* Consolidate changes

* Fix formatting

---------

Co-authored-by: bryan <bryan.maass@gmail.com>
Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-25 19:41:46 +00:00
github-automation-metabase
4280e1af7a Bump org.jsoup/jsoup from 1.21.1 to 1.21.2 (#62652)
Inspect dependency changes here: https://github.com/jhy/jsoup/blob/jsoup-1.21.2/CHANGES.md

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
Co-authored-by: bryan <bryan.maass@gmail.com>
2025-11-25 19:31:30 +00:00
Phoomparin Mano
0a2255c36f ci(sdk): only setup specific enterprise plugins in sdk unit tests as needed (#66238) 2025-11-26 02:03:22 +07:00
bryan
e1e8d53234 add deprecation support to defendpoint dox-gen (#66053) 2025-11-25 18:35:00 +00:00
Nemanja Glumac
cca02fcf31 Fix JAR health check condition logic (#66266)
Addresses this finding by the Claude code review:
https://github.com/metabase/metabase/pull/66237#discussion_r2560704357
2025-11-25 19:23:11 +01:00
Noah Moss
eb4a9f528e Move audit installation before search initialization again (#66222) 2025-11-25 12:02:01 -05:00
Nemanja Glumac
6e30ce468c Run JAR health check only on master and release branches (#66237) 2025-11-25 17:43:27 +01:00
Alexander Polyankin
96eac2d9da Data Studio (#65281)
* Fix some e2e tests from group-9

* test: add bulk sync action e2e test

* fix column selection

* Fixed module config

* Fix a few e2e tests from oss group

* Fix e2e tests from groups 46 and 47

* Fix e2e tests from groups 44 and 45

* Fix group-3 straggler, some of group-8

* Potentially disastrous change (increases item-picker-level of SchemaList and TableList) to fix test in group-8

* Fix group-6 straggler, some more of group-8

* Updates some more e2e tests from group-9 (some actual failures left)

* Fix e2e tests from group-14

* do enterprise code correctly

* library collection search

* Fix e2e tests from group-16

* Fix a couple tests from group 42

* Fix e2e tests from group-17

* Fix e2e tests from group-18

* tests: add bulk publishing scenario

fix wrong collection link in case of root collection

* UXW-2315, UXW-2314

* UXW-2294

* more UXW-2315, UXW-2314

* more UXW-2315, UXW-2314

* correct collection types

* Remove Browsing Memory Feature

* Revert "Revert "Don't return library collections by default from APIs""

This reverts commit 814c49473b.

* Revert "Revert "Fixed null type filtering""

This reverts commit 25e0d78408.

* fetch full tree to have library collections visible

* show library in permissions

* Fixing tests

* fix infinite re-render in tree

* rewrite unit tests and fix max depth problem

* fix: publish property not validated in the tree view after table publishing

* Move bulk editing apis to enterprise (#65968)

* Make sidebar sticky

* test: bulk attribute actions for tables, schemas and dbs

* fix more unit tests

* Copy preview section tests

* Copy error handling tests

* Copy undos tests

* Update test

* test: update new ee endpoints paths

* Make new bulk table APIs ee-only (fe)
- Closes GDGT-1251

* Fix global H.DataModel.visit overrides

* Remove redundant cy.reload

* Remove redundant cy.reload

* add select/deselect tests

* use helper

* data picker using proper library endpoint. Fixing types I broke. Endless Shame

* Fix Tree skeleton resizing multiple times during loading
- Closes GDGT-1253

* Improve icon

* Fill content

* don't call getCollectionItems on database collection

* add search tests and support shift click in search

* default table publish collection

* fox: reset bulk form values when selection changes

* Fix e2e tests from group-19

* fix:  fix missing dependencies in useEffect gdgt-1245

* test: refactor test setup action order

* Fix e2e tests from group-20

* Fix e2e tests from group-22

* Fix e2e tests from group-23

* test: restore default db as the first step

* Kondo the kondo config

* default collections for metrics and models outside of data studio

* Move edit test to ee

* Fix list filtering now default is bronze

* Move bulk-edit-test to ee

* Fix table metadata for test

* Revert "Added `collection` argument to search"

This reverts commits:
- 21999e01
- b0f71c03ea
- 4fa0c3b422

* Fixed OSS loading of tables

* Fixed OSS loading of tables

* add tests for filtering

* Fix e2e tests from group 41 / joins-repros

* more tests

* Fix e2e tests from group-20

* Fix e2e tests from group-23

* Fix e2e tests from group-24

* Fix e2e tests from group-26

* Fix e2e tests from group-27

* Fix e2e tests from group-28

* Fix e2e tests from group-30

* constuct initial paths from library collections

* segments editor, hasEnabledNestedQueries

* Fix a couple more (something between groups 40 and 43)

* Fixed module config

* keyboard navigation

* Added library/tree API

* Fix some e2e tests from groups 40 and 42

* Fixing tests

* disable scoped search on the 'database collection', models.cy.spec should be passing now

* Fix e2e tests from group-33

* Minor cleanup

* Fix e2e tests from group-34

* Fixing tests

* Fix e2e tests from group 37 (except one depending on Recents tab)

* Starts fixing e2e tests from oss group

* cleanup

* wait to focus

* hide our analytics in the data studio

* Added library/tree API

* merge library and data studio

* change backend library flag validation to data-studio

* tidy things up

* Make bulk edit inputs non-clearable
- This prevents sending "empty" requests when clearing values
- And clearing does not really make sense here

* fix: test: table rescan and discard mocks are wrong

* fix: test: wrong mock in oss sync table schema

* Remove ^:parallel from bulk edit tests

They can contend and cause deadlocks

* fix: test: failure due to repeated mocking of same route

* test: refactor: cypress table tests

* Update e2e test

* Update e2e test

* Update e2e test

* fix browse nav section test

* Add missing token

* add check icon for published tables

* Removed unused import

* Updates some e2e tests from oss group, removes some now-invalid tests

* test: use default external db, skip transform test

* Starts fixing e2e tests from mongo group

* remove background from not active table in search

* specs

* Fix e2e tests from group-15

* hack fix ci while i'm on meetings

* scoped search is back

* Fix some e2e tests from group-32

* table picker fixes

* Fixed merge

* Fix e2e test from group-42

* merge fixes

* re-enable the recents tab on the data picker modal

* Avoid race condition on list-table-filtering-test

* fix embedding types

* mini picker unit tests

* Fixing tests

* ci, fixes

* fix library collection bugs

* cleanup data studio plugin

* fix lots of unit tests

* fix import

* fix

* Fixed unused import

* Fixed accidental #p

* ci

* revert util

* specs

* specs

* specs

* fix bug / bad type in SchemaFormSelect (#65995)

* Use actual anti join in GET /table query

* Remove old comments

* Activate token after restore

* test: unskip table metadata transform test

* test: fix search tables e2e test

* fix: test: selection in table picker

* Fix Source input disabled when filtering by Metabase transform
- Closes GDGT-1259

* test: fix: filter unused table

* Fix e2e test

* fix: test: datamodel toasts and errors

* Fix e2e test

* Fix e2e tests from group-9

* Fix flaky tests

* GDGT-1244: Fix DB tree virtualization (#66125)

* GDGT-1244: Fix tree virtualization. Replace top with translateY to improve performance

* GDGT-1244: Fix scroll bug. Refactor border styling

* bring back modeling empty state

* test: adjust publishing test

* Fix e2e test from group-22

* Fix e2e test from group-25

* fix allowing cross DB joins

* properly disable invalid items in MiniPicker

* Fix e2e test from group-26

* Fix straggler from oss group

* Starts fixing e2e tests from group-32

* unit test adjustments

* Fix remaining issue with e2e group 37

* fix item filtering

* Update Loki Snapshots

* add recent views to mini picker

* test recents and backparsing

* additional filtering test

* fix minipicker shows items it should not show

* Fixed :here in library API

* Fixed :here in library API

* UXW-2358 publishing outside of the data studio

* Fixed :here in library API

* snapshot

* Fix most e2e tests from group-32

* Lint fixes

* Fixed failing test

* revert fix

* Reapply "Added `collection` argument to search"

This reverts commit f28d9d5af9.

* Quick fix in CollectionPicker/utils.ts

* Fix flaky Remote Sync test (#65862)

* Clean up backend-test matrix (#66158)

* Fix timeseries value detection (#66161)

* Prevent driver tests (#66156)

Co-authored-by: Bryan Maass <bryan.maass@gmail.com>

* Fetch uberjar using a proper action (#66165)

* fix embedding column picking

* Trying CI with search_index.verified

* Fixed failing test

* Translate label

* Fixed failing test

* fix: published info not updated in the tree picker after deleting model

* fix: refactor: publish collection link tests

* Fixed failing test

* Fix remaining e2e tests from group-32

* FileUploadStatus unit test, quesiton reproductions

* create data studio plugin file

* fix hidden items some more

* Fix issue where confirmation modal closes then reopens again then closes again when you archive a dashboard

* fix dark mode

* UXW-2367

* UXW-2378

* Fixed merge issues

* this element is not visible because you can't even open incompatible sample database db

* Fix e2e test from group-14

* fix embedding data picker clicks

* filtering fixes for transforms

* UXW-2372

* update mini picker specs after a fix

* fix flaky join test

* Fixing in-place support for collections

* fix: cannot scroll search results

* ui: tweak search results checkbox spacing to match tree results

* fix: scroll position jump when entering field sort mode gdgt-1269

* Revert "fix: scroll position jump when entering field sort mode gdgt-1269"

This reverts commit bfecdec661.

* UXW-2279 Changes Data Studio's Glossary page background color to background-secondary

---------

Co-authored-by: Nathan Voxland <nathan@metabase.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
Co-authored-by: Jakub Chodorowicz <jakub@chodorowicz.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Anderson <anderson@metabase.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
Co-authored-by: Uladzimir Havenchyk <uladzimir@metabase.com>
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Dan Stone <wotbrew@gmail.com>
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Stas Gavrylov <stas@metabase.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
Co-authored-by: John Swanson <john.swanson@metabase.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
Co-authored-by: dpsutton <dan@dpsutton.com>
Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
2025-11-25 08:09:59 -08:00
Eric Normand
2d6624319a Test collection tree import/export 2025-11-25 09:43:28 -06:00
Gabriel Moreno
15bb72ee66 fix: anchor table info popover to bottom (#66226)
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.
2025-11-25 14:15:12 +00:00
Stas Gavrylov
ce0232662d GDGT-1252: Respect show mini bar chart setting in list view (#66012)
* 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: Metabase Automation <github-automation@metabase.com>
2025-11-25 12:48:09 +02:00
Nemanja Glumac
076267ed7c chore: Upgrade nextjs to resolve dependabot alert (#66203) 2025-11-25 10:08:00 +01:00
Dennis Schridde
a7f3165348 Fix purchase page for paid Metabase AI add-on for non-store users (#66086)
### 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
2025-11-25 02:37:44 +01:00
Nemanja Glumac
1881164422 Improve how skipped SDK tests are handled (#66211) 2025-11-24 23:29:37 +01:00
Nemanja Glumac
81ba716093 Check for project requirements (#66192)
This PR adds a non-destructive dev script whose only job is to detect and report on your local development environment setup.

## What it does

**`./bin/dev-requirements`** detects:
  - Version managers:
      -  nvm, fnm, n (Node.js version managers)
      - volta, asdf, mise (multi-language support)
      - jenv, sdkman (Java version managers)
  - Installed development tools and their versions
  - Whether your setup meets Metabase's requirements

It cross-references detected versions against project configuration files:
  - Node.js version from `.nvmrc`
  - Clojure version from `deps.edn`
  - Java 21 Temurin distribution requirement

## What it doesn't do

  - No installations
  - No modifications
  - No assumptions about your preferences

The script is purely informational - it shows you what you have, what's required, and recommends mise for version management. Perfect for new contributors or when troubleshooting setup issues.
2025-11-24 22:09:43 +01:00
Eric Normand
f51192d3db Collection tests! 2025-11-24 14:33:43 -06:00
Nemanja Glumac
f90fbb06ce Delete now unused ci-test-config.json (#66189) 2025-11-24 21:23:35 +01:00
Eric Normand
23754f9e95 Tests pass, kondo passes, cljfmt done 2025-11-24 14:18:16 -06:00
Brad Anderson
76cf73dde5 Fix #65501 - Resets search back to first page when filters change (#66104) 2025-11-24 15:07:39 -05:00
Noah Moss
74b8adabe6 Two quality-of-life improvements for @-mentions (#66131)
* QoL improvements for @-mentions

* Add a unit test for new tab click behavior
2025-11-24 19:30:31 +00:00
Riley Thompson
7d7595996c Add snowflake collate expression (#65944)
* get collate working

* add collate test

* add changelog

* oragnize collate code

* fix driver changelog typo
2025-11-24 14:09:59 -05:00
Riley Thompson
8f23a5b725 Cancel jobs in bigquery (#66054)
* cancel bigquery jobs

* move .cancel to promise handling

* wrap .cancel in try catch finally

* use getqueryresults instead of .query
2025-11-24 19:07:31 +00:00
Edward Paget
05b294f47a feat: use boolean flag for remote-sync status (#66048)
* feat: use boolean flag for remote-sync status

It turns out type is too overloaded to have a 'remote-synced' collection
type. This is behavior that we might want to share around other typed
collections, so this migrates us to use a boolean column for this value instead.

* fixup! e2e test find synced collection

* fixup! e2e collection fixture has correct values

* fixup! make sure flag is set on insert/update
2025-11-24 12:16:43 -06:00
Nemanja Glumac
cb37ce8108 chore: Upgrade zx to resolve dependabot alert (#66207)
Should resolve
https://github.com/metabase/metabase/security/dependabot/275
2025-11-24 18:40:46 +01:00
Denis Berezin
0b42ad89a9 Fix trend viz dates diff calculation for a year unit (#65985) 2025-11-24 18:34:33 +03:00
dpsutton
857bdadd45 bump databricks (#66123)
* bump databricks

This moves over to a thin jar (or regular jar) which provides jdbc
classes and lists its dependencies. We can now bump or pin as we
like. The previous versions were uberjars that had their dependencies
packaged inside.

```clojure
clj -Sdeps '{:deps {com.databricks/databricks-jdbc-thin {:mvn/version "3.0.5"}}}'
Clojure 1.12.1
user=> (Class/forName "com.databricks.client.jdbc.Driver")
com.databricks.client.jdbc.Driver
```

```clojure
clj -Xdeps tree :extra '{:deps {com.databricks/databricks-jdbc-thin {:mvn/version "3.0.5"}}}'
org.clojure/clojure 1.12.1
  . org.clojure/spec.alpha 0.5.238
  . org.clojure/core.specs.alpha 0.4.74
com.databricks/databricks-jdbc-thin 3.0.5
  . com.databricks/databricks-sdk-java 0.69.0
    X org.slf4j/slf4j-api 2.0.9 :older-version
    . org.apache.commons/commons-configuration2 2.11.0 :newer-version
      X org.apache.commons/commons-lang3 3.14.0 :older-version
      . org.apache.commons/commons-text 1.12.0
        X org.apache.commons/commons-lang3 3.14.0 :older-version
      . commons-logging/commons-logging 1.3.2 :newer-version
    X com.fasterxml.jackson.core/jackson-databind 2.15.2 :older-version
...
```

contrasted with

```clojure
❯ clj -Xdeps tree :extra '{:deps {com.databricks/databricks-jdbc {:mvn/version "3.0.1"}}}'
org.clojure/clojure 1.12.1
  . org.clojure/spec.alpha 0.5.238
  . org.clojure/core.specs.alpha 0.4.74
com.databricks/databricks-jdbc 3.0.1
```

* bump to run drivers

* include test namespace change to trigger driver tests
2025-11-24 09:14:19 -06:00
Nemanja Glumac
eed6736230 Fix uberjar fetching for SDK host-apps (#66194) 2025-11-24 15:53:22 +01:00
Noah Moss
144b0b33f8 Move audit installation after search init; change some logs to debug (#66045)
* Move audit installation after search init; change some logs to debug

* change another warn to debug
2025-11-24 14:48:35 +00:00
Sébastien
dcca252247 Closes EMB-997 add a reset function to plugins (#65958)
* reorg

* added reinit fns to oss plugins

* ಠ_ಠ

* Added doc and eslint to prevent import of individual reinitialize functions

* added short doc to reinitialize functions to indicate they're internal
2025-11-24 15:15:15 +01:00
Denis Berezin
a183e8b5b4 Add translation for boolean dash filter value (#66050)
* Add translation for boolean dash filter value

* Fix CI
2025-11-24 16:55:44 +03:00
Edward Paget
3b837a15a0 fix: google auth returns given_name/family_name (#66151)
this was incorrectly using first_name/last_name. This also updates the
existing mocks to return the correct fields.
2025-11-24 13:01:08 +00:00
Nemanja Glumac
6679039b45 Revert "Pin the NodeJS version to the version 22 (#66152)" (#66187)
This reverts commit 58867cac0b.
2025-11-24 12:37:57 +01:00
Nemanja Glumac
58867cac0b Pin the NodeJS version to the version 22 (#66152) 2025-11-24 11:49:49 +01:00
Nemanja Glumac
2e4b7adbcb Parallelize embedding SDK package and uberjar builds (#66122) 2025-11-24 11:47:29 +01:00
Fraser
5aeffcf173 Skip BarChart Watermark loki (#66176) 2025-11-24 10:30:48 +00:00
Nemanja Glumac
721db4d40f Fetch uberjar using a proper action (#66165) 2025-11-21 23:58:57 +01:00
dpsutton
442fd726a3 Prevent driver tests (#66156)
Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
2025-11-21 15:36:19 -07:00
Eric Normand
ae65686d30 Fix tests 2025-11-21 15:49:57 -06:00
Eric Normand
f26f6a18cd core test pass 2025-11-21 15:25:43 -06:00
Eric Normand
4b33138799 Better database tests 2025-11-21 15:22:03 -06:00
Eric Normand
d3bad99de1 Whitespace 2025-11-21 15:21:51 -06:00
Denis Berezin
9e65cc60bf Fix timeseries value detection (#66161) 2025-11-21 23:59:43 +03:00
Eric Normand
a576039ae0 Remove persist! 2025-11-21 14:48:18 -06:00
Eric Normand
619e2fa17e Remove non-existent imports 2025-11-21 14:39:47 -06:00
Eric Normand
9116c09afe Get rid of frontend changes 2025-11-21 14:38:58 -06:00
Eric Normand
47b0340836 Merge branch 'master' into representations 2025-11-21 14:23:32 -06:00
Eric Normand
eda624973b Remove old stuff and simplify core 2025-11-21 14:21:48 -06:00
Eric Normand
0c0634dbc1 Module deps for kondo 2025-11-21 13:54:13 -06:00
Eric Normand
8a1139118f Remove transform-specific import 2025-11-21 13:53:57 -06:00
Eric Normand
8bb448b8fc People keep moving namespaces 2025-11-21 13:53:46 -06:00
Eric Normand
99e16ef825 Fixups after merge 2025-11-21 13:53:25 -06:00
Eric Normand
8b44711794 Don't throw if not found 2025-11-21 13:52:57 -06:00
Eric Normand
c35be5ea97 Remove unused transforms export 2025-11-21 13:52:43 -06:00
Eric Normand
04f1e58c3a Delete some unused files. 2025-11-21 13:50:55 -06:00
Nemanja Glumac
44ab6decf0 Clean up backend-test matrix (#66158) 2025-11-21 20:40:40 +01:00
John Swanson
8b369333c3 Fix flaky Remote Sync test (#65862) 2025-11-21 11:29:00 -08:00
Nicolò Pretto
c9e602db2f chore(sdk): remove excessive logs in sdk fixup script (#66133) 2025-11-21 18:19:38 +01:00
Nemanja Glumac
b1fb103a3f Remove redundant static-viz files changed condition (#66138) 2025-11-21 17:41:36 +01:00
Jeff Bruemmer
b631ee88a4 docs - fix docstring (#66134)
* doc string

* edit
2025-11-21 11:39:49 -05:00
Riley Thompson
2df87d3a7f Add empty state to native query DB dropdown (#66090)
* add global search to db dropdown

* Add tests
2025-11-21 10:04:44 -05:00
Egor Grushin
f486c415f9 chore: Add egorgrushin as a team member (#66043)
* chore: Adds egorgrushin to ~/.github/team.json and ~/release/github-slack-map.json.

* chore: fixed the usernames order
2025-11-21 15:02:00 +00:00
Nemanja Glumac
ba5804041b Consolidate embedding CI workflows (#66075) 2025-11-21 11:40:00 +00:00
Nemanja Glumac
9d6564cdaf Fix backend cache paths (#66103) 2025-11-21 11:41:08 +01:00
Sébastien
591b453e4c Closes EMB-1037 preview_embed endpoint for filter search (#66077) 2025-11-21 09:11:52 +01:00
Sébastien
5d087d0d18 Closes EMB-1038 wrong endpoint for embed maps preview (#66063) 2025-11-21 09:11:43 +01:00
Riley Thompson
719ebd0a7b Fix caching of postgres domains in arrays (#66059)
* custom nippy handling for pgobject

* Add domain caching test

* simplify test comparison
2025-11-20 23:22:50 +00:00
Fraser
ff6ec328f3 Create use-page-title hook and remove SetTitle Hoc (#65782) 2025-11-21 10:59:40 +13:00
dpsutton
78978219a6 minimal tests to be run when the label is minimal-tests (#66024)
* 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
2025-11-20 15:31:11 -06:00
Jeff Bruemmer
7c8a8f3694 docs - update docs workflow (#66096)
* update docs workflow

* update perms

* more perms

* perms to delete pending reviews

* review deletion

* delete comments

* update skill
2025-11-20 16:23:51 -05:00
Jeff Bruemmer
45abe078f9 docs - supporting text (#66088)
* supporting text

* image

* edits
2025-11-20 15:06:42 -05:00
Jeff Bruemmer
82b95611cf docs - light weeding (#66023)
* spelling

* docstring
2025-11-20 14:21:28 -05:00
Noah Moss
f04fb1bff2 Fix template tag parsing for model references in transforms generated by metabot (#65630)
* Try to fix model references in transforms generated by metabot

* Add an e2e test

* move test later in file

* simplify implementation

* address bot comments

* add comment
2025-11-20 14:10:41 -05:00
Jeff Bruemmer
f200fbe20c docs - lychee action version (#66091)
* lychee action version

* bump versions
2025-11-20 14:09:01 -05:00
Jeff Bruemmer
3413313d3a docs - links workflow (#66087) 2025-11-20 13:46:09 -05:00
Nicolò Pretto
b5c0d93f8e chore(sdk): fix sdk storybook (#66078)
* chore(sdk): fix sdk storybook

* use rootRepoPath for appConfig
2025-11-20 18:24:13 +01:00
Edward Paget
71f7cbc41b fix: handle invalid email address in auth-identity (#66022)
...migrations.

Handles cases where emails were set to longer than the valid length of
254 bytes. Those emails would fail on this migration previously. We're
not currently using auth-identity to lookup email addresses so this
won't cause any incorrect behavior, but also if any emails like this
exist they weren't valid anyway.

Also sets the validCheckSum to ANY like some other SQL migrations to
handle cases where this migration has already been run successfully, as
on stats.
2025-11-20 10:59:43 -06:00
github-automation-metabase
c2619a5036 Auto-update documentation for master (#66056)
* Update generated docs (master)

* Update docs/configuring-metabase/environment-variables.md

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-20 14:24:59 +00:00
Nicolò Pretto
e4728d22b8 chore(sdk,ci): fix stress tests for sdk tests (#66065)
* chore(sdk,ci): fix stress tests for sdk tests

* fix baseUrl, cypress explodes if we pass it in ct test config
2025-11-20 11:37:10 +01:00
Timofey Kachalov
2d1b6c4a02 refactor(embed-js): Move EmbedJS + EmbedJS wizard files to OSS folder (#65973) 2025-11-20 14:32:30 +04:00
Ngoc Khuat
b8eb7d65f9 Add bottom padding for Attach results as files section (#62483) 2025-11-20 10:25:16 +01:00
Anderson
28b5fb79f1 Collect customer consent to grant instance access to Metabase success engineers (#65701)
* feat: add api for manage support access grants

* Setup frontend endpoint logic and start work on UI

* Implement create access grant; revoke; UI clean up

* Move section to tools > help / Adjust main UI

* feat: migration to new auth-identity module

* Fix schema migration tests

* Adjust backend fields structure on the backend / Update types and table in the UI

* Implement invitation mechanism and auth provider

* Create a route for the access grant modal

* Fix fe types / Fix clj spaces

* Add some test placeholders

* Remove stray #p

* Add missing index

* refix broken migration

* Change the way we temporarily make the new feature always enabled

* Add email sending on grant creation

* Add login and tests

* Make auths expirable

* Remove extraneous test

* Fix bad syntax in test

* Split two column migration into two migrations

* Fix test syntax issue

* Better expires at test

* Create e2e tests / Split troubleshooting.cy.spec and move to ts

* Add fe unit tests

* Add fe unit tests

* Fix kondo

* Fix config file and settings require

* Revert added disallowed exported namespaces

* Correctly test expiration

* Add tests for revoked at behavior

* Better better expires_at test

* Fix help.cy.spec.ts / Self review updates

* Fixup last issues with module config

* Make password reset is disabled for support users

Improve some email copy

* Real token check

* Move test relying on EE-code out of OSS code

* Send invitation notification after sso user creations

* Fix module config

* fixup! BE feedback

* fixup! altered not found msg

* Use user email as fallack when name is not set on support grants table

---------

Co-authored-by: Edward Paget <ed.paget@gmail.com>
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-11-19 23:59:02 -03:00
Sloan Sparger
53cf2ab305 [Metabot] Request cancellation (#65511)
* 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
2025-11-19 17:35:13 -06:00
Nemanja Glumac
135abb44a5 Consolidate caches (#66036) 2025-11-19 23:03:23 +01:00
Alex Yarosh
8699037548 Change images for development and production settings (#66039)
Updated images in the remote sync documentation to reflect new settings.
2025-11-19 20:50:12 +00:00
Alex Yarosh
03dad76c9f Update plans-blockquote inclusion for documents (#66038) 2025-11-19 15:49:12 -05:00
github-automation-metabase
dca22d0865 Bump org.postgresql/postgresql from 42.7.7 to 42.7.8 (#63804)
Inspect dependency changes here: https://github.com/pgjdbc/pgjdbc/blob/REL42.7.8/CHANGELOG.md

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-19 19:21:50 +00:00
github-automation-metabase
a6f98dbd68 Bump com.amazon.redshift/redshift-jdbc42 from 2.1.0.34 to 2.2.0 (#64830)
Inspect dependency changes here: https://github.com/aws/amazon-redshift-jdbc-driver/blob/v2.2.0/CHANGELOG.md

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-19 19:09:59 +00:00
github-automation-metabase
2fe9ebdec1 Bump org.apache.tika/tika-core from 3.2.2 to 3.2.3 (#63799)
Inspect dependency changes here:

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-19 19:03:52 +00:00
github-automation-metabase
c31762e244 Bump clj-kondo/clj-kondo from 2025.07.28 to 2025.10.23 (#65029)
* Bump clj-kondo/clj-kondo from 2025.07.28 to 2025.10.23

Inspect dependency changes here: https://github.com/clj-kondo/clj-kondo/blob/v2025.10.23/CHANGELOG.md

* Fix Kondo warning

---------

Co-authored-by: Cam Saul <github@camsaul.com>
2025-11-19 19:00:12 +00:00
Eric Normand
20657a3b0b Remove dependencies "integration" (unused) 2025-11-19 11:34:10 -06:00
Eric Normand
174a118a6c Claude fixed the kondo warnings 2025-11-19 11:23:53 -06:00
Nicolò Pretto
5585815455 fix(docs): fix sdk docs not being generated correctly (#66030) 2025-11-19 11:58:18 -05:00
Jeff Bruemmer
2f8cc0f153 skills (#65676)
* skills

* docs review workflow

* update skills

* update bug fix workflow to use skills

* headings

* update code workflow to use skills

* updates

* add workflow dispatch to docs review

* edits
2025-11-19 16:54:05 +00:00
Eric Normand
4d6693adae Typo 2025-11-19 10:27:24 -06:00
Eric Normand
91d2191c93 Merge branch 'master' into representations 2025-11-19 10:17:57 -06:00
Jeff Bruemmer
d00a66f474 Fix YAML syntax for target_branch in workflow (#66018) 2025-11-19 09:50:38 -05:00
Braden Shepherdson
19ba6a165a [QP] Allow one-sided :number/between parameter values (#65987)
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.
2025-11-19 09:35:09 -05:00
Jeff Bruemmer
e0e3099787 Docs 57 latest (#65666)
* update release workflow to 57

* string
2025-11-19 09:27:52 -05:00
Jeff Bruemmer
6d62827416 docs - X version note and cleanup (#65756)
* X version note and cleanup

* note on hotfix x

* edit

* note on beta

* changelog link
2025-11-19 09:14:54 -05:00
Fraser
5a8ec6631a Cache yarn in CI (#65946) 2025-11-19 14:31:11 +01:00
Abed Habli
d5a7dc2e49 Docs: reusing snippet parameters (#65723)
* reusing snippet parameters

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

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

* updating the section

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-19 13:25:17 +01:00
Thomas Schmidt
0a3a826537 Metabot tool endpoitns should support MBQL5 (#65844)
* 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: Mike Appleby <86076+appleby@users.noreply.github.com>
2025-11-19 10:32:39 +00:00
Fraser
04cbeab190 Remove ModalWithTrigger (#65994) 2025-11-19 10:22:51 +01:00
Nemanja Glumac
248a95e704 De-clutter the Cypress (nodejs) Module runner (#65881)
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.
2025-11-19 10:20:14 +01:00
Kamil Mielnik
c7e2dcd254 GDGT-1235 Fix flaky dashboard parameters test (#65902)
* Fix flaky test

* Remove broken findDashCardAction helper
2025-11-19 15:17:19 +07:00
Fraser
fafd6bb3d8 Refactor ActionExecuteModal (#65573) 2025-11-19 14:38:44 +13:00
Fraser
4fe0ecbeb9 Refactor CustomURLPicker (#65574) 2025-11-19 14:23:46 +13:00
eliotmetabase
e1c31c0d8e Update label placeholder text to Optional for Gauge visualization (#65989)
* Update label placeholder text to Optional for Gauge visualization

* Update unit test
2025-11-18 17:04:14 -08:00
dpsutton
a8e592718f Turn off db routing for clickhouse and it's trick. (#65984)
* 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
2025-11-18 18:45:46 -05:00
github-automation-metabase
0b5bbd260f Bump compojure/compojure from 1.7.1 to 1.7.2 (#63797)
Inspect dependency changes here: https://github.com/weavejester/compojure/blob/1.7.2/CHANGELOG.md

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-18 20:49:24 +00:00
github-automation-metabase
38c0aebd00 Bump io.github.eerohele/pp from 4998a1fdd9d3713d7034d04509e9212204773bf2 to ffc4edc482c057cd9412c62f018a41e9140c618b (#63473)
Inspect dependency changes here: 4998a1fdd9...ffc4edc482

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-18 20:40:55 +00:00
Riley Thompson
41b5904d52 Fix order by custom expression aggregations (#65937)
* fix bigquery order by aggregate custom expression

* add import

* make test work for all drivers
2025-11-18 13:58:53 -05:00
Alex Yarosh
a2975bdb44 Revise quickstart options for Embedded Analytics SDK (#65830)
Reorganized quickstart section for clarity based on user setup.
2025-11-18 12:41:33 -05:00
Edward Paget
e996561416 fix: allow analytics collection perms to be set (#65927)
* 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
2025-11-18 09:40:22 -06:00
Stas Gavrylov
10e76e3040 Update Table Editing e2e tests to use Postgres instead of SampleDB (#65955)
* Update Table Editing e2e tests to use Postgres instead of SampleDB

* Update table editing e2e tests to include different column types

* Address PR comments
2025-11-18 17:40:06 +02:00
Oleksandr Yakushev
25a97838db Bump Malli to 0.20.0 (#65909) 2025-11-18 17:15:12 +02:00
Brad Anderson
54c23276d7 Documents supporting text - Drag-and-drop (#65854)
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-11-18 10:14:27 -05:00
Denis Berezin
58df0d448e Fix incorrect tooltip metric sum in row chart (#65938)
* Fix incorrect tooltip metric sum in row chart

* Review fixes
2025-11-18 18:08:51 +03:00
Nicola Mometto
35c649f88b Nicola/glossary creator api (#65961)
* feat: glossary, actually add creator_id on create endpoints

* feat: add creator_id tests on api
2025-11-18 15:08:26 +00:00
Nicolò Pretto
d981e64f0a 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:
2025-11-18 15:56:43 +01:00
Sébastien
425856f92a Closes EMB-1021 flaky test e2e tests metabase browser read only mode (#65851)
* .

* .

* .
2025-11-18 15:33:42 +01:00
Anderson
5c87a6c12b Make sure 'Pull changes' button is not truncated on remote sync settings (#65932) 2025-11-18 10:41:45 -03:00
Sébastien
a033c12089 Closes EMB-982 embedding stuck on 404 when navigating with postMessage (#65662)
* Closes EMB-982 postmessage 404

* actual fix

* .

* .

* .
2025-11-18 12:51:32 +01:00
Nicola Mometto
39821ae14e Add creator to transform content view, and include glossary (#65957)
* 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
2025-11-18 11:37:27 +00:00
Fraser
739b062e7c Refactor QuestionRowCount (#65837) 2025-11-18 23:10:34 +13:00
Phoomparin Mano
ec73bb3bae Allow content-disposition header in cross-origin requests (#65918) 2025-11-18 14:59:38 +07:00
github-automation-metabase
566d6d1ad6 Bump thheller/shadow-cljs from 3.2.0 to 3.2.1 (#64165)
Inspect dependency changes here:

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-18 01:11:01 +00:00
github-automation-metabase
9a981a80b5 Bump org.apache.logging.log4j/log4j-core from 2.25.1 to 2.25.2 (#64153)
* Bump org.apache.logging.log4j/log4j-core from 2.25.1 to 2.25.2

Inspect dependency changes here:

* Consolidate log4j version bumps

---------

Co-authored-by: Cam Saul <github@camsaul.com>
2025-11-18 01:09:26 +00:00
github-automation-metabase
ea5d731e6a Bump org.bouncycastle/bcutil-jdk18on from 1.81 to 1.82 (#63808)
* Bump org.bouncycastle/bcutil-jdk18on from 1.81 to 1.82

Inspect dependency changes here:

* Consolidate deps bumps

---------

Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-18 01:06:01 +00:00
github-automation-metabase
cea2da195e Bump io.trino/trino-jdbc from 476 to 477 (#64169)
Inspect dependency changes here:

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-18 01:05:19 +00:00
github-automation-metabase
be1889ac0a Bump ring/ring-core from 1.14.2 to 1.15.3 (#64160)
* Bump ring/ring-core from 1.14.2 to 1.15.3

Inspect dependency changes here: https://github.com/ring-clojure/ring/blob/1.15.3/CHANGELOG.md

* Consolidate Ring deps bumps

---------

Co-authored-by: Cam Saul <github@camsaul.com>
2025-11-18 01:05:00 +00:00
Cam Saul
94d2daaafd Backend module detangling pre Clojure/conj 2025 edition (#65681)
* Split warehouses and warehouses-rest

* Split warehouse-schema and warehouse-schema-rest

* Split actions and actions-rest

* Split collections and collections-rest

* Split `dashboards` and `dashboards-rest`

* Split public-sharing and public-sharing-rest

* Split embedding and embedding-rest; eliminated driver deps: xrays segments sample-data tiles

* Split users and users-rest

* Split setup and setup-rest

* Some more dev functions

* Update Kondo modules config

* Fix test namespace name

* Fix test failure 🔧
2025-11-17 16:35:15 -08:00
Jeff Bruemmer
85633efccf docs - remote sync rename (#65933) 2025-11-17 17:27:11 -05:00
Riley Thompson
e53d67c763 Update snowflake string filtering (#65853) 2025-11-17 22:18:45 +00:00
William
7a5d365a4d qp catches circular queries involving both sql and mbql cards (#65875) 2025-11-17 15:33:28 -06:00
Brad Anderson
6e0186703f Documents supporting text (#65705)
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-11-17 16:15:22 -05:00
Noah Moss
713a369825 And basic recent views info to metabot user context (#65618)
* add a models filter option to recent_views API

* Add recent views to metabot context with only basic metadata fields included

* clean up; add test
2025-11-17 15:43:05 -05:00
Cam Saul
52eeb00a2e Add MAGE module command; use module system for determining if we can skip driver tests (#65631)
* MAGE modules

* Trivial change

* Trivial change 2

* Add note

* Let's try this

* Don't rely on team label

* Update GH Action

* Fix shell script syntax

* Use same runner type for all jobs in drivers workflow

* We can skip Postgres tests too

* Fix Mage command??

* debug github output

* Test ignoring tests in Lib

* Can we skip fetching the base ref??

* Fix test-ignoring logic

* Ok so maybe we do need to fetch the base ref

* Try git-fetch --depth=1

* Fix drivers not waiting for job

* Remove TODO

* Cache Babashka dependencies

* Update step name

* Make sure Babashka deps are actually saved

* Flip the status codes around

* PR feedback and cleanup
2025-11-17 12:41:30 -08:00
Braden Shepherdson
17291f9d79 [QP] Allow multiple dashboard/card params to exist, if only one is set (#64428)
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.
2025-11-17 20:23:00 +00:00
Cam Saul
af139fd003 Run Codespell on docs/ (#65925)
* Run Codespell on docs/

* Only run of docs/
2025-11-17 11:29:29 -08:00
Nicola Mometto
97f104ecbf Better human readable table-data-event for audit-log (#65907)
* abstract action-v2-execute events behind table-data-edit for audit-log

* add test

* chore: still publish
2025-11-17 19:14:48 +00:00
dpsutton
d5e562665f Correctly sync routed databases in task (#65441)
* 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
2025-11-17 12:05:11 -06:00
Phoomparin Mano
b6a8de1d29 EAJS wizard should derive a lighter dashboard background color (#65547) 2025-11-17 23:19:29 +07:00
Nathan Voxland
55abe262c9 Rename remote-sync modes (#65825) 2025-11-17 10:10:56 -06:00
Edward Paget
088a5354fc feat: migration to new auth-identity module (#65716)
* feat: migration to new auth-identity module

* Fix schema migration tests

* Make auths expirable

* Remove extraneous test

* Fix bad syntax in test

* Split two column migration into two migrations

* Fix test syntax issue

* Better expires at test

* Better better expires_at test

* Send invitation notification after sso user creations

* Fix module config
2025-11-17 09:48:08 -06:00
github-automation-metabase
a843870977 Update generated docs (master) (#65892)
Co-authored-by: github-actions <github-actions@github.com>
2025-11-17 09:24:50 -05:00
Nemanja Glumac
049723c814 Remove custom embedding SDK cors config (#65910) 2025-11-17 15:12:19 +01:00
Stas Gavrylov
25270fea3e UXW-1866: UX regression on dropdown list/search with multiple values (#64605)
* UXW-1866: Make MultiAutocomplete dropdown preserve open state when selecting options

* UXW-1866: Fix e2e test

* Add note on running e2e tests for translation functionality

* Fix e2e test

* Fix e2e test
2025-11-17 16:02:13 +02:00
Nemanja Glumac
33f9a3148d Simplify Snowplow Cypress helpers (#65859)
* 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
2025-11-17 09:11:55 +00:00
Mahatthana (Kelvin) Nomsawadi
2b69c463dd Fix dashboard.backgroundColor: transparent breaking dashboard PDF export (#65847) 2025-11-17 09:04:56 +00:00
Fraser
6845e31f38 Drop react draggable for dnd kit (#65268) 2025-11-17 13:53:05 +13:00
Nemanja Glumac
8b4fb71db4 Remove e2e tests for info popovers in field picker (#65883)
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`
2025-11-17 00:48:38 +01:00
metamben
b889dd8e52 MBQL5 segments (#65566) 2025-11-15 21:47:37 +00:00
Fraser
c461d1296c Remove unused types (#65834) 2025-11-15 14:56:03 +13:00
John Swanson
4eda823252 Fix batch-upsert! method for heterogeneous entries (#65177)
* 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
2025-11-14 23:27:45 +00:00
John Swanson
aa549d6910 Don't set last_used_param_values for public (#64432)
Fixes UXW-216
2025-11-14 15:20:19 -08:00
Oreon Lothamer
d5da0f4d38 self-hosting metabase stack (#65262)
* self-hosting metabase stack

* self-hosting config

* self-hosting wait for helm with --atomic
2025-11-14 13:02:53 -10:00
Riley Thompson
dded0d225a Replace snowflake test password auth with key pair auth (#65522)
* 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: dan sutton <dan@dpsutton.com>
2025-11-14 16:03:39 -05:00
Braden Shepherdson
51067eb586 [QP] Only label remaps for columns that actually need it (#65860)
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.
2025-11-14 18:57:02 +00:00
dpsutton
cd39f12e79 Suppress liquibase output (#65858)
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.
2025-11-14 11:52:49 -06:00
Riley Thompson
854650cd86 Fix athena sync 65728 (#65777)
* 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
2025-11-14 12:52:06 -05:00
Jeff Bruemmer
9cd92bf39c docs - document links new charts (#65828)
* links and new charts

* links

* edits

* Update docs/documents/introduction.md

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-11-14 12:09:24 -05:00
Chris Truter
55deb90598 Fix append for CSVs with really long column names with shared prefixes (#65793) 2025-11-14 15:51:48 +00:00
Nicolò Pretto
679170b832 Preparation for moving sdk code to oss folder (#65428)
* 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
2025-11-14 16:28:52 +01:00
Timofey Kachalov
5829365136 fix(sdk, embed-js, static): Fix Static embedding styles (#65796) 2025-11-14 18:24:04 +04:00
lbrdnk
0de9cf68de Revert param values from query results (#65841)
* 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.
2025-11-14 15:08:14 +01:00
Nemanja Glumac
2e6c7d97e7 Remove projectId from Cypress config (#65748) 2025-11-14 07:32:34 +01:00
Mahatthana (Kelvin) Nomsawadi
cdad4c95ff fix(sdk-bundle): Fix EditableDashboard sometimes doesn't show the correct tab (#65802)
* 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
2025-11-14 02:53:03 +00:00
Riley Thompson
86dcae0d73 clean up pulse ui 2025-11-13 19:07:01 -05:00
Riley Thompson
ea48c27d72 use refs with pulses 2025-11-13 19:02:23 -05:00
Fraser
ba35c6640a remove flaky tag (#65741) 2025-11-14 11:25:16 +13:00
Riley Thompson
13cb16df11 initial pulse impl 2025-11-13 16:57:35 -05:00
appleby
ab6c2ab72d Fix code that populates :used_tables in metabot context (#65787)
* 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
2025-11-13 13:39:11 -08:00
Riley Thompson
89e585ac23 finish timeline tests 2025-11-13 15:30:05 -05:00
Alex Yarosh
5cac3d948d Rename handleLink.tsx to handlelink.tsx (#65821) 2025-11-13 19:56:35 +00:00
Timofey Kachalov
2ea84461c3 fix(sdk-bundle): Temporarily hide the incompatibility banner (#65813) 2025-11-13 22:09:29 +04:00
lbrdnk
d6b857a2c6 Adjust cards-with-filters to work with action cards (#65805)
* 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: metamben <103100869+metamben@users.noreply.github.com>

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-11-13 19:02:48 +01:00
Alex Yarosh
a4d22112aa docs: click behavior limitation (#65809)
* Add click behavior setup information to introduction

* Update docs/embedding/sdk/introduction.md

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-13 17:00:04 +00:00
Mahatthana (Kelvin) Nomsawadi
b7b212287c 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>
2025-11-13 09:05:32 +00:00
Sébastien
1103abcfce Closes EMB-988 flaky test (#65745)
* closes EMB-988 flaky test

* .

* .

* .
2025-11-13 09:46:23 +01:00
lbrdnk
c98e640426 Fix mapping of params to later query stages (#65651)
* Fix nested field mapping

* whitespace

* Update src/metabase/lib/util.cljc

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>

* Remarks

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-11-13 09:06:32 +01:00
Fraser
e8a740900f Update claude code workflow to use v1 action (#65783) 2025-11-13 18:04:04 +13:00
Denis Berezin
1b8036e912 Preserve document cards width on reorder (#65768) 2025-11-13 02:39:58 +03:00
Denis Berezin
ef329bbe6a Documents new questions (#65504)
* 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
2025-11-13 02:39:23 +03:00
Nemanja Glumac
b677b62cdd Load plugin manifest in e2e run mode (#65729)
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.
2025-11-12 22:37:32 +01:00
Nemanja Glumac
b82cf6fdee Remove unused mb_user_defaults env var (#65725)
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
```
2025-11-12 22:24:29 +01:00
Alex Yarosh
c040219c62 docs: more new plugins + typechecked snippet for links (#65767)
* new plugins

* Update docs/embedding/sdk/plugins.md

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-12 21:13:22 +00:00
github-automation-metabase
e9090ff9b8 Update generated docs (master) (#65733)
Co-authored-by: github-actions <github-actions@github.com>
2025-11-12 16:08:49 -05:00
github-automation-metabase
faabcbc119 Update generated docs (master) (#65682)
Co-authored-by: github-actions <github-actions@github.com>
2025-11-12 16:04:55 -05:00
Brad Anderson
5d3f2f8061 Feat: Document link editing (#65399) 2025-11-12 15:12:16 -05:00
Dennis Schridde
2b76c38e1f Add purchase page for paid Metabase AI add-on (#65343)
### Description

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

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>
2025-11-12 21:11:50 +01:00
Maz Ameli
fd033ce0bf Allow return to focus body of Documents (#65732)
Co-authored-by: Brad Anderson <brad@metabase.com>
2025-11-12 15:11:34 -05:00
Alex Yarosh
b9e93ea0c8 Update chart colors explanation in appearance.md (#65758)
Clarified the explanation regarding the order of chart colors.
2025-11-12 19:14:13 +00:00
Jeff Bruemmer
aead8fab32 document MB_NOTIFICATION_TEMP_FILE_SIZE_MAX_BYTES (#65751) 2025-11-12 18:53:46 +00:00
Alex Yarosh
bef0a89f9f docs: dependencies polish (#65754)
* dependencies polish

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

* reword

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-11-12 18:06:15 +00:00
Ryan Laurie
63f2359659 upload checksums with releases (#65712) 2025-11-12 08:43:01 -07:00
Mahatthana (Kelvin) Nomsawadi
62fe686ffc Fix static embedding or public embed outside iframe not working with #theme (#65740)
* Fix static embedding or public embed outside iframe not working with #theme

* Add tests

* Make embedding prefix/suffix naming consistent
2025-11-12 15:29:45 +00:00
Mahatthana (Kelvin) Nomsawadi
8c5cac2369 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>
2025-11-12 12:53:27 +00:00
Sébastien
d514efc3c3 feat(sdk): Convert plugin system to deferred initialization (#65142)
* Convert plugin system to deferred initialization with undo capability

* fixed wrong rebase

* better initialization

* .

* fixed unit tests

* .

* duh

* added back whitelabel overrides for SDK

* fixup

* fixed unit test

* cleanup
2025-11-12 11:48:59 +01:00
Oleksandr Solovyov
f4c15ce5d7 unstemmed words should still appear in search (#64560)
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
2025-11-12 12:38:47 +02:00
Fraser
1c649fb56f deps: Remove redux-promise and reduce-reducers (#64945) 2025-11-12 11:35:51 +01:00
Fraser
6d349fd1b2 Drop react-copy-to-clipboard (#65674) 2025-11-12 23:17:37 +13:00
Sébastien
5660df7a85 Closes UXW-2237 click on admin logo error (#65581) 2025-11-12 07:07:50 +01:00
Jeff Bruemmer
1951cfe3f7 add command documentation generation (#65727) 2025-11-11 18:00:31 -05:00
Jeff Bruemmer
ea03f4819b changelog link (#65717) 2025-11-11 16:20:51 -05:00
Brad Anderson
af548d9daa Fix: UXW-2235 Prevents 403s from SmartLinks from hiding the whole document (#65609)
* 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
2025-11-11 15:56:18 -05:00
Rodrigo López Dato
f568cc793b Add /livez and /readyz endpoints (#64479)
* Add /livez and /readyz endpoints

* nit comment

* Update tests with new endpoints

* Update src/metabase/server/routes.clj

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

* 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: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
Co-authored-by: dan sutton <dan@dpsutton.com>
2025-11-11 16:55:08 -03:00
Ryan Laurie
0cfcfd561e fix auto patches again (#65708)
* fix auto patches again

* revert ??
2025-11-11 11:36:51 -07:00
Uladzimir Havenchyk
046df0694e chore: upgrade mantine/core patch to match installed version (#65340)
* chore: update mantine patch package

* fixup

* fixup

* fixup
2025-11-11 20:48:37 +03:00
Jeff Bruemmer
257f23f104 generate command docs (#65608)
* generate command dox

* clean-up

* restore command.md

* clean-up
2025-11-11 11:53:58 -05:00
Braden Shepherdson
f78cf1648f [perf] Improve quadratic lookups in add-alias-info (#65595)
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.
2025-11-11 16:23:08 +00:00
Oleksandr Solovyov
559d3357a2 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-11 18:12:56 +02:00
Braden Shepherdson
9584d61b16 [perf] Remove unnecessary MBQL 4 -> 5 -> 4 round trips in SQL drivers (#65509)
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.
2025-11-11 14:55:19 +00:00
Mahatthana (Kelvin) Nomsawadi
13e92995df Fix flaky 'models.cy.spec.js' test (#65690) 2025-11-11 14:52:48 +00:00
Edward Paget
a939c427ad docs: Update api changelog (#65663) 2025-11-11 08:47:51 -06:00
Nemanja Glumac
2b7980868d Fix encoding in "tag for release" workflow (#65689) 2025-11-11 11:17:19 +00:00
Chris Truter
3c92dcd071 Minor fixes around semantic search (#65654) 2025-11-11 11:36:24 +02:00
Fraser
e02de4a3bb Drop usage of cancelable and add unit tests (#65455) 2025-11-11 19:33:56 +13:00
Fraser
b5495dc6aa Refactor DeleteSubscriptionAction (#65575) 2025-11-11 15:35:50 +13:00
Riley Thompson
7c8078bd09 Merge branch 'master' into representations 2025-11-10 18:13:21 -05:00
Fraser
e976b1af84 Drop clipboardy (#65675) 2025-11-11 12:05:51 +13:00
Riley Thompson
8e37784337 update timelines 2025-11-10 17:52:06 -05:00
Riley Thompson
1a827eb9a0 Fix postgres bytea truncation (#65569)
* fix postgres bytea truncation

* use = over =?

* Add issue ref in test
2025-11-10 22:27:17 +00:00
Riley Thompson
b0443a4805 timeline impl 2025-11-10 17:13:20 -05:00
Sloan Sparger
ecd803f067 [Metabot] Misc. bug fixes (#65255)
* 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)
2025-11-10 14:57:58 -06:00
dpsutton
00ee60d8ed Cell count for notifications temp storage (#65518)
* 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
2025-11-10 13:59:26 -06:00
Fraser
a2a31bd9e3 Replace usages of deprecated useSafeAsyncFunction (#65406) 2025-11-11 08:44:29 +13:00
William
c1e548ca9e Remove-replace cleans up empty first stages when reasonable (#65565)
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.
2025-11-10 19:43:18 +00:00
github-automation-metabase
d32fb5f798 Bump com.nimbusds/nimbus-jose-jwt from 10.4.2 to 10.5 (#63228)
Inspect dependency changes here:

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-10 19:00:15 +00:00
github-automation-metabase
a8345c94f8 Bump com.github.seancorfield/honeysql from 2.7.1340 to 2.7.1350 (#63219)
Inspect dependency changes here: https://github.com/seancorfield/honeysql/blob/v2.7.1350/CHANGELOG.md

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-10 18:48:23 +00:00
Cam Saul
734949f267 BE modularization decoupling Halloween edition (#65236)
* BE modularization: decouple `server` from `core`

* Split up enterprise/api and enterprise/api-routes

* Split up `settings` and `settings-rest`

* Dox for new util

* Add another util function

* Split `permissions` and `permissions-rest`

* Code fixes and additional utils

* Improved deps graph dox
2025-11-10 10:04:36 -08:00
William
14d2f55fa2 Display "previous results" when a join's conditions specify multiple lhs tables (#65239)
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.
2025-11-10 17:43:33 +00:00
Anderson
e8d760345b Include headers when copying table rows (#65439)
* Include headers when copying table rows

* Fix e2e test

* Fix headers and values out of order when when cells are selected backwards or individually
2025-11-10 13:25:34 -03:00
Ryan Laurie
d52732d113 Fix Collection Tree Collapsing (#65620)
* actually just be smart

* consistent change detection

* remove dead code
2025-11-10 07:56:45 -07:00
Edward Paget
fcacb480e0 fix: batch delete data perms (#65567)
* fix: batch delete data perms

To workaround postgresql parameter limits in the delete query

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

Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>

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

Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>

* Update data_permissions.clj

---------

Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2025-11-10 14:50:20 +00:00
Timofey Kachalov
321d9266f2 Close New Modals when pathname is changing (#65472) 2025-11-10 18:27:04 +04:00
github-automation-metabase
4ff0d16f78 Update generated docs (master) (#65643)
Co-authored-by: github-actions <github-actions@github.com>
2025-11-10 09:16:56 -05:00
Timofey Kachalov
7a5a24a347 Adjust reviewers in sdk-release CI workflow (#65652) 2025-11-10 16:56:42 +04:00
Chris Truter
f506b2ce36 Simplify default search engine and active index logic (#65604) 2025-11-10 12:10:21 +00:00
Chris Truter
d7d4141e19 Support search weight overrides per request for tool calls (#65592) 2025-11-10 09:47:17 +00:00
Filipe Silva
d4bbf59cc0 fix: update harbormaster API use, and support public openapi schema (#65549)
* 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.
2025-11-10 09:34:14 +00:00
Fraser
22ebb53487 Refactor SegmentActionSelect (#65576) 2025-11-10 12:07:21 +13:00
Fraser
4e1d6c0796 Refactor edit header (#65577) 2025-11-10 12:07:07 +13:00
Oleksandr Yakushev
cec321e06c [insights] Convert BigDecimals into Doubles early in the pipeline (#65234) 2025-11-10 00:23:44 +02:00
Oleksandr Yakushev
fcce676094 [normalize] Optimize metabase.lib.schema.util (#63470) 2025-11-08 23:50:36 +02:00
Noah Moss
450dddb456 Ensure we normalize queries before detecting transform source type (#65541) 2025-11-08 12:32:01 -05:00
Sébastien
acadfded3e Closes EMB-970 move some callbacks to MetabaseGlobalPluginsConfig (#65590)
* Closes EMB-970 move some callbacks to MetabaseGlobalPluginsConfig

* types
2025-11-08 07:14:54 +01:00
Anderson
4578d66e2e Fix some modals not closing properly without browser history (#65370)
* Fix some modals not closing properly without browser history

* Add e2e test

* Fix tsc
2025-11-07 21:00:49 -03:00
Alex Yarosh
ff2b3d80ff docs: new sdk click and link behavior (#65627)
* new click and link behavior

* Apply suggestions from code review

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

* handle handlelink

* fix typo

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-07 18:18:04 -05:00
Eric Normand
ddcc13edd1 Simplify portable query visitor 2025-11-07 16:53:26 -06:00
Eric Normand
38a5d7b604 Simplify portable query visitor protocol 2025-11-07 16:49:36 -06:00
Nick Fitzpatrick
d3efd21c50 Gdgt 910 rework look and feel of color settings in gauge (#65552)
* updated segments ui

* sober up the needle

* setting up unit tests

* make gauge needle opaque

* remove key, update unit test
2025-11-07 21:15:36 +00:00
Jeff Bruemmer
4d54ae84d5 docs - remote sync edit (#65625)
* turning off remote sync

* theme toggling in command palette

* edtis
2025-11-07 16:13:52 -05:00
Nick Fitzpatrick
15f92af504 Use transparency instead of white for table color ranges (#65426)
* Use transparency instead of white for table color ranges

* adding visual tests
2025-11-07 17:00:07 -04:00
Alex Yarosh
9408112eeb Document supported databases for model persistence (#65621)
Added section listing databases that support model persistence.
2025-11-07 14:21:48 -05:00
Nemanja Glumac
b614b64281 Remove special embedding-sdk e2e test case (#65594) 2025-11-07 19:30:52 +01:00
Timofey Kachalov
7e19ce967f fix(sdk): Accept an entity id as a target collection id for CreateQuestionModal (#64601) 2025-11-07 21:45:08 +04:00
Nicolò Pretto
671e406c28 fix(modular): fix downloads on dashboards loaded by entityIds (#65613)
* fix(modular): fix downloads on dashboards loaded by entityIds

* tests
2025-11-07 17:39:43 +00:00
Eric Normand
938600d341 Fix mbql tests 2025-11-07 11:17:18 -06:00
Eric Normand
1469864d71 Question tests pass again 2025-11-07 11:07:20 -06:00
github-automation-metabase
3dd2b5a7ac Update generated docs (master) (#65596)
Co-authored-by: github-actions <github-actions@github.com>
2025-11-07 11:52:43 -05:00
Eric Normand
777980d11e Forgot the new file 2025-11-07 10:40:52 -06:00
Eric Normand
0a63009b9e lib.portable and representations integration 2025-11-07 10:37:56 -06:00
Nick Fitzpatrick
761e01ff71 update color scheme for google button (#65558)
* update color scheme for google button

* Adding a comment like I was supposed to
2025-11-07 09:36:51 -07:00
Braden Shepherdson
16c875265c [perf] New MetadataProvider and query derived from a real perf issue (#65508)
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`.
2025-11-07 15:34:34 +00:00
Sébastien
f2610651a1 fixed flaky (#65599) 2025-11-07 16:01:27 +01:00
Farhanul Haque Khan
5dc4b8809a Add logging configuration to Docker setup (#65521)
---------

Co-authored-by: Rodrigo López Dato <rodrigo@metabase.com>
2025-11-07 14:20:51 +00:00
Jeff Bruemmer
f70a7b3a7f update doc workflow to add manual input (#65597) 2025-11-07 14:18:08 +00:00
Nicola Mometto
5a7f27262d small bugfixes for mysql aws iam support (#65585) 2025-11-07 12:15:37 +00:00
Phoomparin Mano
f893c48fde fix(embed-js): black background is shown on systems with dark mode preferences (#65534)
* 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
2025-11-07 12:06:18 +00:00
Oleksandr Solovyov
f91fa374af metabot request cancelation (#65538)
this time it is actually working and tests are synchronized with real-world behavior
2025-11-07 13:32:24 +02:00
Dan Stone
aec03f0e37 Avoid DDL races in redshift sync (relation does not exist error) (#65546)
- 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.
2025-11-07 10:58:11 +00:00
Nemanja Glumac
ee9dd41cd2 Fall back to the staging token check (#65474) 2025-11-07 09:07:06 +01:00
dpsutton
97206bcf80 Fix docs scalar version (#65553)
* 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
2025-11-06 23:32:45 -05:00
Riley Thompson
02eec9c5b3 Update mongo test after driver upgrade (#65560)
* adjust exception assertion

* make exception msg regex more generic
2025-11-07 01:05:31 +00:00
Denis Berezin
d3f45bcced UXW-2179 Replace 'Add to dashboard' modal with a toast (#65400)
* 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
2025-11-07 02:11:42 +03:00
Jeff Bruemmer
0d3bae5103 docs - metabot can use the glossary (#65562)
* metabot can use the glossary

* link to glossary
2025-11-06 16:50:29 -05:00
Alex Yarosh
410c4aeb12 docs: for for for for for for (#65559)
* Fix typo in 'Checking for breaking changes' section

* Fix typo in 'Checking for breaking changes' section
2025-11-06 16:11:54 -05:00
Alex Yarosh
92a25096ae docs: dependencies on save (#65450)
* 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: Jeff Bruemmer <jeff.bruemmer@gmail.com>

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-06 15:21:33 -05:00
Chris Truter
5937d3bb38 Add flag to skip search reindexing on import (#65537)
* Add flag to skip search reindexing when loading entities

* Test flag
2025-11-06 15:06:51 -05:00
github-automation-metabase
85ff7199c0 Bump org.mongodb/mongodb-driver-sync from 5.5.1 to 5.6.1 (#64667)
Inspect dependency changes here: https://github.com/mongodb/mongo-java-driver/compare/r5.5.1...r5.6.1
2025-11-06 18:55:15 +00:00
Jeff Bruemmer
9731625cc4 docs - remote sync (#65443)
* 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

Co-authored-by: Alex Yarosh <alexandra@metabase.com>

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

Co-authored-by: Alex Yarosh <alexandra@metabase.com>

* edits

* edits

Co-authored-by: Alex Yarosh <alexandra@metabase.com>

* edits

* more edits

* clean up

* edit

* clean up

* dev instance

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-11-06 17:34:41 +00:00
Nicola Mometto
ff099455d0 Add AWS IAM Authentication Support for PostgreSQL and MySQL (#65418)
* add aws jdbc wrapper

* add aws-iam option to auth-provider-options

* WIP: hook ssl iam in postgres

* wip

* working

* style

* postgres appdb aws iam support

* auth-provider-options-only-aws

* aws iam for mysql

* ssl

* warnings

* as error

* support appdb uri

* add unit tests

* warning

* don't automatically include useSSL

* support ssl-cert configs for mysql appdb

* more unit tests

* refactor

* integration test

* fix: always set useSSL for aws-iam in mysql appdb

* fix mysql uri

* chore

* style

* fix

* connection tests

* setup for CI

* temporarily disable until secrets are setup

* chore: set

* add warning

* Revert "temporarily disable until secrets are setup"

This reverts commit 4ca6eb4607.
2025-11-06 16:26:32 +00:00
Alex Yarosh
5037eec437 Update impersonation.md to include Starburst/Trino (#65542)
Added Starburst/Trino to the list of supported databases for impersonation.
2025-11-06 10:34:54 -05:00
Aleksandr Lesnenko
a5db416a8a use new library icon for remote-synced collections (#65251)
* 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: Brad Anderson <brad@metabase.com>
2025-11-06 14:26:50 +00:00
Timofey Kachalov
b9df4f2f7e Enhance onBeforeRequest into onBeforeRequestHandlers for Api class (#65195) 2025-11-06 13:13:26 +04:00
Riley Thompson
b9f50ff543 Fix databricks tests after driver upgrade (#65498)
* fix databricks tests

* Assert query works with invalid user agent

* Address comments
2025-11-06 02:36:48 +00:00
Sloan Sparger
71f0ce1469 [Dark Mode] Update Metabot illustration (#65185)
* refactor HomeGreeting and convert to use css module over styled components

* update colors for metabot illustration

* bad ai

* rename

* pr feedback

* small adjustments
2025-11-05 20:06:56 -06:00
github-automation-metabase
1969873cb0 Bump com.github.oliyh/martian-clj-http from 0.1.31 to 0.2.1 (#64394)
Inspect dependency changes here: https://github.com/oliyh/martian/compare/0.1.31...0.2.1
2025-11-06 00:29:30 +00:00
github-automation-metabase
8bde92165a Bump net.snowflake/snowflake-jdbc-thin from 3.26.1 to 3.27.0 (#64668)
Inspect dependency changes here:
2025-11-06 00:29:11 +00:00
Nemanja Glumac
4591f96f57 Remove unneeded tests after #65485 (#65517) 2025-11-06 00:10:20 +01:00
dpsutton
08a43180d7 spark failure fix (#65502)
* 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
2025-11-05 16:56:07 -06:00
Nemanja Glumac
8a9a134989 Make Trunk analytics always run (#65451)
* 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.
2025-11-05 23:34:48 +01:00
github-automation-metabase
f6582c78d1 Bump org.clojure/clojure from 1.12.2 to 1.12.3 (#64158)
Inspect dependency changes here: https://github.com/clojure/clojure/blob/clojure-1.12.3/changes.md

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-05 21:46:55 +00:00
Nick Fitzpatrick
10deae2a03 removing new badge for move questions into their dashboards (#65485) 2025-11-05 17:39:06 -04:00
Braden Shepherdson
b910dc5566 chore: removing a stub CLJC file that got included accidentally (#65437) 2025-11-05 21:05:39 +00:00
Cam Saul
65a4a7c9e8 Fix kondo failure in master (#65496) 2025-11-05 13:04:47 -08:00
Alex Yarosh
8ab634d497 docs : clarify subscription settings (#65179)
* Update wording for subscriptions and alerts section

* Update docs/permissions/application.md

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-11-05 19:08:06 +00:00
github-automation-metabase
9431038a75 Update generated docs (master) (#65453)
Co-authored-by: github-actions <github-actions@github.com>
2025-11-05 14:01:21 -05:00
github-automation-metabase
cccb11b0d2 Bump org.eclipse.jetty/jetty-server from 12.0.24 to 12.1.3 (#65034)
* Bump org.eclipse.jetty/jetty-server from 12.0.24 to 12.1.3

Inspect dependency changes here:

* Add other Jetty deps bumps

---------

Co-authored-by: Cam Saul <github@camsaul.com>
2025-11-05 18:19:16 +00:00
github-automation-metabase
53a2da3c62 Bump org.graalvm.polyglot/polyglot from 24.2.2 to 25.0.1 (#65038)
* Bump org.graalvm.polyglot/polyglot from 24.2.2 to 25.0.1

Inspect dependency changes here: https://github.com/oracle/graal/compare/graal-24.2.2...graal-25.0.1

* Consolidate deps bumps

---------

Co-authored-by: Cam Saul <github@camsaul.com>
2025-11-05 18:18:37 +00:00
github-automation-metabase
8be450aa19 Bump io.netty/netty-common from 4.1.124.Final to 4.2.7.Final (#64827)
* 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-05 17:55:34 +00:00
Oleksandr Yakushev
22929ac32b [mage] Use Babashka to run cljfmt on staged files in git pre-commit hook (#65026) 2025-11-05 19:23:53 +02:00
Oleksandr Yakushev
b2b5720843 [flake] Increase test timeout in metabase.app-db.liquibase-test (#64814) 2025-11-05 19:04:08 +02:00
Oleksandr Yakushev
8abb1420e0 [qp] Reuse oridinarily compiled query as inline if it doesn't have params (#64651) 2025-11-05 18:59:22 +02:00
Ryan Laurie
23287f9f28 Toggle dark mode from command palette (#65359)
* toggle dark mode from command palette

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

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2025-11-05 16:32:46 +00:00
Noah Moss
06e016fe4e Surface collection descriptions to metabot in search (#65442)
* Surface collection descriptions to metabot in search

* Fetch descriptions as a post-processing step as they're not indexed
2025-11-05 11:15:24 -05:00
Jakub Chodorowicz
be8686b577 feat: make metabot logo follow the bran colors (#65358)
# Conflicts:
#	frontend/src/metabase/common/components/MetabotLogo/MetabotLogo.stories.tsx

# Conflicts:
#	loki.config.js
2025-11-05 16:51:58 +01:00
Aleksandr Lesnenko
71eb726eb5 upgrade to echarts v6 (#64139)
* upgrade to echarts v6

* Update Loki Snapshots

* Fix BE test

* update gridlines helper function

* adjust test

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2025-11-05 11:45:47 -04:00
Anderson
60c65add21 Make sure /dirty is called when moving an entity out of the library (#65259)
* 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
2025-11-05 11:22:47 -03:00
Stas Gavrylov
e65f73716c GDGT-1185: Columns appear twice in model list view until action taken (#65412)
* 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
2025-11-05 16:14:56 +02:00
Ngoc Khuat
be8790142c Proxy apis for store to get plan and addons (#65423) 2025-11-05 13:02:39 +00:00
Uladzimir Havenchyk
d04a2452f4 chore: ignore e2e embedding host apps from linting (#65467) 2025-11-05 15:58:27 +03:00
Oleksandr Solovyov
6ff47bfe22 metabot: handle (and propagate) request cancellation (#65461) 2025-11-05 14:37:27 +02:00
Timofey Kachalov
2df9e2645f Fix getNextSdkVersion helper (#65466) 2025-11-05 16:26:48 +04:00
Nicolò Pretto
1e997d6d5c ci: allow running stress tests on sdk tests (#64759)
* ci: allow running stress tests on sdk tests

* type choice

* yeah this should work 🤞

* ok we should also build the sdk

* maybe this time

* do we need to setup the BE?

* Revert "do we need to setup the BE?"

This reverts commit 7e9092e2c3.

* trying the auto infer thing out

* refactor and move the logic up to dedup it

* rename output

* move up env?

* Revert "move up env?"

This reverts commit f78f72e396.

* increase timeout to make stress test with throttling pass

* increase the timeout even more :shrugs:
2025-11-05 10:31:41 +01:00
Timofey Kachalov
381d156ca6 Use stableStringify for PublicOrEmbedDashboardView story + add StrictUnion type (#65411) 2025-11-05 12:51:48 +04:00
Nemanja Glumac
43301c49ad Stabilize and deduplicate eslint cache (#65410) 2025-11-05 09:31:47 +01:00
Nathan Voxland
a133b31fc4 Renamed Library to Synced Collection (#65447)
Renamed Library to Synced Collection
2025-11-04 23:32:13 -06:00
github-automation-metabase
d632109808 Bump cider/piggieback from 0.6.0 to 0.6.1 (#63218)
Inspect dependency changes here:

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-05 00:49:45 +00:00
github-automation-metabase
a316b1d9d3 Bump com.metabase/athena-jdbc from 3.5.0 to 3.6.0 (#64166)
Inspect dependency changes here:

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-11-05 00:41:06 +00:00
github-automation-metabase
d7a97b5704 Bump com.google.cloud/google-cloud-bigquery from 2.54.2 to 2.55.3 (#65041)
Inspect dependency changes here: https://github.com/googleapis/java-bigquery/blob/v2.55.3/CHANGELOG.md
2025-11-05 00:28:05 +00:00
github-automation-metabase
53fdb817c4 Bump io.github.clojure/tools.build from 0.10.10 to 0.10.11 (#65334)
Inspect dependency changes here: https://github.com/clojure/tools.build/blob/v0.10.11/CHANGELOG.md
2025-11-05 00:21:57 +00:00
github-automation-metabase
ead22c46a3 Bump ch.qos.logback/logback-classic from 1.5.18 to 1.5.20 (#64819)
Inspect dependency changes here:
2025-11-05 00:13:30 +00:00
github-automation-metabase
1615c60cbf Bump org.apache.sshd/sshd-core from 2.16.0 to 3.0.0-M2 (#65031)
Inspect dependency changes here:
2025-11-05 00:08:47 +00:00
github-automation-metabase
b3fa75c941 Bump dk.ative/docjure from 1.21.0 to 1.22.0 (#64821)
Inspect dependency changes here: https://github.com/mjul/docjure/blob/v1.22.0/CHANGELOG.md
2025-11-04 16:05:24 -08:00
github-automation-metabase
2821954e9b Bump software.amazon.awssdk/s3 from 2.33.0 to 2.36.2 (#65039)
* Bump software.amazon.awssdk/s3 from 2.33.0 to 2.36.2

Inspect dependency changes here:

* Consolidate deps bumps

---------

Co-authored-by: Cam Saul <github@camsaul.com>
2025-11-05 00:02:22 +00:00
github-automation-metabase
d4acb644ee Bump com.microsoft.sqlserver/mssql-jdbc from 13.2.0.jre11 to 13.2.1.jre11 (#64831)
Inspect dependency changes here:
2025-11-04 23:58:12 +00:00
github-automation-metabase
1236a70059 Bump nrepl/nrepl from 1.4.0 to 1.5.1 (#64823)
Inspect dependency changes here: https://github.com/nrepl/nrepl/blob/v1.5.1/CHANGELOG.md
2025-11-04 15:53:52 -08:00
github-automation-metabase
ab8fcd54b0 Bump com.facebook.presto/presto-jdbc from 0.294 to 0.295 (#64829)
Inspect dependency changes here:
2025-11-04 15:49:09 -08:00
github-automation-metabase
6dbe6594a7 Bump com.databricks/databricks-jdbc from 2.7.3 to 3.0.1 (#64828)
Inspect dependency changes here:
2025-11-04 15:37:15 -08:00
github-automation-metabase
f83b585668 Bump com.amazonaws/aws-java-sdk-core from 1.12.788 to 1.12.792 (#64403)
Inspect dependency changes here:
2025-11-04 15:19:09 -08:00
github-automation-metabase
53d01c5274 Bump cider/cider-nrepl from 0.57.0 to 0.58.0 (#64820)
Inspect dependency changes here: https://github.com/clojure-emacs/cider-nrepl/blob/v0.58.0/CHANGELOG.md
2025-11-04 15:07:32 -08:00
Timofey Kachalov
8137d490b3 Adjust parameter_mappings for a text dashcard when its variable is removed (#64463) 2025-11-05 02:53:44 +04:00
metamben
e39c2119d2 Add creator_id for transform (#65388)
* Add creator_id for transform

Closes QUE-2715
2025-11-05 01:46:34 +03:00
Nathan Voxland
c471c5640d Improve tracking for new objects that get deleted before sync (#65433) 2025-11-04 16:36:55 -06:00
Eric Normand
609a58ad6d Tiny cleanup 2025-11-04 15:48:39 -06:00
Eric Normand
e202541ac8 Don't double ref: 2025-11-04 15:27:12 -06:00
Fraser
2f49744ee1 Remove parsing from file download e2e tests (#65081)
* Make e2e download tests more lightweight

* Fix helper to handle redirects
2025-11-05 10:18:43 +13:00
Eric Normand
7e54e25766 Better 2025-11-04 15:09:27 -06:00
Nick Fitzpatrick
283eae65b6 Adding collection name to recent documents (#65376)
* Adding collection name to recent documents

* re-arranging e2e test
2025-11-04 17:07:36 -04:00
Braden Shepherdson
1217fca9a4 [perf] Add lib.computed, optimize wide tables and deep user queries (#65364)
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.

### Investigation Notes

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.

### Optimizations

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.

#### New Caching Approach

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.

### New Benchmarking Tools

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.
2025-11-04 20:49:25 +00:00
Eric Normand
9b903edd5e document 2025-11-04 14:33:50 -06:00
Jeff Bruemmer
5884bfe547 docs - various edits (#65422)
* various edits

* edits
2025-11-04 14:39:26 -05:00
Aleksandr Lesnenko
9d1d534e51 remote sync analytics (#65129) 2025-11-04 18:38:23 +00:00
Nick Fitzpatrick
2fb4793c24 fix large command palette subtext elements, add loki testing (#65369)
* fix large command palette subtext elements, add loki testing

* how did I miss this?

* updating Overlay demo
2025-11-04 13:23:12 -04:00
Nathan Voxland
954857c036 Clean up remote sync source vs. snapshot APIs (#65122) 2025-11-04 11:00:45 -06:00
Eric Normand
ea1cdf4917 Checkpoint 2025-11-04 10:35:49 -06:00
Oleksandr Yakushev
6d1d618fff [util] Explicitly test for BigDecimals in real-number? (#65202) 2025-11-04 18:24:45 +02:00
Aleksandr Lesnenko
785c418578 allow disabling remote sync (#65175) 2025-11-04 15:45:41 +00:00
Ryan Laurie
9d1c3c0ab4 Release Log Upgrades (#65186)
* support tag refs in version log

* release log upgrades

* use html url

* no thanks

* update tests

* ok review bot, you win
2025-11-04 08:33:21 -07:00
Brad Anderson
57daa4d5dc Fix #50044 - Updates dashcard loading state so it shows the correct title while it's loading (#65363) 2025-11-04 10:19:19 -05:00
Chris Truter
805badeb79 Flake protection 🥐 (#65415) 2025-11-04 12:27:56 +00:00
Nemanja Glumac
5ea9541981 Fix the auto-patch workflow (#65417) 2025-11-04 13:12:53 +01:00
Abed Habli
72a7ebec91 V57 docs: updating Alerts + Model view (#65353)
* update screenshot

* Updating model list view

* updating screenshots to Model view

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

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-11-04 12:16:11 +01:00
Nemanja Glumac
cdb6640ea4 Resolve a missing pre-release output (#65413)
[ci skip]
2025-11-04 12:07:38 +01:00
Chris Truter
8b90ffd906 Exclude other users collections in metabot search (#65348)
Closes BOT-496
2025-11-04 11:54:34 +02:00
Timofey Kachalov
3758d88539 Add embedding_type field for card/dashboard (#65209) 2025-11-04 12:45:57 +04:00
Aleksandr Lesnenko
d6397e205e skip flaky UpsellBigCard loki specs (#65404)
* skip flaky UpsellBigCard loki specs

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-11-04 08:21:26 +03:00
Noah Moss
01f7eeb023 Recreate model index quartz triggers on job initialization when needed (#65394)
* Recreate model index quartz triggers on job initialization when needed

* whitespace

* rename var + add comment
2025-11-03 19:32:49 -05:00
Eric Normand
c58e26c8e2 Add resolve to export 2025-11-03 17:28:03 -06:00
Nathan Voxland
8f3730dd45 Improving git management for remote sync (#65249) 2025-11-03 16:19:31 -06:00
dpsutton
5e92088c7d remove useless log (#65390)
```
Updating table metadata for Table 5465 ''properati_ar.properties_rent_201607'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5465 ''properati_ar.properties_rent_201607'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5485 ''properati_ar.properties_sell_201706'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5485 ''properati_ar.properties_sell_201706'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5468 ''properati_ar.properties_rent_201602'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5468 ''properati_ar.properties_rent_201602'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5511 ''properati_ar.properties_rent_201612'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5511 ''properati_ar.properties_rent_201612'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5431 ''properati_ar.properties_sell_201802'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5431 ''properati_ar.properties_sell_201802'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5441 ''properati_ar.properties_sell_201707'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5441 ''properati_ar.properties_sell_201707'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5467 ''personal_bq_repro.events_20230519'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5467 ''personal_bq_repro.events_20230519'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5484 ''properati_ar.properties_sell_201708'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5484 ''properati_ar.properties_sell_201708'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5434 ''properati_ar.resultados_apto_credito'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5434 ''properati_ar.resultados_apto_credito'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5501 ''properati_ar.properties_sell_201704'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5501 ''properati_ar.properties_sell_201704'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5433 ''properati_ar.properties_rent_201604'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5433 ''properati_ar.properties_rent_201604'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5478 ''properati_ar.properties_sell_201702'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5478 ''properati_ar.properties_sell_201702'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5498 ''properati_ar.properties_sell_201512'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5498 ''properati_ar.properties_sell_201512'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5447 ''properati_ar.properties_rent_201709'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5447 ''properati_ar.properties_rent_201709'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5463 ''properati_ar.properties_rent_201609'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5463 ''properati_ar.properties_rent_201609'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5448 ''properati_ar.properties_rent_201509'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5448 ''properati_ar.properties_rent_201509'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
```

We unconditionally say we are updating table metadata, but then when we
actually change anything we of course include the table name.

Note here there is some kind of bug that we are changing the
table (which property??) from null to null.
2025-11-03 16:02:18 -06:00
Jeff Bruemmer
2da5fb8aa8 token data (#65396) 2025-11-03 21:43:00 +00:00
Timothy Dean
99d1bd8cdf Use lookup/lookup-database-id in more places 2025-11-03 14:42:52 -07:00
Uladzimir Havenchyk
a94a70fe46 chore: cleanup warnings from postcss (#64954)
* chore: cleanup warnings from postcss

* Update frontend/src/metabase/common/components/EmojiPicker/EmojiPicker.module.css

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>

---------

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-11-04 00:08:22 +03:00
Timothy Dean
57999716ce Playing with model metadata 2025-11-03 14:05:31 -07:00
Oleksandr Yakushev
5880342225 Remove unused metabase.util.formatting.numbers and metabase.util.formatting.time (#63791) 2025-11-03 22:37:47 +02:00
Eric Normand
57f64aded5 Hook rename refs into api 2025-11-03 13:34:16 -06:00
Jeff Bruemmer
89adf23ef7 update api docs (#65382) 2025-11-03 14:30:57 -05:00
Eric Normand
8d204c712e Whitespace 2025-11-03 13:28:25 -06:00
Denis Berezin
7c7241d350 UXW-2182 fix codemirror editor suggestions styles in light mode (#65367) 2025-11-03 22:03:53 +03:00
Eric Normand
2cbece56c3 Nice set of name tests with a munge-name implementation 2025-11-03 13:01:15 -06:00
Jeff Bruemmer
9638db8b02 json from data-url (#65374) 2025-11-03 18:47:47 +00:00
AlessioLaiso
bace3da926 Updates 6 illustrations for dark mode (#65375) 2025-11-03 14:31:13 -04:00
Ryan Laurie
898c82ad4c add v57 to version-helpers (#65227) 2025-11-03 18:29:18 +00:00
Ryan Laurie
c9792f6604 Restore calendar hover styles (#65361)
* restore calendar hover styles

* fix calendar picker hover states

* remove unnecessary rule
2025-11-03 11:28:02 -07:00
Noah Moss
ec0bc5e081 Comment out BackfillTransformSourceType migration (#65147) 2025-11-03 13:20:13 -05:00
Timothy Dean
c8c515462a Fix bad var reference 2025-11-03 10:53:40 -07:00
Nathan Voxland
9b4c474e11 Remote sync should ignore system git settings (#65293) 2025-11-03 11:38:47 -06:00
metamben
8f10457e32 Add archived flag to graph endpoints (#65366)
Fixes QUE-2708
2025-11-03 16:43:27 +00:00
AlessioLaiso
20b3834269 Updates 35 SVG illustrations (#65232)
* 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: Nick Fitzpatrick <nickfitz.582@gmail.com>
2025-11-03 12:24:40 -04:00
Denis Berezin
0150dcfe07 UXW-2170 cleanup chart brush (#65313) 2025-11-03 18:49:40 +03:00
Riley Thompson
2b2a22b86d filter for active fields (#65245) 2025-11-03 15:11:08 +00:00
Noah Moss
d3e976ed53 Annotate draft transforms in user_is_viewing context with source type when possible (#65283)
* Annotate draft transforms in user_is_viewing context with source type when possible

* add unit tests

* Move transform-source-type helper to transform utils; some refactor

* switch to use lib/native-only-query; change default transform query in tests to use mbql5

* switch batch to using lib.query/native?

* switch back to native-only-query?

* clean ns
2025-11-03 09:56:29 -05:00
lbrdnk
c950dad7eb Fix suggested prompts schema and add test (#65299) 2025-11-03 15:33:50 +01:00
lbrdnk
2693173e7f Compute param values from card results (#64318)
* 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

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>

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

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>

* indent

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-11-03 15:33:39 +01:00
Denis Berezin
3ca4c5a2ee UXW-175 Fix visualization mode switch for pivot table (#65252) 2025-11-03 17:18:36 +03:00
Denis Berezin
9c0910f652 UXW-2172 UXW-2174 remove Document cards click actions (#65191)
* 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
2025-11-03 17:18:21 +03:00
Mahatthana (Kelvin) Nomsawadi
cbf7579c4c Correct interactive embed query execution count (#65336)
* Simplify the FE API code

* Exclude static embed preview from being counted in analytics

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Clarify comments

* Add tests

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-03 13:11:10 +00:00
Nemanja Glumac
5ec5c9a9d3 Fix and revive the backend cloverage workflow (#65341) 2025-11-03 11:22:02 +01:00
github-automation-metabase
9ee26d70fd Bump com.ibm.icu/icu4j from 77.1 to 78.1 (#65332)
Inspect dependency changes here:
2025-11-03 09:30:00 +00:00
github-automation-metabase
73aab1d129 Bump djblue/portal from 0.61.0 to 0.62.0 (#65333)
Inspect dependency changes here: https://github.com/djblue/portal/blob/0.62.0/CHANGELOG.md
2025-11-03 09:29:14 +00:00
Oleksandr Yakushev
6375368c92 [kondo] Encourage more m.util.performance functions in perf-sensitive namespaces (#65331) 2025-11-03 11:09:43 +02:00
Nemanja Glumac
ee3cfb7e68 Disable CodeQL trap caching (#65275) 2025-11-03 09:52:34 +01:00
metamben
e62903b72a Add test case missing from #65240 (#65327)
The PR #65240 got merged without this test.
2025-11-02 02:58:31 +02:00
metamben
652f725d41 Make transforms available in search for admins only (#65240)
* Make transforms available in search for admins only

Fixes QUE-2710

* Fix test
2025-11-01 02:42:23 +03:00
Dan Stone
2c49eb977d Add missing .result to script output lookup in pre-release (#65298) 2025-10-31 23:02:21 +00:00
Timothy Dean
4ed9e32676 Delete unused and stale yml files 2025-10-31 16:48:46 -06:00
Timothy Dean
3a02474632 Delete bin/* scripts 2025-10-31 16:44:03 -06:00
Brad Anderson
b70e091fe8 Fix #64685 - Update brand colors in UI without needing refresh (#65292)
* 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
2025-10-31 18:39:08 -04:00
Timothy Dean
20875923d7 Delete example-manifest.yml 2025-10-31 16:36:36 -06:00
Timothy Dean
2b2cd76b2f Delete ./representation babashka stuff 2025-10-31 16:35:28 -06:00
Brad Anderson
dff2d77981 UXW-2183 Remove fullscreen dashboard night mode toggle (#65312) 2025-10-31 18:16:07 -04:00
Robert Kosara
60ec838229 Remove mention of "night mode" and image (#65318)
* Remove mention of "night mode" and image

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

* Delete dark mode/night mode image
2025-10-31 21:44:44 +00:00
dpsutton
830a6d5c83 Don't count app-db not setup errors in circuit breaker (#65295)
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:27 -05:00
Eric Normand
6a78c448cf Oops bad merge 2025-10-31 16:24:46 -05:00
Eric Normand
81fa467312 Export ref renaming 2025-10-31 16:18:40 -05:00
Eric Normand
7b604076bc move more stuff for order-reprsentations 2025-10-31 16:18:00 -05:00
github-actions[bot]
e0ebddd4f2 Update translations 2025-10-30 (#65213)
* Update translation sources 2025-10-30

* Update translations

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-10-31 20:45:47 +00:00
metamben
79b350eca6 Make sure enough info about transforms is selected (#65291)
Fixes QUE-2731
2025-10-31 23:41:25 +03:00
Timothy Dean
8f8b2b762a Bugfixes in insert! and update! 2025-10-31 14:24:33 -06:00
Timothy Dean
db2d21ef20 Fix v0.common-test errors 2025-10-31 14:19:49 -06:00
Timothy Dean
c2a163701b Step 3, multimethods gone and circular dependencies resolved. 2025-10-31 14:16:53 -06:00
Timothy Dean
2a9df86ff0 Step 2 of cleanup, removing import dependency from v0.* representation nses 2025-10-31 13:45:31 -06:00
Timothy Dean
b2502af083 Step 1 of a series of big cleanup commits 2025-10-31 13:35:06 -06:00
Riley Thompson
af1be91a28 Implement connection impersonation for starburst (#64972)
* 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
2025-10-31 18:29:05 +00:00
Robert Kosara
6322ffc3b3 Small edits to v57 docs about Glossary, dark mode, and progress bars (#65253)
* 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

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

* Remove the bit about LLMs again

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-10-31 18:17:36 +00:00
Eric Normand
4cd66a1b6e move order-representations into v0-common 2025-10-31 11:37:48 -05:00
Eric Normand
eb9a0acb6f Oops 2025-10-31 10:22:09 -05:00
Edward Paget
e657e83c3e fix: allow stacktraces to be suppressed in API (#65215)
* 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
2025-10-31 09:12:45 -05:00
Nemanja Glumac
4b3c293f04 Remove superfluous python setup from H2 driver test (#65272) 2025-10-31 15:09:48 +01:00
Brad Anderson
1447fa0e95 Fix: UXW-2171 Prevents "Edit Query" from clearing name on chart (#65224) 2025-10-31 09:38:55 -04:00
Edward Paget
cb2510a55d fix: pivoting json values (#65183)
* fix: pivoting json values

* fixup! kondos in test

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

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

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-10-31 08:35:55 -05:00
Nemanja Glumac
90f2e42b19 Sunset e2e cross-version tests (#65269)
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
2025-10-31 14:34:09 +01:00
Mahatthana (Kelvin) Nomsawadi
cbcb70a438 Fix deleted documents were editable (#65136)
* 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
2025-10-31 19:15:46 +07:00
lbrdnk
e47e51c229 Metabot glossary integration (#65223)
* Return glossary with user info

* Test glossary in response
2025-10-31 12:25:34 +01:00
Jeff Bruemmer
e6a3974c9a Fix env var doc gen (#65230)
* fix issue with env var gen and some cleanup

* cleanup
2025-10-31 07:00:20 -04:00
Dan Stone
247db60bb7 Increase sync timeout in execution test (#65205)
Redshift sync of even one table can take a really long time (sometimes
over 5 seconds).

Increased to 10 seconds for now.
2025-10-31 10:40:35 +00:00
Jeff Bruemmer
619d9350cc remove registry (#65242) 2025-10-31 03:14:57 +00:00
Nemanja Glumac
9b53db936e Fix logs upload for drivers (#65257)
* 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 02:33:06 +01:00
Nemanja Glumac
024d197e3e Upgrade CodeQL action version (#65250) 2025-10-31 14:04:55 +13:00
metamben
7937c6888c Optimize graph API endpoints (#65172) 2025-10-30 19:41:16 -04:00
github-actions[bot]
3369bf7d15 Update E2E test timings with averaged data (#65024)
Collected timing data from 7 days of test runs.
All specs with timing data were included (simple averages).

🤖 Generated automatically by update-e2e-timings workflow

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <actions@github.com>
2025-10-30 22:58:27 +00:00
Uladzimir Havenchyk
c7fb07c387 deps: drop react-beautiful-dnd (#64713)
Co-authored-by: Fraser <fraser@metabase.com>
2025-10-31 11:24:41 +13:00
Noah Moss
525dec7eb0 Metabot /debug mode to show tool calls (#64811)
* 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: Sloan Sparger <sloansparger@gmail.com>
2025-10-30 17:20:39 -05:00
Timothy Dean
bc6f659963 m. Remove ref: initial from workflows importing metabase/representations 2025-10-30 16:09:09 -06:00
Timothy Dean
93fe76a5c6 More temporary stuff, getting verify-i18n-files running 2025-10-30 16:06:35 -06:00
Timothy Dean
993672c878 Merge remote-tracking branch 'origin/master' into representations 2025-10-30 15:58:00 -06:00
Timothy Dean
2421a24f31 More temporary boilerplate 2025-10-30 15:57:41 -06:00
Timothy Dean
2688cf4cfb Build artifact with metabase/representations 2025-10-30 15:53:20 -06:00
Timothy Dean
4ac312e62c Missed a file 2025-10-30 15:50:16 -06:00
Timothy Dean
32a67d3633 Experimental. Delete copy of metabase/representations, use PAT to check out private repo 2025-10-30 15:46:02 -06:00
Ryan Laurie
f4dde2f744 fix comma in pre-release workflow (#65248) 2025-10-30 20:51:46 +00:00
Nemanja Glumac
c81e28e240 Support releases with different token testing strategies (#65203) 2025-10-30 21:29:02 +01:00
Alexander Polyankin
b859cbfd59 Extract QueryEditor from transforms (#65160) 2025-10-30 20:03:01 +00:00
Nick Fitzpatrick
99a736360b update document title compare to determine dirty state (#65229) 2025-10-30 19:50:30 +00:00
Eric Normand
e343d5ebbe Default db. Fix insert/update. Default to name if display_name is not avilable. 2025-10-30 14:49:36 -05:00
Alexander Polyankin
93d099427e Enable dependency graph UI (#65210) 2025-10-30 19:38:58 +00:00
Nick Fitzpatrick
6fafafe082 fix falsey check when removing card embed from document (#65222) 2025-10-30 16:36:25 -03:00
Nick Fitzpatrick
1a2035d5a4 update hover colors in UserListElement (#65174)
* update hover colors in UserListElement

* adjusting colors

* updating comment
2025-10-30 16:35:27 -03:00
Phoomparin Mano
186df5d802 fix(sdk): non-editable dashboard should not have "add a chart" button and title should be read-only (#65102) 2025-10-31 02:24:32 +07:00
Sloan Sparger
27d13486ac [Metabot] Copy change for suggested prompts setting description (#65163)
* update copy

* adjust copy for embedded metabot

* oops

* remove randomly

* fix test

* feedback
2025-10-30 13:53:33 -05:00
Edward Paget
41ba6ce845 Fix renamed test helper in documents (#65233) 2025-10-30 18:51:32 +00:00
Riley Thompson
1eb96fc1ec return false instead of throw (#65225) 2025-10-30 18:45:40 +00:00
Eric Normand
49020716b5 Multify insert! and update! 2025-10-30 13:38:03 -05:00
Edward Paget
bbc81e20b3 test a document creation in personal collection (#65118)
* test a document creation in personal collection

* fixup! ws
2025-10-30 12:33:41 -05:00
Stas Gavrylov
fafc53e645 GDGT-1083: Improve visual design for new List view in Stats before v57 (#64957)
* 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: Metabase Automation <github-automation@metabase.com>
2025-10-30 16:58:37 +00:00
Nathan Voxland
d0f5d01eea Create appdb tables in its own connection (#65171) 2025-10-30 10:33:35 -05:00
Nicolò Pretto
a04b79857f remove border from dashboard header where header=false and no tabs (#65161)
* remove border from dashboard header where header=false and no tabs

* move css code up to keep no border in fullscreen
2025-10-30 16:00:07 +01:00
Denis Berezin
9f0f6eb78c UXW-2091 user without collection access to Our Analytics can't save documents (#65159)
* UXW-2091 user without collection access to Our Analytics can't save documents

* fix typecheck

* Fix types

* Add e2e tests
2025-10-30 17:56:02 +03:00
Edward Paget
7ea1d83a67 fix: skip join in stats handler test (#64639) 2025-10-30 09:27:17 -05:00
Edward Paget
9aa6611557 fix: improve collections graph performance (#65098)
* 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
2025-10-30 09:26:26 -05:00
Edward Paget
a7b420eeba Update error message for remote sync dep checking (#65148)
* 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
2025-10-30 09:25:33 -05:00
dpsutton
7b8edfbad4 Token grace period (#64938)
* 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 08:51:56 -05: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
Timothy Dean
e406c0c35c Merge remote-tracking branch 'origin/master' into representations 2025-10-29 17:10:05 -06:00
Timothy Dean
3cd8c2f2cd Fix core-test 2025-10-29 17:02:35 -06:00
Timothy Dean
59f53c16db The big switchover to metabase/representations for schemas 2025-10-29 16:57:55 -06:00
Timothy Dean
cac18c4db2 Copy in metabase/representations 2025-10-29 16:56:34 -06:00
Ryan Laurie
6b09c0476c dont break scheduled patches (#65165) 2025-10-29 16:30:18 -06:00
Timothy Dean
dde1cd6b95 Copy from metabase/representations 2025-10-29 15:19:08 -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
Timothy Dean
e4b0d120e5 Copy 2b8f5d6 from metabase/representations 2025-10-29 14:31:00 -06:00
Eric Normand
56fac7fa11 Transforms order and better export/import 2025-10-29 15:23:27 -05: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
Eric Normand
6826b70279 Import test 2025-10-29 14:01:13 -05: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
Eric Normand
dae088f934 Databases maintain key order 2025-10-29 12:37:59 -05:00
Eric Normand
983bf8b002 Maintain model key order 2025-10-29 12:35:22 -05:00
Eric Normand
709a494ad4 :ref->:name in export 2025-10-29 12:32:20 -05:00
Eric Normand
29a5c1d804 Metric maintains order of keys 2025-10-29 12:32:05 -05:00
Eric Normand
d2a4f43bfa Maintain order of question keys 2025-10-29 12:31:54 -05:00
Eric Normand
9f04d4525c Docstring 2025-10-29 12:17:00 -05:00
Timothy Dean
6a98142d10 name -> display_name, ref -> name 2025-10-29 11:16:04 -06:00
Eric Normand
6e075b3fee MBQL5 fields appear to work 2025-10-29 12:04:58 -05:00
Eric Normand
f4f2fae807 Also use database: in referred to databases 2025-10-29 11:57:25 -05:00
Eric Normand
4b1783d724 ALways use query key 2025-10-29 11:57:02 -05:00
Eric Normand
9bb863e36f Reduce tables on export 2025-10-29 11:00:19 -05:00
Eric Normand
18b558507c Reduce database tables on export 2025-10-29 10:52:54 -05:00
Eric Normand
60af228ce8 Don't convert to markdown for now 2025-10-29 10:52:38 -05:00
Eric Normand
4ebe289c9e Represetnations button on database admin screen 2025-10-29 10:27:37 -05:00
Timofey Kachalov
d1c40b6c81 Restore sdk backward compat tests (#65154) 2025-10-29 19:20:08 +04:00
Eric Normand
b96378dd1d Try deps free version 2025-10-29 09:57:35 -05: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
Eric Normand
80a1ee7544 Change to tiptap 2025-10-29 09:51:35 -05: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
Eric Normand
190b660861 Refs for documents 2025-10-28 16:39:25 -05:00
Eric Normand
69a0182908 Can you handle the whitespace? 2025-10-28 16:13:20 -05: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
Eric Normand
096c943179 Better document export 2025-10-28 15:53:53 -05:00
Eric Normand
3250dbbe3b Document prosemirror to markdown 2025-10-28 15:53:53 -05: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
Timothy Dean
eb27ad00a2 Copy changes from metabase/representations 2025-10-28 12:03:41 -06: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
Timothy Dean
e5d50e6e41 Add :local/root to deps.edn for copy of metabase/representations 2025-10-28 11:33:39 -06: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
Timothy Dean
e876cc59ff Copy in metabase/representations 2025-10-28 11:19:52 -06:00
Timothy Dean
04f22bce1c Revert "Attempt to bring in metabase/representations as submodule"
This reverts commit 38edca362b.
2025-10-28 11:12:19 -06:00
Timothy Dean
fe38c6dbfb Revert "Maybe github CI can use submodules: true"
This reverts commit ab8d8e1a85.
2025-10-28 11:12:05 -06:00
Timothy Dean
ab8d8e1a85 Maybe github CI can use submodules: true 2025-10-28 11:06:40 -06: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
Timothy Dean
38edca362b Attempt to bring in metabase/representations as submodule 2025-10-28 11:00:11 -06:00
Eric Normand
481d5c7dd7 Fix card question 2025-10-28 11:47:55 -05: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
Eric Normand
bd407a7a23 Use native-only-query? 2025-10-28 11:17:34 -05: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
Eric Normand
81d235e1f9 Docstring 2025-10-28 10:35:48 -05:00
Eric Normand
a6e8e815e1 Correct env var problem 2025-10-28 10:34:21 -05:00
Eric Normand
20bc080cbe Source cards and native queris 2025-10-28 10:34:21 -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
Timothy Dean
9489190f9b Merge remote-tracking branch 'origin/master' into representations 2025-10-28 09:21:47 -06:00
Timothy Dean
481b92c289 Remove whitespace 2025-10-28 09:21:03 -06:00
Sébastien
e23658dd9a Closes EMB-928 sdk popover flashing at 0,0 (#65086) 2025-10-28 16:17:45 +01:00
Timothy Dean
adcc8e3e5c Merge remote-tracking branch 'origin/master' into representations 2025-10-28 09:17:36 -06: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
Eric Normand
d9fff0a2e7 Documents and collections representations 2025-10-27 18:38:41 -05: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
Eric Normand
ebe192cc51 Yes, transforms too. 2025-10-27 18:10:05 -05:00
Eric Normand
fbe0f1a83b Better UI, more cards 2025-10-27 18:10:05 -05:00
Timothy Dean
5f100521aa More use of lookup-database-id 2025-10-27 15:59:37 -06: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
Timothy Dean
dcc2e5b777 disable test, add comments 2025-10-27 14:58:26 -06:00
Timothy Dean
3152844182 Transforms code is stale and broken 2025-10-27 14:52:32 -06:00
Timothy Dean
6cd4d53aaa Fix typo in snippet-test and add uses of with-toucan-defaults 2025-10-27 14:42:53 -06:00
Timothy Dean
de157d98f1 Use v0-common/map-entity-index in more places 2025-10-27 14:37:16 -06:00
Timothy Dean
64a914bb6c Getting tests up to date 2025-10-27 14:22:59 -06:00
Timothy Dean
b392c931ef Delete stale test 2025-10-27 14:13:27 -06: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
Timothy Dean
57dce27409 Fix bug in new lookup-id impl for maps, update common-test 2025-10-27 14:10:05 -06:00
Nemanja Glumac
49c0589aa8 Remove mage tests from the core classpath (#65046) 2025-10-27 21:06:08 +01:00
Timothy Dean
7bbf5f082e Update stale reference to old with-toucan-defaults 2025-10-27 14:00:25 -06:00
Timothy Dean
6a90502eaa Fix CI issue: create lookup/lookup-database-id 2025-10-27 13:51:02 -06:00
Timothy Dean
be07b8fe0f Remove metabase/representations dependency so CI can run 2025-10-27 13:41:19 -06:00
Timothy Dean
802765a6b4 Fix with-toucan-defaults, add resolve-database-id, get more tests passing 2025-10-27 13:40:28 -06: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
Eric Normand
8e4d85d37b Get a modal. It works. Could be better. 2025-10-27 14:12:20 -05: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
Timothy Dean
ae17a6f937 Fix compilation error in representations.export 2025-10-27 11:41:01 -06:00
Timothy Dean
cafc5540c0 Add metabase/representations dependency 2025-10-27 11:41:01 -06:00
Eric Normand
ccc6c717d2 Missing yamls 2025-10-27 12:26:17 -05:00
Timothy Dean
944cefd0b5 Merge remote-tracking branch 'origin/master' into representations 2025-10-27 11:05:48 -06: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
Eric Normand
8bd2e87737 WIP document 2025-10-24 14:25:59 -05: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
Eric Normand
9927a4abcb Add with-toucan-defaults 2025-10-23 14:37:20 -05:00
Eric Normand
b087de7b13 Guard against infinite loops in order-representations 2025-10-23 12:23:37 -05: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
Eric Normand
3760109621 Robust tests against faulty cycle detection 2025-10-22 16:59:44 -05:00
Eric Normand
c44514f19e Cleanup and test 2025-10-22 16:50:44 -05:00
Nathan Voxland
ac22d632bc Improve logging and recovery around errors in reindexing and create-table! (#64897) 2025-10-22 16:07:13 -05:00
Eric Normand
d197607055 Add a first implementation of a RefIndex 2025-10-22 15:32:37 -05:00
Eric Normand
5b4b835a45 Move representation-type to common 2025-10-22 15:17:09 -05:00
Phoomparin Mano
b56f63252b Design polishes for modular embedding and embedding setup guide (#64893) 2025-10-23 03:14:52 +07:00
Eric Normand
9cb6173c3f Cycle detection in order-representations 2025-10-22 14:44:28 -05: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
Eric Normand
04fb2f80b8 Cleanup 2025-10-22 12:47:34 -05:00
Eric Normand
434e4c77b4 Whitespace 2025-10-22 12:35:46 -05:00
Eric Normand
fa86a2f729 Convert type->model to multimethod 2025-10-22 12:35:22 -05:00
Eric Normand
3e8cc7d241 Add docstrings in lookup 2025-10-22 12:01:12 -05:00
Eric Normand
9672377eff Add some todos for migration in comments 2025-10-22 12:00:52 -05: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
Eric Normand
2d25ff6801 More testing and polishing 2025-10-20 15:10:03 -05: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
Eric Normand
23c32a9679 More lookup functions 2025-10-20 13:37:11 -05:00
Eric Normand
192a3f8cab Good tests for exporting based on types 2025-10-20 13:21:01 -05:00
Eric Normand
d48e2e167f Test lookup and type conversion 2025-10-20 13:07:07 -05: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
Eric Normand
0fc449bb3f First pass at better import (WIP) 2025-10-14 13:55:33 +02: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
Eric Normand
0ccfcf9368 At leasts the tests pass 2025-10-10 23:06:49 -05:00
Eric Normand
f920a0ad6b Work with lib in transforms??? 2025-10-10 22:59:52 -05:00
Eric Normand
ad03eb5e71 Fix transform tests 2025-10-10 22:54:28 -05:00
Eric Normand
968ab66658 Get lib questions working (with tests) 2025-10-10 22:41:56 -05: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
Timothy Dean
531c0a2ec0 Tweaking mbql.clj 2025-10-10 13:46:38 -06: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
Timothy Dean
361b089ae6 Fix nesting bug in mbql.clj, re-enable a models test 2025-10-10 13:13:50 -06:00
Timothy Dean
f868deee6b Models and their metadata working much better 2025-10-10 12:55:18 -06:00
Timothy Dean
e24dd51f77 Land bugfixes in flow we're not using any longer, but it's related to the collections.yml ticket 2025-10-10 12:54:41 -06: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
Eric Normand
a8c3bf86bf Missed a reference 2025-10-10 12:31:11 -05: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
Eric Normand
f77ee2c518 Oops cyclical dep 2025-10-10 12:27:42 -05:00
Eric Normand
126768e0b4 Cleanup mbql stuff 2025-10-10 12:27:08 -05:00
Riley Thompson
a0088a70e2 Merge branch 'representations' of https://github.com/metabase/metabase into representations 2025-10-10 13:24:43 -04:00
Riley Thompson
64860019bc add snippet import tests 2025-10-10 13:24:33 -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
Eric Normand
b899d8cd97 Update test 2025-10-10 11:23:54 -05:00
Eric Normand
fc0f79e339 Export only schemas and tables that are referred to 2025-10-10 11:22:55 -05: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
Riley Thompson
60050841a2 snippet export test 2025-10-09 18:35:32 -04:00
Marcos
376daff947 fix transforms snippet sidebar add/edit button (#64575) 2025-10-09 18:00:00 -03:00
Eric Normand
bc8d0d0423 Metrics import/export tests 2025-10-09 15:02:19 -05: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
Riley Thompson
75de8e0572 remove static serve code from 3312f91 and 89bf939 2025-10-09 15:21:57 -04:00
Riley Thompson
9b1198ce7b remove frontend code 2025-10-09 14:50:58 -04: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
Riley Thompson
f1cb9c64fd use refs directory for db representations 2025-10-09 11:43:48 -04:00
Riley Thompson
80af50a637 replace content with sql in snippet representation 2025-10-09 11:29:22 -04: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
Riley Thompson
0ac69e8f89 Merge branch 'representations' of https://github.com/metabase/metabase into representations 2025-10-08 16:33:14 -04:00
Riley Thompson
2b3a76cf5b use lib native to build template tags 2025-10-08 16:33:09 -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
Eric Normand
a4acab9eff Dependency check API and beginnings of import 2025-10-08 13:32:22 -05:00
Riley Thompson
8dd09eaf20 Merge branch 'representations' of https://github.com/metabase/metabase into representations 2025-10-08 14:06:53 -04:00
Riley Thompson
085b060c4c add template tags to sql snippetes yaml->toucan 2025-10-08 14:06:43 -04:00
Timothy Dean
fb34fc1654 babashka import: manually fix a few issues, but the code organization is pretty bad 2025-10-08 11:00:46 -06: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
Riley Thompson
ca9f37c05f replace versioned :type key with separate :version and :type keys 2025-10-08 12:16:47 -04: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
Timothy Dean
2ebdcb6139 Init commit for representation.bb 2025-10-07 19:00:23 -06: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
Riley Thompson
1300e4fe2d Merge branch 'representations' of https://github.com/metabase/metabase into representations 2025-10-07 18:30:55 -04:00
Riley Thompson
ee5c71754a sql snippet representations 2025-10-07 18:30:49 -04:00
Eric Normand
e0790dda10 Structural change for better recursion 2025-10-07 16:21:41 -05:00
Eric Normand
ca30b7d361 Export entire collection (API) 2025-10-07 16:18:08 -05:00
Jeff Bruemmer
1e5fba41ed remove docs workflows (#64486) 2025-10-07 20:58:12 +00:00
Eric Normand
6697c05014 Can check question dependencies 2025-10-07 15:39:54 -05: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
Eric Normand
56e70074d0 Merge branch 'representations' of github.com:metabase/metabase into representations 2025-10-07 12:15:01 -05:00
Eric Normand
7e0b5e85cd Don't use ref/ namespace 2025-10-07 12:14:34 -05:00
Timothy Dean
e7154969aa Delete a ton of code and experimental feature work. 2025-10-07 10:46:25 -06: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
Timothy Dean
471e76be64 Whitespace 2025-10-06 13:01:42 -06:00
Timothy Dean
25908d5f96 Fix core-test 2025-10-06 12:53:41 -06:00
Timothy Dean
42f5d6cc13 Merge remote-tracking branch 'origin/master' into representations 2025-10-06 12:44:46 -06:00
Edward Paget
54919da812 Remove parallel annotation from tests (#64386) 2025-10-06 18:43:43 +00:00
Timothy Dean
e3a9edcb7a Fix question-test 2025-10-06 12:41:56 -06:00
Timothy Dean
cf1c863b2b Fix YAML dumper-options, filenames, misc. 2025-10-06 12:19:26 -06:00
Timothy Dean
f7db036c73 Add latest export examples 2025-10-06 12:18:09 -06:00
Alex Yarosh
11fec69c5e docs: price change (#64426) 2025-10-06 14:17:23 -04:00
Timothy Dean
49cb9edfa7 Fix topological sort for base64-encoded mbql 2025-10-06 11:10:36 -06: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
Timothy Dean
0fd583ee05 Non-cleaned-up, but new tests and metadata overrides for models. Mix of hand and vibe code, cleanup needed 2025-10-04 00:57:43 -06:00
Timothy Dean
a33fee2435 MBQL separated as base64-encoded blob 2025-10-03 23:33:53 -06:00
Phoomparin Mano
38260ca608 Remove unused EmbeddingSetup components and hooks (#63841) 2025-10-04 07:05:14 +07:00
Timothy Dean
de107e5639 Add forgotten file. 2025-10-03 17:20:59 -06:00
Timothy Dean
339ce9b24c export-import-with-refs-test 2025-10-03 17:12:09 -06:00
Timothy Dean
07b6dcd9ea export-with-refs and export-with-ids 2025-10-03 16:56:57 -06:00
Timothy Dean
560a3b67f0 Cleanup, about to refactor to allow bimodal exports 2025-10-03 15:39:08 -06:00
Eric Normand
d8ae013339 Ooops! 2025-10-03 15:58:36 -05:00
Eric Normand
ad06c09272 Transforms work! 2025-10-03 15:35:38 -05: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
Timothy Dean
b0d38931d0 Some fixes, mostly around models 2025-10-03 12:15:50 -06: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
Eric Normand
30f997054b Make question tests pass 2025-10-01 16:51:44 -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
Eric Normand
bc73878e2a Fix kondo and remove bad docstring 2025-10-01 14:07:41 -05:00
Eric Normand
2bdaa1ca68 Make export-set take a collection of reps 2025-10-01 14:07:23 -05:00
Eric Normand
949633567d Whitespace in cond 2025-10-01 14:06:57 -05:00
Eric Normand
ee68edecae Fix question test 2025-10-01 14:06:45 -05: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
Eric Normand
6b055d5133 Use u/remove-nils instead of custom one 2025-10-01 13:36:55 -05: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
Timothy Dean
c39e42692c Fix circular dependencies 2025-09-30 23:55:11 -06:00
Timothy Dean
34dc6533b2 Cleaning up a little, and resolving 104 kondo warnings 2025-09-30 22:52:08 -06: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
Timothy Dean
46bf926ee3 Get import/export buttons working more nicely (for database.yml and question.yml only) 2025-09-30 16:13:12 -06:00
Riley Thompson
54389ff03a fix collection script 2025-09-30 17:10:01 -04:00
Riley Thompson
13a76e983e Merge branch 'master' into representations 2025-09-30 17:04:15 -04:00
Riley Thompson
34b84f3151 download and upload transform represenations 2025-09-30 17:02:04 -04: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
Timothy Dean
d65e9c8ec4 Merge duplicated work, get batch-imports working for at least questions and databases.
Eric and I duplicated some work. This merges our efforts. This also builds in ref patching on import and export and provides an `import-dir!` method that #worksonmymachine.

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-09-29 14:23:59 -06: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
Kamil Mielnik
581c1e7a38 WRK-871 Details view: JSON formatting missing in details view (#63892)
* Format JSON in new detail view

* Use mantine props

* Use Code

* Use CodeEditor
2025-09-29 10:31:59 +00:00
Romeo Van Snick
17a61a81c8 Add missing import (#64171) 2025-09-29 11:17:26 +02:00
Romeo Van Snick
1d699a5fae Use the entities display name if possible (#64076) 2025-09-29 13:32:11 +10:00
Ngoc Khuat
277d1fdaff Skip sync transforms temp table (#64037) 2025-09-28 15:00:43 +00:00
Oleksandr Yakushev
82b3ba1fcc [perf] Optimize metabase.lib.field.resolution/merge-metadata (#62425) 2025-09-28 13:37:56 +03:00
Dan Stone
dd7845cc83 Improve python error feedback capability (#64053)
* Add i18n / formatting to existing log calls

* Cleanup log conveyance to failure :message

* Improve error feedback capability

- Ensure exception messages do not leak to user logs by default 'Something went wrong'
- Exceptions can carry a `transform-message` key to provide a custom failure message (with i18n)
- Defined messaging for:
   - Error during table copy
   - Error during execution
   - Error during writeback

I would like to follow up with additional context in the form of message log entries for further progress / context of any failure.

Logs can be correlated to metabase logs for stack traces or further debugging. Python output remains presented as-is (traceback etc).
2025-09-27 15:31:57 +00:00
Edward Paget
7e7ed1ac9f fix(scim): support patch requests without a path (#64130)
adheres to the standard and accomodates how we can get these requests
from Okta.
2025-09-26 16:18:45 -05:00
Timothy Dean
29263dad18 Fix circular dependency, clean up some code 2025-09-26 15:15:13 -06:00
Jeff Bruemmer
19387d8d29 add transforms option (#64128) 2025-09-26 16:45:46 -04:00
Alex Yarosh
7ac8feb49b docs: embedding hub changes (#64012)
* embedding hub changes

* more edits

* Apply suggestions from code review

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-09-26 20:04:08 +00:00
Alex Yarosh
4447e2c6bc expand embedding comparison table (#64071) 2025-09-26 15:47:01 -04:00
Oleksandr Yakushev
8434b23764 [match] Prevent match-lite from extracting common result that depends on uncommon bindings (#64073)
* [match] Prevent match-lite from extracting common result that depends on uncommon bindings

* [match] Fail if match-lite's :guard is provided with incorrect predicate syntax

Also fix its treatment of named functions passed as predicates.
2025-09-26 22:39:26 +03:00
Jeff Bruemmer
be72407fc8 docs - RLS notes (#64111) 2025-09-26 19:34:07 +00:00
John Swanson
e530911305 Correctly render empty series in static viz (#63987)
* Correctly render empty series in static viz

[UXW-1754: Row chart with an empty series fails to send on static viz](https://linear.app/metabase/issue/UXW-1754/row-chart-with-an-empty-series-fails-to-send-on-static-viz)

`getColumnValueFormatter` and `getColumnValueStaticFormatter` had
different behaviors for empty strings, so this worked on the frontend
but failed for static visualizations.

* cleanup

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2025-09-26 11:49:59 -07:00
Noah Moss
ca9ba3390d make u/profile log lines look nicer (#64114) 2025-09-26 18:01:53 +00:00
Eric Normand
b70431b8f6 Match existing database by name or do nothing. 2025-09-26 12:47:46 -05:00
Oleksandr Solovyov
a947f3cb94 [advanced-config] uppercased letter in users email should not fail (#64109)
fixes #62894
2025-09-26 17:20:39 +00:00
Dan Stone
33de954fcf Temporarily disable python transforms tests for BQ/Snowflake (#64118) 2025-09-26 17:15:34 +00:00
Eric Normand
57c7b6e15c Database api and better yaml format 2025-09-26 11:45:03 -05:00
Eric Normand
9b0a44d385 Update database export
Env vars for passwords and other secure details
2025-09-26 11:41:56 -05:00
Eric Normand
c0bec3f32e Remove question 2025-09-26 11:41:38 -05:00
Kamil Mielnik
db79c64d3d DSN-73 Verified badge icon should be correct size and nearer text in model and saved question titles (#63871)
* Fix verified badge styling

* Misalign icons :see-no-evil:

* Remove min width on dashboard caption input

* Fix overflow
2025-09-26 16:14:41 +00:00
Eric Normand
2510bae3c2 Tests 2025-09-26 11:09:46 -05:00
Jakub Chodorowicz
3e646a69f3 Move dev instances upsell down on embedding settings pages (#64099) 2025-09-26 17:57:27 +02:00
Sébastien
d6c15aab01 Closes EMB-853 renamed legends get ignored by translation (#64023)
* Closes EMB-853 renmaed legends get ignored by translation

* feedback

* if -> ts-pattern
2025-09-26 16:04:57 +02:00
Jeff Bruemmer
34c224b5f2 docs - verified content (#64067) 2025-09-26 13:28:33 +00:00
Sébastien
568443a99c Closes EMB-407 transparent background download pdf (#63836)
* Closes EMB-407 transparent background download pdf

* e2e

* cleanup
2025-09-26 15:18:24 +02:00
github-automation-metabase
5fe1efe15b Update generated docs (master) (#64078)
Co-authored-by: github-actions <github-actions@github.com>
2025-09-26 06:46:56 -04:00
Alexander Polyankin
894176cf26 Add missing transform filters (#63998)
* Params

* Params

* Params

* Params

* Params

* Params

* Rename param

* Transform params

* Transform params

* Transform params

* Transform params

* Transform params

* Transform params

* Transform params

* Transform params

* fixes

* add a test

* add a test

* add a test

* add a test

* add a test

* Fix field filters for type/TextLike

* Fix polling
2025-09-26 06:39:11 -04:00
lbrdnk
c28f66c961 Add guards to metabot and semantic search job implementations (#64031)
* Fix arity

* Add guards for job implementations

* Adjust test
2025-09-26 10:36:00 +02:00
Kamil Mielnik
85e6e7f779 DSN-74 People page should use tabs instead of radios for active/deactivated control (#63817)
* Inline AdminPaneLayout

* Do not show invite button on deactivated tab

* Simplify

* Use modern button

* Add tabs in People page

* Move mb

* Fix typo

* Make people search input full width

* Move tabs to the top
2025-09-26 15:19:24 +07:00
Kamil Mielnik
d44a2cab66 DSN-67 We could improve the "Scanning for Filter Values" setting (#63887)
* Update scanning schedule form to use new UI components

* Update tests
2025-09-26 15:18:35 +07:00
Brad Anderson
e349faa741 Fix: #60843 Prevents dashboard from being saved when clicking "Discard changes" (#63899)
* UXW-333 Prevents `updateDashboardAndCards` from being called when discarding changes (still called when clicking "Save changes")

* UXW-333 Adds e2e test
2025-09-25 17:40:54 -04:00
Aleksandr Lesnenko
817af7b71d pass lat and lon fields to the tile endpoints as query params (#63533)
* for fetching tiles encode field refs as safe base64

* clojure implementation

* update public api

* pass lat and lon fields in query params

* specs

* fix specs

* update preview endpoints and tests

* clean up previous url safe base64 implementation

* fix specs
2025-09-25 21:11:26 +00:00
Eric Normand
1dad0e5c1e Import ordering 2025-09-25 15:25:27 -05:00
Jeff Bruemmer
e8cd58b376 Revise contributor instructions in PR template (#64059)
Updated warning section for first-time contributors.
2025-09-25 20:07:31 +00:00
Brad Anderson
62d7beec2b Fix: #63463 Loosens condition that forces saving to dashboard (#63855)
* UXW-709 When drilling into a dashboard card that had a filter applied, the resulting query can now be saved outside of the original dashboard. "New Question"/"New SQL query" via dashboard edit screen behavior is unaffected (still forces you to save to that dashboard).

* UXW-709 Updates unit tests
2025-09-25 15:55:45 -04:00
Brad Anderson
c2ec56beed UXW-172 Fix is-neg condition (#63905) 2025-09-25 15:54:48 -04:00
Nathan Voxland
5274867997 Log system signals for better debugging (#63780) 2025-09-25 13:56:48 -05:00
Anderson
b5a9d7457f Have a separate email content for user joining through setup invitation (#63778)
* Allow redirect url from password reset page

* Add await when inviting user so that errors will be displayed

* Allow for different email content when inviting user from setup / Set returnUrl param

* Code refinements

* Add backend tests

* Add frontend tests

* Run formatter

* handle email content when invitor's first name is empty/unset
2025-09-25 15:36:08 -03:00
Radoš Milićev
12f4387864 Fix links in CONTRIBUTING.md (#63653) 2025-09-25 14:31:54 -04:00
Eric Normand
a9be96bbd2 Merge branch 'representations' of github.com:metabase/metabase into representations 2025-09-25 13:23:18 -05:00
Eric Normand
1625842d80 Whitespace 2025-09-25 13:21:02 -05:00
Eric Normand
9af2a858cb Export databases. 2025-09-25 13:19:18 -05:00
Jakub Chodorowicz
6b5e3bd646 Prg 154 allow running dev env on a custom port (#63875)
* Allow running dev on custom MB_FRONTEND_DEV_PORT

Signed-off-by: Jakub Chodorowicz <jakub@chodorowicz.com>

* Unify port env var naming between JS and Clojure

* Add dev server port info

* Update devenv docs

Co-authored-by: Sébastien <sebastien@metabase.com>

* update docs

---------

Signed-off-by: Jakub Chodorowicz <jakub@chodorowicz.com>
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-09-25 20:18:33 +02:00
Eric Normand
942fcbd2d0 Remove prints 2025-09-25 13:17:56 -05:00
José H.
b7c4063dd9 [docs] Add SPARQL driver in community drivers list (#61994) 2025-09-25 13:57:36 -04:00
Anton
49fcc4a40f Fixed misspell in timezones.md (#64041) 2025-09-25 13:52:24 -04:00
Denis Berezin
7fb62b782b Document Layout - add charts side-to-side (#63101)
* Add working table with 2 columns

* Table layout and dnd polishing

* ResizeNode

* Refactor to use grid container

* Add Card node title ellipsification

* cleanup, add min height

* Fix FlexContainer to work with ResizeNode

* Fix empty ResizeNode after card dnd

* Document layout no dnd kit (#63363)

* using tiptap drag and drop

* Fix some issues with dnd

* Add support for resize node, fix styles

* Remove comments

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>

* Fixes after merge comments

* Fix issues with dnd logic

* Fix issue where rearranging columns within a flexContainer didn't respect which side of a cardEmbed we dropped; it always inserted dragged column to the left.

* Fix issue where moving a cardEmbed out of a flexContainer and placing it right after doesn't wrap the card in a resizer

* Fix issues with dropzones and card id

* Fix issue with column resize handlers

* Fix issues with cards previews on dnd

* Feat: UXW-717 Reconcile comments with document layout (#63593)

* UXW-717 Add comment option to cardEmbed menu
* UXW-717 Wires up comment option in cardEmbed menu
* UXW-717 Stubs out CommentsMenu reorganization so logic can be reused inside cardEmbeds (button and menu item)
* UXW-717 Design tweaks per design feedback (and fixes ts error)
* UXW-717 Updates hover state of cardEmbed ellipsis menu trigger per design feedback

* Fix issues with funnel chart and resizer

* Fix issues with column rearrange

* Fix adding third column position

* UXW-739 Adds ResizeNode wrapper to charts added by metabot

* UXW-749 [1/2] Fix: Cutting/copying a chart from a group then pasting it (cmd+v) results in a chart without a resizeNode

* UXW-749 [2/2] Fix: Copying and pasting from one chart to another doesn't preserve the structure correctly

* Refactor dnd logic - consolidate all use cases in HandleEditorDrop

* remove redundant message and add_message icons

* actually remove redundant message icons

* replace references to old icons with new icons

* Fix issue with dropping a card into existing flexContainer

* Fix issue with moving a card from one flexContainer into another

* UXW-748 - Fix broken document when typing with a card selected

* Handle dropping cards onto paragraphs (#63754)

* Handle dropping cards onto paragraphs

* PR Feedback

* cleanup flex containers

---------

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>

* small feedbacks

* breaking up document drop handler

* UXW-689 - add basic e2e tests

* type fix

* loki diff

* Add more e2e tests

* Fix typecheck

* happy types

* passing document.cy.spec

* Fix e2e tests

* e2e test for card resizing

* flex container column resize tests

* Add node deletion e2e tests

* Fix review issues

* Try to fix typecheck

* Refactor useCommentsButtonProps to a react component

* final PR feedback

* fix removing a card via menu

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
Co-authored-by: Maz Ameli <maz@metabase.com>
Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-09-25 21:08:49 +04:00
Phoomparin Mano
f393237eb9 Adjust link and action button layout for modular embedding cards (#63876) 2025-09-25 23:00:29 +07:00
Alexander Polyankin
48376d3f63 Fix field filters for type/TextLike (#64045) 2025-09-25 15:47:16 +00:00
github-automation-metabase
a67c48a036 Update generated docs (master) (#64017)
Co-authored-by: github-actions <github-actions@github.com>
2025-09-25 10:29:52 -04:00
Alex Yarosh
8c3d77473a docs: renaming sheets columns (#64011) 2025-09-25 10:29:07 -04:00
Kamil Mielnik
9f029dbb2f WRK-900 [Bug] Detail View: related records are messed up in tables with no PK (#63977)
* Add repro for WRK-900

* Hide relationships when there's no PK
2025-09-25 21:07:38 +07:00
Kamil Mielnik
1adaaae66e WRK-899 Detail view: keep fields used as titles & sub-titles in the regular list of fields (#63889)
* Include header columns in the body of detail view

* Update tests
2025-09-25 21:07:07 +07:00
Oleksandr Solovyov
21956d6ab7 [serdes] NativeQuerySnippet collection_id should not prevent export (#63870)
Previously `extract-query "NativeQuerySnippet"` would use standard method for exporting entities, which checks for
collection_id in entity and prevents its export if it's outside requested collections.

While that makes sense for Cards (and we do escape analysis for those), snippets live in their own separate collection
namespace and this logic is not relevant to them. So now we export either those in requested collections _or_
dependencies of cards that are being exported.
2025-09-25 17:03:23 +03:00
Sébastien
fd94a0b0cb feat(sdk-embed): adds onVisualizationChange to InteractiveDashboard and InteractiveQuestion (#63969)
* Closes EMB-152 add onVisualizationChange callback to SDK embedding components

* .

* .

* .

* fixed schema

* height

* .
2025-09-25 15:59:28 +02:00
Nicola Mometto
7b6fbd6374 Python Transforms (#63700)
* cherry pick driver code (#63628)

* cherry pick driver code

* update changelog

* add type->database-type unit tests

* kondo

* create/insert table

* insert-from-jsonl test

* missing rename-tables for snowflake

* extend rename-tables-test to more drivers

* line breaks

* add driver python transform feature

* handle review comments

* kondo

* feat: replace string->val with a more generic insert-col->val

* remove non transactional impls

* chore: docsstrings

* TODO

* extra test

* fix extra test

* test all base-types

* fix sqls

* setup ci properly (#63693)

* S3 transport layer for python-runner (#63697)

* Add s3 dependencies (#63706)

* port prometheus/instrumentation (#63631)

* port prometheus metrics

* port instrumentation

* instrument existing transform paths

* wider buckets

* remove nil handling

* warn on nil bytes/rows

* add stage-type mapping

* typo

* split CI into separate jobs (#63746)

* Add python_runner.clj (#63747)

* Add python runner

* Kondo

* Traceback fix

* Remove dead code

* start the runner by default

* Cancellation not used yet

* Remove unused keys from fields-metadata

* cherry pick driver fixes

* start for postgres and mysql as well

* clickhouse fixes

* relax for snowflake

* typo

* exclude transform-python-test from appdb

* exclude transforms-python-test as well

* try exclude-tag here too

---------

Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>

* execute.clj (#63755)

* execute.clj

* with drivers test and execute test

* with wait tables

* missing utils

* /s/open/start

* fix failing tests due to getting the wrong source and target

* kondo

* move cancel-python-code-http-call to python-runner

* Dan's feedback

* we have 2 implementstation of cancel

* and 2 db-routing-enabled?

---------

Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>

* Transforms python APIs (#63762)

* transforms python api

* new tests pass locally

* clean up the db id utils

* move to util

* fix: missing refer

* chore: missing tests/kondo

* kondo

* more kondo

* fix: make function resilient

* eh, validate on old

* on new

* Add python transform support for jobs (#63764)

* Add python transforms job support

* Fix whitespace in when

* Avoid churn due to new local

* Add feature test

* Add ignore for logs (there might be away to avoid this)

* Use new target-database-id util

* Remove duplicated fn

---------

Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
Co-authored-by: Dan Stone <wotbrew@gmail.com>

* Move transform ordering tests to the python module (#63827)

* Add transform ordering tests to the python module

- Consistent with api tests for python transforms being in the python
module
- In practice transforms module 'knows' about python, so this is
organizational only
- Copied test helpers for now, not sure if functions strong enough to be
shared

* Check :transforms/python

* Proj python/table name len (#63842)

* feat: ensure temp-table-name respects max length

* add unit test

* add limit for missing drivers

* depend on it

* fix: use db instead of db-id

* Proj ptyhon/table swap (#63878)

* add rename feature, rename-table! multimethod

* add table swap with atomic or rename or fallback

* changelog

* drop requirement

* ensure we're testing replace flow

* wait for completion, table already exists

* wip

* add rename-table-test

* fix for snowflake

* fix: support bigints (#63898)

* fix: support bigints

* merge meta

* Frontend for Python Transforms (#63699)

* cherry pick driver code (#63628)

* cherry pick driver code

* update changelog

* add type->database-type unit tests

* kondo

* create/insert table

* insert-from-jsonl test

* missing rename-tables for snowflake

* extend rename-tables-test to more drivers

* line breaks

* add driver python transform feature

* handle review comments

* kondo

* feat: replace string->val with a more generic insert-col->val

* remove non transactional impls

* chore: docsstrings

* TODO

* extra test

* fix extra test

* test all base-types

* fix sqls

* setup ci properly (#63693)

* feat: add Python transform frontend pages

* Integerate with FE

* Fix wrong source field name used for showing script in transform view

* Revert "Fix wrong source field name used for showing script in transform view"

This reverts commit c7dfb541f3.

* Fix edit button not doing anything for python scripts

Closes QUE-2300

* call api proxy instead of internal call, also have settings page for transform

* python transforms now properly being scheduled

* FE select table when creating python transform

* multiple tables

* ensure tables are unique in tables selector

* source alignments

* run test

* dead code

* Better default schema, better docstring

* fixex test run

* add cancel button

* better endpoint name

* add cancel button to test python endpoint

* working button

* Auto-update Python transform function signature when table aliases change

- Automatically updates def transform(...) signature when aliases are modified
- Updates docstring Args section with aligned descriptions and table names
- Adds reset button to restore default slugified aliases
- Validates alias input to only allow valid Python identifiers
- Handles multi-line signatures for many parameters (>80 chars)
- Shows visual distinction between custom and auto-generated aliases
- Fixes code editor layout to prevent overlap with Run button

* feat: settings page with s3 configs

* feat: split settings

* remove placeholders

* eh, rename to appease the munging

* Logs are viewable inline during execution of python transforms

* Some minor fixes around docstring rewriting

* solve more fe lints

* fix type errors

* more type check fixes - including some smelly optional override stuff

* fix delete transform + table

* fix: don't remove indentation before """

* chore: allow empty schemas

* Critical fix: docstring indentation

* Separate file / s3 lifetimes / writes / reads from http calls (#63294)

- python-runner no longer simulates a single http api that does
everything (incl s3 interaction)
- Separates file lifetimes (shared storage) from execution
- Easier to see how to avoid reading into strings (e.g. for piping into
tmp files, follow up)

Earlier on we had a service that managed much of the I/O, metabase now
coordinates it so it makes little sense pretending there is still
an overall http api.
# Conflicts:
#	enterprise/backend/src/metabase_enterprise/transforms/api.clj
#	enterprise/backend/src/metabase_enterprise/transforms/execute.clj
#	enterprise/backend/src/metabase_enterprise/transforms/python_runner.clj
#	enterprise/backend/test/metabase_enterprise/transforms/python_runner_test.clj

* Add first-class PythonTransformSource type

# Conflicts:
#	enterprise/frontend/src/metabase-enterprise/transforms/components/QueryEditor/EditorBody/EditorBody.tsx

* Lay python editor out in two columns

* Make python editor resizable

* Move parseCSV to utils

* Split off results into separate component

* Add empty and loading state components

* Split up ExecutionResult component

* Move python execution to separate hook

* Remove color in editor gutter

* Increase indentUnit for python

* Allow extension to be passed to CodeEditor

* Add pandas completions

* Use DataGrid for displaying results

* Python library APIs (#63378)

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
# Conflicts:
#	enterprise/backend/src/metabase_enterprise/api/routes.clj
#	enterprise/backend/src/metabase_enterprise/transforms/python_runner.clj
#	enterprise/backend/test/metabase_enterprise/transforms/python_runner_test.clj
#	enterprise/frontend/src/metabase-enterprise/api/tags.ts
#	resources/migrations/057_update_migrations.yaml

* transforms python module (#63503)

# Conflicts:
#	enterprise/backend/src/metabase_enterprise/transforms/api.clj
#	enterprise/backend/src/metabase_enterprise/transforms/execute.clj
#	enterprise/backend/src/metabase_enterprise/transforms/jobs.clj
#	enterprise/backend/src/metabase_enterprise/transforms/util.clj
#	enterprise/backend/src/metabase_enterprise/transforms_python/python_runner.clj
#	enterprise/backend/test/metabase_enterprise/transforms_python/api_test.clj
#	enterprise/backend/test/metabase_enterprise/transforms_python/e2e_test.clj
#	enterprise/backend/test/metabase_enterprise/transforms_python/python_runner_test.clj

* Use normal title case

* Handle json-line output

* Remove unused props

* Rename PythonEditor to PythonQueryEditor

* Move script rewriter to utils

* Flatten Python transform page

* Rename shared to common

* Remove dead code

* Reduce specialization in Transform editor

* Remove unused props

* Move PythonQueryEditor to top-level components

* Nest Python editor components in PythonTransformEditor

* Restructure Python transform editor

* Split up component more

* Add helpers for python editor

* Disable default schema

* Add test ids

* Fix import path

* Reuse transform save modal

* Fix parameter

* Add e2e tests for python common lib

* Move python transform api to general transforms folder

* Move type to metabase-api/types

* Disable debugger for python transforms for now, allow to open it with query param

* Disable debugger hotkey for python transforms

* Add syntax highlighting to Python script on Transform page

* Remove cancelation code for now

# Conflicts:
#	enterprise/frontend/src/metabase-enterprise/transforms/components/RunButton/RunButton.tsx
#	enterprise/frontend/src/metabase-enterprise/transforms/pages/TransformPage/RunSection/RunSection.tsx

* Add more generic RunInfo

* Remove unused LogOutput

* Set up python runner in CI (#63566)

* Check out with submodules in CI

* Include python-runner in docker compose for tests

* Set up python runner in CI

* Fix import

* Update python-runner
# Conflicts:
#	python-runner

* Fix font sizes

* Fix table layout

* Revert "Remove unused LogOutput"

This reverts commit 90c0704344.

* Add LogOutput back to runsection

* Remove duplicate schema field

* Use css instead of styled components

* Fix LogOutput styling

* Add transforms/python feature

* Do not allow picking unsupported databases

* Use slugify from metabase/lib/formatting

* Add type for transform alias map

* Fix some type imports

* Refactor PythonDataPicker

# Conflicts:
#	enterprise/frontend/src/metabase-enterprise/transforms/components/PythonTransformEditor/PythonDataPicker/PythonDataPicker.tsx

* Further refactors

* Use data selector for database picker

* Use data picker to pick tables

* Remove unused var

* Improve tests for python transform

* Fix duplicate imports

* Use DatabaseId in python transform

* Remove source/draft ambiguity in types

* Move library types to metabase-types/api

* Remove api transforms

* Remove vibe-comment

* Remove unused component

* Validate source more

* Move TableInput to separate file

* Remove TableOption type

* Simplify props

* Move AliasInput to separate file

* Remove unused props

* Add border to empty results

* Fix import

* Remove extension

* Move draft back to new python transform page

* Fix new python transform page nesting

* Simpify new transform page structure

* Add analytics to history revision and data reference (#63587)

* Transform run cancellation (#62387)

* Add cancellation to transform api

* Use effect to set polling state

* Add cancellation button to run button

* Set up cancellation on transform page

* Use confirmation modal to cancel transform

* Add run cancel button to run list

* Make api endpoint take transform id instead of run id.

* Fix cancelation api

* Add canceled state to TransformRunStatus

* Add canceled state to transform page

* Add polling to RunListPage

* Remove comment in code

* Set status to canceling when you click cancel

* Add canceling status

* Poll when the transform is canceling

* Add copy for runs that are being canceled

* Manually track fetching status for running and canceling

* Handle canceling status in utils

* Avoid wrapping cancel button in run list

* Add test for canceling run on transform page

* Add e2e for canceling test from runs page

* Fix prop type

* Change copy to Canceling

* Add custom color to canceled state

* Remove mock code

* Increase cancelation tiemout

* Fix copy in text

* Fix snowplow event

* Remove void specifier and close modal in handler directyle

* Add optimistic update for run cancelation

* Avoid manually tracking cancelation status

* Avoid useEffect when changing isPolling

* Add in missing helper

* Remove another useEffect

* Add placeholder run when starting

---------

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>

* Fix command z not working in connection string input (#63689)

- Stop preventing default event handling onPaste.
- Improve Cypress paste emulation to be compatible with React way of handling paste events.

* Transforms prepare for python (#63698)

* pull out transform run utils to prepare for python transforms

* fix: check running-run on transform-id, not run-id

* chore: put on a new line

* Fix #63629: Filter on cards causes an unnecessary horizontal scroll bar for public/static embedding (#63650)

* Closes EMB-50 tabs dimmed out on iOS (#63690)

* S3 transport layer for python-runner (#63697)

* Add s3 dependencies (#63706)

* port prometheus/instrumentation (#63631)

* port prometheus metrics

* port instrumentation

* instrument existing transform paths

* wider buckets

* remove nil handling

* warn on nil bytes/rows

* add stage-type mapping

* typo

* Implement data picker according to designs

* Further adjust to design file

* Fix some e2e tests

* Clone python runner when running CI

* Avoid starting the container in e2e tests twice

* Hide python runner admin route when user does not have the feature for it

* Remove unused variables

* Move Python runner amdin page to transforms plugin

* Do not show Python library link when the user does not have python transforms support

* Hide Python transforms features when the user does not have transforms-python token

* Use useHasTokenFeature hook where possible

* Add transforms-python feature

* Fix e2e tests

* Do not include python-runner in test docker-compose yet

* Tag tests for python transforms with @transforms-python

* Add helper to update Python library

* Add check for python output

* Fix Revert on python library when it does not exist

* Fix e2e test helper

* Add python runner settings in CI

* WIP

* Translate pandas definitions

* Add AnsiLogs component

* Use AnsiLogs in Logs components

* Use AnsiLogs in LogOutput component

* Remove token feature gate in enterprise folder

* Return alias instead of throwing

* Check type in isPythonTransform assertion

* Use isResourceNotFoundError

* Make transforms-python it's own plugin

* /s/localhost/localstack

* Add test for editing Python transform

* Verify that running the transform with the library works

* Add missing transforms-python feature to mocks

* Simplify source layout

* Change setting type of python runner token

* Fix tests

* Use ConcreteTableIds in python transforms only

* Deduplicate codemirror helpers

* Ignore errors in non-parseable JSON lines

* Use useLocation hook to enable debugger

* Use useErrorMessage helper

* Move SourceSection to transforms-python plugin

* Fix codemirror helpers

* Remove undefined color

* Fix types

* Fix codemirror helpers more

* Move transform ordering tests to the python module (#63827)

* Add transform ordering tests to the python module

- Consistent with api tests for python transforms being in the python
module
- In practice transforms module 'knows' about python, so this is
organizational only
- Copied test helpers for now, not sure if functions strong enough to be
shared

* Check :transforms/python

* Proj python/table name len (#63842)

* feat: ensure temp-table-name respects max length

* add unit test

* add limit for missing drivers

* depend on it

* fix: use db instead of db-id

* Proj ptyhon/table swap (#63878)

* add rename feature, rename-table! multimethod

* add table swap with atomic or rename or fallback

* changelog

* drop requirement

* ensure we're testing replace flow

* wait for completion, table already exists

* wip

* add rename-table-test

* fix for snowflake

* Extract sourceDatabaseId helper

* Fix e2e helpers

* Fix error in table picker

* Add missing test-id

* Fix transform tests

* Validate python source

* Fix issues after merge

* Fix tag test

* Fix other tag test

---------

Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
Co-authored-by: Nicolo-Maria <nicolo.mezzopera@metabase.com>
Co-authored-by: Dan Stone <wotbrew@gmail.com>
Co-authored-by: Chris Truter <chris@metabase.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Eric Normand <ericwnormand@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Jakub Chodorowicz <jakub.chodorowicz@metabase.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
Co-authored-by: Sébastien <sebastien@metabase.com>
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>

* Proj python fix tests (#63970)

* add premium feature

* fix tests that didn't run previously

* exclude from vertica

* remove internal id from mongo table-rows

* fix: require transforms/python db feature for python transforms

* missing in stats

* fix for mongo

* whitespaces to appease the linter

* more more whitespace for the linter gods

* disambiguate for the e2e tests

* Some small type fixes for Python transforms  (#64021)

* Remove duplicate helper

* Add updateEnterpriseSetting helper for type-correctness

* Add missing python runner settings

* Use correct setting name

---------

Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
Co-authored-by: Dan Stone <wotbrew@gmail.com>
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
Co-authored-by: Nicolo-Maria <nicolo.mezzopera@metabase.com>
Co-authored-by: Chris Truter <chris@metabase.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Eric Normand <ericwnormand@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Jakub Chodorowicz <jakub.chodorowicz@metabase.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-09-25 13:03:38 +00:00
Romeo Van Snick
eeecd9a10a Fix native preview button in transforms (#63865)
* Allow passing language as a plugin to CodeEditor

* Pull out NativeQueryPreview

* Render NativeQueryPreview in the native transform editor

* Relax prop types

* Add e2e test for query preview in transforms

* Fix e2e tests

* Pass query instead of question

* Use CopyButton instead of bespoke component

* Fix unit test
2025-09-25 20:42:46 +10:00
Roman Abdulmanov
685424df74 fixed colors (#64029) 2025-09-25 10:06:54 +00:00
Phoomparin Mano
c4af9c415b Double scrollbars are showing up on metabase-browser when always show scrollbar is set (#63971) 2025-09-25 16:07:56 +07:00
Mahatthana (Kelvin) Nomsawadi
ca66414190 Reset colors when passing undefined to theme (#63957)
* Reset colors when passing undefined to theme

* Add tests
2025-09-25 10:07:43 +01:00
Tyler Plude
855e846d0a Add result ID to search click event tracking (#64009)
* Add result ID to search click event tracking

* include entity_id in SearchEventSchema type
2025-09-24 22:13:03 -07:00
Alexander Polyankin
270086315f Add last run status info to jobs (#63994) 2025-09-24 20:51:02 -04:00
Alexander Polyankin
16ea0dc141 Rename DatePicker intervals to "past" and "future" (#63993) 2025-09-24 20:49:52 -04:00
Timothy Dean
67566c475b m. 2025-09-24 17:58:23 -06:00
Timothy Dean
e1bf8c6582 Basic database export functionality 2025-09-24 17:56:06 -06:00
Timothy S. Dean
94b9737f0b Handle trailing spaces appropriately in snippet template tags (#63582)
Attempting to use a snippet template-tag with a trailing space in the snippet name (e.g., `{{snippet: foobar }}`) caused an exception to be thrown when running the native query (missing required parameter).

The regex used for identifying snippet tags will now strip trailing spaces appropriately.
2025-09-24 23:05:27 +00:00
Nathan Voxland
4448933543 Add MB_WEBPACK_PORT env variable config (#63355) 2025-09-24 17:15:19 -05:00
Timothy Dean
069d773c94 Make collection-8 test_resources dir mirroring /collection/8-serialization-v0 2025-09-24 15:47:25 -06:00
Alex Yarosh
a9e0afd420 interactive embedding notes (#64007) 2025-09-24 17:18:31 -04:00
Cam Saul
d018b4a1bc Use Lib for query->source-card; fix busted tests and busted X-Ray code (#63921)
* Misc Lib improvements

* Restore deleted function... for now

* 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

* Druid test fix 🔧

* Appease Kondo
2025-09-24 13:47:57 -07:00
lbrdnk
92011484de Disable fks sync on CH (#63976)
* Disable fks sync

* Describe implementation with warning

* Kondo
2025-09-24 22:34:03 +02:00
Alex Yarosh
c10fd5cd5b docs: db routing with static embedding (#63999)
* docs: db routing with static embedding

Clarified limitations of database routing in Metabase.

* Update docs/permissions/database-routing.md

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-09-24 20:22:35 +00:00
Oleksandr Yakushev
564556d706 [perf] Suggest drop-in replacements for clojure.core functions from metabase.util.performance (#62971)
* [perf] Suggest drop-in replacements for clojure.core functions from metabase.util.performance

* Fix walk for nil

* [perf] Make metabase.util.performance/reduce compatible with non-iterables (like strings)
2025-09-24 20:08:22 +00:00
Riley Thompson
5e55ecd75c Add regression test for clickhouse jdbc driver (#63906)
* add regression test for clickhouse

* revert to 0.8.4

* fix

* fix tests
2025-09-24 13:50:03 -06:00
Ngoc Khuat
0a33f82baf Fix static viz ignore viz-settings order (#63980) 2025-09-24 19:28:38 +00:00
Eric Normand
82029ecfbb We're not ready for import-export 2025-09-24 14:26:24 -05:00
Riley Thompson
7070fac7a6 add frontend 2025-09-24 14:15:42 -04:00
Timothy Dean
2653b9d303 Merge remote-tracking branch 'origin/master' into representations 2025-09-24 11:39:14 -06:00
github-automation-metabase
7ecdc2f757 Update generated docs (master) (#63947)
Co-authored-by: github-actions <github-actions@github.com>
2025-09-24 13:34:01 -04:00
Phoomparin Mano
0bf1ac867f Replace interactive embedding card in embed modal with embed flow (#63942) 2025-09-25 00:14:36 +07:00
Riley Thompson
addf6fda01 export and import collection representation endpoints 2025-09-24 13:00:51 -04:00
Cam Saul
cbdc23a7bf Fix sorting on aggregate columns (#63940)
* Fix sorting on aggregate columns

* cljfmt
2025-09-24 10:55:23 -06:00
Timothy Dean
4a2651851b representations.core: remove unnecessary decoder code 2025-09-24 10:34:09 -06:00
Timothy Dean
2f80bab68f Fix transform schema 2025-09-24 10:21:03 -06:00
Edward Paget
c59e9de090 fix: check email in update before validing for sso (#63915)
Changes to any user attribute for sso users were failing preventing them
from being to set their user locale. This was due to us not checking if
`email` is present in the body of the update request before failing a
`check-403` call if the user has an sso source.
2025-09-24 11:10:58 -05:00
Uladzimir Havenchyk
9668ebe98c chore: upgrade typescript to 5.9 (#61494) 2025-09-24 18:45:28 +03:00
Sébastien
3c2d46151b Closes EMB-851 static embed pin map (#63897)
* Closes EMB-851 static embed pin map

* .

* .

* Update frontend/src/metabase/visualizations/lib/map.ts

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

* Update frontend/src/metabase/visualizations/lib/map.ts

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

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-09-24 17:42:40 +02:00
Alexander Polyankin
1cacd1f510 Constraint available relative directions in the DatePicker for transforms (#63893) 2025-09-24 11:36:39 -04:00
Ryan Laurie
a8074ca04b Thinner + Darker Borders (#63675)
* fix button borders

* update-border-color

* dont mix the colors

* update loki

* update again

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-09-24 15:31:25 +00:00
Oleksandr Solovyov
28014961c3 add index on report_card.type (#63493) 2025-09-24 15:19:51 +00:00
Tyler Plude
ec5b20af0c [METABOT] Fix bug in Metabot search deduplication (#63943)
* [METABOT] Fix bug in Metabot search deduplication

* rm debug defs
2025-09-24 08:01:06 -07:00
dpsutton
ab68e21cf7 revert nett-common and netty-buffer bumps (#63967)
rather than 4.2.4.Final, they will now be "io.netty/netty-buffer
4.1.118.Final" which puts it the same as that in 3.5.0.

The issue is that both the bigquery-cloud-sdk driver and athena driver
get put onto the classpath and it depends on which order the drivers are
added for resolving which version of this netty buffer dep you get.

```clojure
user=> (metabase.classloader.core/the-classloader)
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 annoying bit to keep track of this is that bigquery uses a regular
jar that specifies its dependencies, so you can you regular tooling:

```
clj -X:deps tree :aliases '[:drivers]' > /tmp/deps.with.netty.downgrade
```

And then see those deps:

```
  . metabase/bigquery-cloud-sdk /Users/dan/projects/work/metabase/modules/drivers/bigquery-cloud-sdk
    . com.google.cloud/google-cloud-bigquery 2.54.2
      . com.google.cloud/google-cloud-core 2.60.0
      . ... [lots omitted]
    . org.apache.arrow/arrow-memory-netty 17.0.0
      X org.apache.arrow/arrow-memory-core 17.0.0 :older-version
      . org.apache.arrow/arrow-memory-netty-buffer-patch 17.0.0
        X org.apache.arrow/arrow-memory-core 17.0.0 :older-version
        . io.netty/netty-buffer 4.1.110.Final
```

This version was created without any pinning of netty. Checking the
athena version is a bit more tricky. We use a fat jar. But you can
download the source from amazon as a jar with deps:

```
athena-jdbc-3.5.0-lean-jar-and-separate-dependencies-jars
```

https://docs.aws.amazon.com/athena/latest/ug/jdbc-v3-driver-previous-versions.html

This zip includes `runtime-dependencies` which includes
`netty-buffer-4.1.jar`

The pom inside of this jar specifies

```xml
  <parent>
    <groupId>io.netty</groupId>
    <artifactId>netty-parent</artifactId>
    <version>4.1.118.Final</version>
  </parent>
```

And `META-INF/maven/io.netty/netty-buffer/pom.properties` specifies

```
artifactId=netty-buffer
groupId=io.netty
version=4.1.118.Final
```

So i am confident now that with the pinning in bigquery and this version
here that regardless of class resolution from
"jar:file:/private/tmp/fixed-athena/plugins/bigquery-cloud-sdk.metabase-driver.jar!/io/netty/buffer/ByteBufAllocator.class"
or
"jar:file:/private/tmp/fixed-athena/plugins/athena.metabase-driver.jar!/io/netty/buffer/ByteBufAllocator.class"
you will get the same class and athena shall work again.
2025-09-24 09:48:38 -05:00
dpsutton
821c0f624b ensure type/* for base-type if otherwise not known (#63930)
* ensure type/* for base-type if otherwise not known

Using the follow query that returns pg arrays:

```sql
SELECT *
FROM (
  VALUES
    (1, ARRAY['https://example.com', 'https://example.org']),
    (2, ARRAY['https://test.com']),
    (3, ARRAY['https://foo.com', 'https://bar.com', 'https://baz.com'])
) AS adhoc_table (id, urls);
```

In 55 this returned a nil base-type

```clojure
user=> (metabase.query-processor.metadata/legacy-result-metadata
         {:database 2
          :type :native,
          :native {:template-tags {},
                   :query "SELECT *\nFROM (\n  VALUES\n    (1, ARRAY['https://example.com', 'https://example.org']),\n    (2, ARRAY['https://test.com']),\n    (3, ARRAY['https://foo.com', 'https://bar.com', 'https://baz.com'])\n) AS adhoc_table (id, urls);"}}
         1)
[{:display_name "id",
  :source :native,
  :field_ref [:field "id" {:base-type :type/Integer}],
  :ident "native[]__id",
  :name "id",
  :database_type "int4",
  :base_type :type/Integer,
  :semantic_type :type/PK}
 {:display_name "urls",
  :source :native,
  :field_ref [:field "urls" {:base-type nil}],
  :ident "native[]__urls",
  :name "urls",
  :database_type "_text",
  :base_type nil}]
```

In master, this just fails. If you remove the type checking in places,
it will eventually return similar.

This base-type is computed in sql-jdbc/metadata

```clojure
(mu/defn query-result-metadata :- [:sequential driver-api/schema.metadata.column]
  "Default implementation of [[metabase.driver/query-result-metadata]] for JDBC-based drivers. Gets metadata without
  actually running a query."
  ([driver :- :keyword
    query  :- :map]
   (driver-api/with-qp-setup [query query]
     (let [database               (driver-api/database (driver-api/metadata-provider))
           {:keys [query params]} (driver-api/compile query)]
       (query-result-metadata driver database query params))))

  ([driver      :- :keyword
    database    :- driver-api/schema.metadata.database
    ^String sql :- :string
    params      :- [:maybe [:sequential :any]]]
   (sql-jdbc.execute/do-with-connection-with-options
    driver
    database
    nil
    (fn [^java.sql.Connection conn]
      (with-open [stmt (sql-jdbc.execute/prepared-statement driver conn sql params)]
        (let [rsmeta (.getMetaData stmt)]
          (mapv (fn [i]
                  (let [database-type (.getColumnTypeName rsmeta i)]
                    {:lib/type      :metadata/column
                     :name          (.getColumnLabel rsmeta i)
                     :database-type database-type
                     :base-type     (or (sql-jdbc.sync.interface/database-type->base-type driver (keyword database-type))
                                        :type/*)}))
                (range 1 (inc (.getColumnCount rsmeta))))))))))
```

Before this change, there was no `or` and
`sql-jdbc.sync.interface/database-type->base-type` would just return
nil.

```clojure
user=> (metabase.driver.sql-jdbc.sync/database-type->base-type :postgres (keyword "_text"))
nil
```

Unfortunately this is a multimethod so we can't easily update it in one
spot to fall back to type/*. Each implementation must take care to do
this. A few do (clickhouse does) but a few dont (snowflake does not). So
we update this call site to ensure we have something from the
multimethod or add our own type/*

Why did this start happening now?
> I think it's because I added :metadata/model-metadata to :metabase.lib.schema.info/info at some point

Query info stashes the model metadata which is
```clojure
[:metadata/model-metadata {:optional true} [:maybe [:sequential ::lib.schema.metadata/lib-or-legacy-column]]]
```

We had been throwing errors asynchronously when trying to save metadata,
but now we have on-thread type mismatch for model metadata, which is
what is in the ticket.

* add test to ensure we can handle existing base_type nil's

this got annoying because legacy metadata from the app-db comes from a
different location. I was adding a card schema migration but this is
better here.

The previous commit makes sure we don't put out more bad data, but this
commit here ensures that we can update the card.
2025-09-24 09:37:11 -05:00
Vamsi Peri
7423aaf572 Remove sessions from sync metadata registry (#63949)
Remove sessions table from sync metadata registry
2025-09-24 14:34:51 +00:00
Phoomparin Mano
03f68f0a2c Add embed flow to the command palette (#63944) 2025-09-24 21:22:55 +07:00
Romeo Van Snick
e8f125c19b Add error info to transform job page (#63623)
* Move cron info up into cron section

* Move schedule explanation logic to utils

* Allow ReactNode as explain message

* Render explain message in cron component

* Add status to transform job page

* Add e2e tests for job error message

* Add assertion to lookup

* Add extract shared logic for run status

* Add missing test-ids

* Select correct section
2025-09-25 00:20:23 +10:00
Romeo Van Snick
21c5271879 Fix failing transform tags test (#63964)
* Do not expect tag to be in popover when it's already selected

* Invalidate specific tags when deleting a tag

* Fix other tag test
2025-09-25 00:19:57 +10:00
Jeff Bruemmer
45d701fd6b docs - updates on documents, comments, and Metabot (#63922) 2025-09-24 14:06:31 +00:00
Uladzimir Havenchyk
7c1152e9d0 chore: fix type usage of parameters in sdk (#63918)
* chore: fix type usage for parameters in sdk

* make types plane
2025-09-24 16:21:54 +03:00
Kamil Mielnik
ab20852102 DSN-70 Custom maps section in Admin should have a nicer empty state for its table (#63874)
* Add empty state to custom maps component

* Add unit test
2025-09-24 11:04:24 +00:00
Phoomparin Mano
137bc61a42 Show toggle for enabling saves for question embeds in embed flow (#63908) 2025-09-24 16:35:02 +07:00
Kamil Mielnik
f567aeece1 Do not render tabs in ParameterSidebar if there's only 1 tab (#63815) 2025-09-24 16:21:16 +07:00
Mahatthana (Kelvin) Nomsawadi
e60e38682b Don't send new user login for SDK or Embedded Analytics JS (#63883)
* Don't send new user login for SDK or Embedded Analytics JS

* Update tests

* Stop using hard-coded string to detect modular embedding headers

* Conform to spacing rule
2025-09-24 08:59:23 +01:00
Timofey Kachalov
84efc79be4 refactor(sdk-bundle): Adjust SDK compatibility warning messages and banners (#63919) 2025-09-24 11:58:32 +04:00
Kamil Mielnik
8de8d13eb6 Update copy (#63823) 2025-09-24 14:55:11 +07:00
Kamil Mielnik
a52d58a3e2 Make info panel headings consistent (color, line-height, margin-bottom) (#63882) 2025-09-24 14:54:27 +07:00
Kamil Mielnik
f34cb3d5c3 Use Tab component in TagEditorSidebar (#63829) 2025-09-24 14:52:49 +07:00
Kamil Mielnik
d8571ccabe Update background color of Field items in TableSection (#63831) 2025-09-24 14:52:15 +07:00
Kamil Mielnik
19f279610b Remove forceActiveStyle prop from ActionButton (#63869) 2025-09-24 14:51:51 +07:00
Riley Thompson
5647233576 Fix starbust query cancellation with isClosed proxy implementations (#63857)
* add isClosed impls to proxys

* use mt/id in test

* test all drivers

* check if statements are supported, refactor statement-supported? multimethod to drive feature

* add namespace to statements feature
2025-09-24 05:10:13 +00:00
Riley Thompson
14481bcf2f Clean up transforms test schemas (#63406)
* clean up transforms test schemas

* use destroy-dataset! for bigquery
2025-09-24 05:08:55 +00:00
Mahatthana (Kelvin) Nomsawadi
bbccbb4842 fix(embed-js): Only report analytics when not in the preview (#63812)
* Only report analytics when not in the preview

This would avoid confusing preview usage with the actual usage

* Ensure analytics would be report even if iframe isn't ready

* Add E2E test

* Make the test pass

* Stop relying on redux store to fetch `site-url`

* Clarify test with comment

* Add tests

* Fix linter

I was naming a file wrong, so it doesn't match unit test spec. This rule
apparently doesn't take tests into account, which is great.
2025-09-24 06:06:45 +01:00
Cam Saul
4b99060f46 Do not recurse forever when resolving bad :field refs for expressions (#63926) 2025-09-23 17:57:27 -07:00
Cam Saul
3903af487f Misc Lib improvements to support wider Lib usage in the backend (#63911)
* Misc Lib improvements

* Restore deleted function... for now

* Test fix 🔧
2025-09-24 00:14:30 +00:00
Phoomparin Mano
0fb061b839 Minor visual improvements for embedding hub (#63813) 2025-09-24 06:14:51 +07:00
Timothy Dean
a136a66af7 Just delete run-trigger 2025-09-23 17:02:05 -06:00
Timothy Dean
aab38f089a Transform improvements 2025-09-23 16:51:09 -06:00
Tyler Plude
ab9e7bbcb8 [BOT-292] Metabot with Search 2.0 (#62067)
* Add search endpoint for Metabot and adjusted metadata

* More tests and better split out of logic into separate files

* dedupe search terms and description if they happen to be the same

* fix bad merge conflict

* Answer blending sql querying via search tables (#62415)

* Only put tables used in SQL into context
* Change format of injected database content by reusing existing models
* Create separate function for new schema enchancement
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>

* Add table reference for implicitly joinable fields in context injection (#62753)

* Update Metabot profile IDs (#62864)

* [Answer blending] Updates to the metabot admin configs (#62551)

* remove ability to configure the selected collection for default metabot

* add verified toggle

* add migrations for metabot collection configuration changes

* add metabot PUT endpoint, rip out metabot entities endpoints and usages, convert FE over to new FE, fix tests

* remove metabot_entity table, model, usage and refactor code to use updated metabot and metabot_prompts schemas

* enforce verification and regenerate prompts on verification + collection id change

* fix bad references

* fix bad regexp for fetch-mock collections by id endpoints breaking unit tests

* fix kondo

* fix + increase tests for enterprise/backend/test/metabase_enterprise/metabot_v3/tools/api_test.clj

* fix migration boolean default value syntax

* maybe fix be tests

* fix some tests

* enforce verified filter on the search endpoint

* factor in verified check into find-metric

* hide verification setting behind token feature check, fix migration lint, do not migrate collection id for default metabot, fix kondo errors

* fix core tests

* fix kondo

* fix most of the failing serialization tests

* fix migration lints

* fix one test file

* maybe fix migration failures

* move test resource file

* prevent default metabot from getting a collection id configured

* yolo

* add cascade delete to entity drop table migration

* increase unit tests for verification config UI

* remove extra add column

* fix migration... i think for real this time

* for real for real fix migrations

* no really

* tests fixes and add preventing verification toggle if the instance does not have the content_verification feature

* fix failing feature tests in ci

* fix one more

* fix cljfmt issue

---------

Co-authored-by: Tyler Plude <tsplude@gmail.com>

* [Metabot] Quick slash command + dynamic profile ui (#62909)

* quick slash command + dyanmic profile ui

* add back code i did not mean to remove

* fix failing test

* Revert "fix failing test"

This reverts commit b1c7e9efb9.

* [BOT-284] BE for notebook query tool table support (#62710)

* init

* moved query-table endpoint to query-datasource; add support for both model and table ids

* unit test fixes

* use existing card-query and table-query utils

* adding unit tests

* [Answer blending] Respect collection id in search (#63150)

* remove find metric tool

* adjustments to search endpoint

* add tests

* fix failing test in ci

* add way to override the metabot id

* add way to override metabot request id

* fix whitespace lint

* missing paren...

* fix failing test

* New BE `/search` endpoint for ai-service `SearchTool` (#63154)

* new metabot search tool BE endpoint

* remove debug prints

* parallel searches; incomplete effort to return more fields for results

* Simplify result transforming & response schemas

* unit tests

* kondo fixes; pr feedback

* fallback search model list

* remove references to MetabotEntity model which got re-added incorrectly in rebase

* Make internal metabot use verified content by default (#63529)

Update linter for usage of task in metabot-v3

Move suggested-prompts to separate namespace

Add collection condition only when current-user-id

Add startup task

migration

Update tests

Verified cards only

Test

Docstrings

Limit number of entities

Review feedback

* [METABOT] Default use_verified_content to false; tweak prompts (#63843)

* default use_verified_content false; limit amount of prompts

* reworked unit test to not depend on ai-service or appdb contents

* PR feedback

* remove mock of get metrics and models in favor of mt/with-empty-h2-app-db

* Small refactors & simplifications to metabot PUT endpoint and suggested
prompts job

* small simplification, use m/distinct-by for deduping tables

* rm deprecated search_data_sources

* Cleanup and prioritize verified content (#63877)

* Remove now redundant content verification guard

* Prioritize verified content

* Redundant merge

* Test

* ensure field IDs in user_is_viewing context are snake_cased

* Use proper source column alias as name for the model / table fields (#63826)

* Use proper source column alias as name for the model / table fields

* Add name as fallback

* test fix

* switch to using :lib/desired-column-alias, revert test fix

---------

Co-authored-by: Tyler Plude <tsplude@gmail.com>
Co-authored-by: Noah Moss <noahbmoss@gmail.com>

* Fix some tests: consistent use of snake_case, and a :lib/source-column-alias fallback for model field :name

* fix more field_id snake_case issues

* fix another snake case issue - revert result_columns back to result-columns

---------

Co-authored-by: Thomas Schmidt <thomas.heinz.schmidt@gmail.com>
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
Co-authored-by: Thomas Schmidt <thomas@metabase.com>
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Noah Moss <noahbmoss@gmail.com>
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-09-23 14:42:29 -07:00
Alex Yarosh
a137631b7f docs: time grouping stages (#63934)
* docs: time grouping stages

* Update docs/dashboards/filters.md
2025-09-23 21:19:43 +00:00
Edward Paget
e4a04ebc05 fix: jetty stats handler tests flake (#63912)
* fix: jetty stats handler tests flake

These tests could hang indefinitely on the `(.join server)` statement
because the core.async/go block handling async requests was incorrectly
doing a blocking take `<!!`. This also updates our :dev alias to enable
core.async to print warnings when using blocking operations in `go` blocks.

* fixup! oncomplete dispatch in go block

* fixup! using alts!! in go block
2025-09-23 16:17:41 -05:00
Stas Gavrylov
432287f763 update comments email template (#63626)
* WRK-893: Update API to store comment html content

* WRK-891: Add HTML content sending in comments. Add proper SmartLink serialization to HTML.

* WRK-891: Update comment email template to display comment content

* WRK-891: Fixes for comment email template. Add space insertion after smartLink

* trigger comment notification by id

* put old api behavior back and cleanup comment notification context

* whitespace

* fix tests

* Fix changeset author

* WRK-891: Fix smart links serialization. Add parent comment display in email

* Add style payload for comments email template

* fix types

* 🙄

* test email changes

* test email again

* make email formatting looking perfect

* cleanup

* require html content to be provided when posting a comment

* fix e2e test

* fix another e2e test

* pass 0 as tiptap placeholder when no label available

---------

Co-authored-by: Oleksandr Solovyov <o@solovyov.net>
Co-authored-by: Uladzimir Havenchyk <uladzimir@metabase.com>
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-09-23 21:16:18 +00:00
Oreon Lothamer
d8be52f651 use vertica-ce from ecr (#63609)
* use vertica-ce from ecr

* use CI_IAM_ROLE for vertica ECR

* Adjust test

---------

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-09-23 11:09:32 -10:00
Nathan Voxland
6516199e3f Improve FieldValues inactive check (#63847) 2025-09-23 21:04:09 +00:00
Eric Normand
8dd1b8c4cc import/export tests for questions 2025-09-23 16:02:37 -05:00
Eric Normand
d8e3b30a83 Add transforms export 2025-09-23 14:35:42 -05:00
Eric Normand
6b9a0c0277 Add roundtrip tests 2025-09-23 14:31:12 -05:00
Thomas Schmidt
1bba35237e Auto set template tags (#63691) 2025-09-23 19:19:34 +00:00
Alex Yarosh
4337a1baf3 docs: scim <> saml interaction (#63925) 2025-09-23 15:07:38 -04:00
Brad Anderson
23cb8b11c0 Fix: #50011 Hides "Here are some explorations of" when there are no explorations (#63839) 2025-09-23 14:07:33 -04:00
Cam Saul
c863f41c2a Improved mu/defn and mu/fn macros: only evaluate schemas once (#63737)
* Mega Malli fn improvements

* Remove commented out code
2025-09-23 10:44:03 -07:00
Jakub Chodorowicz
34e7a0e9f1 Adjust DB form page width and form fields spacing (#63818)
* Adjust DB form page width and form fields spacing

* Extract layout field settings to one file

* Use lg spacing between form fields

* Conditionally add labelProps property

* Fix typo

* Refactor deprecated default export

* Simplify responsive max width

* Simplify DB page responsive styles

* Add card background to add db form
2025-09-23 18:25:56 +02:00
Timothy Dean
774cc91a4e Transforms schema tweaks, ingestion. Persist method not well tested 2025-09-23 10:22:30 -06:00
dpsutton
454a05e3c6 Downgrade athena (#63894)
having issues with classpath. I _think_ that athena is finding the
bigquery provided version of a netty class and that is failing. but it's
a bit difficult to follow.

downgrading now until we can take time to understand and sort it.
2025-09-23 10:53:34 -05:00
Ryan Laurie
1ed050b03d Make Loki work more consistently (#63859)
* fix loki?

* update loki scripts

* use ci

* remove double build

* update scripts

* update documentation
2025-09-23 15:16:54 +00:00
Eric Normand
0d185aa777 Export metrics 2025-09-23 10:10:22 -05:00
Robert Kosara
9041dbb329 docs: Remove the +New option for creating new models (#63861)
* Remove the +New option for creating new models

* Bring back the from-scratch approach

Based on Alex's requested change, but also realized that you can use the command palette

* Move note about models getting pinned back into the new model section

* Format UI terms using bold instead of italics
2025-09-23 08:08:29 -07:00
lbrdnk
63cc5c3137 Semantic search token usage tracking (#63591)
* Pass type of embedding request

* Initial migration

* Add remaining opts args

* Add SemanticSearchTokenTracking module

* Connect token tracking to ai-service impl

* Add test for token tracking writes.

* Remove prompt_tokens including migration

* Add usage trimmer job

* Trimmer test

* Activate trimmer job

* test

* Record tokens for openai

* Update test

* Use total-tokens

* Comment

* linter

* Add index

* Exclude from copy
2025-09-23 16:50:55 +02:00
Phoomparin Mano
7551f766dd Hide non-customer-facing embedding hub settings (#63838) 2025-09-23 21:45:31 +07:00
Eric Normand
4434205bc0 Add model test 2025-09-23 09:34:19 -05:00
John Swanson
f4b675b3f2 Serialize transforms (#63658)
Serialization for transforms
2025-09-23 07:34:17 -07:00
github-automation-metabase
123e0cef51 Update generated docs (master) (#63864)
Co-authored-by: github-actions <github-actions@github.com>
2025-09-23 09:17:55 -04:00
Fraser
eed3bb1e19 Make timing steps continue-on-error (#63881) 2025-09-23 14:11:01 +02:00
Cam Saul
dad9b5c709 Don't spend minutes trying to generate descriptions for massive schemas (#63739)
* Don't spend minutes trying to generate descriptions for massive schemas

* Cljs test fix 🔧
2025-09-23 14:38:07 +03:00
Nicolò Pretto
166e20c944 fix typo in WhatsNewNotification: 'dimiss' -> 'dismiss' 2025-09-23 09:51:15 +00:00
Jakub Chodorowicz
e4d0318213 Migrate last direct usage of settings store url, to useStoreUrl (#63771) 2025-09-23 08:56:04 +02:00
Alexander Polyankin
3913c6e850 Fix pills input padding (#63840) 2025-09-23 02:03:55 +00:00
Fraser
f6384ac6f3 Automatically update e2e timings (#61950) 2025-09-23 10:19:09 +12:00
Maz Ameli
bd6d5e527b Replace usage of info_filled icon with info icon (#63734)
* replace usage of info_filled icon with info icon

* Update Loki Snapshots

* drop unused info_filled icon

* Update Loki Snapshots

* update stories

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2025-09-22 21:10:42 +00:00
Maz Ameli
4dac7d9dcf remove dropshadow from glossary container (#63730)
Co-authored-by: Stas Gavrylov <stas@metabase.com>
2025-09-22 21:04:20 +00:00
Nemanja Glumac
5bda80e53f Add simple event tracking for drill-thrus and other "click actions" (#63792) 2025-09-22 22:56:04 +02:00
Sébastien
07a34dc556 Removed loki flaky test (#63824) 2025-09-22 13:15:17 -07:00
Timothy Dean
9fc8a2724d Add validate-representation script 2025-09-22 14:05:04 -06:00
Alex Yarosh
3a4e2a311c docs: send only attachements (#63846)
* docs: send only attachements

* Apply suggestions from code review

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-09-22 20:04:43 +00:00
Jeff Bruemmer
f0427f0a34 docs - add glossary and image (#63844) 2025-09-22 16:00:04 -04:00
Jeff Bruemmer
ebcdcf1ce9 Remove .json format from subscription options (#63849) 2025-09-22 15:59:09 -04:00
Nick Fitzpatrick
20afc08468 Hiros document desires (#63035)
* starting document copying

* Document copy from collection page

* remove card node
2025-09-22 16:53:00 -03:00
Timothy Dean
94a5098f74 Add load-representation script 2025-09-22 13:44:14 -06:00
Timothy Dean
5c788efbe1 Questions and models from serialization-v0 collection 2025-09-22 12:47:58 -06:00
Alexander Polyankin
c60b139cf4 Fix removing all tags from a transform job (#63837) 2025-09-22 14:24:19 -04:00
Alexander Polyankin
cb7e5a0437 Transforms schedule component (#63767) 2025-09-22 18:04:33 +00:00
Anderson
1e4e4bcae5 Update user invitation email design (#63682)
* Update user invitation email design

* Add alt attr to img element

* Update system event clj test
2025-09-22 14:32:20 -03:00
Eric Normand
dc9bbc95d5 More question tests 2025-09-22 11:39:47 -05:00
Phoomparin Mano
f65c0fb194 Add completion checks for creating models in embedding hub (#63661)
* update test and implementation

* update models query to make more sense

* flake fix: try adding timeouts to Done

* remove cy.wait from tests

* wait for model creation

* modify create model tests
2025-09-22 16:33:12 +00:00
Nathan Voxland
fa187a027d Fix crash during reindexing of analytics on upgrade (#63770)
* Don't force reindex on serialization load to be async

* Allow reindex to be controlled when calling load

* Keep load reindex sync for now

* Make reindex async again
2025-09-22 10:30:57 -05:00
Alexander Polyankin
d25a14aec8 Show an error that variables in transforms are not supported (#63759) 2025-09-22 15:30:17 +00:00
Brad Anderson
4a59711053 Fix: #63258 + UXW-570 Fix truncated dashboard notifications (#63726)
* UXW-570 Fix truncated toast messages

* UXW-570 Updates e2e test

* #63258 Fix e2e tests (breaking because toast is wider, blocks previously unobscured elements)
2025-09-22 11:18:46 -04:00
Nemanja Glumac
c33489af35 Add tracking to bookmarks (#63752) 2025-09-22 15:12:24 +00:00
Eric Normand
29e408bf72 Merge branch 'master' into representations 2025-09-22 10:06:21 -05:00
Alexander Polyankin
d6c7ef8e63 Fix MLv2 error with audit v1 (#63772) 2025-09-22 10:27:41 -04:00
Nemanja Glumac
6e7aeb6d71 Add tracking to the metadata changes from admin (#63672) 2025-09-22 16:20:52 +02:00
github-automation-metabase
6db1e7e2ad Update generated docs (master) (#63810)
Co-authored-by: github-actions <github-actions@github.com>
2025-09-22 09:37:11 -04:00
Alexander Polyankin
f901d08b1c Hide cursor in the readonly native editor (#63774) 2025-09-22 13:26:06 +00:00
Alexander Polyankin
5bc7d211ba Remove unsupported buttons from native editor in transforms (#63768) 2025-09-22 09:20:43 -04:00
Alexander Polyankin
d04ffc2925 Change the default editor height for transforms (#63773) 2025-09-22 09:20:27 -04:00
Kamil Mielnik
c471c32f3f Allow to un-resolve deleted comments (#63429) 2025-09-22 10:06:21 +03:00
Romeo Van Snick
d867a09072 Convert MBQL transforms to SQL (#63565)
* Add a controlled version of NotebookNativePreview

* Use ReactNode instead of JSX.Element

* Add a button to toggle native sql

* Add sql preview to transform query editor

* Pull out resizehandle component

* Add e2e test for converting an MBQL transform to a native transform

* Move native query toggle out of header

* Move Native editor sidebar to separate component

* Fix overflow in native sidebar

* Fix copy on button

* Move connected NotebookNativePreview to query_builder

* Remove canConvertToNative prop

* Rename prop

* Move styles to css
2025-09-22 15:42:54 +10:00
github-actions[bot]
090fbc2d5a [chore] Update E2E test timings with recent data (#63327) 2025-09-22 14:27:07 +12:00
Fraser
33fe7b3afe Delete skipped expression popover e2e tests (#63732) 2025-09-22 12:08:46 +12:00
Timothy Dean
9398a2f092 Push experimental model yml file 2025-09-20 01:45:06 -05:00
Timothy Dean
bed66ab743 Fix yarn dev 2025-09-20 01:39:08 -05:00
Timothy Dean
ed931e2404 Playing with model metadata 2025-09-20 01:38:13 -05:00
Timothy Dean
afa3d6d70c Fix the /load endpoint 2025-09-20 01:37:15 -05:00
Phoomparin Mano
ea7eeeb15e Update related settings copy and alignment on embedding hub (#63660) 2025-09-20 09:46:30 +07:00
Phoomparin Mano
b693b137f6 Replace the language selection step on the setup flow with the language selector (#63584) 2025-09-20 08:55:34 +07:00
Phoomparin Mano
1a6044bbb3 Use blue shadow on embedding hub card to highlight next step (#63655) 2025-09-20 08:55:24 +07:00
Phoomparin Mano
e5706a4def Adjust the embedding homepage copy and add upsell for OSS (#63646) 2025-09-20 08:55:09 +07:00
dan sutton
d616d269f9 fixup tests
need db to run db tests. and validation checks against schema
2025-09-19 17:36:31 -05:00
Nicolò Maria Mezzopera
0014bbc775 fix(ci): properly account for ci-skip condition in jobs that specify IF condition (#63785) 2025-09-19 22:10:56 +00:00
Eric Normand
ea1ef9c283 Comment 2025-09-19 16:57:54 -05:00
Alex Yarosh
b96b8fbead docs: fix include in editable tables (#63783) 2025-09-19 17:55:54 -04:00
Eric Normand
639fcf2a3e Add question tests 2025-09-19 16:54:31 -05:00
Phoomparin Mano
7e09b87447 Update embedding hub card copy for embed in your code step (#63656) 2025-09-20 04:46:49 +07:00
dan sutton
89bf939860 referencing questions in static assets
```
❯ tree /tmp/behold
/tmp/behold
├── c-1-card196164.card.yml
├── c-2-card196324.card.yml
├── sub-collection
│   └── c-3-card12345.card.yml
└── with-references
    ├── question-122.yml
    └── question-125.yml

3 directories, 5 files
```

the with-references directory is as follows:

```yaml
name: kondo_lints_question
type: question
ref: question-122
mbql_query:
  type: query
  database: pg
  query:
    source-table:
    - pg
    - public
    - kondo_lints
    fields:
    - - field
      - - pg
        - public
        - kondo_lints
        - id
      - base-type: type/Integer
    - - field
      - - pg
        - public
        - kondo_lints
        - filename
      - base-type: type/Text
    - - field
      - - pg
        - public
        - kondo_lints
        - line
      - base-type: type/Integer
    - - field
      - - pg
        - public
        - kondo_lints
        - status
      - base-type: type/Text
    - - field
      - - pg
        - public
        - kondo_lints
        - error
      - base-type: type/Text
    - - field
      - - pg
        - public
        - kondo_lints
        - category
      - base-type: type/Text
database: pg
```

and 125:

```yaml
name: kondo_lints_question, Filtered by Status is error
type: question
ref: question-125
mbql_query:
  database: pg
  type: query
  query:
    source-table:
      ref: question-122
    filter:
    - =
    - - field
      - status
      - base-type: type/Text
    - error
database: pg
```

It _references_ another static, non-app-db question

```clojure
core=> (:dataset_query (fetch :question -5))
{:database 3,
 :type "query",
 :query {:source-table "card__-4", ;; <----- card -4
         :filter ["="
                  ["field" "status" {:base-type "type/Text"}]
                  "error"]}}
core=> (->> (qp/process-query (:dataset_query (fetch :question -5)))
            :data :rows (take 2))
([12933
  "shared/src/metabase/mbql/normalize.cljc"
  594
  "error"
  "Recur can only be used in tail position."
  "shared/src/metabase/mbql/normalize.cljc"]
 [12934
  "shared/src/metabase/mbql/normalize.cljc"
  594
  "error"
  "Unresolved symbol"
  "shared/src/metabase/mbql/normalize.cljc"])
```
2025-09-19 16:38:05 -05:00
Brad Anderson
102025c69c UXW-753 Fix issues with Detail visualization columns getting out of sync (#63769) 2025-09-19 17:12:14 -04:00
Alex Yarosh
80b31c4b1e docs: progress bar (#63779)
* progress bar

* header

* Optimized 3 images, saved 190.8 KB (53.7% smaller)

* link

* Apply suggestions from code review

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

* feedback

* links again?..

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-09-19 16:59:49 -04:00
Eric Normand
c635152b92 Fixes 2025-09-19 15:50:30 -05:00
Alex Yarosh
d4adbb7ef0 docs: snippets (#63761)
* snippets

* Optimized 5 images, saved 209.2 KB (50.7% smaller)

* link

* sql -> native

* Apply suggestions from code review

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

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

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

* rawwwwww

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-09-19 16:50:12 -04:00
Jeff Bruemmer
04192e385d docs - model list view (#63727) 2025-09-19 20:48:25 +00:00
Uladzimir Havenchyk
18b9ae17c7 rework comments sidebar (#63636)
don't use Sidesheet and use sidebar on the same level as Metabot sidebar, so both sidebars can be opened side by side
2025-09-19 19:48:46 +00:00
Eric Normand
7e8d562358 Move export functions 2025-09-19 14:25:21 -05:00
Eric Normand
320aab30bc whitespace 2025-09-19 14:25:16 -05:00
Alexander Polyankin
b69218fe00 Transforms copy changes (#63760) 2025-09-19 15:03:48 -04:00
Alexander Polyankin
61a8141a44 Remove selected tags (#63714) 2025-09-19 18:40:19 +00:00
Eric Normand
968cf8c336 Add a tiny test 2025-09-19 13:37:15 -05:00
Eric Normand
f4f22cb733 Revert all disablings 2025-09-19 13:33:30 -05:00
Timothy Dean
48239abdd3 Add an MBQL model.yml file 2025-09-19 12:24:33 -06:00
Eric Normand
2c40e5f217 kick ci 2025-09-19 13:22:56 -05:00
Eric Normand
38550465eb disable frontend tests? 2025-09-19 13:20:19 -05:00
Eric Normand
8f73866c87 Disable frontend tests? 2025-09-19 13:19:20 -05:00
Eric Normand
d1625d7384 Skip frontend? 2025-09-19 13:18:11 -05:00
Eric Normand
e22c93ed4c try skip 2025-09-19 13:11:23 -05:00
Eric Normand
a229d08410 remove stuff from run-tests.yml 2025-09-19 13:07:49 -05:00
Eric Normand
35aec6c7cb Revert "Delete e2e tests files"
This reverts commit 58c4abdd10.
2025-09-19 13:05:51 -05:00
Eric Normand
58c4abdd10 Delete e2e tests files 2025-09-19 13:04:02 -05:00
Eric Normand
08e9272440 Get representation tests to run???? 2025-09-19 12:51:38 -05:00
Eric Normand
5c9303e6e3 Attempt to disable tests 2025-09-19 12:49:47 -05:00
Eric Normand
554c6388b3 Remove more tests 2025-09-19 12:41:13 -05:00
Cam Saul
2ed9e3e1d4 Delete dead FE code (#63740)
* Delete dead FE code

* Update enterprise/frontend/src/metabase-enterprise/audit_app/lib/cards/queries.js

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-09-19 10:18:13 -07:00
Eric Normand
f21d0de52e Disable backend test runs 2025-09-19 12:11:19 -05:00
Eric Normand
8dc61e4eb0 Disable more tests 2025-09-19 12:08:10 -05:00
Timothy Dean
270fcf4299 Reorganize code again based on huddle discussion 2025-09-19 11:06:43 -06:00
Eric Normand
77cfe40954 kick ci 2025-09-19 11:58:19 -05:00
Eric Normand
6c4f743f38 Attempt: Disable driver tests and add representation tests runner 2025-09-19 11:56:39 -05:00
Eric Normand
65a5a67624 wip 2025-09-19 11:06:15 -05:00
Abed Habli
a1a9e71867 docs: renaming Debian references (#63763)
* Renaming debian

* redirect to the doc
2025-09-19 17:52:17 +02:00
Edward Paget
0ed177ddb1 fix: remove commented out card pivot test (#63701) 2025-09-19 15:41:59 +00:00
Timothy Dean
abaac8c3f7 m. Rename 2025-09-19 09:20:07 -06:00
Timothy Dean
e1406025a9 Provide a wrapper for yaml->toucan operations 2025-09-19 09:18:41 -06:00
Mahatthana (Kelvin) Nomsawadi
814dd5c800 Fix static embedding dashboard calling GET: /api/dashboard unnecessarily (#63753) 2025-09-19 21:32:19 +07:00
dan sutton
3312f915ee Static serving
given

```
❯ tree /tmp/swaperoo
/tmp/swaperoo
├── c-1-card196164.card.yml
├── c-2-card196324.card.yml
└── sub-collection
    └── c-3-card12345.card.yml

2 directories, 3 files
```

the running

```
clj -M:dev:ee:ee-dev:drivers:drivers-dev:socket -m metabase.core.bootstrap static --directory /tmp/swaperoo
```

Will serve the assets from /tmp/swaperoo.
It does this by loading them in MEMORY and assigning them sequential
negative ids. These are not loaded into the app-db.

```
❯ tree /tmp/swaperoo
/tmp/swaperoo  (collection -1: swaperoo)
├── c-1-card196164.card.yml (card -1)
├── c-2-card196324.card.yml (card -2)
└── sub-collection (collection -2: sub-collection)
    └── c-3-card12345.card.yml (card -3)

```
2025-09-19 09:32:02 -05:00
Oleksandr Solovyov
8285e38f9c cleanup v3/v2/ (#63634) 2025-09-19 17:25:58 +03:00
github-automation-metabase
8ad7ee944d Update generated docs (master) (#63736)
Co-authored-by: github-actions <github-actions@github.com>
2025-09-19 09:07:22 -04:00
Phoomparin Mano
975002a6f7 Revert the cloud setup flow's layout to match self-hosted setup flow (#63577) 2025-09-19 18:34:03 +07:00
Phoomparin Mano
3fddbec54e feat(embed-js): better error message when useExistingUserSession fails (#63125) 2025-09-19 18:13:18 +07:00
Sébastien
c3461ab646 Closes EMB-816 misleading text for number of rows (#63561)
* Closes EMB-816 misleading text for number of rows

* updated e2e tests

* marked a test as flaky until we figure out what is up with it

* addressed legit comment

* Update Loki Snapshots

* loki

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-09-19 12:31:22 +02:00
Phoomparin Mano
b5878d9bf5 Show the embedding hub checklist in embedding homepage (#63596) 2025-09-19 16:47:51 +07:00
Oleksandr Solovyov
6206b6f204 document comments: enable user mentions (#63426) 2025-09-19 09:42:06 +03:00
Mahatthana (Kelvin) Nomsawadi
4ef96bd73a feat(embed-js): Add analytics to Embedded Analytics JS (#63580)
* Add Embedded Analytics JS usage snowplow schema

* Add analytics

* Clarify code with comments

* Fix analytics logic + fix typing

* Add unit tests

* Make E2E embedded analytics JS util supports multiple elements

* Fix code not working in Cypress for some reason

* Add E2E test suite

* Fix import order

* Remove extra line

* Fix E2E from util API change

* Update snowplow/iglu-client-embedded/schemas/com.metabase/embedded_analytics_js/jsonschema/1-0-0

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

* Update e2e/test/scenarios/embedding/sdk-iframe-embedding/sdk-iframe-embedding.cy.spec.ts

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* Update e2e/support/helpers/e2e-embedding-iframe-sdk-helpers.ts

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* Fix E2E by updating a function API

* Pass snowplow schema lint

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-09-19 06:46:35 +01:00
Romeo Van Snick
b336da1517 Allow going back to snippet root collection (#63549)
* Allow going back to root collection from top-level snippet collection

* Add e2e test for snippet collections
2025-09-19 12:23:34 +10:00
Alexander Polyankin
c98dca560d Unskip transform tests (#63733) 2025-09-18 21:50:52 -04:00
github-actions[bot]
e370820778 Fix: Weird menu state shown when there are no questions in recents (#62985)
* Fix: Weird menu state shown when there are no questions in recents

Fixes #62728

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix the robot's mess

---------

Co-authored-by: Claude Code[bot] <noreply@anthropic.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-09-18 23:06:45 +00:00
github-actions[bot]
69405a7dea Update translations 2025-09-16 (#63546)
* Update translation sources 2025-09-16

* Update translations

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-09-18 23:06:31 +00:00
Fraser
c0ca9e0493 Only run auto-backport when a backport label is added (#63606)
* Only run auto-backport when a backport label is added

* Assign backported PR to original PR creator
2025-09-18 16:57:42 -06:00
Timothy Dean
3809c909f0 Create an invalid example yml file 2025-09-18 16:44:09 -06:00
Fraser
ced8d84def Delete out of datte skipped caching test (#63680) 2025-09-19 10:39:24 +12:00
Fraser
8c8279e570 Delete unimplemented FKs in nested queries e2e test (#63684) 2025-09-19 10:39:00 +12:00
Fraser
6afe00b9f1 Fix custom column isNull e2e test (#63685) 2025-09-19 10:38:45 +12:00
Fraser
6e8cca3da7 Unskip join source table e2e tests (#63678) 2025-09-19 10:38:12 +12:00
Timothy Dean
388f208bb2 Tweak model.yml 2025-09-18 16:28:12 -06:00
Eric Normand
55ef1e8392 card->question 2025-09-18 17:14:56 -05:00
Eric Normand
576535eaf7 dataset->model 2025-09-18 17:09:20 -05:00
Timothy Dean
78e3b5d282 Wire up model ingestion 2025-09-18 15:50:51 -06:00
Timothy Dean
ff96dabfcf Slightly improved /validate endpoint 2025-09-18 15:35:02 -06:00
Timothy Dean
3dece4143a WIP model ingestion, not wired up yet 2025-09-18 15:28:52 -06:00
Eric Normand
092674a6b8 string instead of keyword 2025-09-18 16:22:21 -05:00
dan sutton
4d46a3beb4 clean up representation -> card in memory representation 2025-09-18 16:21:33 -05:00
Maz Ameli
a1582d07de Fix palette preview in Branding section (#63677)
* add tabs

* move reset button and remove needless tableheader

* fix palette preview chart

* change tab text

* cleanup

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-09-18 21:19:11 +00:00
Eric Normand
edccda93bf Add bb script to export a collection 2025-09-18 16:18:05 -05:00
Ryan Laurie
40387cc586 Update ActionButton to typescript (#63454)
* update ActionButton to typescript

* address review comments

* replace ref
2025-09-18 21:14:07 +00:00
Timothy Dean
2d10da8267 Stop hardcoding :native on question ingestion 2025-09-18 15:11:16 -06:00
Timothy Dean
64d22caf90 Move creator-id and entity-id determination into representation->question-data 2025-09-18 15:00:24 -06:00
Eric Normand
c09d983f2c Add collection endpoint 2025-09-18 15:50:49 -05:00
Alexander Polyankin
911da7f851 Make transform list pages wider (#63710) 2025-09-18 20:49:56 +00:00
Jeff Bruemmer
4deefb87b3 docs - basic table editing (#63601) 2025-09-18 16:36:23 -04:00
Timofey Kachalov
c56432c2f7 Properly run tiles-query as admin user for static endpoints if JWT token is valid (#63692) 2025-09-19 00:11:33 +04:00
Timofey Kachalov
f9e9a20d94 fix(sdk): Properly load Tiles from MB instance (#63676) 2025-09-19 00:07:31 +04:00
Eric Normand
503c35172d Merge branch 'master' into representations 2025-09-18 15:02:12 -05:00
Eric Normand
57906d9ddc kick ci 2025-09-18 14:59:28 -05:00
Alex Yarosh
5d68e7363f docs: remove references to date coercion (#63716) 2025-09-18 15:58:58 -04:00
Stas Gavrylov
0efa8eac5b Data Reference – Glossary (#63576)
* feat: add glossary UI

* fix: line-height

* Styling

* Show edit button only on hover

* Make the term required

* Delete modal

* Actions menu

* Fix popovers opened for multiple terms

* Autofocus

* glossary api

* serialization

* support moving from h2 to cloud

* WRK-890: Replaces mocked glossary API with proper integration

* WRK-889: Refactor Glossary editing and overall styling

* WRK-889: Fix layout margin

* WRK-889: Update Glossary styling

* WRK-890: Address design comments. Refactor GlossaryTable into a separate component

* WRK-890: Add unit tests for GlossaryTable component

* WRK-890: Add e2e tests for Glossary

* WRK-890: Cleanup css, fix linter

* add boat empty state

* add explanatory text

* text and font weight tweaks

* tweak placeholder text

* improve delete confirm modal

* WRK-889: Update Glossary styling, implement hotkeys handling

* WRK-890: Add optimistic updates for Glossary editing

* WRK-890: Fix unit tests

* WRK-889: Adjust line height for glossary items

* WRK-889: More styling adjustments for GlossaryRowEditor

* WRK-890: Fix e2e tests

* fix merge results

* WRK-890: Address PR comments

* serialization fixes

---------

Co-authored-by: Konstantin Darutkin <spalt08@mail.ru>
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Oleksandr Solovyov <o@solovyov.net>
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Co-authored-by: Maz Ameli <maz@metabase.com>
2025-09-18 22:38:56 +03:00
Eric Normand
0e2fdcdfef Merge branch 'representations' of github.com:metabase/metabase into representations 2025-09-18 13:55:55 -05:00
Eric Normand
83f6814775 kick ci 2025-09-18 13:55:37 -05:00
Oleksandr Yakushev
6e3dfdb62b Upgrade c3p0 to 0.11.2 (#63213) 2025-09-18 21:47:35 +03:00
Timothy Dean
1bb21b1ad7 Add /validate endpoint to API 2025-09-18 11:46:51 -06:00
Timothy Dean
fb62d65095 m. 2025-09-18 11:37:10 -06:00
Timothy Dean
ad1423767a Better example model.yml 2025-09-18 11:36:14 -06:00
Timothy Dean
ef661cc1d1 Add example model yml with some schema 2025-09-18 11:29:51 -06:00
Timothy Dean
be445608ce Create representations.ingestion.common 2025-09-18 11:23:48 -06:00
Eric Normand
075ee44a6c Forgot this file 2025-09-18 12:05:25 -05:00
Eric Normand
407e6dd824 Export models
Note: I copied the export for questions, including the logic and schema. I don't know if there's something else in
models (metadata?) that I am not capturing.
2025-09-18 12:04:35 -05:00
lbrdnk
e915bf2d40 Add guards to semantic search jobs (#63694) 2025-09-18 18:57:14 +02:00
Cam Saul
118613ab89 Binning middleware needs to update :lib/original-binning as well (#63673)
* Binning middleware needs to update `:lib/original-binning` as well

* Test fixes 🔧

* cljfmt
2025-09-18 09:37:29 -07:00
Alexander Polyankin
4f764b82ef Do not autopivot transform query results (#63669) 2025-09-18 16:21:09 +00:00
Alexander Polyankin
ce5a554d4d Add transform count to the job list (#63647) 2025-09-18 16:16:51 +00:00
Eric Normand
5b86da8b8b Export mbql questions 2025-09-18 11:01:06 -05:00
github-automation-metabase
eb5100abc6 Update generated docs (master) (#63679)
Co-authored-by: github-actions <github-actions@github.com>
2025-09-18 11:44:29 -04:00
Eric Normand
39d9982ae4 API for exporting a native query question.
GET /api/ee/representation/question/92
2025-09-18 10:38:10 -05:00
Sébastien
64630276e3 Closes EMB-50 tabs dimmed out on iOS (#63690) 2025-09-18 15:57:35 +02:00
Brad Anderson
6f660a3090 Fix #63629: Filter on cards causes an unnecessary horizontal scroll bar for public/static embedding (#63650) 2025-09-18 09:51:31 -04:00
Nicola Mometto
eab4bf076d Transforms prepare for python (#63698)
* pull out transform run utils to prepare for python transforms

* fix: check running-run on transform-id, not run-id

* chore: put on a new line
2025-09-18 13:46:24 +00:00
Jakub Chodorowicz
2be60d80c3 Fix command z not working in connection string input (#63689)
- Stop preventing default event handling onPaste.
- Improve Cypress paste emulation to be compatible with React way of handling paste events.
2025-09-18 15:20:03 +02:00
Romeo Van Snick
3038880e46 Transform run cancellation (#62387)
* Add cancellation to transform api

* Use effect to set polling state

* Add cancellation button to run button

* Set up cancellation on transform page

* Use confirmation modal to cancel transform

* Add run cancel button to run list

* Make api endpoint take transform id instead of run id.

* Fix cancelation api

* Add canceled state to TransformRunStatus

* Add canceled state to transform page

* Add polling to RunListPage

* Remove comment in code

* Set status to canceling when you click cancel

* Add canceling status

* Poll when the transform is canceling

* Add copy for runs that are being canceled

* Manually track fetching status for running and canceling

* Handle canceling status in utils

* Avoid wrapping cancel button in run list

* Add test for canceling run on transform page

* Add e2e for canceling test from runs page

* Fix prop type

* Change copy to Canceling

* Add custom color to canceled state

* Remove mock code

* Increase cancelation tiemout

* Fix copy in text

* Fix snowplow event

* Remove void specifier and close modal in handler directyle

* Add optimistic update for run cancelation

* Avoid manually tracking cancelation status

* Avoid useEffect when changing isPolling

* Add in missing helper

* Remove another useEffect

* Add placeholder run when starting

---------

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-09-18 10:34:50 +00:00
Nemanja Glumac
b2b04e9206 Add analytics to history revision and data reference (#63587) 2025-09-18 09:44:49 +00:00
Alexander Polyankin
ef8111537e Update copy in UpdateTargetModal.tsx (#63667) 2025-09-18 08:11:11 +00:00
Nemanja Glumac
7bce3ff38a Add analytics to Metabot events (#63415)
* Add Metabot events

* Fix tooltip label

* Add new event for metabot chat controlled from the native editor
2025-09-18 08:44:19 +02:00
Cam Saul
066d3a233d Pure Lib QP: remove code to wrap legacy middleware (#63645)
* cumulative-aggregations-middleware => Lib

* Ensure MBQL 5

* Fix NOCOMMIT

* Fix indentation

* Pure-Lib QP :party:

* Remove some more unused legacy MBQL utils
2025-09-18 00:13:20 +00:00
Fraser
095ad3c39c Tag latest flaky tests (#63617) 2025-09-18 11:54:13 +12:00
Timothy Dean
530b985bc4 tweak commented out dev utils 2025-09-17 17:35:24 -06:00
Timothy Dean
ab8afe34b1 Delete 'card' as a named entity, reorganize namespaces as cleanup 2025-09-17 17:31:45 -06:00
Fraser
d50561227f Fix skipped chart drill-through e2e tests (#63548) 2025-09-18 11:18:02 +12:00
Eric Normand
26b4d85352 API route
curl -X POST -H "Content-Type: text/yaml" -H "X-API-Key: mb_5Qj3t1s5NYcXNq1jB3wIebP3rAhLcmmgkSBp8YTvXOU=" --data-binary @test_resources/representations/v0/monthly-revenue.question.yml localhost:3002/api/ee/representation/load/5
2025-09-17 17:30:44 -05:00
Timothy Dean
558a2f91b2 On card ingestion, update existing card if ref matches 2025-09-17 16:24:56 -06:00
Timothy Dean
6b9381b859 Tweak collection schema 2025-09-17 16:15:48 -06:00
Timothy Dean
0cfa725615 Hook up card ingestion 2025-09-17 15:50:36 -06:00
Timothy Dean
7d74867058 Ingest one example question.yml file and insert it into the app-db 2025-09-17 15:42:20 -06:00
Ryan Laurie
63f9d193a9 Use Iframe for changelog (#62943)
* use iframe for changelog

* add query params and tabs

* always show update info

it's useful even if you're on the latest version

* remove metabase as configurable host

* always allow changelog/releases in iframes

* fix tests

* fix tests

* update tests

* use root metabase domains

* fix test

---------

Co-authored-by: John Swanson <john.d.swanson@gmail.com>
2025-09-17 14:40:52 -06:00
Alexander Polyankin
0a18c13feb Skip failing tests (#63663) 2025-09-17 18:57:52 +00:00
Timothy Dean
bf3a3e9e00 WIP: ingest & validate yml against schemas 2025-09-17 12:30:48 -06:00
Nemanja Glumac
a58c63a74f Add analytics to x-rays (#63498) 2025-09-17 19:55:51 +02:00
Alexander Polyankin
96f1ef42a2 Disable transform editing buttons when running (#63642) 2025-09-17 16:05:51 +00:00
Jakub Chodorowicz
fd073fb8b1 PRG-130 Send parse connection string parsing events only on blur (#63558)
* Send parse connection string parsing events only on blur

* Use synchronous last parsing result for monitoring

* Improve test assertions for connection string events

* Make sure we don' track the same parsing event again

* Refactor ts-match to simple if conditions

* Make lastStatus have the same success value depending on non undefined values

* Improve the snowplow Cypress test setup for connection string
2025-09-17 16:03:04 +00:00
Alexander Polyankin
a7971b43b1 Fix table layout issues in transform pages (#63540) 2025-09-17 11:49:22 -04:00
Cam Saul
0d1b4e253a cumulative-aggregations-middleware => Lib (#63592)
* cumulative-aggregations-middleware => Lib

* Ensure MBQL 5

* Fix NOCOMMIT
2025-09-17 15:47:13 +00:00
Sébastien
9986021635 Closes EMB-303 search bar in embedding no longer awfully long (#63632) 2025-09-17 17:09:28 +02:00
Anderson
ae422678b2 [Admin settings] Show help documentation to connect DB in a side panel (#63420)
* [Admin settings] Show help documentation to connect DB in a side panel

* Add unit tests

* Add more tests / tweaks

* Add e2e tests

* Make sure help content is not rendered if not available

* Self-review tweaks

* Use useDocsUrl in DatabaseHelpSidePanel.tsx

* Use aside element for the side panel

* Use await findBy when possible

* Use JSDoc / Remove unnecessary comment

* Add some style to blockquote

* Add test file for useHelpLink

* Fix failing test

* Add analytics event
2025-09-17 11:59:05 -03:00
Cam Saul
8ecc5c6718 add-rows-truncated middleware => Lib (#63616) 2025-09-17 14:52:21 +00:00
Cam Saul
dec95aabe7 resolve-joins middleware => Lib, remove add-source-metadata (#63608) 2025-09-17 14:50:07 +00:00
Ngoc Khuat
98e29f6c39 [Transform python] python lib apis and settings (#63568) 2025-09-17 14:23:11 +00:00
lbrdnk
b110c02981 Fix empty db url for metric collector job (#63633) 2025-09-17 14:15:20 +00:00
github-automation-metabase
a5056280e8 Update generated docs (master) (#63611)
Co-authored-by: github-actions <github-actions@github.com>
2025-09-17 10:10:53 -04:00
Alexander Polyankin
33f5b24a0a Fix flaky "Change target" behavior for transforms (#63526) 2025-09-17 09:15:43 -04:00
Uladzimir Havenchyk
323e6f3823 chore: drop unused files (#63500) 2025-09-17 13:29:30 +03:00
Timofey Kachalov
b5b9bad486 Add the better handling of the missing enterprise token for Sample Apps e2e (#63573) 2025-09-17 11:51:20 +04:00
Thomas Schmidt
7f4cb813c2 Adjust legacy sql generation button to toggle Metabot chat (#63554)
* Adjust legacy sql generation button to toggle Metabot chat

* Change placeholder text
2025-09-17 07:01:08 +00:00
Oleksandr Solovyov
068f460124 [metabot] tool_calls should be a vector (#63579)
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-09-17 09:09:28 +03:00
Oleksandr Solovyov
50e10ee9c2 enable metabot stats and prevent recursive token checks (#63574) 2025-09-17 09:09:06 +03:00
Cam Saul
4d54129a72 viz-settings middleware => Lib (#63597) 2025-09-16 22:32:46 -07:00
Cam Saul
3d2789c2f1 Fix #63571 (#63595) 2025-09-16 20:31:19 -07:00
Ryan Laurie
2e4c39904e Handle when tags are not defined (#63588)
Co-authored-by: Fraser <fraser@metabase.com>
2025-09-17 00:29:57 +00:00
Alexander Polyankin
0911bbe3b3 Simplify state management and fix the flicker with the transform run button (#63586)r
* Fix optimistic updates with transforms

* Fix optimistic updates with transforms
2025-09-16 18:49:37 -04:00
Luis Paolini
e08969edd9 Document password handling for special characters (#63590)
* Document password handling for special characters

* Add section on special character passwords in MariaDB

Added information about handling passwords with special characters in MariaDB connection strings.

* Apply suggestions from code review

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>

* Update docs/databases/connections/mysql.md

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
2025-09-16 19:22:14 -03:00
Aleksandr Lesnenko
b5942d4f36 respect decimals setting when compact formatting is enabled (#63457) 2025-09-16 17:54:07 -04:00
Alex Yarosh
914d56b2c0 docs: transforms draft (#63594)
* skeleton

* transforms

* privileges

* Apply suggestions from code review

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

* edits

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-09-16 21:53:21 +00:00
dan sutton
bcca5c2329 first pass at writing representations
Interesting things:
- using serdes mbql export. this puts nano-ids, so we walk over each card, get mapping of nano-id to id, then replace
with refs. So the ingestion will need to do the opposite.

  ;; do we like entity type in filename?
  ;; walk over all, identity which depend on other refs. so first, get all refs
  ;; then walk over each dataset_query, looking for any refs that are reffed
  ;; then do topological sort, inserting cards without deps and keeping a map of ref to inserted id
  ;; update existing refs to ids (note source-tables are "card__<id>"
  ;; insert and continue

```clojure
core=> (write-em "/tmp" 8)
.
..nil
```

Very dump to write dots but this is exploratory, baby.

example:

(note, rows in yaml are actually commented out but git would remove them)
```yaml
❯ tree custom
custom
├── c-115-card1150883.card.yml
├── c-116-card1151398.card.yml
└── c-117-card1150868.card.yml

1 directory, 3 files

/tmp on ☁️  metabase-query
❯ cat custom/*
name: Orders and weird column
version: 1-card
type: card
ref: c-115-card1150883
dataset_query:
  database: Sample Database
  type: query
  query:
    source-table:
    - Sample Database
    - PUBLIC
    - ORDERS
    expressions:
      sum-of-weird:
      - +
      - - field
        - - Sample Database
          - PUBLIC
          - ORDERS
          - TAX
        - base-type: type/Float
      - - field
        - - Sample Database
          - PUBLIC
          - ORDERS
          - TOTAL
        - base-type: type/Float

 [1 1 14 37.648145389078365 2.07 39.718145389078366 nil "2025-02-11T21:40:27.892Z" 2 41.788145389078366 "Hudson Borer" "Awesome Concrete Shoes"]
 [2 1 123 110.93145648834248 6.1 117.03145648834247 nil "2024-05-15T08:04:04.58Z" 3 123.13145648834247 "Hudson Borer" "Mediocre Wooden Bench"]
 [3 1 105 52.723521442619514 2.9 49.206842233769756 6.416679208849759 "2025-12-06T22:22:48.544Z" 2 52.106842233769754 "Hudson Borer" "Fantastic Wool Shirt"]
 [4 1 94 109.21864156655383 6.01 115.22864156655383 nil "2025-08-22T16:30:42.392Z" 6 121.23864156655384 "Hudson Borer" "Awesome Bronze Plate"]
 [5 1 132 127.88197029833711 7.03 134.9119702983371 nil "2024-10-10T03:34:47.309Z" 5 141.9419702983371 "Hudson Borer" "Sleek Steel Table"]
 [6 1 60 29.80214751859149 1.64 31.44214751859149 nil "2025-11-06T16:38:50.134Z" 3 33.08214751859149 "Hudson Borer" "Rustic Paper Car"]
 [7 1 55 95.77128575934437 5.27 101.04128575934436 nil "2024-09-11T11:22:26.521Z" 5 106.31128575934436 "Hudson Borer" "Mediocre Rubber Shoes"]
 [8 1 65 68.22769726470014 3.75 63.32374433449318 8.653952930206964 "2025-06-17T02:37:41.693Z" 7 67.07374433449317 "Hudson Borer" "Ergonomic Silk Table"]
 [9 1 184 77.3982748679465 4.26 78.06353271268733 3.594742155259162 "2023-05-03T16:00:54.923Z" 3 82.32353271268734 "Hudson Borer" "Practical Granite Plate"]
 [10 1 6 97.43621265344382 5.36 102.79621265344382 nil "2026-01-17T01:44:37.233Z" 2 108.15621265344382 "Hudson Borer" "Small Marble Hat"]
name: Orders and weird column, Filtered by sum-of-weird is greater than 10
version: 1-card
type: card
ref: c-116-card1151398
dataset_query:
  database: Sample Database
  type: query
  query:
    source-table: c-115-card1150883
    filter:
    - '>'
    - - field
      - sum-of-weird
      - base-type: type/Float
    - 10

 [1 1 14 37.648145389078365 2.07 39.718145389078366 nil "2025-02-11T21:40:27.892Z" 2 41.788145389078366 "Hudson Borer" "Awesome Concrete Shoes"]
 [2 1 123 110.93145648834248 6.1 117.03145648834247 nil "2024-05-15T08:04:04.58Z" 3 123.13145648834247 "Hudson Borer" "Mediocre Wooden Bench"]
 [3 1 105 52.723521442619514 2.9 49.206842233769756 6.416679208849759 "2025-12-06T22:22:48.544Z" 2 52.106842233769754 "Hudson Borer" "Fantastic Wool Shirt"]
 [4 1 94 109.21864156655383 6.01 115.22864156655383 nil "2025-08-22T16:30:42.392Z" 6 121.23864156655384 "Hudson Borer" "Awesome Bronze Plate"]
 [5 1 132 127.88197029833711 7.03 134.9119702983371 nil "2024-10-10T03:34:47.309Z" 5 141.9419702983371 "Hudson Borer" "Sleek Steel Table"]
 [6 1 60 29.80214751859149 1.64 31.44214751859149 nil "2025-11-06T16:38:50.134Z" 3 33.08214751859149 "Hudson Borer" "Rustic Paper Car"]
 [7 1 55 95.77128575934437 5.27 101.04128575934436 nil "2024-09-11T11:22:26.521Z" 5 106.31128575934436 "Hudson Borer" "Mediocre Rubber Shoes"]
 [8 1 65 68.22769726470014 3.75 63.32374433449318 8.653952930206964 "2025-06-17T02:37:41.693Z" 7 67.07374433449317 "Hudson Borer" "Ergonomic Silk Table"]
 [9 1 184 77.3982748679465 4.26 78.06353271268733 3.594742155259162 "2023-05-03T16:00:54.923Z" 3 82.32353271268734 "Hudson Borer" "Practical Granite Plate"]
 [10 1 6 97.43621265344382 5.36 102.79621265344382 nil "2026-01-17T01:44:37.233Z" 2 108.15621265344382 "Hudson Borer" "Small Marble Hat"]
name: 5 products
version: 1-card
type: card
ref: c-117-card1150868
dataset_query:
  database: Sample Database
  type: native
  native:
    template-tags:
      category_filter:
        widget-type: string/=
        display-name: Category Filter
        type: dimension
        name: category_filter
        id: b5cca8e2-d397-4195-9957-1f69fda66d95
        dimension:
        - field
        - - Sample Database
          - PUBLIC
          - PRODUCTS
          - CATEGORY
        - null
    query: select * from products where {{category_filter}} limit 5

 [1 "1018947080336" "Rustic Paper Wallet" "Gizmo" "Swaniawski, Casper and Hilll" 29.463261130679875 4.6 "2023-07-19T19:44:56.582Z"]
 [2 "7663515285824" "Small Marble Shoes" "Doohickey" "Balistreri-Ankunding" 70.07989613071763 0.0 "2025-04-11T08:49:35.932Z"]
 [3 "4966277046676" "Synergistic Granite Chair" "Doohickey" "Murray, Watsica and Wunsch" 35.388744881539054 4.0 "2024-09-08T22:03:20.239Z"]
 [4 "4134502155718" "Enormous Aluminum Shirt" "Doohickey" "Regan Bradtke and Sons" 73.99178100854834 3.0 "2024-03-06T02:53:09.937Z"]
 [5 "5499736705597" "Enormous Marble Wallet" "Gadget" "Price, Schultz and Daniel" 82.7450976850356 4.0 "2022-10-03T01:47:39.147Z"]
```
2025-09-16 16:49:54 -05:00
Timothy Dean
25c142a7aa v0 scaffolding collection.yml 2025-09-16 15:43:43 -06:00
Timothy Dean
2d53706de7 v0 database scaffolding 2025-09-16 15:36:14 -06:00
Timothy Dean
ae6f82e0ee Scaffolding: clj schemas 2025-09-16 15:16:19 -06:00
Anton Kulyk
035be556eb Improve the look and feel of charts in dashboards (#62610)
* Fix vertical legend position for cartesian charts

* Set dashcard title font size to 14px

* Decrease legend dot size

* Decrease value labels density for cartesian charts

* Use normal font weight for axis names, labels, etc

* Make y axis split lines solid vs dashed

* Show scalar card title in dashcard header

* Always show pie chart total

* Hide axis names on small dashcards

* Update screenshots

* Fix tests

* Fix number cards font size

* Fix hiding cartesian chart axis

* Fix font styles in other legend components

* Fix e2e tests

* Hide cartesian chart axes independently

* Use different legend style only in dashboards

* Apply min spacing to labels per series

* Fix legend dot size in edit mode

* Update label sizes for funnels and sankey charts

* Use bold font for data labels

* Update screenshots

* prettier

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-09-16 21:09:38 +00:00
Timothy Dean
219685e26f Scaffolding 2025-09-16 15:01:02 -06:00
Timothy Dean
1f892946c9 Scaffolding 2025-09-16 14:53:43 -06:00
Timothy Dean
cdacf75b02 Init commit 2025-09-16 13:59:53 -06:00
Cam Saul
1919a6cd62 Trivial middleware, qp.compile, qp.execute => Lib (#63419)
* Trivial preprocessing middleware => Lib

* Handle already-native MBQL 5 queries

* substitute-persisted-query => Lib

* A bunch of post-processing middleware is actually MBQL-5 ready

* Fixx 🔧

* Test fixes 🔧

* More fixes 🔧

* Fix more stuff

* Wow even more test fixes =(

* (Hopefully) final round of test fixes

* Kondo

* More test fixes 🔧

* Fixes 🔧
2025-09-16 22:08:09 +03:00
Jeff Bruemmer
1a16244f86 docs - note on images (#63583) 2025-09-16 13:54:25 -04:00
Alexander Polyankin
ea5b0d4a9e Make description input in transforms bigger (#63541) 2025-09-16 15:13:57 +00:00
Ryan Laurie
b84b11532e skip broken about e2e test (#63572) 2025-09-16 08:07:07 -06:00
Oleksandr Solovyov
5e3968f517 report date for metabot usage info to HM (#63560)
* report date for metabot usage info to HM

* disable metabot stats to resurrect stats
2025-09-16 16:45:11 +03:00
Jeff Bruemmer
1b2ebb4fd7 docs - clarify webhook permissions (#63567)
* update webhook docs

* summary

* more perms
2025-09-16 09:30:17 -04:00
github-automation-metabase
d888aa8ee1 Update generated docs (master) (#63542)
Co-authored-by: github-actions <github-actions@github.com>
2025-09-16 09:01:00 -04:00
Ngoc Khuat
7aa3f7fed1 Send pulse skip legacy alerts (#63497) 2025-09-16 11:44:43 +00:00
Phoomparin Mano
be673c4771 Unskip and fix flaky locale test for embedded analytics js (#63518) 2025-09-16 18:05:54 +07:00
Fraser
41db01c5e2 Unskip About page e2e test (#63538) 2025-09-16 22:19:55 +12:00
Oleksandr Solovyov
b0299c474d fix metabot token count query (#63556) 2025-09-16 13:04:04 +03:00
Ngoc Khuat
3275cb9a44 Driver table CRUD to skip QP (#63427) 2025-09-16 09:10:17 +00:00
lbrdnk
e7b70ba03f :metabase-search/semantic-fallback-results-usage (#63442) 2025-09-16 11:00:09 +02:00
Jakub Chodorowicz
25adbcfee8 Adjust label spacing in the db form (#63499)
# Conflicts:
#	frontend/src/metabase/databases/components/DatabaseEngineField/DatabaseEngineSelect.tsx
2025-09-16 10:24:52 +02:00
Timofey Kachalov
94b90013cb refactor(sdk): Replase Zod with Yup for SDK bundle schema validation (#63489) 2025-09-16 10:34:39 +04:00
Oleksandr Solovyov
065d6ce5aa Store Metabot conversation history with token usage and report it to HM (#63073) 2025-09-16 09:02:01 +03:00
Romeo Van Snick
2ce5dc4e46 Native editor sidebar for transforms (#63287)
* Swap cancel and save button

* Render sidebar in native query editor for transforms

* use toggleSnippetSidebar from props

* Fix snippets sidebar

* Export SelectionRange

* Add aria label for data reference button

* Open database on mount

* Add aria-label to snippets button

* Add e2e tests for sidebar in SQL transforms

* Rename prop for clarity

* Return instead of throwing

* Use Lib.rawNativeQuery

* Pass selected text to native editor

* Fix types

* Move longer handlers to hooks in utils

* Handle empty text and reshuffle code
2025-09-16 15:36:49 +10:00
Aleksandr Lesnenko
5b450f29aa support value and goal column selection in progress visualization (#62963)
* progress bar: support value and goal column selection

* design feedback

* fix spacing

* BE review

* FE review

* spec
2025-09-16 04:16:13 +00:00
Nathan Voxland
dbc6913076 Reindex has to be async on language change callback (#63531) 2025-09-16 03:27:35 +00:00
Cam Saul
c1a3971ae8 add-implicit-clauses middleware => Lib (#63360)
* add-implicit-clauses middleware => Lib

* Test fixes 🔧

* Some lib.convert fixes from #61398

* Test fixes 🔧

* More test fixes

* Test fixes 🔧

* Handful of test fixes 🔧

* Discourage use of legacy MBQL utils in QP

* Integrate the platinum metadata provider

* Only one failing test left

* Test fix 🔧

* Kondo

* Test fixes 🔧

* Test fix 🔧

* Test fixes 🔧

* Handle legacy pivot viz settings where `base-type` might not be present

* Handle legacy pivot viz settings where `base-type` might not be present

* Handle legacy pivot viz settings where `base-type` might not be present

* Handle legacy pivot viz settings where `base-type` might not be present

* Handle legacy pivot viz settings where `base-type` might not be present

* Handle legacy pivot viz settings where `base-type` might not be present

* Handle legacy pivot viz settings where `base-type` might not be present

* Handle legacy pivot viz settings where `base-type` might not be present

* Handle legacy pivot viz settings where `base-type` might not be present

* Test fix 🔧

* Test fix 🔧

* Kondo

* Test fix

* Test fix 🔧

* Skip failing transforms tests

* Mark failing tests flaky
2025-09-15 19:35:54 -07:00
appleby
319fc114ab Update :bookmarked and :user_recency scorer to work with mysql and mariadb (#63205)
* Update :bookmark scorer to work with mysql and mariadb

* Update :user_recency scorer to work with mysql and mariadb
2025-09-15 18:43:22 -07:00
Alexander Polyankin
c456cb5a6f Disable failing transform tests (#63535) 2025-09-15 22:52:32 +00:00
Fraser
a743c86b25 Enable skipped implicit-join and breakout e2e tests (#63486) 2025-09-16 10:50:36 +12:00
Fraser
0348e0b3c3 Remove skipped pie chart label truncation e2e test (#63471) 2025-09-16 10:47:59 +12:00
Fraser
a32eeb88a2 Fix skipped time series binning e2e test (#63428) 2025-09-16 09:37:24 +12:00
Fraser
7ad5cdac94 Fix skipped notebook info popoever e2e tests (#63487) 2025-09-16 09:37:07 +12:00
Phoomparin Mano
0aa42f596f Integration branch for Embedding Hub (#62986)
* Setup sidebar and onboarding page for embedding hub (#62517)

* Add the add data and new dashboard modals to embedding hub (#62528)

* mark sandboxed step as done (#62758)

* Auto-mark 'secure your embeds' step as done when either JWT or SAML is configured (#62736)

Co-authored-by: Nicolò Pretto <info@npretto.com>

* Add UTM tags to documentation links in the embedding hub (#62747)

* Add a wizard to select a table to x-ray in embedding hub (#62715)

* Mark the create embed steps in embedding hub as done from embed flow (#62759)

* Add a dropdown to switch embedding solutions in embedding hub (#62870)

* fix(embed-hub): adds key prop to component passed to jt (#63060)

* feat(embed-hub): checklist endpoint (#62875)

* feat(embed-hub): EMB-770 and EMB-742, add checklist endpoint with
'create-dashboard'

* feat(embed-hub): EMB-740 auto mark "Add data" as done

* Revert "mark sandboxed step as done (#62758)"

This reverts commit be775aceed.

* feat(embed-hub): EMB-768 move sandbox check to the BE

* EMB-772: move all "done" checks on the be, move endpoints to ee

* cleanup

fmt

configure enterprise module to make linting pass

test: activate license to make e2e tests pass again

remove fe unit test now that all the logic is on the be

add doc to the endpoint to maybe the tests will pass?

whitespace?

fixes

idk anymore how to make all the linters be happy

last try

refactor has-configured-sso to a function

revert  visibility to see if tests pass

sort config.edn

* tests: remove cy.wait from embed hub tests (#63066)

* Bit of cleanup

- remove warn-on-reflection; there is no interop
- clean up a bit of duplication in sql clause generation
- remove unncessary try/catch around t2 access
- remove a few boolean calls on boolean functions

---------

Co-authored-by: dan sutton <dan@dpsutton.com>

* fix(embed-js): disable the next button when embedded js is disabled (#63134)

* Replace the accordion in embedding hub with steppers (#63271)

* Move embedding settings into its own top-level menu (#63339)

* Add related setting cards to modular embedding and setup guide (#63340)

* Remove the Embed menu from the New menu (#63385)

* Completing later steps on embedding hub should not tick off the former steps (#63393)

* Modular embedding toggle label should depend on toggle states (#63391)

* Add the interactive embedding upsell to the settings page (#63399)

* Lock embed in production step in embedding hub checklist until sso configured (#63449)

* Use ee plugins to check if embedding is enabled in nav (#63446)

* Check for CSV uploads in embedding-hub checklist endpoint (#63501)

* update embedded-analytics-js.md to have consistent quickstart pages

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: dan sutton <dan@dpsutton.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-09-15 22:27:57 +01:00
Brad Anderson
dd68df30c9 Fix: UXW-683 Saving document resets undo history (#63462)
Fixes issue where undo history is deleted on save. Also fixes issue where CommentsSidesheet stays open (big unclosable grey box) when navigating to a different document when it was open.
2025-09-15 16:19:52 -04:00
Jeff Bruemmer
af495f2ff3 elaborate on privacy (#63524) 2025-09-15 14:46:39 -04:00
Alexander Polyankin
c343eaa0a3 Fix flaky transform tests (#63523) 2025-09-15 14:36:33 -04:00
Ngoc Khuat
29c013a78a Add rename-tables! driver method (#63302) 2025-09-15 16:36:13 +00:00
Alexander Polyankin
a85675ef2a Fix some transform flaky tests (#63517) 2025-09-15 12:00:00 -04:00
Alexander Polyankin
8c1582e601 Fix metrics stats in anonymous tracking (#63507) 2025-09-15 15:28:29 +00:00
Jakub Chodorowicz
a7eacc1c96 PRG-138 fix mongo and sql server YAML setup (#63496)
* Move sqlserver description to extra info tooltip

* Fix mongo additional-options not appearing in advanced-options section

# Conflicts:
#	e2e/test/scenarios/admin/databases.cy.spec.js
2025-09-15 17:21:10 +02:00
Jakub Chodorowicz
6ab20070a4 PRG-137 add engine icons (#63491)
* Add new DB engine icons, add icon to regular add DB flow

* Refactor old export style

* update h2 icon

* Fix layout of browse databases cards

* Adjust padding of browse databases cards

* Remove empty comment

* Render default db icon in case of empty engine key
2025-09-15 17:18:18 +02:00
Alexander Polyankin
7bc2093651 Ignore new flaky transform tests until they are fixed (#63516) 2025-09-15 08:34:04 -06:00
Alexander Polyankin
fa9d4ad2a4 Make RTK queries populate metadata created by the getMetadata selector without using the entity framework (#63262) 2025-09-15 10:19:48 -04:00
metamben
ea74e4e1dc Fall back to DESCRIBE if Athena JDBC reports duplicate column names (#63452)
* Fall back to DESCRIBE if Athena JDBC reports duplicate column names

* Make test fail another way

* Fix test

* Verify that the hijacked function gets called
2025-09-15 10:51:27 -03:00
Fraser
1920cc924c Delete old skipped test (#63372) 2025-09-15 21:49:49 +12:00
Sébastien
df7ba12468 Closes EMB-791 custom pivot column title not being translated (#63436) 2025-09-15 10:23:13 +02:00
Romeo Van Snick
35f9175eb0 Hide empty breakout step in readonly notebook (#63367) 2025-09-15 14:28:50 +10:00
Fraser
eeab38518a Remove skipped Metabase Cloud e2e tests (#63417) 2025-09-15 10:57:54 +12:00
Fraser
bc7d55b0dd Remove field filter popover cutoff e2e test (#63418) 2025-09-15 10:57:25 +12:00
Alexander Polyankin
c5b5970b77 Handle legacy viz settings where base-type might not be present (#63468) 2025-09-13 02:14:00 +00:00
Nathan Voxland
c8982e0d1d Fixed lint error (#63460) 2025-09-12 21:42:48 +00:00
Aleksandr Lesnenko
3477b876a2 fix trend chart month cut off (#63453) 2025-09-12 21:08:21 +00:00
Alexander Polyankin
63a60230f1 Migrate the Revision entity to RTK query (#63440) 2025-09-12 17:08:12 -04:00
Jeff Bruemmer
b9838f7cf7 docs - embedding chat (#63259) 2025-09-12 16:32:36 -04:00
Nathan Voxland
c024186f79 Search Indexing Improvements (#63099) 2025-09-12 15:01:39 -05:00
Cam Saul
acbff0c969 ℳℯ𝓉𝒶𝒹𝒶𝓉𝒶 𝒫𝓇ℴ𝓋𝒾𝒹ℯ𝓇 𝒫𝓁𝒶𝓉𝒾𝓃𝓊𝓂 ℰ𝒹𝒾𝓉𝒾ℴ𝓃 (#63368)
* Metadata Provider Platinum Edition

* Revert some formatting changes

* Revert changes to QP tests

* Revert NOCOMMIT changes

* Fix missing ns alias

* Pull in missing changes from other branches

* Misc fixes and changes

* Fixes

* Fix bugs in JVM metadatas

* Fix composed provider not propagating inactive

* JS fixes 🔧

* Test fix 🔧

* Test fixes 🔧

* Test fixes 🔧

* Another JS test fix 🔧

* More FE fixes 🔧

* Don't be too strict

* Set database

* Fix merge conflict

* Fix kondo

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-09-12 18:46:03 +00:00
Jeff Bruemmer
75d56ef281 docs - rename file (#63451)
* rename file

* links
2025-09-12 18:20:26 +00:00
Jeff Bruemmer
d2b1aadf84 docs - docs (#63413) 2025-09-12 13:49:04 -04:00
Ryan Laurie
f07baad1f8 add environment var to disable embedding builds (#63441) 2025-09-12 10:40:59 -06:00
Cam Saul
eecf97f077 Sandboxing middleware => Lib (#63321)
* Sandboxing middleware => Lib

* Test fix 🔧

* Remove some unused stuff

* rename `row-level-restricitions` middleware => `sandboxing`

* Remove TODO

* :model/GroupTableAccessPolicy => :model/Sandbox

* Test fixes 🔧

* Test fix and mark more stuff deprecated

* Test and Kondo fixes 🔧

* "Fix" sandboxes with extra columns because I don't want to update e2e tests

* cljfmt
2025-09-12 09:34:57 -07:00
Alex Yarosh
4768c58a01 docs - add modular embedding to securing embeds (#63444)
* docs - add modular embedding

Also adjust headers a bit because ToC is difficult to scan

* Update docs/embedding/securing-embeds.md

* Update docs/embedding/securing-embeds.md
2025-09-12 16:16:44 +00:00
github-automation-metabase
84530c5a58 Update generated docs (master) (#63421)
Co-authored-by: github-actions <github-actions@github.com>
2025-09-12 12:16:07 -04:00
Ryan Laurie
0d1522742e Make question moving errors bubble correctly (#63409)
* make sure errors bubble correctly

* e2e tests

* fix test
2025-09-12 09:48:37 -06:00
Brad Anderson
2fcecd5de8 Fix: UXW-606 Bookmark drag and drop handle shown when there's nothing to rearrange (#63358)
* UXW-606 Hides bookmark drag handle when there's only one bookmark

* UXW-606 Adds unit tests
2025-09-12 10:25:58 -04:00
Riley Thompson
9164ad955e Disable transforms when db routing is enabled (#63402)
* disable transforms with routing

* disable selecting dbs with routing enabled
2025-09-12 09:32:35 -04:00
Sébastien
293120750e Closes EMB-792 dashcard title and description translation (#63432) 2025-09-12 14:26:59 +02:00
Anton Kulyk
b8b61d0647 Update "Customize Homepage" modal UI (#62280)
* Update "Customize Homepage" modal UI

* Update tests

* Reset selected dashboard on "Cancel" btn click

* Fix button name in test
2025-09-12 13:23:08 +01:00
Anton Kulyk
e4744ae67f Always use "public" schema for x-rays if it exists (#62285)
* Always use "public" schema for x-rays if it exists

* Handle null schema

* Fix type error
2025-09-12 13:13:00 +01:00
Nemanja Glumac
aa59dca84e Make "database" the first option in the "Add data" modal (#63412) 2025-09-12 10:52:22 +02:00
Cam Saul
5f5b2f6d07 Minor lib.convert fixes (#63401)
* Some lib.convert fixes from #61398

* Fix conversion of :dimension pseudo-clauses

* cljfmt
2025-09-11 20:12:13 -07:00
Cam Saul
40420f8d44 Test to confirm #63261 is fixed in master (#63414) 2025-09-12 03:11:34 +00:00
Cam Saul
34bddeb931 Normalize horribly broken fingerprints (#63407)
* Normalize horribly broken fingerprints

* Handle nil fingerprints
2025-09-12 03:02:09 +00:00
github-automation-metabase
16daec0315 Bump com.github.seancorfield/next.jdbc from 1.3.1048 to 1.3.1070 (#63220)
Inspect dependency changes here: https://github.com/seancorfield/next-jdbc/blob/v1.3.1070/CHANGELOG.md
2025-09-12 02:38:10 +00:00
github-automation-metabase
5caa919d59 Bump nrepl/nrepl from 1.3.1 to 1.4.0 (#63222)
Inspect dependency changes here: https://github.com/nrepl/nrepl/blob/v1.4.0/CHANGELOG.md
2025-09-12 02:22:22 +00:00
github-automation-metabase
69bda6feef Bump babashka/fs from 0.5.26 to 0.5.27 (#63216)
Inspect dependency changes here: https://github.com/babashka/fs/blob/v0.5.27/CHANGELOG.md
2025-09-12 02:18:39 +00:00
github-automation-metabase
cb1c25d58b Bump io.github.metabase/hawk from 1.0.11 to 1.0.12 (#63221)
Inspect dependency changes here:
2025-09-12 02:12:07 +00:00
Anderson
d998df052e [PRG-114] Show help & more specific error message when a database connection fails (#62956)
* Implement new DatabaseFormError component & break DatabaseForm component down

* Implement scrolling actions / Avoid 'div in p' console error

* Fix typing check issues / Add 'Read the docs' link url

* Define 'invite teammate' and 'contact support' urls

* add more tests / further refactoring

* css tweaks

* Simplify tests a bit

* Remove comment / Fix translation cases

* Refactor tests

* Adjust 'Check Host and Port settings' button / Fix css lint

* Fix test

* Add target=_blank to doc links / Use existing color for the error container border

* Use cloud-gateway-ips setting when showing IPs to whitelist / Move some helpers to a local utils.tsx

* Use 'be.visible' over 'exist' in cypress test

* Use useDisclosure

* Make Alert title have dark text color by default / Add storybook case to show warning color variant
2025-09-11 22:07:06 -03:00
Fraser
ce15cfeea9 Mark pagination test as flaky (#63328) 2025-09-12 10:54:50 +12:00
Ryan Laurie
a10afa8256 Deprecate old Alert (#63408) 2025-09-11 21:22:34 +00:00
Alex Yarosh
daca8d6c4e docs: translations are case-insensitive (#63383)
* docs: translations are case-insensitive

* Update docs/embedding/translations.md

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>

* Add localization details for embedded Metabase

Added section on localizing embedded Metabase.

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-09-11 17:09:35 +00:00
Timothy S. Dean
80d6389e6e Handle mixed catalog table errors in Trino sync (#63356)
Trino's Hive plugin shows the tables in question in its metadata, but if you try to get a handle on these tables, it will always throw an exception with error code `UNSUPPORTED_TABLE_TYPE`. The Iceberg plugin has a similar exception for such circumstances.

For us, there doesn't seem to be much difference between not being able to query a table because it's an unsupported type and not being able to query because we don't have permissions, so`have-select-privilege?` is modified to return false in these cases. We can examine the vendor-specific error code on the SQLException to detect them.
2025-09-11 09:53:04 -06:00
Kamil Mielnik
7f723a20de Document Comments (#62800)
* Update Start new thread UI

* Refactor

* Lint migrations

* Lint migrations

* Lint

* Fix comments count

* Thread submit input improvements

* Align 'Start new thread' button

* mention metabase entities

* Stupid link copying

* Deep linking to comments

* fix: sidebar style improvements

* Fix line breaking bug on submit

* Maz Comments styling tweaks (#62964)

* add tabs hiding/showing logic

* only show persistent button for open comments

* move comment buttons to the right

* attempt to fix tests

* always display the add-a-comment input in the sidebar

* Remove unused attr

* Placeholders without flags

* Refactor comments' tabs markup

* Refactor CommentsMenu

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Stas Gavrylov <stasgavrylov@gmail.com>

* Fix incorrect counter for unresolved comments

* Fix warning

* Fix key warning in Discussions

* Make document read-only when comments sidebar is open

* Refactor URL generation

* Automatically open correct tab for the comment targeted by URL hash

* Clean up

* Use createPortal instead of Portal from metabase/ui to fix CommentsMenu appearing above CommentsSidesheet when visiting a specific comment via URL

* Remove more/less feature

* Set max-height when editing comments, fix scrolling area

* Extra padding

* Make it possible to mention yourself

* Add ability to resolve deleted threads

* Remove ability to comment on resolved threads

* Remove ability to add new comments on Resolved tab

* allow using @ character without showing mention list

* Fix type errors

* Fix types

* Resolve/unresolve deleted comments

* Remove DocumentContext

* Fix inserting mentions on Enter press

* Minor styling fixes for mentions

* Remove unused endpoint

* Clean up

* Remove unused component

* Remove stories

* Fix storybook

* Remove TODO

* Remove unused file

* Remove outdated comment

* Avoid cast

* Remove redundant code

* Deal with any

* Don't trim empty nodes

* Simplify Discussions component

* Align avatar, submit button and code editor

* Do not show last divider if not necessary

* Get rid of currentIndex

* Fix typo

* Remove hack

* Check only unresolved comments when deciding whether to autofocus comment editor when sidebar opens

* Enable inline_code styling in comments

* Rename css file

* Fix cast

* Use top instead of transform

* Use a flag

* Remove commented-out code

* Move getCommentsUrl to utils

* Use Menu

* Add Avatar to metabase/ui

* Bring back accidentally removed code

* Resolve CSS duplication

* Use void

* Add comment

* Add all comments sidebar

* Use createSelector

* Fix no results styling

* Autofocus editor when editing comments

* Disable menu when editing is disabled

* Add a toast when copying the link

* Prevent deleting and editing someone else's comments

* Fix types

* Update copy

* Cleanup all comments sidebar

* Extract isMetabotBlock

* Use CustomStarterKit

* Copy

* feat: add Emoji picker (#62991)

* feat: add Emoji picker

* fix: styles

* fix: class for loading label

* Add ability to inline emojis in CommentEditor

* fix: keyboard events for emoji picker

* fix: focus visible for emoji picker viewport

* Implement proper keyboard support for inline emojis

* Temporarily hide emoji reaction button

* Improve UX around selecting first emoji

---------

Co-authored-by: Stas Gavrylov <stasgavrylov@gmail.com>

* Pass editable

* Use mentions plugin

* Fix z-index

* Add reactions BE

* Improve list paddings

* Add users support to SmartLink and MentionExtension

* Remove old mentions

* use semantic colors for Avatar

similar logic to what do for users in admin

* show add comment input when we switch from resolved tab

* Limit number of user results

* feat: add comment reactions (#63072)

* feat: add comment reactions

* fix: typescript

* fix: click to react

* fix: styling

* tweak spacing between replies (#63100)

* fix: reply styles

* Update submit shortcut to Cmd-Enter. Fix emoji picking behavior

* fix: do not close discussion sidesheet on some escape events

* fix: cancel editing on escape press

* Make DocumentPage 400px narrower when comments modal is opened

* Extract shared tiptap-related code

* Move EmojiPicker to common/components

* Fix DiscussionComment error when creator is null

* Fix missing formatting menu in CommentEditor

* Add tests boilerplate

* Allow many reactions on a comment

* Hydrate creator info on deleted comments

* Add first test and helpers

* Add tests for more types of nodes

* Add comment

* Improve test name

* Test highlighting

* Add test for splitting paragraphs

* fix: blur comment editor on submit

* Add schema upgrade test

* Add test for creating comments and threads

* Add tests for deleting comments

* Editing a comment

* Test for Esc

* fix: limit editable functionality and add comment styles (#63161)

* Fix test

* Update test

* Fix flaky test

* Fix tooltip

* fix: do not react on deleted comments

* fix: show resolved threads

* fix duplicate replies display

* Add mentions tests

* Make suggestions taller to accommodate users search results without a vertical scrollbar

* don't count deleted comments for the comment badge

* don't show threads if all comments deleted

* Add emoji tests

* fix: can react true by default

* Fix floating menu positioning in CommentEditor

* fix document / menu selected item styling

* Sort comment reactions by created_at ASC

* Make Esc close emoji popup

* first pass at comments api

* Fix reactions ascending order

* WIP

* fix linting

* model resolution

* update test setup to include _id, so equality check works correctly

* replace is_deleted with deleted_at to detect deleted comments

* fix types

* remove ?new=true from url after adding a new comment

* Fix tests

* Improve arrow navigation when emoji popup is opened. Allow selecting with Tab

* Add test

* Refactor

* Update test

* Fix emoji popup Esc handler removal

* Add formatting tests

* Rename test

* Add e2e API helpers to create and delete comments

* Update test name

* Refactor

* Fix types

* update is not deleted eh

* Add test for the comment button

* Add test

* Add a test

* Add test

* test: basic resolve/unresolve tests (#63243)

* test: add resolve other person thread test

* Add test for disabling document editing when comments are open

* Add test for unsaved document changes

* Add test for show all comments button and fix the issue

* Add tests for deleting/editing other people's comments

* Add e2e tests for comment links

* add e2e tests for all comments

* way better/less verbose permission checks

* test: cannot reply to resolved threads

* ESLint

* Update assertion

* Fix unresolved comments count

* e2e tests for comments reactions

* first iteration of notifications

* fix migration lint errors

* fix module tests

* Add label attribute for SmartLinks to simplify server-side notifications rendering

* add e2e test for removing ?new=true after creating a comment

* Fix

* fix clj syntax

* Remove commented-out code

* Use H.readClipboard()

* Refactor

* Update reaction icon

* Move util

* Lint

* Fix

* Lift conditional rendering, move Reaction component to a separate file

* Refactor

* Do not render invalid links

* Refactor

* Update new comment notification template

* add e2e test for top blocks

* fix: comment date to respect browser locale

* Update reactions icon

* Add 1st test for email subscriptions

* Update email template to match figma, remove the comment content

* Add document icon to email template

* Update test

* Remove protocol from the link

* Extract verifyEmail helper

* fix migrations because mysql is majorly unhappy about those rollbacks

* correct urls for comments, notifications on mentions

* Update assertion

* Insert both comment URL and document URL into the email template

* Fix url

* fix copy tests

* Add a setup for next test

* Implement assertions

* 2nd email variant

* Add another test

* Add an assertion

* add more tests for email template

* Ignore whitespace

* Error handling for mutations - toasts

* add more tests

* feedback: drop blue border from paragraph

* feedback: placeholder

* fix e2e test to pass

* Update setup

* Comments design polish (#63352)

* use new Send icon instead of up_arrow

* remove extra space below a Discussion

* restyle Discussions

* fix CommentEditor spacing

* restyle current user reaction

* only show No Comments message on the All Comments sheet

* add on-hover highlighting for All Comments section

* fix for fe-type-check

* fix test

* Cleanup

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>

* put user permissions check back and new api for mentions

* pagination

* Use new GET /api/ee/comment/mentions in frontend

* Use new GET /api/ee/comment/mentions in smart link node

* paid feature in tests

* seed notifications

* oh

* clj-kondo 🤦

* port numbers

* Try to fix flaky test

* attempt to fix flaky e2e

* disable returning users for mentions

* disable mention related tests

---------

Co-authored-by: Stas Gavrylov <stasgavrylov@gmail.com>
Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>
Co-authored-by: Konstantin Darutkin <spalt08@mail.ru>
Co-authored-by: Maz Ameli <maz@metabase.com>
Co-authored-by: Uladzimir Havenchyk <uladzimir@metabase.com>
Co-authored-by: Oleksandr Solovyov <o@solovyov.net>
2025-09-11 22:09:54 +07:00
Aleksandr Lesnenko
179d170826 fix question title layout (#63348)
* fix question title layout

* fix dashboards as well
2025-09-11 10:32:34 -04:00
Aleksandr Lesnenko
b263bd0bc0 fix missing tooltip max width (#63353)
* fix missing tooltip max width

* repro
2025-09-11 10:32:25 -04:00
Aleksandr Lesnenko
4e851e0e19 fix date picker month navigation timezone issue (#63366) 2025-09-11 10:32:15 -04:00
Braden Shepherdson
8ac41c91d2 [ClickHouse] Fix SQL for equality filters on UUID columns (#62922)
Fixes #62492.

A literal UUID was reaching the driver as
`[:value "uuid-string" {:base_type :type/UUID}]`
but this was not recognized as a UUID-valued field because `:value`
clauses have `:base_type` and not `:base-type` like `:field` clauses.

Therefore the `:sql` core driver was rewriting this clause to cast the
UUID field to a string and compare that against the literal string.
With that logic now correctly recognizing such a `:value` clause, the
UUID fields are compared directly. This is much better for indexing,
but also works with *nullable* UUID columns, where the
`CAST(my_uuid AS text)` would cause SQL compilation errors.
2025-09-11 13:59:39 +00:00
lbrdnk
7a122eefd4 Better test isolation for semantic search and related refactor (#63164)
* Make with-index! use new, clean, separate database per test

* Add with-test-db! setup modes

* Comment

* Adjust with-test-db! and related

* Drop with-index! in favor of modal with-test-db! in first test

* semantic.tu/db removal

* Drop use of semantic.tu/db in favor of get-pgvector-datasource!

* Drop semantic.tu/db  from tu

* Remove once-fixture

* Remove ensure-no-migration-table-fixture

* Comment

* Comment

* Cleanup

* Make the rest of the query-test ns use with-test-db!

* Remove redundant test

* Remove remaining usage of with-index!

* Drop remnants of with-index! and make linter happy

* Cleanup

* Comment

* Remove with-mock-index-metadata! in favor of with-temp-db!

* Adjust with-index-contents!

* Fixture to avoid running app-db tests

* Fixture

* Require

* whitespace
2025-09-11 14:11:06 +02:00
Nicolò Maria Mezzopera
f74d718df9 Fix perf test workflow to build uberjar before running tests (#62106)
Problem: Perf tests were failing because they couldn't find the uberjar artifact.
The wait_for_uberjar mechanism was trying to wait for a job named 'build (ee)'
but the actual job name is 'Build MB ee'. Additionally, this wait mechanism was
unnecessary complexity.

Solution: Align with pr-env-labeled.yml pattern:
1. Build uberjar first when 'Run-perf' label is added
2. Run perf test after uberjar is built
3. Remove unnecessary wait_for_uberjar mechanism

Changes:
- perf-test-labeled.yml: Add uberjar build job before running perf test
- perf-test.yml: Remove wait_for_uberjar parameter and 56-line wait mechanism

This simplifies the workflow and ensures the uberjar artifact exists before
the perf test tries to fetch it, following the same proven pattern used by
pr-env-labeled.yml.

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-11 13:55:21 +02:00
Sébastien
8ac41c5b91 Closes EMB-756 translations for static embedded visualizer cards (#63067)
* Closes EMB-756 translations for static embedded visualizer cards

* Closes EMB-757 content translated pie loses custom colors

* unit test

* types

* renaming

* better type guards
2025-09-11 12:49:30 +02:00
Oleksandr Solovyov
cffe9615c6 update athena driver to 3.6.0 (#63369) 2025-09-11 12:24:46 +03:00
Jakub Chodorowicz
4ba3309c4c update Metabot AI terms link (#63370) 2025-09-11 10:46:28 +02:00
lbrdnk
9c712173ce Fix test issues in semantic search module (#63319)
* Make dataset-query->dimensions more robust

* *disable-updates*

* Add macro impls for easier debugging

* Make dataset-query->dimensions more resilient

* Whitespace
2025-09-11 10:14:39 +02:00
Nathan Voxland
71f2b73e51 Avoid null names in semantic search document (#63331) 2025-09-10 16:22:17 -05:00
Aleksandr Lesnenko
d5e806325e fix table search crash when pressing enter without any table selected (#63357) 2025-09-10 17:18:15 -04:00
Cam Saul
09b2346c6a Sweep #62591 under the rug (#63325)
* Another #62591 fix

* Fix conditional syntax

* Fix typo
2025-09-10 17:16:29 -04:00
Riley Thompson
cf5e3ed830 Upgrade clickhouse jdbc driver to 0.9.2 (#63349)
* upgrade clickhouse jdbc driver to 0.9.2

* remove comments

* update tls test details
2025-09-10 16:19:51 -04:00
Filipe Silva
51140fce2e fix: don't ignore db sync/rescan promise (#63301)
* fix: don't ignore db sync/rescan promise

When the call returns non-200, the button still says it's fine instead of showing a failure.

You can test this by trying to sync "Metabase Cloud Storage" DWH.

See https://metaboat.slack.com/archives/CKZEMT1MJ/p1749830993738189

* add unit tests

* fix mocks

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-09-10 19:14:18 +00:00
Ryan Laurie
7b5a4436e7 mark transform test flaky (#63343)
* mark transform test flaky

* quarantine the right test
2025-09-10 12:37:48 -06:00
Ryan Laurie
f85364f530 Fix stray bracket in version-info (#63342)
* fix stray bracket

* 🤦‍♀️
2025-09-10 12:17:58 -06:00
Cam Saul
63d6945498 optimize-temporal-filters middleware => Lib (#63275)
* optimize-temporal-filters middleware => Lib

* Fix circular dependencies

* Test fix 🔧

* Don't deprecate negate-filter-clause yet for drivers

* Oracle test fix 🔧

* cljs test fix 🔧
2025-09-10 08:15:53 -07:00
Konstantin Darutkin
e539ba98ce fix: do not display value in options when editing FKs (#63332) 2025-09-10 15:28:08 +03:00
Jeff Bruemmer
926b5ea393 update placeholder copy (#63311) 2025-09-09 23:42:08 +00:00
Maz Ameli
00aca4b873 add tooltip to clear-conversation action (#63309) 2025-09-09 16:15:12 -07:00
appleby
e4f11aba66 Ensure results are realized when falling back to in-place results in semantic search (#63254)
* Ensure results are realized when falling back to in-place results in semantic search

Unlike the semantic and appdb backends, the in-place backend returns a reducible result set from
search.engine/results. Make sure we realize the results before attempting to pass them to `m/indexed-by` to dedup
them. This avoid a "Don't know how to convert reducible to ISeq" exception when falling back to in-place results.

* Add comment
2025-09-09 15:49:34 -07:00
Cam Saul
70e31de9a0 add-default-temporal-unit => Lib (#63276) 2025-09-09 10:21:31 -07:00
Cam Saul
cd9ebca53a Don't add remaps from join columns that aren't in join :fields (#63193)
* Fix #63165

* Kondo

* Test fix 🔧
2025-09-09 09:04:20 -07:00
Timothy S. Dean
9dab171530 Adjust clj-kondo linter to allow keyword flags in require (#63277)
Clojure MCP runs the linter on all REPL code and aborts on any errors.
2025-09-09 08:51:46 -06:00
Timofey Kachalov
0e42be1914 feat(sdk): Use zod schemas to validate exposed from SDK bundle Components and their props (#63188) 2025-09-09 17:21:14 +04:00
dpsutton
e1f6606ba2 Faster sync when adding new table (#63268)
want to check that the new table exists before adding it into the
app-db. The old way worked for all databases but is pretty dumb: it
enumerates all tables in the db (as it would for regular sync) and then
checks if the new table is in there.

We can be better with the `driver/table-exists?` function.

The shape of data coming back from describe-data is the following:

```clojure
notify=> (let [database (toucan2.core/select-one :model/Database :id 1)]
           (driver/describe-database :h2 database))
{:tables #{{:name "ORDERS",
            :schema "PUBLIC",
            :description nil,
            :is_writable true}
           {:name "PEOPLE",
            :schema "PUBLIC",
            :description nil,
            :is_writable true}
           {:name "FEEDBACK",
            :schema "PUBLIC",
            :description nil,
            :is_writable true}
            ...
```

So we can create the same shape (i omit description and is_writable to
seemingly no deleterious effect).
2025-09-09 08:18:55 -05:00
Timofey Kachalov
a0243ff3a4 ci(sdk): Skip sdk-bundle test suite for backward-compat SDK tests (#63291) 2025-09-09 16:30:08 +04:00
Konstantin Darutkin
f2d1f9f93d fix: display error messages from BE in Editable Data settings (#63288) 2025-09-09 12:09:47 +00:00
Konstantin Darutkin
71f02e8684 fix: disable row edit button when rows are selected (#63290) 2025-09-09 10:26:15 +00:00
Timofey Kachalov
7a90868ef9 refactor(sdk): Adjust logic of handling release-notes/changelogs for Embedding SDK (#63081) 2025-09-09 12:24:29 +04:00
Timofey Kachalov
48971b48eb feat(sdk): Add "start new conversation" button for MetabotQuestion and adjust its visuals (#63211) 2025-09-09 11:11:21 +04:00
Cam Saul
169f3f79e3 reconcile-breakout-and-order-by-bucketing middleware => Lib (#63267)
* reconcile-breakout-and-order-by-bucketing => Lib

* Fix test name 🔧
2025-09-08 17:25:30 -07:00
Romeo Van Snick
908eda55b5 Pass validation errors to create dashboard modal (#63241)
* Handle error when creating dashboard

* Add repro for metabase#63176

* Use unwrap
2025-09-08 23:49:03 +00:00
Romeo Van Snick
2365a169e4 Avoid losing work when closing custom expression from shortut (#63232)
* Pass initialClause to expression editor

* Reset initial to true when we are formatting the initial expression clause

* Add repro for metabase#63180
2025-09-09 08:56:09 +10:00
dpsutton
aca75bee72 partition field syncing by schemas (#63192)
reports that a customer has around 200k tables spread across 300
schemas. the fields query by default would just get a single cursor into
these fields, passing all schema into the query.

This can take quite a long time. Our own horror show schema would take
~45 minutes to sync. But holding a cursor open this long just seems to
invite bad times.

I've taken the logic and just called it multiple times, once per schema.
2025-09-08 13:34:45 -05:00
github-automation-metabase
3eb696e22b Update generated docs (master) (#63229)
Co-authored-by: github-actions <github-actions@github.com>
2025-09-08 13:35:50 -04:00
Alexander Polyankin
60da15bf27 Transform list cleanup (#63208) 2025-09-08 13:32:48 -04:00
Noah Moss
3b3e5f91d6 Fix semantic search repair test flake (#63195)
* Use unique doc IDs across semantic search repair tests to fix flakes

* clear gate table before test

* try switching out table name generation
2025-09-08 12:33:29 -04:00
Jeff Bruemmer
0fcff349d1 note on custom expressions (#63249) 2025-09-08 12:08:55 -04:00
Riley Thompson
f8a66a7470 remove use database from snowflake transforms (#63199) 2025-09-08 16:05:57 +00:00
Riley Thompson
4672ea6c34 handle dbrefs properly (#63244) 2025-09-08 10:05:18 -06:00
Konstantin Darutkin
73e4ba5bd8 test: refactor datetime table editing tests (#63239) 2025-09-08 18:47:54 +03:00
Chris Truter
f09dbce65d Protect against nil search_vector (#63172)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-09-08 11:51:38 +02:00
Stas Gavrylov
dabaa3007e WRK-874: List view preview improvements (#63159)
* WRK-874: Populate preview for List View customization with sample values

* WRK-874: Set default and min size for list view on dashboard

* WRK-874: Fix List view card size on the dashboard

* WRK-874: Add e2e test for empty column placeholder

* Fix lint errors

* Add horizontal padding for List view

* Refactor generatePreviewSample
2025-09-08 07:58:43 +00:00
Fraser
00fb1c3841 Dev 780 Provide issue comments by employees to Claude Code (#62476) 2025-09-08 11:30:13 +12:00
Fraser
e7fd61a386 Ensure flaky tests are tagged as flaky (#63157) 2025-09-08 11:02:02 +12:00
github-automation-metabase
a17971e449 chore(sdk): Update published npm version to 0.57.0-alpha.2 (#63210) 2025-09-06 12:28:31 +00:00
Romeo Van Snick
02390555ba Fix join step alignment (#63120)
* Stretch join data sections when needed

* Tweak padding to avoid jump

* Center 'on' in join condition

* Make gap consistent

* Tighten margins to avoid jump

* Tweak padding to make all wells the same height
2025-09-06 15:17:36 +10:00
Riley Thompson
20577becba Include transform dependencies that have not been run yet (#62884) 2025-09-06 04:21:10 +00:00
Nicolò Pretto
4c3656a57b fix(embed-js): bar charts no longer change scale when props change (#63182)
* fix(embed-js): bar charts no longer change scale when props change

* spec

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2025-09-05 23:23:40 +00:00
appleby
cca17f5f4d BOT-310 lower the weight on the :rrf score for semantic search results (#63102)
* BOT-310 lower the weight on the :rrf score for semantic search results

This seems to give a better blend between the :rrf score coming from the semantic search hybrid query and the other
post-search metadata scorers.

* Add with-weights and with-only-semantic-weights test util macros

* Use semantic.tu/with-weights in scoring tests

* Update query tests to use semantic.tu/with-only-semantic-weights

This prevents other metadata scorers from overriding the expected rankings for these tests. The query tests are
largely focused on making sure the basic machinery of semantic queries are working. Tests exercising individual
scorers are in scoring_test.clj

* Add tests for :official_collection and :verified "premium" scorers
2025-09-05 15:49:18 -07:00
github-automation-metabase
f74de7e31e Bump com.google.cloud/google-cloud-bigquery from 2.54.1 to 2.54.2 (#62974)
Inspect dependency changes here: https://github.com/googleapis/java-bigquery/blob/v2.54.2/CHANGELOG.md
2025-09-05 15:17:21 -06:00
Jeff Bruemmer
cb946d095d Update development instance documentation for clarity (#63201) 2025-09-05 21:08:14 +00:00
github-automation-metabase
c4ed3cac1d Bump net.snowflake/snowflake-jdbc-thin from 3.26.0 to 3.26.1 (#62976)
Inspect dependency changes here:
2025-09-05 21:02:29 +00:00
github-automation-metabase
2e184e6c48 Bump org.clojure/clojure from 1.12.1 to 1.12.2 (#62973)
Inspect dependency changes here: https://github.com/clojure/clojure/blob/clojure-1.12.2/changes.md
2025-09-05 14:47:03 -06:00
github-actions[bot]
71f7fe60f1 Fix: No drill-thru to filter a table by clicking a NULL FK value (#62569)
Fixes #35561

We currently don't allow filtering on null foreign key values, but that is a reasonable thing to want to do.  This extends the foreign key drill to support null values.

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

Co-authored-by: Claude Code[bot] <noreply@anthropic.com>
Co-authored-by: William Zimrin <william@metabase.com>
2025-09-05 20:31:44 +00:00
William
c80fea1587 Native Query Snippet Params (#62283)
Native query snippets get parameterization, using familiar `{{...}}` syntax. Snippets can use other snippets.
2025-09-05 20:05:57 +00:00
github-automation-metabase
50cb92e548 Bump org.apache.arrow/arrow-memory-core from 17.0.0 to 18.3.0 (#62654)
Inspect dependency changes here:

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-09-05 19:50:54 +00:00
github-automation-metabase
b5f5624007 Bump io.netty/netty-common+buffer from 4.2.3.Final to 4.2.4.Final (#62262)
* Bump io.netty/netty-common from 4.2.3.Final to 4.2.4.Final

Inspect dependency changes here:

* typo

---------

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-09-05 19:11:25 +00:00
github-automation-metabase
b514c93c50 Update generated docs (master) (#63153)
Co-authored-by: github-actions <github-actions@github.com>
2025-09-05 15:05:21 -04:00
github-automation-metabase
f9614edfdf Bump djblue/portal from 0.60.2 to 0.61.0 (#62643)
Inspect dependency changes here: https://github.com/djblue/portal/blob/0.61.0/CHANGELOG.md
2025-09-05 18:52:29 +00:00
github-automation-metabase
21325c4366 Bump com.facebook.presto/presto-jdbc from 0.293 to 0.294 (#62975)
Inspect dependency changes here:
2025-09-05 12:28:17 -06:00
github-automation-metabase
b37c60a342 Bump org.apache.sshd/sshd-core from 2.15.0 to 2.16.0 (#62647)
Inspect dependency changes here:
2025-09-05 12:11:21 -06:00
lbrdnk
4a01316597 Ensure thread performing migration finishes first (#63184) 2025-09-05 16:55:55 +00:00
Sébastien
eb474fbf52 Closes EMB-779 content translation is now case insensitive (#63171) 2025-09-05 17:49:05 +02:00
Sébastien
d90fcce25b Closes EMB-780 selected cell color in embedding dark mode (#63163) 2025-09-05 17:48:41 +02:00
github-automation-metabase
9733cd683a Bump net.thisptr/jackson-jq from 1.4.0 to 1.5.0 (#62646)
Inspect dependency changes here:

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-09-05 15:27:35 +00:00
github-automation-metabase
8462072dfd Bump io.github.metabase/hawk from 1.0.7 to 1.0.11 (#62644)
Inspect dependency changes here:

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-09-05 15:27:18 +00:00
Riley Thompson
c482aa6f03 Create schemas if needed for transforms (#62786)
* Unpolished WIP hackathon code for additional driver support

* fix kondo

* add transforms/table featuer for supported drivers

* fix transforms for dbs with no schema

* rename transform datasets to prevent foreign key overlap

* Add clickhouse support

* fix clickhouse tests

* fix redshift tests

* fix bigquery failures

* kondo and filter tests by feature

* fix transform dataset for bigquery

* fix sqlserver transforms with joins

* fix clickhouse order by when no non nullable field is available

* add more complex test with join, filter, aggregation and ordering

* use different metadata provider

* filter for left join feature in test

* improve sqlserver compile-transform

* done use legacy mbql in test, refactor normalize-name

* clean up

* add sqlserver error test

* Squashed commit of the following:

commit a11b602e19
Author: Romeo Van Snick <romeo@romeovansnick.be>
Date:   Thu Aug 21 17:44:13 2025 +1000

    Add message when a new transform will be created

commit 2cfdbfaba3
Author: Romeo Van Snick <romeo@romeovansnick.be>
Date:   Thu Aug 21 17:37:36 2025 +1000

    Allow creating values in schema form select

commit 17ff4dcb3f
Author: Romeo Van Snick <romeo@romeovansnick.be>
Date:   Thu Aug 21 16:51:13 2025 +1000

    Allow selecting schemas always, not only when there are schemas

* create schemas

* fix redshift

* add snowflake

* add sqlserver

* add clickhouse

* add bigquery

* Add test

* add default impl

* fix redshift tests

* Move SchemaFormSelect to components folder

* Allow creating schemas in the target update modal

* Allow initial value in SchemaFormSelect

* Only render schema field when the database supports :schemas

* Do not render new schema item if value is empty

* Add unit tests for SchemaFormSelect

* Add e2e tests for schema creation

* check schema exists first

* fix sql jdbc schema exists and add create schema permissions test

* update changelog

* parse query and add into for sqlserver

* add type hints for linter

* Address comments

* realize bigquery execute-raw-queries

* Disable target schema link if it does not exists (yet)

* Add tooltip when schema is new

* Use hydrated table from transform

* Add e2e tests

* Allow existing schema link to render as enabled even when table does not exist yet

* Do not add default to databaseId

* Add tests for existing schema with new table

* Fix e2e test

* address comments

* rename connection-details to conn-spec

* Compare against null not empty string

* use find first

* Await request to avoid flakiness in hover

---------

Co-authored-by: Timothy Dean <timothy@timothydean.dev>
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-09-05 11:17:51 -04:00
metamben
c621b64c2f Add last_run, next_run and tag id filters (#62993)
* Add last_run, next_run and tag id filters

Closes QUE-2156

* Placate kondo

* Test with scheduled jobs and filtering by tags

* Fix next_run_start_time test

* Return run timestamps as timezone localized strings

* Handle Zulu

* Prepare job list table for next_run and transforms

* Add JobListParams type and use it in getJobListUrl

* Add new parameters to listTransformJobs handler

* Parse params and pass them down on job list page

* Add filters to job list page

* Add tooltipPosition prop to Icon

* Add TimezoneIndicator component

* Allow rendering React nodes in table headers

* Add timezone indicators to job list and transform list

* Add timezoneToUTCOffset helper

* Add timezone to cron explanation

* Format timestamps as ISO-8601 strings with timezone

* Add next run timestamp

* Hide transform count in list for now

* Add next_run to TransformJob

* Add timezone indicators to run list

* Avoid wrapping timestamps in run list

* Move shared widgets to transforms/components

* Allow passing available shortcuts to filter picker

* Disable shortcuts that are in the past for Next run, which is always in the future

* Add e2e test for filters

* Add UTC offset in tests

* Report run timestamps in UTC and expose system timezone

The system timezone is exposed in /api/session/properties as "system-timezone".

* Expose system-timezone to admins only

* Fix setting docstring

* Fix serdes baseline-comparison-test

* Make transform_job API return run timestamps in UTC

* Placate kondo

* Timezone

* Use system-timezone instead of report-timezone

* Add tests

* Fix test string

---------

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-09-05 15:11:26 +00:00
github-automation-metabase
9275b7fb84 Bump net.thisptr/jackson-jq from 1.4.0 to 1.6.0 (#62972)
Inspect dependency changes here:
2025-09-05 09:11:02 -06:00
Dennis Schridde
7e0f54bb73 Cache Store OpenAPI description only for 5min (#63168)
The Store API's OpenAPI description (OAD) can change over time, but
Metabase's Store client would not notice.  For example, the client
would fail a HTTP request, not because the server rejected it, but
because the client "believes" it needs to send a field that the server
no longer requires.

Instead of caching the client, and thus OAD, for the whole lifetime of
the Metabase instance, cache it only for 5min.

Fixes: 1dd56e5f14
References: https://metaboat.slack.com/archives/C010ZSXQY87/p1757002462314229
2025-09-05 15:37:19 +02:00
6227 changed files with 666751 additions and 364753 deletions

View File

@@ -0,0 +1,81 @@
## Linting and Formatting
- **Lint PR:** `./bin/mage kondo-updated master` (or whatever target branch)
- Call the command one time at the beginning, record the results, then work through the problems one at a time.
- If the solution is obvious, then please apply the fix. Otherwise skip it.
- If you fix all the issues (and verify by rerunning the kondo-updated command):
- commit the change with a succinct and descriptive commit message
- **Lint File:** `./bin/mage kondo <file or files>`
- Use the linter as a way to know that you are adhering to conventions in place in the codebase
- **Lint Changes:** `./bin/mage kondo-updated HEAD`
- **Format:** `./bin/mage cljfmt-files [path]`
## Testing
- **Run a test:** `./bin/mage run-tests namespace/test-name`
- **Run all tests in a namespace:** `./bin/mage run-tests namespace`
- **Run all tests for a module:** `./bin/mage run-tests test/metabase/notification` Because the module lives in that directory.
Note: the `./bin/mage run-tests` command accepts multiple args, so you can pass
`./bin/mage run-tests namespace/test-name namespace/other-test namespace/third-test`
to run 3 tests, or
`./bin/mage run-tests test/metabase/module1 test/metabase/module2` to run 2 modules.
## Code Readability
- **Check Code Readability:** `./bin/mage -check-readable <file> [line-number]`
- Run after every change to Clojure code
- Check specific line first, then entire file if readable
## REPL Usage
- **Evaluating Clojure Code:** `./bin/mage -repl '<code>'`
- See "Sending Code to the REPL" section for more details
### Sending Code to the REPL
- Send code to the metabase process REPL using: `./bin/mage -repl '(+ 1 1)'` where `(+ 1 1)` is your Clojure code.
- See `./bin/mage -repl -h` for more details.
- If the Metabase backend is not running, you'll see an error message with instructions on how to start it.
#### Working with Files and Namespaces
1. **Load a file and call functions with fully qualified names**:
To call `your.namespace/your-function` on `arg1` and `arg2`:
```
./bin/mage -repl --namespace your.namespace '(your-function arg1 arg2)'
```
DO NOT use "require", "load-file" etc in the code string argument.
#### Understanding the Response
The `./bin/mage -repl` command returns three separate, independent outputs:
- `value`: The return value of the last expression (best for data structures)
- `stdout`: Any printed output from `println` etc. (best for messages)
- `stderr`: Any error messages (best for warnings and errors)
Example call:
```bash
./bin/mage -repl '(println "Hello, world!") '\''({0 1, 1 3, 2 0, 3 2} {0 2, 1 0, 2 3, 3 1})'
```
Example response:
```
ns: user
session: 32a35206-871c-4553-9bc9-f49491173d1c
value: ({0 1, 1 3, 2 0, 3 2} {0 2, 1 0, 2 3, 3 1})
stdout: Hello, world!
stderr:
```
For effective REPL usage:
- Return data structures as function return values
- Use `println` for human-readable messages
- Print errors to stderr

View File

@@ -0,0 +1,153 @@
# Metabase Clojure Style Guide
This guide covers Clojure and ClojureScript coding conventions for Metabase. See also: `CLOJURE_STYLE_GUIDE.adoc` for the Community Clojure Style Guide.
## Naming Conventions
**General Naming:**
- Acceptable abbreviations: `acc`, `i`, `pred`, `coll`, `n`, `s`, `k`, `f`
- Use `kebab-case` for all variables, functions, and constants
**Function Naming:**
- Pure functions should be nouns describing the value they return (e.g., `age` not `calculate-age` or `get-age`)
- Functions with side effects must end with `!`
- Don't repeat namespace alias in function names
**Destructuring:**
- Map destructuring should use kebab-case local bindings even if the map uses `snake_case` keys
## Documentation Standards
**Docstrings:**
- Every public var in `src` or `enterprise/backend/src` must have docstring
- Format using Markdown conventions
- Reference other vars with `[[other-var]]` not backticks
**Comments:**
- `TODO` format: `;; TODO (Name M/D/YY) -- description`
## Code Organization
**Visibility:**
- Make everything `^:private` unless it is used elsewhere
- Try to organize namespaces to avoid `declare` (put public functions near the end)
**Size and Structure:**
- Break up functions > 20 lines
- Lines ≤ 120 characters
- No blank lines within definition forms (except pairwise `let`/`cond`)
## Style Conventions
**Keywords and Metadata:**
- Prefer namespaced keywords for internal use: `:query-type/normal` not `:normal`
- Tag variables with `:arglists` metadata if they're functions but wouldn't otherwise have it
## Tests
**Organization:**
- Break large tests into separate `deftest` forms for logically separate test cases
- Test names should end in `-test` or `-test-<number>`
**Performance:**
- Mark pure function tests `^:parallel`
## Modules
**OSS Modules:**
- Follow `metabase.<module>.*` pattern
- Source in `src/metabase/<module>/`
**Enterprise Modules:**
- Follow `metabase-enterprise.<module>.*` pattern
- Source in `enterprise/backend/src/metabase_enterprise/<module>/`
**Module Structure:**
- REST API endpoints go in `<module>.api` or `<module>.api.*` namespaces
- Put module public API in `<module>.core` using Potemkin imports
- Put Toucan models in `<module>.models.*`
- Put settings in `<module>.settings`
- Put schemas in `<module>.schema`
**Module Linters:**
- Do not cheat module linters with `:clj-kondo/ignore [:metabase/modules]`
## REST API Endpoints
**Required Elements:**
- All new endpoints must have response schemas (`:- <schema>` after route string)
- All endpoints need Malli schemas for parameters (detailed and complete)
- All new REST API endpoints MUST HAVE TESTS
**Naming Conventions:**
- Query parameters use kebab-case
- Request bodies use `snake_case`
- Routes use singular nouns (e.g., `/api/dashboard/:id`)
**Behavior:**
- `GET` endpoints should not have side effects (except analytics)
- `defendpoint` forms should be small wrappers around Toucan model code
## MBQL (Metabase Query Language)
**Restrictions:**
- No raw MBQL introspection outside of `lib`, `lib-be`, or `query-processor` modules
- Use Lib and MBQL 5 in new source code; avoid legacy MBQL
## Database and Models
**Naming:**
- Model names and table names should be singular nouns
- Application database uses `snake_case` identifiers
**Best Practices:**
- Use `t2/select-one-fn` instead of fetching entire rows for one column
- Put correct behavior in Toucan methods, not separate helper functions
## Drivers
**Documentation:**
- New driver multimethods must be mentioned in `docs/developers-guide/driver-changelog.md`
**Implementation:**
- Driver implementations should pass `driver` argument to other driver multimethods
- Don't hardcode driver names in implementations
- Minimize logic inside `read-column-thunk` in JDBC-based drivers
## Miscellaneous
**Examples:**
- Example data should be bird-themed if possible
**Linter Suppressions:**
- Use proper format for kondo suppressions
- No `#_:clj-kondo/ignore` (keyword form)
**Configurable Options:**
- Don't define configurable options that can only be set with environment variables
- Use `:internal` `defsetting` instead

View File

@@ -0,0 +1,8 @@
# Autonomous Development Workflow
- Do not attempt to read or edit files outside the project folder
- Add failing tests first, then fix them
- Work autonomously in small, testable increments
- Run targeted tests, and lint continuously during development
- Prioritize understanding existing patterns before implementing
- Don't commit changes, leave it for the user to review and make commits

View File

@@ -0,0 +1,84 @@
# Metabase Writing Style Guide
## Core Principles
Write like you're talking to a colleague. Be conversational, not formal. Get people what they need quickly. Know your audience and match the complexity.
## Tone and Voice
**Do:**
- Use contractions ("can't" not "cannot")
- Say "people" or "companies" instead of "users"
- Be friendly but not peppy
- Acknowledge limitations honestly ("that's on us, not them")
- Jokes and Easter eggs are okay (permit them, don't suggest them)
**Don't:**
- Use exclamation points excessively
- Rely on tired tropes about nerdiness
- Use corporate jargon ("utilize", "offerings", "actionable insights")
- Tell people something is cool (show them instead)
## Structure and Clarity
**Lead with the important stuff:**
- Most important information first
- Lead with the ask, then provide context
- Cut text that adds little value (when in doubt, cut it)
- Each paragraph should have one clear purpose
**Make headings do the work:**
- Convey your actual point, not just the topic
- "Use headings to highlight key points" not "How to write a good heading"
- Use sentence case, no punctuation except question marks
- No links in headings unless entire heading is a link
## Instructions and Examples
**Tell people what to do:**
- Give the action before explaining why
- Put commands in execution order
- Provide context, steps, and reasoning
- Don't describe tasks as "easy" or "simple"
**Answer unasked questions:**
- Include answers to "dumb" questions you had when learning
- Don't literally include the question, just give the answer
## Formatting
**Code vs. UI elements:**
- Backticks for code, variable names, parameters only
- **Bold** for UI elements and labels (e.g., "Click the **Save** button")
- Don't use backticks or quotes for UI elements
## Writing Mechanics
- Limit pronouns when introducing new terms (repeat the term to reinforce it)
- Ampersands only in proper nouns, never as substitute for "and"
## Terminology Preferences
Use familiar terms from tools people already know:
- "Summarize" (like Excel) instead of "aggregate"
- "Take a look at" instead of "reference"
- "Filter" instead of technical database terms when appropriate
## Red Flags
Avoid these patterns:
- Multiple exclamation points
- Linking "here"
- Bullet lists to explain (use prose)
- Numbers that will change (guard against change)
- Describing things as "easy" or "simple"
- Stock photography-worthy content

View File

@@ -0,0 +1,21 @@
## Linting and Formatting
- **Lint:** `yarn lint-eslint-pure`
- Run ESLint on the codebase
- **Format:** `yarn prettier`
- Format code using Prettier
- **Type Check:** `yarn type-check-pure`
- Run TypeScript type checking
## Testing
### JavaScript/TypeScript Tests
- **Test a specific file:** `yarn test-unit-keep-cljs path/to/file.unit.spec.js`
- **Test by pattern:** `yarn test-unit-keep-cljs -t "pattern"`
- Runs tests matching the given pattern
### ClojureScript Tests
- **Test ClojureScript:** `yarn test-cljs`
- Run ClojureScript tests

View File

@@ -0,0 +1,144 @@
---
name: clojure-review
description: Review Clojure and ClojureScript code changes for compliance with Metabase coding standards, style violations, and code quality issues. Use when reviewing pull requests or diffs containing Clojure/ClojureScript code.
allowed-tools: Read, Grep, Bash, Glob
---
# Clojure Code Review Skill
@./../_shared/clojure-style-guide.md
@./../_shared/clojure-commands.md
## Review guidelines
**What to flag:**
- Check compliance with the Metabase Clojure style guide (included above)
- If `CLOJURE_STYLE_GUIDE.adoc` exists in the working directory, also check compliance with the community Clojure style guide
- Flag all style guide violations
**What NOT to post:**
- Do not post comments congratulating someone for trivial changes or for following style guidelines
- Do not post comments confirming things "look good" or telling them they did something correctly
- Only post comments about style violations or potential issues
Example bad code review comments to avoid:
> This TODO comment is properly formatted with author and date - nice work!
> Good addition of limit 1 to the query - this makes the test more efficient without changing its behavior.
> The kondo ignore comment is appropriately placed here
> Test name properly ends with -test as required by the style guide.
**Special cases:**
- Do not post comments about missing parentheses (these will be caught by the linter)
## Quick review checklist
Use this to scan through changes efficiently:
### Naming
- [ ] Descriptive names (no `tbl`, `zs'`)
- [ ] Pure functions named as nouns describing their return value
- [ ] `kebab-case` for all variables and functions
- [ ] Side-effect functions end with `!`
- [ ] No namespace-alias repetition in function names
### Documentation
- [ ] Public vars in `src` or `enterprise/backend/src` have useful docstrings
- [ ] Docstrings use Markdown conventions
- [ ] References use `[[other-var]]` not backticks
- [ ] `TODO` comments include author and date: `;; TODO (Name 1/1/25) -- description`
### Code Organization
- [ ] Everything `^:private` unless used elsewhere
- [ ] No `declare` when avoidable (public functions near end)
- [ ] Functions under 20 lines when possible
- [ ] No blank lines within definition forms (except pairwise constructs in `let`/`cond`)
- [ ] Lines ≤ 120 characters
### Tests
- [ ] Separate `deftest` forms for distinct test cases
- [ ] Pure tests marked `^:parallel`
- [ ] Test names end in `-test` or `-test-<number>`
### Modules
- [ ] Correct module patterns (OSS: `metabase.<module>.*`, EE: `metabase-enterprise.<module>.*`)
- [ ] API endpoints in `<module>.api` namespaces
- [ ] Public API in `<module>.core` with Potemkin
- [ ] No cheating module linters with `:clj-kondo/ignore [:metabase/modules]`
### REST API
- [ ] Response schemas present (`:- <schema>`)
- [ ] Query params use kebab-case, bodies use `snake_case`
- [ ] Routes use singular nouns (e.g., `/api/dashboard/:id`)
- [ ] `GET` has no side effects (except analytics)
- [ ] Malli schemas detailed and complete
- [ ] All new endpoints have tests
### MBQL
- [ ] No raw MBQL manipulation outside `lib`, `lib-be`, or `query-processor` modules
- [ ] Uses Lib and MBQL 5, not legacy MBQL
### Database
- [ ] Model and table names are singular nouns
- [ ] Uses `t2/select-one-fn` instead of selecting full rows for one column
- [ ] Logic in Toucan methods, not helper functions
### Drivers
- [ ] New multimethods documented in `docs/developers-guide/driver-changelog.md`
- [ ] Passes `driver` argument to other driver methods (no hardcoded driver names)
- [ ] Minimal logic in `read-column-thunk`
### Miscellaneous
- [ ] Example data is bird-themed when possible
- [ ] Kondo linter suppressions use proper format (not `#_:clj-kondo/ignore` keyword form)
## Pattern matching table
Quick scan for common issues:
| Pattern | Issue |
| -------------------------------------------- | ----------------------------------------------------------- |
| `calculate-age`, `get-user` | Pure functions should be nouns: `age`, `user` |
| `update-db`, `save-model` | Missing `!` for side effects: `update-db!`, `save-model!` |
| `snake_case_var` | Should use kebab-case |
| Public var without docstring | Add docstring explaining purpose |
| `;; TODO fix this` | Missing author/date: `;; TODO (Name 1/1/25) -- description` |
| `(defn foo ...)` in namespace used elsewhere | Should be `(defn ^:private foo ...)` |
| Function > 20 lines | Consider breaking up into smaller functions |
| `/api/dashboards/:id` | Use singular: `/api/dashboard/:id` |
| Query params with `snake_case` | Use kebab-case for query params |
| New API endpoint without tests | Add tests for the endpoint |
## Feedback format examples
**For style violations:**
> This pure function should be named as a noun describing its return value. Consider `user` instead of `get-user`.
**For missing documentation:**
> This public var needs a docstring explaining its purpose, inputs, and outputs.
**For organization issues:**
> This function is only used in this namespace, so it should be marked `^:private`.
**For API conventions:**
> Query parameters should use kebab-case. Change `user_id` to `user-id`.

View File

@@ -0,0 +1,59 @@
---
name: clojure-write
description: Guide Clojure and ClojureScript development using REPL-driven workflow, coding conventions, and best practices. Use when writing, developing, or refactoring Clojure/ClojureScript code.
---
# Clojure Development Skill
@./../_shared/development-workflow.md
@./../_shared/clojure-style-guide.md
@./../_shared/clojure-commands.md
## REPL-Driven Development Workflow
- Start with small, fundamental functions:
- Identify the core features or functionalities required for your task.
- Break each feature down into the smallest, most basic functions that can be developed and tested independently.
- Write and test in the REPL:
- Write the code for each small function directly in the REPL (Read-Eval-Print Loop).
- Test it thoroughly with a variety of inputs, including typical use cases and relevant edge cases, to ensure it
behaves as expected.
- Integrate into source code:
- Once a function works correctly in the REPL, move it from the REPL environment into your source code files (e.g.,
within appropriate namespaces).
- Gradually increase complexity:
- Build upon tested, basic functions to create more complex functions or components.
- Compose smaller functions together, testing each new composition in the REPL to verify correctness step by step.
- Ensure dependency testing:
- Make sure every function is fully tested in the REPL before it is depended upon by other functions.
- This ensures that each layer of your application is reliable before you build on it.
- Use the REPL fully:
- Use the REPL as your primary tool to experiment with different approaches, iterate quickly, and get immediate
feedback on your code.
- Follow functional programming principles:
- Keep functions small, focused, and composable.
- Use Clojure's functional programming features—like immutability, higher-order functions, and the standard
library—to write concise, effective code.
## How to Evaluate Code
### Bottom-up Dev Loop
1. Write code into a file.
2. Evaluate the file's namespace and make sure it loads correctly with:
```
./bin/mage -repl --namespace metabase.app-db.connection
```
3. Call functions in the namespace with test inputs, and observe that the outputs are correct
Feel free to copy these REPL session trials into actual test cases using `deftest` and `is`.
4. Once you know these functions are good, return to 1, and compose them into the task that you need to build.
## Critical Rules for Editing
- Be careful with parentheses counts when editing Clojure code
- After EVERY change to Clojure code, verify readability with `-check-readable`
- End all files with a newline
- When editing tabular code, where the columns line up, try to keep them aligned
- Spaces on a line with nothing after it is not allowed

View File

@@ -0,0 +1,168 @@
---
name: docs-review
description: Review documentation changes for compliance with the Metabase writing style guide. Use when reviewing pull requests, files, or diffs containing documentation markdown files.
allowed-tools: Read, Grep, Bash, Glob
---
# Documentation Review Skill
@./../_shared/metabase-style-guide.md
## Review mode detection
**IMPORTANT: Before starting the review, determine which mode to use:**
1. **PR review mode**: If the `mcp__github__create_pending_pull_request_review` tool is available, you are reviewing a GitHub PR
- Use the pending review workflow to post all issues as one cohesive review
- Follow the workflow steps in "PR review mode format" below
2. **Local review mode**: If the MCP tool is NOT available, output issues in the conversation
- Format all issues in a numbered markdown list (as described in "Feedback format" below)
## Review process
1. **Detect review mode** - Check if `mcp__github__create_pending_pull_request_review` is available
2. Read the changes through once to understand intent
3. Check all issues that violate style guide or significantly impact readability
4. Only flag issues worth mentioning - if it won't make a material difference to the reader, skip it
5. **REQUIRED: Number ALL feedback sequentially** - Start from Issue 1 and increment for each issue found
## Review checklist
Run through the diff looking for these issues:
**Tone and voice:**
- [ ] Formal/corporate language ("utilize" not "use", "offerings", etc.)
- [ ] "Users" instead of "people" or "companies"
- [ ] Excessive exclamation points or overly peppy tone
- [ ] Telling readers something is cool instead of showing them
**Structure and clarity:**
- [ ] Important information buried instead of leading
- [ ] Verbose text that adds little value
- [ ] Paragraphs without clear purpose
- [ ] Vague headings that don't convey the point
- [ ] Instructions explain "why" before telling "what to do"
- [ ] Tasks described as "easy" or "simple"
**Links and references:**
- [ ] Linking the word "here" instead of descriptive text
- [ ] Links in headings (unless entire heading is a link)
**Formatting:**
- [ ] Backticks on UI elements (should use **bold**)
- [ ] Backticks used as quotation marks
- [ ] Ampersands as "and" substitute (except proper nouns)
- [ ] Inconsistent list formatting
**Code and examples:**
- [ ] Code examples that don't work or would error
- [ ] Commands not in execution order
- [ ] Full-width screenshots instead of scoped UI elements
- [ ] Excessive or unnecessary images
**Sentence construction:**
- [ ] Overuse of pronouns when introducing new terms
## Quick scan table
| Pattern | Issue |
| ----------------------------- | --------------------------------------------- |
| `Button name` or `UI element` | Should use **bold** not backticks |
| we can do X, our feature | Should be "Metabase" or "it" |
| click here, read more here | Need descriptive link text |
| easy, simple, just | Remove condescending qualifiers |
| users | Should be "people" or "companies" if possible |
## Feedback format
**MANDATORY REQUIREMENT: Every single issue MUST be numbered sequentially starting from Issue 1.**
This numbered format is NON-NEGOTIABLE. It allows users to efficiently reference specific issues (e.g., "fix issues 1, 3, and 5") and track which feedback has been addressed.
### Local review mode format
When outputting issues in the conversation (local mode), use this format:
```markdown
## Issues
**Issue 1: [Brief title]**
Line X: Succinct description of the issue
[code or example]
Suggested fix or succinct explanation
**Issue 2: [Brief title]**
Line Y: Description of the issue
Suggested fix or explanation
**Issue 3: [Brief title]**
...
```
**Examples:**
> **Issue 1: Backticks on UI elements**
> Line 42: This uses backticks for the UI element. Use **bold** instead: **Filter** not `Filter`.
> **Issue 2: Formal tone**
> Line 15: This could be more conversational. Consider: "You can't..." instead of "You cannot..."
> **Issue 3: Vague heading**
> Line 8: The heading could be more specific. Try stating the point directly: "Run migrations before upgrading" vs "Upgrade process"
### PR review mode format
When posting to GitHub (PR mode), use the **pending review workflow**:
**Workflow steps:**
1. **Start a review**: Use `mcp__github__create_pending_pull_request_review` to begin a pending review
- This creates a draft review that won't be visible until submitted
2. **Get diff information**: Use `mcp__github__get_pull_request_diff` to understand the code changes and line numbers
- This helps you determine the correct file paths and line numbers for comments
3. **Identify ALL issues**: Read through all changes and identify every issue worth mentioning
- Collect all issues before posting any comments
- Number them sequentially (Issue 1, Issue 2, Issue 3, etc.)
4. **Add review comments**: Use `mcp__github__add_pull_request_review_comment_to_pending_review` for each issue
- **CRITICAL**: Post ALL comments in a SINGLE response using multiple tool calls in parallel
- Each comment should reference a specific file path and line number from the diff
- Start each comment body with `**Issue N: [Brief title]**`
- Include the description and suggested fix
5. **Submit the review**: Use `mcp__github__submit_pending_pull_request_review` to publish all comments at once
- Use event type `"COMMENT"` (NOT "REQUEST_CHANGES") to make it non-blocking
- **Do NOT include a body message** - Leave the body empty or omit it entirely
- All comments will appear together as one cohesive review
**Comment format example:**
```
**Issue 1: Backticks on UI elements**
This uses backticks for the UI element. Use **bold** instead: **Filter** not `Filter`.
```
**IMPORTANT**:
- Each issue gets its own review comment attached to the pending review
- Number ALL comments sequentially (Issue 1, Issue 2, Issue 3, etc.)
- Always start the comment body with `**Issue N: [Brief title]**`
- **MUST add all comments in parallel in a single response** - Do NOT add them one after another in separate responses
- Do NOT output a summary message to the conversation - only post GitHub review comments
- When submitting the review, do NOT include a body parameter (or leave it empty) to avoid cluttering the PR with summary text
- The review will appear as a single review with multiple comments when submitted
## Final check
1. Remove any issues from your assessment that won't make a material difference to the reader if addressed. Only flag issues worth the author's time to fix.
2. **Verify all issues are numbered sequentially** starting from Issue 1 with no gaps in numbering.
3. Confirm the format exactly matches: `**Issue N: [Brief title]**` where N is the issue number.
4. **In PR mode**: Verify each issue was posted as a separate GitHub comment (not output to conversation).

View File

@@ -0,0 +1,96 @@
---
name: docs-write
description: Write documentation following Metabase's conversational, clear, and user-focused style. Use when creating or editing documentation files (markdown, MDX, etc.).
allowed-tools: Read, Write, Grep, Bash, Glob
---
# Documentation Writing Skill
@./../_shared/metabase-style-guide.md
## When writing documentation
### Start here
1. **Who is this for?** Match complexity to audience. Don't oversimplify hard things or overcomplicate simple ones.
2. **What do they need?** Get them to the answer fast. Nobody wants to be in docs longer than necessary.
3. **What did you struggle with?** Those common questions you had when learning? Answer them (without literally including the question).
### Writing process
**Draft:**
- Write out the steps/explanation as you'd tell a colleague
- Lead with what to do, then explain why
- Use headings that state your point: "Set SAML before adding users" not "SAML configuration timing"
**Edit:**
- Read aloud. Does it sound like you talking? If it's too formal, simplify.
- Cut anything that doesn't directly help the reader
- Check each paragraph has one clear purpose
- Verify examples actually work (don't give examples that error)
**Polish:**
- Make links descriptive (never "here")
- Backticks only for code/variables, **bold** for UI elements
- American spelling, serial commas
- Keep images minimal and scoped tight
**Format:**
- Run prettier on the file after making edits: `yarn prettier --write <file-path>`
- This ensures consistent formatting across all documentation
### Common patterns
**Instructions:**
```markdown
Run:
\`\`\`
command-to-run
\`\`\`
Then:
\`\`\`
next-command
\`\`\`
This ensures you're getting the latest changes.
```
Not: "(remember to run X before Y...)" buried in a paragraph.
**Headings:**
- "Use environment variables for configuration" ✅
- "Environment variables" ❌ (too vague)
- "How to use environment variables for configuration" ❌ (too wordy)
**Links:**
- "Check out the [SAML documentation](link)" ✅
- "Read the docs [here](link)" ❌
### Watch out for
- Describing tasks as "easy" (you don't know the reader's context)
- Using "we" when talking about Metabase features (use "Metabase" or "it")
- Formal language: "utilize", "reference", "offerings"
- Too peppy: multiple exclamation points
- Burying the action in explanation
- Code examples that don't work
- Numbers that will become outdated
### Quick reference
| Write This | Not This |
| -------------------------- | ------------------ |
| people, companies | users |
| summarize | aggregate |
| take a look at | reference |
| can't, don't | cannot, do not |
| **Filter** button | \`Filter\` button |
| Check out [the docs](link) | Click [here](link) |

View File

@@ -0,0 +1,19 @@
---
name: typescript-review
description: Review TypeScript and JavaScript code changes for compliance with Metabase coding standards, style violations, and code quality issues. Use when reviewing pull requests or diffs containing TypeScript/JavaScript code.
allowed-tools: Read, Grep, Bash, Glob
---
# TypeScript/JavaScript Code Review Skill
@./../_shared/typescript-commands.md
## Code Review Guidelines
Review pull requests with a focus on:
- Compliance with project coding standards and conventions
- Code quality and best practices
- Clear and correct JSDoc comments
- Type safety and proper TypeScript usage
- React best practices (when applicable)

View File

@@ -0,0 +1,9 @@
---
name: typescript-write
description: Write TypeScript and JavaScript code following Metabase coding standards and best practices. Use when developing or refactoring TypeScript/JavaScript code.
---
# TypeScript/JavaScript Development Skill
@./../_shared/development-workflow.md
@./../_shared/typescript-commands.md

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
@@ -173,6 +176,7 @@
metabase.driver.sql-jdbc.execute/execute-prepared-statement!
metabase.notification.models/create-notification!
metabase.pulse.send/send-pulse!
metabase-enterprise.transforms-python.python-runner-test/execute!
;; Safe in tests, where we typically use a private, temporary index per thread.
metabase.search.core/reindex!
metabase.util/run-count!
@@ -228,7 +232,7 @@
(clojure.core.logic/fresh)
(clojure.core.logic/matcha)
(clojure.core.logic/run)
(clojure.test/is [query= =? malli= qv=])
(clojure.test/is [=? malli= qv=])
(clojure.tools.macro/macrolet)
instaparse.core/transform
(metabase.server.streaming-response/streaming-response)
@@ -272,6 +276,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"}
@@ -418,6 +423,7 @@
metabase-enterprise.transforms.api-test/with-transform-tags clojure.core/let
metabase-enterprise.transforms.api-test/with-worker-runs clojure.core/let
metabase-enterprise.transforms.test-util/with-transform-cleanup! clojure.core/let
metabase-enterprise.transforms.execute/with-transform-lifecycle clojure.core/let
metabase.actions.test-util/with-actions clojure.core/let
metabase.api.common/let-404 clojure.core/let
metabase.app-db.custom-migrations.util/with-temp-scheduler! clojure.core/fn
@@ -486,8 +492,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
@@ -517,8 +524,10 @@
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
metabase.api.common.internal-test/with-jetty-server hooks.common/with-one-binding
metabase.api.macros/defendpoint hooks.metabase.api.macros/defendpoint
metabase.app-db.schema-migrations-test.impl/test-migrations hooks.metabase.app-db.schema-migrations-test.impl/test-migrations
@@ -527,11 +536,11 @@
metabase.channel.template.handlebars-test/with-temp-template! hooks.common/with-vec-first-binding
metabase.classloader.core/require hooks.clojure.core.require/lint-require
metabase.classloader.impl/require hooks.clojure.core.require/lint-require
metabase.collections.api-test/with-french-user-and-personal-collection! hooks.common/with-two-top-level-bindings
metabase.collections-rest.api-test/with-french-user-and-personal-collection! hooks.common/with-two-top-level-bindings
metabase.collections.models.collection-test/with-collection-hierarchy! hooks.common/let-one-with-optional-value
metabase.collections.models.collection-test/with-personal-and-impersonal-collections hooks.common/with-two-bindings
metabase.dashboards.api-test/with-chain-filter-fixtures hooks.common/let-one-with-optional-value
metabase.dashboards.api-test/with-simple-dashboard-with-tabs hooks.common/with-one-binding
metabase.dashboards-rest.api-test/with-chain-filter-fixtures hooks.common/let-one-with-optional-value
metabase.dashboards-rest.api-test/with-simple-dashboard-with-tabs hooks.common/with-one-binding
metabase.dashboards.models.dashboard-tab-test/with-dashtab-in-personal-collection hooks.common/with-one-top-level-binding
metabase.dashboards.models.dashboard-test/with-dash-in-collection! hooks.common/with-three-bindings
metabase.driver.bigquery-cloud-sdk-test/calculate-bird-scarcity hooks.metabase.query-processor-test.expressions-test/calculate-bird-scarcity
@@ -539,11 +548,13 @@
metabase.driver.oracle-test/with-temp-user hooks.common/let-one-with-optional-value
metabase.driver/register! hooks.metabase.driver/register!
metabase.driver-api/defenterprise hooks.metabase.premium-features.defenterprise/defenterprise
metabase.embedding.api.embed-test/do-response-formats hooks.common/with-two-bindings
metabase.embedding.api.embed-test/with-chain-filter-fixtures! hooks.common/let-one-with-optional-value
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.embedding-rest.api.embed-test/do-response-formats hooks.common/with-two-bindings
metabase.embedding-rest.api.embed-test/with-chain-filter-fixtures! hooks.common/let-one-with-optional-value
metabase.embedding-rest.api.embed-test/with-temp-card hooks.common/let-one-with-optional-value
metabase.embedding-rest.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
@@ -560,18 +571,18 @@
metabase.permissions.core/disable-perms-cache hooks.common/do*
metabase.premium-features.core/defenterprise hooks.metabase.premium-features.defenterprise/defenterprise
metabase.premium-features.defenterprise/defenterprise hooks.metabase.premium-features.defenterprise/defenterprise
metabase.public-sharing.api-test/with-required-param-card! hooks.common/with-one-binding
metabase.public-sharing.api-test/with-temp-public-card hooks.common/let-one-with-optional-value
metabase.public-sharing.api-test/with-temp-public-dashboard hooks.common/let-one-with-optional-value
metabase.public-sharing.api-test/with-temp-public-dashboard-and-card hooks.common/with-three-bindings
metabase.public-sharing-rest.api-test/with-required-param-card! hooks.common/with-one-binding
metabase.public-sharing-rest.api-test/with-temp-public-card hooks.common/let-one-with-optional-value
metabase.public-sharing-rest.api-test/with-temp-public-dashboard hooks.common/let-one-with-optional-value
metabase.public-sharing-rest.api-test/with-temp-public-dashboard-and-card hooks.common/with-three-bindings
metabase.pulse.api.alert-test/with-alert-in-collection! hooks.common/with-four-bindings
metabase.pulse.dashboard-subscription-test/with-link-card-fixture-for-dashboard hooks.common/let-second
metabase.pulse.models.pulse-test/with-dashboard-subscription-in-collection! hooks.common/with-four-bindings
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
@@ -621,10 +632,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-rest.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
@@ -648,44 +660,43 @@
metabase.xrays.api.automagic-dashboards-test/with-indexed-model! hooks.metabase.xrays.api.automagic-dashboards-test/with-indexed-model!}
:macroexpand
{clojurewerkz.quartzite.jobs/build macros.quartz/build-job
clojurewerkz.quartzite.schedule.calendar-interval/build macros.quartz/build-job
clojurewerkz.quartzite.schedule.cron/schedule macros.quartz/schedule
clojurewerkz.quartzite.schedule.simple/schedule macros.quartz/simple-schedule
clojurewerkz.quartzite.triggers/build macros.quartz/build-trigger
metabase-enterprise.database-routing.e2e-test/with-temp-dbs! macros.metabase-enterprise.database-routing.e2e-test/with-temp-dbs!
metabase-enterprise.impersonation.util-test/with-impersonations! macros.metabase-enterprise.impersonation.util-test/with-impersonations!
metabase-enterprise.query-reference-validation.api-test/with-test-setup! macros.metabase-enterprise.query-reference-validation.api-test/with-test-setup!
metabase-enterprise.sandbox.test-util/with-gtaps! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.sandbox.test-util/with-gtaps-for-user! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.serialization.test-util/with-world macros.metabase-enterprise.serialization.test-util/with-world
metabase-enterprise.test/with-gtaps! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.test/with-gtaps-for-user! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase.collections.api-test/with-collection-hierarchy! macros.metabase.collections.api-test/with-collection-hierarchy!
metabase.collections.api-test/with-some-children-of-collection! macros.metabase.collections.api-test/with-some-children-of-collection!
metabase.embedding.api.embed-test/with-embedding-enabled-and-temp-card-referencing! macros.metabase.embedding.api.embed-test/with-embedding-enabled-and-temp-card-referencing!
metabase.embedding.api.embed-test/with-embedding-enabled-and-temp-dashcard-referencing! macros.metabase.embedding.api.embed-test/with-embedding-enabled-and-temp-dashcard-referencing!
metabase.lib.common/defop macros.metabase.lib.common/defop
metabase.lib.filter/deffilter macros.metabase.lib.filter/deffilter
metabase.parameters.chain-filter-test/chain-filter macros.metabase.parameters.chain-filter-test/chain-filter
metabase.parameters.chain-filter-test/chain-filter-search macros.metabase.parameters.chain-filter-test/chain-filter
metabase.public-sharing.api-test/with-sharing-enabled-and-temp-card-referencing! macros.metabase.public-sharing.api-test/with-sharing-enabled-and-temp-card-referencing!
metabase.public-sharing.api-test/with-sharing-enabled-and-temp-dashcard-referencing! macros.metabase.public-sharing.api-test/with-sharing-enabled-and-temp-dashcard-referencing!
metabase.queries.api.card-test/with-ordered-items macros.metabase.queries.api.card-test/with-ordered-items
metabase.query-analysis.models.query-analysis-test/with-test-setup macros.metabase.query-analysis.models.query-analysis-test/with-test-setup
metabase.query-analysis.task.test-setup/with-test-setup! macros.metabase.query-analysis.task.test-setup/with-test-setup!
metabase.query-processor.streaming/streaming-response macros.metabase.query-processor.streaming/streaming-response
metabase.server.statistics-handler-test/with-server macros.metabase.server.statistics-handler-test/with-server
metabase.test.data.users/with-group-for-user macros.metabase.test.data.users/with-group-for-user
metabase.test.util/with-temp-env-var-value! macros.metabase.test.util/with-temp-env-var-value!
metabase.test.util/with-temporary-raw-setting-values macros.metabase.test.util/with-temporary-raw-setting-values
metabase.test/with-group-for-user macros.metabase.test.data.users/with-group-for-user
metabase.test/with-temp-env-var-value! macros.metabase.test.util/with-temp-env-var-value!
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}}
{clojurewerkz.quartzite.jobs/build macros.quartz/build-job
clojurewerkz.quartzite.schedule.calendar-interval/build macros.quartz/build-job
clojurewerkz.quartzite.schedule.cron/schedule macros.quartz/schedule
clojurewerkz.quartzite.schedule.simple/schedule macros.quartz/simple-schedule
clojurewerkz.quartzite.triggers/build macros.quartz/build-trigger
metabase-enterprise.database-routing.e2e-test/with-temp-dbs! macros.metabase-enterprise.database-routing.e2e-test/with-temp-dbs!
metabase-enterprise.impersonation.util-test/with-impersonations! macros.metabase-enterprise.impersonation.util-test/with-impersonations!
metabase-enterprise.query-reference-validation.api-test/with-test-setup! macros.metabase-enterprise.query-reference-validation.api-test/with-test-setup!
metabase-enterprise.sandbox.test-util/with-gtaps! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.sandbox.test-util/with-gtaps-for-user! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.serialization.test-util/with-world macros.metabase-enterprise.serialization.test-util/with-world
metabase-enterprise.test/with-gtaps! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.test/with-gtaps-for-user! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase.collections-rest.api-test/with-collection-hierarchy! macros.metabase.collections-rest.api-test/with-collection-hierarchy!
metabase.collections-rest.api-test/with-some-children-of-collection! macros.metabase.collections-rest.api-test/with-some-children-of-collection!
metabase.embedding-rest.api.embed-test/with-embedding-enabled-and-temp-card-referencing! macros.metabase.embedding-rest.api.embed-test/with-embedding-enabled-and-temp-card-referencing!
metabase.embedding-rest.api.embed-test/with-embedding-enabled-and-temp-dashcard-referencing! macros.metabase.embedding-rest.api.embed-test/with-embedding-enabled-and-temp-dashcard-referencing!
metabase.lib.common/defop macros.metabase.lib.common/defop
metabase.lib.filter/deffilter macros.metabase.lib.filter/deffilter
metabase.parameters.chain-filter-test/chain-filter macros.metabase.parameters.chain-filter-test/chain-filter
metabase.parameters.chain-filter-test/chain-filter-search macros.metabase.parameters.chain-filter-test/chain-filter
metabase.public-sharing-rest.api-test/with-sharing-enabled-and-temp-card-referencing! macros.metabase.public-sharing-rest.api-test/with-sharing-enabled-and-temp-card-referencing!
metabase.public-sharing-rest.api-test/with-sharing-enabled-and-temp-dashcard-referencing! macros.metabase.public-sharing-rest.api-test/with-sharing-enabled-and-temp-dashcard-referencing!
metabase.queries.api.card-test/with-ordered-items macros.metabase.queries.api.card-test/with-ordered-items
metabase.query-analysis.models.query-analysis-test/with-test-setup macros.metabase.query-analysis.models.query-analysis-test/with-test-setup
metabase.query-analysis.task.test-setup/with-test-setup! macros.metabase.query-analysis.task.test-setup/with-test-setup!
metabase.query-processor.streaming/streaming-response macros.metabase.query-processor.streaming/streaming-response
metabase.server.statistics-handler-test/with-server macros.metabase.server.statistics-handler-test/with-server
metabase.test.data.users/with-group-for-user macros.metabase.test.data.users/with-group-for-user
metabase.test.util/with-temp-env-var-value! macros.metabase.test.util/with-temp-env-var-value!
metabase.test.util/with-temporary-raw-setting-values macros.metabase.test.util/with-temporary-raw-setting-values
metabase.test/with-group-for-user macros.metabase.test.data.users/with-group-for-user
metabase.test/with-temp-env-var-value! macros.metabase.test.util/with-temp-env-var-value!
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.related-test/with-world macros.metabase.xrays.related-test/with-world}}
:config-in-comment
{:linters {:unresolved-symbol {:level :off}}}
@@ -712,16 +723,23 @@
:name metabase-lib}
{:pattern "^metabase\\.lib\\..*"
:name metabase-lib-excluding-legacy-mbql}
{:pattern "^metabase\\.legacy-mbql\\..*"
:name legacy-mbql-namespaces}
;;
;; QP source namespaces: `metabase.query-processor.*`, `metabase-enterprise.sandbox.query-processor.*`, and
;; `metabase.driver.*`, excluding `-test` namespaces.
;; QP and driver source namespaces: `metabase.query-processor.*`, `metabase-enterprise.sandbox.query-processor.*`,
;; and `metabase.driver.*`, excluding `-test` namespaces.
;;
{:pattern "metabase(?:(?:(?:-enterprise\\.sandbox)?\\.query-processor\\.)|(?:\\.driver\\.)).*(?<!-test)$"
:name qp-and-driver-source-namespaces}
;;
;; driver namespaces
;; QP source namespaces
;;
{:pattern "metabase\\.driver.*$"
{:pattern "metabase(?:(?:-enterprise\\.sandbox)?\\.query-processor\\.).*(?<!-test)$"
:name qp-source-namespaces}
;;
;; driver namespaces, including tests
;;
{:pattern "metabase\\.driver(?:-api)?.*$"
:name driver-namespaces}
;;
;; Perf-sensitive namespaces are currently the union of metabase.lib.*, driver namespaces, and QP (without tests).
@@ -734,7 +752,10 @@
;; `metabase-enterprise.sandbox.query-processor*-test`
;;
{:pattern "^metabase(?:((?:-enterprise\\.sandbox)?\\.query-processor)|(?:\\.driver\\.sql(?!server)(?!ite))).*-test$"
:name general-qp-and-driver-test-namespaces}]
:name general-qp-and-driver-test-namespaces}
{:pattern "(?:^mage.*)"
:name mage-namespaces}]
:config-in-ns
{test-namespaces
@@ -767,7 +788,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
@@ -779,7 +807,7 @@
clojure.string/lower-case {:level :off}
clojure.string/upper-case {:level :off}}}}
;; enable all the extra linters we haven't enabled in the core app yet in MLv2. It's all new code so we can adhere
;; enable all the extra linters we haven't enabled in the core app yet in Lib. It's all new code so we can adhere
;; to the new stricter rules from day 1
metabase-lib
{:linters
@@ -799,48 +827,120 @@
metabase.test/with-temp {:message "Don't use application database inside Lib code"}}
:discouraged-namespace
{metabase.driver {:message "MLv2 code should be independent of driver code/methods"}
metabase.test {:message "MLv2 tests should only use MLv2 test helpers"}
metabase.test.data {:message "MLv2 tests should only use MLv2 test helpers"}
metabase.util.malli.schema {:message "Prefer metabase.lib.schema schemas in MLv2 code"}
toucan.db {:message "Don't use application database inside MLv2 code"}
toucan.models {:message "Don't use application database inside MLv2 code"}
toucan.util.test {:message "Don't use application database inside MLv2 code"}
toucan2.core {:message "Don't use application database inside MLv2 code"}}}}
{metabase.driver {:message "Lib code should be independent of driver code/methods"}
metabase.test {:message "Lib tests should only use Lib test helpers"}
metabase.test.data {:message "Lib tests should only use Lib test helpers"}
metabase.util.malli.schema {:message "Prefer metabase.lib.schema schemas in Lib code"}
toucan.db {:message "Don't use application database inside Lib code"}
toucan.models {:message "Don't use application database inside Lib code"}
toucan.util.test {:message "Don't use application database inside Lib code"}
toucan2.core {:message "Don't use application database inside Lib code"}}}}
metabase-lib-excluding-legacy-mbql
{}
legacy-mbql-namespaces
{: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.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/update-keys {:message "Use metabase.util.performance/update-keys"}}}}
{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/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/for {:message "Use metabase.util.performance/for"}
clojure.walk/doseq {:message "Use metabase.util.performance/doseq"}}}}
qp-and-driver-source-namespaces
{:linters
{:discouraged-namespace
{metabase.query-processor.store {:level :off}
metabase.util.malli.schema {:message "Prefer metabase.lib.schema or metabase.legacy-mbql.schema schemas in QP/driver code"}
toucan.db {:message "Don't use application database directly in QP code; use QP Store/metadata provider"}
toucan.models {:message "Don't use application database directly in QP code; use QP Store/metadata provider"}
toucan.util.test {:message "Don't use application database directly in QP code; use QP Store/metadata provider"}
toucan2.core {:message "Don't use application database directly in QP code; use QP Store/metadata provider"}}
toucan.db {:message "Don't use application database directly in QP code; use the MetadataProvider"}
toucan.models {:message "Don't use application database directly in QP code; use the MetadataProvider"}
toucan.util.test {:message "Don't use application database directly in QP code; use the MetadataProvider"}
toucan2.core {:message "Don't use application database directly in QP code; use the MetadataProvider"}}
:discouraged-var
{medley.core/map-keys {:message "Use metabase.util.performance/update-keys"}
medley.core/map-vals {:message "Use clojure.core/update-vals"}
metabase.app-db.core/query {:message "Don't use application database directly in QP code; use QP Store/metadata provider"}
metabase.app-db.core/reducible-query {:message "Don't use application database directly in QP code; use QP Store/metadata provider"}
metabase.app-db.core/query {:message "Don't use application database directly in QP code; use the MetadataProvider"}
metabase.app-db.core/reducible-query {:message "Don't use application database directly in QP code; use the MetadataProvider"}
metabase.lib.convert/->legacy-MBQL {:level :off}
metabase.lib.core/->legacy-MBQL {:level :off}}}}
qp-source-namespaces
{}
general-qp-and-driver-test-namespaces
{:linters
{:discouraged-var
@@ -850,4 +950,11 @@
toucan2.tools.with-temp/with-temp {:message "Use lib.tu/mock-metadata-provider in QP tests. Exceptions: tests for code that doesn't use MPs or models not supported by MPs"}}
:metabase/disallow-hardcoded-driver-names-in-tests
{:level :warning}}}}}
{:level :warning}}}
mage-namespaces
{:linters
{:discouraged-java-method
{java.lang.System {exit
{:level :error
:message "Don't use System/exit directly. Instead throw an ex-info with {:babashka/exit <exit-code>} (and optionally :mage/error) let the mage runner handle exiting the process"}}}}}}}

File diff suppressed because it is too large Load Diff

View File

@@ -13,7 +13,10 @@
toucan2.core/insert-returning-pk!
toucan2.core/insert-returning-pks!
clojure.core.async/<!!
clojure.core.async/<!
clojure.core.async/>!!
clojure.core.async/>!
clojure.core.async/alts!
clojure.core.async/alts!!
clojure.core.async/close!
clojure.core.async/poll!
@@ -97,7 +100,7 @@
metabase.permissions.models.permissions/update-data-perms-graph!
metabase.permissions.models.permissions/update-group-permissions!
metabase.permissions.test-util/with-restored-perms!
metabase.public-sharing.api-test/add-card-to-dashboard!
metabase.public-sharing-rest.api-test/add-card-to-dashboard!
metabase.pulse.send/send-notifications!
metabase.pulse.send/send-pulse!
metabase.query-processor.streaming.interface/begin!

View File

@@ -1,4 +1,4 @@
(ns macros.metabase.collections.api-test)
(ns macros.metabase.collections-rest.api-test)
(defmacro with-collection-hierarchy! [bindings & body]
`(let [~'a nil

View File

@@ -1,4 +1,4 @@
(ns macros.metabase.embedding.api.embed-test)
(ns macros.metabase.embedding-rest.api.embed-test)
(defmacro with-embedding-enabled-and-temp-card-referencing!
[table-kw field-kw [card-binding] & body]

View File

@@ -1,4 +1,4 @@
(ns macros.metabase.public-sharing.api-test)
(ns macros.metabase.public-sharing-rest.api-test)
(defmacro with-sharing-enabled-and-temp-card-referencing!
[table-kw field-kw [card-binding] & body]

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

@@ -52,7 +52,13 @@
(defn- lint-require* [node current-ns config]
(let [[_require & args] (:children node)
required-namespaces (keep unwrap-require args)]
required-namespaces (->> (keep unwrap-require args)
;; `require` runs through `cc/load-libs` which allows
;; #{:as :reload :reload-all :require :use :verbose :refer :as-alias}
;; as args. If you use a REPL tool that applies clj-kondo linting (e.g., Clojure MCP)
;; you may wish to `:reload` or `:reload-all` a namespace. So we shouldn't assume all
;; args are keywords:
(remove keyword?))]
(lint* node current-ns config required-namespaces)))
(defn- lint-requiring-resolve* [node current-ns config]

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

@@ -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

@@ -38,323 +38,321 @@
;; zero get indented 2 spaces if not on the first line regardless of number of elements on the first line.
:extra-indents
{;; clojure.core stuff
fn* [[:inner 0]]
let* [[:block 1]]
with-meta [[:default]]
fn* [[:inner 0]]
let* [[:block 1]]
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]]
clojure.test.check/quick-check [[:block 1]]
clojure.tools.macro/macrolet [[:block 1] [:inner 2 0]]
clojurewerkz.quartzite.jobs/build [[:default]]
clojurewerkz.quartzite.jobs/with-description [[:default]]
clojurewerkz.quartzite.jobs/with-identity [[:default]]
clojurewerkz.quartzite.schedule.cron/schedule [[:default]]
clojurewerkz.quartzite.schedule.cron/with-misfire-handling-instruction-do-nothing [[:default]]
clojurewerkz.quartzite.triggers/build [[:default]]
clojurewerkz.quartzite.triggers/with-description [[:default]]
clojurewerkz.quartzite.triggers/with-identity [[:default]]
clojurewerkz.quartzite.triggers/with-priority [[:default]]
clojurewerkz.quartzite.triggers/with-schedule [[:default]]
def-map-type [[:block 2] [:inner 1]]
defprotocol+ [[:block 1] [:inner 1]]
defrecord+ [[:block 2] [:inner 1]]
deftype+ [[:block 2] [:inner 1]]
net.cgrand.macrovich/case [[:block 0]]
potemkin.namespaces/import-vars [[:default]]
potemkin.types/def-map-type [[:block 2] [:inner 1]]
potemkin.types/defprotocol+ [[:block 1] [:inner 1]]
potemkin.types/defrecord+ [[:block 2] [:inner 1]]
potemkin.types/deftype+ [[:block 2] [:inner 1]]
potemkin/def-map-type [[:block 2] [:inner 1]]
potemkin/defprotocol+ [[:block 1] [:inner 1]]
potemkin/defrecord+ [[:block 2] [:inner 1]]
potemkin/deftype+ [[:block 2] [:inner 1]]
potemkin/import-vars [[:default]]
taoensso.nippy/extend-freeze [[:inner 0]]
taoensso.nippy/extend-thaw [[:inner 0]]
throttle.core/with-throttling [[:block 1]]
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]]
clojure.test.check/quick-check [[:block 1]]
clojure.tools.macro/macrolet [[:block 1] [:inner 2 0]]
clojurewerkz.quartzite.jobs/build [[:default]]
clojurewerkz.quartzite.jobs/with-description [[:default]]
clojurewerkz.quartzite.jobs/with-identity [[:default]]
clojurewerkz.quartzite.schedule.cron/schedule [[:default]]
clojurewerkz.quartzite.schedule.cron/with-misfire-handling-instruction-do-nothing [[:default]]
clojurewerkz.quartzite.triggers/build [[:default]]
clojurewerkz.quartzite.triggers/with-description [[:default]]
clojurewerkz.quartzite.triggers/with-identity [[:default]]
clojurewerkz.quartzite.triggers/with-priority [[:default]]
clojurewerkz.quartzite.triggers/with-schedule [[:default]]
def-map-type [[:block 2] [:inner 1]]
defprotocol+ [[:block 1] [:inner 1]]
defrecord+ [[:block 2] [:inner 1]]
deftype+ [[:block 2] [:inner 1]]
net.cgrand.macrovich/case [[:block 0]]
potemkin.namespaces/import-vars [[:default]]
potemkin.types/def-map-type [[:block 2] [:inner 1]]
potemkin.types/defprotocol+ [[:block 1] [:inner 1]]
potemkin.types/defrecord+ [[:block 2] [:inner 1]]
potemkin.types/deftype+ [[:block 2] [:inner 1]]
potemkin/def-map-type [[:block 2] [:inner 1]]
potemkin/defprotocol+ [[:block 1] [:inner 1]]
potemkin/defrecord+ [[:block 2] [:inner 1]]
potemkin/deftype+ [[:block 2] [:inner 1]]
potemkin/import-vars [[:default]]
taoensso.nippy/extend-freeze [[:inner 0]]
taoensso.nippy/extend-thaw [[:inner 0]]
throttle.core/with-throttling [[:block 1]]
;; the rest of the stuff in this list is generated automatically based on `:style/indent` specs
;; by running [[dev.generate-cljfmt-config/specs]]... use that code to update this list
metabase-enterprise.cache.config-test/with-temp-persist-models [[:block 1]]
metabase-enterprise.impersonation.util-test/with-impersonations! [[:inner 0]]
metabase-enterprise.sandbox.test-util/with-gtaps! [[:inner 0]]
metabase-enterprise.sandbox.test-util/with-gtaps-for-user! [[:inner 0]]
metabase-enterprise.sandbox.test-util/with-user-attributes [[:block 2]]
metabase-enterprise.serialization.test-util/with-dbs [[:inner 0]]
metabase-enterprise.serialization.test-util/with-random-dump-dir [[:block 1]]
metabase-enterprise.serialization.test-util/with-world [[:block 0]]
metabase-enterprise.sso.integrations.jwt-test/with-users-with-email-deleted [[:block 1]]
metabase-enterprise.test/with-gtaps! [[:inner 0]]
metabase-enterprise.test/with-gtaps-for-user! [[:inner 0]]
metabase-enterprise.test/with-user-attributes [[:block 2]]
metabase.actions.actions-test/with-actions-test-data-and-actions-permissively-enabled [[:block 0]]
metabase.actions.test-util/with-actions [[:block 1]]
metabase.actions.test-util/with-actions-disabled [[:block 0]]
metabase.actions.test-util/with-actions-enabled [[:block 0]]
metabase.actions.test-util/with-actions-test-data [[:inner 0]]
metabase.actions.test-util/with-actions-test-data-and-actions-enabled [[:block 0]]
metabase.actions.test-util/with-actions-test-data-tables [[:block 1]]
metabase.actions.test-util/with-empty-db [[:inner 0]]
metabase.actions.test-util/with-temp-test-data [[:inner 0]]
metabase.api.common/check [[:default]]
metabase.api.common/define-routes [[:block 0]]
metabase.api.common/let-404 [[:block 1]]
metabase.app-db.core/with-application-db [[:inner 0]]
metabase.app-db.liquibase/with-liquibase [[:block 1]]
metabase.app-db.liquibase/with-scope-locked [[:block 1]]
metabase.app-db.schema-migrations-test.impl/test-migrations [[:block 2]]
metabase.cmd.copy/step [[:block 1]]
metabase.cmd.copy/with-connection-rollback-only [[:block 1]]
metabase.cmd.copy/with-disabled-db-constraints [[:block 2]]
metabase.collections.api-test/with-collection-hierarchy [[:block 1]]
metabase.collections.api-test/with-french-user-and-personal-collection [[:block 2]]
metabase.collections.api-test/with-some-children-of-collection [[:block 1]]
metabase.collections.models.collection-test/with-collection-hierarchy [[:block 1]]
metabase.collections.models.collection-test/with-current-user-perms-for-collections [[:block 1]]
metabase.collections.models.collection-test/with-personal-and-impersonal-collections [[:block 1]]
metabase.config/build-type-case [[:block 0]]
metabase.dashboards.models.dashboard-test/with-dash-in-collection [[:inner 0]]
metabase.driver-api.core/match [[:inner 0]]
metabase.driver-api.core/match-one [[:inner 0]]
metabase.driver-api.core/replace [[:inner 0]]
metabase.driver-api.core/replace-in [[:inner 0]]
metabase.driver.bigquery-cloud-sdk.query-processor/with-temporal-type [[:default]]
metabase.driver.druid.client/DELETE [[:default]]
metabase.driver.druid.client/GET [[:default]]
metabase.driver.druid.client/POST [[:default]]
metabase.driver.druid.query-processor-test/druid-query [[:block 0]]
metabase.driver.druid.query-processor-test/druid-query-returning-rows [[:block 0]]
metabase.driver.mongo.query-processor/mongo-let [[:block 1]]
metabase.driver.sql-jdbc.actions/with-jdbc-transaction [[:block 1]]
metabase.driver.sql-jdbc.connection/with-connection-spec-for-testing-connection [[:block 1]]
metabase.driver.sql-jdbc.execute.diagnostic/capturing-diagnostic-info [[:block 1]]
metabase.driver.sql.query-processor/apply-top-level-clause [[:default]]
metabase.driver/with-driver [[:block 1]]
metabase.embedding.api.embed-test/do-response-formats [[:block 1]]
metabase.embedding.api.embed-test/with-embedding-enabled-and-new-secret-key [[:block 0]]
metabase.embedding.api.embed-test/with-embedding-enabled-and-temp-card-referencing [[:block 3]]
metabase.embedding.api.embed-test/with-embedding-enabled-and-temp-dashcard-referencing [[:block 3]]
metabase.embedding.api.embed-test/with-new-secret-key [[:block 0]]
metabase.embedding.api.embed-test/with-temp-card [[:block 1]]
metabase.embedding.api.embed-test/with-temp-dashcard [[:block 1]]
metabase.embedding.api.preview-embed-test/with-embedding-enabled-and-new-secret-key [[:block 0]]
metabase.embedding.api.preview-embed-test/with-new-secret-key [[:block 0]]
metabase.lib.binning/with-binning [[:default]]
metabase.lib.core/with-binning [[:default]]
metabase.lib.core/with-join-alias [[:default]]
metabase.lib.core/with-join-conditions [[:default]]
metabase.lib.join/with-join-alias [[:default]]
metabase.lib.join/with-join-conditions [[:default]]
metabase.lib.test-util.macros/$ids [[:inner 0]]
metabase.lib.test-util.macros/mbql-5-query [[:inner 0]]
metabase.lib.test-util.macros/mbql-query [[:inner 0]]
metabase.lib.util.match/match [[:inner 0]]
metabase.lib.util.match/match-one [[:inner 0]]
metabase.lib.util.match/match-lite [[:inner 0]]
metabase.lib.util.match/match-lite-recursive [[:inner 0]]
metabase.lib.util.match/replace [[:inner 0]]
metabase.lib.util.match/replace-in [[:inner 0]]
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.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]]
metabase.public-sharing.api-test/with-sharing-enabled-and-temp-dashcard-referencing [[:block 3]]
metabase.public-sharing.api-test/with-temp-public-card [[:block 1]]
metabase.public-sharing.api-test/with-temp-public-dashboard [[:block 1]]
metabase.public-sharing.api-test/with-temp-public-dashboard-and-card [[:block 1]]
metabase.pulse.api.alert-test/with-alert-in-collection [[:block 1]]
metabase.pulse.dashboard-subscription-test/with-link-card-fixture-for-dashboard [[:block 2]]
metabase.pulse.models.pulse-test/with-dashboard-subscription-in-collection [[:block 1]]
metabase.pulse.models.pulse-test/with-pulse-in-collection [[:inner 0]]
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.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]]
metabase.query-processor.error-type/deferror [[:block 1]]
metabase.query-processor.middleware.cache-backend.interface/with-cached-results [[:block 4]]
metabase.query-processor.middleware.process-userland-query-test/with-query-execution [[:block 1]]
metabase.query-processor.store/cached [[:block 1]]
metabase.query-processor.store/with-metadata-provider [[:inner 0]]
metabase.query-processor.streaming/streaming-response [[:block 1]]
metabase.query-processor.test-util/format-rows-by [[:default]]
metabase.request.core/as-admin [[:block 0]]
metabase.request.core/with-current-request [[:inner 0]]
metabase.request.core/with-current-user [[:inner 0]]
metabase.request.core/with-limit-and-offset [[:inner 0]]
metabase.request.session/as-admin [[:block 0]]
metabase.request.session/with-current-user [[:inner 0]]
metabase.sample-data.impl-test/with-temp-sample-database-db [[:block 1]]
metabase.search.api-test/do-test-users [[:block 1]]
metabase.server.middleware.session/as-admin [[:block 0]]
metabase.server.middleware.session/with-current-user [[:inner 0]]
metabase.server.streaming-response-test/with-streaming-response-thread-pool [[:block 0]]
metabase.server.streaming-response-test/with-test-driver-db! [[:block 0]]
metabase.server.streaming-response/streaming-response [[:block 2]]
metabase.session.api/http-401-on-error [[:block 0]]
metabase.settings.core/define-multi-setting [[:inner 0]]
metabase.settings.core/defsetting [[:block 1]]
metabase.settings.models.setting.multi-setting/define-multi-setting [[:inner 0]]
metabase.settings.models.setting/defsetting [[:block 1]]
metabase.sync.fetch-metadata/log-if-error [[:block 1]]
metabase.sync.sync-metadata.fields-test/with-test-db [[:block 0]]
metabase.sync.util/do-with-start-and-finish-debug-logging [[:default]]
metabase.sync.util/sum-for [[:block 1]]
metabase.sync.util/sync-operation [[:block 3]]
metabase.sync.util/with-db-logging-disabled [[:default]]
metabase.sync.util/with-duplicate-ops-prevented [[:default]]
metabase.sync.util/with-emoji-progress-bar [[:block 1]]
metabase.sync.util/with-error-handling [[:block 1]]
metabase.sync.util/with-start-and-finish-logging [[:default]]
metabase.sync.util/with-start-and-finish-logging* [[:default]]
metabase.sync.util/with-sync-events [[:default]]
metabase.task-history.models.task-history/with-task-history [[:block 1]]
metabase.task.core/rerun-on-error [[:block 1]]
metabase.task.impl/rerun-on-error [[:block 1]]
metabase.test.data.datasets/test-driver [[:inner 0]]
metabase.test.data.datasets/test-drivers [[:inner 0]]
metabase.test.data.one-off-dbs/with-blank-db [[:block 0]]
metabase.test.data.one-off-dbs/with-blueberries-db [[:block 0]]
metabase.test.data.users/with-test-user [[:inner 0]]
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]]
metabase.test.data/with-temp-copy-of-db [[:block 0]]
metabase.test.util.public-settings/with-additional-premium-features [[:block 1]]
metabase.test.util.public-settings/with-premium-features [[:block 1]]
metabase.test.util.thread-local/test-helpers-set-global-values! [[:block 0]]
metabase.test.util/discard-setting-changes [[:block 1]]
metabase.test.util/let-url [[:block 1]]
metabase.test.util/throw-if-called! [[:block 1]]
metabase.test.util/with-temp-scheduler [[:block 0]]
metabase.test.util/with-temp-vals-in-db [[:block 3]]
metabase.test.util/with-user-in-groups [[:inner 0]]
metabase.test/$ids [[:inner 0]]
metabase.test/as-admin [[:inner 0]]
metabase.test/dataset [[:inner 0]]
metabase.test/discard-setting-changes [[:block 1]]
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]]
metabase.test/test-drivers [[:inner 0]]
metabase.test/test-helpers-set-global-values! [[:block 0]]
metabase.test/throw-if-called! [[:block 1]]
metabase.test/with-actions [[:block 1]]
metabase.test/with-actions-disabled [[:block 0]]
metabase.test/with-actions-enabled [[:block 0]]
metabase.test/with-actions-test-data [[:inner 0]]
metabase.test/with-actions-test-data-and-actions-enabled [[:block 0]]
metabase.test/with-actions-test-data-tables [[:block 1]]
metabase.test/with-additional-premium-features [[:block 1]]
metabase.test/with-current-user [[:inner 0]]
metabase.test/with-driver [[:block 1]]
metabase.test/with-empty-db [[:inner 0]]
metabase.test/with-empty-h2-app-db! [[:block 0]]
metabase.test/with-metadata-provider [[:inner 0]]
metabase.test/with-premium-features [[:block 1]]
metabase.test/with-temp [[:inner 0]]
metabase.test/with-temp-copy-of-db [[:block 0]]
metabase.test/with-temp-scheduler [[:block 0]]
metabase.test/with-temp-test-data [[:inner 0]]
metabase.test/with-temp-vals-in-db [[:block 3]]
metabase.test/with-test-user [[:inner 0]]
metabase.test/with-user-in-groups [[:inner 0]]
metabase.timeseries-query-processor-test.util/test-timeseries-drivers [[:block 0]]
metabase.timeseries-query-processor-test/run-mbql-query [[:inner 0]]
metabase.upload.impl-test/with-upload-table! [[:inner 0]]
metabase.upload.types/with-currency [[:default]]
metabase.upload.types/with-parens [[:default]]
metabase.util/for-map [[:block 1]]
metabase.util.async/cancelable-thread [[:block 0]]
metabase.util.date-2/with-time-zone-same-instant [[:default]]
metabase.util.encryption-test/with-secret-key [[:block 1]]
metabase.util.honey-sql-2/with-database-type-info [[:default]]
metabase.util.i18n/deferred-trs [[:default]]
metabase.util.i18n/deferred-tru [[:default]]
metabase.util.i18n/trs [[:default]]
metabase.util.i18n/trsn [[:default]]
metabase.util.i18n/tru [[:default]]
metabase.util.i18n/trun [[:default]]
metabase.util.jvm/auto-retry [[:block 1]]
metabase.util.jvm/varargs [[:block 1]]
metabase.util.jvm/with-us-locale [[:block 0]]
metabase.util.malli/disable-enforcement [[:block 0]]
metabase.util.malli/with [[:default]]
metabase.util.malli/with-api-error-message [[:default]]
metabase.util.namespaces/import-fns [[:default]]
metabase.util.queue-test/await-test-while [[:block 1]]
metabase.util/auto-retry [[:block 1]]
metabase.util/case-enum [[:block 1]]
metabase.util/ignore-exceptions [[:block 0]]
metabase.util/or-with [[:block 1]]
metabase.util/profile [[:block 1]]
metabase.util/prog1 [[:inner 0]]
metabase.util/varargs [[:inner 0]]
metabase.util/with-us-locale [[:block 0]]
metabuild-common.core/exit-when-finished-nonzero-on-exception [[:block 0]]
metabuild-common.core/step [[:block 1]]
metabuild-common.entrypoint/exit-when-finished-nonzero-on-exception [[:block 0]]
metabuild-common.steps/step [[:block 1]]
methodical.core/defmethod [[:inner 0]]
methodical.core/defmulti [[:inner 0]]
methodical.core/with-dispatcher [[:default]]
methodical.core/with-method-table [[:default]]
methodical.core/with-prefers [[:default]]
methodical.interface/with-dispatcher [[:default]]
methodical.interface/with-method-table [[:default]]
methodical.interface/with-prefers [[:default]]
methodical.macros/defmethod [[:inner 0]]
methodical.macros/defmulti [[:inner 0]]
saml20-clj.sp.response/validate-confirmation-datas [[:block 1]]
toucan2.connection/with-transaction [[:block 1]]
toucan2.core/build [[:block 0]]
toucan2.core/compile [[:block 0]]
toucan2.core/debug [[:block 0]]
toucan2.core/define-after-insert [[:inner 0]]
toucan2.core/define-after-select [[:inner 0]]
toucan2.core/define-after-update [[:inner 0]]
toucan2.core/define-before-delete [[:inner 0]]
toucan2.core/define-before-insert [[:inner 0]]
toucan2.core/define-before-select [[:inner 0]]
toucan2.core/define-default-fields [[:inner 0]]
toucan2.core/define-named-query [[:block 1]]
toucan2.core/deftransforms [[:block 1]]
toucan2.core/with-transaction [[:block 1]]
toucan2.tools.after-insert/define-after-insert [[:inner 0]]
toucan2.tools.after-select/define-after-select [[:inner 0]]
toucan2.tools.after-update/define-after-update [[:inner 0]]
toucan2.tools.after/define-after-impl [[:default]]
toucan2.tools.before-delete/define-before-delete [[:inner 0]]
toucan2.tools.before-insert/define-before-insert [[:inner 0]]
toucan2.tools.before-select/define-before-select [[:inner 0]]
toucan2.tools.compile/build [[:block 0]]
toucan2.tools.compile/compile [[:block 0]]
toucan2.tools.compile/resolved [[:block 0]]
toucan2.tools.debug/debug [[:block 0]]
toucan2.tools.default-fields/define-default-fields [[:inner 0]]
toucan2.tools.named-query/define-named-query [[:block 1]]
toucan2.tools.simple-out-transform/define-out-transform [[:inner 0]]
toucan2.tools.transformed/deftransforms [[:block 1]]
toucan2.tools.with-temp/with-temp [[:inner 0]]
toucan2.util/try-with-error-context [[:inner 0]]}}
metabase-enterprise.cache.config-test/with-temp-persist-models [[:block 1]]
metabase-enterprise.impersonation.util-test/with-impersonations! [[:inner 0]]
metabase-enterprise.sandbox.test-util/with-gtaps! [[:inner 0]]
metabase-enterprise.sandbox.test-util/with-gtaps-for-user! [[:inner 0]]
metabase-enterprise.sandbox.test-util/with-user-attributes [[:block 2]]
metabase-enterprise.serialization.test-util/with-dbs [[:inner 0]]
metabase-enterprise.serialization.test-util/with-random-dump-dir [[:block 1]]
metabase-enterprise.serialization.test-util/with-world [[:block 0]]
metabase-enterprise.sso.integrations.jwt-test/with-users-with-email-deleted [[:block 1]]
metabase-enterprise.test/with-gtaps! [[:inner 0]]
metabase-enterprise.test/with-gtaps-for-user! [[:inner 0]]
metabase-enterprise.test/with-user-attributes [[:block 2]]
metabase.actions.actions-test/with-actions-test-data-and-actions-permissively-enabled [[:block 0]]
metabase.actions.test-util/with-actions [[:block 1]]
metabase.actions.test-util/with-actions-disabled [[:block 0]]
metabase.actions.test-util/with-actions-enabled [[:block 0]]
metabase.actions.test-util/with-actions-test-data [[:inner 0]]
metabase.actions.test-util/with-actions-test-data-and-actions-enabled [[:block 0]]
metabase.actions.test-util/with-actions-test-data-tables [[:block 1]]
metabase.actions.test-util/with-empty-db [[:inner 0]]
metabase.actions.test-util/with-temp-test-data [[:inner 0]]
metabase.api.common/check [[:default]]
metabase.api.common/define-routes [[:block 0]]
metabase.api.common/let-404 [[:block 1]]
metabase.app-db.core/with-application-db [[:inner 0]]
metabase.app-db.liquibase/with-liquibase [[:block 1]]
metabase.app-db.liquibase/with-scope-locked [[:block 1]]
metabase.app-db.schema-migrations-test.impl/test-migrations [[:block 2]]
metabase.cmd.copy/step [[:block 1]]
metabase.cmd.copy/with-connection-rollback-only [[:block 1]]
metabase.cmd.copy/with-disabled-db-constraints [[:block 2]]
metabase.collections-rest.api-test/with-collection-hierarchy [[:block 1]]
metabase.collections-rest.api-test/with-french-user-and-personal-collection [[:block 2]]
metabase.collections-rest.api-test/with-some-children-of-collection [[:block 1]]
metabase.collections.models.collection-test/with-collection-hierarchy [[:block 1]]
metabase.collections.models.collection-test/with-current-user-perms-for-collections [[:block 1]]
metabase.collections.models.collection-test/with-personal-and-impersonal-collections [[:block 1]]
metabase.config/build-type-case [[:block 0]]
metabase.dashboards.models.dashboard-test/with-dash-in-collection [[:inner 0]]
metabase.driver-api.core/match [[:inner 0]]
metabase.driver-api.core/match-one [[:inner 0]]
metabase.driver-api.core/replace [[:inner 0]]
metabase.driver-api.core/replace-in [[:inner 0]]
metabase.driver.bigquery-cloud-sdk.query-processor/with-temporal-type [[:default]]
metabase.driver.druid.client/DELETE [[:default]]
metabase.driver.druid.client/GET [[:default]]
metabase.driver.druid.client/POST [[:default]]
metabase.driver.druid.query-processor-test/druid-query [[:block 0]]
metabase.driver.druid.query-processor-test/druid-query-returning-rows [[:block 0]]
metabase.driver.mongo.query-processor/mongo-let [[:block 1]]
metabase.driver.sql-jdbc.actions/with-jdbc-transaction [[:block 1]]
metabase.driver.sql-jdbc.connection/with-connection-spec-for-testing-connection [[:block 1]]
metabase.driver.sql-jdbc.execute.diagnostic/capturing-diagnostic-info [[:block 1]]
metabase.driver.sql.query-processor/apply-top-level-clause [[:default]]
metabase.driver/with-driver [[:block 1]]
metabase.embedding-rest.api.embed-test/do-response-formats [[:block 1]]
metabase.embedding-rest.api.embed-test/with-embedding-enabled-and-new-secret-key [[:block 0]]
metabase.embedding-rest.api.embed-test/with-embedding-enabled-and-temp-card-referencing [[:block 3]]
metabase.embedding-rest.api.embed-test/with-embedding-enabled-and-temp-dashcard-referencing [[:block 3]]
metabase.embedding-rest.api.embed-test/with-new-secret-key [[:block 0]]
metabase.embedding-rest.api.embed-test/with-temp-card [[:block 1]]
metabase.embedding-rest.api.embed-test/with-temp-dashcard [[:block 1]]
metabase.embedding-rest.api.preview-embed-test/with-embedding-enabled-and-new-secret-key [[:block 0]]
metabase.embedding-rest.api.preview-embed-test/with-new-secret-key [[:block 0]]
metabase.lib.binning/with-binning [[:default]]
metabase.lib.core/with-binning [[:default]]
metabase.lib.core/with-join-alias [[:default]]
metabase.lib.core/with-join-conditions [[:default]]
metabase.lib.join/with-join-alias [[:default]]
metabase.lib.join/with-join-conditions [[:default]]
metabase.lib.test-util.macros/$ids [[:inner 0]]
metabase.lib.test-util.macros/mbql-5-query [[:inner 0]]
metabase.lib.test-util.macros/mbql-query [[:inner 0]]
metabase.lib.util.match/match [[:inner 0]]
metabase.lib.util.match/match-one [[:inner 0]]
metabase.lib.util.match/match-lite [[:inner 0]]
metabase.lib.util.match/match-lite-recursive [[:inner 0]]
metabase.lib.util.match/replace [[:inner 0]]
metabase.lib.util.match/replace-in [[:inner 0]]
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.permissions.core/allow-changing-all-users-group-members [[:block 0]]
metabase.permissions.core/disable-perms-cache [[:block 0]]
metabase.public-sharing-rest.api-test/with-sharing-enabled-and-temp-card-referencing [[:block 3]]
metabase.public-sharing-rest.api-test/with-sharing-enabled-and-temp-dashcard-referencing [[:block 3]]
metabase.public-sharing-rest.api-test/with-temp-public-card [[:block 1]]
metabase.public-sharing-rest.api-test/with-temp-public-dashboard [[:block 1]]
metabase.public-sharing-rest.api-test/with-temp-public-dashboard-and-card [[:block 1]]
metabase.pulse.api.alert-test/with-alert-in-collection [[:block 1]]
metabase.pulse.dashboard-subscription-test/with-link-card-fixture-for-dashboard [[:block 2]]
metabase.pulse.models.pulse-test/with-dashboard-subscription-in-collection [[:block 1]]
metabase.pulse.models.pulse-test/with-pulse-in-collection [[:inner 0]]
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.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]]
metabase.query-processor.error-type/deferror [[:block 1]]
metabase.query-processor.middleware.cache-backend.interface/with-cached-results [[:block 4]]
metabase.query-processor.middleware.process-userland-query-test/with-query-execution [[:block 1]]
metabase.query-processor.store/cached [[:block 1]]
metabase.query-processor.store/with-metadata-provider [[:inner 0]]
metabase.query-processor.streaming/streaming-response [[:block 1]]
metabase.query-processor.test-util/format-rows-by [[:default]]
metabase.request.core/as-admin [[:block 0]]
metabase.request.core/with-current-request [[:inner 0]]
metabase.request.core/with-current-user [[:inner 0]]
metabase.request.core/with-limit-and-offset [[:inner 0]]
metabase.request.session/as-admin [[:block 0]]
metabase.request.session/with-current-user [[:inner 0]]
metabase.sample-data.impl-test/with-temp-sample-database-db [[:block 1]]
metabase.search.api-test/do-test-users [[:block 1]]
metabase.server.middleware.session/as-admin [[:block 0]]
metabase.server.middleware.session/with-current-user [[:inner 0]]
metabase.server.streaming-response-test/with-streaming-response-thread-pool [[:block 0]]
metabase.server.streaming-response-test/with-test-driver-db! [[:block 0]]
metabase.server.streaming-response/streaming-response [[:block 2]]
metabase.session.api/http-401-on-error [[:block 0]]
metabase.settings.core/define-multi-setting [[:inner 0]]
metabase.settings.core/defsetting [[:block 1]]
metabase.settings.models.setting.multi-setting/define-multi-setting [[:inner 0]]
metabase.settings.models.setting/defsetting [[:block 1]]
metabase.sync.fetch-metadata/log-if-error [[:block 1]]
metabase.sync.sync-metadata.fields-test/with-test-db [[:block 0]]
metabase.sync.util/do-with-start-and-finish-debug-logging [[:default]]
metabase.sync.util/sum-for [[:block 1]]
metabase.sync.util/sync-operation [[:block 3]]
metabase.sync.util/with-db-logging-disabled [[:default]]
metabase.sync.util/with-duplicate-ops-prevented [[:default]]
metabase.sync.util/with-emoji-progress-bar [[:block 1]]
metabase.sync.util/with-error-handling [[:block 1]]
metabase.sync.util/with-start-and-finish-logging [[:default]]
metabase.sync.util/with-start-and-finish-logging* [[:default]]
metabase.sync.util/with-sync-events [[:default]]
metabase.task-history.models.task-history/with-task-history [[:block 1]]
metabase.task.core/rerun-on-error [[:block 1]]
metabase.task.impl/rerun-on-error [[:block 1]]
metabase.test.data.datasets/test-driver [[:inner 0]]
metabase.test.data.datasets/test-drivers [[:inner 0]]
metabase.test.data.one-off-dbs/with-blank-db [[:block 0]]
metabase.test.data.one-off-dbs/with-blueberries-db [[:block 0]]
metabase.test.data.users/with-test-user [[:inner 0]]
metabase.test.data/$ids [[:inner 0]]
metabase.test.data/dataset [[:inner 0]]
metabase.test.data/mbql-query [[:inner 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]]
metabase.test.data/with-temp-copy-of-db [[:block 0]]
metabase.test.util.public-settings/with-additional-premium-features [[:block 1]]
metabase.test.util.public-settings/with-premium-features [[:block 1]]
metabase.test.util.thread-local/test-helpers-set-global-values! [[:block 0]]
metabase.test.util/discard-setting-changes [[:block 1]]
metabase.test.util/let-url [[:block 1]]
metabase.test.util/throw-if-called! [[:block 1]]
metabase.test.util/with-temp-scheduler [[:block 0]]
metabase.test.util/with-temp-vals-in-db [[:block 3]]
metabase.test.util/with-user-in-groups [[:inner 0]]
metabase.test/$ids [[:inner 0]]
metabase.test/as-admin [[:inner 0]]
metabase.test/dataset [[:inner 0]]
metabase.test/discard-setting-changes [[:block 1]]
metabase.test/format-rows-by [[:default]]
metabase.test/let-url [[:block 1]]
metabase.test/mbql-query [[:inner 0]]
metabase.test/query [[:block 1]]
metabase.test/run-mbql-query [[:inner 0]]
metabase.test/test-driver [[:inner 0]]
metabase.test/test-drivers [[:inner 0]]
metabase.test/test-helpers-set-global-values! [[:block 0]]
metabase.test/throw-if-called! [[:block 1]]
metabase.test/with-actions [[:block 1]]
metabase.test/with-actions-disabled [[:block 0]]
metabase.test/with-actions-enabled [[:block 0]]
metabase.test/with-actions-test-data [[:inner 0]]
metabase.test/with-actions-test-data-and-actions-enabled [[:block 0]]
metabase.test/with-actions-test-data-tables [[:block 1]]
metabase.test/with-additional-premium-features [[:block 1]]
metabase.test/with-current-user [[:inner 0]]
metabase.test/with-driver [[:block 1]]
metabase.test/with-empty-db [[:inner 0]]
metabase.test/with-empty-h2-app-db! [[:block 0]]
metabase.test/with-metadata-provider [[:inner 0]]
metabase.test/with-premium-features [[:block 1]]
metabase.test/with-temp [[:inner 0]]
metabase.test/with-temp-copy-of-db [[:block 0]]
metabase.test/with-temp-scheduler [[:block 0]]
metabase.test/with-temp-test-data [[:inner 0]]
metabase.test/with-temp-vals-in-db [[:block 3]]
metabase.test/with-test-user [[:inner 0]]
metabase.test/with-user-in-groups [[:inner 0]]
metabase.timeseries-query-processor-test.util/test-timeseries-drivers [[:block 0]]
metabase.timeseries-query-processor-test/run-mbql-query [[:inner 0]]
metabase.upload.impl-test/with-upload-table! [[:inner 0]]
metabase.upload.types/with-currency [[:default]]
metabase.upload.types/with-parens [[:default]]
metabase.util/for-map [[:block 1]]
metabase.util.async/cancelable-thread [[:block 0]]
metabase.util.date-2/with-time-zone-same-instant [[:default]]
metabase.util.encryption-test/with-secret-key [[:block 1]]
metabase.util.honey-sql-2/with-database-type-info [[:default]]
metabase.util.i18n/deferred-trs [[:default]]
metabase.util.i18n/deferred-tru [[:default]]
metabase.util.i18n/trs [[:default]]
metabase.util.i18n/trsn [[:default]]
metabase.util.i18n/tru [[:default]]
metabase.util.i18n/trun [[:default]]
metabase.util.jvm/auto-retry [[:block 1]]
metabase.util.jvm/varargs [[:block 1]]
metabase.util.jvm/with-us-locale [[:block 0]]
metabase.util.malli/disable-enforcement [[:block 0]]
metabase.util.malli/with [[:default]]
metabase.util.malli/with-api-error-message [[:default]]
metabase.util.namespaces/import-fns [[:default]]
metabase.util.queue-test/await-test-while [[:block 1]]
metabase.util/auto-retry [[:block 1]]
metabase.util/case-enum [[:block 1]]
metabase.util/ignore-exceptions [[:block 0]]
metabase.util/or-with [[:block 1]]
metabase.util/profile [[:block 1]]
metabase.util/prog1 [[:inner 0]]
metabase.util/varargs [[:inner 0]]
metabase.util/with-us-locale [[:block 0]]
metabuild-common.core/exit-when-finished-nonzero-on-exception [[:block 0]]
metabuild-common.core/step [[:block 1]]
metabuild-common.entrypoint/exit-when-finished-nonzero-on-exception [[:block 0]]
metabuild-common.steps/step [[:block 1]]
methodical.core/defmethod [[:inner 0]]
methodical.core/defmulti [[:inner 0]]
methodical.core/with-dispatcher [[:default]]
methodical.core/with-method-table [[:default]]
methodical.core/with-prefers [[:default]]
methodical.interface/with-dispatcher [[:default]]
methodical.interface/with-method-table [[:default]]
methodical.interface/with-prefers [[:default]]
methodical.macros/defmethod [[:inner 0]]
methodical.macros/defmulti [[:inner 0]]
saml20-clj.sp.response/validate-confirmation-datas [[:block 1]]
toucan2.connection/with-transaction [[:block 1]]
toucan2.core/build [[:block 0]]
toucan2.core/compile [[:block 0]]
toucan2.core/debug [[:block 0]]
toucan2.core/define-after-insert [[:inner 0]]
toucan2.core/define-after-select [[:inner 0]]
toucan2.core/define-after-update [[:inner 0]]
toucan2.core/define-before-delete [[:inner 0]]
toucan2.core/define-before-insert [[:inner 0]]
toucan2.core/define-before-select [[:inner 0]]
toucan2.core/define-default-fields [[:inner 0]]
toucan2.core/define-named-query [[:block 1]]
toucan2.core/deftransforms [[:block 1]]
toucan2.core/with-transaction [[:block 1]]
toucan2.tools.after-insert/define-after-insert [[:inner 0]]
toucan2.tools.after-select/define-after-select [[:inner 0]]
toucan2.tools.after-update/define-after-update [[:inner 0]]
toucan2.tools.after/define-after-impl [[:default]]
toucan2.tools.before-delete/define-before-delete [[:inner 0]]
toucan2.tools.before-insert/define-before-insert [[:inner 0]]
toucan2.tools.before-select/define-before-select [[:inner 0]]
toucan2.tools.compile/build [[:block 0]]
toucan2.tools.compile/compile [[:block 0]]
toucan2.tools.compile/resolved [[:block 0]]
toucan2.tools.debug/debug [[:block 0]]
toucan2.tools.default-fields/define-default-fields [[:inner 0]]
toucan2.tools.named-query/define-named-query [[:block 1]]
toucan2.tools.simple-out-transform/define-out-transform [[:inner 0]]
toucan2.tools.transformed/deftransforms [[:block 1]]
toucan2.tools.with-temp/with-temp [[:inner 0]]
toucan2.util/try-with-error-context [[: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

@@ -2,3 +2,4 @@ frontend/src/cljs
frontend/src/cljs_release
e2e/support/cypress_sample_database.js
e2e/support/cypress_sample_instance_data.js
e2e/embedding-sdk-host-apps

View File

@@ -94,10 +94,7 @@ module.exports = {
"react/jsx-no-target-blank": 2,
"react/jsx-key": 2,
"react/forbid-component-props": [2, { forbid: ["sx"] }],
"react-hooks/exhaustive-deps": [
"warn",
{ additionalHooks: "(useSafeAsyncFunction)" },
],
"react-hooks/exhaustive-deps": ["warn"],
"prefer-const": [1, { destructuring: "all" }],
"no-restricted-globals": ["error", "close"],
"no-useless-escape": 0,
@@ -118,7 +115,6 @@ module.exports = {
"And",
"When",
"Then",
"describeWithSnowplow",
],
},
],
@@ -136,7 +132,7 @@ module.exports = {
},
env: {
browser: true,
es6: true,
es2020: true,
commonjs: true,
jest: true,
"jest/globals": true,
@@ -184,6 +180,7 @@ module.exports = {
"no-unconditional-metabase-links-render": "error",
"no-color-literals": "error",
"no-literal-metabase-strings": "error",
"no-oss-reinitialize-import": "error",
"depend/ban-dependencies": [
"error",
{
@@ -203,6 +200,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/*",
@@ -243,6 +241,7 @@ module.exports = {
plugins: ["@typescript-eslint"],
rules: {
"prefer-rest-params": "off",
"react/prop-types": "off", // TypeScript handles prop validation
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-explicit-any": "off",
@@ -347,5 +346,11 @@ module.exports = {
"import/no-commonjs": "off",
},
},
{
files: ["**/*.stories.tsx", "**/preview.tsx"],
rules: {
"import/no-default-export": "off",
},
},
],
};

View File

@@ -3,7 +3,7 @@
> **Warning**
>
> If that is your first contribution to Metabase, please sign the [Contributor License Agreement](https://docs.google.com/a/metabase.com/forms/d/1oV38o7b9ONFSwuzwmERRMi9SYrhYeOrkbmNaq9pOJ_E/viewform) (unless it's a tiny documentation change). Also, if you're attempting to fix a translation issue, please submit your changes to our [Crowdin project](https://crowdin.com/project/metabase-i18n) instead of opening a PR.
> If that is your first contribution to Metabase, please sign the [Contributor License Agreement](https://docs.google.com/a/metabase.com/forms/d/1oV38o7b9ONFSwuzwmERRMi9SYrhYeOrkbmNaq9pOJ_E/viewform). Also, if you're attempting to fix a translation issue, please submit your changes to our [Crowdin project](https://crowdin.com/project/metabase-i18n) instead of opening a PR.
Closes https://github.com/metabase/metabase/issues/[issue_number]

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

@@ -74,7 +74,7 @@ runs:
git push -u origin ${BACKPORT_BRANCH}
BACKPORT_PR_URL=$(gh pr create --base "${TARGET_BRANCH}" --head "${BACKPORT_BRANCH}" --label "was-backported" --assignee "${GITHUB_ACTOR}" --title "🤖 backported \"${ORIGINAL_TITLE}\"" --body "${PR_BODY}")
BACKPORT_PR_URL=$(gh pr create --base "${TARGET_BRANCH}" --head "${BACKPORT_BRANCH}" --label "was-backported" --assignee "${{ github.event.pull_request.user.login }}" --title "🤖 backported \"${ORIGINAL_TITLE}\"" --body "${PR_BODY}")
BACKPORT_PR_NUMBER=${BACKPORT_PR_URL##*/}
echo "backport_pr_number=$BACKPORT_PR_NUMBER" >> $GITHUB_OUTPUT

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

@@ -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

@@ -10,28 +10,67 @@ inputs:
required: true
default: false
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 +79,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 }}
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

@@ -48,11 +48,11 @@ 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

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,9 +45,14 @@ frontend_sources: &frontend_sources
- "enterprise/frontend/!(test)**/**/{!(*.spec),}.{js,jsx,ts,tsx,css}"
- "frontend/!(test)**/**/{!(*.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/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}"
# 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}"
frontend_specs: &frontend_specs
- *shared_specs
@@ -69,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"
@@ -110,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-*"
@@ -120,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
@@ -163,6 +176,7 @@ yaml:
- "**/*.yaml"
codeql:
- ".github/workflows/codeql.yml"
- "frontend/src/**"
- "enterprise/frontend/src/**"

171
.github/scripts/average-e2e-timings.js vendored Normal file
View File

@@ -0,0 +1,171 @@
const fs = require("fs");
const path = require("path");
const { execSync } = require("child_process");
const collectAndAverageTimings = async ({
github,
context,
daysBack = 7,
existingTimingsPath = "e2e/support/timings.json",
}) => {
try {
const artifacts = await findMergedTimingArtifacts({
github,
context,
daysBack,
});
if (artifacts.length === 0) {
throw new Error("No timing artifacts found in the specified time range");
}
const timingData = await downloadAndExtractArtifacts(
artifacts,
github,
context,
);
if (timingData.length === 0) {
throw new Error("No valid timing data extracted from artifacts");
}
const averagedTimings = averageTimings(timingData);
averagedTimings.durations.sort((a, b) => a.spec.localeCompare(b.spec));
fs.writeFileSync(
existingTimingsPath,
JSON.stringify(averagedTimings, null, 2),
);
console.log(`✅ Updated ${existingTimingsPath} with new timing data`);
return { artifactCount: timingData.length };
} catch (error) {
console.error("❌ Error in collectAndAverageTimings:", error.message);
throw error;
}
};
const findMergedTimingArtifacts = async ({ github, context, daysBack }) => {
const cutoffDate = new Date();
cutoffDate.setDate(cutoffDate.getDate() - daysBack);
console.log(
`Searching for merged timing artifacts created after ${cutoffDate.toISOString()}`,
);
const artifacts = [];
let page = 1;
while (true) {
try {
const { data } = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
name: "merged-e2e-timings",
per_page: 100,
page,
});
const validArtifacts = data.artifacts
.filter((a) => new Date(a.created_at) > cutoffDate && !a.expired)
.map(({ name, created_at, id }) => ({ name, created_at, id }));
artifacts.push(...validArtifacts);
if (
data.artifacts.some((a) => new Date(a.created_at) <= cutoffDate) ||
data.artifacts.length < 100
) {
break;
}
page++;
} catch (error) {
console.log(
`Error fetching artifacts page ${page - 1}: ${error.message}`,
);
break;
}
}
console.log(`Found ${artifacts.length} merged timing artifacts total`);
return artifacts;
};
const downloadAndExtractArtifacts = async (artifacts, github, context) => {
const tempDir = "timing-artifacts-temp";
fs.mkdirSync(tempDir, { recursive: true });
const timingData = [];
for (const artifact of artifacts) {
try {
console.log(`Downloading artifact: ${artifact.name}`);
const zipPath = path.join(tempDir, `${artifact.name}.zip`);
const extractPath = path.join(tempDir, artifact.name);
const { data } = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact.id,
archive_format: "zip",
});
fs.writeFileSync(zipPath, Buffer.from(data));
fs.mkdirSync(extractPath, { recursive: true });
execSync(`unzip -q "${zipPath}" -d "${extractPath}"`);
const timingFilePath = path.join(extractPath, "runTimings.json");
if (fs.existsSync(timingFilePath)) {
const content = JSON.parse(fs.readFileSync(timingFilePath, "utf8"));
if (content.durations?.length) {
timingData.push(content);
console.log(
`✅ Extracted timing data from ${artifact.name} (${content.durations.length} specs)`,
);
} else {
console.log(`⚠ Invalid timing data structure in ${artifact.name}`);
}
} else {
console.log(`⚠ No timing data found in ${artifact.name}`);
}
fs.rmSync(extractPath, { recursive: true });
} catch (error) {
console.log(`❌ Error processing ${artifact.name}: ${error.message}`);
}
}
fs.rmSync(tempDir, { recursive: true });
console.log(
`Successfully extracted timing data from ${timingData.length}/${artifacts.length} artifacts`,
);
return timingData;
};
const averageTimings = (timingDataArray) => {
if (!timingDataArray.length) {
throw new Error("No timing data to process");
}
const specTimings = timingDataArray
.flatMap((data) => data.durations)
.filter((item) => item.spec && typeof item.duration === "number")
.reduce((acc, { spec, duration }) => {
(acc[spec] = acc[spec] || []).push(duration);
return acc;
}, {});
const durations = Object.entries(specTimings).map(([spec, durations]) => ({
spec,
duration: Math.round(
durations.reduce((sum, d) => sum + d, 0) / durations.length,
),
}));
return { durations };
};
module.exports = { collectAndAverageTimings, averageTimings };

View File

@@ -0,0 +1,132 @@
const { averageTimings } = require("./average-e2e-timings");
describe("averageTimings", () => {
it("should throw error when given empty array", () => {
expect(() => averageTimings([])).toThrow("No timing data to process");
});
it("should work for n=1", () => {
const input = [
{
durations: [
{ spec: "test1.cy.js", duration: 1000 },
{ spec: "test2.cy.js", duration: 2000 },
],
},
];
const result = averageTimings(input);
expect(result.durations).toHaveLength(2);
expect(result.durations).toContainEqual({
spec: "test1.cy.js",
duration: 1000,
});
expect(result.durations).toContainEqual({
spec: "test2.cy.js",
duration: 2000,
});
});
it("should calculate average for multiple specs", () => {
const input = [
{
durations: [
{ spec: "test1.cy.js", duration: 1000 },
{ spec: "test2.cy.js", duration: 2000 },
],
},
{
durations: [
{ spec: "test1.cy.js", duration: 2000 },
{ spec: "test2.cy.js", duration: 4000 },
],
},
];
const result = averageTimings(input);
expect(result.durations).toHaveLength(2);
expect(result.durations).toContainEqual({
spec: "test1.cy.js",
duration: 1500,
});
expect(result.durations).toContainEqual({
spec: "test2.cy.js",
duration: 3000,
});
});
it("should round averages to nearest integer", () => {
const input = [
{
durations: [{ spec: "test1.cy.js", duration: 1001 }],
},
{
durations: [{ spec: "test1.cy.js", duration: 1002 }],
},
];
const result = averageTimings(input);
expect(result.durations[0].duration).toBe(1002);
});
it("should ignore invalid entries", () => {
const input = [
{
durations: [
{ spec: "test1.cy.js", duration: 1000 },
{ spec: "test2.cy.js", duration: "invalid" },
{ duration: 2000 }, // missing spec
{ spec: "test3.cy.js", duration: 3000 },
],
},
];
const result = averageTimings(input);
expect(result.durations).toHaveLength(2);
expect(result.durations).toContainEqual({
spec: "test1.cy.js",
duration: 1000,
});
expect(result.durations).toContainEqual({
spec: "test3.cy.js",
duration: 3000,
});
});
it("should handle merging different specs", () => {
const input = [
{
durations: [
{ spec: "test1.cy.js", duration: 1000 },
{ spec: "test2.cy.js", duration: 2000 },
],
},
{
durations: [
{ spec: "test1.cy.js", duration: 3000 },
{ spec: "test3.cy.js", duration: 1000 },
],
},
];
const result = averageTimings(input);
expect(result.durations).toHaveLength(3);
expect(result.durations).toContainEqual({
spec: "test1.cy.js",
duration: 2000,
});
expect(result.durations).toContainEqual({
spec: "test2.cy.js",
duration: 2000,
});
expect(result.durations).toContainEqual({
spec: "test3.cy.js",
duration: 1000,
});
});
});

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

@@ -1,24 +1,66 @@
exports.updateComment = updateComment;
const TYPES = new Set([
"feat",
"fix",
"perf",
"docs",
"style",
"refactor",
"test",
"build",
"ci",
]);
/**
* @param title {string}
*/
function isConventionalTitle(title) {
const match = /^(?<type>\w+)\((?<rawScopes>[^)]+)\):/.exec(title);
if (!match) {
return false;
}
const [, type, rawScopes] = match;
const scopes = rawScopes
.split(",")
.map((scope) => scope.trim())
.filter(Boolean);
return TYPES.has(type) && scopes.length > 0;
}
/** @param {import('@types/github-script').AsyncFunctionArguments} AsyncFunctionArguments */
async function updateComment({ github, context }) {
async function updateCommentForEmbedding({ github, context }) {
const githubUsername = context.payload.sender.login;
const comment = `${CONVENTIONAL_COMMIT_REMINDER_COMMENT_IDENTIFIER}
@${githubUsername} You have modified embedding SDK code. Please make sure the PR title follows [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) style.
Here are all the supported types that will be shown in the changelog:
const comment = `${CONVENTIONAL_COMMENT_IDENTIFIER}
@${githubUsername} You have modified embedding code. Please make sure the PR title follows [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) style.
Here are all the supported types:
- \`feat\`
- \`fix\`
- \`perf\`
- \`docs\`
- \`style\`
- \`refactor\`
- \`test\`
- \`build\`
- \`ci\`
These types \`docs\`, \`style\`, \`refactor\`, \`test\`, \`build\`, and \`ci\` are also encouraged for non-changelog related tasks.
Please also make sure to include \`sdk\` scope, otherwise, the changelog will not include this task.
Please also make sure to include a scope.
For example, these are valid PR titles:
- \`feat(sdk): Add interactive dashboard component\`
- \`feat(sdk): Support theming pie chart\`
- \`fix(sdk): Fix static dashboard crash\``;
- \`feat(sdk-bundle): Add interactive dashboard component\`
- \`fix(sdk-package): Fixed MetabaseProviderPropsStore logic\`
- \`fix(sdk-package, embed-js): Fix API\``;
return updateComment(comment, { github, context });
}
/**
* @param comment {string}
* @param {import('@types/github-script').AsyncFunctionArguments} AsyncFunctionArguments
*/
async function updateComment(comment, { github, context }) {
const owner = context.repo.owner;
const repo = context.repo.repo;
const pullRequestNumber = context.issue.number;
@@ -49,20 +91,19 @@ For example, these are valid PR titles:
}
}
const CONVENTIONAL_COMMIT_REMINDER_COMMENT_IDENTIFIER =
"<!---conventional commit reminder comment ID-->";
const CONVENTIONAL_COMMENT_IDENTIFIER =
"<!---conventional comment identifier-->";
/**
* @typedef Comment
* @property {string} body
*
* @param {Comment[]} comments
* @param comments {{body: string}[]}
*/
function getExistingConventionalCommitReminderComment(comments) {
for (const comment of comments) {
if (
comment.body.startsWith(CONVENTIONAL_COMMIT_REMINDER_COMMENT_IDENTIFIER)
) {
if (comment.body.startsWith(CONVENTIONAL_COMMENT_IDENTIFIER)) {
return comment;
}
}
}
exports.isConventionalTitle = isConventionalTitle;
exports.updateCommentForEmbedding = updateCommentForEmbedding;

View File

@@ -0,0 +1,45 @@
const { isConventionalTitle } = require("./utils");
describe("isConventionalTitle", () => {
it("returns true for a simple conventional commit", () => {
expect(isConventionalTitle("feat: add new feature")).toBe(false);
});
it("returns true for a commit with a scope", () => {
expect(isConventionalTitle("fix(api): correct API bug")).toBe(true);
});
it("returns true for a commit with multiple scopes, comma separated", () => {
expect(isConventionalTitle("feat(build,deps): update dependencies")).toBe(
true,
);
});
it("returns true for a commit with multiple scopes, comma separated with space", () => {
expect(isConventionalTitle("feat(build, deps): update dependencies")).toBe(
true,
);
});
it("returns false for a commit with round brackets in a message", () => {
expect(isConventionalTitle("feat: (something) update dependencies")).toBe(
false,
);
});
it("returns false for missing colon", () => {
expect(isConventionalTitle("feat add feature")).toBe(false);
});
it("returns false for invalid type", () => {
expect(isConventionalTitle("invalidType: some message")).toBe(false);
});
it("returns false for empty message", () => {
expect(isConventionalTitle("feat:")).toBe(false);
});
it("returns false for empty input", () => {
expect(isConventionalTitle("")).toBe(false);
});
});

View File

@@ -0,0 +1,39 @@
const extractChangedTimings = ({ oldTimings, newTimings }) => {
const oldTimingMap =
oldTimings.durations?.reduce((map, item) => {
if (item.spec) {
map[item.spec] = item.duration;
}
return map;
}, {}) || {};
const changedDurations = newTimings.durations
.filter((item) => {
if (!item || !item.spec || typeof item.duration !== "number") {
return false;
}
const newSpec = convertPathFormat(item.spec);
const oldDuration = oldTimingMap[newSpec] || oldTimingMap[item.spec];
// Include if it's a new spec or the duration has changed
return oldDuration === undefined || oldDuration !== item.duration;
})
.map((item) => ({
spec: convertPathFormat(item.spec),
duration: item.duration,
}));
return {
changedTimings: { durations: changedDurations },
hasChanges: changedDurations.length > 0,
};
};
// Convert cypress-split path format to timings.json path format
// from "e2e/test/scenarios/..." to "../test/scenarios/..."
function convertPathFormat(specPath) {
return specPath.startsWith("e2e/test/")
? specPath.replace("e2e/test/", "../test/")
: specPath;
}
module.exports = { extractChangedTimings };

View File

@@ -0,0 +1,195 @@
const { extractChangedTimings } = require("./extract-changed-timings");
describe("extractChangedTimings", () => {
it("should return empty durations when no changes", () => {
const oldTimings = {
durations: [
{ spec: "test1.cy.js", duration: 1000 },
{ spec: "test2.cy.js", duration: 2000 },
],
};
const newTimings = {
durations: [
{ spec: "test1.cy.js", duration: 1000 },
{ spec: "test2.cy.js", duration: 2000 },
],
};
const result = extractChangedTimings({ oldTimings, newTimings });
expect(result.changedTimings.durations).toHaveLength(0);
expect(result.hasChanges).toBe(false);
});
it("should detect new specs", () => {
const oldTimings = {
durations: [{ spec: "test1.cy.js", duration: 1000 }],
};
const newTimings = {
durations: [
{ spec: "test1.cy.js", duration: 1000 },
{ spec: "test2.cy.js", duration: 2000 },
],
};
const result = extractChangedTimings({ oldTimings, newTimings });
expect(result.changedTimings.durations).toHaveLength(1);
expect(result.changedTimings.durations[0]).toEqual({
spec: "test2.cy.js",
duration: 2000,
});
expect(result.hasChanges).toBe(true);
});
it("should detect duration changes", () => {
const oldTimings = {
durations: [
{ spec: "test1.cy.js", duration: 1000 },
{ spec: "test2.cy.js", duration: 2000 },
],
};
const newTimings = {
durations: [
{ spec: "test1.cy.js", duration: 1000 },
{ spec: "test2.cy.js", duration: 2200 },
],
};
const result = extractChangedTimings({ oldTimings, newTimings });
expect(result.changedTimings.durations).toHaveLength(1);
expect(result.changedTimings.durations[0]).toEqual({
spec: "test2.cy.js",
duration: 2200,
});
expect(result.hasChanges).toBe(true);
});
it("should handle missing old timings", () => {
const oldTimings = { durations: [] };
const newTimings = {
durations: [
{ spec: "test1.cy.js", duration: 1000 },
{ spec: "test2.cy.js", duration: 2000 },
],
};
const result = extractChangedTimings({ oldTimings, newTimings });
// All timings should be considered "changed" since old timings is empty
expect(result.changedTimings.durations).toHaveLength(2);
expect(result.changedTimings.durations).toContainEqual({
spec: "test1.cy.js",
duration: 1000,
});
expect(result.changedTimings.durations).toContainEqual({
spec: "test2.cy.js",
duration: 2000,
});
expect(result.hasChanges).toBe(true);
});
it("should handle invalid timing entries", () => {
const oldTimings = {
durations: [{ spec: "test1.cy.js", duration: 1000 }],
};
const newTimings = {
durations: [
{ spec: "test1.cy.js", duration: 1000 },
{ spec: "test2.cy.js", duration: "invalid" },
{ duration: 2000 }, // missing spec
{ spec: "test3.cy.js", duration: 3000 },
],
};
const result = extractChangedTimings({ oldTimings, newTimings });
// Only test3.cy.js should be included (new spec with valid data)
expect(result.changedTimings.durations).toHaveLength(1);
expect(result.changedTimings.durations[0]).toEqual({
spec: "test3.cy.js",
duration: 3000,
});
expect(result.hasChanges).toBe(true);
});
it("should handle timing data with different specs", () => {
const oldTimings = {
durations: [
{ spec: "test1.cy.js", duration: 1000 },
{ spec: "test2.cy.js", duration: 2000 },
],
};
const newTimings = {
durations: [
{ spec: "test1.cy.js", duration: 3000 },
{ spec: "test3.cy.js", duration: 1000 },
],
};
const result = extractChangedTimings({ oldTimings, newTimings });
expect(result.changedTimings.durations).toHaveLength(2);
expect(result.changedTimings.durations).toContainEqual({
spec: "test1.cy.js",
duration: 3000,
});
expect(result.changedTimings.durations).toContainEqual({
spec: "test3.cy.js",
duration: 1000,
});
expect(result.hasChanges).toBe(true);
});
it("should convert cypress-split paths to relative paths", () => {
const oldTimings = {
durations: [
{
spec: "../test/scenarios/dashboard/dashboard.cy.spec.js",
duration: 1000,
},
{
spec: "../test/scenarios/admin/databases.cy.spec.js",
duration: 2000,
},
],
};
const newTimings = {
durations: [
{
spec: "e2e/test/scenarios/dashboard/dashboard.cy.spec.js",
duration: 1200,
},
{
spec: "e2e/test/scenarios/admin/databases.cy.spec.js",
duration: 2000,
},
{
spec: "e2e/test/scenarios/collections/collections.cy.spec.js",
duration: 1500,
},
],
};
const result = extractChangedTimings({ oldTimings, newTimings });
expect(result.changedTimings.durations).toHaveLength(2);
expect(result.changedTimings.durations).toContainEqual({
spec: "../test/scenarios/dashboard/dashboard.cy.spec.js",
duration: 1200,
});
expect(result.changedTimings.durations).toContainEqual({
spec: "../test/scenarios/collections/collections.cy.spec.js",
duration: 1500,
});
expect(result.hasChanges).toBe(true);
});
});

84
.github/scripts/get-issue-data.js vendored Normal file
View File

@@ -0,0 +1,84 @@
const githubSlackMap = require("../../release/github-slack-map.json");
async function getIssueData({ context, github, manualIssueNumber }) {
let issueNumber;
let issueData;
let prReviews = [];
const triggerType = context.eventName;
if (context.eventName === "issues") {
issueNumber = context.payload.issue.number;
issueData = context.payload.issue;
} else if (context.eventName === "workflow_dispatch") {
issueNumber = parseInt(manualIssueNumber);
const { data } = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
});
issueData = data;
} else if (context.eventName === "pull_request_review") {
const prNumber = context.payload.pull_request.number;
const { data: prData } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
});
// Extract issue number from branch name (e.g., "claude-fix/issue-12345-some-title")
const branchMatch = prData.head.ref.match(/claude-fix\/issue-(\d+)/);
if (!branchMatch) {
throw new Error(
`Could not extract issue number from branch name: ${prData.head.ref}`,
);
}
issueNumber = parseInt(branchMatch[1]);
const { data } = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
});
issueData = data;
const { data: reviews } = await github.rest.pulls.listReviews({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
});
prReviews = reviews.filter(
(review) =>
review.state === "CHANGES_REQUESTED" &&
isMetabaseMember(review.user.login),
);
}
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
});
const employeeComments = comments.filter((comment) =>
isMetabaseMember(comment.user.login),
);
return {
issueNumber,
issueData,
employeeComments,
prReviews,
triggerType,
isIssueAuthorEmployee: isMetabaseMember(issueData.user.login),
};
}
function isMetabaseMember(username) {
return username in githubSlackMap;
}
module.exports = {
getIssueData,
};

30
.github/scripts/setup-python-runner.sh vendored Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
set -e
# Parse command line arguments
SKIP_START=false
while [[ $# -gt 0 ]]; do
case $1 in
--skip-start)
SKIP_START=true
shift
;;
*)
echo "Unknown option: $1"
echo "Usage: $0 [--skip-start]"
exit 1
;;
esac
done
echo "Cloning python-runner repository..."
git clone --depth 1 https://${METABASE_AUTOMATION_USER_TOKEN}@github.com/metabase/python-runner-container.git python-runner
if [ "$SKIP_START" = false ]; then
echo "Starting python-runner..."
cd python-runner
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

53
.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,10 +44,13 @@
"label": ".Team/DevEx",
"members": [
"camsaul",
"escherize"
"dpsutton",
"escherize",
"fraserdrops",
"nemanjaglumac"
]
},
{
{
"name": "Metabot",
"label": ".Team/Metabot",
"members": [
@@ -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,24 @@
"edpaget",
"deniskaber",
"alxnddr",
"bpander"
"bpander",
"andsalves",
"gantoreno"
]
},
{
"name": "Gadget",
"label": ".Team/Gadget",
"members": [
"nmezzopera",
"bronsa",
"wotbrew",
"qnkhuat",
"chodorowicz",
"kamilmielnik",
"stasgavrylov",
"uladzimirdev",
"egorgrushin"
]
}
]

View File

@@ -35,21 +35,21 @@ jobs:
build-static-viz: false
test-args: >-
:only '"enterprise/backend/test"'
exclude-tag: ':mb/driver-tests'
exclude-tag: ':mb/driver-tests :mb/transforms-python-test'
- name: EE App DB Tests (Part 1)
build-static-viz: true
test-args: >-
:only '"test"'
:partition/total 2
:partition/index 0
exclude-tag: ':mb/driver-tests'
exclude-tag: ':mb/driver-tests :mb/transforms-python-test'
- name: EE App DB Tests (Part 2)
build-static-viz: true
test-args: >-
:only '"test"'
:partition/total 2
:partition/index 1
exclude-tag: ':mb/driver-tests'
exclude-tag: ':mb/driver-tests :mb/transforms-python-test'
services:
mysql:
@@ -137,31 +137,33 @@ jobs:
image: cimg/mysql:8.0
env:
enable-ssl-tests: 'false'
enable-aws-iam-tests: 'false'
- name: MySQL Latest
junit-name: be-tests-mysql-latest-ee
image: mysql:latest
env:
enable-ssl-tests: 'true'
enable-aws-iam-tests: 'true'
job:
- name: Enterprise Tests
build-static-viz: false
test-args: >-
:only '"enterprise/backend/test"'
exclude-tag: ':mb/driver-tests'
exclude-tag: ':mb/driver-tests :mb/transforms-python-test'
- name: EE App DB Tests (Part 1)
build-static-viz: true
test-args: >-
:only '"test"'
:partition/total 2
:partition/index 0
exclude-tag: ':mb/driver-tests'
exclude-tag: ':mb/driver-tests :mb/transforms-python-test'
- name: EE App DB Tests (Part 2)
build-static-viz: true
test-args: >-
:only '"test"'
:partition/total 2
:partition/index 1
exclude-tag: ':mb/driver-tests'
exclude-tag: ':mb/driver-tests :mb/transforms-python-test'
services:
mysql:
@@ -211,6 +213,14 @@ jobs:
MB_MYSQL_SSL_TEST_SSL_CERT: ${{ secrets.MB_MYSQL_SSL_TEST_SSL_CERT }}
MB_MYSQL_SSL_TEST_USER: metabase
MB_MYSQL_SSL_TEST_PASSWORD: ${{ secrets.MYSQL_RDS_SSL_INSTANCE_PASSWORD }}
MB_MYSQL_AWS_IAM_TEST: ${{ matrix.version.env.enable-aws-iam-tests }}
MB_MYSQL_AWS_IAM_TEST_HOST: ${{ secrets.MYSQL_AURORA_IAM_INSTANCE_HOST }}
MB_MYSQL_AWS_IAM_TEST_PORT: 3306
MB_MYSQL_AWS_IAM_TEST_USER: my_iam_user
MB_MYSQL_AWS_IAM_TEST_DBNAME: test_db
MB_MYSQL_AWS_IAM_TEST_SSL_CERT: trust
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_AURORA_IAM_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_AURORA_IAM_SECRET_ACCESS_KEY }}
# for historic reasons (I don't want to mess around with required jobs) the job name should be something like
# "be-tests-mariadb-10-2-ee (0)"
name: "${{ matrix.version.name }} ${{ matrix.job.name }}"
@@ -249,21 +259,19 @@ jobs:
docker-image: postgres:12-alpine
env:
enable-ssl-tests: 'false'
enable-aws-iam-tests: 'false'
- name: Postgres Latest
junit-name: postgres-latest-ee
docker-image: postgres:latest
env:
enable-ssl-tests: 'true'
enable-aws-iam-tests: 'true'
job:
- name: Driver Tests
build-static-viz: false
test-args: >-
:only-tags [:mb/driver-tests]
- name: Enterprise Tests
build-static-viz: false
test-args: >-
:only '"enterprise/backend/test"'
exclude-tag: ':mb/driver-tests'
exclude-tag: ':mb/driver-tests :mb/transforms-python-test'
- name: EE App DB Tests (Part 1)
build-static-viz: true
test-args: >-
@@ -271,14 +279,14 @@ jobs:
:exclude-tags [:mb/driver-tests]
:partition/total 2
:partition/index 0
exclude-tag: ':mb/driver-tests'
exclude-tag: ':mb/driver-tests :mb/transforms-python-test'
- name: EE App DB Tests (Part 2)
build-static-viz: true
test-args: >-
:only '"test"'
:partition/total 2
:partition/index 1
exclude-tag: ':mb/driver-tests'
exclude-tag: ':mb/driver-tests :mb/transforms-python-test'
name: "${{ matrix.version.name }} ${{ matrix.job.name }}"
env:
# Only run old migrations tests on pushes to master or release branches. All other branches should skip tests
@@ -309,6 +317,13 @@ jobs:
MB_POSTGRES_SSL_TEST_SSL: ${{ matrix.version.env.enable-ssl-tests }}
MB_POSTGRES_SSL_TEST_SSL_MODE: verify-full
MB_POSTGRES_SSL_TEST_SSL_ROOT_CERT_PATH: 'test-resources/certificates/us-east-2-bundle.pem'
MB_POSTGRES_AWS_IAM_TEST: ${{ matrix.version.env.enable-aws-iam-tests }}
MB_POSTGRES_AWS_IAM_TEST_HOST: ${{ secrets.POSTGRES_AURORA_IAM_INSTANCE_HOST }}
MB_POSTGRES_AWS_IAM_TEST_PORT: 5432
MB_POSTGRES_AWS_IAM_TEST_USER: my_iam_user
MB_POSTGRES_AWS_IAM_TEST_DBNAME: test_db
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_AURORA_IAM_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_AURORA_IAM_SECRET_ACCESS_KEY }}
services:
postgres:
image: ${{ matrix.version.docker-image }}

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

@@ -6,11 +6,19 @@ on:
jobs:
create-backport:
if: | # the PR must be merged and have a backport label
if:
| # the PR must have a backport label when it's merged, or be labeled with a backport label after merge
github.event.pull_request.merged == true && (
contains(github.event.pull_request.labels.*.name, 'backport') ||
contains(github.event.pull_request.labels.*.name, 'double-backport') ||
contains(github.event.pull_request.labels.*.name, 'triple-backport')
github.event.action == 'closed' && (
contains(github.event.pull_request.labels.*.name, 'backport') ||
contains(github.event.pull_request.labels.*.name, 'double-backport') ||
contains(github.event.pull_request.labels.*.name, 'triple-backport')
) ||
github.event.action == 'labeled' && (
github.event.label.name == 'backport' ||
github.event.label.name == 'double-backport' ||
github.event.label.name == 'triple-backport'
)
)
runs-on: ubuntu-latest
steps:

View File

@@ -10,21 +10,202 @@ jobs:
# 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: 90
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
modules:
- actions
- activity-feed
- analytics
- analyze
- api
- api-keys
- api-routes
- app-db
- appearance
- audit-app
- auth-provider
- batch-processing
- bookmarks
- bug-reporting
- cache
- channel
- classloader
- cloud-migration
- cmd
- collections
- config
- connection-pool
- content-translation
- content-verification
- core
- dashboards
- database-routing
- driver
- driver-api
- eid-translation
- embedding
- events
- formatter
- geojson
- glossary
- graph
- indexed-entities
- internal-stats
- legacy-mbql
- lib
- lib-be
- logger
- login-history
- model-persistence
- models
- native-query-snippets
- notification
- parameters
- permissions
- pivot
- plugins
- premium-features
- product-feedback
- public-sharing
- pulse
- queries
- query-permissions
- query-processor
- remote-sync
- request
- revisions
- sample-data
- search
- secrets
- segments
- server
- session
- settings
- setup
- sso
- startup
- store-api
- sync
- system
- task
- task-history
- testing-api
- tiles
- timeline
- types
- upload
- user-key-value
- users
- util
- version
- view-log
- warehouse-schema
- warehouses
- xrays
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: "cloverage"
- name: Build static viz frontend
run: yarn build-static-viz
env:
MB_EDITION: ee
- name: Collect the test coverage
run: clojure -X:dev:ci:ee:ee-dev:test:cloverage
run: |
clojure -X:dev:ci:ee:ee-dev:test:cloverage \
:ns-regex '["^metabase\\.${{ matrix.modules }}\\..*"]' \
:test-ns-path '["test/metabase/${{ matrix.modules }}"]'
continue-on-error: true
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v4
if: always()
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./target/coverage/codecov.json
flags: back-end
be-linter-cloverage-enterprise:
# 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: 30
strategy:
fail-fast: false
matrix:
modules:
- action-v2
- advanced-config
- advanced-permissions
- ai-entity-analysis
- ai-sql-fixer
- ai-sql-generation
- analytics
- api
- audit-app
- auth-provider
- billing
- bookmarks
- cache
- cloud-add-ons
- comments
- content-translation
- content-verification
- core
- dashboard-subscription-filters
- database-replication
- database-routing
- dependencies
- documents
- email
- embedding-hub
- gsheets
- harbormaster
- impersonation
- internal-stats
- llm
- metabot-v3
- permission-debug
- premium-features
- public-sharing
- remote-sync
- sandbox
- scim
- search
- semantic-search
- serialization
- snippet-collections
- sso
- stale
- transforms
- transforms-python
- upload-management
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 static viz frontend
run: yarn build-static-viz
env:
MB_EDITION: ee
- name: Collect the test coverage
run: |
clojure -X:dev:ci:ee:ee-dev:test:cloverage \
:ns-regex '["^metabase-enterprise\\.${{ matrix.modules }}\\..*"]' \
:test-ns-path '["enterprise/backend/test/metabase/${{ matrix.modules }}"]'
continue-on-error: true
- name: Upload coverage to codecov.io
if: always()
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./target/coverage/codecov.json

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

140
.github/workflows/cache-generator.yml vendored Normal file
View File

@@ -0,0 +1,140 @@
# 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-caches:
runs-on: ubuntu-22.04
timeout-minutes: 30
needs: get-cache-keys
env:
M2_CACHE_KEY: ${{ needs.get-cache-keys.outputs.m2-cache-key }}
NODE_CACHE_KEY: ${{ needs.get-cache-keys.outputs.node-cache-key }}
CYPRESS_CACHE_KEY: ${{ needs.get-cache-keys.outputs.cypress-cache-key }}
ESLINT_CACHE_KEY: ${{ needs.get-cache-keys.outputs.eslint-cache-key }}
steps:
- uses: actions/checkout@v4
# Backend preparation and cache
- 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 }}
# Frontend preparation and caches
# `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
# Run Prettier to populate its cache (stored in node_modules/.cache/prettier)
# so it gets saved as part of the node_modules cache below
- name: Run Prettier to populate cache
run: yarn lint-prettier-pure
- 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 Cypress cache
uses: ./.github/actions/update-cache
with:
path: ~/.cache/Cypress
key: ${{ env.CYPRESS_CACHE_KEY }}
# ESLint cache (requires both backend and frontend)
- name: Compile CLJS
run: yarn build-pure:cljs
- name: Run ESLint to populate cache
run: yarn lint-eslint-pure
- name: Update eslint cache
uses: ./.github/actions/update-cache
with:
path: ${{ github.workspace}}/.eslintcache
key: ${{ env.ESLINT_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

@@ -4,97 +4,22 @@ on:
issues:
types:
- labeled
pull_request_review:
types:
- submitted
workflow_dispatch:
inputs:
issue_number:
description: "Issue number to fix"
required: true
type: string
override_employee_check:
description: "Override employee check for issue creator"
required: false
default: false
type: boolean
jobs:
check-employee-and-issue:
runs-on: ubuntu-latest
timeout-minutes: 2
permissions:
contents: read
issues: read
if: |
(github.event_name == 'issues' && github.event.label.name == 'Claude Bug Fix' && github.event.issue.state == 'open') ||
(github.event_name == 'workflow_dispatch')
outputs:
is_employee: ${{ steps.check_employee.outputs.is_employee }}
issue_number: ${{ steps.get_issue.outputs.issue_number }}
issue_data: ${{ steps.get_issue.outputs.issue_data }}
steps:
- name: Generate GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.METABASE_BOT_APP_ID }}
private-key: ${{ secrets.METABASE_BOT_APP_PRIVATE_KEY }}
- name: Get issue data
id: get_issue
uses: actions/github-script@v7
with:
script: |
let issueNumber, issueData;
if (context.eventName === 'issues') {
// Original issue label event
issueNumber = context.payload.issue.number;
issueData = context.payload.issue;
} else if (context.eventName === 'workflow_dispatch') {
// Manual trigger with issue number input
issueNumber = parseInt('${{ github.event.inputs.issue_number }}');
const { data } = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber
});
issueData = data;
}
core.setOutput('issue_number', issueNumber);
core.setOutput('issue_data', JSON.stringify(issueData));
console.log(`Issue #${issueNumber}: ${issueData.title}`);
console.log(`Issue author: ${issueData.user.login}`);
- name: Check if issue creator is a Metabase employee
id: check_employee
uses: actions/github-script@v7
env:
ISSUE_DATA: ${{ steps.get_issue.outputs.issue_data }}
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
const issueData = JSON.parse(process.env.ISSUE_DATA);
const issueAuthor = issueData.user.login;
try {
// Check if user is a member of the metabase organization (including private members)
const { data: membership } = await github.rest.orgs.getMembershipForUser({
org: 'metabase',
username: issueAuthor
});
if (membership.state === 'active') {
console.log(`User ${issueAuthor} is an active member of the Metabase organization. Proceeding with bug fix automation.`);
core.setOutput('is_employee', 'true');
} else {
console.log(`User ${issueAuthor} is not an active member of the Metabase organization. Skipping bug fix automation.`);
core.setOutput('is_employee', 'false');
}
} catch (error) {
if (error.status === 404) {
console.log(`User ${issueAuthor} is not a member of the Metabase organization. Skipping bug fix automation.`);
} else {
console.error('Error checking organization membership:', error);
}
core.setOutput('is_employee', 'false');
}
auto-fix-bug:
runs-on: ubuntu-latest
timeout-minutes: 30
@@ -103,8 +28,10 @@ jobs:
issues: write
pull-requests: write
id-token: write
needs: check-employee-and-issue
if: needs.check-employee-and-issue.outputs.is_employee == 'true'
if: |
(github.event_name == 'issues' && github.event.label.name == 'Claude Bug Fix' && github.event.issue.state == 'open') ||
(github.event_name == 'workflow_dispatch') ||
(github.event_name == 'pull_request_review' && github.event.review.state == 'changes_requested' && startsWith(github.event.pull_request.head.ref, 'claude-fix/'))
steps:
- name: Checkout repository
uses: actions/checkout@v4
@@ -112,47 +39,153 @@ jobs:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get issue data and check employee status
id: get_issue
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { getIssueData } = require('${{ github.workspace }}/.github/scripts/get-issue-data.js');
try {
const result = await getIssueData({
context,
github,
manualIssueNumber: '${{ github.event.inputs.issue_number }}'
});
const { issueNumber, issueData, employeeComments, prReviews, triggerType, isIssueAuthorEmployee } = result;
// Check employee status and fail if not authorized
if (!result.isIssueAuthorEmployee && '${{ github.event.inputs.override_employee_check }}' !== 'true') {
core.setFailed(`User ${result.issueData.user.login} is not a Metabase employee. Skipping bug fix automation.`);
}
core.setOutput('issue_number', issueNumber);
core.setOutput('issue_data', JSON.stringify(issueData));
core.setOutput('issue_comments', JSON.stringify(employeeComments));
core.setOutput('pr_reviews', JSON.stringify(prReviews));
core.setOutput('trigger_type', triggerType);
} catch (error) {
core.setFailed(error.message);
}
- name: Set up git configuration
run: |
git config --global user.name "Claude Code[bot]"
git config --global user.email "noreply@anthropic.com"
- name: Prepare dynamic issue info
id: prepare_issue_info
- name: Prepare issue context and bug fix prompt
id: prepare_prompt
uses: actions/github-script@v7
env:
ISSUE_DATA: ${{ needs.check-employee-and-issue.outputs.issue_data }}
ISSUE_DATA: ${{ steps.get_issue.outputs.issue_data }}
ISSUE_COMMENTS: ${{ steps.get_issue.outputs.issue_comments }}
PR_REVIEWS: ${{ steps.get_issue.outputs.pr_reviews }}
TRIGGER_TYPE: ${{ steps.get_issue.outputs.trigger_type }}
with:
script: |
const issueData = JSON.parse(process.env.ISSUE_DATA);
const issueNumber = '${{ needs.check-employee-and-issue.outputs.issue_number }}';
const issueComments = JSON.parse(process.env.ISSUE_COMMENTS);
const prReviews = JSON.parse(process.env.PR_REVIEWS);
const triggerType = process.env.TRIGGER_TYPE;
const issueNumber = '${{ steps.get_issue.outputs.issue_number }}';
// Convert issue title to kebab case
// Convert issue title to kebab case and create branch name
const issueTitle = issueData.title || 'untitled';
const kebabTitle = issueTitle
.toLowerCase()
.replace(/[^a-z0-9]+/g, '-')
.replace(/^-+|-+$/g, '')
.replace(/-+/g, '-')
.substring(0, 50); // Limit length
.substring(0, 50);
const branchName = `claude-fix/issue-${issueNumber}-${kebabTitle}`;
// Create base branch name
const baseBranchName = `claude-fix/issue-${issueNumber}-${kebabTitle}`;
core.exportVariable('BASE_BRANCH_NAME', baseBranchName);
// Format data for bash environment
const formattedComments = issueComments.length > 0
? issueComments.map(comment =>
`**Comment by @${comment.user.login} on ${comment.created_at}:**\n${comment.body}`
).join('\n\n---\n\n')
: '';
const formattedReviews = prReviews.length > 0
? prReviews.map(review =>
`**Review by @${review.user.login} on ${review.submitted_at} (Changes Requested):**\n${review.body || 'No review comment provided'}`
).join('\n\n---\n\n')
: '';
// Export issue info for the prompt
core.exportVariable('BRANCH_NAME', branchName);
core.exportVariable('ISSUE_NUMBER', issueNumber);
core.exportVariable('ISSUE_TITLE', issueData.title);
core.exportVariable('ISSUE_AUTHOR', issueData.user.login);
core.exportVariable('ISSUE_CREATED', issueData.created_at);
core.exportVariable('ISSUE_BODY', issueData.body || 'No description provided');
core.exportVariable('ISSUE_COMMENTS_FORMATTED', formattedComments);
core.exportVariable('PR_REVIEWS_FORMATTED', formattedReviews);
core.exportVariable('TRIGGER_TYPE', triggerType);
- name: Generate bug fix prompt
run: |
cat << 'EOF' >> $GITHUB_ENV
BUG_FIX_PROMPT<<PROMPT_END
You are helping to fix a bug reported in GitHub issue #${{ env.ISSUE_NUMBER }}.
## Bug Report Details
**Title:** ${{ env.ISSUE_TITLE }}
**Reporter:** ${{ env.ISSUE_AUTHOR }}
**Created:** ${{ env.ISSUE_CREATED }}
**Description:**
${{ env.ISSUE_BODY }}
**Comments:**
${{ env.ISSUE_COMMENTS_FORMATTED }}
EOF
# Add review feedback section only if this is a review trigger
if [ "${{ env.TRIGGER_TYPE }}" = "pull_request_review" ]; then
cat << 'EOF' >> $GITHUB_ENV
## Previous Fix Attempt - Review Feedback (MUST ADDRESS)
Your previous automated fix attempt received the following feedback that needs to be addressed:
${{ env.PR_REVIEWS_FORMATTED }}
EOF
fi
# Add the rest of the prompt (always the same)
cat << 'EOF' >> $GITHUB_ENV
## Instructions
1. **Analyze the issue description and comments** - Understand what the issue is describing
a. Pay particular attention to reproduction steps and if there's an agreed upon fix.
2. **Search the codebase** - Use Grep and Glob tools to find relevant files
3. **Implement a fix** - Use the appropriate write skill based on the file types:
- Use clojure-write for Clojure/ClojureScript files
- Use typescript-write for TypeScript/JavaScript files
- Follow the coding standards and patterns in each skill
4. **Test the fix** - Run appropriate tests as specified in the skills
5. **Verify the fix** - Ensure tests pass and code follows conventions
## Important Guidelines
- Use the appropriate write skill for the language you're working in
- Write failing tests first, then fix them
- Work in small, testable increments
- Don't commit changes - leave that for the workflow
- IMPORTANT: Focus only on fixing the reported bug, don't make unrelated changes
## Scratchpad Directory
A `.claude-scratchpad/` directory has been created for your temporary files:
- Use this directory for ALL temporary verification files. However, prefer using production test files rather than adhoc ones.
- Only modify actual production code in the main repository directories
- The scratchpad will be cleaned up automatically - nothing from it will be committed
Start by understanding the bug and then systematically work toward a solution.
PROMPT_END
EOF
- name: Determine branch strategy
run: |
# Use the base branch name (no counters)
BRANCH_NAME="${{ env.BASE_BRANCH_NAME }}"
# Check if this exact branch already exists
BRANCH_NAME="${{ env.BRANCH_NAME }}"
if git branch -r --list "origin/${BRANCH_NAME}" | grep -q .; then
echo "Branch already exists: $BRANCH_NAME"
echo "Will push to existing branch and skip PR creation"
@@ -166,54 +199,6 @@ jobs:
# Export the branch name
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
- name: Prepare bug fix prompt
id: prepare_prompt
run: |
# Prepare the prompt for Claude
cat << 'EOF' >> $GITHUB_ENV
BUG_FIX_PROMPT<<PROMPT_END
You are helping to automatically fix a bug reported in GitHub issue #${{ env.ISSUE_NUMBER }}.
## Bug Report Details
**Title:** ${{ env.ISSUE_TITLE }}
**Reporter:** ${{ env.ISSUE_AUTHOR }}
**Created:** ${{ env.ISSUE_CREATED }}
**Description:**
${{ env.ISSUE_BODY }}
## Instructions
1. **Analyze the bug report** - Understand what the issue is describing
2. **Search the codebase** - Use Grep and Glob tools to find relevant files
3. **Implement a fix** - Follow existing code patterns and conventions
4. **Test the fix** - Run appropriate tests using the commands in CLAUDE.md:
- JavaScript/TypeScript: `yarn test-unit path/to/file.unit.spec.js`
- Clojure: `clojure -X:dev:test :only namespace/test-name`
- Lint: `yarn lint-eslint-pure` for JS/TS, `./bin/mage kondo <file>` for Clojure
5. **Verify the fix** - Ensure tests pass and code follows conventions
## Important Guidelines
- Follow the development patterns in CLAUDE.md
- Write failing tests first, then fix them
- Work in small, testable increments
- Don't commit changes - leave that for the workflow
- IMPORTANT: Focus only on fixing the reported bug, don't make unrelated changes
## Scratchpad Directory
A `.claude-scratchpad/` directory has been created for your temporary files:
- Use this directory for ALL temporary verification files. However, prefer using production test files rather than adhoc ones.
- Only modify actual production code in the main repository directories
- The scratchpad will be cleaned up automatically - nothing from it will be committed
## If You Cannot Fix The Bug
If you determine that you cannot create a definitive fix, create a file called `FAILED_FIX_ANALYSIS.md` with:
1. **Why No Fix** - Specific reason why you couldn't implement a fix
2. **Tool Limitations** - If you needed additional tools/access that weren't available
Start by understanding the bug and then systematically work toward a solution.
PROMPT_END
EOF
- name: Create scratchpad directory for Claude
run: |
# Create a scratchpad directory for Claude to use for temporary files
@@ -228,15 +213,14 @@ jobs:
private-key: ${{ secrets.METABASE_BOT_APP_PRIVATE_KEY }}
- name: Generate Bug Fix with Claude Code
uses: anthropics/claude-code-action@beta
uses: anthropics/claude-code-action@v1
with:
mode: agent
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
github_token: ${{ steps.claude-app-token.outputs.token }}
direct_prompt: ${{ env.BUG_FIX_PROMPT }}
timeout_minutes: "25"
allowed_tools: "Bash(yarn test-unit*),Bash(yarn lint-eslint-pure),Bash(./bin/mage*),Bash(clojure*),Bash(find*),Bash(ls*),Bash(grep*),Write,Read,Glob,Grep,Edit,MultiEdit"
disallowed_tools: "Bash(git commit*),Bash(git push*),Bash(gh*)"
prompt: ${{ env.BUG_FIX_PROMPT }}
claude_args: |
--allowedTools "Bash(yarn test-unit*),Bash(yarn lint-eslint-pure),Bash(./bin/mage*),Bash(clojure*),Bash(find*),Bash(ls*),Bash(grep*),Write,Read,Glob,Grep,Edit,MultiEdit"
--disallowedTools "Bash(git commit*),Bash(git push*),Bash(gh*)"
- name: Clean up scratchpad directory
run: |
@@ -249,20 +233,6 @@ jobs:
- name: Check for changes and analysis
id: check_changes
run: |
# Check if Claude created an analysis file first and store its content
if [ -f "FAILED_FIX_ANALYSIS.md" ]; then
echo "has_analysis=true" >> $GITHUB_OUTPUT
echo "Analysis file found"
# Store analysis content in a GitHub output (base64 encoded to handle multiline)
ANALYSIS_CONTENT=$(base64 -w 0 FAILED_FIX_ANALYSIS.md)
echo "analysis_content=$ANALYSIS_CONTENT" >> $GITHUB_OUTPUT
# Remove analysis file so it doesn't count as a code change
rm -f FAILED_FIX_ANALYSIS.md
else
echo "has_analysis=false" >> $GITHUB_OUTPUT
echo "No analysis file found"
fi
# Now check for actual code changes (excluding analysis file)
if [ -n "$(git status --porcelain)" ]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
@@ -278,25 +248,16 @@ jobs:
id: prepare_reviewers
uses: actions/github-script@v7
env:
ISSUE_DATA: ${{ needs.check-employee-and-issue.outputs.issue_data }}
ISSUE_DATA: ${{ steps.get_issue.outputs.issue_data }}
with:
script: |
// Get existing team labels from the issue
const issueData = JSON.parse(process.env.ISSUE_DATA);
const issueLabels = issueData.labels.map(label => label.name);
const teamLabels = issueLabels.filter(label => label.startsWith('.Team/'));
console.log('Issue labels:', issueLabels);
console.log('Team labels found:', teamLabels);
// Add issue creator as reviewer
const issueCreator = issueData.user.login;
core.setOutput('team_labels', teamLabels.join(','));
core.setOutput('reviewers', issueCreator);
console.log('Reviewer:', issueCreator);
- name: Create Pull Request
if: steps.check_changes.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@v6
@@ -363,25 +324,3 @@ jobs:
with:
script: |
console.log('🤖 No code changes were made by Claude.');
// Check if Claude provided a detailed analysis
if ('${{ steps.check_changes.outputs.has_analysis }}' === 'true') {
try {
// Decode the base64-encoded analysis content
const analysisBase64 = '${{ steps.check_changes.outputs.analysis_content }}';
const analysisContent = Buffer.from(analysisBase64, 'base64').toString('utf8');
console.log('📋 Claude provided detailed analysis:');
console.log('='.repeat(50));
console.log(analysisContent);
console.log('='.repeat(50));
} catch (error) {
console.log('❌ Could not decode analysis content:', error);
}
} else {
console.log('ℹ️ No detailed analysis file was created by Claude.');
console.log('This could be because:');
console.log('- The issue requires more context or clarification');
console.log('- The fix is complex and requires human judgment');
console.log('- The issue is not a straightforward code bug');
console.log('- Claude couldn\'t locate the relevant code to modify');
}

View File

@@ -0,0 +1,98 @@
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 for compliance with project coding standards and conventions.
**Use the appropriate review skill based on the file types changed:**
- Use clojure-review for Clojure/ClojureScript files
- Use typescript-review for TypeScript/JavaScript files
- Follow the review guidelines and checklists in each skill
DO NOT post any comments confirming that something is correct - only post comments for style violations or concerns.
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)"

101
.github/workflows/claude-docs-review.yml vendored Normal file
View File

@@ -0,0 +1,101 @@
name: "Claude Docs Review"
on:
pull_request:
types:
- opened
- synchronize
- reopened
paths:
- 'docs/**/*.md'
- 'docs/**/*.mdx'
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to review'
required: true
type: number
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}-claude-docs-review
cancel-in-progress: true
jobs:
review:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
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
- 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: Delete old Claude docs review comments
env:
GH_TOKEN: ${{ steps.claude-app-token.outputs.token }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number || github.event.inputs.pr_number }}
shell: bash
run: |
# Delete pending reviews first (these can be deleted entirely)
pending_review_ids=$(gh api "/repos/$REPO/pulls/$PR_NUMBER/reviews" --jq '.[] | select(.user.login=="metabase-bot[bot]" and .state=="PENDING") | .id')
if [ -n "$pending_review_ids" ]; then
echo "Deleting pending reviews: $pending_review_ids"
for id in $pending_review_ids; do
gh api -X DELETE "/repos/$REPO/pulls/$PR_NUMBER/reviews/$id"
echo "Deleted pending review $id"
done
fi
# Delete individual inline comments from submitted reviews (can't delete the review itself)
old_line_comment_ids=$(gh api "/repos/$REPO/pulls/$PR_NUMBER/comments" --jq '.[] | select(.user.login=="metabase-bot[bot]") | .id')
if [ -n "$old_line_comment_ids" ]; then
echo "Deleting line comments: $old_line_comment_ids"
for id in $old_line_comment_ids; do
gh api -X DELETE "/repos/$REPO/pulls/comments/$id"
echo "Deleted line comment $id"
done
fi
# Delete top-level review comments
old_top_level_comment_ids=$(gh api "/repos/$REPO/issues/$PR_NUMBER/comments" --jq '.[] | select(.user.login=="metabase-bot[bot]") | .id')
if [ -n "$old_top_level_comment_ids" ]; then
echo "Deleting top-level comments: $old_top_level_comment_ids"
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
fi
- 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 }}
show_full_output: true
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number || github.event.inputs.pr_number }}
Review the documentation changes in this pull request.
Use the docs-review skill to review all changed documentation files for compliance with the Metabase writing style guide.
DO NOT post any comments confirming that something is correct - only post comments for style violations or concerns.
claude_args: |
--allowedTools "Skill,mcp__github__get_pull_request,mcp__github__get_pull_request_files,mcp__github__create_pending_pull_request_review,mcp__github__get_pull_request_diff,mcp__github__add_comment_to_pending_review,mcp__github__add_pull_request_review_comment_to_pending_review,mcp__github__delete_pending_pull_request_review,mcp__github__submit_pending_pull_request_review"

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

@@ -4,39 +4,53 @@ on:
pull_request:
branches:
- master
paths:
- enterprise/frontend/src/embedding-sdk-bundle/**
jobs:
files-changed:
name: Check which files changed
runs-on: ubuntu-22.04
timeout-minutes: 3
outputs:
frontend_embedding_sources: ${{ steps.changes.outputs.frontend_embedding_sources }}
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
pr-title-reminder:
runs-on: ubuntu-22.04
timeout-minutes: 5
permissions:
pull-requests: write
needs: [ files-changed ]
if: |
!cancelled() &&
needs.files-changed.outputs.frontend_embedding_sources == 'true'
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Check if the PR title is already following Conventional Commits style
uses: actions/github-script@v7
id: is-conventional-commit
with:
result-encoding: string
script: | # js
const { isConventionalTitle } = require(".github/scripts/conventional-commit-pr-title-reminder/utils.js")
const pullRequestTitle = context.payload.pull_request.title
const conventionalCommitRegex = /^(?<type>\w+)\((?<scope>\w+)\):/
const match = pullRequestTitle.match(conventionalCommitRegex)
if (match) {
const { type, scope } = match.groups
return ['feat', 'fix', 'perf', 'docs', 'style', 'refactor', 'test', 'build', 'ci'].includes(type) && scope === 'sdk'
}
- name: Checkout repository so `gh` CLI works
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
return isConventionalTitle(pullRequestTitle)
- name: Remind PR authors to use conventional commit in the title
if: ${{ steps.is-conventional-commit.outputs.result != 'true' }}
uses: actions/github-script@v7
with:
script: |
const { updateComment } = require(".github/scripts/conventional-commit-pr-title-reminder/utils.js")
await updateComment({github, context})
script: | #js
const { updateCommentForEmbedding } = require(".github/scripts/conventional-commit-pr-title-reminder/utils.js")
await updateCommentForEmbedding({github, context})

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
@@ -66,6 +60,14 @@ jobs:
clojure -M:ee:doc api-documentation
continue-on-error: false
- name: Generate command documentation
id: generate_command_docs
run: |
set -e # Exit on any error
echo "Generating API documentation..."
clojure -M:ee:doc command-documentation
continue-on-error: false
- name: Check for changes
id: check_changes
run: |

View File

@@ -2,8 +2,6 @@ name: Check doc links
on:
pull_request:
paths:
- "docs/**"
workflow_dispatch:
jobs:
@@ -15,7 +13,7 @@ jobs:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
sparse-checkout: |
docs
@@ -29,7 +27,7 @@ jobs:
- name: Run link checker
id: link-check
uses: lycheeverse/lychee-action@v2
uses: lycheeverse/lychee-action@v2.3.0
with:
fail: true
args: docs --config ./.lychee/config.toml --offline

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

@@ -4,13 +4,18 @@ on:
schedule:
- cron: "0 2 * * 1-5" # Every Monday through Friday at 2 AM UTC
workflow_dispatch:
inputs:
target_branch:
description: "Target branch for documentation update"
required: false
default: "release-x.57.x"
type: string
jobs:
update-release-docs:
name: Call documentation update for release branch
uses: ./.github/workflows/docs-generate-base.yml
with:
target_branch: "release-x.56.x"
m2_cache_key_suffix: "release"
target_branch: ${{ inputs.target_branch || 'release-x.57.x' }}
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

@@ -689,25 +689,57 @@ jobs:
junit-name: 'be-tests-starburst-ee'
test-args: ":only ${{ inputs.test }} :times ${{ inputs.times }}"
# TODO(rileythomp, 2025-08-20): Re-enable vertica tests once the docker image is updated
# be-tests-vertica-ee:
# if: ${{ false && inputs.driver == 'Vertica' }}
# runs-on: ubuntu-22.04
# timeout-minutes: 90
# env:
# CI: 'true'
# DRIVERS: vertica
# services:
# vertica:
# image: vertica/vertica-ce:12.0.2-0
# ports:
# - "5433:5433"
# steps:
# - uses: actions/checkout@v4
# - name: Make plugins directory
# run: mkdir plugins
# - name: Test Vertica driver
# uses: ./.github/actions/test-driver
# with:
# junit-name: 'be-tests-vertica-ee'
# test-args: ":only ${{ inputs.test }} :times ${{ inputs.times }}"
login-to-ecr:
if: inputs.driver == 'Vertica'
runs-on: ubuntu-22.04
timeout-minutes: 15
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.CI_IAM_ROLE }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: us-east-1
- name: Get ECR password
id: login-ecr
run: |
PASSWORD=$(aws ecr get-login-password --region us-east-1)
REGISTRY="$(aws sts get-caller-identity --query Account --output text).dkr.ecr.us-east-1.amazonaws.com"
echo "docker_username=AWS" >> $GITHUB_OUTPUT
echo "docker_password=$PASSWORD" >> $GITHUB_OUTPUT
echo "registry=$REGISTRY" >> $GITHUB_OUTPUT
outputs:
registry: ${{ steps.login-ecr.outputs.registry }}
docker_username: ${{ steps.login-ecr.outputs.docker_username }}
docker_password: ${{ steps.login-ecr.outputs.docker_password }}
be-tests-vertica-ee:
if: inputs.driver == 'Vertica'
runs-on: ubuntu-22.04
needs: login-to-ecr
timeout-minutes: 90
env:
CI: 'true'
DRIVERS: vertica
services:
vertica:
image: ${{ needs.login-to-ecr.outputs.registry }}/vertica-ce:25.3.0-0
ports:
- "5433:5433"
credentials:
username: ${{ needs.login-to-ecr.outputs.docker_username }}
password: ${{ needs.login-to-ecr.outputs.docker_password }}
steps:
- uses: actions/checkout@v4
- name: Make plugins directory
run: mkdir plugins
- name: Test Vertica driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-vertica-ee'
test-args: ":only ${{ inputs.test }} :times ${{ inputs.times }}"

File diff suppressed because it is too large Load Diff

View File

@@ -1,182 +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 }}
- 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

@@ -22,14 +22,10 @@ on:
required: false
default: "ee"
qa_db:
description: "Select the type of Database you want to run your tests with"
type: choice
description: "Whether to set up and include external QA databases"
type: boolean
required: true
default: "none"
options:
- none
- sql
- mongo
default: false
enable_network_throttling:
description: "Enable network throttling simulation (4g slow like in chrome dev tools)"
type: boolean
@@ -37,8 +33,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 +62,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,17 +71,18 @@ 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
env:
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 }}
@@ -87,9 +103,9 @@ jobs:
maildev: true
openldap: true
snowplow: true
postgres: ${{ inputs.qa_db == 'sql' }}
mysql: ${{ inputs.qa_db == 'sql' }}
mongo: ${{ inputs.qa_db == 'mongo' }}
postgres: ${{ inputs.qa_db }}
mysql: ${{ inputs.qa_db }}
mongo: ${{ inputs.qa_db }}
- name: Download Metabase ${{ matrix.edition }} uberjar
uses: ./.github/actions/e2e-download-uberjar
@@ -98,6 +114,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:
@@ -108,20 +134,23 @@ jobs:
uses: ./.github/actions/prepare-cypress
- name: Run Metabase
run: node e2e/runner/run_cypress_ci.js start
- name: Generate database snapshots
run: node e2e/runner/run_cypress_ci.js snapshot
run: |
node e2e/runner/run_cypress_ci.js snapshot \
--env grepTags="${{inputs.qa_db && '' || '-@external'}}"
# For all options and fine-grained control, take a look at the documentation
# https://github.com/cypress-io/cypress/tree/develop/npm/grep
- 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

@@ -37,17 +37,18 @@ jobs:
env:
MB_EDITION: ${{ inputs.edition }}
DISPLAY: ""
QA_DB_ENABLED: true
PR_NUMBER: ${{ github.event.pull_request.number || '' }}
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
@@ -56,10 +57,17 @@ jobs:
MB_SNOWPLOW_URL: "http://localhost:9090" # Snowplow micro
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:
submodules: true
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
- name: Prepare Docker containers
uses: ./.github/actions/e2e-prepare-containers
@@ -70,13 +78,9 @@ jobs:
openldap: true
webhook: true
snowplow: true
postgres: ${{ inputs.name != 'mongo' }}
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
postgres: true
mysql: true
mongo: true
- name: Retrieve uberjar artifact for ${{ inputs.edition }}
uses: ./.github/actions/fetch-artifact
@@ -114,6 +118,8 @@ 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 }}
@@ -123,41 +129,51 @@ jobs:
SPLIT_INDEX: ${{ inputs.split_index }}
SPLIT_FILE: "./e2e/support/timings.json"
SPLIT_OUTPUT_FILE: "newTimes.json"
SPLIT_TIME_THRESHOLD: 5.0
SPLIT_TIME_THRESHOLD: 0.01 # 1% threshold for changes
# 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 }}
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}}+-@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
@@ -177,6 +193,51 @@ jobs:
name: failed-tests-${{ inputs.name }}-${{ inputs.edition }}
path: ./cypress/test-results
- name: Extract chunk-specific changed timings
id: extract-timings
if: inputs.split_index >= 0 && github.ref == 'refs/heads/master'
continue-on-error: true
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const oldTimingsPath = "./e2e/support/timings.json";
const newTimingsPath = "./e2e/support/newTimes.json";
if (!fs.existsSync(newTimingsPath)) {
throw new Error(`newTimes.json not found - cypress-split may not have generated it`);
}
if (!fs.existsSync(oldTimingsPath)) {
throw new Error(`Original timings file ${oldTimingsPath} not found`);
}
const oldTimings = fs.existsSync(oldTimingsPath)
? JSON.parse(fs.readFileSync(oldTimingsPath, "utf8"))
: { durations: [] };
const newTimings = fs.existsSync(newTimingsPath)
? JSON.parse(fs.readFileSync(newTimingsPath, "utf8"))
: { durations: [] };
const { extractChangedTimings } = require('${{ github.workspace }}/.github/scripts/extract-changed-timings.js');
const result = extractChangedTimings({ oldTimings, newTimings });
if (result.hasChanges) {
core.setOutput('has-changes', 'true');
fs.writeFileSync('chunkTimings.json', JSON.stringify(result.changedTimings, null, 2));
console.log(`Extracted ${Object.keys(result.changedTimings).length} changed timings for chunk index ${{ inputs.split_index }}`);
}
- name: Upload Timing Data
uses: actions/upload-artifact@v4
if: steps.extract-timings.outcome == 'success' && steps.extract-timings.outputs.has-changes == 'true'
with:
name: timing-data-${{ inputs.name }}-${{ inputs.split_index }}
path: chunkTimings.json
retention-days: 1 # gets merged immediately by parent workflow
- name: Publish Summary
if: failure()
uses: actions/github-script@v7

View File

@@ -73,31 +73,77 @@ 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
timeout-minutes: 10
needs: e2e-tests
if: always() && !cancelled() && github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
e2e/support
sparse-checkout-cone-mode: false
- name: Download all timing artifacts
uses: actions/download-artifact@v4
with:
pattern: timing-data-*
path: timing-files
merge-multiple: false
continue-on-error: true
- name: Merge split timings
id: merge
continue-on-error: true
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const path = require('path');
const globber = await glob.create('timing-files/*/chunkTimings.json');
const chunkFiles = await globber.glob();
const specs = new Map();
chunkFiles.forEach(file => {
const { durations = [] } = JSON.parse(fs.readFileSync(file, 'utf8'));
durations.forEach(({ spec, duration }) => specs.set(spec, duration));
});
if (specs.size === 0) {
throw new Error('No timing data found - no specs had timing changes');
}
const outputPath = 'e2e/support/runTimings.json';
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
const runTimings = {
durations: [...specs].map(([spec, duration]) => ({ spec, duration }))
};
fs.writeFileSync(outputPath, JSON.stringify(runTimings, null, 2));
console.log(`Merged timing data for ${specs.size} specs`);
- name: Upload merged timing files
if: steps.merge.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: merged-e2e-timings
path: e2e/support/runTimings.json
retention-days: 7
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' }}
@@ -107,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,256 @@
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 }}
# Component tests only need the default snapshot
run: |
node e2e/runner/run_cypress_ci.js snapshot \
--spec "e2e/snapshot-creators/default.cy.snap.js"
# 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 }}
# Component tests only need the default snapshot
run: |
node e2e/runner/run_cypress_ci.js snapshot \
--spec "e2e/snapshot-creators/default.cy.snap.js"
- 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 }}
@@ -236,9 +131,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
@@ -294,7 +191,9 @@ jobs:
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 +217,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 +227,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 +236,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 +249,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
@@ -379,7 +278,9 @@ jobs:
run: node e2e/runner/run_cypress_ci.js start
- name: Generate database snapshots
run: node e2e/runner/run_cypress_ci.js snapshot
run: |
node e2e/runner/run_cypress_ci.js snapshot \
--spec "e2e/snapshot-creators/default.cy.snap.js"
- name: Prepare and launch Host App
run: npx tsx ./e2e/runner/embedding-sdk/host-apps/start-ci.ts ${{ matrix.test_suite }}
@@ -387,7 +288,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,49 @@
name: Embedding SDK Labels Reminder
on:
pull_request:
types: [auto_merge_enabled, review_requested, labeled, unlabeled, synchronize]
branches:
- "master"
merge_group:
jobs:
files-changed:
name: Check which files changed
runs-on: ubuntu-22.04
timeout-minutes: 3
outputs:
frontend_embedding_sdk_package_sources: ${{ steps.changes.outputs.frontend_embedding_sdk_package_sources }}
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
embedding-sdk-package-no-release-notes-reminder:
needs: [ files-changed ]
if: |
!cancelled() &&
(needs.files-changed.outputs.frontend_embedding_sdk_package_sources == 'true')
name: Embedding SDK package release-notes/no-release-notes label reminder
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: jesusvasquez333/verify-pr-label-action@v1.4.0
id: verify-release-notes-labels
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
valid-labels: 'release-notes, no-release-notes'
disable-reviews: true
- name: Comment on PR if label should be added
if: ${{ always() }}
uses: ./.github/actions/notify-pull-request
with:
remove-previous-comment: true
add-new-comment: ${{ steps.verify-release-notes-labels.outcome == 'failure' }}
message: "⚠️ Changes were made to the <b>Embedding SDK Package</b>. Review this PR and apply one of the following labels.<br><br>- <code>release-notes</code> — select if this PR must be included in the main Metabase changelog release notes.<br>- <code>no-release-notes</code> — select if this PR should not be included in the main Metabase changelog release notes."
include-log: true

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

@@ -22,8 +22,6 @@ jobs:
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
@@ -38,8 +36,6 @@ jobs:
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
@@ -54,8 +50,6 @@ jobs:
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

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,32 +20,12 @@ jobs:
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Compile CLJS
run: yarn build-pure:cljs
- name: Build Storybook
# We won't be able to use Storybook play's `userEvent` with production build
# see https://github.com/storybookjs/storybook/issues/19758
run: NODE_ENV=development yarn build-storybook
- 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!"
- name: Update Loki Snapshots
run: yarn test-visual:loki || yarn test-visual:loki-approve-diff && yarn test-visual:loki-prune
run: yarn test-visual:loki:ci || yarn test-visual:loki-approve-diff && yarn test-visual:loki-prune
- name: Check for changes
id: check-changes

View File

@@ -47,20 +47,12 @@ 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
- name: Build Storybook
# We won't be able to use Storybook play's `userEvent` with production build
# see https://github.com/storybookjs/storybook/issues/19758
run: NODE_ENV=development yarn build-storybook
- name: Run Loki Visual Tests
run: |
yarn loki --requireReference --reactUri file:./storybook-static --chromeFlags='--headless --disable-gpu' --verboseRenderer
run: yarn test-visual:loki:ci
- name: Generate Visual Report on Failure
if: failure()

Some files were not shown because too many files have changed in this diff Show More