Compare commits

...

1904 Commits

Author SHA1 Message Date
Chris Truter
853bf9e562 Merge branch 'internal-tools' into undo-execute-test 2025-05-29 13:14:24 +02:00
Dan Stone
98287f0d89 Check tables are active before computing actions (#58623) 2025-05-29 10:52:33 +01:00
Stas Gavrylov
e9a86902bc WRK-411: Move actions to new execute API (#58564)
* WIP

* Match action and API shape for undo / redo

* WRK-397 Integrate Table actions to button action picker (#58333)

* WRK-397: Add table actions output to table actions picker

* WRK-397: Integrate new endpoint and table actions for Action Buttons

* WRK-397 Ignore null update values (temporary)

* WRK-397: Add typings. Fix lint

* WRK-397: Various improvements for table action picker

* WRK-397: Fix tests

* WRK-397: Merge latest updates

* WRK-397 Remove nils from update params

---------

Co-authored-by: Dan Stone <wotbrew@gmail.com>

* WRK-411: Migrate rows delete to new API

* WRK-411: Migrate rows update to new API

* WRK-411: Migrate rows create to new API

* WRK-411: Migrate undo/redo to new API

* WRK-411: Fix lint

---------

Co-authored-by: Chris Truter <chris@metabase.com>
Co-authored-by: Dan Stone <wotbrew@gmail.com>
2025-05-29 12:40:08 +03:00
Ngoc Khuat
36fc93d4e1 Fix table notification emails when create/update/archive (#58505) 2025-05-29 15:25:52 +07:00
Chris Truter
09e5111957 Match action and API shape for undo / redo 2025-05-29 10:03:10 +02:00
Denis Berezin
ba82a8a02e Add edtiable table sorting (#58601) 2025-05-28 23:42:28 +03:00
Denis Berezin
3c0a312444 Breadcrumbs & back navigation for db tables (#58546)
* Add breadcrumbs for table edit screen

* Fix ci
2025-05-28 19:30:23 +03:00
Dan Stone
efccfe909d Fix regression with :policy opt and table action (#58573) 2025-05-28 17:18:20 +01:00
Konstantin Darutkin
26fd776b30 fix: do not display leave confirmation modal on editing modal URL change (#58569) 2025-05-28 16:52:03 +01:00
Chris Truter
a78c4636ba WIP 2025-05-28 17:34:17 +02:00
Stas Gavrylov
f95dcb6be5 WRK-397 Integrate Table actions to button action picker (#58333)
* WRK-397: Add table actions output to table actions picker

* WRK-397: Integrate new endpoint and table actions for Action Buttons

* WRK-397 Ignore null update values (temporary)

* WRK-397: Add typings. Fix lint

* WRK-397: Various improvements for table action picker

* WRK-397: Fix tests

* WRK-397: Merge latest updates

* WRK-397 Remove nils from update params

---------

Co-authored-by: Dan Stone <wotbrew@gmail.com>
2025-05-28 17:57:34 +03:00
Denis Berezin
152aaef104 Add table actions for dashboard question cards (#58380)
* Add table actions management

* Add basic working implementation

* Move actions code to enterprise, unifywith editable table

* add validation for empty field after q change

* Refactor data schema for actions viz settings

* fix issues

* revert genius ide autoreplacement
2025-05-27 17:58:39 +03:00
Denis Berezin
27c58d1157 Remove service tables from editable tables picker 2025-05-27 17:42:17 +03:00
Chris Truter
25ed5d9b8a Bulk Action execution API (#58514) 2025-05-27 14:42:04 +02:00
Konstantin Darutkin
db62348247 feat: edit table filters before saving a dashcard (#58478) 2025-05-27 12:15:50 +01:00
Dan Stone
17353f3dbd Use u/poll to avoid sleeps in field-values test (#58513) 2025-05-27 11:53:53 +01:00
Chris Truter
0444520362 Hack to support seeding the initial editable filters (#58512) 2025-05-27 12:50:09 +02:00
Stas Gavrylov
51a5f4f2fc Update default templates to use scope.origin_url (#58473)
* Update default templates to use scope.origin_url

* Default templates: Fix origin url reference

* Default templates: Fix tests

* fix tests

---------

Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2025-05-27 13:07:34 +03:00
Ngoc Khuat
f5539cdad7 another test fix 2025-05-27 16:20:48 +09:00
Ngoc Khuat
36f8ee0342 test fixes 2025-05-27 12:44:48 +09:00
Ngoc Khuat
33b5e1f905 Merge branch 'internal-tools-master' into internal-tools 2025-05-27 12:29:59 +09:00
Ngoc Khuat
e0f5809a74 Fix Viz settings of 2 questions with the same query on dashboard subsciprionts (#58471) 2025-05-27 01:57:46 +00:00
Alexander Polyankin
a6da2249c0 Remove force-broken-id-refs (#58489) 2025-05-26 22:35:32 +00:00
William
72e14e3ea2 nest-query explicitly adds all fields to the query (#58331)
Before, nest-query relied on the preprocessor (specifically, the add-implicit-clauses middleware) to add all possible
fields to the newly created inner query (and then removes unnecessary fields later).  However, add-implicit-fields
ignores fields with a parent id.  The main user of parent-id is mongo, and mongo doesn't use nest-query, so this
usually isn't an issue.  However, bigquery also uses parent-id, and bigquery is a sql driver that uses nest-query.  As
a result, nest-query wasn't adding bigquery struct member fields to the inner query, which caused some queries to
break.  Now, nest-query explicitly finds all non-sensitive/retired fields (including fields with parent ids) and
ensures that they are in the inner query.
2025-05-26 22:34:41 +00:00
Cam Saul
746e8174bc [Backend modularization] Remove util deps on lib and legacy-mbql (#58379)
* [Backend modularization] Remove `util` deps on `lib` and `legacy-mbql`

* Don't reference unloaded schema

* Test fixes 🔧

* Test fixes 🔧

* cljfmt
2025-05-26 23:10:12 +03:00
Sébastien
d5a0699e61 closes VIZ-1035 silent error when converting certain models to viz cards (#58484) 2025-05-26 18:50:48 +02:00
Alexander Polyankin
fcf51ffefd Show loader every time the generated sql is fetched (#58488) 2025-05-26 16:32:37 +00:00
Riley Thompson
8367dd30a2 Connection impersonation for MySQL & SQLServer (#57622) 2025-05-26 12:18:26 -04:00
Raphael Krut-Landau
eb1de2371e Do science without yelling (#58404) 2025-05-26 11:56:15 -04:00
Stas Gavrylov
4f84e33f77 Optimize EditTableDashcardVisualization rendering (memoize dependencies) (#58475) 2025-05-26 18:24:23 +03:00
Mahatthana (Kelvin) Nomsawadi
fbbf273218 repurpose entityTypeFilter as entityTypes for new embedding data pickers for the SDK (#58208)
* used `entityTypeFilter` for new embedding data pickers

* Rename `entityTypeFilter` to be consistent with `entity_types`

* Migrate `entity_types` to a new reducer

* Add E2E test

* remove unused prop

* Fix interactive embedding's `entity_types`

* Fix unit tests
2025-05-26 15:43:12 +01:00
Chris Truter
f0583eaba5 Tests for more row action types (#58487) 2025-05-26 16:01:35 +02:00
Romeo Van Snick
b1852e2d43 Avoid doing quadratic search in FkTargetPicker (#58434)
* Avoid using quadratic search in FkTargetPicker

* Reduce further parsing and stringification

* Avoid calling JSON.parse in FkTargetPicker

* Assert fieldId

* Rename getters to be more clear
2025-05-26 19:59:58 +07:00
Chris Truter
b5b58ebbcb New v2 execution API for actions (#58432) 2025-05-26 14:40:24 +02:00
Nick Fitzpatrick
b3f4fd20d8 Use user locale setting if available for lang prop in <html> (#58221)
* use user locale setting if available for lang prop in <html>

* add a test

* fix my broken test

---------

Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-05-26 17:54:24 +05:30
Anton Kulyk
63428a43e2 Visualizer: fix scalars being compatible nearly everywhere (#58399)
* Fix scalars being compatible nearly everywhere

* Fix type error
2025-05-26 12:57:31 +01:00
Anton Kulyk
b7de348186 Visualizer: pies, funnels, gauge polish (#58437)
* Fix underlying question menu for pie charts

* Fix opening gauge, fix titles for scalar cards
2025-05-26 12:43:34 +01:00
Nick Fitzpatrick
f142a1dc75 Remove edit permissions from other users personal collections (#58281) 2025-05-26 17:09:50 +05:30
Konstantin Darutkin
d0f20309a1 fix: remove (i) icon from db tables (#58479) 2025-05-26 12:39:04 +01:00
Nemanja Glumac
86350c8a04 Add transient "Getting started" section to the main sidebar (#58332) 2025-05-26 12:20:09 +02:00
Sébastien
ff3d1141cd Closes VIZ-994 snowplow tracking for visualizer (#58274)
* added simple tracking

* .

* added more events

* prefix

* e2e tests

* flaky flaky, eggs and baky

* ...
2025-05-26 10:50:45 +02:00
Jeff Bruemmer
4b11a8aaec docs - entry for datetime function in expression list (#58450)
* entry for datetime function in expression list

* edit

* fix typos
2025-05-23 22:54:35 +00:00
Eric Normand
aebd8322ea Correct datetime() helper text. (#58456) 2025-05-23 22:16:32 +00:00
Riley Thompson
0125b77c3d Add bigquery user agent (#58410) 2025-05-23 21:40:14 +00:00
Tyler Plude
965d41f3ff array-map for json export to preserve order (#58451)
* array-map for json export to preserve order

* fix indents

* add comment
2025-05-23 14:34:20 -07:00
Kyle Doherty
51c758988e clean up settings menu (#58365)
* use mantine menu and reorganize options

* remove comments

* fix unit tests

* e2e test fixes, replace "a" with ForwardRefLink to fix sidebar not getting closed

* fix external links

---------

Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
2025-05-23 17:19:42 -04:00
Tyler Plude
ea48474bcf Convert BigDecimals to double for color getter JS bundle (#58263)
* Convert bigdecimals in table static viz

* unit test; support for bigint conversion
2025-05-23 13:54:38 -07:00
Alexander Polyankin
3d3f52c6f1 Prompt in generated SQL + first comment as a prompt + limit to SQL (#58265)
* Add prompt to the query

* Add prompt to the query

* Add prompt to the query

* Add prompt to the query

* Add prompt to the query

* Add prompt to the query

* Add prompt to the query

* Tests

* Tests

* Tests

* Tests

* Tests
2025-05-23 16:37:52 -04:00
Aleksandr Lesnenko
eaea377420 add pivot xlsx export hint (#58313)
* add pivot xlsx export hint

* safer not to change global checkbox style

* lint
2025-05-24 02:42:05 +07:00
Noah Moss
85bd509d40 url-encode parameters substituted into link and iframe cards (#58429) 2025-05-23 15:29:41 -04:00
Noah Moss
0b53dc2477 Fix column alignment for fully-collapsed pivot exports (#58372)
* Fix fully collapsed pivot exports

* Fix tests, fix unrelated typo
2025-05-23 15:15:17 -04:00
metamben
69703938b3 Add field-values endpoint (#58403) 2025-05-23 22:10:28 +03:00
metamben
1bac602009 Make string matching functions case insensitive (#58427)
Closes BOT-121
2025-05-23 22:10:16 +03:00
Edward Paget
906313b8e0 fix: audit db not working after import form h2 (#58374)
* fix: audit db not working after import form h2

Removes conditions from the `adjust-audit-db-to-source!` function so we
make sure we always restoring the audit db tables to their original form
regardless of what type of app-db is used.

* fixup! test setting up db triggers

* fixup! cljfmt
2025-05-23 18:45:20 +00:00
Timofey Kachalov
4694ac7ce9 Run sample app tests for both prod and dev bundles (#58421) 2025-05-23 19:57:21 +04:00
Nicolò Pretto
295cfce315 remove support for the already deprecated hide_download_button hash parameter (#58401)
* remove support for #hide_download_button

* clean up code 🧹

* adds link to the docs

* use the same style we use in the sdk
2025-05-23 17:27:16 +02:00
Nathan Voxland
16d8f21bbd Improved search metrics (#57797) 2025-05-23 09:29:55 -05:00
Konstantin Darutkin
f6154fd684 feat: render editable when added to a dashboard (#58402)
* feat: render editable when added to a dashboard

* fix: review issues
2025-05-23 15:08:40 +01:00
Oleksandr Solovyov
21f4335bea helper to split fields (#58413) 2025-05-23 16:57:00 +03:00
Phoomparin Mano
d40df5ea08 fix(sdk): fix tooltip crash by migrating away from renderToString (#58394) 2025-05-23 20:46:34 +07:00
Nicolò Pretto
a1acddd7d6 cross versions tests: skip @OSS tests and use prod build for the FE (#58277)
run breaking changes tests on multiple runners

TO BE REVERTED BEFORE MERGING

force production fe build

build-release as setting node_env fucks up everything

exclude @OSS tests

Revert "TO BE REVERTED BEFORE MERGING"

This reverts commit c907a2f492.
2025-05-23 14:38:15 +02:00
Nick Fitzpatrick
43d10c8787 Questions in usage analytics should never show native preview panel (#58229)
* Add additional check on rendering native preview panel

* adding e2e test

* adjusting e2e test

* do not show native panel when no data is selected

* move e2e test to instance analytics suite
2025-05-23 17:13:01 +05:30
Chris Truter
b9fe632080 Add Text/Description back to public field-types docs (#58273) 2025-05-23 13:04:00 +02:00
Anton Kulyk
1e8153a5e0 Use computed settings in visualizer redux actions (#58237)
* Fix some columns added twice

* Use computed viz settings in visualizer actions

* Fix pie chart tests

* Fix removing dimensions in multi series charts

* Handle null metrics and dimensions

* Fix funnel e2e tests

* Fix funnel unit tests

* Fix appending multiple columns

* Fix cartesian unit tests

* Add repro test

* Remove comments

* Add comments
2025-05-23 11:39:42 +01:00
Mahatthana (Kelvin) Nomsawadi
b1bcf32406 Set sensible default data picker step when joining (#58065)
* simplify embedding data picker code

* Show the data picker step based on starting query source

* Set starting model collection ID when joining a model

* Improve initial collection loading UX

* Fix failed unit tests and types

* Fix failed E2E tests

* remove unused var

* Fix sometimes the starting collection is incorrect

* Add an E2E test

* Add a comment to clarify

* Clarify a new prop
2025-05-23 11:38:08 +01:00
Sébastien
5a638013b4 Closes VIZ-646 -> simplify the "empty state" CTAs in visualizer (#57957)
* closes VIZ-646 no dataset CTAs

* better UI

* fixed e2e tests
2025-05-23 11:11:03 +02:00
Timofey Kachalov
5a11a8d3e8 sdk(docs): Remove remarks from SdkDashboardDisplayProps type annotations (#58368) 2025-05-23 11:52:29 +04:00
Fraser
216b1b790c Create LocalizationSettingsPage (#57368)
* Create LocalizationSettingsPage
2025-05-23 14:33:34 +12:00
Edward Paget
f647173e41 Disable quartz metrics trigger listener (#58244) 2025-05-22 20:49:39 -05:00
Cam Saul
fd969ed8d1 [Backend modularization] Move all settings to .settings namespaces (#58327)
* Remove unneeded `GET /api/util/openapi` endpoint

* [Backend modularization] Move all settings to `.settings` namespaces

* Fix stuff up

* Test fixes 🔧

* cljfmt
2025-05-22 17:56:16 -06:00
Brad Anderson
d5cb296f50 Closes VIZ-329 -> Applying formatting updates is unintuitive happens on scroll (#58252)
* VIZ-329 Updates ChartSettingInput and ChartSettingInputNumeric to apply changes when the user pauses typing in addition to on blur

* VIZ-329 Removes now-redundant blur handler in ChartSettingInputNumeric and updates unit tests
2025-05-22 17:16:22 -04:00
Cam Saul
d7a44a0b81 Remove unneeded GET /api/util/openapi endpoint (#58323)
* Remove unneeded `GET /api/util/openapi` endpoint

* Fixes
2025-05-22 19:34:35 +00:00
Aleksandr Lesnenko
4ef802769e use original series settings visibility in visualizer (#58243)
* use original series settings visibility in visualizer

* hide settings for hidden series, add a spec

* shallow clone
2025-05-23 02:13:42 +07:00
Aleksandr Lesnenko
d96b5a512f Makes visualizer entities use numeric card.ids in viz settings (#58295)
* Revert "fix serialization for visualizer entities (#57467)"

This reverts commit d56e791077.

* drop columns from test data

* fix types, tests

* Revert "[VISUALIZER] Fixing dashboard duplication for visualizer cards (#58106)"

This reverts commit 6cf7606754.

* keep preferred true?

* serdes transformation support for visualizer settings

* Update entity ids in visualizer dashcards on DB read to be card ids

* unit test for the serdes transformations

* cljkondo

* fix on-read to only run if viz settings exists

---------

Co-authored-by: Tyler Plude <tsplude@gmail.com>
Co-authored-by: Noah Moss <noahbmoss@gmail.com>
2025-05-22 11:55:32 -07:00
Cam Saul
cefe3d4c0b [BE modularization] Eliminate permissions dep on server, server dep on users (#58312)
* [Backend modularization] Eliminate `permissions` dep on `server`, `server` dep on `users`

* Move `user/permissions-set` => `perms/user-permissions-set`

* Fix something else

* Cleanup

* Fix Kondo warnings

* Fix Kondo

* Revert parallelizing Kondo

* Fix the stuff
2025-05-22 18:19:07 +00:00
Nicola Mometto
4565e1ce54 Disable distribution drill if binning is not available (#58356)
* disable distribution drill if binning is not supported

* add unit test
2025-05-22 18:40:33 +01:00
Cam Saul
cc3b0ceecb [Backend modularization] batch-processing module (#58330) 2025-05-22 10:32:24 -07:00
Eric Normand
22502a99dc Implement the datetime(string) custom expression function (#58048)
* Empty

* Add schema for datetime()

* Add datetime() function; works on iso strings

* Implement datetime() for sql to test all drivers

* Remove Z from datetime

* Change the format of the datetime string in tests

* Be more lenient on types

* have multiple formats for the test

* Implement datetime() for mongo

* Use ISO string in test

* Datetime for string with no mode

* Add changelog entry for :expressions/datetime

* Add docs for datetime

* Add e2e tests for datetime

* Update e2e test and datetime text

* Fix :expressions/datetime feature

* Remove reference to iso

* Remove unused schema

* Fix frontend test

* Use multiple arities for datetime()

* Replace T with ' ' in databases that don't like T in datetime timestamps

* Try removing visibility requirement in test

* Fix brittle test

* Test dates with space and with T

---------

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-05-22 11:26:40 -05:00
Kyle Doherty
7bbc501191 add text to help with swap affordance (#58311) 2025-05-22 11:42:52 -04:00
Alexander Polyankin
7b66df806b Fix dashboard crashing when there is invalid stage-number in parameter targets (#58296) 2025-05-22 11:40:36 -04:00
Maz Ameli
f4abe9a703 Standardize form input font size to md (14px) and improve spacing (#58258)
* make form inputs use md font size, and add spacing

* remove redundant classes, tweak spacing
2025-05-22 15:38:19 +00:00
Edward Paget
0555261a6e fix: drop execution time quartz job metric (#58351) 2025-05-22 09:59:34 -05:00
metamben
3eaca42bd5 Call AI service endpoints without trailing slashes (#58348) 2025-05-22 14:29:15 +00:00
Sébastien
af14a4ef81 Closes VIZ-989 double scrollbars on tabular view (#58345)
* closes VIZ-989 double scrollbars on tabular view

* .
2025-05-22 16:04:57 +02:00
Phoomparin Mano
5ee122bd43 Show "Use instance font" in default dropdown in static embed (#58335) 2025-05-22 21:03:28 +07:00
Romeo Van Snick
02a5a4d511 Render bucketing popover in portal (#58170)
* Render popover in portal

* Revert withinPortal change

* WIP

* Move overflow onto child container

* Move fix to css-only

* Remove fixed strategy

* Fix e2e tests

* Reduce diff
2025-05-22 15:39:52 +02:00
Phoomparin Mano
608bb8c1c4 feat(sdk): remove question and metric from entity type filters in the sdk's data picker (#58339) 2025-05-22 20:06:47 +07:00
Stas Gavrylov
757b650588 WRK-425: Hide TableDashcard actions panel when editing dashboard (#58341) 2025-05-22 15:15:48 +03:00
Nicolò Pretto
f1843ef47f run breaking changes tests on multiple runners (#58092) 2025-05-22 13:18:50 +02:00
metamben
1061de72ca Handle decoding of nil (unknown) field type (#58318) 2025-05-22 06:17:03 +00:00
Cam Saul
43f5033b5f [Backend modularization] eliminate api dependency on server (#58317)
* [Backend modularization] eliminate `api` dependency on `server`

* Fix moved var
2025-05-22 01:39:04 +00:00
Cam Saul
4bb81a7927 [Backend modularization] Decouple app-db and util from driver (#58249)
* [Backend modularization] Decouple `app-db` and `util` from `driver`

* Fixx

* Test fix 🔧

* Move query cancelation checking logic for app DB types into `app-db`

* Fix

* Appease Kondo
2025-05-21 21:33:27 +00:00
Cam Saul
e8559895a3 [Backend modularization] eliminate api dep on embedding (#58310) 2025-05-21 21:07:31 +00:00
Edward Paget
c162d0983d fix: explicitly mark when fields are gtapped (#58113)
* fix: explicitly mark when fields are gtapped

* add debug

* fixup! tests setup to set advanced feature

* fixup! strip any user-added gtapped-tables keys

* fix a bad import
2025-05-21 16:04:45 -05:00
Nemanja Glumac
e8faba9fe8 Refactor browse navigation section (#58279)
* Refactor `browse` navigation section

- Removes the dependency on the `CollapseSection` custom component
- Prepares the section for the "Add Data" project

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-05-21 20:42:21 +00:00
Cam Saul
c82a945223 [Backend modularization] Eliminate util dependency on channel and parameters (#58302) 2025-05-21 14:14:28 -06:00
Cam Saul
90161de265 [Backend modularization] logger cleanup; decouple api from logger (#58251)
* [Backend modularization] `logger` cleanup; decouple `api` from `logger`

* Test fixes 🔧
2025-05-21 14:11:23 -06:00
Cam Saul
f9e730f12d Misc backend modules tooling improvements (#58298) 2025-05-21 14:10:57 -06:00
Alexander Polyankin
302d1295a5 Do not create targets with nil field refs (#58299) 2025-05-21 20:00:41 +00:00
Edward Paget
b81d0f94e9 fix: appdb table permssions search slowdown (#58294)
Use a correlated subquery to make sure we hit the pk index

Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-05-21 18:59:12 +00:00
dpsutton
ab3f39a82b Log view count information (#58259)
BEFORE:
```
2025-05-20 22:24:17,586 DEBUG middleware.log :: POST /api/dashboard/pivot/1/dashcard/12/card/10/query 202 [ASYNC: completed] 634ms (81 DB calls) App DB connections: 1/15 Jetty threads: 4/50 (3 idle, 0 queued) (132 total active threads) Queries in flight: 1 (0 queued); h2 DB 1 connections: 0/7 (0 threads blocked) {:metabase-user-id 1}
2025-05-20 22:24:25,629 DEBUG events.view-log :: Increment view counts of 24 items
```

AFTER:

```
2025-05-20 22:24:17,586 DEBUG middleware.log :: POST /api/dashboard/pivot/1/dashcard/12/card/10/query 202 [ASYNC: completed] 634ms (81 DB calls) App DB connections: 1/15 Jetty threads: 4/50 (3 idle, 0 queued) (132 total active threads) Queries in flight: 1 (0 queued); h2 DB 1 connections: 0/7 (0 threads blocked) {:metabase-user-id 1}
2025-05-20 22:24:25,629 DEBUG events.view-log :: Increment view counts of 24 items
2025-05-20 22:24:25,638 DEBUG events.view-log :: Writing 3 items to :model/Dashboard with lock :metabase.events.view_log/report_dashboard-view-count
2025-05-20 22:24:25,654 DEBUG events.view-log :: Writing 21 items to :model/Card with lock :metabase.util.cluster-lock/statistics-lock
2025-05-20 22:24:27,649 WARN models.card :: Best-effort backfill of :entity_id failed for Card null
2025-05-20 22:24:27,656 WARN models.card :: Best-effort backfill of :entity_id failed for Card null
2025-05-20 22:24:27,660 WARN models.card :: Best-effort backfill of :entity_id failed for Card null
```
2025-05-21 13:36:51 -05:00
Sébastien
3c8ca416f1 Closes VIZ-984 provide a clearer entrypoint to the underlying question in viz cards (#58228)
* added an ... submenu to open questions

* fix

* menu is now in the title

* addressed feedback

* reverted submenu change

* added title menu items to funnel

* added e2e test

* added chevron

* unit test fix
2025-05-21 19:18:42 +02:00
Cam Saul
de55ea6c3e [Backend modularization] Eliminate util dep on dashboards (#58250) 2025-05-21 10:28:41 -06:00
Denis Berezin
9f8adeaadb WRK-419: filter available editable tables list based on db setting 2025-05-21 19:25:29 +03:00
Sloan Sparger
5462e2fb61 [Metabot] Sidebar UI (#58059)
* remove auto-close logic

* add metabot icon to searchbar, clicking icon opens metabot instead of search

* make chat ui appear in the sidebar

* add header section to the chat sidebar

* progress on conversation ui

* few tiny additions

* fetch mock suggested prompts from an endpoint, animate thinking text, fix search button touch target size, do no clear chat history when closing the chat sidebar

* messages rendered as markdown

* restyles

* more restyles

* fix input autofocus

* impl empty state, remove more textarea code

* hide copy button actions

* handle user aborted requests better

* design iteration

* latest design feedback, better auto-scrolling, better markdown rendering

* fix types

* increase unit test coverage

* impl long convo calc, add unit tests, fix focus issue if clicking the metabot option from the command palette

* move code to enterprise folder, fix some e2e, adjust header alignment, fix some types

* small clean ups, fix failing tests and erroring types

* add unit test and fix selector for getting latest agent messages by type

* review feedback, turn on an e2e test again

* try getting metabot e2e working

* fix embedding sdk

* impl pr feedback
2025-05-21 11:23:08 -05:00
Edward Paget
d6acba4756 fix: split snyk scans (#58290)
Fits them under githubs 20 runs per sarif file limit
2025-05-21 16:05:57 +00:00
Konstantin Darutkin
7d2f608ffc fix: respect action settings for bulk deletion (#58287) 2025-05-21 16:14:52 +01:00
Konstantin Darutkin
32771e9841 feat: warn user about potential data loss when there are changes in the queue to be saved (#58286) 2025-05-21 16:09:57 +01:00
Romeo Van Snick
f7e14433ef Update toast design (#58145)
* Make default toast color darker

* Avoid remounting the UndoList on overy toast change

* Tweak the undo animation to come in from the left

* Move more undo state into UndoListingOverlay

* Reverse toast order

* Manually manage undo target

* Remove unused props

* Store pause state in undo itself

* Use react-transition-group to render toast notifications

* Measure height so we can animate toast position

* Use css transforms only and avoid animating bottom

* Mock react-transition-group in test

* Unmount elements on exit

* Wait for animation in test

* Make toast ref optional

* Clean up transition

* Fix e2e test

* Disable transition group in cypress

* Add check_filled icon

* Default to check_filled

* Add text-secondary-inverse

* Use text-secondary-inverse color for icon on tooltip

* Remove min-width from toast

* Control the animation state of the todo's after moving the portal

* Fix icon in unit tests

* Simplify undo hooks

* Avoid overwriting state

* Add missing import

* Allow transitioning new todos even when not moving the portal

* Fix e2e test

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-05-21 15:29:54 +02:00
Uladzimir Havenchyk
8f4cda8597 feat: update metabot icon and placeholder text (#58253)
* feat: update metabot icon and placeholder text

* add tests
2025-05-21 11:48:44 +00:00
Nicola Mometto
56f420c38d Fix race condition in sync, causing failure if a table gets deleted inbetween steps (#58217)
* fix typo

* don't error out during fields-metadata fallback if table is known to not exist

* table known to not exist impl for drivers

* add test

* add debug log

* add to changelog

* address review comments
2025-05-21 12:43:46 +01:00
Roman Pittner
1ff83fcb70 Swapped out the <StepTitle/> for default <Title/> in CompletedStep.tsx
Visual change. Updated the title in CompletedStep.tsx with the actual <Title/> component so that the styling is unified with the rest of the app.
2025-05-21 13:05:11 +02:00
Nemanja Glumac
dfbebdfce3 Branding email subscriptions (#58096)
This commit adds the conditional branding to dashboard email subscriptions and to question alerts. It does so by altering the handlebars templates we use for each, respectively. It follows the same logic as the rest of the PRs from this project. If a token has a whitelabel feature flag (Pro/Enterprise), the branding is not shown. It should be shown for OSS and for Starter plans.

* Add branding content to dashboard subscriptions

* Add branding content to alerts
2025-05-21 12:59:27 +02:00
Nick Fitzpatrick
ec224e251e Exclude parent from recents and search when moving items (#58181)
* Do not show entity parent in recents or search when moving entities

* e2e tests

* adjusting e2e test
2025-05-21 15:42:20 +05:30
Aleksandr Lesnenko
e73e604d4c fix narrow columns widths in dashcards (#57873)
* expand columns to minGridWidth

* specs, flakiness

* refactor measuring code, reduce flakiness

* fix types

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-05-21 15:56:39 +07:00
Phoomparin Mano
cf6a83436c Restore embed signal fallback when in embedding (#58240) 2025-05-21 15:30:48 +07:00
Chris Truter
17e8ae6b28 Un-deprecate Text/Description semantic type (#58235) 2025-05-21 10:18:18 +02:00
Nick Fitzpatrick
023f079151 API key creation modal alawys shows error after selecting group (#58210)
* fixing FormGroupWidget error prop

* update unit test
2025-05-21 12:28:14 +05:30
Raphael Krut-Landau
0e5e5cd2c5 Add script to facilitate translation backports (#58189) 2025-05-20 22:19:55 -04:00
Cam Saul
8749431e5d [Backend modularization] Move some legacy stuff to .core namespaces (#58185)
* [Backend modularization] Move some legacy stuff to `.core` namespaces

* Kondo linter and rename `metabase.http-client` => `metabase.test.http-client`

* metabase.cloverage-runner => metabase.test.cloverage-runner

* `metabase.types` => `metabase.types.core`

* cljfmt / Kondo

* Fix ns name

* Fix type names

* Add `NumericWrapper?` and `TextWrapper?` helpers

* cljfmt

* `metabase.cmd` => `metabase.cmd.core` (part 2)

* Test fixes 🔧
2025-05-20 22:01:32 +00:00
Denis Berezin
d9c75d3c8c Hidden or non-editable fields in row actions (#58198)
* Refactor row actions mapping form, add visibility settings

* Add more options for row actions fields

* fix types

* fix types

* self review
2025-05-21 00:50:49 +03:00
Alexander Polyankin
f15681fc90 Remove field ident calculation (#58246) 2025-05-20 21:48:05 +00:00
Alex Yarosh
09fff2ff41 docs: make sure the code renders (#58205)
* Update funnel.md

* don't need to escape apparently
2025-05-20 17:27:51 -04:00
Cam Saul
6d3d404d1d [Backend modularization] Move JVM metadata provider into lib-be (#58245)
* [Backend modularization] Move JVM metadata provider into `lib-be`

* Fix namespaces
2025-05-20 20:02:05 +00:00
Alexander Polyankin
605cabe101 Remove entity_id on databases, tables, fields (#58236) 2025-05-20 19:50:28 +00:00
Cam Saul
ee52f219dc [Backend modularization] Remove models dep on driver (#58203) 2025-05-20 18:54:05 +00:00
Cam Saul
ce3b11810c [Backend modularization] move metabase.dashboard-subscription-test (#58114)
* [Backend modularization] move `metabase.dashboard-subscription-test` (DEV-524)

* Fix
2025-05-20 18:28:37 +00:00
Cam Saul
6841c08ff7 [Backend modularization] events module deps pruning (#58202)
* [Backend modularization] `events` module deps pruning

* cljfmt
2025-05-20 18:10:23 +00:00
Noah Moss
f7f8f6b911 Ensure we buffer the output stream for CSV downloads (#58238) 2025-05-20 10:57:42 -07:00
Anton Kulyk
e1b1e18500 Unify visualizer compatibility checks + disable unusable columns (#57919) 2025-05-20 18:28:52 +01:00
Cam Saul
7f3a4a1463 [Backend modularization] metabase.api.dataset => metabase.query-processor.api (#58201)
* [Backend modularization] `metabase.api.dataset` => `metabase.query-processor.api`

* Update config

* Sort namespaces

* Fix Kondo warnings
2025-05-20 12:07:39 -05:00
bryan
3ecfbb74e1 Ues linear graphql api with exponential backoff (#58182) 2025-05-20 10:33:13 -06:00
Alexander Polyankin
84af10f4c0 Add unique metabase_table(db_id, schema, name) constraint (#58103)
* Add migration

* Add migration

* Add migration

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Deduplicate tables

* Deduplicate tables

* Deduplicate tables

* Fix tests

* (mt/with-temp-defaults :model/Database)

* (mt/with-temp-defaults :model/Database)

* Fixes

* Remove new column from results

* Remove new column from results

* Remove new column from results

* Remove new column from results

* Fix test

* Fix test

* Fix test

* Fix test

* Fix test

* Fix test

* Fix test

* Fix test

* Fix test

* Fix test

* Fix test

* Fix test

* BackfillDatabaseEntityIds

* BackfillDatabaseEntityIds

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* metabase_table

* Add a comment

* Add a comment

* Add a comment

* Add a comment
2025-05-20 11:44:00 -04:00
Konstantin Darutkin
aa38d7d06d fix: editable menu should not display visualize another way option (#58216) 2025-05-20 16:02:03 +01:00
metamben
386693ede9 Make sure dashcard parameter mappings have valid targets (#58215)
Fixes #58214
2025-05-20 16:36:57 +03:00
Chris Truter
de589ea335 Finish action-ifying things and improving output shapes (#58166) 2025-05-20 15:30:43 +02:00
Cam Saul
5578b587a5 [Backend modularization] metabase.db => metabase.app-db.core (#58200)
* Remove most outdated :consistent-alias specs

* `metabase.db` => `metabase.app-db.core`

* Kondo fixes 🔧
2025-05-20 05:36:14 -07:00
Phoomparin Mano
f5f8a13af9 fix(sdk): questions shows an error while loading on strict mode (#58183) 2025-05-20 18:26:39 +07:00
Christoph Deil
1d3e4d8cf6 Fix Python newline in code-templates.ts (#57350) 2025-05-20 12:22:09 +01:00
Stas Gavrylov
11aad82749 WRK-415, WRK-416: Minor fixes for custom templates (#58213)
* WRK-416: Add error message output to template preview

* WRK-415: Make HandlersInfo display all configured Slack channels

* Fix lint error in Editable

* WRK-416: Add e2e test for preview error display
2025-05-20 13:39:23 +03:00
Timofey Kachalov
50678b84b7 Add sdk esbuild branch to the release process (#58211) 2025-05-20 14:06:04 +04:00
Stas Gavrylov
b2e931b612 WRK-414: Custom templates e2e tests (#58017)
* Custom Templates: e2e tests for default and custom templates

* Custom Templates: e2e tests for alert condition, update alert, delete alert

* Custom Templates: e2e tests for template preview

* Custom Templates: e2e tests refactoring

* Custom templates: Refactor CodeMirror testing

* Custom Templates: Fix e2e async issues

* Custom Templates: Fix BE test
2025-05-20 12:13:21 +03:00
Timofey Kachalov
a6642444d6 feat(sdk): Do not bundle main-app plugins to the SDK bundle (#58028) 2025-05-20 12:23:11 +04:00
github-automation-metabase
f80ca9eb75 Bump org.eclipse.jetty/jetty-server from 12.0.20 to 12.0.21 (#58138)
* Bump org.eclipse.jetty/jetty-server from 12.0.20 to 12.0.21

Inspect dependency changes here:

* Update deps.edn

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-20 00:28:52 +00:00
github-automation-metabase
f2b782b9d6 Bump djblue/portal from 0.59.0 to 0.59.1 (#57815)
Inspect dependency changes here: https://github.com/djblue/portal/blob/0.59.1/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-20 00:25:09 +00:00
github-automation-metabase
dba7e427b5 Bump com.github.seancorfield/honeysql from 2.7.1295 to 2.7.1310 (#58132)
Inspect dependency changes here: https://github.com/seancorfield/honeysql/blob/v2.7.1310/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-20 00:17:48 +00:00
github-automation-metabase
230de54068 Bump rewrite-clj/rewrite-clj from 1.1.49 to 1.2.50 (#58140)
Inspect dependency changes here: https://github.com/clj-commons/rewrite-clj/blob/v1.2.50/CHANGELOG.adoc

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-20 00:09:33 +00:00
github-automation-metabase
ab2d8b1120 Bump com.databricks/databricks-jdbc from 2.7.1 to 2.7.3 (#58143)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-19 23:47:26 +00:00
github-automation-metabase
8f2690e850 Bump io.github.clojure/tools.build from 0.10.8 to 0.10.9 (#58133)
Inspect dependency changes here: https://github.com/clojure/tools.build/blob/v0.10.9/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-19 23:39:08 +00:00
github-automation-metabase
afb0b91f02 Bump thheller/shadow-cljs from 3.0.5 to 3.1.1 (#58141)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-19 23:34:39 +00:00
Maz Ameli
96071d15ce auto-merge
* remove unused var

* use mantine radius

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

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-05-19 23:32:17 +00:00
github-automation-metabase
772ad84d24 Bump io.github.tonsky/clj-reload from 0.9.5 to 0.9.6 (#58134)
Inspect dependency changes here: https://github.com/tonsky/clj-reload/blob/0.9.6/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-19 23:29:38 +00:00
github-automation-metabase
799e6f90cd Bump com.clickhouse/clickhouse-jdbc from 0.8.5 to 0.8.6 (#58142)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-19 23:28:39 +00:00
Cam Saul
6c623919a1 [Backend modularization] add tests to make sure we have requires (#58196)
* [Backend modularization] add tests to make sure we have requires for `init` and `settings` namespaces

* cljfmt
2025-05-19 23:14:59 +00:00
github-automation-metabase
104f820b1b Bump methodical/methodical from 1.0.126 to 1.0.127 (#58135)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-19 23:12:55 +00:00
Cam Saul
067621099e [Backend modularization] metabase.models.dimension => warehouse-schema (#58191) 2025-05-19 22:12:19 +00:00
bryan
1662b32dee key prefixes must be unique, but they weren't (#58190) 2025-05-19 20:49:24 +00:00
Cam Saul
a952fb7e8e [Backend modularization] Move metabase.util.ssh into driver (#58187)
* [Backend modularization] `metabase.util.ssh` => `metabase.driver.sql-jdbc.connection.ssh-tunnel`

* Update changelog
2025-05-19 13:41:46 -07:00
Timofey Kachalov
263547ba24 Fix timeline event tooltip date text for SDK (#58122) 2025-05-20 00:36:30 +04:00
Cam Saul
b892464ed6 [Backend modularization] Move util/password_check into session (#58179)
* [Backend modularization] Move `util/password_check` into `session`

* PR feedback
2025-05-19 20:04:35 +00:00
Brad Anderson
5b0b40b8e5 chore: add bpander as a team member (#58176) 2025-05-19 15:24:01 -04:00
metamben
33b628834d Fix X-Ray URLs generated for models (#58178)
Fixes BOT-125
2025-05-19 21:55:55 +03:00
Nathan Voxland
9472a252df Limit data selected out to what will be eventually indexed (#57552) 2025-05-19 13:52:47 -05:00
Phoomparin Mano
7fff64eaf7 feat(sdk): remove footer from dashboards (#57779) 2025-05-20 00:49:59 +07:00
Nicola Mometto
457526c9ef Exclude all numeric values from Category semantic type consideration (#57955)
* docstring typo fixes

* [SEM-8] Exclude all numeric values from Category semantic type consideration

* add unit test for SEM-8

* more typo fixes

* adjust existing tests for new sync behavior

* extend category classifier restriction to any non-text(-like)

* unit test for bolean classification

* further adjust existing tests for new sync behavior

* missed one test

* Fix e2e test by filtering

* fix e2e test by setting field semantic-type before hand

* don't classify int/bool values to category by name either

* rename tests

* extend tests

* style

* remove unused var

---------

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-05-19 18:08:03 +01:00
Aleksandr Lesnenko
b932a8fd5c fix ai question sidebar rerenders (#58152) 2025-05-19 16:23:29 +00:00
appleby
8d0ee0743d Remove :expression_name from col-info-for-expression in annotate middleware (#57981)
* Fix the sorting of custom column from a saved card in a new question

* Remove the expression_name that is not actually used.

* Use col.name instead of expression_name in sanatizeResultData

* Remove additional :expression_name references in tests

* Remove comment that was attached to now-removed :expression_name

* Remove expression_name from static-viz components

* Remove expression_name from instance_analytics export

* Add comment to now-deprecated expression_name field in DatasetColumn

* Add e2e test for sorting on nested custom column

---------

Co-authored-by: Lifeng Lv <lvlifen9@gmail.com>
2025-05-19 08:45:49 -07:00
Ryan Laurie
95c42197c3 update google auth form (#57715) 2025-05-19 09:25:16 -06:00
Ryan Laurie
dfe5951475 cleanup deprecation notice code (#58001) 2025-05-19 09:21:21 -06:00
Noah Moss
f08b7961fb Unlimit pivot exports (#58109)
* unlimit pivot exports

* fixups, fix default for collapsed rows setting

* address import issue

* simple unit test

* simplify test a bit

---------

Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-05-19 11:13:40 -04:00
Nathan Voxland
7c75d0ef53 Better support for non-english searching in appdb index (#57979) 2025-05-19 10:04:36 -05:00
Noah Moss
b75e530b78 Fix default for condense duplicate totals setting (#58112)
* fixups, fix default for collapsed rows setting

* add condense_duplicate_totals test for pivot csv exports

* tweak order of checks
2025-05-19 11:03:25 -04:00
Nemanja Glumac
ac444667ff Fix broken yarn dev-ee (#58164)
Running `yarn dev-ee` was broken on the latest master. (introduced in #58054)
The compiler was complaining about the `\` in the docstring because it was interpreting it as an escape character followed by a newline.
2025-05-19 15:25:33 +02:00
Oleksandr Yakushev
00dc257b65 cljs: Fix obscenely large schema expansions (#58094) 2025-05-19 16:12:11 +03:00
Oleksandr Yakushev
35a641b26f Bump HoneySQL version (#58156) 2025-05-19 16:05:17 +03:00
Oleksandr Yakushev
f383f9a753 perf: Small optimizations for metabase.search.spec (#57935) 2025-05-19 15:55:15 +03:00
Timofey Kachalov
807acae216 sdk(feat): Reduce bundle size by using commonReducers from the Main App by SDK (#58071) 2025-05-19 16:51:04 +04:00
Aleksandr Lesnenko
620117bb3f Fix visualizer cards do not work on public dashboards (#58104)
* add missing entity_id field

* specs
2025-05-19 17:53:28 +07:00
Aleksandr Lesnenko
0ac23e079e fix legend flaky spec (#58006) 2025-05-19 17:52:46 +07:00
Aleksandr Lesnenko
db6300be72 fix tooltip flakes (#58117) 2025-05-19 17:50:42 +07:00
Konstantin Darutkin
305f102ef9 fix: do not switch timezones when editing a date (#58090)
* fix: do not switch timezones when editing a date

* fix: reivew fixes
2025-05-19 11:35:14 +01:00
Konstantin Darutkin
f3211e4cf2 fix: remove bulk edit from the UI (#58155) 2025-05-19 11:29:00 +01:00
Oleksandr Yakushev
2f84c10b82 perf: Cache metabase.driver.util/features (#57811) 2025-05-19 10:21:20 +00:00
Oleksandr Yakushev
53a2d9e079 Bump Toucan and Methodical (#57932) 2025-05-19 13:19:56 +03:00
Oisin Coveney
0351cbdf3a Fix menu text on sharing and subscription menu (#58089) 2025-05-19 09:53:01 +00:00
Nicolò Pretto
afa28d75bf convert script to js in preparation of splitting the work on multiple runners (#58086)
* convert script to js

import os

* remove two tests as one file there fails

* Update bin/backward-compatibility-test.js

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>

* test -> tests

* address feedback

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-05-19 11:42:22 +02:00
Sébastien
6994d6ca24 Closes VIZ-982 settings not always being propagated (#58072)
* .

* closes VIZ-982 settiings not being propagated

* fixup
2025-05-19 10:56:33 +02:00
Mahatthana (Kelvin) Nomsawadi
3533f67824 Remove field references (#57950) 2025-05-19 05:23:58 +01:00
Alexander Polyankin
b0e6c762c7 Revert "Clean up after #58124 (#58127)" (#58128)
This reverts commit 04462007be.
2025-05-18 11:14:27 -04:00
Alexander Polyankin
04462007be Clean up after #58124 (#58127) 2025-05-18 13:19:55 +00:00
Alexander Polyankin
02596269e1 Revert "Add unique metabase_database (name, engine) constraint and deduplicat…" (#58124)
This reverts commit 5300bf8bfc.
2025-05-18 11:15:36 +00:00
Alexander Polyankin
5300bf8bfc Add unique metabase_database (name, engine) constraint and deduplicate data (#58101) 2025-05-17 03:55:52 +00:00
Aleksandr Lesnenko
96eefff546 fix x-axis ticks granularity on charts with multiple datasets (#57805)
* fix x-axis ticks granularity on charts with multiple datasets

* update specs

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-05-17 03:12:35 +00:00
Cam Saul
688c93d4bc [Backend modularization] users module (first pass) (#58054)
* [Backend modularization] `users` module (first pass)

* Add missing fixture

* Add another missing fixture

* Fix test failure

* Test fixes 🔧

* Test fix ??

* Appease Kondo

* Fix missing (.wakeUp ...) call
2025-05-17 00:46:58 +00:00
Cam Saul
3f8676b1c0 [Backend modularization] warehouses module (first pass) (#58058)
* [Backend modularization] `warehouses` module

* Test fix 🔧

* Test fix 🔧

* Fix bad merge

* Test fix 🔧

* Appease Kondo
2025-05-16 23:59:43 +00:00
Tyler Plude
6cf7606754 [VISUALIZER] Fixing dashboard duplication for visualizer cards (#58106)
* Fixing dashboard duplication for visualizer cards

* test fix
2025-05-16 16:04:06 -07:00
Denis Berezin
a496f9de7d Fix issue with optimistic update after successful update 2025-05-17 02:03:06 +03:00
Denis Berezin
3da6ed1c81 Row action column mapping (#57939)
* add basic action settings state management

* Add basic remapping

* polish settings form

* review fixes
2025-05-17 01:41:47 +03:00
Cam Saul
8661c9a1d6 [Backend modularization] warehouse-schema module (first pass) (#58047)
* [Backend modularization] `warehouse-schema` module (first pass)

* [Backend modularization] `warehouse-schema` module (first pass)

* Fix

* Fix test failure 🔧
2025-05-16 22:40:06 +00:00
bryan
164f9b0d4b require --hot cli arg to enable reloader mw (#58095) 2025-05-16 16:13:03 -06:00
bryan
c20859f4eb mage jar-download improvments (#58102) 2025-05-16 16:12:55 -06:00
Ryan Laurie
52d7235fee Refresh temporary tokens (#58046)
* refresh temporary tokens

* fix tests

* update comments
2025-05-16 22:12:45 +00:00
Ryan Laurie
0ae799bed8 flake jail (#58108) 2025-05-16 15:17:03 -06:00
Cam Saul
c8546e2af3 [Backend modularization] dashboards module (first pass) (#58056)
* [Backend modularization] `dashboards` module

* Move models

* move API namespace
2025-05-16 20:58:47 +00:00
William
bd0a271edd revert and disable entity-id backfill (#58098) 2025-05-16 14:12:37 -05:00
Nemanja Glumac
54a306d031 Adapt the setup flow for the "embedding" use case (#57749)
We're greatly simplifying and speeding up a Metabase setup 
when the use case is "embedding". This currently applies only to 
hosted instances. The FE in the main app will expect the query param
`use_case=embedding` to exist. If it does, we're showing the simplified
setup flow.
2025-05-16 10:51:06 -06:00
Cam Saul
0b36b9a2e6 [Backend modularization] Remove server's dependency on api-routes (#58052)
* [Backend modularization] Remove `server`'s dependency on `api-routes`

* Test fix 🔧
2025-05-16 08:59:37 -07:00
Cam Saul
0be751ab44 [Backend modularization] Move :model/ApplicationPermissionsRevision (#58057) 2025-05-16 08:58:52 -07:00
metamben
dd1a150343 Optimize DB caching and field matching (#58082)
* Optimize DB caching and field matching

Fixes BOT-139

* Stop relying on column idents

* Warm the cache when loading available metric cards
2025-05-16 15:06:51 +00:00
Oleksandr Yakushev
bc4be9159f cljs: Don't require cljs.pprint in :cljs-release mode to reduce bundle size (#58085) 2025-05-16 17:57:12 +03:00
Eric Normand
d196582116 date() and text() in sql dbs and mongo (#57653)
* Empty

* kick ci

* Allow temporal type in addition to string for `date()`

* Add date(datetime) test

* Use cast for date for postgres

* Extend date() on mysql

* Extend date() on bigquery

* Extend date() at snowflake

* Extend date() to datetime on clickhouse

* Generalize `date()` to :sql

* Update changelog with `date(datetime)`

* Empty

* DateTime->Date Coercion + test

* Slight cleanup

* Whitespace

* Cleaner implementation and test

* Test timestamp as well as timestamptz

* Correct implementation to get subtypes of DateTime

* Update helper text string for date

* Add e2e tests for date

* Also check to correct coercion of dates

* Add customization points to enable clickhouse implementation.

* Remove changelog-test/ignore true from ->date

* Fix defn ordering

* Fix expected type for datetime coercions

* Fix tests for sqlite

* Implement coercion for Mongo

* Implement specialization for oracle

* Add :expressions/date feature to all sql dbs

* Add :expressions/date feature to mongo

* Mongo: add text() and date()

* Better check

* Better check

* kick ci

* Add text() to all sql dbs

* Empty

* kick ci

* kick ci

* Format code

* Format code

* Add :text implementation to sql driver

* More robust tests across drivers

* Correct changelog text

* Ors on one line

* Or on same line

* kick ci

* Add `text-dbtype` multi-method

* Add athena implementation of text-dbtype

* Add databricks implementation of text-dbtype

* Remove date expression in tests that breaks some sql dbs

* Improve cast test for dates on other dbs

* Remove duplicate test

* Remove test that won't work for many dbs

* Use VARCHAR for oracle

* Use STRING for SparkSQL

* Use VARCHAR on Vertica

* Remove test that converts date to text before parsing it

* Add mongo exception

* Only run this test for SQL databases (requires native sql query)

* Add SQL Server text type

* Add Starburst text type

* Try varchar2(100)

* Simpler implementation

* Don't support date() for Oracle

* Try selecting from people to get oracle to work.

* Compile nested query for `text()` test

* Don't test empty string because Oracle treats it as NULL.

* Appease the kondo

* Implement Presto cast to text

* Implement cast-to-text in terms of cast (for presto)

* Correct test name

---------

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-05-16 14:55:01 +00:00
Timofey Kachalov
801e9b6e6b feat(sdk): Do not add unused Empty state SVG images to the SDK bundle (#58013) 2025-05-16 17:26:37 +04:00
Ngoc Khuat
5af0a1720b Robust InitSendPulseTriggers (#58007) 2025-05-16 20:42:16 +09:00
Nemanja Glumac
58e15efc82 Return nil when there are no params in a subscription (#58075)
We're using the `computed.filters` value in the handlebars email template.
Previously, if `parameters` were an empty list `[]` we were returning a truthy value,
and handlebars was rendering an empty row in an email.

@ngoc figured out that we need to wrap parameters with `seq` in order to have a
a proper `nil` assigned to `:parameters`.
2025-05-16 11:27:14 +00:00
Ngoc Khuat
7651509551 Merge branch 'master' into internal-tools 2025-05-16 20:18:35 +09:00
Timofey Kachalov
9fcd2fef34 feat(sdk): Reduce bundle size by avoiding the usage of jsrsasign dependency (#58009) 2025-05-16 14:53:02 +04:00
Nemanja Glumac
fe41e9bb1a Update the copy for the map empty viz state (#58073) 2025-05-16 12:35:15 +02:00
Aleksandr Lesnenko
7a8727b98d fix flaky timelines spec (#58060) 2025-05-16 12:33:44 +02:00
metamben
e17c8f0671 Batch process fields in implicitly-joinable-columns (#58053) 2025-05-16 09:48:11 +00:00
Sébastien
800067c2d2 Closes VIZ-700 switch to using include_metadata (#57829)
* closes VIZ-700 switch to using include_metadata

* e2e

* e2e

* more work on making e2e less flaky?
2025-05-16 09:51:12 +02:00
Ngoc Khuat
ad81d702ac default slack template should escape vals (#58069) 2025-05-16 16:28:32 +09:00
Ngoc Khuat
7a7e09163b new login email fallback to last_name, email if it exists (#58027) 2025-05-16 04:27:38 +00:00
Ngoc Khuat
81c056481a humanized erorr message for preview (#58063) 2025-05-16 13:15:48 +09:00
Ngoc Khuat
d29b63a097 prefix all of our log context with mb- (#58023) 2025-05-16 03:20:23 +00:00
Cam Saul
a81c9c884c [Backend modularization] module score calculation (#58002)
* [Backend modularization] module score calculation

* dox
2025-05-15 19:37:15 -06:00
appleby
e30c325250 Cast booleans literals in :fields clause to bit for sqlserver (#57723)
* Cast boolean expressions in :fields clauses to type bit on sqlserver

* Compile boolean literals :inline on sqlserver

* Add some tests for non-booleans to boolean_to_comparison_test.clj

* Add tests for boolean-expression-clause?

* Mention sql.qp/*inner-query* in boolean-expression-clause? docstring

* Split separate cases into separate tests

* Add cast in sql.qp/as if field options contain ::sql.qp/add-cast

Rather than duplicating logic for :select-top in apply-top-level-clause [:sqlserver :fields], just decorate boolean
:fields clauses with ::sql.qp/add-cast and let the parent method handle it. In this way, the :sqlserver method can
pre-process the MBQL :fields clauses rather than post-processing the raw honeysql.
2025-05-15 17:32:37 -07:00
appleby
782daee511 Fix boolean->comparison conversion for nested queries (#57717)
* Add tests for {sum,count,distinct}-where with literal booleans

* Fix typo in literal expressions tests: filters -> filter

* Fix boolean->comparison for boolean expressions coming from nested queries

* Add sql.u/->honeysql-parent-method util

* Remove ::boolean-is-comparison abstract driver

* Lift ->honeysql call out of boolean-to-comparison

* Pass in boolean-types to boolean->comparison from driver

* Update comments and docstrings

* Require :left-join feature in nested-and-joined-literal-boolean-expressions-in-conditions-test

* Revert whitespace changes

* Implement sql.qp/apply-top-level-clause :filter in terms of parent method

* Fix typo in docstring

* Remove unused sql.helpers import

* Add comment about Oracle 23+ support to boolean_to_comparison.clj

* Rename local has-types? to has-some-types? in boolean-field-clause?
2025-05-15 14:30:39 -07:00
Cam Saul
d7eae1df71 [Backend modularization] parameters module (first pass) (#58043)
* [Backend modularization] `parameters` module (first pass)

* Make sure DB is initialized

* Oops revert the change I made to demo something during BE Guild Sync
2025-05-15 21:15:28 +00:00
metamben
dbb22cd0ed Stop hydrating unused properties (#58003)
* Stop returning field values in the answer-sources response

Fixes BOT-137
2025-05-15 22:34:03 +03:00
github-automation-metabase
afffb18b57 Bump io.netty/netty-common from 4.2.0.Final to 4.2.1.Final (#57824)
* Bump io.netty/netty-common from 4.2.0.Final to 4.2.1.Final

Inspect dependency changes here:

* Update deps.edn

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-15 19:23:29 +00:00
Chris Truter
a1d44313a2 Make undo and redo into actions (#58045) 2025-05-15 20:21:59 +02:00
bryan
9e01e38352 in dev, use wrap-reload middleware (#57930) 2025-05-15 11:59:45 -06:00
Timofey Kachalov
ad9d43e0fa Do not transform :has css selectors by Post CSS (#58011) 2025-05-15 19:49:04 +04:00
Nemanja Glumac
44c866ebba Re-enable the old flaky reproduction (#58036) 2025-05-15 17:25:46 +02:00
Aleksandr Lesnenko
af2fafe17f include visible timeline events from different collections in ai analysis (#57990) 2025-05-15 10:59:08 -04:00
Chris Truter
941e5e47f1 Fix case instability issue with h2 driver (#58041) 2025-05-15 16:51:37 +02:00
Chris Truter
8777d4b850 Clean up table.row and grid-edit actions (#58033) 2025-05-15 16:24:33 +02:00
Cam Saul
5373dfac4d [Backend modularization] queries module (#57936)
* [Backend modularization] `queries` module

* `metabase.api.query-metadata` => `metabase.queries.metadata`

* Update config & cljfmt

* Make queries API namespace

* cljfmt

* Fix Kondo warnings

* First pass at fixing circular references.

* Second pass for fixing circular refs.

* Third pass at fixing circular references

* Circular refs pass 3

* Circular refs pass 4

* Circular refs pass 5

* Circular refs pass 6

* Fix

* Appease Kondo

* Test fix 🔧

* Appease Kondo

* Test fix 🔧

* Test fix 🔧

* Test fixes 🔧

* Fix reflection warning

* `schema` => `warehouse-schema`

* More test fixes 🔧

* cljfmt

* Fix

* Test fix 🔧

* Test fix 🔧

* Test debugging

* Test fixes

* Test fix 🔧
2025-05-15 13:30:30 +00:00
metamben
7937ecf662 Stop returning field values in the answer-sources response (#57966)
Fixes BOT-137
2025-05-15 16:19:14 +03:00
Nicolò Pretto
7437449749 change retrieve key too (#57985) 2025-05-15 15:03:59 +02:00
Nemanja Glumac
0581f1c141 Add a single branding link to Slack notification (#57501) 2025-05-15 14:28:16 +02:00
Chris Truter
1c2195c4ed Fix editing tables from dashboards (#58034) 2025-05-15 14:10:36 +02:00
Timofey Kachalov
79afb5dec2 Fix fonts.styled.ts braces (#58025) 2025-05-15 15:50:31 +04:00
Konstantin Darutkin
266be7245e fix: refetch table on filter change (#58020) 2025-05-15 12:46:07 +01:00
Phoomparin Mano
6c890a3a28 ci(sdk): fix flaky tests on entity id target collection (#58014) 2025-05-15 18:10:02 +07:00
Phoomparin Mano
c890601b2e ci(sdk): fix flaky tests on interactive question theming (#58010) 2025-05-15 17:27:59 +07:00
Konstantin Darutkin
5facc8557c fix: optional/required styles in a record create/edit form (#58026) 2025-05-15 11:14:28 +01:00
Timofey Kachalov
1ae53cb922 Fix wrong names of CSS module files (#58012) 2025-05-15 13:50:03 +04:00
Timofey Kachalov
d7912c544b Fix ModalHeader back button position (#58008) 2025-05-15 13:49:24 +04:00
Konstantin Darutkin
53738cdba3 fix: do not display action cannot be undone message for row deletion (#58016) 2025-05-15 10:29:53 +01:00
Chris Truter
3a91374f4e New data-grid actions to replace CRUD endpoints (#57969) 2025-05-15 11:12:30 +02:00
Alexander Polyankin
2842276e6d Remove duplicated code from api/dashboard.clj for parameter matching in chain filters (#57922)
* Fix params used in dashboard endpoints

* Fix params used in dashboard endpoints

* Fix params used in dashboard endpoints

* Fix lint
2025-05-14 21:49:01 -04:00
github-automation-metabase
fa63153010 Bump io.github.camsaul/toucan2 from 1.0.561 to 1.0.564 (#57816)
Inspect dependency changes here: https://github.com/camsaul/toucan2/compare/1.0.561...head

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-14 23:35:15 +00:00
Edward Paget
54974e31dc feat: generic data permissions visibility queries (#57712)
* feat: generic data permissions visibility queries

Creates a new namespace with a generically applicable set of sql queries
for getting only models controlled by data permissions that a given user
has access to.

It also creates a new model.interface defmulti `visible-filter-clause`
that allows us to generate a filter clause for a given model to filter a
query on a supplied expression to only those models allowed for the
supplied user. There is a default implementation that is always true.

the `visible-filter-clause` method is only implemented for the Table
model so far since that is used in a search.

This also fixes a bug in the previous implementation of the sql
filtering for Table models that did not correctly handle the logic in
`data-perms/coalesce` for `:perms/view-data` where `:blocked` is ranked
ahead of `:legacy-no-self-service` for the purposes of selecting the
applicable user permission but is ranked below when testing permission levels.

Co-Authored-By: John Swanson <john.swanson@metabase.com>

* fixup! default for visible-fliter-clause to false

* fixup! add cast back for search permissions

* fixup! correct db type test

* fixup! more verbose table names in perms test

---------

Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-05-14 21:06:12 +00:00
Gustavo Saiani
ed8d735bbd Docs: update links so that they land on final URLs instead of internal redirects (#57461) 2025-05-14 20:16:35 +00:00
Gustavo Saiani
c5b8e1c3fe Pass param to plans-blockquote (#57991) 2025-05-14 17:02:36 -03:00
Alexander Polyankin
1d61926cf5 Fix FE navigation when the query is running (#57977)
* Fix FE navigation when the query is running

* Fix FE navigation when the query is running

* Add test

* Add test
2025-05-14 15:55:39 -04:00
github-automation-metabase
4e6bbcdd5e Bump com.google.cloud/google-cloud-bigquery from 2.49.0 to 2.50.0 (#57822)
Inspect dependency changes here: https://github.com/googleapis/java-bigquery/blob/v2.50.0/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-14 19:51:18 +00:00
github-automation-metabase
7f30bb16dd Bump com.clojure-goes-fast/clj-async-profiler from 1.6.1 to 1.6.2 (#57812)
Inspect dependency changes here: https://github.com/clojure-goes-fast/clj-async-profiler/blob/1.6.2/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-14 19:50:04 +00:00
github-automation-metabase
132336c0be Bump methodical/methodical from 1.0.125 to 1.0.126 (#57818)
Inspect dependency changes here: https://github.com/camsaul/methodical/compare/1.0.125...head

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-14 19:47:47 +00:00
github-automation-metabase
0eac0bb2bd Bump thheller/shadow-cljs from 3.0.4 to 3.0.5 (#57821)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-14 19:47:00 +00:00
github-automation-metabase
f00b28668a Bump diehard/diehard from 0.11.12 to 0.11.13 (#57814)
Inspect dependency changes here: https://github.com/sunng87/diehard/blob/0.11.13/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-14 12:07:51 -07:00
github-automation-metabase
a0184a91d6 Bump org.apache.xmlgraphics/batik-all from 1.18 to 1.19 (#57820)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-14 12:01:58 -07:00
github-automation-metabase
32f5b9105b Bump net.thisptr/jackson-jq from 1.2.0 to 1.3.0 (#57819)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-14 12:01:47 -07:00
Gustavo Saiani
5c0f8d8ede Update link (#57963) 2025-05-14 15:54:17 -03:00
Alexander Polyankin
6e6449b724 Fix FE permission checks for Edit query definition (#57973) 2025-05-14 18:48:30 +00:00
Timofey Kachalov
424be8573c fix(sdk): Move @cypress/react as dev dependency for SDK (#57962) 2025-05-14 22:05:54 +04:00
Aleksandr Lesnenko
cb1b6f7856 track first non-table chart generated (#56858)
* track first non-table chart generated

* specs

* fix types

* review

* fix serialization

* eliminate chart rerender when instance settings change

* fix prop name

* rename chart-generated setting

* update e2e spec
2025-05-14 18:04:03 +00:00
Dan Stone
77da831305 WRK-336 temporary primitive action support (#57701)
* Add tmp-action endpoint for picker listing

* Add table primitive action support to dashboards

On saving a negative action_id, we interpret it as a primitive table
action.

This causes the actual stored dashcard to contain a new table_action
entry in its visualization settings.

From an API perspective the action entry in the dashcard is hydrated in
the normal way, and things should 'just work'

* Add quick-and-dirty test of some of the new behaviour

* Use comp

* Move destructure to where its needed

* crud-actions to table-actions

* Get rid of atom we dont need

* Get rid of now redundant action arg-map keys

* Common sub-expression elimination

* Add comment about snowplow

* Use u/qualified-name

* Use u/for-map

* Use select-fn->fn

* Be less generic

* Fix action args

We did need the database after all, and stuff changed after rebase

* More explicit prefill asserts

* Remove redundant todo

* Remove unnecessary input union in dashcard->action

* Add docstring to tmp-action
2025-05-14 18:48:34 +01:00
Aleksandr Lesnenko
04246335c6 filter timeline events for ai entity analysis by collection id (#57926) 2025-05-14 13:40:23 -04:00
Dan Stone
34492caa8a internal tools CI fixes (#57956)
* kondo

* Fix scope/hydrate-test

* Fix missing scope in event handler

* Support unknown scopes (for legacy action application)

Feel free to change this, just wanna get working again

* Use legacy-action for action test scope

* Fix incorrect reference to test-scope
2025-05-14 18:26:20 +01:00
Nicolò Pretto
0f49dafa5d make the uberjar artifact from the cross-version tests not collide with (#57971)
the one from component tests
2025-05-14 17:20:36 +00:00
Alexander Polyankin
92c221ceb2 Add boolean parameters to dashboards and SQL field filters (#57435)
* Boolean params PoC

* Fix types

* PoC

* PoC

* PoC

* PoC

* PoC

* PoC

* PoC

* PoC

* PoC

* PoC

* PoC

* Fixes

* Fixes

* Fixes

* Fixes

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix formatting settings

* Fix routes

* Fix routes

* Fix routes

* Fix

* Fix routes

* Fix routes

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Add e2e

* Fix
2025-05-14 18:08:23 +01:00
Ngoc Khuat
bc92e04aea fix the enterprise feature that let admin archive all notifications of a user and unsubscribe them from notifiations (#57881) 2025-05-14 19:43:54 +03:00
Chris Truter
05cd7b8ed9 By not passing scope, we were triggering a runtime error when the scope was hydrated (#57968) 2025-05-14 18:30:52 +02:00
Cam Saul
f2004162a1 [Backend modularization] plugins cleanup (#57792)
* [Backend modularization] `plugins` cleanup (DEV-457)

* Test fix 🔧

* Fix unused namespace
2025-05-14 09:02:35 -07:00
Nicolò Pretto
3ef1bf8739 remove double concurrency group causing deadlock (#57960) 2025-05-14 17:00:30 +02:00
Nicolò Pretto
9308cc12ba add yet another linter, no literal strings so we don't forget to translate everything (#57785) 2025-05-14 16:26:05 +02:00
Jeff Bruemmer
9c2464e3e3 Update case.md (#57958) 2025-05-14 13:29:58 +00:00
Nicolò Pretto
52d243cbcf fix(ci-sdk): make cross versions tests run again (#57856)
* debug logs

* testing please ignore

* cleanup and add comment
2025-05-14 13:23:10 +02:00
Konstantin Darutkin
7ab6f20abb fix: editable settings without column order settings (#57951) 2025-05-14 12:01:45 +01:00
Ngoc Khuat
6e040a3fc5 Pass actions scope to notification (#57948) 2025-05-14 18:00:32 +07:00
Konstantin Darutkin
d711427901 feat(enterprise): add row bulk deletion (#57949) 2025-05-14 11:24:15 +01:00
Mahatthana (Kelvin) Nomsawadi
487893a6c6 Add more tests to cover missing cases (#57744)
* Add the first integration test!!!

* Finish integration tests

* Add missing E2E cases

* Remove WIP comment

* Ensure join data only show selected database

* Clarify cryptic Cypress step

* Make test types clearer

* Stop abusing `await` in unit tests

* Consolidate tests

Co-Authored-by: Poom poom@poom.dev
2025-05-14 11:01:51 +01:00
Ngoc Khuat
15ab6f7131 Merge branch 'master' into internal-tools 2025-05-14 15:38:51 +07:00
Ngoc Khuat
e3d85f8506 Giving system event notifications its own queue (#57769) 2025-05-14 06:52:52 +00:00
Alexander Polyankin
222e1beb38 Handle nulls with MBQL lib (#57942) 2025-05-14 02:10:13 +00:00
appleby
3f59c806d8 Handle emptyable expressions in desugar-is-empty-and-not-empty (#57870)
Closes #41265.

The schema for is-empty and not-empty was updated in #56855 to allow StringExpressionArg as well as Field. This
updates desugar-is-empty-and-not-empty to also understand non-field args.
2025-05-13 17:59:15 -07:00
Konstantin Darutkin
23161f4b9b fix(datagrid): improve row selection control (#57889) 2025-05-13 20:20:22 -04:00
metamben
b91c475c4c Fix past1hours and past1seconds filters (#57907)
* Fix past1hours and past1seconds filters

Without this change, both of these types generate 1 minute intervals.
2025-05-14 00:57:25 +03:00
Cam Saul
506b418891 [Backend modularization] secrets module (#57802)
* [Backend modularization] `secrets` module

* Merge master
2025-05-13 14:05:56 -07:00
Nathan Voxland
9c73ab5fe4 Improved liquibase rollback-major-version! logic to not use a simple count (#57754) 2025-05-13 15:26:38 -05:00
Case Nelson
3e4d36e7ab fix: snowflake test and migrate happening repeatedly (#57540)
* fix: snowflake test and migrate happening repeatedly

* Improve comments in test

* Fix kondo
2025-05-13 13:30:15 -06:00
Edward Paget
2919662edb fix: move quartz metric listeners to analytics (#57757)
* fix: move quartz metric listeners to analytics

To make sure the task module does not need to depend on the analytics module

* fixup! remove analytics from task uses

* fixup! export listener adder methods

* fixup! missing docstring

* fixup! put the comment back in the right spot
2025-05-13 19:03:12 +00:00
Phoomparin Mano
fb06c2b571 fix(sdk): table cell color is always white on the sdk (#57770) 2025-05-14 02:01:24 +07:00
Phoomparin Mano
d52a4e35da feat(sdk): theme-dependent default question toolbar colors (#57747) 2025-05-14 00:54:24 +07:00
Luis Paolini
693181cc44 Update upgrading-metabase.md (#57751)
* Update upgrading-metabase.md

Add changes that were needed for a long time :)

* suggested edits (#57913)

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-05-13 17:48:34 +00:00
Cam Saul
0f62c5c292 [Backend modularization] Finish moving "public settings" into appropriate modules (#57860)
* [Backend modularization] `channel` Settings cleanup (DEV-435)

* Remove `metabase.settings.deprecated-grab-bag`

* Fix circular references

* Fix circular refs

* Lint fix

* Test fix 🔧
2025-05-13 17:35:42 +00:00
Chris Truter
e2bd53b114 Add types, normalization, and hydration for action scopes (#57883) 2025-05-13 18:29:43 +02:00
Cam Saul
81da34e617 Fix API routes checks for dataset (#57871) 2025-05-13 10:21:09 -06:00
John Swanson
caffffd802 Fix snowplow helpers to be less flaky (#57750)
Remove `expectGoodSnowplowEvents` entirely - it was an antipattern.

Replace it with a good set of snowplow helper functions that actually
accomplish what we want:

- `expectSnowplowEvent`, which matches on the *entire* event rather than
assuming the event is an unstructured event (most of ours are, but some
are not).

- `expectUnstructuredSnowplowEvent`, which behaves the same as
  `expectGoodSnowplowEvent` used to, except I removed an unused behavior
  where it took a function instead of a partial-match object.

- `assertNoUnstructuredSnowplowEvent`, which asserts the inverse of
  `expectGoodSnowplowEvent` - there are zero matching snowplow events.

I removed `Good` from all these names as I think that's implied - if you
want to make an assertion that a bad event is being received you can
write your own helper :)
2025-05-13 08:49:00 -07:00
bryan
5b7c4d6f26 fix watcher alias (#57790) 2025-05-13 15:46:42 +00:00
Stas Gavrylov
e431d62b3d WRK-380, WRK-387: Custom templates improvements (#57893)
* Fix Slack template onChange method. Remove Slack markdown highlighting. Remove email template from alerts

* WRK-387: Add possibility to send alerts to multiple channels

* Some renaming in custom templates components

* Fix bug when template editor is cleared and immediately repopulated

* Fix lint
2025-05-13 18:12:14 +03:00
Sébastien
9c0c457fc8 Closes VIZ-400 fix stickiness for initial rendering as well (#57886) 2025-05-13 17:01:22 +02:00
Riley Thompson
93b2148bb5 Replace Mongo 4.4/5.0 with 6.0 (#57795) 2025-05-13 09:58:18 -04:00
Romeo Van Snick
ccc1a876be Reduce parameter data sent in public csv download url (#57195)
* Only send id and value when downloading csv

* Add repro for metabase#51813

* Merge in template tag parameters to parameters when running cards

* Fix erroneous test

* Do not pass all parameter data for cards

* Remove commented out code

* Only pass sparse parameters on public dashboards or cards

* Remove unused import

* Fix lint

---------

Co-authored-by: Tamás Benkő <tamas@metabase.com>
2025-05-13 15:35:41 +02:00
Andrew McLoughlin
eacc2176ed Fix typo.md (#57702) 2025-05-13 09:31:39 -04:00
Konstantin Darutkin
fe64dfcf63 feat(enterprise): add row selection view for bulk editing (#57840) 2025-05-13 13:45:12 +01:00
Ngoc Khuat
471ff47c6f break lines for each modules in the config so it generates fewer conflicts (#57874) 2025-05-13 11:15:10 +00:00
Phoomparin Mano
32b3f46331 feat(sdk): warn when using dev instance and change banner design (#57746) 2025-05-13 17:55:56 +07:00
Ngoc Khuat
eddc872446 fix formating value for contains parameter (#57876) 2025-05-13 09:31:08 +00:00
Ngoc Khuat
6aabb54d0a fix tests due to template changes 2025-05-13 15:49:08 +07:00
Sébastien
b3d4d2fc8e closes viz-943 wrong icon size but SOMETIME (#57833) 2025-05-13 10:44:33 +02:00
Cam Saul
272a353462 [Backend modularization] collections module (#57722)
* [Backend modularization] `collections` module (DEV-444)

* Fix wrong namespace

* Fix new metabot v3 code

* Some test fixes. 🔧

* Move test for EE-specific behavior to EE

* Make `/api/collection` tests work correctly from the REPL

* Try to debug failing test

* Fix sanity checc

* Fix Kondo warnings

* Test fix 🔧

* Attempt to debug test failures

* More test failure debugging

* Cleanup

* More test failure debugging

* More test debugging

* Fix private var

* Test fix? 🔧
2025-05-12 20:27:01 -07:00
Ngoc Khuat
930f9b6fa0 Merge branch 'master' into internal-tools 2025-05-13 09:16:23 +07:00
Alexander Polyankin
ec316302da Send param_fields per parameter to avoid field ref matching (#57554) 2025-05-12 19:47:13 -04:00
Case Nelson
3d810c0f87 fix: remove fast snowflake sync (#57858)
* fix: remove fast snowflake sync

* Fix kondo
2025-05-12 16:06:24 -06:00
Cam Saul
dc8381925b [Backend modularization] OSS content-verification module (#57804)
* [Backend modularization] content-verification module (DEV-431)

* Fix namespace
2025-05-12 15:05:29 -07:00
github-automation-metabase
caa4add50e Bump com.oracle.database.jdbc/ojdbc17 from 23.7.0.25.01 to 23.8.0.25.04 (#57826)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-05-12 21:39:13 +00:00
Cam Saul
754d708240 [Backend modularization] Move EID translation API endpoint into module (#57629)
* [Backend modularization] Move EID translation API endpoint into module (DEV-433)

* Prettier
2025-05-12 17:39:34 +00:00
Nicolò Pretto
f454edadb8 wrap strings in t in EditSandboxingModal (#57787) 2025-05-12 18:54:37 +02:00
lbrdnk
b1c25efba4 Track log level adjustments (#57756)
* Snowplow events for log adjustments

* Apply suggestions from code review

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

* Track empty log_levels as log_adjustments_reset

* Use log-levels instead

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-05-12 18:33:28 +02:00
Stas Gavrylov
e83f0988c0 Fix broken tests (#57847) 2025-05-12 19:11:40 +03:00
Aleksandr Lesnenko
0c2d3afa18 do not show visualize another way on text cards (#57806) 2025-05-12 11:59:12 -04:00
Aleksandr Lesnenko
e47f333669 fix text align setting on text dashcards (#57807) 2025-05-12 11:58:56 -04:00
github-automation-metabase
5cb20c2f50 Bump org.mongodb/mongodb-driver-sync from 5.4.0 to 5.5.0 (#57825)
Inspect dependency changes here: https://github.com/mongodb/mongo-java-driver/compare/r5.4.0...r5.5.0

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-12 11:10:49 -04:00
Nicolò Pretto
0f7f07f684 restore missing code after bad conflict resolution of metabot branch (#57846) 2025-05-12 14:50:59 +00:00
Chris Truter
7b010b498a Clean up table.row actions (#57839) 2025-05-12 15:57:43 +02:00
Chris Truter
dcf05ced7f Overload PUT table rows to support efficient bulk updates (#57843) 2025-05-12 15:44:30 +02:00
Jeff Bruemmer
dc3975479f docs - notification thread pool size. (#57748)
* note about long-running queries clogging queue

* fix spacing, update env vars

* note on troubleshooting notifications

* Update docs/troubleshooting-guide/index.md

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

Co-authored-by: Alexander Solovyov <alexander@solovyov.net>

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

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

* edits

* Update notifications.md

Adding some little detail about when changes happen

---------

Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
2025-05-12 09:28:32 -04:00
Ngoc Khuat
4674825133 Example payload with multiple channels (#57837)
* example payload now takes multiple channels

* add table-url helper

* fix make sure only updates keys are in changes and channel_types conversion

* Fix UI to display payload context properly
2025-05-12 15:56:42 +03:00
Kyle Doherty
2a76f70a69 standardize on ToolbarButton for main view header actions (#57791)
* standardize on ToolbarButton for main view header actions

* fix unit test

---------

Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
2025-05-12 08:44:58 -04:00
Nicola Mometto
1d2a6aa95b Add bronsa to team json files (#57834) 2025-05-12 13:13:43 +01:00
Stas Gavrylov
17abfc7280 WRK-366: Update default templates (#57836)
* wip

* WRK-375: Update default structure for table alerts conditions and related typings

* WRK-366: Update default templates for email and slack channels
2025-05-12 15:08:01 +03:00
Ngoc Khuat
f64cf10930 Merge branch 'master' into internal-tools 2025-05-12 17:58:09 +07:00
Sébastien
ebcced6bd4 Closes VIZ-656 better mapping when switching to/from non-cartesians (#57830) 2025-05-12 12:52:54 +02:00
Ngoc Khuat
47eb63c7c9 alerts template use slack syntax (#57828)
* alerts template use slack syntax

* do that for table notifications too

* fix default template
2025-05-12 14:54:42 +07:00
Tyler Plude
b424828108 [VISUALIZER] Fix funnel type static viz support (#57560)
* adding get-visualization-columns in clojure land

* remove inline defs

* add util unit tests

* update comment

* linter fixes

* Fix render visualizer utils to work with entity ids, add test

* Fix body test
2025-05-09 18:01:27 -07:00
Cam Saul
818bacef5f [Backend modularization] product-feedback module (#57720)
* [Backend modularization] `product-feedback` module (DEV-438)

* Update modules config
2025-05-09 22:33:51 +00:00
Alexander Polyankin
07399694ef Use dedicated endpoints for remapping in dashboards & questions (#57571)
* Remove unused endpoints

* Resolve implicit FK Field -> PK Field -> [Name] Field remapping

This affects the field and dashboard APIs.

* New endpoints

* Remove unused code

* Always return value, possibly without label

* Stop requiring FK entry in FK -> PK -> Name resolution

* Relax FK requirement in remapped value resolution

* Remove remaining /field/ endpoints

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-05-09 22:20:52 +00:00
Tyler Plude
bd5d9811ee [BUG FIX] Correctly merge column settings in exports (#57473)
* use existing col settings helper

* forward declaration of viz-settings-for-col to prevent compilation issues

* fixing typo in parens

* fix unit tests

* Fix clj kondo warnings
2025-05-09 15:00:51 -07:00
github-automation-metabase
65a5384994 Bump io.netty/netty-buffer from 4.1.119.Final to 4.2.0.Final (#56361)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-09 21:45:59 +00:00
github-automation-metabase
ec15bbf4b4 Bump org.mongodb/mongodb-driver-sync from 5.3.1 to 5.4.0 (#55608)
* Bump org.mongodb/mongodb-driver-sync from 5.3.1 to 5.4.0

Inspect dependency changes here: https://github.com/mongodb/mongo-java-driver/compare/r5.3.1...r5.4.0

* Update deps.edn

* Update deps.edn

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: bryan <bryan.maass@gmail.com>
Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-09 21:22:32 +00:00
Cam Saul
3e65e9f158 [Backend modularization] OSS audit-app module (#57623)
* [Backend modularization] OSS audit-app module

* Cleanup

* Update config

* Fixx

* Test fix 🔧

* Appease the module linter

* Test fix 🔧
2025-05-09 20:53:38 +00:00
Jeff Bruemmer
38a58700f6 links (#57796) 2025-05-09 20:42:46 +00:00
github-automation-metabase
d405ed82e3 Bump org.graalvm.polyglot/polyglot from 24.2.0 to 24.2.1 (#56956)
* Bump org.graalvm.polyglot/polyglot from 24.2.0 to 24.2.1

Inspect dependency changes here: https://github.com/oracle/graal/compare/graal-24.2.0...graal-24.2.1

* Update deps.edn

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-09 20:15:02 +00:00
Cam Saul
a4313c3960 [Backend modularization] Mega Renaming PR 2 (#57565)
* Move `show-database-syncing-modal` into `sync` module (DEV-436)

* `metabase-enterprise.core` => `metabase-enterprise.core.dummy-namespace` (DEV-473)

* `task` module cleanup (DEV-458)

* Fix 🔧

* Test fix 🔧

* Fixes 🔧
2025-05-09 19:44:37 +00:00
Cam Saul
58648d1de4 [Backend modularization] premium-features cleanup (#57562)
* [Backend modularization] `premium-features` cleanup (DEV-464)

* Fix 🔧

* Fix stuff

* Fix Kondo failures not causing CI failures

* Docstring cleanup

* More fixes 🔧

* Fix 🔧

* Fix token status checc

* Test fix 🔧

* Appease TypeScript

* Appease TypeScript again
2025-05-09 13:37:16 -06:00
Ryan Laurie
5cca6cd94d Update Authentication Settings (#57405)
* rework auth settings

fix for auth cards

fixes

make checking SSO nicer

SCIM tests

make stuff nicer

much tests

rebase fix

update auth settings

update more tests

whoopsie

little fixes

* update more tests

* test fixes

* remove auth tabs

* gee wiz thanks sloan

* conflict fix
2025-05-09 13:29:55 -06:00
Cam Saul
bc50403dcb [Backend modularization] bug-reporting module (#57670)
* [Backend modularization] `bug-reporting` module (DEV-442)

* Update modules config
2025-05-09 19:03:07 +00:00
Cam Saul
94a9847fbf [Backend modularization] version module (#57630)
* [Backend modularization] `version` module (DEV-443)

* Fix stuff
2025-05-09 18:24:24 +00:00
Konstantin Darutkin
f454566dae feat(frontend): add selectable rows for DataGrid (#57771)
* feat(frontend): add selectable rows for DataGrid

* feat: add row selected attribute
2025-05-09 19:23:28 +01:00
Denis Berezin
7c6bfbe30b Editable editable table row actions display (#57084)
* WIP

* WIP

* Add row actions for standalone editable table

* WIP: model row actions display

* Add row actions display and execution for models

* Improvements

* Add row actions connection to dashcard

* Review fixes, add proper modal flow, add edit

* Try to fix lots of failing tests

* Fix tests

* Fix tests
2025-05-09 21:18:21 +03:00
Cam Saul
b6c2815bf3 [Backend modularization] geojson module (#57463) 2025-05-09 17:44:06 +00:00
Aleksandr Lesnenko
5a00c58b32 visualizer feature branch (#48527)
Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>
Co-authored-by: Kyle Doherty <5248953+kdoh@users.noreply.github.com>
Co-authored-by: Sébastien <sebastien@metabase.com>
Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-05-09 12:54:16 -04:00
Ryan Laurie
9825858b19 Add DWH Paused Modal for Uploads (#57285)
* add paused modal

* trigger paused modal

* add unit tests
2025-05-09 10:47:23 -06:00
Jeff Bruemmer
0d756faa0c update learn links (#57782) 2025-05-09 16:13:55 +00:00
Nicolò Pretto
34e647af26 fix: wrap un-translated strings in t`` (#57693)
* fix: wrap un-translated strings in t``

* fix more untranslated strings

* translate some aria-labels

* use interpolation instead of having to provide context

* address feedback and add context

* more t calls added

* revert changes to slider component as it's not used and may get removed

* remove file that i re-created when rebasing

* more context

* more context

* Update frontend/src/metabase/query_builder/components/MoveQuestionModal/MoveQuestionModal.tsx

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>

* Update frontend/src/metabase/query_builder/components/expressions/Editor/Listbox/Listbox.tsx

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>

* address feedback

* add context to what is SSL short for

* remove whitespace that could possibly create issues

* add missing import for c

---------

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2025-05-09 17:51:19 +02:00
Alexander Solovyov
f0aad84238 laziness you little bastard 2025-05-09 18:03:55 +03:00
Eric Normand
8edafd083c Datetime to date coercion (#57523)
* Empty

* kick ci

* Allow temporal type in addition to string for `date()`

* Add date(datetime) test

* Use cast for date for postgres

* Extend date() on mysql

* Extend date() on bigquery

* Extend date() at snowflake

* Extend date() to datetime on clickhouse

* Generalize `date()` to :sql

* Update changelog with `date(datetime)`

* Empty

* DateTime->Date Coercion + test

* Slight cleanup

* Whitespace

* Cleaner implementation and test

* Test timestamp as well as timestamptz

* Correct implementation to get subtypes of DateTime

* Update helper text string for date

* Add e2e tests for date

* Also check to correct coercion of dates

* Add customization points to enable clickhouse implementation.

* Remove changelog-test/ignore true from ->date

* Fix defn ordering

* Fix expected type for datetime coercions

* Fix tests for sqlite

* Implement coercion for Mongo

* Implement specialization for oracle

* Better check

* kick ci

* kick ci

* Format code

* Format code

* Correct changelog text

* Ors on one line

* Or on same line

* Remove zh from the list of supported translations (#57672)

We don't support the `zh` (Traditional Chinese) locale anymore – only `zh-CN` (Simplified Chinese), and `zh-HK` (Hong Kong), and `zh-TW` (Taiwan). Here's a [Slack discussion](https://metaboat.slack.com/archives/C6UBFU9GW/p1741983889165599).

So let's remove `zh` from the list of supported translations.

For some reason the list wasn't sorted alphabetically by language name - this PR fixes that too.

* [Backend modularization] Mega Renaming PR 1 (#57561)

* auth-provider => auth-provider.core

* enterprise/auth-provider

* `metabase.events.core`

* Move `sql-parsing-enabled` Setting into `query-analysis` (DEV-449)

* `metabase.events.core` (DEV-455)

* `metabase-enterprise.stats` => `metabase-enterprise.analytics.stats` (DEV-475)

* `enterprise/stale` cleanup (DEV-474)

* `enterprise/airgap` => `enterprise/premium-features`

* Appease Kondo

* Remove unused

* Mark setup tests flaky (#57710)

* mark setup tests flaky

* add flake

---------

Co-authored-by: Sloan Sparger <sloansparger@gmail.com>

* Fix parameter types! (#57677)

* [Notification] reduce module apis (#57678)

* fix audit log to record external emails when sending notifications (#57679)

* Remove "Model" and "Action" from the "New" button menu (#57647)

* feat: add a link to field filter docs from dashboard sidebar with native question (#57687)

* feat: add a link to field filter docs from dashboard sidebar with native question

* oops

* add missing translation

* Metabot v3 PoC (#52436)

Co-authored-by: Tyler Plude <tsplude@gmail.com>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Mihael Konjević <konjevic@gmail.com>
Co-authored-by: John Swanson <john.swanson@metabase.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Thomas Schmidt <thomas@metabase.com>
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: github-automation-metabase <166700802+github-automation-metabase@users.noreply.github.com>
Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>

* Patch the metabot-v3 merge (#57731)

* Remove unused props from the "New" menu

* Remove Metabot code related to the "New" menu

* Fix flaky e2e test in the onboarding `setup` spec (#57735)

* remove unused slider component (#57745)

* [Admin] Modernize components for People + Groups pages (#57365)

* update components in frontend/src/metabase/admin/people/components to use Mantine components and remove deprecated component usage

* update people and group pages/modals to use more modern components

* use relative sizes

* fix user success modal not closing on "Done" confirm button click

* remove CS from PeopleListRow

* clean up admin/people/colors.ts

* lint fix

* people list footer fix

* pr feedback

* [Admin] Convert people / group pages to RTKQuery (#57490)

* update components in frontend/src/metabase/admin/people/components to use Mantine components and remove deprecated component usage

* update people and group pages/modals to use more modern components

* use relative sizes

* fix user success modal not closing on "Done" confirm button click

* remove CS from PeopleListRow

* clean up admin/people/colors.ts

* lint fix

* people list footer fix

* pr feedback

* wip

* fix issues, people page updates, some clean up

* add unsaved files

* type fix, fetch user list from rktquery for PeopleList

* remove entity usage from unsubscribe modal, lint fix

* remove all remaining usages of user entity

* remove user entity

* test fixes, remove unused user schema

* bit of clean up

* qa pass - invalidate groups cache if user is deactivated/reactivated

* address pr feedback

* Bump org.apache.poi/poi-ooxml-full from 5.4.0 to 5.4.1 (#56357)

Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>

* Add analytics for new entity creation being initiated (#57673)

This commit adds analytics to the:

1. New button being clicked
    - In the top app bar
    - From the empty collection
2. New menu individual items being clicked:
    - Dashboard
    - ~Question~ (not possible at the moment)
    - ~Native query~ (not possible at the moment)
3. An entity creation being initiated
    - Model from the /browse/models page
    - Metric from the /browse/metrics page
    - Collection from the collection header
    - Collection from the main nav sidebar

* Bump io.github.eerohele/pp from 9598f4c72b528480a85ea41651c45b08d1717428 to 4998a1fdd9d3713d7034d04509e9212204773bf2 (#57577)

Inspect dependency changes here: 9598f4c72b...4998a1fdd9

Co-authored-by: Metabase bot <metabase-bot@metabase.com>

* Bump commons-io/commons-io from 2.18.0 to 2.19.0 (#56654)

Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>

* Shutdown index sync while its results are unused (#56885)

* Shutdown index sync while its results are unused

* Update tests

* Update mongo tests

* Bump com.google.guava/guava from 33.4.6-jre to 33.4.8-jre (#56952)

Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>

* Bump com.amazonaws/aws-java-sdk-core from 1.12.782 to 1.12.783 (#57586)

Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>

* Bump io.github.tonsky/clj-reload from 0.9.4 to 0.9.5 (#57578)

Inspect dependency changes here: https://github.com/tonsky/clj-reload/blob/0.9.5/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>

* Bump babashka/fs from 0.5.24 to 0.5.25 (#57575)

Inspect dependency changes here: https://github.com/babashka/fs/blob/v0.5.25/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>

* Bump org.apache.calcite.avatica/avatica from 1.25.0 to 1.26.0 (#54171)

Inspect dependency changes here: https://github.com/apache/calcite-avatica/compare/avatica-1.25.0-rc0...avatica-1.26.0-rc0

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>

* fix: do not render gauge if grouping col is date (#56715)

* fix: toolbar button color not changing on hover (#56694)

* Bump refactor-nrepl/refactor-nrepl from 3.10.0 to 3.11.0 (#57584)

Inspect dependency changes here: https://github.com/clojure-emacs/refactor-nrepl/blob/v3.11.0/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>

* Bump org.jsoup/jsoup from 1.19.1 to 1.20.1 (#57583)

Inspect dependency changes here: https://github.com/jhy/jsoup/blob/jsoup-1.20.1/CHANGES.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>

* [Backend modularization] `view-log` module (DEV-427) (#57628)

* [Backend modularization] Move anonymous-stats-related stuff into `analytics` module (DEV-437) (#57631)

* Bump org.eclipse.jetty.ee9.websocket/jetty-ee9-websocket-jetty-server from 12.0.19 to 12.0.20 (#57579)

* Bump org.eclipse.jetty.ee9.websocket/jetty-ee9-websocket-jetty-server from 12.0.19 to 12.0.20

Inspect dependency changes here:

* Update deps.edn

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>

* Bump com.taoensso/nippy from 3.4.2 to 3.5.0 (#56953)

Inspect dependency changes here: https://github.com/taoensso/nippy/blob/v3.5.0/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>

* Bump com.ibm.icu/icu4j from 76.1 to 77.1 (#55241)

Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>

* Bump thheller/shadow-cljs from 2.28.21 to 2.28.23 (#56657)

Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>

* `date(datetime)` integration branch (#57448)

* Empty

* kick ci

* Allow temporal type in addition to string for `date()`

* Add date(datetime) test

* Use cast for date for postgres

* Extend date() on mysql

* Extend date() on bigquery

* Extend date() at snowflake

* Extend date() to datetime on clickhouse

* Generalize `date()` to :sql

* Update changelog with `date(datetime)`

* Update helper text string for date

* Add e2e tests for date

* Also check to correct coercion of dates

* Better check

* kick ci

* Format code

---------

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>

* Bump org.apache.poi/poi from 5.4.0 to 5.4.1 (#56355)

* Bump org.apache.poi/poi from 5.4.0 to 5.4.1

Inspect dependency changes here:

* Update deps.edn

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>

* Bump cider/cider-nrepl from 0.55.4 to 0.55.7 (#57576)

Inspect dependency changes here: https://github.com/clojure-emacs/cider-nrepl/blob/v0.55.7/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>

* Bump org.postgresql/postgresql from 42.7.4 to 42.7.5 (#57314)

Inspect dependency changes here: https://github.com/pgjdbc/pgjdbc/blob/REL42.7.5/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>

* Bump clj-kondo/clj-kondo from 2025.02.20 to 2025.04.07 (#56650)

* Bump clj-kondo/clj-kondo from 2025.02.20 to 2025.04.07

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

* Add kondo ignore to tests for new :missing-protocol-method linter

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Mike Appleby <86076+appleby@users.noreply.github.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>

* Bump thheller/shadow-cljs from 2.28.21 to 3.0.4 (#57585)

Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>

* Remove unused code in embedding data picker (#57700)

* Remove unused exported components

* Remove references to metrics

* Remove references to saved questions

* Remove irrelevant tests

* Remove unnecessary prop

* Fix more unit tests

* Remove more unnecessary code

* Fix failed unit tests

* Remove unnecessary prop

* speed up notification tests (#57763)

* Update logger presets (#57667)

* Update presets

* Update presets

* Update test

* Apply suggestions from code review

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>

---------

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>

* better snowplow errors when expecting the wrong number of good events (#57730)

* add ?. to make it more resilient

* add more logssss

* cy.log

* some nicer error message

* fix eventType

* removes leftover lines

* typos on comments

* Update e2e/support/helpers/e2e-snowplow-helpers.js

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

---------

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

---------

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
Co-authored-by: Tyler Plude <tsplude@gmail.com>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Mihael Konjević <konjevic@gmail.com>
Co-authored-by: John Swanson <john.swanson@metabase.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
Co-authored-by: Thomas Schmidt <thomas@metabase.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: github-automation-metabase <166700802+github-automation-metabase@users.noreply.github.com>
Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
Co-authored-by: Adithya Vardhan <imadithyavardhan@gmail.com>
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Mike Appleby <86076+appleby@users.noreply.github.com>
2025-05-09 14:38:45 +00:00
Nicolò Pretto
557e7d0f34 better snowplow errors when expecting the wrong number of good events (#57730)
* add ?. to make it more resilient

* add more logssss

* cy.log

* some nicer error message

* fix eventType

* removes leftover lines

* typos on comments

* Update e2e/support/helpers/e2e-snowplow-helpers.js

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

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-05-09 11:13:44 +00:00
Ngoc Khuat
d5edfa8d07 Taxanomy for alert for slack (#57760) 2025-05-09 17:14:12 +07:00
lbrdnk
8b2a8b4d42 Update logger presets (#57667)
* Update presets

* Update presets

* Update test

* Apply suggestions from code review

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>

---------

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-05-09 11:16:32 +02:00
Konstantin Darutkin
71988bd3e3 fix: add scope param for optimistic updates (#57766) 2025-05-09 10:01:45 +01:00
Alexander Solovyov
9ad2b82c88 Merge remote-tracking branch 'origin/master' into internal-tools 2025-05-09 11:32:23 +03:00
Ngoc Khuat
0e53e2bd21 speed up notification tests (#57763) 2025-05-09 07:44:33 +00:00
Mahatthana (Kelvin) Nomsawadi
8fa039f6dc Remove unused code in embedding data picker (#57700)
* Remove unused exported components

* Remove references to metrics

* Remove references to saved questions

* Remove irrelevant tests

* Remove unnecessary prop

* Fix more unit tests

* Remove more unnecessary code

* Fix failed unit tests

* Remove unnecessary prop
2025-05-09 06:51:43 +01:00
Ngoc Khuat
463e8d9d77 Merge branch 'master' into internal-tools 2025-05-09 11:13:46 +07:00
github-automation-metabase
1c5bc70adb Bump thheller/shadow-cljs from 2.28.21 to 3.0.4 (#57585)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-09 00:07:31 +00:00
github-automation-metabase
07235bbde0 Bump clj-kondo/clj-kondo from 2025.02.20 to 2025.04.07 (#56650)
* Bump clj-kondo/clj-kondo from 2025.02.20 to 2025.04.07

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

* Add kondo ignore to tests for new :missing-protocol-method linter

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Mike Appleby <86076+appleby@users.noreply.github.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-08 23:27:10 +00:00
github-automation-metabase
7c0ca3369b Bump org.postgresql/postgresql from 42.7.4 to 42.7.5 (#57314)
Inspect dependency changes here: https://github.com/pgjdbc/pgjdbc/blob/REL42.7.5/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-08 23:18:34 +00:00
github-automation-metabase
be86f32a0f Bump cider/cider-nrepl from 0.55.4 to 0.55.7 (#57576)
Inspect dependency changes here: https://github.com/clojure-emacs/cider-nrepl/blob/v0.55.7/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-08 22:09:49 +00:00
github-automation-metabase
d9147bd92c Bump org.apache.poi/poi from 5.4.0 to 5.4.1 (#56355)
* Bump org.apache.poi/poi from 5.4.0 to 5.4.1

Inspect dependency changes here:

* Update deps.edn

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-08 21:58:39 +00:00
Eric Normand
d55b0e247a date(datetime) integration branch (#57448)
* Empty

* kick ci

* Allow temporal type in addition to string for `date()`

* Add date(datetime) test

* Use cast for date for postgres

* Extend date() on mysql

* Extend date() on bigquery

* Extend date() at snowflake

* Extend date() to datetime on clickhouse

* Generalize `date()` to :sql

* Update changelog with `date(datetime)`

* Update helper text string for date

* Add e2e tests for date

* Also check to correct coercion of dates

* Better check

* kick ci

* Format code

---------

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-05-08 21:52:34 +00:00
github-automation-metabase
61b7eeda25 Bump thheller/shadow-cljs from 2.28.21 to 2.28.23 (#56657)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-08 20:53:47 +00:00
github-automation-metabase
3a8479078c Bump com.ibm.icu/icu4j from 76.1 to 77.1 (#55241)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-08 20:53:31 +00:00
github-automation-metabase
a743c27bcd Bump com.taoensso/nippy from 3.4.2 to 3.5.0 (#56953)
Inspect dependency changes here: https://github.com/taoensso/nippy/blob/v3.5.0/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-08 20:47:00 +00:00
github-automation-metabase
139d1605fa Bump org.eclipse.jetty.ee9.websocket/jetty-ee9-websocket-jetty-server from 12.0.19 to 12.0.20 (#57579)
* Bump org.eclipse.jetty.ee9.websocket/jetty-ee9-websocket-jetty-server from 12.0.19 to 12.0.20

Inspect dependency changes here:

* Update deps.edn

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-08 20:45:10 +00:00
Cam Saul
a6f9bb8167 [Backend modularization] Move anonymous-stats-related stuff into analytics module (DEV-437) (#57631) 2025-05-08 13:22:09 -07:00
Cam Saul
b405045f94 [Backend modularization] view-log module (DEV-427) (#57628) 2025-05-08 13:21:54 -07:00
github-automation-metabase
a669530a55 Bump org.jsoup/jsoup from 1.19.1 to 1.20.1 (#57583)
Inspect dependency changes here: https://github.com/jhy/jsoup/blob/jsoup-1.20.1/CHANGES.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-08 13:19:06 -07:00
github-automation-metabase
a6ef327bdd Bump refactor-nrepl/refactor-nrepl from 3.10.0 to 3.11.0 (#57584)
Inspect dependency changes here: https://github.com/clojure-emacs/refactor-nrepl/blob/v3.11.0/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-08 13:17:42 -07:00
Adithya Vardhan
dafbd09482 fix: toolbar button color not changing on hover (#56694) 2025-05-08 13:13:35 -07:00
Adithya Vardhan
87ca8ab2d3 fix: do not render gauge if grouping col is date (#56715) 2025-05-08 13:13:27 -07:00
github-automation-metabase
8827164777 Bump org.apache.calcite.avatica/avatica from 1.25.0 to 1.26.0 (#54171)
Inspect dependency changes here: https://github.com/apache/calcite-avatica/compare/avatica-1.25.0-rc0...avatica-1.26.0-rc0

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-08 19:56:01 +00:00
github-automation-metabase
8285908e3a Bump babashka/fs from 0.5.24 to 0.5.25 (#57575)
Inspect dependency changes here: https://github.com/babashka/fs/blob/v0.5.25/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-08 12:27:13 -07:00
github-automation-metabase
58f4e0a9dd Bump io.github.tonsky/clj-reload from 0.9.4 to 0.9.5 (#57578)
Inspect dependency changes here: https://github.com/tonsky/clj-reload/blob/0.9.5/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-05-08 12:26:53 -07:00
github-automation-metabase
431184652f Bump com.amazonaws/aws-java-sdk-core from 1.12.782 to 1.12.783 (#57586)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-08 12:26:25 -07:00
github-automation-metabase
3cfcb03cf5 Bump com.google.guava/guava from 33.4.6-jre to 33.4.8-jre (#56952)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-08 12:25:40 -07:00
lbrdnk
76a5231a6f Shutdown index sync while its results are unused (#56885)
* Shutdown index sync while its results are unused

* Update tests

* Update mongo tests
2025-05-08 21:20:00 +02:00
github-automation-metabase
ab296e8d6c Bump commons-io/commons-io from 2.18.0 to 2.19.0 (#56654)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-08 19:19:07 +00:00
github-automation-metabase
fcb6e8415b Bump io.github.eerohele/pp from 9598f4c72b528480a85ea41651c45b08d1717428 to 4998a1fdd9d3713d7034d04509e9212204773bf2 (#57577)
Inspect dependency changes here: 9598f4c72b...4998a1fdd9

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-08 11:56:11 -07:00
Nemanja Glumac
38762f1b74 Add analytics for new entity creation being initiated (#57673)
This commit adds analytics to the:

1. New button being clicked
    - In the top app bar
    - From the empty collection
2. New menu individual items being clicked:
    - Dashboard
    - ~Question~ (not possible at the moment)
    - ~Native query~ (not possible at the moment)
3. An entity creation being initiated
    - Model from the /browse/models page
    - Metric from the /browse/metrics page
    - Collection from the collection header
    - Collection from the main nav sidebar
2025-05-08 20:44:35 +02:00
github-automation-metabase
d415393100 Bump org.apache.poi/poi-ooxml-full from 5.4.0 to 5.4.1 (#56357)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-08 11:33:17 -07:00
Sloan Sparger
7db950f952 [Admin] Convert people / group pages to RTKQuery (#57490)
* update components in frontend/src/metabase/admin/people/components to use Mantine components and remove deprecated component usage

* update people and group pages/modals to use more modern components

* use relative sizes

* fix user success modal not closing on "Done" confirm button click

* remove CS from PeopleListRow

* clean up admin/people/colors.ts

* lint fix

* people list footer fix

* pr feedback

* wip

* fix issues, people page updates, some clean up

* add unsaved files

* type fix, fetch user list from rktquery for PeopleList

* remove entity usage from unsubscribe modal, lint fix

* remove all remaining usages of user entity

* remove user entity

* test fixes, remove unused user schema

* bit of clean up

* qa pass - invalidate groups cache if user is deactivated/reactivated

* address pr feedback
2025-05-08 13:00:01 -05:00
Ngoc Khuat
dee2f6bfc7 fix context path for table notification 2025-05-09 00:18:48 +07:00
Sloan Sparger
c9caad50a4 [Admin] Modernize components for People + Groups pages (#57365)
* update components in frontend/src/metabase/admin/people/components to use Mantine components and remove deprecated component usage

* update people and group pages/modals to use more modern components

* use relative sizes

* fix user success modal not closing on "Done" confirm button click

* remove CS from PeopleListRow

* clean up admin/people/colors.ts

* lint fix

* people list footer fix

* pr feedback
2025-05-08 11:50:57 -05:00
Nicolò Pretto
be81440458 remove unused slider component (#57745) 2025-05-08 18:02:52 +02:00
Ngoc Khuat
2bfd1a477a Customizable slack template for alerts (#57694)
* payload example and templateable for alerts

* add a test for getting default template

* wip

* fix slack default template

* limit number of rows return

* WRK-371: Customizable templates for alerts

* use markdown instead

* no verbatim

* always use the default template

* WRK-371: Disable 'Send Now' button for invalid form

* WRK-371: Make Alerts modal footer always visible

* no more verbatim in tests

* test fixes

---------

Co-authored-by: Stas Gavrylov <stas@metabase.com>
2025-05-08 18:14:09 +03:00
Nemanja Glumac
fc0a1777ec Fix flaky e2e test in the onboarding setup spec (#57735) 2025-05-08 16:07:56 +02:00
Nemanja Glumac
4c6c580964 Patch the metabot-v3 merge (#57731)
* Remove unused props from the "New" menu

* Remove Metabot code related to the "New" menu
2025-05-08 14:03:24 +00:00
Ngoc Khuat
db35b1f042 a transformation layer for event info before evaluating the condition (#57728) 2025-05-08 19:35:39 +07:00
metamben
d3fafe9cf2 Metabot v3 PoC (#52436)
Co-authored-by: Tyler Plude <tsplude@gmail.com>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Mihael Konjević <konjevic@gmail.com>
Co-authored-by: John Swanson <john.swanson@metabase.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Thomas Schmidt <thomas@metabase.com>
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: github-automation-metabase <166700802+github-automation-metabase@users.noreply.github.com>
Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
2025-05-08 06:57:20 -04:00
Ngoc Khuat
8b1fa2daf7 fix kondo 2025-05-08 15:32:23 +07:00
Ngoc Khuat
89c23637b2 fix imports, not sure why it's not auto resolved 2025-05-08 15:28:06 +07:00
Ngoc Khuat
4b36020f6d Merge branch 'master' into internal-tools 2025-05-08 15:13:54 +07:00
Uladzimir Havenchyk
8fc63096b8 feat: add a link to field filter docs from dashboard sidebar with native question (#57687)
* feat: add a link to field filter docs from dashboard sidebar with native question

* oops

* add missing translation
2025-05-08 07:30:39 +00:00
Nemanja Glumac
f53785e010 Remove "Model" and "Action" from the "New" button menu (#57647) 2025-05-08 09:04:20 +02:00
Ngoc Khuat
ee5d61525c fix audit log to record external emails when sending notifications (#57679) 2025-05-08 07:03:41 +00:00
Ngoc Khuat
2f4a3d35c2 [Notification] reduce module apis (#57678) 2025-05-08 05:08:07 +00:00
Ngoc Khuat
3e01e467ce Merge branch 'master' into internal-tools 2025-05-08 11:37:22 +07:00
Alexander Polyankin
c1763bd9d7 Fix parameter types! (#57677) 2025-05-08 01:16:33 +00:00
Ryan Laurie
22e028af3a Mark setup tests flaky (#57710)
* mark setup tests flaky

* add flake

---------

Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
2025-05-07 17:00:28 -06:00
Cam Saul
e58ecd7290 [Backend modularization] Mega Renaming PR 1 (#57561)
* auth-provider => auth-provider.core

* enterprise/auth-provider

* `metabase.events.core`

* Move `sql-parsing-enabled` Setting into `query-analysis` (DEV-449)

* `metabase.events.core` (DEV-455)

* `metabase-enterprise.stats` => `metabase-enterprise.analytics.stats` (DEV-475)

* `enterprise/stale` cleanup (DEV-474)

* `enterprise/airgap` => `enterprise/premium-features`

* Appease Kondo

* Remove unused
2025-05-07 14:32:36 -07:00
Raphael Krut-Landau
a69c66d0e1 Remove zh from the list of supported translations (#57672)
We don't support the `zh` (Traditional Chinese) locale anymore – only `zh-CN` (Simplified Chinese), and `zh-HK` (Hong Kong), and `zh-TW` (Taiwan). Here's a [Slack discussion](https://metaboat.slack.com/archives/C6UBFU9GW/p1741983889165599).

So let's remove `zh` from the list of supported translations.

For some reason the list wasn't sorted alphabetically by language name - this PR fixes that too.
2025-05-07 16:43:16 -04:00
Cam Saul
29efdb4287 Remove unused :model/FieldUsage (#57556) 2025-05-07 12:33:19 -07:00
Cam Saul
655907c7bb Remove unused :model/TablePrivileges (#57551)
* Remove unused `:model/TablePrivileges`

* Remove another stray reference
2025-05-07 12:31:33 -07:00
Nathan Voxland
8c57a1b48a Support bigint model_pks in model_index_value (#57661) 2025-05-07 14:25:55 -05:00
Noah Moss
770207290a Don't add isCollapsed nodes for paths not in the data (#57704) 2025-05-07 11:13:52 -07:00
Kamil Mielnik
802890a8a3 SEM-229 Hide numerical semantic types on string-based fields (#57606)
* Remove hack

* Update test
2025-05-07 19:33:59 +02:00
lbrdnk
3709509a67 Migrate hacked semantic type fields to use coercion (#57518)
* migrate hacked fields

* Format and join subq work differently

* Add engine filtering to migration

* Update migr

* Comment
2025-05-07 19:33:10 +02:00
Cam Saul
0b91af3d7c Functions with side effects should generally end in ! (#57615) 2025-05-07 09:14:10 -07:00
Ryan Laurie
c0d38f98a7 stabilize flaky font unit test (#57699) 2025-05-07 09:03:46 -06:00
Sloan Sparger
6a34d8b120 [Admin] Remove styled component usages from people and group pages + components (#57303)
* convert UnsubscribeUserModal and UnsubscribeUserForm components

* convert UserActivationModal to TS

* convert UserPasswordResetModal to TS

* convert UserSuccessModal to TS

* convert PeopleList and PeopleListingApp components to TS

* convert PeopleListRow to TS

* convert use-people-query to TS

* fix deprecated usages of google_auth and ldap_auth with sso_source field

* fix lint

* convert GroupsListing, GroupsListingApp, and AddRow components to TS

* convert lib/groups, AdminContentTable, and AddMemberRow to TS

* convert GroupDetailApp and GroupDetail to TS

* fix import

* convert GroupSummary to TS, make adjustments to other converted files to make types happy

* remove people/components/SearchInput and convert usage to mantine component to avoid TS migration

* remove styled component usage from people and groups pages and components

* adjustment to people listing app
2025-05-07 09:39:43 -05:00
Stas Gavrylov
3d89c4633f WRK-264: Initial version of conditional alerts UI (#57688)
* WRK-264: Initial verfsion of conditional alerts UI

* WRK-264: Move Table alerts components to enterprise

* Fix lint
2025-05-07 15:36:55 +03:00
Ngoc Khuat
d5733763ad Merge branch 'master' into internal-tools 2025-05-07 18:33:35 +07:00
Ngoc Khuat
c554f3a572 Merge branch 'master' into internal-tools 2025-05-07 18:29:03 +07:00
Ngoc Khuat
dd2b87ccbe Merge branch 'master' into internal-tools 2025-05-07 18:12:50 +07:00
Nicolò Pretto
319b45efb0 make LocaleProvider change the return of useLocale and set the locale used by Mantine (#57534)
* refactor: rename test file to tsx to have hopefully better diff in the
next commit

* fix EMB-360: Make Mantine components use the locale from LocaleProvider

* close EMB-373: make useLocale return the locale from LocaleProvider if
present
2025-05-07 12:25:12 +02:00
Romeo Van Snick
ce33f7c3b9 Fix missing snippet create button (#57479)
* Use Mantine dropdown for snippet menu

* Fix search icon in snippet header too

* Remove default ICON_SIZE

* Fix MIN_SNIPPETS_FOR_SEARCH

* Add createSnippet helper

* Add repro for metabase#57441

* Add test for snippet search

* Move snippet helper to api

* Use actual ref for input

* Simplify header search rendering

* Use SidebarHeader for snippet sidebar

* Use Flex for most components

* Simplify padding

* Use class component for archived snippets

* Use class for header button

* Use direct properties

* Rely less on custom css

* Fix header padding

* Fix e2e tests

* Remove unused eslint-disable

* Add type annotation

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

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-05-07 11:40:42 +02:00
Mahatthana (Kelvin) Nomsawadi
251fb3d05c Copy multi-stage components (#57436)
* Move SimpleDataPicker to a new directory preparing for new components

* Use the embedding data picker from a new folder

This requires turning the component into a plugin, which we'll do in the
next commit.

* Move plugin property to a more appropriate place

* Implement embedding multi-stage data picker as an EE plugin

* Add DataSourceSelectorProps

* Remove reference to query builder data picker

* Fix failing unit tests

* Move embedding data picker components to a proper location
2025-05-07 09:27:04 +01:00
Ngoc Khuat
4b6e6e7faa simplify slack impl (#57634) 2025-05-07 14:30:56 +07:00
Ryan Laurie
a59d8af558 Update Appearance Settings (#56468)
* Update Appearance Settings

* unit test additions + updates

* update e2e tests

* test updates

* unit test fix

* fix lint errors

* obey the linter

* add test coverage

* add more tests

* support env var override ui

* remove dead code

* nicer routing

* useDisclosure

* stabilize test
2025-05-06 17:22:54 -06:00
Edward Paget
e8ff64fc77 fix: failing kondos on master (#57662)
* fix: failing kondos on master

* fixup! remove all external references to permissions group membership

* fixup! missing export
2025-05-06 15:44:31 -07:00
Denis Berezin
4e127f0487 Optimistic updates for table grid edits (#57361)
* almost working optimistic update

* Add errored update display

* Add proper error toast

* Self review

* Add optimistic updates to dashboard cards

* Review fixes 1

* Review fixes, added support for multiple failed updates

* Add uniq cell ids to handle state

* Self review
2025-05-06 22:29:01 +03:00
Ryan Laurie
0beb4fd1ec Add build-args to uberjar job (#57633)
* add build-args to uberjar job

* better sha
2025-05-06 13:01:02 -06:00
Nick Fitzpatrick
f508020b18 Watermarks in development instances - App viz (#57620)
* adding watermark for dynamic viz

* starting to put together e2e tests for watermarks

* adding unit test

* adding loki tests

* adding more e2e tests

* changing test id

* adding e2e tests on chart interactivity

* fixing type error
2025-05-06 23:51:25 +05:30
Aleksandr Lesnenko
61b06cb9ca update chart settings types (#57657) 2025-05-06 13:28:40 -04:00
Konstantin Darutkin
2ffee29111 fix: remapped_to_column is not defined when rows are empty (#57652) 2025-05-06 18:18:56 +01:00
Case Nelson
c21a754c1a fix: redshift pg_enum error when missing base types (#57397) 2025-05-06 09:49:36 -06:00
github-actions[bot]
cebcccd81a Update translations 2025-04-29 (#57372)
* Update translation sources 2025-04-29

* Update translations

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-05-06 09:21:55 -06:00
Nemanja Glumac
479f6ec15e Remove "Collection" option from the "New" button menu (#57649)
Resolves PRG-29 by removing the "Collection" entry from the main "New" menu.
2025-05-06 17:17:12 +02:00
Nemanja Glumac
e42004d8bd Remove "Metric" option from the "New" button menu (#57641)
Resolves PRG-27 by removing the option to create Metric from the main "New" menu.
2025-05-06 15:03:39 +02:00
Romeo Van Snick
3b9ba47ce5 Clean up helper text utils (#57382)
* Split up config into categories

* Break out clauses into groups

* Add duplicate name check

* Allow setting shared options

* Add category to mbql clause config

* Rename groups

* Use enum for category

* Build examples using helper functions

* Build ExpressionParts directly in helper-text

* Flatten examples

* Wrap example in function

* Enable late-binding for args

* Unwrap example

* Remove get name and get description wrappers

* Remove getHelpDocsUrl helper

* Simplify example fn

* Add missing export

* Remove getFunctionByStructure

* Simplify help text helpers

* Rename structure to displayName

* Make args required

* Manually type clause definition type

* Merge HELPER_TEXT_STRINGS into config

* Move help text helpers to separate file

* Use data from MBQL_CLAUSES instead of HELPER_TEXT_STRINGS

* Allow defining stuff in config

* Move help text into config

* Remove fallback to HELPER_TEXT_STRINGS

* Remove helper-text-strings

* Allow more stuff to be optional

* Build clause in getClauseDefinition

* Avoid self-referential types

* Use getClauseDefinition in completer

* Handle new args definition

* Handle null instead of undefined

* Enforce type on all argument definitions

* Enforce name on all argument definitions

* Get clause defns

* Fix types

* Simplify tests

* Remove unnecessary guard

* Avoid creating unnecessary functions

* Move defineClauses to separate module

* Remove any in config

* Rename helper-text-strings test to help-text
2025-05-06 14:53:52 +02:00
John Swanson
6376201ee2 Implement Tenant Groups (#57050)
* Implement Tenant Groups

- normal users cannot be added to a tenant group

- tenant users cannot be added to a normal group

- tenant groups cannot receive write access to any collection

- tenant groups cannot receive any access to the audit collection

- tenant groups cannot receive any application permissions

* Add a setting to turn tenants off and on

When the setting is turned on:

- create the All External Users group, with
`magic_group_type=all-exsternal-users` and `is_tenant_group=true`

When the setting is turned off:

- make sure there are no remaining tenants or tenant users

- delete the All External Users group

* Remove the need for memoized `tenant?` functions

* Fix tests

* allowe using with-temp with perms group membership

* fix more tests

* remove unnecessary bindings

* Put setting behind a feature flag

* Don't read setting from env

closes adm-648
closes adm-657
closes adm-649
2025-05-06 05:50:11 -07:00
Phoomparin Mano
7f92780e9e fix(sdk): custom GeoJSON maps does not load due to wrong domain (#57539) 2025-05-06 19:02:48 +07:00
Nemanja Glumac
9e13274e72 Add a "new collection" button to the collection header (#57616)
Resolves PRG-25

This PR adds a new button to the collection header menu. The button simply opens a new collection modal (lets you create a new collection). There are two important things to note about this change:

1. This button shows only when a user has a curate permissions for the current collection
2. This change required adding a new icon to our design system, which was approved by Maz.
2025-05-06 13:51:26 +02:00
Phoomparin Mano
92fac6cabb fix(sdk): updating collection's entity id crashes InteractiveQuestion and CollectionBrowser (#57529) 2025-05-06 18:51:14 +07:00
Ngoc Khuat
aca9b98060 move context info to after the log message (#57588) 2025-05-06 07:18:06 +00:00
Nemanja Glumac
d25b43a3cb Add a "new collection" button to the main sidebar (#57605)
Resolves PRG-20

This PR replaces the old `...` menu next to the "Collections" sidebar header. As a reminder, this menu was previously triggering a popup with two items:

1. New collection
2. Other users' personal collections (in case the user is an admin)

We're now improving the UX and replacing this menu with two distinct items:

1. The `+` icon that creates a new collection directly
2. The new individual sidebar link that leads to other users' personal collections (again, only if admin)
2025-05-06 07:03:35 +00:00
Nemanja Glumac
fd2f465639 Add a new model button to the browse models page (#57555)
Resolves PRG-21
2025-05-06 08:16:47 +02:00
Fraser
b7f5e23707 Create new PublicSharingSettingsPage component (#57465)
* Create new PublicSharingSettingsPage component

* Add unit tests
2025-05-06 16:00:56 +12:00
Edward Paget
9e7f0b903a fix: remove version-info from settings list api (#57505)
* fix: remove version-info from settings list api

* fixup! cljfmt

* fixup! remove extra assignment
2025-05-05 18:04:34 -05:00
Alex Yarosh
232ce151c3 help page (#57619) 2025-05-05 21:31:07 +00:00
Cam Saul
5d6b82d6ee Fix Kondo failures not causing CI failures (#57618) 2025-05-05 21:01:28 +00:00
Kyle Doherty
1b0ceb2c48 Update Title component sizes to match Figma (#54750)
* update title sizes to match figma - add multi line title stories for lineheight examples

* little more line height in modal titles

* little fixes

* more little fixes

* reduce smartscalar title size

* Update Loki Snapshots

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-05-05 13:41:48 -06:00
Konstantin Darutkin
75d3bda5a0 feat: dashboard editable display new record when there is no data (#57617) 2025-05-05 20:24:51 +01:00
Nick Fitzpatrick
c42252c802 Add watermark to static viz chart renderings (#57553)
* add watermark to static viz chart renderings

* adjusting unit test
2025-05-05 22:38:28 +05:30
Edward Paget
dd9c170d8d fix: add table-level sql based permission query (#57541)
* fix: add table-level sql based permission query

Some places in our code we may be returning fewer tables than a user has
access to because we load a limited number of models from the database
then apply permissions filters to those. This provides a subquery based
check for table permissions that we can use in other queries to do the
same kind of test for table access that we would do on the clojure-side.

Co-Authored-By: Nathan Voxland <nathan@metabase.com>

* fixup! restore check-permissions-for-model impl

* Update src/metabase/models/table.clj

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>

* fixup! caluse -> clause spelling

* fixup! reformat malli annotations; add docstring

* fixup! add Literal type to honeysql helpers

* fixup! restore accidentally deleted clause

---------

Co-authored-by: Nathan Voxland <nathan@metabase.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-05-05 11:48:38 -05:00
Ryan Laurie
c88a5b5bc5 remove use modal hook (#57601) 2025-05-05 10:39:07 -06:00
github-automation-metabase
aa0bd12ed3 Bump net.snowflake/snowflake-jdbc from 3.23.2 to 3.24.0 (#57587)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-05-05 11:20:53 -04:00
github-automation-metabase
a0bee28c26 Bump org.eclipse.jetty/jetty-server from 12.0.19 to 12.0.20 (#57581)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-05 14:04:27 +00:00
Ngoc Khuat
ea279ca19b Email domain check when adding notification recipients (#57416) 2025-05-05 13:59:54 +00:00
github-automation-metabase
a8656deb25 Bump org.eclipse.jetty.ee9/jetty-ee9-servlet from 12.0.19 to 12.0.20 (#57580)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-05-05 13:48:41 +00:00
Nick Fitzpatrick
8ebc12b933 Register Dynamic Shortcuts (#56812)
* Register Dynamic Shortcuts

* regex keys

* things more-less working

* adding admin shortcuts, patching kbar to pass keyboard event

* fixing type issues

* only emit events on keyboard shortcut executions

* remove wait
2025-05-05 17:35:30 +05:30
Nick Fitzpatrick
edb69d6dbb properly invalidate collections when x-raying a table (#57495) 2025-05-05 17:34:15 +05:30
Chris Truter
27d987ef19 Omit model metadata when compiling Editable cards (#57597) 2025-05-05 13:44:47 +02:00
Kamil Mielnik
8aac6aac61 Add label to CodeEditor in LogLevelsForm (#57524)
* Add label to CodeEditor in LogLevelsForm

* Remove required for consistency
2025-05-05 17:56:16 +07:00
Nemanja Glumac
691d1430f8 Add a new metric button to browse metrics page (#57496)
Resolves PRG-22
2025-05-05 12:53:00 +02:00
Nicolò Pretto
2adc027178 fix(sdk): manual fixes for module level ttag calls causing broken translations (#57391)
* fix: filter button labels

* fix: part of EMB-335, uiName: t => getUiName: () => t

* fix linting issue

* fixed unit test mock missing getUiName
frontend/src/metabase/visualizations/components/Visualization/Visualization.unit.spec.js
missing

* make application-permissions.cy.spec.js pass
2025-05-05 10:11:02 +02:00
Aleksandr Lesnenko
e3e035ac6e remove old static pie chart interface (#57545) 2025-05-03 00:56:14 +00:00
Alexander Polyankin
c7ee8b29d2 Fix isDate check in legacy (#57185) 2025-05-03 00:04:44 +00:00
Vamsi Peri
a23481188c Fix for Grey areas around the cards when exporting to PDF (#56928)
* cursor says this could fix the issue

* harder vibe coding

* remove handling of made up by llm elements that do not exist

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2025-05-02 22:49:49 +00:00
Oleksandr Yakushev
0a4625fdbe [svg] Pool static-viz-context objects (#56648) 2025-05-02 23:34:37 +03:00
Nathan Voxland
ac81ee5c25 Fixed catching of 403 errors from harbormaster (#57504) 2025-05-02 14:04:34 -05:00
Cam Saul
99613cfe0d [Backend modularization] sample-data module (#57511)
* [Backend modularization] `sample-data` module

* Remove duplicate ns form
2025-05-02 11:51:47 -07:00
Nathan Voxland
e515a2d6d0 Further limit tsvector size since it's concatinated (#57514) 2025-05-02 13:20:26 -05:00
Riley Thompson
0c0aaf5490 druid jdbc localdate set param impl (#57507) 2025-05-02 10:56:28 -04:00
Riley Thompson
0bc9646ca0 set timezone for identity-hash-test tests (#57530) 2025-05-02 10:56:14 -04:00
Chris Truter
84904235f2 Relax reverse-coercion test (#57535) 2025-05-02 16:54:12 +02:00
Case Nelson
40507a0e21 fix: include system catalog in databricks multicatalog (#57484)
* fix: include system catalog in databricks multicatalog

* Fix formatting
2025-05-02 08:53:37 -06:00
github-automation-metabase
562617890f Bump com.facebook.presto/presto-jdbc from 0.291 to 0.292 (#56659)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-05-02 10:43:22 -04:00
Chris Truter
611b8a4036 Repurpose Bulk actions as Table actions (#57519) 2025-05-02 16:43:12 +02:00
github-automation-metabase
9e4fb1181c Bump io.trino/trino-jdbc from 431 to 475 (#57319)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-05-02 10:43:11 -04:00
github-automation-metabase
6422238118 Bump com.clickhouse/clickhouse-jdbc from 0.8.4 to 0.8.5 (#57318)
* Bump com.clickhouse/clickhouse-jdbc from 0.8.4 to 0.8.5

Inspect dependency changes here:

* Fix test for jdbc driver upgrade

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Riley Thompson <rileythompson99@gmail.com>
2025-05-02 10:42:04 -04:00
Romeo Van Snick
c4cb9263f6 Do not set card when using browser back button (#57389)
* Add reproduction for metabase#56775

* Pass the correct card to the location change

* Unwrap card when navigating to model or metric
2025-05-02 13:42:05 +02:00
Romeo Van Snick
003777b77d Clean up expression config (#57109)
* Rename ALL_NODES to NODE_TYPE

* Remove unnecessary name override

* Remove unused EXPRESSION_OPERATOR_WITHOUT_ORDER_PRIORITY

* Use precedence from pratt compiler

* Move EDITOR_FK_SYMBOLS to identifier module

* Lift const descriptor

* Remove unused characters config

* Remove identifierAlwaysQuoted from EDITOR_QUOTES config and make the behaviour the default

* Move identifierDefaultQuote out of config and hard-code the behaviour

* Flatten default quotes config and move default into string module

* Remove wrong comment

* Use parseOperatorType to find operator type

* Remove separate operator groups

* Remove unused FUNCTIONS variable

* Remove barely used getExpressionName

* Use Boolean token to parse booleans

* Remove True and False from operators

* Rename Star and Slash to Multiply and Divide

* Remove FIELD_MARKERS

* Simplify config definition

* Inline getDescriptionForNow

* Move OPERATOR check to formatter

* Use normal quotes in config

* Split up MBQL_CLAUSES to avoid duplicating names

* Split clause helpers into separate files

* Fix sort order in completion tests

* Move operators to a separate group in config

* Use EXPRESSION_OPERATORS in formatter

* Export using star

* Rename OPERATOR to PUNCTUATOR

* Rename parseOperatorType to parsePunctuator

* Rename parseOperatorType to parsePunctuator

* Add helper for potential function prefixes

* Remove unused OPERATORS

* Remove superflouous helper

* Inline formatCallExpression

* Use Lib.ExpressionOperator where possible

* Remove impossible case for expression

* Inline isLogicOperator

* Rename variable for clarity

* Deduplicate helpers

* Move formatter helpers into utils

* Simplify helper

* Fix import order

* Remove reliance on PUNCTUATOR type

* Fix variable name

* Simplify punctuator definition

* Clean up lexifier

* Flatten lexifier results

* Remove errors for parser results

* Flatten parser result

* Simplify parser tests

* Remove cast

* Remove unused import

* Translate all error messages in formatter

* Simplify type

* Use sentence case name for type
2025-05-02 13:19:47 +02:00
Alexander Solovyov
76133ade49 [serdes] break endless loops (#57482)
When making sure stuff can load even with a loop, the circuit breaker was removed, leading to endless loops. That
would happen if the data causing the loop wasn't stripped properly. Right now if stripping things once did not help
and the entity is in the pipeline again, the process will break (with hopefully enough data to detect why).

This also changes the logic from exception to just recursive calls. Plus it's back at skipping all dashcards in a
Dashboard instead of just skipping visualization logic, which should make for a way faster processing (less deep for
sure). Plus it tries to improve logging a bit so it's easier to understand what's going on in complex cases.
2025-05-02 10:30:38 +00:00
Konstantin Darutkin
ab575facbc fix: display values of FK fields when it is outside of search results (#57517) 2025-05-02 10:20:12 +01:00
Konstantin Darutkin
652657666c feat(enterprise): add scope params for editing endpoints (#57516) 2025-05-02 10:00:21 +01:00
Nicolò Pretto
f29902368b sdk-storybook: disable reactDocGen to speed up storybook (#57440) 2025-05-02 10:47:58 +02:00
Sébastien
2c106817a4 closes viz-360 esc key should not add a recipient (#57253)
* closes viz-360 esc key should not add a recipient

* better code in e2e test to avoid eslint-disable-next-line
2025-05-02 09:47:19 +02:00
Ngoc Khuat
8e668e526b Sample event info with table value (#57474)
* sample with table info

* remove debugging code

* wiring up

* missing imports
2025-05-02 13:52:02 +07:00
Ngoc Khuat
6d518e9db9 Reverse the order of coercion in notification parsing (#57472) 2025-05-02 13:29:40 +07:00
Sébastien
da5cd4e7cf Closes VIZ-349 unknown date style warnings (#57263)
* closes VIZ-349 unknown date style warnings

* safer approach
2025-05-02 07:20:03 +02:00
Alexander Polyankin
04bf793795 Drop param_values (#57508) 2025-05-02 00:39:30 +00:00
Fraser
fa9ea2a5a9 Create EmailSettingsPage (#56760)
* Create EmailSettingsPage

* Add email settings to mocks

* Create ReplyToWidget

* Add unit tests for email page

* Handle boolean conversion in AdminSettingInput
2025-05-02 11:45:51 +12:00
Cam Saul
a04e9bd9b0 [Backend modularization] testing-api module (#57503) 2025-05-01 15:53:14 -07:00
Cam Saul
85b3ab5d5f [Backend modularization] Move remaining Slack namespaces into channel module (#57502) 2025-05-01 15:09:14 -07:00
Cam Saul
41e3110f20 [Backend modularization] create new api-keys module (#57497)
* [Backend modularization] create new `api-routes` module

* Fix test 🔧

* [Backend modularization] `api-keys` module
2025-05-01 14:22:52 -07:00
Cam Saul
213535773b [Backend modularization] create new api-routes module (#57492)
* [Backend modularization] create new `api-routes` module

* Fix test 🔧
2025-05-01 20:16:03 +00:00
Jeff Bruemmer
c1e301eda6 docs - note on role setting (#57268)
* note on role setting

* format
2025-05-01 16:15:16 -04:00
Edward Paget
d82bf686b6 deps: remove simpleclient_jetty and javax.servlet (#57487) 2025-05-01 18:58:56 +00:00
Oisin Coveney
fe3792cda9 Convert AutomaticDashboardApp to a functional component (#57390) 2025-05-01 17:53:37 +00:00
Konstantin Darutkin
5e04b07f2f feat(enterprise): add distinct editing modal URL for dashboard (#57425)
* feat(enterprise): add distinct editing modal URL for dashboard

* fix: review fixes
2025-05-01 14:14:31 +01:00
Konstantin Darutkin
531bcff427 fix: display a header with actions (create) even when there is no data (#57480) 2025-05-01 13:45:52 +01:00
Chris Truter
833718d160 Make undo tests e2e (#57477) 2025-05-01 10:59:17 +02:00
lbrdnk
8278732860 Fix cumulative aggregations legacy transform (#57258)
* Fix cum-sum and cum-count legacy transform

* Address review remarks

* Adjsut test

* ag idents

* dissoc-in
2025-05-01 09:34:57 +02:00
Oisin Coveney
0fb515cbc6 TS Conversion: Automatic Dashboard App (#57075) 2025-05-01 08:09:35 +01:00
Cam Saul
2d038e518e Remove Legacy Metrics code from the backend (#57401)
* Remove Legacy Metrics code from the backend

* Code cleanup

* Test fix 🔧

* Test fix 🔧

* PR feedback

* Extra test

* Revert some X-Rays changes

* Remove commented-out test

* Test fixes 🔧
2025-04-30 19:06:26 -07:00
Cam Saul
fc56c810f9 [Backend modularization] native-query-snippets (#57460) 2025-04-30 23:18:03 +00:00
Riley Thompson
fd18b7708f Try specifying tz for identity hash test flake (#57408) 2025-04-30 22:40:06 +00:00
Cam Saul
1c113a608e [Backend modularization] upload module cleanup (#57414)
* `upload` module cleanup

* Fix MySQL

* More keyword fixes 🔧

* Keep uploads sorted
2025-04-30 15:15:58 -07:00
Noah Moss
5fabb3e1ec Fix subtotal label formatting for xlsx pivot exports (#57452)
* Fix subtotal label formatting for xlsx pivot exports

* untangle circular dep
2025-04-30 14:57:49 -07:00
Nathan Voxland
6da77fce6f Reindex immediately on start-up if existing table is old (#57159) 2025-04-30 16:39:46 -05:00
Riley Thompson
f947b70c35 Restrict Mongo sandboxing with saved questions (#56983)
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2025-04-30 17:32:52 -04:00
bryan
90b9fea551 fix docs bump workflow (#57454) 2025-04-30 20:47:26 +00:00
Denis Berezin
8661631b79 Hotfix to show edit modal in case of string IDs 2025-04-30 22:57:23 +03:00
bryan
8574e882e9 Remove non-doc branches before sending workflow trigger (#57446) 2025-04-30 15:50:42 -04:00
lbrdnk
609807dc33 Fix sorting by aggregation expression with cumulative function works (#57292) 2025-04-30 20:24:30 +02:00
Alex Yarosh
698012db51 Update countif.md (#57373) 2025-04-30 14:12:24 -04:00
Edward Paget
8006d49537 fix: move internal stats for module organization (#57430) 2025-04-30 17:50:33 +00:00
Cam Saul
0c154e49de [Backend modularization] cache module (#57410)
* [Backend modularization] `cache` module

* Update module config

* Update Setting references
2025-04-30 09:43:46 -06:00
Stas Gavrylov
c56b10ce28 Custom templates fixes (#57433) 2025-04-30 17:23:16 +03:00
Edward Paget
eb3cc6d1cc feat: add prometheus metric for quartz task states (#56994)
* feat: add prometheus metric for quartz task states

Adds a new quartz_task_state metric that will report to prometheus the
states of all quartz jobs running on a metabase instance using a guage.

Each task state is reported as a label and we also report a state for
tasks that are executing.

All hosts on a metabase cluster _should_ report the same value for these
metrics if they are scraped at the same time, and we need to consider if
the additional DB load is okay since this does query the database during
a prometheus scrape to report this metric.

* fixup! add job-name tag and histogram of job time
2025-04-30 13:31:08 +00:00
Nicolò Pretto
af3156b9dd add locale selector to sdk storybook (#57393)
* add locale selector to sdk storybook

* clarify the default value and change to have objects as items
2025-04-30 15:12:40 +02:00
Chris Truter
87b07be973 Fix pk selection (#57427) 2025-04-30 14:56:43 +02:00
Ngoc Khuat
265ca5ab39 Remove link to question for table editable (#57423) 2025-04-30 19:23:19 +07:00
Alexander Polyankin
0f158889c6 Handle submit in dashboard filter widgets (#57388)
* Handle submit

* Handle submit

* Handle submit

* Handle submit

* Handle submit

* Handle submit

* Handle submit

* Handle submit

* Handle submit

* Handle submit

* Handle submit

* Handle submit

* Handle submit

* Handle submit
2025-04-30 08:11:58 -04:00
Chris Truter
7b619a3efa Give editables better names (#57426) 2025-04-30 14:07:51 +02:00
Alexander Polyankin
85411a4abc Apply filter split button (#57215)
* Add filter add button

* Add filter add button

* Add filter add button

* Add filter add button

* Add filter add button

* Add filter add button

* Add filter add button

* Add filter add button

* Add filter add button

* Fix E2E

* Fix E2E

* Fix E2E

* Fix back button

* Fix back button

* Fix back button

* Fix back button

* Fix back button

* Fix back button

* Fix back button

* Remove extra source abstraction
2025-04-30 06:21:07 -04:00
Chris Truter
9040d58e26 Support custom context for 'ad hoc' queries (#57421) 2025-04-30 11:22:31 +02:00
Timofey Kachalov
1586c15e04 Add Access-Control-Max-Age header to cache CORS preflight requests made by SDK (#57383) 2025-04-30 11:55:52 +04:00
Timofey Kachalov
827c5d8b2e Update Shoppy Sample App Tests to work with App DB Dump (#57250) 2025-04-30 11:17:49 +04:00
Cam Saul
6d588fef7a [Backend modularization] embedding module (#57409)
* Embedding module

* Embedding module

* Fix lint errors

* Fix circular references

* Remove reference to renamed namespace
2025-04-29 16:58:58 -07:00
Cam Saul
c1d7e63ac0 [Backend modularization] Move premium-features API into module and other misc cleanup (#57404)
* [Backend modularization] Move `premium-features` API into module and other misc cleanup

* Fix Search Settings

* Fix

* Fix removed namespace

* Test fix 🔧
2025-04-29 15:30:17 -07:00
Cam Saul
486a5904a4 [Backend modularization] task-history module (#57369)
* [Backend modularization]  module

* Add init namespaces

* Test fix 🔧

* Test fixes 🔧

* [Backend Modularization] `task-history` module

* cljfmt
2025-04-29 14:57:15 -07:00
Noah Moss
b0c1eddc38 Quarantine cypress flakes in download format test + small correctness fix (#57392)
* try to fix cypress download format flakes

* handle unset last_table_download_format

* more test tweaks

* make tests shorter, refactor, and add wait periods

* rearrange more code

* remove the waits, quarantine tests as flaky

* move cy.intercept to right before reload

* skip tests again

* unravel .then calls
2025-04-29 21:38:16 +00:00
Nathan Voxland
ff6f759dbd Delete indexed rows from the search index which correspond to deleted rows (#57086) 2025-04-29 16:29:53 -05:00
Ryan Laurie
06d74f2209 Map settings array on fetch (#57367)
* map array on fetch

* fix types
2025-04-29 15:28:51 -06:00
Case Nelson
b11300d091 feat: Implement multi-catalog for databricks (#57148)
* feat: Implement multi-catalog for databricks

* Fix schema for nil

* Add tests for joins on multi-catalog

* Fix multicatalog driver name

* Remove require

* Alphabetize drivers

* Add changelog

* Fix tests

* Fix tests

* Do not sync system catalogs

* Address review comments

* Update connection properties

* Update example to make clear its a schema
2025-04-29 14:57:36 -06:00
Cam Saul
01b2c8c140 [Backend modularization] settings module (#57366)
* [Backend modularization]  module

* Add init namespaces

* Test fix 🔧

* Test fixes 🔧
2025-04-29 13:32:18 -07:00
Nemanja Glumac
2ab279f7bb Add unit tests coverage for branded export utils (#57358)
* Add basic unit test coverage for export branding utils

* Add tests for `getChartFileName` util
2025-04-29 21:17:07 +02:00
Nathan Voxland
cfd1cd8c3b Handle deleted connections in harbormaster (#57356) 2025-04-29 13:14:35 -05:00
Stas Gavrylov
3ce75ecdf2 WRK-344: Automate custom template preview updates (#57394) 2025-04-29 19:19:21 +03:00
Denis Berezin
ddaef972cd Remove duplicated rows in record editing on dashboard 2025-04-29 19:06:20 +03:00
Stas Gavrylov
b5280e8e3e WRK-333: Implement POC for default template selection (#57387) 2025-04-29 18:31:42 +03:00
Konstantin Darutkin
93b04ae99c feat(enterprise): add distinct modal URLs for table editable view (#57255) 2025-04-29 16:01:21 +01:00
Nathan Voxland
a7ff114fed mb/mb should be able to get an mb_dev_* token (#57363) 2025-04-29 09:10:49 -05:00
Chris Truter
5d9a5d4d38 Speed up edits to databases with high latency or huge tables (#57385) 2025-04-29 15:20:41 +02:00
Alan Molina
6b5b200b71 Fix typo on collections.md (#52657)
Just removing an additional square bracket in the docs.
2025-04-29 09:09:11 -04:00
metamben
e8acf5e4b1 [SEM-219] Humanize error message even more (#57205)
* [SEM-219] Humanize error message even more

To provide the customized error message, the type check built into the defendpoint framework has to be disabled, which
results in less specific API documentation.

(Malli has an experimental feature we currently don't use for looking up humanized errors from parent schemas, that
would let us configure the error message AND keep the input type information.)
2025-04-29 15:51:34 +03:00
Ryan Laurie
a180c257e1 Refactor Build + Docker Uberjar Job (#57298)
* rewrite uberjar workflow

* test

* fix

* fix

* fix

* fix

* fix

* fixes

* dont make docker sad

* remove test code

* remove metabot shenanigans

* address review comments

* different secrets handling

* remove test code
2025-04-29 06:22:03 -06:00
Ngoc Khuat
d28d12c2cb template for webhook (#57379) 2025-04-29 19:21:33 +07:00
Chris Truter
2c2b7a495b Segregate undo snapshots based on scope, not table (#57378) 2025-04-29 13:49:07 +02:00
github-automation-metabase
f990334130 Bump com.gfredericks/test.chuck from 0.2.14 to 0.2.15 (#56651)
Inspect dependency changes here: https://github.com/gfredericks/test.chuck/blob/test.chuck-0.2.15/changes.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-04-29 10:30:07 +00:00
Nemanja Glumac
ebd7ea407f Use custom redux import to remove type casting (#57362)
Resolves PRG-13
2025-04-29 09:46:47 +00:00
Stas Gavrylov
f15299d54a WRK-348: Hide 'schema' field from event payload (#57376) 2025-04-29 12:31:08 +03:00
Ngoc Khuat
a49cab944b fix kondo errors 2025-04-29 16:25:38 +07:00
Chris Truter
12f7aa1781 Ensure undo batch numbers increase atomically (#57375) 2025-04-29 10:32:54 +02:00
lbrdnk
79daf9d2bd Use case statment to filter metrics (#55094)
* Test comparing  case vs filtered ags

* Add test and update case definition

* Add logging to check CI, mark as driver ns

* Remove metadata to see which driver tests run

* add failing op for some drivers

* Use case to filter metric ag

* Filter in case

* Existing tests update

* WIP Respect expression deduplication

* Move transformation right after metric fetch

* Update test

* Aggregation maps to be used in tests

* Simplify metric transform

* New tests

* Cleanup

* Cleanup

* Cleanup

* Fix equality

* Cleanup

* Cleanup equality

* Simplify test

* Tolerate float deviation

* Feature dependent aggregations

* Update test

* Fix value formatting

* Add var to std dev ags

* Update the filtering logic

* Speculate

* Adjust tests

* Update test

* Kondo

* Adjust test for starburst

* Remove debug def

* Apply suggestions from code review

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

* Adjust naming

* Comment

* fresh-uuids into definition

* Add shortcut for empty condition

* Adjust meta and case default

* Remove now redundant condition

* Docstring

* Indentation

* Remove dev leftover

* Remove dev leftover

* Update tests and distinct-where

* Nullary aggregations map

* Distinct-where feature

* Fix formatting

* Adjust e2e test

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-04-29 09:48:55 +02:00
Ngoc Khuat
d1e0492261 More handlebars helper (#57374)
* add more handlebars helpers

* rename some helpers

* more tests
2025-04-29 14:27:46 +07:00
Ngoc Khuat
79400e908a Template context: ordered fields and coercion (#57340) 2025-04-29 12:58:41 +07:00
Sloan Sparger
d8cd6914d6 [Admin] Migrate groups pages + components to TS (#57232)
* convert UnsubscribeUserModal and UnsubscribeUserForm components

* convert UserActivationModal to TS

* convert UserPasswordResetModal to TS

* convert UserSuccessModal to TS

* convert PeopleList and PeopleListingApp components to TS

* convert PeopleListRow to TS

* convert use-people-query to TS

* fix deprecated usages of google_auth and ldap_auth with sso_source field

* fix lint

* convert GroupsListing, GroupsListingApp, and AddRow components to TS

* convert lib/groups, AdminContentTable, and AddMemberRow to TS

* convert GroupDetailApp and GroupDetail to TS

* fix import

* convert GroupSummary to TS, make adjustments to other converted files to make types happy

* remove people/components/SearchInput and convert usage to mantine component to avoid TS migration
2025-04-28 19:09:20 -05:00
Eric Normand
85194c8080 Extend integer() cast function to accept floats (#56817)
* Add float cases to integer cast testing

* Update types of integer mbql expression

* Better messages for tests

* Add rounding test and specialize for redshift

* Don't use extreme values for redshift

* Add e2e tests for float -> integer casts

* Update helper text for integer

* Change test message.

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>

* Helper function to convert to integer

* Appease the kondo

* More accurate comment

* Update arithmetic.cljc

* Refactor to use better ->integer implementation for SQL dbs

* kick ci

* Missed an argument

* Round properly for inline constants

* Add String->Integer and Float->Integer coercion strategies

* Add MongoDB string->integer and float->integer coercions

* Fix types in coercion test

* Also cast in mongodb coercion

* Use NUMBER(p) type in Oracle

* Spark SQL needs explicit round()

* SQLite needs explicit round()

* SQL Server needs explicit round()

* Clickhouse cast to float first

* SQLite needs to cast to float first so it can round

* SQL Server needs to cast to float so it can round

* Mongo needs to cast to float before rounding

* Spark SQL needs to cast to float so it can round

* Revert converting multimethod ->integer to defn

* Remove cast-integer multi-method and restore ->integer

* Update `integer-dbtype` in changelog

* Fix oracle integer type

* Fix spark sql casting

* Databricks driver needs to round

* kick ci

* Use ->integer in coercion

* Helper function for cast to integer with round

* kick ci

* Remove unnecessary ->float implementation

* Fix cljfmt precommmit hook

* Fix clickhouse returning bigdecimal

* Handle raw values in untyped-inline-value

* This came in with the merge

* Allow integer(float) and integer(string)

* Remove stray println

* Work for known types only

* Test for converting literals at compile time

* Update mysql

* Fix timezone test failing on null week-of-year

* Update fe test for float coercion

* Doh! Typo.

---------

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-04-28 18:34:36 -05:00
Cam Saul
a32c124933 [Backend Modularization] query-analysis module cleanup (#57360)
* Move QueryAnalysis model into `query-analysis` module

* Add `metabase.query-analysis.settings`

* Move `query-analysis-enabled` Setting

* Update modules config
2025-04-28 22:53:20 +00:00
Aleksandr Lesnenko
b0065a0c8e fix invalid tooltip on interpolated values (#57305)
* fix invalid tooltip on interpolated values

* specs, timezone issues for interpolated datums

* fix waterfall, scatter

* update e2e spec after fixing timezone issue

* fix e2e failures

* specs
2025-04-28 18:07:48 -04:00
Aleksandr Lesnenko
a43bdf804d pivot table: show subtotals for a single item (#56988)
* add viz setting fe

* ClJS changes

* Fix up some BE tests

* fix last test

* spec, hint

* specs

* review

---------

Co-authored-by: Noah Moss <noahbmoss@gmail.com>
2025-04-28 21:27:16 +00:00
Edward Paget
3584a5c83b fix: avoid deadlocks by not holding connection (#56524)
Avoid the possiblity of deadlocks during cached query processing by no
taking the connection using with-connection and instead just selecting
the cached result using toucan.

I _think_ this connection holding was introduced under the assumption
that we could 'stream' a binary column from postgresql using the
.getBinaryStreaming jdbc method. However postgres requires binary
columns to be full read and written and so we are unable to stream
results from that column, so this operation ends up being the same as
just querying the column normally.

Because we are not streaming the result in it seems safe to just yeild
the connection back to pool so it can shared with other requests.
2025-04-28 15:52:02 -05:00
Noah Moss
8ccc4df47d Remember last download format in user kv store (#57155)
* initial implementation

* e2e test

* tweaks

* fix e2e test + refactor

* reduce unneeded comments

* clean ns

* fix unit tests

* fix e2e test

* disable userKV when no user is logged in

* fix up a number of unit tests

* refactor out BaseQuestionDownloadPopoverProps with two wrapper components to avoid using the user kv hook in public/embedded contexts

* fix up types

* fix up e2e test

* use ?. syntax
2025-04-28 15:57:13 -04:00
Noah Moss
1a4744e18c Hide email domains for non-admin users without settings access (#57300)
* hide email domains for users without settings access

* fix test

* fix up e2e test

* update BE setting visibility

* Revert "update BE setting visibility"

This reverts commit b3728ad21d.

* remove commented-out line
2025-04-28 19:45:19 +00:00
metamben
75dd83ba81 Prevent falling back on type before cast when qp/ignore-coercion (#57095)
Fixes #56886

This is assuming that qp/ignore-coercion is set to avoid repeated casting.  That means, that we should type is as if
the cast has happened.
2025-04-28 19:36:26 +03:00
Riley Thompson
3e4d4a5116 Disable sqlite for array-query-can-be-cached-test (#57302)
* disable sqlite
2025-04-28 15:58:34 +00:00
Oisin Coveney
e26c89311e Remove Toaster HoC (#57341) 2025-04-28 15:55:49 +00:00
Edward Paget
193cb3819f fix: scheduler state management in cloud migration (#57338)
* fix: scheduler state management in cloud migration

When we create the h2 database to dump a metabase instance to during
cloud migration we need to stop and start the quartz scheduler instance
running on the instance during the migration.

Some liquibase migrations handling quartz job changes expect to control
the scehduler and start/stop it while those migrations run. Recent
changes to guard against this behaviour in testing case these
migrations to throw an exception when they run during the cloud
migration task.

This also fixes an older bug that the quartz scheduler would remain off
on the instance being migrated after the cloud migration task finishes.

* fixup! stop scheduler after all calls to migrate!

* fixup! formatting
2025-04-28 10:55:34 -05:00
Stas Gavrylov
c172e149b9 WRK-306, WRK-307, WRK-324: Template preview. UI improvements for custom templates. (#57331)
* WRK-307: Make default template code grayed out. Add reset to default button

* Replace template example fetching mutation with query to cache results

* WRK-249: Template Preview UI. Refactoring
2025-04-28 17:57:32 +03:00
Oisin Coveney
7d4053a93e Use redux selectors in Dashboard Leave modal (#55179) 2025-04-28 14:55:07 +00:00
Nicolò Pretto
be5453c13c fix: wrong syntax on if was making 'cross-version-for-breaking-changes' always run (#57339)
* fix: wrong syntax on `if:` was making 'cross-version-for-breaking-changes'
always run

* Update .github/workflows/embedding-sdk.yml

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

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-04-28 16:38:09 +02:00
Romeo Van Snick
f1a4c76719 Remove field parsing hack (#57286)
* Rename OPERATORS in tokenizer to FIELD_PUNCTUATORS to avoid confusion with expression operators

* Rename Reference to Field in tokenizer for consistency

* Allow specifying the string delimiter to unquote

* Reduce state in tokenizer

* Allow the tokenizer to parse field tokens that are missing an opening bracket

* Add more comments and rename variable for clarity

* Implement proper escaping in field tokenizer

* Remove duplicate OPEN_BRACKET from punctuators

* Simplify lexifier now that tokenizer returns the correct token for fields

* Reorder loop to reduce duplication

* Simplify lexifier now that tokenizer returns the correct token for fields

* Add unit tests for unquoting with specific character

* Make invalid token error message more precise

* Punctuation

* Typo

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

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-04-28 16:31:56 +02:00
Romeo Van Snick
976ba29134 Add custom error message for zero-arg functions (#57332) 2025-04-28 15:45:25 +02:00
Chris Truter
9ded97a09c Fix bad choice of truthy value
Not valid for all databases.
2025-04-28 15:39:57 +02:00
Chris Truter
ff4112a40e Prune old undo history (#57335) 2025-04-28 15:09:15 +02:00
Kamil Mielnik
9044b07a76 SEM-218 Offer to update the log configuration from the admin panel (#57022)
* Add endpoints to allow admins to override log levels at runtime

Fixes SEM-219

* Add types and RTK query mappings for logger endpoints

* Add a TODO

* Add isErrorWithMessage and isErrorWithMessageResponse guards

* Add

* Add readOnly prop to CodeBlock

* Add duration inputs

* Stop returning undo-task and document return value shapes

* Add delete endpoint, return nothing when adjusting

* Make sure empty adjustments are idempotent

* Fix API documentation

* Add preset dropdown

* Add preset menu

* Update icon

* Use new reset endpoint, update API paths

* Extract DurationInput

* Extract PresetPicker

* Update preset name

* Update menu width

* Translate

* Make CodeBlock fill its parent

* Improve error handling

* Extract utils

* Hide nanoseconds

* Move code

* Simplify code

* Format code

* Extract CodeEditor

* Remove CodeBlock

* Update comment

* Rename

* Add logger mocks

* Add LogLevelsModal unit tests boilerplate

* Fix closing, scrolling, and add info icon

* Add tests

* Lint

* Revert "Lint"

This reverts commit b8339873c2.

* Hide options microseconds and milliseconds

* Fix circular import

* Add missing import

* Fix tests

* Rename TimeUnit to LoggerDurationUnit

* Use NumberInput

* Use existing getResponseErrorMessage

* Use utils from metabase/forms

---------

Co-authored-by: Tamás Benkő <tamas@metabase.com>
2025-04-28 19:57:14 +07:00
Romeo Van Snick
135f97a0df Make CumulativeCount a window function and Sum an aggregation (#57323) 2025-04-28 14:28:43 +02:00
Nemanja Glumac
decbc2e2a2 Introduce Metabase branding to PDF exports (#57266)
Resolves PRG-1 by introducing the branding content to the dashboard PDF exports
Resolves PRG-7 by making the branding content clickable

Additionally resolves PRG-14
2025-04-28 14:20:47 +02:00
Ngoc Khuat
25148746d1 notification with single row event (#57237)
* better template for each event type (#57246)

* eval notification condition using raw event info (#57238)

* simplified payload and it matches the desired output onw (#57330)
2025-04-28 19:06:52 +07:00
Chris Truter
2dca593474 Delete orphaned undo history 2025-04-28 14:05:39 +02:00
github-automation-metabase
fddd39230b Bump cider/cider-nrepl from 0.54.0 to 0.55.4 (#57312)
Inspect dependency changes here: https://github.com/clojure-emacs/cider-nrepl/blob/v0.55.4/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-04-28 10:33:40 +00:00
Chris Truter
682fa130c7 Use two queries, because mysql (#57329) 2025-04-28 12:21:20 +02:00
Ngoc Khuat
c28b50e49e alias for running workflow test 2025-04-28 16:17:21 +07:00
Oisin Coveney
448bdd0569 TS Conversion: DashboardData (#57074) 2025-04-28 10:10:14 +01:00
Ngoc Khuat
4f852f2d17 no selecting user in as-admin (#57324) 2025-04-28 16:04:12 +07:00
Chris Truter
5e0fe4bec5 Revert test helper tweak 2025-04-28 09:55:41 +02:00
Chris Truter
53dd4236bd Merge branch 'master' into merge-master-internal-tools 2025-04-28 08:59:27 +02:00
Mahatthana (Kelvin) Nomsawadi
ac02214b9c Prevent path-to-regexp from breaking when a libary require v6+ (#57242) 2025-04-28 06:44:49 +01:00
Oleksandr Yakushev
ebaaae8bec [dashboard-templates] Use more efficent every? implementation (#56948) 2025-04-28 01:28:41 +03:00
Filip Hric
b8da46c9d8 ci: run changed e2e specs only when only e2e specs changed (#55319)
* run e2e tests only when e2e tests are changed

* sparse checkout

* revert skip build logic

* fix path

* fix path

* add logging

* fix pattern

* fix pattern again

* add tests and cleanup

* cleanup

* handle flaky group

* Revert "handle flaky group"

This reverts commit cd4f996669.

* pass multiple specs

* simplify patten handling

* logs

* play with checkout

* again

* wip

* wip

* if there are other files than e2e, run all tests

* run flaky group only when specs not passed

* optimize flaky group

* make it string

* temp disable build

* temp disable build

* one more time

* more logs

* logs

* arrrgh

* please work

* now?

* step by step

* revert flaky dependency on build

* tests

* oh

* oh 2

* oh 3

* address review

* fix paths

* fix paths

* fix paths

* fix paths

* fix paths

* fix paths

* add wildcard

* fix paths

* fix paths

---------

Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-04-27 15:06:58 +03:00
Sloan Sparger
38b3b0f2fc [Admin] Migrate people pages + components to TS (#57207)
* convert UnsubscribeUserModal and UnsubscribeUserForm components

* convert UserActivationModal to TS

* convert UserPasswordResetModal to TS

* convert UserSuccessModal to TS

* convert PeopleList and PeopleListingApp components to TS

* convert PeopleListRow to TS

* convert use-people-query to TS

* fix deprecated usages of google_auth and ldap_auth with sso_source field

* fix lint
2025-04-25 22:29:22 +00:00
Eric Normand
67ef0e3962 Float tier 2 integration (#56982)
* float() tests + tier 1 (postgres)

* Add more parsing test.

* Better float comparison

* Add expression/float feature

* Add float function to config

* Add float help text

* Add e2e test for float()

* Add `:expressions/float` to list of feature flags

* Only allow casting text to float (not number)

* Better test message

* Refactor for nicer code

* `float()` for snowflake (#56927)

* Implement float() for snowflake

Also add text and date feature keys because somehow they were left off.

* Don't use Long/MAX_VALUE in tests because it breaks some dbs.

* Fix copy-paste error

* kick ci

* Implement float() for mysql (#56919)

Also, add :expressions/date and :expressions/text features that were missing somehow.

* Cast and split custom expression functions for Clickhouse (#56924)

* Implement integer() for clickhouse

ClickHouse is recently tier 2!

* Implement float() for clickhouse

* Implement text() for clickhouse

* Add date() to clickhouse

* Implement splitPart() for clickhouse

* Cast to Date32 after parsing date

* Use a nullable type

* Use nullable types for casts

* Try parseDateTime instead to avoid null

* Use case sensitive function names

* Fix argument order of splitByString()

* Don't use Long/MAX_VALUE in Clickhouse

* Clickhouse needs a lot of type hints!

* Cast position to int

* Better tests for split part

* Negative indexes should return empty string

* kick ci

* Convert index to long (for ClickHouse)

* `float()` implementation for BigQuery (#56920)

* Add float() support for bigquery.

Also add features for date and text that mistakenly got left out.

* Correct argument order for parse_date

* Refactor ->float

* Remove cast-float implementations

* Reinstate Clickhouses' cast to float function.

* Remove specialized :float functions for sql drivers

Replace them with a single :sql implementation

* kick ci

* More refactoring to get rid of questionable recursion

* Fix three tests

* Add null case for literal ->float compilation

* Add type info

* Revert making typed? public (don't need it no more)

* Revert converting multimethod ->float to defn

Also, use a new function called `coerce-float` that does the work.

* Try clickhouse using cast() instead of toFloat64()

* Revert presto jdbc ->float implementation

* Use keyword type name for float-dbtype

* Revert removing ->float method from bigquery clickhouse and starburst

* Add `float-dbtype`, `cast-float`, and `:expressions/float` to changelog

* Remove cast-float multimethod and redundant ->float methods

* REmove mt/dataset test-data from split-part tests.

Is it really necessary?

* Revert qpt changes

* Properly handle NULL in clickhouse cast to float

* Fix presto and starburst

With an improved safe-denominator function

* Change to double as default sql type for casting

* Fix test for casting to double

* Use ->float instead of coerce-float for coercion

* Use DOUBLE PRECISION for Vertica driver

* Use BINARY_DOUBLE for oracle

* Use float for sqlserver

---------

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-04-25 17:00:36 -05:00
github-actions[bot]
c3c706604d Update translations 2025-04-22 (#57002)
* Update translation sources 2025-04-22

* Update translations

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-04-25 14:45:47 -06:00
Nemanja Glumac
a19342a4ce Add clarity to the subscription filter tooltip copy (#57299)
Resolves PRG-15

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-04-25 20:27:32 +00:00
John Swanson
93b36bddbe Add permissions_group.magic_group_type (#56881)
and use it as the source of truth for whether a group is the "All Users"
or "Administrators" group, instead of just the name.

This is a unique field, but it's nullable. H2, MariaDB, MySQL, and
Postgres all treat `null` values as unequal, so it's fine to have many
permissions groups without a `magic_group_type`, but any row *with* a
`magic_group_type` must be distinct from the others. In other words, we
can have lots of non-magic groups and exactly one magic group of each
type.

For now, we'll just have the same Administrators and All Users groups
and the names won't change. At some point, when tenants are enabled,
we'll want to rename "All Users" to "All Internal Users" and create a
separate "All External Users" group.
2025-04-25 12:36:40 -07:00
Braden Shepherdson
407172b445 [refs] Don't backfill :result_metadata on read; strip idents instead (#57273)
Fixes QUE-989, QUE-905.

Stop backfilling idents in `result_metadata` on reading cards. That's costly and recursive, and was the source
of the perf issues on stats.

We're planning instead to support optional, best-effort idents for a longer period, and let the background job do
the work.
2025-04-25 19:34:27 +00:00
Alex Yarosh
a7a413a1dc docs: add casting section to list of custom expressions (#56689)
* add casting section

* Update docs/questions/query-builder/expressions-list.md

* Revert "add casting section"

* Update docs/questions/query-builder/expressions-list.md

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

* Apply suggestions from code review

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-04-25 18:39:42 +00:00
Anton Kulyk
d103f4b875 Close table header popover on second click (#57282)
* Un-skip and update repro test

* Close table header popover on subsequent click
2025-04-25 19:01:50 +01:00
Nathan Voxland
cbae9e265c Renamed /api/ee/gsheets/folder to /api/ee/gsheets/connection (#57239) 2025-04-25 12:59:15 -05:00
Braden Shepherdson
ea655a010d [refs] Fix annotate so model idents are only applied to source columns (#57274)
Fixes QUE-904.

With (1) a fresh column like an aggregation, and (2) when the source was a model:
`annotate` was wrapping the column's ident as if it came from the source model, but that's incorrect.

This adjusts the order of operations so that only columns inherited from the source get their idents
wrapped with the source model.
2025-04-25 17:23:08 +00:00
Adithya Vardhan
9b87335e1b fix: increase flex basis to avoid wrapping in bigger screens (#56733) 2025-04-25 18:02:03 +01:00
bryan
d1a2dce450 Use mage for clj-kondo and cljfmt in GitHub Actions workflow (#57229) 2025-04-25 10:53:46 -06:00
Tyler Plude
8a42850c4f Improve Table Static Viz Text Wrapping Column Widths (#56991)
* Updating text wrap and minibar logic to gracefully handle structure of column widths; updated fallback column width when no width is present in viz settings

* removing inline defs
2025-04-25 09:48:09 -07:00
Alexander Solovyov
cd07ef0afa uberjar.yml should upload my containers (#57270) 2025-04-25 10:43:28 -06:00
Nick Fitzpatrick
e85940a30c Keyboard Shortcut Polish (#57212)
* updating shortcuts, adding shortcut in profile menu, add hotkeys to close shortcut modal and sidesheets

* updating tests

* no one will know

* updating to use mantine hooks
2025-04-25 21:38:44 +05:30
Riley Thompson
0b9e27d15a Enable query caching in flaky test (#57226) 2025-04-25 11:55:49 -04:00
bryan
b3cce298ba Enable equals-true Kondo linter and teach Claude about Clojure (#56573)
* teach claude how to write backend code

* Add solid instructions for calling into the repl

* teach it how to behave when there's no repl

* remove mcp stuff for now

* add lint pr quick command

* fix: Add missing docstrings in mage/be_dev.clj

Added docstrings to parse-int, nrepl-port, and nrepl-eval functions to fix clj-kondo linting warnings.

* flesh out Lint PR quick command

* feat: enable equals-true Kondo linter and fix warnings

This change enables the `:equals-true` warning in the clj-kondo linter configuration,
which identifies code patterns where `(= true x)` is used instead of the more idiomatic
`(true? x)` form in Clojure.

Key changes:
- Enable `:equals-true` linter with warning level in .clj-kondo/config.edn
- Fix all instances of `(= true x)` throughout the codebase, replacing with `(true? x)`
- Add a new utility to check balanced parentheses in Clojure forms
- Add a new mage command `-balance-parens-check` to validate balanced parentheses
- Update CLAUDE.md with documentation about the balanced parentheses utility

This change improves code quality by promoting idiomatic Clojure usage and adds
a helpful tool for ensuring proper Clojure syntax when editing code.

* fix: update code to resolve equals-true Kondo linter warnings

This commit addresses the newly enabled equals-true linter warnings by:
- Adding #_{:clj-kondo/ignore [:equals-true]} to are forms that legitimately need to test both true/false values
- Replacing (= true x) with (true? x) and (= false x) with (false? x) in test assertions where appropriate

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

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

* fix more, refine claude instructions

* fix more = true -> true? linter errors automatically

* fix remaining (= true x) -> (true? x) linter warnings by adding clj-kondo ignores

We need the ignores for 'are' macro clj-kondo tests where (= expected (fn x)) is the idiomatic pattern.

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

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

* move the linter to the things-we-use section

* update claude.md from github copliot's review

* balanced-parens? -> is-readable-code?

- Returns explicit errors, usually with line numbers.

* update claude.md (mostly formatting)

* Fix kondo-updated when there are no matching files

* Update CLAUDE.md to replace -balance-parens-check with -code-is-readable

* Refactor mage -eval to mage -repl with improved usability and reliability

The implementation uses eval and read-string strategically to control when and where code is evaluated:

1. The code from the command line must first be transported as a string to the running REPL server
2. read-string allows parsing the code without executing it
3. eval then executes the code in the correct namespace context
4. This creates a "REPL inside a REPL" where namespace switching and evaluation happen in a controlled environment
5. This approach prevents premature evaluation and ensures code runs in the intended scope

* -check-readable task naming

* cleanup -check-readable

* fix output + fix user.clj

* shuffle code around

* Update CLAUDE.md

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-04-25 15:55:31 +00:00
bryan
446c01c5f8 fix stack traces + task! (#57160) 2025-04-25 15:39:53 +00:00
Kamil Mielnik
9ff33ca64f Fix - Cannot schedule automatic value scanning for postgres database (#57256)
* Fix #57198

* Use proper setter

* Repro #57198
2025-04-25 15:26:19 +00:00
Chris Truter
2e826dd116 Case of inconsistent case (#57272) 2025-04-25 17:11:30 +02:00
Alexander Polyankin
42065b3426 Add parameter default options in subscriptions (#57188) 2025-04-25 11:02:29 -04:00
John Swanson
6ca51d16a1 Hide Schemas for dest DBs (#56853)
Is this the only schema filter? Kind of confused that it's
postgres-specific...
2025-04-25 08:00:15 -07:00
Sloan Sparger
8ad62ccfd5 Sticky footer for database connection modal (#56997) 2025-04-25 09:55:29 -05:00
Chris Truter
a4cb42aed3 Undo logic out of API (#57191) 2025-04-25 16:50:02 +02:00
Ryan Laurie
793e17b386 Fix inefficient regex (#57218)
* Update dom.unit.spec.js

* Update dom.js

* add more tests

---------

Co-authored-by: mmmsssttt404 <931121963@qq.com>
2025-04-25 08:39:27 -06:00
Jeff Bruemmer
5d669bbc5d docs - env var update (#57260)
* update env vars

* update api

* config template
2025-04-25 09:55:07 -04:00
Alexander Solovyov
66cc680762 fix flakey check for duration (#57254)
also hunting for that cache test flake
2025-04-25 13:49:00 +00:00
Sébastien
34a054d0e0 Closes VIZ-332 no more dupes in y-axis ticks (#56910)
* closes VIZ-332 no more dupes in y- ticks

* copy

* lint
2025-04-25 14:00:17 +02:00
Alexander Solovyov
7a7d8fedb7 Merge remote-tracking branch 'origin/master' into internal-tools 2025-04-25 13:39:45 +03:00
Romeo Van Snick
6c366b8e71 Clean up resolver (#56962)
* Use Resolver type from resolver module

* Move getKindForType to resolver

* Inline compileDimension

* Simplify resolver and make data flow requirements more obvious

* Avoid fetching unused dimensions

* Cache metadata displayInfo while resolving

* Move compiler-based resolver tests to compiler

* Rename variables to be more generic

* Refactor resolver

* Merge ExpressionType and MBQLClauseReturnType

* Add tests for resolver

* Be more precise in the resolver error messages

* Be more specific about expected field type in errors

* Add tests for unknown dimensions

* Rename any_ to any

* Add tests for mixed case matching

* Allow matching column names case-insensitively

* Replace ResolveError with CompilerError in resolver

* Use expressionMode in tests

* Fix types

* Remove cast in test

* Add more comments

* Add e2e tests for field matching

* Fix lint

* Rename Field to column in resolver error messages

* Remove TODO's and replace them with comments

* Fix error message in e2e test
2025-04-25 12:30:53 +02:00
Stas Gavrylov
ed937d1266 Fix ttag eslint issues (#57249) 2025-04-25 13:15:51 +03:00
Phoomparin Mano
6b427efbfc fix(sdk): clicking on "and X more" in chart legend throws error (#57175) 2025-04-25 17:07:57 +07:00
Dan Stone
d57f4df6de Row action execution API (#57187)
* Fix formatting

* Add a new endpoint for executing actions as row actions

Allows the caller to provide a subset of the parameters expected by the
action.

Assumes parameters provided by the row share a name with the action
parameter, though user supplied parameters will be preferred.
2025-04-25 10:55:42 +01:00
Alexander Solovyov
5aa96c0e88 Merge branch 'master' into internal-tools 2025-04-25 12:35:40 +03:00
Alexander Solovyov
d2a3ef856a fix flakey identity-hash tests everywhere (#57245) 2025-04-25 09:29:45 +00:00
Romeo Van Snick
2c8a5bd7ef Add check to prevent double comma's in the custom expression editor (#57199)
* Add check to prevent double comma's

* Rename checkDoubleComma to checkDoubleCommas
2025-04-25 11:04:24 +02:00
Timofey Kachalov
92506a847b docs(sdk): Add generation of embeddable .md tables for Embedding SDK components (#56990) 2025-04-25 12:51:21 +04:00
Nemanja Glumac
4b33f7157e Introduce Metabase branding to PNG downloads (#57088)
Resolves PRG-2

This commit adds Metabase branding to the PNG downloads 
for instances that **do not** have the whitelabel feature flag.

Even though it is possible to download the dark mode PNG, 
this commit does not fully resolve PRG-6 because it doesn't 
turn the text white.
2025-04-25 10:07:19 +02:00
Romeo Van Snick
bf2d148954 Fix expression diagnostic for mismatched siblings (#57170)
* Check all mismatched sibling tokens, not just missing comma's

* Rename siblings check to checkMismatchedSiblings

* Merge imports

* Also catch call expressions
2025-04-25 09:50:57 +02:00
Romeo Van Snick
0ea88ad4d5 Add min-width to popover (#57181)
* Add minimum width to description popover

* Add repro for metabase#57132
2025-04-25 09:50:37 +02:00
Ngoc Khuat
e0a4702041 kondo and cljfmt 2025-04-25 14:37:15 +07:00
Ngoc Khuat
1822d3485a test fixes 2025-04-25 14:13:07 +07:00
Ngoc Khuat
39dd7c9c5b Merge branch 'master' into internal-tools 2025-04-25 14:10:49 +07:00
Ngoc Khuat
8544c33213 Fix send once alerts repeatedly sending (#57164) 2025-04-25 02:38:39 +00:00
William
47da0a3d1e Drills use column data from lib/returned-columns (#56894)
result_metadata for a query on a model returns the underlying columns, not the model's columns.  This was causing
drills to break in certain circumstances, because the query processor was trying to cast a particular value twice.
Making drills default to using the column from lib/returned-columns fixes the issue.
2025-04-24 22:45:32 +00:00
bryan
da77b1cc6c Doc update detection (#56330) 2025-04-24 22:03:49 +00:00
Uladzimir Havenchyk
bce438f8b0 test: await for data in temporal unit spec (#57178) 2025-04-24 21:48:29 +00:00
bryan
85f05af834 lint migrations file from babashka (#56611) 2025-04-24 21:37:52 +00:00
Sloan Sparger
3ccadd4160 [DB Routing] Callout db routing enabled on permissions page (#57070)
* callout db routing enabled on permissions pages

* add e2e tests
2025-04-24 15:55:40 -05:00
Sloan Sparger
f396378f43 [DB Routing] Polish db routing (#56901)
* update copy w/ description, update db routing docs link, impl prefill for new destination dbs, fix bug where editing db details would not let you tab through the form

* fixes

* make no user attributes error message link to people page, db routing section expanded by default if feature enabled

* pull out fix for edit db form not being tab-able

* fix failing tests

* copy feedback
2025-04-24 15:55:23 -05:00
Noah Moss
546a40bb49 Change wording for default view map button (#57211) 2025-04-24 16:53:21 -04:00
Nick Fitzpatrick
5638ee1c81 Updating entity-id cards in sidesheets (#57052)
* updating entity cards

* adjusting unit test

* PR feedback
2025-04-25 01:36:01 +05:30
Sloan Sparger
e17f0eb452 Make edit db form tab-able (#56902) 2025-04-24 20:05:15 +00:00
dpsutton
93bd0995b9 More robust checking for timeout exceptions (#56737)
* wip

* More robust checking for timeout exceptions

Overview:
We enumerate items in the database and then we want to see which ones
the user can actually run queries against. To do this we run a query
like `select false from TABLE where 1 != 1 limit 0`. The hope is that
the query analyzer realizes it only needs to do permission checks and
doesn't try to satisfy these conditions (either because limit says no
rows, or 1 != 1 is easily proven to filter all rows). So we _usually_
get very quick feedback if we can select from the table or not.

Snowflake seems to not do this on views. If a view takes a long time to
query, snowflake seems to take a long time to query. The original fix
was to add a 15 second timeout to the query. The expectation here is
that Snowflake can quickly fail if there are no permissions for the
table or view, but might take a long time to run the probe query. But we
can interpret a timeout as a successful permission check.

The original way we checked for timeouts was a very naive check for
`java.sql.SQLTimeoutException`. It seems basically no one uses this when
you do:

```clojure
(with-open [stmt (...)]
  (doto stmt
    (.setQueryTimeout 15)
    (.execute)))
```

For instance, here's some logs from Snowflake:

```
WARN net.snowflake.client.core.StmtUtil Cancelling query 0e8987ee-2d22-40f9-b30d-0129d38ce976 with reason TIMEOUT
INFO metabase.driver.sql-jdbc.sync.describe-database <schema>:<table-name>: Assuming no SELECT privileges: caught exception,net.snowflake.client.jdbc.SnowflakeSQLException: SQL execution canceled,	at ...
```

Note It's a regular `net.snowflake.client.jdbc.SnowflakeSQLException`.
Here's a true permissions failure for comparison:

```
sync.describe-database <schema>:<table>: Assuming no SELECT privileges: caught exception,net.snowflake.client.jdbc.SnowflakeSQLException: SQL compilation error:,Failure during expansion of view 'SOME_VIEW': SQL compilation error:,Object 'DB.SCHEMA.TABLE' does not exist or not authorized.,
```

So we use some regex checks against the messages to try to detect when
we have a permissions failure (cannot select) vs a timeout of the
probe (presumably can select).

And a reminder of the balances here: it's better to show someone a table
that they get an error if they try to query than to hide a table that
they can query. So this change should bias towards reporting can-select
in cases where it might not be clear.

* Only run tests when classes are present

if you don't have :drivers on classpath it would fail

* ensure boolean is returned

tests assert false? on a nil

* CI fails based on the indentation of comments

* empty commit for CI

* Move postgres test into postgres test namespace

* Replace ex-msg matching with sqlerrorcode/sqlstate

Use jdbc error codes and sql state matching to figure out if a
SQLException is caused by user action canceling the request (essentially
how setQueryTimeout works). This adds a multimethod dispatching off the
driver keyword to match up either the SQLState code or the SQLErrorCode
with the appropriate value for a given database driver. Some of these
were found by looking how QueryTimeoutException is implemented in
Hibernate and others were found from JDBC driver source code or documentation.

* fixup! handle multiple codes for mariadb

* fixup! add partial query timeout test

* fixup! split apart sql timeout tests

* fixup! use correct sqlstate for snowflake timeout

* fixup! remove split out tests

* fixup! remove when-class

* fixup! snowflake sql state

* fixup! move query-canceled? into driver code

Removes the jdbc-exceptions namespace and instead makes query-canceled a
driver multimethod that extracts and dispatches on the SQLException
class within the sql-jdbc driver.

Non-jdbc drivers can implement this method, but it is only used for
handling errors in the cluster lock using the appdb and for the sql-jdbc
describe-database sync task.

Co-Authored-By: Nathan Voxland <nathan@metabase.com>

* fixup! update driver changelog add default method

* fixup! merge mysql/mariadb methods

* fixup! add added metadata

* fixup! make test throw instead of is false

---------

Co-authored-by: Edward Paget <ed.paget@gmail.com>
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-04-24 20:01:52 +00:00
Case Nelson
0df7a6a8d4 fix: improve database status metric (#56469)
* fix: improve database status metric

* Format line better

* Fix tests and kondo

* Remove unhealthy counter too
2025-04-24 14:00:46 -06:00
Nick Fitzpatrick
9daf822736 add patch to kbar for tinykeys update (#57116) 2025-04-25 01:11:47 +05:30
Aleksandr Lesnenko
fe3085dc88 remove react 19 as a limitation (#57158) 2025-04-24 14:55:20 -04:00
Braden Shepherdson
163269fda0 [refs] Turn bad :idents in result_metadata into a warning (#57189)
There are at least two cases right now where the idents are bad or
missing that need debugging, but throwing errors is breaking things.
2025-04-24 17:44:15 +00:00
Case Nelson
052474813d fix: snowflake rsa doesn't work with hostname (#57157)
* fix: snowflake rsa doesn't work with hostname

* update account if present
2025-04-24 11:37:28 -06:00
Nicolò Pretto
8e8314cc7e ci: make cross versions tests run only if the pr is against a release (#57197)
branch
2025-04-24 18:23:22 +02:00
Case Nelson
6552bcd10f fix: snowflake key fails when editing unrelated details (#57156)
* fix: snowflake key fails when editing unrelated details

* Fix test comment

* Compare byte arrays
2025-04-24 10:07:04 -06:00
Konstantin Darutkin
870435eba0 refactor: column config for editable tables (#57179)
* refactor: column config for editable tables

* fix: review issues
2025-04-24 16:56:00 +01:00
Ryan Laurie
3fa1acbdcf prevent non-admins from calling admin-only gsheets endpoints (#57186) 2025-04-24 09:23:51 -06:00
Alexander Polyankin
30e0b718f4 PoC for using dataset columns with MBQL lib type checking functions (#57140) 2025-04-24 10:40:45 -04:00
Chris Truter
b4b29dcc19 Publish row modified events for all actions (#57036) 2025-04-24 16:40:02 +02:00
John Swanson
f152b8e5c3 Fix two bugs in DB Routing (#56931)
* Fix deleting a DB with database routing on

* Fix database sync with a user attribute set

When an admin has the relevant user attribute set and tries to sync the
database schema, we use `(with-database-routing-off ...)` to explicitly
turn off database routing for the purposes of sync. However, there are
two problems here:

First, this is just informational for the purposes of error checking, it
didn't actually turn off database routing, it just made us throw an
exception if a driver touched a mirror database (in dev).

Second, during query processing, when we're actually doing the database
routing "swap" to replace the router with the mirror DB, we were doing
`with-database-routing-on`. This essentially means that if you do

```
(with-db-routing-off
 (qp/process-query query rff))
```

you *don't* actually turn off DB routing. 🤦

Both underlying issues get fixed by the same change: if database-routing
is OFF, don't DO any database routing in the QP middleware. This seems
more reasonable to me anyway.

* CR resp
2025-04-24 07:22:59 -07:00
Nicolò Pretto
24debc3158 add ttag/no-module-declaration rule (#56848)
* add ttag/no-module-declaration rule + eslint ignore comments

* change the reference to github issue instead of linear

* add new ignores after rebase

* remove formatting changes from eslint files

* fix eslint rule mising from a file

* convert one field to getter as that got added after I opened the codemod
pr and it's failing the check here

* more //eslint-disable-next-line
2025-04-24 15:50:46 +02:00
lbrdnk
5242b6d15e Fix sync for 66K tables db (#57066)
* Fix 66k statement params in sync-table-privileges and sync-fks

* Test for privileges

* Test privileges

* Update and test set-initial-table-sync-complete-for-db!
2025-04-24 14:04:05 +02:00
Nicolò Pretto
28c0e9458d ci: remove ready_for_review as trigger type (#57134) 2025-04-24 13:07:35 +02:00
Timofey Kachalov
e9fb8e782f Temporarily disable Shoppy sample app tests (#57167) 2025-04-24 13:58:24 +04:00
Phoomparin Mano
dd76006c42 fix(sdk): use background color in sankey chart text outline (#57135)
* use bg-white instead of white

* add visual test

* fixed storybook stories

* add loki snapshot
2025-04-24 16:39:37 +07:00
Stas Gavrylov
c69b53babd WRK-258: Expose default template for notifications (#57031)
* WRK-258: Expose default templates to the UI

* WRK-258: Address UI feedback

* WRK-295: Add confirmation before closing alerts modal with changes
2025-04-24 11:48:12 +03:00
Ngoc Khuat
4453313745 Template preview API (#56971) 2025-04-24 15:07:47 +07:00
appleby
c96816b0fc Move :expression-literals aggregation tests into expressions_test.clj (#57144)
* Move :expression-literals aggregation tests into expressions_test.clj

These tests all use :basic-aggregations not :expression-aggregations, so move them into expressions_test.clj to
consolidate the :expression-literals tests in one place.

* Add clause with top-level boolean literal in case-with-literal-expression-test
2025-04-23 15:38:39 -07:00
Alexander Polyankin
3e8400f143 Check for axis type instead of Category (#57128)
* Check for axis type

* Check for axis type
2025-04-23 18:35:23 -04:00
Luiz Arakaki
8b1d0548b1 only track database routing as enabled if there is at least one routing db (#57117) 2025-04-23 20:51:02 +00:00
Luiz Arakaki
adb4c4a5de rename starburst to startburst (trino) to help customers understand that starburst is trino compatible (#56891) 2025-04-23 16:48:58 -03:00
Noah Moss
4f9ced2fda Share pivot export code between XSLX/CSV instead of using native Excel pivots (#56622)
* Prototype sharing CSV pivot export code with Excel instead of Excel native pivots

* Cleanup some code, fix reflection warnings

* clean ns

* halfway to getting native excel formatting working

* native formatting working, but no auto-sizing

* fix up formatting, get auto-sizing working (+ refactor)

* Fix BE tests

* remove an old test case no longer needed

* lint

* remove final broken tests which is no longer needed

* lint, and clean up/refactor CSV code a bit

* clean up/refactor XLSX code

* remove debug symbol

* fix whitespace

* address feedback
2025-04-23 15:22:34 -04:00
Edward Paget
163528e95c fix: test flake in jetty stats (#57141) 2025-04-23 18:26:02 +00:00
Uladzimir Havenchyk
8f62a989d7 ci: run linting when e2e specs are changed (#57118)
* ci: run linting when e2e specs are changed

* fixup
2025-04-23 17:51:31 +00:00
Renaud Joly
d56e0511d2 Documentation: fix typo in funnel link (#56761) 2025-04-23 13:01:58 -04:00
github-automation-metabase
ea566a0a2e Bump io.github.weavejester/cljfmt from c87493e54bdc30c104d75b95ce2a2ce5e7403430 to 7de286008766127128a156275b9add3bf443d7e5 (#56655)
Inspect dependency changes here: c87493e54b...7de2860087

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-04-23 09:59:21 -07:00
Edward Paget
f7a66b2fac fix: request max time stat reports seconds (#57121)
Forgot to divide millis by 1000 before saving so this stat was reporting
some silly numbers on stats. Also adds tests around this metric
2025-04-23 16:36:26 +00:00
Alexander Polyankin
1fcabbe944 Replace Category with has_field_values check when computing columns compatible with a parameter AND enable card sources for numeric parameters (#56825) 2025-04-23 11:53:08 -04:00
Oisin Coveney
af0188ade1 fix(sdk): Ensure that questions don't flicker when fetching entity IDs (#57073) 2025-04-23 15:36:19 +00:00
Jeff Bruemmer
bcc7bd2cda fix link (#57122) 2025-04-23 11:06:44 -04:00
Phoomparin Mano
520c64839c Use viewFooter variant in view footer's download icon (#57105)
* tweak IconButton variants

* remove variant=subtle as it is applied by default
2025-04-23 21:51:15 +07:00
Nathan Voxland
6214e2896a [Sheets] Allow "Sync Now" (#54940)
---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-04-23 09:47:58 -05:00
Nemanja Glumac
2761c8dd36 Revert "Use a deterministic identifier for chart downloads (#57058)" (#57112)
This reverts commit b5363f3a7e.
2025-04-23 16:13:31 +02:00
Ryan Laurie
81058dea6a replace ee-extra release step (#57120) 2025-04-23 08:02:14 -06:00
Uladzimir Havenchyk
447a73372d chore: fix linting issue (#57115) 2025-04-23 13:18:41 +00:00
Romeo Van Snick
2ba02a78dd Clean up diagnostics (#56984)
* Add missing t to error messages

* Pull out lexification from diagnoseSyntaxChecks

* Add hooks to compiler

* Define diagnose and diagnoseAndCompile using compiler hooks

* Add maybe helper to throw the first error

* Use maybe helper to make sure parsing and lexifying throws

* Remove throwOnError argument to parser

* Add error hook

* Use error hook to make lexifier and parser throw

* Pass token and source in object

* Return position information for mismatching parenthesis

* Add length to Token

* Handle unknown string quotes

* Simplify lexifier

* Move malformed number check to diagnostics

* Move malformed string check to diagnostics

* Move malformed field name check to diagnostics

* Move bad token check to diagnostics

* Stop returning errors from lexifier

* Merge nodes when unopened bracket occurs

* Add error helper for diagnostics

* Use error helper for diagnostics

* Remove unused helpers

* Remove unused ParseError

* Remove errors fuzz test

* Add default hooks to parser

* Remove maybe helper

* Split up checks into syntax and expression folders
2025-04-23 15:13:59 +02:00
Romeo Van Snick
e038159085 Rename regexextract to regexExtract (#57013)
* Rename regexextract to regexExtract

* Fix regexExtract examples in docs

* Fix references to regexExtract in tests
2025-04-23 15:13:46 +02:00
Konstantin Darutkin
8d0a374008 feat(enterprise): add editable table overlay for undo/redo (#57111) 2025-04-23 12:52:10 +01:00
Uladzimir Havenchyk
6bad11bfeb test: move flaky test to jail (#57091) 2025-04-23 11:22:39 +00:00
Konstantin Darutkin
09b8acf6d2 fix: move dashcard undo/redo/add buttons to card header (#57034)
* fix: move dashcard undo/redo/add buttons to card header

* fix: review fixes
2025-04-23 12:11:17 +01:00
Romeo Van Snick
e3e81e4da8 Format zero-arity functions with parens (#56835)
* Format no-argument expression clauses with empty ()

* Suggest no-arg clauses with empty ()

* Remove fallback for non-arg functions in resolver

* Fix unit tests

* Fix e2e test

* Add test for no-arg suggestion completions

* Update examples in docs

* Render parens for no-arg clauses in helptext header

* Make function browser insert parens for no-arg functions

* Do not show help text when a function call is not made

* Add repro for metabase#55300

* Fix function browser e2e test

* Remove unnecessary branch

* Remove fallback for non-arg functions in resolver

* Add () to now in one more location in docs

* Fix unit tests
2025-04-23 09:27:07 +02:00
Noah Moss
587c5e0a6f Exclude nil card IDs for preemptive caching reruns (#57082)
* Exclude nil card IDs for preemptive caching reruns

* Update enterprise/backend/src/metabase_enterprise/task/cache.clj

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

---------

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-04-23 02:59:54 +00:00
Noah Moss
632777c91a Fix inaccurate row collapsing for pivot exports (#56998)
* fix for inaccurate collapsed rows in export

* add unit tests

* fix test

* lint

* edit docstring, skip roundtripping on cljs

* address feedback
2025-04-22 22:47:55 -04:00
Alexander Polyankin
436c0804fa Fix click behavior reset (#57053) 2025-04-22 23:35:57 +00:00
Fraser
1bb8bd14fe Add development-mode setting and banner (#56579)
* Add development-mode setting and banner
2025-04-23 10:13:10 +12:00
Riley Thompson
82cde67228 Upgrade ClickHouse JDBC driver to 0.8.4 (#57055)
* upgrade to 0.8.4

* add test

* update clickhouse contributors
2025-04-22 21:40:48 +00:00
Braden Shepherdson
bde4df5206 [MBQL lib] Gracefully handle invalid :fields refs in joins (#57078)
Fixes #56434.

A join clause's `:fields` might contain refs to columns that no longer exist on the joined table/card.

Before this change, a malformed column was being passed to `with-join-alias`, causing it to throw.
Now the bad fields are dropped from `returned-columns`, and if they all get dropped then it is treated as `:all`.
2025-04-22 21:13:48 +00:00
Timofey Kachalov
d676b8a2ca Properly handle non-pr context for notify-pull-request action (#57081) 2025-04-23 01:08:08 +04:00
Uladzimir Havenchyk
ed132646b0 ci: use variant for trunk to distinguish tests from matrix (#57069)
* ci: use variant for trunk to distinguish tests from matrix

* group e2e

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-04-23 00:02:42 +03:00
Nemanja Glumac
b5363f3a7e Use a deterministic identifier for chart downloads (#57058)
Resolves PRG-10.

This commit keeps the DOM node that we use for downloads
deterministic, while ensuring that we always target the correct
chart in the dashboard.

The same question can be added to the dashboard multiple times
so the only unique identifier we can use is the dashcard id.

But this brings us to the weird situation that the node we're sending
to the canvas to render before downloading is different when we're
downloading the chart from a dashboard vs when we're downloading
it directly from the question page.

This pseudo DOM code shows what we did before:

Dashboard:
```
dashcard-id <--- we were grabbing this
    visualization-root
        card-id
```

Question:
```
div
    visualization-root
        card-id <-- we were grabbing this
```

Compare that to what we're doing now

Dashboard:
```
dashcard-id
    visualization-root
        card-id <--- we are now grabbing this*
```
* but only when it is under the specific dashcard-id

Question:
```
div
    visualization-root
        card-id <-- we continue grabbing this like before
```
2025-04-22 23:01:57 +02:00
Jeff Bruemmer
5b4ed4413c remove bulk filter modal docs (#57083) 2025-04-22 21:00:41 +00:00
Anton Kostenko
bc4517243c Replace SDK and iframe response status metrics to export non-grouped status codes (#56976)
* Replace SDK and iframe response status  metrics to export non-grouped status codes
2025-04-22 20:55:00 +00:00
appleby
111908b790 Enable :expression-literals for sqlserver and oracle (#56942)
* Fix literal-expressions-inside-nested-and-filtered-aggregations-test

* Use mt/formatted-rows in order-by-integer-literal-expression-test

* Support selecting an empty string literal in select-clause-deduplicate-aliases

For drivers like Oracle that inherit from ::sql.qp.empty-string-is-null/empty-string-is-null, if a user adds an empty
string as a custom literal expression, that literal "" value will get compiled to nil, so ensure that
select-clause-deduplicate-aliases can handle such nil values in the :fields list.

Basically, we want to ensure that a query like

  {:expressions {"empty": [:value ""]},
   :fields      [[:expression "empty"]]
   :limit       1}

gets compiled to

  SELECT NULL [AS] "EMPTY" ...

* Add sql.qp.expression-literals/boolean->comparison abstract driver

This is similar in spirit to the existing sql.qp.empty-string-is-null driver and can be used for drivers like oracle
and sqlserver that require booleans to be converted to comparison expressions in logical operators like :and, :or, and
:not, and in the top-level of a :filter clause.

* Enable :expression-literals for sqlserver

* Enable :expression-literals for oracle

* Review feedback: not -> nil?

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

* Implement ->honeysql :sum-where and :distinct-where in terms of :case for :sql driver

Change the ->honeysql methods for :sum-where and :distinct-where to build an MBQL :case form and compile that, rather
than building a honeysql :case form directly. In this way, drivers that need special handling for :case will get
:sum-where and :distinct-where for free. Note that :count-where was already implemented this way. See, e.g. the
:metabase.driver.sql.query-processor.expression-literals/boolean->comparison abstract driver which converts booleans
in the case conditions to equivalent := expressions.

* Fix typo in test: case clause -> expression

* Rename boolean->comparison abstract driver to boolean-is-comparison

Rename

  ::sql.qp.expression-literals/boolean->comparison to
  ::sql.qp.boolean-is-comparison/boolean-is-comparison

This makes it clear that the namespace should only contain the abstract driver, and is also more consistent with the
existing driver in sql.qp.empty-string-is-null.

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-04-22 13:47:39 -07:00
Edward Paget
e1266af965 fix: use a shared lock for report_card updates (#57040)
the view_count and last_view_at updates of report cards can deadlock
against each other, so introduce a shared keyword they can use to each
take a cluster lock when updating these values to prevent the deadlocks.
2025-04-22 13:11:09 -07:00
Denis Berezin
d3b12475b7 fix e2e tests for internal-tools branch (#57060) 2025-04-22 22:11:51 +03:00
Sébastien
e19c9f9013 closes VIZ-400 dashboard parameters panel background FF (#56906) 2025-04-22 20:12:37 +02:00
metamben
254b87fd5f Add endpoints to allow admins to override log levels at runtime (#56973)
* Add endpoints to allow admins to override log levels at runtime

Fixes SEM-219
2025-04-22 17:37:28 +00:00
lbrdnk
7cdf5d3116 Add schema, table and field to missing database type to base type mapping (#56843)
* Adjust missing base type logging for jdbc drivers

* Adjust base type logging for Athena

* Add schema and table to missing base type logging

* Comments

* Update test

* Drop only preceding nils
2025-04-22 18:40:18 +02:00
Uladzimir Havenchyk
a9c878d2b2 test: sign in as admin for external db (#56963) 2025-04-22 18:23:31 +03:00
Denis Berezin
6dbe326997 Merge branch 'master' into internal-tools
# Conflicts:
#	frontend/src/metabase/notifications/modals/components/NotificationChannelsPicker.tsx
#	frontend/src/metabase/ui/components/icons/Icon/icons/index.ts
2025-04-22 18:01:06 +03:00
Kamil Mielnik
163d5afe2a SEM-111 Support sorting by duration, start and end time (#56791)
* Use Mantine instead of styled components

* Fix centering

* Add task and status params

* Add TaskStatusPicker

* Make picker clearable

* Add task picker

* Put filters and pagination together

* Translate task status

* Break down logic

* Move loading and error state

* Always render something

* Make task picker searchable

* Add empty state to the table

* Fix clear button being transparent

* Add useUrlState

* Use useUrlState in TasksApp

* Move UrlState to its own file

* Sort

* Rename file

* Rename

* Clean invalid query params on mount

* Prettier

* Use Action

* Ignore invalid pages

* Reuse variable

* Fix tests

* Add test

* Add label to clear button

* Remove redundant condition

* Add assertions

* Improve typing

* Be explicit about empty string handling

* Add sorting params to ListTasksRequest

* Add sorting params to url state

* Render icon for the first column

* Add SortableColumnHeader

* Extract TasksTable

* Move use-url-state to its own directory

* Add unit tests for useUrlState

* Add test

* Refactor

* Add more tests

* Fix missing import

* Add task endpoints mocks

* Add TasksApp tests boilerplate

* Add pagination test

* Add tests for filters

* Add more tests

* Tmp

* Make SortColumn generic

* Use SortingOptions

* Remove unused type

* Make BaseItemsTableProps non-generic

* Integrate sortingOptions

* Prevent CLS

* Prevent table content from disappearing on sort or filter

* Improve typing

* Use isLoading

* Get fresh data

* Update comment

* Reset page on sorting change

* Update tests

* Add tests for page reset

* Update tests

* Mark test as flaky

* Reuse SortingOptions

* Extract getFirstParamValue
2025-04-22 22:00:28 +07:00
Dan Stone
7d70c66324 Add GET row-action endpoint to be able to present an appropriate modal (#56807)
* Add endpoint that lists parameters that will be required if a row action

For now, if names intersect

* Fetch just what we need

No joins though
2025-04-22 15:43:11 +01:00
Luis Paolini
d92762277c add a note to okta scim (#57032)
Adding the header, which is coming often
2025-04-22 11:21:18 -03:00
github-automation-metabase
6c5c5e409f Bump cheshire/cheshire from 5.13.0 to 6.0.0 (#56950)
Inspect dependency changes here: https://github.com/dakrone/cheshire/blob/6.0.0/ChangeLog.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-04-22 12:54:24 +00:00
Phoomparin Mano
2b3f6833e7 fix(sdk): css variables leak from Mantine to the host app (#56985)
* add tests for mb-wrapper leaks

* revert me - temporarily check diffs

* Revert "revert me - temporarily check diffs"

This reverts commit f474fe7b25.

* only apply mb-wrapper when in the sdk

* use cy.log to show e2e messages

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-04-22 19:08:23 +07:00
Uladzimir Havenchyk
5e9d964237 test: add timeout after dragging tab to avoid flakiness (#57019) 2025-04-22 11:45:46 +00:00
Uladzimir Havenchyk
81c0d0b0fa test: move flaky tests to jail (#56964)
* test: move flaky tests to jail

* two more tests

* one more
2025-04-22 14:21:19 +03:00
Romeo Van Snick
6734dbaa02 Fix metric tests (#56965)
* Allow metrics to show up in tests

* Unskip metric test

* Unskip metric test
2025-04-22 12:55:14 +02:00
Uladzimir Havenchyk
f0b61b8aeb test: make admin test more reliable (#56967) 2025-04-22 13:53:07 +03:00
Luis Paolini
09790c4c6e Remove ed25519 dep (#56940)
Not needed since
https://github.com/apache/mina-sshd/pull/639

Will also remove one security alert due to https://github.com/advisories/GHSA-p53j-g8pw-4w5f
2025-04-22 07:30:26 -03:00
Timofey Kachalov
624a6c53db Adjust CI on exposed internal types from Embedding SDK (#57014) 2025-04-22 14:09:26 +04:00
Romeo Van Snick
d7ae787f0e Remove legacy expression helpers (#56813)
* Remove legacy expression in the return type from compiler

* Move test cases to formatter tests

* Move op and opt helpers to test utils

* Move value helper to test utils

* Rewrite compiler tests to use expression parts

* Remove unused test helpers

* Use actual invalid metadata instead of broken references

* Remove Lib.legacyExpressionForExpressionClause and Lib.expressionClauseForLegacyExpression

* Remove unused mock in fuzz test

* Remove legacy-expression-for-expression-clause and expression-clause-for-legacy-expression helpers

* Merge __support__ and test folders

* Reuse query from shared testing data

* Remove legacy-expression-for-expression-clause and expression-clause-for-legacy-expression tests

* Fix import

* Rename util to utils
2025-04-22 11:45:59 +02:00
Romeo Van Snick
bb5c6874de Remove unused properties in expression compiler (#56993)
* Remove unused parser properties

* Remove custom AssertionError class

* Remove unused WS token

* Remove unused skip property
2025-04-22 11:39:11 +02:00
Romeo Van Snick
0e2edd80e6 Fix infinite loop in native editor (#57012)
* Use _.isEqual to check if ranges are equal

* Add back in reproduction for metabase#53649
2025-04-22 11:38:57 +02:00
Nicolò Pretto
6720fb7987 run codemod to convert t calls on module level to getters when possible (#56793)
* ran the codemod, lets see if it greens out on ci

* manually remove some changes as not-needed or risky

* remove other createEntity
2025-04-22 10:53:35 +02:00
Romeo Van Snick
8df5d81d69 Replace all references of StartRule with Lib.ExpressionMode (#56970) 2025-04-22 10:46:05 +02:00
Chris Truter
16d2514200 Thread effects up from row actions (#56966) 2025-04-22 10:04:13 +02:00
Timofey Kachalov
3a5bde5087 Fail CI on exposed internal types from Embedding SDK (#56958) 2025-04-22 11:25:21 +04:00
Kamil Mielnik
f81d576487 Improve SortColumn typing (#56907)
* Make SortColumn generic

* Use SortingOptions

* Remove unused type

* Make BaseItemsTableProps non-generic
2025-04-22 14:20:08 +07:00
Kamil Mielnik
9a4f9cc59d Fix - Filtering the foreign key dropdown randomly works (#56916)
* Fix #56839

* Repro #56839

* Update log
2025-04-22 14:19:53 +07:00
Ngoc Khuat
08bb9ead73 Revert "Collection operators for notification condition (#56961)" (#57003)
This reverts commit 62dec0bc76.
2025-04-22 13:27:19 +07:00
Ngoc Khuat
5b4e18b303 Fix webhooks don't send notifications (#57001) 2025-04-22 13:24:50 +07:00
Ngoc Khuat
62dec0bc76 Collection operators for notification condition (#56961) 2025-04-22 12:25:46 +07:00
github-automation-metabase
33a444d442 Bump djblue/portal from 0.58.5 to 0.59.0 (#56954)
Inspect dependency changes here: https://github.com/djblue/portal/blob/0.59.0/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-04-21 16:03:46 -07:00
github-automation-metabase
17476b91f5 Bump io.github.weavejester/cljfmt from fc3340da3c8344b3fbb336d190ce696ef40e42d4 to c87493e54bdc30c104d75b95ce2a2ce5e7403430 (#56354)
Inspect dependency changes here: fc3340da3c...c87493e54b

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-04-21 15:59:12 -07:00
Nathan Voxland
38e1e87c87 Dowgraded postgresql driver until liquibase fix is released (#56981) 2025-04-21 15:55:57 -05:00
Eric Normand
cc3f0a5d59 float() tests + tier 1 (postgres) (#56814)
* float() tests + tier 1 (postgres)

* Add more parsing test.

* Better float comparison

* Add expression/float feature

* Add float function to config

* Add float help text

* Add e2e test for float()

* Add `:expressions/float` to list of feature flags

* Only allow casting text to float (not number)

* Better test message

* Refactor for nicer code

---------

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-04-21 20:40:15 +00:00
Romeo Van Snick
61860a1d1a Remove unused expression helpers (#56974)
* Inline only use of isCaseOrIfOperator

* Remove unused matchers

* Rename matchers module to literals

* Rename arguments
2025-04-21 19:26:24 +02:00
Edward Paget
656b31eddb fix: add cluster lock around view count update (#56977)
To avoid deadlocks on postgresql appdbs caused by overlapping ids in the
in clause of these updates.

I also had to change the `call-count` implementation for one of the
tests to spy on t2/query instead. The call-count pipeline middleware
will register either 2 or 4 depending on if we need to insert rows into
the lock table or not.
2025-04-21 12:24:47 -05:00
Aleksandr Lesnenko
e53749f67c Fix column resizing (#56898)
* fix column resizing

* comments

* specs

* change column measurement approach

* repro

* move pagination issue to a separate PR

* fix specs

* fix unit specs

* specs

* unnecessary dependency

* extract a hook and fix failing specs

* adjust to latest master branch updates

* fix types

---------

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-04-21 16:35:00 +00:00
metamben
601217f9f9 Discourage changing jdbc-data-warehouse-unreturned-connection-timeout-seconds (#56749)
Fixes QUE-755

Since killing connections this way is the mechanism we use to terminate long running JDBC driver queries, this timeout
shouldn't differ from the db-query-timeout-minutes setting.
2025-04-21 18:57:48 +03:00
Romeo Van Snick
cb2c515dc6 Allow passing strings to isEmpty and notEmpty (#56855)
* Allow strings to be passed to isEmpty

* Add repro for metabase#55687

* Add be test for is-empty and not-empty

* Use Emptyable var
2025-04-21 17:09:47 +02:00
Edward Paget
0d35a0ac4c fix: broken test after ident change (#56941) 2025-04-21 14:44:01 +00:00
Nathan Voxland
c137105f73 Don't update the "active" index table from the "reindex" job (#56671) 2025-04-21 09:26:53 -05:00
Ngoc Khuat
c638945787 Default template API (#56845) 2025-04-21 18:58:34 +07:00
Stas Gavrylov
44bb373af1 WRK-250: Add autocomplete for handlebars fns and helpers (#56909)
* WRK-250: Add autocomplete for handlebars fns and helpers. Hardcoded

* Fix TableNotificationsListModal tests

* WRK-250: Integrate with BE-provided helpers list for autocomplete

* WRK-250: Add display of doc string for provided helpers

* WRK-250: Revert splitting custom helpers to block and inline
2025-04-21 13:42:33 +03:00
Chris Truter
a40053fda1 Fix bug in events for multi-row creation (#56959) 2025-04-21 10:55:04 +02:00
Chris Truter
965d54cbc5 Rework action composition (#56947) 2025-04-21 10:22:27 +02:00
bryan
d7130ed448 replaces 4 = true.. w/ true? (#56935) 2025-04-18 22:11:10 +00:00
bryan
83941fea48 introduce the no-auto-issue-links label (#56923) 2025-04-18 14:21:55 -07:00
Alex Yarosh
59644bf378 Update field-types.md (#56938) 2025-04-18 21:06:32 +00:00
Gustavo Saiani
508dcaeacc Update links in docs (#56930)
* Update link

* Update links
2025-04-18 15:48:03 -04:00
Chris Truter
6552ffdc69 Fix undo and notifications for tables with an UUID pk (#56922) 2025-04-18 18:26:36 +02:00
Chris Truter
a25be93c6a Fix more test expectations 2025-04-18 17:25:28 +02:00
Timofey Kachalov
3df44a9c5e docs(sdk): Remove remaining internal types from being exposed (#56895) 2025-04-18 16:47:10 +04:00
Konstantin Darutkin
d0c3c9a4ce fix: distinct style for readonly columns and header styling fixes (#56908) 2025-04-18 12:54:14 +01:00
Romeo Van Snick
344b722f49 Merge resolver into compiler (#56647)
* Resolve dimensions while compiling

* Use resolver in pratt compiler instead of resolver pass

* Remove legacy resolver

* Add missing imports

* Add startRule to compiler in test

* Use helper to calculate argtype

* Provide a default implementation of argType

* Return expressionParts from compiler

* Convert resolver tests to use compiler

* Remove superflouous comment

* Convert MAP_TYPE to a function

* Rename field-resolver to resolver

* Simplify resolver check

* Move resolver-related code into resolver module
2025-04-18 13:33:17 +02:00
Chris Truter
df2d0d5061 Use action-agnostic events to trigger table notifications (#56892) 2025-04-18 11:09:46 +02:00
Nick Fitzpatrick
db1aaa49c8 Pinned items moderation status (#56668)
* pinned questions show moderated status, handle their own caption title

* unit tests, description

* fixing grid spacing

* e2e test adjustments

* fix for verified skeletons

* update quetion embed test, dashboard embed test
2025-04-18 10:43:16 +05:30
Alexander Polyankin
fbe7122dc5 Fix pivot metadata (#56786) 2025-04-18 02:02:39 +00:00
Denis Berezin
7ebe65686a WRK-278 sorting in editable table in dashboards improvements (#56857)
* Sorting UX improvements

* self review

* Filters UX improvements

* self review
2025-04-18 01:45:37 +03:00
Ryan Laurie
1e303ea32f Refactor Upload Settings to use RTK + Mantine (#55780)
* Refactor Upload Settings to use RTK + Mantine
2025-04-17 22:38:33 +00:00
Oleksandr Yakushev
7a0bd60c94 [test] Speed up metabase.pulse.send-test tests (#56336)
* perf: Optimize duplicate-model-ids and search/ingestion functions

* [test] Mock javascript-visualization in m.pulse.send-test to speed up tests
2025-04-18 01:30:48 +03:00
Braden Shepherdson
0a4d7039ad [refs] Return :idents in QP annotate; save in :result_metadata (#56244)
Fixes [QUE-701](https://linear.app/metabase/issue/QUE-701), [QUE-778](https://linear.app/metabase/issue/QUE-778),  [QUE-777](https://linear.app/metabase/issue/QUE-777),  [QUE-776](https://linear.app/metabase/issue/QUE-776),  [QUE-703](https://linear.app/metabase/issue/QUE-703),  [QUE-704](https://linear.app/metabase/issue/QUE-704).

### Description

Directly implements `:ident` calculation for legacy MBQL in the QP!

Also changes the spelling of compound idents to eg. `join[JoinClauseIdent]__InnerColumnIdent`, `native[CardEntityId]__COLUMN_NAME`, etc. The advantage of this is that NanoIDs cannot contain `[]`, whereas they do contain `_`s. Then we can make sure there's no missing `entity_id`s (a common issue) by looking for `native[]`. `native____` might have happened by accident is the NanoID started with two underscores.

This is an unfortunately large PR, but I don't think much can be done to help that.
The output of `annotate` becomes `Card.result_metadata`, which is a key **input** to
`annotate`. So we have to tackle legacy metadata end to end to produce a healthy PR.

(A prior attempt to use the lib and match up the results turned into a cluster of hacks,
and required half of these changes anyway, so this direct approach seems more sound.)

Most of this logic lives in the `annotate` post-processing middleware, with
some support from `add-source-metadata` pre-processing.


#### Idents

This generates correct idents for proper fields, expressions,
aggregations, breakouts, explicit and implicit joins, native queries and
models (native and MBQL).

#### Safety checks and Guarantees

Also adds and strengthens several safety checks in the library and
elsewhere. The guarantees I hope we can count on at this point are:
- Cards are saved with correct `:ident`s in their `:result_metadata`.
- Cards with old `:result_metadata` get (correct) `:ident`s added on read.
- Lib can now rely on getting correct idents for all input cards!
- Therefore the lib (BE + FE) can compute the ident for **every column**.

#### Placeholder idents

For native queries, we can only get `result_metadata` from executing them.
The usual flow is:
- Write the query
- Send it as an ad-hoc `/api/dataset` request
- Get back `result_metadata`
- Save it, passing the `result_metadata` back to the BE.

We need a card `entity_id` to create idents for a native query, but an ad-hoc
query doesn't have a card yet! The BE now generates a placeholder `entity_id`,
which gets replaced on save with the new card's actual `entity_id`. These
placeholders contain (1) illegal NanoID characters, and (2) a NanoID, which
means they cannot be mistaken for non-placeholder NanoID, and that they are
still globally unique, so there's no caching concerns.
2025-04-17 20:55:23 +00:00
Romeo Van Snick
66ba50cfea Convert diagnostics to lib (#56646)
* Move diagnostics to separate dir

* Use correct type for startRule arg

* Split up diagnostics into sepearate files per check

* Use throw for checks that don't yet

* Pull out syntax checks into separate function

* Split up lib.diagnoseExpression into helper

* Return expressionParts from compiler

* Add vist helper that walks Lib.ExpressionParts

* Convert check-known-functions to use Lib.ExpressionParts

* Convert check-supported-functions to use Lib.ExpressionParts

* Convert check-comparison-operator-args to use Lib.ExpressionParts

* Convert check-arg-count to use Lib.ExpressionParts

* Convert check-case-or-if-arg-count to use Lib.ExpressionParts

* Convert check-arg-validators to use Lib.ExpressionParts

* Remove legacy visitor

* Also pass expression clause to diagnostics

* Use pMBQL in diagnose-expression

* Stop passing expression to diagnostic checkers

* Rename visit to visitor
2025-04-17 21:53:10 +02:00
Timofey Kachalov
3764616d8c Setup app cleanup for sample-app runner (#56866) 2025-04-17 23:12:10 +04:00
Timofey Kachalov
9bb5e3ec50 feat(sdk): Use public types for Dashboard/Collection/User and other entities (#56875) 2025-04-17 23:11:31 +04:00
Phoomparin Mano
ebcdfddf7e Improve PDF and results download button UI in static embedding (#56541)
* replace the export button in dashboard header

* use the same download button style for both

* add styles for compact download button

* change the compact export button style

* add download button logic

* update data-testid

* update dashboard tests in public-resource-downloads

* use getDashboardCard helper instead

* move question result download to header

* remove PDF export localized test

* add PublicOrEmbeddedDashboardView loki diffs

* use text-primary instead of text-dark for download icons

* simplify downloadAndAssert embed logic

* simplify classnames merging

* revert ExportPdfMenuItem

* cleanup TitleAndDescriptionContainer

* revert LegendCaption

* show the header if headerButtons is not null

* standalone question download results only shows up on card hover

* always show header if there is a header button

* add floating headers when title is hidden

* add comment on floating header buttons

* use accessible label selectors instead of data-testid

* replace question-results-download-button testid with accessible label

* cleanup downloadAndAssert logic

* update tests

* support shared selector

* update unit test for PublicOrEmbeddedDashboardPage.enterprise

* update unit test for PublicOrEmbeddedDashboardPage.premium

* update unit test for PublicOrEmbedded

* update localization tests

* localize aria-label and re-add label tests

* make aria-label "Download as PDF" for all instances

* fix question tests on locale hash params

* fix tests on disabling downloads

* add realHover case to downloadAndAssert

* update testid in LegendDescriptionIcon

* update public-resource-downloads cypress test

* use visibility checks in tests

* restore ellipsis button size

* restore hover parent state to standalone question

* update localization tests that referenced PDF export button

* remove eslint-disable directives

* update ChartSkeleton

* update ChartSkeleton

* lift spacing to LegendCaption

* use lighter colors for dashcard downloads

* add new loki snapshots

* use the auto refresh text for locale tests as pdf export text is gone

* use the lighter color for all download icons

* add new loki snapshots

* update test assertions for locale tests
2025-04-18 00:50:23 +07:00
appleby
3b3d9229a2 Add missing docsPage links to custom expression HELPER_TEXT_STRINGS (#56818) 2025-04-17 10:28:53 -07:00
Tyler Plude
daf6c948e6 Fixing division by zero for minibar columns (#56871) 2025-04-17 10:20:45 -07:00
bryan
eb06aa0d79 use the branch in mage cljfmt-updated <branch> (#56868) 2025-04-17 16:07:01 +00:00
Nicolò Pretto
88a88270be fix(sdk): use instance locale if no locale is passed (#56683)
* fix(sdk): use instance locale if no locale is passed

* update docs

* we do support country codes, we have tests for it

* Update e2e/test-component/scenarios/embedding-sdk/locale-on-provider.cy.spec.tsx

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

* remove manual fallback to "en", site-locale is never undefined as it has
a default

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-04-17 16:06:05 +00:00
Timofey Kachalov
fe1df8df88 feat(sdk): Export public plugin and icon types (#56851) 2025-04-17 19:30:24 +04:00
Sloan Sparger
3c539e3626 [Permissions] Skip fetching of table fields when updating db permissions (#56859) 2025-04-17 15:09:24 +00:00
Edward Paget
5ed1cf1a2d fix: make enhance table stats a single query (#56738)
Avoids hitting the postgresql query parameter limit when there are more
than MAX_UINT16 tables in a database, also should be more efficient to
fetch this in a single query.
2025-04-17 07:47:12 -07:00
Kamil Mielnik
98f9c39437 SEM-173 Allow filtering logs on specific namespaces (#56772)
* Use Mantine instead of styled components

* Fix centering

* Add task and status params

* Add TaskStatusPicker

* Make picker clearable

* Add task picker

* Put filters and pagination together

* Translate task status

* Break down logic

* Move loading and error state

* Always render something

* Make task picker searchable

* Add empty state to the table

* Fix clear button being transparent

* Add useUrlState

* Use useUrlState in TasksApp

* Move UrlState to its own file

* Sort

* Rename file

* Rename

* Clean invalid query params on mount

* Prettier

* Use Action

* Ignore invalid pages

* Reuse variable

* Fix tests

* Add test

* Add label to clear button

* Remove redundant condition

* Add assertions

* Improve typing

* Be explicit about empty string handling

* Add url state to logs

* Add download button

* Disable the button instead of hiding it

* Add query input

* Add clear button

* Improve copy

* Typo

* Fix unit tests setup

* Improve empty state message

* Support location in setup

* Add a test for empty state message when filtering

* Add a test

* Add download button assertions

* Add e2e tests

* Simplify assertion

* Remove redundant element

* Add debounce

* Fix timezone issue

* Extract TasksTable

* Move use-url-state to its own directory

* Add unit tests for useUrlState

* Add test

* Refactor

* Add more tests

* Fix missing import

* Add task endpoints mocks

* Add TasksApp tests boilerplate

* Add pagination test

* Add tests for filters

* Add more tests

* Update tests

* Update tests

* Add more assertions
2025-04-17 21:34:36 +07:00
Romeo Van Snick
04973ca224 Clean up unused code in the expression parser (#56706)
* Remove unused hooks

* Simplify error creation in pratt parser

* Simplify CompileError construction and remove unused data
2025-04-17 16:24:59 +02:00
Konstantin Darutkin
622553c018 fix: focus search field in category editing dropdown (#56852) 2025-04-17 15:01:28 +01:00
Kamil Mielnik
b8f0117f5f SEM-110 Support filtering of tasks list by status and task name (#56664)
* Use Mantine instead of styled components

* Fix centering

* Add task and status params

* Add TaskStatusPicker

* Make picker clearable

* Add task picker

* Put filters and pagination together

* Translate task status

* Break down logic

* Move loading and error state

* Always render something

* Make task picker searchable

* Add empty state to the table

* Fix clear button being transparent

* Add useUrlState

* Use useUrlState in TasksApp

* Move UrlState to its own file

* Sort

* Rename file

* Rename

* Clean invalid query params on mount

* Prettier

* Use Action

* Ignore invalid pages

* Reuse variable

* Fix tests

* Add test

* Add label to clear button

* Remove redundant condition

* Add assertions

* Improve typing

* Be explicit about empty string handling

* Extract TasksTable

* Move use-url-state to its own directory

* Add unit tests for useUrlState

* Add test

* Refactor

* Add more tests

* Fix missing import

* Add task endpoints mocks

* Add TasksApp tests boilerplate

* Add pagination test

* Add tests for filters

* Add more tests
2025-04-17 20:57:38 +07:00
Chris Truter
bf9f135f9f Fix more compound PK stuff (#56819) 2025-04-17 15:55:37 +02:00
Ngoc Khuat
7421a15eec Comparision handlebars helpers (#56828) 2025-04-17 18:15:19 +07:00
Ngoc Khuat
b78b470d1f Setting to get handlebars helpers list (#56827) 2025-04-17 18:13:30 +07:00
Konstantin Darutkin
5a50378330 fix: undo/redo icon size 2025-04-17 12:07:50 +01:00
lbrdnk
2a827d4448 Add memory usage logging to sync steps (#56834) 2025-04-17 13:04:23 +02:00
Ngoc Khuat
9e48bfa0cb Add an envvar to skip sending existing notifications (#56782) 2025-04-17 17:55:14 +07:00
Konstantin Darutkin
812b9ec918 feat(enterprise): Enable clearing categorical values in editable table (#56842) 2025-04-17 11:20:46 +01:00
Timofey Kachalov
764b236601 feat(sdk): Export more public SDK types (#56838) 2025-04-17 13:55:31 +04:00
Chris Truter
387c8f8829 Merge branch 'master' into internal-tools 2025-04-17 09:39:31 +02:00
Nicolò Pretto
6999843d4c fix: run cross-version-for-breaking-changes only on pull requests to (#56794)
make it pass on master
2025-04-17 09:32:10 +02:00
lbrdnk
7cb3445541 Add sorting capabilities to GET /task/ endpoint (#56795)
* Add sorting

* Add test

* Adjust ordering for h2

* Use merge instead of union

* kondo

* Undefined nil ordering among various app dbs
2025-04-17 08:58:44 +02:00
Nick Fitzpatrick
9aec86abce Snowplow tracking for shortcuts (#56744)
* temo

* enable tracking for shortcuts

* amending e2e test
2025-04-17 05:17:11 +00:00
Chris Truter
edffc2b5b1 Fix support for compound PKs (#56816)
Turns out this was only half the cancer, rest of the fix coming after.
2025-04-16 23:05:46 +02:00
Chris Truter
34fc016df0 Comments marking where and what to do for WRK-171 2025-04-16 22:44:58 +02:00
Denis Berezin
891d15deba Add table dashcard actions settings (#56756) 2025-04-16 23:40:31 +03:00
Nick Fitzpatrick
bf27059a98 Disabled shortcuts when a modal is open on the page (#56806)
* Disabled shortcuts when a modal is open on the page

* fix context check

* removing irrelevant test
2025-04-16 19:35:25 +00:00
Uladzimir Havenchyk
3dd6b40c80 test: release healthy specs from jail (#56764) 2025-04-16 22:33:52 +03:00
Romeo Van Snick
633a4565ff Convert compiler to lib (#56426)
* Convert pratt compiler to use ExpressionParts

* Simplify compile by using compileNode helper

* Add todo's about casts

* Simplify error creation

* Make assertions more consistent and translate error messages

* Remove any check

* Simplify compiler by moving stuff into infix/unary helpers

* Remove unused assertions

* Remove casts on constant operator names

* Add assertions for operators

* Wrap top-level literals in a value clause

* Handle bigints in pratt compiler

* Accept ExpressionParts in Lib.expressionClause

* Remove null from ExpressionArgs

* Add field and metric to expression operator

* Simplify pratt compiler types

* Add more tests for equivalent clauses

* Return metadata objects directly from field-resolver

* Add more operators to type

* Create type for field type

* Remove resolverPass

* Convert resolver to Lib.ExpressionParts

* Convert compiler to expressionParts

* Fix syntax error

* Fix types

* Remove unused passes

* Fix resolver tests

* Add types to top-level literals

* WIP: convert untagged expression-parts from #js

* Manually unwrap field, segment and metric metadata

* Unwrap options in pratt compiler

* Remove empty options

* Handle normalized expression when diagnosing

* Allow customizing field resolver

* Fix fuzz tests

* Add value to ExpressionOperator

* Remove unused TODO's

* Use constants in test so types match

* Wrap clauses in defineClause and extract list of defined clauses

* Forbid setting name on clause config

* Use defined clause name as ExpressionOperator

* Use getClauseDefinition helper to get clause definitions

* Ignore type in filters

* Move expression-parts transformation to lib.js

* Add type-of method implementations for field, metrics and segments

* Trigger change when fast setting custom expression

* Remove superflouous casts

* Simplify resolver return type

* Use reference for top-level fields

* Be more specific about types in compiler

* Convert operator to string

* Add unit test for specific expressions

* Fix literals icons

* Remove unused matchers

* Remove unused option from compiler

* Negate number literals directly in compiler

* Add expression-clause implementation that takes one argument

* Use single-arg version of Lib.expressionParts

* Remove TODO

* Use helper to compile top level literal

* Add effective-type to top-level literals

* Remove unused MBQLCLauseMap type

* Remove unused import

* Add two-argument version of expressionClause

* Wait for button to be visible

* Add operator to invalid operator assertion

* Remove incorrect operator check

* Add more specific type to clause name

* Always throw if function name is not found

* Add overloads to getDefinedClause for known function names

* Document the allowFastSet typing hack

* Lift operator check

* Convert nil to {} in body

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

* Make expression-parts js conversion more clear

* Pass through lib.metadata.calculation/type-of for the type-of implementations

* Always throw assertion errors

* Use helper to check query invariants

* Remove lib.schema.expression/type-of methods

* Add test for normalization of uppercase keyword arguments

* Allow some normalizers to ignore case

* Use threading for lowercase converter

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

* Structure test better

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

* Remove unused var

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-04-16 20:52:26 +02:00
Nick Fitzpatrick
6a782d5eb4 Update navigation shortcuts to be key sequences (#56798)
* adjusting keyboard shortcuts, event names

* adding viewing context to dashboard shortcuts

* adding unit tests for enforce some sanity
2025-04-16 12:26:27 -06:00
Uladzimir Havenchyk
fa896cbe1c ci: extract build-matrix script (#56773)
* ci: extract build-matrix script

* fixup

* fixup

* add a test

* make executable?

* checkout

* fix path

* add tests from .github to file-path

* fixup
2025-04-16 20:24:27 +03:00
Konstantin Darutkin
c388ba0c58 feat(enterprise): add undo/redo API and basic buttons for table editing (#56717) 2025-04-16 18:15:20 +01:00
appleby
50e2c32603 Log metric data for failures in qp.middleware.metrics/adjust (#56747)
* Log metric data for failures in qp.middleware.metrics/adjust

When qp.middleware.metrics/adjust fails to expand a metric, log the metric's name and dataset_query, not just the
metric id.

Closes QUE-862

* Update test to assert that metric data is present in ExceptionInfo
2025-04-16 09:36:35 -07:00
bryan
8bb6ef90d7 fix missing deps.edn checksum (#56800) 2025-04-16 12:36:03 -04:00
Alexander Polyankin
781af5af39 Temporal units translation fix (#56792) 2025-04-16 16:30:44 +00:00
Kamil Mielnik
ec25a3ac4a yarn remove use-debounce (#56784) 2025-04-16 21:25:56 +07:00
Ngoc Khuat
aecfe3eda9 Better template (#56487) 2025-04-16 21:15:49 +07:00
Nicolò Pretto
5d9bb5985a POC of cross version tests to detect breaking changes (#56130)
* wip script to build the frankenjar

* build/run/test functions that seem to be working

* preparing for ci

* wip ci workflow

* need to run the job "manually" at least one to be able to dispatch it
from the gh cli

* add workflow_call

* bash instead of sh to solve issue of illegal option -o pipefail?

* use correct version of node

* prepare backend

* more envs to ci

* make jar run on the background in ci

* trying to run a list of specs in ci, tagging with tags probably won't
work as tags potentially need to be there on "older" versions of the
test

* fewer tests so it maybe doesn't timeout

* run on prs targerting the pr branch and the target base one
:wq

* clean up

* fix: without --env it wasn't really using the grepTags param:wq

* refactor: check for the actual files instead of doing ls*

* add back some more test files

* add log for ci

* remove colors as they're not shown in ci

* test: wait for data to load in a flaky test

* test: wait for data to load in a flaky test

* make sure we're building the EE jar

* skip licnese step as we don't need it

* move script out of embedding-sdk folder

* make curl -s to spam less in ci

* refactor: move jops to keep the result job last

---------

Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>
2025-04-16 16:09:17 +02:00
Riley Thompson
49f744375c Revert "Revert "Remove partner drivers"" (#56575) 2025-04-16 09:43:29 -04:00
Ngoc Khuat
01f7f5bcd9 Merge branch 'master' into internal-tools 2025-04-16 20:36:33 +07:00
lbrdnk
22f176f81b Address remarks for status and task filtering in GET /task endpoint (#56774)
* Docstring

* Support :unknown task

* Add tasks-count

* Use tasks-count in the API definition

* Rename to total

* Add and update tests

* docstring
2025-04-16 15:06:38 +02:00
Ngoc Khuat
25e21ed9bf Merge branch 'master' into internal-tools 2025-04-16 19:56:56 +07:00
metamben
21b29f3965 Add diagnostics for expressions with illegal nested aggregations (#56741)
Fixes QUE-822
2025-04-16 15:52:36 +03:00
Dan Stone
3a5be51509 Fix missing :id in field-test (#56777) 2025-04-16 12:53:17 +01:00
Ngoc Khuat
88e251c441 Guard notification pool for exhaustion (#56766) 2025-04-16 11:23:22 +00:00
Stas Gavrylov
b6072b7112 WRK-251,WRK-259,WRK-260,WRK-263: Add autocomplete for custom templates form (#56743)
Replaced regular TextInput and TextField with CodeMirror instances,
styled as MantineUI components to provide autocomplete support
for handlebars (specifically, html and markup).
Introduced "textinput" variant to imitate a regular single-line input.
Other minor fixes and styling adjustments.
2025-04-16 13:36:25 +03:00
Chris Truter
649caa0e44 Merge branch 'master' into internal-tools 2025-04-16 10:25:42 +02:00
github-automation-metabase
4bdc21b1aa Bump com.google.guava/guava from 33.4.5-jre to 33.4.6-jre (#55972)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-04-16 07:30:20 +00:00
Uladzimir Havenchyk
008973b814 test: move flaky mongo test to jail (#56753) 2025-04-16 09:28:51 +03:00
Alexander Polyankin
01eb3ac384 Remove dead code from FieldValuesWidget (#56739) 2025-04-15 22:52:41 -04:00
Fraser
43d5939a64 Convert Updates tab to new components (#55979)
* Convert Updates tab to new components
2025-04-16 11:14:42 +12:00
Alex Yarosh
cbacd7048e docs: semantic types (#56703)
* semantic types

* Apply suggestions from code review

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

* feedback

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-04-15 16:53:41 -04:00
Eric Normand
21e1ca15c6 Correct output for dashboard filter variables (#56619)
* Correct output for dashboard filter variables

* Whitespace

* Add node script for testing clojurescript

* Enhance format-unit and add parse-unit.

parse-unit is new.

format-unit now works with moment (cljs) or java.time (clj) values, not just strings and numbers. I also added two new
units (:day-of-week-abbrev and :month-of-year-full).

* Refactor to use time/parse-unit and time/format-unit
2025-04-15 14:42:20 -05:00
Ngoc Khuat
5f47d1cbd3 Less ambiguous notification logs (#56701) 2025-04-15 20:31:03 +03:00
Nicolò Pretto
fd25c7efcc add comment to explain why we need isDashboard to Visualization (#56709) 2025-04-15 18:47:43 +02:00
Uladzimir Havenchyk
4c59fc665f test: fix another flakiness (#56711)
* test: fix another flakiness

* another assert

* add comment back and remove flaky
2025-04-15 16:29:25 +00:00
bryan
38bb58583d indent files with mage from lint-staged (#56303) 2025-04-15 09:09:36 -06:00
Dan Stone
ea71481630 Fix new errors due to merge (#56736)
* Fix missing emails symbol

* Fix migration order
2025-04-15 15:44:53 +01:00
Timofey Kachalov
1eeaec0e94 docs(sdk): Improve typedoc output and plugins (#56712) 2025-04-15 18:38:26 +04:00
Alexander Polyankin
6985eca2b3 Remove unused endpoints from services.js (#56735) 2025-04-15 14:37:12 +00:00
Denis Berezin
5d6dde74c5 hotfix after merge - fix db admin settings 2025-04-15 17:29:36 +03:00
Denis Berezin
30f59f2e87 hotfix after merge - restore useCombobox 2025-04-15 17:09:47 +03:00
Alexander Solovyov
b211f68ec7 fix identity-hash-test flakes (#56728)
this happens because we're not hashing `now` in this case, but what is coming from DB; which is OffsetDateTime and can
have slightly different precision, leading to different hash.
2025-04-15 13:49:39 +00:00
Alexander Solovyov
c6488e7fc6 use big number mode for apache compress (#56719)
possibly fixes a problem we're seeing in #53354
2025-04-15 13:37:22 +00:00
metamben
f786d876bb Wait a bit longer in util.queue tests to let them pass in CI (#56681)
* Wait a bit longer in util.queue tests to let them pass in CI
2025-04-15 13:32:41 +00:00
Alexander Polyankin
f74bf7fac2 Use MultiAutocomplete in FieldValuesWidget - multiples values only (#56461) 2025-04-15 09:22:53 -04:00
Alexander Solovyov
e43228e8fc merge master 2025-04-15 16:14:58 +03:00
Alexander Polyankin
a3da9834be Rename date picker labels (#56699) 2025-04-15 13:13:52 +00:00
Timofey Kachalov
3dff6bef19 Run build job for SDK on any FE code change (#56718) 2025-04-15 17:07:46 +04:00
Alexander Polyankin
30ca07666d Fix the filter input placeholder for remapping cases (#56691) 2025-04-15 09:04:11 -04:00
Alexander Polyankin
67de26fc3f Fix native model perms (#56697) 2025-04-15 09:04:02 -04:00
Oisin Coveney
b7a74d02c7 feat(sdk): Automatically set a sensible display to interactive questions (#56584) (#56667)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-04-15 11:19:17 +01:00
Alex Yarosh
d001543d0e Update connecting.md (#56708) 2025-04-15 05:23:22 -04:00
Timofey Kachalov
51d772c85b Fix redirect from internal module, replace metadata description via a plugin (#56614)
Co-authored-by: Timofei Kachalov <timofei@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-04-15 12:24:54 +04:00
Timofey Kachalov
f9c6432297 Remove Embedding SDK API generated doc files from repo (#56637) 2025-04-15 12:07:36 +04:00
Fraser
8afc62789e Replace confirm content in use-confirmation hook (#55247)
* Replace confirm content in use-confirmation hook

* Ensure modal closes after confirmation

* Update to mantine popover

* Toggle closeOnClickOutside when modal is open/closed
2025-04-15 18:32:42 +12:00
Denis Berezin
9c50d21401 Add filtering for standalone editable tables (#56623) 2025-04-15 02:03:38 +03:00
Jeff Bruemmer
8ee568053a docs - expression casing (#56695) 2025-04-14 22:32:32 +00:00
Uladzimir Havenchyk
cabe5b28f8 test: fix flakiness in action creator unit tests (#56672) 2025-04-14 20:30:58 +03:00
Nicolò Pretto
f78b415927 make the sdk docs check not required so we can merge things (#56685) 2025-04-14 18:04:11 +01:00
Alexander Polyankin
363c87a8af MultiAutocomplete + remapping (#56621) 2025-04-14 12:33:30 -04:00
metamben
5472a21887 Parse BigQuery timestamp values with microsecond precision (#56626)
Fixes #51175

BigQuery sometimes returns timestamp values as floating point values (as strings, of course). We used to pass the
parsed double value to java-time.api/instant, but that seems to have microsecond precision. In this change we use
Java's built-in Instant construction function to keep the full precision.
2025-04-14 19:31:29 +03:00
Alex Yarosh
90b57b895a docs: mention supabase (#56676)
* mention supabase

* Update docs/databases/connections/postgresql.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-04-14 16:18:37 +00:00
Jeff Bruemmer
74f24399e1 fix typo (#56678) 2025-04-14 16:09:36 +00:00
Romeo Van Snick
dfc753e0f6 Fix dissappearing string escapes (#56605)
* Add repro for #56596

* Allow escaping backslash

* Use unquoteString everywhere to parse strings and references

* Do string quoting and unquoting more consistently

* Add repro for #56596

* Make string parsing more straightforward and consistent

* Use quoteString to find errors with quoting

* Type string helpers more strictly

* Add fuzz tests for string quoting

* Move fuzz helper to test folder

* Make string fuzzing repeatable

* Add sanity check

* Fuzz all three quoting modalities

* Add [-quote tests

* Rename quote to delimiter

* Fix path for lexifier fuzz testing

* Fix name for compiler fuzz testing

* Use constant to store delimiter pairs

* Fix option name in formatter

* Add more cases around half-quoted strings

* Rename quote to delimiter in comment

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

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-04-14 15:30:05 +00:00
Alexander Solovyov
330f2c0a3c mage jar-download now can see newer releases (#56669)
since we don't tag v1.* anymore or something?
2025-04-14 18:27:29 +03:00
Nemanja Glumac
6c0ae49c2d Create the "Product Growth" team (#56674) 2025-04-14 17:19:48 +02:00
Konstantin Darutkin
805b355989 feat(enterprise): respect columns config in editable modals (#56673) 2025-04-14 16:08:23 +01:00
Romeo Van Snick
bd3ef171a8 Convert formatter to mbql (#55468)
* Add isExpressionParts helper to check

* Export Lib.isColumnMetadata

* Add Lib.isColumnMetadata to check

* Mark is-column-metadata as Single use instead of smelly

* Add is-metric-metadata helper

* Add is-segment-metadata helper

* Add isSegmentMetadata and isMetricMetadata to checks

* Use expressionParts and expressionClause in formatter

* Avoid stringifying the ast

* Allow passing literals to filter-clause

* Simplify test case for now

* Handle [:value x] in formatter

* Unnest expression-parts

* Add metric-clause? and segment-clause? helpers

* Handle metric and segment clauses in expression-parts

* Flatten case/if statement args in expression-parts

* Remove special case for case/if in formatter

* Support keywords in expression-parts

* Fix duplicate negation test case

* Prefer desctructuring over get

Co-authored-by: Braden Shepherdson <braden@metabase.com>

* Use set to match case and if

Co-authored-by: Braden Shepherdson <braden@metabase.com>

* Fix typo

* Use conditional threading in maybe-expand-*-expression

* Use destructuring to match case/if clauses

* Use cond-> instead of maybe-expand- helpers

* Fix literal in formatter tests

* Rename is-*-metadata to *-metadata?

* Swap test case order

* Use multi-method for expression-parts

* Inline recurse fn

* Accept ExpressionClause in the formatter

* Pass expression clause in HighlightExpression

* Build expressionParts for examples manually

* Be more strict in formatter typing

* Be more strict in formatter typing

* Fix FunctionBrowser example

* Add test case for 1 + 1

* Pass expression clause to format in Editor

* Add docstring to expression-parts-method

* Remove superflouous check

* Use threading macro in column-metadata-from-ref

* Unwrap case/if into pairs and a fallback argument

* Remove reference to unknown function

* Add stage-index-less version of expression-parts

* Add MetricMetadata and SegmentMetadata to ExpressionArg

* Fix case/if expansion not to have nil argument when fallback is nil

* Add test for case and if

* Fix case/if defop

* Add more test cases to case and if test

* Add ExpressionArg type

* Allow passing Expressionable to formatter

* Add more tests for case and if

* Move case and if conversions to fe_util

* Deduplicate case-or-if matcher

* Document case-or-if helpers more

* Be more precise in the type of ExpressionParts args

* Fix args for expression-clause in exclude-date-filter

* Remove faulty test

* Add test for nested parts

* Move fix-expression into ->op-arg

* Move ensure-uuid into fix-expression

* Wrap operator in keyword

* Correctly recurse through expression-parts

* Add test for nested case parts round-trip

* Add source-field to test data

* Comment out broken test case

* Add source-field to ReferenceOptions type

* Remove unused imports

* Allow more arguments to expression-parts

* Use expression-parts in filter test

* Handle bigint in formatter

* Add missing import

* Remove unused import

* Normalize mbql

* Allow lib.expression/expression as arg to expression-clause

* Handle expression refs

* Add tests for unknown fields, metrics and segments

* Add metrics to formatting tests

* Handle non-existent metrics and segments

* Add workaround for unknown fields

* Use cond-> and destructuring for unknown field

Co-authored-by: Braden Shepherdson <braden@metabase.com>

* Remove superflouous call to lib.field/extend-column-metadata-from-ref

* Inline segment-metadata-from-ref and metric-metadata-from-ref

* Collapse all identity expression-parts-methods in a doseq

* Call expression-parts instead of expression-parts-method

* Use multi-method to handle case and if

* Pull out temporal expression expansion into separate multimethod

* Move check closer to where it is used

* Remove constant conditional

* Use threading macro in expression-parts

* Move nested case/if test out of deftest

* Fix formatting

* Fix metadata method when metric is not found

* Add display-name to unknown field stub

* Use lib.metadata helpers directly for field, metric and segments in expression-parts

* Fix e2e test

* Handle segments in filter parts directly

* Fix e2e test

* Add TODO

* Use doseq in literals test

* Add test for bigint value clause in expression-parts

* Remove TODO

* Use id from sample database

* Use vec

Co-authored-by: Braden Shepherdson <braden@metabase.com>

* Fix types

* Use simpler assertion helper

* Move metric to aggregations tests

* Do not wrap value clauses in parentheses

* Return metric metadata from expression-parts

* Emit expression reference in the case of expressions

* Strip expression-name from columns metadata in expression-parts

* Add e2e test for nested references

* Return stub metric metadata if metric is not found

* Use expression-name from the reference

* Add tests for field reference in expression-parts

* Add tests for segment reference in expression-parts

* Add tests for metric reference in expression-parts

* Add tests for expression reference in expression-parts

---------

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-04-14 15:58:36 +02:00
Romeo Van Snick
93831828e4 Fix native editor sidebar (#56594)
* Fix issue where toolbar is being pushed off screen

* Add repro for metabase#56570
2025-04-14 12:11:00 +02:00
Kamil Mielnik
922cda5ec0 SEM-114 Improve pagination in tasks page (#56491)
* Add pagination to URL in tasks

* Add tests
2025-04-14 13:40:26 +07:00
Nick Fitzpatrick
53093f8c1a Query builder keyboard shortcuts (#56610)
* Query builder keyboard shortcuts

Query builder shortcuts

* PR feedback, remove download question shortcut
2025-04-14 07:48:43 +05:30
lbrdnk
a4ba2acd4b Add filtering capabilities to /task/ endpoint and add/task/unique_tasks endpoint (#56451)
* Adjust /task enpoint to handle status filtering

* Update GET /task endpoint

* Update test

* Unique tassk endpoint and filter nad schema

* Tests

* chore

* Review remarks

* Simplify

* Fix schema

* typo
2025-04-13 09:44:23 +02:00
lbrdnk
a54de86b39 Speculative OOM fix: partition index updates, update logging for index sync (#55866)
* Adjust logging

* Speculative OOM fix

* Update partitioning logic of sync-all-indexes!

* Add test

* Use bigger partitions

* Adjust tests

* Remarks
2025-04-13 09:43:52 +02:00
Oleksandr Yakushev
5d97d19781 [metrics] Fix race condition in jvm-hiccup/alloc-rate metrics (#56528) 2025-04-12 21:54:30 +03:00
appleby
97387d0942 Enable expression-literals for redshift and vertica (#56534)
* Support drivers that need special handling for literal string expressions

* Enable the :expression-literals feature for vertica

* Enable the :expression-literals feature for redshift

* Review feedback: lift comment about inlined literals from h2 to sql driver
2025-04-11 16:33:52 -07:00
bryan
63198734e2 properly address metabase's bb executable (#56606)
- if you have bb on your path, then this would never be hit.

Testing by uninstalling bb will not uncover this issue if you have
repo/path/metabase/bin on your PATH!
2025-04-11 22:54:27 +00:00
appleby
2a4e8d1c69 Enable expression-literals for sqlite and starburst (#56533)
* Rename True and False expressions in literal expression tests

Speculative fix for sqllite failing the tests.

* Update literal expression tests to work with drivers that treat empty string as null

* Add empty-string-literal-expression-test and remove empty string form standard-literal-expression-defs

* Fix logical merge conflicts in case-with-literal-expression-test

* Enable the :expression-literals feature for sqlite and starburst

* Review feedback: drop format-nil->empty-str

As pointed out by metamben in code review `(str nil)` is already the empty string. In fact, the culprit here was a
missing `format-nil-values?` arg to `format-rows-by`.
2025-04-11 15:03:52 -07:00
Uladzimir Havenchyk
de8c20bf55 test: use mousemove instead of realHover for echart tooltip (#56583) 2025-04-12 00:44:57 +03:00
Alexander Polyankin
ba131b1abd Close the MultiAutocomplete dropdown on Esc, preventing the outer Popover from closing (#56562) 2025-04-11 15:39:31 -04:00
Denis Berezin
b28251f8a1 [WRK-240] Remove link to a new question from editable table card (#56604) 2025-04-11 22:25:54 +03:00
Nick Fitzpatrick
452dbefda4 Add route prop to disable command palette, Disable in setup routes (#56507)
* Add route prop to disable command palette, Disable in setup routes

* increase wait timeout

* refresh user on setup

* Lets try a unit test instead

* removing refresh user from UserStep
2025-04-12 00:09:12 +05:30
Ryan Laurie
fd7c0db61f fix frontend test flake (#56597) 2025-04-11 08:50:04 -06:00
Uladzimir Havenchyk
5e19281112 test: fix a broken entity picker test (#56586) 2025-04-11 17:27:37 +03:00
Jeff Bruemmer
50df68482e docs - note on quotes (#56520)
* note on quotes

* edit

* tags

* format

* spacing

* edit
2025-04-11 14:25:41 +00:00
Dan Stone
ef74b7830f Run data editing tests against postgres as well as H2 (#56481)
* Delete app db table record when dropping table

* Remove empty-h2-app-db calls

* Add auto-inc test for create table

* Use driver test db instead of app db

* Fix local whitespace

* Do not lose the cleanup ex in open-test-table!

* Fix postgres test issues
2025-04-11 14:55:22 +01:00
Noah Moss
c17c259d79 Remove a workaround which is no longer needed due to update of Apache POI (#56572)
* Remove a workaround which is no longer needed due to update of Apache POI

* clean ns
2025-04-11 13:33:23 +00:00
metamben
3be8f6ab2b Require only id and value for parameters when running questions (#56565)
This is the BE part of #51813
2025-04-11 15:40:41 +03:00
Sébastien
50664531b3 closes metabase#56307: faint line on tooltip arrow in FF (#56588) 2025-04-11 13:43:56 +02:00
Oisin Coveney
1f19dee6c5 Fail SDK unit tests when there are console errors #55529 2025-04-11 11:16:54 +01:00
Konstantin Darutkin
ed852b65c9 feat(enterprise): show create row on editable dashcard (#56550) 2025-04-11 10:51:34 +01:00
William
c3c5edc272 Calculate and cache entity_ids on select (#54411)
We need to ensure that we consistently have entity-ids in metadata (and potentially elsewhere) even before we've finished backfilling them in.  To do this, we check for entity-ids in the field/table/database/card after-select and run calculation/deduplication logic to get them when necessary.  We then cache the results (because these calculations can be slow), and a separate job then drains the cache and writes the results back to the db.
2025-04-11 00:19:38 +00:00
John Swanson
728fa82bc2 Feature: Database Routing (#54648)
* Migrations for database sandboxing (#53125)

Two changes here:

- add a self-referential foreign key,
`metabase_database.router_database_id`, to allow marking a mirror
database's router database. Databases with this set are mirror
databases, databases without it are primary databases.

- add a `db_sandbox` table with only three columns:

  - `id`, primary ID,

  - `db_id`, the `metabase_database.id` this sandbox is for, and

  - `user_attribute`, the user attribute used to map users to a
    particular mirror database.

* CRUD API for database routing (#54102)

* Migrations for database sandboxing

Two changes here:

- add a self-referential foreign key,
`metabase_database.primary_database_id`, to allow marking a mirror
database's primary database. Databases with this set are mirror
databases, databases without it are primary databases.

- add a `db_sandbox` table with only three columns:

  - `id`, primary ID,

  - `db_id`, the `metabase_database.id` this sandbox is for, and

  - `user_attribute`, the user attribute used to map users to a
    particular mirror database.

* Bulk endpoint for creating mirror dbs

The error case is a bit wonky right now, it just returns the errors for
the details that failed... without the details or name.

Co-authored-by: Ed Paget <ed@metabase.com>

* Add endpoint for marking a database as a RouterDB

Co-authored-by: Ed Paget <ed@metabase.com>

* Rebase fixes

* Exclude mirrordbs from regular db endpoints

* kondo fixes

* mark `DatabaseRouter` as not serialized

* serdes fix

* copy fix

* delete and update routers

Also reorganized things to be a bit less cattywompus.

Now we have:

- `POST api/ee/database-routing/mirror-database` to create a new mirror database
- `POST api/ee/database-routing/router` to create a new router using an
  existing database
- `PUT api/ee/database-routing/router/:id` to update a router to use a
  new user attribute
- `DELETE api/ee/database-routing/router/:id` to delete a router and all
  of the associated mirror databases.

* GET endpoint for mirrors of a particular router db

* Don't test database conn for mirror dbs

---------

Co-authored-by: Ed Paget <ed@metabase.com>

* Modify the API - don't care about database routers (#55036)

* Modify the API - don't care about database routers

Add a `router_user_attribute` to the `GET /api/database/:id` API
endpoint.

Modifies the database routing API to address only by the database ID.
There's now just two endpoints:

- POST /ee/database-routing/mirror-database to create a mirror database

- PUT /ee/database-routing/router-database/:id to change the
`user_attribute` used for routing an existing database. Can be set to
`null` to turn of database routing for the database.

* fix test

* kondo

* DB Routing: Sloan's API improvements (#55438)

* router_user_attribute on `/database/`

* unique database names for mirror dbs

* Don't delete mirror databases when deleting router

* query param to check conn details

* no making a mirror a router

* Require `:manage-database` perms to get dest dbs

(rather than superuser.)

* set `visible-if`, NA on dest dbs

* Add conditions when making db router

* fix db migrations

* fix tests

* kondo

* reorder migrations for mysql/mariadb

* Implement database routing (#55053)

* Swap DB for DB routing

Caching should work, field values does not currently.

* Rename the metadata replacement dynamic var

for clarity. Since we're using it outside of tests now.

* Refactor Advanced Field Values

Previously we had 3 types of Advanced field values:

- sandbox,
- impersonation,
- and linked-filter

Each of these three had their own function, `hash-key-for-*`, and the
caller of this function was responsible for generating the correct hash
key for the field provided.

For example, `hash-key-for-advanced-field-values` took a `fv-type` and
called either `hash-key-for-linked-filters` or `hash-key-for-sandbox` or
`hash-key-for-impersonation` depending on the type.

The big problem here is that the hash keys aren't composable. You can
see this being an issue in `hash-key-for-linked-filters`, where the
enterprise version needs to also check whether the field is sandboxed,
and if so, include sandboxing data in the generated hash as well as the
linked filter data.

If we add more orthogonal things to the hash (like database routing) we
would end up with a rat's nest where each hashing function partially
implements a bunch of other hashing functions to make things work. E.g.
`hash-key-for-database-routing` might check if the field is sandboxed,
and if so include data about the sandbox, but also
`hash-key-for-linked-filters` should check if the field is
sandboxed *or* impersonated *or* subject to db-routing and include data
about those, and ...

Instead, I've replaced all these functions with `hash-input-for-*`
functions, which return self-contained maps that reflect
their *internal* knowledge of what should/should not be cached.

For example, the `hash-input-for-sandbox` function returns either
`nil` (if the field is not sandboxed for the current user) or
`{:sandbox-attributes {<the user attributes used for the sandbox>}}` (if
it is).

`hash-input-for-field-values` simply merges all of these together into
one lump.

To tell whether we're generating a `full` or `advanced` field value, we
can just check to see whether the hash input has any data other than the
field ID.

The one downside here is that we'll no longer be able to look at the DB
and distinguish between different types of FieldValues. As far as I can
tell, the code itself does not ever do this, so I think this is an
acceptable tradeoff.

* database routing for field vals

* move things around a bit

* fix tests

* Lint

* WIP: database routing

* fix test

* more tests, caching tests

* kondo

* stray #p

* Exclude mirror databases from search

* Exclude mirror databases from sync

* Do not create permissions for mirror databases

* fix more tests

* lint

* Add another e2e test for field values

* Don't grab database from query in h2 driver

* Fix my rebase error

* [DB Routing] Implement UI (#55132)

* save

* wip

* wip

* lots of progress

* iteration

* more progress, add delete mirror modal

* type clean up, bug fixes, code organization

* address lots of TODOs

* prevent configuring uploads to routed dbs, prevent db routing if db is upload destination db, replace all usages of routed database and mirror database in favor of destination database

* clean up url usage, add health check to destination database lists

* support hidden fields for database details

* fix types and TODOs

* render warning that model features can not be enabled when db routing is enabled, add unit tests for DestinationDatabasesList

* add e2e coverage for db routing CRUD

* move db routing e2e to a new file, make tests nicer, add test coverage for not showing destination databases outside of database settings

* test that db routing can not be enabled if other conflicting features are enabled

* finish e2e tests as much as possible, add feature token to session properties payload

* move more code into enterprise folder, add redirects and permissions checks for destination db routes, handle no user attributes on instance state, fix failing unit tests, make alerts tooltips when features cant be enabled based on other features being enabled

* test fixes, impl error states kyle provided

* split up tests by ee and oss

* error state updates, fix failing e2e tests

* fix failing oss e2e test, beef up db management perms test

* PR feedback

* impl more feedback

* Fix BE tests

* another be test

* pr feedback

* fix one of the failing e2e tests

* include_mirror_databases -> router_database_id

* skip test

---------

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

* fix deletion of router dbs with dest dbs (#55831)

* Don't require superuser perms to get dest db (#55754)

* [DB Routing] Database pages tech debt - RTKQuery + TS migrations (#55744)

* convert DatabaseList to typescript

* make DatabaseEditApp use rtkquery, remove old initialize approach, remove related redux code, port code to use api db rather than metabase lib Database class

* remove dismissDatabaseSyncSpinner redux code in favor of rtkquery

* fix some mistakes causes tests to fail

* port DatabaseList to typescript

* port adding sample database to rtkquery

* misc fixes

* fix failing unit test

* convert admin/databases/database.js and admin/databases/selectors.js to TS

* editParamsForUserControlledScheduling.js to editParamsForUserControlledScheduling.ts

* remove all usages of metabase lib Database class from Database pages

* fix type errors

* fix failing e2e

* prettier

* [DB Routing] Port Admin DB page components to Mantine (#55811)

* port components to mantine for admin db pages

* fix failing tests

* remove unused comment

* fix type issue

* Require opt in/out of database routing (#55841)

I was considering possible errors here and I think this will work well
as a safety harness.

In dev/testing (non-prod) environments, let's add an assertion to the
JDBC driver that if we're about to connect to a database. Either:

- we're *explicitly* trying to only connect to Router Databases. For
example, sync should *never* connect to mirror databases or go through
Database Routing. OR

- we've enabled Database Routing, and we *don't* want to access the
Router Database (unless of course DB routing has been configured to send
us there)

Another way of putting this is that there are two obvious ways for this
feature to go sideways: we accidentally sync a mirror database or do
something else that shouldn't work for mirror databases, OR we
accidentally skip the Database Routing process and connect to the router
database when we shouldn't.

Of course, we can't guarantee that all drivers will call
`(database-routing/check-allowed-access!)` before connecting! But we can
just call it from the JDBC router and that should be sufficient to catch
any issues in development in the vast vast majority of cases.

* [DB Routing] UI feedback part 1 (#55893)

* make dest db validate on creation, invalidate cache of user attributes after user is updated

* add test coverage for updates and uncomment e2e tests parts that were previously failing

* fix type issue

* Fix audit/query logging for DB routing (#56103)

[ADM-585: Handle audit logging and query logging](https://linear.app/metabase/issue/ADM-585/handle-audit-logging-and-query-logging)

* exclude destination dbs from serialization (#56076)

* Decrease the pool size for mirror DBs (#56104)

DB metadata seems like an odd thing - it's the Metabase Database
converted to a snake-hating map, so `router_database_id` becomes
`router-database-id`.

We can't write a function of `:model/Database` that decides whether
we're looking at a mirror database (because we're not looking at a
`:model/Database` here). So we're reduced to just checking the key.
Feels weird, but I think the cleanest way available here?

* Fix sandbox on a routed DB with question as filter (#56393)

This only affected turning on sandboxing, and was not an error for
sandboxing itself.

When we configure sandboxing, we want to make sure the column types for
the query we're using match the columns in the sandboxed table.

As part of this, we ran the query anonymously with
`(request/with-current-user nil ...)`. With Database Routing, however,
we added a new constraint: you can't run any queries against a database
with routing configured anonymously.

Instead just run the query as a superuser. This is effectively the same,
and it's consistent with what we do when actually *enforcing* the row
level restrictions anyway: we preprocess the source query as an admin
and then splice it into the user's query.

The one thing that gives me pause: I'm not really sure why we would have
done `(request/with-current-user nil ...)` in the first place here.

* Add database-router usage e2e tests (#56255)

* Improve error messages and UI for config (#56392)

* Improve error messages and UI for config

- improve error messages when a dest db can't be found

- improve the admin UI for configuring DB routing: https://metaboat.slack.com/archives/C07L6VCCYQL/p1744044752380479

* changes suggested by Jeff

* fix error msg tests

* disable linting for DB Routing description

* fix getting a destination db

db `can-read/write?` use router DB if necessary, since destination
databases don't actually have permissions saved.

* i18n for errors

* spelling 😁

* fix tests

---------

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

* Fix options for Destination DBs (#56450)

* Fix options for Destination DBs

This may still require a bit of frontend work.

* Set destination-database=true for destination db modal

---------

Co-authored-by: Fraser McIntosh <fraser@metabase.com>

* Fix impersonation with Database Routing (#56503)

* Fix impersonation with Database Routing

Database routing was not working with impersonation, because by the time
the driver calls `set-role-if-supported!` the router database (which is
configured for impersonation) has already been swapped out for the
mirror database (which is not).

To fix this, have a new impersonation middleware set a dynamic var,
`*impersonation-role*`, which is preferred by `set-role-if-supported!`
if set. This way, in queries, `set-role-if-supported!` will use the
pre-calculated role (which seems better than computing it twice anyway).

Co-authored-by: Ed Paget <ed@metabase.com>

* Add impersonation tests

* Add sandbox question test

---------

Co-authored-by: Ed Paget <ed@metabase.com>
Co-authored-by: Fraser McIntosh <fraser@metabase.com>

* keep metadata store on metadata provider swap (#56502)

* keep metadata store on metadata provider swap

Before, we would blow away the existing QP store entirely when using
`*DANGER-allow-replacing-metadata-provider* to swap out the existing
metadata provider.

Instead we can only initialize the QP store when it was truly
uninitialized, and replace *only* the metadata provider when we're
trying to do that.

This is just in case something in QP post-processing needs data from the
original store, e.g. something that was stored with
`qp.store/store-miscellaneous-value!`.

Co-authored-by: Ed Paget <ed@metabase.com>

* only allow replacing md provider once

---------

Co-authored-by: Ed Paget <ed@metabase.com>

---------

Co-authored-by: Ed Paget <ed@metabase.com>
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Fraser <fraser@metabase.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-04-10 13:21:23 -07:00
Alexander Polyankin
9eb88c3478 Pass missing props in MultiAutocomplete (#56506) 2025-04-10 15:15:22 -04:00
Uladzimir Havenchyk
24b79c324c test: fix another flakiness (#56563) 2025-04-10 22:04:51 +03:00
Denis Berezin
94addf0055 Add sorting config for editable table card in dashboard (#56519)
* WIP

* Add sorting for editable table dashboard card

* Fixes after merge

* Self review
2025-04-10 21:57:36 +03:00
Konstantin Darutkin
c3e6655d45 fix: controlled column reordering in datagrid (#56543) 2025-04-10 19:40:08 +01:00
Aleksandr Lesnenko
8f57a69882 fix incorrect series colors in static viz (#56415)
* fix static charts may have incorrect series colors

* use hex colors in static viz
2025-04-10 14:02:08 -04:00
Timofey Kachalov
067057efda Add CI job checking outdated Embedding SDK API documentation (#56452) 2025-04-10 21:54:31 +04:00
Chris Truter
3e3a6aba14 Of course I ran kondo 2025-04-10 19:05:08 +02:00
Nick Fitzpatrick
98c2872f2b Adm 505 collection and everywhere shortcuts (#56457)
* rest of global, and some collection shortcuts

* adjust collection item commands, e2e tests

* adjust e2e test

* remove bulk move
2025-04-10 16:32:56 +00:00
Timofey Kachalov
10b7df74e9 docs(sdk): Add generated documentation files for @metabase/embedding-sdk-react (#56367) 2025-04-10 20:18:59 +04:00
Edward Paget
b46ae17a3b feat: upgrade ring-jetty to 1.14.1 (#55921)
* feat: upgrade ring-jetty to 1.14.1

Moves us onto Jetty 12 which has some features (pthreading, QoSHanlder)
that we may want to take advantage of.

* fixup! customize jetty metrics

* fixup! license info for jetty ee9

* fixup! make a var private

* fixup! don't use deprecated method

* fixup! create custom statistics handler

Replicate the Jetty 11 statistics handler that is able to report on
asynchronously handled requests separately from synchronously handled
ones. Also ports it to directly report statistics to our prometheus
rather than needing to build a connector between the stats handler
object and our metrics reporting

Co-Authored-By: John Swanson <john.swanson@metabase.com>

* fixup! fix race condition in stats test

* fixup! missing private annotation

* fixup! use normal jetty release with logging fix

---------

Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-04-10 16:16:23 +00:00
Timofey Kachalov
b373500c04 docs(sdk): Setup automatic documentation generation for @metabase/embedding-sdk package (#56366)
Co-authored-by: jeff bruemmer <jeff.bruemmer@gmail.com>
2025-04-10 20:06:06 +04:00
Uladzimir Havenchyk
31f31e59f0 ci: simulate slow network in stress test (#56464)
* ci: simulate slow network in stress test

* fixup
2025-04-10 19:04:08 +03:00
Chris Truter
2273872f63 Wire up Undo API and hack the "subscriptions" (#56560) 2025-04-10 17:56:50 +02:00
Nick Fitzpatrick
cf806ce408 Growing entity picker (#56462)
* resize observer entity picker

* adding e2e test

* e2e adjustments
2025-04-10 21:08:01 +05:30
Aleksandr Lesnenko
baab33ecca fix bars width on dst timezone data (#56466)
* fix bars width on dst timezone data

* specs
2025-04-10 11:06:17 -04:00
metamben
acea8921ab Support binning by column with a single numerical value (#56517)
Fixes #53521

--

Co-authored with lyulifeng (lyulifengg@gmail.com)
2025-04-10 14:43:02 +00:00
Timofey Kachalov
4d38da9476 Refactor Embedding SDK CI workflow and improve notify-pull-request action (#56545) 2025-04-10 18:24:38 +04:00
Gustavo Saiani
231d159585 Improve links (#56549) 2025-04-10 11:06:45 -03:00
Nicolò Pretto
59bd5a5905 call e2e-component-tests-embedding-sdk-cross-version from (#56454)
* call e2e-component-tests-embedding-sdk-cross-version from
embedding-sdk.yml

* add e2e-component-tests-embedding-sdk-cross-version to the tests-results
so it needs to pass (or be skipped)
2025-04-10 13:34:29 +00:00
John Swanson
6d647bccde Reset all errored triggers to WAITING on startup (#55769)
* Reset all errored triggers to `WAITING` on startup

Co-authored-by: Ed Paget <ed@metabase.com>

* Add explanatory comments

---------

Co-authored-by: Ed Paget <ed@metabase.com>
2025-04-10 05:44:56 -07:00
Konstantin Darutkin
2e04af515e fix: hide hidden columns in editable table (#56431)
* wip: hide hidden columns in editable table

* fix: flickering

* fix: review fixes
2025-04-10 12:36:02 +01:00
Konstantin Darutkin
0bdb7c1004 feat: add edit disabled icon (#56544) 2025-04-10 12:35:30 +01:00
lbrdnk
c198bc44e7 Make category semantic type available for all types (#56505)
* Make Category semantic type available for all types

* Update test
2025-04-10 12:56:32 +02:00
lbrdnk
20e9cd8fc1 Fix percentile with expression argument on Clickhouse (#56488)
* Fix percentile honeysql generation on Clickhouse

* Fix lib/case arities

* Add test

* Whitespace
2025-04-10 09:05:32 +02:00
Riley Thompson
76241f7db7 Revert "Remove partner drivers (#56403)" (#56529)
This reverts commit 44274c63ad.
2025-04-10 01:51:38 +00:00
Aleksandr Lesnenko
722fc1a45f fix dashboard empty state for no query creation users (#56340)
* fix dashboard empty state for no query creation users

* fix unit specs
2025-04-09 22:03:35 +00:00
Konstantin Darutkin
f9a9c6c06c feat(enterprise): WRK-231 add fast reload for dashcards (#56427)
* feat(enterprise): WRK-231 add fast reload for dashcards

* refactor: better state handling

* fix: review fixes
2025-04-09 22:47:29 +01:00
Edward Paget
d20183be8e fix: allow metabase jars to start on JVM 24 and up (#56518)
Metabase jars would crash when running on JVM 24 because the getReourse
method on the ClassLoader object was changed to return null if there is
no file at the provided path. This adds a ".keep-me" file to the
resources directory that Metabase can use to check if it is running in a
jar.
2025-04-09 21:17:50 +00:00
Riley Thompson
b626947efb Document athena permissions (#56525) 2025-04-09 21:11:35 +00:00
Nathan Voxland
c583ae13e6 Added include_metadata argument to search API (#56397) 2025-04-09 15:01:38 -05:00
Case Nelson
a8ecef4802 fix: resolve snowflake sync cost issue (#56337)
* fix: resolve snowflake sync cost issue

Using information_schema queries will cause snowflake to wake an
instance and thus incur costs. Using `show` queries will not do so.

In addition this adds a new multi-method for manipulating the results of
`describe-fields-sql`.

* Fix database-position and sorting

* Fix kondo

* Add order-by to mysql describe-fields

* Sort deps

* Use identity not map identity

* Fix databricks

* Address PR comments
2025-04-09 13:49:57 -06:00
Nick Fitzpatrick
c1062d680a remove duplicate function, translate dates (#56449) 2025-04-10 00:47:41 +05:30
Nathan Voxland
1762ab78d5 Created queue listener and updated search to use it (#55069) 2025-04-09 13:16:00 -05:00
Ryan Laurie
10890aee1f update CI config for automatic translation update (#56500) 2025-04-09 12:02:43 -06:00
Phoomparin Mano
87bbb5b9a1 Expose PDF and dashcard result download toggles in the embedding modal (#56211)
* scaffold separate download options for dashboard static embeds

* parse the display options to hash options

* add toggles to the embed preview

* workaround for duplicate types

* cleanup the dashboard workaround

* cleanup the dashcard workaround

* downloads parameter should not show up on OSS

* replace the download button tests

* update existing tests

* fix test for Download buttons

* remove unnecessary fallback

* add a new snowplow schema

* update unit tests

* fix snowplow test assertions

* add snowplow tests

* use results instead of dashcard for consistency

* make the JSON schema backwards-compatible

* split download settings into two components

* use downloadsEnabled.results instead

* snowplow type must be results, not dashcard

* revert StaticEmbedSetupPane changes as it is unused

* create a new field for snowplow tracking
2025-04-10 00:06:29 +07:00
Nick Fitzpatrick
cfb87dc8a1 Remove copy and move shortcuts from dashboards (#56493)
* Remove copy shortcut from dashboards

* Also remove mod+m shortcuts
2025-04-09 22:26:18 +05:30
Dan Stone
dee486d3e1 Add temporary authz skip for data editing (#56370)
Removes admin auth for table edits very temporarily!

Add new variable MB_DATA_EDITING_AUTHZ to turn it back on

This unblocks editing tables through dashcards for FE/demos
Will remove once design work is done on permissions / security policy
for dashcard actions
2025-04-09 17:22:31 +01:00
Raphael Krut-Landau
9fc01e8dc6 (mini-PR) Remove irrelevant msgctxt from error diagnostic modal (#56484)
Like it says on the tin
2025-04-09 09:33:23 -04:00
Jeff Bruemmer
cc4202abde docs - data picker entities (#56448)
* entity types for data picker

* dropdown and sidebar

* separate page

* note on metrics

* notes

* edit

* table
2025-04-09 09:20:22 -04:00
Kamil Mielnik
c3ec3d1a90 Fix - Column sorting does not work well with predefined column orders (#56486)
* Fix loading state shown after change

* Repro #56482

* Repro #56482

* Revert 69a7c65c99

* Add extra assertion
2025-04-09 20:17:42 +07:00
Eric Normand
6658efa2f9 Allow lhs and rhs columns to be selected in existing join (#56446)
* Allow lhs and rhs columns to be selected in existing join

* Only mark selected if there is a current selection (tests)

Also simplify the test.
2025-04-09 08:05:00 -05:00
Kamil Mielnik
d703d1a3e7 SEM-113 Format the visualization of the task results (#56383)
* Add new buttons

* Move TaskModal to its own dir

* CopyButton

* Rename

* Download

* Fix setTimeout usage in CopyButton

* Style code

* Styling

* See logs link

* Improve styling

* Format code

* Improve comment

* Extract formatTaskDetails

* Rename

* Extract getFilename

* Improve comment

* Fix text selection

* Add unit tests boilerplate

* Add test

* Remove unit test

* Remove unused function

* Test downloading

* Test task details

* Comments

* Remove useMemo

* Simplify props

* Clean up timeouts
2025-04-09 17:53:28 +07:00
Kamil Mielnik
971252a066 Fix - In some circumstances the type dropdown is not visible in full on table metadata page (#56442)
* Fix #56428

* Repro #56442

* Make vertical padding same as horizontal
2025-04-09 08:25:45 +00:00
Ngoc Khuat
2390fca3af Fix flaky unsubscribe test (#56472) 2025-04-09 08:14:05 +00:00
Uladzimir Havenchyk
db87251a3a test: several fixes for flaky tests (#56441)
* test: wait for data to load in a flaky test

* fix two more tests

* fix one more test
2025-04-09 08:36:07 +03:00
appleby
64dcfe501e Enable expression literals on additional drivers (#56334)
* Enable expression literals on drivers that pass tests

Closes QUE-780

* Update .devcontainer/Dockerfile for java 21 and node 22

This Dockerfile is apparently used by the "metabase assembler", which in turn is used by
.github/workflows/presto-kerberos-integration-test.yml to run the Presto Kerberos tests.

* Add case-with-literal-expression-test

* Review feedback: remove extra whitespace

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

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-04-08 17:20:36 -07:00
metamben
23db3d6618 Preserve non-default effective type of column in field-ref metadata (#56453)
Fixes #55171
2025-04-09 01:58:21 +03:00
github-actions[bot]
785db78108 Update translations 2025-04-08 (#56418)
* Update translation sources 2025-04-08

* Update translations

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-04-08 22:04:39 +00:00
metamben
11239d8d7b Support formatting postgres and oracle concatenation operator (#56331)
Fixes #55961
2025-04-08 23:32:18 +03:00
Riley Thompson
44274c63ad Remove partner drivers (#56403) 2025-04-08 16:31:57 -04:00
Alexander Polyankin
9c8720bc0a New MultiAutocomplete for inline editing (#56195) 2025-04-08 19:01:15 +00:00
Edward Paget
6fb0244736 feat: make cluster locking reusable (#56310)
* feat: make cluster locking reusable

Builds a more generic interface for cluster locking using our existing
retry mechanism and jdbc level timeouts that will work with any database
rather than just postgresql.

* fixup! handle alt error text on mysql/mariadb

* fixup! don't lock on h2

* fixup! move malli annotations to retry
2025-04-08 16:18:52 +00:00
Romeo Van Snick
95afcd14b1 Allow selecting multiple ranges and running those in native editor (#56420)
* Store all native editor selected ranges in redux

* Pass all selected ranges to redux

* Add repro for metabase#54799

* Fix unit tests

* Fix typo

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

* Do not intersperse space in when running selected text

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-04-08 16:59:34 +02:00
Ryan Laurie
1abbfdd637 Move toast handling into useAdminSetting Hook (#56406)
* move toast to useAdminSetting hook

* update tests

* circular import or something
2025-04-08 07:50:48 -06:00
Edward Paget
f6fbcab4d0 fix: mock time to middle of a utc day (#56296)
This test was flaking if it was run close to the boundary of a UTC day
where the models could be created one day and then the clock ticked over
to a new day before the query ran.
2025-04-08 13:49:00 +00:00
Edward Paget
b4bcdb65d3 feat: add basic schema for sso saml settings api (#56318) 2025-04-08 13:44:04 +00:00
Nathan Voxland
0ac5d0bf7f Don't update report_card.result_metadata if it has not changed (#56314)
* Don't update card metadata if it has not changed

* Store stored-metadata as a different field on info

* Fixed failing tests

* Update src/metabase/query_processor/middleware/results_metadata.clj

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>

* Addressed review comments

* Update src/metabase/query_processor/middleware/results_metadata.clj

Co-authored-by: Braden Shepherdson <braden@metabase.com>

* Addressed review comments

* Update src/metabase/query_processor/middleware/results_metadata.clj

Co-authored-by: Braden Shepherdson <braden@metabase.com>

* Addressed review comments

* fixup! exclude info map from legacy normalization

* fixup! test that metadata equality skips update

* fixup! make adding the info map conditional

* fixup! use qp.store instead of adding to info map

* fixup! remove #p

* fixup! remove cyclic dep

* fixup! move load and store fns to same ns

* fixup! test name

---------

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Braden Shepherdson <braden@metabase.com>
Co-authored-by: Edward Paget <ed.paget@gmail.com>
2025-04-08 08:27:48 -05:00
Braden Shepherdson
ba72e829bf [revisions] Include card_schema in revisions; default to 20 (#56394)
The new `:card_schema` field on `:model/Card` was wrongly excluded from Revisions.

This PR includes them, and adds a default value for old Revisions which predate `:card_schema`.
2025-04-08 13:08:09 +00:00
Ngoc Khuat
e8d96ac295 fix kondo 2025-04-08 19:12:22 +07:00
Konstantin Darutkin
eec2b53807 fix: WRK-238 extra fk columns in editable dashcard display settings (#56430) 2025-04-08 13:07:02 +01:00
Sébastien
f4511c2b97 closes VIZ-613 caret on readonly input in FF (#56380) 2025-04-08 13:45:33 +02:00
Ngoc Khuat
569ba2a134 fix deps whitespace 2025-04-08 16:34:34 +07:00
Ngoc Khuat
bf1f730534 Dynamically fetch payload example (#56421) 2025-04-08 16:28:45 +07:00
Chris Truter
d989e582c2 Merge branch 'master' into internal-tools 2025-04-08 10:45:05 +02:00
github-automation-metabase
ed9e654155 Bump net.snowflake/snowflake-jdbc from 3.23.1 to 3.23.2 (#56363)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-04-08 11:44:05 +03:00
github-automation-metabase
c92fe37769 Bump io.netty/netty-common from 4.1.118.Final to 4.2.0.Final (#56362)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-04-08 11:38:36 +03:00
Filipe Silva
e1fd2d1cdd devex: add claude tooling (#56391) 2025-04-08 09:37:04 +01:00
Oleksandr Yakushev
89f7b64763 [metrics] Add hiccup and allocation rate metrics (#56345) 2025-04-08 11:17:52 +03:00
Ngoc Khuat
4f9077f9b9 Generic action system events and example template API (#56419)
* Remodel system event notification (#56149)

* [Notification] Simplify payload for system event (#56262)

* Notification payload api (#56264)

* Update UI with new notification model (#56417)

---------

Co-authored-by: Chris Truter <chris@metabase.com>
2025-04-08 15:10:07 +07:00
Nick Fitzpatrick
2621458071 Adm 504 shortcut viewer and dashboard shortcuts (#55945)
* most dashbaord actions, shortcut side drawer

* fix build error

* converting back to modal. start setting up shortcut grouping

* Shortcut Glossary

* most global actions

* modal polish, adding shortcut context

* shortcuts e2e tests

* remove commented code

* check for context in hook, PR feedback

* fix error

* linter 🙄
2025-04-08 00:53:41 -03:00
Uladzimir Havenchyk
cbcf698e30 test: wait for data to load in a flaky test (#56409) 2025-04-08 00:40:25 +03:00
Denis Berezin
6bf89dc316 Add filters for editable table card settings (#56186) 2025-04-07 22:44:58 +03:00
Riley Thompson
d6b7f86354 Prevent Athena sync failing due to catalog (#56038) 2025-04-07 14:35:48 -04:00
Ryan Laurie
be9cffd831 Convert General Settings Page to use new components (#55064) 2025-04-07 12:22:49 -06:00
Case Nelson
ba40a8354e fix: snowflake can-connect with ssh without touching other drivers (#56325)
* fix: snowflake can-connect with ssh without touching other drivers

* Adjust host-and-port for can-connect without calling incorporate-ssh-tunnel-details
2025-04-07 12:15:26 -06:00
Aleksandr Lesnenko
ee794794ca change table cells vertical align to top instead of center for wrapping (#56256) 2025-04-07 13:52:27 -04:00
Nathan Voxland
c409a653c5 Don't need to be running "configure the scheduler" liquibase tasks during testing (#56176) 2025-04-07 12:45:34 -05:00
Case Nelson
830be48c20 fix: dont log db-details (#56386)
We were inadvertently logging db-details in the rarely used
`maybe-test-and-migrate-details`. This changes to more of a data
diff where we can still get important information on how it changed.
2025-04-07 11:41:11 -06:00
Aleksandr Lesnenko
2dba03a0d0 fix readability of map buttons (#56341) 2025-04-07 13:10:41 -04:00
Romeo Van Snick
10fff67c18 Split up expression resolver (#56350)
* Rename checkCompiledExpression to diagnoseExpression

* Add tests for arg count validation

* Add arg validator tests

* Add test for unsupported functions to diagnostics

* Add isCallExpression matcher

* Add visit helper

* Move unsupported function check to diagnostics

* Move arg validator to diagnostics

* Move arg count validation to diagnostics

* Remove EQUIVALENT_CLAUSES since we have them in config.js

* Remove database argument where no longer needed

* Add COMPARISON_OPERATORS to config

* Add LOGICAL_OPS to config

* Add NUMBER_OPERATORS to config

* Add FIELD_MARKERS to config

* Move comparison validator to diagnostics

* Simplify resolver

* Move checkers before Lib.diagnoseExpression

* Fix diagnoseExpression return type

* Move case or if operator argument check to diagnostics

* Remove unused tokenName

* Make expression types more specific

* Convert resolver to typescript

* Add test for multi-arg infix operators

* Add checker for unknown functions

* Add more tests for coalesce typing

* Add more tests for comparison operator resolving

* Add test for number operators

* Add test for logic operators

* Remove branches that are handled in the config already

* Allow mbql clause config to define the arg types

* Allow case/if to define argType too

* Move getNode and getToken to utils

* Make resolver fn required

* Validate field names in resolver

* Move trim into getMBQLName

* Fix top-level literals

* Handle expression refs

* Allow number operators to be multiple

* Add more tests for custom arg validators

* Test operator resolvers more

* Add more tests for multi arg functions with options

* Use better formatting in test

* Be more generic in getNode and getToken

* Use correct location for errors
2025-04-07 18:40:55 +02:00
Sébastien
c375e64c2d Closes VIZ-579: jarring layout change in object detail view (#56287)
* fixed console warning

* closes VIZ-579 object detail layout no longer jumps

* e2e
2025-04-07 18:26:28 +02:00
Ryan Laurie
0601021d0c use PAT for repository dispatch (#56335) 2025-04-07 10:07:11 -06:00
metamben
796a3c8290 Make mr/def assert that the docstring is a compile time string (#56381)
This is to make adding typos more difficult.
2025-04-07 15:52:27 +00:00
Vamsi Peri
2b577eb3f5 New entry for metabot team (#56384) 2025-04-07 14:46:26 +00:00
github-automation-metabase
1f197ad4cd Bump dev.weavejester/hashp from 0.3.0 to 0.4.0 (#56353)
Inspect dependency changes here: https://github.com/weavejester/hashp/compare/0.3.0...0.4.0

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-04-07 17:41:53 +03:00
Ryan Laurie
5d102ec856 Move Enterprise settings types to general types file (#56174)
* move Enterprise settings types to general types file

* not so fancy
2025-04-07 08:17:57 -06:00
Kamil Mielnik
a14ebf5f29 SEM-223 Show database type instead of MBQL type in UI (#56374)
* Show db type instead of semantic type

* Update unit tests

* Fix flaky test
2025-04-07 21:14:35 +07:00
Eric Normand
54b509bf2f Fix relative-time-view rendering (#56326) 2025-04-07 09:10:27 -05:00
Noah Moss
e2fbe3142f Retain formatting for links with no URL (#56327)
* Retain formatting for links with no URL

* Rework approach to fix tests
2025-04-07 13:34:33 +00:00
Nick Fitzpatrick
e3ba446fbd switch css rule for <FileInput /> component (#56349) 2025-04-07 10:14:50 -03:00
Chris Truter
7dc39fad70 Core table editing Undo mechanism (#56276) 2025-04-07 14:51:19 +02:00
github-automation-metabase
83d3bc708d Bump cider/cider-nrepl from 0.53.2 to 0.54.0 (#56351)
Inspect dependency changes here: https://github.com/clojure-emacs/cider-nrepl/blob/v0.54.0/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-04-07 15:28:28 +03:00
Konstantin Darutkin
b0189956b2 fix: empty viz state typecheck 2025-04-07 13:19:22 +01:00
lbrdnk
56aaaa96d7 Invalidate card's cache on PUT (#56365)
* Invalidate card cache on put

* Add test
2025-04-07 14:16:29 +02:00
Kamil Mielnik
3196d30a33 Fix - Field order sidesheet loading state breaks metadata page layout (#56369)
* Revert "Revert "Prevent CLS""

This reverts commit 043ea8a9e7.

* Add loading and error handling

* Add tests

* Refactor

* Rename tests

* Add issue tags
2025-04-07 18:42:56 +07:00
Chris Truter
95c3693642 Merge branch 'master' into internal-tools 2025-04-07 13:39:46 +02:00
Anton Kulyk
146c4dd8df Fix goal line doesn't appear on a normalized stacked bar chart (#56298)
* Normalize goal line value

* Add visual test
2025-04-07 11:41:40 +01:00
Kamil Mielnik
117785089c SEM-220 Show the data type above the Field Type dropdown (#56289)
* Make it work

* Use Mantine

* Update tests

* Display db type instead of mbql type

* Show db type instead of semantic type

* Revert "Show db type instead of semantic type"

This reverts commit 5a51c5abca.

* Update tests

* Prevent CLS

* Revert change

* Revert "Prevent CLS"

This reverts commit f74b6e80af.
2025-04-07 10:10:54 +00:00
Kamil Mielnik
216212b27a SEM-156 Extract column sorting into a separate control (#56060)
* SEM-156 Extract column sorting into a separate control (#55696)

* Add new 'Table settings' button
- remove unused CSS classes

* Add 'Edit column order' button

* Update sort_arrows icon

* Update header

* Update header

* Remove global CSS classes from MetadataHeader

* Prevent button from shrinking

* Styling

* Drop inline styles from MetadataHeader

* Add FieldOrderSidesheet & FieldOrderDropdown boilerplate

* Connect FieldOrderDropdown

* Make the sort_arrows icon math-perfect

* Sort attributes

* Lift state

* Use Select instead of Menu

* Rename FieldOrderDropdown to FieldOrderPicker

* Sort props

* Avoid using t in top level context

* Fix outline being cut off

* Add onUpdateFieldOrder prop

* Drop connect usage

* Add SortableField boilerplate

* Add inner components

* Handle disabled drag

* Remove copypasta

* Styling

* Icons

* Remove comment

* Fix dnd

* Remove redundant key prop

* useDragOverlay

* Prevent flicker

* Remove old sort button

* Keep sidesheet in sync when closed

* Drop SortableColumn

* Remove SortableList from MetadataTableColumnList

* Improve spacing

* Simplify SortableField interface

* Fix state issues

* Update unit tests

* Update unit tests

* Make focus state match border radius of the content

* Add comment

* Update e2e tests

* Remove comment

* Use useDisclosure

* Add a comment

* Reduce sorting complexity

* Rename

* Simplify logic
2025-04-07 14:47:30 +07:00
Noah Moss
f231f3b519 Disable indefinite vertical panning on leaflet maps, and enable smooth horizontal wrapping (#56329) 2025-04-04 23:34:34 -04:00
Tyler Plude
4126202645 Hide trend line widget when multiple series present (#54107)
* Hide trend line widget when multiple series present

* Adding unit test for trend line hidden state

* Prettier
2025-04-04 17:32:59 -07:00
Tyler Plude
d8705ab9b9 Fixing typo in embed type ui (#56116) 2025-04-04 16:25:36 -07:00
Aleksandr Lesnenko
88ce89e065 fix bar width on non-linear x-axis scales (#56265) 2025-04-04 22:05:04 +00:00
Oleksandr Yakushev
6e957d4ab7 perf: Optimize available-drivers-info (#55970) 2025-04-05 01:02:06 +03:00
bryan
c9d926e018 Do not enforce table cruftiness during updates (#56312)
* do not enforce table cruftiness during updates

- matches original behavior

* add test
2025-04-04 14:25:30 -06:00
Nemanja Glumac
d186e5d0e8 Empty states for visualizations (#55706)
This commit introduces empty states for visualizations 
in order to help less experienced users create their first chart. 

These new empty states come in two flavors:
1. With a "Summarize" button CTA that will open the summarize sidebar
2. With a link to our helpful documentation (for more complex charts)

We have been previously relying on the `placeholderSeries` dummy data to display a greyed out chart preview when we cannot render a chart. That functionality is now replaced with a new property called `hasEmptyState`.

`checkRenderable()` util will try to render a chart based on the series and settings. If it is unable to do so, it will throw a `ChartSettingsError`. This, in combination with hasEmptyState and a few other properties, is a cue to render a new, empty state for that visualization.
2025-04-04 21:34:37 +02:00
Case Nelson
304da4aba7 Revert "fix: properly test snowflake ssh connection details" (#56315)
This reverts commit 0fc5cbe7dc.
2025-04-04 13:14:06 -06:00
Luis Paolini
9e10b9c131 Add note about allowtcpforwarding (#56320) 2025-04-04 19:11:12 +00:00
Raphael Krut-Landau
a65865fce2 Test that sandboxing fails closed when misconfigured (#56110) 2025-04-04 15:04:58 -04:00
Aleksandr Lesnenko
3a93e08dbe skip loki flaky table test (#56305)
* skip loki flaky table test

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-04-04 18:27:41 +00:00
Riley Thompson
921e0a4ffc Replace - with _ in Mongo join aliases (#56185) 2025-04-04 18:18:09 +00:00
appleby
3c40ebd387 Expression literals milestone 2 (#56254)
* Initial BE changes for custom expression literals (#55206)

* Empty

* Add `value` support in the expression editor (#55203)

* Literals in filters tests (#55283)

* E2E tests for literals in custom columns (#55288)

* BE changes for :value wrapped expression literals

* Extend BE test with more literal values

* Add float value to qp test for expression literals

* Add Float and Boolean cases to literal-expression-test

* Remove ^:internal from value clause

:value clauses are now generated by the frontend when creating a top-level expression literal and preserved when
converting legacy <-> pMBQL.

* Add some lib.convert tests for literal custom expressions

* Add legacy schema tests for literal custom expressions

* Add normalize / canonicalize tests for literal custom expressions

* Remove vestigial "date" expression from fields clause in query-with-literal-custom-expression-test

* Fix literal-expression-test for cljs

CLJS parses 1.00 as 1 and hence :type/Integer not :type/Float

* Fix js_test expression-clause-<->-legacy-expression-test for wrapped literals

* Move QP tests into expressions_test.clj and add more tests

* Remove commented out :value and update comment in stage-expressions->legacy-MBQL

* Restrict QP literal expressison tests to supported drivers

* Update boolish->bool to accept BigDecimal inputs

Apparently some DBs return BigDecimal results for boolean expressions.

* Temporarily remove literal-expression-case-test

Needs more debugging

* Move aggregations tests into expression_aggregations_test.clj

* Add some basic filter tests to QP expressions_test.clj

* E2E tests for literal custom columns in other clauses and fixes (#55295)

* E2E tests for literal custom columns in other clauses and fixes (#55295)

* Move changes from the FE branch

* Move changes from the FE branch

* Move changes from the FE branch

* Fix filter schema and false = false filter (#55417)

* Fix date/string literals effective type (#55427)

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix malformed order-by clauses

* Remove tests for offset expressions as non-aggregation expressions

These tests were initially added in #42302, but we disabled offset in custom columns in #43224.

Remove these tests so we can re-enabled nest-expressions when expressions appear in an order-by clause.

https://metaboat.slack.com/archives/C0645JP1W81/p1742317450874479

* Add order-by to the list of places to check in should-nest-expressions?

This is to support order-by of custom expressions, in particular literal custom expressions.

https://metaboat.slack.com/archives/C0645JP1W81/p1742317450874479

* Rename round-trip-expression-literal-test and move it next to existing literal tests in the same file

* Uncomment filter-literal-boolean-expression-with-no-operator-test

The schema was relaxed in bd82763beb, so now the test passes.

* Uncomment filter-literal-expression-with-and-or-test

* Add round-trip-filter-expression-test

* Add more cases to legacy schema filter-test

* Remove unused import

* Review feedback: set/difference -> disj

* Add :expression-literals driver feature (#55662)

* Add the :expression-literals database feature

And enabled it for postgres, mysql, bigquery, and snowflake.

These are the tier 1 and tier 2 DBs, minus redshift which is currently failing some tests.

* Add lib.metadata/database-supports? helper

* Check if :expression-literals feature is enabled in diagnose-expression

* Use standard-literal-expression-values in order-by test expectation

* Add comment about compiler warning to boolish->bool

* Add breakout-by-literal-expression-test

* Add expression-literals-test to nested-queries-test

* Add compound expressions involving literal custom columns to e2e filters tests

* Use lib.schema.common/is-clause? to detect :value expr in diagnose-expression

* Review feedback: fix order-by-integer-literal-expression-test

* Review feedback: conj -> vector

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>

* Add explicit CAST when compiling string literal expressions in H2 driver (#55920)

* Add explicit CAST when compiling string literal expressions in H2 driver

Closes QUE-726

* Add e2e test for nested question with literal custom columns

* Add :expression-literals feature to various mock providers used in tests

* Update diagnose-expression tests

* Ensure legacy :value options are normalized in mbql.normalize

Values coming from the FE in expression-clause-for-legacy-expression call normalize and expect to have :value options
converted from strings to keywords.

* Add base_type to value literals in adjustTopLevelLiteral

* Consistent spelling of base_type

* Use lib.metadata/database-supports? to check for database :features (#56114)

* Use lib.metadata/database-supports? to check for database :features

Closes QUE-836

* Convert a couple more tests to use meta/updated-metadata-provider

* Add e2e test to ensure that sandboxing on literal custom column fails closed (#56190)

* Add e2e test to ensure that sandboxing on literal custom column fails closed

Closes QUE-844

* Review feedback: dedup CustomColumnType definition

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-04-04 11:02:06 -07:00
bryan
260a02887e Mage jar download finds latest major version (#56309)
* scrape releases page to find latest major version

e.g.:

```
$./bin/mage jar-download 50
Warning: JARS not found in env.
Looking for latest version of 50 on release page 1
Downloading from: https://downloads.metabase.com/enterprise/v1.50.35/metabase.jar
              to: /Users/bcm/dv/mb/metabase/jars/metabase_1.50.35.jar ...
Downloaded 1.50.35.jar to /Users/bcm/dv/mb/metabase/jars
```

* better feedback
2025-04-04 12:00:43 -06:00
Chris Truter
349d0503fc Merge branch 'master' into internal-tools 2025-04-04 18:32:07 +02:00
Sébastien
c03a20dae7 Closes VIZ-588 wrong hover index (#55910)
* closes VIZ-588 wrong hover index

* test

* type
2025-04-04 17:54:34 +02:00
github-actions[bot]
9a521649a3 Update translations 2025-04-01 (#56045)
* Update translation sources 2025-04-01

* Update translations

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-04-04 15:21:36 +00:00
Kamil Mielnik
89153b5504 SEM-210 Show database and table of each segment in the segment admin list (#56151)
* Make segment name clickable

* Upadte e2e test

* Convert SegmentItem to TS

* Modernize SegmentItem

* Add cells

* Add TableBreadcrumbs component

* Use TableBreadcrumbs in SegmentEditor

* Use real data

* Improve data handling

* Handle ellispis

* Add tests

* Add test for no schema

* Rename

* Prettier

* Update icon color

* Fix icon shrinking

* Use TableBreadcrumbs in SegmentItem

* Fix icon shrinking

* Update max width

* Update tests

* Sort

* Remove css file
2025-04-04 14:51:06 +00:00
Eric Normand
c4749ad880 Implement text() and date() on bigquery (#56180) 2025-04-04 14:33:22 +00:00
Eric Normand
dcaeb12485 Implement text() and date() on mysql (#56177) 2025-04-04 14:31:31 +00:00
Eric Normand
c1ae2a738a text() and date() on snowflake (#56178) 2025-04-04 14:31:07 +00:00
Chris Truter
5eca4d39df Return just the number of rows created by webhook (#56293)
* Return just the number of rows created by webhook
* More defensive code, although I don't know what we're defending against
2025-04-04 16:23:26 +02:00
Kamil Mielnik
eec2e8034a SEM-211 Show database name for the segment's table in the editing screen (#56213)
* Add TableBreadcrumbs component

* Use TableBreadcrumbs in SegmentEditor

* Use real data

* Improve data handling

* Handle ellispis

* Add tests

* Add test for no schema

* Rename

* Prettier

* Update icon color

* Fix icon shrinking

* Remove css file
2025-04-04 14:13:21 +00:00
Uladzimir Havenchyk
18f5b5282b test: scroll in the virtual table (#56269)
* test: scroll in the virtual table

* fix linting issues

* revert assert back
2025-04-04 14:02:03 +00:00
Jeff Bruemmer
e8ba2da551 drop leading equals operator (#56294) 2025-04-04 09:53:06 -04:00
Jeff Bruemmer
631bb25266 add metabase logo (#56292) 2025-04-04 13:40:44 +00:00
Mahatthana (Kelvin) Nomsawadi
8aa1b56dc6 Deploy SDK with Metabot (#56282) 2025-04-04 14:36:46 +01:00
Alexander Solovyov
5b2124da6e use webhook's creator_id as a current user for inserting/sending events (#56291) 2025-04-04 16:21:40 +03:00
Alexander Solovyov
53873c22b1 a bit more clear webhook data errors (#56288) 2025-04-04 16:07:59 +03:00
Konstantin Darutkin
cc84410ac3 feat(enterpripse): configure column visibility for editable table (#56209) 2025-04-04 14:06:37 +01:00
Kamil Mielnik
d1ce4b64a2 Fix product screenshot link in README (#56268) 2025-04-04 19:48:35 +07:00
Uladzimir Havenchyk
29c361e150 test: wait for data in a flaky test (#56248)
* test: wait for data in a flaky test

* one more check

* set smaller viewport

* add wait

* add a helper
2025-04-04 19:45:16 +07:00
github-automation-metabase
a8463d2a47 Update Readme version references and published npm version to 0.55.1-nightly (#56277) 2025-04-04 12:28:45 +00:00
Chris Truter
3f5333cd22 Merge branch 'master' into internal-tools 2025-04-04 14:15:23 +02:00
Mahatthana (Kelvin) Nomsawadi
a54b7ed035 Fix wrong default cell background color on SDK (#55669) 2025-04-04 12:24:56 +01:00
Phoomparin Mano
2725e33502 ci(sdk): set the nightly version in master to 55 (#56273) 2025-04-04 18:23:28 +07:00
Phoomparin Mano
8a8e0c6e5b Enable PDF and card result downloads individually in static and public embedding (#56131)
* scaffold setting up individual downloads

* use downloadsEnabled as boolean for result downloads

* allow SDK to use a single withDownloads props for compatibility

* sdk static dashboard should continue to support single withDownloads prop

* update downloads prop to be string compatible

* fix the areDownloadsEnabled matcher

* refactor download plugin matcher

* do not modify EmbedDisplayParams for now

* fix misleading types

* remove ConnectedDashboard default

* undo LookAndFeelSettings

* revert embed flow and analytics changes

* add test cases for public resource downloads

* add test cases for public question download

* do not support PDF downloads on questions

* remove redundant showDashboardCardActions

* create types for download results

* rename cardResult to dashcard

* replace cardResult with dashcard

* add downloadsEnabled to storybook

* update unit test for areDownloadsEnabled

* update unit test for no-token case

* update unit test for oss case

* try to disable downloads in storybook

* update story defaults

* make downloadsEnabled a component default

* add default to downloadsEnabled in PublicOrEmbeddedDashboardView for loki

* revert changes as loki diffs seems good now

* fix loki diff issue in stories
2025-04-04 17:24:21 +07:00
Ngoc Khuat
6269563254 Merge branch 'master' into internal-tools 2025-04-04 10:58:28 +07:00
Aleksandr Lesnenko
1d819fac28 skip tooltip loki specs (#56250) 2025-04-03 23:10:40 +00:00
Denis Berezin
b061cc3b9b Fix issues with duplicated columns (#56243) 2025-04-03 23:28:43 +03:00
Oreon Lothamer
4b6ed446b2 add additional fields to payload for create-release-issues (#55956) 2025-04-03 09:44:31 -10:00
Eric Normand
ce99b5c4f5 Integration branch for generalizing cast tests (#55952)
* Empty

* Date generalized tests (#55953)

* Centralize and generalize tests for `integer()`

Also make room for other casting functions to be similarly tested

* Remove unsued imports

* Move postgres date cast test into cast_test.clj

* Rename :cast to :expressions/date

* Remove old imports

* Remove unused features

* Remove more!

* Fix test files

* Centralize and generalize tests for `integer()` (#55950)

* Centralize and generalize tests for `integer()`

Also make room for other casting functions to be similarly tested

* Remove unsued imports

* Example tests for integer()

* Remove empty line

* Use field type

* Appease the Kondo

* Check for Number instead of Integer

* Cast to big-integer before comparing (for snowflake)

* Remove split-part-test. It doesn't belong in this branch.

* Rename :cast to :expressions/integer

* Fix parens after merge

* Unified text() tests

* Appease the kondo

* Appease the whitespace demons

* Oops, wasn't filtering for drivers

* Use literal string for redshift
2025-04-03 13:16:15 -05:00
Nathan Voxland
0eff2ec6de Support for individual google sheets (#54938)
Co-authored-by: bryan <bryan.maass@gmail.com>
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-04-03 12:52:58 -05:00
Jeff Bruemmer
832be65250 docs - various changes (#56230)
* path

* add firebolt driver

* remove api description
2025-04-03 17:50:41 +00:00
Phoomparin Mano
c5d31e8ba2 fix(sdk): fix dataset endpoint being called on every re-render (#56100)
* fix missing useMemo in ad-hoc question

* add a test case for EMB-288

* fix test case for interactive dashboard
2025-04-03 23:43:36 +07:00
Uladzimir Havenchyk
5546d00759 test: use dynamic data for referencing columns and tables instead of static (#56139) 2025-04-03 14:31:51 +00:00
Raphael Krut-Landau
d02f98c519 (mini-PR) Localize string in sidesheet (#56221)
Let's localize the string "Learn more" in the question info sidesheet
2025-04-03 10:26:07 -04:00
Edward Paget
23ffd1ce0a fix: make saml issuer identity required in FE (#56154) 2025-04-03 09:08:46 -05:00
Timofey Kachalov
1bb78814cf feat(sdk): Use dts rollup to generate a single .d.ts file with types (#56205) 2025-04-03 17:47:56 +04:00
Kamil Mielnik
103a64f3ad Fix - When DB is stuck in a Sync Loop, DB List in Native Editor Blinks Constantly (#55995)
* Add a repro for #55951

* Fix typos

* Refactor repro

* Fix #55951

* Remove unused components

* Use 'loading'

* Format code

* Fix test setup

* Rename isLoading back to isSearchLoading since it indicates Search.loadList usage

* Use 1 /search API call instead of 2

* Get rid of rawData

* Update unit tests
2025-04-03 20:27:21 +07:00
dpsutton
45c30a4676 Changelog for api/card/:card-id/query/export-format (#56189)
Examples in 52:
-----

```
52:

WORKS (form data)
curl 'http://localhost:3002/api/card/119/query/csv' \
  -H "x-api-key: $KEY_52" \
  -H 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8' \
  --data-raw 'parameters=%5B%7B%22id%22%3A%227c1e5d79-453a-490e-a507-ffba548aa071%22%2C%22type%22%3A%22id%22%2C%22value%22%3A%5B%225%22%5D%2C%22target%22%3A%5B%22dimension%22%2C%5B%22template-tag%22%2C%22param%22%5D%5D%7D%5D&format_rows=true&pivot_results=false'

WORKS (query param)
curl 'http://localhost:3002/api/card/119/query/csv?parameters=%5B%7B%22id%22%3A%227c1e5d79-453a-490e-a507-ffba548aa071%22%2C%22type%22%3A%22id%22%2C%22value%22%3A%5B%225%22%5D%2C%22target%22%3A%5B%22dimension%22%2C%5B%22template-tag%22%2C%22param%22%5D%5D%7D%5D&format_rows=true&pivot_results=false' \
  -X POST \
  -H "x-api-key: $KEY_52"

DOES NOT WORK (json body)
curl 'http://localhost:3002/api/card/119/query/csv' \
  -H "x-api-key: $KEY_52" \
  -H 'Content-Type: application/json' \
  --data-raw '{"parameters": [{"id":"7c1e5d79-453a-490e-a507-ffba548aa071","type":"id","value":["5"],"target":["dimension",["template-tag","param"]]}], "format_rows": true}'
```

Examples for 53:
---------
```
53:
WORKS
curl 'http://localhost:3003/api/card/113/query/csv' \
  -H 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8' \
  -H "x-api-key: $KEY_53" \
  --data-raw 'parameters=%5B%7B%22id%22%3A%229971a99a-32cb-4b6c-8339-584884e3b3e2%22%2C%22type%22%3A%22id%22%2C%22value%22%3A%5B%225%22%5D%2C%22target%22%3A%5B%22dimension%22%2C%5B%22template-tag%22%2C%22param%22%5D%5D%7D%5D&format_rows=true&pivot_results=false'

WORKS:
curl 'http://localhost:3003/api/card/113/query/csv' \
  -H "x-api-key: $KEY_53" \
  -H 'Content-Type: application/json' \
  --data-raw '{"parameters": [{"id":"9971a99a-32cb-4b6c-8339-584884e3b3e2","type":"id","value":["5"],"target":["dimension",["template-tag","param"]]}], "format_rows": true}'

DOES NOT WORK
curl 'http://localhost:3003/api/card/113/query/csv?parameters=%5B%7B%22id%22%3A%229971a99a-32cb-4b6c-8339-584884e3b3e2%22%2C%22type%22%3A%22id%22%2C%22value%22%3A%5B%225%22%5D%2C%22target%22%3A%5B%22dimension%22%2C%5B%22template-tag%22%2C%22param%22%5D%5D%7D%5D&format_rows=true&pivot_results=false' \
  -X POST \
  -H "x-api-key: $KEY_53"
```
2025-04-03 08:25:21 -05:00
Oisin Coveney
6d7ae96779 fix(sdk): Add questionProps to dashboard components (#55993) 2025-04-03 16:23:31 +03:00
Romeo Van Snick
4187e57c4a Multi line help text (#56155)
* Allow detecting enclosing function in multiline expressions

* Add repro for metabase#56152
2025-04-03 15:07:10 +02:00
Alex Yarosh
8bd3844525 update api and anv var docs (#56198) 2025-04-03 08:48:49 -04:00
Konstantin Darutkin
71e72f6645 feat(enterprise): api-based category search (#56088) 2025-04-03 13:02:30 +01:00
Konstantin Darutkin
60d8da092d fix: category select btn type (#56208) 2025-04-03 12:49:24 +01:00
Konstantin Darutkin
fc5a81afe5 refactor: move editable table siderbar into separate folder (#56204) 2025-04-03 12:23:36 +01:00
Dan Stone
46500e2157 Invalidate field-values on update/insert (#56203) 2025-04-03 12:02:58 +01:00
Uladzimir Havenchyk
71437e758e Merge branch 'master' into internal-tools 2025-04-03 13:55:46 +03:00
Kamil Mielnik
bff123bb45 SEM-212 Allow clicking on the Segment's name to navigate to its edit screen (#56146)
* Make segment name clickable

* Upadte e2e test
2025-04-03 15:18:11 +07:00
Alexander Solovyov
a2ee4eaa22 sorry i messed up (#56202) 2025-04-03 10:19:37 +03:00
Alexander Solovyov
91aa513d43 could this fix a pg flake? (#56201) 2025-04-03 09:41:55 +03:00
Chris Truter
b63e596d37 Revert search engine default to in-place (#56199) 2025-04-03 06:08:59 +00:00
Chris Truter
129510e174 Merge branch 'master' into internal-tools 2025-04-03 07:15:36 +02:00
Edward Paget
2600de0663 fix: deadlock in last used at (#56173)
* fix: deadlock in last used at

This prevents bulk updates to last used at from deadlocking by creating
a new table in metabase's database that can be used by instances to take
cluster wide locks. It adds an initial implementation of a customizeable
db-based locking mechanism.

For the last_used_at update, a metabase instance will first set a
session variable to control locking timesout then take a cluster lock
using SELECT * FROM metabase_cluster_lock WHERE lock_name = 'name' then
execute the update_at.

If another table is holding this lock metabase will wait .5s for the
lock to be released then timeout its SQL transaction, sleep the Thread
for 1s then retry taking the lock. This makes sure we're not holding DB
connections waiting for locks.

* fixup! kondo

* Update resources/migrations/001_update_migrations.yaml

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>

* Update src/metabase/query_processor/middleware/update_used_cards.clj

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>

* fixup! finish method rename

---------

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-04-02 20:47:20 -05:00
Riley Thompson
5f7b7cb812 Fix MySQL JSON decimals (#56102) 2025-04-03 00:17:04 +00:00
Tyler Plude
e04d00c264 Fix formatter support for field id or name col settings (#55067)
* Fix formatter support for when both field ids and col names are used in viz settings

* Apply fix in qp common as well, which date formatter consumes

* Addressing PR feedback and breaking up large test

* Fixing or->merge reversion; adding datetime formatter tests

* Improving viz setting merges based on types of field_ref and column setting keys

* Addressing PR feedback
2025-04-02 14:48:52 -07:00
Jeff Bruemmer
d2bcabb33c docs - remove partner drivers (#56184) 2025-04-02 21:35:17 +00:00
Denis Berezin
4f997cf438 Fix FK display by removing double remapping (#56163) 2025-04-03 00:26:36 +03:00
Eric Normand
e1c7441569 Unified tests for splitPart() (#55941)
* Unified tests for `splitPart()`

* Remove postgres specific split-part-test

* Remove Redshift split-part-test

* Remove snowflake split-part-test

* Remove mysql split-part-test

* Remove bigquery-specific split-part test

* Fix MySQL implementation of splitPart()

* Only allow string literals for 2nd and 3rd args of replace()

* Only allow non-empty string for delimiter of splitPart()

* Better non-blank string

* Make position in splitPart() positive literal or numeric expression

* WIP new examples tests + corner cases

* Oops, go back to non-empty string

* Improve tests

* Improve test message

* Empty string on non-positive position in splitPart() for mysql and postgre

* Fix Redshift error

* Snowflake: return empty string with non-positive position

* Also test zero position

* Correct misplaced paren

* Fix `splitPart()` for snowflake

* Nicer comment on weird mysql implementation

* Rename positive-integer schema

* Clearer parameter comments
2025-04-02 21:01:55 +00:00
eliotmetabase
8ff8ed3494 Change decimal field for Number question to only accept positive integers and update E2E test to cover edge cases (#56112) 2025-04-02 13:03:47 -07:00
Oleksandr Yakushev
f0ba0e628a perf: Optimize settings retrieval (#55969) 2025-04-02 22:52:57 +03:00
bryan
8d5baa6a73 dont skip mage tests when BE job is skipped (#56170)
* dont skip mage tests when BE job is skipped

* checkout metabase for mage tests

* make mage tests its own thing

* add mage test workflow

* if it aint broke dont fix it

* remove dupe mage test from backend workflow
2025-04-02 19:50:37 +00:00
Jeff Bruemmer
dbefc5643a docs - table viz updates (#56162)
* paginate table on dashcards
2025-04-02 15:03:08 -04:00
Eric Normand
d1a4eb463e Rename :cast in tier 2 databases (#56158)
* Empty

* Rename :cast in tier 2 databases
2025-04-02 13:23:36 -05:00
Case Nelson
b618a16569 Merge branch 'master' into internal-tools 2025-04-02 11:50:51 -06:00
Case Nelson
273ecb3b63 fix: attempt #2 to skip adding non-existent partner jars (#56171) 2025-04-02 11:49:45 -06:00
Edward Paget
bc2c0b2fa7 fix: correct setting name check for static stats (#56145)
* fix: correct setting name check for static stats

also fix namespace for the defenterprise in token check to load the
embedding stats module

* fixup! use get-raw-value

* fixup! use-get-value-of-type
2025-04-02 17:37:54 +00:00
Alexander Solovyov
a1b21329ec Merge remote-tracking branch 'origin/master' into internal-tools 2025-04-02 20:24:39 +03:00
Case Nelson
3f6b4e3938 fix: ee-build should skip adding jars when there are none (#56166) 2025-04-02 11:18:44 -06:00
Eric Normand
e2ae5b91a8 Split :cast into three features (#56153)
* Split :cast into three features

* Update frontend feature names

* Update changelog

* PoC

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-04-02 17:01:19 +00:00
Alexander Solovyov
98aaa51b26 Merge remote-tracking branch 'origin/master' into internal-tools 2025-04-02 19:46:31 +03:00
Jeff Bruemmer
073300b47e docs - mention config file on api keys page (#56150) 2025-04-02 12:45:37 -04:00
Riley Thompson
74b62202b9 Make mongo between condition inclusive (#56087) 2025-04-02 12:13:44 -04:00
Noah Moss
f07d1810ea Remove opacity from viz settings gear icon (#56143)
* remove opacity from view button icon

* remove reference to ViewButtonIcon CSS module
2025-04-02 11:28:01 -04:00
Chris Truter
81dee319cb Fixup dashboard model validation (#56147) 2025-04-02 16:20:08 +02:00
Konstantin Darutkin
e88dc44592 feat: add editable table dashcard configuration sidebar (#56136)
* feat: add editable table dashcard configuration sidebar

* fix: review fixes
2025-04-02 14:31:15 +01:00
Alexander Solovyov
86dffe61d9 Merge remote-tracking branch 'origin/master' into internal-tools 2025-04-02 16:19:44 +03:00
Braden Shepherdson
9cd41f0b6f Fix chain filters on public dashboards (#56096)
Fixes [QUE-838](https://linear.app/metabase/issue/QUE-838/linked-filters-are-not-working-on-public-dashboards).

Query params were getting parsed incorrectly to a map like `{:17fdc812 ...}`
with a keyword rather than a string. These failed to match any of the
dashboard's parameters (which are keyed by strings like `"17fdc812"`)
and returned no values (but did not throw any errors in prod).
2025-04-02 13:12:00 +00:00
Uladzimir Havenchyk
429ade95bd attempt to fix e2e tests 2025-04-02 15:53:00 +03:00
Dan Stone
c228954ffe Add webhook ingestion support (#56024)
Added ability to create unauthenticated webhook endpoints that can
insert rows into the database.

Hooks are expected to fire a single record or multiple records at the
generated endpoint.

Moved some logic around (adding data_editing.clj) in order to accomodate
new public endpoints that share behaviour with the existing insert
endpoint.
2025-04-02 13:41:43 +01:00
Chris Truter
1f867c6e64 Make editables models instead of questions (#56135)
* Make editables models instead of questions

* seems to be fine

* Make it more defensive
2025-04-02 14:27:24 +02:00
Kamil Mielnik
acacf330ec Fix - Visibility explanation copy is the same across all 3 options (#56081)
* Fix #56077

* Repro #56077
2025-04-02 19:06:10 +07:00
Mahatthana (Kelvin) Nomsawadi
a9a62e5b82 Fix storybook not working with MetabotQuestion (#56127) 2025-04-02 12:47:43 +01:00
Alexander Solovyov
aef83abf34 Merge remote-tracking branch 'origin/master' into internal-tools 2025-04-02 13:42:12 +03:00
Alexander Solovyov
1020b3dcee fix testing and CDPATH issues with mage (#56125)
also make script code a bit simpler with early breaks
2025-04-02 13:40:45 +03:00
Ngoc Khuat
339b7d1dd4 Flaky test fix: unsubscribe-receive-email-test (#56123) 2025-04-02 09:26:37 +00:00
lbrdnk
e0e833aa52 Add String->Float coercion strategy (#55863)
* Implement string to decimal coercion

* Use float coercion

* Add coercion to mongo

* Use float8

* Update dataset def

* Update coercion to float

* Temp dynamic-dataset-loading

* Comment

* Use ->float multimethod

* Rename dataset

* Enable test for dbs with preloaded datasets
2025-04-02 11:13:32 +02:00
Alexander Solovyov
94ca368631 Merge remote-tracking branch 'origin/master' into internal-tools 2025-04-02 10:37:00 +03:00
Ngoc Khuat
0dc44b4551 Add job context for all quartz jobs (#55889) 2025-04-02 03:44:47 +00:00
Ryan Laurie
8ef81c9a91 revert #56007 (#56111) 2025-04-01 16:11:44 -06:00
Uladzimir Havenchyk
641e170996 test: add native query test to flaky group (#56093) 2025-04-01 21:01:08 +00:00
John Swanson
3f78551385 Add ./bin/mage start-maildev command (#56074)
* Add `./bin/mage start-maildev` command

```
$ ./bin/mage start-maildev
Killing existing `mb-maildev` container...
Running: docker run -d -p 1080:1080 -p 1025:1025 --name mb-maildev maildev/maildev
8b01ba798a18192d02d1fdc3e7874fd03586f91063069db017d44baf30a38c47
Configure Metabase to send emails using localhost:1025
View Maildev UI at http://localhost:1080
```

* Update bb.edn

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

---------

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-04-01 13:12:03 -07:00
Case Nelson
e5ed289651 task: update ee-extra to understand noop from registry (#55934) 2025-04-01 13:59:28 -06:00
Luiz Arakaki
ff42a7c926 Update usage analytics to 54 (#55908)
Closes #55568
Resolve field entity-ids
Adds is_verified to the content model
Adds status to the tasks model
Minor changes to the content
2025-04-01 15:00:38 -03:00
Jeff Bruemmer
94abd0f302 docs - note on caching and permissions (#56034)
* note on caching and permissions

* differentiate caching

* clarify caching

* remove impersonation note
2025-04-01 13:54:14 -04:00
William
a4ee7f4eb7 Bigquery handles nested fields in nested queries appropriately (#56033)
Before, when you had an outer query referring to something in a nested field from the inner query, the query processor
would assume the field is still nested and generate invalid sql.  Now, it will just refer to the alias.
2025-04-01 12:06:54 -05:00
Aleksandr Lesnenko
2aa82343e2 fix scatter charts freeze (#56016) 2025-04-01 11:48:16 -04:00
Nicolò Pretto
ebc59ff5fd ci: run sample app tests and sdk cross version tests on draft prs (#56008) 2025-04-01 15:43:05 +00:00
Uladzimir Havenchyk
90f1364fe2 test: add a fix for flaky test but move to jail anyway (#56071) 2025-04-01 15:29:58 +00:00
Stas Gavrylov
da350584e8 Fix unsubscribe for table notifications (#56082) 2025-04-01 18:10:01 +03:00
Alexander Solovyov
6b3d024d9d fix schedules (#56079) 2025-04-01 17:21:56 +03:00
Arkadi Yaroslavtsev
bb58f77a79 Add cloud-ops as codeowners of prometheus.clj (#56073)
So that cloud-ops can verify new metrics are sound and usable for cloud o11y. 

See https://www.notion.so/metabase/Implementing-a-Prometheus-metric-for-your-feature-14569354c901804b97a3dfcf2fecfc22?pvs=4#15169354c90180a7a4daf6b43820cdd8
2025-04-01 10:12:43 -04:00
Alexander Solovyov
37a9a6c0f3 Merge remote-tracking branch 'origin/master' into internal-tools 2025-04-01 17:00:26 +03:00
Stas Gavrylov
ca30fb63a1 WRK-198: Custom notifications templates (#56065)
* WRK-198: Custom notifications templates. Tabs version

* WRK-198: Refactor UI for custom alert templates
2025-04-01 16:57:46 +03:00
Stas Gavrylov
0f094446f1 WRK-213: Adjust available intervals for 'by the minute' schedule option (#56068) 2025-04-01 16:21:53 +03:00
Alexander Solovyov
1719ebc9c7 :row/delete also wanted some joins (#56075) 2025-04-01 15:58:09 +03:00
Chris Truter
d9b2b96474 kick ci 2025-04-01 14:51:28 +02:00
Alexander Solovyov
79db162e9e fix tests for new actions code (#56070) 2025-04-01 14:31:16 +03:00
Ngoc Khuat
a582ad33c4 [Notification] Improve memory usage for alerts (#55896) 2025-04-01 11:29:17 +00:00
Uladzimir Havenchyk
83ebdb8afd test: move flaky test to jail (#56039) 2025-04-01 14:13:20 +03:00
Ngoc Khuat
5189a40ce4 Spec update add support for reverse PK (#56047) 2025-04-01 17:37:13 +07:00
lbrdnk
0eec5c335f Fix coercion for model (#55870)
* Fix coercion for model

* Add test

* Update test
2025-04-01 11:03:25 +02:00
Kamil Mielnik
f541df16f8 Global scrollIntoView & scrollBy mocks (#55983)
* Remove redundant mocks

* Use jest.fn

* Remove scrollIntoViewMock from setup

* Remove mockScrollIntoView

* Remove mockScrollTo and mockScrollBy

* Introduce getScrollIntoViewMock

* Remove remaining scrollIntoView mocks
2025-04-01 08:57:18 +00:00
Chris Truter
51ad937543 Fix lazy editable card creation. Update missed dashboard API tests. (#56061) 2025-04-01 10:57:12 +02:00
Chris Truter
1035825e94 Fix fallback to default template (#56059) 2025-04-01 10:42:05 +02:00
Sébastien
08a13afd28 Closes VIZ-289 duplicated cards never ending loading state (#55256)
* closes VIZ-289 duplicated cards never ending loading state

* added test
2025-04-01 10:37:44 +02:00
Oisin Coveney
49cec30f3f Fix console.warn message (#56004) 2025-04-01 11:36:27 +03:00
Alexander Solovyov
6f009d56ce Fix row create (#56010) 2025-04-01 11:29:22 +03:00
Alexander Solovyov
44d2658f13 merge master 2025-04-01 11:28:47 +03:00
Romeo Van Snick
f6cecc0960 Fix overflow in expression editor suggestions (#55986)
* Fix overflow in custom expression suggestions

* Add repro for #55984

* Use isScrollableHorizontally helper

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

* Use isScrollableHorizontally helper

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

* Don't allow icon to shrink

* Allow suggestion names to break

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-04-01 08:17:25 +00:00
Nemanja Glumac
d9779da94a Respect whitelabeling when showing the instructional video (#55987) 2025-04-01 10:26:49 +03:00
Oisin Coveney
f2b5cf8fcb QueryDownloadPopover -> QuestionDownloadWidget + QueryDownloadWidget -> QuestionDownloadPopover (#55894) 2025-04-01 10:01:28 +03:00
Romeo Van Snick
1e48077705 Merge expression tokenizer and lexer (#55916)
* Move the lexifier to it's own file

* Remove duplicate type union member

* Remove unused typeinferencer

* Add ParseError type to errors

* Lexify straight in to pratt.Token

* Remove unused TOKEN type

* Use pratt.Token type everywhere

* Fix type

* Remove unused __support__/expressions helper file

* Ignore END_OF_INPUT when matching suggestions
2025-04-01 08:33:53 +02:00
Tyler Plude
00527b55c0 Add display-as image support for table static viz (#55388)
* Add display-as image support for table static viz

* Adding table unit test for view-as image setting
2025-03-31 16:42:07 -07:00
Ryan Laurie
f62755dc9b Add Important Info to Pull Requests (#56007) 2025-03-31 16:34:02 -06:00
Uladzimir Havenchyk
1a990b898b test: fix flake caused by popover appearance order (#55989)
* test: fix flake caused by popover appearance order

* put back flaky tag
2025-04-01 00:23:13 +03:00
Uladzimir Havenchyk
0bebb404eb test: fix flake caused by data not loaded on slow network (#55998) 2025-04-01 00:22:30 +03:00
Braden Shepherdson
eef8dd149b [refs] Fixing Audit DB init and audit content export to handle idents (#56032)
Fixes #55929. (Requires a new export for 54 that also gets backported.)

Adds a new setting `install-analytics-database` that skips loading the
database at all, if set to false. That allows the dev instance that
exports the analytics content to have no real audit DB, and therefore to
generate the right `entity_id` hashes for the audit export!

Existing audit DBs are fine; the checksum will see these new entity_ids
in the export and overwrite any existing content.
2025-03-31 21:17:55 +00:00
Alexander Polyankin
b86d92d156 E2E repro for "Custom Expression having a date function between 2 aggregation functions returning dates doesn't work" (#55930) 2025-03-31 19:04:01 +00:00
Alexander Polyankin
a1b5478734 Show a more user-friendly error message when there are incompatible types (#55927) 2025-03-31 18:56:53 +00:00
Eric Normand
edd33406f7 Implement splitPart() for BigQuery (#55918)
* Implement splitPart() for BigQuery

* Always return string instead of null

* Better test failure message

It's running fine on my machine ;)

* Use coalesce instead
2025-03-31 12:46:31 -05:00
Alexander Polyankin
eb303b3596 Fix compilation of case with clauses that need pre-processing (#55958) 2025-03-31 13:40:31 -04:00
Nathan Voxland
13f81f354f Limit tsvector inserts to 1048575 bytes (#55954) 2025-03-31 12:36:19 -05:00
Case Nelson
8135a2f41f fix: Ensure that local timestamps params work (#55931)
* fix: Ensure that local timestamps params work

Fixes #53371

By filtering a timestamp or date column on an OffsetDateTime it results
in an index being missed since the lhs needs to be upcast by the db engine
to a `timestamp with timezone`.

This ensures we only pass OffsetDateTime to `timestamp with timezone`
columns.

Context about decision here:
https://metaboat.slack.com/archives/C0645JP1W81/p1743111964032089

* Handle sending a datetime range rather than just a date

* Feature gate to dynamic dataset loading

* Fix kondo

* Remove comment
2025-03-31 11:35:15 -06:00
Eric Normand
8737a30d70 splitPart() test for Redshift (#55938) 2025-03-31 11:43:14 -05:00
Eric Normand
004ba66176 splitPart() on Snowflake (#55935) 2025-03-31 11:41:12 -05:00
Eric Normand
9fed60a967 splitPart() for MySQL and MariaDB (#55914)
* Remove commented code from postgres test

* Add splitPart() to MySQL
2025-03-31 11:37:39 -05:00
Alex Yarosh
37b8a235ca docs: can't permanently delete collections (#56014)
* Update delete-and-restore.md

* format

* Update delete-and-restore.md

---------

Co-authored-by: jeff bruemmer <jeff.bruemmer@gmail.com>
2025-03-31 12:15:51 -04:00
Jeff Bruemmer
f4eeb43daf scan section in sparksql (#56015) 2025-03-31 15:51:29 +00:00
Romeo Van Snick
c38c533c72 Case-sensitivity arg name vs example disambiguation (#55965)
* Rename caseInsensitive to caseSensitivity

* Use literal string for case-insensitive template

* Update argument description to be more clear

* Support inline expression highlights

* Render help text description with Markdown

* Add more markdown to help text strings

* Use markdown code blocks to mark code in help text descriptions

* Highlight argument references in help text descriptions

* Fix arg alignment

* Fix HelpText unit tests

* Fix FunctionBrowser tests

* Render FunctionBrowser descriptions using Markdown too

* Mark true

* Fix e2e tests

* Fix e2e tests

* Remove commented-out code

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-03-31 17:18:02 +02:00
Riley Thompson
1d70e07d79 Fix Snowflake casted date field relative time filters (#55225) 2025-03-31 11:09:01 -04:00
Jeff Bruemmer
a2f38e43de formatting (#56009) 2025-03-31 14:38:44 +00:00
Edward Paget
ba9c2face3 fix: typo in token check stats name (#55999) 2025-03-31 14:13:41 +00:00
Jeff Bruemmer
4da41fc578 docs - add ClickHouse and Starburst to list of supported databases (#56001) 2025-03-31 10:00:44 -04:00
Riley Thompson
e7dda8b9ff Mark Mongo binData as a text like type during sync (#55792) 2025-03-31 09:40:00 -04:00
Aleksandr Lesnenko
babdb67fb5 Fix table row heights with rich content (#55960)
* allow wrapping links

* fix image rendering, add specs

* update wrapping setting validation and visibility
2025-03-31 09:05:22 -04:00
Chris Truter
a92fca3ef5 Allow search to return all field values (#55997) 2025-03-31 14:49:16 +02:00
Oisin Coveney
63dadf79d5 docs(sdk): Add docs for dashboard types (#55988)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-31 11:36:52 +00:00
Konstantin Darutkin
4e37127051 fix: merge conflicts 2025-03-31 11:42:27 +01:00
Ngoc Khuat
f70ca33c0a fix condition conflicts 2025-03-31 16:25:01 +07:00
github-automation-metabase
a310eeb305 Bump io.github.clojure/tools.build from 0.10.7 to 0.10.8 (#55973)
Inspect dependency changes here: https://github.com/clojure/tools.build/blob/v0.10.8/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-31 07:18:31 +00:00
github-automation-metabase
c3e042e91e Bump cider/cider-nrepl from 0.53.0 to 0.53.2 (#55971)
Inspect dependency changes here: https://github.com/clojure-emacs/cider-nrepl/blob/v0.53.2/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-31 07:02:19 +00:00
Ngoc Khuat
c5f4bf9fc7 When randomize sync db schemas, avoid at 0th minute marks (#55891) 2025-03-31 06:01:25 +00:00
Alex Yarosh
14f6682637 Update impersonation.md (#55957) 2025-03-30 14:38:37 -04:00
Romeo Van Snick
5f68e7a88c Fix offset example (#55942)
* Apply all passes to examples

* Add format test for offset example

* Make sure all help texts return a string

* Add repro for #55940

* Typo
2025-03-30 10:41:39 +02:00
Uladzimir Havenchyk
2593cf1957 test: add flaky test to a flaky group (#55871) 2025-03-28 17:01:43 -04:00
Alex Yarosh
3ed041bc60 docs: mb_api key docstring (#55924)
* mb_api key docstring

* formatting

* edit

---------

Co-authored-by: jeff bruemmer <jeff.bruemmer@gmail.com>
2025-03-28 16:55:22 -04:00
Aleksandr Lesnenko
d7b1ec1435 disable column reordering on raw query views (#55581) 2025-03-28 20:00:53 +00:00
Aleksandr Lesnenko
f00ca484c8 Table pagination viz settings in dashcards, rows count footer (#55735) 2025-03-28 19:29:03 +00:00
Anton Kulyk
a3ed24fb9c Use clickable styles only for links in detail view (#55903) 2025-03-28 19:13:15 +00:00
Anton Kulyk
50e1b0de63 Don't show dashcard's info tooltip in edit mode (#55905) 2025-03-28 18:29:39 +00:00
Case Nelson
4169b8cc2b fix: properly test snowflake ssh connection details (#55879) 2025-03-28 12:20:12 -06:00
Uladzimir Havenchyk
589c133fac deps: upgrade rspack to 1.3 (#55901) 2025-03-28 17:58:57 +00:00
Eric Normand
676f833a0b Tests for integer() on redshift (#55868)
* Tests for `integer()` on redshift

* Appease the kondo
2025-03-28 12:54:27 -05:00
Ngoc Khuat
329eb07013 Change version for alert api change log from 53 to 54 (#55890) 2025-03-28 18:23:49 +02:00
bryan
be9d37cad2 move mage docs into developer docs (#55915)
- also improve usability of setup-autocomplete test
2025-03-28 16:13:27 +00:00
Aleksandr Lesnenko
9a7704896c prevent text wrapping from being applied to links (#55882) 2025-03-28 15:51:36 +00:00
Konstantin Darutkin
f47d072729 fix: editable select value and dropdown labels (#55907)
* fix: editable select value and dropdown labels

* fix: missing func

* Apply suggestions from code review

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

---------

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-03-28 15:17:06 +00:00
Noah Moss
22856615ae Auto-categorize truncation units as datetime columns in insights code (#55861)
* Auto-categorize truncation units as datetime columns in insights code

* detect datetime units on the FE as well when rendering trend visualization

* prettier

* add unit test

* typo

* fix comment alignment
2025-03-28 14:55:57 +00:00
Konstantin Darutkin
7e138cf216 refactor: use input button for editing category (#55906) 2025-03-28 14:02:16 +00:00
Alexander Polyankin
8e5807c8e7 Enable type checking in the expression editor (#55737) 2025-03-28 09:55:26 -04:00
Konstantin Darutkin
e9de85bd37 fix: api types for field metadata (#55900)
* fix: api types for field metadata

* fix: review issues

* fix: review issues
2025-03-28 13:24:10 +00:00
Konstantin Darutkin
3d489581dd fix(enterprise): inline editing table input styles (#55820)
* fix(enterprise): inline editing table input styles

* fix: review fixes
2025-03-28 12:53:09 +00:00
Nick Fitzpatrick
8ca8411c71 force <DefaultLogoIcon /> on welcome page (#55869) 2025-03-28 09:48:46 -03:00
Ngoc Khuat
ce87540743 [Notification] Customizable template (#55799) 2025-03-28 18:29:21 +07:00
Jeff Bruemmer
305667abed docs - api keys in config file (#55771) 2025-03-28 11:21:29 +00:00
Ngoc Khuat
eaf1ad0085 fix migration checksum 2025-03-28 17:27:36 +07:00
lbrdnk
c421a23bd8 Provide LEVEL_ONE_TYPES to FE (#55766)
* Provide LEVEL_ONE_TYPE to FE

* Apply suggestions from code review

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>

---------

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-03-28 10:25:46 +01:00
Uladzimir Havenchyk
b6e957c05b test: another attempt to fix dashboard flaky test (#55873) 2025-03-28 07:44:57 +03:00
appleby
174508dd10 Update driver-changelog for :cast :distinct-where :split-part features (#55664) 2025-03-27 18:16:15 -07:00
Tyler Plude
67b4bf4cdb Fix bottom margin on query builder view #55876 (#55878) 2025-03-27 17:09:49 -07:00
Tyler Plude
b42e24382a Add new Tanstack table viz settings support to static viz (#55517)
* Initial support for text wrapping in static viz

* Add text-align support

* Add row index support

* Fixing broken unit tests

* Adding new unit test coverage for Tanstack viz settings

* Fixing typo in whitespace; removing debug def

* Removing defs & outdated comment

* Addressing PR feedback

* Adding column width support to minibar columns; improving doc strings

* Adding minibar column width support; improving doc strings; moving consts to style namespace

* Fixing broken unit test after font size change

* Remove trailing whitespace
2025-03-27 16:53:46 -07:00
Denis Berezin
506c665eb6 Editable tables polishing 2025-03-28 00:44:15 +03:00
Uladzimir Havenchyk
a78e2fa04b test: add test to a flaky group (#55867) 2025-03-27 20:56:20 +00:00
Luiz Arakaki
2f40fe4e79 support keys in env vars (#55756)
# Support Environment Variables for API Keys
### Overview
This PR adds support for using environment variables to define API keys in the configuration file, enhancing security and flexibility for deployment environments.
### Changes
- Modified API key validation to support environment variable substitution in the key field
- Added runtime validation for API keys from environment variables to ensure proper formatting
- Refactored tests to properly validate environment variable integration
- All API keys (including those from environment variables) still must follow the required format:
  - Must be between 11-254 characters
  - Must start with mb_
  - Must match the pattern mb_[A-Za-z0-9+/=]+
### Usage
```
api-keys:
  - name: "ENV API Key"
    key: "{{env API_KEY_FROM_ENV}}"
    creator: "admin@example.com"
    group: "admin"
```

### Testing
- Creation of API keys from environment variables
- Validation of API key format from environment variables
- Error handling for improperly formatted environment variable values

# Skip keys if they exist
To guarantee that it is possible to keep the same yaml file on each instance initialization, if there is a key in the instance and the config file has a key with the same name, the creation is skipped.
2025-03-27 20:04:16 +00:00
Tyler Plude
12add5657c Minibar chart support in table static viz (#55736)
* Minibar chart support in table static viz

* Fixing unit test; adding new minibar unit test

* Fixing clj kondo warnings

* Addressing PR feedback

* Removing dead minibar code

* Removing old minibar unit tests
2025-03-27 12:49:39 -07:00
Eric Normand
30b14f3243 integer() for snowflake (#55774)
* Empty

* Implement and test snowflake integer()

* Use card-with-source-metadata-for-query in snowflake tests

* Use lib/functions instead of lib/expression-clause in snowflake
2025-03-27 14:49:22 -05:00
Eric Normand
721736df58 integer() for BigQuery (#55704)
* integer() for BigQuery

* Fix BigQuery tests for integer()

* Change to backticks

* kick ci

* Fix for BigQuery

* Capitalize name of field

* Use STRING type for casting in BigQuery

* Sometimes we get an integer back, and that's okay

* Use mt/card-with-source-metadata-for-query in bigquery tests

* use lib/functions instead of lib/expression-clause in bigquery
2025-03-27 14:48:42 -05:00
Alex Yarosh
34d1b99615 docs: don't forget to use headers in split files (#55856)
* Update uploads.md

* Update docs/databases/uploads.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-27 19:02:13 +00:00
Konstantin Darutkin
e71e4d0ada feat(enterprise): Add a confirmation message on Delete operations (#55821) 2025-03-27 19:01:40 +00:00
Edward Paget
dade705ce7 feat: add remaining token check stats and settings (#55638)
* feat: add remaining token check stats and settings

Adds the remaining five data points we want to report during the token
check request. Adds a new module to internal stats that does the
embedding counts and setting checks.

* fixup! log stats

* fixup! move enterprise settings into defenterprise

* fixup! remove row count
2025-03-27 13:57:25 -05:00
Denis Berezin
a02d08fcfc Fix FK fields empty dropdown (#55851) 2025-03-27 21:55:04 +03:00
Edward Paget
5448ab30e4 fix: only remove vis_settings from dashboardcard (#55846)
* fix: only remove vis_settings from dashboardcard

Fixes loading serialized dashboard cards where we would previously
delete and recreate them on each load.

In order to handle circular dependencies caused by links to other
dashboards in a dashboardcard's visualization_settings we were removing
the dashboardcards entirely from the dashboard model to break the cycle.
Later when we traversed back through the dependency path we would load
the original dashboard a second time with the restored dashboardcards.

However, on the load of the cycle breaking change we could entirely drop
dashcards belonging to the dashboard because the serialization code was
treating our cycle breaking changes as an edit to the dashboard to drop those
cards. This meant when we got back to the the second load of the
dashboard we would create the dashcards fresh instead of updating
existing instances.

The fix here is that we only remove the values from the dasboard card
model that can cause the cycle -- in this case just the
visualization_settings column. This seemed the most straightforward fix,
but there are other possibilities here.

One is that we could _just_ preserve the entity_id column in dashcards
which would eliminate the possibility of any other cycles here.

Another option would be to change how we handle nested models in serialization.
There is not really a foreign key dependency here between dashboard A
and dashboard B linked by the dashboard card. If we instead just created
those dashboards first _then_ went back and created their dashcards we
don't have any problems at all. We could move nested models up to the
same level of handling in serialization that we do for models, which
would let us create the dashboards first then create any dashboard cards
in a subsequent step.

* fixup! update docstring
2025-03-27 18:49:48 +00:00
Riley Thompson
25a6329fec Upgrade ClickHouse JDBC driver version to 0.8.2 (#55713) 2025-03-27 14:31:31 -04:00
Alexander Polyankin
53780a436b Use :value for bigint values in queries (#55698) 2025-03-27 18:07:27 +00:00
Dan Stone
e2fd4fc37e Manage coercion_strategy translations from JSON inputs to database values (#55773)
Implements a set of coercions back to database types, when the frontend provides zoned date time strings (ISO8601).

If an integer field representing UNIX seconds is presented to the frontend as a ISO8601 datetime via coercion_strategy

The frontend will not currently know that database representation of the value (a int representing seconds in this instance). Therefore data editing needs to accept ISO8601 datetime strings as inputs, as the frontend will present a date picker based on the information it has.

For lossy translations (such as ISO8601->Date or ISO8601->Time) much is left undefined, and in some situations users may lose data or find surprises on edit. A working audit log should protect against somewhat $consequences, given how easy it is to make a mistake anyway.

One definition that might work is that time/date changes keep the corresponding exclusive part of the previous row, so if you say vary the time on 2025-03-27T13:42:03Z to 14:00:00, then we take keep the date as 2025-03-27 for that row. In other words, coercion behaviour might become additionally dependent on the existing record state. A followup PR might be in order to acheive this.
2025-03-27 17:48:22 +00:00
Braden Shepherdson
4d318a1183 [models] Add card_schema column, for future use in after-select (#55714)
Closes QUE-794 and QUE-705.

This will enable us to *know*, rather than *infer*, what version of
`report_card` we're looking at.

One example: in the near future, I'm going to add some values to
`result_metadata` on cards. If we later discovered a bug in that logic
and could no longer trust those fields written to AppDB in
`result_metadata`, the `card_schema` will tell us with certainty
whether the card was saved with the broken logic (`:card_schema N`)
or the new logic (`:card_schema (+ N k)`).

The upgrade steps could drop the invalid fields and, if desired, infer
the correct ones.

Note that there's nothing here about writing back! This is about
cleaning up old cards during `after-select`.

There are no upgrades yet; the current version is still the default.
2025-03-27 13:47:43 -04:00
Case Nelson
000ea868f5 fix: move classloader to init as soon as possible (#55786) 2025-03-27 11:03:27 -06:00
Stas Gavrylov
4262ff5a3d WRK-189: Add table notifications UI (#55700)
* WRK-189: Add table notifications UI

* WRK-189: Add delete/unsubscribe confirmation modals. Refactor shared code

* WRK-189: Add display of table notifications list in user profile. Fix lint errors
2025-03-27 18:46:41 +02:00
dpsutton
1a6a9a0916 Bit more logging (#55837)
```
2025-03-27 15:25:21,322 INFO sync.describe-database :: Checking "PUBLIC"."LARGE_NUMBERS"
2025-03-27 15:25:21,757 INFO sync.describe-database :: "PUBLIC"."LARGE_NUMBERS": SELECT privileges confirmed
2025-03-27 15:25:21,759 INFO sync.describe-database :: Checking "PUBLIC"."SINGLE_ROW_TABLE"
2025-03-27 15:25:21,975 INFO sync.describe-database :: "PUBLIC"."SINGLE_ROW_TABLE": SELECT privileges confirmed
2025-03-27 15:25:21,976 INFO sync.describe-database :: Checking "PUBLIC"."SLOW_QUERY_VIEW"
2025-03-27 15:25:22,219 INFO sync.describe-database :: "PUBLIC"."SLOW_QUERY_VIEW": SELECT privileges confirmed
```

This will list all tables it enumerates and then which ones it
removes. There are also two error handling states:

```
2025-03-27 15:29:25,418 INFO sync.describe-database :: "schema"."some_table": SELECT privileges confirmed
2025-03-27 15:29:25,419 INFO sync.describe-database :: "schema"."some_table": Assuming SELECT privileges: caught timeout exception
2025-03-27 15:29:25,419 INFO sync.describe-database :: "schema"."some_table": Assuming no SELECT privileges: caught exception
java.lang.Exception: Some exception
	at metabase.driver.sql_jdbc.sync.describe_database$eval194718.invokeStatic(NO_SOURCE_FILE:33)
	at metabase.driver.sql_jdbc.sync.describe_database$eval194718.invoke(NO_SOURCE_FILE:33)
        [more stacktrace from the exception]
```

This is essentially just changing the log level. We can and perhaps
should change these back to debug or trace in the future but this is
useful for now.
2025-03-27 11:44:52 -05:00
Dan Stone
76d7d80ecb Fix ci internal tools (#55838)
* Fix migrations file

* Fix postgres kondo

* Fix modules config

* Fix unused requires

* Test util kondo

* Fix MySQL index rollback
2025-03-27 16:44:24 +00:00
Eric Normand
aa2457d52c integer() for MySQL (#55691)
* WIP Implement `integer()` for all :sql descendants

* Add test-data to tests

* Just do MySQL

* Undo change to query_processor_test

* Remove unused imports

* Remove extra blank line in query_processor

* Convert postgres tests to mysql

* Appease MySQL syntax

* Remove old tests for mysql integer()

* Remove unsupported postgres tests

* Fix kondo

* kick ci

* Fix up for MariaDB

* Fix queries in test

* Try bigger numbers for MariaDB

* Remove ability to cast integer to integer

* Check that boolean = 1 in mysql

* Use mt/card-with-source-metadata-for-query

* Use lib/functions instead of lib/expression-clause

* Use lib/functions instead of lib/expression-clause in postgres

* Use card-with-source-metadata-for-query for postgres tests
2025-03-27 16:38:49 +00:00
Sébastien
471f077083 Closes viz-447 disable text selection when dragging/resizing dashcards (#55528)
* closes viz-447 disable text selection when dragging/resizing dashcards

* eslint

* fixed e2e
2025-03-27 17:21:49 +01:00
Sébastien
4ee67dba0c upgrade @octokit/rest to address ReDos vulnerabilities (metabase#351) (#55828) 2025-03-27 12:15:50 -03:00
Alexander Solovyov
20276982a8 notifications: log skipping reason (#55701) 2025-03-27 17:15:17 +02:00
Riley Thompson
37068e88df Remove stack traces from SQLExceptions (#55765) 2025-03-27 15:02:58 +00:00
Alexander Polyankin
4de6e9f7e2 Ignore parameters targets with stage-number out of range (#55761) 2025-03-27 14:59:15 +00:00
Ngoc Khuat
95c442b943 fix lint migration about deleteCascade by adding a proper migration for adding constraint 2025-03-27 20:30:51 +07:00
Alexander Solovyov
43292e6a0e config.yml.sample (#55804) 2025-03-27 14:06:44 +02:00
Nicolò Pretto
f5f4dbbc4b make rspack error when the port is already in use (#55803)
* make rspack error when the port is already in use

* adds rspack.config.js to the frontend_sources on file-paths

* use PORT env
2025-03-27 12:48:22 +01:00
Ngoc Khuat
e285c32157 [Notification] Update api to work with system events (#55646) 2025-03-27 18:32:48 +07:00
Konstantin Darutkin
68927160c8 fix: inline editing FK field style (#55813) 2025-03-27 11:12:19 +00:00
Romeo Van Snick
3a865cc16b Update some function names to match modern casing (#55672)
* Update some function names to match modern casing

* Fix test cases

* Update casing in docs for isEmpty, notEmpty, lTrim, rTrim, isNull, and notNull

* Fix isNull and isEmpty casing in tests

* Fix case in unit test

* Fix casing in e2e tests
2025-03-27 11:38:47 +01:00
Kamil Mielnik
5a1d677444 RFC 118. Prettier - arrowParens: “always” (#55807)
* Update .prettierrc
- remove "arrowParens": "avoid" so that it defaults to "always" instead

* Run "yarn prettier"
2025-03-27 09:18:07 +00:00
Chris Truter
01222ff5e1 Merge branch 'master' into internal-tools 2025-03-27 10:19:31 +02:00
Mahatthana (Kelvin) Nomsawadi
651894d137 Fix Slack channel couldn't be found when it's behind pagination (#55748)
* Fix couldn't find Slack channel

When the first `conversations.list` doesn't return the Slack channel we
want, we need to continue to paginate until we found it.

* [debug] for testing

* Revert "[debug] for testing"

This reverts commit 67dd2c0405.

* Simplify logic

Co-Authored-By: Timofey Kachalov <timofei@metabase.com>

---------

Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-03-27 06:04:40 +00:00
Sébastien
2d86842776 reverts #53898 (#55695) 2025-03-27 06:49:56 +01:00
Luis Paolini
13ec3265ef Add group mappings in keycloak (#55775)
* Add group mappings in keycloak

* Apply suggestions from code review

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-03-27 02:02:26 +00:00
Ryan Laurie
4c29538c1f allow assertion functions (#55772) 2025-03-26 17:15:02 -06:00
Ryan Laurie
930bb87382 Only Show Sync Status to Admin Who Started Gdrive Sync (#55587)
* rename and reorganize

# Conflicts:
#	enterprise/frontend/src/metabase-enterprise/google_drive/GdriveConnectionModal.tsx
#	enterprise/frontend/src/metabase-enterprise/google_drive/GdriveSyncStatus.tsx

* resolve conflicts

* only show sync status to admin who created it

* Add connection info to disconnect modal (#55588)

* rename and reorganize

# Conflicts:
#	enterprise/frontend/src/metabase-enterprise/google_drive/GdriveConnectionModal.tsx
#	enterprise/frontend/src/metabase-enterprise/google_drive/GdriveSyncStatus.tsx

* resolve conflicts

* update disconnect modal

* better spacing
2025-03-26 22:18:32 +00:00
Denis Berezin
43c64db6dc Editable tables in dashboards (#55372)
* Support editable tables dashcards with filter support

* Test fix

* Temp

* Add table-editable visualization

* Add table selection + other fixes

* Fixes after merge

* fix e2e

* Fixes after merge

* Fix edit issues and scroll

* Fix issues with edit after merge, fix modal remappings

---------

Co-authored-by: Chris Truter <chris@metabase.com>
2025-03-27 01:02:10 +03:00
Uladzimir Havenchyk
c5a1cdecc8 test: another fix for dashboard flaky test (#55759)
* test: another fix for dashboard flaky test

* increase timeout
2025-03-26 21:04:07 +00:00
Raphael Krut-Landau
b47569f399 In e2e sandboxing tests, compare two users with different attributes (#55556) 2025-03-26 16:44:49 -04:00
Alex Yarosh
7800b2f488 Update mongodb.md (#55789) 2025-03-26 20:41:06 +00:00
Ryan Laurie
1657085257 Don't load gsheets sync status component for non-admins (#55724)
* don't load gsheets sync status for non-admins

* kick ci
2025-03-26 14:34:14 -06:00
Jeff Bruemmer
aa91ebc7a2 docs - alert updates (#54623)
* update question caching

* update alerts

* remove images

* notifications

* add supported schedules

* edits
2025-03-26 20:21:45 +00:00
lbrdnk
e168a7c35d Adjust jdbc-get-tables and probe query logging (#55658) 2025-03-26 20:51:21 +01:00
Case Nelson
2a1adfeee8 feat: Bring starburst driver in house (#55123)
* feat: Bring starburst driver in house

* Fixing lints and github service

* Fix kondo and reflection warnings

* Fix some tests

* Fixing tests

* Fix database check test

* Fix tests

* Hide impersonation

* Cleanup

* Cleanup kondo override

* Add License

* Update modules/drivers/starburst/test/metabase/test/data/starburst.clj

Co-authored-by: Riley Thompson <riley@metabase.com>

* Update modules/drivers/starburst/test/metabase/test/data/starburst.clj

Co-authored-by: Riley Thompson <riley@metabase.com>

* Update modules/drivers/starburst/test/metabase/test/data/starburst.clj

Co-authored-by: Riley Thompson <riley@metabase.com>

* Address Review comments

* Better exception messages

* Fix source version for metabase

* Fix source test

---------

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-03-26 13:41:00 -06:00
Aleksandr Lesnenko
746d806428 remove outdated snapshots (#55663) 2025-03-26 18:48:52 +00:00
Noah Moss
4b65251933 Translate comparison text for smart scalars on the BE (#55722)
* Translate comparison text for smart scalars on the BE

* lint

* add back space

* refactor
2025-03-26 18:30:45 +00:00
Edward Paget
b227d94cdc feat: use semi-join for collection permissions (#55727)
Improve the performance of the collection permission query by using a
semi-join instead of an inner join to the permission tables. This
ensures each collection only needs to be tested once for a route that
gives a user permission to access it rather than multiple times.

This reduces the query time for users that are members of lots of
collections since we dont need postgresql to create large join tables or
return the same collection id more than once from this query.
2025-03-26 12:53:41 -05:00
Alexander Polyankin
b29ae5d7f9 Migrate useUserListQuery to RTK (#55721) 2025-03-26 16:16:26 +00:00
Raphael Krut-Landau
6bde1d3b4a Add e2e test for sandboxing multistage questions (#55565) 2025-03-26 12:11:52 -04:00
Konstantin Darutkin
a9169ea54e feat(enterprise): Handle nulls/defaults/generated columns when (#55675)
* feat(enterprise): Handle nulls/defaults/generated columns when creating/editing

* fix: review fixes

* feat(enterprise): add formik for creation modal (#55694)
2025-03-26 16:07:34 +00:00
Alexander Polyankin
7549ce42f9 Migrate EditUserModal to RTK (#55719) 2025-03-26 15:07:40 +00:00
Riley Thompson
a391b89276 Remove JS from mongo queries (#55499) 2025-03-26 10:39:19 -04:00
Konstantin Darutkin
a5c30576c3 feat(enterprise): update editable table values without reload (#55755) 2025-03-26 13:34:09 +00:00
Ngoc Khuat
f50b9fc2bc [Notification] more 🪵 (#55751) 2025-03-26 13:03:15 +00:00
Uladzimir Havenchyk
07263fff52 test: make dashboard flaky test more robust and stable (#55715)
* test: make dashboard flaky test more robust and stable

* revert flaky

* add additional check

* fix that works locally

* revert prev version

* add missing line
2025-03-26 15:03:18 +03:00
Chris Truter
b2aa25a18e Merge branch 'master' into internal-tools 2025-03-26 13:24:53 +02:00
Romeo Van Snick
396fa05998 Operator prefix suggestions (#55697)
* Match functions even when the current token is an identifier

* Add repro for metabase#55686

* Use existing function in test
2025-03-26 10:16:52 +01:00
Ngoc Khuat
7772e1ae37 Log context (#55746) 2025-03-26 08:51:36 +00:00
Alexander Solovyov
5ed7432f77 improve actions code a little bit (#55749) 2025-03-26 10:23:56 +02:00
Kamil Mielnik
a5343da112 SEM-176 Use new semantic type picker everywhere (#55539)
* Add baseType prop to SemanticTypePicker

* Update unit tests

* Fix legacy v1/ Field['base_type'] typing, to make it same as Field['base_type'] from api/

* Use isa

* Add a hack for numerical types

* Fix typo

* Pass field

* Reuse type

* Use effective type

* First pass on the tech doc

* Handle booleans

* Use isa

* Refactor

* Update test

* Update test

* Assume no type can have 2 level-one ancestors

* Add comments

* Extract getCompatibleSemanticTypes

* Refactor isDeprecated

* Refactor

* Add fieldId param

* Add test for booleans

* Make initialValue required

* Do not assume a field cannot have multiple level-one ancestors
- these types have 2 level-one ancestors: type/JSON, type/XML, type/DruidJSON, type/OracleCLOB

* Extract FIELDS

* Add test

* Test Entity Name

* Remove '

* Add test

* Update test

* Add test for base_type fallback

* Update comment

* Refactor tests

* Add Field containing JSON tests

* Refactor

* Add a comment

* Improve naming

* Improve naming

* Use SemanticTypePicker in DatasetFieldMetadataSidebar

* Use Field from types/api

* Extract DatasetFieldMetadataSemanticTypePicker

* Fix typing

* Pass label, tabIndex, and onKeyDown

* Remove old picker

* Use SemanticTypePicker in FieldTypeDetail

* Remove unused prop

* Remove redundant margin

* Fix #55617

* Use SemanticTypePicker in Field

* Remove old SemanticTypePicker

* Reuse FkTargetPicker

* Introduce new top-level frontend directory: frontend/src/metabase/metadata
- Move semantic type picker + subcomponents in there

* Add readme

* Get rid of global CSS classes

* Remove old FKTargetPicker component

* Pass databaseId to components

* Don't check for text-like fields

* Merge branch 'SEM-97-limit-semantic-types' into SEM-176-new-semantic-type-picker-everywhere

* Update test

* Update tests

* Sort options by label

* Update test

* Fix docs links

* Change reproductions suite to TypeScript

* Repro #55618

* Repro #55617

* Make sure combobox flips if there is no space underneath
2025-03-26 14:42:17 +07:00
Romeo Van Snick
60988ea706 Add Expressionable type (#55683)
* Add Expressionable

* Accept Lib.Expressionable in expression editor

* Remove type casts in AggregationPicker and FilterPicker
2025-03-26 08:40:01 +01:00
Ngoc Khuat
4ee43ee057 Merge branch 'master' into internal-tools 2025-03-26 13:17:41 +07:00
Mahatthana (Kelvin) Nomsawadi
20facf4b69 ci(sdk): make 54 the latest in release workflow (#55741) 2025-03-26 13:14:19 +07:00
Ngoc Khuat
66e30a69c7 [Notification] tables notification working e2e (#55444) 2025-03-26 12:41:22 +07:00
Edward Paget
6aa3663a64 fix: add index to field_usage query_execution_id (#55712)
* fix: add index to field_usage query_execution_id

Supports faster deletes on the query_execution table. Without this index
deleting rows from that table leads to a seq scan on the field usage
table for each row deleted to handle the ON DELETE CASCADE trigger.

* fixup! drop empty preconditions
2025-03-26 01:04:21 +00:00
Fraser
f7d4c635e1 Encode settings key in url (#55734) 2025-03-26 13:44:55 +13:00
github-automation-metabase
47278fdcf6 Bump com.google.cloud/google-cloud-bigquery from 2.48.0 to 2.49.0 (#55606)
Inspect dependency changes here: https://github.com/googleapis/java-bigquery/blob/v2.49.0/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-25 23:23:10 +00:00
github-automation-metabase
15c65e7ad3 Bump io.github.tonsky/clj-reload from 0.9.0 to 0.9.4 (#55600)
Inspect dependency changes here: https://github.com/tonsky/clj-reload/blob/0.9.4/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-25 23:22:57 +00:00
github-automation-metabase
a00bff5b0f Bump com.microsoft.sqlserver/mssql-jdbc from 12.9.0.jre11-preview to 12.10.0.jre11 (#55609)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-25 23:22:45 +00:00
Ryan Laurie
f39269dffd Less noise and more emojis in release channel (#55705)
* less noise and more emojis in release channel

* remove variable
2025-03-25 21:47:20 +00:00
Alexander Polyankin
df239d0174 Migrate UserSuccessModal to RTK (#55716) 2025-03-25 14:56:33 -04:00
Dan Stone
a4d8cc425e Return :updated rows when modify rows with PUT (#55707)
Manually tested the UI, does not seem to break anything. 

Policy stuff is ignored for now
2025-03-25 17:57:07 +00:00
Edward Paget
b3dfcd4a88 fix: reset connection pool after app-db tz change (#55567) 2025-03-25 12:48:36 -05:00
Dan Stone
4bee28d643 Fix clickhouse metadata test (#55710) 2025-03-25 17:27:45 +00:00
github-automation-metabase
20bfdbb4bc Bump com.google.guava/guava from 33.4.0-jre to 33.4.5-jre (#55599)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-25 17:18:52 +00:00
Uladzimir Havenchyk
df11338cfb test: make scrollable echarts tooltip stable (#55699)
* test: make scrollable echarts tooltip stable

* make test better
2025-03-25 16:44:57 +00:00
Jeff Bruemmer
33b34e456c docs - expression updates (#55645) 2025-03-25 16:09:03 +00:00
Chris Truter
58ac9f8dc0 Nix stale comment 2025-03-25 17:57:10 +02:00
Chris Truter
ba47dca45f Preserve existing 'editable' on dashboard save (#55708) 2025-03-25 17:56:09 +02:00
Alexander Solovyov
9381eadebb add dimensions to sample content (#55507) 2025-03-25 17:53:07 +02:00
Alexander Solovyov
140f48eb43 update athena to 3.5.0 (#55391) 2025-03-25 15:18:36 +00:00
Uladzimir Havenchyk
f9d20ea838 test: skip flaky calendar test as it is broken (#55689) 2025-03-25 14:11:45 +00:00
Ryan Laurie
aa8594fae7 remove smoke test (#55655) 2025-03-25 07:57:58 -06:00
Uladzimir Havenchyk
6be63025c9 test: mark broken column tests as broken and not flaky (#55674) 2025-03-25 16:33:46 +03:00
Alex Yarosh
7722d8db9c Update e2e-tests.md (#55676) 2025-03-25 12:46:24 +00:00
Sébastien
6a1588be90 Closes viz-456: decimals setting not being honored compact formatting (#55181)
* closes viz-456 decimals not being honored compact formatting

* fixup

* .
2025-03-25 13:43:21 +01:00
lbrdnk
857228f952 Querying generative test MS2 (#53921)
This PR adds defgentest and transforms with-gentest into gt/iterate. It also adds new test that uses cards.
2025-03-25 13:38:12 +01:00
Chris Truter
741d492778 Missed tests 2025-03-25 12:25:17 +02:00
Filip Hric
7d2e94f352 update cypress and some of its dependencies to the latest version (#55614) 2025-03-25 10:15:56 +00:00
Kamil Mielnik
b174d2e240 SEM-97 Limit the semantic Field Types choices to the actual field type category when editing table metadata (#55343)
* Add baseType prop to SemanticTypePicker

* Update unit tests

* Fix legacy v1/ Field['base_type'] typing, to make it same as Field['base_type'] from api/

* Use isa

* Add a hack for numerical types

* Fix typo

* Pass field

* Reuse type

* Use effective type

* First pass on the tech doc

* Handle booleans

* Use isa

* Refactor

* Update test

* Update test

* Assume no type can have 2 level-one ancestors

* Add comments

* Extract getCompatibleSemanticTypes

* Refactor isDeprecated

* Refactor

* Add fieldId param

* Add test for booleans

* Make initialValue required

* Do not assume a field cannot have multiple level-one ancestors
- these types have 2 level-one ancestors: type/JSON, type/XML, type/DruidJSON, type/OracleCLOB

* Extract FIELDS

* Add test

* Test Entity Name

* Remove '

* Add test

* Update test

* Add test for base_type fallback

* Update comment

* Refactor tests

* Add Field containing JSON tests

* Refactor

* Add a comment

* Improve naming

* Improve naming

* Use Field from types/api

* Fix typing

* Don't check for text-like fields
2025-03-25 09:55:32 +00:00
Chris Truter
4073da9974 Merge branch 'master' into internal-tools 2025-03-25 11:07:44 +02:00
Noah Moss
6f17b2319a Baseline-align text in NativeQueryClickFallback (#55653) 2025-03-24 18:52:19 -04:00
Raphael Krut-Landau
89a4b2651a Add e2e tests for sandboxing implicitly and explicitly joined tables (#55443) 2025-03-24 18:41:25 -04:00
John Swanson
88f6005128 Return 5000 unique user attribute keys (#55649)
Previously we looked at 1000 users and got the set of unique user
attribute names from them. So if 1000 users each had a `name` and user
1001 had `some-other-attribute`, we would give you back `name` as the
complete set of available attributes.

This modifies the magic number (to 5000 from 1000) and the logic. We
select the first 5000 unique *attributes*. So if 1000 users each have a
`name`, that only counts as 1, and we'll continue looking for other
unique attributes before returning to the client.
2025-03-24 22:01:07 +00:00
Luiz Arakaki
711d29bbbb Add constraints to key (#55211)
Implemented validation that ensures API keys when created with config.yml:
Start with the mb_ prefix
Have a minimum length of 12 characters and max 254
Prefix (first 7 characters) must be unique
String must be Base64
2025-03-24 18:01:00 -03:00
github-actions[bot]
cde8cbbbba Update translations 2025-03-24 (#55641)
* Update translation sources 2025-03-24

* Update translations

* kick ci

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-03-24 20:48:26 +00:00
Ryan Laurie
dc6c57f07b v54 release code updates (#55643)
* add v54 build requirements

* remove required checks copy script
2025-03-24 13:06:15 -06:00
Alexander Polyankin
f42397e56d Add hover effect for dirty query state (#55627)
* Add

* Hover effect

* Remove unused compact prop

* Remove unused borderless prop

* Rename className

* Rename className

* Fix circular button padding and icon

* Fix circular button padding and icon

* Fix circular button padding and icon

* Fix circular button padding and icon

* Fix circular button padding and icon

* Fix circular button padding and icon
2025-03-24 12:54:54 -04:00
Konstantin Darutkin
4bdbeccdd9 fix(enterprise): row deletion attempt #2 (#55644) 2025-03-24 16:13:08 +00:00
Chris Truter
2fff1e2c4a Use POST for delete, so we can receive a body (#55642) 2025-03-24 18:04:42 +02:00
Chris Truter
defba4bc0e Add basic malli schema to data editing APIs (#55640)
* Add basic malli schema to data editing APIs
* Track gitignore changes on master
2025-03-24 17:59:23 +02:00
Raphael Krut-Landau
9360d1414e Refactor sandboxing e2e tests (#55540) 2025-03-24 11:55:30 -04:00
Konstantin Darutkin
4cdbafc70f Revert "fix(enterprise): delete row query (#55616)" (#55639)
This reverts commit d04b760b32.
2025-03-24 15:54:34 +00:00
Ryan Laurie
7eee9af182 Gsheets frontend refactoring (#55564)
* rename and reorganize

# Conflicts:
#	enterprise/frontend/src/metabase-enterprise/google_drive/GdriveConnectionModal.tsx
#	enterprise/frontend/src/metabase-enterprise/google_drive/GdriveSyncStatus.tsx

* resolve conflicts

* oops forgot one
2025-03-24 09:33:46 -06:00
Noah Moss
728f04302f Use field refs instead of field ids/names for tiles queries (#55570)
* Use field refs instead of field ids/names for tiles queries

* Fix up embedded + public endpoints

* use field_refs

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2025-03-24 11:29:30 -04:00
Konstantin Darutkin
5fb6bcb4d5 feat(enterprise): non-editable PKs for inline table editing (#55623)
* feat(enterprise): non-editable PKs for inline table editing

* fix: review fixes
2025-03-24 15:12:13 +00:00
Ryan Laurie
1c0bbf23fd allow SegmentedControl to have colors (#55582) 2025-03-24 08:36:25 -06:00
Konstantin Darutkin
d04b760b32 fix(enterprise): delete row query (#55616) 2025-03-24 14:24:11 +00:00
Aleksandr Lesnenko
16bbc2931d fix charts glitches in safari (#55589) 2025-03-24 10:06:59 -04:00
github-automation-metabase
e07c8d7f39 Bump org.graalvm.polyglot/polyglot from 24.1.2 to 24.2.0 (#55603)
* Bump org.graalvm.polyglot/polyglot from 24.1.2 to 24.2.0

Inspect dependency changes here: https://github.com/oracle/graal/compare/graal-24.1.2...graal-24.2.0

* update js-community version too

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2025-03-24 13:34:53 +00:00
Nick Fitzpatrick
85e4594069 Setting shouldUpdateUrl to false when calling popState in QB (#55362)
* resetting qb state before running card on back navigation

* try something else

* adding e2e test for notebook navigation

* wait for fk call in test

* increase timeout

* e2e adjustment
2025-03-24 09:56:37 -03:00
github-automation-metabase
b927a8def2 Bump ring/ring-core from 1.13.0 to 1.13.1 (#55604)
Inspect dependency changes here: https://github.com/ring-clojure/ring/blob/1.13.1/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-24 12:27:20 +00:00
github-automation-metabase
6b9387b268 Bump ch.qos.logback/logback-classic from 1.5.17 to 1.5.18 (#55597)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-24 12:26:06 +00:00
github-automation-metabase
380da21796 Bump cider/cider-nrepl from 0.52.1 to 0.53.0 (#55598)
Inspect dependency changes here: https://github.com/clojure-emacs/cider-nrepl/blob/v0.53.0/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-24 12:25:52 +00:00
github-automation-metabase
da45d95ac3 Bump org.eclipse.jetty.websocket/websocket-jetty-server from 11.0.24 to 11.0.25 (#55601)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-24 14:13:14 +02:00
Ngoc Khuat
0f5a6253e3 Fix query limit for alerts (#55610) 2025-03-24 11:19:45 +00:00
Alexander Solovyov
4050d70935 ci: Add manual workflow for deploying Athena JDBC driver (#55519) 2025-03-24 10:56:14 +02:00
Dan Stone
b257e020f6 Add create table endpoint (#55418)
* Export actions/check-data-editing-enabled-for-database!

* Add API for creating tables

Adds a new endpoint: POST ee/data-editing/database/{db-id}/table
- shares policy with data editing (admin only, data editing enabled)
- has a fixed type set (upload types) to limit security exposure for now
- does not permit changing nullable/default/generated yet
2025-03-22 10:21:36 +00:00
Oreon Lothamer
92c9e8736d paginate pr-env job id retrieval (#55590) 2025-03-21 20:05:41 -10:00
Mahatthana (Kelvin) Nomsawadi
746b6ed780 Let embedders select exposed entities (#55463)
* Control visible entities in multi-stage data picker (#54845)

* Add props to DataSelector, and keeps the same behaviors.

* Read entity_types from URL search params

* Fix type errors

* Fix SDK not rendering multi-stage data picker

* Add redux slice tests

* Add E2E tests

* WIP add integration tests

* Add all integration tests

* Put tests file in a proper folder

So the SDK build process doesn't check test file types

* Cover more E2E scenarios

* Cover the new code with a test

* Add more assertions to make sure more paths are tested

* Fix imports

* Make functions easier to understand

* Fix test case name typo

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

* Clarify embed state type

* Address review: Make code more concise

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>

* Control visible entities in simple data picker (#55329)

* Filter simple data picker by "entity_types"

* Add a happy path for multi-stage data picker E2E test

* Fix loading a wrong entity

* Control visible entities on new item menu dropdown (#55331)

* Control visible entities on new item menu dropdown

* Hide action following product discussion

* Make a new menu item more accessible

* Add tests

* Control visible entities in Browse sidebar (#55332)

* Control visible entities in Browse sidebar

* Add relevant tests

* Fix test case typos

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

* Add comment to clarify magic value

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

---------

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

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-03-22 09:48:30 +07:00
Eric Normand
62cce4b7af [Integration branch] Cast string to date custom expression function (#55435) 2025-03-21 23:03:36 +00:00
Nick Fitzpatrick
4e0ca8b1d3 use-escape-to-close-modal, fix closing entity picker on esc (#55549)
* use-escape-to-close-modal, fix closing entity picker on esc

* add test for duplicate modal

* adding comment
2025-03-21 18:10:31 -03:00
Case Nelson
aebf3c8a2d support: Add snowplow logging for starburst-legacy-impersonation (#55569)
* support: Add snowplow logging for starburst-legacy-impersonation

* Fix tests
2025-03-21 14:57:53 -06:00
Eric Normand
50b372feff [INTEGRATION] splitPart() custom expression function (#55429)
* Empty

* Add split-part backend (#55425)

* feat: prepare fe part of split-part (#55483)

* Add split-part backend

* feat: prepare fe part of split-part

* rename function and add test

* use postgres for testing

* add test for an error

* add db flag

* remove docs page

* update copy

---------

Co-authored-by: Eric Normand <ericwnormand@gmail.com>

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>
2025-03-21 20:44:41 +00:00
Alexander Polyankin
3ca34fbcf6 Multi-stage filter picker in chill mode (#55052) 2025-03-21 20:09:15 +00:00
Oreon Lothamer
78801d0533 point to correct workflow for pr-env lookup (#55580) 2025-03-21 09:53:45 -10:00
Eric Normand
6909e8d742 Frontend and Backend for url-pathname (#55353) (#55375)
* feat: prepare fe part of url-pathname

* fix dropdown styling

* fixup example

* rename function to path and update example

* Backend for url-pathname

* Rename to path()

* Backend tests for `path()`

* Frontend and Backend for url-pathname (#55353)

* feat: prepare fe part of url-pathname

* fix dropdown styling

* fixup example

* rename function to path and update example

* Backend for url-pathname

* Rename to path()

* Backend tests for `path()`

---------

Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>

* Fix kondo

* Fix kondo

* feat: prepare fe part of url-pathname (#55291)

* fix description

* fix styling

* cleanup

* fix rebase

* fix rebase

* add tests

* add tests

* update test

* fix test

* address review

* prevent url translations

* make tests less flaky

* update copy

* add category

* remove docs page and add feature flag

---------

Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-03-21 19:24:10 +00:00
Aleksandr Lesnenko
31eefe0d39 specify renderHook renderer explicitly (#55572) 2025-03-21 19:23:57 +00:00
Oleksandr Yakushev
0267393d72 [sync-metadata] Use equalsIgnoreCase to match fields instead of lowercasing (#55239) 2025-03-21 21:03:40 +02:00
Romeo Van Snick
8f617a8d78 Clean up custom expression compiler (#54415)
* Convert typeinferencer to typescript

* Split up diagnostics

* Split of lib check from diagnostics function

* Move getDatabase to util file

* Move isErrorWithMessage to utils

* Add getExpressionMode helper

* Simplify branches

* Move resolveMBQLField to separate module

* Simplify expressions import

* Remove unused options

* Fix type of mock env

* Move compiler to separate file

* Remove unused arguments to compiler

* Move passes to separate file

* Return expression from diagnose

* Remove unused processSource helper

* Fix types in passes

* Make resolving optional in compiler

* Add fuzz testing for compiler

* Mock legacy mbql to clause in fuzz test

* Remove need for compare

* Use default parameters

* Remove compare and compareSeed

* Remove unused recursive-parser

* Remove fuzz testing for recursive parser

* Remove unused arguments

* Colocate helper with the tests that use it

* Use compileExpression in formatter tests

* Use compileExpression in typeinferencer tests

* Order compiler passes

* Move StartRule and ClauseType to metabase-lib/v1/expressions

* Remove useShorthands pass

* Fix token escaping in pratt compiler #54751

* Remove POPULAR_ functions and aggregations

* Move compiler passes out of pratt compiler

* Make getMBQLName optional

* Add missing adjustBooleans pass

* Type startRule in compiler

* Move resolverPass to field-resolver

* Add isCompilerPass helper

* Allow use of short-circuiting for disabling passes

* Only render friendly errors

* Mark ExpressionError and ResolverError as user-friendly

* Add check for missing comma in argument list

* Simplify diagnostic checks

* Always return error and expression

* Make compileExpression and diagnoseAndCompile generic to StartRule

* Remove diagnoseAndCompileExpression helper

* Remove unused completer utils

* Move enclosingFunction to expressions module

* Fix typeinferencer tests

* Fix e2e test

* Detect cycles

* Inline passes

* Flatten compiler

* Remove prevError

* Remove default from diagnoseAndCompile type definition

* Use try/catch to simplify diagnoseAndCompile

* Wrap diagnostic errors in their own type

* Remove unnecessary wrapping of diagnostic error

* Move errors to top-level expression module

* Remove duplicate error types in expressions

* Fix error format in tests

* Add comments to passes

* Add tests for passes

* Fix lint

* Fix type imports

* Flesh out references in test data with base-type

* Use fleshed out field reference in all test cases

* Add boolean expression to test data

* Port recursive-parser tests for compiler

* Fix support for unary +

* Add cast support to test database

* Move cast calls to separate test

* Add test for escaping identifiers

* Unskip test

* Fix compiler tests to support top-level literal

* Typo

* Use normal quotes

* Fix typeinferencer for value clause

* Use all passes by default

* Fix pratt compiler tests

* Unskip garbage test

* Use dedent from ts-dedent

* Remove ClauseType helper for expression and make everything use Lib.ExpressionClause

* Coerce clause to be expression clause in filter and aggregation pickers

* Fix diagnostic test

* Wrap diagnostic error in a DiagnosticError

* Use instanceof to check type of error

* Do not assume all diagnostic errors are human-friendly
2025-03-21 19:51:50 +01:00
Romeo Van Snick
55fefac833 Add placeholder to custom expression editor (#55537)
* Add placeholder to custom expression editor

* Ignore placeholder in e2e test
2025-03-21 19:48:43 +01:00
github-actions[bot]
a36e2fca46 Add Slovenian Localization + Synchronize Translations (#55307)
* Update translation sources 2025-03-17

* Update translations

* don't add lithuanian yet

* language is always locale

* Fix the `ttag` i18n calls for pluralized strings

Pluralized strings *without* the number interpolated into them (eg.
"Month" and "Months") were not getting found by `i18n/trun` in CLJS,
which made them fall back to English.

This fixed the `ttag/msgid` call to be correctly formed in both cases.

* update some localized strings

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-03-21 11:38:35 -06:00
Jeff Bruemmer
4353626e7a fix links (#55548) 2025-03-21 13:23:53 -04:00
dpsutton
4a068f02b3 Handle snowflake timeouts (#55546)
We are running a probe query on snowlfake to see if the current db user
can see views

```
select true from X where 1 <> 1 limit 0
```

Something like this.

But on large views, it seems snowflake does not quickly determine this
has no rows and it can take a while.

This leads to the connection being closed. Then in the error handler we
attempt to rollback. But if the connection is closed _this_ throws and
we have now thrown from the error handler and we break sync.

This does two things
1. set a timeout on sql statements. This does 10 seconds.
2. If a timeout occurs, assume that they _can_ see the object

The idea is that timeouts might happen but it's trying to run a query
that it would quickly reject if the permissions were lacking. So
timeouts mean you can see the data, it's just taking a while
2025-03-21 12:13:36 -05:00
Sébastien
ccaddac0c4 closes viz-358 precision for scientific notation (#55542) 2025-03-21 18:05:33 +01:00
Sébastien
bc3b10d93c closes viz-230 no color picker for waterfall series (#55530) 2025-03-21 18:05:16 +01:00
Stas Gavrylov
460a36571a WRK-116: Add custom cron scheduling option to Schedule (#55472)
* WRK-116: Add custom cron scheduling option to Schedule. Integrate in Alerts notifications

* WRK-116: Remove 'every' label for custom schedule option. Introduce 'separate' group for GroupControlsTogether.
2025-03-21 18:46:13 +02:00
Riley Thompson
a34c663134 Bring Clickhouse driver into Metabase repo (#54740)
* Bring Clickhouse driver into Metabase repo

---------

Co-authored-by: Luiz Arakaki <luiz.arakaki@metabase.com>
2025-03-21 12:37:18 -04:00
Sébastien
43b23ec5c5 Closes VIZ-498 can't change back to dollar sign in header (#55167)
* closes VIZ-498 can't change back to dollar sign in header

* added unit test

* fixup
2025-03-21 17:36:02 +01:00
Edward Paget
f385ca3b47 feat: enable the field scanning task for audit db (#55379) 2025-03-21 16:27:31 +00:00
Edward Paget
0bff778586 feat: add embedding stats to token request (#55491)
* feat: add embedding stats to token request

Adds the embedding_users, internal_users, domains, and query_execution_*
stats to the token check request in order to track embedding usage.

This creates a new internal_stats module to share code between the
anonymously reported stats the stats for the token check request to
avoid some circular depedencies. This also seperates creation of a stat
and how it is reported, so we could move over other stats calculated for
the phone home metric.

* temp! add a logging statement to figure out why CI is different

* fixup! exclude api-key email

* fixup! exclude api-key/internal type users
2025-03-21 16:22:07 +00:00
Phoomparin Mano
5bd573c163 docs(sdk): indicate support for react 19 (#55527)
* update docs and cli

* unify wording for cli message

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-21 23:22:03 +07:00
bryan
9ff6f46311 fix localhost:* in embedding app origins sdk (#55481)
* fix localhost:* in embedding app origins sdk

We need to call the setting's getter directly, and not use
`setting/get-value-of-type`. The setter it adds localhost:* which is required.

* add test

* test fix

* update module config

* improve test feedback

* fix ci
2025-03-21 10:14:56 -06:00
Timofey Kachalov
84f4b08e52 Enable shoppy compatibility testing on CI (#55536) 2025-03-21 19:58:19 +04:00
Jeff Bruemmer
104e1d59d8 remove unused images (#55544) 2025-03-21 11:53:54 -04:00
Konstantin Darutkin
9f2e1cb040 feature(enterprise): add creation and editing modals for table editing (#55461)
* feature(enterprise): add creation and editing modals for table editing

* fix: review fixes

* feat: add backend integration

* fix: comment out delete button in header
2025-03-21 15:25:54 +00:00
Jeff Bruemmer
c725834726 docs - accessibility notes (#55493)
* accessibility notes

* update accessibility page
2025-03-21 11:23:04 -04:00
Dan Stone
e5023e9e11 Fix sync dropping new columns on the floor after describe (#55447) 2025-03-21 15:14:57 +00:00
Aleksandr Lesnenko
ea33b84c8f use whitelabel colors in the static viz (#55231)
* use whitelabel colors in the static viz

* Fix backend whitelabel test for app colors

* update CI

---------

Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-03-21 10:34:27 -04:00
Edward Paget
0cb3f4157d fix: return 404 when logout without session (#55464)
* fix: return 404 when logout without session

* fixup! remove #p
2025-03-21 14:09:53 +00:00
Mahatthana (Kelvin) Nomsawadi
54c3894552 Reduce noise in SDK Slack channel (#55513) 2025-03-21 09:20:03 +00:00
Oisin Coveney
ecc332187a Use SDK-specific ID types and reconcile the changes (#55448) 2025-03-21 10:48:08 +02:00
Timofey Kachalov
2b192818f6 docs(sdk): Extract embedding docs code snippets to separate files and type-check them (#55253) 2025-03-21 12:45:29 +04:00
Nicolò Pretto
6f3d2566eb test: add renderHookWithProviders helper (#55449)
* test: add renderHookWithProviders helper

* remove defaults from getTestStoreAndWrapper and destructure options to
only pass down the correct args
2025-03-21 09:40:59 +01:00
Darth Spectrum
4379a56a85 Not retrying to send notifications to missing slack channels (#55180)
Fixes #49647
2025-03-21 09:42:31 +02:00
Tyler Plude
c29938b1ea Fix cond fmt of null vs empty str in table static viz (#55386)
* Fix cond fmt of null vs empty str in table static viz

* Adding unit test

* Add TextWrapper support in json exports

* Updating unit tests with TextWrapper
2025-03-21 00:44:59 +00:00
Alexander Polyankin
ce6a272e22 [Integration branch] Literals in expressions - value support (#55202)
* Empty

* Add `value` support in the expression editor (#55203)

* Literals in filters tests (#55283)

* E2E tests for literals in custom columns (#55288)

* E2E tests for literal custom columns in other clauses and fixes (#55295)

* Move changes from the FE branch

* Move changes from the FE branch

* Move changes from the FE branch

* Fix filter schema and false = false filter (#55417)

* Fix date/string literals effective type (#55427)

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Forbid top-level constants until the BE is fixed (#55459)

* Use matches

* Make test flaky

---------

Co-authored-by: Mike Appleby <86076+appleby@users.noreply.github.com>
2025-03-20 20:10:13 -04:00
Nathan Voxland
3fa59859db Store created-by-id in the gsheets config (#55191) 2025-03-20 17:10:03 -05:00
metamben
5071cef855 Use actual time zone marker (Z) when parsing offset times (#54987)
Fixes #53724

Also remove (date)time formats moment cannot handle anyway.
2025-03-20 23:26:29 +03:00
Edward Paget
63d22989e9 fix: use custom dns resolver when fetching geojson (#55460) 2025-03-20 13:27:28 -05:00
Alex Yarosh
6b0449351f Update mongodb.md (#55470) 2025-03-20 14:02:13 -04:00
Tyler Plude
0a3c48b0c1 Fix sig-figs-after-decimal (#55377)
* Fix number formatter for small decimals

* Fixing bug when decimal is not ; Removed param as input value should always be numerical
2025-03-20 10:43:28 -07:00
Uladzimir Havenchyk
bbcac9ead3 ci: set default number of times for running e2e stress test (#55462) 2025-03-20 20:37:50 +03:00
Aleksandr Lesnenko
a1f7d7fba0 Apply fix from 51937 to new minibar cell (#55477) 2025-03-20 17:11:31 +00:00
Phoomparin Mano
f3a1576201 ci(sdk): run embedding sdk component tests across react 18 and 19 (#55405)
* add script to change react version

* cleanup version

* cleanup version change script

* setup workflow

* fix workflow dependencies

* cleanup workflow dependencies

* fix clojure missing

* setup @cypress/react

* combine cypress harness packages

* add clarification messages

* remove @cypress/react18

* remove backup files

* cleanup package.json

* cleanup cypress test harness

* clarify cross React version tests

* clarify messages

* change react version after making appdb snapshot

* log dependencies in change-react-version

* revert me - use fake uberjar to speed up testing

* update test jar

* mkdir for testing purposes

* remove react 17 from matrix

* clarify React 17

* remove testing config

* let git handle the backup and restore mechanism

* move the artifact download step for a better diff
2025-03-20 23:25:51 +07:00
Nicolò Pretto
b196a4e0c3 ci(sdk): adds embedding-sdk-tests-result (#55344)
* ci(sdk): adds embedding-sdk-tests-result

* ci: should run the sdk tests as part of the embedding-sdk workflow

* let's try without concurrency

* rename "frontend" -> "embedding SDK"
2025-03-20 12:40:03 +01:00
Alexander Polyankin
d6e3e3d187 [Integration branch] Add integer(<value>) MBQL function for Postgres (#55364)
* Integration

* Support for `text` MBQL function on the FE (#55274)

* Cast text backend on postgres (#55292)

* Add `text()` custom expression that casts to text

* Add :cast to list of all possible features

* Complete testing plan

* Fix kondo warnings

* Fix test

* Empty

* Add e2e tests (#55361)

* Fix failed tests for text() function (#55374)

* Add UI for integer() function, with e2e tests (#55366)

* Set category

* Set category

* Set category

* Set category

* Fix tests

* Cast integer backend (#55381)

* integer() custom expression with simple tests

(more tests coming)

* MOAR tests

* EVEN MOAR tests

* Change type to BigInteger

---------

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-03-20 01:56:43 +00:00
Aleksandr Lesnenko
9dfa4dcdef Data grid cell selection (#54775) 2025-03-19 21:03:30 -04:00
Oleksandr Yakushev
7d5fcecf28 [pivot] Optimize CLJC pivot exsport for csv files (#55235) 2025-03-19 22:21:45 +00:00
Alexander Solovyov
d6dc7e5f3c [serdes] introduce (partial) schema coercion for Dashboard (#55354)
This adds coercion support for serialization and adds a very limited partial schema for a Dashboard, in hopes that
this grows to be a full schema for our data models at some point.

fixes #54941
2025-03-19 21:38:43 +00:00
Alexander Polyankin
94d46b2290 [Integration branch] Add text(<value>) MBQL function for Postgres (#55268) 2025-03-19 19:52:39 +00:00
Filip Hric
cbc59ff0b2 run only previously failed tests when rerunning pipeline (#54900) 2025-03-19 12:54:30 -06:00
Aleksandr Lesnenko
61ba3c325e Tanstack data grid table interactive dashcards (#54703) 2025-03-19 18:36:33 +00:00
Raphael Krut-Landau
e7dea2105d Add e2e test that filter values are sandboxed #54539 2025-03-19 14:34:49 -04:00
Dan Stone
b817729e1d Fix migration collision (#55421) 2025-03-19 15:57:48 +00:00
Oisin Coveney
928683dc71 fix(sdk): Fix ad-hoc question view when clicking into SDK dashboard (#55254)
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
2025-03-19 17:37:06 +02:00
Ryan Laurie
90f891214e Sync Localizations with Crowdin (#52334)
* sync translations with crowdin

* remove poeditor integration

* fix run name

* update to new project

* sync

* path

* move to config

* not master lol

* kick ci

* update crowdin config

* remove croatian

* roflcopter

* token

* maybe fetch harder

* test code - revert this

* test

* more tokens

* just use the cli

* line breaks

* le facepalm

* no verify

* token swap

* auto approve

* revert

* remove zh e2e test

* remove test code

* don't backport translations

* don't backport translations
2025-03-19 08:24:24 -06:00
Ryan Laurie
7e5d8c9f4a Support huge piles of open backports (#55342)
* support huge piles of open backports

* correct string
2025-03-19 08:06:31 -06:00
Konstantin Darutkin
759da5a5c8 fix(enterprise): datetime editing formatting (#55408) 2025-03-19 13:37:41 +00:00
Denis Berezin
398bacf6ed fix: hide edit mode button from non-admins 2025-03-19 16:33:22 +03:00
Konstantin Darutkin
b7cb067b6c feat(enterprise): add date and datetime table editing (#55402)
* feat(enterprise): add date and datetime table editing

* fix: minor improvement

* fix: minor improvement
2025-03-19 13:23:40 +00:00
Romeo Van Snick
0c9bc4fab2 Do not reopen helptext when selecting completion (#55280)
* Do not reopen helptext when selecting completion

* Add e2e tests for help text and suggestions
2025-03-19 14:07:07 +01:00
Alex Yarosh
4ee726ee16 docs: add Learn redirects for Maps (#55367)
* Update map.md

* Update map.md
2025-03-19 09:00:01 -04:00
Ngoc Khuat
cccf5a8348 [Notification] Conditional expression (#55314)
* condition syntax PoC

* remove the migration

* wire up notification with condition check (#55389)
2025-03-19 21:56:04 +09:00
Denis Berezin
b4b84e778a Merge branch 'master' into internal-tools 2025-03-19 14:57:26 +03:00
Dan Stone
06c9675131 Sync nullable, generated, default attributes for fields (#55113)
* Sync nullable, generated, default database flags

* Fix database-default for apache druid

* Add postgres test for new column attributes

* Add h2 test for new column attributes

* Fix serde baseline

* Use more random test table names
2025-03-19 11:27:15 +00:00
Oisin Coveney
2d4a7d05df fix(sdk): Entity ID support for CreateDashboardModal (#55358) 2025-03-19 13:25:40 +02:00
Konstantin Darutkin
e67139aa3f fix: visual improvements for table editing (#55259) 2025-03-19 11:21:44 +00:00
github-automation-metabase
b8f7bff12b Bump io.netty/netty-buffer from 4.1.118.Final to 4.1.119.Final (#54568)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-19 12:56:03 +02:00
Ngoc Khuat
e7af871ca1 Add display type for notification subscription (#54954) 2025-03-19 10:47:15 +00:00
Romeo Van Snick
331c9bd7e2 Add function browser to the custom expression editor (#55102)
* Add FunctionBrowser component

* Move header into CombineColumns for consistency

* Render the function browser

* Allow wrapping shortcuts

* Render toolbar buttons on top again

* Add missing Lib import

* Fix e2e test

* Use ellipsis in placeholder

* Add test-id to function browser

* Add e2e tests for function browser

* Add category to help text configs

* Only render supported functions in function browser

* Convert to helptext in getFilteredClauses

* Group functions by category

* More e2e tests

* Add empty state to function browser search

* Add more breakpoints for expression editor layout

* Move function browser item into its own component

* Increase width of function browser

* Add case to functions

* Remove unnecessary maw prop

* Sort functions

* Add tests for FunctionBrowser

* Remove nested component definitions

* Use standard breakpoints

* Add spacing between toolbar buttons

* Fix functions test

* Add category to distinct-if

* Fix tests that were broken by sorting

* Fix unit test examples

* Add more unit tests for filtering

* Do not enter parentheses when there are no arguments to the clause

* Sort by displayName

* Sort by structure

* Add e2e about clauses with no args

* Fix sorting test

* Fix font sizes for function browser

* Fix function browser spacing

* Allow replacing selection with function browser
2025-03-19 10:13:32 +01:00
Oisin Coveney
d094e67e54 Remove dashboardActions and dashboardProps spreading in favor of explicit props (#55175) 2025-03-19 07:14:12 +00:00
Kamil Mielnik
c5d7b545ee Fix - App crashes when editing segment field details in data reference (#55333)
* Fix #55322

* Repro #55322

* Simplify diff
2025-03-19 13:43:30 +07:00
Raphael Krut-Landau
34ef924bce Add e2e tests that parameter values can be sandboxed (#54655) 2025-03-18 22:32:53 -04:00
Ngoc Khuat
aa3db88a58 [Notification] Fix task history report when channel failed to send and we skip it (#55312) 2025-03-19 10:33:00 +09:00
Fraser
62af27038b Replace Confirm with ConfirmModal (#55310)
* Replace Confirm with ConfirmModal
2025-03-19 13:02:26 +13:00
Luis Paolini
8f425c9fee Upgrade jspdf to 3.0.1 (#55363) 2025-03-18 20:15:47 -03:00
Chris Truter
7696b5e16c Editable table components in dashboards (#55345) 2025-03-19 00:07:08 +02:00
Aleksandr Lesnenko
c381149964 loki-update should update only diff (#55246) 2025-03-18 20:38:05 +00:00
Nick Fitzpatrick
6850c93eaa For your consideration hoc (#54933)
* Context Driven Indicator Menu

* add unit tests

* unit test adjustments

* Ho
C time

* hasSeenAll

* cleanup, passing tests

* adjusting some tests, PR feedback

* more small adjustments. Starting to add docs

* hopfully final adjustments

* adjusting storybook path
2025-03-18 17:16:51 -03:00
Braden Shepherdson
0195ff7ecd [refs] Support remapped columns in lib; handle more ident cases (#55311)
Closes QUE-764.

Adds support for returning "remapped" columns, which have not been
supported in the library previously.

- Refactor `lib.field/remapped-field` to `lib.metadata`
- Add `lib.metadata.calculation/remapped-columns`


Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-03-18 19:48:24 +00:00
Denis Berezin
177cc26508 Add FK handling and editing (#55303) 2025-03-18 22:45:07 +03:00
Edward Paget
55b4c2446a fix: improve startup by not scheduling all dbs (#55297)
* fix: improve startup by not scheduling all dbs

Improve long startup times by not scheduling tasks for all dbs on
startup. Due to the lack of bulk operations in quartz if an installation
has 500 dbs we need to load and scan through all associated db scanning
triggers 500 times for all dbs which means loading about 500k records in
1000 operations.

This is generally pretty fast on a per operation basis (about .5s
in local development), but on some postgresql installations this can
blow up to a few seconds per db, which makes the whole operation take 40
minutes plus. Additionally there maybe both lock contention and resource
contention between the quartz scheduler and the main app thread that
draws out this time.

Instead we want to init the schedule and put it into standby mode -- where
we can schedule tasks but are not executing them -- before we process
the configuration file. That we can schedule all necessary tasks as part
of loading the database from the config file and not need to then
iterate all database to schedule their tasks later in the startup.

Long term, it would be good to support rescheduling tasks using a bulk
operation in quartz (there are TODOs in their code base for supporting
this) rather than needing to update each trigger individually.

* fixup! doc string for check-health! function
2025-03-18 18:47:45 +00:00
Alex Yarosh
460ced3b6f docs: overhaul maps docs (#55313)
* map comparison

* docs: maps overhaul

* Apply suggestions from code review

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

* review feedback

* Apply suggestions from code review

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-18 18:16:00 +00:00
Alexander Solovyov
87f6d7e8f7 fix some mage installer logic (#55277)
* fix some mage installer logic

* make `cd bin && ./mage` work

get the absolute path, + cd to mb repo root in subshell

---------

Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
2025-03-18 17:44:00 +00:00
Luis Paolini
e7bf5d57ed Update root folder Dockerfile (#54110)
Update the clojure version
2025-03-18 14:11:42 -03:00
Noah Moss
c8314f52cf Migrate Chinese site & user locales from zh to zh_CN (#55287) 2025-03-18 12:50:20 -04:00
Phoomparin Mano
588abf10ed feat(sdk): do not setup sandboxing and show user switcher if using a sample database (#55105)
* do not setup sandboxing if using a sample database

* do not ask for tenancy columns if using a sample database

* alter copywriting when in sample database mode

* improve copywriting for scenarios with a sample database

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

* fix misleading comments

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-18 16:28:28 +00:00
Alex Yarosh
5dd9e138a8 Update expressions-list.md (#55350) 2025-03-18 12:06:16 -04:00
Alex Yarosh
fea7185b21 Update introduction.md (#55349) 2025-03-18 16:02:53 +00:00
Oisin Coveney
3c63deb4bb Remove InteractiveQuestionProviderWithLocation since it's really not necessary (#55165) 2025-03-18 17:53:42 +02:00
github-automation-metabase
7e816edff6 Bump io.github.eerohele/pp from 7ac1bc56de95520ff4938df05e3518e9b051415d to 9598f4c72b528480a85ea41651c45b08d1717428 (#55242)
Inspect dependency changes here: 7ac1bc56de...9598f4c72b

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-18 11:49:11 -04:00
William
b92b5d2e68 Backfill job handles many duplicates (#55228)
The backfill job originally retried up to 20 times and then gave up.  However, some instances apparently have ~150
duplicates or more, so 20 retries is insufficient.  In addition, 2 db calls per conflict is sort of a problem when the
conflict count is O(duplicates^2).  This bumps up the retry limit and reduces the db calls to 1 per 50 conflicts.
2025-03-18 14:40:12 +00:00
Kamil Mielnik
76cabfcf73 SEM-149 Hide unused semantic types (FE only) (#55327)
* Hide deprecated semantic types

* Add tests

* Update tests
2025-03-18 21:21:25 +07:00
Kamil Mielnik
9a8dc14501 Fix - Prevent browser close/go back while changes are unsaved (#55161)
* Disallow navigating from model/{slug}/query and model/{slug}/metadata to model/{slug} when there are unsaved changes

* Reset state

* Simplify reset

* Use appropriate redux action when programmatically invoking navigation

* Disallow navigating from metric/{slug}/query and metric/{slug}/metadata to metric/{slug} when there are unsaved changes

* Remove mentions on inexisting /metric/metadata and /metric/{slug}/metadata routes

* Rename test

* Add repro for #32037 (models)

* Improve assertions

* Fix state cleanup

* Fix flaky test

* Deal with race conditions

* Add repro for metrics

* Correctly reset ui state when cancelling editing a model/metric

* Add repro for editing model's query

* Remove log

* Add a comment
2025-03-18 21:21:20 +07:00
Jeff Bruemmer
b57516c465 update site urls (#55337) 2025-03-18 10:19:06 -04:00
Stas Gavrylov
be7d1b04df WRK-129: Add 'by the minute' option to Schedule (#55184)
* WRK-129: Add 'by the minute' option to Schedule. Add NotificationSchedule component
2025-03-18 16:12:25 +02:00
Stas Gavrylov
6be9eb6905 Fix incorrect condition to hide parameters section in SubscriptionSidevar (#55320)
* Fix incorrect condition to hide parameters section in SubscriptionSidebar
* Add unit tests for advanced filtering parameters display
2025-03-18 14:10:08 +00:00
Ngoc Khuat
ab9103a67f [Notification] Handle description for new schedule types (#55249) 2025-03-18 13:38:18 +00:00
Nick Fitzpatrick
8b4e79dd79 fixing hover state on time grouping dropdown (#55284) 2025-03-18 10:08:47 -03:00
Alexander Polyankin
c38c616056 Remove source-table being accessed directly in the QB (#55267) 2025-03-18 09:07:44 -04:00
Jeff Bruemmer
60d9c209e7 minor modal message fix (#55217) 2025-03-18 09:03:53 -04:00
Phoomparin Mano
87354c136f fix(sdk): mark all react-dom dependency requests as external for React 19 compatibility (#55071)
* fix externals configuration to enable compatibility

* tweak externals configuration
2025-03-18 19:04:08 +07:00
Mahatthana (Kelvin) Nomsawadi
0be73a6e90 Add a new embedding selector + make selector names consistent (#55260) 2025-03-18 11:36:51 +00:00
Mahatthana (Kelvin) Nomsawadi
57bd674360 Update embedding team codeowners files (#55317) 2025-03-18 11:36:30 +00:00
Filip Hric
9a4605143f remove filiphric from e2e tests codeowners (#55316) 2025-03-18 10:31:40 +01:00
Chris Truter
b158037771 Merge branch 'master' into internal-tools 2025-03-18 11:17:27 +02:00
Romeo Van Snick
c7a03ed080 Custom expression close on exit modal (#55047)
* Revert "Skip tests that deal with the click outside and escape behaviour of the custom expression editor"

This reverts commit 2c05bc08c2.

* Revert "Remove CloseModal component"

This reverts commit ad1795e05a.

* Revert "Move usePreventClosePopover into utils"

This reverts commit de31b21282.

* Add PreventPopoverExit util

* Remove use of non-existant hook

* Prevent popover from closing on outside click or escape

* Rename argument to avoid confusion with double negatives

* Prevent custom expression editor from closing in aggregation sidebar

* Allow exiting the component when navigating away from custom expression editor

* Add a comment explaining why the useClickOutside does not work

* Add comment on how CloseModal works

* Remov empty file

* Add comment on what children should be

* Allow overriding cancel button text on ConfirmModal

* Allow passing more props to ConfirmModal

* Fix primary button on ConfirmModal

* Use ConfirmModal for custom expression editor

* Fix e2e test

* Remove second message in closemodal

* Update loki
2025-03-18 09:01:00 +01:00
Uladzimir Havenchyk
5aeb52544a ci: decrease build job timeout (#55264) 2025-03-18 09:32:39 +03:00
Ryan Laurie
34722e2025 Add Basic Admin Setting Component (#55063)
* add admin settings input widget

* stupid typescript

* stupid me

* silly typescript

* rename component
2025-03-17 17:25:57 -06:00
Denis Berezin
5c162716e5 Switch between table view and edit mode (#55133) 2025-03-18 00:31:20 +03:00
Gustavo Saiani
425043a096 Update links (#55298) 2025-03-17 18:06:33 -03:00
Denis Berezin
b52a3b6d34 Merge branch 'master' into internal-tools 2025-03-17 23:19:10 +03:00
Uladzimir Havenchyk
c0c045a568 fix(qb): do not cut layout with two sidebars (#55163)
* fix(qb): do not cut layout with two sidebars

do not show data reference sidebar automatically on small screens

* rename wrapper
2025-03-17 20:13:49 +00:00
Jeff Bruemmer
cc9b45c6dd docs - sdk edits (#55056) 2025-03-17 20:03:29 +00:00
Aleksandr Lesnenko
d0efa299de move crypto-browserify to dev deps (#55279) 2025-03-17 19:25:46 +00:00
Alexander Polyankin
a22366e29f Remove unused metabase-lib/v1 code (#55262)
* Remove StructuredQuery

* Remove query base classes

* Remove query base classes
2025-03-17 13:16:03 -04:00
Jeff Bruemmer
0de7a3047d docs - update generated docs (#55275) 2025-03-17 12:35:23 -04:00
John Swanson
bcbf3e946b dev: just warn if can't watch UserKeyValue schemas (#55178)
If you run an uberjar with `MB_RUN_MODE=dev`, you get an exception
because you try to run the `watch-directory!` bit (which only works for
actual files) in an uberjar environment.

Let's just print a warning but continue along.
2025-03-17 16:29:50 +00:00
Ryan Laurie
fd976b7237 fix temporal strings for i18n (#55270) 2025-03-17 15:58:38 +00:00
Alexander Polyankin
0804a5ebca Improve Select all/none labels (#55109) 2025-03-17 10:16:22 -04:00
Romeo Van Snick
95b6eeec4c Custom expression better examples (#55048)
* Rename arg to caseInsensitive

* Add matcher for internal [:dimension name]

* Add formatting support for internal dimension clause

* Use raw MBQL in examples

* Format examples at certain width

* Remove unused suggest code

* Fix unit test for help text

* Add unit test for rendering examples on multiple lines in HelpText

* Improve spacing

* Make sure that all help texts can be formatted properly

* Add custom formatExample helper to format example expressions

* Use useAsync to format example

* fixup! Add custom formatExample helper to format example expressions

* Add HighlightExpression component

* Export all modules
2025-03-17 14:23:17 +01:00
Anton Kulyk
52b92aa7f5 Fix object detail view ignores link formatting (#55200)
* Fix `row` type to be `RowValue[]`

* Use richer `clicked` object in object detail view

* Fix column settings not available in detail view

* Add e2e test
2025-03-17 12:47:52 +00:00
Alexander Polyankin
efb52f7916 Remove StructuredQuery from metabase-lib/v1 (#55223) 2025-03-17 11:40:41 +00:00
Romeo Van Snick
6b8c581ea6 Fix Custom Expression snippet completion when error occurs (#55164)
* Avoid rerendering editor when error change

* Add delay support to CustomExpression.type

* Add test for breaking snippets
2025-03-17 12:07:10 +01:00
Kamil Mielnik
db12bcbd4f Fix - Filtering the semantic types list is super annoying (#54965)
* Rename Select to LegacySelect

* Convert frontend/src/metabase/lib/core.js to TypeScript

* Format code

* Extract SemanticTypePicker

* Fix type

* Fix styling

* Fix nulls

* Add nothingFoundMessage

* Extract DefaultSelectItem

* Add CurrencyPicker

* Optimize

* Add checked icon to CurrencyPicker

* Improve overflow in SelectItem

* Add FkTargetPicker

* Style font-weights to be the same as in other inputs around

* Fix colors

* Add a comment

* Fix imports

* Style dropdowns

* Make currency input full width

* Add Combobox component

* Show currency symbol next to value

* Modernize field settings button

* Modernize FieldVisibilityPicker

* Update tests

* Update test

* Update and merge tests

* Update tests

* Remove bold, fix padding and move components to their own dirs

* Update unit tests

* Update e2e tests

* Update tests

* Reduce flakiness

* Add comment

* Repro #53595

* Replace CSS modules overrides with props

* Fix symbol styling for selected option in CurrencyPicker
2025-03-17 14:45:27 +07:00
Ngoc Khuat
22d48678bb Quartz guide (#55068) 2025-03-17 16:41:17 +09:00
github-automation-metabase
39a1a17303 Bump net.snowflake/snowflake-jdbc from 3.22.0 to 3.23.1 (#55245)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-17 04:46:42 +00:00
github-automation-metabase
26c0cdaf94 Bump org.clojure/tools.reader from 1.5.1 to 1.5.2 (#55244)
Inspect dependency changes here: https://github.com/clojure/tools.reader/blob/v1.5.2/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-17 04:40:39 +00:00
github-automation-metabase
119579dc6c Bump org.clj-commons/hickory from 0.7.5 to 0.7.7 (#55243)
Inspect dependency changes here: https://github.com/clj-commons/hickory/compare/Release-0.7.5...Release-0.7.7

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-17 13:27:04 +09:00
github-automation-metabase
bb688aff2e Bump com.github.seancorfield/honeysql from 2.6.1281 to 2.7.1295 (#55240)
Inspect dependency changes here: https://github.com/seancorfield/honeysql/blob/v2.7.1295/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-17 13:26:51 +09:00
Fraser
e1f1d8e6ed Replace ConfirmContent with ConfirmModal (#54947)
* Replace ConfirmContent with ConfirmModal
2025-03-17 13:42:16 +13:00
Fraser
db090a59c0 Use the new ConfirmModal in DeleteConfirmModal (#54946)
* Use the new ConfirmModal in DeleteConfirmModal

* Delete ConfirmDeleteModal and use ConfirmModal directly
2025-03-17 13:41:05 +13:00
Alex Yarosh
b6e05875da docs: hiding columns (#55233)
* hiding columns

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-15 19:57:25 +00:00
Aleksandr Lesnenko
b1b183f7b9 render cartesian charts when the dimension column is not available (#54870) 2025-03-14 23:40:20 -04:00
Noah Moss
ea73a601b7 Shared FE/BE pivots (#53000)
* POC - moving two pivot functions into CLJC

* Debug logs in frontend pivot impl

* POC continued

* setting isCollapsed consistently

* Working replication of valuesByKey map construction

* sorting logic

* hook up new code to the FE impl

* Fixing small potential bug in valuesByKey

* Fixing bug in clojure vs javascript string key for valuesByKey

* fix valueColumns key name

* Some performance improvements + cleanup

* A couple more attempts at perf improvements

* Fix bugs

* port format-values-in-tree

* WIP add-subtotals

* @tsp - Improved build-values-by-key perf; some debug perf lines in frontend land

* @tsp - in progress conversion of add-subtotals

* @tsp - working converted Pivot.add_subtotals

* @tsp - fixing bug in add-subtotal mapcat recursion

* @tsp - add-subtotal restoring map to mapcat (oops)

* @tsp - adding working Pivot.add_value_column_nodes to replace addValueColumnNodes

* @tsp - removing debug logs & perf timing logs

* Appease whitespace linter

* More formatting code ported, cleanup

* Fix bugs, cleanup

* Fix some tests

* Start hooking up the BE, fix some bugs

* Fix lint/formatting errors

* Fix comparator + i18n

* Fix another module issue

* Test using js-specific i18n function

* Revert "Test using js-specific i18n function"

This reverts commit 9a8604b583885f1c35f48507112e3a142ca0d3a0.

* Bump up timeout on cypress assertion

* WIP - migrate row section getter to cljc

* fix tests

* Fix e2e test

* Switch exports over to fully using CLJC code paths, delete now-unused code

* Delete outdated postprocess tests

* Bug fix

* Fix build

* cleanup, consolidation

* fix function call

* more cleanup

* empty test ns

* misc cleanup/docstrings

* WIP tests

* more tests and refactor

* small fix

* fix getting column title for value columns

* Fix some tests

* Fix another test

* Revert a couple changes

* Fix some more tests

* Fix more tests, fix default values for pivot viz settings

* Ensure headers respect format-rows? settings in exports, and fix more
tests

* Fix lint issues

* fix another test

* Fix a test, a little cleanup

* Try to fix another test by setting format-rows middleware to false for subscription attachments

* Revert "Try to fix another test by setting format-rows middleware to false for subscription attachments"

This reverts commit d860522a6d17c27e67afabccf119039508c96cca.

* Update formatting logic to fix another test

* Fix conditional formatting

* Fix last BE test

* remove test not needed anymore

* Fix drill through + more cleanup

* clean ns

* remove old code from .clj-kondo/config.edn

* add a comment + tweak keywords

* perf improvements and refactoring the CSV export path

* Performance improvements

* Fix bad rebase

* more perf improvements

* fix test

* lint

* oops, fix test

* more optimizations, memoize backend formatting

* fix range-based conditional formatting

* remove unused function

* add some new backend unit tests

* fix FE type checks - caused by an experiment that I didn't revert fully

* address PR review feedback

* fix up tests

---------

Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-03-14 22:49:11 +00:00
Uladzimir Havenchyk
33072d65d4 ci: adjust timeouts to catch possible build stucks earlier (#55151)
* ci: adjust timeouts to catch possible build stucks earlier

* adjust memory

* Update .github/workflows/e2e-tests.yml

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

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-03-14 22:38:55 +00:00
William
c43780e97f Add background job to backfill entity ids (#54060)
We are adding entity_ids to dbs, tables, and fields, but existing rows don't have entity_ids yet, and newly created dbs/tables/fields don't have entity_ids when created. This job adds those missing ids.
2025-03-14 21:21:15 +00:00
Oleksandr Yakushev
e8c6375b24 [pivot] Use m.u.performance/juxt* when constructing pivots (#54555) 2025-03-14 23:19:49 +02:00
Jeff Bruemmer
e477f074fd docs - include deprecated in env vars, not in config template (#54873)
* include deprecated in env vars, not in config template

* whitespace

* tests

* config file test

* whitespace

* combine functions

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

* format

---------

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-03-14 20:59:40 +00:00
Alexander Solovyov
10be466d6f skip actions when duplication a dashboard: they raise an exception right now (#55197)
Ideally, we'd copy them too, but we need to decide if we should duplicate them or not (do a deep or shallow copy) is a
too hard to make immediately, and this at least will unblock people being unable to duplicate dashboard with actions
defined.

somewhat improves on #38224
2025-03-14 20:34:55 +00:00
Riley Thompson
e09377b3de Add Mongo support for mage start-db (#54939)
* add start-db mongo to mage

* different container names for different versions

* image -> container

* move eol url to db info
2025-03-14 16:14:59 -04:00
bryan
5505ebc3dd setup discouraged-tag linting for #p (#55187)
* setup discouraged-tag linting for #p

- this is fine to use in dev, but shouldn't get comitted
  so this will fail kondo linting.

* sample #p commit (check linting)

* Revert "sample #p commit (check linting)"

This reverts commit 171130c668.

I added it to double check the linter will complain correctly
2025-03-14 20:02:50 +00:00
Noah Moss
70ef40a740 Revert "Ensure that ad-hoc questions show visualization (#55156)" (#55210)
This reverts commit 106ee4f4ef.
2025-03-14 19:55:15 +00:00
Edward Paget
6a89c7502c feat: send setting information via snowplow (#54981)
* feat: send setting information via snowplow

* fixup! return full values for locale

* fixup! kondo

* fixup! remove #p

* fixup! newline
2025-03-14 19:52:51 +00:00
Denis Berezin
57bbf5b224 Add db setting to enable table editing (#54990) 2025-03-14 22:28:49 +03:00
bryan
a19ce07aa7 mage installer (#54994)
* moves mage to mage_core, adds installer at mage

- not sure if this will always work or not

* respond to review

* review2

* review3
2025-03-14 18:48:20 +00:00
Luiz Arakaki
33592a3528 add api keys to config.yml
API Key Configuration via config.yml
Overview
This PR adds support for configuring API keys through the config.yml file in Metabase Enterprise. This enhancement allows administrators to define and manage API keys declaratively through configuration, making it easier to set up and maintain API access across different environments.

Features
Adds support for defining API keys in config.yml under the api-keys section
API keys can be configured with:
name (required)
group ("admin" or "all-users")
creator (email of the user to assign it, user must exist in the instance or be created in the config file, must be superuser)
Automatically creates API keys on Metabase startup if they don't already exist
Skips creation of API keys that already exist (based on name)
Validates configuration including:
Required fields
Valid group values
Creator permissions
Example Configuration
version: 1
config:
  api-keys:
    - name: "My Admin API Key"
      group: admin
      description: "API key for admin operations"
      creator: admin@metabase.com
    - name: "My All Users API Key"
      group: all-users
      description: "API key for general operations"
      creator: admin@metabase.com
Security Considerations
API keys are only created by admin users
Keys are properly hashed before storage
Existing keys are preserved to maintain continuity
Group validation ensures keys have appropriate permission levels
Use Cases
Automated deployment and configuration
Infrastructure as code
Consistent API key setup across environments
DevOps automation
Testing
Unit tests cover key creation, validation, and error cases
Tests for configuration parsing and application
Validation of group permissions
Error handling for invalid configurations
This enhancement is part of Metabase Enterprise's advanced configuration capabilities, providing more flexibility in managing API access through configuration files.
2025-03-14 15:35:09 -03:00
Alexander Polyankin
241dc386b1 DistinctIf in the expression editor (#55129) 2025-03-14 18:22:43 +00:00
Aleksandr Lesnenko
95e0a447a7 fix empty tooltip on the help menu item (#55198) 2025-03-14 18:21:08 +00:00
Anton Kulyk
47d4ebb437 Fix drill through for "empty" pie chart slices (#55188)
* Add repro test

* Use null instead of "empty" label in click object
2025-03-14 18:06:22 +00:00
William
99e8f5ff70 Add distinct-where function to mbql (#55131)
Add distinct-where custom expression function
2025-03-14 16:57:09 +00:00
Oleksandr Yakushev
ed5a723b0a [mongodb] Optimize post-processing of Mongo queries (#54881) 2025-03-14 18:44:00 +02:00
Jeff Bruemmer
6320ee4fe2 docs - remove auth flows (#55185)
* remove auth flows

* add description
2025-03-14 12:25:12 -04:00
Noah Moss
3da9eadd09 Use timezoned timestamp for export filenames (#54872)
* Use timezoned timestamp for export filenames

* clean ns

* tweak docstring

* add unit test + make namespace aliases consistent

* use new function in xlsx exports
2025-03-14 16:18:29 +00:00
github-automation-metabase
3a404dcc3b Bump org.clojure/tools.reader from 1.5.0 to 1.5.1 (#54885)
Inspect dependency changes here: https://github.com/clojure/tools.reader/blob/v1.5.1/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-14 16:15:25 +00:00
github-automation-metabase
b7f887c6c0 Bump com.github.seancorfield/honeysql from 2.6.1270 to 2.6.1281 (#54882)
Inspect dependency changes here: https://github.com/seancorfield/honeysql/blob/v2.6.1281/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2025-03-14 16:10:30 +00:00
Edward Paget
710e5da548 feat: add sdk embedding to snowplow features (#54988)
* feat: add sdk embedding to snowplow features

* fixup! remove extra ?
2025-03-14 10:46:20 -05:00
Nick Fitzpatrick
cde799a53a hide empty tooltips with empty hints in PermissionsSelectOption (#55145) 2025-03-14 12:22:34 -03:00
Oisin Coveney
106ee4f4ef Ensure that ad-hoc questions show visualization (#55156) 2025-03-14 15:22:18 +00:00
Nicolò Pretto
77e231de6c fix(sdk): don't set the color scheme on the host app (#54918) 2025-03-14 16:02:02 +01:00
Nathan Voxland
f94deea7a8 Don't allow a migrate down if you are running an old version of metabase (#54984) 2025-03-14 09:48:52 -05:00
Edward Paget
b7648138de feat: add malli schema, test converage to ldap api (#55130)
* feat: add malli schema, test converage to ldap api

Restores the malli schema that was causing e2e tests to fail on the
first attempt and updates those e2e tests to look for the new error
message returned when the api request is rejected due to schema
validation issues.

Expand test cases around ldap connection testing errors so those
messages can be caught on future api changes.

* fixup! error capitalization
2025-03-14 09:23:16 -05:00
Oisin Coveney
2ec9773d05 Use InteractiveQuestion to create StaticQuestion (#54700) 2025-03-14 14:05:57 +00:00
Romeo Van Snick
b1063dd9f3 Custom expression repros (#55107)
* Add reproduction for #54638

* Add reproduction for #54722

* Add reproduction for #31964

* Correct user of metabase issue in test name

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

* Correct use of issue name in test title

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

* Use addCustomColumn helper

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

* Use helpers to open filter and summarize popovers

* Check for textbox role instead on cm-content class

* Just use enter

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-03-14 14:28:17 +01:00
Braden Shepherdson
e91e344bd4 [refs] Put :idents on column lists returned by MBQL lib (#54777)
I enforced this by checking the return values of `visible-columns` and
`returned-columns`. I want to check that in (for dev and test only) but
it fails tests currently.

The trouble is that cards don't have `:ident` in their `result_metadata`.
That's coming later, so the enforcement flag is disabled for now.
2025-03-14 12:27:27 +00:00
Dan Stone
e235783fc4 Add data editing configuration checks with a flag (#55104)
* Support intended configuration checks

e.g
- database-enable-editing is required
- database-enable-actions is not required
- superuser is required

* Fix long line in docstring

* Factor out init helper

* Less lossy asserts
2025-03-14 14:24:00 +02:00
Chris Truter
47bae0413d Remove pin on kixi-stats (#55152) 2025-03-14 10:00:11 +00:00
Oisin Coveney
fb1bf78398 Add template strings (#55150) 2025-03-14 09:27:24 +00:00
Chris Truter
3c954431f9 Merge branch 'master' into internal-tools 2025-03-14 11:05:52 +02:00
github-automation-metabase
20e3f6c3bb Bump potemkin/potemkin from 0.4.7 to 0.4.8 (#54887)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-14 08:56:18 +00:00
Oisin Coveney
129cd93aa6 feat(sdk): Add DownloadWidget and DownloadWidgetDropdown (#54546) 2025-03-14 08:25:45 +00:00
Kamil Mielnik
dbd6176658 Fix styling (#55101) 2025-03-14 14:22:41 +07:00
Nick Fitzpatrick
08884decff Adm 464 disabled input text color (#55054)
* formula

* adding text-disabled color for input
2025-03-14 02:51:26 -03:00
Luis Paolini
bcf8d922cf Add doc for alternate hostname (#55139)
docs for https://github.com/metabase/metabase/pull/51948
2025-03-13 20:52:23 -04:00
Aleksandr Lesnenko
59c9fd5006 fix model reproductions and filters flakes (#54950)
* fix model reproductions flake

* try a different approach
2025-03-13 19:18:57 -04:00
Edward Paget
b0618df0be fix: more efficient query for execution stats (#55126) 2025-03-13 21:39:45 +00:00
Raphael Krut-Landau
63f7907c2d Simplify Schedule component and improve Schedule story (#54727) 2025-03-13 15:15:52 -04:00
Sloan Sparger
89c0e17f85 [CI] Fix e2e admin database page flakes (#55099) 2025-03-13 12:57:47 -05:00
bryan
7ceebc1df7 mage update (#55108) 2025-03-13 17:09:55 +00:00
Uladzimir Havenchyk
38edfe5102 refactor: convert ParameterFieldWidget to ts (#54916) 2025-03-13 20:01:06 +03:00
Jeff Bruemmer
30cccd3811 docs - note on self-hosted upgrades (#55096) 2025-03-13 12:19:33 -04:00
Uladzimir Havenchyk
dba810264c fix: update filter widget value when we reset value to the default one (#54915)
* rework filters reset tests to work with real data

* fix test

* fix stupid issue

* rename methods

* rework fix and fix the test
2025-03-13 19:09:30 +03:00
Chris Truter
5e406269a4 Naive detection and deletion of dependant records (#55076)
Walk the foreign keys to get counts, grouped by table, and a delete-the-whole-shebang method.

Doesn't limit the worst case work as much as we'd like, and the glue for working with drivers needs to be written as well. Deferring that glue until we have the necessary metadata in appdb.

There are lots of low hanging optimizations, but scaling isn't a concern while we're in scrappy mode.
2025-03-13 17:40:10 +02:00
Alex Yarosh
e75a354792 Update mysql.md (#55095) 2025-03-13 10:33:29 -04:00
metamben
5000cfec10 Use source column type in drills (#54871)
* Resolve day bucketed columns and do the resolution without bucketing
2025-03-13 14:08:46 +00:00
Timofey Kachalov
7bc0c091b9 test(sdk): Perform type-checking of Embedding SDK CLI snippets (#54972) 2025-03-13 18:07:27 +04:00
Oisin Coveney
1f760489a4 feat(sdk): Ensure that all dashboards use entity ID the same way (#55010) 2025-03-13 15:55:43 +02:00
Romeo Van Snick
220038a90c Bump axios for dependabot alert #188 (#55074) 2025-03-13 14:41:04 +01:00
Oisin Coveney
77456687f0 Remove all mentions of saveToCollection (#54983) 2025-03-13 13:45:45 +02:00
Oisin Coveney
0494356eb9 Add stable IDs for SaveQuestion / InteractiveQuestion (#55024) 2025-03-13 13:45:27 +02:00
Oisin Coveney
65cd90a5b6 feat(sdk): Add entity IDs to CollectionBrowser (#54985) 2025-03-13 13:27:20 +02:00
Phoomparin Mano
7a3dceb4e2 Fix React console errors on unrecognized props in styled components (#55081)
* do not forward unrecognized props

* make shouldForwardProps more explicit
2025-03-13 18:02:53 +07:00
Oisin Coveney
fa41120629 feat(sdk): Add stable ID support where missing (#54975) 2025-03-13 09:47:11 +00:00
Oisin Coveney
bd72a75db8 refactor(sdk): Add targetCollection and deprecate saveToCollection (#54971) 2025-03-13 11:43:47 +02:00
Dan Stone
b998d1e9ff Truncate slack header titles and links if the exceed block limits (#54956)
* Truncate mrkdwn links

They could exceed block limits

* Truncate header block text

* Remove incorrect (testing) block in escaping test

* Make length consts under test public

* Add link truncation test

* Add header truncation tests
2025-03-13 09:33:09 +00:00
Romeo Van Snick
bc2a2ebf22 Custom expression multiline UI (#54084)
* Use lezer parser for custom expressions (#53540)

* Add @lezer/generator

* Add missing value on Token

* Add script to generate lezer grammar parser

* Add @lezer/lr

* Add more tests to tokenizer

* Add lezer grammar for custom expressions

* Generate lezer parser for custom expressions

* Convert TOKEN and OPERATOR to enums

* Make Token type more specific

* Add isReference to identifier token

* Typo

* Add more tests for tokenizer

* Add tokenize alternative that uses lezer grammar

* Remove old tokenizer

* Update location of grammer in generate rule

* Add test cases for tokens that share a prefix

* Merge tokens when necessary

* Only add character error when text is 1 character long

* Reduce the need to manually merge nodes

* Stop the iteration when node is found

* Update tests to be more specific

* Simplify tokenize

* Uncommit edge cases

* Generate parser as js

* Move previous tokenizer tests into expressions folder

* Add typing to unit test

* Allow escaping [] in reference

* Add test for escaping closing bracket

* Handle invalid parses manually

* Add support for signed expressions

* Document parser more

* Add custom tokenizer for Reference

* Make tests more explicit

* Fix e2e test

* Merge old test suite into tokenizer test suite

* Move @lezer/generator to devDependencies

* Custom expression suggestions (#53679)

* Add new suggesters for custom expressions

* Add test for joined fields

* Move complete into separate folder

* Split up completions into separate files

* Split up completion tests too

* Copy more tests from legacy completer

* Fix types

* Lezer highlight for custom expressions (#53651)

* Rename generated parser to lezer

* Add lezer highlighting rules to parser

* Add HighlightExpression component

* Use HighlightExpression in expression HelpText

* Add type annotation to highlighter

* Add test for highlight

* Simplify unit test

* Move syntax highlighting to shared module

* Rename util.tsx to util.ts

* Add monospace font variable

* Use monospace font from theme for syntax block

* Use relative font size in HighlightExpression

* Use mantine var for border-radius

* Add test id to example

* Fix tests that rely on example content

* Move highlighting code to metabase/ui/syntax

* Replace ACE with codemirror in custom expression editor (#53746)

* Rename generated parser to lezer

* Add lezer highlighting rules to parser

* Add HighlightExpression component

* Use HighlightExpression in expression HelpText

* Add type annotation to highlighter

* Add test for highlight

* Simplify unit test

* Move syntax highlighting to shared module

* Rename util.tsx to util.ts

* Add monospace font variable

* Use monospace font from theme for syntax block

* Use relative font size in HighlightExpression

* Use mantine var for border-radius

* Add test id to example

* Fix tests that rely on example content

* Move highlighting code to metabase/ui/syntax

* Replace custom expression editor with CodeMirror editor

* Add test mock for CodeMirror

* Colocate custom expression tests (#53812)

* Remove unused DISPLAY_QUOTES

* Colocate custom expressions diagnostic tests

* Colocate custom expressions process tests

* Colocate custom expressions recursive-parser tests

* Colocate custom expressions typeinferencer tests

* Colocate custom expressions completer tests

* Colocate custom expressions format tests

* Colocate custom expressions resolver tests

* Colocate custom expressions index tests

* Colocate custom expressions pratt compiler tests

* Colocate fuzz tests with custom expressions code

* Update paths for fuzz tests

* Fix types in fuzz test

* Fix types in process test

* Remove unused var

* Remove unused var in generator

* Merge types for custom expressions (#53902)

* Add missing expression types to metabase-types

* Add more explicit types to matchers

* Use Expression type from metabase-types everywhere instead of custom type

* Move matchers to separate file

* Further use Expression types for matchers

* Add types for Metric and Segment matchers

* Fix types in format

* Fix missing types

* Clean up imports

* Split string helpers into separate submodule

* Split identifier helpers into separate submodule

* Avoid importing from index file in expressions module

* Render suggestions and help text in new custom tooltip (#53760)

* Add new help text component for custom expression editor

* Add new suggestions listbox for custom expression editor

* Add helper to find help text by function name

* Add enclosingFunction helper that is more forgiving to broken syntax

* Add new tooltip component for custom expression editor

* Add extension to render custom react tooltips

* Render suggestions in custom tooltip

* Export custom types

* Remove old expression editor popover components

* Add typings to process

* Add missing shortcuts

* Fix example font size

* Fix type imports

* Fix click on helptext

* Stop click propagation

* Fix process types

* Remove superflouous optional chain

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

* Fix types whith optional expressionIndex

* Use imports instead of React namespace

* Use index for key

* Rename util to utils

* Remove unused box shadow

* Remove brackets around placeholder names

* Resize tooltip to avoid it overflowing the window

* Fix line height for args

* Fix missing key icons

* Fix chevron alignment

* Fix types

* Move Listbox resizing classes to Tooltip

* Fix completion template for functions with no arguments

* Add unit tests for enclosingFunction

* Add darker background to expression example

* Remove bold from function call

* Fix imports

* Fix HelpText tests

* Add custom color for highlighted syntax argument

* Use colors from design system

* Fix blurring when switching to a different tab

* Remove trailing comma

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

* Split up effect

* Remove background from template arguments

* Improve tooltip position

* Fix Popover position when selection changes

---------

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

* Fix custom expression editor e2e tests (#53761)

* Fix e2e tests for custom expressions

* Fix unit test

* Fix e2e tests

* Fix types

* Fix moveToStart and moveToEnd by using Home/End

* Add test for popover position

* Remove JSDoc in favor of inline comments

* Add examples of side effects

* Remove shouldContain helper in favour of value()

* Add comment to wait

* Use CustomExpressionEditor helper instead of @formula

* Add wait to reduce flakiness

* Add back in the useful comment about popover position

* Remove superflouous cy.viewport call

* Add helper to accept completion

* Rename helper to verifyHelptextPosition

* Convert comments to cy.logs

* Make sure we don't avoid testing the regression

* Allow customising key with which to accept completion

* Use acceptCompletion helper

* Fix tooltip position bug

* Remove unnused wait

* Add selectCompletion helper

* Fix helper using H

* Add better emulation of copy/paste in reproduction

* Ignore ts error

* Multiline formatter for the custom expression editor (#53973)

* Make type name meaningful

* Add more tests for not isnull, etc

* Remove unreachable code

* Add isEmpty matcher

* Pass query to format tests

* Add stronger types to formatStringLiteral

* Fix CallOptions import

* Implement multiline formatter as a prettier plugin

* Reimplement legacy formatter as new formatter with infinite print width

* Use the new formatter in the expression editor

* Remove legacy expression format files

* Document utils

* Simplify Expression type further

* Fully type test cases

* Remove cast in test

* Add more tests and fix formatting

* Use recurse helper to recurse into path children

* Prefix logical operators

* Improve formatting of logical connectors

* Wait for expression editor to be ready

* Avoid passing unknown html props

* Use selectCompletion helper

* Remove unused @ts-expect-error

* Align UI more to design

* Remove shortcuts in suggestions popover

* Disable popular functions in completions

* Render shortcuts as separate component

* Move NameInput to separate component

* Fix button location when no name input is present

* Remove unused ExpressionWidgetInfo component

* Avoid flicker of shortcut buttons

* Tweak name input padding

* Deduplicate styleTags in Editor

* Do not format on blur and pass through all valid changes

* Split of diagnose and compile step

* Remove unused props

* Do not trigger completion on focus

* Show update button when no name is passed

* Expose expression types

* Use diagnoseAndCompileExpression in lint extension too

* Add toolbar with format button

* Only show popover when user has interacted with editor

* Throw ResolverError when types mismatch

* Fix missing highligh for boolean

* Render errors

* Disable format button when the expression contains an error

* Remove shortcut and popular function completion

* Move Shortcut type to component that uses it

* Fix blur for CustomExpression helper

* Add format helper

* Fix e2e tests

* Fix format helper

* Fix blur helper

* Use actual ellipsis in placeholder

* Add helper for nameInput

* Remove buttons from tab sequence once hidden

* Do not autofocus shortcuts

* Hide shortcuts when error occurs

* Allow reading multiline value

* Fix e2e tests

* Fix unit tests

* Add more tests for multiline custom expression editor

* Debounce error checking

* Add max height to tooltip

* Fix formatting

* Document changing reproduction

* Test wording

* Disable format button when expression is empty

* Do not try compiling when source is empty

* Cancel changes when source changes

* Autofocus editor

* Use Tooltip to mark button

* Remove default autoFocus on button

* Simplify shortcuts show and hide style

* Move shortcuts styles to parent element

* Fix line number alignment

* Add a gap between Cancel and Done buttons

* Always close helptext when suggestions are being shown

* Add usePreventClosePopover hook

* Prevent closing popover from the custom expression editor

* Add tests for not closing on click outside and escape

* Move toolbar down

* Fix e2e tests

* Add format_code icon

* Use correct icon for formatting code

* Use new format code icon in native editor too

* Update Loki Snapshots

* Merge useEffect cases into one

* Allow clicking the shortcuts

* Debounce validation

* Fix React update loop

* Prevent flicker in the listbox completions

* Tweak the linting delay

* Hide shortcuts when there is an error

* Only prevent closing popover when editor is rendered

* Fix width and height for editor widget

* Fix format button positioning

* Fix button alignment in expression editor

* Allow blurring tooltip by clicking nothing

* Add button role to header

* Show modal when clicking outside of editor

* Allow closing editor when it's empty

* Add tests for clicking outside of expression editor

* Fix missing onClose handler

* Add bigger timeout

* Rename Format to Auto-format

* Hide format button when there is an error or editor is empty

* Fix label names in test

* Fix format button test

* Deduplicate tests for exiting the editor

* Fix test

* Fix repro

* Only prevent closing popover when the source has changed

* Fix e2e test

* Hide lint point

* Fix types

* Fix tooltip helptext layout

* Update loki reference

* Only show format button when the expression was validated

* Scale the expression editor with the screen width

* Move usePreventClosePopover into utils

* Remove CloseModal component

* Remove custom PreventCloseContext from Popover

* Skip tests that deal with the click outside and escape behaviour of the custom expression editor

* Remove canPreventCloseHandlers from ClausePopover

* Add lineWrapping to editor

* Fix loki

* Fix loki screenshots

* Fix e2e test

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-03-13 10:03:48 +01:00
William
a258b878f2 SQL Server doesn't cast when compiling uuid field filters (#54996)
Apparently, a filter like `blah in (cast([uuid] as uuid))` is fine in postgres, but sqlserver doesn't like it very
much.  This gives sql server the syntax it needs.
2025-03-13 08:32:44 +00:00
Konstantin Darutkin
a68c2f475e feat: customize edit view data grid (#54787) 2025-03-13 09:40:46 +02:00
Denis Berezin
b26d24c90f Fix grid markup to show missing rows 2025-03-13 09:40:46 +02:00
Konstantin Darutkin
3beb60de0b feat(enterprise): add category dropdown editing (#54921) 2025-03-13 09:40:46 +02:00
Chris Truter
430d3ab213 FE for Table Editing v1 (#54289)
* API for reading tables

* Strip fields, add table

* Table editing view mode (#54218)

* Add basic component in ee

* Add table view with header

* Enable feature flag

* Code review fixes, remove token check

* Add basic e2e test for route

* Fix CI

* Boilerplate for new EE feature

* Basic CRUD URLs

* Spoke to Katya, fine to require actions being enabled

* Missing require

* Track the table-crud-apis branch

* Add simple table cell edit UI (#54679)

* Temp

* Add full code to edit a value

* Add proper feature toggle name

* Single click edit, use new api, add cell formatting

* Updated api usage

* Add feature toggle check

* Temp

* Add isolated EditingCell component

* Review fix - simplify state

* Add keyboard events

* Fixes after merge with master

* Fix be tests

* Fix fe e2e tests

* Clean-up

---------

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-03-13 09:40:46 +02:00
Denis Berezin
59dd7e7dc3 Table editing view mode (#54218)
* Add basic component in ee

* Add table view with header

* Enable feature flag

* Code review fixes, remove token check

* Add basic e2e test for route

* Fix CI
2025-03-13 09:40:46 +02:00
Jeff Bruemmer
3e84a67233 docs - include sdk videos (#54980)
* include sdk videos

* remove queries
2025-03-12 19:42:45 -04:00
Ryan Laurie
c4b56e2920 Add Settings Hooks (#54935)
* add settings hooks

* less hax

* fix type
2025-03-12 17:05:39 -06:00
Aleksandr Lesnenko
b299b37501 mark tooltip specs flaky (#55060) 2025-03-12 23:05:22 +00:00
Ryan Laurie
28c37766de fix bug in env var url component (#54937) 2025-03-12 17:05:06 -06:00
Uladzimir Havenchyk
4413c19c09 rework filters reset tests to work with real data (#54991)
* rework filters reset tests to work with real data

* fix test

* fix stupid issue

* rename methods
2025-03-12 22:05:45 +00:00
Edward Paget
dec524e3f7 fix: bump saml20 library for assertion sig fix (#55055)
Bumps the version of the saml library in order to pull in the fix for messages without top-level signatures, but with assertion signatures.
2025-03-12 21:19:45 +00:00
bryan
9620f5d384 [github action] Update github PRs with links to linear issues (#54779)
* first crack at linear pr link bot

* try it again

* bump actions versions

* bump

* try again

Added Node.js setup step
Added dependency installation step for node-fetch
Changed the ES module import to a CommonJS require statement
Changed variable name from fetch to nodeFetch for clarity

* extract script

* use the right graphql query

* add debug

* look at the right part of the linear api response

* lets see the issue numbers

* again

* again

* again

* again

* again

* again

* again

* again

* again

* fix formatting

* remove ???'s

* improve logging

* check all magic closing words

* refine checking logic

* test

* some review responses

* again

* make github object a thing

* install octokit

* install octokit again

* install octokit again

* running

* running

* running

* running

* running

* delimit message with spaces

* delimit message with spaces

* delimit message with spaces

* delimit message with spaces

* test

* only try to close metabase/metabase issues

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-03-12 13:33:09 -06:00
bryan
0fc06d0a45 fix if statement ordering (#55046) 2025-03-12 18:39:25 +00:00
bryan
f23dc6cb09 mage stats repl (#54993) 2025-03-12 11:47:19 -06:00
lbrdnk
a70efb20c2 Add describe-fields query logging (#55039) 2025-03-12 18:40:49 +01:00
Stas Gavrylov
af2a0dc1b0 Add typescript-plugin-css-modules to improve autocomplete (#55009)
* Add typescript-plugin-css-modules

* Fix TS errors related to className prop
2025-03-12 19:30:28 +02:00
bryan
645d38ff4e never unhide tables w/ cruft settings (#54998)
* never update hidden table visibility_types

* apply the same logic to table recreation

* testing: cruftyness doesnt unhide tables in syncs
2025-03-12 11:25:36 -06:00
Ngoc Khuat
43149ed615 Prevent concurrent init notification and send pulse trigger tasks (#55000) 2025-03-12 15:53:25 +00:00
Alexander Polyankin
809647806d Add E2E tests for bigint values in query results (#54929) 2025-03-12 11:42:16 -04:00
Alexander Solovyov
376b9530a9 CD for internal-tools (#55029) 2025-03-12 14:58:13 +00:00
Edward Paget
8ef101c649 fix: default saml to use http-post binding (#55017)
* fix: default saml to use http-post binding

* fixup! use library release
2025-03-12 14:47:32 +00:00
Aleksandr Lesnenko
f99da3d0f6 make tooltip scrollable (#53730)
* make tooltip scrollable

* specs
2025-03-12 14:42:21 +00:00
Oisin Coveney
70daac31ba Change name of files from Result -> DefaultView (#55014) 2025-03-12 14:40:44 +00:00
Oisin Coveney
6586b589c8 fix(sdk): Popovers not working on Safari (#55012) 2025-03-12 14:20:52 +00:00
Uladzimir Havenchyk
1948044e1d upgrade rspack and swc. includes memory fix (#54970) 2025-03-12 14:13:32 +00:00
Oisin Coveney
4f090e349d Convert cardId to questionId for consistency (#55013) 2025-03-12 14:11:09 +00:00
github-automation-metabase
dd8cff3854 Bump org.jsoup/jsoup from 1.18.3 to 1.19.1 (#54886)
Inspect dependency changes here: https://github.com/jhy/jsoup/blob/jsoup-1.19.1/CHANGES.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-12 13:26:51 +00:00
github-automation-metabase
097f4858a5 Bump com.github.seancorfield/next.jdbc from 1.3.994 to 1.3.1002 (#54883)
Inspect dependency changes here: https://github.com/seancorfield/next-jdbc/blob/v1.3.1002/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-12 15:09:48 +02:00
Filip Hric
9b0866e41b tag tests as flaky (#54957) 2025-03-12 12:45:40 +00:00
Phoomparin Mano
1e590475c9 feat(sdk): experimental react 19 version range support (#54904)
* support react 19 version range in embedding sdk

* sync supported react versions

* add oxford comma

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

* revert docs and cli updates as we want to do a silent release

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-12 15:15:24 +07:00
Ngoc Khuat
90e3218d66 [Notification] Deadline-based priority queue (#54647) 2025-03-12 02:36:16 +00:00
Fraser
e33e273491 Replace BulkDeleteConfirmModal with ConfirmModal (#54997) 2025-03-12 14:07:07 +13:00
Alexander Polyankin
2781834c49 Remove empty section title from AccordionList (#54860) 2025-03-11 19:51:12 +00:00
Ryan Laurie
0cf6f48ffe Remove legacy setup checklist (#54599)
* remove legacy setup checklist
2025-03-11 13:22:47 -06:00
Konstantin Darutkin
27ffe25aae feat: add data-grid-customization (#54752) 2025-03-11 18:22:11 +00:00
Ryan Laurie
59c81f57e9 Add use-toast hook (#54819)
* add use-toast-hook

* use the new toast hook

# Conflicts:
#	frontend/src/metabase/admin/performance/components/ModelPersistenceConfiguration.tsx

* bonus change slipped in

* use those callbacks
2025-03-11 11:54:20 -06:00
Sloan Sparger
47cb73d999 [DB Routing] Reorganize database page (#54627)
* add new database header, make layout adjustments

* start building connection section

* reorganize connection info section content, migrate danger info section

* reorg

* flow rewired together mostly, connection details form is now in a modal

* make section content components the entire section for better hide/show logic, remove old code comments, show proper engine name in edit db header, hide model actions section if no actions can be taken

* lots of polishing

* fix BE punctuation

* test e2e fixes in ci

* more test fixes

* more test fixes

* fix unit tests

* fix last failing unit test

* fix last e2e test?

* final polish pass from self review

* fix model persistence section and its related tests, reorganize the tests

* fix model persistence section and its related tests, reorganize the tests

* impl feedback from arakaki around creation flow and date format

* clean up last commit

* make modal scroll container limited to the body, remove use of force to find inputs in cypress tests

* impl PR feedback
2025-03-11 12:44:13 -05:00
Timofey Kachalov
dcce112be0 Use a proper sample app release branch (#54857) 2025-03-11 21:18:04 +04:00
Edward Paget
f067c2844a fix: question stats are calculated in sql query (#54932)
* fix: question stats are calculated in sql query

Previously instances could OOM when calculating these question stats if
they had too many cards because we load all these cards into memory.

We were doing this full calculation because we have some data we want to
calculate metrics over stored as json in a text column. This uses native
mysql/mariadb and postgresql json fuctions to calculate those metrics
inside the database prevent us from needing to load everything. That
also means we no longer calculate these json-based metrics for metabase
instances running h2.

* fixup! use older path_exists json function
2025-03-11 11:21:53 -05:00
Stas Gavrylov
e9edc39a9e Make postcss-modules eslint plugin conditional to fix VS Code (#54978) 2025-03-11 16:04:06 +00:00
Nemanja Glumac
489be7cbcd Empty states for the native editor (#54438)
* Add a native editor placeholder text

Resolves CLO-3674

* Keep the "data reference" panel open by default

Resolves CLO-3675

[ci skip]

* Add empty state for snippet sidebar

Resolves CLO-3684

* Empty state for query results panel

Resolves CLO-3676

* More refined way to initialize data reference

* Update copy in e2e tests

* Fix more tests

* Open data reference whenever native editor is open

* Do not alter the initializeQB flow

* Close the data reference sidebar when question settings are open

* Fix a failing Mongo test

* Address review comment
2025-03-11 16:06:54 +01:00
Ryan Laurie
842c421454 fix release notes generation (#54977) 2025-03-11 08:38:55 -06:00
Jeff Bruemmer
eb884a97cd docs - poeditor -> crowdin (#54973)
* crowdin link

* more links

* links
2025-03-11 13:56:24 +00:00
Oisin Coveney
0fbbf95479 Change end to flex-end to remove rspack warnings (#54899) 2025-03-11 12:13:29 +00:00
Nicolò Pretto
1436293fe4 make sdk not error on type error (#54964) 2025-03-11 12:31:07 +01:00
Ngoc Khuat
17bc5eaf31 when an alert failed to execute, make sure task history's status is failed (#54949) 2025-03-11 11:03:33 +00:00
Sébastien
37ec722486 avoid ref on fn component error in console (#54959) 2025-03-11 10:00:44 +00:00
Phoomparin Mano
576567b379 fix(sdk): remove react-router console error in LegendLabel when in React 19 (#54926) 2025-03-11 06:51:50 +00:00
Mahatthana (Kelvin) Nomsawadi
59d5f32f10 fix(sdk): Improve _.compose type + fix SDK type (#54850)
* Improve _.compose type + fix SDK types

* Use a simpler type overloading

* Fix Englishz

* Fix type errors

* Add a comment to clarify extrat type overload

* Clarify the source of code
2025-03-11 06:03:42 +00:00
Ngoc Khuat
590ddeba8f [Notification] fix exception during init notification triggers and skip inactive notifications (#54879)
* make sure init notification skips inactive notifications

* probably going to fix the exception stuff
2025-03-11 13:43:02 +09:00
Fraser
928c6db5c6 Refactor model caching widget to tsx and switch to css modules (#54572)
* Refactor model caching widget to tsx and switch to css modules

* Update cron example to valid one

* Translate or in cron tooltip
2025-03-11 12:48:32 +13:00
Ryan Laurie
001d9b6a5f update some e2e spec timings (#54877) 2025-03-10 16:31:21 -06:00
bryan
bc1a66fcf3 don't try to destructure the setting when missing (#54942)
* don't try to destructure the setting when missing

* also on gsheets status
2025-03-10 22:27:31 +00:00
Riley Thompson
c8a767ece6 Abandon fingerprinting if connecting to DB fails (#54697) 2025-03-10 21:55:01 +00:00
bryan
3d677c736c add deps required by defenterprise{,-schema} (#54875) 2025-03-10 17:15:20 -04:00
bryan
1158d45637 update gsheets setting visibility (#54930) 2025-03-10 20:07:13 +00:00
Nick Fitzpatrick
de4ca7278c Legacy permission and cloud migration modals (#54922) 2025-03-10 16:59:15 -03:00
Eric Normand
2ba1dc95a1 Increase stage limit to 1000 and clarify error message. (#54917) 2025-03-10 14:07:00 -05:00
Alexander Polyankin
311044f5b4 Repro for "Multiple bucketing menus can be opened simultaneously" (#54859) 2025-03-10 14:15:33 -04:00
Alexander Polyankin
0113bac8c7 Fix leaving native query editor with parameters (#54863) 2025-03-10 14:15:18 -04:00
Phoomparin Mano
b178fee0c4 fix(sdk): mark react-dom/client as external to fix warnings in React 19 (#54919) 2025-03-11 00:52:28 +07:00
Phoomparin Mano
44107fdb93 Make pivot tables draggable compatible with React 19 (#54914)
* prevent react-draggable usage in pivot tables

* simplify refs
2025-03-10 23:57:40 +07:00
Alexander Polyankin
c27c08c753 Sortable cleanup (#54865) 2025-03-10 16:14:38 +00:00
Kamil Mielnik
788994f16d Fix - SQL view is opened when creating a question on small screens (#54267)
* Add reproduction for #54124

* Allow closing of sidebar

* Initial fix for #54124

* Add a hook

* Fix translations

* Extract hook

* Revert "Allow closing of sidebar"

This reverts commit 6caa95823e.

* Revert "Add reproduction for #54124"

This reverts commit 781e9af5f3.

* Implement new spec

* Drop redundant ref

* Beautify

* Revert "Fix translations"

This reverts commit 7b8ad142f9.

* Add extra assertion

* Repro #54124

* Refactor

* Merge effects

* Simplify useNotebookScreenSize's return value

* Fix check

---------

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-03-10 14:59:07 +00:00
bryan
b117dc258a Google Sheets Integration - Feature Branch (#51436)
* add fall-through for ignored embedding requests

* Gsheets mb api (#51307)

* send flag to show "connect gsheets" button to FE

* clean up docstring + add etl-connections condition

* metabase api WIP

* align APIs

* include site-url in the HM temp-url api call

* cleanup

* update HM<->MB api to be working (minus temp-url)

* cleanup

* remove some notes

* indentation + linting

* add tests

* fix typo

* remove illustrative (when true ...)

* add frontend for gsheets sync

* update frontend to use changed API

* Gsheets integration: more api alignment (#51492)

* add frontend for gsheets sync

* update frontend to use changed API

* wip

* cleanup

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>

* fix: declare gsheet setting fn before using in getter

* fix: delay u.secret instantiation to prevent build race condition

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

* build: push ee-extra to dev repo, not ee

Cloud wants ee-extra, not just ee

* move settings out of auth middleware ns

- update kondo modules
- add metabase.api.auth ns

* More cleaning up

- update docstring
- remove declares + use {set,get}-value-of-type{!,}
- remove nil state from gsheets setting

* rely on more hm stubs

* save folder_owner to gsheets

* gsheets and hm http client => enterprise

+ move tests too

* require the right namespace

* add migration for is_gsheet to metabase_table

* Gsheets service account be flow (#51997)

* update setup flow to use service-account

* align GET api/ee/gsheets/service-account response

* align the HM service account endpoint

* fix migration yaml

* update test for service accounts

* indentation + migration quibble

* improve error messages + kondo housekeeping

* remove unreachable if-let branch + fix serdes test

* add is_gsheet to mock and test data

* add gsheets setting to serialization test

* fix fe-type-check

* typechecker

* [kondo] defendpoint -> defendpoint2

* Gsheets table management (#52145)

* include dwh ∈ GET /api/ee/upload-management/tables

* cljfmt

* simplify preliminary gsheet definition

* archive cards is a query param

* gsheets: update polling logic + better errors (#52162)

* update polling logic + better errors

* codify protocol for polling folder done-ness

* align on FE polling logic + the real sync complete

* [WIP] testing happy path

* status should be "active"

- remove a bunch of extra debugging

* remove outdated tests + cljfmt

* check admin + use the connection's id w/ delete

- cleanup

* fix :delete /folder + schema on :get /folder

* Gsheets frontend (#51946)

* non-oauth UI

* update api and add disconnect modal

* update illustration and add error displays

* add gsheets sync status

* better copy

* remove test code'

* fix bad api error

* updates to sync status

* Update sidebar entrypoint

* gate things behind the right features

- only show gsheets button
- http requests to /api/ee/gsheets/*

* model/Table has a db_id column not database_id

* add and use simple events

* differentiate failure modes

* + tests and error status codes

* make form submit on enter

* reset gsheet status when there is no gdrive conn

* add debug info

* FIXME FOR TESTING - disable feature checks

* fail on sync error + partially allow deletes

* add database page entrypoint

* FIXME FOR TESTING - set token-status-cache-ttl to 1 second (vs 12 hrs)

* only show _active_ dwh tables

* fix config.edn (howd it break tho?)

* handle multiple gdrive connections

- on delete, delete them all
- when looking at syncing, look at the most recent one

* add auto-cruft-tables to metabase_database.setting

- Here's the contract:

There should be an array of strings located at: db > settings >
"auto-cruft-tables". Each string will get fed into re-pattern. The table
names get lowercased before getting matched on. That list of regexes is
combined with our built in list of crufty regex patterns. We use re-find
to match them against the lower-cased table names. If there's a match we
will mark the table crufty (this is called a "Hidden Table" in the UI).
This way, if someone names their sheet `I'mUnique____dlt_loads` or
whatever they can at least fish it out of the hidden section.

Note: It will get set back to being crufty (aka what the ui calls
hidden) on the next sync... but this is configurable so we can fine-tune
the regexes to match the tables we want to hide more closely.

Examples:

If you put ["a"] in the config.yml: any table with A or a in it will be
marked hidden. So be sure to use anchors for the suffix or what-not. For
our thing, I think we want something like:

* add bunch of tests for auto-cruft

* mocked api tests

* add commment + mock hm responses

* documentation

* when multiple gdrive conns, sort by status, then created-at time

* cleanup

* joda time Instant/ofEpochSecond 0 -> t/instant 0

* if no gdrive conns are found, reset state

- add gdrive sorting tests

* indentation

* fix complete sync state and add error state

* update sync unit tests

* update sync unit tests

* add frontend analytics events

* don't show reconnect copy from DB page

* Add 10 minute timeout for polling connection

- return errors as json-encoded :error in the response body
- minor cleanup how we auto cruft tables (no change to behavior)
- add script for running the flow locally: from the repl

* better FE sync state and form validation

* refresh setting on error

* remove fake error state

* Delete connections on reset

- Change order of timeout checks in :get /folder handler
- add auto-cruft-columns setting

* update gsheets routes to use the new ns-handler

* loosen up gdrive link validation

* update regex

* add docstring to dynamic timeout var

* simplify api use via gdrive conn id

- move ->config into hm.client ns

* recover from suddenly-missing gdrive conn @ id

* cleanup hm.client

- indentation

fix [[make-request]] args

* fail to load invalid + present cruft patterns

* remove some extra comments + use hm-delete-conn

* fix update-table-metadata

- (no longer update nil -> nil)

* auto cruft columns

- pull the regex comparrison code into crufty ns
  - reuse it on 2
- add defsetting so having the setting on the database doesn't complain
- pass database down into field syncing + grab vis types

* indent

* fix a few tests

* fix gsheets tests

* add harbormaster client test

* kondo + cljfmt

* migrate to underscores for auto_cruft_*

- add tests for field + fix schema for table syncs

* use kebab-case for settings but accept snake_cased

* cljfmt + kebab case stragglers

* fix update-field-metadata-if-needed! signature

* fixing tests

* rename macro double -> run-twice

* remove test code

* prettier

* cruft settings are db-local

* Fix search index update job restart issue (#53229)

* more idiomatic crufty db-local settings

* add auto cruft fields test

* bump gsheets sync timeout to 10 seconds

* handle going back to loading state

* kondo + add empty cruft tables test

* add get folder timeout test, update dox,

- remove regex folder check

* add cruft columns config.yml setup tests

* remove def + actually run the test

* test code for bruyan

* reset gsheets status on every error response

* save dbId and actually show it

* bust cache on gsheets setting

* solve initial-sync-status-table-only-test failure

* Update src/metabase/sync/sync_metadata/crufty.clj

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>

* Update enterprise/backend/src/metabase_enterprise/advanced_config/file/databases.clj

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>

* Update enterprise/backend/src/metabase_enterprise/advanced_config/file/databases.clj

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>

* Update enterprise/backend/src/metabase_enterprise/gsheets.clj

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>

* respond to Noah's review comments

* kondo

* update modal copy

* update error copy

* status click target update

* improve crufty/name? api

* modularize gsheets

* remove temp gsheets

- token status checks happen once per 12h
- remove hm/conn and mb/sync-info from :get /folder response

* gdrive-conn is now unused

* remove comment

* fix modules

* add docstring

* add harbormaster module

* kondo

* fix the tests

* module linter

* fix typo

* cljfmt

* setup api-key setting before reading it

* sort ns

* ::snowplow/simple_event -> :snowplow/simple_event

* hard code error message

* remove test code

* update frontend tests

* update module linter config

* add simple schema snowplow event schema

* fix schema name

* update some tests

* add a test

* better docstring

* better docstrings

* fix e2e tests

* fix fe token mock

* respond to review comments

+ fix timeout 50000 -> 5000
+ make internal regex function private

* build: push ee-extra to dev repo, not ee

Cloud wants ee-extra, not just ee

* fix strings

* remove resolved comment

* adds prometheus metrics to gsheets api

- :metabase-gsheets/sync-creation-begin
- :metabase-gsheets/sync-creation-ok
- :metabase-gsheets/sync-creation-error
  - failure-reason is one of:
  - "timeout" - gsheets.api/sync-complete? didn't return true after 10 minutes
  - "status_error" - HM said the sync connection had status == error
- :metabase-gsheets/connection-deleted

* Refines prometheus events

They are now:

- :metabase-gsheets/connection-creation-began
- :metabase-gsheets/connection-creation-ok
- :metabase-gsheets/connection-creation-error {:reason "status_error"}
- :metabase-gsheets/connection-creation-error {:reason "timeout"}
- :metabase-gsheets/connection-deleted

* comment

* allow resolution of snake_cased setting names

* review responses

* add logging if any part of the batch-delete fails

* remove unused schema

* Revert "remove unused schema"

This schema is actually used! 🎉

This reverts commit f5dbd78051.

* update loki icon reference image

* switch off flaky test setup

* mark date filter picker tests flaky (#54866)

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Filipe Silva <filipematossilva@gmail.com>
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-03-10 14:41:39 +00:00
Luis Paolini
26b310be01 Fixes https://github.com/metabase/metabase/issues/12987 (#51692) 2025-03-10 14:34:55 +00:00
Alexander Solovyov
3332a7d59e disable backend codeowners (#54831) 2025-03-10 10:57:11 +00:00
Chris Truter
f10b22c2f2 Scrap the ability to resolve table names, just use ids (#54839) 2025-03-10 10:48:34 +00:00
Stas Gavrylov
5ec66916c3 WRK-114, WRK-115: Update Alerts scheduling component (#54788)
* WRK-114,WRK-115: Replace SchedulePicker with Schedule in Alerts.

Integrated a newer feature-rich component for Alerts scheduling.
Fixed bug related to incorrect handling of '*' values in minute and hour
alerts.

* Remove scaling transition from popInFromBottom animation.

This transition used for all modals led to a bug with sizing in some
Mantine components, when they were used inside a modal:
https://github.com/mantinedev/mantine/issues/6967#issuecomment-2417439117
2025-03-10 12:44:57 +02:00
John Swanson
9c6fe31a4c Fix schema-wide data permissions for huge schemas (#54858) 2025-03-10 03:02:51 -07:00
Mahatthana (Kelvin) Nomsawadi
89054f1a73 ci(sdk): Fix mysterious sdk deployment failure on 52 (#54890)
* Reuse Personal Access Token on all tasks

* Fix permission when pushing to GitHub

* Use annotated tag for better information

* Remove steps for faster testing

* Revert "Remove steps for faster testing"

This reverts commit 8bd5d2e07f.
2025-03-10 08:48:10 +00:00
Fraser
262a69e01b Create confirm modal component (#54632)
* Create confirm modal component and use in query builder
2025-03-10 11:30:02 +13:00
Oleksandr Yakushev
19e805d085 test: Reuse source database in load_from_h2 tests (#54165) 2025-03-08 18:18:28 +02:00
Nick Fitzpatrick
1bf46c862f Migrating composed modals to simple modals (#54685)
* Migrating composed modals to simple modals

* fixup
2025-03-08 09:36:45 -04:00
Ryan Laurie
5088ddb83a Refactor SettingHeader (#54823)
* Refactor SettingHeader

* use divs

* index to ts

* index to ts

* fix title

* add boxprops
2025-03-08 00:21:08 +00:00
Nick Fitzpatrick
80e982b224 Fixing select dropdown in append data modal collection view (#54864) 2025-03-07 18:17:56 -04:00
Ryan Laurie
90490efa14 mark date filter picker tests flaky (#54866) 2025-03-07 21:41:37 +00:00
Ryan Laurie
727c8c7ff4 Use PAT for git tagging (#54868)
* use PAT for git tagging

* use token more
2025-03-07 21:01:40 +00:00
Ryan Laurie
fbb5088df3 Allow sending release notes to website (#53418)
* allow sending release notes to website

* use generic version

* cleanup and add tests

* whitespace

* linkify website changelog
2025-03-07 12:29:56 -07:00
Ryan Laurie
f78fa85411 fetch settings using RTK Query (#54687)
* fetch settings using RTK Query

* type fixes

* 💪

* fix type 🤞
2025-03-07 12:13:41 -07:00
bryan
b05fd4f511 adds cljfmt-updated task (#54861) 2025-03-07 18:47:40 +00:00
Filipe Silva
fe66a8f862 fix: download all clj deps before builds (#54852)
Prevents a race condition where both clojure and shadow-cljs would be
downloading deps at the same time.
2025-03-07 18:23:26 +00:00
Aleksandr Lesnenko
e4a6d8a81e feat(sdk): Revamp TableInteractive visualization component: update header styles, add text wrapping, and row indices (#54399)
* use tanstack datagrid for the table visualization implementation
2025-03-07 18:18:19 +00:00
Anton Kulyk
769bd1ee1b Fix "decimals" viz setting ignored when formatting numbers (#53053)
* Respect "decimals" setting when formatting compact numbers

* Update loki screenshots
2025-03-07 17:07:05 +00:00
Alexander Polyankin
da5e954e63 Fix initial focus of the filter modal (#54817) 2025-03-07 11:41:35 -05:00
metamben
5a9d4baa53 Allow single argument between parameters on the backend (#54848)
Backend part of the fix for #54364
2025-03-07 15:52:46 +00:00
Nathan Voxland
4f7b3c27cf Added additional API tests for /public and /api/public (#54756) 2025-03-07 09:21:50 -06:00
Chris Truter
40ba06c779 Expire pending search indexes eventually (#54834) 2025-03-07 16:20:31 +02:00
Dan Stone
1fc41425ff Drop public channel requirement for slack images (#54276)
* Prefer slack_file for images, so metabase no longer requires a public files channel

This removes the requirement to have a public files channel so share
images or other files in slack bot posts. Simplifying the integration
and lessening requirements to get setup.

It enables the posting of images files directly to public or private
channels without sharing - improving privacy and security.

* Files channel deprecation note

* Drop slack-files-channel requirement from slack /settings API

* Remove remaining files-channel calls

* Remove files channel input from SlackSetupForm

* Remove slack-files-channel from SettingsManagerSettings

* Remove slack-files-channel from API docs

* Drop files channel configuration guidance

* Remove slack channel prompt/description

* Instead of polling files.read reuse the complete call

There was an accidental introduction of files.read.

The goal is to preserve the previous behaviour of reusing
completeUploadExternal.

This limits the oauth scope requirements of the bot token.

* If more than 50 slack blocks, send using multiple messages

* Escape mkdwn special-processing chars in card links

* Simplify slack attachment uploading

- Its easy to mapv
- (cond) over nested (if)s
- Fix out of date docstring

* Remove slack-files-channel from config-template.md

* Remove metabase_files check from e2e suite
2025-03-07 14:11:51 +00:00
Phoomparin Mano
2917e8c418 Replace defaultProps in styled and functional components (#54725)
* cleanup defaultProps in BaseItemsTable

* cleanup StrategyFormLauncher and QuestionModerationSection

* cleanup BookmarkToggle and TableSimple

* cleanup additional styled components

* cleanup PermissionsSelect and SmartScalarSettingsWidget

* additional styled default props cleanup

* cleanup defaultProps

* cleanup remaining defaultProps

* cleanup type imports

* cleanup IconContainer

* cleanup NodeRootProps

* remove text.0

* forward ref for BookmarkButton

* cleanup DoneButton

* default to ContentTable instead

* forward ref for legend description icon

* forward ref for more icons

* forward ref for more icons

* forward sortingIcon ref

* forward IconButtonWrapper ref

* merge classes for items table
2025-03-07 20:37:18 +07:00
Chris Truter
e83347e888 Create search index within transaction (#54832)
Not all drivers will actually do DDL statements transactionally, but it doesn't hurt to try.
2025-03-07 12:43:04 +00:00
Chris Truter
55067acdb0 Revert search indexing error workaround in #52072 (#52111)
- Fix flake by disabling index (cop out)
- Make h2 implementation thread-safe
- Small optimization
- Hide some log noise
2025-03-07 12:39:28 +00:00
Jeff Bruemmer
ce06b0b2da update banner (#54800) 2025-03-07 07:34:14 -05:00
Alexander Polyankin
699acf861a Remove unused temporal interval translations (#54826) 2025-03-07 06:41:04 -05:00
Phoomparin Mano
87c2542531 Replace findDOMNode in core components (#54650)
* replace use of findDOMNode in core components

* do not wrap input in div

* always populate scrollElementRef

* remove scrollElement from TokenField

* do not export _TokenField

* remove scrollElementRef

* use appropriate ref container

* cleanup root container

* use the scrollingContainerRef instead

* pass the elementRef directly

* use full-width container

* remove full-width container

* use display contents to preserve layout

* attach listRootRef conditionally

* try to update Loki snapshots

* modify snapshots

* fallback to scrollingContainer instead of elementRef

* revert loki snapshot

* revert loki snapshot to master
2025-03-07 13:54:27 +07:00
Alexander Polyankin
d8ce2f9efe Fix a case when the template tag's type was changed and the original question was an MBQL query (#54804)
* Do not use originalQuestion when changing the template tag's type

* Do not use originalQuestion when changing the template tag's type

* Fix test

* Fix

* Fix

* Fix

* Fix

* Fix
2025-03-06 17:23:32 -05:00
Uladzimir Havenchyk
2bc8821ac4 fix: select dataset editor header column after reordering by the corner (#54692)
* fix: select dataset editor header column after reordering by the corner

* enable fix

* use index

* rename method
2025-03-06 21:43:24 +00:00
Ryan Laurie
4cba32d8bb Enable multi-arch builds in publish workflow (#54473)
* build multi-arch arm image

* refactor artifact fetching and containerizing

* fixes after testing

* use old master for caution's sake

* enable multi-arch in publish workflow

* sync
2025-03-06 14:08:50 -07:00
Nathan Voxland
b93b078706 Hash id in core_session table (#53266) 2025-03-06 15:04:18 -06:00
Nathan Voxland
04693bc9d1 Don't update dashboard updated_by if only last_viewed_at changes (#54613) 2025-03-06 13:18:44 -06:00
Tyler Plude
52baee0550 Fix frontend parsing of allowed iframe hosts (#54111)
* Fix frontend parsing of allowed iframe hosts

* Adding spec for allowed domain list parsing change
2025-03-06 11:17:57 -08:00
bryan
68d6537dd7 update download jar (#54811) 2025-03-06 18:38:38 +00:00
Filipe Silva
4fb7432514 fix: add socket to cloud dev aliases (#54803) 2025-03-06 18:34:28 +00:00
Alexander Polyankin
ef154c5fd2 Make expression editor not crash on missing entities (#54768)
* Make expression editor not crash on missing entities

* Review comments
2025-03-06 18:13:42 +00:00
Case Nelson
78cd2283cd support: More logging for field sync. (#54774)
Part of #54559

This adds `trace` level logging to:
- `metabase.driver.athena`
- `metabase.sync.sync-metadata.fields.sync-instances`

That should help us diagnose sync issues where describe-fields and
fingerprinting seem to be out of sync.
2025-03-06 10:58:32 -07:00
Jeff Bruemmer
a0cab0ce80 docs - note on literals with special characters (#54806)
* note on literals with triple braces

* edit
2025-03-06 17:38:06 +00:00
bryan
45f541521b eid-translation module (#54542) 2025-03-06 09:41:33 -07:00
Alexander Polyankin
2bcf0ca5e8 Fix offset intervals translations (#54772) 2025-03-06 11:40:16 -05:00
Alexander Polyankin
e4c50175c2 Clarify parsing & escaping of filter values (#54771) 2025-03-06 11:28:03 -05:00
Nicolò Pretto
bbd40b5997 fix: CheckboxTooltip should have only 1 child (#54798) 2025-03-06 16:14:17 +01:00
Timofey Kachalov
8cbecd8908 Add Sample Apps compatibility with Embedding SDK tests documentation (#54723) 2025-03-06 18:17:51 +04:00
Phoomparin Mano
e476bee260 Remove findDOMNode from visualization components (#54707)
* remove findDOMNode usage in viz components

* remove type cast

* expose rootElement via ref
2025-03-06 19:59:45 +07:00
Filip Hric
16d69499f0 stabilize flaky test (#54789) 2025-03-06 13:37:43 +01:00
Filipe Silva
037c3eb57c fix: package.json script should use && (#54753)
* fix: package.json script should use &&

Followup from https://github.com/metabase/metabase/pull/54667

* fix: cloud:dev process labels were switched
2025-03-06 12:35:07 +00:00
Eric Normand
44bc8c72f2 Clean template tags when changing databases (#54453)
* Clean template tags when changing databases

* WIP add tests

* Remove println

* Make :dimension optional on :field-filter

* Don't run native queries with incomplete field filters

* Add helpful comment

* Fix cypress tests

* Remove commented code
2025-03-06 12:03:17 +00:00
Eric Normand
6406f7b2bd Fix type logic for datetimeDiff() for days on postgres (#54709)
* Subtracting 2 dates gives a number of days (integer)

* Add test for all postgres time units for datetimeDiff()
2025-03-06 11:52:57 +00:00
Ngoc Khuat
0cd7a19b1b [Notification] Dedup send queue (#54320) 2025-03-06 17:24:55 +07:00
Mahatthana (Kelvin) Nomsawadi
fa7ca671b6 ci(sdk): Send SDK release notification to Slack (#54733)
* Update Slack util

* Standardize job name

* Add slack notification for SDK

* Debug: remove other jobs

* Add failure message

* Add build successful notification

* Connect Slack jobs with real jobs

* Debug: disabled steps

* debug: mock failure

* Re-enable everything

* Update channel name
2025-03-06 06:58:14 +00:00
bryan
e1800cda38 fix examples for mage cljfmt-files (#54773)
* fix examples for mage cljfmt-files

+ test was broken

* fix tests + ./bin/mage by itself is ok
2025-03-05 22:43:40 +00:00
Oleksandr Yakushev
e9195acea6 [db-pool] Try again to address the thread deadlock caused by c3p0 (#52351) 2025-03-05 23:53:55 +02:00
Riley Thompson
fceee59fad Update required driver fields and placeholders (#53693) 2025-03-05 16:36:26 -05:00
Alexander Polyankin
4a766ed1aa Fix temporal unit interval translations (#54686) 2025-03-05 20:21:55 +00:00
Alexander Polyankin
a88224854a Repro test (#54762) 2025-03-05 14:33:27 -05:00
Alexander Polyankin
594584dbb5 Fix large filter pill text wrapping (#54757) 2025-03-05 14:33:14 -05:00
Vamsi Peri
9313a21937 New semantic layer team (#54736)
* New semantic layer team

* Update team.json
2025-03-05 19:06:17 +00:00
Alexander Polyankin
fe707e4c5e Do no singularize or pluralize table and column names in drills (#54659) 2025-03-05 13:38:40 -05:00
Alexander Polyankin
715ee2c568 Support relative-time-interval in the expression editor (#54671) 2025-03-05 13:37:05 -05:00
Luis Paolini
199c50319f Add a nitpick for postgres and impersonation (#54424)
* Add a nitpick for postgres and impersonation

Something that a customer saw, and might be interesting for posterity

* Update docs/permissions/impersonation.md

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

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-05 18:29:36 +00:00
Luis Paolini
b35f4f0f72 Update running-metabase-on-docker.md (#54571)
* Update running-metabase-on-docker.md

Add a note since people think that this is the official way to run Metabase

* Update running-metabase-on-docker.md

* Update running-metabase-on-docker.md

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-03-05 18:27:19 +00:00
John Swanson
561ccbc397 allow healthchecks for h2 dbs (#54674) 2025-03-05 09:47:56 -08:00
Alexander Polyankin
1316be26cd Fix token unescaping in the expression editor (#54751) 2025-03-05 17:46:58 +00:00
Jeff Bruemmer
05e28ddd34 check for anchors (#54743) 2025-03-05 12:17:46 -05:00
Nathan Voxland
57e157c082 Only include personal emails in admin recipients (#54658) 2025-03-05 10:34:11 -06:00
Nathan Voxland
fd2edb8ba8 Don't allow pulse.updated_at to change when dashboard changes (#54670) 2025-03-05 10:31:52 -06:00
Aleksandr Lesnenko
12e2dd86e2 use new endpoints for tiles in the pin map viz (#54475)
* use new endpoints to load tiles for pin map

* Fix public endpoints for unauthneticated users

* use new BE api for pin maps

---------

Co-authored-by: Noah Moss <noahbmoss@gmail.com>
2025-03-05 11:01:20 -05:00
Edward Paget
b35022d96a fix: update saml20 for full SAML SLO support (#54285)
* fix: update saml20 for full SAML SLO support

Update metabase to use a new version of the saml20-clj library that
correctly builds and signs HTTP Redirect requests and provides support
for checking LogoutResponses.

Note right now SAML SLO cannot be enabled just through the API it
requires the following settings to work correctly:

* saml-slo-enable - must be true
* saml-identity-provider-slo-uri - must be set to the IdP's SLO endpoint
* session-cookie-samesite - must be set to none

For the samesite none cookie to work metabase must be served over SSL.
Without this setting Chrome (and other browsers) will not send the
cookie when Okta redirects to our SLO endpoint which means we can't sign
out the user session.

* fixup! kondo lints
2025-03-05 09:41:18 -06:00
Jeff Bruemmer
047053159e docs - images and links (#54734) 2025-03-05 09:35:37 -05:00
Nicolò Pretto
cbf51e6dc3 fix(sdk): wrong icon on visualization selector (#54724) 2025-03-05 15:13:59 +01:00
Jeff Bruemmer
2772090d72 docs - rename SQL snippets to snippets (#54507)
* SQL snippets to snippets

* rename file

* snippet folder
2025-03-05 08:37:03 -05:00
Ngoc Khuat
f68c0e25c0 Return http channels for admins or users with settings permissions only (#53210)
* feat(frontend): allow non admin users to create alerts (#54426)

---------

Co-authored-by: Konstantin Darutkin <spalt08@mail.ru>
2025-03-05 13:05:51 +00:00
Chris Truter
7a4c66d413 Table Data Editing APIs (#54651) 2025-03-05 10:47:39 +00:00
Nicolò Pretto
c1aeb94b8f docs: update some other docs about e2e for the sdk (#54718) 2025-03-05 10:50:04 +01:00
Alexander Polyankin
7f07975d15 Prevent from using millisecond with datetime-diff (#54531)
* Fixes

* Fix

* Fix

* Fix

* Add tests

* Add tests

* Add tests

* Fix description

* Fix description
2025-03-05 12:11:09 +03:00
Stas Gavrylov
6f6909c5aa WRK-81: Subscriptions can include unwired filters which is confusing (#54508)
* WRK-81: Hide unwired filters from subscriptions panel

* WRK-81: Refactor AddEditEmailSidebar to TypeScript.

* WRK-81: Refactor AddEditSlackSidebar to TypeScript

* Hide parameters section if none are connected. Update typings
2025-03-05 10:59:26 +02:00
Mahatthana (Kelvin) Nomsawadi
70cada082b Update stable tag (#54710) 2025-03-05 08:39:58 +00:00
Roman Abdulmanov
5755ee06f6 Disabled feature merged notifications (#54713) 2025-03-05 11:10:04 +03:00
Phoomparin Mano
6a15b7f463 Remove the legacy isModal context from ModalContent (#54660) 2025-03-05 13:44:51 +07:00
Ngoc Khuat
f283daa3f0 Moduralize notification (#54556)
* moduralize notification, tests are passing

* kondo and clj-format

* test fixes

* fix some spacing

* test fixes
2025-03-05 04:14:47 +00:00
bryan
ba3e008d41 Metabase Automation Genius Engine (#54091)
* booting up mage

* indent -> format

* formatter help

* Kondo commands

* Clear cache when running Kondo

* start-db command

* Add aliases in deps.edn

* comments + more

* subsume new commands into bb

* add mage_verbose env var

* add tests

* refine tests + check github action output

* run the tests

* add mage tests to backend workflow instead

* min version + rip out b/ask!

* Fix start-db latest

* actually call it with --help

* add readme entry for bb tasks

* move project-root-dir into util

* add mb download jar + cleanup bb.edn

* cleanup + fix jar downloader

* run tests

* finish removing bask

* add mage and jar downloader

* setup ./bin/mage entrypoint [responding to user research]

* uopdate examples

* update readme

* add todos

* add autotab + deprecate obsolete scripts

* migrate instructions for cljfmt over to mage

* respond to ./bin/mage kondo-updated master

* linting branding, clean up cli for fmt

* fix comment

* more tests

* better explainations of what mage is doing

* remove empty task -new-task!

fix start-db

* handle missing deps-edn-hash

* make start-db work with mysql and maria

* improve ux + simplify option and arg parsing

* add optional :usage-fn to task definitions

* cljfmt-* {-c}, and jar-download working

* last bit of cleanup

* docs

* add examples exit-codes test: ./bin/mage -test-examples

* add deprecation warns to old shell scripts + docs

* remove typo

* better errors

* typos

---------

Co-authored-by: Cam Saul <github@camsaul.com>
2025-03-04 16:56:11 -07:00
Oisin Coveney
22557bf7b6 Convert rest of RuleEditor to Mantine (#54476) 2025-03-04 22:20:06 +00:00
Alexander Polyankin
96fed1a4c2 Show an error message when overwriting a card with a cycle (#54610)d
* Fix bug

* Fix bug
2025-03-04 16:54:30 -05:00
Oisin Coveney
6e784167ea Convert RulePreview to Mantine (#54472) 2025-03-04 21:24:39 +00:00
Oisin Coveney
0e6d999f8f Convert ColorRange + RuleBackground to Mantine (#54469) 2025-03-04 21:24:23 +00:00
Alexander Polyankin
a9379e2579 Do not display the raw data toggle when displaying table, even with reordered columns (#54668) 2025-03-04 15:21:33 -05:00
Uladzimir Havenchyk
fb645c672d fix: clear dashboard url from undefined when filter is removed (#54600)
* fix: clear url when filter is removed

* add e2e test
2025-03-04 22:36:11 +03:00
Filipe Silva
d768c1e51e build: fixes for cloud dev (#54667)
* fix: :dev-start would not call start!

* build: cloud:dev npm script for when working in cloud
2025-03-04 19:14:12 +00:00
Oisin Coveney
d1aa6ff450 Convert RuleListing to Mantine (#54471) 2025-03-04 10:54:36 -08:00
Oisin Coveney
9eea43baee Convert RuleDescription to Mantine (#54470) 2025-03-04 10:50:23 -08:00
Timofey Kachalov
0ba3bfecb8 Integrate Sample Apps e2e tests with CI (#54579) 2025-03-04 22:07:22 +04:00
Alex Yarosh
f3189fcc43 docs: Update Usage analytics (#54657)
* Update usage-analytics.md

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-04 17:49:01 +00:00
Konstantin Darutkin
8d82cbafd6 fix(frontend): update single alert condition style (#54587) 2025-03-04 17:19:20 +00:00
Nicolò Pretto
9da93a751d docs(sdk): update the command to run sdk e2e (#54666) 2025-03-04 18:17:20 +01:00
Nicolò Pretto
b427265c7d fix(sdk): move import of mantine css to index file of sdk (#54602)
* fix(sdk): move import of mantine css to index file of sdk

* put back the css in core app
2025-03-04 18:03:51 +01:00
Phoomparin Mano
d45816434e Bump react-virtualized to 9.22.5 to unblock React 19 (#54645)
* bump react-virtualized to 9.22.6

* bump the types for react-virtualized to latest in DefinitelyTyped

* try using 9.22.5 instead of 9.22.6
2025-03-05 00:01:52 +07:00
Phoomparin Mano
ded9cde3b2 Bump react-grid-layout to 1.4.4 to unblock React 19 (#54644)
* bump react-grid-layout to 1.4.4

* bump the types for react-grid-layout to latest in DefinitelyTyped
2025-03-04 23:44:07 +07:00
Carlos Sánchez Páez
9f8fd15204 54138 Upgrade node to v22 in Dockerfile & docker-compose (#54436)
* 54138 Upgrade node to v22 in Dockerfile & docker-compose

* Update docker-compose.yml

---------

Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
2025-03-04 11:30:48 -05:00
Luis Paolini
12db805680 Update activating-the-enterprise-edition.md (#54430)
* Update activating-the-enterprise-edition.md

Added proxy for containers

* Update docs/installation-and-operation/activating-the-enterprise-edition.md

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-04 12:34:29 +00:00
Mahatthana (Kelvin) Nomsawadi
f4171427b2 feat(sdk): Simple data picker (#54489)
* Simple data picker UI (#52964)

* Add SimpleDataPicker base component

* Finish the flattened list version of the simple data picker

* Add selected entity state

* Fix the new simple data picker got run with loki accidentally

* Update frontend/src/metabase/embedding-sdk/components/SimpleDataPicker/SimpleDataPicker.tsx

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

* Fix selected data source icon color

* Add an empty state

---------

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

* Real simple data picker (#52965)

* Connect data to the data picker

* Sort the entities alphabetically

* Make sure the data picker icon is always table

* Fix unit tests

* Fix interactive embedding E2E tests

* Force table icon on the DataPickerTarget for simple data picker

* Remove commented out code

* Remove tests that don't apply to the new simple data picker

* Fix passing wrong table ID

* Ensure we can only join data from same DB

* Make component name better

* todo

* better simple data picker UX

* Add multi stage embedding data picker back

* Able to force complex data picker in interactive embedding

* Fix tests for simple data picker

* Add old tests back

* Add simple data picker tests back

* Fix unit tests

* Fix SDK tests

* Remove ability to force multi stage data picker

* Add cross-db join tests for simple data picker

* Simplify code

* Fix popover not closing since Mantine prop changes

* Add simple data picker data source ordering tests

* Fix conflicts from merging master

* poc async plugins

* Remove SDK plugins poc code

* Fix unit tests after moving code to EE folder

* Mock search query explicitly

Co-Authored-By: Alexander Polyankin <alexander.polyankin@metabase.com>

* Don't modify cljs objects

Co-Authored-By: Alexander Polyankin <alexander.polyankin@metabase.>

* Reduce the ambiguity around NaN value

Co-Authored-By: Alexander Polyankin <alexander.polyankin@metabase>

* Remove dependency from an unrelated module

Co-Authored-By: Alexander Polyankin <alexander.polyankin@metabase>

* Fix SDK unit tests not running because EE plugins

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase>

* Fix embedding data picker not filtering by selected database (#54272)

* Fix embedding data picker not filtering by selected database

* Add an E2E test

* Fix SavedEntityPicker doesn't filtered out items in a selected DB

* Fix TypeScript types

* Address review, not passing unnecessary props

* Fix failed tests by using the same snippet in the past

* Hide metrics/saved questions from multi-stage data picker (#54409)

* Hide metrics from multi-stage data picker

* Hide saved questions from multi-stage data picker

* Modify saved questions tests

* Modify metrics tests

* Address review: create a new test suite and put tests there

* Adjust the data picker min-height according to review

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase>
2025-03-04 10:05:45 +00:00
Roman Abdulmanov
86338d9a8b removed GH project urls (#54639) 2025-03-04 12:18:05 +03:00
Mahatthana (Kelvin) Nomsawadi
a3647a71c5 refactor: "Get embedding code" width too narrow (#54574)
* A more idiomatic fix

* Add an assertion
2025-03-04 07:41:29 +00:00
Sébastien
0fbe8cf3b1 Closes viz-474: conditional formatting polish (#54483)
* :x

* fixup

* useToggle -> useDisclosure

* deprecate useToggle in favor or useDisclosure
2025-03-04 08:33:21 +01:00
Ngoc Khuat
92ff77263a Robustly initialize notification triggers (#54577) 2025-03-04 04:29:52 +00:00
Raphael Krut-Landau
91f4922e15 Increase e2e test coverage for sandboxing (#53776)
Let's improve coverage of sandboxing in e2e tests.

These tests cover the following kinds of sandboxing policies:
* Filter by regular column
* Filter by custom column
* Use a custom view to filter a table

The tests verify that these sandboxing policies correctly affect:
* Saved questions
* Models
* Questions based on questions
* All of the above, when viewed in a dashboard
* Adhoc questions
* Filter values
2025-03-03 21:02:07 -05:00
Ryan Laurie
9a65e0b6c4 Build multi-arch arm images (#54156)
* build multi-arch arm image

* refactor artifact fetching and containerizing

* fixes after testing

* backwards compatibility

* use old master for caution's sake

* update release code tests

* just bash it
2025-03-03 21:53:42 +00:00
Noah Moss
874c11e806 Guard enforced-sandboxes-for-user against nil user-ids (#54605)
* guard enforced-sandboxes-for-user against nil user-ids

* add comment

* Fix e2e test

* try again to fix e2e test
2025-03-03 16:52:06 -05:00
Oisin Coveney
cd06480c6b fix(sdk): Fix ColorSelector in Conditional Formatting (#54402) 2025-03-03 13:07:18 -08:00
Uladzimir Havenchyk
d71862d041 fix: close date filter on esc (#54499)
* fix: close date filter on esc

* fix test

* fixup
2025-03-03 21:03:50 +00:00
Alexander Polyankin
92a5a6816d Repro for "Date filter translations: Key not being translated" (#54619) 2025-03-03 20:43:16 +00:00
Nick Fitzpatrick
c76be91169 Updating InputWithSelectPrefix to Mantine components (#54536)
* updating InputWithSelectPrefix to Mantine components

* fixing the border, and tests
2025-03-03 14:39:28 -06:00
Alexander Polyankin
9ef9186dd7 Fix duplicates introduced by column sync (#54611) 2025-03-03 20:11:44 +00:00
Oisin Coveney
609d4923f9 Add "for React" to SDK in legalese modal and settings page (#54534) 2025-03-03 12:02:15 -08:00
Oisin Coveney
752e9246e5 fix(sdk): Fix ColorRangeSelector in Conditional Formatting (#54450) 2025-03-03 12:01:32 -08:00
Nick Fitzpatrick
f12e332019 add ability to style SpecialTagInput, update MultiAutocomplete styles (#54533)
* add ability to style SpecialTagInput, update MultiAutocomplete styles

* get outta here, stupid

* adjusting padding
2025-03-03 15:43:33 -04:00
John Swanson
b112fa202a Healthcheck endpoint for databases (#54446)
* Healthcheck endpoint for databases

* Update test/metabase/api/database_test.clj

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>

---------

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-03 11:18:59 -08:00
Alexander Polyankin
dd66622ec9 Remove extra queries on public & embedded dashboard load (#52993) 2025-03-03 18:03:48 +00:00
Case Nelson
0252fb2aa0 fix: Cast LocalDateTime to date in oracle (#54529)
* fix: Cast LocalDateTime to date in oracle

Fixes #53371

Remember that oracle Date is a timestamp type with seconds resolution.
This changes our inlining of LocalDateTime values to use a date rather
than timestamp if the LocalDateTime has no millisecond part.

We can see `timestamp` causes full scan:
```
SQL> explain plan for select * from test where d > timestamp '1970-01-01 00:00:00';
SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY());
--------------------------------------------------------------------------
| Id  | Operation	  | Name | Rows  | Bytes | Cost (%CPU)| Time	 |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |	 |     1 |    35 |     2   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| TEST |     1 |    35 |     2   (0)| 00:00:01 |
--------------------------------------------------------------------------
```

We can see `to_date` causes idx scan for both date and timestamp LHS.
```
SQL> explain plan for select * from test where d > to_date('1970-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS');
SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY());

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT		    |	    |	  1 |	 35 |	  0   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| TEST  |	  1 |	 35 |	  0   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN		    | IDX_D |	  1 |	    |	  0   (0)| 00:00:01 |

SQL> explain plan for select * from test where ts > to_date('1970-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS');
SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY());
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT		    |	     |	   1 |	  35 |	   0   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| TEST   |	   1 |	  35 |	   0   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN		    | IDX_TS |	   1 |	     |	   0   (0)| 00:00:01 |
```

* Fix kondo
2025-03-03 11:01:03 -07:00
Ryan Laurie
954b21a88a Fix invisible close icons on some legacy modals (#54056)
* fix invisible close icons on some legacy modals

* fix alignment
2025-03-03 10:46:52 -07:00
Alexander Polyankin
8529330c88 Make :time-interval work with 0 instead of :current in the UI (#54525) 2025-03-03 12:35:07 -05:00
Nick Fitzpatrick
1e4a44f00a updating mantine patch (#54598) 2025-03-03 12:13:18 -04:00
John Swanson
7f51520b96 Override some deps licenses (#54589) 2025-03-03 15:59:23 +00:00
Jeff Bruemmer
f0098c980a clarify cloud (#54592) 2025-03-03 10:47:21 -05:00
Chris Truter
c5f6a34cc1 Add prometheus info metric (#54523) 2025-03-03 17:41:13 +02:00
github-automation-metabase
9d4fa545a7 Bump thheller/shadow-cljs from 2.28.20 to 2.28.21 (#54170)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-03 10:31:45 -05:00
Sloan Sparger
572a75bfad [Cards in Dashboards] Allow changing save location when saving a modified dashboard question (#54526)
* fix

* add unit tests
2025-03-03 09:24:06 -06:00
Noah Moss
bc514f1f2f Fix pivot csv export with multiple pivot cols and no row totals (#54540)
* Fix pivot csv export with multiple pivot cols and no row totals

* revert re-enabling a couple tests since they fail on mysql
2025-03-03 10:15:17 -05:00
Timofey Kachalov
18e077c721 Update sample app ports in documentation (#54575) 2025-03-03 19:12:43 +04:00
Timofey Kachalov
a7b8a23519 Run cypress tests against the nodejs sample app (#54250) 2025-03-03 19:00:54 +04:00
Jeff Bruemmer
0a32925830 docs - note on license (#54586)
* note on license

* Update docs/embedding/sdk/quickstart.md
2025-03-03 09:27:41 -05:00
Mahatthana (Kelvin) Nomsawadi
6e9dd0f77c Remove unnecessary step that updates GH CLI (#54581) 2025-03-03 13:58:46 +00:00
John Swanson
e22e19509c Allow impersonated users to hit cache again (#54521)
* Allow impersonated users to hit cache again

As part of this I refactored a bit: `impersonation` is now its own
module, used by the `advanced-permissions` module.

The real changes are in:

- `middleware.cache`, where we're no longer not caching impersonated users,

- `metabase.impersonation.middleware`, where we're adding a key to the
  query if it'll be impersonated, and

- `metabase.query-processor.util/select-keys-for-hashing`, where we're
  selecting that key as part of the query hash.

- a new test in `metabase-enterprise.impersonation.cache-test`, an e2e
  test which verifies that impersonated users get a different cache than
  non-impersonated users.

* Fix throwing when sandbox/gtap both enforceable

`enforce-impersonations?` was returning `false` because due to the
sandbox, we had "unrestricted" data access from another group (the
sandboxed group).

i refactored a bit:

- `enforced-impersonations-for-db?` now is responsible for throwing in the
sandbox conflict case, rather than `connection-impersonation-role`.

- this way, if there's a conflicting sandbox, we'll throw before we even
check to see whether those impersonations will be enforced (rather than
checking and deciding "nope, they have unrestricted access so we won't
enforce them.")

* kondo yay
2025-03-03 05:36:36 -08:00
Chris Truter
919a393bf3 Recalculate columns for Upload model when updating (#54069)
* Recalculate metadata for derived models when updating Upload table
* Preserve modified metadata
* Test for display names being consistent
* Less ominous language
2025-03-03 15:35:28 +02:00
Romeo Van Snick
06f0eee2d2 Remove the ACE editor (#54558)
* Remove ace styles

* Remove ace-builds types

* Remove ace-builds alias from webpack and rspack config

* Remove ace mocks

* Remove ace packages

* Remove ace references in jest config

* Remove ace global in jest mock
2025-03-03 10:21:28 +01:00
Sébastien
be318cf2d5 Auto formatting adapts to currency style if needed (#54349)
* wip

* test

* fix

* fixup
2025-03-03 09:41:04 +01:00
github-automation-metabase
b44f22b6fa Bump org.slf4j/slf4j-api from 2.0.16 to 2.0.17 (#54566)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-03 07:13:07 +00:00
github-automation-metabase
08847cdf6b Bump ch.qos.logback/logback-classic from 1.5.16 to 1.5.17 (#54561)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-03 07:05:39 +00:00
github-automation-metabase
3517c25fea Bump io.github.tonsky/clj-reload from 0.8.0 to 0.9.0 (#54563)
Inspect dependency changes here: https://github.com/tonsky/clj-reload/blob/0.9.0/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-03 06:56:46 +00:00
github-automation-metabase
6ab2325841 Bump cider/cider-nrepl from 0.52.0 to 0.52.1 (#54562)
Inspect dependency changes here: https://github.com/clojure-emacs/cider-nrepl/blob/v0.52.1/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-03 13:48:49 +07:00
github-automation-metabase
e112875105 Bump org.apache.sshd/sshd-core from 2.14.0 to 2.15.0 (#54565)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-03 13:48:26 +07:00
github-automation-metabase
e4497bfe8a Bump metabase/saml20-clj from 2.2.7.173 to 3.0.0.175 (#54564)
Inspect dependency changes here: https://github.com/metabase/saml20-clj/compare/v2.2.7.173...head

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-03 13:47:58 +07:00
Romeo Van Snick
cc946a888f Move Custom Expression editor to CodeMirror (#54253)
* Use lezer parser for custom expressions (#53540)

* Add @lezer/generator

* Add missing value on Token

* Add script to generate lezer grammar parser

* Add @lezer/lr

* Add more tests to tokenizer

* Add lezer grammar for custom expressions

* Generate lezer parser for custom expressions

* Convert TOKEN and OPERATOR to enums

* Make Token type more specific

* Add isReference to identifier token

* Typo

* Add more tests for tokenizer

* Add tokenize alternative that uses lezer grammar

* Remove old tokenizer

* Update location of grammer in generate rule

* Add test cases for tokens that share a prefix

* Merge tokens when necessary

* Only add character error when text is 1 character long

* Reduce the need to manually merge nodes

* Stop the iteration when node is found

* Update tests to be more specific

* Simplify tokenize

* Uncommit edge cases

* Generate parser as js

* Move previous tokenizer tests into expressions folder

* Add typing to unit test

* Allow escaping [] in reference

* Add test for escaping closing bracket

* Handle invalid parses manually

* Add support for signed expressions

* Document parser more

* Add custom tokenizer for Reference

* Make tests more explicit

* Fix e2e test

* Merge old test suite into tokenizer test suite

* Move @lezer/generator to devDependencies

* Custom expression suggestions (#53679)

* Add new suggesters for custom expressions

* Add test for joined fields

* Move complete into separate folder

* Split up completions into separate files

* Split up completion tests too

* Copy more tests from legacy completer

* Fix types

* Lezer highlight for custom expressions (#53651)

* Rename generated parser to lezer

* Add lezer highlighting rules to parser

* Add HighlightExpression component

* Use HighlightExpression in expression HelpText

* Add type annotation to highlighter

* Add test for highlight

* Simplify unit test

* Move syntax highlighting to shared module

* Rename util.tsx to util.ts

* Add monospace font variable

* Use monospace font from theme for syntax block

* Use relative font size in HighlightExpression

* Use mantine var for border-radius

* Add test id to example

* Fix tests that rely on example content

* Move highlighting code to metabase/ui/syntax

* Replace ACE with codemirror in custom expression editor (#53746)

* Rename generated parser to lezer

* Add lezer highlighting rules to parser

* Add HighlightExpression component

* Use HighlightExpression in expression HelpText

* Add type annotation to highlighter

* Add test for highlight

* Simplify unit test

* Move syntax highlighting to shared module

* Rename util.tsx to util.ts

* Add monospace font variable

* Use monospace font from theme for syntax block

* Use relative font size in HighlightExpression

* Use mantine var for border-radius

* Add test id to example

* Fix tests that rely on example content

* Move highlighting code to metabase/ui/syntax

* Replace custom expression editor with CodeMirror editor

* Add test mock for CodeMirror

* Colocate custom expression tests (#53812)

* Remove unused DISPLAY_QUOTES

* Colocate custom expressions diagnostic tests

* Colocate custom expressions process tests

* Colocate custom expressions recursive-parser tests

* Colocate custom expressions typeinferencer tests

* Colocate custom expressions completer tests

* Colocate custom expressions format tests

* Colocate custom expressions resolver tests

* Colocate custom expressions index tests

* Colocate custom expressions pratt compiler tests

* Colocate fuzz tests with custom expressions code

* Update paths for fuzz tests

* Fix types in fuzz test

* Fix types in process test

* Remove unused var

* Remove unused var in generator

* Merge types for custom expressions (#53902)

* Add missing expression types to metabase-types

* Add more explicit types to matchers

* Use Expression type from metabase-types everywhere instead of custom type

* Move matchers to separate file

* Further use Expression types for matchers

* Add types for Metric and Segment matchers

* Fix types in format

* Fix missing types

* Clean up imports

* Split string helpers into separate submodule

* Split identifier helpers into separate submodule

* Avoid importing from index file in expressions module

* Render suggestions and help text in new custom tooltip (#53760)

* Add new help text component for custom expression editor

* Add new suggestions listbox for custom expression editor

* Add helper to find help text by function name

* Add enclosingFunction helper that is more forgiving to broken syntax

* Add new tooltip component for custom expression editor

* Add extension to render custom react tooltips

* Render suggestions in custom tooltip

* Export custom types

* Remove old expression editor popover components

* Add typings to process

* Add missing shortcuts

* Fix example font size

* Fix type imports

* Fix click on helptext

* Stop click propagation

* Fix process types

* Remove superflouous optional chain

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

* Fix types whith optional expressionIndex

* Use imports instead of React namespace

* Use index for key

* Rename util to utils

* Remove unused box shadow

* Remove brackets around placeholder names

* Resize tooltip to avoid it overflowing the window

* Fix line height for args

* Fix missing key icons

* Fix chevron alignment

* Fix types

* Move Listbox resizing classes to Tooltip

* Fix completion template for functions with no arguments

* Add unit tests for enclosingFunction

* Add darker background to expression example

* Remove bold from function call

* Fix imports

* Fix HelpText tests

* Add custom color for highlighted syntax argument

* Use colors from design system

* Fix blurring when switching to a different tab

* Remove trailing comma

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

* Split up effect

* Remove background from template arguments

* Improve tooltip position

* Fix Popover position when selection changes

---------

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

* Fix custom expression editor e2e tests (#53761)

* Fix e2e tests for custom expressions

* Fix unit test

* Fix e2e tests

* Fix types

* Fix moveToStart and moveToEnd by using Home/End

* Add test for popover position

* Remove JSDoc in favor of inline comments

* Add examples of side effects

* Remove shouldContain helper in favour of value()

* Add comment to wait

* Use CustomExpressionEditor helper instead of @formula

* Add wait to reduce flakiness

* Add back in the useful comment about popover position

* Remove superflouous cy.viewport call

* Add helper to accept completion

* Rename helper to verifyHelptextPosition

* Convert comments to cy.logs

* Make sure we don't avoid testing the regression

* Allow customising key with which to accept completion

* Use acceptCompletion helper

* Fix tooltip position bug

* Remove unnused wait

* Add selectCompletion helper

* Fix helper using H

* Add better emulation of copy/paste in reproduction

* Ignore ts error

* Multiline formatter for the custom expression editor (#53973)

* Make type name meaningful

* Add more tests for not isnull, etc

* Remove unreachable code

* Add isEmpty matcher

* Pass query to format tests

* Add stronger types to formatStringLiteral

* Fix CallOptions import

* Implement multiline formatter as a prettier plugin

* Reimplement legacy formatter as new formatter with infinite print width

* Use the new formatter in the expression editor

* Remove legacy expression format files

* Document utils

* Simplify Expression type further

* Fully type test cases

* Remove cast in test

* Add more tests and fix formatting

* Use recurse helper to recurse into path children

* Prefix logical operators

* Improve formatting of logical connectors

* Wait for expression editor to be ready

* Avoid passing unknown html props

* Use selectCompletion helper

* Remove unused @ts-expect-error

* Always close helptext when suggestions are being shown

* Keep completion identity constant

* Fix unit test

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-03-02 12:25:24 +01:00
bryan
46df39bffc Bump #p version, add :dev-start alias, and dev app allows #p (#54398)
* dev mode starts webapp + works with hashp

- starts app in one go with :dev-start

* docstring

* docs

* fix ci

* reorder dev deps
2025-02-28 16:04:54 -07:00
Oisin Coveney
a6cdb8e7f4 SDK legalese text overflow (#54541) 2025-02-28 22:26:34 +00:00
Eric Normand
2f84e20584 Allow zoom on joined binned column (#54226)
* Add condition for join alias to match source alias

* Add test for zoom order of joined fields

* Improve nil handling in test

* Remove unneeded dependency

* WIP Check not using generous? true

* Remove `:generous?` option

* Get rid of unused require
2025-02-28 21:20:53 +00:00
Case Nelson
d47b1af7c4 fix: nested field refs from join-alias with spaces (#54231)
* fix: nested field refs from join-alias with spaces

Fixes: #37600

Join aliases get escaped by drivers (truncation and/or tr space to
underscore). However, when join fields are referenced in future stages,
the references were not being renamed and so the query was being created
with invalid columns from the previous stage.

* Fix tests, drop methods namespace

* Re-assoc info after conversion

* Just change query, none of the mw keys

* Add before/after mw for escape join alias to be able to use and capture converted pmbql queries

* Fix kondo errors

* Fix nest-breakouts

* Fix breakouts tests

* Field rename should happen in add-alias-info.

* Fix tests

* Don't use card name for collection name

* Format rows for sqlite

* Uncomment assertion
2025-02-28 14:12:21 -07:00
Nick Fitzpatrick
7a926d81a9 Various UI Polish (#54501)
* lots of UI fixes

* adjusting focus color with theme

* updating z-index in tests

* only change focus color

* updating loki screenshots

* e2e adjustments, PR feedback
2025-02-28 16:48:57 -04:00
Nemanja Glumac
b1b5efe9be Empty states for events (#54157)
Resolves CLO-3630
Resolves CLO-3627
Resolves CLO-3629
Resolves CLO-3626
Resolves CLO-3660
2025-02-28 21:25:13 +01:00
Riley Thompson
127724f0a0 Add support for filtering Mongo UUIDs with string patterns (#54390) 2025-02-28 19:10:50 +00:00
Ryan Laurie
5eb9ee24ad allow configuration of mantine tooltip bg color (#54524) 2025-02-28 17:59:19 +00:00
Sloan Sparger
afa15c0588 [Impersonation] Adds e2e test for enforcement of impersonation on cached questions (#54456)
* adds e2e test for enforcement of impersonation when working with cached questions

* assert response is cached for admin users
2025-02-28 10:47:01 -06:00
appleby
b9414bb439 Fix e2e test flake for issue 29943 reproduction (#54304)
Rather than dragging the Custom column left by a fixed -100 px, drag the Total column right 10 px past the right edge
of the Custom column's bounding box. The idea is to make the test more flake resistant since (1) we drag based on the
size of the target column header rather than a fixed offset, (2) since there are no more columns to the right of
Custom, it's OK if we overshoot the distance slightly.
2025-02-28 08:18:20 -08:00
bryan
ece8c586a9 defendpoint returns a thunk + add call-core-fn (#54395) 2025-02-28 08:57:45 -07:00
Alberto Perdomo
a5a7e5188d Update interactive-embedding-quick-start-guide.md (#54485)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-28 15:54:50 +00:00
Sloan Sparger
b46b264806 [Cards in Dashboards] Save dashboard question directly to tab (#53580)
* wip - got the FE working w/o a real endpoint for DQs created from a dashboard

* progress

* wire in real endpoint with some ugly code

* get working for copy form and clean up code

* fix failing unit tests

* fix failing e2e tests

* fix tab select hidden when creating a question directly from a dashboard

* adds unit test coverage

* add e2e tests

* fix console warn when tab id field is not used in formik form

* small fixes

* fix flakes from two modals sometimes being opened at the same time
2025-02-28 09:44:13 -06:00
Case Nelson
6b8dd38c3e fix: BigQuery ClassNotFound in future (#54474)
Follow up to #52990

When `future` is called clojure uses `Executors.newCachedThreadPool`
This means that the Threads remain in a pool for up to a minute.

That means that if `future` gets called anywhere before
`classloader/the-classloader` is called then that `Thread` can remain in
the pool with a bad classloader. Then when BigQuery's `future` tries to
`Class/forName` `BigQuery$JobOption` it will be calling it from the
classloader context of that initial `future` call and not be able to
find the class.

This adds a very early call to `classloader/the-classloader` in `init!`
and a safety call to it right in BigQuery. In the long term we should
probably be much more strict and explicit about the executors we use.
2025-02-28 08:32:40 -07:00
Kamil Mielnik
2c42eef428 Fix - Uncaught TypeError when making native query parameter required (#54494)
* Fix #52812

* Fix types

* Repro #52812

* Add logs

* Bring back lost values

* Simplify code
2025-02-28 15:04:48 +00:00
Uladzimir Havenchyk
7a3c5f26d4 fix quarter picker styles (#54457)
* fix quarter picker styles

* update loki screenshots

* screenshots
2025-02-28 14:59:20 +00:00
Filip Hric
f6ae0f2844 stabilize flaky test (#54480) 2025-02-28 15:51:18 +01:00
Riley Thompson
9a37543f40 Handle non-JSON native mongo queries (#54210) 2025-02-28 14:49:54 +00:00
Romeo Van Snick
5ca7303e3c Use CodeMirror for code samples (#54268)
* Add @codemirror/legacy-modes package

* Add @codemirror/lang-html

* Add @codemirror/lang-javascript

* Add @xiechao/codemirror-lang-handlebars

* Add CodeBlock component

* Add custom metabase syntax highlighter for codemirror

* Use custom highlighing

* Render code sample using CodeBlock

* Add @codemirror/lang-python

* Add python support

* Restructure code

* Add classname to CodeBlock

* Deduplicate codemirror packages

* Add erb support

* Improve syntax highlighting

* Remove fold gutter

* Remove unused TextEditor

* Remove unused ace imports

* Add highlighted text to CodeBlock

* Fix tests

* Fix e2e test

* Disable current line highlighting

* Add the nonce plugin to Codemirror

* Sort languages

* Rename variable to be more descriptive

* Remove TODO

* Rename util to utils

* Find all occurences of highlighted text in source

* Use explicit classes in highlight

* Remove reliance on overriding based on language

* Remove null in signature

* Remove unused classnames

* Initialise highlighted text statefield

* Add e2e test for disappearing highlighted texts

* Replace all jade references with pug

* Remove erb support and replace it with HTML

* Add comment as to what is being tested

* Remove javascript as a code language
2025-02-28 15:48:02 +01:00
Braden Shepherdson
ce13e14c70 [refs] Include parent_id when hashing Fields to be unique (#53933)
Nested fields (Mongo, Postgres JSON unfolding, etc.) can have the same
name within one table, if their parent paths are different.

Including the parent (if any) as part of a Field's `serdes/hash-fields` makes the hashes truly unique.
2025-02-28 14:35:19 +00:00
Alexander Polyankin
858efafed7 Fix field-id propagation in filter parts (#54448) 2025-02-28 09:34:49 -05:00
Romeo Van Snick
81e9289400 Dependabot fixes octokit dompurify (#54406)
* Udpate @octokit/rest to address regex vulnerabilities

* Update tsx to fix esbuild vuln

* Fix types
2025-02-28 15:24:13 +01:00
Oisin Coveney
8850ab249f Convert components of RuleEditor to Mantine (#54104) 2025-02-28 06:24:08 -08:00
Uladzimir Havenchyk
a5e8e826b0 fix: prevent icon overflow on resize (#54189)
* fix: prevent icon overflow on resize

* add repro

* adapt join step to smaller screens
2025-02-28 17:20:27 +03:00
Braden Shepherdson
81a4a369ab [MBQL Lib] Joins added after summaries have no :fields (#54344)
When you add a summary clause (aggregation or breakout), any `:fields`
clauses are removed from the stage and its joins.

However the reverse order was not correct: a join clause added after
summaries would keep its specified `:fields` clause, or get the default
`:fields :all`. This change fixes that quirk.
2025-02-28 08:52:49 -05:00
Ngoc Khuat
3cdbe363c7 Fix alerts double sending on stats (#54478) 2025-02-28 19:47:39 +07:00
Nick Fitzpatrick
e75592cc22 Mantine UI Regressions part 1 (#54312)
* ui regressions

* updating reference images

* update loki screenshots

---------

Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>
2025-02-28 08:42:12 -04:00
Sloan Sparger
d19309da1c [Cards in Dashboards] Use last selected collection for default save location if more recent than a dashboard (#53571)
* use the last saved collection if the use saved to a collection more recently than saving to a dashboard

* make changes not affect models/metrics, fix e2e tests

* unit tests

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2025-02-28 08:21:12 -04:00
Kamil Mielnik
ceb20066a0 Enable custom no-color-literals ESLint rule (#54427)
* Enable no-color-literals rule

* Fix all strings in the file being highlighted if only one of them violates the rule

* Silence violations

* Revert "Fix all strings in the file being highlighted if only one of them violates the rule"

This reverts commit 11a3c6aca7.

* Fix all strings in the file being highlighted if only one of them violates the rule
2025-02-28 14:08:17 +07:00
Aleksandr Lesnenko
f724e1b58d add tanstack data grid (#54375)
* add tanstack data grid

* review

* drop forwardref
2025-02-28 03:59:11 +00:00
Remi Kristelijn
9895b2d76f fix: remove aria-expanded where it is not allowed (#53833) 2025-02-27 21:05:36 -05:00
Aleksandr Lesnenko
b7e0843d42 fix tooltip content overflows (#54444) 2025-02-27 17:38:29 -05:00
Jeff Bruemmer
1f6e7546d2 fix typo (#54464) 2025-02-27 17:17:37 -05:00
Noah Moss
01993856fc New tiles APIs to support parameterization and public sharing/embedding (#54150)
* New tiles APIs to support parameterization

* Public + embedding endpoints

* fix up tests, light refactor

* address feedback

* fix test
2025-02-27 17:13:43 -05:00
Alexander Polyankin
4f0eeaae99 Change offset help text (#54455) 2025-02-27 22:09:17 +00:00
Sloan Sparger
66ef7ccc70 [Cards in Dashboards] Allow dashboards w/o questions saved inside it to be shallow cloned (#53780)
* revert the removal of shallow cloning a dashboard, prevent shallow copy if dashboard has a dashboard question

* load dashboard in copy modal to avoid cases where provided entity is incomplete and does not contain dashcard data

* type fix

* add e2e test coverage

* remove old e2e test

* address pr feedback and add test coverage for case

* fix lint
2025-02-27 15:51:50 -06:00
Jeff Bruemmer
b1c4f96690 docs - SDK questions (#54451) 2025-02-27 16:02:00 -05:00
Fraser
2b690f30fa Check caching schedule setting value exists (#54392) 2025-02-28 09:45:40 +13:00
Uladzimir Havenchyk
f6dd88a771 fix: MonthPicker styles after migration to mantine v7 (#54352)
* fix monthpicker styles after migration to mantine v7

* fixup

* fix styles

* update loki screenshots
2025-02-27 23:05:18 +03:00
John Swanson
af12aba3ec Add a clj-kondo hook for bad single-quotes in i18n (#54149)
For i18n, we had a lot of things like

```
(tru "this user's string will be broken")
```

During i18n, we use `java.text.MessageFormat` to format messages. These
have a great idea: you can format messages with parameters like `{0}`, or
escape these cases with single-quotes like `'{0}'` when you actually
want the string "{0}". And of course, you can escape a single-quote
itself just by doubling it, so "''" becomes a "'".

All this makes sense. But then they had a problem. What if there's an
unescaped single-quote in the argument to MessageFormat?

A lesser program might have thrown an exception here, but not
MessageFormat! Nay! We must persist, lads, not give up at the first sign
of trouble!

Instead, let's just decide that the programmer probably *meant* to close
that single-quote! So, for example, "This user's message is totally
frickin broken" is interpreted AS IF you'd written "This user's message
is totally frickin broken'" (which ends up as "This users message is
totally frickin broken"), which - doubtless - is what you intended.

Unfortunately there are *some* few cases where - IT TURNS OUT - we don't
actually want this behavior! For example,

```
(deferred-tru "Key to retrieve the JWT user's email address.")
```

becomes "Key to retrieve the JWT users email address." Which is slightly
annoying.

So: let's have a kondo rule that will enforce statically that you don't
have unescaped single-quotes in your template strings for `tru`,
`deferred-tru`, `trs`, or `deferred-trs`.
2025-02-27 18:51:57 +00:00
appleby
f617c87173 Fix drills for mapped model metadata (#54057)
* Fix underlying-records and pivot drills for mapped model metadata

* Fix zoom-in.timeseries drill for mapped model metadata

* Fix zoom-in.binning drill for mapped model metadata

* Fix zoom-in.geographic drill for mapped model metadata

* Replace breakout->filterable-column with breakout->resolved-column

* Fix sort drill for mapped model metadata

* Restrict fix to possible-model-mapped-breakout-column?

* Add e2e tests

* Move shared e2e helpers into outer scope

* Add tests for source-card-type and source-card-is-model?

* Fix indentation

* Remove unused require

* Rename local vars from filterable-column to resolved-column

The old name was a holdover from before the function got renamed.

* Cleanup some->> -> some->

This pipeline used to have more parts that required some->>. Since the only remaining func wants the resolved-column
threaded as the first arg, switch to some-> instead and drop the now useless lambda.
2025-02-27 10:17:05 -08:00
Braden Shepherdson
902b2b69ce [refs] Make lib.convert internal; use lib/query etc. to convert (#54211)
Fixes QUE-681.


Drops `metabase.lib.convert` from the "exported" namespaces under `lib` module, and refactors all usage to
prefer `lib/query` and friends. These require a `MetadataProvider` where `lib.convert/->pMBQL` does not, but
since most of the calls were in QP middleware there was already one handy.

A few API handlers were calling `lib.convert/->pMBQL` and some of those require new `MetadataProvider`s.

Note that currently `lib.convert/->pMBQL` and `->legacy-MBQL` are still exported from `metabase.lib.core`,
and used a few places in the QP! That's an unfortunate temporary measure, and I've started the ball rolling
on alternative ways to factor both of the main offenders (like `annotate/aggregation-name` called from some
drivers).
2025-02-27 12:33:59 -05:00
Alexander Polyankin
3b7be3eda7 Add support for bigint in formatting (#54376) 2025-02-27 11:20:43 -05:00
Timofey Kachalov
1a03bcc59c Convert Visualization.jsx to typescript (#54303) 2025-02-27 20:18:16 +04:00
Nicolò Pretto
54a7b1c707 fix(sdk): expose the correct type for saveToCollection (#54428) 2025-02-27 16:32:00 +01:00
Oisin Coveney
b58d497885 Ensure that markdown files also include prop changes (#54382)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-02-27 13:35:44 +00:00
Alexander Polyankin
8118cb1933 Support large integers in query results (#54308)
* PoC

* Base pass

* First pass

* First pass

* First pass

* First pass

* Basic test

* Basic test

* Basic test

* Basic test

* Basic test

* Basic test

* Basic test

* Basic test

* Basic test

* Basic test

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes
2025-02-27 07:03:11 -05:00
Uladzimir Havenchyk
6ac028a9bc Revert "upgrade rspack and swc (#54131)" (#54417)
This reverts commit 4875aba153.
2025-02-27 15:58:19 +04:00
Raphael Krut-Landau
cf7a3fa6af Widen the 'Get embedding code' popover so we can see the copy link button (#54414)
Closes #54407

Before:

![widen-get-embedding-popover--before.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/utGnP2ljFMMNOgi82vVn/b08058f1-4b63-4331-9067-b4e629b338fd.png)

After:

![widen-get-embedding-popover--after.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/utGnP2ljFMMNOgi82vVn/3aef6862-fa57-4275-a52a-420563c0f623.png)
2025-02-27 06:34:29 -05:00
Filip Hric
8a3b6323bf fix flaky test (#54408) 2025-02-27 11:10:54 +01:00
Phoomparin Mano
fb25682fe8 feat(sdk): use questionId={new} for creating new questions (#54323) 2025-02-27 13:18:40 +07:00
Aleksandr Lesnenko
2d561440a0 Reduce usage of legacy tooltip (#53447)
* reduce usage of legacy tooltip

* update Link component tooltip

* update e2e specs

* fix tooltip usages

* lint

* unit specs

* forward ref

* specs

* smart scalar tooltip color

* use tooltip secondary color

* drop flaky legacy tooltips and popovers from loki tests

* one more usage
2025-02-27 06:16:59 +00:00
Jeff Bruemmer
1071dbbcc5 docs - base url for api docs (#54374) 2025-02-27 00:44:07 +00:00
Ryan Laurie
ee401487ca optional sql server 2017 (#54389)
* optional sql server 2017

* disable sqlserver 2017 tests
2025-02-26 22:34:32 +00:00
Oisin Coveney
0c7e18ac30 Convert ChartSettingsTableFormatting components to TS (#54103) 2025-02-26 21:06:16 +00:00
Oisin Coveney
cee7052c31 Add for React in two places on the core app (#54234) 2025-02-26 12:45:40 -08:00
Aleksandr Lesnenko
b974b6bc1c support markdown in the link description tooltip (#53097) 2025-02-26 14:41:12 -05:00
Jeff Bruemmer
5c2132facb Update interactive-embedding-quick-start-guide.md (#54377) 2025-02-26 13:50:03 -05:00
Alberto Perdomo
c9f655bef9 Updates to SDK docs (#54363)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-26 17:51:10 +00:00
Jeff Bruemmer
fe5c9864d1 dashboardCardMenu (#54366) 2025-02-26 12:45:41 -05:00
Alberto Perdomo
22fb69ebbc SDK - Document color theming limitation (#54351)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-26 16:18:37 +00:00
github-automation-metabase
a562562dd4 Update Readme version references and published npm version to 0.54.3-nightly (#54348) 2025-02-26 16:01:02 +00:00
Denis Berezin
e9705f56ec Fixed Question Notifications UI issues after mantine upgrade (#54327) 2025-02-26 18:19:05 +03:00
Riley Thompson
ea38120e5a Cast column to float for Redshift and SQLServer AVG (#53756)
* cast to float for redshift avg

* cast sqlserver avg as float

* remove ::floors-average

* fix test comparison
2025-02-26 09:19:34 -05:00
John Swanson
fbf8c6db83 Remove unused cards in usage analytics (#53598)
[ADM-159: Get rid of unused questions in Usage Analytics](https://linear.app/metabase/issue/ADM-159/get-rid-of-unused-questions-in-usage-analytics)
2025-02-26 05:39:29 -08:00
Kamil Mielnik
2c23bc8284 Repro #54236 (#54326) 2025-02-26 18:52:40 +07:00
Nicolò Pretto
789f1d5002 fix(sdk): move some emotion to css, scope it to .mb-wrapper and use it in the sdk (#54202)
* fix(sdk): move some css to css, scoped it to .mb-wrapper and use it in
the sdk

* make the dashboard test not flake if they render 6 or 7 rows
2025-02-26 11:57:27 +01:00
Filip Hric
c9a9a33e65 fix a test (#53878) 2025-02-26 11:55:30 +01:00
Uladzimir Havenchyk
208e191c12 ci: fix flaky test about sticky panel (#54125)
* fix flaky test about sticky panel

* rework fix

* drop waitFor

* fixup
2025-02-26 12:09:21 +03:00
Phoomparin Mano
250b47b0d8 feat(sdk): cli should ask to remove the instance early if one exists (#53545) 2025-02-26 15:20:18 +07:00
Ngoc Khuat
72538ba54b [Notification] Alert refactor WIP (#51101)
* [Notification] First Notification API (#50770)

* [Notification] CRUD notification APIs (#50921)

* [Notification] Send notification card (#51120)

* [Notification] Send notification APIs (#51267)

* [Notification] Migrate alerts (#50724)

* [Notification] send card notification tests (#51447)

* [Notification] use malli registry (#51439)

* [Notification] Create notification API use current user as creator (#51676)

* [Notification] module readme (#51657)

* [Notification] CRUD api permissions  (#51561)

* [Notification] Send notification APIs (#51267)

* [Notification] add spec update tests (#51630)

* [Notification] management api (#51649)

* [Notification] Transaction emails (#51688)

* [Notification] add spec update tests  (#52078)

* [Notification] send emails about alerts when update card (#52087)

* [Notification] POST /api/notification/send do not requires creator_id (#52374)

* [Notification] Fix unable to send test to webhook (#52502)

* [Notification] Card notification archive when send_once = true (#52375)

* [Notification] unsubscribe notification APIs (#52109)

* [Notification] Quartz trigger management (#52431)

* [Notification] Publish events (#51852)

* [Notification] confirmation email when setting up alert (#52494)

* [Notification] Remove alerts APIs except GET and DELETE (#52012)

* [Notification] unsubscribe notification UI (#52186)

* New UX for Question alerts (#51647)

---------

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-02-26 08:36:48 +01:00
Nemanja Glumac
ecb1d83170 Point all hosting-related upsells to the main Cloud upsell (#53951)
The Product decision was to point all existing upsells 
(that were previously leading to https://www.metabase.com/cloud) 
to the existing, central Cloud upsell in the app.

This makes it easier to initiate the migration directly from within the app.
2025-02-25 23:10:46 +00:00
Jeff Bruemmer
0376d71bd7 docs - sdk edits (#54311) 2025-02-25 17:19:36 -05:00
Fraser
cbc1ab534f Use CSS Modules and add border-radius to Entity Picker input (#53869) 2025-02-26 11:15:17 +13:00
Oisin Coveney
17578a74c3 fix(sdk): [EMB-154] Pivot table visualization settings tabs caused jarring width change (#54023) 2025-02-25 14:05:22 -08:00
Nick Fitzpatrick
493430dffd Adding DatePicker, Embed, Overlay and other loki tests back (#54310) 2025-02-25 17:37:50 -04:00
Uladzimir Havenchyk
3bd9329f5d refactor: rework click behavior buttons to mantine (#53769)
* rework click actions buttons to mantine

* use new button and wrap text
2025-02-25 23:09:38 +03:00
Tyler Plude
d5834ea250 Introduce attachment-row-limit and enforce download-row-limit minimum of 1048576 (#52134)
* Removing unused require

* Raising download-row-limit min to 1048576

* Removing unused require

* Raising download-row-limit min to 1048576

* Fix default to not be nil; remove useless unit test

* Change to 2**20 - 1 to account for header row

* Restore more efficient row total values in downloads row limits test

* Improve docstring for env var

* Testing if removing broken unit test fixes all of CI

* Adding new MB_ATTACHMENT_ROW_LIMIT env var; fixing unit test that dependend on old mb-row-download behavior

* Fixing nil support in min call by moving safe-min to u/safe-min and using that over clojure.core/min

* Fixing condition that tests if we're in a subscription email to include check for :pulse

* Removing default value for download-row-limit; updating limit logic; fixing test

* Fixing cljfmt

* Addressing PR feedback

* Fix circular dependency

* Fix imports for modules

* Fixing broken import

* Adding missing doc string
2025-02-25 11:39:58 -08:00
Remi Kristelijn
8c792da0d1 Enable zoom on mobile (#53830) 2025-02-25 12:05:02 -07:00
Timofey Kachalov
01bad49f5b fix(sdk): Add missing support of mapQuestionClickActions plugin for InteractiveDashboard (#54240) 2025-02-25 22:39:42 +04:00
John Swanson
07b490db9f Fix two bugs in DQ updates/creation (#54292)
- allow not specifying a `collection_id` when creating a new
card (inferring it from the `dashboard_id` instead)

- correctly check perms on the *dashboard*'s `collection_id` when moving
a card to a dashboard
2025-02-25 10:34:18 -08:00
Oisin Coveney
7c67445fbe Ensure that other popovers close when a new one is opened (#54214) 2025-02-25 10:23:20 -08:00
Jeff Bruemmer
c46fba0914 update image and add version note (#54294) 2025-02-25 13:01:53 -05:00
Jeff Bruemmer
70e81f8304 docs - sdk questions edits (#54279) 2025-02-25 13:01:41 -05:00
Nemanja Glumac
c953d31f79 Upsells follow up (#53727)
* Clean up the upsell exports

Resolves CLO-3582

* Get rid of styled components in upsells

Resolves CLO-3567

* Define urls in a single place

Resolves CLO-3566

* Tidy up the cloud upsell

* Tidy up `UpsellBanner`

* Nit: Format the sentence correctly

* Use safer approach when setting color for the `UpsellGem`
2025-02-25 18:42:34 +01:00
Sébastien
3cebfb8f19 Fixed conditional formatting for numerical primary/foreign keys (#54139)
* conditional formatting for numerical primary/foreign keys

* clearer conditionals?

* import
2025-02-25 18:39:15 +01:00
Nicolò Pretto
75b6a348d7 fix warning about missing ref on forwardref for FullWidthContainer (#54252) 2025-02-25 18:21:09 +01:00
Nicolò Pretto
af88536cef fix(sdk): add forwardRef to remove 'Function components cannot be given (#54280)
refs' console.error
2025-02-25 17:03:33 +00:00
Phoomparin Mano
837df59223 fix(sdk): deprecate the CreateQuestion component (#54212) 2025-02-26 00:00:53 +07:00
Jeff Bruemmer
4c90b40871 Update quickstart-with-sample-app.md (#54284) 2025-02-25 16:55:06 +00:00
Stas Gavrylov
6975288d2d Remove Unsubscribe link from unsaved subscription test email for non-users (#54242) 2025-02-25 16:38:27 +00:00
Ryan Laurie
fd9c44866d add some nice logging about skipping snapshots in e2e tests (#53757) 2025-02-25 16:31:55 +00:00
Alexander Polyankin
f3ff38b8da Fix a case with broken dates and timelines (#54271) 2025-02-25 16:24:21 +00:00
Nemanja Glumac
0b254b23c7 Remove unused timeline-related entries from services.js (#54188) 2025-02-25 17:04:36 +01:00
Timofey Kachalov
d60b09d348 Adjust SDK version compatibility warning color (#54260) 2025-02-25 19:58:08 +04:00
Oisin Coveney
f77ff5e492 fix(sdk): Rename saveToCollectionId to saveToCollection (#54225)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-25 22:06:30 +07:00
github-automation-metabase
6ef61ccb1a Update Readme version references and published npm version to 0.54.2-nightly (#54261) 2025-02-25 14:45:55 +00:00
Jeff Bruemmer
57c292adfd docs - display as image (#54200)
* Update table.md

* headings

* Update docs/questions/visualizations/table.md
2025-02-25 09:09:28 -05:00
Alberto Perdomo
8737e62f1a Remove beta label for SDK (#53925)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-25 14:00:11 +00:00
Jeff Bruemmer
bf5de5ca23 docs - sdk pages (#54224)
* Update JWT SSO authentication documentation

* links

* edits
2025-02-25 08:55:20 -05:00
Nicolò Pretto
76add4254f sdk debug info component (#54201)
* sdk debug info component

* remove extra BUILD_TIME

* move the component to components/public so it gets automatically wrapped in the nextjs compat layer
2025-02-25 13:44:54 +00:00
Timofey Kachalov
3a55dcde58 Always run Pivot Table queries immediately (#54195) 2025-02-25 16:30:05 +04:00
Uladzimir Havenchyk
d878b0eb25 deprecate emotion (#54177)
* deprecate emotion

* drop enterprise folder

* Update frontend/src/metabase/.eslintrc

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>

---------

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2025-02-25 15:20:51 +03:00
Phoomparin Mano
65b050eb7d feat(sdk): use new querying layout for create question flow (#53976) 2025-02-25 12:11:01 +00:00
Romeo Van Snick
a56a344ef3 Allow closing Native editor sidebar reference (#54197)
* Add reproduction for #54124

* Allow closing of sidebar
2025-02-25 10:51:50 +01:00
dpsutton
80b6e485cb fix redshift (#54232)
```clojure
upload-test=> (driver/allowed-promotions :redshift)
{}
upload-test=> (mt/transitive {})
nil
```

just have to expect the allow-list of `{}` rather than nil
2025-02-25 08:53:14 +00:00
Nathan Voxland
536b5f4fd6 Support bulk-fetching personal collection names to improve performance (#53572) 2025-02-24 16:37:13 -06:00
Riley Thompson
d1ad389d45 Gracefully handle null arrays in results (#54203) 2025-02-24 17:31:14 -05:00
Tyler Plude
e2dfb4d715 Fix static fix thai translations (#54155) 2025-02-24 18:58:26 -03:00
Tyler Plude
2536241c25 Fix static viz to respect custom formatting (#54154) 2025-02-24 13:25:53 -08:00
Riley Thompson
48c31a60af Fix mongo uuid not displaying correctly (#53564)
* Fixes the display by checking if the Mongo binary data is a UUID and converting it if so.

* Fixes the filtering by changing how we infer the base type so we can differentiate UUIDs and binData

* Fixes the existing UUID tests so that they use BSON UUIDs instead of strings.
2025-02-24 20:49:25 +00:00
Oisin Coveney
8f1578ec5c Use SELECT 1 instead of SELECT * FROM ORDERS (#54151) 2025-02-24 12:39:46 -08:00
Riley Thompson
db4c1e8f1a Destroy DB in count of grouping tests (#53700) 2025-02-24 14:38:27 -05:00
Phoomparin Mano
33a64e993f fix(sdk): improve example component import paths in cli (#53473) 2025-02-25 01:57:35 +07:00
Dan Stone
e4bd3a44a7 Take the :type of implicit action parameters from the table field, not what is saved in the database (#53914)
* Add implicit actions schema change test

* For now, we define the column set as being determined by models
  - this can break actions if new required columns are added
* Type changes however should be reflected in the derived parameters
* Drops, renames behaviour remains undefined for now

* Fix field :type change being ignored by implicit action params

* Add round trip test for implicit action params
2025-02-24 17:55:51 +00:00
John Swanson
174db1c92e Allow duplicating dashboard but not with DQs (#53766)
If you try to shallow-copy a dashboard but it has DQs, throw a 400.

(Also, when copying a dashboard, don't copy cards that are archived.)
2025-02-24 09:26:20 -08:00
Kyle Doherty
b5b19eacd5 Storybook cleanup (#53982)
* set up our own sort order, do some initial renaming

* consolidate viz stories into one folder

* Move app section specific components / patterns into app folder

* mark old components as deprecated in storybook

* group ui components under components

* add additional new components to proper folder

* move utils to components directory

* move data display to components

* move old core components into components directory w/ caveats

* move parameters stories into components

* move old segmented control to deprecated folder

* move deprecated radio to components folder

* move status components into components/feedback

* tweak order of pages

* run test-visual:loki-update

* rename colors_Default to Colors_Default

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2025-02-24 12:25:26 -05:00
Nick Fitzpatrick
e6e4ced878 Small UI fixes (#54198)
* Fixing some UI issues

* fixing query builder header icon
2025-02-24 13:23:37 -04:00
Jeff Bruemmer
05392dde3e docs - sdk quickstart (#54161) 2025-02-24 11:20:29 -05:00
Kamil Mielnik
20e70189c0 Fix - Variable type picker covered by field picker (#54184)
* Upgrade mantine to 7.17.0

* Fix #52811

* Repro #52811
2025-02-24 21:45:13 +07:00
Nick Fitzpatrick
aa501351a6 Upgrading Mantine to 7.17 (#54163) 2025-02-24 10:10:06 -04:00
Mahatthana (Kelvin) Nomsawadi
83cbb31e36 Fix summarize sidebar bucket label not visible when selected (#54176)
* Fix summarize sidebar bucket label not visible when selected

* Make binning label visible when adding a dimension
2025-02-24 14:08:35 +00:00
Nicolò Pretto
231e16b876 chore: restore no-restricted-imports rules for enterprise folder (#53436)
* chore: restore no-restricted-imports rules for the sdk

* fix imports + add eslint-ignore for when we can't

* address feedback on PR: export BadgeProps + use types we already had

* also change enterprise/frontend/.eslintrc

* add comment to explain why we copy paste them

* "name": "@storybook/testing-library" -> @storybook/test

* add eslint ignore for an import used in a utils file for stories
2025-02-24 14:13:13 +01:00
Mahatthana (Kelvin) Nomsawadi
12b56354ee Fix embedding SDK admin settings typo (#54134)
* Fix embedding SDK admin settings typo

* quickstarttttttt

* Fix unit tests
2025-02-24 12:50:06 +00:00
Nicolò Pretto
1008b43a55 ci: make the sdk e2e run on draft prs and comment non-used stub (#54137) 2025-02-24 12:26:14 +01:00
Dan Stone
2eb5285fa9 On csv upload allow column promotion from boolean to int / float (#52607)
* On csv upload allow column promotion from boolean to int / float

* Fix incorrect arglist

* Add postgres support for bool -> int, float upload migrations

* Improve compatibility with old drivers

* Rename alter-upload-columns to alter-table-columns

* Formatting, sparking joy

* Flip alter-column-using-hsql-expr arg order

* Docstring tweak alter-column-using-hsql-expr

* More symmetry with existing tests, redshift

* Add driver changelog note re `alter-table-columns!`

* Prefer ::driver over :default

* Allow drivers to specify the promo allowlist

* Prefer parser errors for redshift upload promos

* Ensure promo tests respect driver allowlist

* Make index-test/transitive available as a test util

* Add transitivity test

* Add allowlist note about transitivity requirement

* s/upload-promotion-allowlist/allowed-promotions/g

* Prefer case over condp

* Unlearn boolean/predicate habit

bikeshed: Personal style vs metabase style:
e.g I prefer flags/booleans to not have ?, reserving that only for
questions i.e predicates

* Fix alignment

* s/internal-allowed-promotions/translate-type-keywords/g

* Fix wierd comment line break

* Fix missing potemkin import
2025-02-24 11:05:29 +00:00
Denis Berezin
82768f0750 Fix new dashboard subscription button UI (#54152) 2025-02-24 12:41:45 +03:00
Uladzimir Havenchyk
4875aba153 upgrade rspack and swc (#54131) 2025-02-24 11:33:44 +03:00
Ngoc Khuat
6804aeefae Fix unit for notification send prometheus metrics (#54164) 2025-02-24 10:04:47 +02:00
Kamil Mielnik
9ae89b2b1a Fix - Card reference in a native query with a long title does not wrap (#54123)
* Fix #53171

* Repro #53171

* Handle undefined message
2025-02-24 15:04:18 +07:00
Kamil Mielnik
1e1dbb259c Remove redundant "in" in a translation string (#54122) 2025-02-24 15:02:32 +07:00
Kamil Mielnik
a9c0eb0571 Fix - Alignment in DateOffsetIntervalPicker 2025-02-24 15:02:14 +07:00
Timofey Kachalov
ec7d155054 Always set a ref in PivotTable to properly scale it (#54126) 2025-02-24 11:42:43 +04:00
Kamil Mielnik
79ab5476bc Fix - Resize handle misplaced in Notebook view (#54079)
* Fix #53817

* Fix another usage
2025-02-24 08:07:04 +01:00
Alex Yarosh
12f7f98e23 docs: caching and impersonation (#54153)
* caching impersonation

* Update docs/configuring-metabase/caching.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-21 23:08:55 +00:00
Maxime Pauvert
f0cb2d0f48 Update map.md (#54143) 2025-02-21 17:47:43 -05:00
Nemanja Glumac
bad4e01917 Empty states for collections (#54136)
Resolves CLO-3623
Resolves CLO-3638

* Replace artwork for collection empty state

* Fix the deprecated prop warning

* Update the "New" menu trigger

* Remove previous artwork

* Update the copy
2025-02-21 21:47:40 +01:00
Denis Berezin
a6f36291b6 Fix disabled Select text display (#54085) 2025-02-21 21:22:51 +03:00
Case Nelson
efcd6f3190 tech-debt: move sync.concurrent out of sync module (#54092)
Moving this fixes a circular dependency with sync and
models.database health check.
2025-02-21 09:39:44 -07:00
Nemanja Glumac
6211123deb Empty states for "It's ok" modals (#54101)
Resolves CLO-3624
* Add SVG assets

* Update the modal UI

Resolves CLO-3631
Resolves CLO-3632
Resolves CLO-3637
2025-02-21 16:35:57 +01:00
Alberto Perdomo
da12a8741d SDK - initialSqlParameters is only supported in SQL questions (#54114)
Co-authored-by: jeff bruemmer <jeff.bruemmer@gmail.com>
2025-02-21 14:46:21 +00:00
Phoomparin Mano
7ad55f5099 fix(sdk): fix visual artifacts in binning options (#53961)
* add trigger button class with visibility

* add visibility clauses

* Remove empty file

* Colocate visibility logic

So we don't have to repeat this logic on every call site

* Fix E2E tests

* Remove leftover prop type

* Passing ref since we need it for popover

* Fix the rest of the failed e2e tests

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-21 14:40:14 +00:00
Alexander Polyankin
3e8fe57187 Removes impl files (#54078) 2025-02-21 09:33:45 -05:00
Eric Normand
5cbbfeb4a8 Convert back to original type when binning by day (mysql) (#53777)
* Convert back to original type when binning by day (mysql)

* Use h2x/->datetime instead of custom one in mysql

* Interpret base-type into database-type

* Remove println

* Undo using base-type to derive database-type

* Fix mysql date binning to maintain type

* Improve postgres bucketing test

* Fix test

* Refactor for clarity

* Whitespace

* Track type info when casting unix timestamps and date strings

* Track type when casting temporal strings (psql)

* Revert changing test (fix instead)

* Add very helpful comment

* Add very helpful and useful comment
2025-02-21 17:05:54 +03:00
Uladzimir Havenchyk
5a0a238277 refactor: replace emotion with css modules (#53981)
- replace emotion components with mantine
- replace emotion styles with css modules
2025-02-21 16:54:28 +03:00
Aleksandr Lesnenko
6a95864afa fix series names overflow available space in viz settings (#54112) 2025-02-21 08:50:46 -05:00
Nicolò Pretto
ff1d319d12 devex: add user selector for the sdk storybook (#54075) 2025-02-21 13:40:19 +01:00
Timofey Kachalov
c4e499cd2a fix(sdk): Add dir attribute for PublicComponentStylesWrapper (#54082) 2025-02-21 16:24:34 +04:00
Nicolò Pretto
39bd897d09 chore: remove css import from sdk storybook (#54081) 2025-02-21 11:18:25 +01:00
Sébastien
73be8e8a83 Allowing users to show/hide values on their stacked series (#53835)
* allowing users to show/hide values on their stacked series

* fixup

* not showing the new widget when settings[graph.show_stack_values] === total
2025-02-21 10:18:36 +01:00
Sébastien
4de9c8d5fd Allow users to format their durations (#53898)
* added duration formatting

* added a test

* .
2025-02-21 10:18:10 +01:00
Timofey Kachalov
98da9ea0ee Remove the custom override of use-popover (#53969) 2025-02-21 13:14:45 +04:00
Timofey Kachalov
39c57131e6 Fix alert icon box-sizing (#52378) 2025-02-21 13:14:02 +04:00
Jeff Bruemmer
0981abbfdd docs - notes on EIDs and static embedding (#54098) 2025-02-20 15:41:19 -05:00
Cam Saul
ca614e63f1 Restore deleted hook file (#54096) 2025-02-20 19:14:04 +00:00
Alexander Polyankin
2a6318acfd Check for min arg count in expressions (#54012) 2025-02-20 13:38:17 -05:00
github-automation-metabase
02e29320bb Bump clj-kondo/clj-kondo from 2024.11.14 to 2025.02.20 (#54048)
* GH job to auto-upgrade backend deps weekly

* Run on push to this branch

* Run on this branch

* Disable reviewers

* Should open PR against master

* Exclude Kondo for now

* Try tagging backend dev with `reviewers`

* Run against `master`

* Set `master` as the base

* Add backend team as reviewers for deps.edn

* Enable auto-merge

* Fix antq config

* Use squash-merge

* Try creating PR using GH CLI

* Set commit username

* Set GH token

* Manually create branch

* Better branch name

* Checkout master before creating commit

* Set fetch-depth 0

* Leverage git stash

* Git diff

* Fix

* Unique branch name

* Push branch to origin

* Re-enable auto-merge

* Use GH Actions bot as author

* Open separate PRs for each dep bump

* Fix GH Action config

* Update Action name

* Fix script

* Final cleanup

* Bump clj-kondo/clj-kondo from 2024.11.14 to 2025.01.16

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

* Bump clj-kondo/clj-kondo from 2024.11.14 to 2025.01.16

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

* Bump Methodical & Toucan 2 for updated Kondo configs

* Update some Kondo configs

* Fix Kondo errors

---------

Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-02-20 18:33:38 +00:00
Ngoc Khuat
acddb50a3b Track notification wait time and total send time (#54080) 2025-02-21 00:18:04 +07:00
Nicolò Pretto
28b11beef3 fix: remove typo from packages we remove from the filter list (#54072) 2025-02-20 17:59:16 +01:00
Alex Yarosh
ed3430dc1a Update editor.md (#54086) 2025-02-20 11:48:34 -05:00
Case Nelson
78077ba2e0 feat: Reduce cost of initial field scanning (#53387)
* feat: Reduce cost of initial field scanning

Setting a Field `has_field_values` to `:autolist` moves from classify
based on fingerprinting to the initial Field creation only based on
semantic and base types.

Querying for field values and receiving too many values or too many
bytes will no longer delete FieldValues or change Field
`has_field_values` but rather set the `has_more_values` to true.

During sync, if a `has_field_values` is `:autolist` or `:list` but
FieldValues is nil, we will not fetch a new cache of FieldValues. This
way, the only way to cache new FieldValues would be by triggering an
adhoc request to `GET /api/field/:id/values`.

* Unmark FKs as auto-list

* Fix tests to manually activate field values for param_values

* Add search to e2e helper when filter has more

* Fix e2e tests

* Fix helper

* Fixing more tests

* Fix e2e test
2025-02-20 09:06:32 -07:00
Konstantin Darutkin
398cb39a1a test: repro tests for #32750 and #41831 (#54076) 2025-02-20 15:10:18 +00:00
Edward Paget
5b153e5b54 fix: hide sqlite from engines on cloud hosting (#53702)
* fix: hide sqlite from engines on cloud hosting

* fixup! set custom driver heirarchy
2025-02-20 08:37:49 -06:00
Alexander Polyankin
10fba041f1 [Tests] BigInteger in filters - public & embedded questions & dashboards (#53955) 2025-02-20 09:11:58 -05:00
Konstantin Darutkin
465fe5aef7 fix: WRK-70 wording (#54070)
* fix: WRK-70 wording

* fix: review issues
2025-02-20 14:07:47 +00:00
Nemanja Glumac
20bf09ffc8 Upsell Performance Tools (#53720)
* Add upsell component for performance tools

* Make `tools` a regular route

When the "audit_app" feature flag is missing, we will show the upsell.
This now applies to all non-enterprise routes, which removes the need
for the route guard.

It also greatly simplifies the tools "plugin" system.

The logic is now as follows:
1. If the feature flag is enabled, the route shows enterprise component
(erroring questions page)
2. if the feature flag is not present, the route falls back to the upsell component

* Get rid of styled components

* Center the tools upsell

* Delete test case that's not valid anymore

* Add e2e coverage
2025-02-20 14:46:27 +01:00
Sébastien
dc43e40f47 Fewer warnings in the console (#53528)
* fewer warnings in the console

* fixed test
2025-02-20 13:15:04 +01:00
Uladzimir Havenchyk
89f67a2870 drop unused styled files (#54013) 2025-02-20 12:05:54 +00:00
Timofey Kachalov
636d817e71 Fix global css reset for svg elements (#53928) 2025-02-20 11:34:38 +04:00
github-automation-metabase
6127271a89 Bump io.netty/netty-buffer from 4.1.117.Final to 4.1.118.Final (#54043)
* Bump io.netty/netty-buffer from 4.1.117.Final to 4.1.118.Final

Inspect dependency changes here:

* Fix missing newline at end of file

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-20 01:56:10 +00:00
github-automation-metabase
87b712c945 Bump com.amazonaws/aws-java-sdk-core from 1.12.780 to 1.12.782 (#54052)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-20 01:36:35 +00:00
Riley Thompson
d4304f2211 Convert java.sql.Arrays to Clojure vectors (#53551)
Implements `read-column-thunk [:sql-jdbc Types/ARRAY]` to convert `java.sql.Array`s to Clojure vectors.
2025-02-20 00:16:08 +00:00
github-automation-metabase
29678e13c7 Bump com.microsoft.sqlserver/mssql-jdbc from 12.8.1.jre11 to 12.9.0.jre11-preview (#54051)
Inspect dependency changes here:

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:35:48 +00:00
github-automation-metabase
00995815a9 Bump io.github.clojure/tools.build from 0.10.6 to 0.10.7 (#54038)
Inspect dependency changes here: https://github.com/clojure/tools.build/blob/v0.10.7/CHANGELOG.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:30:30 +00:00
github-automation-metabase
5b217313a7 Bump com.facebook.presto/presto-jdbc from 0.290 to 0.291 (#54046)
Inspect dependency changes here:

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:29:51 +00:00
github-automation-metabase
2fd421e7c1 Bump org.xerial/sqlite-jdbc from 3.48.0.0 to 3.49.1.0 (#54050)
Inspect dependency changes here: https://github.com/xerial/sqlite-jdbc/compare/3.48.0.0...3.49.1.0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:26:05 +00:00
github-automation-metabase
32d65255dd Bump io.github.tonsky/clj-reload from 0.7.1 to 0.8.0 (#54039)
Inspect dependency changes here: https://github.com/tonsky/clj-reload/blob/0.8.0/CHANGELOG.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:25:54 +00:00
Cam Saul
df62a1a7da GH job to auto-upgrade backend deps weekly (#53934) 2025-02-19 16:25:23 -07:00
github-automation-metabase
41ad985ce7 Bump com.google.cloud/google-cloud-bigquery from 2.46.0 to 2.48.0 (#54042)
Inspect dependency changes here: https://github.com/googleapis/java-bigquery/blob/v2.48.0/CHANGELOG.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:19:15 +00:00
github-automation-metabase
9ec45e2325 Bump com.oracle.database.jdbc/ojdbc17 from 23.6.0.24.10 to 23.7.0.25.01 (#54045)
Inspect dependency changes here:

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:18:58 +00:00
github-automation-metabase
50bbfc20da Bump lambdaisland/deep-diff2 from 2.11.216 to 2.12.219 (#54040)
Inspect dependency changes here: https://github.com/lambdaisland/deep-diff2/blob/v2.12.219/CHANGELOG.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:15:31 +00:00
github-automation-metabase
0e0b8187aa Bump com.clojure-goes-fast/clj-async-profiler from 1.6.0 to 1.6.1 (#54034)
Inspect dependency changes here: https://github.com/clojure-goes-fast/clj-async-profiler/blob/1.6.1/CHANGELOG.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:11:59 +00:00
github-automation-metabase
f61ca1f637 Bump com.amazonaws/aws-java-sdk-core from 1.12.780 to 1.12.781 (#54049)
Inspect dependency changes here:

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 15:06:57 -08:00
github-automation-metabase
f54ef358e8 Bump io.netty/netty-common from 4.1.117.Final to 4.1.118.Final (#54044)
Inspect dependency changes here:

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 15:04:47 -08:00
github-automation-metabase
54a3958e83 Bump org.apache.tika/tika-core from 3.0.0 to 3.1.0 (#54041)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-02-19 15:03:38 -08:00
github-automation-metabase
37bccd57f0 Bump com.clojure-goes-fast/clj-memory-meter from 0.3.0 to 0.4.0 (#54035)
Inspect dependency changes here: https://github.com/clojure-goes-fast/clj-memory-meter/blob/0.4.0/CHANGELOG.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 15:02:37 -08:00
github-automation-metabase
ef6f8a3445 Bump com.github.seancorfield/next.jdbc from 1.3.981 to 1.3.994 (#54036)
Inspect dependency changes here: https://github.com/seancorfield/next-jdbc/blob/v1.3.994/CHANGELOG.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 15:02:13 -08:00
Noah Moss
220d92c651 Ensure CLJS/CLJC files get translations included in the FE bundle (#53984)
* Ensure CLJS/CLJC files get translated included in the FE bundle

* Fix backend test

* clean ns

* add e2e test

* Fix another e2e test
2025-02-19 14:14:02 -05:00
Filip Hric
6b58f641bc tag test as flaky (#53980) 2025-02-19 19:47:58 +01:00
Alexander Solovyov
02b7effe1a update athena driver to 3.4.0 (#53979) 2025-02-19 19:28:17 +01:00
Nemanja Glumac
a92d113b3e Fix "Migrating to Metabase Cloud" for local dev instances (#53971) 2025-02-19 19:15:36 +01:00
Chris Truter
59974f065a Helper to simplify retrying jobs on failure (#53960) 2025-02-19 16:55:51 +00:00
Noah Moss
07591c1787 Add back discarding-rff for preemptive caching, and expand backend and e2e test coverage (#53639)
* WIP: e2e querying test for preemptive caching

* WIP restructure BE tests for better coverage

* Misc cleanup

* revert some unneeded changes

* Fix tests

* Revert some typo fixes to avoid polluting this PR

* Refactor cypress test

* Try again to fix Cypress test in CI

* Address feedback

* fix tests

* fix tests again
2025-02-19 10:41:14 -05:00
Konstantin Darutkin
524658912e fix: WRK-67 new action modal is too hard to close (#53905)
* fix: the-new-action-modal-is-too-hard-to-close

* refactor: do not use absolute positioning

* test: add tests for click outside

* fix: review issues
2025-02-19 15:35:50 +00:00
Kamil Mielnik
eecde2f2a2 Fix - Redundant GET /api/action request when viewing non-model object details (#53032)
* Fix #50266

* Add a boolean cast

* Add repro for #50266

* Improve test name

* Add RTK Query API middleware to storybook store

* Add the effect cleanup

* Fix "Promise was collected" error

* Fix other hooks

* Add missing RTK Query middleware in storybook

* Fix "Promise was collected" error

* Clean up the effect

* Fix tests

* Fix storybook setup correctly
2025-02-19 22:08:26 +07:00
Kamil Mielnik
0b7a11ef8c Fix "Promise was collected" error in visual tests (#53889)
* Add missing RTK Query middleware in storybook

* Fix "Promise was collected" error
2025-02-19 12:43:47 +00:00
Phoomparin Mano
8423d6382a fix(sdk): hide "New Question" in EditableDashboard sidebar (#53908) 2025-02-19 18:23:56 +07:00
Alexander Polyankin
96ee8b4181 Support BigInteger in filter display names (#53916) 2025-02-18 21:13:01 -05:00
8280 changed files with 1300593 additions and 1526813 deletions

View File

@@ -0,0 +1 @@
Fix flakey test $ARGUMENTS

View File

@@ -0,0 +1 @@
Fix issue $ARGUMENTS

View File

@@ -0,0 +1 @@
Fetch unresolved comments for this branch's PR, then fix them

View File

@@ -0,0 +1 @@
Repro issue $ARGUMENTS in a failing test

View File

@@ -11,6 +11,7 @@
:def-fn {:level :warning}
:dynamic-var-not-earmuffed {:level :warning}
:equals-expected-position {:level :warning, :only-in-test-assertion true}
:equals-true {:level :warning}
:keyword-binding {:level :warning}
:main-without-gen-class {:level :warning}
:minus-one {:level :warning}
@@ -42,7 +43,6 @@
#_:docstring-leading-trailing-whitespace
#_:equals-false
#_:equals-true
#_:used-underscored-binding
;;
@@ -58,9 +58,11 @@
: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}
@@ -91,7 +93,6 @@
metabase.test.data.users/with-group-for-user
metabase.test.data/with-empty-h2-app-db
metabase.test.util.log/with-log-level
metabase.test.util.misc/with-single-admin-user
metabase.test.util/with-all-users-permission
metabase.test.util/with-discarded-collections-perms-changes
metabase.test.util/with-env-keys-renamed-by
@@ -123,7 +124,6 @@
metabase.test/with-model-cleanup
metabase.test/with-non-admin-groups-no-root-collection-for-namespace-perms
metabase.test/with-non-admin-groups-no-root-collection-perms
metabase.test/with-single-admin-user
metabase.test/with-temp-env-var-value
metabase.test/with-temp-vals-in-db
metabase.test/with-temporary-raw-setting-values
@@ -167,7 +167,7 @@
clojure.core.async/to-chan!!
metabase.channel.core/send!
metabase.driver.sql-jdbc.execute/execute-prepared-statement!
metabase.models.notification/create-notification!
metabase.notification.models/create-notification!
metabase.pulse.send/send-pulse!
metabase.query-processor.store/store-database!
;; Safe in tests, where we typically use a private, temporary index per thread.
@@ -190,6 +190,7 @@
;; module drivers
:athena
:bigquery-cloud-sdk
:clickhouse
:databricks
:druid
:druid-jdbc
@@ -203,6 +204,7 @@
:sparksql
:sqlite
:sqlserver
:starburst
:vertica}}
;;
@@ -240,20 +242,14 @@
:deprecated-var
{:exclude
{metabase.cmd/dump {:namespaces ["metabase\\.cmd-test" "metabase-enterprise\\.serialization\\.cmd-test"]}
metabase.cmd/load {:namespaces ["metabase\\.cmd-test" "metabase-enterprise\\.serialization\\.cmd-test"]}
metabase.db.data-migrations/data-migrations {:namespaces ["metabase\\.db\\.data-migrations"]}
metabase.db.data-migrations/defmigration {:namespaces ["metabase\\.db\\.data-migrations"]}
metabase.db.data-migrations/run-migration-if-needed! {:namespaces ["metabase\\.db\\.data-migrations"]}
{metabase.cmd.core/dump {:namespaces ["metabase\\.cmd-test" "metabase-enterprise\\.serialization\\.cmd-test"]}
metabase.cmd.core/load {:namespaces ["metabase\\.cmd-test" "metabase-enterprise\\.serialization\\.cmd-test"]}
metabase.driver.sql-jdbc.execute.old-impl/set-timezone-sql {:namespaces ["metabase\\.driver.*"]}
metabase.driver.sql-jdbc.execute/set-time-zone-if-supported! {:namespaces ["metabase\\.driver.*"]}
metabase.driver/current-db-time {:namespaces ["metabase.*"]}
metabase.driver/supports? {:namespaces ["metabase.*"]}
metabase.premium-features.premium-features/enable-enhancements? {:namespaces ["metabase\\.models.*"]}
metabase.query-processor.middleware.resolve-joins/maybe-resolve-source-table {:namespaces ["metabase.*"]}
metabase.query-processor.util/normalize-token {:namespaces ["metabase.*"]}
schema.core/both {:namespaces ["metabase.*"]}
schema.core/either {:namespaces ["metabase.*"]}}}
metabase.query-processor.util/normalize-token {:namespaces ["metabase.*"]}}}
:discouraged-var
{clojure.core/print {:message "Use metabase.util.log instead of clojure.core/print"}
@@ -273,6 +269,7 @@
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"}
compojure.core/defroutes {:message "Use metabase.api.util.handlers/defroutes instead of compojure.core/routes, it supports OpenAPI spec generation."}
compojure.core/routes {:message "Use metabase.api.util.handlers/routes instead of compojure.core/routes, it supports OpenAPI spec generation."}
clojurewerkz.quartzite.jobs/defjob {:message "Use metabase.task/defjob instead of clojurewerkz.quartzite.jobs/defjob"}
fipp.edn/pprint {:message "Use metabase.util.log instead of fipp.edn/pprint"}
honeysql.core/call {:message "Use hx/call instead because it is Honey SQL 2 friendly"}
honeysql.core/raw {:message "Use hx/raw instead because it is Honey SQL 2 friendly"}
@@ -285,7 +282,8 @@
me.flowthing.pp/pprint {:message "Use metabase.util.log instead of me.flowthing.pp/pprint"}
medley.core/random-uuid {:message "Use clojure.core/random-uuid instead of medley.core/random-uuid"}
metabase.driver/database-supports? {:message "Use metabase.driver.util/supports? instead of metabase.driver/database-supports?"}
metabase.lib.equality/find-column-indexes-for-refs {:message "Use lib.equality/closest-matches-in-metadata or lib.equality/find-closest-matches-for-refs instead of lib.equality/find-column-indexes-for-refs"}}
metabase.lib.equality/find-column-indexes-for-refs {:message "Use lib.equality/closest-matches-in-metadata or lib.equality/find-closest-matches-for-refs instead of lib.equality/find-column-indexes-for-refs"}
next.jdbc/active-tx? {:message "Use metabase.app-db.core/in-transaction? to see if we are in a transaction"}}
:discouraged-namespace
{camel-snake-kebab.core {:message "CSK is not Turkish-safe, use the versions in metabase.util instead."}
@@ -298,222 +296,97 @@
honeysql.types {:message "Use Honey SQL 2. Honey SQL 1 is removed as a dependency in Metabase 49+."}
honeysql.util {:message "Use Honey SQL 2. Honey SQL 1 is removed as a dependency in Metabase 49+."}}
:discouraged-tag {p {:message "You can use it, but don't commit it."}}
:unresolved-var
{:exclude
[colorize.core]}
:consistent-alias
{:aliases
{buddy.core.hash buddy-hash
cheshire.generate json.generate
clojure.tools.logging log
clj-http.client http
clj-ldap.client ldap
clj-time.coerce time.coerce
clj-time.format time.format
clojure.core.async a
clojure.core.match clojure.core.match ; Prefer :refer [match]
clojure.data data
clojure.math.combinatorics math.combo
clojure.pprint pprint
clojure.spec.alpha s
clojure.string str
clojure.test t
clojure.tools.build.api b
clojure.tools.namespace.dependency ns.deps
clojure.tools.namespace.find ns.find
clojure.tools.namespace.parse ns.parse
colorize.core colorize
environ.core env
hiccup.core hiccup
hiccup.util hiccup.util
honey.sql sql
honey.sql.helpers sql.helpers
java-time.api t
macaw.core macaw
malli.core mc
malli.error me
malli.experimental mx
malli.generator mg
malli.provider mp
malli.transform mtx
malli.util mut
medley.core m
metabase-enterprise.audit-app.pages.common common
metabase-enterprise.sandbox.api.table table
metabase-enterprise.sandbox.api.util sandbox.api.util
metabase-enterprise.test met
metabase.analytics.sdk sdk
metabase.analytics.stats stats
metabase.analysis.native-query-analyzer nqa
metabase.analysis.native-query-analyzer.parameter-substitution nqa.sub
metabase.analyze.query-results qr
metabase.analyze.classifiers.category classifiers.category
metabase.analyze.classifiers.core classifiers
metabase.analyze.classifiers.name classifiers.name
metabase.analyze.classifiers.no-preview-display classifiers.no-preview-display
metabase.analyze.classifiers.text-fingerprint classifiers.text-fingerprint
metabase.analyze.fingerprint.fingerprinters fingerprinters
metabase.analyze.fingerprint.insights insights
metabase.analyze.fingerprint.schema fingerprint.schema
metabase.api.common api
metabase.channel.core channel
metabase.channel.render.core channel.render
metabase.cloud-migration.core cloud-migration
metabase.cmd.copy.h2 copy.h2
metabase.config config
metabase.config.file config.file
metabase.connection-pool connection-pool
metabase.db.connection mdb.connection
metabase.db.jdbc-protocols mdb.jdbc-protocols
metabase.db.metadata-queries metadata-queries
metabase.db.spec mdb.spec
metabase.db.query mdb.query
metabase.driver.common.parameters params
metabase.driver.common.parameters.dates params.dates
metabase.driver.common.parameters.operators params.ops
metabase.driver.common.parameters.parse params.parse
metabase.driver.common.parameters.values params.values
metabase.driver.druid.client druid.client
metabase.driver.druid.execute druid.execute
metabase.driver.druid.js druid.js
metabase.driver.druid.query-processor druid.qp
metabase.driver.druid.sync druid.sync
metabase.driver.impl driver.impl
metabase.driver.mongo.execute mongo.execute
metabase.driver.mongo.parameters mongo.params
metabase.driver.mongo.query-processor mongo.qp
metabase.driver.mongo.util mongo.util
metabase.driver.sql driver.sql
metabase.driver.sql-jdbc.common sql-jdbc.common
metabase.driver.sql-jdbc.connection sql-jdbc.conn
metabase.driver.sql-jdbc.execute sql-jdbc.execute
metabase.driver.sql-jdbc.execute.diagnostic sql-jdbc.execute.diagnostic
metabase.driver.sql-jdbc.execute.legacy-impl sql-jdbc.legacy
metabase.driver.sql-jdbc.execute.old-impl sql-jdbc.execute.old
metabase.driver.sql-jdbc.sync sql-jdbc.sync
metabase.driver.sql-jdbc.sync.common sql-jdbc.sync.common
metabase.driver.sql-jdbc.sync.describe-database sql-jdbc.describe-database
metabase.driver.sql-jdbc.sync.describe-table sql-jdbc.describe-table
metabase.driver.sql-jdbc.sync.interface sql-jdbc.sync.interface
metabase.driver.sql-jdbc.test-util sql-jdbc.tu
metabase.driver.sql.parameters.substitute sql.params.substitute
metabase.driver.sql.parameters.substitution sql.params.substitution
metabase.eid-translation eid-translation
metabase.formatter formatter
metabase.http-client client
metabase.legacy-mbql.normalize mbql.normalize
metabase.legacy-mbql.schema mbql.s
metabase.legacy-mbql.util mbql.u
metabase.lib.util lib.util
metabase.lib.util.match lib.util.match
metabase.login-history.core login-history
metabase.model-persistence.core model-persistence
metabase.models.dependency dependency
metabase.models.interface mi
metabase.models.setting setting
metabase.notification.core notification
metabase.notification.test-util notification.tu
metabase.permissions.core perms
metabase.plugins.initialize plugins.init
metabase.public-settings public-settings
metabase.public-sharing.core public-sharing
metabase.premium-features.core premium-features
metabase.pulse.core pulse
metabase.pulse.render render
metabase.pulse.render.body body
metabase.pulse.render.style style
metabase.pulse.test-util pulse.test-util
metabase.pulse.parameters pulse-params
metabase.query-processor-test qp.test
metabase.query-processor.context qp.context
metabase.query-processor.error-type qp.error-type
metabase.query-processor.interface qp.i
metabase.query-processor.middleware.add-dimension-projections qp.add-dimension-projections
metabase.query-processor.middleware.add-implicit-clauses qp.add-implicit-clauses
metabase.query-processor.middleware.add-implicit-joins qp.add-implicit-joins
metabase.query-processor.middleware.auto-bucket-datetimes qp.auto-bucket-datetimes
metabase.query-processor.middleware.constraints qp.constraints
metabase.query-processor.middleware.cumulative-aggregations qp.cumulative-aggregations
metabase.query-processor.middleware.parameters.mbql qp.mbql
metabase.query-processor.middleware.parameters.native qp.native
metabase.query-processor.middleware.permissions qp.perms
metabase.query-processor.middleware.pre-alias-aggregations qp.pre-alias-aggregations
metabase.query-processor.middleware.resolve-fields qp.resolve-fields
metabase.query-processor.middleware.resolve-referenced qp.resolve-referenced
metabase.query-processor.middleware.resolve-source-table qp.resolve-source-table
metabase.query-processor.middleware.wrap-value-literals qp.wrap-value-literals
metabase.query-processor.pivot qp.pivot
metabase.query-processor.streaming qp.streaming
metabase.query-processor.streaming.interface qp.si
metabase.query-processor.streaming.xlsx qp.xlsx
metabase.query-processor.timezone qp.timezone
metabase.query-processor.util qp.util
metabase.request.core request
metabase.revisions.core revisions
metabase.search.config search.config
metabase.search.filter search.filter
metabase.search.in-place.filter search.in-place.filter
metabase.search.in-place.util search.util
metabase.search.in-place.scoring scoring
metabase.server.core server
metabase.server.protocols server.protocols
metabase.sso.core sso
metabase.sync.analyze.fingerprint sync.fingerprint
metabase.sync.field-values sync.field-values
metabase.sync.interface i
metabase.sync.schedules sync.schedules
metabase.sync.sync-metadata.fields.our-metadata fields.our-metadata
metabase.sync.util sync-util
metabase.sync.util-test sync.util-test
metabase.test mt
metabase.test.data.dataset-definitions defs
metabase.test.data.env.impl tx.env.impl
metabase.test.data.impl data.impl
metabase.test.data.users test.users
metabase.test.domain-entities test.de
metabase.test.mock.util mock.util
metabase.test.sync test.sync
metabase.test.redefs test.redefs
metabase.test.util.js test.js
metabase.test.util.timezone test.tz
metabase.timeline.core timeline
metabase.timeseries-query-processor-test.util tqpt
metabase.util.cron u.cron
metabase.util.currency currency
metabase.util.date-2 u.date
metabase.util.date-2.common u.date.common
metabase.util.date-2.parse u.date.parse
metabase.util.embed embed
metabase.util.encryption encryption
metabase.util.encryption-test encryption-test
metabase.util.files u.files
metabase.util.grouper grouper
metabase.util.honey-sql-2 h2x
metabase.util.i18n i18n
metabase.util.i18n.impl i18n.impl
metabase.util.jvm u.jvm
metabase.util.log log
metabase.util.macros u.macros
metabase.util.malli mu
metabase.util.malli.schema ms
metabase.util.markdown markdown
metabase.util.password u.password
metabase.util.schema su
metabase.util.ui-logic ui-logic
metabase.util.urls urls
metabase.xrays.core xrays
metabuild-common.core u
metabuild-common.output out
metabuild-common.shell shell
monger.collection mcoll
ring.mock.request ring.mock
ring.util.codec codec
ring.util.response response
ring.adapter.jetty9.servlet servlet
saml20-clj.core saml
toucan.db db
toucan.models models}}}
{buddy.core.hash buddy-hash
cheshire.generate json.generate
clj-http.client http
clj-ldap.client ldap
clj-time.coerce time.coerce
clj-time.format time.format
clojure.core.async a
clojure.core.match clojure.core.match
clojure.data data
clojure.math.combinatorics math.combo
clojure.pprint pprint
clojure.spec.alpha s
clojure.string str
clojure.test t
clojure.tools.build.api b
clojure.tools.logging log
clojure.tools.namespace.dependency ns.deps
clojure.tools.namespace.find ns.find
clojure.tools.namespace.parse ns.parse
colorize.core colorize
environ.core env
hiccup.core hiccup
hiccup.util hiccup.util
honey.sql sql
honey.sql.helpers sql.helpers
java-time.api t
macaw.core macaw
malli.core mc
malli.error me
malli.experimental mx
malli.generator mg
malli.provider mp
malli.transform mtx
malli.util mut
medley.core m
metabase-enterprise.database-routing.core database-routing
metabase.analyze.classifiers.core classifiers
metabase.channel.core channel
metabase.channel.render.core channel.render
metabase.cloud-migration.core cloud-migration
metabase.eid-translation.core eid-translation
metabase.login-history.core login-history
metabase.model-persistence.core model-persistence
metabase.notification.core notification
metabase.notification.payload.core notification.payload
metabase.permissions.core perms
metabase.premium-features.core premium-features
metabase.public-sharing.core public-sharing
metabase.pulse.core pulse
metabase.request.core request
metabase.revisions.core revisions
metabase.server.core server
metabase.settings.core setting
metabase.sso.core sso
metabase.timeline.core timeline
metabase.util.cron u.cron
metabase.util.currency currency
metabase.util.date-2 u.date
metabase.util.date-2.common u.date.common
metabase.util.date-2.parse u.date.parse
metabase.util.embed embed
metabase.util.encryption encryption
metabase.util.encryption-test encryption-test
metabase.util.files u.files
metabase.util.grouper grouper
metabase.util.honey-sql-2 h2x
metabase.util.i18n i18n
metabase.util.i18n.impl i18n.impl
metabase.util.jvm u.jvm
metabase.util.log log
metabase.util.macros u.macros
metabase.util.malli mu
metabase.util.malli.schema ms
metabase.util.markdown markdown
metabase.util.password u.password
metabase.util.ui-logic ui-logic
metabase.xrays.core xrays
monger.collection mcoll
ring.mock.request ring.mock
ring.util.codec codec
ring.util.response response
saml20-clj.core saml
toucan2.core t2}}}
:lint-as
{cljs.cache/defcache clojure.core/deftype
@@ -526,26 +399,30 @@
metabase-enterprise.serialization.test-util/with-random-dump-dir 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
metabase.app-db.custom-migrations/define-migration clj-kondo.lint-as/def-catch-all
metabase.app-db.custom-migrations/define-reversible-migration clj-kondo.lint-as/def-catch-all
metabase.app-db.liquibase/with-liquibase clojure.core/let
metabase.app-db.schema-migrations-test.impl/with-temp-empty-app-db clojure.core/let
metabase.channel.impl.http-test/with-captured-http-requests clojure.core/fn
metabase.channel.impl.http-test/with-server clojure.core/let
metabase.dashboard-subscription-test/with-dashboard-sub-for-card clojure.core/let
metabase.db.custom-migrations/define-migration clj-kondo.lint-as/def-catch-all
metabase.db.custom-migrations/define-reversible-migration clj-kondo.lint-as/def-catch-all
metabase.db.data-migrations/defmigration clojure.core/def
metabase.db.liquibase/with-liquibase clojure.core/let
metabase.db.schema-migrations-test.impl/with-temp-empty-app-db clojure.core/let
metabase.collections.models.collection-test/with-collection-in-location clojure.core/let
metabase.driver.mongo.connection/with-mongo-client clojure.core/let
metabase.driver.mongo.connection/with-mongo-database clojure.core/let
metabase.driver.mongo.query-processor/mongo-let clojure.core/let
metabase.driver.sql-jdbc.actions/with-jdbc-transaction clojure.core/let
metabase.driver.sql-jdbc.connection.ssh-tunnel/with-ssh-tunnel clojure.core/let
metabase.driver.sql-jdbc.connection/with-connection-spec-for-testing-connection clojure.core/let
metabase.driver.sql-jdbc.execute.diagnostic/capturing-diagnostic-info clojure.core/fn
metabase.models.collection-test/with-collection-in-location clojure.core/let
metabase.models.json-migration/def-json-migration clj-kondo.lint-as/def-catch-all
metabase.models.setting/defsetting clj-kondo.lint-as/def-catch-all
metabase.models.util.spec-update/define-spec clojure.core/def
metabase.notification.test-util/with-card-notification clojure.core/let
metabase.notification.test-util/with-system-event-notification! clojure.core/let
metabase.notification.test-util/with-temp-notification clojure.core/let
metabase.premium-features.core/defenterprise-schema clj-kondo.lint-as/def-catch-all
metabase.premium-features.core/define-premium-feature clojure.core/def
metabase.premium-features.defenterprise/defenterprise-schema clj-kondo.lint-as/def-catch-all
metabase.premium-features.settings/define-premium-feature clojure.core/def
metabase.pulse.dashboard-subscription-test/with-dashboard-sub-for-card clojure.core/let
metabase.pulse.send-test/with-pulse-for-card clojure.core/let
metabase.query-processor-test.pipeline-queries-test/pmbql-query clojure.core/->
metabase.query-processor-test.pipeline-queries-test/run-pmbql-query clojure.core/->
@@ -554,22 +431,31 @@
metabase.query-processor.middleware.process-userland-query-test/with-query-execution! clojure.core/let
metabase.query-processor.setup/with-qp-setup clojure.core/let
metabase.search.api-test/do-test-users clojure.core/let
metabase.settings.core/define-multi-setting clojure.core/def
metabase.settings.core/defsetting clj-kondo.lint-as/def-catch-all
metabase.settings.models.setting.multi-setting/define-multi-setting clojure.core/def
metabase.settings.models.setting/defsetting clj-kondo.lint-as/def-catch-all
metabase.sso.ldap/with-ldap-connection clojure.core/fn
metabase.sync.util/sum-for clojure.core/for
metabase.sync.util/with-emoji-progress-bar clojure.core/let
metabase.task.core/defjob clojure.core/defn
metabase.task.impl/defjob clojure.core/defn
metabase.test.data.interface/defdataset clojure.core/def
metabase.test.data.interface/defdataset-edn clojure.core/def
metabase.test.gentest/defgentest clojure.test/deftest
metabase.test/defdataset clojure.core/def
metabase.test/let-url clojure.core/let
metabase.test/with-actions clojure.core/let
metabase.test/with-grouper-batches! clojure.core/fn
metabase.test/with-open-channels clojure.core/let
metabase.test/with-single-admin-user clojure.core/fn
metabase.test/with-single-admin-user! clojure.core/fn
metabase.test/with-temp-dir clojure.core/let
metabase.test/with-temp-empty-app-db clojure.core/let
metabase.test/with-temp-file clojure.core/let
metabase.test/with-user-in-groups clojure.core/let
metabase.upload.impl-test/with-upload-table! clojure.core/let
metabase.upload-test/with-upload-table! clojure.core/let
metabase.util/for-map clojure.core/for
metabase.util/with-timer-ms clojure.core/fn
metabase.util.files/with-open-path-to-resource clojure.core/let
metabase.util.malli.defn/defn schema.core/defn
@@ -580,7 +466,6 @@
metabase.util.malli/defn- schema.core/defn
metabase.util.malli/fn schema.core/fn
metabase.util.namespaces/import-fns potemkin/import-vars
metabase.util.ssh/with-ssh-tunnel clojure.core/let
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
@@ -611,26 +496,28 @@
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.serialization.test-util/with-temp-dpc hooks.toucan2.tools.with-temp/with-temp
metabase.api.card-test/with-card-param-values-fixtures hooks.common/let-one-with-optional-value
metabase.api.card-test/with-temp-native-card! hooks.common/with-two-bindings
metabase.api.card-test/with-temp-native-card-with-params! hooks.common/with-two-bindings
metabase.api.collection-test/with-french-user-and-personal-collection! hooks.common/with-two-top-level-bindings
metabase.api.common.internal-test/with-jetty-server hooks.common/with-one-binding
metabase.api.dashboard-test/with-chain-filter-fixtures hooks.common/let-one-with-optional-value
metabase.api.dashboard-test/with-simple-dashboard-with-tabs hooks.common/with-one-binding
metabase.api.embed-test/do-response-formats hooks.common/with-two-bindings
metabase.api.embed-test/with-chain-filter-fixtures! hooks.common/let-one-with-optional-value
metabase.api.embed-test/with-temp-card hooks.common/let-one-with-optional-value
metabase.api.embed-test/with-temp-dashcard hooks.common/let-one-with-optional-value
metabase.api.macros/defendpoint hooks.metabase.api.macros/defendpoint
metabase.api.user-test/with-temp-user-email! hooks.common/with-one-binding
metabase.app-db.schema-migrations-test.impl/test-migrations hooks.metabase.app-db.schema-migrations-test.impl/test-migrations
metabase.channel.render.js.svg/with-static-viz-context hooks.common/with-one-top-level-binding
metabase.channel.template.handlebars-helper/defhelper hooks.metabase.channel.template.handlebars-helper/defhelper
metabase.channel.template.handlebars-test/with-temp-template! hooks.common/with-vec-first-binding
metabase.dashboard-subscription-test/with-link-card-fixture-for-dashboard hooks.common/let-second
metabase.db.schema-migrations-test.impl/test-migrations hooks.metabase.db.schema-migrations-test.impl/test-migrations
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.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.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
metabase.driver.oracle-test/with-temp-user hooks.common/let-one-with-optional-value
metabase.driver/register! hooks.metabase.driver/register!
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.legacy-mbql.schema.macros/defclause hooks.metabase.legacy-mbql.schemas.macros/defclause
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
@@ -641,18 +528,10 @@
metabase.model-persistence.api-test/with-persistence-setup! hooks.common/with-one-top-level-binding
metabase.model-persistence.api-test/with-setup! hooks.common/with-one-top-level-binding
metabase.model-persistence.test-util/with-persistence-enabled! hooks.metabase.model-persistence.test-util/with-persistence-enabled!
metabase.models.collection-test/with-collection-hierarchy! hooks.common/let-one-with-optional-value
metabase.models.collection-test/with-personal-and-impersonal-collections hooks.common/with-two-bindings
metabase.models.dashboard-tab-test/with-dashtab-in-personal-collection hooks.common/with-one-top-level-binding
metabase.models.dashboard-test/with-dash-in-collection! hooks.common/with-three-bindings
metabase.models.interface/define-batched-hydration-method hooks.metabase.models.interface/define-hydration-method
metabase.models.interface/define-simple-hydration-method hooks.metabase.models.interface/define-hydration-method
metabase.models.setting.multi-setting/define-multi-setting hooks.metabase.models.setting/define-multi-setting
metabase.models.setting.multi-setting/define-multi-setting-impl hooks.metabase.models.setting/define-multi-setting-impl
metabase.models.setting/defsetting hooks.metabase.models.setting/defsetting
metabase.permissions.core/allow-changing-all-users-group-members hooks.common/do*
metabase.permissions.core/disable-perms-cache hooks.common/do*
metabase.plugins.classloader/require hooks.clojure.core.require/lint-require
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
@@ -660,19 +539,29 @@
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.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.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
metabase.request.core/with-current-request hooks.common/with-used-first-arg
metabase.request.core/with-current-user hooks.common/with-used-first-arg
metabase.request.core/with-limit-and-offset hooks.common/with-used-first-two-args
metabase.sample-data-test/with-temp-sample-database-db hooks.common/with-one-binding
metabase.sample-data.impl-test/with-temp-sample-database-db hooks.common/with-one-binding
metabase.search.api-test/with-search-items-in-collection hooks.metabase.search.api-test/with-search-items-in-collection
metabase.search.api-test/with-search-items-in-root-collection hooks.common/do*
metabase.server.streaming-response-test/with-start-execution-chan hooks.common/with-one-binding
metabase.settings.core/define-multi-setting hooks.metabase.settings.models.setting/define-multi-setting
metabase.settings.core/define-multi-setting-impl hooks.metabase.settings.models.setting/define-multi-setting-impl
metabase.settings.core/defsetting hooks.metabase.settings.models.setting/defsetting
metabase.settings.models.setting.multi-setting/define-multi-setting hooks.metabase.settings.models.setting/define-multi-setting
metabase.settings.models.setting.multi-setting/define-multi-setting-impl hooks.metabase.settings.models.setting/define-multi-setting-impl
metabase.settings.models.setting/defsetting hooks.metabase.settings.models.setting/defsetting
metabase.stale-test/with-stale-items hooks.toucan2.tools.with-temp/with-temp
metabase.test.data.datasets/test-driver hooks.metabase.test.data.datasets/test-driver
metabase.test.data.datasets/test-drivers hooks.metabase.test.data.datasets/test-drivers
@@ -681,8 +570,9 @@
metabase.test.data/dataset hooks.metabase.test.data/dataset
metabase.test.data/mbql-query hooks.metabase.test.data/mbql-query
metabase.test.data/run-mbql-query hooks.metabase.test.data/mbql-query
metabase.test.gentest/with-gentest hooks.metabase.test.gentest/with-gentest
metabase.test.gentest/iterate hooks.metabase.test.gentest/iterate*
metabase.test.util.async/with-open-channels hooks.common/let-with-optional-value-for-last-binding
metabase.test.util.generators.jvm/with-random-cards hooks.metabase.test.util.generators.jvm/with-random-cards
metabase.test.util.log/with-log-level hooks.common/with-ignored-first-arg
metabase.test.util/discard-setting-changes hooks.common/with-ignored-first-arg
metabase.test.util/with-column-remappings hooks.common/with-ignored-first-arg
@@ -704,10 +594,15 @@
metabase.test/with-log-messages-for-level hooks.metabase.util.log.capture/with-log-messages-for-level
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-temp hooks.toucan2.tools.with-temp/with-temp
metabase.test/with-temp-file hooks.metabase.test.util/with-temp-file
metabase.test/with-prometheus-system! hooks.common/with-two-bindings
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.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
metabase.util.i18n/tru hooks.metabase.util.i18n/tru
metabase.util.log.capture/with-log-messages-for-level hooks.metabase.util.log.capture/with-log-messages-for-level
metabase.util.log/debug hooks.metabase.util.log/info
metabase.util.log/debugf hooks.metabase.util.log/infof
@@ -727,41 +622,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.cron/schedule macros.quartz/schedule
clojurewerkz.quartzite.schedule.simple/schedule macros.quartz/simple-schedule
clojurewerkz.quartzite.triggers/build macros.quartz/build-trigger
metabase-enterprise.advanced-permissions.api.util-test/with-impersonations! macros.metabase-enterprise.advanced-permissions.api.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.api.card-test/with-ordered-items macros.metabase.api.card-test/with-ordered-items
metabase.api.collection-test/with-collection-hierarchy! macros.metabase.api.collection-test/with-collection-hierarchy!
metabase.api.collection-test/with-some-children-of-collection! macros.metabase.api.collection-test/with-some-children-of-collection!
metabase.api.embed-test/with-embedding-enabled-and-temp-card-referencing! macros.metabase.api.embed-test/with-embedding-enabled-and-temp-card-referencing!
metabase.api.embed-test/with-embedding-enabled-and-temp-dashcard-referencing! macros.metabase.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.models.params.chain-filter-test/chain-filter macros.metabase.models.params.chain-filter-test/chain-filter
metabase.models.params.chain-filter-test/chain-filter-search macros.metabase.models.params.chain-filter-test/chain-filter
metabase.models.query-analysis-test/with-test-setup macros.metabase.models.query-analysis-test/with-test-setup
metabase.models.user-test/with-groups macros.metabase.models.user-test/with-groups
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.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.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.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.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}}
:config-in-comment
{:linters {:unresolved-symbol {:level :off}}}
@@ -782,9 +679,9 @@
:name test-namespaces}
{:pattern "^(?!.*-test(?:\\..*)?$)(?!.*test-util)(?!^metabase\\.test.*).*$"
:name source-namespaces}
{:pattern "(?:(?:^metabase\\.cmd.*)|(?:^build.*)|(?:^metabuild-common.*)|(?:^release.*)|(?:^i18n.*)|(?:^lint-migrations-file$))"
{:pattern "(?:(?:^metabase\\.cmd.*)|(?:^build.*)|(?:^metabuild-common.*)|(?:^release.*)|(?:^i18n.*)|(?:^lint-migrations-file$))|(?:^mage.*)"
:name printable-namespaces}
{:pattern "^metabase\\.(?:(?:lib)|(?:legacy-mbql))\\.*"
{:pattern "^metabase\\.(?:(?:lib)|(?:legacy-mbql))\\..*"
:name metabase-lib}
;;
;; QP source namespaces: `metabase.query-processor.*`, `metabase-enterprise.sandbox.query-processor.*`, and
@@ -811,8 +708,9 @@
{:inline-def {:level :off}
:missing-docstring {:level :off}
:private-call {:level :off}
:discouraged-var {metabase.driver/database-supports? {:level :off}}
:metabase/defsetting-must-specify-export {:level :off}
:discouraged-var {metabase.driver/database-supports? {:level :off}}}
:metabase/defsetting-namespace {:level :off}}
:hooks
{:analyze-call
@@ -822,7 +720,9 @@
source-namespaces
{:linters
{:discouraged-var
{:metabase/validate-escaped-single-quotes-in-i18n {:level :warning}
:metabase/validate-string-or-str-args-to-i18n {:level :warning}
:discouraged-var
{clojure.core/with-redefs {:message "Don't use with-redefs outside of tests"}
clojure.core/eval {:message "Don't use eval outside of tests"}}}}
@@ -878,10 +778,10 @@
toucan2.core {:message "Don't use application database directly in QP code; use QP Store/metadata provider"}}
:discouraged-var
{medley.core/map-keys {:message "Use clojure.core/update-keys"}
medley.core/map-vals {:message "Use clojure.core/update-vals"}
metabase.db.query/query {:message "Don't use application database directly in QP code; use QP Store/metadata provider"}
metabase.db.query/reducible-query {:message "Don't use application database directly in QP code; use QP Store/metadata provider"}}}}
{medley.core/map-keys {:message "Use clojure.core/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"}}}}
general-qp-and-driver-test-namespaces
{:linters

File diff suppressed because it is too large Load Diff

View File

@@ -49,36 +49,43 @@
metabase.actions.models/insert!
metabase.analytics.snowplow-test/fake-track-event-impl!
metabase.analytics.snowplow/track-event-impl!
metabase.app-db.core/finish-db-setup!
metabase.app-db.core/migrate!
metabase.app-db.core/setup-db!
metabase.app-db.schema-migrations-test.impl/run-migrations-in-range!
metabase.app-db.setup/migrate!
metabase.app-db.setup/setup-db!
metabase.channel.email-test/reset-inbox!
metabase.channel.email/send-email!
metabase.cmd.dump-to-h2/dump-to-h2!
metabase.cmd.load-from-h2/load-from-h2!
metabase.content-verification.models.moderation-review/create-review!
metabase.core.core/ensure-audit-db-installed!
metabase.db.schema-migrations-test.impl/run-migrations-in-range!
metabase.db.setup/migrate!
metabase.db.setup/setup-db!
metabase.db/migrate!
metabase.db/setup-db!
metabase.driver.mongo-test/create-database-from-row-maps!
metabase.driver.postgres-test/create-enums-db!
metabase.driver.postgres-test/drop-if-exists-and-create-db!
metabase.driver.sql-jdbc.execute/execute-statement!
metabase.indexed-entities.models.model-index/add-values!
metabase.driver.sql-jdbc.connection.ssh-tunnel-test/start-mock-servers!
metabase.driver.sql-jdbc.connection.ssh-tunnel-test/stop-mock-servers!
metabase.indexed-entities.task.index-values/job-init!
metabase.model-persistence.models.persisted-info/ready-database!
metabase.model-persistence.task.persist-refresh/job-init!
metabase.model-persistence.task.persist-refresh/refresh-tables!
metabase.model-persistence.task.persist-refresh/schedule-persistence-for-database!
metabase.models.collection.graph-test/clear-graph-revisions!
metabase.models.collection.graph-test/do-with-n-temp-users-with-personal-collections!
metabase.models.field-values/create-or-update-full-field-values!
metabase.models.moderation-review/create-review!
metabase.models.on-demand-test/add-dashcard-with-parameter-mapping!
metabase.models.setting-test/test-user-local-allowed-setting!
metabase.models.setting-test/test-user-local-only-setting!
metabase.models.setting.cache/restore-cache!
metabase.models.setting/set!
metabase.models.setting/validate-settings-formatting!
metabase.permissions.core/grant-application-permissions!
metabase.permissions.core/grant-collection-read-permissions!
metabase.permissions.core/grant-collection-readwrite-permissions!
metabase.permissions.core/grant-full-data-permissions!
metabase.permissions.core/grant-native-readwrite-permissions!
metabase.permissions.core/grant-permissions!
metabase.permissions.core/revoke-application-permissions!
metabase.permissions.core/revoke-data-perms!
metabase.permissions.core/update-data-perms-graph!
metabase.permissions.core/update-group-permissions!
metabase.permissions.models.collection.graph-test/clear-graph-revisions!
metabase.permissions.models.collection.graph-test/do-with-n-temp-users-with-personal-collections!
metabase.permissions.models.permissions/grant-application-permissions!
metabase.permissions.models.permissions/grant-collection-read-permissions!
metabase.permissions.models.permissions/grant-collection-readwrite-permissions!
@@ -96,7 +103,12 @@
metabase.query-processor.streaming.interface/begin!
metabase.query-processor.streaming.interface/finish!
metabase.query-processor.streaming.interface/write-row!
metabase.sample-data/try-to-extract-sample-database!
metabase.sample-data.impl/try-to-extract-sample-database!
metabase.settings.models.setting-test/test-user-local-allowed-setting!
metabase.settings.models.setting-test/test-user-local-only-setting!
metabase.settings.models.setting.cache/restore-cache!
metabase.settings.models.setting/set!
metabase.settings.models.setting/validate-settings-formatting!
metabase.setup.core/create-token!
metabase.sso.ldap-test-util/start-ldap-server!
metabase.sync.core/sync-database!
@@ -104,7 +116,8 @@
metabase.sync.sync-metadata/sync-db-metadata!
metabase.sync.util-test/sync-database!
metabase.sync.util/store-sync-summary!
metabase.task/delete-task!
metabase.task.core/delete-task!
metabase.task.impl/delete-task!
metabase.test.data.bigquery-cloud-sdk/execute!
metabase.test.data.impl.get-or-create/set-test-db-permissions!
metabase.test.data.impl/copy-db-tables-and-fields!
@@ -126,7 +139,6 @@
metabase.test/initialize-if-needed!
metabase.test/test-helpers-set-global-values!
metabase.test/with-temp-env-var-value!
metabase.upload-test/set-local-infile!
metabase.upload.impl-test/set-local-infile!
metabase.util.files/create-dir-if-not-exists!
metabase.util.ssh-test/start-mock-servers!
metabase.util.ssh-test/stop-mock-servers!}}}}
metabase.warehouse-schema.models.field-values/create-or-update-full-field-values!}}}}

View File

@@ -1,5 +0,0 @@
(ns macros.common
"Helpers for common Metabase macro shapes so we don't have to define the same macroexpansions over and over.")
(defn ignore-unused [symb]
(vary-meta symb assoc :clj-kondo/ignore [:unused-binding]))

View File

@@ -1,12 +0,0 @@
(ns macros.metabase.api.card-test
(:require [macros.common]))
(defmacro with-ordered-items
[collection model-and-name-syms & body]
`(let ~(into []
(comp (partition-all 2)
(mapcat (fn [[model binding]]
[(macros.common/ignore-unused binding) model])))
model-and-name-syms)
~collection
~@body))

View File

@@ -1,17 +0,0 @@
(ns macros.metabase.api.collection-test
(:require [macros.common]))
(defmacro with-collection-hierarchy! [bindings & body]
`(let [~(macros.common/ignore-unused 'a) nil
~(macros.common/ignore-unused 'b) nil
~(macros.common/ignore-unused 'c) nil
~(macros.common/ignore-unused 'd) nil
~(macros.common/ignore-unused 'e) nil
~(macros.common/ignore-unused 'f) nil
~(macros.common/ignore-unused 'g) nil]
~bindings
~@body))
(defmacro with-some-children-of-collection! [collection-or-id-or-nil & body]
`(let [~(macros.common/ignore-unused '&ids) ~collection-or-id-or-nil]
~@body))

View File

@@ -1,13 +0,0 @@
(ns macros.metabase.api.embed-test)
(defmacro with-embedding-enabled-and-temp-card-referencing!
[table-kw field-kw [card-binding] & body]
`(let [~card-binding [~table-kw ~field-kw]]
~@body))
(defmacro with-embedding-enabled-and-temp-dashcard-referencing!
[table-kw field-kw [dash-binding card-binding dashcard-binding] & body]
`(let [~dash-binding [~table-kw ~field-kw]
~(or card-binding '_) nil
~(or dashcard-binding '_) nil]
~@body))

View File

@@ -0,0 +1,24 @@
(ns macros.metabase.collections.api-test)
(defmacro with-collection-hierarchy! [bindings & body]
`(let [~'a nil
~'b nil
~'c nil
~'d nil
~'e nil
~'f nil
~'g nil]
~'a
~'b
~'c
~'d
~'e
~'f
~'g
~bindings
~@body))
(defmacro with-some-children-of-collection! [collection-or-id-or-nil & body]
`(let [~'&ids ~collection-or-id-or-nil]
~'&ids
~@body))

View File

@@ -0,0 +1,13 @@
(ns macros.metabase.embedding.api.embed-test)
(defmacro with-embedding-enabled-and-temp-card-referencing!
[table-kw field-kw [card-binding] & body]
`(let [~card-binding [~table-kw ~field-kw]]
~@body))
(defmacro with-embedding-enabled-and-temp-dashcard-referencing!
[table-kw field-kw [dash-binding card-binding dashcard-binding] & body]
`(let [~dash-binding [~table-kw ~field-kw]
~(or card-binding '_) nil
~(or dashcard-binding '_) nil]
~@body))

View File

@@ -1,4 +0,0 @@
(ns macros.metabase.models.params.chain-filter-test)
(defmacro chain-filter [& _]
`(metabase.models.params.chain-filter/chain-filter nil nil))

View File

@@ -1,9 +0,0 @@
(ns macros.metabase.models.query-analysis-test
(:require [macros.common]))
(defmacro with-test-setup [& body]
`(let [~(macros.common/ignore-unused 'card-id) 1
~(macros.common/ignore-unused 'table-id) 2
~(macros.common/ignore-unused 'tax-id) 3
~(macros.common/ignore-unused 'total-id) 4]
~@body))

View File

@@ -1,9 +0,0 @@
(ns macros.metabase.models.user-test)
(defmacro with-groups [bindings & body]
`(let ~(into []
(comp (partition-all 3)
(mapcat (fn [[group-binding properties members]]
[group-binding [properties members]])))
bindings)
~@body))

View File

@@ -0,0 +1,4 @@
(ns macros.metabase.parameters.chain-filter-test)
(defmacro chain-filter [& _]
`(metabase.parameters.chain-filter/chain-filter nil nil))

View File

@@ -0,0 +1,13 @@
(ns macros.metabase.queries.api.card-test)
(defmacro with-ordered-items
[collection model-and-name-syms & body]
`(let ~(into []
(comp (partition-all 2)
(mapcat (fn [[model binding]]
[binding model])))
model-and-name-syms)
~collection
~@(->> (partition-all 2 model-and-name-syms)
(map second))
~@body))

View File

@@ -0,0 +1,12 @@
(ns macros.metabase.query-analysis.models.query-analysis-test)
(defmacro with-test-setup [& body]
`(let [~'card-id 1
~'table-id 2
~'tax-id 3
~'total-id 4]
~'card-id
~'table-id
~'tax-id
~'total-id
~@body))

View File

@@ -1,13 +1,18 @@
(ns macros.metabase.query-analysis.task.test-setup
(:require [macros.common]))
(ns macros.metabase.query-analysis.task.test-setup)
(defmacro with-test-setup!
"Set up the data required to test the Query Analysis related tasks"
[& body]
`(let [~(macros.common/ignore-unused 'c1) 1
~(macros.common/ignore-unused 'c2) 2
~(macros.common/ignore-unused 'c3) 3
~(macros.common/ignore-unused 'c4) 4
~(macros.common/ignore-unused 'archived) 5
~(macros.common/ignore-unused 'invalid) 6]
`(let [~'c1 1
~'c2 2
~'c3 3
~'c4 4
~'archived 5
~'invalid 6]
~'c1
~'c2
~'c3
~'c4
~'archived
~'invalid
~@body))

View File

@@ -0,0 +1,9 @@
(ns macros.metabase.server.statistics-handler-test)
(defmacro with-server
[_ _ [connector chan-start-handle chan-finish-handle chan-done-request] & body]
`(let [~connector nil
~chan-start-handle nil
~chan-finish-handle nil
~chan-done-request nil]
~@body))

View File

@@ -0,0 +1,9 @@
(ns macros.metabase.users.models.user-test)
(defmacro with-groups! [bindings & body]
`(let ~(into []
(comp (partition-all 3)
(mapcat (fn [[group-binding properties members]]
[group-binding [properties members]])))
bindings)
~@body))

View File

@@ -1,13 +1,20 @@
(ns macros.metabase.xrays.related-test
(:require [macros.common]))
(ns macros.metabase.xrays.related-test)
(defmacro with-world [& body]
`(let [~(macros.common/ignore-unused 'collection-id) nil
~(macros.common/ignore-unused 'metric-id-a) nil
~(macros.common/ignore-unused 'metric-id-b) nil
~(macros.common/ignore-unused 'segment-id-a) nil
~(macros.common/ignore-unused 'segment-id-b) nil
~(macros.common/ignore-unused 'card-id-a) nil
~(macros.common/ignore-unused 'card-id-b) nil
~(macros.common/ignore-unused 'card-id-c) nil]
`(let [~'collection-id nil
~'metric-id-a nil
~'metric-id-b nil
~'segment-id-a nil
~'segment-id-b nil
~'card-id-a nil
~'card-id-b nil
~'card-id-c nil]
~'collection-id
~'metric-id-a
~'metric-id-b
~'segment-id-a
~'segment-id-b
~'card-id-a
~'card-id-b
~'card-id-c
~@body))

View File

@@ -1,6 +0,0 @@
(ns macros.metabase-enterprise.advanced-permissions.api.util-test
(:require [macros.common]))
(defmacro with-impersonations! [impersonations-and-attributes-map & body]
`(let [~(macros.common/ignore-unused '&group) ~impersonations-and-attributes-map]
~@body))

View File

@@ -0,0 +1,5 @@
(ns macros.metabase-enterprise.database-routing.e2e-test)
(defmacro with-temp-dbs! [bindings & body]
`(let [~@(interleave bindings (repeat nil))]
~@body))

View File

@@ -0,0 +1,6 @@
(ns macros.metabase-enterprise.impersonation.util-test)
(defmacro with-impersonations! [impersonations-and-attributes-map & body]
`(let [~'&group ~impersonations-and-attributes-map]
~'&group
~@body))

View File

@@ -1,12 +1,18 @@
(ns macros.metabase-enterprise.query-reference-validation.api-test
(:require [macros.common]))
(ns macros.metabase-enterprise.query-reference-validation.api-test)
(defmacro with-test-setup! [& body]
`(let [~(macros.common/ignore-unused 'card-1) 1
~(macros.common/ignore-unused 'card-2) 2
~(macros.common/ignore-unused 'card-3) 3
~(macros.common/ignore-unused 'card-4) 4
~(macros.common/ignore-unused 'card-5) 5
~(macros.common/ignore-unused 'coll-2) 100
~(macros.common/ignore-unused 'coll-3) 200]
`(let [~'card-1 1
~'card-2 2
~'card-3 3
~'card-4 4
~'card-5 5
~'coll-2 100
~'coll-3 200]
~'card-1
~'card-2
~'card-3
~'card-4
~'card-5
~'coll-2
~'coll-3
~@body))

View File

@@ -1,6 +1,6 @@
(ns macros.metabase-enterprise.sandbox.test-util
(:require [macros.common]))
(ns macros.metabase-enterprise.sandbox.test-util)
(defmacro with-gtaps! [gtaps-definition & body]
`(let [~(macros.common/ignore-unused '&group) ~gtaps-definition]
`(let [~'&group ~gtaps-definition]
~'&group
~@body))

View File

@@ -1,59 +1,112 @@
(ns macros.metabase-enterprise.serialization.test-util
(:require [macros.common]))
(ns macros.metabase-enterprise.serialization.test-util)
(defmacro with-world [& body]
`(let [~(macros.common/ignore-unused 'db-id) nil
~(macros.common/ignore-unused 'table-id) nil
~(macros.common/ignore-unused 'table) nil
~(macros.common/ignore-unused 'table-id-categories) nil
~(macros.common/ignore-unused 'table-id-users) nil
~(macros.common/ignore-unused 'table-id-checkins) nil
~(macros.common/ignore-unused 'venues-pk-field-id) nil
~(macros.common/ignore-unused 'numeric-field-id) nil
~(macros.common/ignore-unused 'name-field-id) nil
~(macros.common/ignore-unused 'latitude-field-id) nil
~(macros.common/ignore-unused 'longitude-field-id) nil
~(macros.common/ignore-unused 'category-field-id) nil
~(macros.common/ignore-unused 'category-pk-field-id) nil
~(macros.common/ignore-unused 'date-field-id) nil
~(macros.common/ignore-unused 'users-pk-field-id) nil
~(macros.common/ignore-unused 'user-id-field-id) nil
~(macros.common/ignore-unused 'checkins->venues-field-id) nil
~(macros.common/ignore-unused 'last-login-field-id) nil
~(macros.common/ignore-unused 'collection-id) nil
~(macros.common/ignore-unused 'collection-id-nested) nil
~(macros.common/ignore-unused 'user-id-temp) nil
~(macros.common/ignore-unused 'personal-collection-id) nil
~(macros.common/ignore-unused 'pc-felicia-nested-id) nil
~(macros.common/ignore-unused 'pc-nested-id) nil
~(macros.common/ignore-unused 'pc-deeply-nested-id) nil
~(macros.common/ignore-unused 'metric-id) nil
~(macros.common/ignore-unused 'segment-id) nil
~(macros.common/ignore-unused 'dashboard-id) nil
~(macros.common/ignore-unused 'root-dashboard-id) nil
~(macros.common/ignore-unused 'card-id) nil
~(macros.common/ignore-unused 'card-arch-id) nil
~(macros.common/ignore-unused 'card-id-root) nil
~(macros.common/ignore-unused 'card-id-nested) nil
~(macros.common/ignore-unused 'card-id-nested-query) nil
~(macros.common/ignore-unused 'card-id-native-query) nil
~(macros.common/ignore-unused 'card-id-pivot-table) nil
~(macros.common/ignore-unused 'dashcard-id) nil
~(macros.common/ignore-unused 'dashcard-top-level-click-id) nil
~(macros.common/ignore-unused 'dashcard-with-click-actions) nil
~(macros.common/ignore-unused 'dashcard-with-textbox-id) nil
~(macros.common/ignore-unused 'card-id-root-to-collection) nil
~(macros.common/ignore-unused 'card-id-collection-to-root) nil
~(macros.common/ignore-unused 'pulse-id) nil
~(macros.common/ignore-unused 'pulsecard-root-id) nil
~(macros.common/ignore-unused 'pulsecard-collection-id) nil
~(macros.common/ignore-unused 'card-id-template-tags) nil
~(macros.common/ignore-unused 'card-id-filter-agg) nil
~(macros.common/ignore-unused 'card-id-temporal-unit) nil
~(macros.common/ignore-unused 'snippet-id) nil
~(macros.common/ignore-unused 'snippet-collection-id) nil
~(macros.common/ignore-unused 'snippet-nested-collection-id) nil
~(macros.common/ignore-unused 'nested-snippet-id) nil
~(macros.common/ignore-unused 'card-id-with-native-snippet) nil
~(macros.common/ignore-unused 'card-join-card-id) nil]
`(let [~'db-id nil
~'table-id nil
~'table nil
~'table-id-categories nil
~'table-id-users nil
~'table-id-checkins nil
~'venues-pk-field-id nil
~'numeric-field-id nil
~'name-field-id nil
~'latitude-field-id nil
~'longitude-field-id nil
~'category-field-id nil
~'category-pk-field-id nil
~'date-field-id nil
~'users-pk-field-id nil
~'user-id-field-id nil
~'checkins->venues-field-id nil
~'last-login-field-id nil
~'collection-id nil
~'collection-id-nested nil
~'user-id-temp nil
~'personal-collection-id nil
~'pc-felicia-nested-id nil
~'pc-nested-id nil
~'pc-deeply-nested-id nil
~'metric-id nil
~'segment-id nil
~'dashboard-id nil
~'root-dashboard-id nil
~'card-id nil
~'card-arch-id nil
~'card-id-root nil
~'card-id-nested nil
~'card-id-nested-query nil
~'card-id-native-query nil
~'card-id-pivot-table nil
~'dashcard-id nil
~'dashcard-top-level-click-id nil
~'dashcard-with-click-actions nil
~'dashcard-with-textbox-id nil
~'card-id-root-to-collection nil
~'card-id-collection-to-root nil
~'pulse-id nil
~'pulsecard-root-id nil
~'pulsecard-collection-id nil
~'card-id-template-tags nil
~'card-id-filter-agg nil
~'card-id-temporal-unit nil
~'snippet-id nil
~'snippet-collection-id nil
~'snippet-nested-collection-id nil
~'nested-snippet-id nil
~'card-id-with-native-snippet nil
~'card-join-card-id nil]
~'db-id
~'table-id
~'table
~'table-id-categories
~'table-id-users
~'table-id-checkins
~'venues-pk-field-id
~'numeric-field-id
~'name-field-id
~'latitude-field-id
~'longitude-field-id
~'category-field-id
~'category-pk-field-id
~'date-field-id
~'users-pk-field-id
~'user-id-field-id
~'checkins->venues-field-id
~'last-login-field-id
~'collection-id
~'collection-id-nested
~'user-id-temp
~'personal-collection-id
~'pc-felicia-nested-id
~'pc-nested-id
~'pc-deeply-nested-id
~'metric-id
~'segment-id
~'dashboard-id
~'root-dashboard-id
~'card-id
~'card-arch-id
~'card-id-root
~'card-id-nested
~'card-id-nested-query
~'card-id-native-query
~'card-id-pivot-table
~'dashcard-id
~'dashcard-top-level-click-id
~'dashcard-with-click-actions
~'dashcard-with-textbox-id
~'card-id-root-to-collection
~'card-id-collection-to-root
~'pulse-id
~'pulsecard-root-id
~'pulsecard-collection-id
~'card-id-template-tags
~'card-id-filter-agg
~'card-id-temporal-unit
~'snippet-id
~'snippet-collection-id
~'snippet-nested-collection-id
~'nested-snippet-id
~'card-id-with-native-snippet
~'card-join-card-id
~@body))

View File

@@ -1,6 +1,7 @@
(ns hooks.clojure.core.ns
(:require
[clj-kondo.hooks-api :as hooks]
[clojure.string :as str]
[hooks.common]
[hooks.common.modules :as modules]))
@@ -59,12 +60,15 @@
(printf "Don't know how to figure out what namespace is being required in %s\n" (pr-str node)))))
args)))
(defn- ns-form-node->ns-symb-node [ns-form-node]
(some (fn [node]
(when (and (hooks/token-node? node)
(not= (hooks/sexpr node) 'ns))
node))
(:children ns-form-node)))
(defn- ns-form-node->ns-symb [ns-form-node]
(some-> (some (fn [node]
(when (and (hooks/token-node? node)
(not= (hooks/sexpr node) 'ns))
node))
(:children ns-form-node))
(some-> (ns-form-node->ns-symb-node ns-form-node)
hooks/sexpr))
(defn- lint-modules [ns-form-node config]
@@ -83,9 +87,34 @@
:message error
:type :metabase/modules))))))))
(defn- lint-namespace-name [ns-form-node]
; NOCOMMIT
(when-let [ns-symb-node (ns-form-node->ns-symb-node ns-form-node)]
(when-not (contains? (hooks.common/ignored-linters ns-symb-node) :metabase/namespace-name)
(let [parts (str/split (str (hooks/sexpr ns-symb-node)) #"\.")]
(when (and (<= (count parts) 2)
(#{"metabase" "metabase-enterprise"} (first parts))
;; exclude test namespaces for now
(not (str/ends-with? (last parts) "test")))
(hooks/reg-finding! (assoc (meta ns-symb-node)
:message "Metabase namespaces should have the form metabase[-enterprise].<module>.* [:metabase/namespace-name]"
:type :metabase/namespace-name)))))))
(defn lint-ns [x]
(doto (:node x)
lint-require-shapes
lint-requires-on-new-lines
(lint-modules (modules/config x)))
(lint-modules (modules/config x))
lint-namespace-name)
x)
(comment
(lint-ns
{:node (hooks/parse-string
(pr-str
'(ns hooks.clojure.core.ns
(:require
[clj-kondo.hooks-api :as hooks]
[clojure.string :as str]
[hooks.common]
[hooks.common.modules :as modules]))))}))

View File

@@ -0,0 +1,14 @@
(ns hooks.metabase.app-db.schema-migrations-test.impl
(:require [clj-kondo.hooks-api :as hooks]))
(defn test-migrations
[{{[_ migration-range {[binding] :children} & body] :children} :node}]
(let [node* (hooks/list-node
(list*
(hooks/token-node `let)
(hooks/vector-node
[binding (hooks/list-node (list (hooks/token-node `fn)
(hooks/vector-node [(hooks/token-node '&) (hooks/token-node '_args)])))])
migration-range
body))]
{:node node*}))

View File

@@ -1,14 +0,0 @@
(ns hooks.metabase.db.schema-migrations-test.impl
(:require [clj-kondo.hooks-api :as hooks]))
(defn test-migrations
[{{[_ migration-range {[binding] :children} & body] :children} :node}]
(let [node* (hooks/list-node
(list*
(hooks/token-node `let)
(hooks/vector-node
[binding (hooks/list-node (list (hooks/token-node `fn)
(hooks/vector-node [(hooks/token-node '&) (hooks/token-node '_args)])))])
migration-range
body))]
{:node node*}))

View File

@@ -1,294 +0,0 @@
(ns hooks.metabase.models.setting
(:require
[clj-kondo.hooks-api :as hooks]
[hooks.common :as common]))
;;; TODO -- move this into
(def ^:private ignored-implicit-export?
'#{active-users-count
admin-email
analytics-uuid
anon-tracking-enabled
api-key
attachment-table-row-limit
audit-max-retention-days
bcc-enabled?
breakout-bin-width
check-for-updates
cloud-gateway-ips
config-from-file-sync-databases
custom-homepage
custom-homepage-dashboard
database-enable-actions
deprecation-notice-version
dismissed-custom-dashboard-toast
dismissed-onboarding-sidebar-link
email-configured?
email-from-address
email-from-name
email-reply-to
email-smtp-host
email-smtp-password
email-smtp-port
email-smtp-security
email-smtp-username
embedding-app-origin
embedding-secret-key
enable-password-login
enable-public-sharing
enable-query-caching
engines
enum-cardinality-threshold
follow-up-email-sent
google-auth-auto-create-accounts-domain
google-auth-client-id
google-auth-configured
google-auth-enabled
has-sample-database?
has-user-setup
help-link
help-link-custom-destination
instance-creation
is-hosted?
is-metabot-enabled
jdbc-data-warehouse-max-connection-pool-size
jdbc-data-warehouse-unreturned-connection-timeout-seconds
jwt-attribute-email
jwt-attribute-firstname
jwt-attribute-groups
jwt-attribute-lastname
jwt-configured
jwt-enabled
jwt-group-mappings
jwt-group-sync
jwt-identity-provider-uri
jwt-user-provisioning-enabled?
jwt-shared-secret
last-acknowledged-version
last-used-native-database-id
ldap-attribute-email
ldap-attribute-firstname
ldap-attribute-lastname
ldap-bind-dn
ldap-configured?
ldap-enabled
ldap-group-base
ldap-group-mappings
ldap-group-membership-filter
ldap-group-sync
ldap-host
ldap-password
ldap-port
ldap-user-provisioning-enabled?
ldap-security
ldap-sync-user-attributes
ldap-sync-user-attributes-blacklist
ldap-user-base
ldap-user-filter
load-analytics-content
map-tile-server-url
metabot-default-embedding-model
metabot-feedback-url
metabot-get-prompt-templates-url
metabot-prompt-generator-token-limit
multi-setting-read-only
notebook-native-preview-shown
notebook-native-preview-sidebar-width
notification-link-base-url
num-metabot-choices
openai-api-key
openai-available-models
openai-model
openai-organization
other-sso-enabled?
password-complexity
persist-models-enabled
persisted-model-refresh-cron-schedule
premium-embedding-token
prometheus-server-port
query-caching-max-kb
query-caching-max-ttl
query-caching-min-ttl
query-caching-ttl-ratio
redirect-all-requests-to-https
reset-token-ttl-hours
retired-setting
retry-initial-interval
retry-max-attempts
retry-max-interval-millis
retry-multiplier
retry-randomization-factor
saml-application-name
saml-attribute-email
saml-attribute-firstname
saml-attribute-group
saml-attribute-lastname
saml-configured
saml-enabled
saml-group-mappings
saml-group-sync
saml-identity-provider-certificate
saml-identity-provider-issuer
saml-identity-provider-uri
saml-keystore-alias
saml-keystore-password
saml-keystore-path
saml-user-provisioning-enabled?
send-email-on-first-login-from-new-device
send-new-sso-user-admin-email?
session-cookie-samesite
session-cookies
session-timeout
setup-token
show-database-syncing-modal
show-metabase-links
site-url
site-uuid
site-uuid-for-premium-features-token-checks
site-uuid-for-unsubscribing-url
site-uuid-for-version-info-fetching
slack-app-token
slack-cached-channels-and-usernames
slack-channels-and-usernames-last-updated
slack-files-channel
slack-token
slack-token-valid?
snowplow-available
snowplow-enabled
snowplow-url
sql-jdbc-fetch-size
ssh-heartbeat-interval-sec
ssl-certificate-public-key
startup-time-millis
token-features
token-status
toucan-name
trial-banner-dismissal-timestamp
uncached-setting
user-visibility
version
version-info
version-info-last-checked})
(defn- defsetting-lint [node setting-name docstring options-list]
(let [anon-binding (common/with-macro-meta (hooks/token-node '_) node)
;; (defn my-setting [] ...)
getter-node (-> (list
(hooks/token-node 'defn)
setting-name
(hooks/string-node "Docstring.")
(hooks/vector-node []))
hooks/list-node
(with-meta (meta node)))
;; (defn my-setting! [_x] ...)
setter-node (-> (list
(hooks/token-node 'defn)
(with-meta
(hooks/token-node (symbol (str (hooks/sexpr setting-name) \!)))
(meta setting-name))
(hooks/string-node "Docstring.")
(hooks/vector-node [(hooks/token-node '_value-or-nil)]))
hooks/list-node
(with-meta (meta node))
common/add-lsp-ignore-unused-public-var-metadata)]
(when (nil? (second (drop-while (comp not #{[:k :export?]} first) options-list)))
(when-not (contains? ignored-implicit-export? (:value setting-name))
(hooks/reg-finding! (assoc (meta node)
:message "Setting definition must provide an explicit value for :export? indicating whether the setting should be exported or not with serialization."
:type :metabase/defsetting-must-specify-export))))
{:node (-> (hooks/list-node
(list
(hooks/token-node 'let)
;; include description and the options map so they can get validated as well.
(hooks/vector-node
[anon-binding docstring
anon-binding (hooks/map-node options-list)])
(hooks/reg-keyword! (-> (hooks/keyword-node (keyword (hooks/sexpr setting-name)))
(with-meta (meta setting-name)))
'metabase.models.setting/defsetting)
getter-node
setter-node))
(with-meta (meta node)))}))
(defn defsetting
"Rewrite a [[metabase.models.defsetting]] form like
(defsetting my-setting \"Description\" :type :boolean)
as
(let [_ \"Description\"
_ {:type :boolean}]
(defn my-setting \"Docstring.\" [])
(defn my-setting! \"Docstring.\" [_value-or-nil]))
for linting purposes."
[{:keys [node], :as context}]
(let [[setting-name docstring & options] (rest (:children node))]
(merge
context
(defsetting-lint node setting-name docstring options))))
(defn define-multi-setting
"Rewrite a [[metabase.models.define-multi-setting]] form like
(defsetting my-setting \"Description\" :key :type :boolean)
as
(let [_ \"Description\"
_ {:type :boolean, :multi-thunk :key}]
(defn my-setting \"Docstring.\" [])
(defn my-setting! \"Docstring.\" [_value-or-nil]))
for linting purposes."
[{:keys [node], :as context}]
(let [[setting-name docstring thunk & options] (rest (:children node))]
(merge
context
(defsetting-lint node setting-name docstring (concat options [(hooks/token-node :multi-thunk) thunk])))))
(defn define-multi-setting-impl
[context]
(letfn [(update-node [node]
(let [[_define-multi-setting-impl setting-name & more] (:children node)]
(-> (hooks/list-node
(list*
(hooks/token-node 'do)
;; For a qualified setting name like `oss-namespace/setting`, then leave the symbol as is, so the
;; usage of that namespace/var gets recorded. Otherwise for an unqualified name convert it to a
;; keyword so we don't get unresolved var errors.
(if (and (hooks/token-node? setting-name)
(qualified-symbol? (hooks/sexpr setting-name)))
setting-name
(-> (hooks/keyword-node (keyword (hooks/sexpr setting-name)))
(with-meta (meta setting-name))))
more))
(with-meta (meta node)))))]
(update context :node update-node)))
(comment
(defn- defsetting* [form]
(hooks/sexpr
(:node
(defsetting
{:node
(hooks/parse-string
(with-out-str
#_{:clj-kondo/ignore [:unresolved-namespace]}
(clojure.pprint/pprint
form)))}))))
(defn x []
(defsetting*
'(defsetting active-users-count
(deferred-tru "Cached number of active users. Refresh every 5 minutes.")
:visibility :admin
:type :integer
:default 0
:getter (fn []
(if-not ((requiring-resolve 'metabase.db/db-is-set-up?))
0
(cached-active-users-count)))))))

View File

@@ -0,0 +1,309 @@
(ns hooks.metabase.settings.models.setting
(:require
[clj-kondo.hooks-api :as hooks]
[hooks.common :as common]))
(defn lint-defsetting-namespace [node context]
(when-not (re-matches #"^metabase(?:-enterprise)?\.[^\.]+\.settings$" (name (:ns context)))
(hooks/reg-finding! (assoc (meta node)
:message "All defsettings should live in metabase[-enterprise].<module>.settings namespaces"
:type :metabase/defsetting-namespace))))
;;; TODO -- move this into a Kondo config file in `.clj-kondo/config/`
(def ^:private ignored-implicit-export?
'#{active-users-count
admin-email
analytics-uuid
anon-tracking-enabled
api-key
attachment-table-row-limit
audit-max-retention-days
bcc-enabled?
breakout-bin-width
check-for-updates
cloud-gateway-ips
config-from-file-sync-databases
custom-homepage
custom-homepage-dashboard
database-enable-actions
deprecation-notice-version
dismissed-custom-dashboard-toast
email-configured?
email-from-address
email-from-name
email-reply-to
email-smtp-host
email-smtp-password
email-smtp-port
email-smtp-security
email-smtp-username
embedding-app-origin
embedding-secret-key
enable-password-login
enable-public-sharing
enable-query-caching
engines
enum-cardinality-threshold
follow-up-email-sent
google-auth-auto-create-accounts-domain
google-auth-client-id
google-auth-configured
google-auth-enabled
has-sample-database?
has-user-setup
help-link
help-link-custom-destination
instance-creation
is-hosted?
is-metabot-enabled
jdbc-data-warehouse-max-connection-pool-size
jdbc-data-warehouse-unreturned-connection-timeout-seconds
jwt-attribute-email
jwt-attribute-firstname
jwt-attribute-groups
jwt-attribute-lastname
jwt-configured
jwt-enabled
jwt-group-mappings
jwt-group-sync
jwt-identity-provider-uri
jwt-user-provisioning-enabled?
jwt-shared-secret
last-acknowledged-version
last-used-native-database-id
ldap-attribute-email
ldap-attribute-firstname
ldap-attribute-lastname
ldap-bind-dn
ldap-configured?
ldap-enabled
ldap-group-base
ldap-group-mappings
ldap-group-membership-filter
ldap-group-sync
ldap-host
ldap-password
ldap-port
ldap-user-provisioning-enabled?
ldap-security
ldap-sync-user-attributes
ldap-sync-user-attributes-blacklist
ldap-user-base
ldap-user-filter
load-analytics-content
map-tile-server-url
metabot-default-embedding-model
metabot-feedback-url
metabot-get-prompt-templates-url
metabot-prompt-generator-token-limit
multi-setting-read-only
notebook-native-preview-shown
notebook-native-preview-sidebar-width
notification-link-base-url
num-metabot-choices
openai-api-key
openai-available-models
openai-model
openai-organization
other-sso-enabled?
password-complexity
persist-models-enabled
persisted-model-refresh-cron-schedule
premium-embedding-token
prometheus-server-port
query-caching-max-kb
query-caching-max-ttl
query-caching-min-ttl
query-caching-ttl-ratio
redirect-all-requests-to-https
reset-token-ttl-hours
retired-setting
retry-initial-interval
retry-max-attempts
retry-max-interval-millis
retry-multiplier
retry-randomization-factor
saml-application-name
saml-attribute-email
saml-attribute-firstname
saml-attribute-group
saml-attribute-lastname
saml-configured
saml-enabled
saml-group-mappings
saml-group-sync
saml-identity-provider-certificate
saml-identity-provider-issuer
saml-identity-provider-uri
saml-keystore-alias
saml-keystore-password
saml-keystore-path
saml-user-provisioning-enabled?
send-email-on-first-login-from-new-device
send-new-sso-user-admin-email?
session-cookie-samesite
session-cookies
session-timeout
setup-token
show-database-syncing-modal
show-metabase-links
site-url
site-uuid
site-uuid-for-premium-features-token-checks
site-uuid-for-unsubscribing-url
site-uuid-for-version-info-fetching
slack-app-token
slack-cached-channels-and-usernames
slack-channels-and-usernames-last-updated
slack-files-channel
slack-token
slack-token-valid?
snowplow-available
snowplow-enabled
snowplow-url
sql-jdbc-fetch-size
ssh-heartbeat-interval-sec
ssl-certificate-public-key
startup-time-millis
token-features
token-status
toucan-name
trial-banner-dismissal-timestamp
uncached-setting
user-visibility
version
version-info
version-info-last-checked})
(defn- lint-defsetting-export [node]
(let [[_defsetting setting-name _docstring & options] (:children node)]
(when (nil? (second (drop-while (comp not #{[:k :export?]} first) options)))
(when-not (contains? ignored-implicit-export? (:value setting-name))
(hooks/reg-finding! (assoc (meta node)
:message "Setting definition must provide an explicit value for :export? indicating whether the setting should be exported or not with serialization."
:type :metabase/defsetting-must-specify-export))))))
(defn- defsetting-replacement-node [node]
(let [[_defsetting setting-name docstring & options-list] (:children node)
anon-binding (common/with-macro-meta (hooks/token-node '_) node)
;; (defn my-setting [] ...)
getter-node (-> (list
(hooks/token-node 'defn)
setting-name
(hooks/string-node "Docstring.")
(hooks/vector-node []))
hooks/list-node
(with-meta (meta node)))
;; (defn my-setting! [_x] ...)
setter-node (-> (list
(hooks/token-node 'defn)
(with-meta
(hooks/token-node (symbol (str (hooks/sexpr setting-name) \!)))
(meta setting-name))
(hooks/string-node "Docstring.")
(hooks/vector-node [(hooks/token-node '_value-or-nil)]))
hooks/list-node
(with-meta (meta node))
common/add-lsp-ignore-unused-public-var-metadata)]
(-> (hooks/list-node
(list
(hooks/token-node 'let)
;; include description and the options map so they can get validated as well.
(hooks/vector-node
[anon-binding docstring
anon-binding (hooks/map-node options-list)])
(hooks/reg-keyword! (-> (hooks/keyword-node (keyword (hooks/sexpr setting-name)))
(with-meta (meta setting-name)))
'metabase.settings.models.setting/defsetting)
getter-node
setter-node))
(with-meta (meta node)))))
(defn defsetting
"Rewrite a [[metabase.models.defsetting]] form like
(defsetting my-setting \"Description\" :type :boolean)
as
(let [_ \"Description\"
_ {:type :boolean}]
(defn my-setting \"Docstring.\" [])
(defn my-setting! \"Docstring.\" [_value-or-nil]))
for linting purposes."
[{:keys [node], :as context}]
(lint-defsetting-namespace node context)
(lint-defsetting-export node)
(update context :node defsetting-replacement-node))
(defn define-multi-setting-replacement-node [node]
(let [[defsetting setting-name docstring thunk & options] (:children node)]
(-> (hooks/list-node
(list*
defsetting
setting-name
docstring
(hooks/token-node :multi-thunk) thunk
options))
(with-meta (meta node))
defsetting-replacement-node)))
(defn define-multi-setting
"Rewrite a [[metabase.models.define-multi-setting]] form like
(defsetting my-setting \"Description\" :key :type :boolean)
as
(let [_ \"Description\"
_ {:type :boolean, :multi-thunk :key}]
(defn my-setting \"Docstring.\" [])
(defn my-setting! \"Docstring.\" [_value-or-nil]))
for linting purposes."
[{:keys [node], :as context}]
(update context :node define-multi-setting-replacement-node))
(defn define-multi-setting-impl
[context]
(letfn [(update-node [node]
(let [[_define-multi-setting-impl setting-name & more] (:children node)]
(-> (hooks/list-node
(list*
(hooks/token-node 'do)
;; For a qualified setting name like `oss-namespace/setting`, then leave the symbol as is, so the
;; usage of that namespace/var gets recorded. Otherwise for an unqualified name convert it to a
;; keyword so we don't get unresolved var errors.
(if (and (hooks/token-node? setting-name)
(qualified-symbol? (hooks/sexpr setting-name)))
setting-name
(-> (hooks/keyword-node (keyword (hooks/sexpr setting-name)))
(with-meta (meta setting-name))))
more))
(with-meta (meta node)))))]
(update context :node update-node)))
(comment
(defn- defsetting* [form]
(hooks/sexpr
(:node
(defsetting
{:node
(hooks/parse-string
(with-out-str
#_{:clj-kondo/ignore [:unresolved-namespace]}
(clojure.pprint/pprint
form)))}))))
(defn x []
(defsetting*
'(defsetting active-users-count
(deferred-tru "Cached number of active users. Refresh every 5 minutes.")
:visibility :admin
:type :integer
:default 0
:getter (fn []
(if-not ((requiring-resolve 'metabase.app-db.core/db-is-set-up?))
0
(cached-active-users-count)))))))

View File

@@ -45,37 +45,35 @@
:unqualified/unknown)))
(defn dataset
[{{[_ dataset & body] :children} :node this-ns :ns}]
(let [noop (constantly nil)
body (case (dataset-type this-ns dataset)
;; non-symbol, qualified symbols, and unqualified symbols from the current namespace/let-bound can all
;; get converted from something like
;;
;; (dataset whatever
;; ...)
;;
;; to
;;
;; (let [_ whatever]
;; ...)
(:non-symbol :qualified :unqualified/local-def)
(list* (hooks/token-node 'let)
(hooks/vector-node [(hooks/token-node '_) dataset])
body)
[{{[_ dataset & body] :children, :as node} :node this-ns :ns}]
(let [node' (case (dataset-type this-ns dataset)
;; non-symbol, qualified symbols, and unqualified symbols from the current namespace/let-bound can all
;; get converted from something like
;;
;; (dataset whatever
;; ...)
;;
;; to
;;
;; (let [_ whatever]
;; ...)
(:non-symbol :qualified :unqualified/local-def)
(hooks/list-node
(list*
(hooks/token-node 'let)
(hooks/vector-node [(hooks/token-node '_) dataset])
body))
;; for ones that came from the dataset defs namespace or ones whose origin is unknown, just ignore them
;; and generate a `print` form:
;;
;; (print ...)
;;
;; (this used to be a `do` form (which makes a lot more semantic sense), but that resulted in warnings
;; about unused values
(:unqualified/from-dataset-defs-namespace :unqualified/unknown)
(list* (hooks/token-node noop)
body))]
{:node (with-meta (hooks/list-node (with-meta body
(meta dataset)))
(meta dataset))}))
;; for ones that came from the dataset defs namespace or ones whose origin is unknown, just ignore them
;; and generate a form like
;;
;; (do ...)
(:unqualified/from-dataset-defs-namespace :unqualified/unknown)
(hooks/list-node
(list*
(hooks/token-node `do)
body)))]
{:node (with-meta node' (meta node))}))
(defn- special-token-node?
"Whether this node is one of the special symbols like `$field`."

View File

@@ -2,8 +2,8 @@
(:require
[clj-kondo.hooks-api :as hooks]))
(defn with-gentest
"(with-gentest {:as limit-spec} [s1 val1 & more] body-form body-form...)"
(defn iterate*
"(iterate {:as limit-spec} [s1 val1 & more] body-form body-form...)"
[{{:keys [children] :as node} :node :as orig}]
(let [[token limit-spec bindings & body-nodes] children
node* (-> (hooks/list-node

View File

@@ -0,0 +1,15 @@
(ns hooks.metabase.test.util.generators.jvm
(:require
[clj-kondo.hooks-api :as hooks]))
(defn with-random-cards
"(with-random-cards <metadata-provider> <integer-count-value> & body-forms)"
[{{:keys [children] :as node} :node :as orig}]
(let [[token num-cards & body-nodes] children
node* (-> (hooks/list-node
(list token num-cards
(hooks/list-node (list* (hooks/token-node 'let)
(hooks/vector-node [(hooks/token-node '&cards) (hooks/list-node ())])
body-nodes))))
(with-meta (meta node)))]
(assoc orig :node node*)))

View File

@@ -0,0 +1,74 @@
(ns hooks.metabase.util.i18n
(:require
[clj-kondo.hooks-api :as api]
[clojure.string :as str]
[hooks.common]))
(defn- valid-apostrophes?
"Returns true if `s` contains only doubled quotes (''') or complete placeholder-escaping quotes ('{...}'), false otherwise."
[s]
(loop [chars (seq s)]
(if (empty? chars)
true
(let [c (first chars)]
(if (= c \')
(cond
;; Doubled quotes: skip both
(and (next chars) (= (second chars) \'))
(recur (nthrest chars 2))
;; Placeholder escape. We allow for intentional escaping, like either '{0}` or '{{`, but not 'arbitrary
;; strings' So basically, just require the *next* character to be a `{`, find the next single-quote, and
;; continue on from there.
;;
;; Technically a string like "foo bar's happy but i'm not" is totally fine, but we'll say it's invalid
;; because... that inner string literal is probably not what we actually want. So since we've never done
;; this intentionally as far as I can tell, let's just remove the possibility to avoid ambiguity.
(= (second chars) \{)
(let [at-closing (drop-while #(not= \' %) (next chars))]
(if (seq at-closing)
(recur (next at-closing))
false))
;; Unpaired single quote: invalid
:else
false)
(recur (rest chars)))))))
(defn format-str-arg-node->str
[node]
(cond
;; it's just a string literal
(api/string-node? node) (api/sexpr node)
;; it's `(str "some" "strings")`
(and (api/list-node? node)
(= 'str (api/sexpr (first (:children node))))
(every? api/string-node? (rest (:children node))))
(apply str (map api/sexpr (rest (:children node))))
;; it's something else, no good
:else
(do
(api/reg-finding!
(assoc (meta node)
:message "Must be a string literal or a call to `str` with string literal arguments."
:type :metabase/validate-string-or-str-args-to-i18n))
nil)))
(defn strict-apostrophes
"Checks the node to make sure it's not a i18n call that will result in dropped apostrophes."
[{:keys [node]}]
(let [format-str-arg (second (:children node))
;; `format-str-arg` must be either a `"string"` or `(str "a call " "to" "str")` (to allow for splitting long
;; strings into shorter lines)
format-str (format-str-arg-node->str format-str-arg)]
(when-not (valid-apostrophes? format-str)
(api/reg-finding!
(assoc (meta node)
:message "Format string contains invalid single quote usage. Use '' for literals or '{...}' for escaping."
:type :metabase/validate-escaped-single-quotes-in-i18n))))
{:node node})
(def tru strict-apostrophes)
(def trs strict-apostrophes)
(def deferred-tru strict-apostrophes)
(def deferred-trs strict-apostrophes)

View File

@@ -20,15 +20,17 @@
(lint-ns form (assoc-in config [:linters :metabase/modules :level] :warning)))
(deftest ^:parallel module-checker-allowed-modules-test
(is (=? [{:message "Module task should not be used in the api module. [:metabase/modules api :uses]"
:type :metabase/modules}]
(lint-modules
'(ns metabase.api.search
(:require
[metabase.request.core :as request]
[metabase.task :as task]))
'{:metabase/modules {api {:uses #{request}}
request {:api #{metabase.request.core}}}}))))
(are [task-namespace] (=? [{:message "Module task should not be used in the api module. [:metabase/modules api :uses]"
:type :metabase/modules}]
(lint-modules
'(ns metabase.api.search
(:require
[metabase.request.core :as request]
[task-namespace :as task]))
'{:metabase/modules {api {:uses #{request}}
request {:api #{metabase.request.core}}}}))
metabase.task
metabase.task.core))
(deftest ^:parallel module-checker-api-namespaces-test
(is (=? [{:message "Namespace metabase.search.config is not an allowed external API namespace for the search module. [:metabase/modules search :api]"

View File

@@ -0,0 +1,34 @@
(ns hooks.metabase.settings.models.setting-test
(:require
[clj-kondo.hooks-api :as hooks]
[clojure.test :refer :all]
[hooks.metabase.settings.models.setting]))
#_{:clj-kondo/ignore [:metabase/validate-deftest]}
(deftest ^:parallel defsetting-test
(let [node (-> '(defsetting active-users-count
(deferred-tru "Cached number of active users. Refreshed every 5 minutes.")
:visibility :admin
:type :integer
:default 0
:getter (fn []
(if-not ((requiring-resolve 'metabase.app-db.core/db-is-set-up?))
0
(cached-active-users-count))))
pr-str
hooks/parse-string)]
(is (= '(let [_ (deferred-tru "Cached number of active users. Refreshed every 5 minutes.")
_ {:default 0
:type :integer
:getter (fn []
(if-not ((requiring-resolve 'metabase.app-db.core/db-is-set-up?))
0
(cached-active-users-count)))
:visibility :admin}]
:active-users-count
(defn active-users-count "Docstring." [])
(defn active-users-count! "Docstring." [_value-or-nil]))
(-> {:node node, :ns 'hooks.metabase.settings.models.setting-test}
hooks.metabase.settings.models.setting/defsetting
:node
hooks/sexpr)))))

View File

@@ -0,0 +1,33 @@
(ns hooks.metabase.util.i18n-test
(:require [clj-kondo.hooks-api :as api]
[clj-kondo.impl.utils]
[clojure.string :as str]
[clojure.test :refer [deftest testing is are]]
[hooks.metabase.util.i18n]))
(defn- warnings
[form]
(binding [clj-kondo.impl.utils/*ctx* {:config {:linters {:metabase/validate-string-or-str-args-to-i18n {:level :warning}
:metabase/validate-escaped-single-quotes-in-i18n {:level :warning}}}
:ignores (atom nil)
:findings (atom [])
:namespaces (atom {})}]
(hooks.metabase.util.i18n/strict-apostrophes {:node (api/parse-string (pr-str form))})
(mapv :message @(:findings clj-kondo.impl.utils/*ctx*))))
(deftest ^:parallel strict-apostrophes-warns
(are [form] (= ["Format string contains invalid single quote usage. Use '' for literals or '{...}' for escaping."]
(warnings (quote form)))
(metabase.util.i18n/tru "this isn't good bob")
(metabase.util.i18n/tru "'this is not good either'")
(metabase.util.i18n/tru "''this isn't''")
(metabase.util.i18n/tru "nope you can not escape 'like {{0}} so {{1}}'")
(metabase.util.i18n/tru (str "it works" "when strings" "are concatenated'"))))
(deftest ^:parallel strict-apostrophes-doesnt-warn-on-good-ones
(are [form] (= []
(warnings (quote form)))
(metabase.util.i18n/tru "this isn''t bad")
(metabase.util.i18n/tru (str "not sure why you'" "'d do this" "... but ok"))
(metabase.util.i18n/tru "you can '{{0}}' do things like that")
(metabase.util.i18n/tru "or '{{ this or }}}}}}}}}}' that")))

View File

@@ -81,267 +81,273 @@
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.advanced-permissions.api.util-test/with-impersonations! [[:inner 0]]
metabase-enterprise.cache.config-test/with-temp-persist-models [[:block 1]]
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.card-test/with-cards-in-readable-collection [[:block 1]]
metabase.api.card-test/with-cards-in-writeable-collection [[:block 1]]
metabase.api.card-test/with-ordered-items [[:inner 0]]
metabase.api.card-test/with-temp-native-card! [[:block 1]]
metabase.api.card-test/with-temp-native-card-with-params! [[:block 1]]
metabase.api.collection-test/with-collection-hierarchy [[:block 1]]
metabase.api.collection-test/with-french-user-and-personal-collection [[:block 2]]
metabase.api.collection-test/with-some-children-of-collection [[:block 1]]
metabase.api.common/check [[:default]]
metabase.api.common/define-routes [[:block 0]]
metabase.api.common/let-404 [[:block 1]]
metabase.api.embed-test/do-response-formats [[:block 1]]
metabase.api.embed-test/with-embedding-enabled-and-new-secret-key [[:block 0]]
metabase.api.embed-test/with-embedding-enabled-and-temp-card-referencing [[:block 3]]
metabase.api.embed-test/with-embedding-enabled-and-temp-dashcard-referencing [[:block 3]]
metabase.api.embed-test/with-new-secret-key [[:block 0]]
metabase.api.embed-test/with-temp-card [[:block 1]]
metabase.api.embed-test/with-temp-dashcard [[:block 1]]
metabase.api.preview-embed-test/with-embedding-enabled-and-new-secret-key [[:block 0]]
metabase.api.preview-embed-test/with-new-secret-key [[:block 0]]
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.config/build-type-case [[:block 0]]
metabase.dashboard-subscription-test/with-link-card-fixture-for-dashboard [[:block 2]]
metabase.db.liquibase/with-liquibase [[:block 1]]
metabase.db.liquibase/with-scope-locked [[:block 1]]
metabase.db.schema-migrations-test.impl/test-migrations [[:block 2]]
metabase.db/with-application-db [[: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.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-query [[:inner 0]]
metabase.lib.util.match/match [[:inner 0]]
metabase.lib.util.match/match-one [[:inner 0]]
metabase.lib.util.match/replace [[:inner 0]]
metabase.lib.util.match/replace-in [[:inner 0]]
metabase.models.collection-test/with-collection-hierarchy [[:block 1]]
metabase.models.collection-test/with-current-user-perms-for-collections [[:block 1]]
metabase.models.collection-test/with-personal-and-impersonal-collections [[:block 1]]
metabase.models.dashboard-test/with-dash-in-collection [[:inner 0]]
metabase.models.interface/define-batched-hydration-method [[:inner 0]]
metabase.models.interface/define-simple-hydration-method [[:inner 0]]
metabase.models.params.chain-filter-test/with-clean-field-values-for-field [[:block 1]]
metabase.models.params.chain-filter-test/with-fk-field-to-field-remapping [[:block 0]]
metabase.models.params.chain-filter-test/with-human-readable-values-remapping [[:block 0]]
metabase.models.setting.multi-setting/define-multi-setting [[:inner 0]]
metabase.models.setting/defsetting [[:block 1]]
metabase.models.task-history/with-task-history [[:block 1]]
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.models.pulse-test/with-dashboard-subscription-in-collection [[:block 1]]
metabase.pulse.models.pulse-test/with-pulse-in-collection [[:inner 0]]
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-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.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.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.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.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.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.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.timeseries-query-processor-test.util/test-timeseries-drivers [[:block 0]]
metabase.timeseries-query-processor-test/run-mbql-query [[:inner 0]]
metabase.upload-test/with-upload-table! [[:inner 0]]
metabase.upload.types/with-currency [[:default]]
metabase.upload.types/with-parens [[:default]]
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]]
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]]
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/define-after-impl [[:default]]
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.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.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.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-query [[:inner 0]]
metabase.lib.util.match/match [[:inner 0]]
metabase.lib.util.match/match-one [[: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]]}}

View File

@@ -1,11 +1,11 @@
FROM mcr.microsoft.com/vscode/devcontainers/java:11
FROM mcr.microsoft.com/vscode/devcontainers/java:21
# Set up nodesource, install node, yarn, fontconfig for static viz, rlwrap for dev ergonomics
RUN ( curl -fsSL https://deb.nodesource.com/setup_18.x | bash ) \
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
RUN curl https://download.clojure.org/install/linux-install-1.11.1.1262.sh | bash
RUN curl https://download.clojure.org/install/linux-install-1.12.0.1488.sh | bash

View File

@@ -6,6 +6,10 @@
// can use this flag to enable it. This is set to true in CI
const shouldLintCssModules =
process.env.LINT_CSS_MODULES === "true" || process.env.CI;
const plugins = ["react", "no-only-tests", "ttag", "i18next"];
if (shouldLintCssModules) {
plugins.push("postcss-modules");
}
module.exports = {
rules: {
@@ -22,6 +26,9 @@ module.exports = {
},
],
"no-empty": [1, { allowEmptyCatch: true }],
// Note: adding this rule to a eslint config file in a subfolder will remove
// *not* carry over the restricted imports from parent folders, you will
// need to copy them over
"no-restricted-imports": [
"error",
{
@@ -111,7 +118,7 @@ module.exports = {
],
},
],
complexity: ["error", { max: 54 }],
complexity: ["error", { max: 55 }],
...(shouldLintCssModules
? {
"postcss-modules/no-undef-class": "error",
@@ -131,7 +138,7 @@ module.exports = {
"jest/globals": true,
},
parser: "babel-eslint",
plugins: ["react", "no-only-tests", "postcss-modules"],
plugins,
extends: [
"eslint:recommended",
"plugin:react/recommended",
@@ -142,6 +149,7 @@ module.exports = {
"plugin:import/typescript",
"plugin:depend/recommended",
"plugin:storybook/recommended",
"plugin:i18next/recommended",
],
settings: {
"import/internal-regex": "^metabase/|^metabase-lib/",
@@ -168,6 +176,7 @@ module.exports = {
files: ["*.js", "*.jsx", "*.ts", "*.tsx"],
rules: {
"no-unconditional-metabase-links-render": "error",
"no-color-literals": "error",
"no-literal-metabase-strings": "error",
"depend/ban-dependencies": [
"error",
@@ -187,17 +196,38 @@ module.exports = {
"*.unit.spec.*",
"frontend/src/metabase/admin/**/*",
"frontend/src/metabase/setup/**/*",
"enterprise/frontend/src/metabase-enterprise/whitelabel/**/*",
"frontend/lint/**/*",
"*.stories.*",
"stories-data.*",
"e2e/**/*",
"**/tests/*",
"release/**/*",
"webpack.config.js",
"rspack.config.js",
],
rules: {
"no-color-literals": "off",
"no-unconditional-metabase-links-render": "off",
"no-literal-metabase-strings": "off",
},
},
{
files: [
"*.unit.spec.*",
"frontend/lint/**/*",
"*.stories.*",
"stories-data.*",
"e2e/**/*",
"**/tests/*",
"release/**/*",
"webpack.config.js",
"rspack.config.js",
],
rules: {
"i18next/no-literal-string": "off",
},
},
{
extends: ["plugin:@typescript-eslint/recommended"],
files: ["*.ts", "*.tsx"],
@@ -245,6 +275,13 @@ module.exports = {
],
rules: {
"jest/valid-title": ["error", { ignoreTypeOfDescribeName: true }],
"jest/expect-expect": [
"error",
{
assertFunctionNames: ["expect*", "assert*"],
additionalTestBlockFunctions: [],
},
],
},
},
{
@@ -275,13 +312,20 @@ module.exports = {
message:
"You may not use base colors in the application, use semantic colors instead. (see colors.module.css)",
},
{
selector:
"CallExpression[callee.property.name='legacyQuery'] > ObjectExpression > Property[key.name='useStructuredQuery'][value.value=true]",
message: "StructuredQuery usage is forbidden. Use MLv2",
},
],
},
},
{
files: ["docs/**/snippets/**/*.{ts,tsx,js,jsx}"],
rules: {
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off",
"import/no-commonjs": "off",
"import/no-default-export": "off",
"import/order": "off",
"import/no-unresolved": "off",
"no-color-literals": "off",
},
},
],
};

332
.github/CODEOWNERS vendored
View File

@@ -3,255 +3,259 @@
enterprise/frontend/src/embedding-sdk @metabase/embedding
frontend/src/metabase/embedding-sdk @metabase/embedding
frontend/src/metabase/public/containers/PublicOrEmbeddedQuestion @metabase/embedding
frontend/src/metabase/public/containers/PublicOrEmbeddedDashboard @metabase/embedding
frontend/src/metabase/ui @metabase/core-frontend-admin-webapp
snowplow/* @metabase/data
e2e @filiphric
# snowplow/* @metabase/data
src/metabase/analytics/prometheus.clj @metabase/cloud-ops
.github @metabase/devexp
.clj-kondo @metabase/devexp
deps.edn @metabase/backend-developers
docs @metabase/tech-writers
#
# Backend modules <=> teams that own them
#
modules/drivers @metabase/drivers
# modules/drivers @metabase/drivers
enterprise/backend/src/metabase_enterprise/advanced_config @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/advanced_config @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/advanced_config @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/advanced_config @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/advanced_permissions @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/advanced_permissions @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/advanced_permissions @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/advanced_permissions @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/airgap @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/airgap @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/airgap @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/airgap @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/api @metabase/devexp
enterprise/backend/test/metabase_enterprise/api @metabase/devexp
# enterprise/backend/src/metabase_enterprise/api @metabase/devexp
# enterprise/backend/test/metabase_enterprise/api @metabase/devexp
enterprise/backend/src/metabase_enterprise/audit_app @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/audit_app @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/audit_app @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/audit_app @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/auth_provider @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/auth_provider @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/auth_provider @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/auth_provider @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/billing @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/billing @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/billing @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/billing @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/cache @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/cache @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/cache @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/cache @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/content_verification @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/content_verification @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/content_verification @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/content_verification @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/core @metabase/devexp
enterprise/backend/test/metabase_enterprise/core @metabase/devexp
# enterprise/backend/src/metabase_enterprise/core @metabase/devexp
# enterprise/backend/test/metabase_enterprise/core @metabase/devexp
enterprise/backend/src/metabase_enterprise/dashboard_subscription_filters @metabase/core-workflows
enterprise/backend/test/metabase_enterprise/dashboard_subscription_filters @metabase/core-workflows
# enterprise/backend/src/metabase_enterprise/dashboard_subscription_filters @metabase/core-workflows
# enterprise/backend/test/metabase_enterprise/dashboard_subscription_filters @metabase/core-workflows
enterprise/backend/src/metabase_enterprise/enhancements @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/enhancements @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/enhancements @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/enhancements @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/llm
# enterprise/backend/test/metabase_enterprise/llm
# # enterprise/backend/src/metabase_enterprise/llm
# # enterprise/backend/test/metabase_enterprise/llm
enterprise/backend/src/metabase_enterprise/query_reference_validation @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/query_reference_validation @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/query_reference_validation @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/query_reference_validation @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/sandbox @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/sandbox @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/sandbox @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/sandbox @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/scim @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/scim @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/scim @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/scim @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/search @metabase/core-workflows
enterprise/backend/test/metabase_enterprise/search @metabase/core-workflows
# enterprise/backend/src/metabase_enterprise/search @metabase/core-workflows
# enterprise/backend/test/metabase_enterprise/search @metabase/core-workflows
enterprise/backend/src/metabase_enterprise/serialization @metabase/core-workflows
enterprise/backend/test/metabase_enterprise/serialization @metabase/core-workflows
# enterprise/backend/src/metabase_enterprise/serialization @metabase/core-workflows
# enterprise/backend/test/metabase_enterprise/serialization @metabase/core-workflows
enterprise/backend/src/metabase_enterprise/snippet_collections @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/snippet_collections @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/snippet_collections @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/snippet_collections @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/sso @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/sso @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/sso @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/sso @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/stale @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/stale @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/stale @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/stale @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/stats @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/stats @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/stats @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/stats @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/task @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/task @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/task @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/task @metabase/core-backend-admin-webapp
enterprise/backend/src/metabase_enterprise/upload_management @metabase/core-backend-admin-webapp
enterprise/backend/test/metabase_enterprise/upload_management @metabase/core-backend-admin-webapp
# enterprise/backend/src/metabase_enterprise/upload_management @metabase/core-backend-admin-webapp
# enterprise/backend/test/metabase_enterprise/upload_management @metabase/core-backend-admin-webapp
src/metabase/actions @metabase/core-backend-admin-webapp
test/metabase/actions @metabase/core-backend-admin-webapp
# src/metabase/actions @metabase/core-backend-admin-webapp
# test/metabase/actions @metabase/core-backend-admin-webapp
src/metabase/activity_feed @metabase/core-backend-admin-webapp
test/metabase/activity_feed @metabase/core-backend-admin-webapp
# src/metabase/activity_feed @metabase/core-backend-admin-webapp
# test/metabase/activity_feed @metabase/core-backend-admin-webapp
src/metabase/analytics @metabase/core-backend-admin-webapp
test/metabase/analytics @metabase/core-backend-admin-webapp
# src/metabase/analytics @metabase/core-backend-admin-webapp
# test/metabase/analytics @metabase/core-backend-admin-webapp
src/metabase/analyze @metabase/drivers
test/metabase/analyze @metabase/drivers
# src/metabase/analyze @metabase/drivers
# test/metabase/analyze @metabase/drivers
src/metabase/api @metabase/devexp
test/metabase/api @metabase/devexp
# src/metabase/api @metabase/devexp
# test/metabase/api @metabase/devexp
src/metabase/audit @metabase/core-backend-admin-webapp
test/metabase/audit @metabase/core-backend-admin-webapp
# src/metabase/audit @metabase/core-backend-admin-webapp
# test/metabase/audit @metabase/core-backend-admin-webapp
src/metabase/auth_provider @metabase/core-backend-admin-webapp
test/metabase/auth_provider @metabase/core-backend-admin-webapp
# src/metabase/auth_provider @metabase/core-backend-admin-webapp
# test/metabase/auth_provider @metabase/core-backend-admin-webapp
src/metabase/bookmarks @metabase/core-backend-admin-webapp
test/metabase/bookmarks @metabase/core-backend-admin-webapp
# src/metabase/bookmarks @metabase/core-backend-admin-webapp
# test/metabase/bookmarks @metabase/core-backend-admin-webapp
src/metabase/cmd @metabase/devexp
test/metabase/cmd @metabase/devexp
# src/metabase/cmd @metabase/devexp
# test/metabase/cmd @metabase/devexp
src/metabase/channel @metabase/core-workflows
test/metabase/channel @metabase/core-workflows
# src/metabase/channel @metabase/core-workflows
# test/metabase/channel @metabase/core-workflows
src/metabase/cloud_migration @metabase/core-workflows
test/metabase/cloud_migration @metabase/core-workflows
# src/metabase/cloud_migration @metabase/core-workflows
# test/metabase/cloud_migration @metabase/core-workflows
src/metabase/cmd @metabase/devexp
test/metabase/cmd @metabase/devexp
# src/metabase/cmd @metabase/devexp
# test/metabase/cmd @metabase/devexp
src/metabase/config @metabase/devexp
test/metabase/config @metabase/devexp
# src/metabase/config @metabase/devexp
# test/metabase/config @metabase/devexp
src/metabase/core @metabase/devexp
test/metabase/core @metabase/devexp
# src/metabase/core @metabase/devexp
# test/metabase/core @metabase/devexp
src/metabase/db @metabase/core-backend-admin-webapp
test/metabase/db @metabase/core-backend-admin-webapp
# src/metabase/db @metabase/core-backend-admin-webapp
# test/metabase/db @metabase/core-backend-admin-webapp
src/metabase/driver @metabase/drivers
test/metabase/driver @metabase/drivers
# src/metabase/driver @metabase/drivers
# test/metabase/driver @metabase/drivers
src/metabase/eid_translation @metabase/core-backend-admin-webapp
test/metabase/eid_translation @metabase/core-backend-admin-webapp
# src/metabase/eid_translation @metabase/core-backend-admin-webapp
# test/metabase/eid_translation @metabase/core-backend-admin-webapp
src/metabase/embed @metabase/embedding
test/metabase/embed @metabase/embedding
# src/metabase/embed @metabase/embedding
# test/metabase/embed @metabase/embedding
src/metabase/events @metabase/devexp
test/metabase/events @metabase/devexp
# src/metabase/events @metabase/devexp
# test/metabase/events @metabase/devexp
src/metabase/formatter @metabase/core-backend-querying
test/metabase/formatter @metabase/core-backend-querying
# src/metabase/formatter @metabase/core-backend-querying
# test/metabase/formatter @metabase/core-backend-querying
src/metabase/indexed_entities @metabase/core-backend-querying
test/metabase/indexed_entities @metabase/core-backend-querying
# src/metabase/indexed_entities @metabase/core-backend-querying
# test/metabase/indexed_entities @metabase/core-backend-querying
src/metabase/integrations @metabase/core-workflows
test/metabase/integrations @metabase/core-workflows
# src/metabase/integrations @metabase/core-workflows
# test/metabase/integrations @metabase/core-workflows
src/metabase/legacy_mbql @metabase/core-backend-querying
test/metabase/legacy_mbql @metabase/core-backend-querying
# src/metabase/legacy_mbql @metabase/core-backend-querying
# test/metabase/legacy_mbql @metabase/core-backend-querying
src/metabase/lib @metabase/core-backend-querying
test/metabase/lib @metabase/core-backend-querying
# src/metabase/lib @metabase/core-backend-querying
# test/metabase/lib @metabase/core-backend-querying
src/metabase/logger @metabase/devexp
test/metabase/logger @metabase/devexp
# src/metabase/logger @metabase/devexp
# test/metabase/logger @metabase/devexp
src/metabase/login_history @metabase/core-backend-admin-webapp
test/metabase/login_history @metabase/core-backend-admin-webapp
# src/metabase/login_history @metabase/core-backend-admin-webapp
# test/metabase/login_history @metabase/core-backend-admin-webapp
src/metabase/model_persistence @metabase/core-backend-querying
test/metabase/model_persistence @metabase/core-backend-querying
# src/metabase/model_persistence @metabase/core-backend-querying
# test/metabase/model_persistence @metabase/core-backend-querying
src/metabase/models @metabase/devexp
test/metabase/models @metabase/devexp
# src/metabase/models @metabase/devexp
# test/metabase/models @metabase/devexp
src/metabase/moderation @metabase/core-backend-admin-webapp
test/metabase/moderation @metabase/core-backend-admin-webapp
# src/metabase/moderation @metabase/core-backend-admin-webapp
# test/metabase/moderation @metabase/core-backend-admin-webapp
src/metabase/notification @metabase/core-workflows
test/metabase/notification @metabase/core-workflows
# src/metabase/notification @metabase/core-workflows
# test/metabase/notification @metabase/core-workflows
src/metabase/permissions @metabase/core-backend-admin-webapp
test/metabase/permissions @metabase/core-backend-admin-webapp
# src/metabase/permissions @metabase/core-backend-admin-webapp
# test/metabase/permissions @metabase/core-backend-admin-webapp
src/metabase/plugins @metabase/devexp
test/metabase/plugins @metabase/devexp
# src/metabase/plugins @metabase/devexp
# test/metabase/plugins @metabase/devexp
src/metabase/premium_features @metabase/core-backend-admin-webapp
test/metabase/premium_features @metabase/core-backend-admin-webapp
# src/metabase/premium_features @metabase/core-backend-admin-webapp
# test/metabase/premium_features @metabase/core-backend-admin-webapp
src/metabase/public_settings @metabase/core-backend-admin-webapp
test/metabase/public_settings @metabase/core-backend-admin-webapp
# src/metabase/public_settings @metabase/core-backend-admin-webapp
# test/metabase/public_settings @metabase/core-backend-admin-webapp
src/metabase/public_sharing @metabase/core-backend-admin-webapp
test/metabase/public_sharing @metabase/core-backend-admin-webapp
# src/metabase/public_sharing @metabase/core-backend-admin-webapp
# test/metabase/public_sharing @metabase/core-backend-admin-webapp
src/metabase/pulse @metabase/core-workflows
test/metabase/pulse @metabase/core-workflows
# src/metabase/pulse @metabase/core-workflows
# test/metabase/pulse @metabase/core-workflows
src/metabase/query_analysis @metabase/core-backend-querying
test/metabase/query_analysis @metabase/core-backend-querying
# src/metabase/query_analysis @metabase/core-backend-querying
# test/metabase/query_analysis @metabase/core-backend-querying
src/metabase/query_processor @metabase/core-backend-querying
test/metabase/query_processor @metabase/core-backend-querying
# src/metabase/query_processor @metabase/core-backend-querying
# test/metabase/query_processor @metabase/core-backend-querying
src/metabase/request @metabase/devexp
test/metabase/request @metabase/devexp
# src/metabase/request @metabase/devexp
# test/metabase/request @metabase/devexp
src/metabase/revisions @metabase/core-backend-admin-webapp
test/metabase/revisions @metabase/core-backend-admin-webapp
# src/metabase/revisions @metabase/core-backend-admin-webapp
# test/metabase/revisions @metabase/core-backend-admin-webapp
src/metabase/sample_data @metabase/core-backend-admin-webapp
test/metabase/sample_data @metabase/core-backend-admin-webapp
# src/metabase/sample_data @metabase/core-backend-admin-webapp
# test/metabase/sample_data @metabase/core-backend-admin-webapp
src/metabase/search @metabase/core-workflows
test/metabase/search @metabase/core-workflows
# src/metabase/search @metabase/core-workflows
# test/metabase/search @metabase/core-workflows
src/metabase/segments @metabase/core-backend-querying
test/metabase/segments @metabase/core-backend-querying
# src/metabase/segments @metabase/core-backend-querying
# test/metabase/segments @metabase/core-backend-querying
src/metabase/server @metabase/devexp
test/metabase/server @metabase/devexp
# src/metabase/server @metabase/devexp
# test/metabase/server @metabase/devexp
src/metabase/session @metabase/core-backend-admin-webapp
test/metabase/session @metabase/core-backend-admin-webapp
# src/metabase/session @metabase/core-backend-admin-webapp
# test/metabase/session @metabase/core-backend-admin-webapp
src/metabase/setup @metabase/core-backend-admin-webapp
test/metabase/setup @metabase/core-backend-admin-webapp
# src/metabase/setup @metabase/core-backend-admin-webapp
# test/metabase/setup @metabase/core-backend-admin-webapp
src/metabase/sso @metabase/core-backend-admin-webapp
test/metabase/sso @metabase/core-backend-admin-webapp
# src/metabase/sso @metabase/core-backend-admin-webapp
# test/metabase/sso @metabase/core-backend-admin-webapp
src/metabase/sync @metabase/drivers
test/metabase/sync @metabase/drivers
# src/metabase/sync @metabase/drivers
# test/metabase/sync @metabase/drivers
src/metabase/task @metabase/devexp
test/metabase/task @metabase/devexp
# src/metabase/task @metabase/devexp
# test/metabase/task @metabase/devexp
src/metabase/tiles @metabase/core-backend-dashviz
test/metabase/tiles @metabase/core-backend-dashviz
# src/metabase/tiles @metabase/core-backend-dashviz
# test/metabase/tiles @metabase/core-backend-dashviz
src/metabase/timeline @metabase/core-backend-dashviz
test/metabase/timeline @metabase/core-backend-dashviz
# src/metabase/timeline @metabase/core-backend-dashviz
# test/metabase/timeline @metabase/core-backend-dashviz
src/metabase/types @metabase/core-backend-querying
test/metabase/types @metabase/core-backend-querying
# src/metabase/types @metabase/core-backend-querying
# test/metabase/types @metabase/core-backend-querying
src/metabase/upload @metabase/core-backend-admin-webapp
test/metabase/upload @metabase/core-backend-admin-webapp
# src/metabase/upload @metabase/core-backend-admin-webapp
# test/metabase/upload @metabase/core-backend-admin-webapp
src/metabase/user_key_value @metabase/core-backend-admin-webapp
test/metabase/user_key_value @metabase/core-backend-admin-webapp
# src/metabase/user_key_value @metabase/core-backend-admin-webapp
# test/metabase/user_key_value @metabase/core-backend-admin-webapp
src/metabase/util @metabase/devexp
test/metabase/util @metabase/devexp
# src/metabase/util @metabase/devexp
# test/metabase/util @metabase/devexp
src/metabase/xrays @metabase/core-backend-querying
test/metabase/xrays @metabase/core-backend-querying
# src/metabase/xrays @metabase/core-backend-querying
# test/metabase/xrays @metabase/core-backend-querying

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 [POEditor project](https://poeditor.com/join/project/ynjQmwSsGh) 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) (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.
Closes https://github.com/metabase/metabase/issues/[issue_number]

View File

@@ -1,116 +0,0 @@
name: Build ee-extra
description: Build Metabase Enterprise Edition with extra features
inputs:
java-version:
required: true
default: 21
iam-role:
description: "The IAM role to assume"
required: true
runs:
using: composite
steps:
- name: Prepare Java
uses: actions/setup-java@v3
with:
java-version: ${{ inputs.java-version }}
distribution: 'temurin'
- name: Reveal its original version.properties
run: jar xf ./bin/docker/metabase.jar version.properties && cat version.properties
shell: bash
- name: get major version
id: major_version
run: echo "major_version=$(cat version.properties | grep 'tag=' | cut -d'.' -f2)" >> $GITHUB_OUTPUT
shell: bash
- name: get drivers registry
run: |
curl -OL https://raw.githubusercontent.com/metabase/metabase-registry/main/registry.yaml
shell: bash
- uses: actions/setup-node@v4
with:
node-version: lts/Jod # 22.x.x
- run: rm package.json && npm install yaml
shell: bash
- name: parse drivers registry
uses: actions/github-script@v7
id: drivers_registry
with:
script: | # js
const { parse } = require('yaml');
const fs = require('fs');
const registry = parse(fs.readFileSync('registry.yaml', 'utf8'));
const drivers = registry.drivers;
const majorVersion = '${{ steps.major_version.outputs.major_version }}';
const getDriverUrl = (driverName) => {
const driver = drivers.find(driver => driver.name === driverName);
if (!driver) {
throw new Error(`Driver ${driverName} not found in the registry`);
}
const driverUrl = driver.versions[majorVersion] ?? driver.versions.default;
if (!driverUrl) {
throw new Error(`Driver ${driverName} version ${majorVersion} not found in the registry`);
}
return driverUrl;
};
const extraDrivers = {
firebolt: getDriverUrl('firebolt'),
starburst: getDriverUrl('starburst'),
clickhouse: getDriverUrl('clickhouse'),
materialize: getDriverUrl('materialize'),
};
console.log(extraDrivers);
return extraDrivers;
- name: Download Firebolt driver
run: |
curl -OL ${{ fromJson(steps.drivers_registry.outputs.result).firebolt }}
working-directory: modules
shell: bash
- name: Download Starburst driver
run: |
curl -OL ${{ fromJson(steps.drivers_registry.outputs.result).starburst }}
shell: bash
working-directory: modules
- name: Download Clickhouse driver
run: |
curl -OL ${{ fromJson(steps.drivers_registry.outputs.result).clickhouse }}
shell: bash
working-directory: modules
- name: Download Materialize driver
run: |
curl -OL ${{ fromJson(steps.drivers_registry.outputs.result).materialize }}
shell: bash
working-directory: modules
- name: Bundle additional drivers into the Uberjar
run: jar uf bin/docker/metabase.jar modules/*.jar
shell: bash
- name: Launch uberjar
run: >-
java --add-opens java.base/java.nio=ALL-UNNAMED -jar ./bin/docker/metabase.jar &
shell: bash
- name: Wait for Metabase to start
run: while ! curl 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
shell: bash
- name: Kill the java process
run: pkill -f metabase.jar
shell: bash
- name: configure aws credentials
if: ${{ github.ref_name == 'master' }}
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ inputs.iam-role }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: us-east-1
- name: Login to Amazon ECR
if: ${{ github.ref_name == 'master' }}
uses: aws-actions/amazon-ecr-login@v2

View File

@@ -46,7 +46,7 @@ runs:
echo "git reset HEAD~1" > ./backport.sh
echo "rm ./backport.sh" >> ./backport.sh
echo "git cherry-pick ${COMMIT}" >> ./backport.sh
echo "echo 'Resolve conflicts and force push this branch'" >> ./backport.sh
echo "echo 'Resolve conflicts and force push this branch.\n\nTo backport translations run: bin/i18n/merge-translations <release-branch>'" >> ./backport.sh
chmod +x ./backport.sh
git add ./backport.sh
git commit -m "Add backport resolution script"

View File

@@ -0,0 +1,63 @@
name: Fetch artifact
description: Fetches a specific artifact and downloads it to the current directory
inputs:
name:
description: The name of the artifact to fetch
required: true
runs:
using: "composite"
steps:
- name: find_release_artifact
id: find_release_artifact
uses: actions/github-script@v7
with:
result-encoding: string
script: | # js
const fs = require('fs');
const artifacts = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
name: "${{ inputs.name }}",
per_page: 1,
});
if (!artifacts.data?.artifacts?.[0]?.id) {
throw new Error(`No artifacts found for ${{ inputs.commit }}`);
}
const artifact_id = artifacts.data.artifacts[0].id;
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact_id,
archive_format: 'zip',
});
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/mb.zip`, Buffer.from(download.data));
- name: unzip uberjar artifact
shell: bash
run: unzip mb.zip
- name: Move the Uberjar
shell: bash
run: | # bash
if [ -e "metabase.jar" ]; then
echo "metabase.jar is already in the right place"
elif [ -e "target/uberjar/metabase.jar" ]; then
echo "moving metabase.jar to current directory"
mv target/uberjar/metabase.jar metabase.jar
else
echo "Could not find the metabase.jar file"
exit 1
fi
- name: Verify that this is a valid JAR file
shell: bash
run: file --mime-type ./metabase.jar
- name: Reveal its version.properties
shell: bash
run: jar xf metabase.jar version.properties && cat version.properties

View File

@@ -1,5 +1,13 @@
name: Notify Pull Request
inputs:
remove-previous-comment:
required: false
type: boolean
default: false
add-new-comment:
required: false
type: boolean
default: true
message:
required: true
include-log:
@@ -9,7 +17,44 @@ inputs:
runs:
using: "composite"
steps:
- uses: actions/github-script@v7
- name: Remove previous pull-request comment
uses: actions/github-script@v7
if: ${{ inputs.remove-previous-comment == 'true' && always() && github.event_name == 'pull_request' }}
with:
script: |
const pr = context.payload.pull_request ?? context.payload.issue;
if (!pr) {
console.error("This action can only be run on pull requests");
return;
}
const { owner, repo } = context.repo;
const { data: comments } = await github.rest.issues.listComments({
owner,
repo,
issue_number: pr.number,
}).catch(console.error);
if (!comments) {
return;
}
const message = "${{ inputs.message }}";
const comment = comments.find((comment) => comment.body.includes(message));
if (comment) {
await github.rest.issues.deleteComment({
owner,
repo,
comment_id: comment.id,
});
}
- name: Notify pull-request
uses: actions/github-script@v7
if: ${{ inputs.add-new-comment == 'true' && always() && github.event_name == 'pull_request' }}
id: notify-pull-request
with:
result-encoding: string
@@ -21,7 +66,7 @@ runs:
return;
}
const message = "${{ inputs.message }}"
const message = "${{ inputs.message }}";
const shouldIncludeLog = ${{ inputs.include-log }}.toString() === "true";
const author = context.payload.sender.login;

View File

@@ -1,6 +1,12 @@
name: Prepare cypress environment
description: Cypress preparation steps
inputs:
working-directory:
description: "Optional working directory for yarn commands"
required: false
default: "."
outputs:
chrome-path:
description: Path to the custom Chrome executable
@@ -33,3 +39,4 @@ runs:
yarn cypress cache list
yarn cypress verify
shell: bash
working-directory: ${{ inputs.working-directory }}

View File

@@ -23,6 +23,8 @@ runs:
run: yarn build-static-viz
shell: bash
if: ${{ inputs.build-static-viz == 'true' }}
env:
MB_EDITION: ee
- name: Test database driver
run: clojure -X:dev:ci:ee:ee-dev:drivers:drivers-dev:test ${{ inputs.test-args }}
shell: bash

View File

@@ -0,0 +1,14 @@
name: Create Backend Dep Bump PRs
inputs:
github-token:
required: true
runs:
using: "composite"
steps:
- name: Open PRs to Bump Backend Deps
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
shell: bash
run: bash ${{ github.action_path }}/upgrade-deps.sh

View File

@@ -0,0 +1,81 @@
#! /usr/bin/env bash
# Script is adapted from https://github.com/nnichols/clojure-dependency-update-action/blob/master/dependency-check.sh
# make sure we're in the root dir of the metabase repo
script_dir=`dirname "${BASH_SOURCE[0]}"`
cd "$script_dir/../../.."
echo `pwd`
# Configure Git user opening PRs to the GH Actions bot.
git config --global user.email "metabase-bot@metabase.com"
git config --global user.name "Metabase bot"
# Run antq to check for outdated dependencies and output to UPGRADE_LIST
echo "::group::Checking for outdated dependencies"
UPGRADE_LIST=$(clojure -M:outdated --reporter=format --error-format="{{name}},{{version}},{{latest-version}},{{diff-url}}")
echo "$UPGRADE_LIST"
echo "::endgroup::"
# Parse the output of antq into a list of upgrades, and remove any failed fetches
UPGRADES=$(echo ${UPGRADE_LIST} | sed '/Failed to fetch/d' | sed '/Unable to fetch/d' | sed '/Logging initialized/d' | sort -u)
echo "::group::Upgrades"
echo ${UPGRADES}
echo "::endgroup::"
# Make sure we're on master
git checkout master
# Iterate over all upgrades
for upgrade in $UPGRADES; do
echo "::group::Processing upgrade"
# Parse each upgrade into its constituent parts
IFS=',' temp=($upgrade)
DEP_NAME=${temp[0]}
OLD_VERSION=${temp[1]}
NEW_VERSION=${temp[2]}
DIFF_URL=${temp[3]}
MODIFIED_FILE=${temp[4]}
BRANCH_NAME="dependencies/clojure/$DEP_NAME-$NEW_VERSION"
# Checkout the branch if it exists, otherwise create it
echo "Checking out" $BRANCH_NAME
git checkout $BRANCH_NAME || git checkout -b $BRANCH_NAME
# IF we successfully created a new branch, update the dependency
if [[ $? == 0 ]]; then
# Use antq to update the dependency
echo "Updating" $DEP_NAME "version" $OLD_VERSION "to" $NEW_VERSION
UPDATE_CMD="clojure -M:outdated --upgrade --force --focus=${DEP_NAME}"
eval ${UPDATE_CMD} || $(echo "Cannot update ${DEP_NAME}. Continuing" && git checkout master && continue)
TITLE="Bump $DEP_NAME from $OLD_VERSION to $NEW_VERSION"
BODY="Inspect dependency changes here: $DIFF_URL"
# Commit the dependency update, and link to the diff
git add deps.edn modules
git commit -m ${TITLE} -m ${BODY} --no-verify
git push -u origin $BRANCH_NAME
# Open the PR
echo "Opening pull request for" $DEP_NAME
PR_URL=$(gh pr create --base master --head $BRANCH_NAME --label "no-backport" --title ${TITLE} --body ${BODY})
PR_NUMBER=${PR_URL##*/}
echo "Opened PR #$PR_NUMBER"
# Make the PR Auto-Merge
gh pr merge -R metabase/metabase --squash --auto "$PR_NUMBER"
# Print a blank line, and reset the branch
echo "Checking out master" master
git checkout master
fi
echo "::endgroup::"
done

View File

@@ -18,6 +18,9 @@ inputs:
required: true
trunk-api-token:
required: true
variant:
required: false
default: ''
runs:
using: "composite"
@@ -49,6 +52,7 @@ runs:
uses: trunk-io/analytics-uploader@main
with:
junit-paths: ${{ inputs.input-path }}
variant: ${{ inputs.variant || inputs.output-name }}
org-slug: metabase
token: ${{ inputs.trunk-api-token }}
continue-on-error: true

View File

@@ -6,7 +6,7 @@ files:
# migrations related files
'resources/migrations/**':
- team:core-workflows
'src/metabase/db/custom_migrations.clj':
'src/metabase/app_db/custom_migrations.clj':
- team:core-workflows
options:

View File

@@ -26,16 +26,21 @@ frontend_sources: &frontend_sources
- "babel.config.json"
- ".eslintrc.js"
- "postcss.config.js"
- "rspack.config.js"
- "webpack.config.js"
- "webpack.embedding-sdk.config.js"
- "webpack.static-viz.config.js"
- ".nvmrc"
frontend_embedding_sdk_sources:
- *frontend_sources
frontend_specs: &frontend_specs
- *shared_specs
- "frontend/test/**"
- "frontend/**/tests/**"
- "frontend/**/*.unit.*"
- ".github/**/*.unit.spec.*"
- "jest.config.js"
- "jest.tz.unit.conf.json"
@@ -105,9 +110,6 @@ e2e_ci: &e2e_ci
e2e_specs: &e2e_specs
- "**/*.cy.*.js"
- "**/*.cy.*.ts"
- "e2e/runner/**"
- "e2e/support/**"
- "e2e/snapshot*/**"
e2e_cross_version: &e2e_cross_version
- ".github/workflows/e2e-cross-version.yml"
@@ -118,12 +120,14 @@ e2e_all:
- *e2e_ci
- *sources
- *e2e_specs
- "e2e/**"
snowplow:
- ".github/workflows/snowplow.yml"
- "snowplow/**"
documentation:
- ".typedoc/**"
- "docs/**"
- "**/*.md"

84
.github/scripts/build-e2e-matrix.js vendored Executable file
View File

@@ -0,0 +1,84 @@
// This script is used in .github/workflows/e2e-matrix-builder.yml
// its aim is to split the e2e test matrix into multiple jobs
// 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",
tags: "@OSS @smoke+-@EE",
specs: DEFAULT_SPEC_PATTERN,
},
{ name: "mongo", tags: "@mongo", specs: DEFAULT_SPEC_PATTERN },
];
/**
*
* @param {*} inputSpecs - specs, which were changed in the PR, separated by comma
* .e.g e2e/test/scenarios/onboarding/command-palette.cy.spec.js,e2e/test/scenarios/question/document-title.cy.spec.js
* or a pattern like DEFAULT_SPEC_PATTERN
*/
function buildMatrix(options, inputSpecs, inputChunks) {
const { java, defaultRunner } = options;
// number of specs per chunk when running specific specs
const SPECS_PER_CHUNK = 5;
const defaultOptions = {
"java-version": java,
runner: defaultRunner,
edition: "ee",
};
const isDefaultSpecPattern =
inputSpecs === "" || inputSpecs === DEFAULT_SPEC_PATTERN;
console.log("Processed specs value:", inputSpecs);
console.log("Is default pattern:", isDefaultSpecPattern);
let regularChunks;
if (isDefaultSpecPattern) {
regularChunks = inputChunks - specialTestConfigs.length;
} else {
// when pattern is not default, it means we passed some custom list of the changed specs
// so we need to calculate how many chunks we need to run
const matchingSpecsCount = inputSpecs.split(",").length;
regularChunks = Math.max(
1,
Math.ceil(matchingSpecsCount / SPECS_PER_CHUNK),
);
}
const regularTests = new Array(regularChunks).fill(1).map((files, index) => ({
name: `e2e-group-${index + 1}`,
// works when specs less than 5, otherwise seems all chunks will contain
// same specs
...(!isDefaultSpecPattern && {
specs: inputSpecs
.split(",")
.slice(SPECS_PER_CHUNK * index, SPECS_PER_CHUNK * (index + 1))
.join(","),
}),
}));
const testSets = isDefaultSpecPattern
? regularTests.concat(specialTestConfigs)
: regularTests;
const config = testSets.map((options) => ({
...defaultOptions,
...options,
}));
return { config, regularChunks, isDefaultSpecPattern };
}
module.exports = { buildMatrix };

View File

@@ -0,0 +1,97 @@
const { buildMatrix } = require("./build-e2e-matrix");
describe("buildMatrix", () => {
const options = {
java: "11",
defaultRunner: "ubuntu-22.04",
};
const testBuildMatrix = (entry, chunks) =>
buildMatrix(options, entry, chunks);
it("should calculate correct regular chunks with default parameters", () => {
const result = testBuildMatrix("./e2e/test/scenarios/**/*.cy.spec.*", 30);
expect(result.regularChunks).toBe(27);
});
it("should create correct number of configuration objects", () => {
const result = testBuildMatrix("./e2e/test/scenarios/**/*.cy.spec.*", 10);
expect(result.config.length).toBe(10);
});
it("should apply default specs path when empty entry is provided", () => {
const result = testBuildMatrix("", 5);
expect(result.regularChunks).toBe(2);
expect(result.config.length).toBe(5);
});
it("should name regular test groups sequentially", () => {
const result = testBuildMatrix("./e2e/test/scenarios/**/*.cy.spec.*", 10);
const regularTests = result.config.filter((cfg) =>
cfg.name.startsWith("e2e-group-"),
);
regularTests.forEach((test, index) => {
expect(test.name).toBe(`e2e-group-${index + 1}`);
});
});
it("should handle case when input chunks equals special tests count", () => {
const result = testBuildMatrix("./e2e/test/scenarios/**/*.cy.spec.*", 3);
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");
});
it("should correctly calculate regularChunks for non-default spec pattern", () => {
const entry = "file.cy.spec.js,".repeat(12).slice(0, -1);
const result = testBuildMatrix(entry, 10);
// For 12 matching specs with SPECS_PER_CHUNK=5, we expect ceil(12/5) = 3 chunks
expect(result.regularChunks).toBe(3);
const firstGroupSpecs = result.config[0].specs.split(",").length;
const secondGroupSpecs = result.config[1].specs.split(",").length;
const thirdGroupSpecs = result.config[2].specs.split(",").length;
expect(firstGroupSpecs).toBe(5);
expect(secondGroupSpecs).toBe(5);
expect(thirdGroupSpecs).toBe(2);
});
it("should return isDefaultSpecPattern as true when empty or default value is provided", () => {
let result = testBuildMatrix("", 5);
expect(result.isDefaultSpecPattern).toBe(true);
result = testBuildMatrix("./e2e/test/scenarios/**/*.cy.spec.*", 5);
expect(result.isDefaultSpecPattern).toBe(true);
});
it("should return isDefaultSpecPattern as false when non-default spec pattern is provided", () => {
const result = testBuildMatrix("test1.cy.spec.js,test2.cy.spec.js", 1);
expect(result.isDefaultSpecPattern).toBe(false);
});
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");
});
it("should not return special test configs when non-default spec pattern is provided", () => {
const result = testBuildMatrix("test1.cy.spec.js,test2.cy.spec.js", 50);
expect(result.config.length).toBe(1);
expect(result.config[0].name).toBe("e2e-group-1");
});
});

241
.github/scripts/update-pr-with-issues.js vendored Normal file
View File

@@ -0,0 +1,241 @@
const https = require('https');
function getLinkedIssues(body) {
const matches = body.match(
/(close(s|d)?|fixe?(s|d)?|resolve(s|d)?)(:?) (#|https?:\/\/github\.com\/.+metabase\/issues\/)(\d+)/gi,
);
if (matches) {
console.log(`Matches: ${matches}`);
return matches.map(m => {
const numberMatch = m.match(/\d+/);
return numberMatch ? numberMatch[0] : null;
});
}
return [];
}
// Function to make HTTPS requests
function httpsRequest(options, data = null) {
return new Promise((resolve, reject) => {
const req = https.request(options, (res) => {
let responseData = '';
res.on('data', (chunk) => {
responseData += chunk;
});
res.on('end', () => {
if (res.statusCode >= 200 && res.statusCode < 300) {
try {
resolve(JSON.parse(responseData));
} catch (e) {
resolve(responseData);
}
} else {
reject(new Error(`Request failed with status code ${res.statusCode}: ${responseData}`));
}
});
});
req.on('error', (error) => {
reject(error);
});
if (data) {
req.write(data);
}
req.end();
});
}
// Makes an HTTPS request with exponential backoff retry logic
async function httpsRequestWithBackoff(options, data = null, backoffOptions = {}) {
// Set default backoff options:
const {
maxRetries = 8,
totalDurationSeconds = 60
} = backoffOptions;
let retries = 0;
let delay = 500; // Start with a .5 second delay
// Calculate a reasonable initial delay based on total duration and max retries
// This helps distribute the retry attempts across the total allowed duration
const totalDurationMs = totalDurationSeconds * 1000;
// Track the start time
const startTime = Date.now();
// Ensure data is stringified if it's an object
const requestData = data ? (typeof data === 'string' ? data : JSON.stringify(data)) : null;
while (true) {
try {
const response = await httpsRequest(options, requestData);
return response; // Success: Return the data
} catch (error) {
retries++;
const elapsedMs = Date.now() - startTime;
const timeRemaining = totalDurationMs - elapsedMs;
// Stop retrying if we've hit max retries or exceeded the total duration
if (retries >= maxRetries || timeRemaining <= 0) {
console.error(`Failed after ${retries} retries (${Math.round(elapsedMs/1000)}s elapsed):`);
throw error;
}
// Calculate the next delay with exponential backoff and jitter
delay = Math.min(delay * 2 * (0.8 + Math.random() * 0.4), timeRemaining);
console.log(`Request failed (attempt ${retries}/${maxRetries}). Retrying in ${Math.round(delay)}ms... (${Math.round(timeRemaining/1000)}s remaining)`);
// Wait for the calculated delay before trying again
await new Promise(resolve => setTimeout(resolve, delay));
}
}
}
async function link_issues(github) {
try {
// Get environment variables
const githubToken = process.env.GITHUB_TOKEN;
const linearApiKey = process.env.LINEAR_API_KEY;
const prNumber = process.env.PR_NUMBER;
const repoOwner = process.env.REPO_OWNER;
const repoName = process.env.REPO_NAME;
if (!githubToken || !linearApiKey || !prNumber || !repoOwner || !repoName) {
console.error('Missing required environment variables');
process.exit(1);
}
// Get PR details from GitHub API
const prInfo = await github.rest.issues.get({
owner: repoOwner,
repo: repoName,
issue_number: prNumber
}).catch((err) => {
console.log("error getting prInfo:\n" + err);
});
console.log('PR Info:\n' + JSON.stringify(prInfo, null, 2) + "\n");
if (prInfo &&
prInfo.data &&
prInfo.data.labels &&
prInfo.data.labels.some(label => label.name === "no-auto-issue-links")) {
console.log('PR has "no-auto-issue-links" label, skipping...');
return;
}
const prUrl = prInfo.data.html_url;
console.log(`Processing PR: ${prUrl}`);
// Query Linear API to find tasks linked to this PR
const linearQuery = JSON.stringify({
query: `
query {
attachmentsForURL(url: "${prUrl}") {
nodes {
issue {
id
identifier
attachments {
nodes {url}}}}}}`});
console.log('--- Linear API query ---');
console.log(linearQuery);
console.log('----- End of query -----');
const linearData = await httpsRequestWithBackoff({
hostname: 'api.linear.app',
path: '/graphql',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': linearApiKey
}
},
linearQuery,
{ maxRetries: 8, totalDurationSeconds: 60 });
console.log('Linear API response:');
console.log(JSON.stringify(linearData) + "\n");
if (!linearData.data || !linearData.data.attachmentsForURL || linearData.data.attachmentsForURL.nodes.length === 0) {
console.log('No Linear tasks linked to this PR');
return;
} else {
console.log(`Found ${linearData.data.attachmentsForURL.nodes.length} linked Linear tasks`);
}
// Extract GitHub issue numbers from all attachments in the linked Linear task
const issueNumbers = [];
for (const node of linearData.data.attachmentsForURL.nodes) {
console.log(`checking node task: ${JSON.stringify(node)}`)
const linearIssue = node.issue;
for (const attachment of linearIssue.attachments.nodes) {
const url = attachment.url;
console.log(`--> checking url: ${url}`)
const match = url.match(/github\.com\/metabase\/metabase\/issues\/(\d+)/);
if (match) {
console.log(`--> found match: ${match[1]}`)
issueNumbers.push(match[1]);
console.log("")
}
}
}
console.log(`Found linked GitHub issues: ${JSON.stringify(issueNumbers)}`);
if (issueNumbers.length === 0) {
console.log(`Found linked GitHub issues: ${JSON.stringify(issueNumbers)}`);
console.log('No GitHub issues linked to the Linear task');
return;
}
let body = prInfo.data.body || '';
let linked_issues = getLinkedIssues(body);
console.log(`Linked issues: ${linked_issues}`);
let newBody = body || '';
let issueNumbersToAdd = issueNumbers.filter(num => !linked_issues.includes(num));
console.log(`Issue numbers to add: ${issueNumbersToAdd}`);
if (issueNumbersToAdd.length > 0) {
// Generate closing references
const closingRefs = issueNumbersToAdd.map(num => `closes #${num}`).join(' ');
const messagePreamble = "<!-- Added by 'Add Issue References to PR' GitHub Action. To disable linking, add 'no-auto-issue-links' label to your PR. -->"
newBody = `${messagePreamble} ${closingRefs}\n` + newBody;
// Update PR body with new closing references
await github.rest.issues.update({
owner: repoOwner,
repo: repoName,
issue_number: prNumber,
body: newBody
});
console.log(`Updated PR #${prNumber} with issue references:\n ${closingRefs}`);
} else {
console.log('PR already contains all closing references');
}
} catch (error) {
console.error('Error:', error.message);
process.exit(1);
}
}
module.exports = {link_issues};

30
.github/team.json vendored
View File

@@ -3,24 +3,29 @@
{
"name": "Querying",
"label": ".Team/Querying",
"projectUrl": "https://github.com/orgs/metabase/projects/97/views/1",
"members": [
"ranquild",
"kamilmielnik",
"romeovs",
"bshepherdson",
"metamben",
"lbrdnk",
"appleby",
"uladzimirdev",
"wzimrin",
"ericnormand"
]
},
{
"name": "Semantic Layer",
"label": ".Team/SemanticLayer",
"members": [
"kamilmielnik",
"lbrdnk",
"bronsa"
]
},
{
"name": "Drivers",
"label": ".Team/Drivers",
"projectUrl": "https://github.com/orgs/metabase/projects/98/views/1",
"members": [
"snoe",
"rileythomp"
@@ -29,7 +34,6 @@
{
"name": "Embedding",
"label": ".Team/Embedding",
"projectUrl": "https://github.com/orgs/metabase/projects/88/views/1",
"members": [
"WiNloSt",
"oisincoveney",
@@ -41,7 +45,6 @@
{
"name": "Workflows",
"label": ".Team/Workflows",
"projectUrl": "https://github.com/orgs/metabase/projects/50/views/1",
"members": [
"qnkhuat",
"piranha",
@@ -74,7 +77,8 @@
"kulyk",
"tsplude",
"lorem--ipsum",
"noahmoss"
"noahmoss",
"bpander"
]
},
{
@@ -84,6 +88,18 @@
"camsaul",
"escherize"
]
},
{
"name": "Metabot",
"label": ".Team/Metabot",
"members": [
"somtom"
]
},
{
"name": "Product Growth",
"label": ".Team/ProductGrowth",
"members": ["nemanjaglumac"]
}
]
}

38
.github/workflows/athena.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Publish Athena JDBC Driver
on:
workflow_dispatch:
inputs:
version:
description: 'Athena JDBC driver version to publish'
required: true
type: string
jobs:
deploy:
name: Publish Athena JDBC Driver
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Set up Babashka
uses: turtlequeue/setup-babashka@v1.7.0
with:
babashka-version: 1.12.197
- name: Set up AWS CLI
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_S3_MAVEN_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_S3_MAVEN_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Deploy Athena JDBC driver
run: ./bin/athena.bb ${{ github.event.inputs.version }} --deploy
- name: Verify deployment
run: |
aws s3 ls s3://metabase-maven-downloads/com/metabase/athena-jdbc/${{ github.event.inputs.version }}/
echo "Athena JDBC driver version ${{ github.event.inputs.version }} has been deployed"

View File

@@ -19,6 +19,8 @@ jobs:
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
- name: Upload coverage to codecov.io

View File

@@ -24,7 +24,7 @@ jobs:
with:
m2-cache-key: 'kondo'
- name: Run clj-kondo
run: ./bin/kondo.sh
run: ./bin/mage kondo
be-linter-eastwood:
if: ${{ !inputs.skip }}
@@ -114,6 +114,8 @@ jobs:
- 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
@@ -183,7 +185,7 @@ jobs:
with:
m2-cache-key: 'cljfmt'
- name: Run cljfmt
run: clojure -T:cljfmt check
run: ./bin/mage cljfmt-all --force-check
be-tests-result:
needs:

View File

@@ -18,7 +18,6 @@ jobs:
timeout-minutes: 3
outputs:
frontend_all: ${{ steps.changes.outputs.frontend_all }}
e2e_specs: ${{ steps.changes.outputs.e2e_specs }}
steps:
- uses: actions/checkout@v4
- name: Test which files changed

141
.github/workflows/containerize-jar.yml vendored Normal file
View File

@@ -0,0 +1,141 @@
name: Containerize Uberjar
run-name: Containerize ${{ inputs.tag }} Uberjar
on:
workflow_call:
inputs:
artifact-name:
type: string
repo:
description: owner and repo like "metabase/metabase"
type: string
tag:
type: string
commit:
type: string
release:
type: string
default: 'true'
build-args:
type: string
workflow_dispatch:
inputs:
artifact-name:
description: usually something like "metabase-release-{{ edition }}-{{ hash }}-uberjar"
type: string
repo:
description: docker owner and repo like "metabase/metabase"
type: string
tag:
description: usually a version like v1.87.2
type: string
commit:
description: the full commit hash
type: string
jobs:
containerize:
runs-on: ubuntu-latest
timeout-minutes: 15
outputs:
platforms: ${{ steps.platforms.outputs.result }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# we want the dockerfile from the commit we're building
- run: git checkout ${{ inputs.commit }} -- bin/docker
- name: Retrieve test build uberjar artifact
uses: ./.github/actions/fetch-artifact
with:
name: ${{ inputs.artifact-name }}
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Get platforms
id: platforms
uses: actions/github-script@v7
with:
result-encoding: string
script: | # js
const { getBuildRequirements, isValidVersionString} = require('${{ github.workspace }}/release/dist/index.cjs');
const version = "${{ inputs.tag }}".split('-')[0];
if (!isValidVersionString(version)) {
return "linux/amd64,linux/arm64";
}
// versions before 53 need to be handled differently
const buildInfo = getBuildRequirements(version);
return buildInfo.platforms;
- name: Move the Uberjar to the context dir
run: mv ./metabase.jar bin/docker/.
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ inputs.release == 'true' && secrets.DOCKERHUB_RELEASE_USERNAME || secrets.DOCKERHUB_USERNAME }}
password: ${{ inputs.release == 'true' && secrets.DOCKERHUB_RELEASE_TOKEN || secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
if: contains(steps.platforms.outputs.result, 'arm')
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
if: contains(steps.platforms.outputs.result, 'arm')
uses: docker/setup-buildx-action@v3
- name: Build multi-arch container
if: contains(steps.platforms.outputs.result, 'arm')
uses: docker/build-push-action@v6
with:
context: bin/docker/.
platforms: ${{ steps.platforms.outputs.result }}
network: host
tags: ${{ inputs.repo }}:${{ inputs.tag }}
no-cache: true
push: true
build-args: ${{ inputs.build-args }}
# we need to do this to get the nice fallback behavior of the legacy manifest file
- name: Build container (x86 only)
if: contains(steps.platforms.outputs.result, 'arm') == false
run: | # bash
docker build \
-t ${{ inputs.repo }}:${{ inputs.tag }} \
--network=host \
--push \
bin/docker/.
verify-docker-pull:
runs-on: ubuntu-latest
needs: containerize
timeout-minutes: 15
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ inputs.release == 'true' && secrets.DOCKERHUB_RELEASE_USERNAME || secrets.DOCKERHUB_USERNAME }}
password: ${{ inputs.release == 'true' && secrets.DOCKERHUB_RELEASE_TOKEN || secrets.DOCKERHUB_TOKEN }}
- name: Pull the container image
run: docker pull ${{ inputs.repo }}:${{ inputs.tag }}
- name: Launch container
run: docker run --rm -dp 3000:3000 ${{ inputs.repo }}:${{ inputs.tag }}
timeout-minutes: 5
- name: Wait for Metabase to start
run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
timeout-minutes: 5
verify-docker-pull-arm:
runs-on: arm-ubuntu-24-2core
needs: containerize
if: contains(needs.containerize.outputs.platforms, 'linux/arm64')
timeout-minutes: 15
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ inputs.release == 'true' && secrets.DOCKERHUB_RELEASE_USERNAME || secrets.DOCKERHUB_USERNAME }}
password: ${{ inputs.release == 'true' && secrets.DOCKERHUB_RELEASE_TOKEN || secrets.DOCKERHUB_TOKEN }}
- name: Pull the container image
run: docker pull ${{ inputs.repo }}:${{ inputs.tag }}
- name: Launch container
run: docker run --rm -dp 3000:3000 ${{ inputs.repo }}:${{ inputs.tag }}
timeout-minutes: 5
- name: Wait for Metabase to start
run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
timeout-minutes: 5

View File

@@ -0,0 +1,34 @@
name: Docs Bump Detected
on:
pull_request:
paths:
- 'docs/**'
jobs:
push_workflow_to_docs_metabase_github_io_job:
runs-on: ubuntu-latest
steps:
- name: Report changed docs files exist
run: |
echo "A change in the docs directory was detected."
- name: Trigger repo dispatch
uses: actions/github-script@v7
env:
BRANCH_NAME: ${{ github.head_ref || github.ref }}
with:
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
script: | #js
if (process.env.BRANCH_NAME === "master" ||
/^release-x\.\d+\.x$/.test(process.env.BRANCH_NAME)) {
github.rest.repos.createDispatchEvent({
owner: "${{ github.repository_owner }}",
repo: "docs.metabase.github.io",
event_type: "docs_update",
client_payload: { branch_name: process.env.BRANCH_NAME
}
});
} else {
console.log("Branch name is not to be published: ", process.env.BRANCH_NAME);
}

View File

@@ -42,6 +42,7 @@ on:
- SQLite
- SQL Server 2017
- SQL Server 2022
- Starburst
- Vertica
jobs:
@@ -663,6 +664,31 @@ jobs:
junit-name: 'be-tests-sqlserver-2022-ee'
test-args: ":only ${{ inputs.test }} :times ${{ inputs.times }}"
be-tests-starburst-ee:
if: inputs.driver == 'Starburst'
runs-on: ubuntu-22.04
timeout-minutes: 90
env:
CI: 'true'
DRIVERS: starburst
services:
starburst:
image: trinodb/trino:latest
env:
CATALOG_MANAGEMENT: dynamic
ports:
- "8080:8080"
name: Starburst
steps:
- uses: actions/checkout@v4
- name: Make plugins directory
run: mkdir plugins
- name: Test Starburst driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-starburst-ee'
test-args: ":only ${{ inputs.test }} :times ${{ inputs.times }}"
be-tests-vertica-ee:
if: inputs.driver == 'Vertica'
runs-on: ubuntu-22.04

View File

@@ -12,33 +12,6 @@ concurrency:
cancel-in-progress: true
jobs:
be-tests-h2:
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 60
env:
CI: 'true'
name: H2
steps:
- uses: actions/checkout@v4
- name: Test H2 driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-h2'
test-args: >-
:only-tags [:mb/driver-tests]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-athena-ee:
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
@@ -108,6 +81,53 @@ jobs:
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-clickhouse-ee:
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: clickhouse
MB_CLICKHOUSE_TEST_HOST: localhost
MB_CLICKHOUSE_TEST_PORT: 8123
MB_CLICKHOUSE_TEST_OLD_PORT: 8124
MB_CLICKHOUSE_TEST_NGINX_PORT: 8127
name: Clickhouse
steps:
- uses: actions/checkout@v4
- name: Add ClickHouse TLS instance to /etc/hosts
run: |
sudo echo "127.0.0.1 server.clickhouseconnect.test" | sudo tee -a /etc/hosts
- name: Start ClickHouse in Docker
uses: hoverkraft-tech/compose-action@v2.0.0
with:
compose-file: "modules/drivers/clickhouse/docker-compose.yml"
down-flags: "--volumes"
services: |
clickhouse
clickhouse_tls
clickhouse_older_version
clickhouse_cluster_node1
clickhouse_cluster_node2
nginx
- name: Test Clickhouse driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-clickhouse-ee'
test-args: >-
:only-tags [:mb/driver-tests]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-druid-ee:
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
@@ -143,6 +163,41 @@ jobs:
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-druid-jdbc-ee:
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: druid-jdbc
services:
druid:
image: metabase/druid:29.0.1-json-no-ingestion
ports:
- "8888:8888"
env:
CLUSTER_SIZE: nano-quickstart
name: Druid (JDBC)
steps:
- uses: actions/checkout@v4
- name: Test Druid JDBC driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-druid-jdbc-ee'
test-args: >-
:only-tags [:mb/driver-tests]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-databricks-ee:
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
@@ -177,27 +232,54 @@ jobs:
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-druid-jdbc-ee:
be-tests-databricks-multi-catalog-ee:
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: druid-jdbc
services:
druid:
image: metabase/druid:29.0.1-json-no-ingestion
ports:
- "8888:8888"
env:
CLUSTER_SIZE: nano-quickstart
name: Druid (JDBC)
DRIVERS: databricks
MB_DATABRICKS_TEST_MULTI_LEVEL_SCHEMA: true
MB_DATABRICKS_TEST_HOST: ${{ secrets.MB_DATABRICKS_JDBC_TEST_HOST }}
MB_DATABRICKS_TEST_HTTP_PATH: ${{ secrets.MB_DATABRICKS_JDBC_TEST_HTTP_PATH }}
MB_DATABRICKS_TEST_TOKEN: ${{ secrets.MB_DATABRICKS_JDBC_TEST_TOKEN }}
MB_DATABRICKS_TEST_CATALOG: 'metabase_ci'
MB_DATABRICKS_TEST_CLIENT_ID: ${{ secrets.MB_DATABRICKS_JDBC_TEST_CLIENT_ID }}
MB_DATABRICKS_TEST_OAUTH_SECRET: ${{ secrets.MB_DATABRICKS_JDBC_TEST_OAUTH_SECRET }}
name: Databricks (Multi-Catalog)
steps:
- uses: actions/checkout@v4
- name: Test Druid JDBC driver
- name: Test Databricks driver with multi-catalog
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-druid-jdbc-ee'
junit-name: 'be-tests-databricks-multi-catalog-ee'
test-args: >-
:only-tags [:mb/driver-tests]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-h2:
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 60
env:
CI: 'true'
name: H2
steps:
- uses: actions/checkout@v4
- name: Test H2 driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-h2'
test-args: >-
:only-tags [:mb/driver-tests]
- name: Upload Test Results
@@ -346,12 +428,9 @@ jobs:
fail-fast: false
matrix:
version:
- name: MongoDB 4.4
junit-name: be-tests-mongo-4-4-ee
image: metabase/qa-databases:mongo-sample-4.4
- name: MongoDB 5.0
junit-name: be-tests-mongo-5-0-ee
image: metabase/qa-databases:mongo-sample-5.0
- name: MongoDB 6.0
junit-name: be-tests-mongo-6-0-ee
image: metabase/qa-databases:mongo-sample-6
- name: MongoDB Latest
junit-name: be-tests-mongo-latest-ee
image: mongo:latest
@@ -398,12 +477,9 @@ jobs:
fail-fast: false
matrix:
version:
- name: MongoDB 4.4
junit-name: be-tests-mongo-4-4-ee
image: metabase/qa-databases:mongo-sample-4.4
- name: MongoDB 5.0
junit-name: be-tests-mongo-5-0-ssl-ee
image: metabase/qa-databases:mongo-sample-5.0
- name: MongoDB 6.0
junit-name: be-tests-mongo-6-0-ssl-ee
image: metabase/qa-databases:mongo-sample-6
env:
CI: 'true'
DRIVERS: mongo
@@ -890,9 +966,9 @@ jobs:
fail-fast: false
matrix:
version:
- name: SQL Server 2017
junit-name: be-tests-sqlserver-2017-ee
image: mcr.microsoft.com/mssql/server:2017-latest
# - name: SQL Server 2017
# junit-name: be-tests-sqlserver-2017-ee
# image: mcr.microsoft.com/mssql/server:2017-latest
- name: SQL Server 2022
junit-name: be-tests-sqlserver-2022-ee
image: mcr.microsoft.com/mssql/server:2022-latest
@@ -932,6 +1008,43 @@ jobs:
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-starburst-ee:
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: starburst
services:
starburst:
image: trinodb/trino:latest
env:
CATALOG_MANAGEMENT: dynamic
ports:
- "8080:8080"
name: Starburst
steps:
- uses: actions/checkout@v4
- name: Make plugins directory
run: mkdir plugins
- name: Test Starburst driver
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-starburst-ee'
test-args: >-
:only-tags [:mb/driver-tests]
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-vertica-ee:
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
@@ -988,7 +1101,9 @@ jobs:
- be-tests-sparksql-ee
- be-tests-sqlite-ee
- be-tests-sqlserver
- be-tests-starburst-ee
- be-tests-vertica-ee
- be-tests-clickhouse-ee
runs-on: ubuntu-latest
timeout-minutes: 5
name: drivers-tests-result

View File

@@ -1,17 +1,7 @@
name: E2E Cross-version Component Tests for Embedding SDK
on:
push:
branches:
- "release-**"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- "release-**"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
workflow_call:
jobs:
files-changed:
@@ -66,8 +56,7 @@ jobs:
build:
needs: [files-changed, get-build-requirements]
if: |
!cancelled() &&
github.event.pull_request.draft == false
!cancelled()
runs-on: ubuntu-22.04
timeout-minutes: 25
env:
@@ -93,7 +82,7 @@ jobs:
- name: Prepare uberjar artifact
uses: ./.github/actions/prepare-uberjar-artifact
with:
name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar-cross-version
resolve-sdk-version:
if: |
@@ -175,7 +164,7 @@ jobs:
- name: Retrieve uberjar artifact for ee
uses: actions/download-artifact@v4
with:
name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar-cross-version
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend

View File

@@ -1,16 +1,11 @@
name: E2E Component Tests for Embedding SDK
on:
push:
branches:
- "master"
- "release-**"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
workflow_call:
inputs:
cached-embedding-sdk-dist-artifact-name:
required: true
type: string
jobs:
files-changed:
@@ -63,11 +58,10 @@ jobs:
node_version: requirements.node,
};
build:
build-uberjar:
needs: [files-changed, get-build-requirements]
if: |
!cancelled() &&
github.event.pull_request.draft == false &&
needs.files-changed.outputs.e2e_all == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 25
@@ -78,10 +72,12 @@ jobs:
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:
@@ -97,12 +93,17 @@ jobs:
name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
e2e-tests:
needs: [get-build-requirements, build]
needs: [get-build-requirements, build-uberjar]
if: |
!cancelled() && needs.build.result == 'success'
!cancelled() &&
needs.build-uberjar.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 45
name: e2e-tests-embedding-sdk
strategy:
matrix:
react-version: [18, 19]
fail-fast: false
name: React ${{ matrix.react-version }}
env:
MB_EDITION: ee
DISPLAY: ""
@@ -148,12 +149,11 @@ jobs:
with:
m2-cache-key: "cljs"
- name: Compile CLJS
run: yarn build-pure:cljs
shell: bash
- name: Build Embedding SDK package
run: yarn build-embedding-sdk
- 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
@@ -161,6 +161,10 @@ jobs:
- 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 }}
@@ -169,7 +173,7 @@ jobs:
if: always()
with:
input-path: ./target/junit
output-name: e2e-embedding-sdk
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 }}
@@ -180,7 +184,7 @@ jobs:
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-recording-embedding-sdk-latest
name: cypress-recording-embedding-sdk-react-${{ matrix.react-version }}
path: |
./cypress
./logs/test.log
@@ -202,15 +206,3 @@ jobs:
const summary = formatSummary(results);
await core.summary.addRaw(summary).write();
e2e-tests-skipped-stub:
needs: [e2e-tests]
if: |
!cancelled() &&
needs.e2e-tests.result == 'skipped'
runs-on: ubuntu-22.04
timeout-minutes: 5
name: e2e-component-tests-embedding-sdk
steps:
- run: |
echo "Didn't run due to conditional filtering"

View File

@@ -0,0 +1,155 @@
name: E2E Cross-version Tests
on:
workflow_dispatch:
inputs:
fe-ref:
description: "Frontend git ref to use"
type: string
required: true
default: "master"
be-ref:
description: "Backend git ref to use"
type: string
required: true
default: "master"
total-shards:
description: "Total number of parallel test shards"
type: number
required: false
default: 4
workflow_call:
inputs:
fe-ref:
description: "Frontend git ref to use"
type: string
required: true
be-ref:
description: "Backend git ref to use"
type: string
required: true
total-shards:
description: "Total number of parallel test shards"
type: number
required: false
default: 4
jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix_json: ${{ steps.set_matrix.outputs.matrix_json }}
shards_total: ${{ steps.set_matrix.outputs.shards_total }}
steps:
- name: Set up shard matrix
id: set_matrix
uses: actions/github-script@v7
with:
# generate an output like `{"matrixJson": "{\"shard\": [1, 2, 3, 4]}", "shardsTotal": 4}` to be used in the other jobs
script: |
const totalShards = parseInt(process.env.TOTAL_SHARDS_INPUT, 10);
const matrix = { shard: Array.from({ length: totalShards }, (_, i) => i + 1) };
console.log("Generated matrix JSON", matrix);
console.log(`Total shards: ${totalShards}`);
core.setOutput('matrix_json', JSON.stringify(matrix));
core.setOutput('shards_total', totalShards);
env:
TOTAL_SHARDS_INPUT: ${{ inputs.total-shards }}
build-jar:
runs-on: ubuntu-22.04
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare Node.js
# We're not using `actions/prepare-frontend` because we don't want to install deps from the root repo
# nor we want to touch the cache as we'll be potentially be installing different versions of packages
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: cross-version-uberjar
- name: Build jar with different frontend and backend version
env:
MB_EDITION: ee
CYPRESS_CI: true
run: |
node bin/backward-compatibility-test.js \
${{ inputs.fe-ref }} ${{ inputs.be-ref }} \
build
- name: Upload Uberjar
uses: actions/upload-artifact@v4
with:
name: metabase-jar-cross-version
path: .tmp/metabase-be/target/uberjar/metabase.jar
if-no-files-found: error
run-breaking-changes-tests:
needs: [build-jar, generate-matrix]
runs-on: ubuntu-22.04
timeout-minutes: 45
env:
TOTAL_SHARDS: ${{ needs.generate-matrix.outputs.shards_total }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix_json) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prepare Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: cross-version-uberjar
- name: Download Uberjar
uses: actions/download-artifact@v4
with:
name: metabase-jar-cross-version
path: .tmp/metabase-be/target/uberjar/
- name: Download FE repo
run: |
git clone --depth 1 -b ${{ inputs.fe-ref }} https://github.com/metabase/metabase.git .tmp/metabase-fe
- name: Install FE dependencies
working-directory: .tmp/metabase-fe
run: |
yarn install
- name: Prepare Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
with:
working-directory: .tmp/metabase-fe
- name: Run the tests
env:
MB_EDITION: ee
CYPRESS_ALL_FEATURES_TOKEN: ${{ secrets.ENTERPRISE_TOKEN }}
CYPRESS_NO_FEATURES_TOKEN: ${{ secrets.E2E_STARTER_TOKEN }}
CYPRESS_CI: true
run: |
node bin/backward-compatibility-test.js \
${{ inputs.fe-ref }} ${{ inputs.be-ref }} \
start > /dev/null & \
node bin/backward-compatibility-test.js \
${{ inputs.fe-ref }} ${{ inputs.be-ref }} \
test ${{ matrix.shard}}/${{ env.TOTAL_SHARDS }}

View File

@@ -7,11 +7,17 @@ on:
required: true
type: number
default: 30
specs:
required: false
type: string
default: "./e2e/test/scenarios/**/*.cy.spec.*"
outputs:
matrix:
value: ${{ jobs.build-matrix.outputs.matrix }}
regularChunks:
value: ${{ jobs.build-matrix.outputs.regularChunks }}
isDefaultSpecPattern:
value: ${{ jobs.build-matrix.outputs.isDefaultSpecPattern }}
jobs:
build-matrix:
@@ -20,53 +26,38 @@ jobs:
outputs:
matrix: ${{ steps.matrix.outputs.config }}
regularChunks: ${{ steps.matrix.outputs.regularChunks }}
isDefaultSpecPattern: ${{ steps.matrix.outputs.isDefaultSpecPattern }}
steps:
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
with:
node-version: '22.x'
- uses: actions/github-script@v7
sparse-checkout: |
.github
sparse-checkout-cone-mode: false
- uses: actions/setup-node@v4
with:
node-version: lts/Jod # 22.x.x
- name: Build e2e matrix
uses: actions/github-script@v7
id: matrix
env:
chunks: ${{ inputs.chunks }}
with:
script: | # js
const { buildMatrix } = require('${{ github.workspace }}/.github/scripts/build-e2e-matrix.js');
const inputSpecs = "${{ inputs.specs }}";
const inputChunks = Number(process.env.chunks);
const java = 21;
const defaultRunner = "ubuntu-22.04";
const defaultOptions = {
"java-version": java,
runner: defaultRunner,
edition: "ee",
const options = {
java,
defaultRunner,
};
const allSpecs = "./e2e/test/scenarios/**/*.cy.spec.*";
// see config.js function getSplittableSpecs for logic that excludes some tests from auto splitting
const specialTests = [
{ name: "embedding-sdk", specs: "./e2e/test/scenarios/embedding-sdk/**.cy.spec.*" },
{ name: "oss-subset", edition: 'oss', tags: "@OSS @smoke+-@EE", specs: allSpecs },
{ name: "mongo", tags: "@mongo", specs: allSpecs },
];
const inputChunks = Number(process.env.chunks);
const regularChunks = inputChunks - specialTests.length;
const regularTests = new Array(regularChunks).fill(1)
.map((files, index) => ({
name: `e2e-group-${index + 1}`,
}));
// regular chunks need to come before special chunks
const testSets = [...regularTests, ...specialTests];
const config = testSets.map((options) => ({
...defaultOptions,
...options,
}));
const { config, regularChunks, isDefaultSpecPattern } = buildMatrix(options, inputSpecs, inputChunks);
core.setOutput("regularChunks", JSON.stringify(regularChunks));
core.setOutput("config", JSON.stringify({ include: config }));
core.setOutput("isDefaultSpecPattern", JSON.stringify(isDefaultSpecPattern));
console.log({ regularChunks });
console.log("matrix config", config);
console.log("isDefaultSpecPattern", isDefaultSpecPattern);

View File

@@ -0,0 +1,298 @@
name: E2E Sample Apps tests
on:
push:
branches:
- "master"
- "release-**"
pull_request:
types: [opened, synchronize, reopened]
branches:
- "master"
- "release-**"
env:
# we must support last two stable releases
SUPPORTED_RELEASES_COUNT: 2
TEST_SUITES: |
[
"metabase-nodejs-react-sdk-embedding-sample-e2e",
"metabase-nextjs-sdk-embedding-sample-e2e",
"shoppy-e2e"
]
TEST_SUITES_TO_RUN_IN_MASTER_ONLY: |
[
"shoppy-e2e"
]
SAMPLE_APP_MAIN_BRANCH_NAME: "main"
SAMPLE_APP_STABLE_RELEASE_BRANCH_NAME_SUFFIX: "stable"
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_all: ${{ steps.changes.outputs.e2e_all }}
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
outputs:
branch_name: ${{ fromJson(steps.build-sample-apps-data.outputs.result).branch_name }}
matrix: ${{ toJSON(fromJson(steps.build-sample-apps-data.outputs.result).matrix) }}
steps:
- uses: actions/checkout@v4
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Build sample app compatibility data
uses: actions/github-script@v7
id: build-sample-apps-data
with:
script: | # js
const {
isReleaseBranch,
getMajorVersionNumberFromReleaseBranch,
} = require('${{ github.workspace }}/release/dist/index.cjs');
const testSuites = JSON.parse(process.env.TEST_SUITES);
const testSuitesToRunInMasterOnly = JSON.parse(process.env.TEST_SUITES_TO_RUN_IN_MASTER_ONLY);
const ref = '${{ github.base_ref || github.ref }}';
const branchName = ref.replace(/^refs\/heads\//, '');
const isMainBranchRef = branchName === 'master';
const isReleaseBranchRef = isReleaseBranch(branchName);
if (isMainBranchRef) {
return {
branch_name: '${{ env.SAMPLE_APP_MAIN_BRANCH_NAME }}',
matrix: testSuites,
};
}
if (isReleaseBranchRef) {
const supportedReleasesCount = Number(${{ env.SUPPORTED_RELEASES_COUNT }});
const currentReleaseVersion = Number(${{ vars.CURRENT_VERSION }});
const currentBranchVersion = Number(getMajorVersionNumberFromReleaseBranch(branchName));
const sampleAppBranchName = `${currentBranchVersion}-${{ env.SAMPLE_APP_STABLE_RELEASE_BRANCH_NAME_SUFFIX }}`
const shouldRunTestsForVersion = (currentReleaseVersion - currentBranchVersion) <= (supportedReleasesCount - 1);
const releaseBranchTestSuites = testSuites.filter(testSuite => !testSuitesToRunInMasterOnly.includes(testSuite));
return {
branch_name: sampleAppBranchName,
matrix: shouldRunTestsForVersion
? releaseBranchTestSuites
: []
};
}
return {
branch_name: '',
matrix: []
};
build:
needs: [files-changed, get-build-requirements, get-sample-apps-data]
if: |
!cancelled() &&
needs.files-changed.outputs.e2e_all == '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: Compile CLJS
run: yarn build-pure:cljs
shell: bash
- name: Build Embedding SDK package
run: yarn build-embedding-sdk
- 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
e2e-tests:
needs: [get-build-requirements, get-sample-apps-data, build]
strategy:
matrix:
test_suite: ${{ fromJSON(needs.get-sample-apps-data.outputs.matrix) }}
environment: ["production", "development"]
if: |
!cancelled() && needs.build.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 45
name: e2e-sample-app-${{ matrix.test_suite }}-tests-${{ matrix.environment }}-bundle
env:
MB_EDITION: ee
DISPLAY: ""
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number || '' }}
HASH: ${{ github.event.pull_request.head.sha || github.sha }}-${{ github.run_attempt }}
# 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_ALL_FEATURES_TOKEN: ${{ secrets.ENTERPRISE_TOKEN }}
CYPRESS_NO_FEATURES_TOKEN: ${{ secrets.E2E_STARTER_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
# Sample Apps testing variables
CYPRESS_CI: true
SAMPLE_APP_BRANCH_NAME: ${{ needs.get-sample-apps-data.outputs.branch_name }}
SAMPLE_APP_ENVIRONMENT: ${{ matrix.environment }}
permissions:
id-token: write
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
- 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 Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
- name: Check if sample app branch exists
id: check-sample-app-branch
run: |
TEST_SUITE="${{ matrix.test_suite }}"
REPO_NAME="${TEST_SUITE%-e2e}"
REPO_URL="https://github.com/metabase/${REPO_NAME}.git"
echo "Checking if branch '${SAMPLE_APP_BRANCH_NAME}' exists in ${REPO_URL}..."
if git ls-remote --exit-code --heads "$REPO_URL" "${SAMPLE_APP_BRANCH_NAME}"; then
echo "sample_app_branch_exists=true" >> $GITHUB_OUTPUT
else
echo "sample_app_branch_exists=false" >> $GITHUB_OUTPUT
fi
- name: Configure AWS credentials
if: ${{ matrix.test_suite == 'shoppy-e2e' }}
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.SHOPPY_IAM_ROLE }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: us-east-1
- name: Download Shoppy's App DB PostgreSQL dump from S3
if: ${{ matrix.test_suite == 'shoppy-e2e' }}
run: |
aws s3 cp s3://${{ secrets.SHOPPY_METABASE_APP_DB_S3_BUCKET }}/${{ secrets.SHOPPY_METABASE_APP_DB_S3_KEY }} ./e2e/tmp/db_dumps/shoppy_metabase_app_db_dump.sql
- name: Prepare and launch Sample Apps for shoppy-e2e test suite
if: ${{ steps.check-sample-app-branch.outputs.sample_app_branch_exists == 'true' && matrix.test_suite == 'shoppy-e2e' }}
env:
METABASE_APP_DB_USER: ${{ secrets.SHOPPY_METABASE_APP_DB_USER }}
METABASE_APP_DB: ${{ secrets.SHOPPY_METABASE_APP_DB_DATABASE }}
run: npx tsx ./e2e/runner/start-sample-app-containers/start-ci.ts shoppy-e2e
- name: Prepare and launch Sample Apps for other test suites
if: ${{ steps.check-sample-app-branch.outputs.sample_app_branch_exists == 'true' && matrix.test_suite != 'shoppy-e2e' }}
run: npx tsx ./e2e/runner/start-sample-app-containers/start-ci.ts ${{ matrix.test_suite }}
- name: Run e2e tests for Sample App
id: run-e2e-tests
if: ${{ steps.check-sample-app-branch.outputs.sample_app_branch_exists == 'true' }}
run: node e2e/runner/run_cypress_ci.js ${{ matrix.test_suite }} --browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Upload Cypress Artifacts upon failure
uses: actions/upload-artifact@v4
if: ${{ steps.check-sample-app-branch.outputs.branch_exists == 'true' && steps.run-e2e-tests.outcome != 'success' }}
with:
name: cypress-recording-sample-app-${{ matrix.test_suite }}-latest
path: |
./cypress
./logs/test.log
if-no-files-found: ignore

View File

@@ -4,24 +4,25 @@ on:
workflow_dispatch:
inputs:
spec:
description: 'Relative path of the target spec'
description: "Relative path of the target spec"
type: string
required: true
burn_in:
description: 'Number of times to run the test (e.g. 20)'
description: "Number of times to run the test (e.g. 20)"
type: string
required: true
default: "20"
grep:
description: 'Grep and filter tests to run in isolation'
description: "Grep and filter tests to run in isolation"
type: string
required: false
mb_edition:
description: 'Set MB_EDITION env var to "ee" (enteprise) or "oss" (open-source)'
description: 'Set MB_EDITION env var to "ee" (enterprise) or "oss" (open-source)'
type: string
required: false
default: "ee"
qa_db:
description: 'Select the type of Database you want to run your tests with'
description: "Select the type of Database you want to run your tests with"
type: choice
required: true
default: "none"
@@ -29,6 +30,11 @@ on:
- none
- sql
- mongo
enable_network_throttling:
description: "Enable network throttling simulation (4g slow like in chrome dev tools)"
type: boolean
required: false
default: true
jobs:
workflow-summary:
@@ -45,6 +51,7 @@ jobs:
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
echo '- `enable_network_throttling`: "${{ inputs.enable_network_throttling }}"' >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
echo 'triggered by: @${{ github.event.sender.login }}' >> $GITHUB_STEP_SUMMARY
@@ -61,6 +68,7 @@ jobs:
MB_SNOWPLOW_AVAILABLE: true
MB_SNOWPLOW_URL: "http://localhost:9090" # Snowplow micro
MB_EDITION: ${{ inputs.mb_edition }}
CYPRESS_ENABLE_NETWORK_THROTTLING: ${{ inputs.enable_network_throttling }}
TERM: xterm
TZ: US/Pacific # to make node match the instance tz
steps:
@@ -83,7 +91,7 @@ jobs:
- name: Download Metabase ${{ matrix.edition }} uberjar
uses: ./.github/actions/e2e-download-uberjar
with:
edition: 'ee'
edition: "ee"
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
@@ -105,10 +113,12 @@ jobs:
# 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 }}
run: |
node e2e/runner/run_cypress_ci.js e2e \
--spec '${{ github.event.inputs.spec }}' \
--env burn=${{ github.event.inputs.burn_in }},grep='${{ github.event.inputs.grep }}' \
--env burn=${{ github.event.inputs.burn_in }} \
--config-file e2e/support/cypress-stress-test.config.js \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}

View File

@@ -49,6 +49,7 @@ jobs:
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
MB_SEARCH_ENGINE: appdb
MB_SNOWPLOW_AVAILABLE: true
MB_SNOWPLOW_URL: "http://localhost:9090" # Snowplow micro
TZ: US/Pacific # to make node match the instance tz
@@ -98,6 +99,18 @@ jobs:
id: cypress-prep
uses: ./.github/actions/prepare-cypress
- name: Download failed test artifacts
uses: actions/download-artifact@v4
if: github.run_attempt != '1'
continue-on-error: true
id: failed-specs
with:
name: failed-tests-${{ inputs.name }}-${{ inputs.edition }}
- name: Get failed specs
if: github.run_attempt != '1'
run: echo "specs=$(cat failed-specs)" >> $GITHUB_ENV
- name: Run Snowplow micro
uses: ./.github/actions/run-snowplow-micro
@@ -117,19 +130,25 @@ jobs:
SPLIT_TIME_THRESHOLD: 5.0
# do not write cypress-split summary to github
SPLIT_SUMMARY: false
SPEC_PATH: ${{ env.specs || inputs.specs }}
shell: bash
run: |
echo "Running tests with specs: $SPEC_PATH"
node e2e/runner/run_cypress_ci.js e2e \
--env grepTags="-@mongo+-@flaky+-@OSS --@quarantine",grepOmitFiltered=true \
--spec "$SPEC_PATH" \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run Tagged EE Cypress tests on ${{ inputs.name }}
if: ${{ inputs.specs }}
shell: bash
env:
SPEC_PATH: ${{ env.specs || inputs.specs }}
run: |
echo "Running tests with specs: $SPEC_PATH"
node e2e/runner/run_cypress_ci.js e2e \
--env grepTags="${{inputs.tags}} --@quarantine",grepOmitFiltered=true \
--spec '${{ inputs.specs }}' \
--spec "$SPEC_PATH" \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Upload Test Results
@@ -138,6 +157,7 @@ jobs:
with:
input-path: ./target/junit
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 }}
@@ -154,6 +174,13 @@ jobs:
./logs/test.log
if-no-files-found: ignore
- name: Upload Failed Tests
uses: actions/upload-artifact@v4
if: failure()
with:
name: failed-tests-${{ inputs.name }}-${{ inputs.edition }}
path: ./cypress/test-results
- name: Publish Summary
if: failure()
uses: actions/github-script@v7

View File

@@ -6,6 +6,10 @@ on:
skip:
type: boolean
default: false
specs:
type: string
required: false
default: ""
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}-e2e
@@ -16,6 +20,7 @@ jobs:
uses: ./.github/workflows/e2e-matrix-builder.yml
with:
chunks: 50
specs: ${{ inputs.specs }}
# if this is a test on a release branch, we need to check the build requirements
get-build-requirements:
@@ -52,7 +57,7 @@ jobs:
needs: [get-build-requirements]
if: ${{ !cancelled() && !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 25
timeout-minutes: 15
strategy:
matrix:
edition: [oss, ee]
@@ -74,7 +79,9 @@ jobs:
java-version: "${{ needs.get-build-requirements.outputs.java_version || 21 }}"
- name: Build uberjar with ./bin/build.sh
timeout-minutes: 10
run: ./bin/build.sh
shell: bash
- name: Prepare uberjar artifact
uses: ./.github/actions/prepare-uberjar-artifact
@@ -137,19 +144,21 @@ jobs:
flaky-e2e-tests:
name: Flaky e2e Tests
uses: ./.github/workflows/e2e-test.yml
needs: build
needs:
- build
- e2e-matrix-builder
# skip flaky test run if only e2e specs changed as an optimization
if: |
!cancelled() && needs.build.result == 'success'
!cancelled() && needs.build.result == 'success' && needs.e2e-matrix-builder.outputs.isDefaultSpecPattern == 'true'
secrets: inherit
with:
name: Flaky
tags: "@flaky"
specs: "./e2e/test/scenarios/**/*.cy.spec.*"
e2e-tests-result:
needs:
- e2e-tests
- flaky-e2e-tests
- e2e-tests
- flaky-e2e-tests
runs-on: ubuntu-latest
timeout-minutes: 5
name: e2e-tests-result

View File

@@ -2,21 +2,39 @@ name: Embedding SDK
on:
push:
branches:
- "master"
- "release-**"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
types: [opened, synchronize, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
sdk-build:
if: contains(github.event.pull_request.labels.*.name, 'embedding-sdk-build')
files-changed:
name: Check which files changed
runs-on: ubuntu-22.04
timeout-minutes: 20
timeout-minutes: 3
outputs:
documentation: ${{ steps.changes.outputs.documentation }}
frontend_embedding_sdk_sources: ${{ steps.changes.outputs.frontend_embedding_sdk_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
build:
needs: [files-changed]
if: |
!cancelled() &&
(needs.files-changed.outputs.frontend_embedding_sdk_sources == 'true' ||
needs.files-changed.outputs.documentation == 'true')
runs-on: ubuntu-22.04
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
@@ -25,15 +43,146 @@ jobs:
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Build SDK bundle
run: yarn run build-embedding-sdk
- name: Generate SDK package.json
run: yarn run embedding-sdk:generate-package "$GITHUB_SHA"
- name: Generate .npmrc for Github npm registry
uses: actions/setup-node@v4
- name: Build Embedding SDK package
run: yarn build-embedding-sdk
- name: Prepare Embedding SDK artifact
uses: actions/upload-artifact@v4
with:
registry-url: "https://npm.pkg.github.com"
- name: Publish package
run: yarn run embedding-sdk:publish
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'
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- 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: Run frontend embedding SDK snippets type check
run: yarn run embedding-sdk:cli-snippets:type-check
embedding-sdk-docs-snippets-type-check:
needs: [files-changed, build]
if: |
needs.files-changed.outputs.documentation == 'true' &&
needs.build.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- 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: Run frontend embedding SDK snippets type check
run: yarn run embedding-sdk:docs-snippets:type-check
embedding-sdk-no-exposed-internal-types-validate:
needs: [files-changed, build]
if: |
needs.files-changed.outputs.frontend_embedding_sdk_sources == 'true' &&
needs.build.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- 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: Run no exposed internal types validation
run: |
output="$(yarn embedding-sdk:docs:generate:pure --emit none 2>&1)" || {
if [[ "$output" == *"not included in the documentation"* ]]; then
echo "$output"
exit 1
fi
}
- name: Comment on PR if docs need update
uses: ./.github/actions/notify-pull-request
if: success() || failure()
with:
remove-previous-comment: true
add-new-comment: ${{ job.status == 'failure' }}
message: "📝 One or more internal Metabase types were accidentally exported from the `@metabase/embedding‑sdk‑react` package in this pull request.<br/><br/>Publishing these types would change the public API and may drastically change generated SDK documentation.<br/><br/>Please update the code so internal types remain private and the public API stays unchanged."
include-log: true
sdk-e2e-tests:
uses: ./.github/workflows/e2e-component-tests-embedding-sdk.yml
needs: [build]
secrets: inherit
with:
cached-embedding-sdk-dist-artifact-name: embedding-sdk-${{ github.event.pull_request.head.sha || github.sha }}
e2e-component-tests-embedding-sdk-cross-version:
# run on: every push on release branches, and every pr that targets a release branch
if: ${{ startsWith(github.ref, 'refs/heads/release-x.') || (github.event_name == 'pull_request' && startsWith(github.base_ref, 'release-x.')) }}
uses: ./.github/workflows/e2e-component-tests-embedding-sdk-cross-version.yml
secrets: inherit
cross-version-for-breaking-changes:
# run on: every pr that targets a release branch
if: ${{ github.event_name == 'pull_request' && startsWith(github.base_ref, 'release-x.') }}
uses: ./.github/workflows/e2e-cross-version-for-breaking-changes.yml
secrets: inherit
with:
fe-ref: ${{ github.base_ref }}
be-ref: ${{ github.head_ref }}
embedding-sdk-tests-result:
needs:
- embedding-sdk-cli-snippets-type-check
- embedding-sdk-docs-snippets-type-check
- embedding-sdk-no-exposed-internal-types-validate
- sdk-e2e-tests
- e2e-component-tests-embedding-sdk-cross-version
if: always() && !cancelled()
runs-on: ubuntu-latest
timeout-minutes: 5
env:
needs: ${{ toJson(needs) }}
steps:
- name: Check embedding SDK job status
uses: actions/github-script@v7
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
needs: ${{ toJson(needs) }}
with:
script: | # js
const needs = JSON.parse(process.env.needs);
const jobs = Object.entries(needs).map(
([jobName, jobValues]) => ({
name: jobName,
result: jobValues.result
}));
// are all jobs skipped or successful?
if (jobs.every(job => (job.result === 'skipped' || job.result === 'success'))) {
console.log('All jobs are skipped or successful');
process.exit(0);
}
// otherwise, something failed
console.log('Some embedding SDK jobs failed');
jobs.forEach((job) => {
if (job.result !== 'success') {
console.log(`${job.name} - ${job.result}`);
}
});
process.exit(1);

View File

@@ -6,6 +6,9 @@ on:
skip:
type: boolean
default: false
skip-lint:
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}-frontend
@@ -13,7 +16,7 @@ concurrency:
jobs:
fe-lint:
if: ${{ !inputs.skip }}
if: ${{ !inputs.skip-lint }}
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:

View File

@@ -4,43 +4,59 @@ on:
workflow_dispatch:
push:
branches:
- 'master'
- 'release-**'
- "master"
- "release-**"
paths:
- 'frontend/src/metabase-lib/expressions/**'
- "frontend/src/metabase-lib/expressions/**"
pull_request:
paths:
- 'frontend/src/metabase-lib/expressions/**'
- "frontend/src/metabase-lib/expressions/**"
jobs:
fe-fuzz-tokenizer:
fe-fuzz-lexifier:
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'cljs'
- run: yarn test-unit frontend/test/metabase/lib/expressions/fuzz.tokenizer.unit.spec.js
env:
MB_FUZZ: 1
name: Run fuzz testing on the tokenizer
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- run: yarn test-unit frontend/src/metabase-lib/v1/expressions/pratt/fuzz.lexifier.unit.spec.ts
env:
MB_FUZZ: 1
name: Run fuzz testing on the lexifier
fe-fuzz-recursive-parser:
fe-fuzz-compiler:
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'cljs'
- run: yarn test-unit frontend/test/metabase/lib/expressions/fuzz.recursive-parser.unit.spec.js
env:
MB_FUZZ: 1
name: Run fuzz testing on the recursive parser
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- run: yarn test-unit frontend/src/metabase-lib/v1/expressions/fuzz.compiler.unit.spec.ts
env:
MB_FUZZ: 1
name: Run fuzz testing on the custom expression compiler
fe-fuzz-string-quoting:
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- run: yarn test-unit frontend/src/metabase-lib/v1/expressions/fuzz.string.unit.spec.ts
env:
MB_FUZZ: 1
name: Run fuzz testing on the custom expression string quoter

View File

@@ -3,18 +3,25 @@ name: Generative Query Test
on:
workflow_dispatch:
inputs:
seed:
description: 'Seed value (empty = random; logged)'
context-seed:
description: 'Context seed (empty = random)'
type: number
iteration-seed:
description: 'Iteration seed (for iteration replay, empty = dependent on Context seed)'
type: number
iterations:
description: 'Number of test iterations (overrides `seconds`)'
description: 'Iterations (number of test iterations, overrides seconds)'
type: number
seconds:
description: 'No further iteration after _this_ number of seconds since test started'
description: 'Seconds (Number of seconds after which next iteration will not start)'
test:
description: 'Test or namespace to run'
default: metabase.query-processor-test.generative-test/execution-with-cards-test
ref:
description: 'Ref to run generative tests on'
default: qgen-milestone-1
default: qgen-ms2
# TODO: Consider renaming the job in next milestones
jobs:
generative-query-test:
runs-on: ubuntu-22.04
@@ -22,24 +29,24 @@ jobs:
name: Generative Query Test
env:
CI: 'true'
MB_GENTEST_SEED: ${{ inputs.seed }}
MB_GENTEST_CONTEXT_SEED: ${{ inputs.context-seed }}
MB_GENTEST_ITERATION_SEED: ${{ inputs.iteration-seed }}
MB_GENTEST_LIMIT_ITERATIONS: ${{ inputs.iterations }}
MB_GENTEST_LIMIT_SECONDS: ${{ inputs.seconds }}
# TODO: Remove in favor of cp root with further tests
MB_GENTEST_RUN: true
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- 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
- name: Run test
run: clojure -X:dev:ci:test:ee:ee-dev :only 'metabase.query-processor-test.generative-test'
run: clojure -X:dev:ci:test:ee:ee-dev :only '${{ inputs.test }}'
- name: Publish Test Report (JUnit)
uses: dorny/test-reporter@v1

24
.github/workflows/linear-pr-links.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: Add Issue References to PR
on:
pull_request:
types: [opened, edited, synchronize]
jobs:
add-issue-references:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Run the link script
uses: actions/github-script@v7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.event.repository.name }}
with:
script: |
const { link_issues } = require('${{ github.workspace }}/.github/scripts/update-pr-with-issues.js');
await link_issues(github)

View File

@@ -19,7 +19,7 @@ jobs:
uses: lycheeverse/lychee-action@v2
with:
fail: false
args: docs --config ./.lychee/config.toml --verbose --no-progress
args: docs --include-fragments --config ./.lychee/config.toml --verbose --no-progress
format: markdown
- name: Create Issue From File

View File

@@ -45,17 +45,35 @@ jobs:
echo "Storybook is being served!"
- name: Update Loki Snapshots
run: yarn test-visual:loki-update
run: yarn test-visual:loki || yarn test-visual:loki-approve-diff && yarn test-visual:loki-prune
- name: Check for changes
id: check-changes
run: |
if [[ -n "$(git status --porcelain .loki/reference/)" ]]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
else
echo "has_changes=false" >> $GITHUB_OUTPUT
fi
- name: Commit and Push Changes
if: steps.check-changes.outputs.has_changes == 'true'
run: |
git config --global user.name "Metabase Automation"
git config --global user.email "github-automation@metabase.com"
git add .loki/**
git add .loki/reference/
git commit -m "Update Loki Snapshots"
git push
env:
GITHUB_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Notify No Changes
if: steps.check-changes.outputs.has_changes == 'false'
uses: ./.github/actions/notify-pull-request
with:
include-log: false
message: No visual differences were found. All Loki snapshots are up to date.
- name: Remove 'loki-update' label
uses: actions/github-script@v7
with:

27
.github/workflows/mage.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: Mage Tests
on:
pull_request:
paths: ["mage/**", "test/mage/**"]
jobs:
# run mage tests even if the rest of be isnt needed
mage-tests:
runs-on: ubuntu-22.04
name: Mage
steps:
- uses: actions/checkout@v4
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'kondo'
- name: Setup Babashka
uses: turtlequeue/setup-babashka@v1.7.0
with:
babashka-version: 1.12.197
- name: Check bb runs
run: bb --version
- name: bb task list
run: bb tasks
- name: Run mage tests
run: bb ./test/mage/runtests.clj

View File

@@ -19,4 +19,4 @@ jobs:
with:
m2-cache-key: lint-migrations
- name: Verify Liquibase Migrations
run: ./bin/lint-migrations-file.sh
run: ./bin/mage lint-migrations

View File

@@ -1,48 +0,0 @@
name: A New Feature Slack Notification
on:
issues:
types:
- closed
jobs:
on-epic-closed:
runs-on: ubuntu-22.04
timeout-minutes: 5
if: ${{ contains(github.event.issue.labels.*.name, '.Epic') || contains(github.event.issue.labels.*.name, 'Type:New Feature') }}
steps:
- name: Setting title
uses: actions/github-script@v6
id: vars
with:
script: |
core.setOutput('issue_title', ${{ toJson(github.event.issue.title) }}.replaceAll(/"/g, '\\"'));
- name: Extracting team name
id: team_name
run: |
team_label=$(echo "${{ join(github.event.issue.labels.*.name, ',') }}" | grep -o '\.Team/[^,]*' | head -n 1)
echo $team_label
echo "team_label=${team_label}" >> "$GITHUB_OUTPUT"
team_name=${team_label#*.Team/}
echo $team_name
echo "team_name=${team_name^^}_SLACK_EPIC_WEBHOOK_URL" >> "$GITHUB_OUTPUT"
- name: Send the issue ${{ github.event.issue.number }} to Slack
id: slack
if: ${{ steps.team_name.outputs.team_label }}
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[steps.team_name.outputs.team_name] }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

View File

@@ -40,16 +40,50 @@ jobs:
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/actions/workflows/e2e-tests.yml/runs?head_sha=${{ github.event.pull_request.head.sha || github.sha }}
https://api.github.com/repos/${{ github.repository }}/actions/workflows/run-tests.yml/runs?head_sha=${{ github.event.pull_request.head.sha || github.sha }}
ID=$(jq -r '.workflow_runs[0].id' e2e-tests.json)
echo "Run ID: ${ID}"
## Get workflow run id for uberjar build
while [ -z "$JOB_ID" ]; do
NEXT_URL="https://api.github.com/repos/${{ github.repository }}/actions/runs/${ID}/jobs?filter=latest"
# Search for build job
echo "Searching for build job..."
while [ -z "$JOB_ID" ] && [ -n "$NEXT_URL" ]; do
# Get one page of jobs
RESPONSE=$(curl -s -i \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"$NEXT_URL")
# Extract headers and body
HEADERS=$(echo "$RESPONSE" | sed -n '1,/^\r$/p')
BODY=$(echo "$RESPONSE" | sed '1,/^\r$/d')
LINK_HEADER=$(echo "$HEADERS" | grep -i '^link:' | sed 's/^link: //')
# Check for next page in Link header
if echo "$LINK_HEADER" | grep -q 'rel="next"'; then
NEXT_URL=$(echo "$LINK_HEADER" | sed -E 's/.*<([^>]+)>; rel="next".*/\1/')
else
NEXT_URL=""
fi
# Check for build job
JOB_ID=$(echo "$BODY" | jq -r '.jobs[] | select(.name | contains("build (ee)")) | .id')
done
done
echo "Job ID: ${JOB_ID}"
## Wait for uberjar build to complete
while [ true ]; do
curl -Ls --output uberjar.json \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/actions/runs/${ID}/jobs?filter=latest
jq -r '.jobs[] | select(.name == "build (ee)") | .steps[] | select(.name == "Prepare uberjar artifact") | .status' uberjar.json | grep -q "completed" && break
https://api.github.com/repos/${{ github.repository }}/actions/jobs/${JOB_ID}
jq -r '.steps[] | select(.name == "Prepare uberjar artifact") | .status' uberjar.json | grep -q "completed" && break
echo "Waiting for uberjar build..."
sleep 10
done

View File

@@ -40,16 +40,50 @@ jobs:
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/actions/workflows/e2e-tests.yml/runs?head_sha=${{ github.event.pull_request.head.sha || github.sha }}
https://api.github.com/repos/${{ github.repository }}/actions/workflows/run-tests.yml/runs?head_sha=${{ github.event.pull_request.head.sha || github.sha }}
ID=$(jq -r '.workflow_runs[0].id' e2e-tests.json)
echo "Run ID: ${ID}"
## Get workflow run id for uberjar build
while [ -z "$JOB_ID" ]; do
NEXT_URL="https://api.github.com/repos/${{ github.repository }}/actions/runs/${ID}/jobs?filter=latest"
# Search for build job
echo "Searching for build job..."
while [ -z "$JOB_ID" ] && [ -n "$NEXT_URL" ]; do
# Get one page of jobs
RESPONSE=$(curl -s -i \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"$NEXT_URL")
# Extract headers and body
HEADERS=$(echo "$RESPONSE" | sed -n '1,/^\r$/p')
BODY=$(echo "$RESPONSE" | sed '1,/^\r$/d')
LINK_HEADER=$(echo "$HEADERS" | grep -i '^link:' | sed 's/^link: //')
# Check for next page in Link header
if echo "$LINK_HEADER" | grep -q 'rel="next"'; then
NEXT_URL=$(echo "$LINK_HEADER" | sed -E 's/.*<([^>]+)>; rel="next".*/\1/')
else
NEXT_URL=""
fi
# Check for build job
JOB_ID=$(echo "$BODY" | jq -r '.jobs[] | select(.name | contains("build (ee)")) | .id')
done
done
echo "Job ID: ${JOB_ID}"
## Wait for uberjar build to complete
while [ true ]; do
curl -Ls --output uberjar.json \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/actions/runs/${ID}/jobs?filter=latest
jq -r '.jobs[] | select(.name == "build (ee)") | .steps[] | select(.name == "Prepare uberjar artifact") | .status' uberjar.json | grep -q "completed" && break
https://api.github.com/repos/${{ github.repository }}/actions/jobs/${JOB_ID}
jq -r '.steps[] | select(.name == "Prepare uberjar artifact") | .status' uberjar.json | grep -q "completed" && break
echo "Waiting for uberjar build..."
sleep 10
done

View File

@@ -35,41 +35,15 @@ jobs:
oss_version: ${{ steps.version-properties.outputs.oss_version }}
commit: ${{ steps.version-properties.outputs.commit }}
steps:
- name: find_release_artifact
id: find_release_artifact
uses: actions/github-script@v7
- uses: actions/checkout@v4
with:
result-encoding: string
script: | # js
const fs = require('fs');
sparse-checkout: .github
- name: Retrieve test build uberjar artifact for ${{ matrix.edition }}
uses: ./.github/actions/fetch-artifact
with:
name: metabase-release-${{ matrix.edition }}-${{ inputs.commit }}-uberjar
const artifacts = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
name: `metabase-release-${{ matrix.edition }}-${{ inputs.commit }}-uberjar`,
per_page: 1,
});
if (!artifacts.data?.artifacts?.[0]?.id) {
throw new Error(`No artifacts found for ${{ inputs.commit }}`);
}
const artifact_id = artifacts.data.artifacts[0].id;
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact_id,
archive_format: 'zip',
});
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/mb.zip`, Buffer.from(download.data));
- name: Unzip Metabase artifact containing an uberjar
run: unzip mb.zip
- name: Extract the version.properties file from the JAR
run: |
jar xf metabase.jar version.properties
- name: Reveal Metabase ${{ matrix.edition }} properties
- name: Extract version number from version.properties
id: version-properties
run: |
cat version.properties
@@ -204,121 +178,30 @@ jobs:
./logs/test.log
if-no-files-found: ignore
containerize:
needs: [release-artifact]
runs-on: ubuntu-22.04
timeout-minutes: 15
strategy:
matrix:
edition: [oss, ee]
services:
registry:
image: registry:2
ports:
- 5000:5000
outputs:
image_tag: ${{ steps.target.outputs.image_tag }}
steps:
- name: Get the version
run: |
if [[ "${{ matrix.edition }}" == "ee" ]]; then
echo "VERSION=${{ needs.release-artifact.outputs.ee_version }}" >> $GITHUB_ENV
else
echo "VERSION=${{ needs.release-artifact.outputs.oss_version }}" >> $GITHUB_ENV
fi
- name: Check out the code
uses: actions/checkout@v4
with:
ref: ${{ needs.release-artifact.outputs.commit }}
- uses: actions/download-artifact@v4
name: Retrieve uberjar artifact
with:
name: metabase-test-${{ matrix.edition }}-uberjar
- name: Move the Uberjar to the context dir
run: mv metabase.jar bin/docker/.
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Build ${{ matrix.edition }} container
uses: docker/build-push-action@v6
with:
context: bin/docker/.
platforms: linux/amd64
network: host
tags: localhost:5000/local-metabase:${{ env.VERSION }}
no-cache: true
push: true
containerize-oss:
needs: release-artifact
uses: ./.github/workflows/containerize-jar.yml
secrets: inherit
with:
artifact-name: metabase-release-oss-${{ inputs.commit }}-uberjar
commit: ${{ inputs.commit }}
repo: ${{ vars.DOCKERHUB_OWNER }}/${{ vars.DOCKERHUB_STAGING_REPO }}
tag: ${{ needs.release-artifact.outputs.oss_version }}-${{ inputs.commit }}
- name: Launch container
run: docker run --rm -dp 3000:3000 localhost:5000/local-metabase:${{ env.VERSION }}
timeout-minutes: 5
- name: Wait for Metabase to start
run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
timeout-minutes: 3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_RELEASE_USERNAME }}
password: ${{ secrets.DOCKERHUB_RELEASE_TOKEN }}
- name: Retag and push container image to ${{ vars.DOCKERHUB_OWNER }} staging Docker Hub repo
id: target
run: |
# SHA-1 truncated to 7 digits should be enough
SHORT_HASH=${COMMIT:0:7}
IMAGE_TAG=$VERSION-$SHORT_HASH
CONTAINER_IMAGE=${{ vars.DOCKERHUB_OWNER }}/${{ vars.DOCKERHUB_STAGING_REPO }}:$IMAGE_TAG
echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT
echo "Retag local image for staging"
docker tag localhost:5000/local-metabase:$VERSION $CONTAINER_IMAGE
echo "Pushing container image $CONTAINER_IMAGE ..."
docker push $CONTAINER_IMAGE
echo "Finished!"
shell: bash
env:
COMMIT: ${{ needs.release-artifact.outputs.commit }}
verify-docker-pull:
runs-on: ubuntu-22.04
needs: [release-artifact, containerize]
timeout-minutes: 15
strategy:
matrix:
edition: [oss, ee]
env:
IMAGE_TAG: ${{ needs.containerize.outputs.image_tag }}
steps:
- name: Login to Docker Hub # authenticated, to avoid being rate-throttled
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_RELEASE_USERNAME }}
password: ${{ secrets.DOCKERHUB_RELEASE_TOKEN }}
- name: Pull the container image
run: |
CONTAINER_IMAGE=${{ vars.DOCKERHUB_OWNER }}/${{ vars.DOCKERHUB_STAGING_REPO }}:$IMAGE_TAG
echo "Pulling container image $CONTAINER_IMAGE ..."
docker pull $CONTAINER_IMAGE
echo "Successful!"
- name: Launch container
run: |
CONTAINER_IMAGE=${{ vars.DOCKERHUB_OWNER }}/${{ vars.DOCKERHUB_STAGING_REPO }}:$IMAGE_TAG
docker run --rm -dp 3000:3000 $CONTAINER_IMAGE
timeout-minutes: 5
- name: Wait for Metabase to start
run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
timeout-minutes: 3
containerize-ee:
needs: release-artifact
uses: ./.github/workflows/containerize-jar.yml
secrets: inherit
with:
artifact-name: metabase-release-ee-${{ inputs.commit }}-uberjar
commit: ${{ inputs.commit }}
repo: ${{ vars.DOCKERHUB_OWNER }}/${{ vars.DOCKERHUB_STAGING_REPO }}
tag: ${{ needs.release-artifact.outputs.ee_version }}-${{ inputs.commit }}
tests-complete-message:
if: always()
runs-on: ubuntu-22.04
needs: [run-sanity-check, check-uberjar-health, verify-docker-pull]
needs: [run-sanity-check, check-uberjar-health, containerize-ee, containerize-oss]
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
@@ -338,7 +221,8 @@ jobs:
const allJobsSuccessful =
'${{ needs.run-sanity-check.result }}' === 'success' &&
'${{ needs.check-uberjar-health.result }}' === 'success' &&
'${{ needs.verify-docker-pull.result }}' === 'success';
'${{ needs.containerize-ee.result }}' === 'success' &&
'${{ needs.containerize-oss.result }}' === 'success';
await sendTestsCompleteMessage({
owner: context.repo.owner,

View File

@@ -14,6 +14,9 @@ on:
- release-x.51.x
- release-x.52.x
- release-x.53.x
- release-x.54.x
- metabot-v3-main
- esbuild-main
concurrency:
# We want to ensure only one job is running at a time per branch because
@@ -37,12 +40,143 @@ jobs:
triggered by: @${{ github.event.sender.login }}
EOF
determine-version:
name: Determine SDK version
send-slack-notification-start:
name: "Send Slack notification: SDK release started"
needs: determine-sdk-version
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
slackMessageId: ${{ steps.send-slack-message-start.outputs.result }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Cache build scripts
uses: actions/upload-artifact@v4
with:
name: build-scripts
path: release/dist/index.cjs
- name: Send build start message
id: send-slack-message-start
uses: actions/github-script@v7
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
result-encoding: string
script: | # js
const { mentionUserByGithubLogin, sendSlackMessage, githubRunLink } = require('${{ github.workspace }}/release/dist/index.cjs');
const sdkVersion = "${{ needs.determine-sdk-version.outputs.sdk_version }}";
const title = `:rocket: *SDK release: ${sdkVersion}* :rocket:`
const runLink = githubRunLink(
`:building_construction: _CI Run_ :building_construction:`,
context.runId,
context.repo.owner,
context.repo.repo,
);
const body = `${runLink} - run by ${mentionUserByGithubLogin("${{ github.event.sender.login }}")}`
const sendSlackMessageResponse = await sendSlackMessage({
channelName: 'team-embedding-releases',
message: `${title}\n${body}`,
});
return sendSlackMessageResponse.message.ts
# Technically this should be placed last, since it runs after other jobs, but I want to co-locate all Slack jobs
send-slack-notification-failure:
name: "Send Slack notification: SDK release failed"
needs:
[
"determine-sdk-version",
"send-slack-notification-start",
"check-git-tag",
"test",
"build-sdk",
"publish-npm",
"git-tag",
]
runs-on: ubuntu-22.04
timeout-minutes: 5
env:
slackMessageId: ${{ needs.send-slack-notification-start.outputs.slackMessageId }}
if: ${{ always() && contains(needs.*.result, 'failure') }}
steps:
- name: Retrieve build scripts
uses: actions/download-artifact@v4
with:
name: build-scripts
path: release/dist/
- name: Send build failure message
uses: actions/github-script@v7
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
script: | # js
const { githubRunLink, sendSlackReply } = require('${{ github.workspace }}/release/dist/index.cjs');
const sdkVersion = "${{ needs.determine-sdk-version.outputs.sdk_version }}";
const runLink = githubRunLink(
`:x: ${sdkVersion} Release has failed`,
context.runId,
context.repo.owner,
context.repo.repo,
);
sendSlackReply({
channelName: 'team-embedding-releases',
message: runLink,
messageId: ${{ env.slackMessageId}},
broadcast: true
});
send-slack-notification-successful:
name: "Send Slack notification: SDK release successful"
needs:
["determine-sdk-version", "send-slack-notification-start", "publish-npm"]
runs-on: ubuntu-22.04
timeout-minutes: 5
env:
slackMessageId: ${{ needs.send-slack-notification-start.outputs.slackMessageId }}
steps:
- name: Retrieve build scripts
uses: actions/download-artifact@v4
with:
name: build-scripts
path: release/dist/
- name: Send build successful message
uses: actions/github-script@v7
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
script: | # js
const { githubRunLink, sendSlackReply } = require('${{ github.workspace }}/release/dist/index.cjs');
const sdkVersion = "${{ needs.determine-sdk-version.outputs.sdk_version }}";
const runLink = githubRunLink(
`:partydeploy: ${sdkVersion} Release is complete :partydeploy:`,
context.runId,
context.repo.owner,
context.repo.repo,
);
sendSlackReply({
channelName: 'team-embedding-releases',
message: runLink,
messageId: ${{ env.slackMessageId}},
broadcast: true
});
determine-sdk-version:
runs-on: ubuntu-22.04
timeout-minutes: 20
outputs:
sdk_version: ${{ steps.new-sdk-version.outputs.result }}
sdk_version: ${{ fromJson(steps.new-sdk-version.outputs.result).version }}
major_version: ${{ fromJson(steps.new-sdk-version.outputs.result).majorVersion }}
steps:
- name: Check out the code using the provided branch
uses: actions/checkout@v4
@@ -59,19 +193,25 @@ jobs:
id: new-sdk-version
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const currentVersion = "${{ steps.current-sdk-version.outputs.sdk_current_version }}";
const [currentVersionWithoutSuffix, suffix] = currentVersion.split("-");
const versionParts = currentVersionWithoutSuffix.split(".");
versionParts[versionParts.length - 1] = parseInt(versionParts.at(-1)) + 1;
const newVersion = versionParts.join(".");
const [_, majorVersion] = versionParts
if (!suffix) {
return newVersion;
return {
version: newVersion,
majorVersion
};
}
return `${newVersion}-${suffix}`
return {
version: `${newVersion}-${suffix}`,
majorVersion
}
- name: Append workflow summary
run: |
@@ -79,15 +219,16 @@ jobs:
**Derived inputs:**
- \`current_version\`: "${{ steps.current-sdk-version.outputs.sdk_current_version }}"
- \`next_version\`: "${{ steps.new-sdk-version.outputs.result }}"
- \`next_version\`: "${{ fromJson(steps.new-sdk-version.outputs.result).version }}"
- \`major_version\`: "${{ fromJson(steps.new-sdk-version.outputs.result).majorVersion }}"
EOF
check-git-tag:
needs: determine-version
needs: determine-sdk-version
runs-on: ubuntu-22.04
timeout-minutes: 20
env:
tag: embedding-sdk-${{ needs.determine-version.outputs.sdk_version }}
tag: embedding-sdk-${{ needs.determine-sdk-version.outputs.sdk_version }}
steps:
- name: Check out the code using the provided branch
uses: actions/checkout@v4
@@ -128,7 +269,7 @@ jobs:
run: yarn embedding-sdk:test-unit
build-sdk:
needs: [test, determine-version]
needs: [test, determine-sdk-version]
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
@@ -150,7 +291,7 @@ jobs:
- name: Bump published npm package version
# NOTE: this should happen before "Build SDK bundle" as we inject SDK version into the code during build step
run: |
./bin/embedding-sdk/release_utils.bash update_package_json_template ${{ needs.determine-version.outputs.sdk_version }}
./bin/embedding-sdk/release_utils.bash update_package_json_template ${{ needs.determine-sdk-version.outputs.sdk_version }}
- name: Update changelog
run: |
@@ -175,15 +316,16 @@ jobs:
path: ./changelog-diff
publish-npm:
needs: [build-sdk, determine-version]
needs: [build-sdk, determine-sdk-version]
runs-on: ubuntu-22.04
timeout-minutes: 20
env:
sdk_version: ${{ needs.determine-version.outputs.sdk_version }}
sdk_version: ${{ needs.determine-sdk-version.outputs.sdk_version }}
steps:
- name: Check out branch to prepare for a SDK version bump PR
uses: actions/checkout@v4
with:
token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
# when we created version update PR, it would only have diff from 2 files SDK readme and SDK package.json template
ref: ${{ inputs.branch}}
@@ -212,10 +354,6 @@ jobs:
- name: Create a PR updating readme + published version, and changelog (using GitHub Metabase Automation account)
run: |
# TODO: Remove this step once github includes the new gh CLI version 2.65.0
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install gh
git checkout -b update-sdk-version-${{ env.sdk_version }}
git commit -a -m 'Update Readme version references and published npm version to ${{ env.sdk_version }}'
git push origin HEAD
@@ -226,17 +364,11 @@ jobs:
env:
GH_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_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: Edit PR adding useful information (using Metabase bot app)
run: |
gh pr edit --add-reviewer @metabase/embedding,albertoperdomo --add-label no-backport
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GH_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Auto approve PR (using GitHub Actions account)
run: |
@@ -261,32 +393,40 @@ jobs:
run: |
echo //registry.npmjs.org/:_authToken=${{ secrets.NPM_RELEASE_TOKEN }} > .npmrc
# Please keep the value in sync with `inputs.branch`'s release branch
npm publish --tag ${{fromJson('{"master": "nightly", "release-x.51.x": "51-stable", "release-x.52.x": "52-stable", "release-x.53.x": "53-stable"}')[inputs.branch]}}
npm publish --tag ${{fromJson('{"master": "nightly", "release-x.51.x": "51-stable", "release-x.52.x": "52-stable", "release-x.53.x": "53-stable", "release-x.54.x": "54-stable", "metabot-v3-main": "55-metabot", "esbuild-main": "56-esbuild"}')[inputs.branch]}}
- name: Add `latest` tag to the latest release branch (`release-x.53.x`) deployment
if: ${{ inputs.branch == 'release-x.53.x' }}
- name: Add `latest` tag to the latest release branch (`release-x.54.x`) deployment
if: ${{ inputs.branch == 'release-x.54.x' }}
working-directory: sdk
run: |
npm dist-tag add @metabase/embedding-sdk-react@${{ env.sdk_version }} latest
git-tag:
needs: [publish-npm, determine-version]
needs: [publish-npm, determine-sdk-version]
runs-on: ubuntu-22.04
timeout-minutes: 20
env:
tag: embedding-sdk-${{ needs.determine-version.outputs.sdk_version }}
tag: embedding-sdk-${{ needs.determine-sdk-version.outputs.sdk_version }}
stable_tag: embedding-sdk-${{ needs.determine-sdk-version.outputs.major_version }}-stable
steps:
- name: Check out the code using the provided branch
uses: actions/checkout@v4
with:
token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
ref: ${{ inputs.branch }}
# Lightweight tags don't need committer name and email
- name: Create a new git tag
- name: Setup git user
run: |
git tag ${{ env.tag }}
git config --global user.email "github-automation@metabase.com"
git config --global user.name "Metabase Automation"
- name: Push the new tag
id: push-tag
- name: Create and push SDK version tag
run: |
git tag -a ${{ env.tag }} -m "Tagging SDK version ${{ env.tag }}"
git push origin ${{ env.tag }}
- name: Create and push SDK stable version tag
if: ${{ startsWith(inputs.branch, 'release-x.') }}
run: |
git tag -a -f ${{ env.stable_tag }} -m "Tagging SDK stable version ${{ env.stable_tag }}"
git push origin -f ${{ env.stable_tag }}

View File

@@ -50,7 +50,7 @@ jobs:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn --frozen-lockfile && yarn build
- name: Check release status and post to Slack
- name: Check backport status and post to Slack
uses: actions/github-script@v7
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

View File

@@ -269,12 +269,15 @@ jobs:
needs: check-version
runs-on: ubuntu-22.04
timeout-minutes: 5
env:
GH_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
strategy:
matrix:
edition: ${{ fromJson(needs.check-version.outputs.edition_matrix) }}
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
fetch-depth: 0 # we want all branches and tags
fetch-tags: true
- name: Add and push git tag for nightly/beta/latest

View File

@@ -99,7 +99,11 @@ jobs:
throw new Error("This version has already been released!", version);
}
return versions;
console.log({
versions,
});
return versions
publish-start-message:
runs-on: ubuntu-22.04
@@ -137,41 +141,13 @@ jobs:
matrix:
edition: [oss, ee]
steps:
- name: find_release_artifact
id: find_release_artifact
uses: actions/github-script@v7
- uses: actions/checkout@v4
with:
result-encoding: string
script: | # js
const fs = require('fs');
const artifacts = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
name: `metabase-release-${{ matrix.edition }}-${{ inputs.commit }}-uberjar`,
per_page: 1,
});
if (!artifacts.data?.artifacts?.[0]?.id) {
throw new Error(`No artifacts found for ${{ inputs.commit }}`);
}
const artifact_id = artifacts.data.artifacts[0].id;
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact_id,
archive_format: 'zip',
});
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/mb.zip`, Buffer.from(download.data));
- name: unzip uberjar artifact
run: unzip mb.zip
- name: Verify that this is a valid JAR file
run: file --mime-type ./metabase.jar | grep "application/zip"
- name: Reveal its version.properties
run: jar xf metabase.jar version.properties && cat version.properties
sparse-checkout: .github
- name: Retrieve test build uberjar artifact for ${{ matrix.edition }}
uses: ./.github/actions/fetch-artifact
with:
name: metabase-release-${{ matrix.edition }}-${{ inputs.commit }}-uberjar
- name: Check JAR version properties
run: |
# ensure actual jar checksum matches checksum file
@@ -247,7 +223,6 @@ jobs:
--distribution-id ${{ vars.AWS_CLOUDFRONT_DOWNLOADS_ID }} \
--paths /${{ steps.version_path.outputs.result }}/metabase.jar
verify-s3-download:
runs-on: ubuntu-22.04
needs: upload-to-s3
@@ -281,143 +256,29 @@ jobs:
- name: Verify Checksum
run: grep -q $(sha256sum ./metabase-downloaded.jar) SHA256.sum && echo "checksums match" || exit 1
containerize:
runs-on: ubuntu-22.04
needs: [check-version, download-uberjar]
timeout-minutes: 15
strategy:
matrix:
edition: [oss, ee]
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- uses: actions/checkout@v4
with:
# checkout the commit that was tagged so we get the right dockerfile
ref: ${{ inputs.commit }}
fetch-depth: 0 # IMPORTANT! to get all the tags
- name: prepare release scripts
run: cd release && yarn && yarn build
- name: Determine the docker version tag
uses: actions/github-script@v7
id: canonical_version
with:
result-encoding: string
script: |
const version = '${{ inputs.version }}';
const edition = '${{ matrix.edition }}';
containerize-oss:
needs: check-version
uses: ./.github/workflows/containerize-jar.yml
secrets: inherit
with:
artifact-name: metabase-release-oss-${{ inputs.commit }}-uberjar
commit: ${{ inputs.commit }}
repo: ${{ vars.DOCKERHUB_OWNER }}/${{ vars.DOCKERHUB_REPO }}
tag: ${{ needs.check-version.outputs.oss }}
const canonical_version = edition === 'ee'
? '${{ needs.check-version.outputs.ee }}'
: '${{ needs.check-version.outputs.oss }}';
console.log("The canonical version of this Metabase", edition, "edition is", canonical_version);
return canonical_version;
- uses: actions/download-artifact@v4
name: Retrieve previously downloaded Uberjar
with:
name: metabase-${{ matrix.edition }}-uberjar
- name: Move the Uberjar to the context dir
run: mv ./metabase.jar bin/docker/.
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
- name: Build ${{ matrix.edition }} container
uses: docker/build-push-action@v3
with:
context: bin/docker/.
platforms: linux/amd64
network: host
tags: localhost:5000/local-metabase:${{ steps.canonical_version.outputs.result }}
no-cache: true
push: true
- name: Launch container
run: docker run --rm -dp 3000:3000 localhost:5000/local-metabase:${{ steps.canonical_version.outputs.result }}
timeout-minutes: 5
- name: Wait for Metabase to start
run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
timeout-minutes: 3
- name: Determine the target Docker Hub repository
run: |
if [[ "${{ matrix.edition }}" == "ee" ]]; then
echo "Metabase EE: image is going to be pushed to ${{ github.repository_owner }}/metabase-enterprise"
echo "DOCKERHUB_REPO=${{ github.repository_owner }}/metabase-enterprise" >> $GITHUB_ENV
else
echo "Metabase OSS: image is going to be pushed to ${{ github.repository_owner }}/metabase"
echo "DOCKERHUB_REPO=${{ github.repository_owner }}/metabase" >> $GITHUB_ENV
fi
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_RELEASE_USERNAME }}
password: ${{ secrets.DOCKERHUB_RELEASE_TOKEN }}
- name: Retag and push container image to Docker Hub
run: |
echo "Pushing ${{ steps.canonical_version.outputs.result }} to ${{ env.DOCKERHUB_REPO }} ..."
docker tag localhost:5000/local-metabase:${{ steps.canonical_version.outputs.result }} ${{ env.DOCKERHUB_REPO }}:${{ steps.canonical_version.outputs.result }}
docker push ${{ env.DOCKERHUB_REPO }}:${{ steps.canonical_version.outputs.result }}
echo "Finished!"
verify-docker-pull:
runs-on: ubuntu-22.04
needs: containerize
timeout-minutes: 15
strategy:
matrix:
edition: [oss, ee]
steps:
- name: Login to Docker Hub # authenticated, to avoid being rate-throttled
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_RELEASE_USERNAME }}
password: ${{ secrets.DOCKERHUB_RELEASE_TOKEN }}
- name: Determine the container image to pull
run: |
if [[ "${{ matrix.edition }}" = "ee" ]]; then
echo "DOCKERHUB_REPO=${{ github.repository_owner }}/metabase-enterprise" >> $GITHUB_ENV
else
echo "DOCKERHUB_REPO=${{ github.repository_owner }}/metabase" >> $GITHUB_ENV
fi
- name: Determine the docker version tag
uses: actions/github-script@v7
id: canonical_version
with:
result-encoding: string
script: |
const version = '${{ inputs.version }}';
const edition = '${{ matrix.edition }}';
const canonical_version = edition === "ee"
? version.replace(/^v0\./, "v1.") // always e.g. v1.47.2
: version.replace(/^v1\./, "v0."); // always e.g. v0.47.2
console.log("The canonical version of this Metabase", edition, "edition is", canonical_version);
return canonical_version;
- name: Pull the container image
run: |
echo "Pulling container image ${{ env.DOCKERHUB_REPO }}:${{ steps.canonical_version.outputs.result }} ..."
docker pull ${{ env.DOCKERHUB_REPO }}:${{ steps.canonical_version.outputs.result }}
echo "Successful!"
- name: Launch container
run: docker run --rm -dp 3000:3000 ${{ env.DOCKERHUB_REPO }}:${{ steps.canonical_version.outputs.result }}
timeout-minutes: 5
- name: Wait for Metabase to start
run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
timeout-minutes: 3
containerize-ee:
needs: check-version
uses: ./.github/workflows/containerize-jar.yml
secrets: inherit
with:
artifact-name: metabase-release-ee-${{ inputs.commit }}-uberjar
commit: ${{ inputs.commit }}
repo: ${{ vars.DOCKERHUB_OWNER }}/${{ vars.DOCKERHUB_REPO }}-enterprise
tag: ${{ needs.check-version.outputs.ee }}
push-tags:
permissions: write-all
needs: [verify-s3-download, verify-docker-pull, check-version]
needs: [verify-s3-download, containerize-oss, containerize-ee, check-version]
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
@@ -429,6 +290,7 @@ jobs:
- name: Tag Release
uses: actions/github-script@v7
with:
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
result-encoding: string
script: | # js
const { tagRelease } = require('${{ github.workspace }}/release/dist/index.cjs');
@@ -476,7 +338,8 @@ jobs:
needs:
- get-extra-tags
- push-tags
- verify-docker-pull
- containerize-ee
- containerize-oss
- verify-s3-download
strategy:
matrix:
@@ -496,6 +359,29 @@ jobs:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Find milestone
id: find-milestone
uses: actions/github-script@v7
with:
script: | # js
const { findMilestone } = require('${{ github.workspace }}/release/dist/index.cjs');
const version = '${{ inputs.version }}';
const milestone = await findMilestone({
github,
owner: context.repo.owner,
repo: context.repo.repo,
version,
}).catch(console.error);
console.log("Milestone:", milestone.number);
core.setOutput('milestone', milestone.number);
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
@@ -509,6 +395,10 @@ jobs:
event_type: 'create-release-issues',
client_payload: {
version: enterpriseVersion,
runId: '${{ github.run_id }}',
releaseSha: '${{ inputs.commit }}',
userName: '${{ github.actor }}',
milestone: '${{ steps.find-milestone.outputs.milestone }}',
}
});
@@ -550,19 +440,36 @@ jobs:
sparse-checkout: release
- name: prepare release scripts
run: cd release && yarn && yarn build
- name: Publish draft release notes
- name: Publish draft release notes to github
uses: actions/github-script@v7
with:
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
result-encoding: string
script: | # js
const { publishRelease, getCanonicalVersion } = require('${{ github.workspace }}/release/dist/index.cjs');
const {
publishRelease,
getCanonicalVersion,
getGenericVersion,
getMilestoneIssues,
getWebsiteChangelog,
getMajorVersion
} = require('${{ github.workspace }}/release/dist/index.cjs');
const version = '${{ inputs.version }}';
const issues = await getMilestoneIssues({
version,
github,
owner: context.repo.owner,
repo: context.repo.repo,
});
// github release notes
await publishRelease({
github,
owner: context.repo.owner,
repo: context.repo.repo,
issues,
version,
}).then(() => {
console.log('Successfully published release notes', '${{ inputs.version }}');
@@ -571,6 +478,20 @@ jobs:
process.exit(1);
});
// website changelog
const changelogText = getWebsiteChangelog({ version, issues });
await github.rest.repos.createDispatchEvent({
owner: context.repo.owner,
repo: '${{ vars.WEBSITE_REPO }}',
event_type: 'update-changelog',
client_payload: {
version: getGenericVersion(version),
majorVersion: getMajorVersion(version),
text: changelogText,
}
}).catch(console.warn);
publish-version-info:
runs-on: ubuntu-22.04
needs: [push-tags, check-version]
@@ -672,7 +593,6 @@ jobs:
version: '${{ inputs.version }}',
runId: '${{ github.run_id }}',
channelName: '${{ vars.SLACK_RELEASE_CHANNEL }}',
generalChannelName: !isAutoRelease ? '${{ vars.SLACK_GENERAL_CHANNEL }}' : '',
}).catch(console.error);
manage-milestones:

View File

@@ -15,6 +15,9 @@ jobs:
timeout-minutes: 5
outputs:
e2e_all: ${{ steps.changes.outputs.e2e_all }}
e2e_all_files: ${{ steps.changes.outputs.e2e_all_files }}
e2e_specs: ${{ steps.changes.outputs.e2e_specs }}
e2e_specs_files: ${{ steps.changes.outputs.e2e_specs_files }}
backend_all: ${{ steps.changes.outputs.backend_all }}
frontend_all: ${{ steps.changes.outputs.frontend_all }}
frontend_sources: ${{ steps.changes.outputs.frontend_sources }}
@@ -25,6 +28,8 @@ jobs:
id: changes
with:
token: ${{ github.token }}
# comma separated list of files
list-files: csv
filters: .github/file-paths.yaml
static-viz-files-changed:
@@ -43,6 +48,8 @@ jobs:
m2-cache-key: "files-changed"
- name: Build static-viz frontend
run: yarn build-static-viz
env:
MB_EDITION: ee
- name: Upload Static Viz Bundle Artifact
uses: actions/upload-artifact@v4
with:
@@ -77,6 +84,7 @@ jobs:
secrets: inherit
with:
skip: ${{ needs.files-changed.outputs.frontend_all != 'true' }}
skip-lint: ${{ needs.files-changed.outputs.frontend_all != 'true' && needs.files-changed.outputs.e2e_specs != 'true' }}
e2e-tests:
needs: files-changed
@@ -84,3 +92,8 @@ jobs:
secrets: inherit
with:
skip: ${{ needs.files-changed.outputs.e2e_all != 'true' }}
# here we pass result from files-changed, which is a list of files, comma separated
# e.g. e2e/test/scenarios/onboarding/command-palette.cy.spec.js,e2e/test/scenarios/question/document-title.cy.spec.js
# e2e_all_files includes all changes which trigger all e2e tests, if the list of changes files is included in the
# list of changed specs files, then only specs are changed and we can run only those specs
specs: ${{ needs.files-changed.outputs.e2e_all_files == needs.files-changed.outputs.e2e_specs_files && needs.files-changed.outputs.e2e_specs_files || '' }}

View File

@@ -29,12 +29,23 @@ jobs:
- uses: snyk/actions/setup@0.4.0
- name: Generate all pom.xml
run: .github/scripts/write-poms.sh
- name: Run snyk
- name: Run snyk main project
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
continue-on-error: true
run: snyk test --all-projects --sarif-file-output=snyk.sarif
run: snyk test --all-projects --exclude="modules" --sarif-file-output=snyk-main.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: snyk.sarif
sarif_file: snyk-main.sarif
category: main-project
- name: Run snyk drivers
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
continue-on-error: true
run: cd modules && snyk test --all-projects --sarif-file-output=snyk-drivers.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: modules/snyk-drivers.sarif
category: drivers

View File

@@ -135,6 +135,9 @@ jobs:
env:
INTERACTIVE: false
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: .github
- name: Get correct version number
run: | # bash
if [ '${{matrix.edition}}' == 'ee' ]; then
@@ -151,54 +154,9 @@ jobs:
java-version: 21
- name: Retrieve test build uberjar artifact for ${{ matrix.edition }}
id: find_release_artifact
uses: actions/github-script@v7
uses: ./.github/actions/fetch-artifact
with:
result-encoding: string
script: | # js
const fs = require('fs');
const artifacts = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
name: `metabase-${{ matrix.edition }}-${{ inputs.commit }}-uberjar`,
per_page: 1,
});
if (!artifacts.data?.artifacts?.[0]?.id) {
console.warn(`No existing artifacts found for ${{ inputs.commit }}, need to build jar`);
if ("${{matrix.edition}}" === 'oss') {
// only trigger the build job on OSS, otherwise we'll get double builds
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'build-for-release.yml',
ref: 'refs/heads/master',
inputs: {
commit: '${{ inputs.commit }}',
version: '${{ inputs.version }}',
}
});
}
throw new Error('aborting in favor of build script');
}
const artifact_id = artifacts.data.artifacts[0].id;
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact_id,
archive_format: 'zip',
});
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/mb.zip`, Buffer.from(download.data));
- name: Unzip Metabase artifact containing an uberjar
run: |
unzip mb.zip
mv target/uberjar/metabase.jar metabase.jar
name: metabase-${{ matrix.edition }}-${{ inputs.commit }}-uberjar
- name: Update version.properties in jar
run: | # sh

View File

@@ -1,134 +1,119 @@
name: Update Translations
run-name: Update Translations for v${{ inputs.version }} - ${{ inputs.step }}
name: Synchronize Translations
on:
schedule:
- cron: 30 5 * * 2 # tuesday morning, UTC
workflow_dispatch:
inputs:
step:
type: choice
description: Upload untranslated strings | Download translated strings
options:
- upload
- download
required: true
version:
type: string
description: "The version number for which to update translations (e.g. 43, 58.7)"
required: true
permissions:
contents: write
pull-requests: write
jobs:
upload-translations:
name: Upload Translations
if: ${{ inputs.step == 'upload' }}
synchronize-translations:
name: Synchronize Translations
env:
BRANCH_NAME: update-translations-${{ github.run_id }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
GH_TOKEN: ${{ github.token }}
runs-on: ubuntu-22.04
timeout-minutes: 20
env:
POEDITOR_API_TOKEN: ${{ secrets.POEDITOR_API_TOKEN }}
POEDITOR_PROJECT_ID: 200535
VERSION: ${{ inputs.version }}
steps:
- name: Checkout code
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: manage-translations
- name: install gettext
run: sudo apt-get install gettext
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: manage-translations
- name: install gettext
run: sudo apt-get install gettext
# TODO: check for untranslated strings
- name: Crowdin download
uses: crowdin/github-action@v2
id: crowdin-download
with:
config: locales/crowdin.yml
command: download
command_args: |
--config locales/crowdin.yml
-e=el
-e=es-MX
-e=gu-IN
-e=hr
-e=lt
-e=km
-e=pt-PT
-e=ro
-e=th
-e=uz
- name: Upload strings to be translated
run: | # sh
./bin/i18n/update-translation-template
./bin/i18n/export-pot-to-poeditor
echo "Strings uploaded to POEditor"
- name: Prepare translation resources
env:
GITHUB_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
run: | # sh
git config user.name github-actions
git config user.email github-actions@github.com
git checkout -b $BRANCH_NAME
- name: Commit changes
env:
GH_TOKEN: ${{ github.token }}
run: | # sh
git config user.name github-actions
git config user.email github-actions@github.com
DATE=$(date +'%Y-%m-%d')
BRANCH_NAME="update-translations-v$VERSION"
./bin/i18n/update-translation-template
git checkout -b $BRANCH_NAME
git add locales/
git add locales/metabase.po
git commit -m "Update translation sources $DATE" --no-verify
git commit -m "Add new strings for v$VERSION"
git push -u origin $BRANCH_NAME
./bin/i18n/build-translation-resources
gh pr create \
--reviewer "${GITHUB_ACTOR}" \
--assignee "${GITHUB_ACTOR}" \
--title "Update Translations for v$VERSION" \
--body "Update translations from POEditor for v$VERSION
git add locales/
git commit -a -m "Update translations $Date" --allow-empty --no-verify
git push -u origin $BRANCH_NAME
See [translation update documentation](https://www.notion.so/metabase/Process-for-updating-translations-421db70048fe400da1153ad0b61102f4)
- name: Crowdin upload
uses: crowdin/github-action@v2
id: crowdin-upload
env:
GITHUB_TOKEN: ${{ github.token }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
with:
config: locales/crowdin.yml
command: upload
command_args: --config locales/crowdin.yml
## To Do
- name: Open PR
id: create_pr
env:
GITHUB_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
run: | # sh
DATE=$(date +'%Y-%m-%d')
- [x] Upload new strings to POEditor
- [ ] Message contributors on POEditor (manual)
- [ ] Copy source strings to english language (manual)
- [ ] Download translations from POEditor (github action)
- [ ] Merge this PR and backport to the release branch (manual)
" \
--label "backport" \
--label "Customization/i18n"
URL=$(gh pr create \
--base master \
--head $BRANCH_NAME \
--title "Update translations $DATE" \
--body "Synchronize translations with Crowdin" \
--label "no-backport" \
--label "Customization/i18n")
# TODO: notify contributors
# TODO: copy source strings to english language
PR_NUMBER=${URL##*/}
download-translations:
name: Download Translations
if: ${{ inputs.step == 'download' }}
runs-on: ubuntu-22.04
timeout-minutes: 20
env:
POEDITOR_API_TOKEN: ${{ secrets.POEDITOR_API_TOKEN }}
POEDITOR_PROJECT_ID: 200535
VERSION: ${{ inputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# assumes there's already a branch with that name from the upload step
ref: update-translations-v${{inputs.VERSION}}
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: manage-translations
echo "::set-output name=pr_number::$PR_NUMBER"
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Automatically translate untranslated strings
uses: actions/github-script@v7
with:
script: | # js
const { autoTranslateSupportedLanguages } = require('${{ github.workspace }}/release/dist/index.cjs');
- name: Auto approve PR
uses: juliangruber/approve-pull-request-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.create_pr.outputs.pr_number }}
await autoTranslateSupportedLanguages();
- name: Download translated strings
run: | # sh
cd ${{ github.workspace }}
./bin/i18n/import-po-from-poeditor
./bin/i18n/build-translation-resources
- name: Commit changes
run: | # sh
git config user.name github-actions
git config user.email github-actions@github.com
BRANCH_NAME="update-translations-v$VERSION"
git add locales/
git commit -m "Update translations"
git push -u origin $BRANCH_NAME
- name: Enable Pull Request Automerge
uses: peter-evans/enable-pull-request-automerge@v2
with:
token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
pull-request-number: ${{ steps.create_pr.outputs.pr_number }}
merge-method: squash

View File

@@ -1,355 +1,174 @@
name: Build + Docker Uberjar
# This workflow builds an uberjar and pushes it to dockerhub for any branch, either on-demand,
# or automatically for the listed branches
on:
push:
branches:
- "master"
- metabot-v3-second-try
- master
- metabot-v3-main
- feature-visualizer
- internal-tools
paths-ignore:
# config files
- ".**"
# documentation
- 'docs/**'
- "docs/**"
- "**.md"
# this covers both BE and FE unit tests, as well as E2E tests
- '**test/**'
- "**test/**"
- "**_test.clj"
- "**/frontend/**.unit.*"
workflow_dispatch:
inputs:
commit:
description: 'Optional full-length commit SHA-1 hash'
description: "Optional full-length commit SHA-1 hash"
jobs:
get-container-info:
runs-on: ubuntu-22.04
timeout-minutes: 5
name: Get container info
outputs:
editions: ${{ toJson(fromJson(steps.info.outputs.result).editions) }}
ee: ${{ toJson(fromJson(steps.info.outputs.result).ee) }}
oss: ${{ toJson(fromJson(steps.info.outputs.result).oss) }}
steps:
- name: Get docker repo and tag
id: info
uses: actions/github-script@v7
with:
script: | # js
const branch = '${{ github.head_ref || github.ref_name }}';
const owner = '${{ github.repository_owner }}';
console.log(`Branch: ${branch}`);
if (branch === "master") {
return {
editions: ["ee", "oss"],
ee: {
repo: `${owner}/metabase-enterprise-head`,
tag: "latest"
},
oss: {
repo: `${owner}/metabase-head`,
tag: "latest"
}
};
}
return {
editions: ["ee"],
ee: {
repo: `${owner}/metabase-dev`,
tag: branch.replaceAll("/", "-"), // slashes make docker sad
},
};
- name: Print output
run: |
echo "${{ steps.info.outputs.result }}"
build:
needs: get-container-info
name: Build MB ${{ matrix.edition }}
runs-on: ubuntu-22.04
timeout-minutes: 40
timeout-minutes: 15
strategy:
matrix:
edition: [ee, oss]
edition: ${{ fromJson(needs.get-container-info.outputs.editions) }}
env:
MB_EDITION: ${{ matrix.edition }}
INTERACTIVE: false
SKIP_LICENSES: true # faster builds for dev
steps:
- name: Check out the code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit }}
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: uberjar
java-version: 21
- name: Build
run: ./bin/build.sh
- name: Prepare uberjar artifact
uses: ./.github/actions/prepare-uberjar-artifact
with:
name: metabase-${{ matrix.edition }}-${{ github.sha }}-uberjar
check_jar_health:
runs-on: ubuntu-22.04
name: Is ${{ matrix.edition }} (java ${{ matrix.java-version }}) healthy?
needs: build
timeout-minutes: 10
strategy:
matrix:
edition: [ee, oss]
java-version: [21]
steps:
- name: Prepare JRE (Java Run-time Environment)
uses: actions/setup-java@v4
with:
java-package: jre
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
- run: java -version
- uses: actions/download-artifact@v4
name: Retrieve uberjar artifact
with:
name: metabase-${{ matrix.edition }}-${{ github.sha }}-uberjar
- name: Launch uberjar
run: >-
java --add-opens java.base/java.nio=ALL-UNNAMED -jar ./target/uberjar/metabase.jar &
- name: Wait for Metabase to start
run: while ! curl 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
containerize_test_and_push_container:
runs-on: ubuntu-22.04
name: Containerize ${{ matrix.edition }}
needs: check_jar_health
strategy:
matrix:
edition: [ee, oss, ee-extra]
services:
registry:
image: registry:2
ports:
- 5000:5000
permissions:
id-token: write
contents: read
security-events: write
steps:
- name: Extract and clean branch name
shell: bash
run: echo "branch=$(echo $GITHUB_REF_NAME | sed 's/[^-._a-zA-Z0-9]/-/g')" >> $GITHUB_OUTPUT
id: extract_branch
- name: Verify the intended tag of the container image
run: echo "Container image will be tagged as ${{ steps.extract_branch.outputs.branch }}-${{ matrix.edition }}"
- name: Check out the code (Dockerfile needed)
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit }}
- name: Download uploaded artifacts to insert into container
if: ${{ matrix.edition != 'ee-extra' }}
uses: actions/download-artifact@v4
with:
name: metabase-${{ matrix.edition }}-${{ github.sha }}-uberjar
path: bin/docker/
- name: Download uploaded artifacts to insert into container
if: ${{ matrix.edition == 'ee-extra' }}
uses: actions/download-artifact@v4
with:
name: metabase-ee-${{ github.sha }}-uberjar
path: bin/docker/
- name: Move the ${{ matrix.edition }} uberjar to the context dir
run: mv bin/docker/target/uberjar/metabase.jar bin/docker/.
- name: Add partner drivers to the container
if: ${{ matrix.edition == 'ee-extra' }}
uses: ./.github/actions/build-ee-extra
with:
iam-role: ${{ secrets.METABASE_EE_EXTRA_IAM_ROLE }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.5.0
with:
driver-opts: network=host
- name: Build ${{ matrix.edition }} container
uses: docker/build-push-action@v3
with:
context: bin/docker/.
platforms: linux/amd64,linux/arm64
network: host
tags: localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-${{ matrix.edition }}
build-args: |
GIT_COMMIT_SHA=${{ github.sha }}
no-cache: true
push: true
- name: Launch ${{ matrix.edition }} container
run: docker run --rm -dp 3000:3000 localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-${{ matrix.edition }}
timeout-minutes: 5
- name: Is Docker running?
run: docker ps
- name: Wait for Metabase to start and reach 100% health
run: while ! curl 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
timeout-minutes: 3
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Retag and push images if master (ee) - should be cached at this point
if: ${{ (github.ref_name == 'master') && matrix.edition == 'ee' }}
uses: docker/build-push-action@v3
with:
context: bin/docker/.
platforms: linux/amd64,linux/arm64
network: host
tags: ${{ github.repository_owner }}/metabase-enterprise-head:latest
build-args: |
GIT_COMMIT_SHA=${{ github.sha }}
no-cache: false
push: true
# TODO: remove when we're done testing metabot
- name: Retag and push images if metabot-v3-second-try (ee) - should be cached at this point
if: ${{ (github.ref_name == 'metabot-v3-second-try') && matrix.edition == 'ee' }}
uses: docker/build-push-action@v3
with:
context: bin/docker/.
platforms: linux/amd64,linux/arm64
network: host
tags: ${{ github.repository_owner }}/metabase-enterprise-head:metabot
build-args: |
GIT_COMMIT_SHA=${{ github.sha }}
no-cache: false
push: true
- name: Retag and push images if master (oss) - should be cached at this point
if: ${{ (github.ref_name == 'master') && matrix.edition == 'oss' }}
uses: docker/build-push-action@v3
with:
context: bin/docker/.
platforms: linux/amd64,linux/arm64
network: host
tags: ${{ github.repository_owner }}/metabase-head:latest
build-args: |
GIT_COMMIT_SHA=${{ github.sha }}
no-cache: false
push: true
- name: Retag and push images if master (ee-extra) - should be cached at this point
if: ${{ (github.ref_name == 'master') && matrix.edition == 'ee-extra' }}
uses: docker/build-push-action@v3
with:
context: bin/docker/.
platforms: linux/amd64,linux/arm64
network: host
tags: ${{ secrets.METABASE_EE_EXTRA_CONTAINER_REGISTRY }}/metabase-enterprise-head:latest
build-args: |
GIT_COMMIT_SHA=${{ github.sha }}
no-cache: false
push: true
- name: Retag and push images if dev branch - should be cached at this point
if: ${{ !(startsWith(github.ref_name,'master') || startsWith(github.ref_name,'backport')) && matrix.edition == 'ee' }}
uses: docker/build-push-action@v3
with:
context: bin/docker/.
platforms: linux/amd64,linux/arm64
network: host
tags: ${{ github.repository_owner }}/metabase-dev:${{ steps.extract_branch.outputs.branch }}
build-args: |
GIT_COMMIT_SHA=${{ github.sha }}
no-cache: false
push: true
- name: Run Trivy vulnerability scanner if master (ee)
if: ${{ (github.ref_name == 'master') && matrix.edition == 'ee' }}
uses: aquasecurity/trivy-action@0.29.0
env:
TRIVY_OFFLINE_SCAN: true
with:
image-ref: docker.io/${{ github.repository_owner }}/metabase-enterprise-head:latest
format: sarif
output: trivy-results.sarif
version: "v0.57.1"
- name: Run Trivy vulnerability scanner if master (oss)
if: ${{ (github.ref_name == 'master') && matrix.edition == 'oss' }}
uses: aquasecurity/trivy-action@0.29.0
env:
TRIVY_OFFLINE_SCAN: true
with:
image-ref: docker.io/${{ github.repository_owner }}/metabase-head:latest
format: sarif
output: trivy-results.sarif
version: "v0.57.1"
- name: Run Trivy vulnerability scanner if dev branch
if: ${{ !(startsWith(github.ref_name,'master') || startsWith(github.ref_name,'backport')) && matrix.edition == 'ee' }}
uses: aquasecurity/trivy-action@0.29.0
env:
TRIVY_OFFLINE_SCAN: true
with:
version: "v0.57.1"
image-ref: docker.io/${{ github.repository_owner }}/metabase-dev:${{ steps.extract_branch.outputs.branch }}
format: sarif
output: trivy-results.sarif
- name: Upload Trivy scan results to GitHub Security tab if master (ee)
if: ${{ (github.ref_name == 'master') && matrix.edition == 'ee' }}
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab if master (oss)
if: ${{ (github.ref_name == 'master') && matrix.edition == 'oss' }}
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab if dev branch
if: ${{ !(startsWith(github.ref_name,'master') || startsWith(github.ref_name,'backport')) && matrix.edition == 'ee' }}
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
containerize_multi_arch:
runs-on: ubuntu-22.04
name: Containerize multi-arch ${{ matrix.edition }}
needs: check_jar_health
strategy:
matrix:
edition: [ee, oss]
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Extract and clean branch name
shell: bash
run: echo "branch=$(echo $GITHUB_REF_NAME | sed 's/[^-._a-zA-Z0-9]/-/g')" >> $GITHUB_OUTPUT
id: extract_branch
- name: Verify the intended tag of the container image
run: echo "Container image will be tagged as ${{ steps.extract_branch.outputs.branch }}-${{ matrix.edition }}"
- name: Check out the code (Dockerfile needed)
- name: Check out the code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit }}
- name: Download uploaded artifacts to insert into container
uses: actions/download-artifact@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
name: metabase-${{ matrix.edition }}-${{ github.sha }}-uberjar
path: bin/docker/
- name: Move the ${{ matrix.edition }} uberjar to the context dir
run: mv bin/docker/target/uberjar/metabase.jar bin/docker/.
# We need it for multi-arch build
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
m2-cache-key: uberjar
java-version: 21
- name: Build
run: ./bin/build.sh
- name: Prepare uberjar artifact
uses: ./.github/actions/prepare-uberjar-artifact
with:
platforms: 'arm64'
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2.5.0
name: metabase-${{ matrix.edition }}-${{ github.event.inputs.commit || github.sha }}-uberjar
check-jar-health:
runs-on: ubuntu-22.04
name: Is ${{ matrix.edition }} (java ${{ matrix.java-version }}) healthy?
needs: [build, get-container-info]
timeout-minutes: 10
strategy:
matrix:
edition: ${{ fromJson(needs.get-container-info.outputs.editions) }}
java-version: [21]
steps:
- name: Prepare JRE (Java Run-time Environment)
uses: actions/setup-java@v4
with:
driver-opts: network=host
# Build experimental ubuntu-based images only for master
- name: Build ${{ matrix.edition }} Ubuntu based multi-arch container
uses: docker/build-push-action@v3
java-package: jre
java-version: ${{ matrix.java-version }}
distribution: "temurin"
- run: java -version
- uses: actions/download-artifact@v4
name: Retrieve uberjar artifact
with:
context: bin/docker/.
platforms: linux/amd64,linux/arm64
file: bin/docker/Dockerfile_ubuntu
network: host
tags: localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-${{ matrix.edition }}-ubuntu
build-args: |
GIT_COMMIT_SHA=${{ github.sha }}
no-cache: true
push: true
- name: Launch ${{ matrix.edition }} Ubuntu based container
run: docker run --rm -dp 3001:3000 localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-${{ matrix.edition }}-ubuntu
timeout-minutes: 5
- name: Is Docker with Ubuntu running?
run: docker ps
- name: Wait for Ubuntu-based Metabase container to start and reach 100% health
run: while ! curl 'http://localhost:3001/api/health' | grep '{"status":"ok"}'; do sleep 1; done
timeout-minutes: 3
- name: Login to Docker Hub
if: ${{ github.ref_name == 'master' }}
uses: docker/login-action@v2
name: metabase-${{ matrix.edition }}-${{ github.event.inputs.commit || github.sha }}-uberjar
- name: Launch uberjar
run: >-
java --add-opens java.base/java.nio=ALL-UNNAMED -jar ./target/uberjar/metabase.jar &
- name: Wait for Metabase to start
run: while ! curl 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
containerize:
needs: [check-jar-health, get-container-info]
strategy:
matrix:
edition: ${{ fromJson(needs.get-container-info.outputs.editions) }}
uses: ./.github/workflows/containerize-jar.yml
secrets: inherit
with:
artifact-name: metabase-${{ matrix.edition }}-${{ github.event.inputs.commit || github.sha }}-uberjar
commit: ${{ github.event.inputs.commit || github.sha }}
repo: ${{ fromJson(needs.get-container-info.outputs[matrix.edition]).repo }}
tag: ${{ fromJson(needs.get-container-info.outputs[matrix.edition]).tag }}
release: "false"
build-args: |
GIT_COMMIT_SHA=${{ github.event.inputs.commit || github.sha }}
run-trivy:
needs: [get-container-info, containerize]
strategy:
matrix:
edition: ${{ fromJson(needs.get-container-info.outputs.editions) }}
runs-on: ubuntu-22.04
name: Run Trivy vulnerability scanner
steps:
- name: Check out the code
uses: actions/checkout@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Push experimental ubuntu image only for versions based on a master
- name: Install regctl
if: ${{ github.ref_name == 'master' }}
uses: regclient/actions/regctl-installer@main
ref: ${{ github.event.inputs.commit || github.sha }}
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@0.29.0
env:
TRIVY_OFFLINE_SCAN: true
repo: ${{ fromJson(needs.get-container-info.outputs[matrix.edition]).repo }}
tag: ${{ fromJson(needs.get-container-info.outputs[matrix.edition]).tag }}
with:
release: 'v0.4.7'
- name: Switch regctl to point to localhost:5000 via http
if: ${{ github.ref_name == 'master' }}
run: regctl registry set --tls disabled localhost:5000
- name: Retag and push ubuntu-based images if master (ee)
if: ${{ (matrix.edition == 'ee') && (github.ref_name == 'master') }}
run: regctl image copy localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-ee-ubuntu ${{ github.repository_owner }}/metabase-enterprise-head:latest-ubuntu
- name: Retag and push ubuntu-based images if master (oss)
if: ${{ (matrix.edition == 'oss') && (github.ref_name == 'master') }}
run: regctl image copy localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-oss-ubuntu ${{ github.repository_owner }}/metabase-head:latest-ubuntu
image-ref: docker.io/${{ env.repo }}:${{ env.tag }}
format: sarif
output: trivy-results.sarif
version: "v0.57.1"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results.sarif"

35
.github/workflows/upgrade-deps.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: Open PR to Bump Backend Deps
on:
workflow_dispatch:
schedule:
# weekly on Mondays
- cron: '00 0 * * 1'
push:
branches:
- auto-upgrade-backend-deps-job
permissions:
contents: write
pull-requests: write
jobs:
bump-deps:
name: Open PRs to Bump Backend Deps
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
fetch-depth: ${{ (github.ref_name == 'master' && '1') || '0' }}
token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'update-be-deps'
- name: Open PRs to Upgrade Backend Deps
uses: ./.github/actions/upgrade-backend-deps
with:
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}

Some files were not shown because too many files have changed in this diff Show More