Compare commits

...

786 Commits

Author SHA1 Message Date
bryan
f459a9654c Merge branch 'release-x.53.x' into docs-gen-sync-53 2025-06-18 16:49:09 -06:00
bryan
f7a3f8c17a Add workflows to 53 (#59756)
Fix docs workflow trigger action syntax (#59723)
2025-06-18 22:40:09 +00:00
Bryan Maass
daf3118021 Add docs bump comment 2025-06-18 16:17:38 -06:00
William
d5edabb6ad Add setting to disable reusing a dashboard's last used parameters (#59293) (#59608)
Set MB_DASHBOARDS_SAVE_LAST_USED_PARAMETER to false to disable saving.
2025-06-18 01:50:55 -05:00
github-automation-metabase
df787f6a49 Update upgrading-metabase.md (#58477) (#59573)
* Update upgrading-metabase.md

Adding a note about upgrading between major versions

* Update upgrading-metabase.md

* Apply suggestions from code review



---------

Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-06-16 19:12:53 +00:00
github-automation-metabase
93540da4dc 🤖 backported "Apply filter correctly when clicking Contains... or Does not contain... quick filters" (#59027)
* Apply filter correctly when clicking `Contains...` or `Does not contain...` quick filters (#58798)

* Remove popover for quick drill

* Add repro for metabase#58247

* Show filter popover instead of immediately applying filter

* Do not prefill values

* Change filter propt to Filterable

* Remove nonsensical comment

* Remove duplicate filter

* Remove superflouous checks

* Update Loki Snapshots

---------

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-06-13 18:08:41 +01:00
github-automation-metabase
88a77f1c8c Remove unnecessary horizontal scroll on static embed sharing modal (#59230) (#59448)
* Remove unnecessary horizontal scroll on static embed sharing modal

* Fix undefined CSS custom property via linter

* fix tests

* Fix the style regression from the previous commit

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-06-13 09:53:37 +01:00
github-automation-metabase
9bdb273f7c Remove back push filters for embedding-sdk.yml (#59406)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-06-12 19:11:58 +04:00
github-automation-metabase
8c026dfb6d Fix can't download static SQL question\ (#59164) (#59375)
when a parameter only expects a single value

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-06-12 13:24:19 +00:00
github-automation-metabase
abc3f3992e Add limitation about CSS vars in SDK theming (#59238) (#59252)
Co-authored-by: Alberto Perdomo <albertoperdomo@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-06-10 13:10:25 +00:00
github-automation-metabase
4efc9df1f6 no archived collections in perm graph (#59065) (#59178)
Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-06-09 13:29:27 +00:00
github-automation-metabase
f5951fdef2 Handle datetime extracted values in filters for xrays (#58725) (#58770)
Fixes #47196.

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-06-03 21:12:18 +03:00
github-automation-metabase
94dc03c2b5 🤖 backported "Generate valid multi arg string filters in parameter chaining" (#58676)
* Generate valid multi arg string filters in parameter chaining (#58646)

Fixes #57287

* Fix namespace ordering

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
Co-authored-by: Tamás Benkő <tamas@metabase.com>
2025-05-30 18:47:22 +03:00
github-automation-metabase
9b79cacf26 🤖 backported "fix: set download-results to no on table block" (#58611)
* fix: set download-results to no on table block (#58597)

* fix: set download-results to no on table block

When a view-data permission for a table is set to blocked set the
create-queries and download-results permissions to no. Also includes a
migration script read to backport to v52 to update databases to be
consistent with this change

* fixup! remove precondition

* fixup! join in update to work on mysql

* fixup! separate migrations on mysql/postgres

* fixup! test order

* fixup! remove add-user-to-group! call

* fixup! set schemas for the table models

---------

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Edward Paget <ed.paget@gmail.com>
2025-05-29 15:25:29 -05:00
github-automation-metabase
0bab73dacf Fix static question embed download when parameters have multiple values (#58423) (#58508)
* Fix static question embed download when parameters have multiple values

* Simplify type

* Don't wanna deal with outdated query builder types 🤷

* Use a proper value when asserting

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-05-27 08:05:00 +00:00
github-automation-metabase
29e1cce7c0 🤖 backported "Add bigquery user agent" (#58458)
* Add bigquery user agent (#58410)

* missed change

* remove test from 54

---------

Co-authored-by: Riley Thompson <riley@metabase.com>
Co-authored-by: Riley Thompson <rileythompson99@gmail.com>
2025-05-26 17:21:49 -04:00
github-automation-metabase
23c3586dae Update Readme version references and published npm version to 0.53.18 (#58482) 2025-05-26 12:19:23 +00:00
github-automation-metabase
f1d996246f fix(sdk): fix tooltip crash by migrating away from renderToString (#58394) (#58412)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-05-26 18:38:37 +07:00
github-automation-metabase
9df71bafbd Fix column alignment for fully-collapsed pivot exports (#58372) (#58443)
* Fix fully collapsed pivot exports

* Fix tests, fix unrelated typo

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-05-23 21:18:02 -04:00
github-automation-metabase
f155489a73 cross versions tests: skip @OSS tests and use prod build for the FE (#58277) (#58407)
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.

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-05-23 15:58:46 +00:00
github-automation-metabase
2450e46c22 Add script to facilitate translation backports (#58189) (#58267)
Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2025-05-22 14:55:41 +00:00
github-automation-metabase
c9482edd2d 🤖 backported "fix: explicitly mark when fields are gtapped" (#58320)
* 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

* fixup! changed var in test

---------

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Edward Paget <ed.paget@gmail.com>
2025-05-22 13:49:00 +00:00
github-automation-metabase
638972e3cb run breaking changes tests on multiple runners (#58092) (#58344)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-05-22 12:02:21 +00:00
github-automation-metabase
6592640589 🤖 backported "fix(sdk): questions shows an error while loading on strict mode" (#58220)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
fix(sdk): questions shows an error while loading on strict mode (#58183)
2025-05-22 04:17:50 +07:00
github-automation-metabase
cc8584996b fix: appdb table permssions search slowdown (#58294) (#58306)
Use a correlated subquery to make sure we hit the pk index

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-05-21 16:05:13 -05:00
github-automation-metabase
3fa8453cb1 fix: split snyk scans (#58290) (#58292)
Fits them under githubs 20 runs per sarif file limit

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-05-21 16:23:07 +00:00
github-automation-metabase
1508bb42d6 Fix snowplow helpers to be less flaky (#57750) (#57905)
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 :)

Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-05-21 14:35:46 +00:00
github-automation-metabase
3cddfe52f2 Fix menu text on sharing and subscription menu (#58089) (#58150)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-05-21 15:33:45 +02:00
github-automation-metabase
c3de448349 Restore embed signal fallback when in embedding (#58240) (#58271)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-05-21 08:57:33 +00:00
github-automation-metabase
d11f52ce29 convert script to js in preparation of splitting the work on multiple runners (#58086) (#58148)
* convert script to js

import os

* remove two tests as one file there fails

* Update bin/backward-compatibility-test.js



* test -> tests

* address feedback

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-05-19 10:13:57 +00:00
github-automation-metabase
298876bfc9 Update Readme version references and published npm version to 0.53.17 (#58067) 2025-05-16 07:13:07 +00:00
github-automation-metabase
cd74e4e6c7 Improved liquibase rollback-major-version! logic to not use a simple count (#57754) (#57928)
# Conflicts:
#	src/metabase/db/liquibase.clj

Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-05-15 12:25:58 -05:00
github-automation-metabase
f56d066222 🤖 backported "feat: generic data permissions visibility queries" (#57997)
* 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>

* fixup! correct audit module name

* fixup! correct test

---------

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: John Swanson <john.swanson@metabase.com>
Co-authored-by: Edward Paget <ed.paget@gmail.com>
2025-05-15 11:54:24 -05:00
github-automation-metabase
c06de5fa77 🤖 backported "adds i18next/no-literal-string" (#57965)
* add yet another linter, no literal strings so we don't forget to translate everything (#57785)

* eslint ignore

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-05-15 16:45:07 +02:00
github-automation-metabase
084f26777c fix(sdk): Move @cypress/react as dev dependency for SDK (#57984)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-05-15 09:40:54 +04:00
github-automation-metabase
dc1851259d 🤖 backported "make the uberjar artifact from the cross-version tests not collide with the one from component tests" (#57976)
* make the uberjar artifact from the cross-version tests not collide with (#57971)

the one from component tests

* change retrieve key too

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-05-14 18:46:37 +00:00
github-automation-metabase
f4de7ae8b7 🤖 backported "fix(ci-sdk): make cross versions tests run again" (#57954)
* fix(ci-sdk): make cross versions tests run again (#57856)

* debug logs

* testing please ignore

* cleanup and add comment

* remove double concurrency group causing deadlock

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-05-14 17:50:53 +02:00
github-automation-metabase
939c9880fe Don't add isCollapsed nodes for paths not in the data (#57704) (#57709)
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-05-13 18:07:43 +00:00
github-automation-metabase
c33adf1683 Update upgrading-metabase.md (#57751) (#57915)
* Update upgrading-metabase.md

Add changes that were needed for a long time :)

* suggested edits (#57913)

---------

Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-05-13 17:56:58 +00:00
github-automation-metabase
58f541d279 🤖 backported "fix: wrap un-translated strings in t``" (#57781)
* 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>

* translate Email Settings

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2025-05-13 17:05:08 +02:00
github-automation-metabase
f0f55865b7 Update Readme version references and published npm version to 0.53.16 (#57877) 2025-05-13 09:11:00 +00:00
github-automation-metabase
2b6ef96219 fix: remove fast snowflake sync (#57858) (#57867)
* fix: remove fast snowflake sync

* Fix kondo

Co-authored-by: Case Nelson <case@metabase.com>
2025-05-12 23:09:37 +00:00
github-automation-metabase
bd574945cd wrap strings in t in EditSandboxingModal (#57787) (#57855)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-05-12 17:21:11 +00:00
metamben
72fb60819a Add back wrongly removed tests (#57853) 2025-05-12 17:10:37 +00:00
Alexander Polyankin
22de35b2d6 [v53] Use dedicated endpoints for remapping in dashboards & questions (#57842)
* Use dedicated endpoints for remapping in dashboards & questions

* Use dedicated endpoints for remapping in dashboards & questions

* Fix services

* Backport fixes
2025-05-12 19:00:09 +03:00
github-automation-metabase
dd27849b64 Support bigint model_pks in model_index_value (#57661) (#57714)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-05-09 12:37:02 -05:00
github-automation-metabase
b61ee4c433 better snowplow errors when expecting the wrong number of good events (#57730) (#57773)
* 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: Nicolò Pretto <info@npretto.com>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-05-09 17:28:00 +02:00
github-automation-metabase
9e12302d7b 🤖 backported "fix(sdk): updating collection's entity id crashes InteractiveQuestion and CollectionBrowser" (#57643)
* fix(sdk): updating collection's entity id crashes InteractiveQuestion and CollectionBrowser (#57529)

* remove non-applicable test from 53

* remove unused imports

* fix type import

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
2025-05-09 09:24:28 +00:00
github-automation-metabase
69fc32080d 🤖 backported "make LocaleProvider change the return of useLocale and set the locale used by Mantine" (#57692)
* 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

* add ?. to make it more resilient

* more debug logs

* Revert "more debug logs"

This reverts commit 53e7127b85.

* Revert "add ?. to make it more resilient"

This reverts commit a38d22d2c7.

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-05-08 16:34:39 +02:00
github-automation-metabase
9cb3f4cef8 Mark setup tests flaky (#57710) (#57733)
* mark setup tests flaky

* add flake

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
2025-05-08 12:30:49 +00:00
github-automation-metabase
b8a2222bc9 fix(sdk): custom GeoJSON maps does not load due to wrong domain (#57539) (#57646)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-05-06 12:29:16 +00:00
github-automation-metabase
12e950f89c fix(sdk): manual fixes for module level ttag calls causing broken translations (#57590)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-05-06 12:09:42 +02:00
github-automation-metabase
be02400472 help page (#57619) (#57625)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-05-05 23:15:12 +00:00
github-automation-metabase
87abc81bd6 🤖 backported "fix: add table-level sql based permission query" (#57611)
* 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>

* fixup! kondo diff

---------

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Nathan Voxland <nathan@metabase.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Co-authored-by: Edward Paget <ed.paget@gmail.com>
2025-05-05 20:13:37 +00:00
github-automation-metabase
ad3cb85793 🤖 backported "Reindex immediately on start-up if existing table is old" (#57457)
---------

Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-05-05 10:25:27 -05:00
github-automation-metabase
77c621620d 🤖 backported "feat(sdk): Automatically set a sensible display to interactive question" (#56714)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-05-05 09:47:21 +02:00
github-automation-metabase
98c9121abb Further limit tsvector size since it's concatinated (#57514) (#57549)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-05-02 19:26:46 +00:00
github-automation-metabase
9ed688887d [serdes] break endless loops (#57482) (#57521)
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.

Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2025-05-02 11:15:31 +00:00
github-automation-metabase
a1d5809e8e docs - note on role setting (#57268) (#57499)
* note on role setting

* format

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-05-01 20:23:26 +00:00
github-automation-metabase
c3238c0d07 feat: add prometheus metric for quartz task states (#56994) (#57432)
* 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

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-04-30 21:59:10 +00:00
github-automation-metabase
5ccb71da08 fix: move internal stats for module organization (#57430) (#57444)
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-04-30 16:22:43 -05:00
github-automation-metabase
ed308d4c12 Add Access-Control-Max-Age header to cache CORS preflight requests made by SDK (#57383) (#57419)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-04-30 08:39:13 +00:00
github-automation-metabase
3db08f04ce Delete indexed rows from the search index which correspond to deleted rows (#57086) (#57407)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-04-29 23:16:32 +00:00
github-automation-metabase
a7fd04c6f3 fix: avoid deadlocks by not holding connection (#56524) (#57355)
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.

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-04-28 21:38:56 +00:00
github-automation-metabase
4c1c0c8712 fix: wrong syntax on if was making 'cross-version-for-breaking-changes' always run (#57339) (#57343)
* fix: wrong syntax on `if:` was making 'cross-version-for-breaking-changes'
always run

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



---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-04-28 14:43:39 +00:00
github-automation-metabase
55992eef0d 🤖 backported "Fix - Cannot schedule automatic value scanning for postgres database" (#57276)
* Fix - Cannot schedule automatic value scanning for postgres database (#57256)

* Fix #57198

* Use proper setter

* Repro #57198

* Fix test

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-04-28 15:58:45 +07:00
github-automation-metabase
d8dafd4ddb 🤖 backported "Prevent path-to-regexp from breaking when a libary require v6+" (#57321)
* Prevent `path-to-regexp` from breaking when a libary require v6+ (#57242)

* Upgrade swc versions to match with the new `@rspack/core`

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-04-28 09:12:59 +01:00
github-automation-metabase
0474782fcd fix: improve database status metric (#56469) (#57220)
* fix: improve database status metric

* Format line better

* Fix tests and kondo

* Remove unhealthy counter too

Co-authored-by: Case Nelson <case@metabase.com>
2025-04-25 16:37:59 +00:00
github-automation-metabase
703938f1e0 Update Readme version references and published npm version to 0.53.15 (#57279) 2025-04-25 15:48:16 +00:00
github-automation-metabase
a17fa42461 More robust checking for timeout exceptions (#56737) (#57222)
* 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.



* 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: dpsutton <dan@dpsutton.com>
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-25 13:58:40 +00:00
github-automation-metabase
b606e921db 🤖 backported "add ttag/no-module-declaration rule" (#57183)
* 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

* manual fixes

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-04-25 13:57:38 +01:00
github-automation-metabase
ffcad911c2 fix(sdk): clicking on "and X more" in chart legend throws error (#57175) (#57252)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-04-25 10:36:45 +00:00
github-automation-metabase
81f65b80cc fix: snowflake rsa doesn't work with hostname (#57157) (#57209)
* fix: snowflake rsa doesn't work with hostname

* update account if present

Co-authored-by: Case Nelson <case@metabase.com>
2025-04-24 18:13:35 +00:00
github-automation-metabase
c36dfb579c fix: snowflake key fails when editing unrelated details (#57156) (#57201)
* fix: snowflake key fails when editing unrelated details

* Fix test comment

* Compare byte arrays

Co-authored-by: Case Nelson <case@metabase.com>
2025-04-24 17:21:56 +00:00
github-automation-metabase
5b49f7f2f9 ci: make cross versions tests run only if the pr is against a release (#57197) (#57203)
branch

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-04-24 16:27:59 +00:00
github-automation-metabase
8909927ad7 Fix sync for 66K tables db (#57066) (#57177)
* 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!

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-04-24 13:07:30 +00:00
github-automation-metabase
4b5c7a9cad fix(sdk): use background color in sankey chart text outline (#57135) (#57169)
* use bg-white instead of white

* add visual test

* fixed storybook stories

* add loki snapshot

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-04-24 18:09:16 +07:00
github-automation-metabase
bf2309539f Update Readme version references and published npm version to 0.53.14 (#57171) 2025-04-24 10:14:26 +00:00
github-automation-metabase
4ed2c0861c 🤖 backported "fix(sdk): Ensure that questions don't flicker when fetching entity IDs" (#57130)
* fix(sdk): Ensure that questions don't flicker when fetching entity IDs (#57073)

* Fix type mismatch from the release branch version

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-04-24 10:24:15 +01:00
github-automation-metabase
9bd54f910a fix: use a shared lock for report_card updates (#57040) (#57080)
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.

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-04-22 20:59:51 +00:00
github-automation-metabase
d5b9f4c17e Add schema, table and field to missing database type to base type mapping (#56843) (#57068)
* 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

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-04-22 17:43:46 +00:00
github-automation-metabase
20b7108540 add a note to okta scim (#57032) (#57044)
Adding the header, which is coming often

Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
2025-04-22 14:32:33 +00:00
github-automation-metabase
dc8134820f run codemod to convert t calls on module level to getters when possible (#56793) (#57010)
* ran the codemod, lets see if it greens out on ci

* manually remove some changes as not-needed or risky

* remove other createEntity

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-04-22 15:39:26 +02:00
github-automation-metabase
a6a033ad8b fix: add cluster lock around view count update (#56977) (#56987)
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.

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-04-21 17:53:36 +00:00
github-automation-metabase
36afc7b089 Don't update the "active" index table from the "reindex" job (#56671) (#56969)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-04-21 15:10:40 +00:00
github-automation-metabase
b39d8a96f2 Setup app cleanup for sample-app runner (#56866) (#56890)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-04-17 19:37:55 +00:00
github-automation-metabase
77bce68f25 fix(sdk): use instance locale if no locale is passed (#56683) (#56874)
* 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



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

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-04-17 16:33:28 +00:00
github-automation-metabase
eadddda453 [Permissions] Skip fetching of table fields when updating db permissions (#56859) (#56864)
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-04-17 15:37:55 +00:00
github-automation-metabase
989c9989ab fix: make enhance table stats a single query (#56738) (#56861)
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.

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-04-17 15:19:12 +00:00
John Swanson
b1edc5b6be Reset all errored triggers to WAITING on startup (#55769) (#56546) (#56854)
Reset all errored triggers to `WAITING` on startup

[WRK-203: If a task fails and the trigger_state is set to ERROR in Quartz, then the task will never fire ever again](https://linear.app/metabase/issue/WRK-203/if-a-task-fails-and-the-trigger-state-is-set-to-error-in-quartz-then)

---------

Co-authored-by: github-automation-metabase <166700802+github-automation-metabase@users.noreply.github.com>
Co-authored-by: Ed Paget <ed@metabase.com>
2025-04-17 06:59:30 -07:00
github-automation-metabase
947a0079e2 Add memory usage logging to sync steps (#56834) (#56847)
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-04-17 11:35:24 +00:00
github-automation-metabase
d3f9b11ee6 fix: run cross-version-for-breaking-changes only on pull requests to (#56794) (#56832)
make it pass on master

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-04-17 07:36:36 +00:00
github-automation-metabase
16d98cd62d POC of cross version tests to detect breaking changes (#56130) (#56789)
* 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: Nicolò Pretto <info@npretto.com>
Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>
2025-04-16 14:56:02 +00:00
github-automation-metabase
68137eba95 fix bars width on dst timezone data (#56466) (#56556)
* fix bars width on dst timezone data

* specs

Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-04-16 14:32:10 +00:00
github-automation-metabase
e7163aa61f use big number mode for apache compress (#56719) (#56731)
possibly fixes a problem we're seeing in #53354

Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2025-04-15 14:24:34 +00:00
github-automation-metabase
e2be5a0af9 Fix native model perms (#56697) (#56724)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-04-15 13:31:02 +00:00
github-automation-metabase
46b919a571 Run build job for SDK on any FE code change (#56718) (#56727)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-04-15 13:12:18 +00:00
github-automation-metabase
15f5cb66ac 🤖 backported "Added include_metadata argument to search API" (#56514)
* Added include_metadata argument to search API (#56397)

* Fixed backport

---------

Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-04-14 14:42:45 +00:00
github-automation-metabase
86ec7435c0 Speculative OOM fix: partition index updates, update logging for index sync (#55866) (#56644)
* Adjust logging

* Speculative OOM fix

* Update partitioning logic of sync-all-indexes!

* Add test

* Use bigger partitions

* Adjust tests

* Remarks

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-04-13 08:23:45 +00:00
Oleksandr Yakushev
2cb7ae4bad [metrics] Add hiccup and allocation rate metrics (#56345) (#56641) 2025-04-12 20:49:17 +00:00
Noah Moss
dee4a00b69 Shared FE/BE pivots (#53000) (#55423) (#56618) 2025-04-11 20:10:58 +00:00
github-automation-metabase
5d43373490 call e2e-component-tests-embedding-sdk-cross-version from (#56454) (#56548)
* 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)

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-04-11 08:29:38 +00:00
github-automation-metabase
362a5cb343 🤖 backported "fix: resolve snowflake sync cost issue" (#56512)
* 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

* sort alphabetically

---------

Co-authored-by: Case Nelson <case@metabase.com>
Co-authored-by: Luiz Arakaki <luiz.arakaki@metabase.com>
2025-04-10 18:48:35 +00:00
github-automation-metabase
32ee610ee4 Refactor Embedding SDK CI workflow and improve notify-pull-request action (#56553)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-04-10 21:05:05 +04:00
github-automation-metabase
0137be5ea0 🤖 backported "fix(sdk): fix dataset endpoint being called on every re-render" (#56234)
* 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

* experiment: try with a longer wait time

* experiment: use data-index instead

* remove it.only flag

* cleanup selector

* scope findByText selectors

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
2025-04-10 12:08:27 +07:00
github-automation-metabase
ac8e5a7c0e Backported changes (#56509)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-04-09 15:23:16 -05:00
github-automation-metabase
56a33ff9c8 feat: make cluster locking reusable (#56310) (#56456)
* 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

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-04-08 17:24:18 +00:00
github-automation-metabase
3710a38cfa (mini-PR) Localize string in sidesheet (#56221) (#56227)
Let's localize the string "Learn more" in the question info sidesheet

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2025-04-08 15:42:19 +00:00
github-automation-metabase
60736a1f93 🤖 backported "Don't update report_card.result_metadata if it has not changed" (#56433)
* 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>

* fixup! test data for 53

---------

Co-authored-by: Nathan Voxland <nathan@metabase.com>
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 14:35:58 +00:00
github-automation-metabase
4067582607 feat: add basic schema for sso saml settings api (#56318) (#56436)
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-04-08 14:30:02 +00:00
github-automation-metabase
2314b9f9f1 fix: mock time to middle of a utc day (#56296) (#56438)
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.

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-04-08 14:27:33 +00:00
Case Nelson
3a2289f910 manual backport "task: update ee-extra to understand noop from registry" (#56412)
* fix: ee-build should skip adding jars when there are none

* task: update ee-extra to understand noop from registry
2025-04-07 16:02:22 -06:00
github-automation-metabase
60461d1b36 fix: ee-build should skip adding jars when there are none (#56166) (#56411)
Co-authored-by: Case Nelson <case@metabase.com>
2025-04-07 21:26:27 +00:00
github-automation-metabase
8cea041801 fix: snowflake can-connect with ssh without touching other drivers (#56325) (#56405)
* fix: snowflake can-connect with ssh without touching other drivers

* Adjust host-and-port for can-connect without calling incorporate-ssh-tunnel-details

Co-authored-by: Case Nelson <case@metabase.com>
2025-04-07 19:05:25 +00:00
github-automation-metabase
182e5207a1 fix: dont log db-details (#56386) (#56399)
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.

Co-authored-by: Case Nelson <case@metabase.com>
2025-04-07 18:17:15 +00:00
github-automation-metabase
9764ea4d64 Invalidate card's cache on PUT (#56365) (#56376)
* Invalidate card cache on put

* Add test

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-04-07 13:02:43 +00:00
github-automation-metabase
cdc537681f Revert "fix: properly test snowflake ssh connection details" (#56315) (#56324)
This reverts commit 0fc5cbe7dc.

Co-authored-by: Case Nelson <case@metabase.com>
2025-04-04 20:01:59 +00:00
github-automation-metabase
ecb558cf98 Add note about allowtcpforwarding (#56320) (#56322)
Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
2025-04-04 19:18:44 +00:00
github-automation-metabase
e60a7a88e4 Fix product screenshot link in README (#56268) (#56285)
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-04-04 12:56:40 +00:00
github-automation-metabase
334ef6708c Update Readme version references and published npm version to 0.53.13 (#56279) 2025-04-04 12:30:19 +00:00
github-automation-metabase
dd7d8eff61 🤖 backported "Fix - When DB is stuck in a Sync Loop, DB List in Native Editor Blinks Constantly " (#56220)
* 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

* Remove unused code

* Revert search deletion

* Bring back deleted files

* Revert "Bring back deleted files"

This reverts commit 3025b731c7.

* Revert "Revert search deletion"

This reverts commit 185b5d5a74.

* Remove inexisting prop usage

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-04-04 14:16:25 +02:00
github-automation-metabase
f88021b069 🤖 backported "Fix object detail view ignores link formatting" (#55257)
* 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

* Fix using not existing e2e test helper

---------

Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>
2025-04-04 12:08:11 +00:00
github-automation-metabase
2f4098e607 🤖 backported "fix(sdk): Add questionProps to dashboard components" (#56215)
* fix(sdk): Add `questionProps` to dashboard components (#55993)

* Make the loki tests pass, hopefully

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-04-04 10:26:17 +00:00
github-automation-metabase
33e08c359a fix: make saml issuer identity required in FE (#56154) (#56225)
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-04-03 15:54:39 -06:00
github-automation-metabase
6ccb35ed3b Changelog for api/card/:card-id/query/export-format (#56189) (#56218)
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"
```

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-04-03 09:11:41 -05:00
github-automation-metabase
7f0ed83da1 fix: deadlock in last used at (#56173) (#56193)
* 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



* Update src/metabase/query_processor/middleware/update_used_cards.clj



* fixup! finish method rename

---------

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-04-03 08:02:49 -05:00
github-automation-metabase
e695ff7f97 fix: correct setting name check for static stats (#56145) (#56169)
* 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

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-04-02 18:26:11 +00:00
github-automation-metabase
904e5ee64a Fix chain filters on public dashboards (#56096) (#56142)
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).

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-04-02 13:55:39 +00:00
github-automation-metabase
faf97dbf9b Fix storybook not working with MetabotQuestion (#56127) (#56133)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-04-02 12:15:33 +00:00
github-automation-metabase
4eabd91ab0 fix scatter charts freeze (#56016) (#56092)
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-04-01 16:17:09 +00:00
github-automation-metabase
7fc2fc4266 ci: run sample app tests and sdk cross version tests on draft prs (#56008) (#56090)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-04-01 16:09:27 +00:00
github-automation-metabase
9be95a58a7 fix: Ensure that local timestamps params work (#55931) (#56027)
* 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

Co-authored-by: Case Nelson <case@metabase.com>
2025-04-01 16:02:53 +00:00
Romeo Van Snick
5326b785f5 v53: Allow escape square brackets in identifier (#56078)
* Allow escaping [] in custom expressions

* Add repro for #55984
2025-04-01 15:01:45 +00:00
github-automation-metabase
4f7a6c12b5 🤖 backported "Use SDK-specific ID types and reconcile the changes" (#55511)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-04-01 17:26:33 +03:00
github-automation-metabase
b847ab9b19 support keys in env vars (#55756) (#55865)
# 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.

Co-authored-by: Luiz Arakaki <luiz.arakaki@metabase.com>
2025-04-01 13:15:45 +00:00
github-automation-metabase
777232825d Fix coercion for model (#55870) (#56064)
* Fix coercion for model

* Add test

* Update test

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-04-01 09:47:45 +00:00
github-automation-metabase
a747befda7 QueryDownloadPopover -> QuestionDownloadWidget + QueryDownloadWidget -> QuestionDownloadPopover (#55894) (#56050)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-04-01 07:28:33 +00:00
Uladzimir Havenchyk
482ed3efa5 backport: fix for a flaky test (#56020) 2025-04-01 00:22:13 +03:00
github-automation-metabase
cd80683776 Merge confict fix (#56029)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-03-31 16:14:47 -05:00
github-automation-metabase
b6c06678a6 docs: can't permanently delete collections (#56014) (#56019)
* Update delete-and-restore.md

* format

* Update delete-and-restore.md

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: jeff bruemmer <jeff.bruemmer@gmail.com>
2025-03-31 16:20:29 +00:00
github-automation-metabase
53501f679c fix: typo in token check stats name (#55999) (#56006)
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-31 14:58:17 +00:00
github-automation-metabase
7e4588158d docs(sdk): Add docs for dashboard types (#55988) (#55991)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-31 11:41:59 +00:00
github-automation-metabase
009d267d66 Update impersonation.md (#55957) (#55968)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-03-30 18:44:01 +00:00
github-automation-metabase
1dd66e6ea5 docs: mb_api key docstring (#55924) (#55948)
* mb_api key docstring

* formatting

* edit

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: jeff bruemmer <jeff.bruemmer@gmail.com>
2025-03-28 21:31:24 +00:00
github-automation-metabase
56f3290b47 fix: properly test snowflake ssh connection details (#55879) (#55926)
Co-authored-by: Case Nelson <case@metabase.com>
2025-03-28 19:06:58 +00:00
Uladzimir Havenchyk
a9152e914d backport: fix for a flaky test (#55904) 2025-03-28 17:14:33 +03:00
Gustavo Saiani
c930ffbc7a Update links in docs (#55778)
* Update link

* More links
2025-03-28 10:04:53 -04:00
github-automation-metabase
900e06e211 docs - api keys in config file (#55771) (#55899)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-28 12:06:21 +00:00
github-automation-metabase
987228ebc3 feat: add remaining token check stats and settings (#55638) (#55858)
* 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

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-27 19:44:24 +00:00
github-automation-metabase
b65e946285 fix: only remove vis_settings from dashboardcard (#55846) (#55855)
* 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

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-27 19:40:40 +00:00
github-automation-metabase
24ff367b16 docs: don't forget to use headers in split files (#55856) (#55860)
* Update uploads.md

* Update docs/databases/uploads.md



---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-27 19:07:46 +00:00
github-automation-metabase
00a45e3706 Bit more logging (#55837) (#55843)
```
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.

Co-authored-by: dpsutton <dan@dpsutton.com>
2025-03-27 18:45:38 +00:00
github-automation-metabase
dac87b2856 fix: move classloader to init as soon as possible (#55786) (#55845)
Co-authored-by: Case Nelson <case@metabase.com>
2025-03-27 17:36:08 +00:00
github-automation-metabase
9168b7809a 🤖 backported "Ignore parameters targets with stage-number out of range" (#55827)
* Ignore parameters targets with `stage-number` out of range (#55761)

* Add missing helper

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-03-27 16:21:30 +00:00
Kamil Mielnik
66c48fe435 RFC 118. Prettier - arrowParens: “always” - v53 (#55809)
* Update .prettierrc
- remove "arrowParens": "avoid" so that it defaults to "always" instead

* Run "yarn prettier"
2025-03-27 09:29:52 +00:00
github-automation-metabase
88d8dc8464 [db-pool] Try again to address the thread deadlock caused by c3p0 (#52351) (#54778)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-03-27 10:48:28 +02:00
github-automation-metabase
50c690b5af Add group mappings in keycloak (#55775) (#55798)
* Add group mappings in keycloak

* Apply suggestions from code review

---------

Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-03-27 02:06:37 +00:00
Ryan Laurie
ebf91a06e6 Don't load gsheets sync status component for non-admins (#55724) (#55788) (#55794)
* don't load gsheets sync status for non-admins

* kick ci

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
# Conflicts:
#	frontend/src/metabase/status/components/StatusListing/StatusListing.tsx

Co-authored-by: github-automation-metabase <166700802+github-automation-metabase@users.noreply.github.com>
2025-03-26 20:21:58 -03:00
github-automation-metabase
46b63c6369 Update mongodb.md (#55789) (#55791)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-03-26 20:45:35 +00:00
github-automation-metabase
99af690b3b Adjust jdbc-get-tables and probe query logging (#55658) (#55785)
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-03-26 20:31:10 +00:00
github-automation-metabase
c573538be1 feat: use semi-join for collection permissions (#55727) (#55768)
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.

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-26 18:52:04 +00:00
Riley Thompson
9dde7e5dfc Remove JS from mongo queries (#55499) (#55762) 2025-03-26 11:45:13 -06:00
github-automation-metabase
3f30e3ab4f 🤖 backported "eid-translation module" (#54805)
* eid-translation module (#54542)

* kondo

* setting/get uses the setting getter

---------

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-03-26 17:01:32 +00:00
github-automation-metabase
288ca3ce46 Bump io.netty/netty-buffer from 4.1.118.Final to 4.1.119.Final (#54568) (#55394)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-26 10:17:10 -06:00
github-automation-metabase
ee3eec35c1 ci(sdk): make 54 the latest in release workflow (#55741) (#55743)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-26 06:18:51 +00:00
github-automation-metabase
b05d683533 fix: reset connection pool after app-db tz change (#55567) (#55718)
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-25 18:23:26 +00:00
github-automation-metabase
e1eecad194 🤖 backported "Setting shouldUpdateUrl to false when calling popState in QB" (#55626)
* 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

* adjusting e2e test

---------

Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2025-03-25 13:10:53 +00:00
github-automation-metabase
01675b95aa Use field refs instead of field ids/names for tiles queries (#55570) (#55633)
* Use field refs instead of field ids/names for tiles queries

* Fix up embedded + public endpoints

* use field_refs

---------

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2025-03-25 12:09:10 +00:00
github-automation-metabase
b0ce515267 🤖 backported "test: add renderHookWithProviders helper" (#55508)
* test: add renderHookWithProviders helper (#55449)

* test: add renderHookWithProviders helper

* remove defaults from getTestStoreAndWrapper and destructure options to
only pass down the correct args

* specify renderHook renderer explicitly (#55572)

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-03-25 07:14:19 +01:00
github-automation-metabase
3807edc1a6 Add constraints to key (#55211) (#55657)
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

Co-authored-by: Luiz Arakaki <luiz.arakaki@metabase.com>
2025-03-24 21:32:41 +00:00
github-automation-metabase
7e07736de9 fix charts glitches in safari (#55589) (#55628)
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-03-24 14:34:01 +00:00
github-automation-metabase
4c6adacaac Store created-by-id in the gsheets config (#55191) (#55498)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-03-24 14:26:51 +00:00
github-automation-metabase
5aa5550758 feat: add embedding stats to token request (#55491) (#55553)
* 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

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-24 13:34:55 +00:00
github-automation-metabase
b4f5b9f840 closes viz-358 precision for scientific notation (#55542) (#55560)
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-03-24 11:26:38 +01:00
github-automation-metabase
4086f9c723 docs(sdk): Extract embedding docs code snippets to separate files and type-check them (#55510)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-03-24 12:46:43 +04:00
github-automation-metabase
3eddbf3e8f support: Add snowplow logging for starburst-legacy-impersonation (#55569) (#55584)
* support: Add snowplow logging for starburst-legacy-impersonation

* Fix tests

Co-authored-by: Case Nelson <case@metabase.com>
2025-03-21 21:43:22 +00:00
github-automation-metabase
e058c53781 fix localhost:* in embedding app origins sdk (#55481) (#55551)
* 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

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-03-21 15:37:44 -06:00
github-automation-metabase
8ce83a964e Fix width of model persistence toggle (#55121) (#55579)
In Admin / Performance / Model persistence, don't allow the toggle to fill the width of the page or clicking several inches to the right of it will trigger it, making misclicks too easy.

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2025-03-21 20:05:08 +00:00
github-automation-metabase
782c83e97b Improve spacing in Admin / settings / appearance / logo. (#55122) (#55578)
Don't show removal icon button unless an image has been selected. Port
the button to Mantine

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2025-03-21 20:04:34 +00:00
github-automation-metabase
67df1b1b36 [sync-metadata] Use equalsIgnoreCase to match fields instead of lowercasing (#55239) (#55571)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-03-21 19:33:26 +00:00
dpsutton
4da22ca703 Handle snowflake timeouts (#55550)
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:48:20 -05:00
github-automation-metabase
669648b133 closes viz-230 no color picker for waterfall series (#55530) (#55559)
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-03-21 17:34:10 +00:00
github-automation-metabase
2837c8380d fix links (#55548) (#55561)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-21 17:28:20 +00:00
github-automation-metabase
4cad5bd78b feat: enable the field scanning task for audit db (#55379) (#55555)
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-21 17:18:12 +00:00
github-automation-metabase
84618e1660 Closes VIZ-498 can't change back to dollar sign in header (#55167) (#55557)
* closes VIZ-498 can't change back to dollar sign in header

* added unit test

* fixup

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-03-21 17:12:13 +00:00
github-automation-metabase
ca68ed959c docs(sdk): indicate support for react 19 (#55527) (#55552)
* update docs and cli

* unify wording for cli message



---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-21 16:51:36 +00:00
github-automation-metabase
99982436f7 Remove unused cards in usage analytics (#53598) (#54338)
[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)

Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-03-21 16:41:37 +00:00
github-automation-metabase
9e29a57a27 remove unused images (#55544) (#55547)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-21 16:04:20 +00:00
github-automation-metabase
bf730c89a8 🤖 backported "minor modal message fix" (#55330)
* minor modal message fix (#55217)

* remove key

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-21 11:40:10 -04:00
github-automation-metabase
54b668c6fe docs - accessibility notes (#55493) (#55545)
* accessibility notes

* update accessibility page

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-21 15:29:04 +00:00
github-automation-metabase
163540b189 use whitelabel colors in the static viz (#55231) (#55535)
* use whitelabel colors in the static viz

* Fix backend whitelabel test for app colors

* update CI

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-03-21 15:26:40 +00:00
github-automation-metabase
179f3ac2b2 fix: return 404 when logout without session (#55464) (#55531)
* fix: return 404 when logout without session

* fixup! remove #p

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-21 14:55:45 +00:00
github-automation-metabase
e47b76cf6b fix: use custom dns resolver when fetching geojson (#55460) (#55489)
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-21 14:36:33 +00:00
github-automation-metabase
faf54a43ba ci(sdk): run embedding sdk component tests across react 18 and 19 (#55405) (#55474)
* 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

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-03-21 19:10:02 +07:00
Timofey Kachalov
6671e09591 test(sdk): Perform type-checking of Embedding SDK CLI snippets (#55516) 2025-03-21 14:38:43 +04:00
github-automation-metabase
7ba6a4a3de Reduce noise in SDK Slack channel (#55513) (#55514)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-21 09:24:22 +00:00
github-automation-metabase
6de8e4bab0 Use actual time zone marker (Z) when parsing offset times (#54987) (#55495)
Fixes #53724

Also remove (date)time formats moment cannot handle anyway.

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-03-21 03:48:35 +00:00
github-automation-metabase
6af0da03ee Fix cond fmt of null vs empty str in table static viz (#55386) (#55500)
* 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

Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-03-21 01:25:41 +00:00
github-automation-metabase
b68e37e69e Fix sig-figs-after-decimal (#55377) (#55482)
* Fix number formatter for small decimals

* Fixing bug when decimal is not ; Removed param as input value should always be numerical

Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-03-20 18:17:03 +00:00
github-automation-metabase
3d32109fa1 Update mongodb.md (#55470) (#55485)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-03-20 18:06:30 +00:00
github-automation-metabase
682ec82fcd Fix frontend parsing of allowed iframe hosts (#54111) (#54813)
* Fix frontend parsing of allowed iframe hosts

* Adding spec for allowed domain list parsing change

Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-03-20 17:41:24 +00:00
github-automation-metabase
e6a80107e1 Fix static viz to respect custom formatting (#54154) (#54223)
Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-03-20 17:38:20 +00:00
Noah Moss
ef8a2e965c Revert "Shared FE/BE pivots (#53000) (#55423)" (#55458)
This reverts commit 34e18606a2.
2025-03-20 10:53:31 -04:00
github-automation-metabase
94e6f2360c 🤖 backported "ci(sdk): adds embedding-sdk-tests-result" (#55450)
* 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"

* remove embedding-sdk-cli-snippets-type-check as it wasn't backported

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-03-20 15:38:13 +01:00
github-automation-metabase
a222ffe128 Update Readme version references and published npm version to 0.53.12 (#55466) 2025-03-20 14:17:45 +00:00
github-automation-metabase
0154e208c7 avoid ref on fn component error in console (#54959) (#54961)
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-03-20 12:23:57 +00:00
github-automation-metabase
e967468ef7 fix(sdk): fix ad-hoc question view when clicking into SDK dashboard (#55254) (#55419)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
2025-03-20 17:12:47 +07:00
github-automation-metabase
0239eb5962 Add a new embedding selector + make selector names consistent (#55260) (#55324)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-20 07:06:38 +00:00
github-automation-metabase
8cd35d4397 [serdes] introduce (partial) schema coercion for Dashboard (#55354) (#55439)
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

Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2025-03-19 22:12:05 +00:00
Noah Moss
34e18606a2 Shared FE/BE pivots (#53000) (#55423) 2025-03-19 17:36:40 -04:00
github-automation-metabase
7508f254b3 run only previously failed tests when rerunning pipeline (#54900) (#55432)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-03-19 19:19:58 +00:00
Luiz Arakaki
39d7fd1ea1 add api keys to config.yml (#55407)
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-19 15:08:47 +00:00
github-automation-metabase
870d4cea0f 🤖 backported "fix(qb): do not cut layout with two sidebars" (#55296) 2025-03-19 17:30:17 +03:00
github-automation-metabase
2b7e68d50d docs: add Learn redirects for Maps (#55367) (#55404)
* Update map.md

* Update map.md

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-03-19 13:04:32 +00:00
github-automation-metabase
7591f87026 fix(sdk): Entity ID support for CreateDashboardModal (#55358) (#55396)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-19 11:51:48 +00:00
github-automation-metabase
b8ad458339 Fix - App crashes when editing segment field details in data reference (#55333) (#55390)
* Fix #55322

* Repro #55322

* Simplify diff

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-03-19 07:08:42 +00:00
github-automation-metabase
0f4723e0a9 loki-update should update only diff (#55246) (#55380)
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-03-19 01:38:35 +00:00
github-automation-metabase
347c58e4fa fix: improve startup by not scheduling all dbs (#55297) (#55368)
* 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

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-18 19:44:08 +00:00
github-automation-metabase
86e6925fc5 docs: overhaul maps docs (#55313) (#55365)
* map comparison

* docs: maps overhaul

* Apply suggestions from code review



* review feedback

* Apply suggestions from code review

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-18 18:26:03 +00:00
github-automation-metabase
30f5f28af8 Update root folder Dockerfile (#54110) (#55359)
Update the clojure version

Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
2025-03-18 17:15:54 +00:00
github-automation-metabase
d1cf62b309 feat(sdk): do not setup sandboxing and show user switcher if using a sample database (#55105) (#55355)
* 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



* fix misleading comments



---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-18 16:57:07 +00:00
Luis Paolini
4cd48e5d27 upgrade snowflake driver on 53 (#55338)
to see if there are performance bumps
2025-03-18 13:27:19 -03:00
github-automation-metabase
49b1f212e5 Use InteractiveQuestion to create StaticQuestion (#54700) (#55169)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-18 18:26:51 +02:00
github-automation-metabase
0b2f7a11fe Remove InteractiveQuestionProviderWithLocation since it's really not necessary (#55165) (#55347)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-18 16:20:41 +00:00
github-automation-metabase
52e15c918d Update expressions-list.md (#55350) (#55352)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-03-18 16:11:07 +00:00
github-automation-metabase
328ceccffc Update introduction.md (#55349) (#55351)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-03-18 16:07:02 +00:00
github-automation-metabase
c680b8ddc3 🤖 backported "make tooltip scrollable" (#55032)
* make tooltip scrollable (#53730)

* make tooltip scrollable

* specs

* mark tooltip specs flaky (#55060)

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-03-18 14:55:55 +00:00
github-automation-metabase
6ae0664591 Fix - Prevent browser close/go back while changes are unsaved (#55161) (#55341)
* 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

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-03-18 14:49:32 +00:00
github-automation-metabase
ab08d283db Fix incorrect condition to hide parameters section in SubscriptionSidevar (#55320) (#55339)
* Fix incorrect condition to hide parameters section in SubscriptionSidebar
* Add unit tests for advanced filtering parameters display

Co-authored-by: Stas Gavrylov <stasgavrylov@gmail.com>
2025-03-18 14:36:08 +00:00
github-automation-metabase
07bdefe1bf feat: add malli schema, test converage to ldap api (#55130) (#55173)
* 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

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-18 14:35:31 +00:00
github-automation-metabase
f3daa4b3f0 update site urls (#55337) (#55340)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-18 14:26:42 +00:00
github-automation-metabase
6995b164a9 fix temporal strings for i18n (#55270) (#55273)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-03-18 07:51:53 -06:00
github-automation-metabase
249660b9c2 🤖 backported "refactor: rework filter widget to typescript" (#55117)
* refactor: convert ParameterFieldWidget to ts (#54916)

* fix import order

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>
2025-03-18 13:44:41 +00:00
github-automation-metabase
9865f68e2a Update embedding team codeowners files (#55317) (#55323)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-18 12:51:09 +00:00
github-automation-metabase
765c7c5716 fix(sdk): mark all react-dom dependency requests as external for React 19 compatibility (#55071) (#55325)
* fix externals configuration to enable compatibility

* tweak externals configuration

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-03-18 12:30:20 +00:00
github-automation-metabase
b3fefff9a3 Prevent concurrent init notification and send pulse trigger tasks (#55000) (#55035)
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2025-03-18 19:48:10 +09:00
github-automation-metabase
1cd6e9daae Add stable IDs for SaveQuestion / InteractiveQuestion (#55024) (#55087)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-18 11:21:40 +02:00
Gustavo Saiani
f09fa75c77 Update links (#55299) 2025-03-17 18:06:47 -03:00
github-automation-metabase
ce5a8d927a move crypto-browserify to dev deps (#55279) (#55289)
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-03-17 20:39:30 +00:00
github-automation-metabase
99d1d01b4a docs - sdk edits (#55056) (#55293)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-17 20:07:49 +00:00
Gustavo Saiani
fe5bbe4aac Use links with no redirection (#55229) 2025-03-17 15:55:17 -03:00
github-automation-metabase
f3fb25ccf4 Update Readme version references and published npm version to 0.53.11 (#55285) 2025-03-17 18:51:29 +00:00
github-automation-metabase
a6545b3920 🤖 backported "render cartesian charts when the dimension column is not available" (#55230)
* render cartesian charts when the dimension column is not available (#54870)

* snapshot

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2025-03-17 18:36:23 +00:00
github-automation-metabase
c87c492209 dev: just warn if can't watch UserKeyValue schemas (#55178) (#55278)
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.

Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-03-17 16:59:42 +00:00
Jeff Bruemmer
91304b8e72 docs - env var, config, and api updates (#55266)
* update env var docs

* config template

* update API
2025-03-17 12:47:29 -04:00
bryan
a43ea7f556 [53 Backport] Google Sheets Integration + Fixes (#55043)
* 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>

* update gsheets setting visibility (#54930)

* don't try to destructure the setting when missing (#54942)

* don't try to destructure the setting when missing

* also on gsheets status

* 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

* Add :snowplow/simple_event to schema->version

* backport mantine v6 props

* lefticon

---------

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-17 07:52:02 -06:00
Chris Truter
108009d956 Hack to workaround #55199 (#55209) 2025-03-17 13:04:03 +02:00
github-automation-metabase
bfdc47c72b 🤖 backported "feat(sdk): Add DownloadWidget and DownloadWidgetDropdown" (#55148)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-17 09:57:16 +00:00
github-automation-metabase
d818222187 Change name of files from Result -> DefaultView (#55014) (#55027)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-17 11:27:06 +02:00
github-automation-metabase
e2aac1199c docs: hiding columns (#55233) (#55234)
* hiding columns

* Apply suggestions from code review



---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-15 20:03:10 +00:00
github-automation-metabase
88ef6cf9a1 [pivot] Use m.u.performance/juxt* when constructing pivots (#54555) (#55221)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-03-14 21:52:19 +00:00
github-automation-metabase
18cdc645af docs - include deprecated in env vars, not in config template (#54873) (#55219)
* include deprecated in env vars, not in config template

* whitespace

* tests

* config file test

* whitespace

* combine functions



* format

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
Co-authored-by: bryan <bryan.maass@gmail.com>
2025-03-14 21:45:50 +00:00
github-automation-metabase
e73225bb1e skip actions when duplication a dashboard: they raise an exception right now (#55197) (#55218)
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

Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2025-03-14 21:22:53 +00:00
github-automation-metabase
a22930ea50 setup discouraged-tag linting for #p (#55187) (#55213)
* 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

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-03-14 20:47:08 +00:00
github-automation-metabase
aa8f5d3408 feat: send setting information via snowplow (#54981) (#55212)
* feat: send setting information via snowplow

* fixup! return full values for locale

* fixup! kondo

* fixup! remove #p

* fixup! newline

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-14 20:39:21 +00:00
github-automation-metabase
dd698bbb07 Fix drill through for "empty" pie chart slices (#55188) (#55201)
* Add repro test

* Use null instead of "empty" label in click object

Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>
2025-03-14 18:32:38 +00:00
github-automation-metabase
5ecdba2548 [mongodb] Optimize post-processing of Mongo queries (#54881) (#55195)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-03-14 17:15:43 +00:00
github-automation-metabase
7049af0399 Use timezoned timestamp for export filenames (#54872) (#55190)
* Use timezoned timestamp for export filenames

* clean ns

* tweak docstring

* add unit test + make namespace aliases consistent

* use new function in xlsx exports

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-03-14 17:07:26 +00:00
github-automation-metabase
3931def2e0 feat: add sdk embedding to snowplow features (#54988) (#55186)
* feat: add sdk embedding to snowplow features

* fixup! remove extra ?

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-14 16:32:53 +00:00
github-automation-metabase
715e6825f0 docs - remove auth flows (#55185) (#55193)
* remove auth flows

* add description

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-14 16:29:54 +00:00
github-automation-metabase
f37d1aa1c1 Resolved conflicts (#55176)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-03-14 10:43:28 -05:00
github-automation-metabase
ea4b1c2590 Add template strings (#55150) (#55154)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-14 12:35:34 +00:00
github-automation-metabase
7191951527 Fix styling (#55101) (#55147)
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-03-14 07:47:27 +00:00
github-automation-metabase
ef1c0a48bb Add doc for alternate hostname (#55139) (#55140)
docs for https://github.com/metabase/metabase/pull/51948

Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
2025-03-14 00:56:32 +00:00
github-automation-metabase
bc0e6a1971 fix: more efficient query for execution stats (#55126) (#55136)
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-13 22:34:28 +00:00
github-automation-metabase
b2d7cf032b fix: update filter widget value when we reset value to the default one (#54915) (#55111)
* rework filters reset tests to work with real data

* fix test

* fix stupid issue

* rename methods

* rework fix and fix the test

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-03-13 16:35:11 +00:00
github-automation-metabase
f3407e460a docs - note on self-hosted upgrades (#55096) (#55112)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-13 16:23:35 +00:00
github-automation-metabase
008e73af79 feat(sdk): Ensure that all dashboards use entity ID the same way (#55010) (#55091)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-13 15:13:31 +00:00
github-automation-metabase
2d6883522e Use source column type in drills (#54871) (#55093)
* Resolve day bucketed columns and do the resolution without bucketing

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-03-13 14:53:39 +00:00
github-automation-metabase
64ec32ce8b Update mysql.md (#55095) (#55098)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-03-13 14:37:32 +00:00
github-automation-metabase
b206331368 feat(sdk): Add entity IDs to CollectionBrowser (#54985) (#55085)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-13 13:43:42 +00:00
github-automation-metabase
48f00c21b0 refactor(sdk): Add targetCollection and deprecate saveToCollection (#54971) (#55077)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-13 13:13:43 +00:00
github-automation-metabase
b6f7bbee47 feat(sdk): Add stable ID support where missing (#54975) (#55079)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-13 13:09:21 +00:00
github-automation-metabase
a8c5e22e89 Fix React console errors on unrecognized props in styled components (#55081) (#55083)
* do not forward unrecognized props

* make shouldForwardProps more explicit

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-03-13 11:28:18 +00:00
github-automation-metabase
a3c96cee1a SQL Server doesn't cast when compiling uuid field filters (#54996) (#55072)
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.

Co-authored-by: William <william@metabase.com>
2025-03-13 09:04:51 +00:00
github-automation-metabase
795092960d docs - include sdk videos (#54980) (#55065)
* include sdk videos

* remove queries

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-12 23:46:31 +00:00
github-automation-metabase
a168633d06 fix bug in env var url component (#54937) (#55061)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-03-12 23:31:08 +00:00
github-automation-metabase
ac02037a76 fix: bump saml20 library for assertion sig fix (#55055) (#55057)
Bumps the version of the saml library in order to pull in the fix for messages without top-level signatures, but with assertion signatures.

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-12 21:51:09 +00:00
github-automation-metabase
12dd763872 Add describe-fields query logging (#55039) (#55042)
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-03-12 18:42:00 +00:00
github-automation-metabase
256a93c058 fix: default saml to use http-post binding (#55017) (#55031)
* fix: default saml to use http-post binding

* fixup! use library release

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-12 15:43:52 +00:00
github-automation-metabase
c72aa49bec fix(sdk): Popovers not working on Safari (#55012) (#55021)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-12 15:04:02 +00:00
github-automation-metabase
2a7cfa8740 Convert cardId to questionId for consistency (#55013) (#55018)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-12 14:39:25 +00:00
github-automation-metabase
52523c7f9a Update Readme version references and published npm version to 0.53.10 (#55004) 2025-03-12 08:42:57 +00:00
github-automation-metabase
8450f0159d feat(sdk): experimental react 19 version range support (#54904) (#55001)
* support react 19 version range in embedding sdk

* sync supported react versions

* add oxford comma



* revert docs and cli updates as we want to do a silent release

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-12 08:19:23 +00:00
github-automation-metabase
f04744349d 🤖 backported "when an alert failed to execute, make sure task history's status is failed" (#54966)
🤖 backported "when an alert failed to execute, make sure task history's status is failed" (#54966)

---------

Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2025-03-12 04:23:37 +00:00
github-automation-metabase
cc99b2ebec 🤖 backported "Wrap analytics into a module" (#53794)
* Wrap analytics into a module (#53476)

* wrap analytics into a module

* cleanup

* update config + use the analytics core api

* break circular dependency

* whitespace linter

* tests were using snowplow/first-user-creation

* ::snowplow/x -> :snowplow/x

* snowplow -> analytics

* indent

* indent2

* break cyclic dep

- add dev/mermaid.clj

* break another cycle

* remove internal api namespace references

* remove more internal api namespace access

* and another

* prometheus -> analytics

* allow access of activity-feed.init

* remove duplicate require

* fix e2e test + spelling + docs

* prometheus/ -> analytics/

---------

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-03-11 14:15:33 -04:00
Timofey Kachalov
cefee6b02d Backport: "Run cypress tests against sample apps" (#54854) 2025-03-11 21:18:40 +04:00
github-automation-metabase
6e64c33880 fix: question stats are calculated in sql query (#54932) (#54982)
* 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

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-11 16:53:47 +00:00
github-automation-metabase
072105edf6 Cast column to float for Redshift and SQLServer AVG (#53756) (#54341)
* cast to float for redshift avg

* cast sqlserver avg as float

* remove ::floors-average

* fix test comparison

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-03-11 16:46:54 +00:00
github-automation-metabase
4af49337cc Rebase after backport.sh (#54790)
Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-03-11 16:32:14 +00:00
github-automation-metabase
00044e105a 🤖 backported "Added additional API tests for /public and /api/public" (#54849)
* Added additional API tests for /public and /api/public (#54756)

* Backported #54756

* Reformatted

---------

Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-03-11 16:04:58 +00:00
github-automation-metabase
e7a71d1efa docs - poeditor -> crowdin (#54973) (#54976)
* crowdin link

* more links

* links

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-11 14:01:38 +00:00
github-automation-metabase
f6d8bd76a9 make sdk not error on type error (#54964) (#54967)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-03-11 11:56:55 +00:00
github-automation-metabase
e16f145031 Auto formatting adapts to currency style if needed (#54349) (#54576)
* wip

* test

* fix

* fixup

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-03-11 08:30:08 +00:00
github-automation-metabase
7741b4cc3b Replace defaultProps in styled and functional components (#54725) (#54840)
* 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

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-03-11 15:04:53 +07:00
github-automation-metabase
a8ca5dbf3d fix(sdk): remove react-router console error in LegendLabel when in React 19 (#54926) (#54952)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-03-11 07:17:13 +00:00
github-automation-metabase
16d2f76ae6 fix(sdk): Improve _.compose type + fix SDK type (#54850) (#54951)
* 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

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-11 06:30:47 +00:00
github-automation-metabase
4b57af8b66 Abandon fingerprinting if connecting to DB fails (#54697) (#54943)
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-03-10 22:52:48 +00:00
github-automation-metabase
492b8a0a0c update download jar (#54811) (#54936)
Co-authored-by: bryan <bryan.maass@gmail.com>
2025-03-10 20:37:49 +00:00
github-automation-metabase
d1d61fd809 Increase stage limit to 1000 and clarify error message. (#54917) (#54931)
Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-03-10 19:48:35 +00:00
github-automation-metabase
493cacb702 Fix leaving native query editor with parameters (#54863) (#54928)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-03-10 18:41:55 +00:00
github-automation-metabase
8f47f1399f fix(sdk): mark react-dom/client as external to fix warnings in React 19 (#54919) (#54923)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-03-10 18:38:42 +00:00
Phoomparin Mano
b3129d3715 Make react-draggable compatible with React 19 (#54902) 2025-03-10 23:35:12 +07:00
github-automation-metabase
9fa3e61969 Fix - SQL view is opened when creating a question on small screens (#54267) (#54911)
* 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: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-03-10 15:25:49 +00:00
github-automation-metabase
e29d43442e 🤖 backported "fix: close date filter on esc" (#54624)
* fix: close date filter on esc (#54499)

* fix: close date filter on esc

* fix test

* fixup

* update screenshots

* fix tests

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>
2025-03-10 17:51:10 +03:00
github-automation-metabase
ed868b67ab ci: fix flaky test about sticky panel (#54125) (#54907)
* fix flaky test about sticky panel

* rework fix

* drop waitFor

* fixup

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-03-10 14:50:35 +00:00
github-automation-metabase
eccc590e3f Fix schema-wide data permissions for huge schemas (#54858) (#54896)
Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-03-10 10:41:24 +00:00
github-automation-metabase
36e2c0a20b ci(sdk): Fix mysterious sdk deployment failure on 52 (#54890) (#54893)
* 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.

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-10 08:52:08 +00:00
github-automation-metabase
eed6f72504 🤖 backported "Fixing select dropdown in append data modal collection view" (#54874)
* Fixing select dropdown in append data modal collection view (#54864)

# Conflicts:
#	frontend/src/metabase/collections/components/ModelUploadModal.tsx

* back to mantine v6

---------

Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-03-08 14:15:54 +00:00
github-automation-metabase
d2b5746c69 Allow single argument between parameters on the backend (#54848) (#54851)
Backend part of the fix for #54364

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-03-07 16:21:42 +00:00
github-automation-metabase
fbd2944b2e Expire pending search indexes eventually (#54834) (#54844)
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2025-03-07 15:12:39 +00:00
github-automation-metabase
31f46fc972 Create search index within transaction (#54832) (#54838)
Not all drivers will actually do DDL statements transactionally, but it doesn't hurt to try.

Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2025-03-07 13:14:55 +00:00
github-automation-metabase
12d18f5942 update banner (#54800) (#54836)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-07 12:38:33 +00:00
github-automation-metabase
d6dd1b1f0d fix: select dataset editor header column after reordering by the corner (#54692) (#54820)
* fix: select dataset editor header column after reordering by the corner

* enable fix

* use index

* rename method

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-03-07 14:38:48 +03:00
github-automation-metabase
27c5380f82 🤖 backported "Recalculate columns for Upload model when updating" (#54582)
* 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
* fix brackets

---------

Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
Co-authored-by: Chris Truter <chris@metabase.com>
2025-03-07 10:09:12 +02:00
github-automation-metabase
427c4a4d63 Bump react-virtualized to 9.22.5 to unblock React 19 (#54645) (#54664)
* 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

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-03-07 08:06:56 +00:00
github-automation-metabase
3f594ab51b Remove findDOMNode from visualization components (#54707) (#54795)
* remove findDOMNode usage in viz components

* remove type cast

* expose rootElement via ref

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-03-07 07:55:28 +00:00
github-automation-metabase
2d76168409 Bump react-grid-layout to 1.4.4 to unblock React 19 (#54644) (#54662)
* bump react-grid-layout to 1.4.4

* bump the types for react-grid-layout to latest in DefinitelyTyped

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-03-07 14:39:29 +07:00
github-automation-metabase
71c7648f6b Replace findDOMNode in core components (#54650) (#54829)
* 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

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-03-07 07:20:27 +00:00
github-automation-metabase
7827d85246 WRK-81: Subscriptions can include unwired filters which is confusing (#54508) (#54719)
* 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

Co-authored-by: Stas Gavrylov <stasgavrylov@gmail.com>
2025-03-07 05:27:18 +00:00
github-automation-metabase
ed511f94bb 🤖 backported "fix(sdk): Fix ColorRangeSelector in Conditional Formatting" (#54615)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-07 00:32:56 +00:00
github-automation-metabase
4d8552da12 🤖 backported "Convert components of RuleEditor to Mantine" (#54502)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-06 14:43:51 -08:00
github-automation-metabase
3df10e4f05 Enable multi-arch builds in publish workflow (#54473) (#54818)
* 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

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-03-06 21:12:54 +00:00
github-automation-metabase
f28f9e1053 Don't update dashboard updated_by if only last_viewed_at changes (#54613) (#54814)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-03-06 19:50:17 +00:00
github-automation-metabase
5b361ce08a support: More logging for field sync. (#54774) (#54809)
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.

Co-authored-by: Case Nelson <case@metabase.com>
2025-03-06 18:38:18 +00:00
github-automation-metabase
e3ccd61e7c docs - note on literals with special characters (#54806) (#54807)
* note on literals with triple braces

* edit

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-06 17:42:07 +00:00
github-automation-metabase
a3ecb6089c 🤖 backported "fix: update saml20 for full SAML SLO support" (#54742)
* 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

* fixup! update license overrides

---------

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Edward Paget <ed.paget@gmail.com>
2025-03-06 15:35:05 +00:00
github-automation-metabase
3353d7d8e5 stabilize flaky test (#54789) (#54792)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-03-06 13:03:04 +00:00
github-automation-metabase
24807042be Fix type logic for datetimeDiff() for days on postgres (#54709) (#54786)
* Subtracting 2 dates gives a number of days (integer)

* Add test for all postgres time units for datetimeDiff()

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-03-06 12:37:15 +00:00
github-automation-metabase
2827f53fb1 Closes viz-474: conditional formatting polish (#54483) (#54635)
* :x

* fixup

* useToggle -> useDisclosure

* deprecate useToggle in favor or useDisclosure

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-03-06 13:12:41 +01:00
github-automation-metabase
73050dee32 ci(sdk): Send SDK release notification to Slack (#54733) (#54780)
* 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

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-06 07:02:46 +00:00
github-automation-metabase
0c210c5295 Update required driver fields and placeholders (#53693) (#54776)
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-03-05 22:23:16 +00:00
Uladzimir Havenchyk
d1d4932d10 fix: replicate mantine v7 behavior for relative datepicker (#54761) 2025-03-06 00:00:45 +03:00
github-automation-metabase
5ce9ff6cda use new endpoints for tiles in the pin map viz (#54475) (#54744)
* 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: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Noah Moss <noahbmoss@gmail.com>
2025-03-05 15:32:32 -05:00
github-automation-metabase
d396ebb7e3 Fix large filter pill text wrapping (#54757) (#54769)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-03-05 19:59:22 +00:00
github-automation-metabase
bea4df0e01 Support relative-time-interval in the expression editor (#54671) (#54766)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-03-05 19:04:52 +00:00
github-automation-metabase
a8e1b00d9c Add a nitpick for postgres and impersonation (#54424) (#54765)
* 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: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-05 18:34:33 +00:00
github-automation-metabase
a9dd49cb16 Update running-metabase-on-docker.md (#54571) (#54764)
* 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: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-03-05 18:31:21 +00:00
github-automation-metabase
39f69806c2 Don't allow pulse.updated_at to change when dashboard changes (#54670) (#54745)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-03-05 18:10:17 +00:00
John Swanson
d5bc65be80 Allow impersonated users to hit cache again (#54521) (#54673)
* 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-05 09:47:45 -08:00
github-automation-metabase
c0440485fa check for anchors (#54743) (#54754)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-05 17:22:25 +00:00
github-automation-metabase
9f210ff799 Only include personal emails in admin recipients (#54658) (#54747)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-03-05 17:15:23 +00:00
github-automation-metabase
b9a03da16c docs - images and links (#54734) (#54735)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-05 14:40:05 +00:00
github-automation-metabase
249228df47 docs - rename SQL snippets to snippets (#54507) (#54729)
* SQL snippets to snippets

* rename file

* snippet folder

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-05 13:41:18 +00:00
github-automation-metabase
37b33db705 Fix - Uncaught TypeError when making native query parameter required (#54494) (#54509)
* Fix #52812

* Fix types

* Repro #52812

* Add logs

* Bring back lost values

* Simplify code

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-03-05 09:49:41 +00:00
github-automation-metabase
e335b5932f Prevent from using millisecond with datetime-diff (#54531) (#54720)
* Fixes

* Fix

* Fix

* Fix

* Add tests

* Add tests

* Add tests

* Fix description

* Fix description

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-03-05 09:48:46 +00:00
github-automation-metabase
010153f55a Update stable tag (#54710) (#54716)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-05 08:43:54 +00:00
github-automation-metabase
241cce5e4d Remove the legacy isModal context from ModalContent (#54660) (#54705)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-03-05 07:10:15 +00:00
github-automation-metabase
df76e8b001 🤖 backported "Convert RuleListing to Mantine" (#54677)
* Convert RuleListing to Mantine (#54471)

* Fix type errors

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-05 03:59:06 +00:00
github-automation-metabase
ab8d0dcb4b Show an error message when overwriting a card with a cycle (#54610)d (#54693)
* Fix bug

* Fix bug

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-03-04 22:32:33 -05:00
github-automation-metabase
3f70f686e6 🤖 backported "Convert RulePreview to Mantine" (#54690)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-04 18:48:30 -08:00
github-automation-metabase
d1b2e5208c Metabase Automation Genius Engine (#54091) (#54698)
* 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: bryan <bryan.maass@gmail.com>
Co-authored-by: Cam Saul <github@camsaul.com>
2025-03-05 00:25:35 +00:00
github-automation-metabase
74fd44cfcd Do not display the raw data toggle when displaying table, even with reordered columns (#54668) (#54683)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-03-04 20:46:27 +00:00
github-automation-metabase
f9bdeabb37 fix: clear dashboard url from undefined when filter is removed (#54600) (#54680)
* fix: clear url when filter is removed

* add e2e test

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-03-04 20:00:46 +00:00
github-automation-metabase
465d7b5051 Convert RuleDescription to Mantine (#54470) (#54675)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-04 19:15:54 +00:00
github-automation-metabase
1fac296d56 docs: Update Usage analytics (#54657) (#54672)
* Update usage-analytics.md

* Apply suggestions from code review



---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-04 17:53:18 +00:00
github-automation-metabase
8f92d9f0c4 🤖 backported "Add prometheus info metric" (#54595)
* Add prometheus info metric (#54523)

* Adjust to the lay of the land

---------

Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
Co-authored-by: Chris Truter <chris@metabase.com>
2025-03-04 15:27:39 +00:00
Nick Fitzpatrick
7981462797 Manual Backport of echarts tooltip and dashcard viz modal adjustments (#54614)
* echarts tooltip and dashcard viz modal adjustments

* fix e2e viz tooltip assertion

* adjusting embedding-sdk test
2025-03-04 11:18:05 -04:00
github-automation-metabase
580c9aec4a 🤖 backported "Updating InputWithSelectPrefix to Mantine components" (#54621)
* Updating InputWithSelectPrefix to Mantine components (#54536)

* updating InputWithSelectPrefix to Mantine components

* fixing the border, and tests

* adjusting e2e test

---------

Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2025-03-04 14:58:54 +00:00
github-automation-metabase
a6ed3e0654 Update activating-the-enterprise-edition.md (#54430) (#54646)
* Update activating-the-enterprise-edition.md

Added proxy for containers

* Update docs/installation-and-operation/activating-the-enterprise-edition.md

---------

Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-04 12:39:16 +00:00
github-automation-metabase
a07050ab09 refactor: "Get embedding code" width too narrow (#54574) (#54637)
* A more idiomatic fix

* Add an assertion

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-04 09:36:34 +00:00
Mahatthana (Kelvin) Nomsawadi
2097d002b5 ci: Fix wrong format (#54640) 2025-03-04 09:10:46 +00:00
github-automation-metabase
cd8fe76902 Guard enforced-sandboxes-for-user against nil user-ids (#54605) (#54628)
* guard enforced-sandboxes-for-user against nil user-ids

* add comment

* Fix e2e test

* try again to fix e2e test

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-03-04 00:43:08 +00:00
github-automation-metabase
1485b585da Build multi-arch arm images (#54156) (#54629)
* 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

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-03-03 21:58:09 +00:00
github-automation-metabase
9a522e4357 Repro for "Date filter translations: Key not being translated" (#54619) (#54622)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-03-03 21:09:09 +00:00
github-automation-metabase
3f18ca5567 Add "for React" to SDK in legalese modal and settings page (#54534) (#54617)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-03-03 12:59:12 -08:00
github-automation-metabase
4b2568a5f9 Fix duplicates introduced by column sync (#54611) (#54620)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-03-03 20:37:47 +00:00
github-automation-metabase
674de23c5f Make :time-interval work with 0 instead of :current in the UI (#54604)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-03-03 20:20:50 +00:00
github-automation-metabase
cf7a57c9d2 fix: Cast LocalDateTime to date in oracle (#54529) (#54607)
* 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

Co-authored-by: Case Nelson <case@metabase.com>
2025-03-03 19:08:17 +00:00
github-automation-metabase
7c70ec75cf Remove extra queries on public & embedded dashboard load (#52993) (#54609)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-03-03 18:29:38 +00:00
github-automation-metabase
accb8b6863 clarify cloud (#54592) (#54596)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-03 15:52:48 +00:00
github-automation-metabase
328ec45212 [Cards in Dashboards] Allow changing save location when saving a modified dashboard question (#54526) (#54594)
* fix

* add unit tests

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-03-03 15:50:31 +00:00
github-automation-metabase
265cefec41 Fix pivot csv export with multiple pivot cols and no row totals (#54540) (#54593)
* Fix pivot csv export with multiple pivot cols and no row totals

* revert re-enabling a couple tests since they fail on mysql

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-03-03 15:47:58 +00:00
github-automation-metabase
21110531db Update sample app ports in documentation (#54575) (#54590)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-03-03 15:18:00 +00:00
github-automation-metabase
d4f45d5066 docs - note on license (#54586) (#54588)
* note on license

* Update docs/embedding/sdk/quickstart.md

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-03 14:31:45 +00:00
github-automation-metabase
08c1ef6804 Remove unnecessary step that updates GH CLI (#54581) (#54584)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-03 14:03:12 +00:00
github-automation-metabase
7183edb63a 🤖 backported "fix: prevent icon overflow on resize" (#54500)
* fix: prevent icon overflow on resize (#54189)

* use mantine v6

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>
2025-03-03 14:48:14 +03:00
github-automation-metabase
93c684203a SDK legalese text overflow (#54541) (#54543)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-02-28 22:50:42 +00:00
github-automation-metabase
c29fa4777d Allow zoom on joined binned column (#54226) (#54537)
* 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

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-02-28 22:29:11 +00:00
github-automation-metabase
dad51f169f fix: nested field refs from join-alias with spaces (#54231) (#54535)
* 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

Co-authored-by: Case Nelson <case@metabase.com>
2025-02-28 22:04:38 +00:00
github-automation-metabase
b3cd4ab7e3 Add for React in two places on the core app (#54234) (#54384)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-02-28 12:55:10 -08:00
github-automation-metabase
c69fbc140c 🤖 backported "[Cards in Dashboards] Save dashboard question directly to tab" (#54514)
* [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

* replace mantine v7 prop with its v6 counterpart

* replace e2e util with one that exists in backport branch

---------

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
2025-02-28 14:05:11 -06:00
github-automation-metabase
53d061a06d Add support for filtering Mongo UUIDs with string patterns (#54390) (#54528)
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-02-28 19:59:48 +00:00
github-automation-metabase
ea08fad2ac 🤖 backported "[Impersonation] Adds e2e test for enforcement of impersonation on cached questions" (#54522)
* [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

* replace e2e util with one that exists in backport branch

---------

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
2025-02-28 18:16:04 +00:00
github-automation-metabase
b7e45ce014 🤖 backported "Fix field-id propagation in filter parts" (#54504)
* Fix `field-id` propagation in filter parts (#54448)

* Fix test

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-02-28 17:08:52 +00:00
github-automation-metabase
242cacebf8 Fix e2e test flake for issue 29943 reproduction (#54304) (#54520)
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.

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-02-28 16:47:20 +00:00
github-automation-metabase
2329658a61 tech-debt: move sync.concurrent out of sync module (#54092) (#54141)
Moving this fixes a circular dependency with sync and
models.database health check.

Co-authored-by: Case Nelson <case@metabase.com>
2025-02-28 16:26:44 +00:00
github-automation-metabase
0da53ec082 fix: BigQuery ClassNotFound in future (#54474) (#54512)
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.

Co-authored-by: Case Nelson <case@metabase.com>
2025-02-28 16:19:30 +00:00
github-automation-metabase
b91d388b4c Update interactive-embedding-quick-start-guide.md (#54485) (#54515)
Co-authored-by: Alberto Perdomo <albertoperdomo@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-28 15:59:23 +00:00
github-automation-metabase
84f1d5cf6f Handle non-JSON native mongo queries (#54210) (#54505)
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-02-28 15:29:21 +00:00
github-automation-metabase
becb001a36 [Cards in Dashboards] Use last selected collection for default save location if more recent than a dashboard (#53571) (#54492)
* 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: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2025-02-28 12:57:36 +00:00
github-automation-metabase
2a02275714 New tiles APIs to support parameterization and public sharing/embedding (#54150) (#54465) 2025-02-27 20:54:32 -05:00
github-automation-metabase
7789039cdd Change offset help text (#54455) (#54463)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-02-27 22:34:22 +00:00
github-automation-metabase
71786a64ab fix typo (#54464) (#54466)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-27 22:22:03 +00:00
github-automation-metabase
25dcc59a06 [Cards in Dashboards] Allow dashboards w/o questions saved inside it to be shallow cloned (#53780) (#54462)
* 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

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-02-27 22:17:47 +00:00
github-automation-metabase
515ab4821a docs - SDK questions (#54451) (#54458)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-27 16:44:35 -05:00
github-automation-metabase
6b92b628ac Check caching schedule setting value exists (#54392) (#54454)
Co-authored-by: Fraser <fraser@metabase.com>
2025-02-27 21:36:22 +00:00
github-automation-metabase
260a24f469 🤖 backported "Convert ChartSettingsTableFormatting components to TS" (#54387)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-02-27 13:13:05 -08:00
github-automation-metabase
66dd725e59 🤖 backported "Fix drills for mapped model metadata" (#54443)
* 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.

* Fix tests that depend on un-backported test util changes

These tests depended on un-backported changes to lib.tu/query-with-source-card from commit
bba632c41e

---------

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-02-27 20:32:20 +00:00
github-automation-metabase
dabc5bd06c Update Readme version references and published npm version to 0.53.9 (#54439) 2025-02-27 16:48:52 +00:00
github-automation-metabase
65ec0d4abc fix(sdk): expose the correct type for saveToCollection (#54428) (#54432)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-02-27 16:21:42 +00:00
Jeff Bruemmer
b722cdfc5b update api docs and base host (#54373) 2025-02-27 14:18:50 +00:00
github-automation-metabase
98cdffb15d 🤖 backported "feat(sdk): use questionId={new} for creating new questions" (#54403)
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
2025-02-27 21:08:50 +07:00
github-automation-metabase
8f0ccda6dd Widen the 'Get embedding code' popover so we can see the copy link button (#54414) (#54418)
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)

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2025-02-27 11:59:52 +00:00
github-automation-metabase
6216ff701e fix flaky test (#54408) (#54413)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-27 10:35:48 +00:00
github-automation-metabase
cf0d10c9fd fix(sdk): deprecate the CreateQuestion component (#54212) (#54287)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
2025-02-27 15:29:44 +07:00
github-automation-metabase
559e43ecce feat(sdk): use new querying layout for create question flow (#53976) (#54245)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
2025-02-27 14:54:52 +07:00
github-automation-metabase
b2f594bbcc 🤖 backported "Notification metrics" (#53657)
* Notification metrics (#53289)

* Buckets for notification send duration ms histogram (#53882)

* Track notification wait time and total send time (#54080)

* #54164

---------

Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2025-02-27 05:35:15 +00:00
github-automation-metabase
d00cde95b6 optional sql server 2017 (#54389) (#54394)
* optional sql server 2017

* disable sqlserver 2017 tests

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-02-26 23:16:23 +00:00
github-automation-metabase
5626964894 🤖 backported "fix(sdk): [EMB-154] Pivot table visualization settings tabs caused jarring width change" (#54313)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
fix(sdk): [EMB-154] Pivot table visualization settings tabs caused jarring width change (#54023)
2025-02-26 21:01:37 +00:00
github-automation-metabase
605b37957c support markdown in the link description tooltip (#53097) (#54381)
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-02-26 20:05:43 +00:00
github-automation-metabase
7ddb51a86f Update interactive-embedding-quick-start-guide.md (#54377) (#54378)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-26 18:54:34 +00:00
github-automation-metabase
f5a8cef20e Updates to SDK docs (#54363) (#54371)
Co-authored-by: Alberto Perdomo <albertoperdomo@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-26 17:55:23 +00:00
github-automation-metabase
a27b81a528 dashboardCardMenu (#54366) (#54369)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-26 17:49:58 +00:00
github-automation-metabase
a81eebe78a SDK - Document color theming limitation (#54351) (#54355)
Co-authored-by: Alberto Perdomo <albertoperdomo@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-26 16:22:59 +00:00
github-automation-metabase
8d93d36e9a Update Readme version references and published npm version to 0.53.8 (#54350) 2025-02-26 16:04:39 +00:00
github-automation-metabase
8f652a145b fix(sdk): add forwardRef to remove 'Function components cannot be given (#54280) (#54290)
refs' console.error

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-02-26 15:32:24 +01:00
github-automation-metabase
67bd60a670 🤖 backported "docs - sdk edits" (#54315)
* Add backport resolution script

* merge

* Delete backport.sh

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-26 07:37:55 -05:00
github-automation-metabase
27c9f350cd 🤖 backported "docs - sdk questions edits" (#54296)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-26 07:24:35 -05:00
github-automation-metabase
c2ce5bd7e6 Repro #54236 (#54326) (#54333)
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-02-26 12:17:22 +00:00
github-automation-metabase
3563535d8a Add missing support of mapQuestionClickActions plugin for InteractiveDashboard (#54240)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-02-26 15:49:28 +04:00
github-automation-metabase
e4a074b4ca fix(sdk): move some emotion to css, scope it to .mb-wrapper and use it in the sdk (#54202) (#54330)
* 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

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-02-26 11:40:44 +00:00
github-automation-metabase
7c99220bcb fix a test (#53878) (#54329)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-26 11:20:34 +00:00
github-automation-metabase
b7ce5d9d5e fix flaky test (#53904) (#53923)
# Conflicts:
#	e2e/test/scenarios/native-filters/native-filters-reproductions.cy.spec.js

Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-26 12:01:45 +01:00
github-automation-metabase
3fa14f4606 🤖 backported "fix(sdk): Rename saveToCollectionId => saveToCollection" (#54263)
* fix(sdk): Rename saveToCollectionId to saveToCollection (#54225)

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

* cleanup docs and types

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
2025-02-26 09:05:12 +00:00
github-automation-metabase
cf5480e41a feat(sdk): cli should ask to remove the instance early if one exists (#53545) (#54321)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-26 08:44:57 +00:00
github-automation-metabase
40a0b9df6d fix(sdk): improve example component import paths in cli (#53473) (#54213)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-26 08:44:22 +00:00
github-automation-metabase
7ebd9b3b06 🤖 backported "Introduce attachment-row-limit and enforce download-row-limit minimum of 1048576" (#54307)
* 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

Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-02-25 13:01:56 -08:00
github-automation-metabase
82c545d2b2 Fix two bugs in DQ updates/creation (#54292) (#54300)
- 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

Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-02-25 19:15:18 +00:00
github-automation-metabase
0f1f8a48fd update image and add version note (#54294) (#54297)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-25 18:07:09 +00:00
github-automation-metabase
1530def412 Fixed conditional formatting for numerical primary/foreign keys (#54139) (#54293)
* conditional formatting for numerical primary/foreign keys

* clearer conditionals?

* import

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-02-25 18:06:27 +00:00
github-automation-metabase
eb99d8dc45 Remove Unsubscribe link from unsaved subscription test email for non-users (#54242) (#54283)
Co-authored-by: Stas Gavrylov <stasgavrylov@gmail.com>
2025-02-25 17:27:31 +00:00
github-automation-metabase
9cbc04851c Update quickstart-with-sample-app.md (#54284) (#54286)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-25 17:01:09 +00:00
github-automation-metabase
094b834d30 add some nice logging about skipping snapshots in e2e tests (#53757) (#54281)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-02-25 17:00:29 +00:00
github-automation-metabase
8525f9cb44 Fix a case with broken dates and timelines (#54271) (#54277)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-02-25 16:49:28 +00:00
github-automation-metabase
c6bfcc918d Adjust SDK version compatibility warning color (#54260) (#54274)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-02-25 16:22:51 +00:00
github-automation-metabase
4e80bb965c Update Readme version references and published npm version to 0.53.7 (#54262) 2025-02-25 14:57:15 +00:00
github-automation-metabase
66856143c6 sdk debug info component (#54201) (#54254)
* sdk debug info component

* remove extra BUILD_TIME

* move the component to components/public so it gets automatically wrapped in the nextjs compat layer

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-02-25 14:36:21 +00:00
github-automation-metabase
59349f0452 Destroy DB in count of grouping tests (#53700) (#54216)
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-02-25 14:34:41 +00:00
github-automation-metabase
7e68f114ca docs - display as image (#54200) (#54259)
* Update table.md

* headings

* Update docs/questions/visualizations/table.md

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-25 14:20:47 +00:00
github-automation-metabase
38b35ed9a9 Remove beta label for SDK (#53925) (#54257)
Co-authored-by: Alberto Perdomo <albertoperdomo@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-25 14:05:32 +00:00
github-automation-metabase
1197fdf649 docs - sdk pages (#54224) (#54256)
* Update JWT SSO authentication documentation

* links

* edits

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-25 13:59:15 +00:00
github-automation-metabase
b6863c365c Fix summarize sidebar bucket label not visible when selected (#54176) (#54185)
* Fix summarize sidebar bucket label not visible when selected

* Make binning label visible when adding a dimension

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-25 13:18:17 +00:00
github-automation-metabase
8edc2fb085 Always run Pivot Table queries immediately (#54195) (#54247)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-02-25 12:54:05 +00:00
github-automation-metabase
eb779ed04c Fix embedding SDK admin settings typo (#54134) (#54179)
* Fix embedding SDK admin settings typo

* quickstarttttttt

* Fix unit tests

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-25 12:24:24 +00:00
github-automation-metabase
2f720242bd Always set a ref in PivotTable to properly scale it (#54126) (#54172)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-02-25 12:24:13 +00:00
Mahatthana (Kelvin) Nomsawadi
84444ce8a4 Use the snapshot created on CI (#54244) 2025-02-25 11:48:11 +00:00
github-automation-metabase
22b987b60a Support bulk-fetching personal collection names to improve performance (#53572) (#54229)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-02-24 23:17:06 +00:00
github-automation-metabase
c7005df14b Gracefully handle null arrays in results (#54203) (#54228)
Co-authored-by: Riley Thompson <riley@metabase.com>
2025-02-24 23:08:11 +00:00
github-automation-metabase
3339501fb2 Convert back to original type when binning by day (mysql) (#53777) (#54128)
* 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

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-02-24 14:49:52 -08:00
github-automation-metabase
9c59e252ef Fix static fix thai translations (#54155) (#54227)
Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-02-24 22:29:03 +00:00
github-automation-metabase
8becef9501 Fix mongo uuid not displaying correctly (#53564) (#54222)
* 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.

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-02-24 21:46:42 +00:00
github-automation-metabase
6213c8bc1f Use SELECT 1 instead of SELECT * FROM ORDERS (#54151) (#54219)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-02-24 21:04:39 +00:00
github-automation-metabase
89379d1a71 Take the :type of implicit action parameters from the table field, not what is saved in the database (#53914) (#54209)
* 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

Co-authored-by: Dan Stone <wotbrew@gmail.com>
2025-02-24 18:34:39 +00:00
github-automation-metabase
90fbe7ce7e Allow duplicating dashboard but not with DQs (#53766) (#54204)
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.)

Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-02-24 18:07:00 +00:00
github-automation-metabase
9539593e85 docs - sdk quickstart (#54161) (#54199)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-24 16:24:50 +00:00
github-automation-metabase
48cdff4e25 fix: allow google auth when throttling is disabled (#53788) (#53919)
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-02-24 08:23:21 -06:00
github-automation-metabase
0dce68b39a Fewer warnings in the console (#53528) (#54068)
* fewer warnings in the console

* fixed test

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-02-24 10:03:08 +01:00
github-automation-metabase
e622b870d5 Remove redundant "in" in a translation string (#54122) (#54174)
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-02-24 08:51:27 +00:00
github-automation-metabase
9bd8f5c3c2 🤖 backported "Check for min arg count in expressions" (#54095)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-02-22 23:13:56 -05:00
github-automation-metabase
7a01bda088 docs: caching and impersonation (#54153) (#54158)
* caching impersonation

* Update docs/configuring-metabase/caching.md



---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-21 23:12:47 +00:00
github-automation-metabase
1a1679ff4a fix(sdk): fix visual artifacts in binning options (#53961) (#54129)
* 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: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-21 15:05:17 +00:00
github-automation-metabase
b36b5a9070 SDK - initialSqlParameters is only supported in SQL questions (#54114) (#54132)
Co-authored-by: Alberto Perdomo <albertoperdomo@users.noreply.github.com>
Co-authored-by: jeff bruemmer <jeff.bruemmer@gmail.com>
2025-02-21 14:50:15 +00:00
github-automation-metabase
4320f3f57e Fix alert icon box-sizing (#52378) (#54117)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-02-21 09:53:21 +00:00
github-automation-metabase
c4d95de5b1 Allowing users to show/hide values on their stacked series (#53835) (#54119)
* allowing users to show/hide values on their stacked series

* fixup

* not showing the new widget when settings[graph.show_stack_values] === total

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-02-21 09:42:01 +00:00
Aleksandr Lesnenko
0a239d961f Fix chart settings field picker (#54099)
* fix chart settings field picker

* spec
2025-02-20 21:12:25 +00:00
github-automation-metabase
99310f1687 docs - notes on EIDs and static embedding (#54098) (#54100)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-20 20:45:35 +00:00
github-automation-metabase
f1a67dfeae Update Readme version references and published npm version to 0.53.6 (#54097) 2025-02-20 18:51:17 +00:00
github-automation-metabase
5de432b713 fix: WRK-70 wording (#54070) (#54073)
* fix: WRK-70 wording

* fix: review issues

Co-authored-by: Konstantin Darutkin <spalt08@mail.ru>
2025-02-20 17:34:44 +00:00
github-automation-metabase
9aea2bdc57 fix: remove typo from packages we remove from the filter list (#54072) (#54089)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-02-20 17:30:55 +00:00
github-automation-metabase
b0878436af Update editor.md (#54086) (#54087)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-02-20 16:52:32 +00:00
github-automation-metabase
c0e7ff6fef test: repro tests for #32750 and #41831 (#54076) (#54083)
Co-authored-by: Konstantin Darutkin <spalt08@mail.ru>
2025-02-20 15:34:54 +00:00
github-automation-metabase
f31b40511c fix: hide sqlite from engines on cloud hosting (#53702) (#54077)
* fix: hide sqlite from engines on cloud hosting

* fixup! set custom driver heirarchy

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-02-20 15:33:02 +00:00
github-automation-metabase
ff19935cfc Fix global css reset for svg elements (#53928) (#54061)
Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-02-20 07:59:01 +00:00
Timofey Kachalov
dd00985e13 Use max-content width for ClickActionsPopover (#53958) 2025-02-20 11:35:10 +04:00
github-automation-metabase
149b880e7f Convert java.sql.Arrays to Clojure vectors (#53551) (#54055)
Implements `read-column-thunk [:sql-jdbc Types/ARRAY]` to convert `java.sql.Array`s to Clojure vectors.

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-02-20 01:04:17 +00:00
github-automation-metabase
848f775038 Ensure CLJS/CLJC files get translations included in the FE bundle (#53984) (#54007)
* Ensure CLJS/CLJC files get translated included in the FE bundle

* Fix backend test

* clean ns

* add e2e test

* Fix another e2e test

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-02-19 19:47:48 +00:00
github-automation-metabase
50ed7df469 tag test as flaky (#53980) (#53990)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-19 19:11:31 +00:00
github-automation-metabase
b47aae5337 update athena driver to 3.4.0 (#53979) (#53989)
Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2025-02-19 18:56:40 +00:00
github-automation-metabase
0b68d6d4a1 Add back discarding-rff for preemptive caching, and expand backend and e2e test coverage (#53639) (#53978)
* 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

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-02-19 16:13:32 +00:00
github-automation-metabase
040ce33571 fix: WRK-67 new action modal is too hard to close (#53905) (#53977)
* 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

Co-authored-by: Konstantin Darutkin <spalt08@mail.ru>
2025-02-19 15:59:45 +00:00
github-automation-metabase
e1c22e0470 Fix - Redundant GET /api/action request when viewing non-model object details (#53032) (#53975)
* 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

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-02-19 15:44:56 +00:00
github-automation-metabase
b91b364cc9 Fix "Promise was collected" error in visual tests (#53889) (#53968)
* Add missing RTK Query middleware in storybook

* Fix "Promise was collected" error

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-02-19 13:08:27 +00:00
github-automation-metabase
cbe83601c8 fix(sdk): hide "New Question" in EditableDashboard sidebar (#53908) (#53963)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-19 11:47:50 +00:00
github-automation-metabase
2846be2f66 fix(sdk): auto-select sample database tables in cli (#53654) (#53862)
* auto-select tables in sample databases

* use people, orders and products

* use non-underscore variants

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-19 07:36:32 +00:00
github-automation-metabase
1398f2b6c8 🤖 backported "Field select fix" (#53828)
* Field select fix (#53759)

* fixed color selection and reordering on columns

* test

* added drag and drop expectation

* .

---------

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-02-19 08:22:18 +01:00
github-automation-metabase
415687a509 Buckets for notification send duration ms histogram (#53882) (#53900)
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2025-02-19 05:47:29 +00:00
github-automation-metabase
9ea1c6d9ba Fix trend lines in slack alerts VIZ-272 (#53711) (#53798)
* Enable results metadata during qp/process-query as it seems to also control insights which we need for slack alert trendlines

* Removing outdated alerts w/ models test

Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-02-19 00:59:32 +00:00
github-automation-metabase
8b9d8d5a78 Fix env vars in embedding quickstart doc (#53931) (#53946)
We're now using `VITE_METABASE_INSTANCE_URL` and `VITE_AUTH_PROVIDER_URI`: https://github.com/metabase/metabase-nodejs-react-sdk-embedding-sample/blob/main/.env.example

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2025-02-18 22:33:55 +00:00
github-automation-metabase
f1254bae00 fix flaky test (#53906) (#53924)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-18 19:06:59 +00:00
github-automation-metabase
c117a4f452 fix: use standard user order sort for group list (#53722) (#53920)
* fix: use standard user order sort for group list

* fixup! remove alba from user fixtures

* fixup! better user model creation

* fixup! remove test-user? filter

* fixup! remove added test and use exisiting sort test

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-02-18 19:00:57 +00:00
github-automation-metabase
5eb779397a fix: allow password reset if google sso disabled (#53865) (#53917)
* fix: allow password reset if google sso disabled

* fixup! correct arg type to keyword in message test

* fixup! remove empty line

* fixup! add public docstring

* fixup! add temp google client id

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-02-18 17:50:29 +00:00
github-automation-metabase
7be3094d52 Removed beta badge for the SDK (#53596) (#53909)
Co-authored-by: Roman Abdulmanov <roman@metabase.com>
2025-02-18 16:22:15 +00:00
github-automation-metabase
0bd585f015 Update Readme version references and published npm version to 0.53.5 (#53899) 2025-02-18 13:43:16 +00:00
github-automation-metabase
d9d37028e8 chore: add spalt08 as a team member (#53886) (#53888)
Co-authored-by: Konstantin Darutkin <spalt08@mail.ru>
2025-02-18 12:09:09 +00:00
github-automation-metabase
f3826bb838 Disallow console.log in unit tests (#53871) (#53873)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-18 09:24:21 +00:00
github-automation-metabase
0f4954f864 small fixes I found during hackathon (#53593) (#53597)
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2025-02-18 08:50:09 +00:00
github-automation-metabase
55bfc3e228 [pulse] Optimize memory usage email notification rendering (#53717) (#53854)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-02-18 08:41:23 +00:00
github-automation-metabase
939dd036d9 docs(sdk): document sample components generated by cli (#53695) (#53860)
* document sample cli components

* document the demo providers

* update docs

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-17 21:54:24 +00:00
github-automation-metabase
f8a5ef2417 feat(sdk): asks whether to add a db right before adding db connection in the cli (#53680) (#53856)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-17 21:39:56 +00:00
github-automation-metabase
a21b67e5e9 Error explicitly when sandboxing/impersonation configs conflict (#53849) (#53855)
* Error explicitly when sandboxing/impersonation configs conflict

* Fix tests

* Fix kondo warning, use consistent ns aliases

* Fix another test

* Cleanup, consistent aliases

* Add an extra check of *current-user-id*

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-02-17 21:39:40 +00:00
github-automation-metabase
4bb6b28e54 feat(sdk): pro license setup in cli defaults to false (#53655) (#53685)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-17 21:11:30 +00:00
github-automation-metabase
f26393179e feat(sdk): add Next.js compatibility to embedding cli (#50281) (#53691)
* check if the project is a nextjs project

* add nextjs imports and exports for nextjs projects

* add comments

* add notice on analytics.css and link to guide

* fix typo

* update snippet

* normalize path

* quote import path

* update generated directory

* use fileName for sampleComponents

* remove getImportSnippet

* use nextjs imports from the compatibility layer

* remove use client and export default from snippets

* fix checkIsInNextJsProject import

* add use client directive to pages with useReducer

* add suggestions on module resolution

* make import paths reasonable for next.js

* add example _app.tsx snippet

* trim snippets for Next.js

* show custom app snippets separately for next

* auto-generate custom app

* fix file extension

* do not show the react import step in nextjs

* add default root layout or app

* refine root layout generation logic

* add comments on root layout generation

* add next.js route to app and pages router

* add notes on API routes

* only generate AnalyticsPage when not using nextjs

* use writeFileSync

* create directory if it does not exist

* add messages on route created

* remove AppProps type from snippets

* inform users that a custom root layout has been added

* wait for root layout snippets to be ready

* use the correct layout file name in message

* cleanup snippet message

* highlight the layout file

* temporarily remove the moduleResolution warning

* cleanup messages helper

* cleanup exports

* cleanup analytics page snippet

* restore analytics.css

* add more info on the default provider

* fix whitespace in imports

* add a use-client directive to EmbeddingProvider

* highlight the analytics demo route

* add a sans-serif font by default

* do not show the Express server message if Express server is not there

* use glob to simplify path matching

* make analytics page snippet function pure

* make custom app snippet function pure

* add support for src directory

* add source prefix in router resolution

* trim layout snippet header and add eta

* strip the source prefix from import paths

* make src dir a constant

* add lightweight margin reset to sample analytics.css

* consistent source prefix

* parameterize the route name

* cleanup snippet whitespace



* rename to getNextJsPagesWrapperOrAppWrapperSnippet

* consolidate snippets file

* inline hasNextJsCustomAppOrRootLayout



---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-17 21:03:30 +00:00
github-automation-metabase
fdab63d90f Fix brush filters for longitudes that lie outside the normal -180 to 180 range (#53342) (#53853)
* Wrap east/west filterBounds to [-180,180] in LeafletMap.jsx

* Split filters that cross the antimerdian into two parts in update-lat-lon-filter

If the bounds cross the 180th meridian, split the filter into two parts ORed togehter. One part covering the
[west, 180] range and the other covering [-180, east].

* Add tests for bounds crossing the antimerdian

* Rename longDelta to lngDelta to conform to standard leaflet abbreviation

* Review feedback: use shorthand notation for east and west filterBounds

* Add e2e tests

* Fix existing e2e test

realMouseDown expects to have x and y coords passed in an options map.

* Use common pinMapSelectRegion test helper in new e2e tests

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-02-17 20:43:37 +00:00
github-automation-metabase
4c4d76a9ca Allow specifying a dashboard tab for DQs (#53615) (#53852)
When creating a DQ, or moving a card to a dashboard, allow specifying a
dashboard_tab_id (the tab to move it to).

Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-02-17 20:17:57 +00:00
github-automation-metabase
a136ee982d Update Readme version references and published npm version to 0.53.4 (#53850) 2025-02-17 19:36:04 +00:00
github-automation-metabase
c8f4080c04 docs: Funnel chart (#53792) (#53848)
* funnel docs

* Apply suggestions from code review



* steps

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-17 18:39:56 +00:00
github-automation-metabase
257322adb2 chore(ci): update sql server runner to ubuntu 22 (#53683) (#53754)
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-02-17 18:32:10 +00:00
github-automation-metabase
54d5df568c fix(sdk): filter out some deps that may require @types/react (#53821) (#53840)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-02-17 17:52:21 +00:00
github-automation-metabase
882e2619d3 Update model-persistence.md (#53807) (#53844)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-02-17 17:39:24 +00:00
Jeff Bruemmer
fabf6fbde2 update API docs (#53843) 2025-02-17 17:33:11 +00:00
github-automation-metabase
9642e41078 fix(sdk): handle 'personal' for collectionId when creating dashboards and in the collection browser (#53553) (#53836)
* wip logic to handle 'personal' for collectionId when creating dashboards

* unit test for useCreateDashboardApi supporting 'personal'

* add e2e test for createdashboardmodal

* collection browser support for 'personal'

* some actual decent logic

* change jest tests to use root collcetion

* fix type error in stories

* fix create dashboard modal support for root

* yeah i shouldn't have commited a .only

* self review, better docs + removed un-used type

* typo

* another step of self review: changed comments and removed useless
beforeEach

* updated docs

* Apply suggestions from code review



* re-format file after suggestions were applied from gh

* refactor(e2e): use cy.wait().then instead of let =

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-17 17:31:53 +00:00
github-automation-metabase
7523ad051c Update mustache to include docs metadata (#53832) (#53834)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-17 17:05:21 +00:00
github-automation-metabase
382d00cde6 Enable pivot tables with only pivot columns (#52864) (#53831)
* Enable pivot tables with only pivot columns

* Re-add one condition so that tests pass

* Tweak logic

* Fix logic again, and add cypress test

* Try again to fix conditional

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-02-17 15:37:15 +00:00
github-automation-metabase
002060862f Dev 344 remove flaky tag from tests that are stable (#53669) (#53820)
* add eslint rule that prevents incorrect order of helpers

* remove flaky tags and stabilize tests

Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-17 09:23:39 +00:00
github-automation-metabase
dc836dec6c Update mocha to fix dependabot issue with serialize-javascript (#53739) (#53741)
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-02-17 09:48:07 +01:00
github-automation-metabase
5c4fa8ba0e fixes offset images when dnd-ing columns in dashcards (#53112) (#53524)
* fixes offset images when dnd-ing columns in dashcards

* we should be grateful for e2e tests

* -> mantine style prop

* fix this in the sortable list while I'm at it

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-02-17 08:32:03 +00:00
github-automation-metabase
8a512e9d10 Ensure menu text hover colors correctly with inherit (#53433) (#53813)
* Ensure menu text hover colors correctly with inherit

* Remove Text component from Menu Items

Co-authored-by: Fraser <fraser@metabase.com>
2025-02-16 20:10:50 +00:00
github-automation-metabase
ebaf1fcbc9 🤖 backported "[Backend modularization] login-history module" (#53783)
* Add backport resolution script

* [Backend modularization] login-history module (#53723)

* [Backend modularization] `login-history` module

* CODEOWNERS

* Test fix

* Test fix 🔧

* Remove backport.sh

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-15 01:24:19 +00:00
github-automation-metabase
86f2ddd283 Fixing broken description column in static viz tables (#53726) (#53797)
* Fixing broken description column in static viz tables

* Fixing unit tests

Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-02-15 00:34:59 +00:00
github-automation-metabase
6536760e45 fix: add logging during connection health checks (#53781) (#53789)
* fix: add logging during connection health checks

Trying to get ahead of #52458, add logs around startup health checks

* Add log for when health check is queued

Co-authored-by: Case Nelson <case@metabase.com>
2025-02-14 22:20:21 +00:00
github-automation-metabase
48ee190e7e 🤖 backported "Cast date binning back to date in postgres" (#53697)
* Cast date binning back to date in postgres (#53499)

* Cast date binning back to date in postgres

* Remove unnecessary conversion to timestamp

* Fix existing test.

* Test that temporal columns don't change type when binned.

* Fix bucketing for postgres days

* Improve comment about casting interval addition

* Select single field in test for robustness

* Tag :to_timestamp to avoid other areas adding a type

* Whitespace

* Remove blank line at end of file

* Don't cast if type is nil.

* Add alias to native query in test

* Fix redshift

* Add missing requires in postgrest_test

---------

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-02-14 21:52:23 +00:00
github-automation-metabase
af7eac8e33 Pass temporal unit when listing quick-filter options. (#53626) (#53696)
* Pass temporal unit when listing quick-filter options.

* Use with-temporal-bucket like a gentleman

* Use lib.temporal-bucket/temporal-bucket

* Whitespace

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-02-14 21:21:45 +00:00
github-automation-metabase
574d9f2500 docs - remove duplicate entry (#53779) (#53787)
* Update other-env-vars.md

* remove dupes

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-14 21:18:19 +00:00
github-automation-metabase
716c32356d [Backend modularization] improve deps graph tooling (#53643) (#53764)
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-14 20:12:31 +00:00
github-automation-metabase
c0a1fa22ae fix missing pointer cursor on viz options action button (#53731) (#53778)
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-02-14 20:10:10 +00:00
github-automation-metabase
3c1d00bc02 [Backend modularization] session module (#53718) (#53765)
* [Backend modularization] `session` module

* Add CODEOWNERS

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-14 20:06:56 +00:00
github-automation-metabase
bddfa8a281 🤖 backported "fix: handle ambiguous snowflake connections" (#53768)
* fix: handle ambiguous snowflake connections

* fix tests that were passing in boolean

* Better normalization check for private-key-id

* Fix formatting

Co-authored-by: Case Nelson <case@metabase.com>
2025-02-14 14:25:42 -05:00
github-automation-metabase
950c60564f fix(sdk): filterout @types/react from the generated package.json (#53747) (#53773)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-02-14 18:27:46 +00:00
github-automation-metabase
785a817b30 [Backend modularization] cloud-migration module (#53578) (#53762)
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-14 17:34:30 +00:00
Case Nelson
1f2fdb7502 Manual Backport of 51948 (#53732)
* Add hostname support to BigQuery

* Fix formatting

---------

Co-authored-by: Victor Vieux <victor@joinformal.com>
2025-02-14 10:16:41 -07:00
github-automation-metabase
f7c03147dc Update esbuild to fix dependabot alert (#53740) (#53750)
* Update esbuild to fix dependabot alert

* Update esbuild in release folder

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-02-14 15:45:14 +00:00
github-automation-metabase
e347c02d2b docs - notes on db version support (#52136) (#53755)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-14 14:57:21 +00:00
github-automation-metabase
a3c0707ee9 Update elliptic to ^6.6.1 (#53738) (#53743)
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-02-14 13:40:40 +00:00
github-automation-metabase
3f6a3c55b6 add eslint rule that prevents incorrect order of helpers (#53666) (#53671)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-14 08:49:24 +00:00
github-automation-metabase
163b55ee1d [Backend modularization] tiles module (#53577) (#53721)
* [Backend modularization] `tiles` module

* Field IDs cannot be zero

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-14 01:20:34 +00:00
github-automation-metabase
0b74590e8f Do not :return-drills-for-dimensions? for column header drills (#52716) (#53728)
* Don't :return-drills-for-dimensions? for header-context-only drills

Dimensions can never have a "missing" value, i.e. (nil? value), and so none of these drills will ever apply when
called with a context built from dimension-contexts.

* Add comment with updated table for Pivot Cell clicks

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-02-14 01:04:23 +00:00
github-automation-metabase
183a1533f2 Push button to the end of the table cell (#53496) (#53725)
Co-authored-by: Fraser <fraser@metabase.com>
2025-02-13 23:23:35 +00:00
github-automation-metabase
d5ee86f0b5 🤖 backported "[Backend modularization] More pulse module cleanup" (#53715)
* Add backport resolution script

* [Backend modularization] More `pulse` module cleanup (#53579)

* [Backend modularization] `pulse` module cleanup

* Move Pulse API endpoints into `pulse` module

* Move metabase.api.alert into `pulse` module

* Fix docstring

* Move Card and Dashboard pulse-updating code into the `pulse` module

* cljfmt
# Conflicts:
#	.clj-kondo/config/modules/config.edn

* Remove backport.sh

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-13 22:21:14 +00:00
github-automation-metabase
fe7aa6d784 🤖 backported "[Backend modularization] Module linter 2.0 and other MEGA improvements" (#53641)
* Add backport resolution script

* [Backend modularization] `revisions` module (#53419)

* Revisions module

* Test fixes

* Remove legacy-metric impl

* Fix CODEOWNERS

* Cleanup

* Merge fixes
# Conflicts:
#	.clj-kondo/config.edn
#	src/metabase/api/routes.clj

* [Backend modularization] Module linter 2.0 and other MEGA improvements (#53583)

* [Backend modularization] Module linter 2.0

* Much improved linting

* Amazing module deps graph helper tools

* Remove stray println

* Sort namespaces

* Test fixes 🔧
# Conflicts:
#	.clj-kondo/src/hooks/clojure/core.clj
#	.clj-kondo/test/hooks/clojure/core_test.clj

* Use newer dev.deps-graph tool

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
Co-authored-by: Cam Saul <github@camsaul.com>
2025-02-13 21:07:51 +00:00
github-automation-metabase
bd460c4b7b Fetch permissions for all databases when looking up db permissions (#53491) (#53706)
Extracted db permission caching to a function so that it can be called on demand when we know we will need to check a lot

Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-02-13 20:07:22 +00:00
github-automation-metabase
600bd64749 Renamed cleanup-session to cleanup-session! (#53481) (#53672)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-02-13 19:52:50 +00:00
github-automation-metabase
11ac102702 String fields fetch field type info from :field_ref as well as :source_metadata (#53569) (#53636)
When wrapping literal values in :value clauses, fields with string-type ids (for example, fields after an aggregation)
were getting their type info from source-metadata.  When the field in question was a postgres enum, the source
metadata was missing important data.  Fetching info from both source-metadata and the type info of field-ref fixes
that.

Co-authored-by: William <william@metabase.com>
2025-02-13 18:53:29 +00:00
github-automation-metabase
14a77d063a docs - md links (#53606) (#53698)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-13 17:32:09 +00:00
github-automation-metabase
6842a69cfa fix: allow update last_used_at in read-only mode (#53633) (#53694)
* fix: allow update last_used_at in read-only mode

* fixup! use temporary settings helper

* fixup! kondo

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-02-13 17:12:55 +00:00
github-automation-metabase
e8e9fffba9 feat(sdk): add the instance url to the cli's login json file (#53469) (#53677)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-13 15:54:48 +00:00
github-automation-metabase
6e9ab88eea feat(sdk): abort cli with message when react version is unsupported (#53656) (#53674)
* improve unsupported react version message

* do not allow continuing when React version is unsupported

* updated sample url to nextjs

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-13 15:48:48 +00:00
github-automation-metabase
b2a744afd0 Fix - Frozen UI after viewing a table with missing fields in the metadata browser (#53600) (#53670)
* Add repro for #53194

* Add comments

* Fix typos

* Fix #53194

* Fix test

* Abandon ref approach, instead make sure that hook deps don't change on every render (tableId)

* Drop use-safe-async-function

* Revert changes to fix tests

* Revert

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-02-13 15:23:03 +00:00
github-automation-metabase
c0b5736862 Speed up SDK build (#53537) (#53662)
* Speed up SDK build

* Update package.json



* Update yarn.lock since package.json changed

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-02-13 15:05:01 +00:00
github-automation-metabase
061d7db245 Fix no-unused-vars ESLint rule config (#53648) (#53653)
* Fix no-unused-vars config by adding sole underscore checks

* Fix unused underscores

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-02-13 11:37:20 +00:00
github-automation-metabase
63e075773b Fix - Field tooltip text overflowing in filter modal (#53045) (#53646)
* Fix #50731

* Revert first fix as design team said there's a better way

* Remove HackyInvisibleTargetFiller

* Use max-width instead of width to prevent overflow if there's less than 300px available

* Add a repro for #50731

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-02-13 08:12:53 +00:00
github-automation-metabase
804b5ad8fd Upgrade to NodeJs 22 (#53446) (#53477)
* update to node 22

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-02-12 17:13:28 -07:00
github-automation-metabase
3a19c27013 Revert discarding-rff for preemptive caching (#53631) (#53634)
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-02-12 22:48:43 +00:00
github-automation-metabase
3bf004720f update rerun job to work with new master test workflow (#53635) (#53637)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-02-12 21:39:45 +00:00
github-automation-metabase
2225f9ab14 Smooth out some rough edges for local e2e tests (#53576) (#53618)
* smooth out some rough edges for local e2e tests

* note for the normies

* remove premium embedding token

* add note about h2 app db

* update config file stuff

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-02-12 21:31:36 +00:00
github-automation-metabase
dca0d33efb Adjust Smoke Tests (#53542) (#53625)
* run all smoke tests on OSS tests regularly

* skip certain smoke tests for oss v EE

* or not and

* union

* update prerelease tests

* run smoke tests on OSS except EE

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-02-12 20:17:20 +00:00
github-automation-metabase
3b65c9e963 docs - note on questions into models (#53620) (#53622)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-12 19:04:52 +00:00
github-automation-metabase
9af73acecc fix: return 204 on nonpersisted card unpersist (#53554) (#53614)
changes API behaviour to give us a 204 instead of 404 status code when
calling unpersist on a card that does not have a persistedinfo model

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-02-12 19:03:06 +00:00
github-automation-metabase
8dc140dd7c docs: usage analytics when upgrading (#53619) (#53621)
* Update usage-analytics.md

* Update docs/usage-and-performance-tools/usage-analytics.md



---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-12 18:39:04 +00:00
github-automation-metabase
151e48687e 🤖 backported "[Dashboards] Prevent duplicate edit dashboard calls from breaking dashboard save" (#53306)
* [Dashboards] Prevent duplicate edit dashboard calls from breaking dashboard save (#53132)

* prevent duplicated SET_EDITING_DASHBOARD dispatches from overriding edit dashboard state if the editing dashboard is the same dashboard

* small improvements

* add test coverage

* impl pr feedback

* remove usage of helper that is not available in backport branch

---------

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
2025-02-12 18:38:41 +00:00
github-automation-metabase
d1b593c771 Update activating-the-enterprise-edition.md (#53613) (#53616)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-02-12 17:34:30 +00:00
github-automation-metabase
b98ba7aaeb Fix typos and add tests (#53449) (#53608)
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-02-12 17:16:18 +00:00
github-automation-metabase
42ba82e8f5 Fix min extent histogram (#52932) (#53066)
* Fix normalized stacked histogram minimum extent #48021

* Adjusting technique for respecting min/max y axis extents in normalized stacked charts

* Fixing stackType? and adjusting comment

* Adding new visual story test

* Update Loki Snapshots

* Update Loki Snapshots

* Updating loki reference after flake

---------

Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-02-12 07:56:19 -08:00
github-automation-metabase
d650a108f9 Convert Postgres array columns to vectors (#53151) (#53565)
* convert pgarray to java array

* convert array to vector early

* add test and todo comment

* fix whitespace

* add tests for caching and emailing

* whitespace

* use feature and test other drivers

* update test names

* deduplicate native array methods

* remove vertica

* remove http from array agg test

* remove let

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-02-12 15:15:09 +00:00
github-automation-metabase
46aa224107 Update link (#53603) (#53605)
Co-authored-by: Gustavo Saiani <gus@metabase.com>
2025-02-12 14:45:27 +00:00
github-automation-metabase
83742804de an attempt te reduce the spam in the dev console (#53214) (#53516)
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-02-12 09:52:59 +00:00
github-automation-metabase
3cbb80301b fix: correct layout for duplicate modal when question name is long (#53363) (#53523)
* fix: correct layout for duplicate modal when question name is long

* Update e2e/test/scenarios/question/saved.cy.spec.js



* Update e2e/test/scenarios/question/saved.cy.spec.js



* address review

* address review

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-02-12 07:53:40 +00:00
github-automation-metabase
22462722c8 🤖 backported "[Backend modularization] segments module" (#53574)
* Add backport resolution script

* [Backend modularization] `segments` module (#53559)

* Remove backport.sh

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-12 01:12:58 +00:00
github-automation-metabase
2564b03af9 [Backend modularization] indexed-entities module (#53563) (#53575)
* [Backend modularization] `indexed-entities` module

* Fix CODEOWNERS

* Update .github/CODEOWNERS



---------

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
Co-authored-by: bryan <bryan.maass@gmail.com>
2025-02-12 00:44:39 +00:00
github-automation-metabase
61d86da134 🤖 backported "[Backend modularization] Actions module cleanup" (#53507)
* Add backport resolution script

* Actions module cleanup (#53424)

* Actions module cleanup

* Sort namespaces
# Conflicts:
#	test/metabase/driver/postgres_test.clj

* Remove backport.sh

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-11 23:22:13 +00:00
github-automation-metabase
423d10958d 🤖 backported "[Backend modularization] revisions module" (#53512)
* Add backport resolution script

* Remove backport.sh

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <github@camsaul.com>
2025-02-11 22:59:03 +00:00
github-automation-metabase
5539219cb9 param->fields looks through filterable columns (#53379) (#53461)
When fetching a param's possible values, we were originally looking for concrete columns and checking result metadata.
However, if the query is against a model and has an aggregation, the thing you are filtering on isn't a concrete field
and probably isn't in result metadata.  Checking filterable-columns lets us find the appropriate field in that case.  The practical result is that we actually find remapped values for a param when it is linked to an aggregated query against a model.

Co-authored-by: William <william@metabase.com>
2025-02-11 22:02:12 +00:00
github-automation-metabase
5fe02f1a9b Perf & correctness fixes for preemptive caching (#53328) (#53562)
* Two potential performance fixes for preemptive caching

* Test fixing, cleanup

* Address feedback

* Update cache.clj



* Fix tests + update function name

---------

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-02-11 21:39:50 +00:00
github-automation-metabase
8449a05425 🤖 backported "[Backend modularization] More xrays module cleanup" (#53560)
* Add backport resolution script

* [Backend modularization] More `xrays` module cleanup (#53426)

* [Backend modularization] More `xrays` module cleanup

* Rename test namespaces

* Sort namespaces

* Test fixes 🔧
# Conflicts:
#	.clj-kondo/config.edn

* Remove backport.sh

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-11 21:32:06 +00:00
github-automation-metabase
57fd127f8d [Backend modularization] activity-feed module (#53427) (#53506)
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-11 20:54:13 +00:00
github-automation-metabase
fe9dd26d34 [Backend modularization] Bookmarks module (#53417) (#53505)
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-11 20:46:28 +00:00
github-automation-metabase
96d10ae453 update timings on specs (#53356) (#53459)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-11 19:37:37 +00:00
Jeff Bruemmer
bb7ac65193 docs - env var and config template (#53555) 2025-02-11 19:36:44 +00:00
github-automation-metabase
6470e66a8a fix: allow using long name in save question modal (#53232) (#53552)
* fix: allow using long name in save question modal

* fixup

* adjust styles

* fix e2e test

* fix selector

* fix test

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-02-11 18:20:26 +00:00
github-automation-metabase
1a31e2abdb model details (#53549) (#53550)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-11 17:51:36 +00:00
github-automation-metabase
b6da2535f8 docs - dashboard duplication note (#53546) (#53547)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-11 16:52:05 +00:00
github-automation-metabase
918b27167c docs - Entity IDs for interactive embedding (#52992) (#53543)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-11 16:03:55 +00:00
github-automation-metabase
24bc4db285 Check cycles on PUT to /card/:id (#53373) (#53456)
* Check cycles on PUT to /card/:id

* Remove extra protection from saving cycles.

* cljfmt

* kondo

* Better threading

* Cleaner tests

* Fix test

* Better naming in metabase.api.card/dataset-query->query

* Rename `dataset-query` arg to `dq-fragment`.

* Normalize query on backend.

* Throw exceptions with user messages.

Also rework `dataset-query->query`.

* Unshadow card-type in doseq

* Make consistent use of query/dataset-query

* Remove normalization from lib.query

* Don't shadow `query`.

* Rename `dq-fragment` to `query-fragment`

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-02-11 15:40:39 +00:00
github-automation-metabase
24f0e2e004 fix test flake (#53530) (#53534)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-11 14:08:23 +00:00
github-automation-metabase
f24dc49a81 fix test flake (#53519) (#53529)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-11 12:50:21 +00:00
Romeo Van Snick
7daaaf2631 Remove color for ace identifier token (#53479) 2025-02-11 11:40:16 +00:00
github-automation-metabase
adb8733cfe add new script to stress test workflow file (#53522) (#53525)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-11 11:23:45 +00:00
github-automation-metabase
440914eb58 feat(sdk): show clarification messages upon running the cli (#53471) (#53514)
* add clarification message to the cli

* update cli startup message



* line-wrap the cli startup message

* use metaba.se/sdk for docs link

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-11 11:14:21 +00:00
github-automation-metabase
2dbe5ab801 reset title to default now reflects reality (#53121) (#53517)
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-02-11 09:56:45 +00:00
github-automation-metabase
7d79c7817f Improve type clarity (#53444) (#53508)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-11 07:00:48 +00:00
github-automation-metabase
48a9de8ae2 fix(sdk): dashboard not found when switching dashboards in cli (#53452) (#53467)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-11 03:42:14 +00:00
github-automation-metabase
b4a61a9ff7 fix(sdk): make headers in generated cli components responsive (#53455) (#53457)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-11 03:41:53 +00:00
github-automation-metabase
db90245faf 🤖 backported "[Backend modularization] user-key-value module" (#53474)
* Add backport resolution script

* [Backend modularization] `user-key-value` module (#53416)

* Remove backport.sh

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-10 19:06:18 -08:00
Ryan Laurie
b79df9d426 docs - update env var doc strings (#53268) (#53501)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-11 00:30:20 +00:00
Ryan Laurie
a045d2d935 Don't cache query results for impersonated users (#53489) (#53502)
Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-02-11 00:18:23 +00:00
github-automation-metabase
3dc5ffd0e8 Fix multi-arch uberjar preview builds (#52897) (#53482)
* Remove silent flag and re-enable multi-arch build

Check what's going on here

* test code

* fix test code

* Update Dockerfile_ubuntu

Fixes the multi-arch build

* Update Dockerfile_ubuntu

Have a feeling that the ca-certificates-java is making a mess here

* Update uberjar.yml

Add the logging to the process

* Update Dockerfile_ubuntu

* Update uberjar.yml

* Update run_metabase.sh

ensure the path lives with the user

* Update uberjar.yml

Alpine 21 is multi-arch, we should have that as well in the build script along ubuntu

* Update uberjar.yml

push explicitly all platforms

* Update uberjar.yml

Update actions to see if platform flag works

* Update uberjar.yml

This should push the multi-arch images without building again 🤞🏻

* Update uberjar.yml

return to old versions, just to keep stuff more consistent

* Update uberjar.yml

fix typo

* remove test code

---------

Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-02-10 21:49:49 +00:00
github-automation-metabase
4c97606679 Streamline local e2e test running (#53095) (#53478)
* WIP - lots of streamlining

* revert dotenv addition

* ci fix

* some fixes

* make component testing work

* set some default ports

* fix component test ci

* fix all the e2e tests

* fix the other sdk tests

* update e2e docs

* fix embedding more

* fix tagged tests

* documentation

* split user and derived options

* better exit behavior

* more error handling

* revert saml change

* ❤️ typescript and booleans

* fix some stuff

* fixes

* stupid lockfile

* maybe keep the lockfile

* remove unnecessary diff
# Conflicts:
#	package.json

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-02-10 14:20:32 -07:00
github-automation-metabase
573a772293 Limit last-id queries in SQL to improve performance (#53088) (#53484)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-02-10 19:57:23 +00:00
github-automation-metabase
393ae5df9f remove flaking legacy tooltips from visual tests (#53448) (#53465)
* remove flaking legacy tooltips from visual tests

* update snapshots, remove legacy tooltip and popover stories

Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-02-10 19:43:26 +00:00
github-automation-metabase
9724ffac35 [CI] Fix flaky dashboard tab test v2 (#53327) (#53475)
* flaky test fix v2

* add flaky prevention measure

---------

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-10 18:17:41 +00:00
github-automation-metabase
5c43cdda9c fix(sdk): better scope for SCOPED_CSS_RESET to fix transparent (#53443) (#53462)
background on buttons

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-02-10 16:47:37 +00:00
Jeff Bruemmer
c720f49ac1 docs - api redirects (#53454) 2025-02-10 16:43:08 +00:00
github-automation-metabase
f27faa6b48 fix: make switcher position stable (#53402) (#53435)
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-02-10 12:20:29 +00:00
github-automation-metabase
46787cade6 fix(sdk): Fix question not found error showing briefly after navigating from dashboards (#53284) (#53366)
* Fix question not found error showing after navigating from dashboards

* Add interactive dashboard tests

* Add editable dashboard tests

* Fix failed tests

* Add an assertion to ensure we display ad-hoc question

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-10 11:41:11 +00:00
github-automation-metabase
9b6e0fb82f fix(sdk): Clean up and enhance InteractiveQuestion docs (#53283) (#53420)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-02-10 10:45:17 +00:00
Nicolò Pretto
ee19d6c5e0 chore: remove embedding team from codeowners on the release branch (#53368)
* chore: remove embedding team from codeowners on the release branch
this was triggering reviews for automated backports that are
auto-approved by the bot

* remove some more references
2025-02-10 10:40:19 +01:00
github-automation-metabase
f380b9c48c 🤖 backported "fix invalid pivot table columns in click behavior" (#53311)
* fix invalid pivot table columns in click behavior (#53013)

* fix invalid pivot table columns in click behavior

* spec

* Update Loki Snapshots

* loki

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2025-02-10 03:31:47 +00:00
github-automation-metabase
d982e9b3f4 [Backend modularization] timelines module (#53391) (#53425)
* `timelines` module

* Move some render-related timeline stuff into the timeline module

* Remove unused /api/card/:id/timelines endpoint

* PR feedback and test fixes 🔧

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-08 04:18:01 +00:00
github-automation-metabase
674db9ccfd Update Readme version references and published npm version to 0.53.3 (#53421) 2025-02-08 02:58:51 +00:00
Jeff Bruemmer
50e68704f8 docs - api, env var, and config updates (#53406) 2025-02-07 16:23:20 -05:00
github-automation-metabase
27393e6fec docs - various edits (#53382) (#53403)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-07 20:53:41 +00:00
Jeff Bruemmer
4baabb8886 docs - 53.1 env vars (#53265) 2025-02-07 20:51:17 +00:00
github-automation-metabase
b70fbbf6e9 docs: note about marketplaces (#53395) (#53399)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-02-07 20:19:00 +00:00
github-automation-metabase
7e8128f9ed docs: 53 edits (#53383) (#53398)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-02-07 20:17:52 +00:00
github-automation-metabase
e2193b6053 Flag the site url requirement (#53301) (#53385)
Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-07 18:13:16 +00:00
github-automation-metabase
82e18e17c6 docs: druid basic auth (#53380) (#53384)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-02-07 18:07:37 +00:00
github-automation-metabase
1070af6d0e chore(sdk): make FlexibleSizeComponent private (#53304) (#53318)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-02-07 16:51:25 +00:00
github-automation-metabase
71e3d897b6 remove all instances of describeEE, onlyOnEE and onlyOnOSS (#53240) (#53355)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-07 16:49:37 +00:00
github-automation-metabase
d5f5d1aaa9 Added Session Cleanup Job (#53246) (#53375)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-02-07 16:20:26 +00:00
github-automation-metabase
f81bfc58a8 One parent test job + run it on draft PRs (#53258) (#53350) 2025-02-07 08:13:27 -07:00
github-automation-metabase
f8c0c8f336 Log name of missing class when implicitly deleting job (#53357) (#53362)
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2025-02-07 12:11:41 +00:00
github-automation-metabase
82cb302e80 Fix search for queries with single backslashes (#53296) (#53358)
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2025-02-07 11:20:54 +00:00
github-automation-metabase
a4787998ba no more super tiny remove button for condition rules (#53295) (#53308)
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-02-07 08:33:24 +00:00
github-automation-metabase
8c457edb5d 🤖 backported "[Backend modularization] More search module cleanup" (#53291)
* Add backport resolution script

* [Backend modularization] More search module cleanup (#53269)

* [Backend modularization] Search module cleanup

* Sort namespaces

* Remove backport

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-07 02:30:53 +00:00
github-automation-metabase
133343a0e4 🤖 backported "[Backend modularization] permissions module" (#53098)
* Add backport resolution script

* [Backend modularization] `permissions` module (#52868)

* Squash

* Add missing API namespace

* Well moving the tests seemed to fix stuff

* Test fix 🔧

* Remove backport.sh

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-06 17:47:35 -08:00
github-automation-metabase
2fd11184d0 paste instead of type saml key (#53303) (#53352)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-02-07 01:19:13 +00:00
github-automation-metabase
29dcbb1ca9 🤖 backported "Add custom linter to make sure requires are on newlines" (#53282)
* Add backport resolution script

* [Backend modularization] `permissions` module (#52868)

* Squash

* Add missing API namespace

* Well moving the tests seemed to fix stuff

* Test fix 🔧

* Remove backport.sh

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-07 00:09:30 +00:00
github-automation-metabase
629be58a5b rename enable embedding sdk alignment migration id (#53339) (#53347)
* rename enable embedding sdk alignment migration id

* changeset ids must be in order

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-02-07 00:04:01 +00:00
github-automation-metabase
73e264a1d1 Allow disabling reading a setting from env vars (#53330) (#53340)
Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-02-06 23:08:28 +00:00
github-automation-metabase
17ea3044c5 🤖 backported "OpenAPI dox generation part 2" (#53011)
* OpenAPI dox generation part 2

* Fix docstring

* metabase.billing.billing => metabase.billing.api

* Fix dox generation code fr fr

* Revert changes to dox for now

* Remove define-routes

* Fix missing routes

* Fix even more missing routes

* Third time's a charm

* Remove extra newlines at end of file

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-06 15:05:26 -08:00
github-automation-metabase
e8d5b8bfe8 🤖 backported "CI driver job tweaks" (#53017)
* CI driver job tweaks

* SQL Server timeout after 30 minutes

* Ok maybe don't make the matrix fail-fast

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-06 15:04:45 -08:00
github-automation-metabase
43bdde7a53 Don't document SDK embed terms switch (#53316) (#53333)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-02-06 21:32:40 +00:00
github-automation-metabase
591d61f32b update enable-embedding-sdk based on embedding-app-origins-sdk (#53263) (#53331)
* update enable-embedding-sdk based on embedding-app-origins-sdk

|enable-embedding-sdk key exists? | then we:
|---------------------------------|---------
|false                            | no-op
|true                             | set enable-embedding-sdk to true when `embedding-app-origins-sdk` exists

* actually need to set it to false when embedding-app-origins-sdk dne

* reformat liquibase migration

* make the query run on h2, too

* per-db sql + update comment

* use preconditions to simplify update sql

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-02-06 20:55:32 +00:00
github-automation-metabase
c6cd8e4021 fix(sdk): Remove ExplicitSize findDOMNode console errors (#52253) (#52994)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-02-06 12:11:14 -08:00
github-automation-metabase
eb0c2b231e Add tests for file downloads from the public link sharing popover (#52779) (#53010)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-02-06 12:10:47 -08:00
github-automation-metabase
9105a01c0c add visibility check before saving dashboard (#53292) (#53329)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-06 19:59:01 +00:00
github-automation-metabase
f5ebacbdbe fix (ci): Set longer timeout to ensure we get a successful connection attempt (#53312) (#53320)
Co-authored-by: Case Nelson <case@metabase.com>
2025-02-06 18:00:49 +00:00
github-automation-metabase
dcf507b631 Drop from sdk legalese copy (#53315) (#53322)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-02-06 17:51:59 +00:00
github-automation-metabase
77cbab87ce Type mbql required features (#53293) (#53317)
* Type requiredFeatures as DatabaseFeature

* Add missing database features from MBQL

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-02-06 18:35:42 +01:00
github-automation-metabase
5e9c53543b Fix breakout by drill through context menu for multi-stage queries (#52925) (#53145)
* Add pivot-drill-details

Similar to filter-drill-details and combine-columm-drill-details.

pivot-drill-details returns the info needed by FE to render the pivot drill popover UI.

* Merge pivot-types into pivot-drill-details

* Add e2e test

* Revert unintentional whitespace change

* Re-enable Breakout by e2e test

* Re-enable multi-stage pivot drill tests

* Add pivot drill test for query with explict join

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-02-06 17:23:57 +00:00
github-automation-metabase
306086f723 flaky tab test (#53309) (#53314)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-02-06 17:01:34 +00:00
github-automation-metabase
99668cdc4b unmark tests as flaky (#53298) (#53305)
* unmark as flaky: should not reload the model for record in the same model

* unmark as flaky: scenarios > search should allow users to paginate results

* unmark as flaky: scenarios > model indexes should be able to see details of a record outside the first 2000

* unmark as flaky: should be able to search model index values and visit detail records

Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-06 15:39:03 +00:00
github-automation-metabase
0b9d891169 remove unused labeled trigger for backend tests (#53235) (#53278)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-02-06 14:52:15 +00:00
github-automation-metabase
e85634c6cb Dashcard titles no longer interactive when editing the dashboard (#53168) (#53287)
* dashcard titles no longer interactive when editing the dashboard

* added test

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-02-06 13:03:47 +00:00
github-automation-metabase
db4364739c convert header breadcrumbs components to typescript (#53110) (#53177)
* convert header breadcrumbs components to typescript

* fix breadcrumbs

* tweaks

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-02-06 11:49:34 +00:00
github-automation-metabase
516d20216d fix(sdk): fix minWidth console error in dashboard grid (#52880) (#53126)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-06 11:20:50 +00:00
github-automation-metabase
04b6cb59bd viz settings tabs don't scroll anymore, only the content does (#53178) (#53285)
* viz settings tabs don't scroll anymore, only the content does

* e2e

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-02-06 09:37:34 +00:00
github-automation-metabase
d4b1e20376 Fix ultra wide tooltips (closes #52199) (#52455) (#52871)
* fix ultra wide tooltips (closes #52199)

* all tooltips wrap now, and better test

* sturdier test

* use setup() in test case

* removed unncessary code path

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-02-06 07:47:30 +00:00
github-automation-metabase
887283071f Don't infer join aliases when replacing a join (#53081) (#53211)
When replacing a join, we were taking a valid join (with a correctly set up join alias), dropping the alias, creating
a new alias, and then inferring which fields belonged to the new alias.  This caused issues when joining models using
a field that could plausibly belong to either model, because we inferred that the lhs join condition belonged to the
rhs model.  This in turn confused the join naming code and caused us to refer to the lhs as "previous results" instead
of the correct table name.

With the new code, if we want to rename the new join, we explicitly replace the old alias with the new alias instead
of just removing the new alias and inferring what goes with what.  This avoids potentially incorrect inferences and
fixes this issue (and possibly others?).

Co-authored-by: William <william@metabase.com>
2025-02-06 07:08:25 +00:00
github-automation-metabase
d051b26fb2 add estimated size to Search Results virtual list in entity picker (#53226) (#53279)
Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-02-06 01:05:46 +00:00
github-automation-metabase
2d20aed32b Add legacy handling for snowflake password (#53181) (#53276)
Co-authored-by: Case Nelson <case@metabase.com>
2025-02-06 00:32:46 +00:00
github-automation-metabase
10c744f805 Update Translations for v53 (#52775) (#53271)
* Add new strings for v53

* Update translations

* Update translations

* kick ci

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-02-05 23:10:44 +00:00
github-automation-metabase
81c565fe7c docs - note on upgrading to pro (#51585) (#53274)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-02-05 23:03:55 +00:00
github-automation-metabase
7bf428a001 🤖 backported "[Dashboards] Mark dashboard as dirty if tabs are edited" (#53254)
* [Dashboards] Mark dashboard as dirty if tabs are edited (#53204)

* make dashboard dirty if tabs are edited and add test coverage for leaving dashboard after editing a dashboard or its tabs

* handle rename tab, add rename tab test coverage, simplify test coverage

* makes ci ts happy

* clean up test a bit

* rename helper

* fixes unnoticed race condition in dashboard tab test (#53267)

---------

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-02-05 22:55:34 +00:00
github-automation-metabase
672a8a6ba4 Fix quick filter drill for trend charts (#53135) (#53249)
* Return column corresponding to aggregation value in SmartScalar getCurrentMetricData

Closes #46168

The returned clicked object had the `value` from the aggregation cell, but the `column` from the date dimension, which
breaks the quick filter drill (and probably others).

Instead, return the `column` that corresponds to the `value`.

* Add e2e test for smartscalar quick filter drill

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-02-05 22:49:27 +00:00
github-automation-metabase
071007f57f Fix use of offset with external remapping (#53118) (#53260)
* Fix use of offset with external remapping

* whitespace

* Address review remarks

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-02-05 20:21:00 +00:00
github-automation-metabase
997c67a314 Check connectivity on startup (#52934) (#53140)
* Check connectivity on startup

* Fix format and kondo and some tests

* Allow h2 connection testing

* Address review

* Fix cyclic dependency, don't care about checking sample db

* Fix kondo/fmt

* Fix another cyclic dep

* Fix macro

* Fix kondo

* Fix h2, check is_sample is_audit

Co-authored-by: Case Nelson <case@metabase.com>
2025-02-05 18:19:44 +00:00
github-automation-metabase
e26330a49f lets see how many things break in ci (#53107) (#53227)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-02-05 17:23:03 +00:00
github-automation-metabase
a1d9f916dd mark additional tests as flaky (#53243) (#53245)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-05 16:58:13 +00:00
github-automation-metabase
e7e962e219 mark browse metrics flakes as flaky (#53176) (#53185)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-02-05 16:48:53 +00:00
github-automation-metabase
609afc4acf Fix search index update job restart issue (#53229) (#53242)
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2025-02-05 16:22:22 +00:00
github-automation-metabase
42be2aaa4a fix(sdk): remove unsafe lifecycle errors from DashboardGrid (#53213) (#53238)
* remove unsafe lifecycles from visualization component

* add e2e tests

* remove extra comma in test helpers

* only run tests under strict mode when a flag is passed

* extract console assertion to a test helper

* update tests for known console errors

* swap new and previous props

* combine old state for transform props to state

* combine initial state

* use getDerivedStateFromProps to fix failures

* only store a subset of lastProps to compare

* remove timeline events check from getDerivedStateFromProps

* reset state when timeline events changed

* get rid of mutation in strict mode

* remove existing state spread from state updates



* remove deriveStateFromProps from constructor

* use sdkProviderProps to pass provider props

* replace UNSAFE_componentWillReceiveProps with getDerivedStateFromProps

* add unsafe lifecycle check for DashboardGrid

* lastProps is already part of DashboardGrid state

* optional chain state.initialCardSizes

* remove state comparison logic

* fix misleading hasVisibleDashcardsChanged condition

* fix editor issue

* remove unused dashcardData from lastProps

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-05 16:11:06 +00:00
github-automation-metabase
8997b4890a Add legalese modal to present SDK terms (#53139) (#53233)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-02-05 15:58:04 +00:00
github-automation-metabase
039e423ddb fix: allow replacing a question with a long name (#53217) (#53230)
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-02-05 15:52:12 +00:00
Chris Truter
b7a7afe7fa Keep old Search Engine for 53 gold release (#53162)
* Default to old search engine for Gold release
* Use new search in e2e
* use env vars in backend process

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-02-05 15:39:44 +00:00
github-automation-metabase
df86367fd2 disable video recording on snapshots and delete videos on successful tests (#53169) (#53223)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-05 14:40:04 +00:00
github-automation-metabase
f4b1c6e7ad Update Readme version references and published npm version to 0.53.2 (#53224) 2025-02-05 14:22:53 +00:00
github-automation-metabase
d0341b46ac fix(sdk): remove unsafe lifecycle errors from Visualization (#52885) (#53221)
* remove unsafe lifecycles from visualization component

* add e2e tests

* remove extra comma in test helpers

* only run tests under strict mode when a flag is passed

* extract console assertion to a test helper

* update tests for known console errors

* swap new and previous props

* combine old state for transform props to state

* combine initial state

* use getDerivedStateFromProps to fix failures

* only store a subset of lastProps to compare

* remove timeline events check from getDerivedStateFromProps

* reset state when timeline events changed

* get rid of mutation in strict mode

* remove existing state spread from state updates



* remove deriveStateFromProps from constructor

* use sdkProviderProps to pass provider props

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-05 14:15:06 +00:00
github-automation-metabase
a078799f6a better interactivity check for opening sidebar (#52539) (#53219)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-02-05 12:47:04 +00:00
github-automation-metabase
55eb0f4344 fix(sdk): remove error about stageIndex prop being passed to dom element (#53165) (#53212)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-02-05 10:29:44 +00:00
github-automation-metabase
1c3113141b feat(sdk): apply theming to interactive question modules (#52513) (#53164)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-05 09:18:28 +00:00
github-automation-metabase
00c273908e Add e2e tests checking high-visibility pages in top locales (#53203) (#53206)
Last year we had a P1 where a high-visibility page in Brazilian Portuguese was broken. Let's add some basic e2e tests that check high-visibility admin/webapp pages (accessible in one click from the homepage) in our most popular locales.

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2025-02-05 04:13:12 +00:00
github-automation-metabase
87eb61ae83 Fix all-indexes->field-ids generating queries with too many parameters (#52835) (#53072)
* partition indexes and use separate queries

* test no exception thrown

* improve helper func name

* improve test

* remove test debugging

* address pr comments

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-02-04 23:17:03 +00:00
github-automation-metabase
3e9c577f6b docs: in clarification (#53182) (#53200)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-02-04 22:22:59 +00:00
github-automation-metabase
1fcee87dc1 fixed logo to support opacity and color props. looks correct in admin… (#53167) (#53196)
* fixed logo to support opacity and color props. looks correct in admin app now

* adding back fill=currentColor

Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-02-04 21:46:42 +00:00
github-automation-metabase
00afd29a94 Fix home page Metabot spacing on large screens (#52916) (#53188)
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-02-04 20:22:44 +00:00
github-automation-metabase
caece0d184 fix(sdk): echarts tooltip is cut off below the viewport height (#52822) (#53191)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-04 19:14:34 +00:00
github-automation-metabase
3640d2d47f Close CSV upload modal on escape press (#52913) (#53189)
* close csv upload on escape

* fix unit test

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-02-04 18:56:57 +00:00
github-automation-metabase
c187f54635 [Cards in Dashboards] Trash UI when removing last dashcard for a dashboard question (#52781) (#53187)
* update ui to show trash icon, tooltip, and undo message if the dashcard being removed is the last dashcard for a dashboard question

* add e2e test, fix types

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-02-04 18:52:23 +00:00
github-automation-metabase
621b12bb94 Update SDK usage wording (#53105) (#53163)
* Update authentication.md

* Fix formatting in * below table

Co-authored-by: Alberto Perdomo <albertoperdomo@users.noreply.github.com>
2025-02-04 13:24:47 +00:00
github-automation-metabase
264a4a42c8 ensure that the link abstracted from element is not empty (#53160) (#53161)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-04 13:11:09 +00:00
github-automation-metabase
6cb0d22474 Support not specifying is_group_manager in /api/user calls on Pro (#52977) (#53147)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-02-04 00:09:11 +00:00
github-automation-metabase
89df04d705 Order the query in expression-using-aggregation-test (#53093) (#53146)
* order query in test

* sort instead of order for h2

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-02-03 23:18:35 +00:00
github-automation-metabase
43a527567d Recognize year-of-era (#52930) (#53074)
Year of era aggregations weren't working because our legacy malli schema didnt recognize it as a valid temporal unit.
Adding it to the schema makes it work.

Co-authored-by: William <william@metabase.com>
2025-02-03 22:00:17 +00:00
github-automation-metabase
758c598dd7 Elide data in task_history.details which can get very large (#53002) (#53136)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-02-03 21:10:33 +00:00
github-automation-metabase
e1fbcbd705 🤖 backported "Don't cast dates when doing a dateadd on h2" (#53060)
* Don't cast dates when doing a dateadd on h2 (#52928)

* Don't cast dates when doing a dateadd.

* Add test for date binned by week

* kick ci

---------

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-02-03 19:35:48 +00:00
github-automation-metabase
d35c021e08 Symbol for swedish krona is "kr" not "Skr" (#52921) (#53123)
Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-02-03 16:38:34 +00:00
github-automation-metabase
dfbb83b75e fix(entity-id): show 404 for entity id that starts with digits (#52896) (#53108)
* fix(entity-id): show 404 for entity id that starts with digits

* simplify logic by removing support for sequential ids with slugs for the
tab

* clean up the tests and rename things

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-02-03 15:47:30 +00:00
github-automation-metabase
d177d8da67 ci: find css variables that are used but never defined (#52910) (#53047)
* ci: find css variables that are used but never defined

* only search in frontend and enterprise/frontend

* Update bin/find-never-defined-css-variables/find-never-defined-css-variables.ts



* test: checks that it doesn't confuse definitions with usages

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-03 15:37:18 +00:00
github-automation-metabase
9a2e9c7e7f Stop drilling down past day in DateType (#52869) (#52929)
* Stop drilling down past day in DateType

* Distinguish date and datetime drill-down

* Rename local and add comment

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-02-03 15:32:51 +00:00
github-automation-metabase
f1fe62d7d1 🤖 backported "Dont run redshift upload tests on PRs" (#53113)
* Dont run redshift upload tests on PRs (#53094)

* dont run redshift upload tests on PRs

* kick ci

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-02-03 15:16:11 +00:00
github-automation-metabase
0cd6bbdb92 stabilize flaky tests (#53106) (#53109)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-03 13:22:29 +00:00
github-automation-metabase
e8c5c0962c Proper title for cards when visualization is in error (#52680) (#53103)
* proper title for cards when viz in error

* addressed PR feedback

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-02-03 06:54:57 +00:00
github-automation-metabase
40236b296f [csv-export] Follow-up optimizations to CSV pivotted export (#52810) (#53101)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-02-02 09:24:38 +00:00
github-automation-metabase
5427a9c5ce Filter personal recent dashboards for the "Add to Dashboard" modal (#52927) (#53057)
* Filter personal recent dashboards for the "Add to Dashboard" modal

* e2e adjustment

Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-01-31 22:26:09 +00:00
github-automation-metabase
e0afc360f6 fix row chart font in pdf exports (#53052) (#53063)
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-01-31 22:11:13 +00:00
github-automation-metabase
39a12cf402 Update week.md (#53090) (#53091)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-01-31 22:03:42 +00:00
github-automation-metabase
fea202b78e Update connecting.md (#53087) (#53089)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-31 21:59:35 +00:00
github-automation-metabase
d0a7d6fd1b docs - various link fixes (#53084) (#53086)
* link

* another link

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-31 21:53:41 +00:00
github-automation-metabase
adb0bd65c9 docs: percentile in usage analytics (#53078) (#53082)
* docs: percentile in usage analytics

* Update docs/usage-and-performance-tools/usage-analytics.md



---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-31 21:38:45 +00:00
github-automation-metabase
bb9561b6fc 🤖 backported "allow numeric category columns to be considered as number columns" (#53016)
* allow numeric category columns to be considered as number columns (#52718)

* Update Loki Snapshots

* loki

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2025-01-31 16:00:48 -05:00
github-automation-metabase
cb387d1e64 docs: add pics to week of year docs (#53068) (#53075)
* week of year viz

* Apply suggestions from code review



---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-31 20:38:46 +00:00
github-automation-metabase
f3ca5d2460 Ensure the classloader is in task thread contexts (#52990) (#53062)
This should ensure tasks will find classes in our plugin system. The
issue arose when `submit-task!` was called to sync an unhidden bigquery
table before any query was run on the main thread before hand.

This ensures that if either of these tasks runs before classloader has
been set, that their threads will inherit it.

`task.cache/pool` was found as an audit of other threads that may
exhibit this behavior.

Testing this from source is not possible right away since the
classloaders behave so differently between jars and sources.

Co-authored-by: Case Nelson <case@metabase.com>
2025-01-31 20:30:34 +00:00
github-automation-metabase
634ba75db9 Delete legacy-no-self-service email (#53061) (#53071)
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-01-31 15:19:52 -05:00
github-automation-metabase
9cc7309004 Revise wording about shared user accounts when using SDK (#52986) (#53056)
---------

Co-authored-by: Alberto Perdomo <albertoperdomo@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-31 18:32:12 +00:00
github-automation-metabase
085fd404a8 Update Usage analytics YAMLs for 53 release (#52833) (#52852)
Update YAMLs for 53 release.
Move all questions into usage analytics dashboards. In some cases, questions had to be duplicated in order to be moved to dashboards.

Co-authored-by: Luiz Arakaki <luiz.arakaki@metabase.com>
2025-01-31 17:40:06 +00:00
github-automation-metabase
bb6f1acedd Remove Exasol and Ocient (#52924) (#53040)
Co-authored-by: Luiz Arakaki <luiz.arakaki@metabase.com>
2025-01-31 16:56:00 +00:00
github-automation-metabase
6ad63bef74 quarantine flaky search pagination test (#53050) (#53051)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-01-31 09:17:34 -07:00
github-automation-metabase
d2debda352 Databricks #48585 follow-up (#48855) (#53046)
* Remove redundant function

* Address test remarks

* Address remark

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-01-31 15:57:47 +00:00
github-automation-metabase
eb2d6223fc Fix parameter popover width when the datepicker changes its width (#52985) (#53044)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-01-31 10:32:50 -05:00
github-automation-metabase
c36d1e67d2 Fix - Empty tooltip shown when save button is disabled (#53033) (#53039)
* Fix #51035

* Add repro for #51035

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-01-31 15:31:02 +00:00
github-automation-metabase
da4b36e291 Fix - Segment filter misaligned in filter modal (#53038) (#53041)
* Fix #50734

* Add repro for #50734

* Add a comment

* Update comment

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-01-31 15:22:05 +00:00
github-automation-metabase
c9ceabde56 Move filters for perms-related t2 selects into the honeysql :where clauses (#52865) (#53004)
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-01-31 15:11:40 +00:00
github-automation-metabase
a22add8f3b updating the Logo SVG (#52908) (#52999)
Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-01-31 14:17:51 +00:00
github-automation-metabase
f41a70070d introduce tree-shaking of helpers by adding them to the Cypress object (#52042) (#52946)
* second attempt at treeshaking

* add eslint rules to disallow direct helper imports
# Conflicts:
#	e2e/test/scenarios/native/suggestions.cy.spec.ts

Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-01-31 09:54:24 +01:00
github-automation-metabase
3265e57eb0 Lofi quartz debugging (#53029) (#53030)
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2025-01-31 11:54:02 +03:00
github-automation-metabase
a4e504c16f More robust handling of search negation (#52976) (#53027)
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2025-01-31 08:40:03 +00:00
github-automation-metabase
0c03816365 Fix - Incorrect document title when query fails (#52953) (#53025)
* Fix #49270

* Turn it into an action for consistency

* Add a repro for #49270

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-01-31 15:36:45 +07:00
github-automation-metabase
076fb0124e [search] create index tables with nanoid instead of uuid (#52942) (#52961)
Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2025-01-31 08:05:23 +00:00
github-automation-metabase
a889c4bf1e Fix - Can't edit field descriptions from the edit mode of "learn about my data" (#52959) (#53026)
* Start refactoring Field to TS

* Revert "Start refactoring Field to TS"

This reverts commit 88af47fdac.

* Add description input

* Use translation

* Make placeholder match data model page UI

* Add repro for #37907

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-01-31 07:56:39 +00:00
github-automation-metabase
3ac9df074f Last axis label is now there on row charts (#52948) (#53024)
* last axis label is now there

* updated screenshots

* unit test

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-01-31 07:33:37 +00:00
github-automation-metabase
2ee7347a6f fix: Mongodb handle let with alias with space (#52862) (#53023)
Co-authored-by: Case Nelson <case@metabase.com>
2025-01-31 07:02:40 +00:00
github-automation-metabase
6dc4146cd3 Only add views to dynamic datasets (#52979) (#53001)
Databricks has static test data, by creating views we run the risk of
concurrent test runs seeing the temporary views or those views not
getting cleaned up if a job gets killed.

This is part of ENG-14545

Co-authored-by: Case Nelson <case@metabase.com>
2025-01-31 06:49:22 +00:00
github-automation-metabase
3679efeab4 apply custom separators to compactly formatted numbers (#52634) (#53014)
* apply custom separators to compactly formatted numbers

* Update Loki Snapshots

* Update Loki Snapshots

* Update Loki Snapshots

* Update Loki Snapshots

* loki

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-01-31 00:45:19 -05:00
github-automation-metabase
ea3393a2df Fixing xlsx pivot table exports to respect table column names (#52638) (#53018)
* Fixing xlsx pivot table exports to respect table column names

* Adding fallback to column title to use display_name if custom title is empty; fixing kondo error

* Fix cljfmt spacing

* Adding unit test for xlsx pivot exports respecting custom column name

* Improving logic to be more idiomatic

Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-01-31 03:48:53 +00:00
github-automation-metabase
a17e739ed4 Fix Toucan 2 table name for unresolved models (#52939) (#53012)
* Fix Toucan 2 table name for unresolved models

* Add explanation

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-01-31 02:37:53 +00:00
github-automation-metabase
3ff2db44ac ci: Cache final H2 app DB scheme when running tests (#51523) (#53009)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-01-31 01:55:50 +00:00
github-automation-metabase
500b84b580 Handle legacy secrets double encoded with base64 (#52836) (#52844)
Co-authored-by: Case Nelson <case@metabase.com>
2025-01-31 00:13:55 +00:00
github-automation-metabase
d2721181f0 🤖 backported "OpenAPI dox generation & request routing overhaul PART 1" (#52997)
* Will this work?

* Add updated api.macros

* Add missing file

* Test fix 🔧

* Backport more stuff

* Backport tests

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-01-30 15:35:58 -08:00
github-automation-metabase
ec68fd1739 docs: week of year (#52877) (#53006)
* docs: week of year

* Apply suggestions from code review



---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-30 22:42:22 +00:00
github-automation-metabase
e72730f7bf feat(sdk): Add option to remove dashboard footer (#52555) (#52936)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-01-30 22:35:33 +00:00
github-automation-metabase
e9ff150d79 tag model index search tests as flaky (#52969) (#52981)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-01-30 17:43:18 +00:00
github-automation-metabase
aa70da2a65 Reuse getMappingOptionByTarget in ParameterTarget component (#52903) (#52971)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-01-30 16:46:53 +00:00
github-automation-metabase
ef77d0025f fix(entity-id): don't call to the card endpoint if the entity id starts with digits (#52892) (#52970)
* fix(entity-id): don't make call to the card endpoint if the entity id
starts with digits

* prevent `isXXXPath` to return true if the path is the one of entity ids

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-01-30 16:13:26 +00:00
github-automation-metabase
057c51c4e5 Make deduplication of returned-columns available in pivoting (#52914) (#52963)
* WIP Move deduplication from js wrapper into returned-columns

* Move deduplication into pivoting code

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2025-01-30 15:27:53 +00:00
github-automation-metabase
c82519b4ad fix flaky helper causing flakes (#52954) (#52960)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-01-30 15:25:03 +00:00
github-automation-metabase
a3da30c3b0 Auto reset data db for writable db tests (#52784) (#52958)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-01-30 14:29:24 +00:00
github-automation-metabase
9ff4067665 Hopefully fix e2e search flakes (#52944) (#52956)
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2025-01-30 14:23:16 +00:00
github-automation-metabase
9518c90626 update oracle driver to jdk17+ (#52895) (#52931)
Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2025-01-30 12:32:20 +03:00
github-automation-metabase
8e4e7563bd add rule to prevent unsafe element filtering (#52432) (#52818)
* add rule to prevent unsafe element filtering

* add eslint-disable comments for all files affected by the new eslint rule

* add tests for eslint rule

Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-01-30 08:28:15 +00:00
github-automation-metabase
60ed6b9827 fix: reload model after applying prev revision (#52849) (#52940)
* fix: reload model after applying prev revision

* add tests

* fix lint

* reuse helpers

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-01-30 06:40:17 +00:00
github-automation-metabase
56978ffa59 🤖 backported "Remove defendpoint 1" (#52857)
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-01-29 18:50:47 -08:00
github-automation-metabase
d327343866 🤖 backported "Make public dashcards download endpoint match FE expectations" (#52787)
* Fix public dashcards download endpoint

* Finally handle form-encoded bodies correctly

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-01-29 17:54:18 -08:00
github-automation-metabase
b530bac0d1 🤖 backported "Auto-rewrite defendpoint forms in dashboard.clj" (#52777)
* Auto-rewrite defendpoint forms in dashboard.clj

* Auto-rewrite defendpoint forms in dashboard.clj

* Fix tests

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-01-29 17:54:05 -08:00
github-automation-metabase
64d03ed160 🤖 backported "Auto-rewrite defendpoint forms in dataset.clj" (#52776)
* Auto-rewrite defendpoint forms in dataset.clj

* Auto-rewrite defendpoint forms in dataset.clj

* Auto-rewrite defendpoint forms in dataset.clj

* Test fixes 🔧

* More test fixes 🔧

* A few more test fixes.

* Test fixes 🔧

* Test fixes 🔧

* Finally handle form-encoded bodies correctly

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
Co-authored-by: Cam Saul <github@camsaul.com>
2025-01-29 16:41:48 -08:00
github-automation-metabase
8fbbd9051e 🤖 backported "Auto-rewrite defendpoint forms in card.clj" (#52786)
* Auto-rewrite defendpoint forms in card.clj

* Test fixes 🔧

* Test fixes 🔧

* Test fix 🔧

* Test fix 🔧

* cljfmt

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-01-29 15:23:21 -08:00
github-automation-metabase
118e21e530 Fix nav bar highlighting when creating a new question (#52847) (#52907)
Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-01-29 21:35:57 +00:00
github-automation-metabase
f95cd1617f Set max length for question name (#52793) (#52922)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-01-29 21:32:40 +00:00
Jeff Bruemmer
7bb4b890fe docs - api docs (#52899) 2025-01-29 16:32:09 -05:00
github-automation-metabase
3f46b20b04 Convert nil values to :null in dimension-contexts (#52692) (#52866)
* Add lib.drill-thru.common/js->drill-value

* Ignore :null values in zoom-in.geographic

* Ignore :null values in zoom.in-binning

* Convert nil :values in dimensions to :null in dimension-contexts

* Add tests

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-01-29 21:27:40 +00:00
github-automation-metabase
cace37a49c Ensure relevant models are loaded when running preemptive caching task (#52855) (#52919)
* Ensure relevant models are loaded when running preemptive caching task

* typo

* Fix linter

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-01-29 19:49:20 +00:00
Mahatthana (Kelvin) Nomsawadi
8216bb8946 Fix SDK cross-version testing failure after test util refactor (#52900)
* Revert the code before the fix

* Revert "Revert the code before the fix"

This reverts commit be11146bf1.

* Another attempt by checking out the whole e2e dir

* Can't checkout twice it will override everything 😭

* Reset everything back to the start

* Add missing files

* Keep only the latest webpack config

* Clarify the temporary bandaid with a comment
2025-01-29 18:15:01 +00:00
github-automation-metabase
7810dd5002 Fix setting "Display as Link" in model metadata (#52749) (#52904)
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-01-29 17:09:29 +00:00
github-automation-metabase
d43e0fbf6e drop codenotify (#52690) (#52902)
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-01-29 16:44:53 +00:00
github-automation-metabase
1ab51a8e0a Add metrics around default and active engines (#52893) (#52901)
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2025-01-29 16:43:20 +00:00
github-automation-metabase
f5f19dcc4b Remove deprecated custom Cypress API commands (#52878) (#52884)
* Remove empty file

* Replace API commands usages with helpers

This is an automated change:

find e2e -type f \( -name "*.spec.*" \) -exec sed -i 's/cy.archiveCollection/H.archiveCollection/g; s/cy.archiveDashboard/H.archiveDashboard/g; s/cy.createCollection/H.createCollection/g; s/cy.createDashboard/H.createDashboard/g; s/cy.createDashboardWithQuestions/H.createDashboardWithQuestions/g; s/cy.createNativeQuestion/H.createNativeQuestion/g; s/cy.createNativeQuestionAndDashboard/H.createNativeQuestionAndDashboard/g; s/cy.createQuestion/H.createQuestion/g; s/cy.createQuestionAndAddToDashboard/H.createQuestionAndAddToDashboard/g; s/cy.createQuestionAndDashboard/H.createQuestionAndDashboard/g; s/cy.editDashboardCard/H.editDashboardCard/g' {} +

* Manually adjust imports

* Remove API commands

* Update calls with whitespace after `cy.`

* Update imports

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-01-29 11:36:26 +00:00
github-automation-metabase
e0c18552a2 Initialize zeros for labeled counter metrics (#52834) (#52873)
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2025-01-29 11:10:52 +00:00
github-automation-metabase
0d9045e428 fix path in codeowners (#52881) (#52883)
Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-01-29 10:48:35 +00:00
github-automation-metabase
1b4597e018 slightly tweaked the font size in gauge to make sure middle label is always visible (#52740) (#52815)
Co-authored-by: Sébastien <sebastien@metabase.com>
2025-01-29 09:40:21 +00:00
github-automation-metabase
a7a362d704 Fix - Wrong value shown in the filter modal (#52594) (#52874)
* Sync state in useStringFilter

* Sync state in useBooleanOperatorFilter

* Sync state in useBooleanOptionFilter

* Add FilterModalResult type

* Fix setTab type

* Make comments work as JSDocs

* Move FilterModalResult

* Add filter modal context

* Drop FilterModalHeader and use FilterSearchInput directly

* Start to use context in BooleanFilterEditor

* Start to use context in TimeFilterEditor

* Start to use context in DateFilterEditor

* Start to use context in CoordinateFilterEditor

* Start to use context in NumberFilterEditor

* Start to use context in StringFilterEditor

* Start to use context in DefaultFilterEditor

* Stop drilling isSearching

* Fix tests

* Stop drilling version prop

* Remove FilterModalBody and FilterModalFooter exports

* Make naming consistent

* Remove props drilling

* Remove props drilling

* Remove props drilling

* Inline FilterTabContent into FilterModalBody

* Revert "Inline FilterTabContent into FilterModalBody"

This reverts commit cfd5738e52.

* Remove props drilling

* Sort attributes

* Consolidate imports

* Fix a mistake

* Improve JSDoc

* Revert "Sync state in useBooleanOptionFilter"

This reverts commit 33a979dfdf.

* Update approach after merging refactoring branch

* Add a repro for string filters

* Go back and forth on search input

* Assert operator

* Move effect to concrete hook

* Add test for boolean filters

* Fix time filters

* Revert "Move effect to concrete hook"

This reverts commit 82b94f4345.

* Move effect outside use-time-filter

* Improve naming

* Remove TODO

* Extract setup48319

* Rename setup48319 to setupCustomColumns

* Rename handle* to on*

* Fix coordinate filters

* Fix default filters

* Fix number filters

* Revert 1st approach

* Use key prop

* Remove detailed tests and leave only one

* Use current value

* Add a test for "version" hack

* Use only version for the key

* Rename version to remountKey and add explanatory comments

* Rename forceDescendantsRemount to forceRemountDescendants

* Rename

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-01-29 09:23:22 +00:00
github-automation-metabase
6dd703140a Sets the proper autofocus when navigating to a specific setting through the hash (#52588) (#52870)
* autofocus is now properly set when using a hash in settings

* tests

* fix types in tests

* better type in test

Co-authored-by: Sébastien <sebastien@metabase.com>
2025-01-29 09:19:50 +00:00
github-automation-metabase
8bc1bcca66 fix: some css variables were not defined (#52808) (#52828)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-01-29 09:17:04 +00:00
Oisin Coveney
dcdf5e8767 Update package.template.json to reflect stable releases (#52792) 2025-01-28 19:06:21 -08:00
github-automation-metabase
23d523df1c [Cards in Dashboards] Allow duplicating questions into dashboards (#52750) (#52860)
* allow duplicating questions into a dashboard

* add model test, fix copy of entity picker modals for models

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-01-28 22:58:57 +00:00
github-automation-metabase
2b84fc6b48 Use features instead of hard-coded driver names in tests (#52758) (#52856)
* use features instead of hard coding drivers in tests

* fix formatting

* fix details-name-is-db feature

* bad conn details helper instead of features

* address pr comments

* exclude vertica from materialized view tests

* fix whitespace

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-01-28 22:10:40 +00:00
github-automation-metabase
52708cb884 docs: java 21 (#52858) (#52859)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-01-28 22:03:16 +00:00
github-automation-metabase
c21234df3a Don't try to cancel a statement that has already been closed (#52762) (#52838)
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-01-28 21:29:31 +00:00
github-automation-metabase
d99b06d21f Empty states: dashboards (#52639) (#52825)
* Add dashboard empty states

* Separate empty states from the actual dashboard content

* Fix public dashboards view

* Add translation context

* Localize the `alt` tag

* Make sure the content doesn't get cut off

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2025-01-28 21:17:01 +00:00
github-automation-metabase
c9a07af913 [Cards in Dashboards] Revision history copy change (#52423) (#52832)
* update copy and avoid showing two messages about moving when going between collections and dashboards in different collections

* pr feedback

* impl pr feedback

Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2025-01-28 14:14:36 -06:00
github-automation-metabase
bfb896a82e ci(sdk): Make 53 the latest in release workflow (#52789) (#52850)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-01-28 20:04:32 +00:00
github-automation-metabase
20794e2f8a For your consideration - collection menu (#52709) (#52823)
* For your consideration - collection menu

* type adjustment

* CI green?

* conditional for recommended

* adjusting e2e

Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2025-01-28 19:39:31 +00:00
github-automation-metabase
69cd77864e [test] Don't pprint values in malli= unless necessary (#52830) (#52837)
Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2025-01-28 18:01:48 +00:00
github-automation-metabase
fc7c0d7946 disable broken multi-arch container (#52839) (#52840)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-01-28 17:58:05 +00:00
github-automation-metabase
2c03388dcc Update google-sign-in.md (#52826) (#52829)
Co-authored-by: Abed Habli <154609371+abdhabli@users.noreply.github.com>
2025-01-28 17:08:25 +00:00
github-automation-metabase
0fba9aa40a extract function from component (#52820) (#52827)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-01-28 16:58:17 +00:00
Ryan Laurie
642c2eff1a check that the model is the same before comparing ids of entities (#52824)(#52821)
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
2025-01-28 16:25:30 +00:00
github-automation-metabase
6c7d5790a6 mark "should allow users to paginate results" as flaky as it fails with (#52816) (#52819)
a new e2e grouping

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-01-28 15:51:39 +00:00
github-automation-metabase
1ca79542d8 Build releases on java 21 for 53 (#52795) (#52813)
* use java 21 for 53

* fix unit test

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-01-28 14:03:41 +00:00
github-automation-metabase
43e2fb3491 support entity ids with /entity/ routes (#52659) (#52801)
* POC of entity id aware route

* wip e2e tests

* clean up logic

* changing approach as everything was broken

* revert unwanted changes

* Revert "revert unwanted changes"

This reverts commit f6ce10ac7b.

* reset routes to master

* /by-entity-id/ routes

* update tests to check for subpaths and search param preservation

* cleaning up un-needed code

* simplified even more the logic by merging the two config maps to one
array

* pass down router instead of single props

* split the tests to their files

* fix typo in test

* adds a test for a unlikely to be needed scenario

* fix import after merging master

* fix e2e copy

* /by-entity-id/ -> /entity/ as per product decision

* tag the test as flaky as it fails depending on the order of test files
being run

Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-01-28 11:47:21 +00:00
github-automation-metabase
2f2341b8c3 Account for DATEFIRST in sql server (#52636) (#52803)
In sql server, language settings change what day weeks start on.  The sql server driver assumes that weeks always
start on sunday (ie the US default), which means that if you change the db to french, our math is off and we start
calculating weeks and days of the week wrong.  This adds back in an offset based on DATEFIRST to fix that.

Co-authored-by: William <william@metabase.com>
2025-01-28 11:27:19 +00:00
github-automation-metabase
3504bc5c34 ci(sdk): embedding e2e workflow fixes for 53 branch (#52800) (#52802)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-01-28 10:57:53 +00:00
github-automation-metabase
1df5c4a00b Don't email "new login" detected emails on embedded logins (#52286) (#52772)
- Cleaned up session management
- Don't send "new device" email from embedded logins

---------

Co-authored-by: Nathan Voxland <nathan@metabase.com>
Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-01-28 01:07:04 +00:00
github-automation-metabase
3201fef18f Limit amount of data stored in the in-memory log (#52548) (#52783)
Limit amount of data stored in the in-memory log

Co-authored-by: Nathan Voxland <nathan@metabase.com>
2025-01-28 00:58:08 +00:00
github-automation-metabase
7c67586d9b Auto-rewrite defendpoint forms in ldap.clj (#52565) (#52780)
* Auto-rewrite defendpoint forms in ldap.clj

* Let's just try to get LDAP merged without being fancy

* Kondo

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-01-28 00:09:15 +00:00
github-automation-metabase
8c308dae8f Fix the Dockerfile (#52761) (#52782)
seems like debian doesn't ship java 21, so I added the one from Temurin following https://adoptium.net/en-GB/installation/linux/

Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
2025-01-28 00:08:53 +00:00
github-automation-metabase
ce9c0bef19 allow dashes in hashes for e2e failure notification (#52764) (#52778)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-01-27 23:39:48 +00:00
4433 changed files with 212626 additions and 150887 deletions

View File

@@ -1,8 +1,7 @@
;; -*- comment-column: 100; -*-
{:config-paths ["macros" "src"]
:linters
{
;;
{;;
;; enabled optional linters (these are disabled by default)
;;
@@ -183,7 +182,7 @@
:metabase/disallow-hardcoded-driver-names-in-tests
;; don't include `:h2` since that will probably lead to a mountain of tests where we are specifically testing
;; middleware or compilation behavior with just H2 since it's the default.
{:drivers #{ ;; core drivers
{:drivers #{;; core drivers
#_:h2
:postgres
:mysql
@@ -270,6 +269,9 @@
clojure.pprint/pprint {:message "Use metabase.util.log instead of clojure.pprint/pprint"}
clojure.string/lower-case {:message "Use metabase.util/lower-case-en instead of clojure.string/lower-case"}
clojure.string/upper-case {:message "Use metabase.util/upper-case-en instead of clojure.string/upper-case"}
compojure.core/context {:message "Use metabase.api.util.handlers/route-map-handler instead of compojure.core/context, it is much faster and supports OpenAPI spec generation"}
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."}
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"}
@@ -282,9 +284,7 @@
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.test/with-temp* {:message "Use mt/with-temp instead of mt/with-temp*"}
toucan2.tools.with-temp/with-temp {:message "Use mt/with-temp instead of toucan2.tools.with-temp/with-temp"}}
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"}}
:discouraged-namespace
{camel-snake-kebab.core {:message "CSK is not Turkish-safe, use the versions in metabase.util instead."}
@@ -297,224 +297,12 @@
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]}
;; A "module" is any `metabase.x` namespace in `src`.
:metabase/ns-module-checker
{:level :warning
;; Map of module name => the "core" external public-facing API namespace(s). You have three options here:
;;
;; 1. Special sentinel value `:any` means means this module does not (yet) have external public-facing API
;; namespace(s). This is mostly a temporary placeholder until we go in and create module namespaces, which means
;; you should go create one.
;;
;; 2. A set of namespace symbols. All namespaces in other modules will only be allowed to use namespaces from
;; this set. Ideally this set should only have one namespace, but restricting it to a set of several is still
;; better than `:any`.
;;
;; 3. `nil` or not listed here -- we default to assuming there is one API namespace called `<module>.core`
;;
;; `nil` or an empty set Otherwise this should be a set of namespace symbols.
;;
;; PRO TIP: Check out the `dev.deps-graph` namespace for helpful tools to see where a module is used externally.
:api-namespaces
{metabase.actions #{metabase.actions.core}
metabase.analytics #{metabase.analytics.prometheus
metabase.analytics.snowplow
metabase.analytics.stats
metabase.analytics.sdk} ; TODO -- consolidate these into a real API namespace.
metabase.analyze #{metabase.analyze.core}
metabase.api #{metabase.api.common
;; I don't really like making all these namespaces external but they have to be
;; for now until we can shrink this mega-module down a little bit (by moving API
;; namespaces out into different modules)... eventually `api` will just be a
;; general low-level API utils/macros module and at that point it can probably
;; get a single API namespace. Please try to avoid adding more stuff here if you
;; can tho. -- Cam
metabase.api.common.validation
metabase.api.dataset
metabase.api.macros
metabase.api.permission-graph
metabase.api.routes} ; TODO -- consolidate these into a real API namespace. I think the `*current-user*` type stuff might need to be moved into a separate module.
metabase.audit #{metabase.audit}
metabase.auth-provider #{metabase.auth-provider}
metabase.cmd #{} ; there are no namespaces here since you shouldn't be using this in any other module.
;; TODO -- this has too many API namespaces, ideally it would only expose `metabase.channel.core`,
;; `metabase.channel.init`, and `metabase.channel.api`.
metabase.channel #{metabase.channel.api
metabase.channel.core
metabase.channel.email
metabase.channel.email.messages
metabase.channel.init
metabase.channel.render.core
metabase.channel.template.core}
metabase.config #{metabase.config}
;; this is not even a real module, it's an external library but its starts with a `metabase.` namespace.
metabase.connection-pool #{metabase.connection-pool}
metabase.core #{metabase.core.initialization-status} ; TODO -- only namespace used outside of EE, this probably belongs in `metabase.server` anyway since that's the only place it's used.
metabase.db #{metabase.db
metabase.db.metadata-queries ; TODO this should probably be separate from metabase.db
metabase.db.query ; TODO this is mostly util stuff like `metabase.db.query/query` that we don't even need anymore.
metabase.db.setup} ; TODO these are only calling `metabase.db.setup/setup-db!` and there's a slightly different version in `metabase.db`
metabase.driver :any ; TODO -- 19 namespaces!!!! CRY
metabase.eid-translation #{metabase.eid-translation}
metabase.embed #{metabase.embed.settings}
metabase.events #{metabase.events metabase.events.init}
metabase.formatter #{metabase.formatter}
metabase.integrations #{metabase.integrations.common
metabase.integrations.google
metabase.integrations.ldap
metabase.integrations.slack} ; TODO -- consolidate these into a real API namespace.
metabase.legacy-mbql #{metabase.legacy-mbql.normalize
metabase.legacy-mbql.predicates
metabase.legacy-mbql.schema
metabase.legacy-mbql.schema.helpers
metabase.legacy-mbql.util} ; TODO -- consolidate these into a real API namespace.
metabase.lib :any ; TODO -- :cry: 34 externally referenced namespaces, but maybe half of them are schema namespaces which technically don't need to be required.
metabase.logger #{metabase.logger metabase.logger.init}
metabase.models :any ; TODO -- scream, 62 namespaces used elsewhere, but to be fair a lot of these don't *need* to be required.
metabase.moderation #{metabase.moderation}
metabase.notification #{metabase.notification.core
metabase.notification.init
metabase.notification.payload.core}
metabase.permissions #{metabase.permissions.util} ; TODO -- this is currently the only namespace in this module. Give it a real API namespace?
metabase.plugins #{metabase.plugins
metabase.plugins.classloader} ; TODO -- not 100% sure the classloader belongs here
metabase.premium-features #{metabase.premium-features.core}
metabase.public-settings #{metabase.public-settings}
metabase.pulse #{metabase.pulse.core}
metabase.query-processor :any ; TODO omg scream, 29 namespaces used outside of the module. WHAT THE HECC
metabase.query-analysis #{metabase.query-analysis.core
metabase.query-analysis.init}
metabase.request #{metabase.request.core}
metabase.sample-data #{metabase.sample-data}
metabase.search #{metabase.search.core
metabase.search.init
;; this is used by `metabase.search.api`... once we move that into this module we
;; can remove it as an API namespace
metabase.search.config
;; Need to expose this submodule, to break circular dependencies with models.
metabase.search.spec}
metabase.server #{metabase.server.core
;;
;; TODO FIXME -- this is loaded for side effects since it contains the JSON
;; encoder logic for stuff like `java.time` classes. As a
;; result, [[metabase.models.setting]] (and thus the `metabase.models` module)
;; has to depend on the `metabase.server` module...we should create either a new
;; `metabase.json` or `metabase.encoders` module for stuff like this to live. Or
;; maybe it just belongs in a generic `metabase.config` module.
metabase.server.middleware.json
;;
;; TODO -- we can't make this part of [[metabase.server.core]] YET because it
;; causes circular dependencies. Maybe in the future once we tease apart more of
;; the modules tangle we can.
metabase.server.protocols
;;
;; TODO -- I really don't like having YET ANOTHER allowed external namespace for
;; this module but some things need to import it so
;; `metabase.server.streaming_response.StreamingReponse` comes into existence...
metabase.server.streaming-response}
metabase.setup #{metabase.setup.api
metabase.setup.core}
metabase.sync #{metabase.sync.api
metabase.sync.core
metabase.sync.init
;; TODO -- see if we can expose the important parts in `metabase.sync.core`
metabase.sync.schedules
metabase.sync.util}
metabase.task #{metabase.task
metabase.task.bootstrap
metabase.task.index-values
metabase.task.init
metabase.task.persist-refresh
;; We need to expose this to the metabase.search module.
;; Ideally, it would just live inside that module.
metabase.task.search-index} ; TODO -- consolidate these into a real API namespace.
metabase.types #{metabase.types}
metabase.upload #{metabase.upload}
metabase.util :any ; I think util being `:any` is actually something I am ok with. But this has 32 namespaces.
metabase.xrays #{metabase.xrays.core}}
;; Map of module => other modules you're allowed to use there. You have two options here:
;;
;; 1. `:any` means namespaces in this module are allowed to use any other module -- allowed modules are not
;; enforced for this module. Module API namespaces for modules that have them defined are still enforced. For
;; ones that are `nil`, please go in and add a list of allowed modules. `:any` is mostly meant a temporary
;; placeholder until we can fill these all out, so feel free to fix these.
;;
;; 2. A set of module symbols. This is the list of modules that are allowed to be referenced. An empty set means no
;; other modules are allowed to be referenced; this is the default for any modules that aren't listed here.
:allowed-modules
{metabase.actions :any
metabase.analytics :any
metabase.analyze :any
metabase.api :any
metabase.audit :any
metabase.auth-provider #{metabase.util
metabase.premium-features}
metabase.cmd :any
metabase.channel :any
metabase.config #{metabase.plugins}
metabase.core :any
metabase.db :any
metabase.driver :any
metabase.embed :any
metabase.events :any
metabase.formatter :any
metabase.integrations :any
metabase.legacy-mbql :any
metabase.lib :any
metabase.logger #{metabase.config
metabase.plugins}
metabase.models :any
metabase.moderation :any
metabase.notification :any
metabase.permissions :any
metabase.plugins :any
metabase.premium-features :any
metabase.public-settings :any
metabase.pulse :any
metabase.query-analysis #{metabase.config
metabase.driver
metabase.legacy-mbql
metabase.lib
metabase.models
metabase.public-settings
metabase.query-processor
metabase.task
metabase.util}
metabase.query-processor :any
metabase.request #{metabase.config
metabase.models
metabase.public-settings
metabase.util}
metabase.sample-data :any
metabase.search :any
metabase.server :any
metabase.setup :any
metabase.sync :any
metabase.task :any
metabase.types #{metabase.util}
metabase.upload :any
metabase.util :any ; TODO -- this should probably be #{}
metabase.xrays :any}
;; namespaces matching these patterns (with `re-find`) are excluded from the module linter. Since regex literals
;; aren't allowed in EDN just used the `(str <regex>)` version i.e. two slashes instead of one.
;;
;; this is mostly intended for excluding test namespaces or those rare 'glue' namespaces that glue multiple modules
;; together, e.g. `metabase.lib.metadata.jvm`.
:ignored-namespace-patterns
#{"-test$" ; anything ending in `-test`
"test[-.]util" ; anything that contains `test.util` or `test-util`
"test\\.impl" ; anything that contains `test.impl`
"test-setup" ; anything that contains `test-setup`
"^metabase\\.test" ; anything starting with `metabase.test`
"^metabase\\.http-client$"}} ; `metabase.http-client` which is a test-only namespace despite its name.
:consistent-alias
{:aliases
{buddy.core.hash buddy-hash
@@ -554,6 +342,7 @@
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
@@ -568,50 +357,10 @@
metabase.analyze.fingerprint.fingerprinters fingerprinters
metabase.analyze.fingerprint.insights insights
metabase.analyze.fingerprint.schema fingerprint.schema
metabase.api.activity api.activity
metabase.api.alert api.alert
metabase.api.automagic-dashboards api.magic
metabase.api.bookmark api.bookmark
metabase.api.card api.card
metabase.api.card-test api.card-test
metabase.api.collection api.collection
metabase.api.common api
metabase.api.dashboard api.dashboard
metabase.api.dashboard-test api.dashboard-test
metabase.api.database api.database
metabase.api.dataset api.dataset
metabase.api.email api.email
metabase.api.embed api.embed
metabase.api.field api.field
metabase.api.geojson api.geojson
metabase.api.ldap api.ldap
metabase.api.logic-history api.login-history
metabase.api.metric api.metric
metabase.api.native-query-snippet api.native-query-snippet
metabase.api.permission-graph api.permission-graph
metabase.api.permissions api.permissions
metabase.api.permissions-test-util perm-test-util
metabase.api.pivots api.pivots
metabase.api.premium-features api.premium-features
metabase.api.preview-embed api.preview-embed
metabase.api.public api.public
metabase.api.pulse api.pulse
metabase.api.revision api.revision
metabase.api.search api.search
metabase.api.segment api.segment
metabase.api.session api.session
metabase.api.setting api.setting
metabase.api.setup api.setup
metabase.api.slack api.slack
metabase.api.table api.table
metabase.api.task api.task
metabase.api.tiles api.tiles
metabase.api.timeline api.timeline
metabase.api.timeline-event api.timeline-event
metabase.api.user api.user
metabase.api.util api.util
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
@@ -651,7 +400,7 @@
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.eid-translation.core eid-translation
metabase.formatter formatter
metabase.http-client client
metabase.legacy-mbql.normalize mbql.normalize
@@ -659,35 +408,12 @@
metabase.legacy-mbql.util mbql.u
metabase.lib.util lib.util
metabase.lib.util.match lib.util.match
metabase.models.activity activity
metabase.models.application-permissions-revision a-perm-revision
metabase.models.bookmark bookmark
metabase.models.collection collection
metabase.models.collection.graph graph
metabase.models.collection-permission-graph-revision c-perm-revision
metabase.models.dashboard-card dashboard-card
metabase.models.database database
metabase.login-history.core login-history
metabase.models.dependency dependency
metabase.models.field-values field-values
metabase.models.interface mi
metabase.models.moderation-review moderation-review
metabase.models.native-query-snippet native-query-snippet
metabase.models.notification models.notification
metabase.models.params params
metabase.models.permissions perms
metabase.models.permissions-group perms-group
metabase.models.permissions-group-membership perms-group-membership
metabase.models.permissions-revision perms-revision
metabase.models.permissions.parse perms-parse
metabase.models.pulse models.pulse
metabase.models.pulse-channel pulse-channel
metabase.models.pulse-channel-recipient pulse-channel-recipient
metabase.models.query.permissions query-perms
metabase.models.setting.cache setting.cache
metabase.models.timeline timeline
metabase.models.timeline-event timeline-event
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.premium-features.core premium-features
@@ -722,6 +448,7 @@
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
@@ -733,6 +460,7 @@
metabase.sync.field-values sync.field-values
metabase.sync.interface i
metabase.sync.schedules sync.schedules
metabase.sync.sync-metadata.crufty crufty
metabase.sync.sync-metadata.fields.our-metadata fields.our-metadata
metabase.sync.util sync-util
metabase.sync.util-test sync.util-test
@@ -747,6 +475,7 @@
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
@@ -794,12 +523,10 @@
metabase-enterprise.serialization.test-util/with-dbs clojure.core/fn
metabase-enterprise.serialization.test-util/with-random-dump-dir clojure.core/let
metabase.actions.test-util/with-actions clojure.core/let
metabase.api.common/defroutes clojure.core/def
metabase.api.common/let-404 clojure.core/let
metabase.api.search-test/do-test-users clojure.core/let
metabase.dashboard-subscription-test/with-dashboard-sub-for-card 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
@@ -817,8 +544,8 @@
metabase.models.setting.multi-setting/define-multi-setting clojure.core/def
metabase.models.setting/defsetting clj-kondo.lint-as/def-catch-all
metabase.premium-features.core/defenterprise-schema clj-kondo.lint-as/def-catch-all
metabase.premium-features.defenterprise/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.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/->
@@ -826,6 +553,7 @@
metabase.query-processor.middleware.cache.impl/with-reducible-deserialized-results clojure.core/let
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.sync.util/sum-for clojure.core/for
metabase.sync.util/with-emoji-progress-bar clojure.core/let
metabase.test.data.interface/defdataset clojure.core/def
@@ -841,6 +569,7 @@
metabase.test/with-temp-file clojure.core/let
metabase.test/with-user-in-groups clojure.core/let
metabase.upload-test/with-upload-table! clojure.core/let
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
metabase.util.malli.defn/defn- schema.core/defn
@@ -869,8 +598,8 @@
{cljs.test/deftest hooks.clojure.test/deftest
cljs.test/is hooks.clojure.test/is
cljs.test/use-fixtures hooks.clojure.test/use-fixtures
clojure.core/defmulti hooks.clojure.core/lint-defmulti
clojure.core/ns hooks.clojure.core/lint-ns
clojure.core/defmulti hooks.clojure.core.defmulti/lint-defmulti
clojure.core/ns hooks.clojure.core.ns/lint-ns
clojure.test/deftest hooks.clojure.test/deftest
clojure.test/is hooks.clojure.test/is
clojure.test/use-fixtures hooks.clojure.test/use-fixtures
@@ -879,15 +608,11 @@
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.analytics.prometheus-test/with-prometheus-system! hooks.common/with-two-bindings
metabase.api.alert-test/with-alert-in-collection! hooks.common/with-four-bindings
metabase.api.automagic-dashboards-test/with-indexed-model! hooks.metabase.api.automagic-dashboards-test/with-indexed-model!
metabase.api.card-test/with-card-param-values-fixtures hooks.common/let-one-with-optional-value
metabase.api.card-test/with-persistence-setup! hooks.common/with-one-top-level-binding
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/defendpoint hooks.metabase.api.common/defendpoint
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
@@ -901,8 +626,6 @@
metabase.api.public-test/with-temp-public-card hooks.common/let-one-with-optional-value
metabase.api.public-test/with-temp-public-dashboard hooks.common/let-one-with-optional-value
metabase.api.public-test/with-temp-public-dashboard-and-card hooks.common/with-three-bindings
metabase.api.search-test/with-search-items-in-collection hooks.metabase.api.search-test/with-search-items-in-collection
metabase.api.search-test/with-search-items-in-root-collection hooks.common/do*
metabase.api.user-test/with-temp-user-email! hooks.common/with-one-binding
metabase.channel.template.handlebars-test/with-temp-template! hooks.common/with-vec-first-binding
metabase.channel.template.handlebars-helper/defhelper hooks.metabase.channel.template.handlebars-helper/defhelper
@@ -924,12 +647,15 @@
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.pulse-test/with-dashboard-subscription-in-collection! hooks.common/with-four-bindings
metabase.models.pulse-test/with-pulse-in-collection! hooks.common/with-four-bindings
metabase.models.setting.multi-setting/define-multi-setting hooks.metabase.models.setting/define-multi-setting
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.premium-features.core/defenterprise hooks.metabase.premium-features.defenterprise/defenterprise
metabase.premium-features.defenterprise/defenterprise hooks.metabase.premium-features.defenterprise/defenterprise
metabase.pulse.api.alert-test/with-alert-in-collection! hooks.common/with-four-bindings
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.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
@@ -938,6 +664,8 @@
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.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.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
@@ -952,6 +680,7 @@
metabase.test.util/discard-setting-changes hooks.common/with-ignored-first-arg
metabase.test.util/with-column-remappings hooks.common/with-ignored-first-arg
metabase.test.util/with-non-admin-groups-no-root-collection-perms hooks.common/do*
metabase.test.util/with-prometheus-system! hooks.common/with-two-bindings
metabase.test.util/with-temp-file hooks.metabase.test.util/with-temp-file
metabase.test.util/with-temporary-setting-values hooks.metabase.test.util/with-temporary-setting-values
metabase.test/$ids hooks.metabase.test.data/$ids
@@ -969,6 +698,7 @@
metabase.test/with-non-admin-groups-no-root-collection-perms hooks.common/do*
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.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
@@ -985,14 +715,15 @@
metabase.util.log/warnf hooks.metabase.util.log/infof
metabase.util.malli.registry/def hooks.metabase.util.malli.registry/def
metabase.util/case-enum hooks.metabase.util/case-enum
metabase.util/format-color hooks.metabase.util/format-color}
metabase.util/format-color hooks.metabase.util/format-color
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.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!
@@ -1002,7 +733,6 @@
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.common/define-routes macros.metabase.api.common/define-routes
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.api.public-test/with-sharing-enabled-and-temp-card-referencing! macros.metabase.api.public-test/with-sharing-enabled-and-temp-card-referencing!
@@ -1045,7 +775,7 @@
: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))\\.*"
:name metabase-lib}
@@ -1079,9 +809,9 @@
:hooks
{:analyze-call
{clojure.core/defmacro hooks.clojure.core/non-thread-safe-form-should-end-with-exclamation
clojure.core/defn hooks.clojure.core/non-thread-safe-form-should-end-with-exclamation
clojure.core/defn- hooks.clojure.core/non-thread-safe-form-should-end-with-exclamation}}}
{clojure.core/defmacro hooks.clojure.core.defn/non-thread-safe-form-should-end-with-exclamation
clojure.core/defn hooks.clojure.core.defn/non-thread-safe-form-should-end-with-exclamation
clojure.core/defn- hooks.clojure.core.defn/non-thread-safe-form-should-end-with-exclamation}}}
source-namespaces
{:linters

View File

@@ -0,0 +1,763 @@
;; A "module" is any `metabase.<module>.core` namespace in `src`.
;;
;; ## `api`:
;;
;; Map of module name => the "core" external public-facing API namespace(s). You have three options here:
;;
;; 1. Special sentinel value `:any` means means this module does not (yet) have external public-facing API
;; namespace(s). This is mostly a temporary placeholder until we go in and create module namespaces, which means
;; you should go create one.
;;
;; 2. A set of namespace symbols. All namespaces in other modules will only be allowed to use namespaces from
;; this set. Ideally this set should only have one namespace, but restricting it to a set of several is still
;; better than `:any`.
;;
;; 3. `nil` or not listed here -- we default to assuming there is (some subset) of the 'standard' API namespaces
;; `<module>.api`, `<module>.core`, and `<module>.init`
;;
;; ## `uses`:
;;
;; Map of module => other modules you're allowed to use there. You have two options here:
;;
;; 1. `:any` means namespaces in this module are allowed to use any other module -- allowed modules are not
;; enforced for this module. Module API namespaces for modules that have them defined are still enforced. For
;; ones that are `nil`, please go in and add a list of allowed modules. `:any` is mostly meant a temporary
;; placeholder until we can fill these all out, so feel free to fix these.
;;
;; 2. A set of module symbols. This is the list of modules that are allowed to be referenced. An empty set means no
;; other modules are allowed to be referenced; this is the default for any modules that aren't listed here.
;;
;; ## Tips
;;
;; PRO TIP: Check out the [[dev.deps-graph]] namespace for helpful tools to see where a module is used externally, and
;; for tools for calculating this config.
{:metabase/modules
{actions
{:api #{metabase.actions.api metabase.actions.core}
:uses #{analytics api driver legacy-mbql lib models query-processor search util}}
activity-feed
{:api #{metabase.activity-feed.api metabase.activity-feed.init}
:uses #{api config db events models util}}
analytics
{:api #{metabase.analytics.prometheus
metabase.analytics.sdk
metabase.analytics.snowplow
metabase.analytics.stats}
:uses #{api
channel
config
db
driver
eid-translation
embed
integrations
internal-stats
models
premium-features
public-settings
server
util}}
analyze
{:api #{metabase.analyze.core metabase.analyze.query-results}
:uses #{config driver legacy-mbql lib models sync util}}
api
{:api #{metabase.api.auth
metabase.api.cache
metabase.api.card
metabase.api.collection
metabase.api.common
metabase.api.common.validation
metabase.api.dataset
metabase.api.ldap
metabase.api.macros
metabase.api.open-api
metabase.api.query-metadata
metabase.api.routes
metabase.api.routes.common
metabase.api.table
metabase.api.user
metabase.api.util.handlers}
:uses :any}
audit {:api #{metabase.audit}
:uses #{db models}}
auth-provider
{:api #{metabase.auth-provider}
:uses #{premium-features}}
bookmarks
{:api #{metabase.bookmarks.api}
:uses #{api db models util}}
channel
{:api #{metabase.channel.api
metabase.channel.core
metabase.channel.email
metabase.channel.email.messages
metabase.channel.init
metabase.channel.render.core
metabase.channel.template.core}
:uses #{analytics
api
config
db
driver
events
formatter
integrations
lib
models
notification
permissions
premium-features
public-settings
query-processor
timeline
types
util}}
cloud-migration
{:api #{metabase.cloud-migration.api
metabase.cloud-migration.core
metabase.cloud-migration.init}
:uses #{api cmd config db models premium-features util}}
cmd
{:api #{metabase.cmd
metabase.cmd.copy
metabase.cmd.dump-to-h2}
:uses #{api config db legacy-mbql models plugins query-processor search util}}
;; technically this 'uses' `enterprise/core` and `test` since it tries to load them to see if they exists so we know
;; if EE/test code is available; however we can ignore them since they're not real usages.
config
{:api #{metabase.config}
:uses #{}}
;; this is not actually a real module, but comes from one of our libraries.
connection-pool
{:api #{metabase.connection-pool}
:uses #{}}
core
{:api #{metabase.core.initialization-status}
:uses :any}
db
{:api #{metabase.db metabase.db.metadata-queries metabase.db.query metabase.db.setup}
:uses #{auth-provider config connection-pool driver legacy-mbql lib plugins query-processor task util}}
driver
{:api #{metabase.driver
metabase.driver.common
metabase.driver.common.parameters
metabase.driver.common.parameters.dates
metabase.driver.common.parameters.operators
metabase.driver.common.parameters.parse
metabase.driver.common.parameters.values
metabase.driver.ddl.interface
metabase.driver.h2
metabase.driver.impl
metabase.driver.init
metabase.driver.mysql
metabase.driver.postgres
metabase.driver.sql
metabase.driver.sql-jdbc.connection
metabase.driver.sql-jdbc.execute
metabase.driver.sql-jdbc.execute.diagnostic
metabase.driver.sql-jdbc.sync
metabase.driver.sql.query-processor
metabase.driver.sql.query-processor.deprecated
metabase.driver.sql.util
metabase.driver.sync
metabase.driver.util}
:uses #{actions
auth-provider
config
connection-pool
db
legacy-mbql
lib
logger
models
plugins
premium-features
public-settings
pulse
query-processor
sync
upload
util}}
eid-translation
{:api #{metabase.eid-translation.core}
:uses #{}}
embed
{:api #{metabase.embed.settings metabase.embed.app-origins-sdk}
:uses #{analytics models premium-features tiles util}}
events
{:api #{metabase.events metabase.events.init metabase.events.notification}
:uses #{api driver models notification premium-features public-settings util}}
formatter
{:api #{metabase.formatter}
:uses #{models public-settings query-processor types util}}
indexed-entities
{:api #{metabase.indexed-entities.api metabase.indexed-entities.init}
:uses #{analytics api driver legacy-mbql lib models query-processor search sync task util}}
integrations
{:api #{metabase.integrations.common
metabase.integrations.google
metabase.integrations.google.interface
metabase.integrations.ldap
metabase.integrations.ldap.default-implementation
metabase.integrations.slack}
:uses #{api config events models permissions plugins premium-features util enterprise/enhancements}}
internal-stats
{:api #{metabase.internal-stats.core}
:uses #{db models}}
legacy-mbql
{:api #{metabase.legacy-mbql.normalize
metabase.legacy-mbql.predicates
metabase.legacy-mbql.schema
metabase.legacy-mbql.schema.helpers
metabase.legacy-mbql.util}
:uses #{lib models types util}}
lib
{:api #{metabase.lib.binning
metabase.lib.binning.util
metabase.lib.card
metabase.lib.convert
metabase.lib.core
metabase.lib.equality
metabase.lib.field
metabase.lib.filter
metabase.lib.ident
metabase.lib.join.util
metabase.lib.metadata
metabase.lib.metadata.calculation
metabase.lib.metadata.jvm
metabase.lib.metadata.protocols
metabase.lib.normalize
metabase.lib.options
metabase.lib.query
metabase.lib.schema
metabase.lib.schema.actions
metabase.lib.schema.binning
metabase.lib.schema.common
metabase.lib.schema.expression
metabase.lib.schema.expression.temporal
metabase.lib.schema.expression.window
metabase.lib.schema.id
metabase.lib.schema.info
metabase.lib.schema.literal
metabase.lib.schema.metadata
metabase.lib.schema.parameter
metabase.lib.schema.template-tag
metabase.lib.schema.temporal-bucketing
metabase.lib.schema.util
metabase.lib.temporal-bucket
metabase.lib.types.isa
metabase.lib.util
metabase.lib.util.match
metabase.lib.walk}
:uses #{config driver legacy-mbql models types util}}
logger
{:api #{metabase.logger metabase.logger.init}
:uses #{config plugins}}
login-history
{:api #{metabase.login-history.api
metabase.login-history.core
metabase.login-history.init}
:uses #{analytics api channel models request util}}
models
{:api #{metabase.models.api-key
metabase.models.application-permissions-revision
metabase.models.audit-log
metabase.models.cache-config
metabase.models.card
metabase.models.card.metadata
metabase.models.collection
metabase.models.collection-permission-graph-revision
metabase.models.collection.graph
metabase.models.collection.root
metabase.models.dashboard
metabase.models.dashboard-card
metabase.models.dashboard-tab
metabase.models.dashboard.constants
metabase.models.database
metabase.models.dispatch
metabase.models.field
metabase.models.field-usage
metabase.models.field-values
metabase.models.humanization
metabase.models.init
metabase.models.interface
metabase.models.moderation-review
metabase.models.native-query-snippet
metabase.models.native-query-snippet.permissions
metabase.models.notification
metabase.models.params
metabase.models.params.chain-filter
metabase.models.params.custom-values
metabase.models.params.field-values
metabase.models.params.shared
metabase.models.persisted-info
metabase.models.query
metabase.models.query-analysis
metabase.models.query.permissions
metabase.models.resolution
metabase.models.secret
metabase.models.serialization
metabase.models.setting
metabase.models.setting.cache
metabase.models.setting.multi-setting
metabase.models.table
metabase.models.task-history
metabase.models.user
metabase.models.user-parameter-value
metabase.models.view-log-impl
metabase.models.visualization-settings}
:uses #{analytics
analyze
api
audit
channel
config
db
driver
events
integrations
legacy-mbql
lib
moderation
permissions
plugins
premium-features
public-settings
pulse
query-analysis
query-processor
request
search
server
setup
sync
task
types
util
xrays
enterprise/advanced-permissions}}
moderation
{:api #{metabase.moderation}
:uses #{models util}}
notification
{:api #{metabase.notification.core
metabase.notification.init
metabase.notification.payload.core
metabase.notification.payload.execute}
:uses #{analytics api channel events models permissions premium-features public-settings query-processor request util}}
permissions
{:api #{metabase.permissions.api
metabase.permissions.core
metabase.permissions.models.data-permissions
metabase.permissions.models.permissions
metabase.permissions.models.permissions-group
metabase.permissions.util}
:uses #{api audit config db integrations models plugins premium-features request server util}}
pivot
{:api #{metabase.pivot.core}
:uses #{util models}}
plugins
{:api #{metabase.plugins metabase.plugins.classloader}
:uses #{config driver util}}
premium-features
{:api #{metabase.premium-features.core
metabase.premium-features.token-check}
:uses #{config db internal-stats models plugins util}}
public-settings
{:api #{metabase.public-settings}
:uses #{api config models plugins premium-features util enterprise/sso}}
public-sharing
{:api #{metabase.public-sharing.api
metabase.public-sharing.core
metabase.public-sharing.init}
:uses #{actions analytics api db events lib models query-processor request tiles util}}
pulse
{:api #{metabase.pulse.api
metabase.pulse.core
metabase.pulse.init
metabase.pulse.task.send-pulses}
:uses #{api channel config db driver events integrations models notification permissions plugins premium-features
query-processor request task util
enterprise/advanced-config enterprise/advanced-permissions enterprise/sandbox}}
query-analysis
{:api #{metabase.query-analysis.core metabase.query-analysis.init}
:uses #{config driver legacy-mbql lib public-settings query-processor task util}}
query-processor
{:api #{metabase.query-processor
metabase.query-processor.card
metabase.query-processor.compile
metabase.query-processor.dashboard
metabase.query-processor.debug
metabase.query-processor.error-type
metabase.query-processor.interface
metabase.query-processor.metadata
metabase.query-processor.middleware.annotate
metabase.query-processor.middleware.cache-backend.db
metabase.query-processor.middleware.constraints
metabase.query-processor.middleware.fetch-source-query
metabase.query-processor.middleware.fetch-source-query-legacy
metabase.query-processor.middleware.limit
metabase.query-processor.middleware.permissions
metabase.query-processor.middleware.wrap-value-literals
metabase.query-processor.pipeline
metabase.query-processor.pivot
metabase.query-processor.preprocess
metabase.query-processor.reducible
metabase.query-processor.schema
metabase.query-processor.setup
metabase.query-processor.store
metabase.query-processor.streaming
metabase.query-processor.streaming.common
metabase.query-processor.streaming.interface
metabase.query-processor.timezone
metabase.query-processor.util
metabase.query-processor.util.add-alias-info
metabase.query-processor.util.nest-query
metabase.query-processor.util.persisted-cache
metabase.query-processor.util.relative-datetime
metabase.query-processor.util.transformations.nest-breakouts
metabase.query-processor.writeback}
:uses #{analytics
analyze
api
audit
config
db
driver
events
formatter
legacy-mbql
lib
models
permissions
pivot
premium-features
public-settings
request
server
types
util}}
request
{:api #{metabase.request.core}
:uses #{api config models permissions public-settings util}}
revisions
{:api #{metabase.revisions.api metabase.revisions.core metabase.revisions.init}
:uses #{api config events models util}}
sample-data
{:api #{metabase.sample-data}
:uses #{plugins sync util}}
search
{:api #{metabase.search.api
metabase.search.appdb.scoring
metabase.search.config
metabase.search.core
metabase.search.in-place.scoring
metabase.search.ingestion
metabase.search.init
metabase.search.spec}
:uses #{analytics api audit config db driver models permissions premium-features public-settings request startup task util}}
segments
{:api #{metabase.segments.api}
:uses #{api events legacy-mbql lib models permissions search util xrays}}
server
{:api #{metabase.server.core
metabase.server.middleware.json
metabase.server.middleware.session
metabase.server.streaming-response}
:uses #{analytics api config core db driver embed models premium-features public-settings request util
enterprise/sso}}
session
{:api #{metabase.session.api metabase.session.init metabase.session.models.session}
:uses #{api channel config db driver events integrations login-history models public-settings request task util}}
setup
{:api #{metabase.setup.api metabase.setup.core}
:uses #{analytics
api
channel
config
db
embed
events
integrations
models
permissions
premium-features
public-settings
request
session
util}}
startup
{:api #{metabase.startup.core}
:uses #{util}}
sync
{:api #{metabase.sync.api
metabase.sync.core
metabase.sync.init
metabase.sync.schedules
metabase.sync.task.sync-databases
metabase.sync.util}
:uses #{analyze api audit config db driver events lib models plugins query-processor task util}}
task
{:api #{metabase.task
metabase.task.bootstrap
metabase.task.init
metabase.task.notification
metabase.task.persist-refresh}
:uses #{analytics
channel
config
db
driver
integrations
models
notification
plugins
premium-features
public-settings
query-processor
util
enterprise/task}}
tiles
{:api #{metabase.tiles.api
metabase.tiles.init}
:uses #{api legacy-mbql models query-processor util}}
timeline
{:api #{metabase.timeline.api metabase.timeline.core}
:uses #{analytics api models util}}
types
{:api #{metabase.types}
:uses #{util}}
upload
{:api #{metabase.upload}
:uses #{analytics api driver events legacy-mbql lib models permissions public-settings sync util}}
user-key-value
{:api #{metabase.user-key-value.api metabase.user-key-value.init}
:uses #{api config lib util}}
util
{:api :any
:uses #{config db driver legacy-mbql lib models plugins premium-features public-settings}}
xrays
{:api #{metabase.xrays.api metabase.xrays.core}
:uses #{analyze api db driver legacy-mbql lib models public-settings query-processor util}}
enterprise/advanced-config
{:api #{metabase-enterprise.advanced-config.api.logs
metabase-enterprise.advanced-config.models.pulse-channel
metabase-enterprise.advanced-config.file
metabase-enterprise.advanced-config.crufty}
:uses #{api db driver models permissions premium-features setup sync util}}
enterprise/advanced-permissions
{:api #{metabase-enterprise.advanced-permissions.api.routes
metabase-enterprise.advanced-permissions.common
metabase-enterprise.advanced-permissions.models.permissions.group-manager}
:uses #{api audit driver enterprise/impersonation lib models permissions premium-features query-processor util enterprise/sandbox}}
enterprise/airgap
{:api #{}
:uses #{premium-features util}}
enterprise/api
{:api #{metabase-enterprise.api.routes
metabase-enterprise.api.routes.common}
:uses :any}
enterprise/audit-app
{:api #{metabase-enterprise.audit-app.api.routes}
:uses #{api
audit
db
driver
lib
models
permissions
plugins
premium-features
query-processor
sync
util
enterprise/serialization}}
enterprise/auth-provider
{:api #{}
:uses #{premium-features util}}
enterprise/billing
{:api #{metabase-enterprise.billing.api.routes}
:uses #{api premium-features util}}
enterprise/cache
{:api #{metabase-enterprise.cache.strategies}
:uses #{api models premium-features query-processor util}}
enterprise/content-verification
{:api #{metabase-enterprise.content-verification.api.routes}
:uses #{api models moderation util enterprise/api}}
enterprise/core
{:api #{metabase-enterprise.core.init}
:uses #{enterprise/enhancements}}
enterprise/dashboard-subscription-filters
{:api #{}
:uses #{premium-features}}
enterprise/enhancements
{:api #{metabase-enterprise.enhancements.init
metabase-enterprise.enhancements.integrations.google
metabase-enterprise.enhancements.integrations.ldap}
:uses #{integrations models premium-features util enterprise/sso}}
enterprise/gsheets
{:api #{metabase-enterprise.gsheets.api}
:uses #{api analytics enterprise/harbormaster models premium-features server util}}
enterprise/harbormaster
{:api #{metabase-enterprise.harbormaster.client}
:uses #{api cloud-migration models util}}
enterprise/impersonation
{:api #{metabase-enterprise.impersonation.core
metabase-enterprise.impersonation.api}
:uses #{api audit driver enterprise/sandbox lib models permissions premium-features query-processor util}}
enterprise/internal-stats
{:api #{metabase-enterprise.internal-stats}
:uses #{models premium-features}}
enterprise/llm
{:api #{metabase-enterprise.llm.api}
:uses #{analytics analyze api models query-processor util}}
enterprise/query-reference-validation
{:api #{metabase-enterprise.query-reference-validation.api}
:uses #{api models public-settings request util}}
enterprise/sandbox
{:api #{metabase-enterprise.sandbox.api.routes
metabase-enterprise.sandbox.api.util}
:uses #{api
audit
db
legacy-mbql
lib
models
permissions
plugins
premium-features
query-processor
request
util
enterprise/impersonation
enterprise/api}}
enterprise/scim
{:api #{metabase-enterprise.scim.api metabase-enterprise.scim.routes}
:uses #{analytics api models permissions public-settings server util enterprise/serialization}}
enterprise/search
{:api #{}
:uses #{premium-features search}}
enterprise/serialization
{:api #{metabase-enterprise.serialization.api
metabase-enterprise.serialization.cmd
metabase-enterprise.serialization.v2.backfill-ids}
:uses #{analytics api config db legacy-mbql lib logger models plugins premium-features public-settings setup util}}
enterprise/snippet-collections
{:api #{}
:uses #{models permissions premium-features util}}
enterprise/sso
{:api #{metabase-enterprise.sso.api.routes
metabase-enterprise.sso.integrations.sso-settings
metabase-enterprise.sso.integrations.sso-utils}
:uses #{api channel embed events integrations models premium-features public-settings request session util
enterprise/scim}}
enterprise/stale
{:api #{metabase-enterprise.stale.routes}
:uses #{analytics api embed models premium-features public-settings request util}}
enterprise/stats
{:api #{}
:uses #{driver premium-features enterprise/advanced-config enterprise/scim enterprise/sso}}
enterprise/task
{:api #{metabase-enterprise.task.truncate-audit-tables}
:uses #{premium-features query-processor task util enterprise/cache}}
enterprise/upload-management
{:api #{metabase-enterprise.upload-management.api}
:uses #{api models premium-features upload util}}}
;; namespaces matching these patterns (with `re-find`) are excluded from the module linter. Since regex literals
;; aren't allowed in EDN just used the `(str <regex>)` version i.e. two slashes instead of one.
;;
;; this is mostly intended for excluding test namespaces or those rare 'glue' namespaces that glue multiple modules
;; together, e.g. `metabase.lib.metadata.jvm`.
:linters
{:metabase/modules
{:ignored-namespace-patterns
#{"-test$" ; anything ending in `-test`
"test[-.]util" ; anything that contains `test.util` or `test-util`
"test\\.impl" ; anything that contains `test.impl`
"test-setup" ; anything that contains `test-setup`
"^metabase(?:-enterprise)?\\.test" ; anything starting with `metabase.test` or `metabase-enterprise.test`
"^metabase\\.http-client$"}}}} ; `metabase.http-client` which is a test-only namespace despite its name.

View File

@@ -0,0 +1,132 @@
{:linters
{:metabase/test-helpers-use-non-thread-safe-functions
;; TODO -- seems silly to maintain different blacklists and whitelists here than we use for the deftest `^:parallel`
;; checker...
{:explicitly-safe
#{ ;; these toucan methods might actually set global values if it's used outside of a transaction,
;; but since mt/with-temp runs in a transaction, so we'll ignore them in this case.
toucan2.core/delete!
toucan2.core/update!
toucan2.core/insert!
toucan2.core/insert-returning-instance!
toucan2.core/insert-returning-instances!
toucan2.core/insert-returning-pk!
toucan2.core/insert-returning-pks!
clojure.core.async/<!!
clojure.core.async/>!!
clojure.core.async/alts!!
clojure.core.async/close!
clojure.core.async/poll!
clojure.core.memoize/memo-clear!
clojure.core/conj!
clojure.core/persistent!
clojure.core/reset!
clojure.core/swap!
clojure.core/volatile!
clojure.core/vreset!
clojure.core/vswap!
clojure.java.jdbc/execute!
methodical.core/add-aux-method-with-unique-key!
methodical.core/remove-aux-method-with-unique-key!
next.jdbc/execute!
;; Definitely thread safe
metabase.test.util.dynamic-redefs/patch-vars!
;; TODO: most of these symbols shouldn't be here, we should go through them and
;; find the functions/macros that use them and make sure their names end with !
;; best way to do this is try remove each of these and rely on kondo output to find places where it's used
clojure.test/grant-collection-perms!
clojure.test/grant-collection-perms-fn!
clojure.test/grant-perms-fn!
clojure.test/purge-old-entries!
clojure.test/revoke-collection-perms!
clojure.test/save-results!
metabase-enterprise.advanced-permissions.models.permissions/update-db-download-permissions!
metabase-enterprise.internal-user/install-internal-user!
metabase-enterprise.sso.integrations.saml-test/call-with-login-attributes-cleared!
metabase.actions.actions/perform-action!
metabase.actions.models/insert!
metabase.analytics.snowplow-test/fake-track-event-impl!
metabase.analytics.snowplow/track-event-impl!
metabase.api.public-test/add-card-to-dashboard!
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.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.indexed-entities.task.index-values/job-init!
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.persisted-info/ready-database!
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.models.permissions/grant-application-permissions!
metabase.permissions.models.permissions/grant-collection-read-permissions!
metabase.permissions.models.permissions/grant-collection-readwrite-permissions!
metabase.permissions.models.permissions/grant-full-data-permissions!
metabase.permissions.models.permissions/grant-native-readwrite-permissions!
metabase.permissions.models.permissions/grant-permissions!
metabase.permissions.models.permissions/revoke-application-permissions!
metabase.permissions.models.permissions/revoke-data-perms!
metabase.permissions.models.permissions/update-data-perms-graph!
metabase.permissions.models.permissions/update-group-permissions!
metabase.permissions.test-util/with-restored-perms!
metabase.pulse.send/send-notifications!
metabase.pulse.send/send-pulse!
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.setup.core/create-token!
metabase.sync.core/sync-database!
metabase.sync.sync-metadata.fields.sync-metadata/update-field-metadata-if-needed!
metabase.sync.sync-metadata/sync-db-metadata!
metabase.sync.util-test/sync-database!
metabase.sync.util/store-sync-summary!
metabase.task.persist-refresh/job-init!
metabase.task.persist-refresh/refresh-tables!
metabase.task.persist-refresh/schedule-persistence-for-database!
metabase.task/delete-task!
metabase.test.data.bigquery-cloud-sdk/execute!
metabase.test.data.impl/copy-db-tables-and-fields!
metabase.test.data.impl/get-or-create-database!
metabase.test.data.impl/get-or-create-default-dataset!
metabase.test.data.impl.get-or-create/set-test-db-permissions!
metabase.test.data.interface/create-db!
metabase.test.data.interface/destroy-db!
metabase.test.data.oracle/create-user!
metabase.test.data.oracle/drop-user!
metabase.test.data.sql-jdbc.load-data/make-insert!
metabase.test.data.users/clear-cached-session-tokens!
metabase.test.initialize/do-initialization!
metabase.test.initialize/initialize-if-needed!
metabase.test.integrations.ldap/start-ldap-server!
metabase.test.util.log/ensure-unique-logger!
metabase.test.util.log/set-ns-log-level!
metabase.test.util/do-with-temp-env-var-value!
metabase.test.util/restore-raw-setting!
metabase.test.util/upsert-raw-setting!
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.util.files/create-dir-if-not-exists!
metabase.util.ssh-test/start-mock-servers!
metabase.util.ssh-test/stop-mock-servers!}}}}

View File

@@ -1,7 +0,0 @@
(ns macros.metabase.api.common)
(defmacro define-routes
"Macro for api.common/define-routes"
[& args]
`(do (def ~'routes "docstring" nil)
~@args))

View File

@@ -1,5 +1,6 @@
(ns macros.metabase-enterprise.advanced-permissions.api.util-test
(:require [macros.common]))
(ns macros.metabase-enterprise.impersonation.util-test
(:require
[macros.common]))
(defmacro with-impersonations! [impersonations-and-attributes-map & body]
`(let [~(macros.common/ignore-unused '&group) ~impersonations-and-attributes-map]

View File

@@ -1,375 +0,0 @@
(ns hooks.clojure.core
(:require
[clj-kondo.hooks-api :as hooks]
[clojure.string :as str]
[hooks.common]))
;;; TODO -- seems silly to maintain different blacklists and whitelists here than we use for the deftest `^:parallel`
;;; checker... those lists live in the Clj Kondo config file
(def ^:private symbols-allowed-in-fns-not-ending-in-an-exclamation-point
'#{;; these toucan methods might actually set global values if it's used outside of a transaction,
;; but since mt/with-temp runs in a transaction, so we'll ignore them in this case.
toucan2.core/delete!
toucan2.core/update!
toucan2.core/insert!
toucan2.core/insert-returning-instance!
toucan2.core/insert-returning-instances!
toucan2.core/insert-returning-pk!
toucan2.core/insert-returning-pks!
clojure.core.async/<!!
clojure.core.async/>!!
clojure.core.async/alts!!
clojure.core.async/close!
clojure.core.async/poll!
clojure.core.memoize/memo-clear!
clojure.core/conj!
clojure.core/persistent!
clojure.core/reset!
clojure.core/swap!
clojure.core/volatile!
clojure.core/vreset!
clojure.core/vswap!
clojure.java.jdbc/execute!
methodical.core/add-aux-method-with-unique-key!
methodical.core/remove-aux-method-with-unique-key!
next.jdbc/execute!
;; Definitely thread safe
metabase.test.util.dynamic-redefs/patch-vars!
;; TODO: most of these symbols shouldn't be here, we should go through them and
;; find the functions/macros that use them and make sure their names end with !
;; best way to do this is try remove each of these and rely on kondo output to find places where it's used
clojure.test/grant-collection-perms!
clojure.test/grant-collection-perms-fn!
clojure.test/grant-perms-fn!
clojure.test/purge-old-entries!
clojure.test/revoke-collection-perms!
clojure.test/save-results!
metabase-enterprise.advanced-permissions.models.permissions/update-db-download-permissions!
metabase-enterprise.internal-user/install-internal-user!
metabase-enterprise.sso.integrations.saml-test/call-with-login-attributes-cleared!
metabase.actions.actions/perform-action!
metabase.analytics.snowplow-test/fake-track-event-impl!
metabase.analytics.snowplow/track-event-impl!
metabase.api.public-test/add-card-to-dashboard!
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.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.models.action/insert!
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.model-index/add-values!
metabase.models.moderation-review/create-review!
metabase.models.on-demand-test/add-dashcard-with-parameter-mapping!
metabase.models.permissions/grant-application-permissions!
metabase.models.permissions/grant-collection-read-permissions!
metabase.models.permissions/grant-collection-readwrite-permissions!
metabase.models.permissions/grant-full-data-permissions!
metabase.models.permissions/grant-native-readwrite-permissions!
metabase.models.permissions/grant-permissions!
metabase.models.permissions/revoke-application-permissions!
metabase.models.permissions/revoke-data-perms!
metabase.models.permissions/update-data-perms-graph!
metabase.models.permissions/update-group-permissions!
metabase.models.persisted-info/ready-database!
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.test-util/with-restored-perms!
metabase.pulse.send/send-notifications!
metabase.pulse.send/send-pulse!
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.setup.core/create-token!
metabase.sync.core/sync-database!
metabase.sync.sync-metadata.fields.sync-metadata/update-field-metadata-if-needed!
metabase.sync.sync-metadata/sync-db-metadata!
metabase.sync.util-test/sync-database!
metabase.sync.util/store-sync-summary!
metabase.task.index-values/job-init!
metabase.task.persist-refresh/job-init!
metabase.task.persist-refresh/refresh-tables!
metabase.task.persist-refresh/schedule-persistence-for-database!
metabase.task/delete-task!
metabase.test.data.bigquery-cloud-sdk/execute!
metabase.test.data.impl/copy-db-tables-and-fields!
metabase.test.data.impl/get-or-create-database!
metabase.test.data.impl/get-or-create-default-dataset!
metabase.test.data.impl.get-or-create/set-test-db-permissions!
metabase.test.data.interface/create-db!
metabase.test.data.interface/destroy-db!
metabase.test.data.oracle/create-user!
metabase.test.data.oracle/drop-user!
metabase.test.data.sql-jdbc.load-data/make-insert!
metabase.test.data.users/clear-cached-session-tokens!
metabase.test.initialize/do-initialization!
metabase.test.initialize/initialize-if-needed!
metabase.test.integrations.ldap/start-ldap-server!
metabase.test.util.log/ensure-unique-logger!
metabase.test.util.log/set-ns-log-level!
metabase.test.util/do-with-temp-env-var-value!
metabase.test.util/restore-raw-setting!
metabase.test.util/upsert-raw-setting!
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.util.files/create-dir-if-not-exists!
metabase.util.ssh-test/start-mock-servers!
metabase.util.ssh-test/stop-mock-servers!})
(defn- end-with-exclamation?
[s]
(str/ends-with? s "!"))
(defn- explicitly-safe? [qualified-symbol]
(contains? symbols-allowed-in-fns-not-ending-in-an-exclamation-point qualified-symbol))
(defn- explicitly-unsafe? [config qualified-symbol]
(contains? (get-in config [:linters :metabase/validate-deftest :parallel/unsafe]) qualified-symbol))
(defn- unsafe? [config qualified-symbol]
(and (or (end-with-exclamation? qualified-symbol)
(explicitly-unsafe? config qualified-symbol))
(not (explicitly-safe? qualified-symbol))))
(defn- non-thread-safe-form-should-end-with-exclamation*
[{[defn-or-defmacro form-name] :children, :as node} config]
(when-not (and (:string-value form-name)
(end-with-exclamation? (:string-value form-name)))
(letfn [(walk [f form]
(f form)
(doseq [child (:children form)]
(walk f child)))
(check-node [form]
(when-let [qualified-symbol (hooks.common/node->qualified-symbol form)]
(when (unsafe? config qualified-symbol)
(hooks/reg-finding!
(assoc (meta form-name)
:message (format "The name of this %s should end with `!` because it contains calls to non thread safe form `%s`. [:metabase/test-helpers-use-non-thread-safe-functions]"
(:string-value defn-or-defmacro) qualified-symbol)
:type :metabase/test-helpers-use-non-thread-safe-functions)))))]
(walk check-node node))
node))
(defn non-thread-safe-form-should-end-with-exclamation
"Used to ensure defn and defmacro in test namespace to have name ending with `!` if it's non-thread-safe.
A function or a macro can be defined as 'not thread safe' when their funciton name ends with a `!`.
Only used in tests to identify thread-safe/non-thread-safe test helpers. See #37126"
[{:keys [node cljc lang config]}]
(when (or (not cljc)
(= lang :clj))
(non-thread-safe-form-should-end-with-exclamation* node config))
{:node node})
(comment
(require '[clj-kondo.core :as clj-kondo])
(def form (str '(defmacro a
[x]
`(fun-call x))))
(def form "(defmacro a
[x]
`(some! ~x))")
(def form "(defun f
[x]
(let [g! (fn [] 1)]
(g!)))")
(str (hooks/parse-string form))
(hooks/sexpr (hooks/parse-string form))
(binding [hooks/*reload* true]
(-> form
(with-in-str (clj-kondo/run! {:lint ["-"]}))
:findings))
(do (non-thread-safe-form-should-end-with-exclamation* (hooks/parse-string form)) nil))
(defn- ns-form-node->require-node [ns-form-node]
(some (fn [node]
(when (and (hooks/list-node? node)
(let [first-child (first (:children node))]
(and (hooks/keyword-node? first-child)
(= (hooks/sexpr first-child) :require))))
node))
(:children ns-form-node)))
(defn- lint-require-shapes [ns-form-node]
(doseq [node (-> ns-form-node
ns-form-node->require-node
:children
rest)]
(cond
(not (hooks/vector-node? node))
(hooks/reg-finding! (assoc (meta node)
:message "All :required namespaces should be wrapped in vectors [:metabase/require-shape-checker]"
:type :metabase/require-shape-checker))
(hooks/vector-node? (second (:children node)))
(hooks/reg-finding! (assoc (meta node)
:message "Don't use prefix forms inside :require [:metabase/require-shape-checker]"
:type :metabase/require-shape-checker)))))
(defn- require-node->namespace-symb-nodes [require-node]
(let [[_ns & args] (:children require-node)]
(into []
;; prefixed namespace forms are NOT SUPPORTED!!!!!!!!1
(keep (fn [node]
(cond
(hooks/vector-node? node)
;; propagate the metadata attached to this vector in case there's a `:clj-kondo/ignore` form.
(let [symbol-node (first (:children node))]
(hooks.common/merge-ignored-linters symbol-node require-node node))
;; this should also be dead code since we require requires to be vectors
(hooks/token-node? node)
(hooks.common/merge-ignored-linters node require-node)
:else
(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 [ns-form-node]
(some-> (some (fn [node]
(when (and (hooks/token-node? node)
(not= (hooks/sexpr node) 'ns))
node))
(:children ns-form-node))
hooks/sexpr))
(defn- module
"E.g.
(module 'metabase.qp.middleware.wow) => 'metabase.qp"
[ns-symb]
(some-> (re-find #"^metabase\.[^.]+" (str ns-symb)) symbol))
(defn- ignored-namespace? [ns-symb config]
(some
(fn [pattern-str]
(re-find (re-pattern pattern-str) (str ns-symb)))
(:ignored-namespace-patterns config)))
(defn- module-api-namespaces
"Set API namespaces for a given module. `:any` means you can use anything, there are no API namespaces for this
module (yet). If unspecified, the default is just the `<module>.core` namespace."
[module config]
(let [module-config (get-in config [:api-namespaces module])]
(cond
(= module-config :any)
nil
(set? module-config)
module-config
:else
#{(symbol (str module ".core"))})))
(defn- lint-modules [ns-form-node config]
(let [ns-symb (ns-form-node->ns-symb ns-form-node)]
(when-not (ignored-namespace? ns-symb config)
(when-let [current-module (module ns-symb)]
(let [allowed-modules (get-in config [:allowed-modules current-module])
required-namespace-symb-nodes (-> ns-form-node
ns-form-node->require-node
require-node->namespace-symb-nodes)]
(doseq [node required-namespace-symb-nodes
:when (not (contains? (hooks.common/ignored-linters node) :metabase/ns-module-checker))
:let [required-namespace (hooks/sexpr node)
required-module (module required-namespace)]
;; ignore stuff not in a module i.e. non-Metabase stuff.
:when required-module
:let [in-current-module? (= required-module current-module)]
:when (not in-current-module?)
:let [allowed-module? (or (= allowed-modules :any)
(contains? (set allowed-modules) required-module))
module-api-namespaces (module-api-namespaces required-module config)
allowed-module-namespace? (or (empty? module-api-namespaces)
(contains? module-api-namespaces required-namespace))]]
(when-let [error (cond
(not allowed-module?)
(format "Module %s should not be used in the %s module. [:metabase/ns-module-checker :allowed-modules %s]"
required-module
current-module
current-module)
(not allowed-module-namespace?)
(format "Namespace %s is not an allowed external API namespace for the %s module. [:metabase/ns-module-checker :api-namespaces %s]"
required-namespace
required-module
required-module))]
(hooks/reg-finding! (assoc (meta node)
:message error
:type :metabase/ns-module-checker)))))))))
(defn lint-ns [x]
(lint-require-shapes (:node x))
(lint-modules (:node x) (get-in x [:config :linters :metabase/ns-module-checker]))
x)
(defn- check-arglists [report-node arglists]
(letfn [(reg-bad-arglists! []
(hooks/reg-finding!
(assoc (meta report-node)
:message ":arglists should be a quoted list of vectors [:metabase/check-defmulti-arglists]"
:type :metabase/check-defmulti-arglists)))
(reg-bad-arg! []
(hooks/reg-finding!
(assoc (meta report-node)
:message ":arglists should contain actual arg names, not underscore (unused) symbols [:metabase/check-defmulti-arglists]"
:type :metabase/check-defmulti-arglists)))
(underscore-arg? [arg]
(and (symbol? arg)
(str/starts-with? arg "_")))
(check-arglist [arglist]
(cond
(not (vector? arglist)) (reg-bad-arglists!)
(some underscore-arg? arglist) (reg-bad-arg!)))]
(if-not (and (seq? arglists)
(= (first arglists) 'quote)
(seq (second arglists)))
(reg-bad-arglists!)
(let [[_quote arglists] arglists]
(doseq [arglist arglists]
(check-arglist arglist))))))
(defn- defmulti-check-for-arglists-metadata
"Make sure a [[defmulti]] has an attribute map with `:arglists` metadata."
[node]
(let [[_defmulti _symb & args] (:children node)
[_docstring & args] (if (hooks/string-node? (first args))
args
(cons nil args))
attr-map (when (hooks/map-node? (first args))
(first args))
arglists (some-> attr-map hooks/sexpr :arglists seq)]
(if (not (seq? arglists))
(hooks/reg-finding!
(assoc (meta node)
:message "All defmultis should have an attribute map with :arglists metadata. [:metabase/check-defmulti-arglists]"
:type :metabase/check-defmulti-arglists))
(check-arglists attr-map arglists))))
(defn lint-defmulti [x]
(defmulti-check-for-arglists-metadata (:node x))
x)

View File

@@ -0,0 +1,52 @@
(ns hooks.clojure.core.defmulti
(:require
[clj-kondo.hooks-api :as hooks]
[clojure.string :as str]
[hooks.common]))
(defn- check-arglists [report-node arglists]
(letfn [(reg-bad-arglists! []
(hooks/reg-finding!
(assoc (meta report-node)
:message ":arglists should be a quoted list of vectors [:metabase/check-defmulti-arglists]"
:type :metabase/check-defmulti-arglists)))
(reg-bad-arg! []
(hooks/reg-finding!
(assoc (meta report-node)
:message ":arglists should contain actual arg names, not underscore (unused) symbols [:metabase/check-defmulti-arglists]"
:type :metabase/check-defmulti-arglists)))
(underscore-arg? [arg]
(and (symbol? arg)
(str/starts-with? arg "_")))
(check-arglist [arglist]
(cond
(not (vector? arglist)) (reg-bad-arglists!)
(some underscore-arg? arglist) (reg-bad-arg!)))]
(if-not (and (seq? arglists)
(= (first arglists) 'quote)
(seq (second arglists)))
(reg-bad-arglists!)
(let [[_quote arglists] arglists]
(doseq [arglist arglists]
(check-arglist arglist))))))
(defn- defmulti-check-for-arglists-metadata
"Make sure a [[defmulti]] has an attribute map with `:arglists` metadata."
[node]
(let [[_defmulti _symb & args] (:children node)
[_docstring & args] (if (hooks/string-node? (first args))
args
(cons nil args))
attr-map (when (hooks/map-node? (first args))
(first args))
arglists (some-> attr-map hooks/sexpr :arglists seq)]
(if-not (seq? arglists) ; should be a list or at least list-like
(hooks/reg-finding!
(assoc (meta node)
:message "All defmultis should have an attribute map with :arglists metadata. [:metabase/check-defmulti-arglists]"
:type :metabase/check-defmulti-arglists))
(check-arglists attr-map arglists))))
(defn lint-defmulti [x]
(defmulti-check-for-arglists-metadata (:node x))
x)

View File

@@ -0,0 +1,76 @@
(ns hooks.clojure.core.defn
(:require
[clj-kondo.hooks-api :as hooks]
[clojure.string :as str]
[hooks.common]))
(defn- end-with-exclamation?
[s]
(str/ends-with? s "!"))
(defn- explicitly-safe? [config qualified-symbol]
(contains? (get-in config [:linters :metabase/test-helpers-use-non-thread-safe-functions :explicitly-safe])
qualified-symbol))
(defn- explicitly-unsafe? [config qualified-symbol]
(contains? (get-in config [:linters :metabase/validate-deftest :parallel/unsafe]) qualified-symbol))
(defn- unsafe? [config qualified-symbol]
(and (or (end-with-exclamation? qualified-symbol)
(explicitly-unsafe? config qualified-symbol))
(not (explicitly-safe? config qualified-symbol))))
(defn- non-thread-safe-form-should-end-with-exclamation*
[{[defn-or-defmacro form-name] :children, :as node} config]
(when-not (and (:string-value form-name)
(end-with-exclamation? (:string-value form-name)))
(letfn [(walk [f form]
(f form)
(doseq [child (:children form)]
(walk f child)))
(check-node [form]
(when-let [qualified-symbol (hooks.common/node->qualified-symbol form)]
(when (unsafe? config qualified-symbol)
(hooks/reg-finding!
(assoc (meta form-name)
:message (format "The name of this %s should end with `!` because it contains calls to non thread safe form `%s`. [:metabase/test-helpers-use-non-thread-safe-functions]"
(:string-value defn-or-defmacro) qualified-symbol)
:type :metabase/test-helpers-use-non-thread-safe-functions)))))]
(walk check-node node))
node))
(defn non-thread-safe-form-should-end-with-exclamation
"Used to ensure defn and defmacro in test namespace to have name ending with `!` if it's non-thread-safe.
A function or a macro can be defined as 'not thread safe' when their funciton name ends with a `!`.
Only used in tests to identify thread-safe/non-thread-safe test helpers. See #37126"
[{:keys [node cljc lang config]}]
(when (or (not cljc)
(= lang :clj))
(non-thread-safe-form-should-end-with-exclamation* node config))
{:node node})
(comment
(require '[clj-kondo.core :as clj-kondo])
(def form (str '(defmacro a
[x]
`(fun-call x))))
(def form "(defmacro a
[x]
`(some! ~x))")
(def form "(defun f
[x]
(let [g! (fn [] 1)]
(g!)))")
(str (hooks/parse-string form))
(hooks/sexpr (hooks/parse-string form))
(binding [hooks/*reload* true]
(-> form
(with-in-str (clj-kondo/run! {:lint ["-"]}))
:findings))
(do (non-thread-safe-form-should-end-with-exclamation* (hooks/parse-string form)) nil))

View File

@@ -0,0 +1,91 @@
(ns hooks.clojure.core.ns
(:require
[clj-kondo.hooks-api :as hooks]
[hooks.common]
[hooks.common.modules :as modules]))
(defn- ns-form-node->require-node [ns-form-node]
(some (fn [node]
(when (and (hooks/list-node? node)
(let [first-child (first (:children node))]
(and (hooks/keyword-node? first-child)
(= (hooks/sexpr first-child) :require))))
node))
(:children ns-form-node)))
(defn- lint-require-shapes [ns-form-node]
(doseq [node (-> ns-form-node
ns-form-node->require-node
:children
rest)]
(cond
(not (hooks/vector-node? node))
(hooks/reg-finding! (assoc (meta node)
:message "All :required namespaces should be wrapped in vectors [:metabase/require-shape-checker]"
:type :metabase/require-shape-checker))
(hooks/vector-node? (second (:children node)))
(hooks/reg-finding! (assoc (meta node)
:message "Don't use prefix forms inside :require [:metabase/require-shape-checker]"
:type :metabase/require-shape-checker)))))
(defn- lint-requires-on-new-lines [ns-form-node]
(let [[require-keyword first-require] (-> ns-form-node
ns-form-node->require-node
:children)]
(when-let [require-keyword-line (:row (meta require-keyword))]
(when-let [first-require-line (:row (meta first-require))]
(when (= require-keyword-line first-require-line)
(hooks/reg-finding! (assoc (meta first-require)
:message "Put your requires on a newline from the :require keyword [:metabase/require-shape-checker]"
:type :metabase/require-shape-checker)))))))
(defn- require-node->namespace-symb-nodes [require-node]
(let [[_ns & args] (:children require-node)]
(into []
;; prefixed namespace forms are NOT SUPPORTED!!!!!!!!1
(keep (fn [node]
(cond
(hooks/vector-node? node)
;; propagate the metadata attached to this vector in case there's a `:clj-kondo/ignore` form.
(let [symbol-node (first (:children node))]
(hooks.common/merge-ignored-linters symbol-node require-node node))
;; this should also be dead code since we require requires to be vectors
(hooks/token-node? node)
(hooks.common/merge-ignored-linters node require-node)
:else
(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 [ns-form-node]
(some-> (some (fn [node]
(when (and (hooks/token-node? node)
(not= (hooks/sexpr node) 'ns))
node))
(:children ns-form-node))
hooks/sexpr))
(defn- lint-modules [ns-form-node config]
(let [ns-symb (ns-form-node->ns-symb ns-form-node)]
(when-not (modules/ignored-namespace? config ns-symb)
(when-let [current-module (modules/module ns-symb)]
(let [required-namespace-symb-nodes (-> ns-form-node
ns-form-node->require-node
require-node->namespace-symb-nodes)]
(doseq [node required-namespace-symb-nodes
:when (not (contains? (hooks.common/ignored-linters node) :metabase/modules))
:let [required-namespace (hooks/sexpr node)
error (modules/usage-error config current-module required-namespace)]
:when error]
(hooks/reg-finding! (assoc (meta node)
:message error
:type :metabase/modules))))))))
(defn lint-ns [x]
(doto (:node x)
lint-require-shapes
lint-requires-on-new-lines
(lint-modules (modules/config x)))
x)

View File

@@ -0,0 +1,69 @@
(ns hooks.clojure.core.require
(:require
[clj-kondo.hooks-api :as hooks]
[hooks.common.modules :as modules]))
(defn- lint* [node current-ns config required-namespaces]
{:pre [(map? node)
(simple-symbol? current-ns)
(map? config)
(sequential? required-namespaces)
(every? simple-symbol? required-namespaces)]}
(when-not (modules/ignored-namespace? config current-ns)
;; ignore namespaces outside of the module system
(when-let [current-module (modules/module current-ns)]
(doseq [required-namespace required-namespaces]
;; ignore namespaces outside of the module system.
(when (modules/module required-namespace)
(when-let [error (modules/usage-error config current-module required-namespace)]
(hooks/reg-finding! (assoc (meta node)
:message error
:type :metabase/modules))))))))
(defn- unwrap-require [node]
(case (hooks/tag node)
;; some.namespace of some.namespace/some-var
:token
(let [sexpr (hooks/sexpr node)]
(if (qualified-symbol? sexpr)
(symbol (namespace sexpr))
sexpr))
;; (quote some.namespace)
:list
(let [[x y] (:children node)]
(when (and (hooks/token-node? x)
(= (hooks/sexpr x) 'quote))
(recur y)))
;; 'some.namespace
:quote
(recur (first (:children node)))
;; something like [some.namespace :as whatever]
:vector
(recur (first (:children node)))))
(comment
(unwrap-require (-> "(requiring-resolve 'metabase.notification.payload.execute/execute-dashboard)"
hooks/parse-string
:children
second)))
(defn- lint-require* [node current-ns config]
(let [[_require & args] (:children node)
required-namespaces (keep unwrap-require args)]
(lint* node current-ns config required-namespaces)))
(defn- lint-requiring-resolve* [node current-ns config]
(let [[_requiring-resolve symb-node] (:children node)
required-namespace (unwrap-require symb-node)]
(lint* node current-ns config [required-namespace])))
(defn lint-require [x]
(lint-require* (:node x) (:ns x) (modules/config x))
x)
(defn lint-requiring-resolve [x]
(lint-requiring-resolve* (:node x) (:ns x) (modules/config x))
x)

View File

@@ -0,0 +1,81 @@
(ns hooks.common.modules)
(defn ignored-namespace? [config ns-symb]
(some
(fn [pattern-str]
(re-find (re-pattern pattern-str) (str ns-symb)))
(:ignored-namespace-patterns config)))
(defn config [{:keys [config], :as _hook-input}]
(merge (get-in config [:linters :metabase/modules])
(select-keys config [:metabase/modules])))
(defn module
"E.g.
(module 'metabase.qp.middleware.wow) => 'qp
(module 'metabase-enterprise.whatever.core) => enterprise/whatever"
[ns-symb]
{:pre [(simple-symbol? ns-symb)]}
(or (some->> (re-find #"^metabase-enterprise\.([^.]+)" (str ns-symb))
second
(symbol "enterprise"))
(some-> (re-find #"^metabase\.([^.]+)" (str ns-symb))
second
symbol)))
(defn module-api-namespaces
"Set of API namespace symbols for a given module. `:any` means you can use anything, there are no API namespaces for
this module (yet). If unspecified, the default is just the `<module>.core` namespace."
[config module]
(let [module-config (get-in config [:metabase/modules module :api])]
(cond
(= module-config :any)
nil
(set? module-config)
module-config
:else
(let [ns-prefix (if (= (namespace module) "enterprise")
(str "metabase-enterprise." (name module))
(name module))]
#{(symbol (str ns-prefix ".api"))
(symbol (str ns-prefix ".core"))
(symbol (str ns-prefix ".init"))}))))
(defn allowed-modules
"Set of namespace symbols that `module` is allowed to use. `:any` means it's allowed to use anything."
[config module]
(get-in config [:metabase/modules module :uses]))
(defn allowed-module? [config module required-module]
(let [allowed-modules (allowed-modules config module)]
(or (= allowed-modules :any)
(contains? (set allowed-modules) required-module))))
(defn allowed-module-namespace? [config ns-symb]
(let [module (module ns-symb)
module-api-namespaces (module-api-namespaces config module)]
(or (empty? module-api-namespaces)
(contains? module-api-namespaces ns-symb))))
(defn usage-error
"Find usage errors when a `required-namespace` is required in the `current-module`. Returns a string describing the
error type if there is one, otherwise `nil` if there are no errors."
[config current-module required-namespace]
;; ignore stuff not in a module i.e. non-Metabase stuff.
(when-let [required-module (module required-namespace)]
(when-not (= current-module required-module)
(cond
(not (allowed-module? config current-module required-module))
(format "Module %s should not be used in the %s module. [:metabase/modules %s :uses]"
required-module
current-module
current-module)
(not (allowed-module-namespace? config required-namespace))
(format "Namespace %s is not an allowed external API namespace for the %s module. [:metabase/modules %s :api]"
required-namespace
required-module
required-module)))))

View File

@@ -1,32 +0,0 @@
(ns hooks.metabase.api.common
(:require
[clj-kondo.hooks-api :as api]
[clojure.string :as str]
[hooks.common]))
(defn route-fn-name
"route fn hook"
[method route]
(let [route (if (vector? route) (first route) route)]
(-> (str (name method) route)
(str/replace #"/" "_")
symbol)))
(defn defendpoint
[arg]
(letfn [(update-defendpoint [node]
(let [[_defendpoint method route & body] (:children node)]
(-> (api/list-node
(list
(api/token-node 'do)
(-> (api/token-node (symbol "compojure.core" (str (api/sexpr method))))
(with-meta (meta method)))
(api/list-node
(list*
(api/token-node 'clojure.core/defn)
(-> (api/token-node (route-fn-name (api/sexpr method) (api/sexpr route)))
(with-meta (meta route)))
body))))
(with-meta (meta node))
hooks.common/add-lsp-ignore-unused-public-var-metadata)))]
(update arg :node update-defendpoint)))

View File

@@ -3,6 +3,7 @@
[clj-kondo.hooks-api :as hooks]
[hooks.common :as common]))
;;; TODO -- move this into
(def ^:private ignored-implicit-export?
'#{active-users-count
admin-email

View File

@@ -1,4 +1,4 @@
(ns hooks.metabase.api.search-test
(ns hooks.metabase.search.api-test
(:require [clj-kondo.hooks-api :as hooks]))
(defn with-search-items-in-collection [{{[_ & args] :children, :as node} :node}]

View File

@@ -1,5 +1,6 @@
(ns hooks.metabase.api.automagic-dashboards-test
(:require [clj-kondo.hooks-api :as hooks]))
(ns hooks.metabase.xrays.api.automagic-dashboards-test
(:require
[clj-kondo.hooks-api :as hooks]))
(comment
@@ -10,7 +11,7 @@
(println (hooks/sexpr input))
(let [f (load-file ".clj-kondo/hooks/metabase/api/automagic_dashboards_test.clj")]
(let [f (load-file ".clj-kondo/hooks/metabase/xrays/api/automagic_dashboards_test.clj")]
(f {:node input})))
(defn with-indexed-model!

View File

@@ -0,0 +1,63 @@
(ns hooks.clojure.core.defmulti-test
(:require
[clj-kondo.hooks-api :as hooks]
[clj-kondo.impl.utils]
[clojure.test :refer :all]
[hooks.clojure.core.defmulti]))
(defn- lint-defmulti [form]
(binding [clj-kondo.impl.utils/*ctx* {:config {:linters {:metabase/check-defmulti-arglists {:level :warning}}}
:ignores (atom nil)
:findings (atom [])
:namespaces (atom {})}]
(hooks.clojure.core.defmulti/lint-defmulti {:node (hooks/parse-string (pr-str form))})
@(:findings clj-kondo.impl.utils/*ctx*)))
(deftest ^:parallel defmulti-missing-arglists-test
(testing "missing arglists"
(is (=? [{:message "All defmultis should have an attribute map with :arglists metadata. [:metabase/check-defmulti-arglists]"}]
(lint-defmulti '(defmulti expand-visualization
(fn [card _ _]
(-> card :visualization first))))))))
(deftest ^:parallel defmulti-invalid-arglists-test
(testing "invalid arglists"
(are [form] (=? [{:message ":arglists should be a quoted list of vectors [:metabase/check-defmulti-arglists]"}]
(lint-defmulti form))
'(defmulti expand-visualization
{:arglists '()}
(fn [card _ _]
(-> card :visualization first)))
'(defmulti expand-visualization
{:arglists ([a])} ; unquoted
(fn [card _ _]
(-> card :visualization first)))
'(defmulti expand-visualization
{:arglists '[(a)]}
(fn [card _ _]
(-> card :visualization first)))
'(defmulti expand-visualization
{:arglists '((a))}
(fn [card _ _]
(-> card :visualization first))))))
(deftest ^:parallel defmulti-arglists-with-underscore-args-test
(testing "arglists, but some symbols are _"
(are [form] (=? [{:message ":arglists should contain actual arg names, not underscore (unused) symbols [:metabase/check-defmulti-arglists]"}]
(lint-defmulti form))
'(defmulti expand-visualization
{:arglists '([card _ _])}
(fn [card _ _]
(-> card :visualization first)))
'(defmulti expand-visualization
{:arglists '([card _bad _arg])}
(fn [card _ _]
(-> card :visualization first))))))
(deftest ^:parallel defmulti-arglists-ok-test
(testing "good"
(is (= []
(lint-defmulti '(defmulti expand-visualization
{:arglists '([card x y])}
(fn [card _ _]
(-> card :visualization first))))))))

View File

@@ -0,0 +1,74 @@
(ns hooks.clojure.core.ns-test
(:require
[clj-kondo.hooks-api :as hooks]
[clj-kondo.impl.utils]
[clojure.test :refer :all]
[hooks.clojure.core.ns]))
(defn- lint-ns [form config]
(binding [clj-kondo.impl.utils/*ctx* {:config config
:ignores (atom nil)
:findings (atom [])
:namespaces (atom {})}]
(hooks.clojure.core.ns/lint-ns {:node (hooks/parse-string
(binding [*print-meta* true]
(pr-str form)))
:config config})
@(:findings clj-kondo.impl.utils/*ctx*)))
(defn- lint-modules [form config]
(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}}}}))))
(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]"
:type :metabase/modules}]
(lint-modules
'(ns metabase.api.search
(:require
[metabase.search.config :as search.config]
[metabase.search.core :as search]))
'{:metabase/modules {api {:uses #{search}}
search {:api #{metabase.search.core}}}}))))
(deftest ^:parallel module-checker-api-namespaces-ignore-test
(is (empty? (lint-modules
'(ns metabase.api.search
(:require
^{:clj-kondo/ignore [:metabase/modules]}
[metabase.search.config :as search.config]
[metabase.search.core :as search]))
'{:metabase/modules {api {:uses #{search}}
search {:api #{metabase.search.core}}}}))))
(deftest ^:parallel module-checker-enterprise-test
(is (=? [{:message "Module search should not be used in the enterprise/search module. [:metabase/modules enterprise/search :uses]"
:type :metabase/modules}]
(lint-modules
'(ns metabase-enterprise.search.core
(:require
[metabase.search.core :as search]))
'{:metabase/modules {search {:api #{metabase.search.core}}}}))))
(deftest ^:parallel require-newlines-test
(binding [clj-kondo.impl.utils/*ctx* {:config {:linters {:metabase/require-shape-checker {:level :warnings}}}
:ignores (atom nil)
:findings (atom [])
:namespaces (atom {})}]
(hooks.clojure.core.ns/lint-ns {:node (hooks/parse-string "
(ns metabase.task.cache
(:require [metabase.task.bunny]
[metabase.task.rabbit]))")})
(is (=? [{:message "Put your requires on a newline from the :require keyword [:metabase/require-shape-checker]",
:type :metabase/require-shape-checker}]
@(:findings clj-kondo.impl.utils/*ctx*)))))

View File

@@ -1,111 +0,0 @@
(ns hooks.clojure.core-test
(:require
[clj-kondo.hooks-api :as hooks]
[clojure.test :refer :all]
[hooks.clojure.core]))
(deftest module-checker-allowed-modules-test
(let [findings (atom [])]
(with-redefs [hooks/reg-finding! (fn [node]
(swap! findings conj node))]
(hooks.clojure.core/lint-ns
{:node (hooks/parse-string "
(ns metabase.api.search
(:require
[metabase.request.core :as request]
[metabase.task :as task]))")
:config '{:linters {:metabase/ns-module-checker {:allowed-modules {metabase.api #{metabase.request}}
:api-namespaces {metabase.request #{metabase.request.core}}}}}})
(is (=? [{:message (str "Module metabase.task should not be used in the metabase.api module."
" [:metabase/ns-module-checker :allowed-modules metabase.api]")
:type :metabase/ns-module-checker}]
@findings)))))
(deftest module-checker-api-namespaces-test
(let [findings (atom [])]
(with-redefs [hooks/reg-finding! (fn [node]
(swap! findings conj node))]
(hooks.clojure.core/lint-ns
{:node (hooks/parse-string "
(ns metabase.api.search
(:require
[metabase.search.config :as search.config]
[metabase.search.core :as search]))")
:config '{:linters {:metabase/ns-module-checker {:allowed-modules {metabase.api #{metabase.search}}
:api-namespaces {metabase.search #{metabase.search.core}}}}}})
(is (=? [{:message (str "Namespace metabase.search.config is not an allowed external API namespace for the"
" metabase.search module. [:metabase/ns-module-checker :api-namespaces metabase.search]")
:type :metabase/ns-module-checker}]
@findings)))))
(deftest module-checker-api-namespaces-ignore-test
(let [findings (atom [])]
(with-redefs [hooks/reg-finding! (fn [node]
(swap! findings conj node))]
(hooks.clojure.core/lint-ns
{:node (hooks/parse-string "
(ns metabase.api.search
(:require
^{:clj-kondo/ignore [:metabase/ns-module-checker]}
[metabase.search.config :as search.config]
[metabase.search.core :as search]))")
:config '{:linters {:metabase/ns-module-checker {:allowed-modules {metabase.api #{metabase.search}}
:api-namespaces {metabase.search #{metabase.search.core}}}}}})
(is (empty? @findings)))))
(defn- lint-defmulti! [form]
(let [findings (atom [])
node (hooks/parse-string (pr-str form))]
(with-redefs [hooks/reg-finding! (fn [node]
(swap! findings conj node))]
(hooks.clojure.core/lint-defmulti {:node node})
@findings)))
(deftest defmulti-missing-arglists-test
(testing "missing arglists"
(is (=? [{:message "All defmultis should have an attribute map with :arglists metadata. [:metabase/check-defmulti-arglists]"}]
(lint-defmulti! '(defmulti expand-visualization
(fn [card _ _]
(-> card :visualization first))))))))
(deftest defmulti-invalid-arglists-test
(testing "invalid arglists"
(are [form] (=? [{:message ":arglists should be a quoted list of vectors [:metabase/check-defmulti-arglists]"}]
(lint-defmulti! form))
'(defmulti expand-visualization
{:arglists '()}
(fn [card _ _]
(-> card :visualization first)))
'(defmulti expand-visualization
{:arglists ([a])} ; unquoted
(fn [card _ _]
(-> card :visualization first)))
'(defmulti expand-visualization
{:arglists '[(a)]}
(fn [card _ _]
(-> card :visualization first)))
'(defmulti expand-visualization
{:arglists '((a))}
(fn [card _ _]
(-> card :visualization first))))))
(deftest defmulti-arglists-with-underscore-args-test
(testing "arglists, but some symbols are _"
(are [form] (=? [{:message ":arglists should contain actual arg names, not underscore (unused) symbols [:metabase/check-defmulti-arglists]"}]
(lint-defmulti! form))
'(defmulti expand-visualization
{:arglists '([card _ _])}
(fn [card _ _]
(-> card :visualization first)))
'(defmulti expand-visualization
{:arglists '([card _bad _arg])}
(fn [card _ _]
(-> card :visualization first))))))
(deftest defmulti-arglists-ok-test
(testing "good"
(is (= []
(lint-defmulti! '(defmulti expand-visualization
{:arglists '([card x y])}
(fn [card _ _]
(-> card :visualization first))))))))

View File

@@ -0,0 +1,10 @@
(ns hooks.common.modules-test
(:require
[clojure.test :refer :all]
[hooks.common.modules]))
(deftest ^:parallel module-test
(are [symb expected] (= expected
(hooks.common.modules/module symb))
'metabase.qp.middleware.wow 'qp
'metabase-enterprise.whatever.core 'enterprise/whatever))

View File

@@ -6,16 +6,16 @@
[hooks.common]))
(deftest ^:parallel ignored-linters-test
(doseq [ignored [":metabase/ns-module-checker"
"[:metabase/ns-module-checker]"
"(:metabase/ns-module-checker)"]
(doseq [ignored [":metabase/modules"
"[:metabase/modules]"
"(:metabase/modules)"]
prefix ["#_"
"^"]
:let [s (format "%s{:clj-kondo/ignore %s} [metabase.search.config :as search.config]"
prefix
ignored)]]
(testing (pr-str s)
(is (= #{:metabase/ns-module-checker}
(is (= #{:metabase/modules}
(hooks.common/ignored-linters (api/parse-string s)))))))
(deftest ^:parallel merge-ignored-linters-test

View File

@@ -1,35 +0,0 @@
(ns hooks.metabase.api.common-test
(:require
[clj-kondo.hooks-api :as api]
[clojure.test :refer :all]
[hooks.metabase.api.common]))
(deftest ^:parallel defendpoint-test
(is (= '(do
compojure.core/POST
(clojure.core/defn
POST_:id_copy
"Copy a `Card`, with the new name 'Copy of _name_'"
[id]
{id [:maybe ms/PositiveInt]}
(let [orig-card (api/read-check Card id)
new-name (str (trs "Copy of ") (:name orig-card))
new-card (assoc orig-card :name new-name)]
(-> (card/create-card! new-card @api/*current-user*)
hydrate-card-details
(assoc :last-edit-info (last-edit/edit-information-for-user @api/*current-user*))))))
(-> {:node (-> '(api/defendpoint POST "/:id/copy"
"Copy a `Card`, with the new name 'Copy of _name_'"
[id]
{id [:maybe ms/PositiveInt]}
(let [orig-card (api/read-check Card id)
new-name (str (trs "Copy of ") (:name orig-card))
new-card (assoc orig-card :name new-name)]
(-> (card/create-card! new-card @api/*current-user*)
hydrate-card-details
(assoc :last-edit-info (last-edit/edit-information-for-user @api/*current-user*)))))
pr-str
api/parse-string)}
hooks.metabase.api.common/defendpoint
:node
api/sexpr))))

View File

@@ -81,7 +81,7 @@
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.impersonation.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]]
@@ -102,7 +102,6 @@
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.alert-test/with-alert-in-collection [[:block 1]]
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]]
@@ -114,9 +113,6 @@
metabase.api.common/check [[:default]]
metabase.api.common/define-routes [[:block 0]]
metabase.api.common/let-404 [[:block 1]]
metabase.api.common.internal/auto-coerce [[:block 1]]
metabase.api.common.internal/auto-parse [[:block 1]]
metabase.api.common.internal-test/no-route-regexes [[:block 0]]
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]]
@@ -131,8 +127,6 @@
metabase.api.public-test/with-temp-public-card [[:block 1]]
metabase.api.public-test/with-temp-public-dashboard [[:block 1]]
metabase.api.public-test/with-temp-public-dashboard-and-card [[:block 1]]
metabase.api.search-test/do-test-users [[:block 1]]
metabase.api.session/http-401-on-error [[: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]]
@@ -175,11 +169,14 @@
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.pulse-test/with-dashboard-subscription-in-collection [[:block 1]]
metabase.models.pulse-test/with-pulse-in-collection [[:inner 0]]
metabase.models.setting/defsetting [[:block 1]]
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.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]]
@@ -197,11 +194,13 @@
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/streaming-response [[:block 2]]
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]]

View File

@@ -20,11 +20,7 @@
(clojure-mode
;; Specify which arg is the docstring for certain macros
;; (Add more as needed)
(eval . (put 'defendpoint-schema 'clojure-doc-string-elt 3))
(eval . (put 'defendpoint 'clojure-doc-string-elt 3))
(eval . (put 'define-premium-feature 'clojure-doc-string-elt 2))
(eval . (put 'api/defendpoint-schema 'clojure-doc-string-elt 3))
(eval . (put 'api/defendpoint 'clojure-doc-string-elt 3))
(eval . (put 'api.macros/defendpoint 'clojure-doc-string-elt 3))
(eval . (put 'defsetting 'clojure-doc-string-elt 2))
(eval . (put 'setting/defsetting 'clojure-doc-string-elt 2))

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: {
@@ -17,7 +21,7 @@ module.exports = {
{
vars: "all",
args: "none",
varsIgnorePattern: "^_",
varsIgnorePattern: "^_.+$",
ignoreRestSiblings: true,
},
],
@@ -108,7 +112,6 @@ module.exports = {
"When",
"Then",
"describeWithSnowplow",
"describeEE",
],
},
],
@@ -132,7 +135,7 @@ module.exports = {
"jest/globals": true,
},
parser: "babel-eslint",
plugins: ["react", "no-only-tests", "postcss-modules"],
plugins: ["react", "no-only-tests", "postcss-modules", "ttag"],
extends: [
"eslint:recommended",
"plugin:react/recommended",
@@ -143,6 +146,7 @@ module.exports = {
"plugin:import/typescript",
"plugin:depend/recommended",
"plugin:storybook/recommended",
"plugin:i18next/recommended",
],
settings: {
"import/internal-regex": "^metabase/|^metabase-lib/",
@@ -199,6 +203,22 @@ module.exports = {
"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"],
@@ -220,10 +240,10 @@ module.exports = {
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
argsIgnorePattern: "^_.+$",
varsIgnorePattern: "^_.+$",
ignoreRestSiblings: true,
destructuredArrayIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_.+$",
},
],
// This was introduced in 6.0.0
@@ -284,5 +304,17 @@ module.exports = {
],
},
},
{
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",
},
},
],
};

230
.github/CODEOWNERS vendored
View File

@@ -1,34 +1,248 @@
# Before changing this file, make sure you have read how we use it:
# https://www.notion.so/metabase/Pull-Request-Code-Review-Guide-374f05df889748b69d67af753f9bc9b8?pvs=4#36550c04ceab40b5a8b8bee6264b090c
enterprise/backend/src/metabase_enterprise/advanced_permissions @noahmoss
enterprise/backend/src/metabase_enterprise/audit_app @noahmoss
enterprise/backend/src/metabase_enterprise/sso @noahmoss
enterprise/backend/src/metabase_enterprise/task/truncate_audit_table.clj @noahmoss
enterprise/backend/src/metabase_enterprise/internal_user.clj @noahmoss
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
src/metabase/**/*permissions* @noahmoss
src/metabase/integrations @noahmoss
snowplow/* @metabase/data
e2e/* @filiphric
e2e @filiphric
.github @metabase/devexp
.clj-kondo @metabase/devexp
#
# Backend modules <=> teams that own them
#
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_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/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/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/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/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/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/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/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/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/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/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/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/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/analyze @metabase/drivers
test/metabase/analyze @metabase/drivers
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/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/cmd @metabase/devexp
test/metabase/cmd @metabase/devexp
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/cmd @metabase/devexp
test/metabase/cmd @metabase/devexp
src/metabase/config @metabase/devexp
test/metabase/config @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/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/events @metabase/devexp
test/metabase/events @metabase/devexp
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/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/lib @metabase/core-backend-querying
test/metabase/lib @metabase/core-backend-querying
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/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/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/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/public_settings @metabase/core-backend-admin-webapp
test/metabase/public_settings @metabase/core-backend-admin-webapp
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_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/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/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/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/setup @metabase/core-backend-admin-webapp
test/metabase/setup @metabase/core-backend-admin-webapp
src/metabase/sync @metabase/drivers
test/metabase/sync @metabase/drivers
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/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/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/util @metabase/devexp
test/metabase/util @metabase/devexp
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

@@ -5,7 +5,7 @@ PENDING CI / PENDING REVIEW / READY _(choose one and update accordingly)_
- Reproduces #XXXXX
### How to test this manually?
- `yarn test-cypress-open`
- `yarn test-cypress`
- `relative/path/to/the/file`
> _(For still unfixed bug)_
- Replace `it.skip()` with `it.only()` to run the test in isolation

View File

@@ -30,7 +30,7 @@ runs:
shell: bash
- uses: actions/setup-node@v4
with:
node-version: lts/Hydrogen # 18.x.x
node-version: lts/Jod # 22.x.x
- run: rm package.json && npm install yaml
shell: bash
- name: parse drivers registry
@@ -64,10 +64,7 @@ runs:
const extraDrivers = {
firebolt: getDriverUrl('firebolt'),
starburst: getDriverUrl('starburst'),
exasol: getDriverUrl('exasol'),
exasol_jdbc: drivers.find(d => d.name === 'exasol').deps[0],
clickhouse: getDriverUrl('clickhouse'),
ocient: getDriverUrl('ocient'),
materialize: getDriverUrl('materialize'),
};
@@ -75,38 +72,31 @@ runs:
return extraDrivers;
- name: Download Firebolt driver
if: ${{ fromJson(steps.drivers_registry.outputs.result).firebolt != 'noop' }}
run: |
curl -OL ${{ fromJson(steps.drivers_registry.outputs.result).firebolt }}
working-directory: modules
shell: bash
- name: Download Starburst driver
if: ${{ fromJson(steps.drivers_registry.outputs.result).starburst != 'noop' }}
run: |
curl -OL ${{ fromJson(steps.drivers_registry.outputs.result).starburst }}
shell: bash
working-directory: modules
- name: Download Exasol driver
run: |
curl -OL ${{ fromJson(steps.drivers_registry.outputs.result).exasol }}
curl -OL ${{ fromJson(steps.drivers_registry.outputs.result).exasol_jdbc }}
shell: bash
working-directory: modules
- name: Download Clickhouse driver
if: ${{ fromJson(steps.drivers_registry.outputs.result).clickhouse != 'noop' }}
run: |
curl -OL ${{ fromJson(steps.drivers_registry.outputs.result).clickhouse }}
shell: bash
working-directory: modules
- name: Download Ocient driver
run: |
curl -OL ${{ fromJson(steps.drivers_registry.outputs.result).ocient }}
shell: bash
working-directory: modules
- name: Download Materialize driver
if: ${{ fromJson(steps.drivers_registry.outputs.result).materialize != 'noop' }}
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
run: test -n "$(find modules -maxdepth 1 -name '*.jar' -print -quit)" && jar uf bin/docker/metabase.jar modules/*.jar
shell: bash
- name: Launch uberjar
run: >-

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

@@ -5,16 +5,56 @@ inputs:
include-log:
required: false
default: true
remove-previous-comment:
required: false
type: boolean
default: false
runs:
using: "composite"
steps:
- uses: actions/github-script@v7
id: get-latest-release-branch
- name: Remove previous pull-request comment
uses: actions/github-script@v7
if: inputs.remove-previous-comment == 'true'
with:
script: |
const { owner, repo } = context.repo;
const { data: comments } = await github.rest.issues.listComments({
owner,
repo,
issue_number: context.issue.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
id: notify-pull-request
with:
result-encoding: string
script: |
const message = "${{ inputs.message }}"
script: | # js
const pr = context.payload.pull_request ?? context.payload.issue;
if (!pr) {
console.error("This action can only be run on pull requests");
return;
}
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

@@ -5,6 +5,7 @@ default: &default
shared_sources: &shared_sources
- "src/**/*.cljc"
- "src/**/*.cljs"
- "package.json"
shared_specs: &shared_specs
- "test/**/*.cljc"
@@ -30,6 +31,9 @@ frontend_sources: &frontend_sources
- "webpack.static-viz.config.js"
- ".nvmrc"
frontend_embedding_sdk_sources:
- *frontend_sources
frontend_specs: &frontend_specs
- *shared_specs
- "frontend/test/**"

3
.github/team.json vendored
View File

@@ -47,7 +47,8 @@
"piranha",
"crisptrutski",
"deniskaber",
"wotbrew"
"wotbrew",
"spalt08"
]
},
{

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

@@ -1,70 +1,19 @@
name: Backend
on:
push:
branches:
- "master"
- "release-**"
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled]
workflow_call:
inputs:
skip:
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}-backend
cancel-in-progress: true
jobs:
files-changed:
name: Check which files changed
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
backend_all: ${{ steps.changes.outputs.backend_all }}
frontend_sources: ${{ steps.changes.outputs.frontend_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
static-viz-files-changed:
needs: files-changed
if: needs.files-changed.outputs.backend_all != 'true' && needs.files-changed.outputs.frontend_sources == 'true'
name: Check whether static-viz files changed
runs-on: ubuntu-22.04
timeout-minutes: 10
outputs:
static_viz: ${{ steps.static_viz.outputs.static_viz }}
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "files-changed"
- name: Build static-viz frontend
run: yarn build-static-viz
- name: Upload Static Viz Bundle Artifact
uses: actions/upload-artifact@v4
with:
name: static-viz-bundle-${{ github.sha }}
path: resources/frontend_client/app/dist
- name: Check for static viz changes
uses: dorny/paths-filter@v3.0.0
id: static_viz
with:
token: ${{ github.token }}
filters: .github/static-viz-sources.yaml
be-linter-clj-kondo:
needs: [files-changed, static-viz-files-changed]
if: |
!cancelled() &&
(needs.files-changed.outputs.backend_all == 'true' || needs.static-viz-files-changed.outputs.static_viz == 'true')
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 10
name: Clj-Kondo
@@ -78,11 +27,7 @@ jobs:
run: ./bin/kondo.sh
be-linter-eastwood:
needs: [files-changed, static-viz-files-changed]
if: |
!cancelled() &&
github.event.pull_request.draft == false &&
(needs.files-changed.outputs.backend_all == 'true' || needs.static-viz-files-changed.outputs.static_viz == 'true')
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 20
name: Eastwood
@@ -95,51 +40,29 @@ jobs:
- run: clojure -X:dev:ee:ee-dev:drivers:drivers-dev:test:eastwood
name: Run Eastwood linter
# Because it's not possible to conditionally run only `java-11-ee` test in the draft mode,
# we have to extract that job manually here. Backend developers have requested that this
# test runs at all times to give them an early warning sign is something is broken.
be-tests-pre-check:
needs: [files-changed, static-viz-files-changed]
if: |
!cancelled() &&
github.event.pull_request.draft == true &&
(needs.files-changed.outputs.backend_all == 'true' || needs.static-viz-files-changed.outputs.static_viz == 'true')
mage-tests:
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
name: Backend Tests Pre-Check
timeout-minutes: 60
name: Mage
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: backend-pre-check
- run: yarn install --frozen-lockfile --prefer-offline
- name: Build static viz frontend
run: yarn build-static-viz
- name: Run tests
run: clojure -X:dev:ci:test:ee:ee-dev
- name: Publish Test Report (JUnit)
uses: dorny/test-reporter@v1
if: failure()
m2-cache-key: 'kondo'
- name: Setup Babashka
uses: turtlequeue/setup-babashka@v1.7.0
with:
path: "target/junit/**/*_test.xml"
name: JUnit Test Report (Backend Tests Pre-Check)
reporter: java-junit
list-suites: failed
list-tests: failed
fail-on-error: false
babashka-version: 1.12.196
- name: Check bb runs
run: bb --version
- name: bb task list
run: bb tasks
- name: Run mage tests
run: bb ./test/mage/core_test.clj
be-tests:
needs: [files-changed, static-viz-files-changed]
if: |
!cancelled() &&
github.event.pull_request.draft == false &&
(needs.files-changed.outputs.backend_all == 'true' || needs.static-viz-files-changed.outputs.static_viz == 'true')
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 60
strategy:
@@ -210,10 +133,12 @@ jobs:
# Depending on which files changed, we might either have to build static-viz
# from scratch or download the previously built artifact
- name: Build static-viz frontend
if: ${{ matrix.job.build-static-viz == 'true' && needs.files-changed.outputs.backend_all == 'true' }}
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' && needs.static-viz-files-changed.outputs.static_viz == 'true' }}
if: ${{ matrix.job.build-static-viz == 'true' && !inputs.skip }}
uses: actions/download-artifact@v4
with:
name: static-viz-bundle-${{ github.sha }}
@@ -252,11 +177,7 @@ jobs:
# checks that all the namespaces we actually ship can be compiled, without any dependencies that we don't ship (such
# as `:dev` dependencies). See #27009 for more context.
be-check:
needs: [files-changed, static-viz-files-changed]
if: |
!cancelled() &&
github.event.pull_request.draft == false &&
(needs.files-changed.outputs.backend_all == 'true' || needs.static-viz-files-changed.outputs.static_viz == 'true')
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 10
strategy:
@@ -274,9 +195,7 @@ jobs:
run: clojure -M:ee:drivers:check
be-cljfmt:
needs: [files-changed]
if: |
!cancelled() && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 10
name: Cljfmt

View File

@@ -1,22 +0,0 @@
name: Codenotify
on:
pull_request:
types: [opened, synchronize, ready_for_review]
# We're currently notifying developers only for frontend source changes.
# Update this glob if that ever changes and we start including backend source code changes.
paths:
- 'frontend/src/metabase/**'
- 'enterprise/frontend/src/metabase-enterprise/**'
jobs:
codenotify:
runs-on: ubuntu-22.04
name: Codenotify
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: sourcegraph/codenotify@v0.6.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

135
.github/workflows/containerize-jar.yml vendored Normal file
View File

@@ -0,0 +1,135 @@
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
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";
}
// 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: ${{ secrets.DOCKERHUB_RELEASE_USERNAME }}
password: ${{ secrets.DOCKERHUB_RELEASE_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
# 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: ${{ secrets.DOCKERHUB_RELEASE_USERNAME }}
password: ${{ secrets.DOCKERHUB_RELEASE_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: ${{ secrets.DOCKERHUB_RELEASE_USERNAME }}
password: ${{ secrets.DOCKERHUB_RELEASE_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,37 @@
name: Docs Bump Detected
on:
pull_request_target:
types:
- opened
- synchronize
- reopened
branches:
- 'master'
- 'release-x.[0-9]+.x'
paths:
- 'docs/**'
jobs:
push_workflow_to_docs_metabase_github_io_job:
runs-on: ubuntu-latest
env:
SOURCE_BRANCH: ${{ github.head_ref || github.ref }}
TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}
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
with:
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
script: | #js
github.rest.repos.createDispatchEvent({
owner: "${{ github.repository_owner }}",
repo: "docs.metabase.github.io",
event_type: "docs_update",
client_payload: {
source_branch: process.env.SOURCE_BRANCH,
target_branch: process.env.TARGET_BRANCH}});

View File

@@ -0,0 +1,36 @@
name: Docs Merge Detected
on:
pull_request:
types:
- closed
branches:
- 'master'
- 'release-x.[0-9]+.x'
paths:
- 'docs/**'
jobs:
push_and_merge_workflow_to_docs_metabase_github_io_job:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
env:
SOURCE_BRANCH: ${{ github.head_ref || github.ref }}
TARGET_BRANCH: ${{ github.event.pull_request.base.ref }}
steps:
- name: Report changed docs files exist
run: |
echo "A PR with changes to the docs directory was merged."
- name: Trigger repo dispatch
uses: actions/github-script@v7
with:
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
script: | #js
github.rest.repos.createDispatchEvent({
owner: "${{ github.repository_owner }}",
repo: "docs.metabase.github.io",
event_type: "docs_merge",
client_payload: {
source_branch: process.env.SOURCE_BRANCH,
target_branch: process.env.TARGET_BRANCH}});

View File

@@ -1,36 +1,19 @@
name: Driver Tests
on:
push:
branches:
- 'master'
- 'release-**'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_call:
inputs:
skip:
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}-drivers
cancel-in-progress: true
jobs:
files-changed:
name: Check which files changed
runs-on: ubuntu-22.04
timeout-minutes: 3
outputs:
backend_all: ${{ steps.changes.outputs.backend_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
be-tests-h2:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 60
env:
@@ -57,10 +40,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-athena-ee:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: athena
@@ -93,10 +75,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-bigquery-cloud-sdk-ee:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: bigquery-cloud-sdk
@@ -128,10 +109,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-druid-ee:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: druid
@@ -164,10 +144,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-databricks-ee:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: databricks
@@ -199,10 +178,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-druid-jdbc-ee:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: druid-jdbc
@@ -235,10 +213,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-mysql-mariadb:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
@@ -362,10 +339,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-mongo:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
@@ -415,10 +391,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-mongo-ssl:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
@@ -483,10 +458,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-mongo-sharded-cluster-ee:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: mongo
@@ -517,10 +491,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-oracle:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
@@ -589,10 +562,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-postgres:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
@@ -694,10 +666,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-presto-jdbc-ee:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: presto-jdbc
@@ -763,21 +734,24 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-redshift-ee:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
job:
- name: Redshift Upload Tests
skip: ${{ github.event_name == 'pull_request' }} # FIXME: temporary to alleviate pressure on redshift instances
test-args: >-
:only-tags [:mb/upload-tests]
:fail-fast? true
- name: Redshift (Excluding Upload Tests)
skip: false
test-args: >-
:only-tags [:mb/driver-tests]
:exclude-tags [:mb/upload-tests]
:fail-fast? true
env:
CI: 'true'
@@ -790,6 +764,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Test ${{ matrix.job.name }}
if: ${{ !matrix.job.skip }}
uses: ./.github/actions/test-driver
with:
junit-name: 'be-tests-redshift-ee'
@@ -797,7 +772,7 @@ jobs:
${{ matrix.job.test-args }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
if: ${{ !matrix.job.skip && !cancelled() }}
with:
input-path: ./target/junit/
output-name: ${{ github.job }}
@@ -808,10 +783,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-snowflake-ee:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: snowflake
@@ -848,10 +822,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-sparksql-ee:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: sparksql
@@ -882,10 +855,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-sqlite-ee:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: sqlite
@@ -911,17 +883,16 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-sqlserver:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
runs-on: ubuntu-20.04
timeout-minutes: 90
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
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
@@ -962,10 +933,9 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
be-tests-vertica-ee:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.backend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 90
timeout-minutes: 60
env:
CI: 'true'
DRIVERS: vertica

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: |
@@ -165,8 +154,13 @@ jobs:
- name: Move tests from the release commit into the repo
run: |
rm -rf ./e2e/support/helpers/*
mv ./sdk-release-e2e/e2e/support/helpers/* ./e2e/support/helpers
# remove this line after we release a new SDK 0.53.x, since it will already contain the fixed version then.
mv ./e2e/support/component-webpack.config.js .
rm -rf ./e2e/support/*
mv ./sdk-release-e2e/e2e/support/* ./e2e/support
mv ./component-webpack.config.js ./e2e/support
rm -rf ./e2e/test-component/*
mv ./sdk-release-e2e/e2e/test-component/* ./e2e/test-component
shell: bash
@@ -174,7 +168,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
@@ -192,8 +186,14 @@ jobs:
- name: Install Embedding SDK package v${{ needs.resolve-sdk-version.outputs.sdk_version }}
run: yarn add @metabase/embedding-sdk-react@${{ needs.resolve-sdk-version.outputs.sdk_version }}
- name: Run E2E tests for Embedding SDK
run: yarn run test-cypress-run-component-sdk --browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run Metabase
run: node e2e/runner/run_cypress_ci.js start
- name: Make app db snapshot
run: node e2e/runner/run_cypress_ci.js snapshot --browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run component tests for Embedding SDK
run: node e2e/runner/run_cypress_ci.js component --browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results

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,7 +58,7 @@ jobs:
node_version: requirements.node,
};
build:
build-uberjar:
needs: [files-changed, get-build-requirements]
if: |
!cancelled() &&
@@ -78,15 +73,17 @@ 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:
m2-cache-key: uberjar
java-version: "${{ needs.get-build-requirements.outputs.java_version || 11 }}"
java-version: "${{ needs.get-build-requirements.outputs.java_version || 21 }}"
- name: Build uberjar with ./bin/build.sh
run: ./bin/build.sh
@@ -97,12 +94,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: ""
@@ -111,6 +113,7 @@ jobs:
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
CYPRESS_CI: true
@@ -132,10 +135,10 @@ jobs:
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare JDK ${{ needs.get-build-requirements.outputs.java_version || 11 }}
- name: Prepare JDK ${{ needs.get-build-requirements.outputs.java_version || 21 }}
uses: actions/setup-java@v4
with:
java-version: ${{ needs.get-build-requirements.outputs.java_version || 11 }}
java-version: ${{ needs.get-build-requirements.outputs.java_version || 21 }}
distribution: "temurin"
- name: Prepare Cypress environment
@@ -147,22 +150,31 @@ jobs:
with:
m2-cache-key: "cljs"
- name: Compile CLJS
run: yarn build-pure:cljs
shell: bash
- 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: Build Embedding SDK package
run: yarn build-embedding-sdk
- name: Run Metabase
run: node e2e/runner/run_cypress_ci.js start
- name: Run E2E tests for Embedding SDK
run: yarn run test-cypress-run-component-sdk --browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Make app db snapshot
run: node e2e/runner/run_cypress_ci.js snapshot --browser ${{ steps.cypress-prep.outputs.chrome-path }}
# Has to be run after the app db snapshot is made, as it is not compatible with React 19
- name: Change React version to ${{ matrix.react-version }}
run: ./bin/embedding-sdk/change-react-version.bash ${{ matrix.react-version }}
- name: Run component tests for Embedding SDK
run: node e2e/runner/run_cypress_ci.js component --browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit
output-name: e2e-embedding-sdk
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 }}
@@ -173,7 +185,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
@@ -195,15 +207,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

@@ -126,7 +126,7 @@ jobs:
steps:
- uses: actions/setup-node@v4
with:
node-version: lts/Hydrogen # 18.x.x
node-version: lts/Jod # 22.x.x
- run: npm install @slack/web-api
- name: notify slack of failure
uses: actions/github-script@v7

View File

@@ -23,7 +23,7 @@ jobs:
steps:
- uses: actions/setup-node@v3
with:
node-version: '20.x'
node-version: '22.x'
- uses: actions/github-script@v7
id: matrix
env:
@@ -44,7 +44,7 @@ jobs:
// 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", specs: allSpecs },
{ name: "oss-subset", edition: 'oss', tags: "@OSS @smoke+-@EE", specs: allSpecs },
{ name: "mongo", tags: "@mongo", specs: allSpecs },
];

View File

@@ -0,0 +1,273 @@
name: E2E Sample Apps tests
on:
push:
branches:
- "master"
- "release-**"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
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"
]
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) }}
if: |
!cancelled() && needs.build.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 45
name: e2e-sample-app-${{ matrix.test_suite }}-tests
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
TEST_SUITE: ${{ matrix.test_suite }}
SAMPLE_APP_BRANCH_NAME: ${{ needs.get-sample-apps-data.outputs.branch_name }}
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: |
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: Prepare and launch Sample Apps
if: ${{ steps.check-sample-app-branch.outputs.sample_app_branch_exists == 'true' }}
run: npx tsx ./e2e/runner/start-sample-app-containers/start-ci.ts
- 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

@@ -97,12 +97,16 @@ jobs:
uses: ./.github/actions/prepare-cypress
- name: Run Snowplow micro
uses: ./.github/actions/run-snowplow-micro
- name: Run Metabase
run: node e2e/runner/run_cypress_ci.js start
- name: Generate database snapshots
run: node e2e/runner/run_cypress_ci.js snapshot
# 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
run: |
yarn run test-cypress-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 }}' \
--config-file e2e/support/cypress-stress-test.config.js \

View File

@@ -48,8 +48,10 @@ jobs:
CYPRESS_NO_FEATURES_TOKEN: ${{ secrets.E2E_STARTER_TOKEN }}
CYPRESS_PULL_REQUEST_ID: ${{ github.event.pull_request.number || '' }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message || github.event.head.sha }}
MB_EXPERIMENTAL_SEARCH_BLOCK_ON_QUEUE: true
MB_SNOWPLOW_AVAILABLE: true
MB_SNOWPLOW_URL: "http://localhost:9090" # Snowplow micro
MB_SEARCH_ENGINE: "appdb"
TZ: US/Pacific # to make node match the instance tz
CYPRESS_CI: true
CYPRESS_QA_DB_MONGO: ${{ inputs.name == 'mongo' }}
@@ -97,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
@@ -116,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: |
node e2e/runner/run_cypress_ci.js test \
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: |
node e2e/runner/run_cypress_ci.js test \
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
@@ -153,6 +173,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

@@ -1,33 +1,17 @@
name: E2E Tests
on:
push:
branches:
- "master"
- "release-**"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_call:
inputs:
skip:
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}-e2e
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
e2e-matrix-builder:
uses: ./.github/workflows/e2e-matrix-builder.yml
with:
@@ -65,11 +49,8 @@ jobs:
};
build:
needs: [files-changed, get-build-requirements]
if: |
!cancelled() &&
github.event.pull_request.draft == false &&
needs.files-changed.outputs.e2e_all == 'true'
needs: [get-build-requirements]
if: ${{ !cancelled() && !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 25
strategy:

View File

@@ -13,10 +13,30 @@ concurrency:
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 +45,110 @@ 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:docs-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:cli-snippets:type-check
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-docs-snippets-type-check
- embedding-sdk-cli-snippets-type-check
- 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

@@ -1,37 +1,19 @@
name: Frontend
on:
push:
branches:
- "master"
- "release-**"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_call:
inputs:
skip:
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}-frontend
cancel-in-progress: true
jobs:
files-changed:
name: Check which files changed
runs-on: ubuntu-22.04
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
uses: dorny/paths-filter@v3.0.0
id: changes
with:
token: ${{ github.token }}
filters: .github/file-paths.yaml
fe-lint:
needs: files-changed
if: needs.files-changed.outputs.frontend_all == 'true' || needs.files-changed.outputs.e2e_specs == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
@@ -44,14 +26,15 @@ jobs:
m2-cache-key: "cljs"
- name: Compile CLJS
run: yarn build-pure:cljs
- name: Find CSS variables that are used but never defined
run: yarn find-never-defined-css-variables
- name: Run Prettier formatting linter
run: yarn run lint-prettier-pure
- name: Run ESLint linter
run: yarn run lint-eslint-pure
fe-type-check:
needs: files-changed
if: needs.files-changed.outputs.frontend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
@@ -68,8 +51,7 @@ jobs:
name: Check types
fe-tests-unit:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.frontend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 60
env:
@@ -109,8 +91,7 @@ jobs:
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
fe-tests-timezones:
needs: files-changed
if: github.event.pull_request.draft == false && needs.files-changed.outputs.frontend_all == 'true'
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:

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

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
@@ -168,11 +142,29 @@ jobs:
run: |
jar xf metabase.jar version.properties
mv version.properties resources/
- name: Run a few important Cypress tests as sanity check
- name: Move jar
run: mkdir -p ./target/uberjar && cp metabase.jar ./target/uberjar/metabase.jar
- name: Run Metabase
run: node e2e/runner/run_cypress_ci.js start
- name: Make app db snapshot
run: node e2e/runner/run_cypress_ci.js snapshot
- name: Run a few important OSS Cypress tests as sanity check
if: ${{ matrix.edition == 'oss' }}
run: |
mkdir -p ./target/uberjar && cp metabase.jar ./target/uberjar/metabase.jar
yarn test-cypress-run \
--env grepTags="@smoke",grepOmitFiltered=true \
node e2e/runner/run_cypress_ci.js e2e \
--env grepTags="@smoke+-@EE",grepOmitFiltered=true \
--spec './e2e/test/scenarios/**/*.cy.spec.(js|ts)' \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run a few important EE Cypress tests as sanity check
if: ${{ matrix.edition == 'ee' }}
run: |
node e2e/runner/run_cypress_ci.js e2e \
--env grepTags="@smoke+-@OSS",grepOmitFiltered=true \
--spec './e2e/test/scenarios/**/*.cy.spec.(js|ts)' \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
@@ -186,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
@@ -320,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

@@ -13,6 +13,8 @@ on:
- master
- release-x.51.x
- release-x.52.x
- release-x.53.x
- release-x.54.x
concurrency:
# We want to ensure only one job is running at a time per branch because
@@ -36,12 +38,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
@@ -58,19 +191,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: |
@@ -78,15 +217,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
@@ -127,7 +267,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:
@@ -149,7 +289,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: |
@@ -174,15 +314,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}}
@@ -211,10 +352,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
@@ -225,17 +362,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: |
@@ -260,32 +391,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"}')[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"}')[inputs.branch]}}
- name: Add `latest` tag to the latest release branch (`release-x.52.x`) deployment
if: ${{ inputs.branch == 'release-x.52.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

@@ -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:
@@ -476,7 +337,8 @@ jobs:
needs:
- get-extra-tags
- push-tags
- verify-docker-pull
- containerize-ee
- containerize-oss
- verify-s3-download
strategy:
matrix:

View File

@@ -2,7 +2,7 @@ name: Re-run Flaky Workflows
on:
workflow_run:
workflows: [Backend, Driver Tests, E2E Tests, Frontend, Backend-Cloverage]
workflows: [run-tests]
types: [completed]
branches: [master, 'release-x.**', 'backport-**']
@@ -25,7 +25,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: lts/Hydrogen # 18.x.x
node-version: lts/Jod # 22.x.x
- run: npm install @slack/web-api
- name: Trigger a re-run
uses: actions/github-script@v7

88
.github/workflows/run-tests.yml vendored Normal file
View File

@@ -0,0 +1,88 @@
name: Run tests
on:
push:
branches:
- "master"
- "release-**"
pull_request:
types: [opened, synchronize, reopened]
jobs:
files-changed:
name: Check which files changed
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
e2e_all: ${{ steps.changes.outputs.e2e_all }}
backend_all: ${{ steps.changes.outputs.backend_all }}
frontend_all: ${{ steps.changes.outputs.frontend_all }}
frontend_sources: ${{ steps.changes.outputs.frontend_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
static-viz-files-changed:
name: Check whether static-viz files changed
runs-on: ubuntu-22.04
timeout-minutes: 10
outputs:
static_viz: ${{ steps.static_viz.outputs.static_viz }}
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "files-changed"
- name: Build static-viz frontend
run: yarn build-static-viz
env:
MB_EDITION: ee
- name: Upload Static Viz Bundle Artifact
uses: actions/upload-artifact@v4
with:
name: static-viz-bundle-${{ github.sha }}
path: resources/frontend_client/app/dist
- name: Check for static viz changes
uses: dorny/paths-filter@v3.0.0
id: static_viz
with:
token: ${{ github.token }}
filters: .github/static-viz-sources.yaml
backend-tests:
if: ${{ !cancelled() }}
needs: [files-changed, static-viz-files-changed]
uses: ./.github/workflows/backend.yml
secrets: inherit
with:
skip: ${{ needs.files-changed.outputs.backend_all != 'true' && needs.static-viz-files-changed.outputs.static_viz != 'true' }}
driver-tests:
needs: files-changed
uses: ./.github/workflows/drivers.yml
secrets: inherit
with:
skip: ${{ needs.files-changed.outputs.backend_all != 'true' }}
frontend-tests:
needs: files-changed
uses: ./.github/workflows/frontend.yml
secrets: inherit
with:
skip: ${{ needs.files-changed.outputs.frontend_all != 'true' }}
e2e-tests:
needs: files-changed
uses: ./.github/workflows/e2e-tests.yml
secrets: inherit
with:
skip: ${{ needs.files-changed.outputs.e2e_all != 'true' }}

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

@@ -133,7 +133,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: bin/docker/.
platforms: linux/amd64
platforms: linux/amd64,linux/arm64
network: host
tags: localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-${{ matrix.edition }}
build-args: |
@@ -146,7 +146,7 @@ jobs:
- name: Is Docker running?
run: docker ps
- name: Wait for Metabase to start and reach 100% health
run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
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
@@ -154,30 +154,75 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Retag and push images if master (ee)
- name: Retag and push images if master (ee) - should be cached at this point
if: ${{ (github.ref_name == 'master') && matrix.edition == 'ee' }}
run: docker tag localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-ee ${{ github.repository_owner }}/metabase-enterprise-head:latest && docker push ${{ github.repository_owner }}/metabase-enterprise-head:latest
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)
- 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' }}
run: docker tag localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-ee ${{ github.repository_owner }}/metabase-enterprise-head:metabot && docker push ${{ github.repository_owner }}/metabase-enterprise-head:metabot
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)
- name: Retag and push images if master (oss) - should be cached at this point
if: ${{ (github.ref_name == 'master') && matrix.edition == 'oss' }}
run: docker tag localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-oss ${{ github.repository_owner }}/metabase-head:latest && docker push ${{ github.repository_owner }}/metabase-head:latest
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)
- name: Retag and push images if master (ee-extra) - should be cached at this point
if: ${{ (github.ref_name == 'master') && matrix.edition == 'ee-extra' }}
run: docker tag localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-ee-extra ${{ secrets.METABASE_EE_EXTRA_CONTAINER_REGISTRY }}/metabase-enterprise-head:latest && docker push ${{ secrets.METABASE_EE_EXTRA_CONTAINER_REGISTRY }}/metabase-enterprise-head:latest
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
if: ${{ !(startsWith(github.ref_name,'master') || startsWith(github.ref_name,'backport')) && matrix.edition == 'ee' }}
run: docker tag localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-ee ${{ github.repository_owner }}/metabase-dev:${{ steps.extract_branch.outputs.branch }} && docker push ${{ github.repository_owner }}/metabase-dev:${{ steps.extract_branch.outputs.branch }}
- 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-extra' }}
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.28.0
uses: aquasecurity/trivy-action@0.29.0
env:
TRIVY_OFFLINE_SCAN: true
with:
@@ -188,7 +233,7 @@ jobs:
- name: Run Trivy vulnerability scanner if master (oss)
if: ${{ (github.ref_name == 'master') && matrix.edition == 'oss' }}
uses: aquasecurity/trivy-action@0.28.0
uses: aquasecurity/trivy-action@0.29.0
env:
TRIVY_OFFLINE_SCAN: true
with:
@@ -199,7 +244,7 @@ jobs:
- 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.28.0
uses: aquasecurity/trivy-action@0.29.0
env:
TRIVY_OFFLINE_SCAN: true
with:
@@ -210,19 +255,19 @@ jobs:
- 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@v2
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@v2
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@v2
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
@@ -285,7 +330,7 @@ jobs:
- 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 -s 'http://localhost:3001/api/health' | grep '{"status":"ok"}'; do sleep 1; done
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' }}

9
.gitignore vendored
View File

@@ -36,8 +36,12 @@
/crate-*
/cypress
/deploy/artifacts/*
/docs/**/node_modules
/docs/**/package.json
/docs/**/yarn.lock
/frontend/test/snapshots/*
/e2e/snapshots/*
/e2e/tmp/*
/lein-plugins/*/target
/local
/locales/metabase-*.pot
@@ -66,6 +70,7 @@
/storybook-static
/target
/test-report-*
**/cli-snippets-tmp/**
\#*\#
bin/node_modules/
bin/release/aws-eb/metabase-aws-eb.zip
@@ -98,6 +103,7 @@ modules/drivers/*/.lsp/*
.clj-kondo/*
!.clj-kondo/README.md
!.clj-kondo/config.edn
!.clj-kondo/config/
!.clj-kondo/src/
!.clj-kondo/test/
!.clj-kondo/macros/
@@ -119,3 +125,6 @@ modules/drivers/*/.lsp/*
.swc/
*storybook.log
# jar downloader
/jars/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Some files were not shown because too many files have changed in this diff Show More