Compare commits

...

1629 Commits

Author SHA1 Message Date
Cam Saul
ea97f7f7f9 API dox include session token 2025-02-19 09:18:48 -08:00
Raphael Krut-Landau
b4af3f80d3 Fix env vars in embedding quickstart doc (#53931)
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
2025-02-18 17:30:02 -05:00
Braden Shepherdson
aef9e6f5d0 [refs] Use the new entity_id on Fields as their idents (#53609)
`entity_id` columns on Databases, Tables and Fields are new in #53076.

This PR uses `entity_id` on Fields as their `:ident` in the metadata,
rather than the concatenated names previously used.

The names were a bit too fragile, since occasionally people rename
Fields or Tables in the appdb to retain the identity of something that
got renamed in place in their data warehouse. (That isn't exactly
supported, but it's also not blocked.)

With random (or hashed and saved) `entity_id`s for Fields used as their
`:ident`s instead, references to fields will not need to be updated if
fields or tables are renamed but their `entity_id`s preserved.

**On memoization**

Since the `entity_id` is `NULL` for existing fields and they're only
being populated in the background, we need to populate them on demand
when reading metadata. Since fields depend on their tables and tables on
their databases, this meant a lot of extra appdb reads at first.

This change includes memoization added to `serdes/hydrated-hash`, such
that any table or database only gets read once, and memoized forever.
There's a big comment about the memory impact of this; in summary it
should be safe since this is on demand, and holds only DBs/tables
and not fields.

A later PR will add a background job as mentioned, that will populate
all the `entity_id` columns with hashed values. After that, the cache
will always be empty.

Note that this memoization is not going to work if a table or field is
renamed before the background job catches up! I consider this an
acceptable loss - renaming fields is an admin action that requires
editing the appdb. The guide for doing that can include making sure all
`entity_id` fields are populated first.
2025-02-18 15:19:21 -05:00
bryan
da0ad760c9 auto cljfmt on commit hook (#53922) 2025-02-18 19:40:56 +00:00
Ryan Laurie
298e277678 remove settings access as a requirement to use the bug reporter (#53795) 2025-02-18 18:50:00 +00:00
Filip Hric
f1ccaa92bb fix flaky test (#53906) 2025-02-18 19:42:42 +01:00
Filip Hric
0e79002c65 fix flaky test (#53904) 2025-02-18 19:42:31 +01:00
Edward Paget
6825c1d661 fix: use standard user order sort for group list (#53722)
* 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
2025-02-18 12:15:37 -06:00
Edward Paget
f71261ed85 fix: allow google auth when throttling is disabled (#53788) 2025-02-18 12:08:19 -06:00
Edward Paget
93231acba1 fix: allow password reset if google sso disabled (#53865)
* 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
2025-02-18 10:52:26 -06:00
Stas Gavrylov
4d3579d86c Add stasgavrylov to team directory (#53915) 2025-02-18 18:18:16 +02:00
Aleksandr Lesnenko
b527e6fb4d fix mantine viz settings widgets (#53801) 2025-02-18 10:19:30 -05:00
Roman Abdulmanov
1efe670d4e Removed beta badge for the SDK (#53596) 2025-02-18 15:06:32 +00:00
Ngoc Khuat
5fa8d46476 Buckets for notification send duration ms histogram (#53882) 2025-02-18 20:40:55 +07:00
Nicolò Pretto
f5a0c34650 fix: <Text span not being a span (#53876)
* fix: <Text span not being a span

* convert all `span` to `component="span"` in the codebase
2025-02-18 13:56:53 +01:00
Nicolò Pretto
4decb23b5f fix: text color not being brand in embed modal (#53877) 2025-02-18 13:56:38 +01:00
Konstantin Darutkin
e556e552b3 chore: add spalt08 as a team member (#53886) 2025-02-18 12:05:15 +00:00
Romeo Van Snick
22eda01994 Fix usage of native editor in some e2e tests (#53581)
* Use NativeEditor.type in test

* Use NativeEditor.type in all tests that aren't

* Stop using .as(editor) for native editor

* Do not return anything from startNewNativeQuestion to avoid confusion

* Fix more tests

* Fix movetostart/movetoend
- Ctrl + A is "select all" on non-apple machines, but on apple machines it's same as "home"

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-02-18 10:50:10 +01:00
Mahatthana (Kelvin) Nomsawadi
12bf97e256 Disallow console.log in unit tests (#53871) 2025-02-18 09:05:10 +00:00
Alexander Polyankin
fa3b58002b Make BigInteger dashboard id parameters work (#53808) 2025-02-18 04:05:54 +00:00
Phoomparin Mano
8af4499d47 fix(sdk): auto-select sample database tables in cli (#53654)
* auto-select tables in sample databases

* use people, orders and products

* use non-underscore variants
2025-02-18 04:32:42 +07:00
Phoomparin Mano
62a82340e1 docs(sdk): document sample components generated by cli (#53695)
* document sample cli components

* document the demo providers

* update docs
2025-02-18 04:31:31 +07:00
Phoomparin Mano
f957817f70 feat(sdk): asks whether to add a db right before adding db connection in the cli (#53680) 2025-02-18 04:05:16 +07:00
Noah Moss
bb27e2f96c Error explicitly when sandboxing/impersonation configs conflict (#53849)
* 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*
2025-02-17 15:55:24 -05:00
Oleksandr Yakushev
ca0a16e7d7 [pulse] Optimize memory usage email notification rendering (#53717) 2025-02-17 23:06:25 +03:00
appleby
a304019cf6 Fix brush filters for longitudes that lie outside the normal -180 to 180 range (#53342)
* 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
2025-02-17 12:04:59 -08:00
John Swanson
bcc2c7a00f Allow specifying a dashboard tab for DQs (#53615)
When creating a DQ, or moving a card to a dashboard, allow specifying a
dashboard_tab_id (the tab to move it to).
2025-02-17 11:52:39 -08:00
github-automation-metabase
917ff25970 Update Readme version references and published npm version to 0.54.1-nightly (#53851) 2025-02-17 19:36:25 +00:00
Alex Yarosh
34d30973f0 docs: Funnel chart (#53792)
* funnel docs

* Apply suggestions from code review

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

* steps

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-17 18:36:09 +00:00
Jeff Bruemmer
7789855a1b api docs (#53846) 2025-02-17 18:17:07 +00:00
Alex Yarosh
df459b77dc Update model-persistence.md (#53807) 2025-02-17 12:35:01 -05:00
Nicolò Pretto
2e731dbbd8 fix(sdk): filter out some deps that may require @types/react (#53821) 2025-02-17 18:14:52 +01:00
Nicolò Pretto
d3f0a4b1b2 fix(sdk): handle 'personal' for collectionId when creating dashboards and in the collection browser (#53553)
* 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

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

* re-format file after suggestions were applied from gh

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

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-17 17:54:21 +01:00
Jeff Bruemmer
57a82b636f Update mustache to include docs metadata (#53832) 2025-02-17 16:34:57 +00:00
Noah Moss
e0b0640b10 Enable pivot tables with only pivot columns (#52864)
* 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
2025-02-17 09:59:39 -05:00
bryan
d98832fb18 make links in slack bug report descriptions clickable (#53782)
* pull description out into a mrkdwn block,

- which gets links parsed out automatically

* cljfmt fix
2025-02-17 13:44:33 +00:00
Sébastien
cfda0fb8ed Field select fix (#53759)
* fixed color selection and reordering on columns

* test

* added drag and drop expectation
2025-02-17 14:14:00 +01:00
Alexander Polyankin
1aa96ab121 filter-bigint.cy.spec.ts flaky test fix (#53806)
* Fix flaky bigint test

* Fix flaky bigint test

* Fix flaky bigint test

* Fix flaky bigint test

* Perf fix

* Perf fix

* Perf fix
2025-02-17 12:10:03 +01:00
Filip Hric
e380d347a6 Dev 344 remove flaky tag from tests that are stable (#53669)
* add eslint rule that prevents incorrect order of helpers

* remove flaky tags and stabilize tests
2025-02-17 09:58:51 +01:00
Fraser
d8ed6a46df Ensure menu text hover colors correctly with inherit (#53433)
* Ensure menu text hover colors correctly with inherit

* Remove Text component from Menu Items
2025-02-17 08:45:38 +13:00
Cam Saul
c14d89e731 [Backend modularization] public-sharing module and fix bad config c… (#53800)
* [Backend modularization] `public-sharing` module and fix bad config changes

* One more pass

* Another pass
2025-02-15 06:07:23 +00:00
Alexander Polyankin
6e1690db35 Fix flaky bigint test (#53802)
* Fix flaky bigint test

* Fix flaky bigint test

* Fix flaky bigint test
2025-02-15 05:26:56 +00:00
Tyler Plude
ed6b817ff1 Fix trend lines in slack alerts VIZ-272 (#53711)
* 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
2025-02-14 15:51:27 -08:00
Tyler Plude
121718dd5a Fixing broken description column in static viz tables (#53726)
* Fixing broken description column in static viz tables

* Fixing unit tests
2025-02-14 15:51:09 -08:00
bryan
fd00f8dcfb 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
2025-02-14 22:51:33 +00:00
Cam Saul
9a7cbd0ba4 [Backend modularization] model-persistence module (#53573)
* [Backend modularization] `model-persistence` module

* Move persistence-related API endpoints

* Event schema improvements.

* Convert custom Kondo macro to custom hook

* Update modules config
2025-02-14 22:11:06 +00:00
Case Nelson
7402c31488 fix: add logging during connection health checks (#53781)
* 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
2025-02-14 21:36:22 +00:00
Ryan Laurie
369d49c8d6 Fix rerun workflow again (#53753)
* use workflow name instead of id

* remove test code
2025-02-14 13:58:18 -07:00
Jeff Bruemmer
8db50e3bfe docs - remove duplicate entry (#53779)
* Update other-env-vars.md

* remove dupes
2025-02-14 20:48:42 +00:00
Cam Saul
bc54de38b3 [Backend modularization] SSO module (#53729)
* [Backend modularization] SSO module

* Test fixes 🔧

* Test fix 🔧
2025-02-14 20:44:00 +00:00
Cam Saul
56131a0fd8 [Backend modularization] login-history module (#53723)
* [Backend modularization] `login-history` module

* CODEOWNERS

* Test fix

* Test fix 🔧
2025-02-14 19:39:34 +00:00
lbrdnk
d5a493eb9a Querying generative testing milestone 1 (#53300)
* Use with-generator

* Replace for tu.rng

* Add ref to workflow, rename env

* Rename vars

* Remove former random ns

* Typo

* Adjust log level

* random-query-from

* Use random-query-from

* Adjust random exception handling

* Add with-gentest kondo hook

* Initial version of with-gentest

* Logging in test assertions

* Workflow, env var names, logging

* Remove redundant code

* Newline

* Seed for non exceptional queries

* Naming

* Cleanup

* Atom for seed

* Cleanup

* Whitespace

* Kondo

* Temporarily fix schema and suppress full-join, to be rebased out later

* Update .github/workflows/generative-query-test.yml

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

* Update test/metabase/test/gentest.clj

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

* Remove stale comment

* Use tu.rng

---------

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-02-14 19:51:42 +01:00
Aleksandr Lesnenko
143c024538 fix missing pointer cursor on viz options action button (#53731) 2025-02-14 14:04:08 -04:00
Nicolò Pretto
1e1a8ffa0e fix(sdk): filterout @types/react from the generated package.json (#53747) 2025-02-14 18:32:09 +01:00
Case Nelson
bfacd62e02 fix: handle ambiguous snowflake connections (#53645)
* fix: handle ambiguous snowflake connections

* fix tests that were passing in boolean

* Better normalization check for private-key-id

* Fix formatting
2025-02-14 10:16:21 -07:00
Cam Saul
d58ba412ae [Backend modularization] session module (#53718)
* [Backend modularization] `session` module

* Add CODEOWNERS
2025-02-14 10:08:03 -07:00
Cam Saul
6d60452933 [Backend modularization] improve deps graph tooling (#53643) 2025-02-14 10:06:24 -07:00
Cam Saul
909be60ee0 [Backend modularization] cloud-migration module (#53578) 2025-02-14 10:03:23 -07:00
Jeff Bruemmer
54444ef9ed docs - notes on db version support (#52136) 2025-02-14 14:53:05 +00:00
Edward Paget
8634f23926 chore(ci): update sql server runner to ubuntu 22 (#53683) 2025-02-14 08:45:32 -06:00
Romeo Van Snick
4bc0070a57 Update esbuild to fix dependabot alert (#53740)
* Update esbuild to fix dependabot alert

* Update esbuild in release folder
2025-02-14 14:24:32 +01:00
Alexander Polyankin
d9b7bcd251 Fix dashboard drills and between filters with BIGINT (#53705)
* Improve ID test

* Improve ID test

* Improve ID test

* Improve ID test

* Add a test

* Between test

* Between test

* Between test

* Between test

* tests

* tests

* tests

* tests

* tests

* tests

* tests

* tests

* tests

* tests

* tests

* tests

* tests

* tests

* tests
2025-02-14 12:00:26 +00:00
Nemanja Glumac
2687cc4b61 Upsell Cloud (#53632)
* Make the UpsellBigCard more flexible

The product requirements for the Cloud upsell dictate that
the main CTA doesn't directly lead to Metabase website like in
all other cases. It opens a Migration modal instead.

UpsellBigCard had to be adjusted to enable that.

* Add Upsell Cloud component


* Resolve CLO-3576

* Use the cloud upsell instead of the previous CTA

* Adjust the UI

* Update stories

* Update related test

* Fix e2e test

* Add context for translators

* Adjust the vertical spacing
2025-02-14 11:17:35 +00:00
Romeo Van Snick
39372f2b1a Update mocha to fix dependabot issue with serialize-javascript (#53739) 2025-02-14 11:25:46 +01:00
Romeo Van Snick
e4a00c17fc Update elliptic to ^6.6.1 (#53738) 2025-02-14 11:25:37 +01:00
Nicolò Pretto
e88873a099 chore: remove suppressNextjsWarning() call from mantine (#53690)
* chore: remove suppressNextjsWarning from mantine

* also change cjs in case some builds uses that
2025-02-14 09:47:33 +01:00
metamben
8290d9d56e Export metabase.query-analysis.native-query-analyzer/tables-for-native (#53712) 2025-02-14 06:07:29 +02:00
appleby
92ad76a065 Do not :return-drills-for-dimensions? for column header drills (#52716)
* 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
2025-02-13 16:38:46 -08:00
Fraser
670d5274cc Push button to the end of the table cell (#53496) 2025-02-14 11:59:37 +13:00
Cam Saul
0b4dd2e756 [Backend modularization] tiles module (#53577)
* [Backend modularization] `tiles` module

* Field IDs cannot be zero
2025-02-13 21:56:09 +00:00
Braden Shepherdson
b6d08d7bb4 [refs] Don't randomize entity_ids for databases, tables or fields (#53704)
#53076 added `:hook/entity-id` for databases, tables and fields, but this is incorrect behaviour.

The sync process periodically detects new tables and fields and adds them to the appdb. If multiple instances of Metabase are connected via serdes, and linked to the same data warehouses, then eg. a new table would get duplicated before the serdes process would be run.

Instead, the `entity_id`s should be based only on the hashes, the same as serdes for databases, tables and fields.
2025-02-13 21:54:19 +00:00
Nick Fitzpatrick
156a329589 fixing some composed modals, porting badge component (#53716) 2025-02-13 17:51:43 -04:00
Cam Saul
3b627d1bb9 [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
2025-02-13 20:44:50 +00:00
metamben
3cc92a3ba6 Remove unused type (#53701)
The linter is complaining.
2025-02-13 20:31:03 +00:00
Nathan Voxland
843f81aa22 Fetch permissions for all databases when looking up db permissions (#53491)
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
2025-02-13 13:34:57 -06:00
Nick Fitzpatrick
2ea0a694d6 Remove css vars on unit tests (#53703)
* remove css vars on unit tests

* weird lint issue
2025-02-13 15:21:03 -04:00
Jeff Bruemmer
4b97475050 docs - md links (#53606) 2025-02-13 12:27:17 -05:00
Eric Normand
7ef645bd27 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
2025-02-13 17:19:11 +00:00
Eric Normand
3bb9478215 Pass temporal unit when listing quick-filter options. (#53626)
* Pass temporal unit when listing quick-filter options.

* Use with-temporal-bucket like a gentleman

* Use lib.temporal-bucket/temporal-bucket

* Whitespace
2025-02-13 17:16:48 +00:00
Edward Paget
42cbd634a2 fix: allow update last_used_at in read-only mode (#53633)
* fix: allow update last_used_at in read-only mode

* fixup! use temporary settings helper

* fixup! kondo
2025-02-13 16:40:09 +00:00
Phoomparin Mano
b0900d88f0 feat(sdk): add Next.js compatibility to embedding cli (#50281)
* 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

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

* rename to getNextJsPagesWrapperOrAppWrapperSnippet

* consolidate snippets file

* inline hasNextJsCustomAppOrRootLayout

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

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-13 23:32:46 +07:00
Phoomparin Mano
af7227e8d9 feat(sdk): pro license setup in cli defaults to false (#53655) 2025-02-13 23:05:12 +07:00
Alexander Polyankin
2ed9f0ac7c BIGINT (INT64) support in parameters (#53630) 2025-02-13 11:02:45 -05:00
Phoomparin Mano
8aa6ee0ed7 feat(sdk): add the instance url to the cli's login json file (#53469) 2025-02-13 22:20:47 +07:00
Phoomparin Mano
8a651a248b feat(sdk): abort cli with message when react version is unsupported (#53656)
* improve unsupported react version message

* do not allow continuing when React version is unsupported

* updated sample url to nextjs
2025-02-13 22:20:12 +07:00
Nathan Voxland
d56da1a054 Renamed cleanup-session to cleanup-session! (#53481) 2025-02-13 09:19:13 -06:00
Filip Hric
4ed93618c2 add eslint rule that prevents incorrect order of helpers (#53666) 2025-02-13 15:55:00 +01:00
Kamil Mielnik
a13e45b0ec Fix - Frozen UI after viewing a table with missing fields in the metadata browser (#53600)
* 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
2025-02-13 14:54:08 +00:00
Mahatthana (Kelvin) Nomsawadi
4bb25512dc Speed up SDK build (#53537)
* Speed up SDK build

* Update package.json

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>

* Update yarn.lock since package.json changed

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-02-13 13:02:02 +00:00
Ngoc Khuat
a0378ba230 Notification metrics (#53289) 2025-02-13 12:11:37 +00:00
Kamil Mielnik
842fa1a0fe Fix no-unused-vars ESLint rule config (#53648)
* Fix no-unused-vars config by adding sole underscore checks

* Fix unused underscores
2025-02-13 18:10:50 +07:00
Mahatthana (Kelvin) Nomsawadi
ac4f6f6663 Fix type failures from merge conflicts (#53647) 2025-02-13 09:26:01 +00:00
Kamil Mielnik
9c00839e0a Fix - Field tooltip text overflowing in filter modal (#53045)
* 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
2025-02-13 14:30:38 +07:00
Cam Saul
f88dafb8be [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 🔧
2025-02-12 17:35:12 -08:00
Noah Moss
6168ee8c88 Bump icu4j (#53544) 2025-02-12 17:57:11 -05:00
Oleksandr Yakushev
633f657a1c [mbql] Use more efficient keywordize-keys during normalization (#53432) 2025-02-12 21:42:23 +00:00
Ryan Laurie
4edfe1377a update rerun job to work with new master test workflow (#53635) 2025-02-12 14:34:04 -07:00
William
dc72ee9722 String fields fetch field type info from :field_ref as well as :source_metadata (#53569)
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.
2025-02-12 15:28:43 -06:00
Noah Moss
ce285ce1af Revert discarding-rff for preemptive caching (#53631) 2025-02-12 21:16:01 +00:00
Braden Shepherdson
4972d25abe [refs] Add entity_id columns to databases, tables, fields (#53076)
These three entities have previously used their names as their serdes
keys. The names are still used for serdes but we want opaque, stable
`entity_id`s as well so that they can be used as `:ident`s in the field
refs overhaul. Then the name of a database, schema, table or field can
be changed without its `:ident` changing, and therefore without breaking
any questions that reference it.

* Updating the v2 serdes baseline export - it has `entity_id`s now

* Updating the exported audit database; it has entity_ids now

* Fix MySQL appdbs

Use lower case for all table/field names; hard-code the schema
"PUBLIC". (The actual schema for appdb is ignored.)
2025-02-12 21:13:34 +00:00
Nemanja Glumac
3a3d8028ec Use gap instead of spacing Mantine components (#53629) 2025-02-12 20:56:06 +00:00
Alexander Polyankin
f0abe274a7 Unify parameter parsing utils (#53610) 2025-02-12 15:34:21 -05:00
Alexander Polyankin
73737673cf Cleanup bigint usage in QB filters (#53607) 2025-02-12 15:34:12 -05:00
Ryan Laurie
2df4df7a8c Adjust Smoke Tests (#53542)
* 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
2025-02-12 12:51:06 -07:00
Nemanja Glumac
1e486af5ee Upsell whitelabel (#53566)
* Add upsell for whitelabel/appearance

The most important change this PR introduces is a whitelabel route that's now present in the OSS and starter plans. How this works now:

- When the whitelabel token feature is not present, the route `/admin/settings/whitelabel` shows the upsell page
- When the whitelabel token feature gets activated, the route `/admin/settings/whitelabel` gets redirected to `/admin/settings/whitelabel/branding` and the upsell page is not visible anymore.
2025-02-12 20:45:52 +01:00
Jeff Bruemmer
a101797f95 docs - note on questions into models (#53620) 2025-02-12 14:00:59 -05:00
Ryan Laurie
621ea1feca Mantine v7 (#51144)
* Mantine v7-1 squash

update deps

update UI configs

easy fixes

happy little typescript

updates after rebase

test fixes

fix rebase issues

admin-2, collections, custom-columns, dashbaord and dashboard-cards suites

fix clause popovers

fixing rebase issue

more rebase sadness:

more e2e

autocomplete adjustment

fixing nested popovers

adjusting a couple more pickers

more e2e fixes

fix mantine provider, searchbox errors

unit test adjustments

theme colors, filter labels

Relative Date Picker

more unit test fixes

* e2e adjustments

* [MANTINE] ci: find css variables that are used but never defined (#52947)

* ci: find css variables that are used but never defined

* only search in frontend and enterprise/frontend

* whitelist mantine css variables

* temporarily allow some css variables

* read mantine variables directly from mantine css file

* UI Regressions

* lint and type fixes. green unit test

* Cherry pick updates to the never defined variables script (#53049)

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

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

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

---------

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

* more adjustments for e2e tests

* adjustments

* embedding sdk green, maybe unit tests?

* loki regressions

* test(sdk): migrate theme provider test to e2e to work with mantine v7 (#53290)

* test: migrate theme provider test to e2e to work with mantine v7

* re-put there things i removed by mistake

* preview and type fixes

* I think I'm making this better?

* fixing colors, unit tests

* scoping css vars and static classes, other things

* class prefix, scoping input css

* small adjustments

* shamelessly poach Nicolo's commit

* small fixes, should make Kamil happy :)

* finally green!

* type check

* chartsettingsinput fixes

* silly number types

* Adjustments for loki tests

* type fix

* undo Question View Download changes

* adjusting smart scalar

* updating loki reference

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-12 14:56:43 -04:00
Alex Yarosh
3579cd040e docs: usage analytics when upgrading (#53619)
* Update usage-analytics.md

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

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-12 18:34:11 +00:00
Ryan Laurie
97330f0ae4 Smooth out some rough edges for local e2e tests (#53576)
* 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
2025-02-12 11:00:19 -07:00
Alex Yarosh
fb97b96f69 Update activating-the-enterprise-edition.md (#53613) 2025-02-12 12:30:18 -05:00
Edward Paget
4bea4abf5a fix: return 204 on nonpersisted card unpersist (#53554)
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
2025-02-12 10:59:28 -06:00
lbrdnk
10cb07dfa3 Fix typos and add tests (#53449) 2025-02-12 16:28:31 +01:00
Gustavo Saiani
a0fc9340c6 Update link (#53603) 2025-02-12 14:41:14 +00:00
Nemanja Glumac
9c6e187fdb Introduce the Upsell Big Card component (#53495) 2025-02-12 15:19:03 +01:00
Romeo Van Snick
495776dc1e Pass missing native extras when switching databases (#53302)
* Allow passing native extras to withDifferentDatabase

* Pass empty nativeExtras when switching databases

* Add reproduction for 53299

* Do not pass nativeExtras to withDifferentDatabase

* Do not update native-extras when chaning databases

* Remove with-extras overload on with-different-database

* Remove native-extras for with-different-database call sites

* Remove required throw from test

* Remove collection requirement from test
2025-02-12 14:51:04 +01:00
Ngoc Khuat
c9af783134 small fixes I found during hackathon (#53593) 2025-02-12 13:23:48 +00:00
Cam Saul
520f30b3f3 [Backend modularization] indexed-entities module (#53563)
* [Backend modularization] `indexed-entities` module

* Fix CODEOWNERS

* Update .github/CODEOWNERS

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

---------

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-02-11 23:53:10 +00:00
Cam Saul
8a0e48b038 [Backend modularization] segments module (#53559) 2025-02-11 23:09:46 +00:00
Riley Thompson
d19d0bd01a Convert Postgres array columns to vectors (#53151)
* 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
2025-02-11 16:19:58 -05:00
Noah Moss
fc4a83f9fa Perf & correctness fixes for preemptive caching (#53328)
* Two potential performance fixes for preemptive caching

* Test fixing, cleanup

* Address feedback

* Update cache.clj

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

* Fix tests + update function name

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-02-11 15:49:19 -05:00
Alexander Polyankin
ac982ba47b type/BigInteger support in filters in the QB (#53326) 2025-02-11 20:32:58 +00:00
Cam Saul
5cdb9aeb17 [Backend modularization] More xrays module cleanup (#53426)
* [Backend modularization] More `xrays` module cleanup

* Rename test namespaces

* Sort namespaces

* Test fixes 🔧
2025-02-11 20:28:20 +00:00
Romeo Van Snick
972530b4b4 Fix model native editor render loop (#53526)
* Remove explicit focus call on mount

* Only call onSelectionChanged when the selection changes
2025-02-11 21:15:31 +01:00
Uladzimir Havenchyk
3353942052 fix: allow using long name in save question modal (#53232)
* fix: allow using long name in save question modal

* fixup

* adjust styles

* fix e2e test

* fix selector

* fix test
2025-02-11 17:48:00 +00:00
Jeff Bruemmer
1b6b0e4e65 model details (#53549) 2025-02-11 12:44:50 -05:00
Jeff Bruemmer
e3f5a8fa02 docs - dashboard duplication note (#53546) 2025-02-11 11:47:56 -05:00
Jeff Bruemmer
59b1c333bc docs - Entity IDs for interactive embedding (#52992) 2025-02-11 10:59:48 -05:00
Filip Hric
a09a2afb05 fix test flake (#53530) 2025-02-11 14:37:24 +01:00
Filip Hric
445bf5fd4e fix test flake (#53519) 2025-02-11 13:18:48 +01:00
Romeo Van Snick
9625969eab Remove color for codemirror identifier token (#53480)
* Remove color for codemirror identifier token

* Add exclude to keywords for h2
2025-02-11 12:09:42 +01:00
Filip Hric
bb9c605f9e add new script to stress test workflow file (#53522) 2025-02-11 10:53:46 +00:00
Sébastien
34d4548595 fixes offset images when dnd-ing columns in dashcards (#53112)
* 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
2025-02-11 11:32:37 +01:00
Uladzimir Havenchyk
5094cb83a8 fix: correct layout for duplicate modal when question name is long (#53363)
* fix: correct layout for duplicate modal when question name is long

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

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

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

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

* address review

* address review

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-02-11 10:32:25 +00:00
Sébastien
3c97adc08f reset title to default now reflects reality (#53121) 2025-02-11 10:25:24 +01:00
Sébastien
756d0188e0 an attempt te reduce the spam in the dev console (#53214) 2025-02-11 10:25:11 +01:00
Phoomparin Mano
e81a4d3808 feat(sdk): show clarification messages upon running the cli (#53471)
* add clarification message to the cli

* update cli startup message

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

* line-wrap the cli startup message

* use metaba.se/sdk for docs link

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-11 15:39:23 +07:00
Cam Saul
f236589153 [Backend modularization] revisions module (#53419)
* Revisions module

* Test fixes

* Remove legacy-metric impl

* Fix CODEOWNERS

* Cleanup

* Merge fixes
2025-02-10 22:29:23 -08:00
Mahatthana (Kelvin) Nomsawadi
0faa1b815e Improve type clarity (#53444) 2025-02-11 05:41:50 +00:00
Cam Saul
869d810773 Actions module cleanup (#53424)
* Actions module cleanup

* Sort namespaces
2025-02-11 03:28:05 +00:00
Cam Saul
7fc08ff0e1 [Backend modularization] activity-feed module (#53427) 2025-02-10 19:53:34 -07:00
Cam Saul
a9732409d7 [Backend modularization] Bookmarks module (#53417) 2025-02-10 19:47:35 -07:00
Fraser
410d7e6b53 remove unused test script (#53497) 2025-02-11 15:01:13 +13:00
Ryan Laurie
ecabdc59ec fix output var (#53498) 2025-02-10 16:39:45 -07:00
Jeff Bruemmer
da8a48b462 docs - update env var doc strings (#53268) 2025-02-10 22:06:31 +00:00
John Swanson
db26eebe3f Don't cache query results for impersonated users (#53489) 2025-02-10 14:04:42 -08:00
Ryan Laurie
7c010114d4 Allow Double (and Triple) Backports via label (#53201)
* Allow for 1-3 automatic backports via github label

remove other backport workflow

* remove test code

* fix pr ref

* remove unused env

* remove test code

* fix whitespace
2025-02-10 14:20:01 -07:00
Edward Paget
9748d41f4a Add edpaget to team files (#53490) 2025-02-10 14:55:43 -06:00
Jeff Bruemmer
ef8c3f2342 add frontmatter to api docs (#53488) 2025-02-10 15:45:02 -05:00
Nathan Voxland
f8bbd9ecc2 Limit last-id queries in SQL to improve performance (#53088) 2025-02-10 13:23:28 -06:00
Luis Paolini
6c0dedbb73 Fix multi-arch uberjar preview builds (#52897)
* 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: Ryan Laurie <iethree@gmail.com>
2025-02-10 19:10:47 +00:00
Filipe Silva
1ddf10f00a feat: use liquibase session lock instead of transaction lock (#53158)
* feat: use liquibase session lock instead of transaction lock

Prevent the migration lock class of errors in non-h2 dbs by using a liquibase session lock instead of a transaction lock.
This type of lock would clear automatically when the connection closes for any reason.

Using this approach there is no need for the metabase release lock command except with h2.
The force migration command still is applicable though, as it does more things than just release the lock.

See https://github.com/blagerweij/liquibase-sessionlock

Fix #50212

* fix: mark migration 109 as none db

From Nathan Voxland:

From a liquibase-standpoint, deleting the changesets are just fine. As long as you don't accidentally reuse the id+author+path combo in the future. Databases that already ran it will not care that it's missing and new databases will just never see it to know. So it's more of an our-standards questions.

Alternately, you can set dbms="none" to keep it in the file but not have it actually apply anywhere. That doesn't change the checksum

* fix: error when force-releasing non-h2 locks

* test: add session lock test
2025-02-10 18:29:58 +00:00
Ryan Laurie
03dc3fdd0d Streamline local e2e test running (#53095)
* 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
2025-02-10 11:12:48 -07:00
Ryan Laurie
1b1c572c2c add alex yakushev to slack map (#53440) 2025-02-10 11:11:51 -07:00
Ryan Laurie
b16161533d Upgrade to NodeJs 22 (#53446)
* update to node 22
2025-02-10 11:06:28 -07:00
Sloan Sparger
e6f551e0a0 [CI] Fix flaky dashboard tab test v2 (#53327)
* flaky test fix v2

* add flaky prevention measure

---------

Co-authored-by: Filip Hric <filip@filiphric.sk>
2025-02-10 11:45:26 -06:00
Cam Saul
60e08be857 [Backend modularization] user-key-value module (#53416) 2025-02-10 09:41:54 -08:00
Phoomparin Mano
9d12421e41 fix(sdk): dashboard not found when switching dashboards in cli (#53452) 2025-02-11 00:08:46 +07:00
Aleksandr Lesnenko
5351d4d4a9 remove flaking legacy tooltips from visual tests (#53448)
* remove flaking legacy tooltips from visual tests

* update snapshots, remove legacy tooltip and popover stories
2025-02-10 12:55:00 -04:00
Nicolò Pretto
c03a49a87c fix(sdk): better scope for SCOPED_CSS_RESET to fix transparent (#53443)
background on buttons
2025-02-10 17:10:43 +01:00
William
52ffc412c8 param->fields looks through filterable columns (#53379)
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.
2025-02-10 16:07:45 +00:00
Filip Hric
eb931d72b1 update timings on specs (#53356) 2025-02-10 17:03:11 +01:00
Phoomparin Mano
cf4f46e5c6 fix(sdk): make headers in generated cli components responsive (#53455) 2025-02-10 22:43:23 +07:00
Eric Normand
ae958b131c Check cycles on PUT to /card/:id (#53373)
* 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`
2025-02-10 10:12:34 -05:00
Romeo Van Snick
dfd0a55a09 Fix json indentation (#53365)
* Use indentMore instead of inserTab

* Customise indentation for JSON-like databases

* Add highlight for brace

* Add e2e test for JSON indentation
2025-02-10 14:14:55 +00:00
Uladzimir Havenchyk
58998875a4 fix: make switcher position stable (#53402) 2025-02-10 11:55:04 +03:00
Cam Saul
e7f1a92c8a [Backend modularization] timelines module (#53391)
* `timelines` module

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

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

* PR feedback and test fixes 🔧
2025-02-07 19:47:13 -08:00
Oisin Coveney
9a554425e2 fix(sdk): Clean up and enhance InteractiveQuestion docs (#53283) 2025-02-08 02:44:19 +00:00
Uladzimir Havenchyk
e104ed81e5 chore: upgrade shadow-cljs to align with deps.edn (#53313) 2025-02-07 23:49:45 +03:00
Jeff Bruemmer
c20c9b7cb6 docs - various edits (#53382) 2025-02-07 20:49:17 +00:00
Alex Yarosh
db35fefdc3 docs: note about marketplaces (#53395) 2025-02-07 15:14:19 -05:00
Alex Yarosh
df3843215d docs: 53 edits (#53383) 2025-02-07 15:13:39 -05:00
Luis Paolini
28a2150c1e Flag the site url requirement (#53301)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-07 18:07:22 +00:00
Alex Yarosh
f31cb4c45d docs: druid basic auth (#53380) 2025-02-07 13:03:20 -05:00
Nathan Voxland
01b996ddb6 Added Session Cleanup Job (#53246) 2025-02-07 09:50:01 -06:00
John Swanson
5cad344fd0 xrays create dashboard questions (#52462)
* Create dashboard questions for x-rays

* Don't make subcollections for autogened dashboards

Before, for an admin we'd create a structure like:

```
- Our analytics
  - Automatically Generated Dashboards
    - A look at Accounts
      - Dashboard
      - Card 1
      - Card 2
      - ...
```

Or, for regular users, a structure like:

```
- Your personal collection
  - A look at Accounts
    - Dashboard (A look at Accounts)
    - Card 1
    - ...
```

Now, we'll create the following structure:

```
- Our Analytics (OR Your personal collection, for non-admins)
  - Automatically Generated Dashboards
    - Dashboard (A look at Accounts)
```

Other autogenerated dashboards will be placed alongside.
2025-02-07 07:11:25 -08:00
Mahatthana (Kelvin) Nomsawadi
924e2ecd3d fix(sdk): Fix question not found error showing briefly after navigating from dashboards (#53284)
* 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
2025-02-07 12:38:24 +00:00
Chris Truter
5de615c633 Log name of missing class when implicitly deleting job (#53357) 2025-02-07 13:30:24 +02:00
Chris Truter
a260601156 Fix search for queries with single backslashes (#53296) 2025-02-07 10:50:53 +00:00
Filip Hric
926d2c617e remove all instances of describeEE, onlyOnEE and onlyOnOSS (#53240) 2025-02-07 09:27:01 +01:00
Ryan Laurie
9af191fc60 paste instead of type saml key (#53303) 2025-02-07 00:49:05 +00:00
Ryan Laurie
ef6a9bb253 One parent test job + run it on draft PRs (#53258)
* one parent test job
2025-02-06 17:07:32 -07:00
bryan
2cc56a4c13 rename enable embedding sdk alignment migration id (#53339)
* rename enable embedding sdk alignment migration id

* changeset ids must be in order
2025-02-06 23:18:56 +00:00
Fraser
d72c26b66c Remove FS_CACHE references from docs (#53338) 2025-02-07 11:25:21 +13:00
Oisin Coveney
81e6f479e9 Don't document SDK embed terms switch (#53316) 2025-02-06 21:01:13 +00:00
John Swanson
45aaf7c6d7 Allow disabling reading a setting from env vars (#53330) 2025-02-06 12:58:26 -08:00
bryan
a5f6687798 update enable-embedding-sdk based on embedding-app-origins-sdk (#53263)
* 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
2025-02-06 13:23:55 -07:00
Filip Hric
eeeb6bbc5c add visibility check before saving dashboard (#53292) 2025-02-06 20:28:27 +01:00
Oisin Coveney
b71e299854 Drop from sdk legalese copy (#53315) 2025-02-06 17:19:19 +00:00
Case Nelson
95fe8fa5f2 fix (ci): Set longer timeout to ensure we get a successful connection attempt (#53312) 2025-02-06 10:12:49 -07:00
Nicolò Pretto
9cef486ea3 chore(sdk): make FlexibleSizeComponent private (#53304) 2025-02-06 18:04:44 +01:00
Romeo Van Snick
3e71b70d8d Type mbql required features (#53293)
* Type requiredFeatures as DatabaseFeature

* Add missing database features from MBQL
2025-02-06 17:51:41 +01:00
Dan Stone
84c99be11a Allow private slack channels to be returned for alerts/subscriptions (#53128)
* Allow private slack channels to be listed for alerts/subscriptions.

Requires the groups:read scope to see private channels
 * manifest.yaml changed so new installations get it by default
 * things are kept compatible if the token does not have the scope
 * you can manually add the scope to the app in slack.
  private channels will then up when the channels are refreshed

* Update the slack manifest.yaml inlined in the docs

* Add re-installation guidance to slack docs for `groups:read`

* Ensure slack token is set in conversations-list test

* Refactor conversations-list to take :private-channels opt

* Add refresh-channels-and-usernames! test to check groups:read behaviour
2025-02-06 16:38:35 +00:00
Ryan Laurie
da360af2d0 flaky tab test (#53309) 2025-02-06 16:25:42 +00:00
Aleksandr Lesnenko
ecfae75734 fix invalid pivot table columns in click behavior (#53013)
* fix invalid pivot table columns in click behavior

* spec
2025-02-06 12:19:32 -04:00
Sébastien
47108c9f94 no more super tiny remove button for condition rules (#53295) 2025-02-06 16:40:43 +01:00
Sloan Sparger
6c6372f6bc [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
2025-02-06 09:00:57 -06:00
Filip Hric
5e5f44878d unmark tests as flaky (#53298)
* 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
2025-02-06 14:54:47 +00:00
Cam Saul
c9d6609021 [Backend modularization] More search module cleanup (#53269)
* [Backend modularization] Search module cleanup

* Sort namespaces
2025-02-06 14:19:08 +02:00
Sébastien
e5044f2cb8 Dashcard titles no longer interactive when editing the dashboard (#53168)
* dashcard titles no longer interactive when editing the dashboard

* added test
2025-02-06 10:52:58 +01:00
Sébastien
ce24e63aca viz settings tabs don't scroll anymore, only the content does (#53178)
* viz settings tabs don't scroll anymore, only the content does

* e2e
2025-02-06 09:51:38 +01:00
Cam Saul
3cd46419dd Add custom linter to make sure requires are on newlines (#53272) 2025-02-06 09:57:42 +07:00
Nick Fitzpatrick
b09343c050 add estimated size to Search Results virtual list in entity picker (#53226) 2025-02-05 20:24:57 -04:00
Ryan Laurie
53ee36832a remove unused labeled trigger for backend tests (#53235) 2025-02-05 17:13:29 -07:00
Case Nelson
6136047dff Add legacy handling for snowflake password (#53181) 2025-02-05 16:47:27 -07:00
Jeff Bruemmer
1c755054c9 docs - note on upgrading to pro (#51585)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-02-05 23:02:06 +00:00
github-actions[bot]
bed2c3d442 Update Translations for v53 (#52775)
* Add new strings for v53

* Update translations

* Update translations

* kick ci

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-02-05 22:29:20 +00:00
Sloan Sparger
fa27b5e744 fixes unnoticed race condition in dashboard tab test (#53267) 2025-02-05 15:24:22 -07:00
Nemanja Glumac
a4b2ccd657 Upsell Advanced Permissions (#53080)
* Remove the custom permissions upsell component

* Implement upsell for advanced permissions

This applies to both:
- `/admin/permissions/data/group` and
- `/admin/permissions/data/database/` routes.

* Remove the old feature from the enterprise feature level permissions
2025-02-05 21:00:20 +01:00
lbrdnk
570cd10c3c Fix use of offset with external remapping (#53118)
* Fix use of offset with external remapping

* whitespace

* Address review remarks
2025-02-05 20:33:59 +01:00
Sloan Sparger
7c13028d7f [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
2025-02-05 11:45:08 -06:00
Alexander Polyankin
94379d8a54 Fix memoization of extensions in CodeMirror (#53241)
* Renaming

* Memoize

* Memoize
2025-02-05 12:35:34 -05:00
appleby
4ca935e2cf Fix quick filter drill for trend charts (#53135)
* 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
2025-02-05 09:11:40 -08:00
Nemanja Glumac
2634a5ff83 Remove the postcss-presets-env warning about the partially supported end value (#53220) 2025-02-05 18:06:55 +01:00
Chris Truter
efd7c708b2 Use env vars in backend process (#53237)
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-02-05 18:16:18 +02:00
Filip Hric
4949cf3847 mark additional tests as flaky (#53243) 2025-02-05 16:15:10 +00:00
Chris Truter
566f21d1ae Fix search index update job restart issue (#53229) 2025-02-05 15:40:51 +00:00
Phoomparin Mano
29bcb43082 fix(sdk): remove unsafe lifecycle errors from DashboardGrid (#53213)
* 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

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

* 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: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-05 22:25:10 +07:00
lbrdnk
8250c46747 [WIP] Querying generative test (#53183)
* Add generative test

* Use per test generator with adjustable seed

* Add workflow file

* Temporarily add trigger

* Make rand function work with default generator

* Update log4j2 test config

* Info log level

* Whitespace

* Add iteration count and env to make run on-demand

* cljfmt

* cljfmt
2025-02-05 16:02:51 +01:00
Oisin Coveney
26e2e158ee Add legalese modal to present SDK terms (#53139) 2025-02-05 06:55:57 -08:00
Uladzimir Havenchyk
1124000465 fix: allow replacing a question with a long name (#53217) 2025-02-05 17:47:24 +03:00
Nicolò Pretto
6cd6235289 lets see how many things break in ci (#53107) 2025-02-05 15:36:14 +01:00
Filip Hric
2d60b9cb44 disable video recording on snapshots and delete videos on successful tests (#53169) 2025-02-05 14:57:12 +01:00
Phoomparin Mano
cb8266362c fix(sdk): remove unsafe lifecycle errors from Visualization (#52885)
* 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

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

* remove deriveStateFromProps from constructor

* use sdkProviderProps to pass provider props

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-05 20:39:54 +07:00
Ryan Laurie
39860ebb86 better interactivity check for opening sidebar (#52539) 2025-02-05 13:01:34 +01:00
Nicolò Pretto
61a58edaf9 fix(sdk): remove error about stageIndex prop being passed to dom element (#53165) 2025-02-05 10:43:52 +01:00
William
6e5293fdfa Don't infer join aliases when replacing a join (#53081)
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?).
2025-02-05 03:14:44 -06:00
Raphael Krut-Landau
c8f0e188a2 Add e2e tests checking high-visibility pages in top locales (#53203)
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.
2025-02-04 22:40:03 -05:00
Nemanja Glumac
74fc3b9db9 Introduce the Upsell Banner component (#53099) 2025-02-05 00:21:08 +01:00
Alex Yarosh
f02be4f3f7 docs: in clarification (#53182) 2025-02-04 17:21:19 -05:00
Alexander Solovyov
1ead33339c update to latest GraalVM JS version (#53155) 2025-02-04 23:57:11 +03:00
Nick Fitzpatrick
a70d20d135 fixed logo to support opacity and color props. looks correct in admin… (#53167)
* fixed logo to support opacity and color props. looks correct in admin app now

* adding back fill=currentColor
2025-02-04 16:04:17 -04:00
Phoomparin Mano
faa7c736d0 fix(sdk): echarts tooltip is cut off below the viewport height (#52822) 2025-02-05 01:24:38 +07:00
Sloan Sparger
b31ce245b7 Close CSV upload modal on escape press (#52913)
* close csv upload on escape

* fix unit test
2025-02-04 12:12:17 -06:00
Sloan Sparger
9e0f6e1703 Fix home page Metabot spacing on large screens (#52916) 2025-02-04 12:10:43 -06:00
Sloan Sparger
4ba2882740 [Cards in Dashboards] Trash UI when removing last dashcard for a dashboard question (#52781)
* 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
2025-02-04 12:03:05 -06:00
Ryan Laurie
39a48c4539 mark browse metrics flakes as flaky (#53176) 2025-02-04 10:50:12 -07:00
Fraser
0bbab5f051 Add fraserdrops to team lists (#53150) 2025-02-05 06:43:53 +13:00
Uladzimir Havenchyk
42e50fbdcc convert header breadcrumbs components to typescript (#53110)
* convert header breadcrumbs components to typescript

* fix breadcrumbs

* tweaks
2025-02-04 16:39:37 +00:00
Phoomparin Mano
a2794d6ae2 feat(sdk): apply theming to interactive question modules (#52513)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-04 20:39:28 +07:00
Alberto Perdomo
e871e538b1 Update SDK usage wording (#53105)
* Update authentication.md

* Fix formatting in * below table
2025-02-04 13:23:01 +00:00
Filip Hric
feb7db2c06 ensure that the link abstracted from element is not empty (#53160) 2025-02-04 13:36:40 +01:00
Alexander Solovyov
30970aa4ac update snowflake (#53154) 2025-02-04 18:24:17 +07:00
Nathan Voxland
7d11423cef Support not specifying is_group_manager in /api/user calls on Pro (#52977) 2025-02-03 17:21:44 -06:00
Riley Thompson
123c1232fd Order the query in expression-using-aggregation-test (#53093)
* order query in test

* sort instead of order for h2
2025-02-03 17:37:52 -05:00
appleby
9b4a091817 Fix breakout by drill through context menu for multi-stage queries (#52925)
* 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
2025-02-03 14:31:23 -08:00
Victor Vieux
0b1c5003eb Add hostname support to BigQuery (#51948)
* Add hostname support to BigQuery

* Fix formatting

---------

Co-authored-by: Case Nelson <snoe@snoe.ca>
Co-authored-by: Case Nelson <case@metabase.com>
2025-02-03 15:50:12 -06:00
Case Nelson
eca452c45f Check connectivity on startup (#52934)
* 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
2025-02-03 14:40:09 -07:00
Nathan Voxland
69a72b9db8 Elide data in task_history.details which can get very large (#53002) 2025-02-03 14:20:08 -06:00
lbrdnk
443860bff5 Fix enum filtering on postgres (#52982)
* Fix filtering enum values on source card or model

* Add test

* Add logging

* Adjust virtual-table-metadata-test

* Adjust test

* Adjust test

* cljfmt

* Add dynamic-database-types-lookup

* Avoid redundant db calls

* Defualt impl arity

* cljfmt

* Constraint to initialized qp
2025-02-03 18:19:18 +01:00
Phoomparin Mano
f442920bb8 fix(sdk): fix minWidth console error in dashboard grid (#52880) 2025-02-04 00:18:42 +07:00
Nathan Voxland
9bd43494a6 Symbol for swedish krona is "kr" not "Skr" (#52921) 2025-02-03 09:50:27 -06:00
Braden Shepherdson
4968758f1d [chore] Bump BE deps at the start of Metabase 54 (#52853)
Fixes #52843.
 
* Redshift: Adding an explicit dep on `aws-java-sdk-core`

This is listed as an optional dep, but it seems that at least one class
from it (`com.amazonaws.util.StringUtils`) is now dynamically required
by our driver - tests were throwing `NoClassDefFoundError`s without it.

Redshift tests are passing locally with this dependency added.
2025-02-03 18:26:27 +03:00
Ryan Laurie
a6392f245a Dont run redshift upload tests on PRs (#53094)
* dont run redshift upload tests on PRs
2025-02-03 14:15:39 +00:00
Filip Hric
4fd4f14456 stabilize flaky tests (#53106) 2025-02-03 13:49:28 +01:00
Nicolò Pretto
12bb4b9e77 fix(entity-id): show 404 for entity id that starts with digits (#52896)
* 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
2025-02-03 13:44:07 +01:00
Alexander Solovyov
9c806a5c27 update hawk to silence warnings about algo.generic/abs override (#53104) 2025-02-03 15:36:06 +07:00
Sébastien
be5b292ba3 Proper title for cards when visualization is in error (#52680)
* proper title for cards when viz in error

* addressed PR feedback
2025-02-03 07:09:51 +01:00
Oleksandr Yakushev
e2fd234cc2 [csv-export] Follow-up optimizations to CSV pivotted export (#52810) 2025-02-02 08:41:33 +00:00
Cam Saul
ee16b43e3b [Backend modularization] permissions module (#52868)
* Squash

* Add missing API namespace

* Well moving the tests seemed to fix stuff

* Test fix 🔧
2025-02-01 04:14:03 +00:00
Alex Yarosh
4142c00db9 Update week.md (#53090) 2025-01-31 22:01:35 +00:00
Jeff Bruemmer
e58b3bc5dd Update connecting.md (#53087) 2025-01-31 21:57:56 +00:00
Jeff Bruemmer
c9dfcb2f47 docs - various link fixes (#53084)
* link

* another link
2025-01-31 16:52:02 -05:00
Alex Yarosh
1e17d6903d docs: percentile in usage analytics (#53078)
* docs: percentile in usage analytics

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

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-31 16:37:02 -05:00
Alex Yarosh
50d9099ca0 docs: add pics to week of year docs (#53068)
* week of year viz

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-31 20:26:03 +00:00
William
8b23d477dd Recognize year-of-era (#52930)
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.
2025-01-31 14:25:32 -06:00
Riley Thompson
0f0799898b Fix all-indexes->field-ids generating queries with too many parameters (#52835)
* partition indexes and use separate queries

* test no exception thrown

* improve helper func name

* improve test

* remove test debugging

* address pr comments
2025-01-31 20:16:52 +00:00
Noah Moss
13417eebb7 Delete legacy-no-self-service email (#53061) 2025-01-31 15:16:15 -05:00
Tyler Plude
ca6e3dba41 Fix min extent histogram (#52932)
* 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: Metabase Automation <github-automation@metabase.com>
2025-01-31 11:58:17 -08:00
Aleksandr Lesnenko
fc4024b973 fix row chart font in pdf exports (#53052) 2025-01-31 14:40:26 -05:00
Case Nelson
858fbb555f Ensure the classloader is in task thread contexts (#52990)
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.
2025-01-31 12:39:43 -07:00
Uladzimir Havenchyk
6033ae8983 chore: disable cljs live reload by default (#52894)
* chore: disable cljs live reload by default

* fixup
2025-01-31 19:27:53 +00:00
Uladzimir Havenchyk
5d498f51a1 chore: migrate emdedding-cli to rspack (#52949) 2025-01-31 22:14:01 +03:00
Eric Normand
87e1260760 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
2025-01-31 20:05:19 +01:00
Nick Fitzpatrick
3dd914fcaa Filter personal recent dashboards for the "Add to Dashboard" modal (#52927)
* Filter personal recent dashboards for the "Add to Dashboard" modal

* e2e adjustment
2025-01-31 14:47:09 -04:00
Nemanja Glumac
ea9fe96a71 Upsell Uploads and Storage (#52974) 2025-01-31 19:31:16 +01:00
Alberto Perdomo
916dd6bff7 Revise wording about shared user accounts when using SDK (#52986)
---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-31 18:30:24 +00:00
Jeff Bruemmer
e800fc7438 docs - api info (#52920) 2025-01-31 17:29:41 +00:00
Ryan Laurie
06064dfbaa quarantine flaky search pagination test (#53050) 2025-01-31 09:16:20 -07:00
Nicolò Pretto
5fcaa3c884 ci: find css variables that are used but never defined (#52910)
* 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

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

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

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-01-31 16:43:29 +01:00
lbrdnk
be1e70f51c Databricks #48585 follow-up (#48855)
* Remove redundant function

* Address test remarks

* Address remark
2025-01-31 15:09:11 +00:00
Alexander Polyankin
945237b09c Fix parameter popover width when the datepicker changes its width (#52985) 2025-01-31 15:02:24 +00:00
Alexander Polyankin
5fe517a03e Port native queries to MBQL lib (#52991) 2025-01-31 09:46:33 -05:00
Kamil Mielnik
ea53020156 Fix - Segment filter misaligned in filter modal (#53038)
* Fix #50734

* Add repro for #50734

* Add a comment

* Update comment
2025-01-31 14:32:36 +00:00
Luiz Arakaki
e1665c9674 Remove Exasol and Ocient (#52924) 2025-01-31 14:29:52 +00:00
Kamil Mielnik
b4a34ab899 Fix - Empty tooltip shown when save button is disabled (#53033)
* Fix #51035

* Add repro for #51035
2025-01-31 21:16:37 +07:00
Braden Shepherdson
969c1babd3 [cleanup] Delete lib.metadata/stage and stage-column (#52842)
These date from the beginnings of the `metabase.lib` codebase,
and are unused outside of a couple of tests.

I deleted the tests for these functions specifically, and updated a few
other tests that used these functions to retrieve columns on a query.

Prework for #49182.
2025-01-31 13:24:06 +00:00
Nicolò Pretto
59d45e5ef4 chore(sdk): remove build step from test-cypress-open-component-sdk (#52957) 2025-01-31 10:52:37 +00:00
Chris Truter
75e9be30f6 Lofi quartz debugging (#53029) 2025-01-31 11:49:44 +03:00
Chris Truter
dff830c1f6 More robust handling of search negation (#52976) 2025-01-31 08:00:34 +00:00
Kamil Mielnik
e40425322f Fix - Can't edit field descriptions from the edit mode of "learn about my data" (#52959)
* 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
2025-01-31 14:19:22 +07:00
Kamil Mielnik
f7f23dcf3e Fix - Incorrect document title when query fails (#52953)
* Fix #49270

* Turn it into an action for consistency

* Add a repro for #49270
2025-01-31 14:18:33 +07:00
Sébastien
93ed751688 Last axis label is now there on row charts (#52948)
* last axis label is now there

* updated screenshots

* unit test
2025-01-31 07:55:49 +01:00
Case Nelson
c806f3a599 fix: Mongodb handle let with alias with space (#52862) 2025-01-30 23:27:20 -07:00
Tyler Plude
426446b9fc Fixing xlsx pivot table exports to respect table column names (#52638)
* 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
2025-01-30 18:54:53 -08:00
Cam Saul
2cef7a8695 CI driver job tweaks (#53015)
* CI driver job tweaks

* SQL Server timeout after 30 minutes

* Ok maybe don't make the matrix fail-fast
2025-01-31 02:51:59 +00:00
Aleksandr Lesnenko
8ce4383355 allow numeric category columns to be considered as number columns (#52718) 2025-01-31 02:27:34 +00:00
Aleksandr Lesnenko
12cd25af26 apply custom separators to compactly formatted numbers (#52634)
* apply custom separators to compactly formatted numbers

* Update Loki Snapshots

* Update Loki Snapshots

* Update Loki Snapshots

* Update Loki Snapshots

* loki

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-01-30 21:15:44 -05:00
Cam Saul
55afff90af Fix Toucan 2 table name for unresolved models (#52939)
* Fix Toucan 2 table name for unresolved models

* Add explanation
2025-01-31 01:56:18 +00:00
Cam Saul
d27bcffb5f OpenAPI dox generation part 2 (#52998)
* 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
2025-01-30 17:41:35 -08:00
Oisin Coveney
aaae17f296 Add tests for file downloads from the public link sharing popover (#52779) 2025-01-30 23:01:54 +00:00
Oleksandr Yakushev
bc26890905 ci: Cache final H2 app DB scheme when running tests (#51523) 2025-01-31 00:58:27 +02:00
Alex Yarosh
0e988ff8a0 docs: week of year (#52877)
* docs: week of year

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-30 17:40:43 -05:00
Noah Moss
afce736c7f Move filters for perms-related t2 selects into the honeysql :where clauses (#52865) 2025-01-30 22:09:17 +00:00
Case Nelson
1d81ce41b1 Only add views to dynamic datasets (#52979)
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
2025-01-30 17:00:52 -05:00
Nick Fitzpatrick
eef8ad7901 updating the Logo SVG (#52908) 2025-01-30 17:25:41 -04:00
Cam Saul
66ff9f2c04 OpenAPI dox generation & request routing overhaul PART 1 (#52987)
* Will this work?

* Add updated api.macros

* Add missing file

* Test fix 🔧

* Backport more stuff

* Backport tests
2025-01-30 13:20:03 -08:00
Oisin Coveney
70d4582f67 fix(sdk): Remove ExplicitSize findDOMNode console errors (#52253) 2025-01-30 12:39:36 -08:00
Nemanja Glumac
703db28acd Upsell Better Support (#52955)
* Add upsell component for better support

* Implement upsell for better support on a troubleshooting page

* Snow better support upsell only for OSS

* Update import path

* Remove whitespace

* Account for smaller screens
2025-01-30 18:50:31 +01:00
Ryan Laurie
8949f1598a tag model index search tests as flaky (#52969) 2025-01-30 17:19:05 +00:00
Alexander Polyankin
ebe179780b Reuse getMappingOptionByTarget in ParameterTarget component (#52903) 2025-01-30 10:32:38 -05:00
Nicolò Pretto
4b5c8caa1e fix(entity-id): don't call to the card endpoint if the entity id starts with digits (#52892)
* 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
2025-01-30 08:29:48 -07:00
Romeo Van Snick
a746d081b7 Disable flaky tests for native editor (#52943)
* Remove flaky tags in e2e/test/scenarios/native/native.cy.spec.js

* Remove flaky tags in e2e/test/scenarios/native/native_subquery.cy.spec.js

* Remove flaky tags in e2e/test/scenarios/native/native-reproductions.cy.spec.js

* Remove flaky tag from admin test that uses native editor

* Remove flaky tag from visualization test that uses native editor

* Remove flaky tag from dashboard test that uses native editor

* Add helper to clear browser cache

* Reduce flakiness in autocomplete test

* Remove flaky tag in e2e/test/scenarios/native-filters/native-filters-reproductions.cy.spec.js
2025-01-30 16:26:01 +01:00
lbrdnk
0f5b4944e3 Make deduplication of returned-columns available in pivoting (#52914)
* WIP Move deduplication from js wrapper into returned-columns

* Move deduplication into pivoting code
2025-01-30 15:47:37 +01:00
Alexander Solovyov
69c2c29e0e [search] create index tables with nanoid instead of uuid (#52942) 2025-01-30 14:19:04 +00:00
Filip Hric
fe5de91ff7 fix flaky helper causing flakes (#52954) 2025-01-30 15:15:32 +01:00
Ryan Laurie
666bf41aa2 Auto reset data db for writable db tests (#52784) 2025-01-30 06:51:02 -07:00
Chris Truter
48f792ab99 Hopefully fix e2e search flakes (#52944) 2025-01-30 16:26:03 +03:00
Mahatthana (Kelvin) Nomsawadi
220e18db22 ci: Fix SDK cross-version testing failure after test util refactor when cutting 54 (future) (#52941)
* 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

* Ensure when we cut 54, we won't ran into SDK cross-version testing
2025-01-30 09:21:13 +00:00
Filip Hric
697bfef8d7 introduce tree-shaking of helpers by adding them to the Cypress object (#52042)
* second attempt at treeshaking

* add eslint rules to disallow direct helper imports
2025-01-30 10:13:46 +01:00
Uladzimir Havenchyk
2d6c18162b fix: reload model after applying prev revision (#52849)
* fix: reload model after applying prev revision

* add tests

* fix lint

* reuse helpers
2025-01-30 06:04:04 +00:00
Oisin Coveney
cd209344c6 feat(sdk): Add option to remove dashboard footer (#52555)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-01-29 17:25:23 -08:00
Alexander Solovyov
a451a506a0 update oracle driver to jdk17+ (#52895)
* update oracle driver to jdk17+

* another place with java 11
2025-01-30 00:54:07 +03:00
Eric Normand
3cc73019c5 Stop drilling down past day in DateType (#52869)
* Stop drilling down past day in DateType

* Distinguish date and datetime drill-down

* Rename local and add comment
2025-01-30 00:50:51 +03:00
Braden Shepherdson
bba632c41e [refs] Make lib.tu/* into functions, not top-level defs (#52841)
Future work on the refs overhaul #49182 changes how queries are
represented. To enable testing that new behaviour at a per-test level,
we can't let global queries like `lib.tu/venues-query` be defined once
and reused forever: in that case, tests of the new refs would see global
queries defined under old refs, and vice versa.

This change transforms the global queries, cards and other helpers in
`lib.test-util` from static `def`s to functions, so they build the
queries etc. in the context of the current test.

(If this introduces a performance hit for the lib tests, we can update
the functions to cache the two versions up front and choose between them
at runtime. So far it does not seem to have made a significant impact.)
2025-01-29 16:10:48 -05:00
Alexander Polyankin
0d0a53e0fd Set max length for question name (#52793) 2025-01-29 20:13:32 +00:00
Uladzimir Havenchyk
e8cec5b900 chore: migrate static-viz build to rspack (#52734) 2025-01-29 23:07:10 +03:00
Case Nelson
7f1147c96a Add describe-database check to view tests (#52912)
* Add describe-database check to view tests

* Check for the correct view-name
2025-01-29 12:39:28 -07:00
Noah Moss
cc0cbb27b3 Ensure relevant models are loaded when running preemptive caching task (#52855)
* Ensure relevant models are loaded when running preemptive caching task

* typo

* Fix linter
2025-01-29 14:04:00 -05:00
Romeo Van Snick
cc928b793b Replace ACE with CodeMirror in the native query editor (#51632)
* Use CodeMirror 6 (#50484)

* Add @uiw/react-codemirror

* Add language plugins for codemirror

* Add @codemirror/autocomplete

* Add basic codemirror editor

* Add selection handler to CodeMirror editor

* Set height

* Add basic styling to codemirror editor

* Add custom selection background

* Add simple theme with font settings

* Move extensions to a separate file

* Implement right click on selection

* Add language support

* Add @codemirror/language

* Add @lezer/highlight

* Add custom syntax colors

* Hightlight tags

* Add highlight for matching bracket

* Add completions

* Add snippet completions

* Make the editor full height by default

* Remove duplicate dependencies

* Match autocomplete colors with ace editor

* Render completion items in subgrid

* Tweak completion margin

* Use nesting

* Add hover state on completions

* Make getTagAtCursor more sueful

* Move matchTagAtCursor to utils

* Avoid work when there's no need

* Implement onCursorMoveOnCardTag

* Move autocomplete into language helper

* Disable language completions when inside a tag

* Allow open ended tags to return without suffix

* Add testid to codemirror editor

* Update test helpers

* Fix native subquery tests

* Fix native reproductions

* Fix snippet tests

* Remove ensureAceEditorClosed helper

* Add nativeEditorType helper

* Fix action tests

* Do not use native editor helper for custom expression test

* Add more native editor helpers

* Fix model metadata tests

* Use better type helpers

* Add more TODO comments

* Fix sharing test

* Simplify e2e helper

* Use native editor type helper

* Fix clearNativeEditor helper

* Fix missing namespace

* Update Loki Snapshots

* Remove unused lang extension

* Be explicit about h2 engine

* Nest language plugin return

* Export useLazyGetCardQuery

* Add completions for referenced card columns

* Split up autocompleters

* Simplify completion info

* Use cached cards

* Move useMemoized to util

* Add TODO comment about engine type

* Fix subquery test

* Use helpers in native reproduction

* Fix e2e test meta helper

* Do not assume we've seen all suggestions when narrowing down

* Fix selectAll

* Unskip unbroken test

* Fix broken reproduction

* Increase the delay for autocompletions to kick in

* Fix nativeEditorSelectAll on non-Mac systems

* Rename completer

* Move completers to separate file and make them handle their own dependencies

* Add autocomplete endpoints to metabase/api

* Use autocompletion hooks from metabase/api

* Reuse AutocompleteMatchStyle type

* Simplify helper

* Whitespace formatting

* Test sub-limit completion

* Fix reproduction

* Add tests for matchTagAtCursor

* Remove commented out code

* Typos

* Clarify why we disable rtk-query's cache

* Simplify cx call

* Use Cypress.platform over navigator.platform

* Tweak fold caret position

* Pass font to cm-content too

* Add synteax highlighting for the name token

* Rename AutocompleteSuggestionsRequest to AutocompleteRequest

* Fix broken overflow on notebook preview

* Add more fonts to monospaceFontFamily

* Use the same line height as the ACE editor

* Autocomplete much faster

* Handle overflow in completion meta

* Use shared object

* Add padding to editor scroll pane

* Add more fonts to monospaceFontFamily

* Set line-height to normal

* Fold on parens, braces and brackets

---------

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

* Namespace native editor e2e helpers (#51093)

* Add namespace for helpers

* Replace H.nativeEditor with namespaced version

* Replace H.focusNativeEditor with namespaced H.NativeEditor.focus()

* Replace H.nativeEditor completions helpers with namespaced versions

* Replace H.nativeEditorSelectAll with namespaced version

* Replace H.nativeEditorClear with namespaced version

* Replace H.nativeEditorType with namespaced version

* Use NativeEditor.type where possible

* Fix imports

* Replace H.focusNativeEditor with namespaced H.NativeEditor.focus()

* Use NativeEditor.type where possible

* Use NativeEditor.clear where possible

* Do not call NativeEditor

* Add missing backspace in helpers

* Fix case of selectall

* Remove use of focus().as(...)

* Fix NativeEditor.get call

* Fix e2e test

* Remove focus where it is wrong

* Fix text replacement test

* Add small delay

* Remove ACE version of the Native editor (#51437)

* Remove sql_behaviour

* Remove getEngineNativeAceMode

* Remove CARD_TAG_REGEX

* Do not re-export ACE_EDITOR_ID

* Remove AceEditor

* Remove ACE_EDITOR_ID from NativeEdiror mock

* Remove AceEditor reference in test

* Remove intermediate editor

* Update Loki Snapshots

* Fix formatting

* Fix broken test

* Various fixes for the native editor revamp (#52321)

* Deduplicate schema completions

* Align description to the right

* Add keyword description to comletions

* Render completion description in normal font

* Set indentation to use tabs

* Remove boost from completions

* Stop cmd+enter from entering a newline

* Use same indentation as previous line when pressing Enter

* Remove empty resize handler in CodeMirrorEditor

* Add defaults to NativeEditor.type

* Make config parameter optional

* Add custom keymaps for next and previous completions

* Add custom interpolations for previous and next completion

* Add helpers up and down arrows

* Add reproduction for #48712

* Add tests for suggestion issues

* Allow completing from inside a word

* Add unit test for useSchemaCompletions

* Add unit test for useSnippetCompletions

* Add unit test for useCardTagCompletion

* Add unit test for useReferencedCardCompletion

* Accept completion with tab

* Do not indent with tab, but just insert a tab

* Use Lib.Query in CodeMirrorEditor

* Simplif CodeMirror editor prop and ref names

* Add simple unit test for CodeMirrorEditor

* Use isNotNull helper

* Use Lib.Query in NotebookNativePreview

* Handle nil in engine

* Handle empty engine

* Use correct meta kay in test

* Reduce flakiness in dashboard test

* Reduce flakiness in native test

* Add completion for query locals

* Make database optional

* Add test for locals

* Add test for command enter

* Add tests for indenting with tab

* Handle non-darwin platform in test

* Allow typing {tab}

* Add test for indentation

* Handle quoted locals

* Add typing to source

* Improve syntax highlighting for mongo

* WIP: add custom keywords completion for mongo

* Make collection_id optional

* Remove test return

* Handle SQLDialct shape

* Handle keyword completion all in the completer

* Lift completers out of language plugin

* Move language helpers to separate file

* Simplify keywords extraction

* Add tests for keyword completion

* Add more mongo keywords

* Fix quoted local test

* Add suggestion tests for mongo

* Fix e2e test with NativeEditor

* Update Loki Snapshots

* Fix e2e test with NativeEditor

* Revert "Update Loki Snapshots"

This reverts commit 7d1ea82579.

* Revert "Revert "Update Loki Snapshots""

This reverts commit fd7b552770.

* update screenshot

* Fix autocomplete API calls in the new native query editor (#52688)

* Enable autoFocus

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-01-29 18:39:22 +01:00
Nick Fitzpatrick
687fe82667 Fix nav bar highlighting when creating a new question (#52847) 2025-01-29 12:37:34 -04:00
Alexander Polyankin
b4a28c6a6f Fix setting "Display as Link" in model metadata (#52749) 2025-01-29 11:25:30 -05:00
Aleksandr Lesnenko
4f899500f6 drop codenotify (#52690) 2025-01-29 15:56:35 +00:00
Chris Truter
ee6550bfbe Add metrics around default and active engines (#52893) 2025-01-29 15:56:17 +00:00
Uladzimir Havenchyk
07967d1d54 ci: do not cache yarn registry (#52658) 2025-01-29 12:42:36 +00:00
Kamil Mielnik
674a2ef295 Remove deprecated custom Cypress API commands (#52878)
* 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
2025-01-29 17:59:24 +07:00
Filip Hric
f5531c1b7c fix path in codeowners (#52881) 2025-01-29 11:46:47 +01:00
Uladzimir Havenchyk
85f0815d4d chore: cleanup storybook patches (#52805) 2025-01-29 13:22:43 +03:00
Kamil Mielnik
a034598d14 Fix - Wrong value shown in the filter modal (#52594)
* 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
2025-01-29 14:24:42 +07:00
Chris Truter
415864829a Initialize zeros for labeled counter metrics (#52834) 2025-01-29 07:14:06 +00:00
Sébastien
55f2b55347 Fix ultra wide tooltips (closes #52199) (#52455)
* fix ultra wide tooltips (closes #52199)

* all tooltips wrap now, and better test

* sturdier test

* use setup() in test case

* removed unncessary code path
2025-01-29 07:23:47 +01:00
Sébastien
a04fbad1c4 Sets the proper autofocus when navigating to a specific setting through the hash (#52588)
* autofocus is now properly set when using a hash in settings

* tests

* fix types in tests

* better type in test
2025-01-29 07:23:35 +01:00
appleby
414d7c21c6 Convert nil values to :null in dimension-contexts (#52692)
* 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
2025-01-28 17:15:03 -08:00
Sloan Sparger
d951556eb1 [Cards in Dashboards] Allow duplicating questions into dashboards (#52750)
* allow duplicating questions into a dashboard

* add model test, fix copy of entity picker modals for models
2025-01-28 16:11:16 -06:00
Alex Yarosh
23b1ee90f4 docs: java 21 (#52858) 2025-01-28 17:01:33 -05:00
Cam Saul
54d9d77892 Remove defendpoint 1 (#52785) 2025-01-28 14:32:48 -07:00
Riley Thompson
8a2b0538f1 Use features instead of hard-coded driver names in tests (#52758)
* 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
2025-01-28 21:26:05 +00:00
Luiz Arakaki
3d960aeb80 Update Usage analytics YAMLs for 53 release (#52833)
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.
2025-01-28 17:46:48 -03:00
Oisin Coveney
71c3a2bab6 ci(sdk): Make 53 the latest in release workflow (#52789) 2025-01-28 12:02:48 -08:00
Oisin Coveney
20a474a2f2 Bump master to 54 nightly (#52790) 2025-01-28 12:00:07 -08:00
Case Nelson
5fb2f158ec Handle legacy secrets double encoded with base64 (#52836) 2025-01-28 11:24:49 -07:00
Ryan Laurie
24a9ab15e4 disable broken multi-arch container (#52839) 2025-01-28 10:56:13 -07:00
Noah Moss
9c1d83d272 Don't try to cancel a statement that has already been closed (#52762) 2025-01-28 12:39:01 -05:00
Oleksandr Yakushev
8ce2ee9f06 [test] Don't pprint values in malli= unless necessary (#52830) 2025-01-28 19:34:46 +02:00
Sloan Sparger
38e44a29bc [Cards in Dashboards] Revision history copy change (#52423)
* update copy and avoid showing two messages about moving when going between collections and dashboards in different collections

* pr feedback

* impl pr feedback
2025-01-28 10:47:07 -06:00
Abed Habli
b74a5a7056 Update google-sign-in.md (#52826) 2025-01-28 17:34:08 +01:00
Nicolò Pretto
9863ce2a11 fix: some css variables were not defined (#52808) 2025-01-28 17:18:45 +01:00
Nicolò Pretto
810fe8e072 extract function from component (#52820) 2025-01-28 17:16:44 +01:00
Sloan Sparger
7c096d3e5d [Cards in Dashboards] Fix dashboard on the go bug #52821 2025-01-28 16:08:18 +00:00
Nemanja Glumac
e800e56f96 Empty states: dashboards (#52639)
* 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
2025-01-28 17:07:26 +01:00
Nick Fitzpatrick
c177bbcee7 For your consideration - collection menu (#52709)
* For your consideration - collection menu

* type adjustment

* CI green?

* conditional for recommended

* adjusting e2e
2025-01-28 11:45:56 -04:00
Nicolò Pretto
783fa00d69 mark "should allow users to paginate results" as flaky as it fails with (#52816)
a new e2e grouping
2025-01-28 15:25:10 +00:00
Filip Hric
8638b3c780 add rule to prevent unsafe element filtering (#52432)
* 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
2025-01-28 16:22:25 +01:00
Sébastien
1a4aa1a5cb slightly tweaked the font size in gauge to make sure middle label is always visible (#52740) 2025-01-28 15:39:36 +01:00
Ryan Laurie
4b2db972d7 Build releases on java 21 for 53 (#52795)
* use java 21 for 53

* fix unit test
2025-01-28 07:00:45 -07:00
Uladzimir Havenchyk
e4c5f2fce7 chore: reduce flakiness on loki screenshots (#52751)
* chore: reduce flakiness on loki screenshot

* add try/catch

* add another check

* fixup

* increase timeout
2025-01-28 16:09:31 +03:00
Vamsi Peri
8c03762cc5 Update team.json (#52794) 2025-01-28 11:48:57 +00:00
William
760f65f7e5 Account for DATEFIRST in sql server (#52636)
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.
2025-01-28 10:47:17 +00:00
Mahatthana (Kelvin) Nomsawadi
0f488296d8 ci(sdk): embedding e2e workflow fixes for 53 branch (#52800)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-01-28 10:33:30 +00:00
Nicolò Pretto
e242f00b64 support entity ids with /entity/ routes (#52659)
* 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
2025-01-28 11:03:23 +01:00
Cam Saul
3bbae3d595 Make public dashcards download endpoint match FE expectations (#52763)
* Fix public dashcards download endpoint

* Finally handle form-encoded bodies correctly
2025-01-28 01:08:20 +00:00
Cam Saul
19f17b54f8 Auto-rewrite (most) defendpoint forms in card.clj (#52569)
* Auto-rewrite defendpoint forms in card.clj

* Test fixes 🔧

* Test fixes 🔧

* Test fix 🔧

* Test fix 🔧

* cljfmt
2025-01-28 00:24:38 +00:00
Nathan Voxland
89d1513395 Limit amount of data stored in the in-memory log (#52548)
Limit amount of data stored in the in-memory log
2025-01-27 18:10:55 -06:00
Luis Paolini
b9eae7d152 Fix the Dockerfile (#52761)
seems like debian doesn't ship java 21, so I added the one from Temurin following https://adoptium.net/en-GB/installation/linux/
2025-01-27 21:07:08 -03:00
Cam Saul
57e371f5dc Auto-rewrite defendpoint forms in ldap.clj (#52565)
* Auto-rewrite defendpoint forms in ldap.clj

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

* Kondo
2025-01-27 15:40:54 -08:00
Ryan Laurie
77291ab895 allow dashes in hashes for e2e failure notification (#52764) 2025-01-27 16:12:39 -07:00
Cam Saul
1e83d3d38d Auto-rewrite defendpoint forms in dashboard.clj (#52481)
* Auto-rewrite defendpoint forms in dashboard.clj

* Auto-rewrite defendpoint forms in dashboard.clj

* Fix tests
2025-01-27 23:06:06 +00:00
Cam Saul
e4451b2f77 Auto-rewrite defendpoint forms in dataset.clj (#52552)
* 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
2025-01-27 15:02:30 -08:00
Nathan Voxland
e8797bc340 Don't email "new login" detected emails on embedded logins (#52286)
- Cleaned up session management
- Don't send "new device" email from embedded logins

---------

Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-01-27 16:36:53 -06:00
Ryan Laurie
6f02407835 Disable query analysis (update e2e test) (#52754)
* pass through env vars

* fix e2e test

* Revert "pass through env vars"

This reverts commit d10c7bbaea.
2025-01-27 13:59:26 -07:00
Dan Stone
62eb4a6dbe Fix blank eid not creating a new entity on load (#52517) 2025-01-27 18:37:39 +00:00
Jeff Bruemmer
eaa13e8a6b docs - moving questions into dashboards (#52755) 2025-01-27 13:36:34 -05:00
Nemanja Glumac
4ddf02cc2b Empty states: dashboard subscriptions (#52717)
* Improve empty states for dashboard subscriptions

* Prevent the title jumping when opening email subscription
2025-01-27 19:25:46 +01:00
Hervé Labas
fb65c38b84 Add desc systematically + reporter info (#52725) 2025-01-27 10:54:01 -07:00
Noah Moss
d4a9b80e2b Avoid cartesian products in pivot csv exports (#52551)
* Avoid cartesian products in pivot csv exports

* Get row and column sorting working properly

* Add a bunch of unit tests

* Test fixes, various tweaks to better match the FE output

* Fix another test

* address feedback
2025-01-27 12:37:06 -05:00
Chris Truter
ee727307c4 Disable query analysis by default (#52728) 2025-01-27 11:56:51 -05:00
Oisin Coveney
b29716d856 Convert expression popover to mantine to fix z-index issues (#52719) 2025-01-27 16:55:31 +00:00
Hervé Labas
63703cfb15 Added missing Metric mention (#52584) 2025-01-27 15:31:01 +00:00
Aleksandr Lesnenko
36bbfeec80 fix only one comparison can be added (#52644) 2025-01-27 15:29:20 +00:00
Kamil Mielnik
41441f6090 Add a repro for #32840 (#52742) 2025-01-27 15:14:20 +00:00
Filip Hric
d0859d5455 fix flaky test (#52731) 2025-01-27 15:57:31 +01:00
Alexander Polyankin
89a0a1a66a Fix converting nested mongo questions to native (#52645) 2025-01-27 09:52:34 -05:00
Mahatthana (Kelvin) Nomsawadi
a904c1e5be fix(sdk): Fix nextJS compatibility layer missing components (#52672)
* Fix nextJS compat missing components

* Remove leftover console.log

* Make code easier to understand

* Make the code more explicit
2025-01-27 14:11:30 +00:00
Mahatthana (Kelvin) Nomsawadi
3365b33beb Manually revert 88141a8 (#52736) 2025-01-27 12:34:04 +00:00
Chris Truter
7bc578d008 Track search index queue size as prometheus gauge (#52737) 2025-01-27 12:26:42 +00:00
Kamil Mielnik
a7b8f79b03 Refactor - React Context in FilterModal (#52651)
* 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

* Rename handle* to on*
2025-01-27 10:17:44 +00:00
John Swanson
bb909363a2 Do not clean sandboxing queries (#52710) 2025-01-25 05:39:51 +00:00
Cam Saul
a99a7dd117 Auto-rewrite defendpoint forms in session.clj (#52570)
* Auto-rewrite defendpoint forms in session.clj

* Auto-rewrite defendpoint forms in session.clj

* Remove &request anaphor and make it a normal arg

* Add test

* Defendpoint 2.1

* base-handler => handler

* Fix Kondo errors

* Make sure async exception handling is done correctly
2025-01-24 19:02:15 -08:00
Cam Saul
13e237e007 Auto-rewrite defendpoint forms in table.clj (#52642)
* Auto-rewrite defendpoint forms in session.clj

* Auto-rewrite defendpoint forms in session.clj

* Revert changes to session

* Auto-rewrite endpoints in table.clj

* Restore session.clj

* OK unrestore session

* Fix macroexpansion

* Support non-map HTTP request bodies

* Remove &request anaphor and make it a normal arg

* Add test

* Defendpoint 2.1

* base-handler => handler

* Fix Kondo errors

* Update src/metabase/api/table.clj

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

* Update src/metabase/api/table.clj

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

* no more `&request`

---------

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-01-24 19:01:57 -08:00
Cam Saul
1a60acc0e6 Convert /public endpoints to defendpoint 2, second try (#52715) 2025-01-24 17:04:26 -08:00
Cam Saul
91953b7c96 defendpoint 2.2: auto-infer route regexes based on schemas (#52649)
* defendpoint 2.2

* Remove unused stuff

* PR feedback from @escherize
2025-01-24 17:04:01 -08:00
Cam Saul
6e5360ed78 Rewrite all remaining defendpoints except those in public.clj (#52708)
* Remove defendpoint-async

* Rewrite all the rest of the remaining defendpoints except for those in public

* Remove card endpoints from this PR

* Update src/metabase/setup/api.clj

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

* cljfmt

* Test fixes 🔧

---------

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-01-24 17:02:43 -08:00
Cam Saul
399e8944ad Rewrite defendpoints in testing.clj and EE saml.clj (#52646) 2025-01-24 23:59:01 +00:00
Cam Saul
eca1f09ffe Auto-rewrite sandboxing REST API endpoints (#52640)
* Auto-rewrite sandboxing REST API endpoints

* attribute_remappings should be optional

* Test fix 🔧
2025-01-24 23:16:09 +00:00
Noah Moss
d65e48e6e1 Make preemptive caching toggle a FE plugin (#52131)
* Make preemptive caching toggle a FE plugin

* make sure we expose the premium feature to the FE

* fix BE test
2025-01-24 17:00:28 -06:00
Jeff Bruemmer
41a300da8c note on excel cell limit (#52713) 2025-01-24 17:12:15 -05:00
givemesomefaces
d83f37e5af XLSX Export truncate String cells to 32767 chars (#51706)
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-01-24 16:46:25 -05:00
Cam Saul
060e5930d0 Drop Java 11/17 Support (#52620)
* Drop Java 11/17 Support

* Update Dockerfile

Change the Java version of the builder as well

* mention that we are dropping support for earlier Java in docs

---------

Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2025-01-24 13:37:27 -08:00
Cam Saul
b941c552f0 Auto-rewrite even more defendpoints (#52641)
* Auto-rewrite more defendpoints

* Test fixes 🔧

* Test fixes 🔧
2025-01-24 20:16:16 +00:00
Cam Saul
768cb9514f defendpoint 2.1: 3x performance boost (#52647)
* Remove &request anaphor and make it a normal arg

* Add test

* Defendpoint 2.1

* base-handler => handler

* Fix Kondo errors
2025-01-24 13:14:08 -07:00
Cam Saul
fa3b30034e Auto-rewrite SCIM endpoints (#52633) 2025-01-24 13:02:25 -07:00
Cam Saul
b8b539de91 Auto-rewrite defendpoints in channel module (#52632) 2025-01-24 12:59:55 -07:00
Alberto Perdomo
878a67a293 Add caveat about SDK client filtering (#52681)
* Add caveat about SDK client filtering
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-24 19:58:49 +00:00
Riley Thompson
ff747db23e Fix flaky date-string->range driver test (#52590)
* mock time using with-redefs

* remove parallel

* use with-clock
2025-01-24 19:13:53 +00:00
Sloan Sparger
889664c71f [Cards in Dashboards] Prevent saving to other dashboards when creating a dashboard question (#52406)
* adds back prop that prevented feature from working

* fix e2e
2025-01-24 13:46:16 -04:00
Sloan Sparger
c584246f18 [Cards in Dashboards] Bulk move dashboard question candidates (#52171)
* throw down ui

* pixel freaking perfect

* wire in real endpoint for fetching dashboard question candidates

* wire in move endpoint

* loading and error handling for mutation

* persist info step acknowledgement

* optionally show item in menu, fix flickering of info modal is acked previously, add a toast on successful bulk move

* fix some of the failing existing tests

* add unit tests for collection menu

* add unit tests for main migration modal

* add e2e test

* fix failing unit test

* fix another failing unit test

* fix candidates result being stale if dashcards added/removed from dashboards creates/removes candidates

* adjust url of feature

* copy feedback

* fix type-check

* scope feature to only admins

* use pagination to fetch count but not items when detecting if to show the migration tool menu item

* test + style improvements, impl pr feedback

* fix unit tests, add unit coverage for is admin
2025-01-24 11:16:00 -06:00
appleby
a5207cbab4 Disable drill thrus for native queries with template-tag variables (#52485)
* Add lib.native/has-template-tag-variables?

* Disable drills for native queries with template tag variables

Closes #49051

* Re-export lib.native/has-template-tag-variables? from lib.core

* Add tests for disabled drills for native queries with variables

* Review feedback
2025-01-24 08:31:06 -08:00
Chris Truter
3155b1cd2a Mark metrics-search as flaky (#52668) 2025-01-24 09:13:30 -07:00
Oisin Coveney
3a8cf256d0 Convert LoadingAndErrorWrapper to TS (#52475) 2025-01-24 07:37:39 -08:00
Uladzimir Havenchyk
f81d575f9d chore: upgrade undici package with a security fix (#52656)
* chore: upgrade undici package with a security fix

* remove resolution for source-map-js
2025-01-24 17:37:57 +03:00
Chris Truter
8473fdb650 Move weight updates to a PUT (#52582) 2025-01-24 17:34:40 +03:00
Alexander Solovyov
9543678121 start prometheus when sending metrics if it was not started yet (#52652) 2025-01-24 17:24:20 +03:00
Alexander Polyankin
d9674eb215 Remove an empty query stage after a drill from dashboards (#52631) 2025-01-24 09:21:28 -05:00
Alexander Polyankin
1f7cd46a28 Close clause popovers when dnd is active (#52616) 2025-01-24 09:21:11 -05:00
Chris Truter
c09ff48c6c Simplify and shorten upload table names (#52581)
Closes: https://github.com/metabase/metabase/issues/52116

Note that of icu4j was already a dependency, via graalvm. 

We have just made it explicit now, ~~and updated to the latest version.~~ ([upgrading version breaks rendering](https://github.com/metabase/metabase/actions/runs/12926546646/job/36049844305?pr=52581))

```
org.graalvm.js/js 22.3.5
  . org.graalvm.regex/regex 22.3.5
    . org.graalvm.truffle/truffle-api 22.3.5
    . com.ibm.icu/icu4j 71.1
  . org.graalvm.truffle/truffle-api 22.3.5
    . org.graalvm.sdk/graal-sdk 22.3.5
  . org.graalvm.sdk/graal-sdk 22.3.5
  . com.ibm.icu/icu4j 71.1
```
2025-01-24 13:33:59 +00:00
Uladzimir Havenchyk
18e423c8df fix: allow passing aggregation instead of expression (#52628)
* allow passing aggregation instead of expression

* add e2e test
2025-01-24 11:00:33 +00:00
Timofey Kachalov
a58c82bec5 Refactor use-embed-font hook (#52447) 2025-01-24 14:38:04 +04:00
Chris Truter
1a413c114b Always schedule new trigger (#52600) 2025-01-24 06:50:39 +00:00
Cam Saul
adedaf3677 Auto-rewrite defendpoint forms in persist.clj (#52562)
* Auto-rewrite defendpoint forms in persist.clj

* Auto-rewrite defendpoint forms in persist.clj
2025-01-23 19:06:53 -08:00
Cam Saul
f35c2c286b Auto-rewrite defendpoint forms in timeline.clj (#52564) 2025-01-23 19:06:19 -08:00
Cam Saul
86eefeff09 Auto-rewrite defendpoint forms in google.clj (#52626) 2025-01-24 02:35:37 +00:00
Cam Saul
3b3771be4e Auto-rewrite defendpoint forms in task.clj (#52558) 2025-01-23 18:07:33 -08:00
Cam Saul
4b60e5ab18 Auto-rewrite defendpoint forms in slack.clj (#52568) 2025-01-24 01:55:02 +00:00
Cam Saul
92b0983353 Auto-rewrite defendpoint forms in embed.clj (#52567)
* Auto-rewrite defendpoint forms in embed.clj

* Auto-rewrite defendpoint forms in embed.clj

* Auto-rewrite defendpoint forms in embed.clj
2025-01-23 17:47:02 -08:00
Cam Saul
9d5cf6baaf Auto-rewrite defendpoint forms in revision.clj (#52625) 2025-01-24 01:01:01 +00:00
Cam Saul
c453d347e8 Auto-rewrite remaining defendpoint forms in src/metabase/api/api_key.clj (#52624)
* Auto-rewrite defendpoint forms in src/metabase/api/api_key.clj

* Auto-rewrite defendpoint forms in src/metabase/api/api_key.clj

* Fix formatting

* Auto-rewrite defendpoint forms in api_key.clj

* Auto-rewrite defendpoint forms in api_key.clj
2025-01-24 00:55:10 +00:00
Cam Saul
91c6427e1f Auto-rewrite defendpoint forms in segment.clj (#52559) 2025-01-23 16:43:57 -08:00
Cam Saul
a5ccd65d08 Auto-rewrite defendpoint forms in timeline_event.clj (#52560) 2025-01-23 16:43:24 -08:00
Eric Normand
fedd7d2485 Test: Oracle compares dates (no time) correctly (#52606)
* Test: Oracle compares dates (not time) correctly

* Indentation

* Parameterize test to clarify only type changes
2025-01-23 17:23:17 -06:00
Alexander Polyankin
ee22e2895f Fix recents in the entity picker for tables in joins (#52630) 2025-01-23 21:47:08 +00:00
Cam Saul
77269788b6 Auto-rewrite defendpoint forms in preview_embed.clj (#52566)
* Auto-rewrite defendpoint forms in preview_embed.clj

* Auto-rewrite defendpoint forms in preview_embed.clj
2025-01-23 13:54:57 -07:00
Cam Saul
efa723617e Auto-rewrite defendpoint forms in setting.clj (#52563) 2025-01-23 13:52:18 -07:00
Cam Saul
dc674ad1f6 Auto-rewrite defendpoint forms in native_query_snippet.clj (#52561) 2025-01-23 13:47:15 -07:00
Ryan Laurie
c349e6fc00 Properly tag external db tests (#51875)
* update ci file change deps

* update tags
2025-01-23 20:46:29 +00:00
Cam Saul
4995c330e7 Auto-rewrite defendpoint forms in model_index.clj (#52557) 2025-01-23 13:40:05 -07:00
Uladzimir Havenchyk
df32bd3af1 chore: upgrade storybook to v8 (#51699)
* updated some flaky screenshots
* simplified ci job
* updated types
* registered visualizations and added a way to register multiple visualizations in storybook
* replaced @storybook/testing-library with @storybook/test
2025-01-23 20:15:11 +00:00
Jeff Bruemmer
b188dafad9 Update converttimezone.md (#52617) 2025-01-23 14:04:20 -05:00
John Swanson
0c1593e9b4 Paginate the DQ candidates endpoints (#52533)
* Paginate the DQ candidates endpoints

* Paginate in Clojure

I think this should be fine - the number of cards we're working with
should be relatively small, since this is working one collection at a time.

* CR response
2025-01-23 18:57:01 +00:00
Ryan Laurie
2e13505d19 Split up slow e2e test spec (#52416)
* split the chonky tests up

* est timings

* update timings
2025-01-23 11:48:13 -07:00
Dan Stone
dde841f26e Do not ignore full_stacktrace on import (#52580) 2025-01-23 18:37:46 +00:00
Alexander Polyankin
ebaf8a84c6 Add repro for "Cannot filter on enum fields on dashboards" (#52602) 2025-01-23 13:24:46 -05:00
Alexander Polyankin
86d9c905b5 Remove an external link from convert-timezone description (#52603) 2025-01-23 12:52:24 -05:00
Cam Saul
3e5c7bda5e Auto-rewrite defendpoint forms in database.clj (#52543)
* Auto-rewrite defendpoint forms in database.clj

* Some cleanup

* Update src/metabase/api/database.clj

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

* cljfmt

* Auto-rewrite defendpoint forms in database.clj

* Test fix?

---------

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-01-23 09:21:33 -08:00
John Swanson
839b090013 Exclude DQs from DQ candidate endpoint (#52516)
* Exclude DQs from DQ candidate endpoint

... oops

I also moved the `(= (:collection_id card) (:collection_id dashboard))`
check out of `card/sole-dashboard-id`, since it's not really part of
being a sole dashboard.

* Add `dashboard_id IS NULL` to the query

... instead of filtering them out in clojure.
2025-01-23 11:20:53 -06:00
William
37aaa66a85 Allow passing aggregation functions to coalesce (#52505)
This was already legal-ish, as [:* 1 [:sum ...]] was a valid argument to coalesce.  However, you couldn't pass in the
sum directly.  Under the hood, NumericExpressionArg allowed aggregations, but ExpressionArg didn't.  Presumably, the
one is supposed to be a superset of the other, and this change made that actually be true.
2025-01-23 10:51:49 -06:00
Filip Hric
0e7b66ae44 improve rules around unscoped-selectors rule (#52509)
* improve rules around unscoped-selectors rule

* add a test for newly added rules
2025-01-23 16:49:41 +01:00
Ryan Laurie
8a5eb47579 quarantine flaky tests (#52589) 2025-01-23 06:47:19 -07:00
Ngoc Khuat
19acff81ae Fix dashboard subscription sometimes shows empty result (#52571) 2025-01-23 11:13:25 +00:00
lbrdnk
e98220607a Add reproduction for #49433 (#52553) 2025-01-23 10:29:36 +01:00
Sébastien
eccfcf2c17 Trim tab names on blur (closes #50797) (#52397)
* Trim tab names on blur (closes #50797)

* cleaner tests
2025-01-23 10:02:17 +01:00
Phoomparin Mano
f32093aac1 ci(sdk): skip flaky tooltip test on ci (#52577) 2025-01-23 15:55:01 +07:00
Chris Truter
7c71973684 Register prometheus endpoint metrics (#52534) 2025-01-23 08:24:18 +00:00
Phoomparin Mano
9e9292d5e4 Revert public.clj changes from #52490 (#52574) 2025-01-23 13:53:43 +07:00
Phoomparin Mano
e3cdbbf7a8 fix(sdk): fix save question form's cancel button height (#52504) 2025-01-23 12:55:26 +07:00
Phoomparin Mano
88141a8fca fix(sdk): echarts tooltip is cut off below the viewport height (#52310) 2025-01-23 12:55:16 +07:00
Cam Saul
5b8adfe4df Auto-rewrite defendpoint forms in util.clj (#52486)
* Auto-rewrite defendpoint forms in util.clj

* Test fix 🔧
2025-01-22 19:50:45 -08:00
Cam Saul
87f5ff5025 Auto-rewrite defendpoint forms in pulse.clj (#52549)
* Auto-rewrite defendpoint forms in pulse.clj

* Don't ignore ALL the deprecated namespaces <3

* Test fixes 🔧
2025-01-22 19:50:12 -08:00
Cam Saul
1e4bf6a9ea Auto-rewrite defendpoint forms in search.clj (#52550)
* Auto-rewrite defendpoint forms in search.clj

* Auto-rewrite defendpoint forms in search.clj

* Auto-rewrite defendpoint forms in search.clj
2025-01-22 19:18:25 -08:00
Sloan Sparger
f3715931c0 [Cards in Dashboards] Update question save location filter to exclude items without can_write access (#52395)
* filter out collections and dashboards where can_write is false from recents tab in collection picker

* move modal filter out locations you can not save to from recents tab

* add e2e test

* pr feedback - make cleaner and add comment
2025-01-22 20:04:04 -06:00
Cam Saul
61dbcc3c4e Auto-rewrite defendpoint forms in field.clj (#52544)
* Auto-rewrite defendpoint forms in field.clj

* Auto-rewrite defendpoint forms in field.clj
2025-01-23 01:46:37 +00:00
Cam Saul
97ce719dc1 Auto-rewrite (some) defendpoint forms in session.clj (#52542) 2025-01-22 14:49:00 -08:00
Tyler Plude
74b7088daa Fixes bug where scaled column is not respected in xlsx exports (#50518) (#52482)
* Fixes bug where scaled column is not respected in xlsx exports

* Fixing associated scaled value export unit test
2025-01-22 14:26:19 -08:00
Cam Saul
7ca14ce129 Auto-rewrite defendpoint forms in permissions.clj (#52541)
* Auto-rewrite defendpoint forms in permissions.clj

* Auto-rewrite defendpoint forms in permissions.clj
2025-01-22 13:45:46 -08:00
Raphael Krut-Landau
1ba4aba2d0 [Deets in Sheets]: Relationships tab (#52057)
This PR adds a Relationships tab to the question info sidesheet that shows where the question/model is used, and which tables are linked to it.

![image](https://github.com/user-attachments/assets/ccfb3e8e-923f-41b7-a45f-ca171141695d)
2025-01-22 16:30:06 -05:00
Jeff Bruemmer
d077d441d5 docs - remove paid features docs section (#52545)
* remove paid features docs section

* redirect
2025-01-22 16:09:14 -05:00
Cam Saul
b9d2bbe034 Auto-rewrite defendpoint forms in automagic_dashboards.clj (#52471)
* Auto-rewrite defendpoint forms in src/metabase/api/automagic_dashboards.clj

* Manual cleanup

* Auto-rewrite defendpoint forms in bookmark.clj

* Manual cleanup

* Auto-rewrite defendpoint forms in automagic_dashboards.clj

* Fix endpoints with no route params but no regexes

* Auto-rewrite defendpoint forms in automagic_dashboards.clj

* Auto-rewrite defendpoint forms in automagic_dashboards.clj

* Auto-rewrite defendpoint forms in automagic_dashboards.clj

* Don't include changes to dev namespace

* Revert changes to bookmark

* Some manual cleanup

* Show should be optional
2025-01-22 20:32:59 +00:00
Cam Saul
3aadc1e6bb Auto-rewrite defendpoint forms in user.clj (#52488) 2025-01-22 20:31:52 +00:00
Ryan Laurie
333eca8d45 reset webhook tester (#52538) 2025-01-22 13:10:24 -07:00
Cam Saul
3f01cd254d Auto-rewrite defendpoint forms in user_key_value.clj (#52489)
* Auto-rewrite defendpoint forms in user_key_value.clj

* Auto-rewrite defendpoint forms in user_key_value.clj

* Auto-rewrite defendpoint forms in user_key_value.clj

* Cleanup + fixes 🔧
2025-01-22 12:05:11 -08:00
Cam Saul
c7fe1a2484 Auto-rewrite defendpoint forms in cache.clj (#52476)
* Auto-rewrite defendpoint forms in cache.clj

* Auto-rewrite defendpoint forms in cache.clj

* Auto-rewrite defendpoint forms in cache.clj

* Auto-rewrite defendpoint forms in cache.clj

* Fix schema for PUT /api/cache

* Fix cache schema (part 2)
2025-01-22 19:50:34 +00:00
Cam Saul
dddd710ac8 Auto-rewrite defendpoint forms in public.clj (#52490)
* Auto-rewrite defendpoint forms in public.clj

* Auto-rewrite defendpoint forms in public.clj
2025-01-22 18:43:58 +00:00
Alexander Polyankin
a82a386525 Fix numeric parameter value parsing when there are no connected database fields (#52484) 2025-01-22 18:27:15 +00:00
Nemanja Glumac
4b5ddbd97f Exclude e2e-tests-result from Slack notifications (#52530)
* Exclude `e2e-tests-result` from Slack notifications

* Update .github/workflows/rerun-workflows.yml

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

* Keep the flaky job check separate

* missing paren

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-01-22 18:50:24 +01:00
Cam Saul
776e0c65cf Auto-rewrite defendpoint forms in cloud_migration.clj (#52478) 2025-01-22 10:38:42 -07:00
Cam Saul
2f21dd6596 Auto-rewrite defendpoint forms in bookmark.clj (#52472)
* Auto-rewrite defendpoint forms in bookmark.clj

* Manual cleanup
2025-01-22 10:38:03 -07:00
Cam Saul
dae1de739f Auto-rewrite defendpoint forms in src/metabase/api/api_key.clj (#52470)
* Auto-rewrite defendpoint forms in src/metabase/api/api_key.clj

* Auto-rewrite defendpoint forms in src/metabase/api/api_key.clj

* Fix formatting
2025-01-22 10:37:00 -07:00
Ryan Laurie
ac46c14f5f remove useless jobs (#52532) 2025-01-22 10:24:12 -07:00
dpsutton
758921c1a3 Better error messages when embedding against oss (#52445)
Fixes #51972

Error message in oss:
```
❯ http get localhost:3000/auth/sso/ -pb
{
    "message": "The auth/sso endpoint only exists in enterprise builds",
    "status": "ee-build-required"
}
```

Working endpoint on ee (but an error message about what it needs)

```
❯ http post localhost:3000/auth/sso/logout -pb
{
    "errors": {
        "cookies": "map where {metabase.SESSION -> <map where {:value -> <value must be a non-blank string.>}>}"
    },
    "specific-errors": {
        "cookies": {
            "metabase.SESSION": [
                "missing required key, received: nil"
            ]
        }
    }
}
```

Running tests:

```
;; without enterprise on classpath
clj -X:dev:test :only metabase.server.auth-wrapper-test

Running tests in metabase.server.auth-wrapper-test
Ran 1 tests in 3.761 seconds
4 assertions, 0 failures, 0 errors.
{:test 1, :pass 4, :fail 0, :error 0, :type :summary, :duration 3760.932417, :single-threaded 1}
Ran 0 tests in parallel, 1 single-threaded.
All tests passed.

;; with enterprise on classpath
clj -X:dev:ee:test :only metabase.server.auth-wrapper-test
0 assertions, 0 failures, 0 errors.
{:test 1, :pass 0, :fail 0, :error 0, :type :summary, :duration 3705.00675, :single-threaded 1}
Ran 0 tests in parallel, 1 single-threaded.
All tests passed.
```

with enterprise has 0 assertions

and in
2025-01-22 09:32:44 -06:00
Raphael Krut-Landau
15f83e691d [Deets in Sheets] Add actions link to question info sidesheet (#52422) 2025-01-22 09:41:23 -05:00
Raphael Krut-Landau
d913e17690 [Deets in Sheets] Remove model detail links (#52349) 2025-01-22 09:40:50 -05:00
Raphael Krut-Landau
2fe63c903f [Deets in Sheets] Add fields to question info sidebar (#51907) 2025-01-22 09:40:16 -05:00
Filip Hric
643e7647f9 add a guarding assertion and remove eslint-disable (#52510) 2025-01-22 14:19:37 +01:00
John Swanson
61e74eb120 Use official docker image for Mongo (#42870)
The `circleci/*` images were deprecated in late 2021 and replaced by
`cimg/*` images. But we can just use the official images.
2025-01-22 04:43:00 -08:00
Alexander Solovyov
1df2e40a59 [search] track indexing errors (#52452) 2025-01-22 15:17:00 +03:00
Phoomparin Mano
3879be8bde docs(sdk): add proficiency labs color scheme to storybook (#52507) 2025-01-22 19:08:04 +07:00
Kamil Mielnik
1d5b5c6b33 Fix - Actions can't be made public (#52314)
* Do not render "Make public" toggle in Create Action Modal

* Disable the "make public" toggle and add a tooltip explaining why it's disabled
- Use Mantine's Switch
- Use Mantine's Tooltip

* Add a repro for #51282

* Update test name

* Fix tests

* Update unit tests

* Add unit test repro for #51282

* Remove e2e repro for #51282

* Format code

* Format code
2025-01-22 09:44:25 +00:00
Sébastien
43bf9c58c8 Fixes ellipsis button hidden when dash card title is empty string (#52305)
* fix unknown attribute error

* fix another error message about unknow HTML attribute

* fix invisible ellipsis when title is empty string

* added e2e test
2025-01-22 10:37:30 +01:00
Kamil Mielnik
9290125217 Add a repro for #7108 (#52429) 2025-01-22 14:39:48 +07:00
Kamil Mielnik
3efcf2c860 Fix - Default names for date and number filters are off (#52369)
* Update labels

* Revert "Update labels"

This reverts commit be632aec2e.

* Simplify the fix

* Update unit tests

* Update test

* Revert "Simplify the fix"

This reverts commit a9c267c4c0.

* Update labels

* Update test

* Make it work in native editor

* Revert "Update unit tests"

This reverts commit 3614a8ff2f.

* Update test

* Update test

* Update test

* Update test
2025-01-22 14:39:24 +07:00
Tyler Plude
7f3816a47a Using 1 as max value in minibar chart rendering logic if the column i… (#51937)
* Using 1 as max value in minibar chart rendering logic if the column is pure percent

* Adding MiniBar unit spec

* Prettier --write

* fixing eslint errors

* polish specs

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2025-01-21 23:20:59 -08:00
Alexander Polyankin
9315a633b3 Fix loader flicker and double scrollbars with the entity framework in Admin -> Data model -> Segments (#52411) 2025-01-22 04:13:36 +00:00
Cam Saul
98907d2f58 Auto-rewrite defendpoint forms in collection.clj (#52479)
* Auto-rewrite defendpoint forms in collection.clj

* cleanup

* Test fixes
2025-01-21 17:29:28 -08:00
Cam Saul
ffa6bedead Auto-rewrite defendpoint forms in cards.clj (#52477) 2025-01-21 16:30:01 -08:00
Cam Saul
79143aa539 Defendpoint 2 misc fixes (#52473)
* Defendpoint 2 misc fixes

* More fixes 🔧

* Remove some requires for faster loading; always make all query params optional

* Fix comment

* Make :boolean default false as well
2025-01-21 16:29:43 -08:00
Cam Saul
23f0e9405f Auto-rewrite defendpoint forms in activity.clj (#52474)
* Auto-rewrite defendpoint forms in activity.clj

* Auto-rewrite defendpoint forms in activity.clj

* Formatting

* Auto-rewrite defendpoint forms in activity.clj

* Auto-rewrite defendpoint forms in activity.clj
2025-01-21 15:48:42 -08:00
Nick Fitzpatrick
aff8e8e792 Update keyboard command palette nav to support ctrl + enter (#52285)
* Update keyboard command palette nav to support ctrl + enter

* add support for meta key, don't close on ctrl + click

* adding settings routes
2025-01-21 19:45:44 -04:00
Nemanja Glumac
c0dddcc3ae Empty states: models (#52205)
Add or visually upgrade the empty states for models.
This is primarily targeting the `/browse/models` page.
2025-01-22 00:36:52 +01:00
Cam Saul
c06e0293b5 Auto rewrite legacy defendpoint 1 forms (part 1) (#52294)
* Auto rewrite defendpoint ones

* My bird is typing

* Make sure response format matches old defendpoint format

* Cleanup

* Clean up alert tests

* Test fixes 🔧

* One last test fix 🔧

* Make actions execute body optional
2025-01-21 15:07:51 -07:00
Uladzimir Havenchyk
61e3d00fb2 tests(e2e): disable cypress_split summary (#52392)
* tests(e2e): disable cypress_split summary

* update test to trigger ci
2025-01-22 00:25:08 +03:00
Uladzimir Havenchyk
d2b8c0bf08 fix: use white color for icon on hover (#52440) 2025-01-21 19:14:50 +00:00
Sloan Sparger
65c112a89c Prevent Dashboard from reloading when clicking move, duplicate, and trash options in context menu (#52456)
* use Link component instead of a tags to avoid reloading the page

* fix typo

* Update frontend/src/metabase/dashboard/components/DashboardHeader/buttons/DashboardActionMenu.tsx

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

* Update frontend/src/metabase/dashboard/components/DashboardHeader/buttons/DashboardActionMenu.tsx

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

---------

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2025-01-21 13:14:46 -06:00
Uladzimir Havenchyk
f8a65475c0 chore(qb): drop useless divider (#52441) 2025-01-21 18:47:33 +00:00
Uladzimir Havenchyk
3267710d8d fix: update labels in the exclude date options (#52389)
* fix: update label in the exclude date options

* update tests

* update tests

* fix tests

* update loki screenshots
2025-01-21 21:43:19 +03:00
Jeff Bruemmer
0fcb08f545 enterprise only (#52151) 2025-01-21 13:05:00 -05:00
Jeff Bruemmer
80449f3cb6 docs - iframe and link variables (#52457)
* iframe and link variables

* vars
2025-01-21 12:59:13 -05:00
Raphael Krut-Landau
0efd740217 Prevent unsafe usage of localeCompare and related functions (#52399)
As a follow-up to #52284, this PR adds lint rules banning the pattern that caused a P1 (#48144). These rules require us to use the browser default with `String.localeCompare` and related functions in the `Intl` library. Since we cannot pass these functions our own locale codes, since some of these are in the wrong format.

This is designed to be a good-enough, "80 percent of the value with 20 percent of the effort" solution, even though better solutions could be pursued such as aligning FE and BE around an international standard (BCP 47).

- [x] Tests have been added/updated to cover changes in this PR
2025-01-21 12:24:44 -05:00
Oleksandr Yakushev
4f6373a71d [db-pool] Retry acquiring the connection one in tests to reduce flakiness (#52360) 2025-01-21 18:12:26 +02:00
Oleksandr Yakushev
b94b107b81 Bump HoneySQL (#52359) 2025-01-21 18:10:32 +02:00
Timofey Kachalov
af094941c8 fix(sdk): add theme change transition to the root element (#52427) 2025-01-21 19:40:03 +04:00
Alex Yarosh
af75dec737 docs: QB UI updates (#52393)
* UI updates

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-21 15:38:56 +00:00
Aleksandr Lesnenko
00059659bf allow selecting non-metric columns for tooltips of cartesian charts (#52180) 2025-01-21 10:29:13 -05:00
Chris Truter
85d3b4907b More reindexing up into the restore snapshot API (#52442) 2025-01-21 15:24:57 +00:00
dpsutton
abad978404 Add an order by to the batched truncation (#52417)
This is a strange one. But in practice, this was still doing a seq scan
on postgres.

```sql
clean=# explain DELETE FROM query_execution WHERE id IN (SELECT id FROM query_execution WHERE started_at <= '2025-01-02 01:10:15.651839+00' LIMIT 50000);
                                                           QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------
 Delete on query_execution  (cost=526084.17..1066675.96 rows=0 width=0)
   ->  Nested Loop  (cost=526084.17..1066675.96 rows=50000 width=34)
         ->  Unique  (cost=526076.73..526326.73 rows=50000 width=32)
               ->  Sort  (cost=526076.73..526201.73 rows=50000 width=32)
                     Sort Key: "ANY_subquery".id
                     ->  Subquery Scan on "ANY_subquery"  (cost=0.00..522174.32 rows=50000 width=32)
                           ->  Limit  (cost=0.00..521674.32 rows=50000 width=4)
table scan >>>>>              ->  Seq Scan on query_execution query_execution_1  (cost=0.00..1704153.49 rows=163335 width=4)
                                       Filter: (started_at <= '2025-01-01 19:10:15.651839-06'::timestamp with time zone)
         ->  Bitmap Heap Scan on query_execution  (cost=7.44..11.46 rows=1 width=10)
               Recheck Cond: (id = "ANY_subquery".id)
               ->  Bitmap Index Scan on query_execution_pkey  (cost=0.00..7.44 rows=1 width=0)
                     Index Cond: (id = "ANY_subquery".id)
(13 rows)

```

The odd thing is that it is sensitive to what timestamp you use. Here's
the same query but with a timestamp in 2024:

```sql
clean=# explain DELETE FROM query_execution WHERE id IN (SELECT id FROM query_execution WHERE started_at <= '2024-12-19 01:10:15.651839+00' LIMIT 50000);
                                                             QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------
 Delete on query_execution  (cost=225736.06..641819.90 rows=0 width=0)
   ->  Nested Loop  (cost=225736.06..641819.90 rows=28490 width=34)
         ->  HashAggregate  (cost=225724.95..226009.85 rows=28490 width=32)
               Group Key: "ANY_subquery".id
               ->  Subquery Scan on "ANY_subquery"  (cost=122917.34..225653.72 rows=28490 width=32)
                     ->  Limit  (cost=122917.34..225368.82 rows=28490 width=4)
                           ->  Bitmap Heap Scan on query_execution query_execution_1  (cost=122917.34..225368.82 rows=28490 width=4)
                                 Recheck Cond: (started_at <= '2024-12-18 19:10:15.651839-06'::timestamp with time zone)
                                 ->  Bitmap Index Scan on idx_query_execution_started_at  (cost=0.00..122910.22 rows=28490 width=0)
                                       Index Cond: (started_at <= '2024-12-18 19:10:15.651839-06'::timestamp with time zone)
         ->  Bitmap Heap Scan on query_execution  (cost=11.11..15.12 rows=1 width=10)
               Recheck Cond: (id = "ANY_subquery".id)
               ->  Bitmap Index Scan on query_execution_pkey  (cost=0.00..11.11 rows=1 width=0)
                     Index Cond: (id = "ANY_subquery".id)
(14 rows)
```

And this is because the db engine knows that most of my data is around
2025 and will just hit the whole table rather than hit an index and then
go return most of the table.

The logic we want here is basically, "work up the index on created_at
until we get to a notion of recent".

If we add an order by, we're close to that and things go much faster
again

```sql
clean=# explain DELETE FROM query_execution WHERE id IN (SELECT id FROM query_execution WHERE started_at <= '2025-01-02 01:10:15.651839+00' order by id asc LIMIT 50000);
                                                                         QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------------------------------
 Delete on query_execution  (cost=851615.84..1392207.62 rows=0 width=0)
   ->  Nested Loop  (cost=851615.84..1392207.62 rows=50000 width=34)
         ->  Unique  (cost=851608.39..851858.39 rows=50000 width=32)
               ->  Sort  (cost=851608.39..851733.39 rows=50000 width=32)
                     Sort Key: "ANY_subquery".id
                     ->  Subquery Scan on "ANY_subquery"  (cost=0.55..847705.98 rows=50000 width=32)
                           ->  Limit  (cost=0.55..847205.98 rows=50000 width=4)
                                 ->  Index Scan using query_execution_pkey on query_execution query_execution_1  (cost=0.55..2767566.54 rows=163335 width=4)
                                       Filter: (started_at <= '2025-01-01 19:10:15.651839-06'::timestamp with time zone)
         ->  Bitmap Heap Scan on query_execution  (cost=7.44..11.46 rows=1 width=10)
               Recheck Cond: (id = "ANY_subquery".id)
               ->  Bitmap Index Scan on query_execution_pkey  (cost=0.00..7.44 rows=1 width=0)
                     Index Cond: (id = "ANY_subquery".id)
(13 rows)
```
2025-01-21 09:05:53 -06:00
Timofey Kachalov
abfda359b0 Fix passing a font for static embedded question (#52368) 2025-01-21 19:01:18 +04:00
Oisin Coveney
3757a89594 Add overflow auto for dropdown (#52409) 2025-01-21 06:33:41 -08:00
Aleksandr Lesnenko
34624003cf bump tolerance (#52408) 2025-01-21 09:19:03 -05:00
Uladzimir Havenchyk
8590ba6448 chore: drop clj linting and formatting from pre-commit hook (#41602)
It caused problems as lint-staged stashes files and if developer is not familiar with the mechanism, he thinks that his work is lost. To avoid confusion we remove this git hook
2025-01-21 16:27:04 +03:00
Dan Stone
6e125a6802 Add wotbrew to team files (#52383) 2025-01-21 09:44:51 +00:00
Timofey Kachalov
a4665a7234 Improve theme transitions (#52259) 2025-01-21 12:36:25 +04:00
Ryan Laurie
f435376eaa fix impersonation test (#52418) 2025-01-21 01:21:09 +00:00
Riley Thompson
296e2258b9 Fix Postgres XML column visualization (#52400)
* convert xml col to string

* add test

* remove unnecessary .getObject call to fix eastwood

* remove ^:parallel from test

* use mt/test-driver
2025-01-20 23:30:03 +00:00
Sloan Sparger
db5d327471 Skip model modal if the user has accepted it previously (#52000)
* skips model popup

* fix types

* port to ts

* reorganize acknowledgement code

* improve ack api, add unit test, fix missing key prop console warning for question action menu

* move schema file to correct location, improve e2e

* Make sure we can load User KV schemas when in a JAR (#52246)

* Make sure we can load user KV schemas in a JAR

* A few minor tweaks

- removed some unused code

- added some more comments to clarify when each function is used

- move `update-user-key-value-schema!` outside the `doseq`

* Fix tests

* A bit more clarity

* actually fix tests

* move prod implementation below dev implementation; couple other tweaks

* fix fn name

---------

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

* remove only usage in test

* lint and unit fixes

* fix unit test for real this time

* but actually... unit tests are fixed this time

---------

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-01-20 17:13:21 -06:00
Ryan Laurie
04eb8348bc Close Stale PRs (#52394) 2025-01-20 16:01:18 -07:00
William
30b9d66619 Sync extra fields to order-by when replacing breakouts (#52338)
When we replace a breakout, we also update any related order-by.  However, we weren't updating all fields.  This
meant that the order-by and breakout weren't identical.  This was fine-ish on postgres, because they compiled to the
same thing.  However, on google bigquery, it expects that group bys and order bys will refer to the AS alias instead
of just duplicating the code for the aliased thing.  The differences between order-by and breakout meant that we
didn't realize that the one was supposed to match the other, and so we duplicated the code and bigquery barfed.
Syncing more fields fixes that.
2025-01-20 21:55:26 +00:00
Oisin Coveney
b78d8cf08f Fix flex-grow property on ChartSegmentedControl buttons (#52356) 2025-01-20 13:42:21 -08:00
Sloan Sparger
59daec2227 [Cards in Dashboards] Remove dashboard name in QB header when creating a new dashboard question (#52403) 2025-01-20 14:54:33 -06:00
John Swanson
3f11901c23 POST endpoint to actually move DQ candidates (#52218)
Also removed the sort query param for the GET endpoint, since we don't
need that.
2025-01-20 12:49:31 -08:00
Sloan Sparger
31ccb1e082 [Cards in Dashboards] Move dashboard question copy fix (#52398) 2025-01-20 14:28:07 -06:00
github-actions[bot]
795b53a82a Add new strings for v52.7 (#52315)
Co-authored-by: github-actions <github-actions@github.com>
2025-01-20 13:08:29 -07:00
Riley Thompson
ab0a7f1034 Fix Presto bytes to Honey SQL conversion (#52331)
* use presto varbinary type

* remove sqlvarbinary and add test

* replace byte/1
2025-01-20 20:01:37 +00:00
Sébastien
1c63f62431 proper team for seb (#52326) 2025-01-20 18:30:23 +01:00
Braden Shepherdson
0998f9b6e1 [refs] Joined columns get unique :idents; new test metadata (#51989)
**Joined columns**

- `join__${IDENT_OF_JOIN_CLAUSE}__${IDENT_OF_COLUMN}` for explicit
  joins
- `implicit_via__${IDENT_OF_FK_COLUMN}__->__${IDENT_OF_TARGET_COLUMN}`
  for implicit joins

These fulfill the contract for column `:ident`s:
- Unique identity within one stage of a query
- Globally unique
    - Note that the same implicitly joined column (eg.
      `Products via Orders.PRODUCT_ID`) might be referenced in
      many queries, but it's the **same column** - same `display_name`,
      types, etc.

**New test metadata**

In order to test these properly, I needed test metadata with more
permutations of FKs.

I've added three new tables to `metabase.lib.test-metadata`, which are a
simplified version of Github issues, users and comments. The tables are
`:gh/issues`, `:gh/users` and `:gh/comments`.

Some notable things:
- `:gh/users` has a `:type/Text` PK, ie. Github usernames
- `:gh/issues` and `:gh/comments` have `:type/UUID` PKs
- `:gh/issues` has **two** FKs to `:gh/users`: `:reporter-id` and
  `:assignee-id`.
- `:gh/comments` has a **self FK**: `:reply-to`
- `:gh/issues :closed-at` is a `NULL`able `:type/DateTime` column, which
  we lacked previously
2025-01-20 17:02:34 +00:00
John Swanson
5e212e931f GET dashboard question candidates (#52137)
Works for both the root and normal collections.
2025-01-20 08:54:03 -08:00
Phoomparin Mano
ea4ee806aa fix(sdk): disable dashboard card click behavior and prevent url formatting (#51290)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-01-20 22:31:46 +07:00
Phoomparin Mano
3bcf2d5989 feat(sdk): granular documentation links in usage problem banner (#52257) 2025-01-20 21:53:08 +07:00
Chris Truter
a8927594c1 Use new search in tests, if available (#51277)
Fixes a bunch of minor issues found in the process of porting over the e2e tests, in particular.
2025-01-20 15:44:38 +02:00
Filip Hric
f6b9e3b0d2 Remove deprecated open native editor helper (#51707)
* phase #1: remove all uses of openNativeEditor without a parameter

* phase #2: remove all uses with parameter

* remove useless test

* fix failing test cases

* fix failing tests

* add db id and native filter interaction

* fix flaky tests
2025-01-20 13:57:37 +01:00
Raphael Krut-Landau
9c904e8500 Remove stray file that got checked in (#52336) 2025-01-20 07:30:30 -05:00
Mahatthana (Kelvin) Nomsawadi
fbf0e7a3ad Fix error button hover color (#52373) 2025-01-20 12:16:37 +00:00
Timofey Kachalov
c6bd90065b Update static embedding code template for nodejs (#52366) 2025-01-20 14:45:21 +04:00
Timofey Kachalov
d8c45ea17c Fix empty state color for accordion list (#52308) 2025-01-20 13:41:15 +04:00
Kamil Mielnik
87316e805e Fix - Custom Expression error can sometimes be slightly misleading (#52274)
* Support multiple operators in expectOp

* Refactor

* Show errors from parser

* Revert recursive-parser changes

* Pass human-friendly operator name to expectOp

* Fix typo

* Require comma if next token is not closing parenthesis

* Add a repro for #15892

* Update existing test
2025-01-20 14:51:00 +07:00
Kamil Mielnik
74cb6fa714 Add repro for #48358 (#52313) 2025-01-20 14:50:34 +07:00
Kamil Mielnik
dd8581a3d1 Add repro for #46832 (#52311) 2025-01-20 14:50:10 +07:00
Timofey Kachalov
4ec0eac971 Fix png image paths when rendered inside Embedding SDK (#52201) 2025-01-20 11:08:19 +04:00
Oisin Coveney
85e0db50f8 Convert default usages to named usages (#52079) 2025-01-18 00:30:33 +00:00
Ryan Laurie
40e53d907b no need to reset PR comments on non-PRs (#52352) 2025-01-17 23:31:15 +00:00
Case Nelson
e3adb04fa4 perf: faster snowflake sync with describe-fields (#49625)
* perf: faster snowflake sync with describe-fields

Fixes: #49624

* Fix formatting

* Update modules/drivers/snowflake/test/metabase/driver/snowflake_test.clj

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

* Fix up datetime types

* Ensure describe-fields is sorted

* Fix types for venues

* Check for integer with numeric_scale

* Consistency with getColumnMetadata

* Add pks

---------

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-01-17 15:45:37 -07:00
Oisin Coveney
71bc1d85d9 Convert CreateDashboardModal to new components (#52075) 2025-01-17 22:14:27 +00:00
Oisin Coveney
91b16b4a79 Fix bad overflow on ColumnItem preventing showing and hiding columns (#52290) 2025-01-17 22:04:29 +00:00
Ryan Laurie
0b880331dd Instant e2e test updates (#51605) 2025-01-17 14:49:35 -07:00
Tyler Plude
d304dae668 When duplicating a dashboard, persist the :width setting (#51805)
* When duplicating a dashboard, persist the :width setting

* Modifying copy dashboard test to account for width setting
2025-01-17 21:23:01 +00:00
Alex Yarosh
8452fc328c docs: linked filters (#52182)
* linked filters draft

* linked filters draft

* probably should actually insert the link eh?

* Apply suggestions from code review

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

* review feedback

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-17 21:21:15 +00:00
Alex Yarosh
db8f67d816 docs: sharing icon (#52281) 2025-01-17 16:17:47 -05:00
lbrdnk
9ba1a81821 [Databricks] Make dataset loading chunk-size dynamic (#52097)
* Make dataset loading chunk-size dynamic

* Update comment
2025-01-17 21:51:06 +01:00
Uladzimir Havenchyk
030b80ec5a feat(qb): update header button styling (#51905) 2025-01-17 20:50:01 +00:00
Raphael Krut-Landau
af74709b0e Don't pass locale codes to localeCompare (#52284) 2025-01-17 15:01:48 -05:00
appleby
3e046e5735 Disable pivot drill thru for multi-stage queries (#52239)
This drill thru was recently enabled for multi-stage queries in #51950, but there is a bug which causes the
QueryColumnPicker to fail if a join is present. Disable the drill thru for now while we work on a fix.

Closes #52221
Related to  #52236
2025-01-17 11:55:37 -08:00
Cam Saul
2a525ea3c1 Add Kondo linter to make sure defmultis have arglists (#52083)
* Add Kondo linter to make sure defmultis have arglists

* Appease Kondo

* cljfmt
2025-01-17 12:48:55 -07:00
Case Nelson
ec1aae01a4 feat: Add csv_upload_failed metric to Prometheus (#52219) 2025-01-17 12:28:43 -07:00
Oisin Coveney
72501e16e3 Change order of input wrapper elements (#52235) 2025-01-17 11:15:00 -08:00
Jeff Bruemmer
4bffd6b8e2 docs - azure sql (#52287) 2025-01-17 14:04:00 -05:00
Luis Paolini
be08de26b6 Upgrade postgres app db version (#50310)
* Upgrade postgres app db version

The more the marrier

* Update docs/installation-and-operation/configuring-application-database.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-17 19:01:35 +00:00
appleby
4abf0a9ec3 Return is-null filter in underlying-records drill thru if value is nil (#52295) 2025-01-17 09:02:05 -08:00
Ryan Laurie
0c6f3eb867 Balance e2e specs by runtime (#52118)
* split e2e tests by timings

* dont do a volkswagen
2025-01-17 08:49:48 -07:00
Timofey Kachalov
9a2676013a Fixed resetting the embedded preview to the default font (#52306) 2025-01-17 16:45:53 +04:00
Alexander Solovyov
be81c7f922 linked-issues.ts: codeql complained about regexp (#52302) 2025-01-17 11:10:28 +03:00
Kamil Mielnik
31be930b9c Fix - Custom column formula autocomplete overwrites part of existing formula (#52198)
* Add repro for #50925

* Add a test

* Fix the case with whitespace following an incomplete token

* Add test case with bracket identifier following an incomplete token

* Add comments

* Thanks vscode

* Fix the case with bracket identifier following an incomplete token

* Simplify unit tests

* Fix the logic

* Update comment

* Fix it

* Refactor
2025-01-17 14:53:09 +07:00
Kamil Mielnik
e43a9ee150 Fix - Confusing error message when trying to add a custom expression aggregation (#52267)
* Throw different error when using a known name that is not a metric

* Drop checking for segments as they cannot be used in aggregation expressions anyway

* Add tests

* Remove redundant withName: true

* Wrap with describe

* Make naming consistent

* Improve copy
2025-01-17 14:36:49 +07:00
Alexander Solovyov
bdfc92a707 update databricks driver - removes a few security warnings (#52263) 2025-01-17 10:55:08 +07:00
Cam Saul
87eaa5d640 Drop "long test" Kondo linter threshold from 180 to 160 (#52280)
* Drop "long test" threshold from 180 to 160

* Drop threshold from 160 => 150
2025-01-17 10:54:08 +07:00
Cam Saul
1acb027d66 Split super slow Redshift upload tests off into separate job (#52077) 2025-01-17 02:14:40 +00:00
Oisin Coveney
9908b9e539 Add popover props for interactive question dropdowns (#52225) 2025-01-16 18:11:31 -08:00
Hervé Labas
1e5ebfe653 Simplify formatting of Slack bug report (#52296) 2025-01-17 01:54:21 +00:00
Riley Thompson
9fb173967f Document and update CSV date export behaviour (#52210)
* document mongo date details

* test date time export for all drivers

* include athena in csv date export test

* use athena v3_test_data
2025-01-17 00:08:20 +00:00
Eric Normand
930cb87f98 49809 Fix sorting by unbinned date expression (#52277) 2025-01-16 23:38:28 +00:00
Noah Moss
f02832e9d9 Make sure dashboard-id is always included for preemptive caching (#52126) 2025-01-16 18:26:42 -05:00
William
63c69f5461 Cards use default values when required (#52144)
If a card with a default value doesn't actually require a value, letting people clear the default value can be useful.
However, if the card does require a value, letting people clear the default just throws an error.  This is a
completely useless result, so we should use the default value in that case.  See [here](https://metaboat.slack.com/archives/C0645JP1W81/p1719233020129649) for more info.
2025-01-16 23:00:28 +00:00
Jeff Bruemmer
f40526dc12 docs - env var updates (#51986) 2025-01-16 20:28:59 +00:00
Noah Moss
81beb333b6 Fix SCIM test faliure (#52063) 2025-01-16 18:35:06 +00:00
Cam Saul
272f682da5 [Backend modularization] sync module cleanup (#52251)
* `sync` module cleanup

* Fix another bug

* Fix some references to old namespace

* Fix references to stuff that doesn't exist anymore
2025-01-16 17:36:23 +00:00
Riley Thompson
055abbf97e Fix byte to timestamp coercion for redshift (#52242)
use from_varbyte for redshift
2025-01-16 12:26:41 -05:00
Nemanja Glumac
7997420ef7 Add a warning/disclaimer for H2 uploads (#52095)
* Add a warning/disclaimer for H2 uploads

* Expand the component test

* Use the built in margin bottom

* Show the additional warning on hosted instances only
2025-01-16 17:06:49 +00:00
Uladzimir Havenchyk
41fece6015 Revert "chore(qb): cleanup unused code" and "feat(QB): combine chart type selector with viz settings sidebar" (#52270)
* Revert "chore(qb): cleanup unused code (#51903)"

This reverts commit 68b5038d6e.

* Revert "feat(QB): combine chart type selector with viz settings sidebar (#51671)"

This reverts commit 82e4392582.
2025-01-16 19:29:10 +03:00
Filip Hric
be18f2706a revert to using selector instead of helper (#52266) 2025-01-16 16:52:06 +01:00
Nemanja Glumac
8e9558ebad Remove unused REPL connection string from Cypress backend (#52272) 2025-01-16 16:28:32 +01:00
Ryan Laurie
6ee2eb3bb3 only match issues in main repo for milestoning (#52223) 2025-01-16 07:28:57 -07:00
Jeff Bruemmer
f96fe1fdb8 docs - refresh cache automatically (#52064) 2025-01-16 09:28:51 -05:00
Uladzimir Havenchyk
ee95429b8d chore: remove metabot leftovers (#52189) 2025-01-16 13:00:09 +00:00
Sébastien
0eb4084fbc Added Sébastien to team files (#52215) 2025-01-16 13:32:29 +01:00
Ngoc Khuat
c211cb72f2 dev/seed-instance! (#52258) 2025-01-16 09:35:54 +00:00
Cam Saul
bea3c3d789 Only run old migration tests onmaster and release pushes (#52254)
* Remove `mb/once` tag since we don't use it anymore

* Add `^:mb/old-migrations-tests` tag.

* Update GH Actions config

* Cleanup

* Keep the migrations test files in order

* Quote excluded tags
2025-01-16 12:07:58 +03:00
Cam Saul
6dd40b8241 Keep deps.edn deps sorted (#52256) 2025-01-16 05:02:08 +00:00
Cam Saul
46dc35e86b [Backend modularization] channel module cleanup (#52243)
* Merge `email` module into `channel`

* Fix Kondo warnings

* Remove unneeded module API namespace

* Fix error keys

* Move `/api/channel`, `/api/email`, and `:model/Channel` into `channel` module

* Fix Kondo errors

* Cleanup

* Update templates for their new homes
2025-01-15 20:17:46 -08:00
Ryan Laurie
359c55dd2e more flakes boo (#52249) 2025-01-15 20:13:49 -07:00
Oisin Coveney
5a3f6124c6 Fix bad wrapping on long names for ColumnItem (#52245) 2025-01-16 01:10:25 +00:00
Ryan Laurie
00eeac0a40 remove ocean color scheme (#52231) 2025-01-15 23:15:58 +00:00
Nathan Voxland
69a4f865fb Don't automatically persist/cache models in EE (#52222)
In EE: don't automatically persist models. Require users to select which to persist
2025-01-15 16:49:25 -06:00
Cam Saul
4a0b85c54a [Backend modularization] setup module cleanup (#52234)
* `setup` module cleanup

* Rename metabase.api.pivots (a TEST namespace!) to metabase.query-processor.pivot.test-util
2025-01-15 22:28:35 +00:00
Cam Saul
39a58d6311 [Backend modularization] parcel out async module (#52227) 2025-01-15 21:41:43 +00:00
Oisin Coveney
f18e43a0f0 fix(sdk): Add segmented button for chart settings (#52076) 2025-01-15 21:10:41 +00:00
Luis Paolini
398e108899 update troubleshooting (#52031)
* Update running.md

Some little details about running Java apps on prod

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-01-15 17:53:39 -03:00
Luis Paolini
579c00e008 docs: Update mysql.md (#52107)
* Update mysql.md

Add a note about vitess and planetscale

* Update docs/databases/connections/mysql.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-15 15:51:19 -05:00
Timofey Kachalov
de4da6e620 Apply theme change transition styles to the ParameterFieldSet component (#52049) 2025-01-15 22:54:08 +04:00
Cam Saul
91618837bf [Backend modularization] Improved model resolution; remove metabase.models and metabase-enterprise.models (#52184)
* [Backend modularization] Remove `metabase.models`

* I guess we don't really need an ordered map

* Remove unneeded require of models

* Small fixes 🔧

* Test fix 🔧

* Fix metabase.api.embed.common

* Fix some insane code that was using symbols for raw table names

* We need to do model resolution for table names

* Don't test EE namespaces in OSS
2025-01-15 18:14:40 +00:00
Ryan Laurie
e3abb47200 quarantine flaky e2e tests (#52213) 2025-01-15 17:36:58 +00:00
Case Nelson
5d9aceb04f Secret handling in details (#51714)
* Secret handling in details

Secret handling in details was very confusing. This PR consolidates most
of the logic into models.secret around toucan2 lifecycles of
model/Database.

Some of the problems fixed here:
 - path and value confusion. It was possible to swap between uploaded
   files and file-paths and end up with the uploaded file being treated
   as a file-path and leaking to users in logs, APIs, and UIs.
 - Unclear management of secret properties in details. The
   responsibility for taking in secrets in details, saving to a Secret,
   and then ensuring those incoming secrets do not get saved in details
   was spread out all over the place. This made it possible to save a
   secret-value in details.
 - Unclear hydration of secret values for connection testing. How a
   driver was supposed to get a secret and which properties might be in
   details was unclear and inconsistent. Often mangling strings and
   files returned by Secret api was necessary.
 - Encoding problems. Uploaded files were being mangled by taking bytes
   into a string and back to bytes to save. Ensure that the bytes given
   are the bytes saved.

* Fix merge

* Fix tests

* Fix db creation

* Fix db creation in other tests

* Manually add updated_at to database

* Fix tests

* Fix tests

* Fix after-select input

* Wrap in data-uri

* Fallback for -value if base64 encoding failed

* If not data-uri, then just turn string to utf8 bytes

* Poking at oracle failures

* Oracle wrap bytes in data-uri

* Don't clean secret properties from oracle

* Fix base64 typo and add test util for data-uri wrap

* Fix snowflake test

* Another snowflake test

* Update src/metabase/models/secret.clj

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

* Update src/metabase/models/secret.clj

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

* Update src/metabase/models/secret.clj

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

* Update test/metabase/test/util.clj

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

* Update src/metabase/util/jvm.clj

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

* Update src/metabase/util/jvm.clj

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

---------

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-01-15 10:00:26 -07:00
appleby
020cb1505c Filter after summarize drill-thru cleanups (#52175)
* Update comment in automatic-insights drill to point to new github issue

* Move helpers from lib.drill-thru.common to lib.underlying

These funcs deal with "underlying" columns, so move them into lib.underlying.

    aggregation-sourced?
    breakout-sourced?
    strictly-underlying-aggregation?

* Consistent naming for drill-thru multi-stage query tests

* Update multi-stage query drills tests to use new test helpers

* Homogenize apis for drill thru test helpers

Rename prepend-filter-to-stage to prepend-filter-to-test-expectation-stage and make the calling interface match
that of append-filter-stage-to-test-expectation.

* cljfmt
2025-01-15 08:01:58 -08:00
Vamsi Peri
5a8d279051 Run nightly point releases at 4 pm ET (#52197) 2025-01-15 18:38:21 +03:00
Eric Normand
aae5c83334 Add ericnormand to team files (#52143)
* Add ericnormand to query team and slack map

* Fix whitespace

* Remove trailing whitespace
2025-01-15 09:02:11 -06:00
Alexander Polyankin
21630de9a4 Fix in-progress selection in the date range picker (#52141) 2025-01-15 10:01:58 -05:00
Noah Moss
0a533a9c07 Revise new table permissions logic to handle sandboxes (#52052)
* Revise new table permissions logic to handle sandboxes

* tweak new perm logic

* make sure cond has a default

* fix comments

* tweak defenterprise conditions
2025-01-15 09:40:08 -05:00
Chris Truter
c8f684a36d Handle stale search index tracking gracefully for h2 (#52084) 2025-01-15 14:10:11 +00:00
Phoomparin Mano
6ef825835a fix(sdk): fix data picker crash by using mantine popover (#52096) 2025-01-15 20:43:52 +07:00
Phoomparin Mano
304e1077ee ci(sdk): add CODEOWNERS for embedding sdk (#52110) 2025-01-15 16:23:03 +07:00
Cam Saul
a6793c4061 [Backend modularization] query-analysis cleanup (#52165)
* [Backend modularization] `query-analysis` cleanup

* Update Kondo config

* Add CODEOWNERS

* metabase.task.sweep-query-analysis => metabase.query-analysis.task.sweep-query-analysis

* Move test util

* Module linter should ignore my test-setup namespace

* Make sure query analysis init is loaded in tests that need it

* Deparallelize some of the tests
2025-01-15 07:55:41 +00:00
Filip Hric
6336fdbc98 optimize matrix builder (#52101) 2025-01-15 08:49:44 +01:00
Timofey Kachalov
4c197eeead Exclude embedding-sdk/dist for babel-loader for Embedding SDK cypress tests (#52127) 2025-01-15 11:31:55 +04:00
dpsutton
8e7d79b1b9 Fix clickhouse uploads (#52181)
This change happened in peer
https://github.com/metabase/metabase/pull/51023 and is manifesting now
it seems.

The removal of the call to `(classloader/the-classloader)` is what is
hurting us.

Only clickhouse cloud instances can be set as a suitable upload spot so
i'm doing the following changes in the local jar repro to fix it up:

```clojure
(in-ns 'metabase.driver.clickhouse)

(defmethod driver/database-supports? [:clickhouse :uploads] [_driver _feature db]
  true)

(in-ns 'metabase.public-settings)
(let [db_id 2, schema_name "default", table_prefix "upload_"]
  (t2/update! :model/Database db_id {:uploads_enabled      true
                                     :uploads_schema_name  schema_name
                                     :uploads_table_prefix table_prefix}))
```
2025-01-14 22:29:40 -06:00
Cam Saul
a5022e140d [Backend modularization] analyze module cleanup (#52179)
* [Backend modularization] `analyze` module cleanup

* Appease Kondo
2025-01-14 20:11:17 -08:00
Cam Saul
ac58570ae0 [Backend modularization] actions module cleanup (#52170) 2025-01-14 20:10:46 -08:00
Cam Saul
6a477b5172 [Backend modularization] Remove metabase.compatibility (#52177)
* [Backend modularization] Remove `metabase.compatibility`

* Fix one more ref
2025-01-14 18:28:37 -08:00
Cam Saul
16ea4a7629 [Backend modularization] Remove metabase.troubleshooting (#52173)
* Remove `metabase.troubleshooting`

* Remove Kondo config
2025-01-15 02:20:31 +00:00
Mahatthana (Kelvin) Nomsawadi
3527c911d7 fix(sdk): Standardize SDK components errors with different ID formats (#49714)
* [debug] add storybook helper

* Make error on InteractiveQuestion consistent

* Make error on StaticQuestion consistent

* [debug] static question stories

* [debug] InteractiveDashboard Stories

* Make error on InteractiveDashboard consistent

* [debug] StaticDashboard stories

* Make error on StaticDashboard consistent

* [debug] EditableDashboard stories

* Make error on EditableDashboard consistent

* Fix CreateQuestion not working after fixing entity ID states

* Add tests for InteractiveQuestion

* Add StaticQuestion tests

* Add InteractiveDashboard tests

* Add StaticDashboard tests

* Add EditableDashboard tests

* Make variable names consistent

* Extract resource not found error to a component

* Fix missing return

* Make storybook usable and reduce duplications

* Don't roll my own util

* Update error colors following the new design

* Update loki snapshots

* Fix unit test expectation to hex

* Make colors easier to understand with comments

* Update SDK error style

* Update error components copy

* Use Code from metabase/ui

* Remove change accidentally commited

* Fix InteractiveQuestion renders question not found briefly

metabase#51969
2025-01-15 02:03:19 +00:00
Cam Saul
d59316a58e Remove remaining MetaBot v2 code (#52167)
* Remove remaining MetaBot v2 code

* Remove reference to metabot v2 mocks
2025-01-14 18:02:21 -08:00
Cam Saul
85a341cf55 [Backend modularization] Metabase core module cleanup (#52156)
* Metabase `core` module cleanup

* Fix some references
2025-01-15 01:15:32 +00:00
Tyler Plude
8ea5431774 Static Viz Start of Week in Subscription Emails (#51423)
* WIP First attempt at passing start of week option to static viz bundle

* Cleaning debug lines

* set moment and dayjs start of week day setting in static viz

* reverting index.ts

* Adding backend test for checking first day of week setting is respected in static viz

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2025-01-15 00:23:11 +00:00
Tyler Plude
aed32a76c7 Removing error boundaries when log scale y axis contains both negative and positive values (#51941) 2025-01-14 23:15:00 +00:00
Cam Saul
d6864cbafe [Backend modularization] xrays module cleanup (#52148) 2025-01-14 15:02:55 -08:00
Tyler Plude
fd52f4e992 Enabling mouse wheel scroll zooming for leaflet maps (#51888)
* Enabling mouse wheel scroll zooming for leaflet maps

* Reducing wheelPxPerZoomLevel so scroll zooming works faster in leaflet maps
2025-01-14 22:59:58 +00:00
Cam Saul
914cc8f725 Revert "Revert #52018 to fix failing tests (#52080)" (#52082)
This reverts commit bf88842c89.
2025-01-14 22:10:36 +00:00
Luis Paolini
5a5cbff5c4 Update mysql.md (#52139)
* Update mysql.md

Add an additional flag as a note, since I've hit this one today with a customer

* Update docs/databases/connections/mysql.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-14 21:59:13 +00:00
Oleksandr Yakushev
18cc47efef perf: Fix performance of CSV pivot table export (#51985) 2025-01-14 21:47:44 +00:00
Alexander Polyankin
c05bfd571e Date widgets types cleanup (#52138) 2025-01-14 16:34:12 -05:00
Nemanja Glumac
6d9d394b52 Remove the "version check" from the sequence of Cypress runner steps (#52054)
* Remove the Cypress "version check" step

* Remove superfluous step from GH Actions workflows
2025-01-14 22:10:03 +01:00
bryan
dc5662b06e add Dan's mb-download script (#51010)
* add Dan's mb-download script

* add short bin/README.md
2025-01-14 20:59:26 +00:00
Nemanja Glumac
95758dfdb9 Simplify Cypress custom runner dependencies (#52051)
* Delete custom util

* Expand the documentation

* Generate HTML report in `cypress/reports`
2025-01-14 21:18:24 +01:00
Luis Paolini
699c029d78 Update activating-the-enterprise-edition.md (#52133)
* Update activating-the-enterprise-edition.md

another little nitpick, since people tend to get creative with these things and then we end up debugging endless hours

* edit

---------

Co-authored-by: jeff bruemmer <jeff.bruemmer@gmail.com>
2025-01-14 16:46:06 -03:00
Sloan Sparger
6cd504fb02 [Cards in Dashboards] Auto-scroll to new dashboard questions (#51804)
* initial impl

* better error handling, smooth scroll for adding existing cards, clean up of code in general

* add e2e test

* fix type error

* pr feedback

* reworks implementation to consume value from url then clear it, follows existing code patterns better

* clean up and test improvements

* fix e2e tests

* fix type issues

* pr feedback
2025-01-14 13:37:17 -06:00
Cam Saul
018932f07a Skip migrations tests for non-core drivers (#52060)
* Skip migrations tests for non-core drivers

* Skip schema migrations tests for drivers

* cljfmt

* Bump Hawk
2025-01-14 19:20:18 +00:00
Luis Paolini
55ab66d6cc Update activating-the-enterprise-edition.md (#52113)
* Update activating-the-enterprise-edition.md

Add details about Zscaler

* Update docs/paid-features/activating-the-enterprise-edition.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-14 15:35:04 -03:00
Jeff Bruemmer
d8674cc61b docs - preference for docker when self-hosting (#52122) 2025-01-14 18:14:20 +00:00
Sloan Sparger
d7a3215567 [User KV] Add FE APIs for working with the user key value store (#51882)
* mostly working solution w/ tests

* add basic type impl, change interface to return obj from hook, update tests to account for both

* add types to setup mock endpoint fns
2025-01-14 11:07:41 -06:00
Nicolò Pretto
d458b6e6b9 refactor sdk imports (#52020)
* move sdk config

* extracts mode: "sdk" to renderWithSDKProviders

* move MetabasePluginsConfig

* move theme types

* move theming stuff

* moved plugins, added eslint rule

* remove duplicated file

* clean up ui.tsx

* move defineMetabaseTheme

* fix lint issue
2025-01-14 16:35:20 +00:00
Alexander Polyankin
86086df469 Consolidate logic to apply a parameter to a query (#52056) 2025-01-14 11:15:28 -05:00
Nicolò Pretto
a231c83c12 update eslint rules to restrict importing from react-redux directly (#52114) 2025-01-14 17:06:13 +01:00
Sloan Sparger
1fdc213d08 [Redux] Make core app use custom redux context (#52040)
* hacks solution together to test if everything passes CI

* real implementation, removes hacked approach

* patch types

* add test coverage for patched package

* add one more unit test
2025-01-14 09:36:45 -06:00
lbrdnk
199d4c2557 Upgrade Athena jdbc driver to 3.3.0 (#52030)
* Upgrade Athena jdbc driver to 3.3.0

* Adjust driver to conform tests
2025-01-14 16:32:07 +01:00
Chris Truter
bdfa366fe5 Run search index worker on every instance (#52108) 2025-01-14 15:27:00 +00:00
Alexander Solovyov
ad00b9478b [search] update/delete indexed entities on change (#51222) 2025-01-14 18:19:14 +03:00
Aleksandr Lesnenko
19eaa8bf78 fix mobile text cards height (#52062) 2025-01-14 09:11:36 -05:00
Timofey Kachalov
9586bca50a Fix module errors when Embedding SDK Cypress tests running in development mode (#52093) 2025-01-14 18:07:04 +04:00
Uladzimir Havenchyk
6b2a9d7a72 fix: correct layout of viz settings on dashboard with reduced motion (#51960) 2025-01-14 13:39:41 +00:00
Mahatthana (Kelvin) Nomsawadi
6624cc7e22 Update error colors following the new design (#52029)
* Update error colors following the new design

* Update loki snapshots

* Fix unit test expectation to hex

* Make colors easier to understand with comments

* Fix E2E tests
2025-01-14 10:49:17 +00:00
Timofey Kachalov
5f41d063be Fix flaky JoinStep tests (#52046) 2025-01-14 13:09:13 +04:00
Kamil Mielnik
5a4e3fcb48 Remove the old EntityListLoader and clean up (#51963)
* Make setupModelPersistenceEndpoints work with multiple models

* Make test wait for data

* Improve tags invalidation

* Improve types

* Remove entity.ListLoader usage in UploadSettingsForm (#51909)

* Remove entity.ListLoader usage from ModelCacheRefreshJobs (#51910)

* Remove entity.ListLoader usage from SavedEntityList (#51914)

* Remove entity.ListLoader usage from SearchApp (#51915)

* Remove entity.ListLoader usage from QuestionList (#51912)

* Remove entity.ListLoader usage from SearchResults (#51913)

* Remove `entity.ListLoader` from `CollectionContentView` (#51916)

* Remove entity.ListLoader usage from CollectionContentView

* CI Failure notice improvements (#51885)

* don't notify slack on flaky job failing

also add more info to failure notice

* this is nicer

* add entity insertion library (#47895)

* add entity insertion library

- this lets us use `add-load/from-script`

* update add load examples

* Update year in the README (#51923)

* reset cache when starting cypress locally (#51921)

* Don't build FE for driver tests that don't need it; shave 2 minutes off of driver tests (#51884)

* Don't build FE for driver tests

* Try this again

* Consolidate MySQL job configs

* Oops fix conditional flags for test-driver

* More MySQL consolidation

* Oops

* Add a new job that waits for all other jobs (so we can require one single job going forward)

* Restore deleted code

* Try adding a Driver Tests (Summary) workflow

* How about a nice job name

* Don't love YAML inline array syntax

* Try fixing the build-static-viz configuration again

* Try fixing the build-static-viz configuration again

* Try this again

* Fix MySQL SSL config

* Try fixing the drivers summary workflow

* re-remove docs update block (#51928)

* upload title (#51931)

* Fix formatting of month-of-year when there are 53 weeks in the year (#51892)

* New deactivated_at field on users (#51765)

* New deactivated_at field on users

* fix migration syntax

* Setting alignment to top for icons in subscription and alert emails (#51886)

* Correct docstring for series (#51840)

Minor nitpicks on some endpoint docstrings

* Dont escape chars of header dashcards (#51880)

* fix rerun job

* feat(sdk): Interactive Question Chart Settings Dropdown #50976

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: bryan <bryan.maass@gmail.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Co-authored-by: Tyler Plude <tsplude@gmail.com>
Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Oisin Coveney <oisin@metabase.com>

* Remove `entity.ListLoader` from `CollectionItemsTable` - approach v3 (#51958)

* Break CollectionItemsTable down to avoid using Search.ListLoader

* ESLint

* Oops

* Fix auto-upload effect in ModelUploadModal

* Fix types

* Fix the effect running too often

* Remove redundant code

* Reduce diff

* Remove old EntityListLoader and rename new EntityListLoaderRtkQuery to EntityListLoader

* Remove PaginationState

* Remove EntityType

* Fix effect

* Fix effect

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: bryan <bryan.maass@gmail.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Co-authored-by: Tyler Plude <tsplude@gmail.com>
Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-01-14 09:02:06 +00:00
Kamil Mielnik
18f4ba60ff Fix - Removing the source filter from a linked filter will leave the latter broken (#52034)
* Add repro for #49556

* Format code

* Fix #49556

* Format code

* Rename const
2025-01-14 08:10:31 +00:00
Kamil Mielnik
1d984403bb Remove entity.ListLoader (#51908)
* Make setupModelPersistenceEndpoints work with multiple models

* Make test wait for data

* Improve tags invalidation

* Improve types

* Remove entity.ListLoader usage in UploadSettingsForm (#51909)

* Remove entity.ListLoader usage from ModelCacheRefreshJobs (#51910)

* Remove entity.ListLoader usage from SavedEntityList (#51914)

* Remove entity.ListLoader usage from SearchApp (#51915)

* Remove entity.ListLoader usage from QuestionList (#51912)

* Remove entity.ListLoader usage from SearchResults (#51913)

* Remove `entity.ListLoader` from `CollectionContentView` (#51916)

* Remove entity.ListLoader usage from CollectionContentView

* CI Failure notice improvements (#51885)

* don't notify slack on flaky job failing

also add more info to failure notice

* this is nicer

* add entity insertion library (#47895)

* add entity insertion library

- this lets us use `add-load/from-script`

* update add load examples

* Update year in the README (#51923)

* reset cache when starting cypress locally (#51921)

* Don't build FE for driver tests that don't need it; shave 2 minutes off of driver tests (#51884)

* Don't build FE for driver tests

* Try this again

* Consolidate MySQL job configs

* Oops fix conditional flags for test-driver

* More MySQL consolidation

* Oops

* Add a new job that waits for all other jobs (so we can require one single job going forward)

* Restore deleted code

* Try adding a Driver Tests (Summary) workflow

* How about a nice job name

* Don't love YAML inline array syntax

* Try fixing the build-static-viz configuration again

* Try fixing the build-static-viz configuration again

* Try this again

* Fix MySQL SSL config

* Try fixing the drivers summary workflow

* re-remove docs update block (#51928)

* upload title (#51931)

* Fix formatting of month-of-year when there are 53 weeks in the year (#51892)

* New deactivated_at field on users (#51765)

* New deactivated_at field on users

* fix migration syntax

* Setting alignment to top for icons in subscription and alert emails (#51886)

* Correct docstring for series (#51840)

Minor nitpicks on some endpoint docstrings

* Dont escape chars of header dashcards (#51880)

* fix rerun job

* feat(sdk): Interactive Question Chart Settings Dropdown #50976

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: bryan <bryan.maass@gmail.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Co-authored-by: Tyler Plude <tsplude@gmail.com>
Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Oisin Coveney <oisin@metabase.com>

* Remove `entity.ListLoader` from `CollectionItemsTable` - approach v3 (#51958)

* Break CollectionItemsTable down to avoid using Search.ListLoader

* ESLint

* Oops

* Fix auto-upload effect in ModelUploadModal

* Fix types

* Fix the effect running too often

* Remove redundant code

* Reduce diff

* Fix effect

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: bryan <bryan.maass@gmail.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Co-authored-by: Tyler Plude <tsplude@gmail.com>
Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2025-01-14 08:06:51 +00:00
Cam Saul
ce53e5256a Optimize Backend & Driver Tests (#52072) 2025-01-14 06:28:08 +00:00
Cam Saul
bf88842c89 Revert #52018 to fix failing tests (#52080)
This reverts commit 6fbe8727ff.
2025-01-13 18:54:42 -08:00
Cam Saul
9ec0de7013 Improved MySQL/MariaDB and Postgres test job partitioning (#52070) 2025-01-13 17:57:25 -08:00
Ryan Laurie
3ad2fa7f1a Single backend check (#52065)
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-01-13 16:04:32 -08:00
Cam Saul
ffb64be70d Split H2 app DB and driver test jobs (#52069) 2025-01-13 15:36:30 -08:00
Ryan Laurie
baec00f266 single frontend required check (#52066) 2025-01-13 16:14:38 -07:00
Cam Saul
02d1dfee1e metabase.<module>.init namespaces (#52003)
* `metabase.<module>.init` namespaces

* Fix Kondo errors

* Fix Kondos

* Oops this only works if we load the init namespace

* Fix ns sorting
2025-01-13 15:07:27 -08:00
Ryan Laurie
b46bedc781 One driver check (#52002)
* wip - one driver check

* fix the syntax

* whitespace

* learn to javascript yo

* plz

* Update .github/workflows/drivers.yml

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

---------

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-01-13 14:21:10 -08:00
bryan
fb06daf9b7 Make test run from its own namespace (#52008) 2025-01-13 13:51:42 -07:00
Noah Moss
dca2d5367e Refactor collection list query for performance (#51929)
* Don't select entire collections for permission checks

* Pull collection perm checks out as a CTE (wip)

* Cljfmt

* Refactor, fix tests

* Move comment, formatting fixes

* do a single query to fetch both the limited results and the total row count

* select more fields from collections

* inline values in the CTE to get it to work on H2

* fix e2e tests

* fix handling of limit = 0 edge case

* inline last ID
2025-01-13 15:41:01 -05:00
Jeff Bruemmer
d0d18d0774 docs - update links (#52047) 2025-01-13 14:38:47 -05:00
Alexander Polyankin
500f598ce8 Consolidate date filter clause creation in parameters (#51924) 2025-01-13 19:14:26 +00:00
appleby
4d83649cf8 Fix pivot drill thru for multi-stage queries (#51950)
* Fix pivot drill thru for multi-stage queries

* Add tests for multi-stage queries in pivot drill tests

* Fix e2e test
2025-01-13 10:14:28 -08:00
Nathan Voxland
6de41bd362 Encrypt cache (#51803)
Encrypt query_cache if encryption is enabled
2025-01-13 11:19:57 -06:00
Alexander Polyankin
97fe3a63f7 Fix 53rd week formatting (#52038) 2025-01-13 17:18:03 +00:00
Ryan Laurie
51398067a7 request reviews from filip for e2e test changes (#51968) 2025-01-13 09:49:41 -07:00
Abed Habli
6e1b34c8fe Typo (#52023) 2025-01-13 16:04:49 +00:00
Alex Yarosh
92c1f6fa99 Update static-embedding.md (#52036) 2025-01-13 16:00:54 +00:00
Timofey Kachalov
26d2d76ba6 Add sanex3339 to team files (#52026) 2025-01-13 18:45:35 +04:00
Chris Truter
6fbe8727ff Enable realtime search indexing without experimental flag (#52018) 2025-01-13 12:41:42 +00:00
Mahatthana (Kelvin) Nomsawadi
84c33f06f5 Add Code component from Mantine (#51962) 2025-01-13 12:18:15 +00:00
Mahatthana (Kelvin) Nomsawadi
6d33e3192a Fix SDK release process failure (#52015)
* debug

* [debug] upgrade gh version

* Fix the gh cli by using the latest version

* Fix gh not using the latest version
2025-01-13 12:01:02 +00:00
Chris Truter
836a66e42f Add trace logging for search index queue, and fix timer (#52017) 2025-01-13 11:10:30 +00:00
Chris Truter
87cf284db9 Ensure with-dynamic-redefs is only used with functions (#51899) 2025-01-13 10:10:24 +00:00
github-automation-metabase
bbac4354bb Update Readme version references and published npm version to 0.53.1-nightly (#52016) 2025-01-13 07:52:49 +00:00
Ngoc Khuat
b994cb167a [Notification] reduce memory footprint (#51708) 2025-01-13 02:51:21 +00:00
Alexander Polyankin
58f32ff108 Fix parameter mappings reset logic (#51973) 2025-01-11 03:33:09 +00:00
Cam Saul
a9d08f63d6 New command to generate static index.html page for OpenAPI/Scalar API documentation (#51872)
* Split Kondo lint fixes off into #51747

* Merge changes from #51660

* Reworked API documentation generation code

* Oops Markdown not YAML

* BIG documentation generation improvements

* Don't try to style tables ourselves

* Fix lint errors

* Fix tests 🔧

* Fix Kondo warnings

* Update OpenAPI dox generator to handle Defendpoint v2

* Update OpenAPI dox generator to handle Defendpoint v2

* Test fixes 🔧

* Fix uberjar compilation

* Static OpenAPI documentation generation

* change output to docs/api.html

* Update test

* PR feedback from @escherize

* add api.html

* Deprecate the old `defendpoint`

* Nuke the old version of the API documentation code (new version will be merged in #51872)

* Remove empty file

* Disable output validation in prod

* Fix the way we define defendpoint 2 handlers

* Fix deps.edn

---------

Co-authored-by: jeff bruemmer <jeff.bruemmer@gmail.com>
2025-01-10 18:46:02 -08:00
Aleksandr Lesnenko
d1ff0969cf allow changing x-axis column settings (#51953) 2025-01-11 02:19:57 +00:00
appleby
27c6fe4864 Fix zoom-in.geographic drill thru for multi-stage queries (#51891)
* Update docstring in zoom-in.timeseries

The comment is stale. Construction of dimensions from row data is now done in available-drill-thrus.

* Fix zoom-in.geographic drill thru for mutli-stage queries

* Fix return type schema for lib.underlying/top-level-column

* Add append-filter-stage-to-test-expectation to drill-thru test-utils

* Add tests for multi-stage queries to zoom-in.geographic tests
2025-01-10 12:36:14 -08:00
Aleksandr Lesnenko
3aaecdb612 fix pivot table is not rendered until resized (#51951) 2025-01-10 20:23:20 +00:00
Riley Thompson
c1c331166a Make sync timezone log human readable (#51883)
* make timezone log human readable

* add test

* use .getId

* fix formatting

* address pr comment
2025-01-10 20:06:21 +00:00
Nemanja Glumac
12b366a2c5 Remove the custom --folder flag when running Cypress (#51964) 2025-01-10 20:06:39 +01:00
Sloan Sparger
352d96b5a6 [Cards in Dashboards] Allow creating dashboards from entity picker (#51745)
* add New Dashboard button and rework Create a new collection button to New Collection

* fix failing e2e tests

* fix unit tests

* allows users to create a new dashboard to save their dashboard question into

* remove usage of ref

* adds e2e test coverage for creating a dashboard on the go for a new question

* add unit tests

* fix type error

* clean up

* make test less flaky
2025-01-10 12:41:00 -06:00
Aleksandr Lesnenko
c2b755bc2c allow disabling table pivot when new columns were added (#51893)
* allow disabling table pivot when new columns were added

* specs
2025-01-10 18:13:05 +00:00
appleby
bf2f6678b2 Fix quick-filter drill thru for multi-stage queries (#51807)
* Fix quick-filter drill thru for multi-staged queries

* Add column-by-name and append-filter-stage to drill-thru test utils

* Add quick-filter tests for multi-stage queries

* Allow drill-thru tests to pass an update fn for :custom-{query,native,row}

The update fn will get passed the default value for the test case based on query-table and query-type. This allows
callers to easily modify or extend the default, rather than having to look it up or recreate it from scratch.

    ;; same as the standard test query, but with an extra filter stage
    :custom-query #(lib.drill-thru.tu/append-filter-stage % "count")

* Use mu/defmethod and mu/defn for column-by-name and append-filter-stage

* Add lib.drill-thru.test-util/prepend-filter-to-stage

* Add lib.drill-thru.tu/test-drill-variants-with-merged-args

A helper function to make it easy to call test-returns-drill or test-drill-application with minor variations of some
base case (for example, drill behavior should remain unchanged when called with a query with filter stage after
aggregations).

* Use test-drill-variants-with-merged-args for quick-filter multi-stage tests

* Add multi-stage quick-filter tests for a couple of unaggregated queries

* Use lib.drill-thru.tu/column-by-name in metabase.lib.drill-thru-test

* Use lib.drill-thru.tu/column-by-name in lib.drill-thru.test-util.canned

* Support skipping tests in test-drill-variants-with-merged-args

* Allow variant-case to be a fn in test-drill-variants-with-merged-args

* Clean up test formatting

* Reduce diff
2025-01-10 10:07:59 -08:00
lbrdnk
2d56f4deb9 Upgrade hive-jdbc dependency (#51902)
* Upgrade hive-jdbc
2025-01-10 18:30:02 +01:00
Alex Yarosh
7402b0ee8e docs: H1 edits (#51940)
* H1 edits

* Apply suggestions from code review

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

* review suggestions

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-01-10 17:16:49 +00:00
Oisin Coveney
48f876956a fix(sdk): Ensure that styles within the custom expression editor still work (#51878) 2025-01-10 09:08:00 -08:00
Ryan Laurie
e0f42d499d make flaky job detection case-insensitive (#51965) 2025-01-10 08:26:03 -08:00
Ryan Laurie
6d669a7808 add filip (#51966) 2025-01-10 08:46:56 -07:00
Sloan Sparger
19830af9d2 [Cards in Dashboards] Fix focus getting lost in nested Save question modals (#51743)
* restore form focus on modal close to handle nested modal Esc dismissal

* add test coverage
2025-01-10 09:30:17 -06:00
Ryan Laurie
8020d35532 only push oss version number tag (#51944) 2025-01-10 07:53:28 -07:00
Uladzimir Havenchyk
68b5038d6e chore(qb): cleanup unused code (#51903)
* feat(QB): combine chart type selector with viz settings sidebar

* fix typecheck

* fix unit tests

* chore(e2e): create helpers for viz settings and viz type buttons

* fix some tests

* fix most of the e2e tests

* fixup

* more fixes

* another test

* add a warning

* revert cross test changes

* chore: cleanup unused code

* render component directly
2025-01-10 12:53:24 +00:00
Oisin Coveney
08f0bf86aa feat(sdk): Interactive Question Chart Settings Dropdown #50976 2025-01-09 18:07:25 -08:00
Ryan Laurie
8f1b27b774 fix rerun job 2025-01-10 01:48:23 +00:00
Tyler Plude
2244872a0f Dont escape chars of header dashcards (#51880) 2025-01-09 17:22:32 -08:00
Luis Paolini
1ea72c0b64 Correct docstring for series (#51840)
Minor nitpicks on some endpoint docstrings
2025-01-09 19:15:35 -03:00
Tyler Plude
8ce65f0ec8 Setting alignment to top for icons in subscription and alert emails (#51886) 2025-01-09 12:02:59 -08:00
Noah Moss
ed2182b89c New deactivated_at field on users (#51765)
* New deactivated_at field on users

* fix migration syntax
2025-01-09 14:51:55 -05:00
Alexander Polyankin
c3eafa1eb1 Fix formatting of month-of-year when there are 53 weeks in the year (#51892) 2025-01-09 19:01:57 +00:00
Jeff Bruemmer
69bbddbb31 upload title (#51931) 2025-01-09 18:54:15 +00:00
Ryan Laurie
81e84ccddc re-remove docs update block (#51928) 2025-01-09 10:42:30 -07:00
Cam Saul
7829b67c22 Don't build FE for driver tests that don't need it; shave 2 minutes off of driver tests (#51884)
* Don't build FE for driver tests

* Try this again

* Consolidate MySQL job configs

* Oops fix conditional flags for test-driver

* More MySQL consolidation

* Oops

* Add a new job that waits for all other jobs (so we can require one single job going forward)

* Restore deleted code

* Try adding a Driver Tests (Summary) workflow

* How about a nice job name

* Don't love YAML inline array syntax

* Try fixing the build-static-viz configuration again

* Try fixing the build-static-viz configuration again

* Try this again

* Fix MySQL SSL config

* Try fixing the drivers summary workflow
2025-01-09 09:08:06 -08:00
Ryan Laurie
9e681c801f reset cache when starting cypress locally (#51921) 2025-01-09 10:06:40 -07:00
Nemanja Glumac
8f1e55bdb1 Update year in the README (#51923) 2025-01-09 17:43:08 +01:00
bryan
4f2207b4a9 add entity insertion library (#47895)
* add entity insertion library

- this lets us use `add-load/from-script`

* update add load examples
2025-01-09 08:48:19 -07:00
Ryan Laurie
fe092c1156 CI Failure notice improvements (#51885)
* don't notify slack on flaky job failing

also add more info to failure notice

* this is nicer
2025-01-09 07:48:02 -07:00
Uladzimir Havenchyk
82e4392582 feat(QB): combine chart type selector with viz settings sidebar (#51671)
* feat(QB): combine chart type selector with viz settings sidebar

* fix typecheck

* fix unit tests

* chore(e2e): create helpers for viz settings and viz type buttons

* fix some tests

* fix most of the e2e tests

* fixup

* more fixes

* another test

* add a warning

* revert cross test changes
2025-01-09 12:10:50 +00:00
Uladzimir Havenchyk
9afbb6d62c feat(QB): show small Join and CC icons for aggregation without breakout (#51655)
* chore(QB): show small Join and CC icons for aggregation without breakout

* fix linting

* tests

* use compact prop and add another test

* revert provider

* fix memo
2025-01-09 14:15:09 +03:00
Kamil Mielnik
8ceed8d65e Port all entities to use new EntityListLoaderRtkQuery (#51496)
* Fix typo

* Fix broken memoization

* Use undefined instead of 0

* Introduce entityOptions

* Fix memoization

* Enable EntityListLoaderRtkQuery for alerts (#51501)

* Port bookmarks to use new `EntityListLoaderRtkQuery` (#51502)

* Fix types

* Enable EntityListLoaderRtkQuery for bookmarks

* Revert "Fix types"

This reverts commit f855c3a460.

* Enable EntityListLoaderRtkQuery for dashboards (#51503)

* Enable EntityListLoaderRtkQuery for persisted models (#51505)

* Enable EntityListLoaderRtkQuery for pulses (#51507)

* Enable EntityListLoaderRtkQuery for revisions (#51509)

* Enable EntityListLoaderRtkQuery for persisted segments (#51512)

* Enable EntityListLoaderRtkQuery for snippets (#51513)

* Enable EntityListLoaderRtkQuery for persisted questions (#51508)

* Enable EntityListLoaderRtkQuery for actions (#51515)

* Port tables to use new `EntityListLoaderRtkQuery` (#51518)

* Enable EntityListLoaderRtkQuery for tables

* Fix polling

* Port timelines to use new `EntityListLoaderRtkQuery` (#51516)

* Enable EntityListLoaderRtkQuery for timelines

* Add missing options

* Fix flaky test

* Port groups to use new `EntityListLoaderRtkQuery` (#51504)

* Enable EntityListLoaderRtkQuery for groups

* Bind action creators

* Fix flaky test

* Port users to use new `EntityListLoaderRtkQuery` (#51514)

* Enable EntityListLoaderRtkQuery for users

* Add missing options

* Fix crash

* Reimplement pagination

* Enable EntityListLoaderRtkQuery for search (#51568)

* Port schemas to use new `EntityListLoaderRtkQuery` (#51511)

* Enable EntityListLoaderRtkQuery for persisted schemas

* Add missing options

* Temporary commit
- just to save work at EOY

* Fix file upload

* Fix unit tests

* Fix data being set for different entityQuery

* Port collections to use new `EntityListLoaderRtkQuery` (#51519)

* Enable EntityListLoaderRtkQuery for collections

* Add missing options

* Improve typing

* Fix data being set for different entityQuery

* Fix destructuring crash

* Fix typing

* Pass options to RTK query where missing

* Use undefined instead of 0 for reloadInterval

* Port snippet collections to use new `EntityListLoaderRtkQuery` (#51847)

* Enable EntityListLoaderRtkQuery for snippet collections

* Introduce custom useListQuery

* Reduce diff

* Reduce diff
2025-01-09 14:55:02 +07:00
Cam Saul
f0842c1ce8 Defendpoint 2.0 (#51559)
* Split Kondo lint fixes off into #51747

* Merge changes from #51660

* Reworked API documentation generation code

* Oops Markdown not YAML

* BIG documentation generation improvements

* Don't try to style tables ourselves

* Fix lint errors

* Fix tests 🔧

* Fix Kondo warnings

* Update OpenAPI dox generator to handle Defendpoint v2

* Update OpenAPI dox generator to handle Defendpoint v2

* Test fixes 🔧

* Fix uberjar compilation

* PR feedback from @escherize

* Deprecate the old `defendpoint`

* Nuke the old version of the API documentation code (new version will be merged in #51872)

* Remove empty file

* Disable output validation in prod

* Fix the way we define defendpoint 2 handlers
2025-01-08 17:02:13 -08:00
Cam Saul
9c9dc1f0c1 Fix Kondo linter for with-temp and add linters for Malli explain/validate (#51747)
* DEFENDPOINT 2.0

* Remove blank file

* Fix Kondo linter for with-temp and add linters for Malli explain/validate

* Fix Kondo errors and reformat

* Revert unneeded change
2025-01-09 00:04:38 +00:00
William
f1b714aead Actions preprocess queries before compiling (#51724)
We need to preprocess queries (and use the results) to ensure that we properly cast arguments in where clauses
2025-01-08 23:52:44 +00:00
Ryan Laurie
b133ca22f3 Dot X Releases (#51257)
* first crack at dot x releases

* updates based on testing

* fix some white space
2025-01-08 16:45:23 -07:00
Noah Moss
ccdd98bc68 Premium features module + reorganization (#51700)
* start moving code around

* WIP fixes

* Test reorg, some more fixes

* Test fixes

* cljfmt, fix a test

* more cljfmt and linting

* cleanup, formatting fixes

* remove debugging code

* format again

* add some ns docstrings
2025-01-08 17:20:13 -05:00
Uladzimir Havenchyk
6d285d9311 feat(QB): change visual style of the buttons so that they all look active (#51666)
* chore(QB): change visual style of the buttons so that they all look active

* show readonly items as transparent

* adjust colors
2025-01-08 21:09:13 +00:00
Cam Saul
81ce63f45f Fix Liquibase CLI alias (#51192)
* Fix Liquibase CLI alias

* Only run setup-db! for dbDoc

* Revert job/trigger name changes

* Appease linters
2025-01-08 19:57:01 +00:00
Ryan Laurie
f3e7f3e1c2 mark the flakiest tests as such (#51869) 2025-01-08 11:12:30 -07:00
Jeff Bruemmer
84b67702a8 docs - link updates (#51870) 2025-01-08 12:58:52 -05:00
Case Nelson
dab495cf6f Set key auth as the default auth method, put warning password (#51249)
* Set key auth as the default auth method, put warning on username and password

* Fix password / keyfile existing at once

* Address review
2025-01-08 10:23:07 -07:00
Case Nelson
bd15d5d577 fix: Change pool acquireRetryAttemps to 0 (#51296)
* fix: Change pool acquireRetryAttemps to 1

Fixes: #51176

* Address PR review and only test dbs with username auth

* Fix model ref

* Exclude hive-like connections

* Ensure user and password
2025-01-08 10:22:25 -07:00
Braden Shepherdson
8d23fd7406 Adding :idents to columns returned by MetadataProviders (#50158)
Updates JVM, JS and unit test `MetadataProvider` implementations to include `:ident` fields for all columns.

These idents need to be globally unique and serdes portable; therefore they are not randomized.
Instead they are built from the database, schema, table and field names, eg.

```clojure
{:ident "field__Sample Database__PUBLIC__Orders__CREATED_AT"
 #_...}
```

**Note:** These `:ident` fields are not included on `/query_metadata` and other such API calls (currently).
They could be, but they can just as easily be synthesized from the DB, table and field in the JS metadata
implementation.
2025-01-08 16:12:53 +00:00
Uladzimir Havenchyk
dc33029e96 feat(QB): rename last to previous in date filters (#51650)
* chore(QB): rename last to previous in date filters

* update tests

* update e2e test

* fix test
2025-01-08 16:09:20 +00:00
Noah Moss
b339c31147 auto create serialization users as inactive (#51816) 2025-01-08 15:50:42 +00:00
Braden Shepherdson
8980b64c6d [refs] Clean up backfill warnings on cards at startup (#51802)
These warnings started with #50100, because the `sweep-query-analysis`
tasks had under-populated Toucan 2 queries against `:model/Card`.
2025-01-08 15:40:01 +00:00
Alexander Polyankin
933dfd793a Consolidate numeric type system checks (#51808) 2025-01-08 09:57:34 -05:00
Aleksandr Lesnenko
c1db02efac fix parameter placeholder encoding on iframe urls (#51818) 2025-01-08 14:37:07 +00:00
Oleksandr Yakushev
cd9e7c6634 perf: Optimize metabase.formatter/strip-trailing-zeroes (#51774) 2025-01-08 15:13:55 +02:00
Uladzimir Havenchyk
58cb47d6ae feat(QB): make viz icon stable independently from the viz type (#51670) 2025-01-08 15:59:27 +03:00
Uladzimir Havenchyk
a0ae2a8f28 chore(e2e): create helpers for viz settings and viz type buttons (#51674) 2025-01-08 08:23:55 +00:00
William
3339090e34 Convert aggregation order-bys to reference by index instead of uuid before hashing (#51800)
When you order by an aggregation, mbql v2 references the aggregation by uuid.  However, that makes the query hash to a different value each time, because you get a different uuid each time you hash it.  Converting the query to reference by index during the hashing process fixes this.
2025-01-08 05:27:51 +00:00
Oisin Coveney
dcea62b5e3 Don't truncate 'Generate Key' label (#51838) 2025-01-07 16:11:33 -08:00
Riley Thompson
298bdfe88d Add rileythomp to team files (#51837)
* add rileythomp to team files

* add back newline at eof
2025-01-07 17:19:43 -05:00
Ryan Laurie
90321968d5 Cache logins in e2e tests (#51715) 2025-01-07 21:12:31 +00:00
Ryan Laurie
7b7da72b9c Make JWT provider URI optional (#51832)
* make jwt provider URI optional

* prettier
2025-01-07 14:10:09 -07:00
Noah Moss
6445bc91c6 correctly hide preemptive caching toggle for root config (#51823) 2025-01-07 15:26:14 -05:00
Jeff Bruemmer
beff8ddec7 docs - in function for custom expressions (#51719) 2025-01-07 20:14:14 +00:00
Jeff Bruemmer
8ef3001c62 docs - relocate contributing file (#51764) 2025-01-07 15:09:48 -05:00
Oisin Coveney
ec35920631 Convert ChartSettingFieldsPartition to mantine (#51223) 2025-01-07 11:56:56 -08:00
Raphael Krut-Landau
e204b56332 Small a11y improvements (#51577) 2025-01-07 14:06:27 -05:00
Jeff Bruemmer
b70ec4e804 docs - note on bigquery structs (#51822) 2025-01-07 13:49:01 -05:00
Raphael Krut-Landau
fdafb79120 Fix flaky unit test of JoinStep (#51789) 2025-01-07 10:07:18 -08:00
Jeff Bruemmer
daf0185322 docs - mb-disable-scheduler (#51812) 2025-01-07 17:38:18 +00:00
Jeff Bruemmer
aff0dc9790 docs - add enterprise-only key to SDK blockquote (#51815) 2025-01-07 12:30:30 -05:00
Nathan Voxland
c120c35891 Improved encryption management (#51546)
* Ensure database is fully encrypted if key is set, fail f database is encrypted and key is not set
* Added "remove-encryption" command as a more obvious alternative to rotate-encryption-key with an empty key
2025-01-07 10:10:25 -06:00
Alexander Polyankin
58b9992f1f Quarter picker in parameters (#51770) 2025-01-07 11:07:14 -05:00
Nathan Voxland
5434b36d03 Handle exception in rollback better (#51675)
Handle exception in rollback better
2025-01-07 09:20:55 -06:00
Alexander Polyankin
4686618c33 Fix string, temporal, category type check functions (#51796)
* Fix type checks

* Fix type checks

* Fix type checks

* Fix type checks

* Remove disabled "compare-aggregations" drill

* Remove disabled "compare-aggregations" drill

* Remove dead code

* Remove dead code
2025-01-07 09:55:10 -05:00
Alexander Polyankin
01242bdb26 Change label (#51788) 2025-01-07 09:53:41 -05:00
Alexander Polyankin
29dafe465f Remove disabled compare-aggregations drill (#51798)
* Remove disabled compare-aggregations drill

* Remove disabled "compare-aggregations" drill
2025-01-07 09:52:50 -05:00
Nathan Voxland
05c93c8b21 Update setting table name reference to :model/setting (#51783)
Update setting table name reference to :model/Setting
2025-01-06 19:51:53 -06:00
Cam Saul
009c1bfdff Update API dox (#51795) 2025-01-06 16:48:07 -05:00
Noah Moss
ccfaf2e9ab Preemptive caching FE (#51684)
* fix broken link on BE

* Frontend

* update switch styles

* Fix type errors

* Fix BE tests

* fix malli schema

* logic tweak - don't show the switch if the target model is database

* cljfmt

* Add cypress test

* localize strings

* simplify form updates

* remove unneeded description style

* remove unused enabled? prop

* revert unintended change to cypress helper
2025-01-06 16:29:58 -05:00
Sloan Sparger
9ff67b56fc Fix FormTextInput styling (#51721) 2025-01-06 13:39:32 -06:00
Jeff Bruemmer
bb3abf74e1 links (#51784) 2025-01-06 16:56:01 +00:00
Ngoc Khuat
fdb3a1f127 put field usage behind a feature flag and turn it off by default (#51677) 2025-01-06 16:10:45 +00:00
Oleksandr Yakushev
83fe7b1d3f [svg] Limit the lifetime of a cached Truffle JS engine to sidestep apparent memory leaks (#51685) 2025-01-05 16:16:28 +02:00
appleby
c1bf4fb520 Fix compare-aggregations drill for multi-stage queries (#51608) 2025-01-03 13:05:05 -08:00
appleby
50e10e1b78 Fix the zoom-in.binning drill thru for multi-stage queries (#51489)
* Make renaming options optional in lib.underlying/top-level-column

* Construct dimensions from row data in available-drill-thrus

Construct dimensions from row data once in available-drill-thrus, rather than doing it in each drill that needs it
separately. The dimensions must be constructed in available-drill-thrus since some drills are expected to
return-drills-for-dimensions?, but this also has the side benefit of reducing code duplication by lifting the
rows->dimensions conversion up into a single place.

* Fix the zoom-in.binning drill thru for multi-stage queries

* Add tests for zoom-in.binning with multi-stage queries

* cljfmt

* Explicitly disable the automatic-insights drill for multi-stage queries

Previously, this drill will was implicitly disabled for multi-stage queries because the FE would not pass dimensions
for queries with underlying breakouts / aggregations. Now that dimensions are reconstructed in available-drill-thrus,
automatic-insights drill is available again, but if you try to actually run the drill you get a big scary "Something
went wrong" error, so just explicitly disable the drill until we fix it.

* Update test/metabase/lib/drill_thru/zoom_in_bins_test.cljc

Co-authored-by: Braden Shepherdson <braden@metabase.com>

* Review feedback: not-empty -> seq

* Reivew feeback: shadow rather than using a single-quote suffix

* Review feedback: underyling -> underlying

---------

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-01-03 13:03:32 -08:00
Jeff Bruemmer
d053b2fe80 docs - separate google sign-in and ldap docs (#51746)
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-01-03 15:10:15 -05:00
Ryan Laurie
ae97cbde23 Enable N-parallelism for e2e tests (#51433) 2025-01-03 08:23:13 -07:00
Jeff Bruemmer
4eeccde961 Add link to support matrix (#51737) 2025-01-03 10:05:35 -05:00
Roman Abdulmanov
322b8958c8 Update urls (#51732) 2025-01-03 11:51:53 +00:00
Mahatthana (Kelvin) Nomsawadi
2ed72d106b Fix static embedding missing dark theme on some date widgets (#51661)
* Fix date widgets dark theme

* Update more outdated loki snapshots

* Add a story to theme date filters missing dark theme

* Theme relative current widget and co.

* Theme date exclude widget

* Theme relative date interval widget and co.

* Update more snapshots from border color change

* Fix comment on the wrong line

* Fix light theme story switching + mock relative date stories

* Review: Remove unused function arg

* Update snapshots that change once a year 🤦
2025-01-03 09:13:57 +00:00
Ryan Laurie
fe13ca6859 Happy new year e2e test fixes (#51720) 2025-01-02 14:31:29 -07:00
Uladzimir Havenchyk
5c011ed5ec chore: drop a duplicated test (#51653)
* chore: drop a duplicated test

* cleanup naming
2025-01-02 14:05:06 -07:00
Bruno Bergher
4bc96006af Workflow: Slack Notification for New Feature Requests (#51709)
Tells the PMs when new feature requests come in.
2025-01-02 16:41:59 +00:00
Braden Shepherdson
73fe6a603c [refs] Ensure all column-creating clauses have idents on read (#50100)
That is: aggregations, breakouts, expressions and joins.

Nothing is consuming these yet, but the BE populates them when reading cards.

MBQL changes
=============

These new `:ident`s have been present for new clauses for a few weeks, but now they'll be generated for existing queries on read.

The new idents are stable, including across serialization. They aren't written back until the card is saved again.

Backfilling
===========

Here's the constraints for generating idents for pre-existing clauses:

- If the same query exists across serdes instances, produce the same ident
- Globally unique, even if:
    - two cards have identical queries
    - two stages of the same card have identical `:count` aggregations.
    - a single stage has multiple aggregations of the same type
    - a single stage has duplicate breakouts with different time granularity
- Never change, even if the query does
    - mbql-lib assumes these are (in theory) randomly generated, and never examines or updates them.
    - If new clauses are added, they get random idents.
    - If clauses are removed, that's no problem.
    - If clauses are edited (eg. changing an expression name) then the BE *would* generate a new ident!
        - But when the card gets saved, the original ident with the original expression name is enshrined forever as the ident - it just needs to be unique!

The backfilled idents have this form:

```clojure
"${kind}_${entity_id of the card}@${stage-number}__${name or index}"
;; eg. 
"aggregation_ThisIsAValidNanoIdxxx@0__1"
"breakout_ThisIsAValidNanoIdxxx@1__1"
"expression_ThisIsAValidNanoIdxxx@0__exprname"
"join_ThisIsAValidNanoIdxxx@1__alias"
```
2024-12-31 16:47:03 +00:00
Ryan Laurie
e9d13a38c1 split up query stage e2e test file (#51583)
* split up query stage tests

# Conflicts:
#	e2e/test/scenarios/dashboard-filters-2/dashboard-filters-query-stages.cy.spec.ts

* update for merge to master

* fix
2024-12-31 09:34:09 -07:00
Alex Yarosh
dea02a4d22 Docs: bell icon - master version (#51696)
* alerts

* bell
2024-12-31 11:26:32 -05:00
Ngoc Khuat
84dc6f75ee toucan2 consistent model alias (#51660) 2024-12-31 05:35:35 +00:00
lbrdnk
8985d95122 Add test for external contribution (#51693) 2024-12-30 22:11:44 +03:00
Alexander Viala Bellander
263256f7ab Add M2M Oauth to Databricks Driver (#51476)
* Add M2M Oauth to Databricks Driver

* Add toggle for PAT/M2M Oauth

Introduces a 'Use Personal Access Token' toggle button which shows different UI components when setting up the connection. The implementation was inspired by @snoe in #51249

* Address feedback from @ibrdnk

Addresses the feedback related to #pullrequestreview-2515818008

* Default M2M, Add conditional Merge, Reduce whitespace

* Update docs/databases/connections/databricks.md

Co-authored-by: Jeff Bruemmer <jeffbruemmer@gmail.com>
2024-12-30 16:05:41 +01:00
Uladzimir Havenchyk
be4a57cf78 feat(QB): update view sql/hide sql button style (#51651)
* chore(QB): update view sql/hide sql button style

* update e2e tests
2024-12-28 12:37:44 +00:00
Noah Moss
68101f50f2 Ensure collections' effective_location is batch hydrated when hydrating effective_parent (#51673) 2024-12-27 15:08:34 +00:00
Oleksandr Yakushev
393308bc5c perf: Make registered? and initialized? checks faster for already initialized drivers (#51023) 2024-12-26 14:47:00 +00:00
Nemanja Glumac
4b64ef287b Remove the unused and deprecated fetch-mock-jest (#51663) 2024-12-26 14:43:52 +03:00
Alexander Polyankin
eb596a48f0 Use MonthPicker from mantine for dashboard parameters to enable selection of months in the future (#51645) 2024-12-24 16:49:15 -05:00
Oisin Coveney
0502dd8a8e Fix ChartSettingsPopover style/z-index issues (#51154) 2024-12-23 19:02:24 -08:00
Alexander Polyankin
670ee25906 Replace old DatePicker in dashboard & search parameters (#51596) 2024-12-23 22:09:21 +00:00
metamben
7dfe9d4cc4 Fix typo (#51638) 2024-12-23 21:38:21 +00:00
Aleksandr Lesnenko
5444d94a13 Fix glitching series on hover in Safari (#51611)
* nasty hack but works

* apply to safari only

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-12-23 15:32:44 -05:00
Aleksandr Lesnenko
97a47fe9db allow parametrized link cards (#51428) 2024-12-23 20:05:13 +00:00
Jeff Bruemmer
189703e895 docs - env vars in config files (#51642) 2024-12-23 14:14:18 -05:00
Oisin Coveney
c170d97352 Convert ChartsettingOrderedItems to match ChartSettingSelect (#51332) 2024-12-23 10:17:07 -08:00
Phoomparin Mano
1a8e6132b2 feat(sdk): make editable dashboard grid border color themeable (#51060) 2024-12-24 00:08:12 +07:00
Phoomparin Mano
4a9e296160 docs(sdk): fix initial parameter props name in dashboards (#51625) 2024-12-24 00:04:51 +07:00
Jeff Bruemmer
6ee87dcc9b docs - question in dashboards (#51366) 2024-12-23 10:45:13 -05:00
Romeo Van Snick
b7950cd10e Partial rollback of FieldValuesWidget to v50 (#51183)
* Reset FieldValuesWidget to v50 state

* Revert some changes in SingleSelectListField to v50

* Make onSearchChange optional

* Use RowValue instead of string

* Add test-ids to FieldValuesWidget inputs

* Add testing matrix for all parameter combinations

* Add filter matrix test to github workflow

* Fix unit test

* Render custom option value when it exists

* Fix e2e test

* Fix remove value helper

* Fix e2e test

* Render custom label on TokenField

* Update Loki Snapshots

* Use css colors for TokenFieldItem

* Make TokenField dark-mode aware

* Make TokenFieldItem dark-mode aware

* Update Loki Snapshots

* Fix e2e test after merge

* Add listbox role to tokenfield values

* Fix more e2e tests

* Fix e2e test for listbox

* Remove commented out code

* Fix e2e test

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-12-24 02:30:13 +11:00
Uladzimir Havenchyk
21e2b99ec6 chore: drop unused emotion components (#51598)
* chore: drop unused emotion components

* more cleanup
2024-12-23 13:59:31 +03:00
Uladzimir Havenchyk
72b3cc3f48 chore: remove not used index files (#51591)
* chore: remove unused files

* more files to drop

* fixup

* more files

* chore: remove not used index files
2024-12-23 13:59:19 +03:00
lbrdnk
aab7f5baee Fix method definitions (#51473) 2024-12-23 10:55:50 +01:00
Phoomparin Mano
0361bdd557 bump master to 53-nightly (#51575) 2024-12-23 05:57:35 +00:00
Alexander Solovyov
7c276e3bbf [serdes] extract tabId in click_behavior (#51588)
also, somewhat relatedly, create `elide-fk` function to skip pieces of data holding FKs to deleted targets
2024-12-21 10:07:23 +00:00
appleby
0b44617a5d Fix summarize-column and summarize-column-by-time drills for multi-stage queries (#51553)
* Fix summarize-column drill for multi-stage queries

* Fix the summarize-column-by-time drill for multi-stage queries
2024-12-20 17:19:01 -08:00
John Swanson
7ff5975436 Simple API for storing KV pairs per-user (#48376)
Co-authored-by: Noah Moss <noahbmoss@gmail.com>
2024-12-20 18:48:40 -05:00
Uladzimir Havenchyk
bcac621fa8 chore: replace global icon selector with local (#51566) 2024-12-21 01:12:17 +03:00
Noah Moss
bea199498e Batch query_execution, audit_log and view_log truncations (#51490) 2024-12-20 16:57:30 -05:00
Uladzimir Havenchyk
5583a5c29a chore: remove unused files (#51574) 2024-12-21 00:09:14 +03:00
Jeff Bruemmer
96b843e41c remove changelog toggle in release notes (#51479) 2024-12-20 15:35:45 -05:00
Oleksandr Yakushev
8b8147a807 ci: Fix be-tests stub (#51545) 2024-12-20 20:19:55 +00:00
lbrdnk
79b33141f7 Add debug logging for chain filter query (#51481)
* Add debug logging for chain filter query

* Comment
2024-12-20 20:51:25 +01:00
lbrdnk
28a1629790 Add description to metric API responses (#51448)
* Generate suggested_name on card read

* Add test

* Comment

* Naming and comment

* Use m/assoc-some
2024-12-20 20:51:14 +01:00
Sloan Sparger
f42b605299 [Cmd Palette] Do not show admin and settings links to users who do not have access (#50887)
* fixes showing admin links to not admins in the command palette

* updates calculation to take into account EE advanced permissions allowing certain users permissions to change settings who are not admins

* admin routes for non-admins

* fix unit tests

* actually fix unit tests

* adding checks for other permissions

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2024-12-20 15:45:40 -04:00
Alexander Polyankin
c2de5b5e5f Date picker cleanup for parameter changes (#51587)
* Remove canUseRelativeOffsets

* Remove canUseRelativeOffsets

* Types

* Types
2024-12-20 18:45:30 +00:00
Oleksandr Yakushev
6a3aa35832 Minor refactoring of cancellation-related code (#49815) 2024-12-20 19:22:54 +02:00
Oleksandr Yakushev
48ae90a5b1 ci: Only run driver tests when testing Databricks driver (#51543) 2024-12-20 18:23:09 +02:00
William
ff06e1b900 Pass uuids as strings to SQL Server (#51484)
Azure Synapse doesn't like it when you give it a uuid parameter, even though synapse does support uuids in general.
Converting those uuids to strings beforehand fixes this error, and regular SQL Server is also fine with that.
2024-12-20 09:48:55 -06:00
Nick Fitzpatrick
53af5593bd Adjust initialDashboardId calculation (#51291)
* adjust initialDashboardId calculation

* e2e adjustments

* unit test adjustment

* PR Feedback
2024-12-20 11:45:43 -04:00
Sloan Sparger
be1eac5e39 [Cards in Dashboards] Prevent dashboard from appearing in breadcrumbs when not on a DQ page (#51554)
* prevent dashboard from appearing in breadcrumbs when not on a DQ page

* updating unit test with location

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2024-12-20 11:43:22 -04:00
Aleksandr Lesnenko
718f667515 fix broken radio buttons in viz settings (#51558) 2024-12-20 15:42:47 +00:00
Noah Moss
4452359c58 Update migration to allow query_execution.parameterized to be null (#51549) 2024-12-20 10:41:22 -05:00
Raphael Krut-Landau
428b0c9f86 Show errors from backend in Create API key modal (#51395) 2024-12-20 15:36:54 +00:00
Nicolò Pretto
91ddc60070 add tests for support of xx-YY locales in embed/public-links (#51456)
* fix: add supports for xx-YY locales in embed/public-links

* Generate locales.json

* [WIP] Read locales.json

* wip FE implementation

* refactor + unit and sdk component tests

* fixes after the merge, plus tests and cleand up logic

* fix file name in string

* change FE logic to use locales from the instance settings

* revert json generation

* remove leftover comment

* add comment about the code to keep in sync

* migrate e2e tests for static/public to use #locale=de-CH so we test that
it's using the fallback logic

* fix kondo error
Co-authored-by: dpsutton <dan@dpsutton.com>

* fix unit test

* fix more jest tests

* cy.request -> cy.intercept

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-12-20 16:26:28 +01:00
Nicolò Pretto
bda324e42b fix(sdk): add supports for xx-YY locales in embed/public-links and sdk (#51002)
* fix: add supports for xx-YY locales in embed/public-links

* Generate locales.json

* [WIP] Read locales.json

* wip FE implementation

* refactor + unit and sdk component tests

* fixes after the merge, plus tests and cleand up logic

* fix file name in string

* change FE logic to use locales from the instance settings

* revert json generation

* remove leftover comment

* add comment about the code to keep in sync

* fix kondo error
Co-authored-by: dpsutton <dan@dpsutton.com>

* fix unit test

* fix more jest tests

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-12-20 15:11:08 +01:00
Alexander Solovyov
6fb5fdc8f4 [openapi] reduce amount of oneOf/allOf we generate in documentation (#51495) 2024-12-20 13:13:22 +00:00
Phoomparin Mano
53dee386d3 ci(sdk): make 52 the latest in release workflow (#51552) 2024-12-20 19:07:53 +07:00
Uladzimir Havenchyk
d4db9cd0e8 fix: show chevron icon in the bucket picker on hover (#51542)
* chore: rework pickers in querying folder to css modules

* more css

* more css

* more css

* fix typecheck

* fix ui

* fix ui

* drop unused code

* fix ui

* fix css

* fix unit test

* revert color changes

* fix join color

* fix showing chevron icon in the bucket picker

* address review

* oops
2024-12-20 14:54:56 +03:00
Phoomparin Mano
ec0ac2bf7a Fix non-legible text and icon colors in fullscreen dark mode (#51538) 2024-12-20 18:05:44 +07:00
Oleksandr Yakushev
963d308568 Bump Toucan2 version (#51547) 2024-12-20 00:35:52 +02:00
Aleksandr Lesnenko
f99b8baa5f show all columns in scatter tooltip by default (#51480)
* show all columns in scatter tooltip by default

* update e2e spec
2024-12-19 20:59:14 +00:00
Uladzimir Havenchyk
522910ec6b chore: rework querying steps to css modules (#51430)
* chore: rework pickers in querying folder to css modules

* more css

* more css

* more css

* fix typecheck

* fix ui

* fix ui

* drop unused code

* fix ui

* fix css

* fix unit test

* revert color changes

* fix join color
2024-12-19 23:25:07 +03:00
Noah Moss
bc4e2da39b Fix instance stats cypress test + ensure it runs in CI (#51531) 2024-12-19 15:19:52 -05:00
Aleksandr Lesnenko
9f01f0efa4 Fix pdf exports issues (#51491)
* fix horizontally trimmed content on short pages

* include filters

* update specs
2024-12-19 15:17:25 -05:00
Sloan Sparger
f29b68770f [Cards in Dashboards] Edit dashboard save changes modal adjustments (#51345)
* make making the change easy

* make easy change

* clean up

* pr feedback

* pr feedback
2024-12-19 14:05:27 -06:00
Sloan Sparger
f147c3710b [Clean-up] Allow collection clean up banner to be dismissible (#51434)
* allow collection clean up banner to be dismissable

* small change

* dismiss the banner if the user uses the clean up modal

* add test coverage
2024-12-19 14:03:04 -06:00
Aleksandr Lesnenko
a8634811a0 support parametrized iframe urls (#51374)
* support parametrized iframe urls

* spec

* copy fix
2024-12-19 14:27:42 -05:00
Nemanja Glumac
482f6bbff4 Try a band-aid fix for native editor e2e flakes (#51528) 2024-12-19 18:49:17 +00:00
Oisin Coveney
ec4192eb9d Convert ChartSettingSelect to Mantine (#50977) 2024-12-19 18:14:58 +00:00
Aleksandr Lesnenko
41bac38d80 quarantine flakes caused by problems with typing in the native editor (#51520) 2024-12-19 17:48:35 +00:00
Oleksandr Yakushev
cfe322223b perf: Add fastpaths to url? and email? predicates (#51522) 2024-12-19 19:24:55 +02:00
Alexander Polyankin
f314f6d56a Add more binning options for coordinates (#51472) 2024-12-19 17:16:52 +00:00
Abed Habli
4304b96ce2 docs: Updating "Export dashboard as PDF" (#51506)
* Updating "Export dashboard as PDF"

* Typo

* updating the screenshot
2024-12-19 18:15:24 +01:00
Sloan Sparger
56357db89f [Cards in Dashboards] Update in-dashboard question creation flow (#51246)
* revert previous solution and move code into question question picker

* convert QuestionPicker to typescript

* port to css module

* refine button styles

* fix some e2e

* fix last failing e2e

* fe implementation for sessions

* fix styles if only one button is showing

* user css va for border colors

* fix failing unit tests and move new unit tests into existing file i had not noticed

* fix lint
2024-12-19 10:02:28 -06:00
Ryan Laurie
b04cfa86a6 quarantine flaky native tests (#51510) 2024-12-19 14:51:16 +00:00
Nicolò Pretto
7a4d682dde fix(types): fix type error on textCard in static-dashboard.cy.spec.tsx (#51450) 2024-12-19 13:34:01 +01:00
Nicolò Pretto
83cbbd7e45 add sdk theme selector to storybook + split the storybook sdk config into its own folder (#51122)
* add sdk theme selector to storybook

* let's try to split the storybook
2024-12-19 13:29:57 +01:00
John Swanson
4e451b4692 fix error copy when trying to move card->dash (#51233) 2024-12-19 04:12:43 -08:00
Uladzimir Havenchyk
71735c6722 chore: rework pickers in querying folder to css modules (#51427)
* chore: rework pickers in querying folder to css modules

* more css

* fix ui

* fix ui

* drop unused code
2024-12-19 06:03:17 +00:00
Noah Moss
dd021f0862 Preemptive caching backend (#50816) 2024-12-18 20:04:54 -05:00
bryan
6c933f2d91 Don't crash for ignored status codes in embedding responses (#51408)
* short circuit tracking for ignored requests

- add fall-through for ignored embedding requests

* add test for ignored status codes

* remove cruft

* add logging for unknown clients or statuses

* Fix some e2e tests in custom-column and view-data (#51431)

* warn on reflection!

---------

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2024-12-18 22:23:56 +00:00
appleby
4cfbd67ce2 Revert to using secrets.GITHUB_TOKEN for the auto-approve PR step (#51413)
Using secrets.METABASE_AUTOMATION_USER_TOKEN causes the auto-approve PR step to fail with an error like

  Can not approve your own pull request

Revert to using secrets.GITHUB_TOKEN instead, which matches what the auto-backport.yml workflow does and what this
workflow did previously.
2024-12-18 10:51:38 -08:00
Alexander Polyankin
f024e79c85 Add field values e2e test (#51424) 2024-12-18 17:10:48 +00:00
Aleksandr Lesnenko
6d4b695b5f add percentages to sankey tooltip (#51193)
* add percentages to sankey tooltip

* another tooltip variant

* specs

* lint
2024-12-18 16:47:11 +00:00
Raphael Krut-Landau
500b0e6d06 Fix some e2e tests in custom-column and view-data (#51431) 2024-12-18 09:52:02 -05:00
Alexander Solovyov
8f49ab0dd0 [serdes] make logs and errors a bit more consistent (#51390) 2024-12-18 14:12:01 +00:00
Oleksandr Yakushev
aa8a386e34 ci: trim stacktrace of intentional exceptions thrown during testing (#51443) 2024-12-18 16:31:45 +03:00
Phoomparin Mano
00a087bb52 fix(sdk): update define function names in Next.js compat (#51071) 2024-12-18 20:21:44 +07:00
Abed Habli
41e4defd29 Typo (#51440) 2024-12-18 13:37:15 +01:00
Oisin Coveney
bb32a4111b Convert ChartSettingInputNumeric to Mantine (#51165) 2024-12-18 11:51:45 +00:00
Kamil Mielnik
94372d6fa6 Implement new EntityListLoader that uses RTK Query hooks (#51341)
* Add EntityListLoaderRtkQuery boilerplate

* Add loaded prop

* Add metadata prop to children

* Improve typing for entity selectors

* Add missing selector typing

* Adjust list loader

* Drop dispatchApiErrorEvent, entityAlias

* Add listName prop

* Conditionally use entityListLoaderRtkQuery

* Add transformResponse

* Enable new loader for database entity

* Update typing

* Add todo

* Remove actionCreators

* Update TODO

* Use loadListLegacy

* Fix condition

* Add dynamic reload* prop to children

* Handle onLoaded prop

* Reproduce isReloading behavior with isLoading

* Add support for reloadInterval prop

* Fix list state path when query is empty

* Migrate sample database endpoint

* Update type

* Simplify transformResponse

* Use modern syntax

* Type the wrapper

* Name the wrapper components

* Improve typing
2024-12-18 17:44:06 +07:00
Uladzimir Havenchyk
c29f2e382d chore: rework mix components to css modules (#51220)
* chore: rework mix components to css modules

* more css

* more css

* more css

* more css

* rework last pieces of emotion to css modules

* remove failing test

* address review

* fix view button styling

* fix view button styling

* drop not needed change
2024-12-18 09:26:09 +00:00
Uladzimir Havenchyk
084384db11 tests(jest): add ES module is-absolute-url to the transform ignore (#51438) 2024-12-18 11:49:30 +03:00
Jeff Bruemmer
e1a1e73128 lychee to lint doc links (#51422)
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2024-12-17 16:49:20 -05:00
Nick Fitzpatrick
a59eba3e63 Entity picker search dashboard questions (#51367)
* scoping search to dashboard questions, adding dashboard questions to everywhere search results in entity picker

* e2e tests
2024-12-17 17:36:24 -04:00
Jeff Bruemmer
685c36f599 docs - remove release page (#51410)
* remove release page

* links

* remove workflow
2024-12-17 13:51:54 -05:00
Raphael Krut-Landau
3d01b319e5 Test that we can go back from the notebook editor (#50972)
This PR builds on #50420 by adding an e2e test that the user can press the back button to return from the notebook editor to the homepage. Previously this was impossible due to a pop-under bug (#50971).
2024-12-17 13:21:49 -05:00
Raphael Krut-Landau
93a703a911 fix(sdk): Control stacking without distinct z-indexes (#49442)
This PR introduces a simple way of avoiding pop-under bugs:
* First, we **give all overlays the same z-index.** It's 200, above everything else. SDK users can change this value.
* Second, we **prevent eager portal rendering**. On master, overlays are appended to the DOM inside an empty div, called a "portal". This portal is appended on mount. It stays hidden until the overlay is opened. In this branch, we stop portals from rendering eagerly. Instead, portals are only appended when the overlay is opened, and removed when the overlay is closed. This way, the most recently opened overlay is always last in the DOM. 

Since the most recently opened overlay is last in the DOM, and since all overlays have the same z-index, the most recently opened overlay always appears on top.

This PR:
* closes #51256
* closes #45468
* closes #49466
* closes #50943
* closes #50971 
* provides a more robust solution for two issues that previously received a quick, "minimum viable fix": #45469 and #48256
* improves the health of the codebase by removing hacks
2024-12-17 12:48:14 -05:00
Nicolò Pretto
ec2f229fe1 fix(sdk): migrate to custom redux context to allow using the sdk on host apps that use redux (#51382)
* step1: add MetabaseReduxProvider and make our hooks + connect fn use it

step1: add MetabaseReduxProvider and make our hooks + connect fn use it

* step 2: run codemod to change the imports

step 2: run codemod to change the imports

* step 3: manual fixes

* step 4: e2e test for sdk
2024-12-17 18:37:54 +01:00
Chris Truter
f19101b970 Replace Search Index setting with a table (#51338) 2024-12-17 16:08:43 +00:00
Phoomparin Mano
cce25745a7 ci(sdk): skip flaky mantine styles test for sdk (#51404) 2024-12-17 22:40:56 +07:00
Denis Berezin
fd32386973 Migrate dashboard and question actions menus to Mantine (#51229) 2024-12-17 18:36:18 +03:00
Alexander Polyankin
5548e70d57 Avoid frequent setState calls in the add parameter popover in dashboards (#51373) 2024-12-17 10:28:28 -05:00
Alexander Solovyov
ea928cdb2c test to check ms/QueryVectorOf works (#51385) 2024-12-17 16:32:29 +02:00
Raphael Krut-Landau
7bfb4662d1 Add stories for overlays (#49501) 2024-12-17 09:29:10 -05:00
Ngoc Khuat
a238b9310f Send pulse asynchronously with a small pool size (#51380) 2024-12-17 13:38:38 +00:00
Nick Fitzpatrick
f9b87a3f6b adjusting webhook test response ui (#51043)
* adjusting webhook test response ui

* missed i18n, updating test to check for test response

* show response on error, not success

* parse the request as json response

---------

Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2024-12-17 08:52:22 -04:00
Uladzimir Havenchyk
7178d0fba9 deps: upgrade rspack (#51377) 2024-12-17 10:28:33 +00:00
Chris Truter
775feb1aa1 Add prometheus metric for search errors (#51357) 2024-12-17 12:19:14 +02:00
Kamil Mielnik
cc15ee649e Remove the old EntityObjectLoader and clean up (#51208)
* Add EntityObjectLoaderRtkQuery boilerplate

* Incorporate EntityType logic into the new component

* Improve comment

* Add childrenProps

* Move component into its own directory, extract types to a separate file

* Add entityObjectLoaderRtkQuery and temporary mappings

* Hook up the useGetQuery hook (tables only)

* Pass all the props to children

* Add Playground

* Gather more info in the Playground

* Integrate RTK with redux store

* Adjust props passed down

* Improve typing

* Make the request hook dynamic

* Add missing id in the query

* Handle fetchMetadata

* Change requestType to fetchType

* Add rtk mappings for databases in entity framework

* Use requestType to get request state path

* Enable new component everywhere

* Use legacy loader for entities without rtk mappings

* Improve comment

* Handle fetchMetadataAndForeignTables

* Remove unused function

* Handle reload and remove

* Add TODO

* Add transformResponse option and use it for fetchIdFields

* Format code

* Remove Playground

* Remove unused getUseGetListQuery

* Add rtk mapping for alerts

* Add rtk mapping for dashboards

* Add rtk mapping for groups

* Add rtk mapping for pulses

* Remove options

* Fix permissions tests

* Fix notifications tests

* Add rtk mapping for segments

* Use params instead of body
- It's leftover because this code got reverted after body -> params refactoring for GET endpoint has been merged to master

* Add rtk mapping for snippet collections

* Add TODO

* ESLint

* ESLint

* Update TODO

* Deprecate entity HOCs

* Update TODO

* Revert other entities for now

* Revert other entities for now

* Bring tables back

* Improve todos

* Add comment

* Improve comment

* Remove TODO

* Use reload param

* Remove properties prop

This was used to short-circuit and avoid triggering api calls if we already had an object with given attributes in cache.
With RTK query now managing the cache, we don't want to reproduce this behavior.

* Remove reloadInterval

This is used in EntityListLoader, not EntityObjectLoader

* Don't use setRequestPromise action

* Fix deprecations

* Format code

* Fix flake :(

* Try to fix flake

* Revert "Try to fix flake"

This reverts commit 6408a22a37.

* Try to fix flake

* Fix UseQuery type

* Implement useGetMetadataAndForeignTables

* Fix useMemo and move things down

* Fix typo

* Bring back original hack

* Move file

* Enable RTK for alerts

* Undeprecate a test

* Enable RTK for dashboards

* Port Segments to use new EntityObjectLoaderRtkQuery (#50635)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Revert "Enable RTK for pulses"

This reverts commit cabcc7e297.

* Enable RTK for questions

* Revert "Enable RTK for questions"

This reverts commit b9ad637ae0.

* Enable RTK for segments

* [WIP] Port Groups to use new EntityObjectLoaderRtkQuery (#50631)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Fix failing test

* Enable RTK for dashboards

* Port Snippet collections to use new EntityObjectLoaderRtkQuery (#50636)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Revert "Enable RTK for pulses"

This reverts commit cabcc7e297.

* Enable RTK for questions

* Revert "Enable RTK for questions"

This reverts commit b9ad637ae0.

* Enable RTK for segments

* Revert "Enable RTK for segments"

This reverts commit ef65fe78f3.

* Enable RTK for snippet collections

* Fix skipToken passing

* Enable RTK for dashboards

* Port Pulses to use new EntityObjectLoaderRtkQuery (#50633)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Fix hook usage

* Enable RTK for dashboards

* Port Fields to use new EntityObjectLoaderRtkQuery (#50639)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Revert "Enable RTK for pulses"

This reverts commit cabcc7e297.

* Enable RTK for questions

* Revert "Enable RTK for questions"

This reverts commit b9ad637ae0.

* Enable RTK for segments

* Revert "Enable RTK for segments"

This reverts commit ef65fe78f3.

* Enable RTK for snippet collections

* Revert "Enable RTK for snippet collections"

This reverts commit e1439cb28b.

* Enable RTK for fields

* Account for skipToken

* Fix fetchFieldValues

* Optimize hooks

* Format code

* Fix loading state not kicking in during first render

* Rename

* Add comment

* Use consistent reference name for revisions

* Port Questions to use new EntityObjectLoaderRtkQuery (#50634)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Revert "Enable RTK for pulses"

This reverts commit cabcc7e297.

* Enable RTK for questions

* Rename import

* Fix weirdness
- Apparently what makes the difference here is the lack of children render pattern ({childProps => <ComposedComponent {...childProps} />})

* Refactor

* Use isFetching instead of isLoading in EntityObjectLoaderRtkQuery, replace useEffect+useState with useMemo in SavedQuestionLoader

* Change order of HOCs to prevent loading state from redundantly kicking in

* Rename import

* [WIP] Port Persisted Models to use new EntityObjectLoaderRtkQuery (#50853)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Revert "Enable RTK for pulses"

This reverts commit cabcc7e297.

* Enable RTK for questions

* Rename import

* Fix weirdness
- Apparently what makes the difference here is the lack of children render pattern ({childProps => <ComposedComponent {...childProps} />})

* Refactor

* Use isFetching instead of isLoading in EntityObjectLoaderRtkQuery, replace useEffect+useState with useMemo in SavedQuestionLoader

* Change order of HOCs to prevent loading state from redundantly kicking in

* Port persisted models

* Port schemas (#50854)

* Port snippets (#50855)

* Port timelines (#50858)

* Do TODOs

* Port timeline events (#50857)

* Port users (#50866)

* Port Collections to use new EntityObjectLoaderRtkQuery  (#50869)

* Port collections

* Fix imports

* Drop unused params

* Add missing property

* Fix collection not getting loaded

* Replace useCollectionQuery with useGetCollectionQuery

* Remove useCollectionQuery

* Format code

* Skip request on null id

* Revert "Remove useCollectionQuery"

This reverts commit 9b1068e611.

* Revert "Replace useCollectionQuery with useGetCollectionQuery"

This reverts commit 0c5ee660a3.

* Fix test

* Implement EntityName with RTK query

* git merge --squash 50323-port-other-entities

* Use entity getName selector

* Update comment

* Remove BaseEntity

* Improve typing

* git merge --squash 50323-port-other-entities

* Enable RTK for dashboards

* Deprecate the component

* Remove entityObjectLoader usage

* Remove old EntityObjectLoader and replace it with new one

* git merge --squash 51213-entity-loader
2024-12-17 07:48:52 +00:00
Ngoc Khuat
5a52987617 remove translation for slack error (#51375) 2024-12-17 06:29:49 +00:00
Tyler Plude
11f501e810 Make formatter integral? dependent on scale (#50609)
* Fix unexpected rounding in csv & json exports when column multiplier is non integral

* Fixing table unit test

* Adding WIP test

* Adding test case for validating new scaling logic is applied appropriately in exports

* Reverting id-or-name change and adjusting new scaling unit test

* Updating formatting to fix cljfmt in CI

* removing debug def

* Preserving integral behavior if scale is nil
2024-12-16 21:09:18 -08:00
Raphael Krut-Landau
e0a2a322ba Remove some console errors due to prop forwarding (#51358) 2024-12-16 18:30:57 -05:00
Raphael Krut-Landau
19d7f3d58a Deprecate the openNativeEditor helper in favor of the startNewNativeQuestion helper (#51109) 2024-12-16 16:42:19 -05:00
Sloan Sparger
fc85504079 [Cards in Dashboards] Reduce requests made for dashboards (#51084)
* reduce requests made by CollectionBreadcrumbs by using the dashboard on the question

* fix unit tests
2024-12-16 14:13:50 -06:00
github-automation-metabase
ef01a0f9f1 Update Readme version references and published npm version to 0.52.4-nightly (#51365) 2024-12-16 19:14:52 +00:00
Ryan Laurie
08b11e1dfa update release notes utm (#51353) 2024-12-16 12:06:00 -07:00
Braden Shepherdson
4cba79cdf1 [refs] Ignore :idents when comparing queries (#51349)
`query=` logic was returning false negatives when two queries were identical except for their `:ident`s.

This broke Metrics UI, for example, since it makes up a query based on the "old" and "new" metrics, and
compares those queries.

Now `:ident`s are ignored by `query=`, so two queries of the same shape are equal.
2024-12-16 13:26:45 -05:00
Nicolò Pretto
a21280000a simplify font config by not providing sans-serif fallback (#51343) 2024-12-16 19:04:42 +01:00
Phoomparin Mano
601c4f7412 ci(sdk): add package.json to sdk exports block (#51328) 2024-12-16 23:54:58 +07:00
Nick Fitzpatrick
7008d38317 Entity picker improvements (#50527)
* visial changes

* adding filter popover to collections tab

* proper key value

* filtering search results

* remove filtering on search, auto-focus search on modal open

* sweeping e2e adjustments

* Green e2e??

* adjusting unit test

* PR Feedback

* raffi feedback

* fixing shouldShowItem, adding max height

* expect-expect

* more e2e adjustments
2024-12-16 12:30:57 -04:00
Nick Fitzpatrick
e480527e92 PopoverWithRef, plus some other stuff (#49306)
* PopoverWithRef, plus some other stuff

* removing commented code

* I've done terrible things

* cleanup

* adding comments

* lets see what this breaks

* e2e adjustmnet

* removing unused component
2024-12-16 12:28:41 -04:00
Kamil Mielnik
e56e508989 Port EntityName to use RTK Query (#51052)
* Add EntityObjectLoaderRtkQuery boilerplate

* Incorporate EntityType logic into the new component

* Improve comment

* Add childrenProps

* Move component into its own directory, extract types to a separate file

* Add entityObjectLoaderRtkQuery and temporary mappings

* Hook up the useGetQuery hook (tables only)

* Pass all the props to children

* Add Playground

* Gather more info in the Playground

* Integrate RTK with redux store

* Adjust props passed down

* Improve typing

* Make the request hook dynamic

* Add missing id in the query

* Handle fetchMetadata

* Change requestType to fetchType

* Add rtk mappings for databases in entity framework

* Use requestType to get request state path

* Enable new component everywhere

* Use legacy loader for entities without rtk mappings

* Improve comment

* Handle fetchMetadataAndForeignTables

* Remove unused function

* Handle reload and remove

* Add TODO

* Add transformResponse option and use it for fetchIdFields

* Format code

* Remove Playground

* Remove unused getUseGetListQuery

* Add rtk mapping for alerts

* Add rtk mapping for dashboards

* Add rtk mapping for groups

* Add rtk mapping for pulses

* Remove options

* Fix permissions tests

* Fix notifications tests

* Add rtk mapping for segments

* Use params instead of body
- It's leftover because this code got reverted after body -> params refactoring for GET endpoint has been merged to master

* Add rtk mapping for snippet collections

* Add TODO

* ESLint

* ESLint

* Update TODO

* Deprecate entity HOCs

* Update TODO

* Revert other entities for now

* Revert other entities for now

* Bring tables back

* Improve todos

* Add comment

* Improve comment

* Remove TODO

* Use reload param

* Remove properties prop

This was used to short-circuit and avoid triggering api calls if we already had an object with given attributes in cache.
With RTK query now managing the cache, we don't want to reproduce this behavior.

* Remove reloadInterval

This is used in EntityListLoader, not EntityObjectLoader

* Don't use setRequestPromise action

* Fix deprecations

* Format code

* Fix flake :(

* Try to fix flake

* Revert "Try to fix flake"

This reverts commit 6408a22a37.

* Try to fix flake

* Fix UseQuery type

* Implement useGetMetadataAndForeignTables

* Fix useMemo and move things down

* Fix typo

* Bring back original hack

* Move file

* Enable RTK for alerts

* Undeprecate a test

* Enable RTK for dashboards

* Port Segments to use new EntityObjectLoaderRtkQuery (#50635)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Revert "Enable RTK for pulses"

This reverts commit cabcc7e297.

* Enable RTK for questions

* Revert "Enable RTK for questions"

This reverts commit b9ad637ae0.

* Enable RTK for segments

* [WIP] Port Groups to use new EntityObjectLoaderRtkQuery (#50631)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Fix failing test

* Enable RTK for dashboards

* Port Snippet collections to use new EntityObjectLoaderRtkQuery (#50636)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Revert "Enable RTK for pulses"

This reverts commit cabcc7e297.

* Enable RTK for questions

* Revert "Enable RTK for questions"

This reverts commit b9ad637ae0.

* Enable RTK for segments

* Revert "Enable RTK for segments"

This reverts commit ef65fe78f3.

* Enable RTK for snippet collections

* Fix skipToken passing

* Enable RTK for dashboards

* Port Pulses to use new EntityObjectLoaderRtkQuery (#50633)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Fix hook usage

* Enable RTK for dashboards

* Port Fields to use new EntityObjectLoaderRtkQuery (#50639)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Revert "Enable RTK for pulses"

This reverts commit cabcc7e297.

* Enable RTK for questions

* Revert "Enable RTK for questions"

This reverts commit b9ad637ae0.

* Enable RTK for segments

* Revert "Enable RTK for segments"

This reverts commit ef65fe78f3.

* Enable RTK for snippet collections

* Revert "Enable RTK for snippet collections"

This reverts commit e1439cb28b.

* Enable RTK for fields

* Account for skipToken

* Fix fetchFieldValues

* Optimize hooks

* Format code

* Fix loading state not kicking in during first render

* Rename

* Add comment

* Use consistent reference name for revisions

* Port Questions to use new EntityObjectLoaderRtkQuery (#50634)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Revert "Enable RTK for pulses"

This reverts commit cabcc7e297.

* Enable RTK for questions

* Rename import

* Fix weirdness
- Apparently what makes the difference here is the lack of children render pattern ({childProps => <ComposedComponent {...childProps} />})

* Refactor

* Use isFetching instead of isLoading in EntityObjectLoaderRtkQuery, replace useEffect+useState with useMemo in SavedQuestionLoader

* Change order of HOCs to prevent loading state from redundantly kicking in

* Rename import

* [WIP] Port Persisted Models to use new EntityObjectLoaderRtkQuery (#50853)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Revert "Enable RTK for pulses"

This reverts commit cabcc7e297.

* Enable RTK for questions

* Rename import

* Fix weirdness
- Apparently what makes the difference here is the lack of children render pattern ({childProps => <ComposedComponent {...childProps} />})

* Refactor

* Use isFetching instead of isLoading in EntityObjectLoaderRtkQuery, replace useEffect+useState with useMemo in SavedQuestionLoader

* Change order of HOCs to prevent loading state from redundantly kicking in

* Port persisted models

* Port schemas (#50854)

* Port snippets (#50855)

* Port timelines (#50858)

* Do TODOs

* Port timeline events (#50857)

* Port users (#50866)

* Port Collections to use new EntityObjectLoaderRtkQuery  (#50869)

* Port collections

* Fix imports

* Drop unused params

* Add missing property

* Fix collection not getting loaded

* Replace useCollectionQuery with useGetCollectionQuery

* Remove useCollectionQuery

* Format code

* Skip request on null id

* Revert "Remove useCollectionQuery"

This reverts commit 9b1068e611.

* Revert "Replace useCollectionQuery with useGetCollectionQuery"

This reverts commit 0c5ee660a3.

* Fix test

* Implement EntityName with RTK query

* git merge --squash 50323-port-other-entities

* Use entity getName selector

* Update comment

* Remove BaseEntity

* Improve typing

* git merge --squash 50323-port-other-entities

* Enable RTK for dashboards

* Deprecate the component
2024-12-16 23:01:32 +07:00
Kamil Mielnik
38cc13c3d3 Fix actions loading (#51281)
* Fix flaky test

* Fix flake in all tests

* Use useGetActionQuery in ActionExecuteModal

* Remove use-action-query

* Remove Actions.load usage in ActionCreator

* Remove unused initialAction prop

* Remove redundant prop

* Use entityCompatibleQuery

* Update unit tests to account for RTK Query refetching

* Fix unit tests

* Fix unit tests

* Fix unit tests
2024-12-16 23:00:20 +07:00
Kamil Mielnik
bb854dbd50 Upgrade RTK from 2.3.0 to 2.5.0 (#51333) 2024-12-16 22:40:28 +07:00
Ryan Laurie
d619950925 Clean up hasBeenReleased checks (#51308)
* don't check for enterprise release tag anymore

* use oss tag for release channel tagging

* add error catcher

* don't trigger release log from tag job
2024-12-16 08:05:38 -07:00
Uladzimir Havenchyk
0fbb656080 fix(View Details): calculate row after vertical and horizontal scroll (#51302) 2024-12-16 14:56:15 +00:00
Nicolò Pretto
869efcea7a docs(sdk): document the compatibility layer for nextjs (#51173)
* wip nextjs compat docs

* explain how to do manual wrapping

* doocs

* better explanation of the index file

* Apply suggestions from code review

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

* Update docs/embedding/sdk/next-js.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2024-12-16 15:06:05 +01:00
Demetrio
bf6759b08d Add basic auth on druid JDBC driver (#50905) 2024-12-16 14:18:14 +01:00
Nicolò Pretto
86b994e7a5 fix(sdk): wrap InteractiveDashboard with renderOnlyInSdkProvider (#51224) 2024-12-16 14:12:32 +01:00
Oisin Coveney
4bbd4cc2aa fix(sdk): Fix alignment of ColorSelector in SDK Chart Settings (#51000) 2024-12-16 13:01:25 +01:00
Kamil Mielnik
9dbfd5bc08 Remove entity.Loader (#51216)
* Get rid of enitity.Loader in PinnedQuestionLoader

* Set errorIcon

* Get rid of enitity.Loader in TargetClickMappings

* Remove duplication

* Get rid of enitity.Loader in LinkedField

* Convert metabase-lib/v1/metadata/utils/schema.js to TS

* Extract useGetSchemas

* Revert "Extract useGetSchemas"

This reverts commit 2271bd3aa7.

* Mark optional props as optional

* Properly handle skipToken

* Remove Schema.Loader from FieldMappingSelect
- This was added to fix metabase#19451 but seems no longer needed as the repro passes without it
- See 83f4097e87

* Update unit tests to use number as DatabaseId

* Extract DataSourceCrumbs and refactor it to TS

* Extract SourceDatasetBreadcrumbs and refactor it to TS

* Extract SourceQuestionBreadcrumbs and refactor it to TS

* Remove Questions.Loader from SourceQuestionBreadcrumbs

* Drop entity.Loader

* Update unit tests

* Drop checkNotNull usage
2024-12-16 10:15:53 +00:00
Chris Truter
2021f7daec Remove unnecessary transaction around query analysis (#51321) 2024-12-16 10:09:34 +00:00
Oleksandr Yakushev
6e72ffbb53 [ci] Actually test against different JDK versions (#51313) 2024-12-14 15:33:44 -05:00
appleby
da9d62a0e7 Fix distribution drill thru for multi-stage queries (#51247)
* Add missing -test suffix to zoom-in-timeseries test name

* Add missing -test suffix to underlying-records test name

* Fix distribution drill thru for multi-stage queries

Ensure the distribution drill thru is not returned by available-drill-thrus when a user clicks on an aggregation or
breakout column, even if there are additional query stages after the last aggregation / breakout stage.
2024-12-13 23:58:35 +00:00
Oleksandr Yakushev
912ee7b034 Bump c3p0 version (#51188) 2024-12-14 01:55:47 +02:00
Aleksandr Lesnenko
5bc378d9ca fix pie chart incorrect settings memoization (#51305) 2024-12-13 18:49:55 -05:00
Ryan Laurie
0e415e664c Just one Release (#51184)
* only create a single release for each release

* remove dead file

* little bug fixes

* update tests

* add link to metabase cloud in release notes

* remove checksums from release notes
2024-12-13 16:10:42 -07:00
Nathan Voxland
4df1c417a9 Don't compute a different hash key if they only differ on the order of values in a parameter (#51186)
Don't compute a different hash key if they only differ on the order of values in a parameter
2024-12-13 16:08:40 -06:00
Uladzimir Havenchyk
6f8ff73343 chore: cleanup query_builder nad querying folders from unused code (#51274) 2024-12-14 00:44:51 +03:00
Uladzimir Havenchyk
70c6be8670 chore: cleanup of unused styles and components (#51273) 2024-12-14 00:19:26 +03:00
Ryan Laurie
7ab0c413a4 pin to master (#51294) 2024-12-13 20:40:56 +00:00
Nick Fitzpatrick
ed61e82fa4 surface errors in move confirmation modal (#51239)
* surface errors in move confirmation modal

* woops...
2024-12-13 16:40:47 -04:00
appleby
bd36ca40cc Update underlying-records drill to use code in lib.drill-thru.common (#51254)
Some funcs were added to lib.drill-thru.common for the recent fix to the zoom-in.timeseries drill. Update the
underlying-records drill to use the common lib code rather than duplicating it.
2024-12-13 12:22:29 -08:00
Braden Shepherdson
2970dc54d5 [refs] Preserve :idents in replace-clause (#51251)
`replace-clause` is for editing an existing clause, which should
*preserve* its identity. But the new clause was getting its own
random ident which didn't match the original.

I've added tests for this, and fixed the `lib.remove-replace` logic to
make them pass.

Hat tip to Mike for catching this case!
2024-12-13 19:06:41 +00:00
William
24249e76da Implement cumulative aggregators in mongo (#51135)
Previously, cumulative aggregators were being done in clojure after the mongo query was finished.  However, this
didn't work on multi-step queries where the cumulative aggregator wasn't the last step (for example, do a cumulative
sum and then filter the result).  Implementing cumulative operators directly in mongo fixes this issue.
2024-12-13 18:48:22 +00:00
Raphael Krut-Landau
6059f92ca2 Update test to use revert icon (#50956)
We changed the time_history icon in this context to a revert icon in #46050 but never updated this test. This PR fixes that.
2024-12-13 12:58:16 -05:00
Oisin Coveney
4a0c62775f Convert ChartSettingInput to Mantine (#51162) 2024-12-13 18:06:43 +02:00
Oisin Coveney
f768b844c3 Convert ChartSettingsRadio to mantine (#51210) 2024-12-13 18:06:34 +02:00
Oisin Coveney
79817b4f15 Convert ChartSettingToggle to Mantine (#51161) 2024-12-13 18:05:55 +02:00
Aleksandr Lesnenko
b7a030022b prevent backport command from creating backports on open PRs (#51242) 2024-12-13 10:30:29 -05:00
Kyle Doherty
cd650bfd69 Update uberjar.yml to builde feature-visualizer (#51284)
Adds feature-visualizer to the branches for this workflow to help automate deployment to our staging env.
2024-12-13 10:17:09 -05:00
Kamil Mielnik
cd71625a45 npx browserslist@latest --update-db (#51280) 2024-12-13 14:38:58 +00:00
Chris Truter
2d01597302 Use pr-str so log data is parseable (#51275) 2024-12-13 15:12:39 +03:00
Oisin Coveney
afc1963a9b Convert ChartSettingSegmentedControl to Mantine (#50994) 2024-12-13 11:57:20 +02:00
Kamil Mielnik
08771ef685 Fix - Updating a filter via click behavior will not populate the field on actions (#51108)
* Fix #51020

* Add a repro for #51020

* Improve test name

* Update comment and naming

* Improve diff

* Add repro for when primary key is not called 'id'

* Update repro

* Drop prefetchesInitialValues & getValuesForUpdate

It's unclear what the real intention behind these two was, but it's clear that it made two differences:
(1) It decreased the probability of overwriting someone else's changes (if someone else saved them after we opened the form)
(2) It decreases the payload sent over the wire

(1) We can ignore this, as this problem is prevalent everywhere in our app
(2) This is negligible

Dropping these is simpler than enhancing getValuesForUpdate with extra logic for primary keys (and who knows what else)

* Break beforeEach into 2

* Remove no longer valid test
2024-12-13 15:18:15 +07:00
Uladzimir Havenchyk
4882239cd9 chore: rework view components to css modules (#51219)
* chore: rework view components to css modules

* fixup

* fix styling
2024-12-13 11:04:48 +03:00
Aleksandr Lesnenko
6fa8ff4779 Split dashboard PDF exports into pages (#49917)
* save only grid on fixed width dashboards

* split export pdf into pages

* trim dashboard export pdf into pages

* specs

* add padding to pdf pages

* dark mode
2024-12-13 03:53:56 +00:00
dpsutton
db1c4f3741 guard against a stage number in matching (#51262)
* guard against a stage number in matching

old:

`{"category":["dimension",["field",5,{"base-type":"type/Integer"}]]}`

new:

`{"state":["dimension",["field",48,{"base-type":"type/Text"}],{"stage-number":0}]}`

(comment
  (let [login-attributes {"state" "CA"}
        field-ids #{55 46 54 48 50 56 51 47 57 45 53 52 49}
        attribute_remappings {"state" [:dimension
                                       [:field
                                        48
                                        {:base-type :type/Text}]
                                        ;; this stage-number is optional. Newer versions have it since https://github.com/metabase/metabase/issues/46914
                                       {:stage-number 0}]}]
    (into {} (for [[k v] attribute_remappings
                   ;; get attribute that map to fields of the same table
                   :when (contains? field-ids
                                    (lib.util.match/match-one v [:dimension [:field field-id _]] field-id))]
               {k (get login-attributes k)})))
  )

* formatting fix
2024-12-12 20:54:42 -05:00
Alexander Polyankin
321c37ca1c Add e2e tests for if (#51245) 2024-12-13 01:28:51 +00:00
Raphael Krut-Landau
a0d13128dc Use the time_history icon to display when a question was last updated (#50952) 2024-12-12 18:58:11 -05:00
bryan
8c08ebbf3d update tracking for embedding-sdk-react and embedding-iframe x-metabase-clients (#51179)
* skip tracking non react-sdk x-metabase-clients

- Do not do promethus tracking for sdk.
- tracking ignores x-metabase-client headers when they're not == "embedding-sdk-react"

* cleanup indentation

* add prometheus tracking counters for iframe

* remedy 24h query execution inaccuracy
2024-12-12 22:03:32 +00:00
Nathan Voxland
d0137526c8 Allow config files to have literal values enclosed in {{{ ... }}} (#51129)
Allow config files to have literal values enclosed in {{{ ... }}}
2024-12-12 15:09:07 -06:00
John Swanson
f88e47c127 Fix autoplacement when a dashboard has empty tabs (#51180)
We were getting the `dashboard_tab_id` from the existing cards on the
first tab... but if no such card exists (the first tab is empty) then we
end up with a dashboard with tabs, but a card with
`dashboard_tab_id=null`, which doesn't show up.

This also fixes a bug in the revision history: we were publishing an
event for the dashboard being updated. The object was the updated
dashboard, but it had the old dashcards that we'd hydrated in order to
autoplace. We can dissoc the dashcards to ensure that the handler
hydrates them with the fresh, updated dashcards.
2024-12-12 11:51:36 -08:00
Alexander Polyankin
591599bf4e Add in and notIn custom expression functions (#51148) 2024-12-12 14:42:38 -05:00
Ryan Laurie
f5a22e7a3b fix-release-log (#51238) 2024-12-12 12:33:52 -07:00
Hervé Labas
83e55c8dce Update data.md (#51234)
Tiny typo
2024-12-12 18:35:12 +00:00
Phoomparin Mano
f9545b8740 Backport the webpack config from 51171 to master (#51212)
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2024-12-13 00:38:50 +07:00
Jeff Bruemmer
f7c5f1f2f5 note on static embeds (#51181) 2024-12-12 11:32:07 -05:00
Sloan Sparger
fb7ae7d97c [Cards in Dashboards] Fix no items appearing in personal collection (#51140)
* checks if there are dashboards in the personal collection to check if we should show items below

* adding e2e test

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2024-12-12 09:19:11 -06:00
Uladzimir Havenchyk
aae8d818ad chore: rework qb styles of view sidebars to css modules (#51136)
* chore: rework qb styles of view sidebars to css modules

* do not use text

* fix view sidebar styles

* naming

* more css

* more css

* fix color

* rework bucket button override

* rework modal right section content override

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

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

* remove probably unused file

* change order

* pass color properly

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-12-12 18:17:18 +03:00
Sloan Sparger
b1de8b8bfd [Cards in Dashboards] Bug fix - Query builder breaks with DQ in root collection as init value (#51191)
* fixes error cases when initial question picker value is a DQ in a dashboard in the root collection

* fix type issue
2024-12-12 09:01:18 -06:00
Filip Hric
7ab2e5ecff Enable bug reporting (#50856)
* add bug report to command palette and profile menu

add bug report to command palette and profile menu

* refactor and update diagnostic window modal

* add analytics to track bug reporter modal activity

* add file id to to the upload-file method

* add the ability to collect browser information for diagnostic window

* implement feedback from PR comments

* Update frontend/src/metabase/components/ErrorPages/ErrorDiagnosticModal.tsx

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

* implement feedback from PR comments #2

* rename "file a bug" to "report an issue"

* resolve conflict

* fix lint issues

* fix bad merge conflict resolution

* fix failing onboarding tests

---------

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2024-12-12 15:21:08 +01:00
Nick Fitzpatrick
e8ebd956f4 delete old dashcards when moving question from QB view (#51187) 2024-12-12 09:46:18 -04:00
Chris Truter
1200eb2f10 More logging around search index maintenance (#51206) 2024-12-12 13:12:13 +00:00
Jeff Bruemmer
70b4ad81e9 logo link (#51177) 2024-12-12 07:47:21 -05:00
Chris Truter
82f13b6742 Better diagnostic info when Search Index is not ready (#51201) 2024-12-12 11:34:37 +00:00
Nicolò Pretto
528222e7e2 docs(sdk): simpler documentation for building the sdk locally (#51064)
* wip: better documentation for developers that need to run the sdk
locally

* morning fixes

* remove developers-guide/sdk in favor of dev.md in the sdk folder

* add note about using the sdk with link to the docs

* fix mising word

* addressed feedback

* added notes about the envs for sdk e2e test
2024-12-12 11:59:51 +01:00
Nemanja Glumac
62caae9946 Prevent newly opened items from expanding outside viewport (#51008)
* Prevent newly opened items from expanding outside viewport

* Expand the unti test coverage

* Use the existing helper

* Change scroll view to center

This works better because it ensures that the top bar doesn't cover the element.

* Update frontend/src/metabase/home/components/Onboarding/Onboarding.tsx

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

* Extract the `stopVideo` function

* Fix the type name

* Set the top scroll margin on the `main` element

---------

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2024-12-12 11:59:05 +01:00
Romeo Van Snick
a04af019b9 Update nanoid and path-to-regexp (#51198)
* Force nanoid onto 3.3.8

* Force path-to-regexp to 0.1.12
2024-12-12 20:55:39 +11:00
Phoomparin Mano
29b070c07a Manual backport workflow fixes from 51171 (#51196) 2024-12-12 15:56:24 +07:00
Ngoc Khuat
33e50fa799 Change migration added in #50735 from v52 to v53 (#51194) 2024-12-12 08:52:06 +00:00
Ryan Laurie
876eedc92a Make release log updates smarter (#49340)
* make release log updates smarter

* fix a bunch of stuff after testing
2024-12-11 17:18:35 -07:00
Braden Shepherdson
1d8541ca43 [refs] lib.convert preserves :idents through a round trip (#51133)
Closes #49682. Closes #49683.

Updates `lib.convert` and legacy MBQL normalization to allow
`:ident`s, and fixes some QP middleware and utils so they can
still match up refs correctly.

No user-visible impact.

Newly created queries will have `:ident`s generated for joins,
aggregations, etc. by the previous PR. This starts saving them
into appDBs. It is still acceptable to have missing idents at
this stage, including for new queries created without the lib.

Pre-existing clauses don't have refs added yet.


* Fix loading in segments

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2024-12-11 23:29:28 +00:00
Nick Fitzpatrick
53568b2570 removing broken assertion (#51182) 2024-12-11 22:26:01 +00:00
John Swanson
2ed4ad3d7c Lock revisions before adding more (#51158)
Our revision system has a race condition in the case of two concurrent requests to modify the same object. You can reproduce the exact issue here by opening two `psql` shells. In each one, run

```
begin;
insert into revision (model, model_id, user_id, timestamp, object, most_recent, metabase_version) values ('Dashboard', 1, 1, '2024-01-01T00:00:00Z', '{}', true, 'v1.0.0') returning id;
update revision set most_recent = false where model='Dashboard' and model_id = 10 and id != [[the id from above]];
```

after running all of the above, `commit` the transaction and note that **two** revisions are now marked as `most_recent`.

This is the way our revision system works: `t2/before-insert` sets `most_recent=true`, while `t2/after-insert` updates all the *other* revisions with `most_recent=false`.

The issue here is that when each transaction is running, it doesn't see
the uncommitted result of the other transaction (the new revision), so
the UPDATE does not set `most_recent` to `false` for either new
revision.

The solution here is to just select all existing `revision`s for this
model `FOR UPDATE`. This effectively locks the revisions for a single
entity, so we can't concurrently update revisions for the same entity.
2024-12-11 12:06:25 -08:00
Jeff Bruemmer
208deba6e6 docs - if alias (#51168) 2024-12-11 17:48:15 +00:00
Case Nelson
3f629276d8 Quiet snowflake logging (#51138)
It looks like snowflake introduced some very noisy logging in their
code.

9b7c9eb3e0 (diff-7859cac7243b3b9668df0770c96e264a1be2be06eefbbf7bba63904104028495L743)

This should reduce the noise and allow our code to handle and log the
exceptions.
2024-12-11 10:17:06 -07:00
Uladzimir Havenchyk
b06e6e9c34 chore: rework qb template tags to css modules (#51137)
* chore: rework qb template tags to css modules

* more css

* more css

* more css

* fix styles

* nobody uses less bottom padding

* Update frontend/src/metabase/query_builder/components/template_tags/TagEditorParamParts/TagEditorParam.module.css

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

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-12-11 16:03:39 +00:00
Sloan Sparger
e81c4137fc [Cards in Dashboards] Fix bulk move runtime error (#51146)
* fix runtime error caused by bulk moving dashboard questions where one question did not have an existing dashboard

* fix oopsie
2024-12-11 09:53:25 -06:00
Chris Truter
3f367ac9a3 Ignore interpolated expressions in query analysis (#51151) 2024-12-11 15:27:36 +00:00
github-automation-metabase
10986403a0 Add v0.51.8 to the list of releases (#51153)
* Add v0.51.8 to the list of releases

* ordering

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: jeff bruemmer <jeff.bruemmer@gmail.com>
2024-12-11 15:05:06 +00:00
Chris Truter
3b2fdbb676 Basic Search Index support for h2 (#51042) 2024-12-11 14:45:37 +00:00
Ngoc Khuat
9acb577c10 Fix alert condition text (#51117) 2024-12-11 19:46:54 +07:00
Alexander Solovyov
b62505f15b [search] track total search indexing time as prometheus metric (#51095) 2024-12-11 14:38:39 +03:00
Kamil Mielnik
ceacccd0b1 Port all entities to use new EntityObjectLoaderRtkQuery (#50623)
* Add EntityObjectLoaderRtkQuery boilerplate

* Incorporate EntityType logic into the new component

* Improve comment

* Add childrenProps

* Move component into its own directory, extract types to a separate file

* Add entityObjectLoaderRtkQuery and temporary mappings

* Hook up the useGetQuery hook (tables only)

* Pass all the props to children

* Add Playground

* Gather more info in the Playground

* Integrate RTK with redux store

* Adjust props passed down

* Improve typing

* Make the request hook dynamic

* Add missing id in the query

* Handle fetchMetadata

* Change requestType to fetchType

* Add rtk mappings for databases in entity framework

* Use requestType to get request state path

* Enable new component everywhere

* Use legacy loader for entities without rtk mappings

* Improve comment

* Handle fetchMetadataAndForeignTables

* Remove unused function

* Handle reload and remove

* Add TODO

* Add transformResponse option and use it for fetchIdFields

* Format code

* Remove Playground

* Remove unused getUseGetListQuery

* Add rtk mapping for alerts

* Add rtk mapping for dashboards

* Add rtk mapping for groups

* Add rtk mapping for pulses

* Remove options

* Fix permissions tests

* Fix notifications tests

* Add rtk mapping for segments

* Use params instead of body
- It's leftover because this code got reverted after body -> params refactoring for GET endpoint has been merged to master

* Add rtk mapping for snippet collections

* Add TODO

* ESLint

* ESLint

* Update TODO

* Deprecate entity HOCs

* Update TODO

* Revert other entities for now

* Revert other entities for now

* Bring tables back

* Improve todos

* Add comment

* Improve comment

* Remove TODO

* Use reload param

* Remove properties prop

This was used to short-circuit and avoid triggering api calls if we already had an object with given attributes in cache.
With RTK query now managing the cache, we don't want to reproduce this behavior.

* Remove reloadInterval

This is used in EntityListLoader, not EntityObjectLoader

* Don't use setRequestPromise action

* Fix deprecations

* Format code

* Fix flake :(

* Try to fix flake

* Revert "Try to fix flake"

This reverts commit 6408a22a37.

* Try to fix flake

* Fix UseQuery type

* Implement useGetMetadataAndForeignTables

* Fix useMemo and move things down

* Fix typo

* Bring back original hack

* Move file

* Enable RTK for alerts

* Undeprecate a test

* Enable RTK for dashboards

* Port Segments to use new EntityObjectLoaderRtkQuery (#50635)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Revert "Enable RTK for pulses"

This reverts commit cabcc7e297.

* Enable RTK for questions

* Revert "Enable RTK for questions"

This reverts commit b9ad637ae0.

* Enable RTK for segments

* [WIP] Port Groups to use new EntityObjectLoaderRtkQuery (#50631)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Fix failing test

* Enable RTK for dashboards

* Port Snippet collections to use new EntityObjectLoaderRtkQuery (#50636)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Revert "Enable RTK for pulses"

This reverts commit cabcc7e297.

* Enable RTK for questions

* Revert "Enable RTK for questions"

This reverts commit b9ad637ae0.

* Enable RTK for segments

* Revert "Enable RTK for segments"

This reverts commit ef65fe78f3.

* Enable RTK for snippet collections

* Fix skipToken passing

* Enable RTK for dashboards

* Port Pulses to use new EntityObjectLoaderRtkQuery (#50633)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Fix hook usage

* Enable RTK for dashboards

* Port Fields to use new EntityObjectLoaderRtkQuery (#50639)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Revert "Enable RTK for pulses"

This reverts commit cabcc7e297.

* Enable RTK for questions

* Revert "Enable RTK for questions"

This reverts commit b9ad637ae0.

* Enable RTK for segments

* Revert "Enable RTK for segments"

This reverts commit ef65fe78f3.

* Enable RTK for snippet collections

* Revert "Enable RTK for snippet collections"

This reverts commit e1439cb28b.

* Enable RTK for fields

* Account for skipToken

* Fix fetchFieldValues

* Optimize hooks

* Format code

* Fix loading state not kicking in during first render

* Rename

* Add comment

* Use consistent reference name for revisions

* Port Questions to use new EntityObjectLoaderRtkQuery (#50634)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Revert "Enable RTK for pulses"

This reverts commit cabcc7e297.

* Enable RTK for questions

* Rename import

* Fix weirdness
- Apparently what makes the difference here is the lack of children render pattern ({childProps => <ComposedComponent {...childProps} />})

* Refactor

* Use isFetching instead of isLoading in EntityObjectLoaderRtkQuery, replace useEffect+useState with useMemo in SavedQuestionLoader

* Change order of HOCs to prevent loading state from redundantly kicking in

* Rename import

* [WIP] Port Persisted Models to use new EntityObjectLoaderRtkQuery (#50853)

* Revert "Enable RTK for dashboards"

This reverts commit dd74f51b63.

* Enable RTK for groups

* Revert "Enable RTK for groups"

This reverts commit bbf6954cfa.

* Enable RTK for pulses

* Revert "Enable RTK for pulses"

This reverts commit cabcc7e297.

* Enable RTK for questions

* Rename import

* Fix weirdness
- Apparently what makes the difference here is the lack of children render pattern ({childProps => <ComposedComponent {...childProps} />})

* Refactor

* Use isFetching instead of isLoading in EntityObjectLoaderRtkQuery, replace useEffect+useState with useMemo in SavedQuestionLoader

* Change order of HOCs to prevent loading state from redundantly kicking in

* Port persisted models

* Port schemas (#50854)

* Port snippets (#50855)

* Port timelines (#50858)

* Do TODOs

* Port timeline events (#50857)

* Port users (#50866)

* Port Collections to use new EntityObjectLoaderRtkQuery  (#50869)

* Port collections

* Fix imports

* Drop unused params

* Add missing property

* Fix collection not getting loaded

* Replace useCollectionQuery with useGetCollectionQuery

* Remove useCollectionQuery

* Format code

* Skip request on null id

* Revert "Remove useCollectionQuery"

This reverts commit 9b1068e611.

* Revert "Replace useCollectionQuery with useGetCollectionQuery"

This reverts commit 0c5ee660a3.

* Fix test

* Extract dedicated providePermissionsGroupListQueryTags

* Format code

* Fix test setup
2024-12-11 09:50:10 +00:00
Kamil Mielnik
ce49352589 Remove EntityLink (#51044)
* Get rid of Database.Link usage in TableBrowser

* Fix browseDatabase typing

* Get rid of Collection.Link usage in DashboardMoveModal

* Get rid of Collection.Link usage in QuestionMoveToast

* Style links consistently

* Remove EntityLink

* Use database from the store if it's already there

* Remove filter

* Fix typo

* Use ts-pattern

* Bring spacing back

* Extract components for links

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2024-12-11 16:10:27 +07:00
Sloan Sparger
219ca91f6d Questions in Dashboards Milestone 1 (#47784)
* BE: Dashboard Questions

Setting this makes the card a "dashboard internal card" that should only
be used within a single dashboard, is moved along with the dashboard, etc.

prevent invalid inserts/updates

POST /api/card for dashboard internal cards

GET /api/collection/:id/items

Search

PUT /api/card/:id

WIP: last bits of card-in-dashboard API

Sticking point here is the copy, I think I need to do a small refactor
to make the code less hairy.

rm line

optionally show DQs for collection items

copying dashboards 🎉

wip

quick fix

Disallow moving dashboard questions & test archive

remove unused columns

fix argument order 🤦

serdes for dashboard questions

serialization baseline tests

Fix tests in `metabase.models.card`

Fix download exports test

Lint migrations file

cljfmt

cljfmt, again

the cljfmt job in CI doesn't run on this branch, it runs on the PR
branch merged with `origin/master` - which is nice, because it catches
cljfmt issues that would happen if you merged, but don't happen on your
branch, but also confusing, because it catches issues like
"metabase.api.common is never used", and then you stare at the file for
a while like "YES IT IS" before realizing what's going on.

migration to add idx for report_card.dashboard_id

don't rollback the `report_card.dashboard_id` bits

a couple missed API changes

- no DQs w/o DashboardCards in search

- no DQs in autocomplete

- fix check for "currently a dashboard question" in card validation

Fix some comments, clean up some existing code

Before, `cards-to-copy` returned just two lists of cards: those to
discard (no permissions) and those to copy. But `maybe-duplicate-cards!`
had some extra logic: if the card was a `model`, don't copy it, just
reference it.

I modified `cards-to-copy` to return three lists instead: cards to copy,
cards to discard, *and* cards to reference. This was initially just used
for making sure we copy Dashboard Questions instead of referencing them
- but I realized we could use the same for Models as well. I moved the
logic for models to `cards-to-copy` instead: if the card is a Model,
return it in the `reference` list instead of the `copy` list.

Fix commented-out test

cljfmt

Optionally include dashboard questions in search

Add a test for failing card name change

Opt. include dashboard questions for autocomplete

Update src/metabase/api/dashboard.clj

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

PR review response

lint migrations

quick impl of dashboard items

copied from collection items. should be firmed up for real going
forward. notable divergences:
- i'm not doing any limit/offset in the query
- i'm not including limit/offset in the response
- no reuse. just grabbed it to unblock nick

```
❯ http get "localhost:3000/api/dashboard/22/items" x-api-key:$API_KEY -pb
{
    "data": [
        {
            "archived": false,
            "archived_directly": false,
            "collection_id": 20,
            "collection_position": null,
            "collection_preview": true,
            "database_id": 48,
            "dataset_query": {
                "database": 48,
                "query": {
                    "source-table": 360
                },
                "type": "query"
            },
            "description": null,
            "display": "table",
            "entity_id": "_TmF-T7m_bBVxV_jfaNtM",
            "id": 192,
            "last-edit-info": {
                "email": "dan@metabase.com",
                "first_name": "dan",
                "id": 1,
                "last_name": "sutton",
                "timestamp": "2024-09-13T22:13:30.220311Z"
            },
            "last_used_at": "2024-10-01T17:48:36.128915Z",
            "model": "card",
            "moderated_status": null,
            "name": "Cynthia Example"
        }
    ],
    "models": [
        "card"
    ],
    "total": 1
}
```

contrast with collection items:

```
❯ http get "localhost:3000/api/collection/root/items?models=card&limit=1" x-api-key:$API_KEY -pb
{
    "data": [
        {
            "archived": false,
            "can_delete": false,
            "can_restore": false,
            "can_write": true,
            "collection_id": null,
            "collection_position": null,
            "collection_preview": true,
            "database_id": 4,
            "description": null,
            "display": "table",
            "entity_id": "e_jABu05u9nT9ocgfQWfZ",
            "fully_parameterized": true,
            "id": 143,
            "last-edit-info": {
                "email": "dan@metabase.com",
                "first_name": "dan",
                "id": 1,
                "last_name": "sutton",
                "timestamp": "2024-08-27T14:11:15.214254Z"
            },
            "last_used_at": "2024-08-27T14:11:27.138735Z",
            "location": null,
            "model": "card",
            "moderated_status": null,
            "name": "Collection + query on sleep question"
        }
    ],
    "limit": 1,
    "models": [
        "card"
    ],
    "offset": 0,
    "total": 13
}
```

Clean up last-edit-info and exclude archived cards

before: over-selecting, copy-paste function to clean it up.
after: reuse (bulk-aware) query that annotates with last-edit-info, ALSO
EXCLUDE CARDS

also condensed query a bit. was each field on a separate line for no
real reason.

`location` on dashboards

dashcards are still active for archived DQs

WIP: autoplace dashcards for dashboard cards

more wip for autoplacement

WIP for moving DQs

more WIP on moving DQs/autoplacement

delete old dashcards when moving to new dashboard

populate `here` on dashboards in coll items

reject moving card if in another dashboard

fix silly typo

allow optionally deleting old dashcards on move

WIP

add dashboard details to recents

untested wip

fix auto delete of old dashcards for move

Add another test for DQs getting unarchived

Fix dashboard details on recents, with a test

Archive and unarchive DQs when used/unused

including in revisions

Handle reversions containing unowned DQs

lint

Tests and fixes for dashboard items endpoint

remove stray #p

fix a test

Add more tests for DQs/reversions

Fix/update tests for updating DQs

Don't revert to dashcards with archived cards

This is the existing behavior, we should keep it.

lint

small fixes for recents tests

add more tests

Autoplace Dashboard Questions on creation

Improve autoplace to be like frontend

I'd hacked together something - this actually makes autoplacement work
the same way on the frontend and backend.

fix a couple tests

`delete_old_dashboards` as a query param

Fix autoplace for tabbed dashboards

and add a test

do not autoplace DQs when duplicating a dashboard

This was resulting in us accidentally creating two dashcards for a
duplicated DQ.

add effective location to collections on dash

add dashboard_count to (card) collection items

autoplace on unarchive, better error messages

Exclude DQs from dashboard if archived directly

DOH

workaround a bug with "changing" a type

Fix bug causing dashboard cards to be removed

small refactor autoplacing / removing dashcards

Create Dashboard revisions on autoplace/remove

When we modify Dashboard Questions, we autoplace or autoremove relevant
cards from the Dashboards involved. For example, we remove DashCards
from the old dashboard if we're moving to a new dashboard, and we
autoplace DashCards into the new dashboard.

When we do this, publish an event that the dashboard itself has changed.
This updates the revision history for the dashboard so that you can
revert correctly.

Note that when using the revision history, DQs will automatically be
archived or unarchived as necessary. So e.g. if you manually archive a
DQ, then go to the Dashboard and revert, the DQ will be auto-unarchived.
If you go to the dashboard and remove all cards for a DQ, the DQ will be
archived - if you then manually unarchive it, it'll be autoplaced on its
dashboard again.

Fix bug on card modification

The conditions here were wrong. Say you had a card on dashboard 1 that
was archived. If you specified `{:dashboard_id 1 :archived false}`, it
would be correctly autoplaced on the dashboard. But if you just
specified `{:archived false}`, the "new dashboard ID" is nil.

The logic here is pretty painful, because to figure out the resulting
value for something like `dashboard_id` we can't just get it from the
old version or the changes. Instead, we need to:

- check to see whether it's changing, then

- if it changed, use the version from the update, otherwise

- use the old version

The same is true for `archived`.

After we figure out the old dashboard_id, new dashboard_id, and whether
the card will end up archived or not, we can actually do the checks we
need:

- if we're ending up an unarchived card on a dashboard, autoplace

- if we're moving from one dashboard to another, or moving from a
dashboard to a collection (and the user told us to), auto-remove

offset/limits for dashboard items

Reuse some code between dashboard/collection items

Fix some failing tests in api.dashboard

I was getting stack overflow errors when running these tests. I followed
along with the demonstartion
[here](https://github.com/metabase/metabase/pull/43496) to fix.

cljfmt

add additional tests

Always delete dashcards when archiving a DQ

If we're archiving a DQ, let's delete the dashcards so this appears in
the revision history.

publish revision when autoplacing

Publish dashboard events when cards are autoplaced

new endpoint to get dashboards a card is in

allow moving to a dashboard deleting old dashcards

fix the migrations 😭

fix migration IDs

* work on dedicated dashboard question page

* wip on dashboard page for handling dashboard questions

* hacking linking to dashboard for question and books marks - does not handle navigating to the correct tab yet

* make it easier to change the dashboard_id for hacking

* misc. changes

* action menu and dashbcard action updates

* enables trashing dashboard questions from the dashboard view, enables undoing of that case, updates archive state for dedicated dashboard question page

* wip - mostly done creation flow

* wip

* add question directly on dashboard flow

* significant clean up of fe code, revert some wierd differences between base branch, allows selecting dashboard when duplicating a question

* type fixes

* clean up isDashboardQuestion checks, fixes bug where save question form name and description state would get cleared after selecting a dashboard from the picker, fixed bug where editing a dashboard question and choosing save as new question would only let you save it to the dashboard the original question was on

* implement bulk of team feedback

This commit accomplishes the following things:
- Updates copy of the dashboard/collection picker
- Fixes the tooltip copy for the add question button in the edit dashboard view
- Removes the ability to trash a dashboard question + dashboard view removes rather than trashes the question
- Adds option in dashboard edit view to add a native or notebook question

* prompt to save rather than discard changes when leaving a dashboard while editing to create a new question

* include dashboard questions in search results

* fix lint & kick CI

* type fixes

* fix unit tests

* two small fixes

* wip on failing e2e tests

* bulk e2e test fix

* fixed most tests worth fixing - leaving the ones that need to be replaced

* Dashboard Question as a source

* replace dashcard flow

* starting to update collection picker to treat dashboards as folders

* fix spelling mistake

* fix bad resolution and stop double adding newly created dashboard questions to their dashboards

* allow dashboards in collection picker

* remove checkbox to only clone dashboard w/o cards, fix collection id calculation for saving a question when defaults to a dashboard

* rough pass at allowing questions to be moved to, from, and between dashboards

* building state path with initial value as a dashboard

* simplify moving code and fix encountering BE error

* add confirm modals when moving a dashboard question to a collection or another dashboard, allow users to keep or remove dashcards for a dashboard question getting moved to a collection

* improve the breadcrumbs data consistency, fix bug in moving logic and dump user in edit state of dashboard when moving from collection to dashboard

* dynamic select button text

* Search showing available models

* hopefully this resolves some type sadness

* handle inconsistent state issues between latest question and query builder internal state

* default question picker to showing dashboards as folders

* silly type things

* disallow saving metrics | models | events to dashboards, added back ability to keep or remove dashboard ca
rds when moving a DQ to a collection, fixed dedicated DQ page not appearing archived after archiving the parent dashboard

* use currentData instead of data for collection breadcrumbs

* dashboards are not folders when they are empty

* fix moving question to Our Analytics, Update sidesheet question into for DQs, always allowed to select a dashboard for moving question

* confirm moving questions into dashboards

* trying to sort out types

* types are still a mess

* only regular questions can be moved into a dashboard

* adjusting some unit tests

* add e2e tests for dashboard questions

* should have happy linter and unit tests

* fix some type errors

* loading state

* e2e test fixes

* more fixed tests

* loading state message

* filter series options, fix create new collection logic

* fix some more e2e tests

* e2e test adjustments

* even more e2e tests fixes

* fix named export

* more e2e test fixes

* fixing some e2e stuff

* hopefully final e2e adjustments

* last failing e2e (for now)

* More BE: Dashboard Questions

add dashboard question dimension to stats

Handle series correctly

and test for them

Don't restore archived-directly questions

* unit test adjustments, linter changes

* obey the linter

* unit tests for new breadcumb functionality

* allow creating a question directly to a dashboard

* More BE: Dashboard Questions

use dashboard constants for default size

add missing sql clause

add dummmy alias to subquery

* more cards in dashboards e2e tests

* rebase whoopsie

* more tests

* fix types

* More BE: Dashboard Questions

include dashboard info on coll items & cards

include dashboard info in search

also modify the moderation info a bit, now all three endpoints return
the same shape for `dashboard` (if present):

```
{:id dashboard-id
 :name dashboard-name
 :moderation_status moderation-status-if-present}
```

Bulk endpoints for checking dashboards and moving

For now the move endpoint just runs everything in a transaction and
spits out an error if anything failed. I'd like to take more time to
think of the exact shape of the result we want in the case of an error,
even though I think ideally we should allow partial success.

* reproduce card-pocalypse

* adding dashboard link to search results

* more trash tests

* lint fixes

* fix crash when archiving dashboard with virtual cards

* add loading state to archive modal

* obey the clojure linter

* More BE: Dashboard Questions

cljfmt and fix tests

small test fix

* more e2e tests

* embedding tests

* type fix

* More BE: Dashboard Questions

two more small test fixes

more test fixes

* add sdk tests

* another test

* add series removal e2e test

* More BE: Dashboard Questions

yet another test 😭

work around old MariaDB limitations

* permission check and confirmation modal when moving cards into dashboards

* e2e adjustments

* add some missing tests

* prettier + rebase fixes

* fix search result bug

* Entity syncing when moving a question from a collection to a dashboard

* hello rebase hades

* gree dashboard-questions suite

* fix more e2e tests

* happy little test fixes

* Sloan Feedback

* fix move modal error swallowing

* fix embedding test

* fixes breadcrumbs for embedding, fixes associated failing tests, and updates some tests to account for reduction in # of requests

* fix embedding e2e tests

* Bryan's review response

* fix usage of `offset-paging`

* fix request count errors

* fix unit test

* finish feedback from FE code review

* CR response for Noah

* bad sloan

* no need for dashboards in ad hoc

* get the dash name from the question object

* fix migrations again

* fix test + kondo

* lint fix

---------

Co-authored-by: John Swanson <john.swanson@metabase.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2024-12-10 13:51:37 -06:00
Braden Shepherdson
1770e0d228 Revert "[refs] lib.convert preserves :idents through a round trip (#50085)" (#51128)
This reverts commit 7c6b8bee37, #50085.
2024-12-10 19:41:23 +00:00
Nemanja Glumac
0cecef1c38 Dismissible "How to use Metabase" sidebar link (#50536)
* Add new user-level setting

* Add selector

* Make link dismissible from the sidebar

* Transfer the onboarding link to the main "gear" menu

* Add E2E test to cover the link dismissal behavior

* Add tests for the settings menu link

* Fix tests

* Provide useful comment in the e2e test

* Provide contextual explanations to translators
2024-12-10 19:36:50 +00:00
Jeff Bruemmer
4a47bd20f0 docs - api update (#51124)
* api docs

* intro
2024-12-10 18:55:26 +00:00
bryan
600e4aec03 Count and Categorize Public Views in query executions table (#51079)
* We need to look at the context field to categorize public views

* pull poll-unil into util ns

* fix comment typo

* add test

* update docstring

* remove true? call, it will return `true` on pass

* improve poll-until
2024-12-10 18:25:51 +00:00
Alexander Polyankin
c9b18c5fc6 Migrate legacy exclude date filters on read (#51014) 2024-12-10 17:33:04 +00:00
Uladzimir Havenchyk
d95746367e chore: rework qb expressions to css modules (#50864)
* chore: rework qb expressions to css modules

* use correct code for syntax

* use box instead of text

* replace text with box

* cleanup ts

* cleanup

* fix styles

* fix lint

* fix colors

* fix styles
2024-12-10 20:25:50 +03:00
appleby
1f8b62c4ea Fix the zoom-in.timeseries drill for multi-stage queries (#50970)
* Fix the zoom-in.timeseries drill for multi-stage queries

If no dimensions are provided to the zoom-in.timeseries drill, then attempt to find the matching dimension from the FE-provided row data instead, if present.

Related to https://github.com/metabase/metabase/issues/46932

* Only return zoom-in.timeseries drills for clicks on aggregated columns
2024-12-10 08:22:09 -08:00
Raphael Krut-Landau
6d4ea59746 Use Mantine's Portal not BodyComponent (#49494)
This PR removes the deprecated `BodyComponent` HOC in favor of Mantine's `Portal` component. This helps pave the way for https://github.com/metabase/metabase/pull/49442

### How to verify

1. Perform an action that triggers an undo toast (e.g., move a question into the trash)
2. Verify the undo toast appears correctly at the bottom of the screen
3. In a collection, drag and drop items to verify the drag preview renders correctly

### Testing

This change is covered by the following tests:
* `collections.cy.spec.js > "should be able to drag an item to the root collection (metabase#16498)"`
* `collection-pinned-overview.cy.spec.js:269: "should be able to pin a visualization by dragging it up"`

Note the following comment, however, which mentions the limitations of our drag-n-drop e2e tests:

(from https://github.com/metabase/metabase/blob/92d6150/e2e/test/scenarios/collections/collection-pinned-overview.cy.spec.js#L282-L289)
```
    // this test can give us some degree of confidence, but its effectiveness is limited
    // because we are manually firing events on the correct elements. It doesn't seem that there's
    // a way to actually simulate the raw user interaction of dragging a certain distance in cypress.
    // this will not guarantee that the drag and drop functionality will work in the real world, e.g
    // when our various drag + drop libraries start interfering with events on one another.
    // for example, this test would not have caught https://github.com/metabase/metabase/issues/30614
    // even libraries like https://github.com/dmtrKovalenko/cypress-real-events rely on firing events
    // on specific elements rather than truly simulating mouse movements across the screen
```
2024-12-10 11:12:32 -05:00
Alexander Polyankin
5607cb71c0 Move default filter parts to MBQL lib (#50957) 2024-12-10 16:08:11 +00:00
Jeff Bruemmer
99a1cdb660 docs - locale params (#51001)
* locale params

* formatting

* note on UI vs content

* interactive embedding

* language update

* plans blockquote

* asterisk
2024-12-10 10:58:35 -05:00
Alexander Polyankin
ebb3f14c39 Add :if as an alias to :case in the expression editor (#50702) 2024-12-10 15:15:21 +00:00
Braden Shepherdson
7c6b8bee37 [refs] lib.convert preserves :idents through a round trip (#50085)
Closes #49682. Closes #49683.

Updates `lib.convert` and legacy MBQL normalization to allow
`:ident`s, and fixes some QP middleware and utils so they can
still match up refs correctly.

No user-visible impact.

Newly created queries will have `:ident`s generated for joins,
aggregations, etc. by the previous query, and this will start
saving them into appDBs.

Pre-existing clauses don't have refs added yet.

* Fix loading in segments

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2024-12-10 15:04:21 +00:00
Roman Abdulmanov
41c73023b6 Add 52 as the release branch (#51113) 2024-12-10 18:50:22 +04:00
Alexander Polyankin
ad25f3c0eb Add :if mbql sugar function (#51069)
* Desugar if

* Add if to MBQL lib

* Add if to MBQL lib

* Add if to MBQL lib
2024-12-10 09:43:31 -05:00
Uladzimir Havenchyk
130f406b4f chore: migrate ViewHeader components to css modules (#50907)
* chore: migrate ViewHeader components to css modules

* fix typecheck

* cleanup styles

* more css

* fix styles

* more css

* more css

* fix css specificity

* fixup
2024-12-10 17:31:37 +03:00
Uladzimir Havenchyk
10f52f57ef chore: rework qb DatasetEditor styles to css modules (#50909)
* chore: rework qb DatasetEditor styles to css modules

* fix color

* fixup

* fix styles

* fix styles
2024-12-10 14:28:48 +00:00
Alexander Polyankin
ccd6b59b34 Do not match inner clauses with -filter-parts (#51089) 2024-12-10 08:43:37 -05:00
Chris Truter
faf82bd8d5 Track which search models are affected by deletes (#51096)
For now, we've decided not to trigger index updates when elements are deleted, due to the overhead that toucan2 would add.

We have the code to calculate what *should* be done, so we might as well keep it around in a test that documents these relationships. 

It's good to be mindful of the implications, and we could even use this information to do manual calls from the relevant deletion call sites.
2024-12-10 15:32:11 +02:00
Nemanja Glumac
cb71e0e908 Fix the "invite" screenshot (#51098) 2024-12-10 14:20:44 +01:00
Oisin Coveney
b88e7431b6 feat(sdk): Modify Interactive Question Layout (#50152) 2024-12-10 14:27:47 +02:00
Ngoc Khuat
0c4d8284b0 [Notification] insert and replace instead of truncate (#50735) 2024-12-10 12:14:35 +00:00
lbrdnk
a96a840c78 Avoid logging stacktrace in streaming (#51053)
* Avoid logging trace

* Demote log to warning
2024-12-10 09:59:56 +00:00
Uladzimir Havenchyk
84f6a327fa chore: rework dataref styles to css modules (#50911)
* chore: rework dataref to css modules

* fix pane

* fix styles

* fixup

* fix styles

* fix styles

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

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

* rename questionid to NodeListItemId

* fix color

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-12-10 12:47:13 +03:00
Kamil Mielnik
4904ae048f Replace Actions API handlers in entities with RTK Query (#50936)
* Add list/create/update/delete to actions api

* Add api mappings in entity framework

* Port actions to RTK

* Remove old api mappings

* Fix a test

* Fix test

* Fix test

* Fix test

* Fix method

* Fix types

* Define request types

* Remove ActionsApi.create

* Fix deleting actions

* Fix invalidation

* Fix invalidation

* Remove redundant spreads

* Remove type attribute from UpdateActionRequest
2024-12-10 09:04:48 +00:00
github-automation-metabase
115d77dfbe Add v0.52.2 to the list of releases (#51085)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-12-09 19:33:05 -05:00
Jeff Bruemmer
a1aff9440f note on public links (#51081) 2024-12-09 17:15:04 -05:00
Jeff Bruemmer
f3edd784f0 docs - generate config file (#44444) 2024-12-09 20:37:12 +00:00
Phoomparin Mano
c40657ff3a feat(sdk): use metabase type prefix and re-export types (#50862) 2024-12-10 02:33:15 +07:00
Nathan Voxland
110079b65b If multiple limit or offset arguments are passed, only use the 1st one (#50964)
If multiple limit or offset arguments are passed, only use the 1st one
2024-12-09 13:25:30 -06:00
Phoomparin Mano
fba8aab8ac feat(sdk): combine title props in interactive question (#50660) 2024-12-10 01:23:30 +07:00
William
f256f2d2eb Nested joins ignore temporal units (#50962)
The underlying issue is that nest-query/nest-expression included temporal units when copying over joined fields into the nested query. This caused both the nested query and the parent query to include the "extract the unit from the date" code. In cases where the extraction didn't change the type, this duplication wasn't a big deal. However, for temporal units like hour-of-day, the first extraction changed the type of the field from date to string, and then the second extraction broke.  This change ensures that the inner query doesn't try to extract temporal units, which should avoid the duplicate extractions.
2024-12-09 18:15:08 +00:00
Phoomparin Mano
9f3e0bc68a feat(sdk): move non-auth config options to provider (#50585)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-12-10 00:44:43 +07:00
Phoomparin Mano
5313e018e8 feat(sdk): support sql parameters in interactive questions (#50728) 2024-12-09 23:43:19 +07:00
Nicolò Pretto
c0eab4452e feat(sdk): next sdk compatibility layer (#50230)
* wip next sdk compat

* better code generation, dts works

* Last line of file should end in a newline character

* feat(sdk): make MetabaseProvider not break ssr

* aUpdate enterprise/frontend/src/embedding-sdk/package.template.json

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

* address pr comments

* refactor(sdk): use relative paths when fixing d.ts files

* make types work on moduleResolution: node

* add loading text

* fix(sdk): #50736 make sure we don't break the host app if a sdk
component is rendered outside of the provider for a render

* fix: this should make types work for real?

* self review fixes

* update test for PublicComponentWrapper

* Update enterprise/frontend/src/embedding-sdk/components/private/PublicComponentWrapper/PublicComponentWrapper.tsx

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

* remove unused component

* eslint-disable-next-line for MetabaseProvider

* list tsx as dependency

* /next -> /nextjs

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2024-12-09 17:12:27 +01:00
Nicolò Pretto
179554e564 feat(sdk): detect if session.id is not a string (#50890)
* feat(sdk): detect if session.id is not a string

* use yup, also validate exp as we use it
2024-12-09 16:27:37 +01:00
Phoomparin Mano
dbd60f5c47 feat(sdk): use public-facing question type in event handlers (#50867)
* introduce public metabase question type

* revise internal question type

* update stories

* use public question type in dashboard card plugins

* add tests for transforming question properties

* add tests for question description

* re-export the MetabaseQuestion type

* fix lint imports

* change publicQuestion to sdkQuestion

* name cannot be null if the card is present
2024-12-09 18:21:10 +07:00
Oisin Coveney
59c5690bd6 Add story for QuestionSettings (#50998) 2024-12-09 08:22:44 +00:00
Mahatthana (Kelvin) Nomsawadi
5197e318d7 Fix embed loader not translated with #locale (#50841)
* Fix embed loader not translated with #locale

* Fix unit tests

* Add E2E tests

* Fix a case where the lcoale is failed to load

* Simplify conditions in `LocaleProvider`

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

* Make E2E tests faster

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

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
2024-12-09 01:50:41 +00:00
Mahatthana (Kelvin) Nomsawadi
fbe206dfba Make Loki's embedding scroll stories more resilient (#50991) 2024-12-09 01:50:29 +00:00
Oleksandr Yakushev
168bd09275 Bump Malli version (#51022) 2024-12-08 22:17:50 +02:00
Cam Saul
41b212a654 [Backend modularization] metabase.server.core and metabase.request.core API namespaces; update Kondo (#50839)
* WIP

* metabase.request.cookies namespace

* Server API namespace

* `metabase.server` => `metabase.server.instance`

* Reformat code

* Revert indentation changes

* Unrevert comment

* Oops delete moved file

* Don't be lazy CAM!!!

* Add TODO

* Please cljfmt

* Bump Kondo version to fix metadata ignores in namespaces being ignored

* Update Kondo and enable a few more linters

* Update Clojure linux install script location

* Ok so apparently the old URL does work

* Make sure things live in the right places

* Why do I always have to clean up other people's messes

* Fix formatting

* People need to knocc it off with writing slow tests

* Fix another test that took 45 SECONDS

* Fix Kondo warning
2024-12-07 09:35:13 +00:00
Case Nelson
b2fade6394 feat: Introduce describe-indexes (#49982)
* feat: Introduce describe-indexes

Fixes: #49981

Introduce a faster sync with describe-indexes that follows describe-fields
and describe-fks to allow for a database wide sync step rather per table
describe-table-indexes.

Implement for psotgres

* Fix formatting

* Add tests

* Update src/metabase/driver.clj

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

* Update src/metabase/driver.clj

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

* Address PR review

* Fix null schema check

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2024-12-06 21:31:36 +00:00
metamben
8f93e5550d Support FE display functions for during function (#50965)
* Support FE display functions for during function

Fixes #50942
2024-12-06 21:00:47 +00:00
Ryan Laurie
c3c2e8ee18 pin webhook tester to v1 (#51007) 2024-12-06 12:34:39 -07:00
Aleksandr Lesnenko
b03d6f7e2b Fix missing tooltip on waterfall total bar (#50917)
* fix scatter chart tooltip shows irrelevant info

* remove outdated spec as we always show the tooltip_column setting

* fix missing tooltip on the total bar on waterfall charts
2024-12-06 12:40:14 -05:00
Alexander Polyankin
da0397c091 Move specific date filter parts to MBQL lib (#50953) 2024-12-06 10:42:59 -05:00
Chris Truter
47200643e1 Fix race between jobs accessing the search index (#50990) 2024-12-06 17:08:06 +02:00
Chris Truter
6c22043070 Encapsulate default models to search (#50938) 2024-12-06 15:07:00 +00:00
Chris Truter
34401cccab Fix rollback to version 50 with null query_field values (#50982) 2024-12-06 14:59:33 +00:00
Aleksandr Lesnenko
e80c600db5 Render negative values on PieChart (#50837)
* fix pie chart ignores negative values

* fix incorrect handling of zero only values

* fix rebase
2024-12-06 13:30:34 +00:00
Chris Truter
3d6c90698b Improve queue test and add more buffering (#50980) 2024-12-06 12:31:06 +00:00
Denis Berezin
7b4c298126 chore: Move alerts and pulse components to notifications domain (#50929) 2024-12-06 14:39:45 +03:00
Mahatthana (Kelvin) Nomsawadi
631947bfb8 Streamline embed flow when embedding is off (#50842)
* Always show embed sharing option for admins (#50513)

* Always render the public link option

This is possible because metabase#50504

* Always render the embed option

* Fix unit tests

* Fix E2E tests

* Correct test semantic

* Hide Embed option for non-admins

* New Embed modal (#50580)

* Open "Compare options" in a new tab

* Add an external link icon to interactive embed option when it should

* Add disabled state to SDK

* Add a disable state to static and interactive embedding

* Add interactive embedding disabled state

* Implement disabled link

* Prepare folder for testing

* Fix tests and add SDK tests

* Add interactive embedding tests

* Correct test desribe block levels

* Add static embedding tests

* Add premium interactive embedding tests

* Add enterprise tests (EE without tokens)

* Fix the rest of the failed unit tests

* Update E2E tests

* Fix a case where OSS see disabled interactive embedding

This should be impossible as interactive embedding isn't available on
OSS, so we should not display the disabled state.

* Address review

Co-authored-by: Oisin Coveney <oisin@metabase.com>

* Address review

Co-Authored-by: Poom poom@poom.dev

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>

* Update Interactive Embedding Admin Settings page (#50693)

* Add a quick start link to interactive embedding settings page

* Update UTM tags for interactive embedding card

* Don't show interactive embedding option as enabled on OSS

* Fix unit tests

* Add a new test

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>
2024-12-06 10:26:41 +00:00
Uladzimir Havenchyk
6ce8344c90 chore: rework DataSelector styles to css modules (#50912)
* chore: rework DataSelector to css modules

* fix imports

* revert changes

* fix styles

* fix styles

* fix styles

* fix styles

* use upper case

* address review

* add missing files

* one more entry
2024-12-06 13:07:49 +03:00
Aleksandr Lesnenko
6d83cb2b60 fix scatter chart tooltip (#50889)
* fix scatter chart tooltip shows irrelevant info

* remove outdated spec as we always show the tooltip_column setting
2024-12-05 20:53:33 -05:00
Jeff Bruemmer
9f4327cf87 update env vars (#50963) 2024-12-05 22:56:10 +00:00
bryan
989bb6ff23 New and improved Examples collection (#50829)
* fix the script, and add the new edn

* make the migrations run in the proper order

* it works (needs cleanup)

* remove broken binning

- These bins rely on fingerprinting for the custom Age column

- The fingerprinting for that custom column are not properly exported in
serialization, hence do not get loaded into metabase, causing binning by
Age to fail.

* cleanup / linting

* cleanup

* update migration test ids to test

* realign test name to check for to see if sample content was created

* remove Product collection + move Examples into root

* update collection_ids for the content too

* remove click behavior for 'Revenue goal for this quarter'

* Apply suggestions from code review

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

* for the sample collection is_sample should be true

* Drop CreateInternalUserNoOp

* typo

* update migration comments

* 2 small fixes

* fix data perms for example coll

* add a comment so we don't have 2 blank lines in a row

---------

Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2024-12-05 15:33:20 -07:00
William
82c39bb942 Make postgres enums not error when using :is-empty/:not-empty (#50914) 2024-12-05 22:23:31 +00:00
github-automation-metabase
bcd41db9ad Add v0.50.35 to the list of releases (#50835) 2024-12-05 22:19:25 +00:00
dpsutton
a135e609e8 Include explicit require to c.t.build.tasks.uber (#50941)
Fixes https://github.com/metabase/metabase/issues/50940

Build sometimes fails with

```clojure
      Compiling namespaces [metabase.driver.sqlserver]
{:via
 [{:type clojure.lang.ExceptionInfo,
   :message
   "Running build steps for Enterprise Edition version UNKNOWN: version, translations, frontend, licenses, drivers, uberjar",
   :data {},
   :at [metabuild_common.steps$do_step invokeStatic "steps.clj" 90]}
  {:type clojure.lang.ExceptionInfo,
   :message "Building all drivers in parallel (:ee edition)",
   :data {},
   :at [metabuild_common.steps$do_step invokeStatic "steps.clj" 90]}
  {:type java.util.concurrent.ExecutionException,
   :message "clojure.lang.ExceptionInfo: Build driver :databricks (edition = :ee, options = nil) {}",
   :at [java.util.concurrent.FutureTask report "FutureTask.java" 122]}
  {:type clojure.lang.ExceptionInfo,
   :message "Build driver :databricks (edition = :ee, options = nil)",
   :data {},
   :at [metabuild_common.steps$do_step invokeStatic "steps.clj" 90]}
  {:type clojure.lang.ExceptionInfo,
   :message
   "Write :databricks :ee uberjar -> /home/runner/work/metabase/metabase/resources/modules/databricks.metabase-driver.jar",
   :data {},
   :at [metabuild_common.steps$do_step invokeStatic "steps.clj" 90]}
  {:type java.lang.IllegalStateException,
   :message "Attempting to call unbound fn: #'clojure.tools.build.tasks.uber/uber",
   :at [clojure.lang.Var$Unbound throwArity "Var.java" 47]}],
 :trace
 [[clojure.lang.Var$Unbound throwArity "Var.java" 47]
  [clojure.lang.AFn invoke "AFn.java" 32]
  [clojure.lang.Var invoke "Var.java" 386]
  [clojure.tools.build.api$uber invokeStatic "api.clj" 511]
  [clojure.tools.build.api$uber invoke "api.clj" 439]
  [build_drivers.create_uberjar$create_uberjar_BANG_$fn__4951 invoke "create_uberjar.clj" 82]
  [metabuild_common.steps$do_step invokeStatic "steps.clj" 87]
  [metabuild_common.steps$do_step invoke "steps.clj" 81]
  [build_drivers.create_uberjar$create_uberjar_BANG_ invokeStatic "create_uberjar.clj" 80]
  [build_drivers.create_uberjar$create_uberjar_BANG_ invoke "create_uberjar.clj" 77]
  [build_drivers.build_driver$build_driver_BANG_$fn__6636 invoke "build_driver.clj" 37]
  [metabuild_common.steps$do_step invokeStatic "steps.clj" 87]
  [metabuild_common.steps$do_step invoke "steps.clj" 81]
  [build_drivers.build_driver$build_driver_BANG_ invokeStatic "build_driver.clj" 33]
  [build_drivers.build_driver$build_driver_BANG_ invoke "build_driver.clj" 17]
  [build_drivers.build_driver$build_driver_BANG_ invokeStatic "build_driver.clj" 24]
  [build_drivers.build_driver$build_driver_BANG_ invoke "build_driver.clj" 17]
  [build_drivers$build_drivers_BANG_$fn__6657$fn__6658 invoke "build_drivers.clj" 31]
  [clojure.core$pmap$fn__8582$fn__8583 invoke "core.clj" 7169]
  [clojure.core$binding_conveyor_fn$fn__5842 invoke "core.clj" 2047]
  [clojure.lang.AFn call "AFn.java" 18]
  [java.util.concurrent.FutureTask run "FutureTask.java" 264]
  [java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1128]
  [java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 628]
  [java.lang.Thread run "Thread.java" 829]],
 :cause "Attempting to call unbound fn: #'clojure.tools.build.tasks.uber/uber"}
```

Seems that pmap-ing over the tasks hits a race condition with how the api works

```clojure
(defn uber
  [params]
  (assert-required "uber" params [:class-dir :uber-file])
  (assert-specs "uber" params
    :class-dir ::specs/path
    :uber-file ::specs/path)
  ((requiring-resolve 'clojure.tools.build.tasks.uber/uber) params))
```

So we just require `clojure.tools.build.tasks.uber` so that the
namespace is compiled and ready.
2024-12-05 13:37:56 -06:00
metamben
c2504f4e99 Support desugaring during function (#50903) 2024-12-05 22:31:22 +03:00
Alexander Polyankin
fd0cafeb7b [FE] Move exclude date filter parts to MBQL lib (#50888) 2024-12-05 14:20:52 -05:00
Aleksandr Lesnenko
3e1f18a9cf sankey static viz integration test (#50793) 2024-12-05 12:59:01 -05:00
lbrdnk
89faa64681 Add binning to display name (#50531)
Add binning to display name similarly as done with bucketing.
---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2024-12-05 17:28:38 +00:00
Oleksandr Yakushev
8e68606eb4 [xlsx-export] Refactor postprocess namespace with perf/concat (#50170) 2024-12-05 18:53:28 +02:00
Chris Truter
26e8f86868 Fix edge cases in New Search around model filtering (#50937) 2024-12-05 15:56:57 +00:00
Nicolò Pretto
4c27ad5fa3 fix(sdk): remove Error.captureStackTrace as it errors on firefox (#50773)
firefox
2024-12-05 15:38:45 +01:00
Oisin Coveney
2c76bd4a92 Migrate favicon logic to mantine hook (#50878) 2024-12-05 16:17:34 +02:00
Chris Truter
8692d9e000 Keep support for the old search engine name (#50876) 2024-12-05 07:31:39 +00:00
Romeo Van Snick
02e80cf2ae Loki flake: make delays configurable independently (#50806)
* Add delay helper

* Remove delays in storybook

* Use skippable delay in ListField and SingleSelectListField

* Use skippable delay in ExplicitSize

* Remove waitTimeContext in storybook

* Remove waitTimeContext altogether

* Add documentation to delay

* Remove all context references in ExplicitSize

* Update flaky snapshots
2024-12-05 11:58:46 +11:00
Case Nelson
6f1f0c02ed fix: Qualify postgres enums outside public schema (#50900)
Fixes: #50771

The new sync process failed to qualify enums outside public and
therefore failed to properly type them in database_type. This could
either result in matching the wrong type if there was a conflict or not
being typed as an enum.
2024-12-04 14:33:49 -07:00
github-automation-metabase
3be2611784 Add v0.52.1 to the list of releases (#50906) 2024-12-04 16:11:56 -05:00
github-automation-metabase
5b3278831c Add v0.51.7 to the list of releases (#50899) 2024-12-04 15:49:13 -05:00
Case Nelson
c592413341 test: syncing views against all drivers (#50236)
* test: see which drivers pass these tests

* Fix build

* Change test to use standard dataset, add initial implementation for bigquery

* Use fully qualified names for views

* Don't use transactions for databricks

* Make drop table only if exists, fix describe-index in mongo for views

* don't sync system.views

* Fix oracle drop-views, disable non-syncing views

* Use metabase-instance to find the table, this is important because redshift and oracle munge table name

* Fix oracle tests

* Fix oracle views

* Fix formatting

* Fix snowflake qualified components

* Change tests to opt out

* Fix sqlsserver

* Fix postgres test

* Disable h2 describe views test

* Address review
2024-12-04 19:43:25 +00:00
metamben
98e0fce497 Deserialize metrics as cards (#50807) 2024-12-04 19:38:33 +00:00
Jeff Bruemmer
88d5b7bc17 docs - verified content (#50885) 2024-12-04 19:31:28 +00:00
Ryan Laurie
ad3fc72b03 Use global e2e helper import (#50156) 2024-12-04 18:17:10 +00:00
Alexander Polyankin
51b73954e1 Move time filter parts to MBQL lib (#50765) 2024-12-04 12:14:14 -05:00
William
85ce744a2b Applying the underlying records filter to a query with a join display… (#50802)
Applying the underlying records filter to a query with a join displays fields from the join
2024-12-04 17:11:27 +00:00
Phoomparin Mano
33915469e3 feat(sdk): add style and className to static dashboards (#50860)
* add style and className to static dashboards

* unify props for static and interactive
2024-12-05 00:01:38 +07:00
Alexander Polyankin
b85e236113 sql-field-filter-types.cy.spec.js flakes (#50881)
* sql-field-filter-types.cy.spec.js flakes

* sql-field-filter-types.cy.spec.js flakes
2024-12-04 16:43:00 +00:00
Uladzimir Havenchyk
32d8726ac9 chore: drop unused CSS (#50861) 2024-12-04 16:24:50 +00:00
Chris Truter
72f70ade32 Finish deprecating old search module namespace (#50852) 2024-12-04 15:32:32 +00:00
Alexander Polyankin
80cd4f3c80 Move filter-parts to MBQL lib (#50752) 2024-12-04 10:29:24 -05:00
Chris Truter
2e73064e94 [search] replace experimental flag with engine choice (#50850) 2024-12-04 16:08:21 +03:00
Nemanja Glumac
e1f2fb96c3 Trial Banner (#49344)
* Add trial banner

* Use the semantic "warning" color for background

* Simplify the "reappearance" logic

* Refine the banner logic

- Pass the bare minimum information (expiry timestamp) to the `TrialBanner`
- Take timezones into account
- Introduce utilities
- Add unit tests

* Update the remaining tests

* Clean up

* Unbreak my `defsetting` 🎶

* Add comments

* Defer var assignment

* Fix failing tests 🤦

* Adjust the types in order to match `master`

* Move the logic up to the parent component

* Convert the `index` component to TS

* Fix typo in the JSDoc

* Fix another typo

* Make the return statement more readable

* Remove redundant test
2024-12-04 12:49:53 +00:00
Alexander Solovyov
9006696ee3 [serdes] do not require prefix when passing entity ids to export (#50786) 2024-12-04 14:04:53 +02:00
Ngoc Khuat
727246d3b1 fix persist model error email (#50843) 2024-12-04 16:16:00 +07:00
Ngoc Khuat
5e6851a8c3 Add more logs for sending notification (#50836) 2024-12-04 10:38:53 +02:00
Raphael Krut-Landau
83f0c60fea Show /api/search errors in Browse models and Browse metrics (#50713) 2024-12-04 00:00:51 -05:00
Nick Fitzpatrick
414048fba0 Properly handle other users personal collections in collection picker (#50605)
* Properly handle other users personal collections in collection picker

* fixing types and unit test
2024-12-03 22:43:23 -04:00
Romeo Van Snick
2b1c6958c0 Split ACE editor into separate component (#50258)
* Move modals out of resizable area

* Split off ace editor from NativeQueryEditor

* Query for selection target in AceEditor

* Rename editor ref

* Add custom type for selection range

* Move more items into shared types file

* Add shared interface for editors

* Add shared Editor wrapper

* Add SQL colors in core/colors.module.css

* Allow importing global css with .global.css

* Move ace styles to AceEditor.global.css

* Fix Range type

* Fix Ace editor tests

* Scope the ace editor styles

* Remove EditorRoot styled component

* Use parent wrapper instead of classname on editor

* Remove ace editor styles from global styles

* Remove custom ace styles from embedding sdk

* Move NativeQueryEditor styles to css modules

* Fix styles for notebook sql preview

* Remove unused props

* Remove unused variable warnings

* Remove width prop

* Rename openDataReferenceAtQuestion and make it optional

* Rename setNativeEditorSelectedRange and make it optional

* Move selection popover logic out of AceEditor

* Make autocompleteResultsFn optional

* Make cardAutocompleteResultsFn optional

* Remove fetchQuestion prop

* Remove nativeEditorSelectedText prop

* Make props explicit

* Make onChange optional

* Set editor height

* Use Editor in NotebookNativePreview

* Remove cardAutocompleteResultsFn and autocompleteResultsFn props from Editor

* Remove unused snippetCollections prop

* Add missing native-query-autocomplete-match-style setting

* Remove snippets from Editor props

* Resize ace editor on load

* Add custom snippets wrapper

* Flatter completer styles

* Add container class to autocomplete popover

* Fix flex size for editor

* Fix AceEditor types

* Flatten ace styles

* Avoid hard-coded color

* Set height and width on editor

* Flatten ace wrapper

* Do not call api with empty prefix

* Add helpers to target native editor

* Use nativeQueryEditor in action helper

* Use nativeQueryEditor in ad hoc helper

* Remove ace_* references from tests

* Align nativeEditor helpers

* Revert "Align nativeEditor helpers"

This reverts commit e629aecb18.

* Move focusNativeEditor to native editor helpers

* Use focusNativeEditor where applicable

* Remove ace_editor references in test

* Fix test

* Remove references to native-query-editor testid in test

* Remove duplicate test assertion

* Fix nesting in css

* Use font-family from variable

* Use default module.css with :global instead of custom .global.css file

* Move AceEditor into subdirectory

* Fix import path

* More strongly type native-query-autocomplete-match-style

* Remove duplicate default

* Rename EditorHandle to EditorRef

* Add more specificity to ace syntax overwrites

* Simplify EditorRef

* Remove HOC

* Do not perform visibility check inside nativeEditor helper

* Explicitly assert elements are visible

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

* Fix formatting issue

* Add highlight for identifier

* Improve gutter cell

* Use relative imports for helpers

* Focus editor before typing

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-12-04 12:59:10 +11:00
Noah Moss
590951cacb Ensure user count is fetched within token status memoization (#50813) 2024-12-03 23:18:58 +00:00
Phoomparin Mano
35ec452c6c feat(sdk): rename prop names to be clear and explicit (#50656)
* rename onClose to onCancel

* rename questionHeight to drillThroughQuestionHeight

* rename showVisualizationSelector to withVisualizationSelector

* rename parameter value props

* doc updates for parameter values

* rename the chart type selector prop

* document the withChartTypeSelector prop
2024-12-04 05:19:40 +07:00
Jeff Bruemmer
63ce443b49 docs - commands (#50784) 2024-12-03 17:03:59 -05:00
Nemanja Glumac
44dd5df5da Onboarding checklist - misc. follow ups (#50579)
* Fix the help link

* Update data stack image

* Fix the link appearance
2024-12-03 21:55:27 +00:00
Sloan Sparger
4e8404d3b7 [Clean up] Hide clean up UI in sample collections (#50760)
* hides clean up ui on sample collections

* commit unsaved changes

* pr feedback
2024-12-03 15:51:10 -06:00
Uladzimir Havenchyk
33ff237b59 fix(ObjectDetail): do not show popup when click on View More (#50745) 2024-12-04 00:15:38 +03:00
Nick Fitzpatrick
703638cd10 removing the 'can_write' requirement for selecting things via the question picker (#50783) 2024-12-03 16:21:31 -04:00
Uladzimir Havenchyk
142306a3f7 fix: do not show popup when click on View More (#50745) 2024-12-03 19:47:45 +00:00
Uladzimir Havenchyk
9401a0ba6f fix: do not show popup when click on View More (#50745) 2024-12-03 19:47:31 +00:00
github-actions[bot]
b4aa704be6 Update Translations for v52.1 (#50534)
* Add new strings for v52.0

* Update translations

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-12-03 19:20:18 +00:00
Nemanja Glumac
f5e63b4001 Introduce the non-admin Onboarding Checklist (#50516)
* Add new selectors

* Adjust the onboarding checklist for non-admins

* Add unit tests for non-admins

* Rename the control knob

* Fix the forgotten test

* Stop guarding the route for admins only

* Translate `alt` tags

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

* Translate `alt` tags

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

* Add e2e coverage for non-admins

* Refine selectors

* Improve the route guard

* Increase E2E coverage for route guards

---------

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2024-12-03 19:23:38 +01:00
Nicolò Pretto
2d9d447492 fix(sdk): introduce .mb-wrapper to scope down our css (#50466)
* add tests for css rules not scoped to the sdk

* fix(sdk): adds mb-wrapper class and scope css to it

* fix typo

* add .mb-wrapper to the body on storybook
diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx
index 52a0d45125d..a4b3a86f4a5 100644
--- a/.storybook/preview.tsx
+++ b/.storybook/preview.tsx
@@ -42,15 +42,20 @@ const globalStyles = css`
 export const decorators = isEmbeddingSDK
   ? [] // No decorators for Embedding SDK stories, as we want to simulate real use cases
   : [
-      renderStory => (
-        <EmotionCacheProvider>
-          <ThemeProvider>
-            <Global styles={globalStyles} />
-            <CssVariables />
-            {renderStory()}
-          </ThemeProvider>
-        </EmotionCacheProvider>
-      ),
+      renderStory => {
+        if (!document.body.classList.contains("mb-wrapper")) {
+          document.body.classList.add("mb-wrapper");
+        }
+        return (
+          <EmotionCacheProvider>
+            <ThemeProvider>
+              <Global styles={globalStyles} />
+              <CssVariables />
+              {renderStory()}
+            </ThemeProvider>
+          </EmotionCacheProvider>
+        );
+      },
     ];

 function CssVariables() {
2024-12-03 18:19:50 +01:00
Aleksandr Lesnenko
0f9bb8045b fix narrow ordinal line charts have no tooltip (#50715) 2024-12-03 17:02:01 +00:00
Noah Moss
aa0a444be4 Remove memoization of active user counts setting (#50779) 2024-12-03 16:27:53 +00:00
Aleksandr Lesnenko
c7e8d6cae5 Address feedback on Sankey (#50611)
* do not show column selection error on empty datasets

* add more specs to chart-definition logic

* fix entry nodes tooltip and click behavior values

* fix nodes formatting

* do not show sankey data settings on dashboards

* do not initiallt open sankey data columns selects

* hide sankey tooltip on scroll

* drop incorrect types

* set sankey node limit

* prevent clicks on edges close tooltips on native sankey questions

* tweak copy

* update sankey spec according to fixes

* revert changed settings behavior

* fix unit specs
2024-12-03 10:20:24 -05:00
dpsutton
16117c6423 Fix logging with conflict handlers (#50723)
* Fix logging with conflict handlers

Information:
https://github.com/seancorfield/depstar
https://github.com/seancorfield/build-uber-log4j2-handler

Gist is that log4j needs all of it's plugin files merged into one
file. Lots of
`META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat`
files become one.

In our jar currently it is 3247 bytes. In older good jars it is 28463
bytes.

Before:

```
❯ MB_JETTY_PORT=3006 java -jar before.jar
Warning: environ value /Users/dan/.sdkman/candidates/java/current for key :java-home has been overwritten with /Users/dan/.sdkman/candidates/java/21.0.2-tem
2024-12-02T03:58:45.591114Z main ERROR Unrecognized format specifier [d]
2024-12-02T03:58:45.592271Z main ERROR Unrecognized conversion specifier [d] starting at position 16 in conversion pattern.
2024-12-02T03:58:45.592893Z main ERROR Unrecognized format specifier [thread]
2024-12-02T03:58:45.592989Z main ERROR Unrecognized conversion specifier [thread] starting at position 25 in conversion pattern.
2024-12-02T03:58:45.593101Z main ERROR Unrecognized format specifier [level]
2024-12-02T03:58:45.593187Z main ERROR Unrecognized conversion specifier [level] starting at position 35 in conversion pattern.
2024-12-02T03:58:45.593291Z main ERROR Unrecognized format specifier [logger]
2024-12-02T03:58:45.593375Z main ERROR Unrecognized conversion specifier [logger] starting at position 47 in conversion pattern.
2024-12-02T03:58:45.593459Z main ERROR Unrecognized format specifier [msg]
2024-12-02T03:58:45.593541Z main ERROR Unrecognized conversion specifier [msg] starting at position 54 in conversion pattern.
2024-12-02T03:58:45.593628Z main ERROR Unrecognized format specifier [n]
2024-12-02T03:58:45.593710Z main ERROR Unrecognized conversion specifier [n] starting at position 56 in conversion pattern.
2024-12-02T03:58:45.603389Z main ERROR Reconfiguration failed: No configuration found for 'Default' at 'null' in 'null'
WARNING: infinite? already refers to: #'clojure.core/infinite? in namespace: kixi.stats.core, being replaced by: #'kixi.stats.math/infinite?

UPDATE SUMMARY
Run:                        436
Previously run:               0
Filtered out:                52
-------------------------------
Total change sets:          488

FILTERED CHANGE SETS SUMMARY
DBMS mismatch:               52
```

And now after:

```
❯ MB_JETTY_PORT=3007 java -jar after.jar
Warning: environ value /Users/dan/.sdkman/candidates/java/current for key :java-home has been overwritten with /Users/dan/.sdkman/candidates/java/21.0.2-tem
2024-12-01 21:58:49,892 INFO metabase.util :: Maximum memory available to JVM: 8.0 GB
2024-12-01 21:58:51,121 INFO util.encryption :: Saved credentials encryption is DISABLED for this Metabase instance. 🔓
 For more information, see https://metabase.com/docs/latest/operations-guide/encrypting-database-details-at-rest.html
2024-12-01 21:58:51,591 WARN db.env :: WARNING: Using Metabase with an H2 application database is not recommended for production deployments. For production deployments, we highly recommend using Postgres, MySQL, or MariaDB instead. If you decide to continue to use H2, please be sure to back up the database file regularly. For more information, see https://metabase.com/docs/latest/operations-guide/migrating-from-h2.html
WARNING: infinite? already refers to: #'clojure.core/infinite? in namespace: kixi.stats.core, being replaced by: #'kixi.stats.math/infinite?
2024-12-01 21:58:54,353 INFO driver.impl :: Registered abstract driver :sql  🚚
2024-12-01 21:58:54,375 INFO driver.impl :: Registered abstract driver :sql-jdbc (parents: [:sql]) 🚚
2024-12-01 21:58:54,379 INFO metabase.util :: Load driver :sql-jdbc took 7.3 ms
2024-12-01 21:58:54,379 INFO driver.impl :: Registered driver :h2 (parents: [:sql-jdbc]) 🚚
2024-12-01 21:58:54,525 INFO driver.impl :: Registered driver :mysql (parents: [:sql-jdbc]) 🚚
2024-12-01 21:58:54,543 INFO driver.impl :: Registered driver :postgres (parents: [:sql-jdbc]) 🚚
2024-12-01 21:58:54,642 INFO util.namespaces :: Loading namespace: metabase.notification.payload.impl.alert
2024-12-01 21:58:54,646 INFO util.namespaces :: Loading namespace: metabase.notification.payload.impl.dashboard-subscription
2024-12-01 21:58:54,648 INFO util.namespaces :: Loading namespace: metabase.notification.payload.impl.system-event
2024-12-01 21:58:54,655 INFO util.namespaces :: Loading namespace: metabase.channel.impl.email
2024-12-01 21:58:54,663 INFO util.namespaces :: Loading namespace: metabase.channel.impl.http
2024-12-01 21:58:54,667 INFO util.namespaces :: Loading namespace: metabase.channel.impl.slack
2024-12-01 21:58:55,520 INFO metabase.core ::
Metabase v0.52.1-SNAPSHOT (3e7a8a4)

Copyright © 2024 Metabase, Inc.

Metabase Enterprise Edition extensions are NOT PRESENT.
2024-12-01 21:58:55,522 INFO metabase.core :: Starting Metabase in STANDALONE mode
2024-12-01 21:58:55,550 INFO metabase.server :: Launching Embedded Jetty Webserver with config:
 {:port 3007}
```

* formatting fix
2024-12-03 10:08:26 -05:00
adam-james
18bfb20523 Pivot Exports Can Handle nil in Breakout Col, and Multiple Cols of the Same Aggregation Type (#50672)
* Pivot Exports Can Handle `nil` in Breakout Col, and Multiple Cols of the Same Aggregation Type

Fixes #50551

If a pivot table has several measures configured, they might both use the same kind of
aggregation (eg. 'sum'). Previously, this would lead to columns with the same name preventing the pivot-measures from
properly making it through the export post processing. Now, the correct aliased/deduped name is used and all columns
can be properly included in the pivot export.

Also fixes the case where a breakout column (pivot-row) contains `nil` values, which caused the pivot export to
fail. Now, all nil values are grouped and handled appropriately.

* when pivot is disabled, header should still be included

* min and max don't default to 0, add a test for the aggregations
2024-12-03 06:40:59 -08:00
Nemanja Glumac
bf184ac3da Fix a (native-ace-editor) flake 30039 (#50774) 2024-12-03 13:36:21 +01:00
Ngoc Khuat
37acc7e854 [Notification] Rename notification types (#50768)
- notification/alert -> notification/card
- notification/dashboard-subscription -> notification/dashboard
2024-12-03 10:24:23 +00:00
Kamil Mielnik
e2a8d43ed5 Implement new EntityObjectLoaderRtkQuery that uses RTK Query hooks (#44523)
* Add EntityObjectLoaderRtkQuery boilerplate

* Incorporate EntityType logic into the new component

* Improve comment

* Add childrenProps

* Move component into its own directory, extract types to a separate file

* Add entityObjectLoaderRtkQuery and temporary mappings

* Hook up the useGetQuery hook (tables only)

* Pass all the props to children

* Add Playground

* Gather more info in the Playground

* Integrate RTK with redux store

* Adjust props passed down

* Improve typing

* Make the request hook dynamic

* Add missing id in the query

* Handle fetchMetadata

* Change requestType to fetchType

* Add rtk mappings for databases in entity framework

* Use requestType to get request state path

* Enable new component everywhere

* Use legacy loader for entities without rtk mappings

* Improve comment

* Handle fetchMetadataAndForeignTables

* Remove unused function

* Handle reload and remove

* Add TODO

* Add transformResponse option and use it for fetchIdFields

* Format code

* Remove Playground

* Remove unused getUseGetListQuery

* Add rtk mapping for alerts

* Add rtk mapping for dashboards

* Add rtk mapping for groups

* Add rtk mapping for pulses

* Remove options

* Fix permissions tests

* Fix notifications tests

* Add rtk mapping for segments

* Use params instead of body
- It's leftover because this code got reverted after body -> params refactoring for GET endpoint has been merged to master

* Add rtk mapping for snippet collections

* Add TODO

* ESLint

* ESLint

* Update TODO

* Deprecate entity HOCs

* Update TODO

* Revert other entities for now

* Revert other entities for now

* Bring tables back

* Improve todos

* Add comment

* Improve comment

* Remove TODO

* Use reload param

* Remove properties prop

This was used to short-circuit and avoid triggering api calls if we already had an object with given attributes in cache.
With RTK query now managing the cache, we don't want to reproduce this behavior.

* Remove reloadInterval

This is used in EntityListLoader, not EntityObjectLoader

* Don't use setRequestPromise action

* Fix deprecations

* Format code

* Fix flake :(

* Try to fix flake

* Revert "Try to fix flake"

This reverts commit 6408a22a37.

* Try to fix flake

* Fix UseQuery type

* Implement useGetMetadataAndForeignTables

* Fix useMemo and move things down

* Fix typo

* Bring back original hack

* Move file

* Add comment
2024-12-03 08:28:55 +00:00
Raphael Krut-Landau
07ee64373f Make e2e tests of embedding and sql filters date-invariant (#50737) 2024-12-02 23:20:03 -05:00
Nathan Voxland
c63bfcf186 Added nvoxland to team config files (#50761) 2024-12-02 17:03:39 -06:00
William
499553cc74 Add wzimrin to teams and github-slack-map (#50756) 2024-12-02 14:38:28 -06:00
Jeff Bruemmer
8e95128018 update chart list (#50743) 2024-12-02 15:02:03 -05:00
Alex Yarosh
1470cb1abe docs: serialization clarification (#50601)
* serialization clarification

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-12-02 15:01:46 -05:00
Alexander Polyankin
68f645545d Partially fix flaky native e2e tests (#50710) 2024-12-02 12:21:59 -05:00
Samy Djemaï
caadb4cfd6 docs: fix log4j configurationFile arg path for docker command (#38121) 2024-12-02 09:06:09 -05:00
Chris Truter
0cd2032a35 Fix Quartz rescheduling with multiple triggers (#50707) 2024-12-02 11:27:39 +02:00
Ngoc Khuat
b26eca90b9 Deprecate alert and pulse apis (#50453) 2024-12-02 05:32:45 +00:00
Chris Truter
3e7a8a4e48 Fix NPE on search model calculation, and improve testing story (#50717) 2024-11-30 22:24:55 +03:00
Aleksandr Lesnenko
d5b09bc9e0 fix loki-update label is not removed after the job (#50607)
* fix loki-update label is not removed after the job

* Update Loki Snapshots

* Update Loki Snapshots

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-11-30 04:10:51 +00:00
Gustavo Saiani
8b8bbc66a4 Include in-page-promo in embedding docs pages (#50359) 2024-11-30 01:40:11 +00:00
Denis Berezin
299b698cd4 Migrate Slack channel picker field to use mantine autocomplete (#50661)
* Migrate Slack channel picker field to use mantine autocomplete

* Fix limit size

* Fix limit size
2024-11-30 00:20:09 +03:00
Phoomparin Mano
0c8b9a133b Cache static assets without hash length restriction (#50703)
* match against any hexadecimal bundle name

* add e2e tests skeleton

* Support display-name for ISO get-day-of-week exclusion expressions (#50606)

* Support display-name for ISO get-day-of-week exclusion expressions

Fixes #50574

* Fix light theme embeddings has different text colors (#50678)

* add cache-control tests

* support local runs

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-11-29 17:35:22 -03:00
Alexander Polyankin
fa6f4762cc Fix custom expressions with multiple arguments - contains, does-not-contain, starts-with, ends-with (#50480)
* adjustMultiArgOptions

* adjustMultiArgOptions

* Fix options

* Fix options

* Add a comment

* Fix tests

* Fix tests

* Add tests

* Tests

* Add tests

* Add tests

* Add tests
2024-11-29 15:30:53 -05:00
Phoomparin Mano
6e407f15aa feat(sdk): add withChartTypeSelector prop to InteractiveQuestion (#50664)
* add withVisualizationSelector prop

* add tests

* add to docs

* use default layout in tests

* only use custom layout when needed

* make withChartTypeSelector false by default
2024-11-30 03:23:01 +07:00
Aleksandr Lesnenko
167b1b6f87 update token status types (#50669) 2024-11-29 15:11:57 -05:00
metamben
e105de0219 Support extraction expressions in filter-args-display-name (#50694)
Fixes #50670
2024-11-29 20:04:58 +00:00
Phoomparin Mano
87b60ba547 feat(sdk): use string types for specifying entity ids instead of internal nanoid type (#50663) 2024-11-30 02:48:58 +07:00
Chris Truter
fd0954aeb7 Improve Search Index clean-up and re-enable some tests (#50687) 2024-11-29 18:25:49 +00:00
Alexander Solovyov
755256a800 top-level LICENSE conflicts with other files breaking uberjar build (#50691) 2024-11-29 18:17:13 +00:00
Braden Shepherdson
29428b7c80 [dev] Add dev.portal/diff->, drop-in -> that sends diffs to Portal (#50470)
Adds `dev.portal/diff->`, a drop-in replacement for `->` that `tap>`s
a diff at each stage. (With the metadata for Portal to default to diff viewer)

I found myself wanting this several times while debugging the refs overhaul.
2024-11-29 17:55:06 +00:00
github-automation-metabase
5d7ac6573a Add v0.51.6 to the list of releases (#50640)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-11-29 12:49:36 -05:00
Alexander Solovyov
81c0389fe9 return better errors when request contains malformed JSON (#50629) 2024-11-29 20:42:18 +03:00
Braden Shepherdson
6f1d9cbdd3 [refs] Generate idents for new clauses in MBQL lib (#50083)
Specifically, for expressions, aggregations, breakouts, and joins.
Adds MBQL lib unit tests for this behaviour.

Currently these idents are discarded during `lib.convert` and don't
survive a round trip to legacy. That will come with a later change.
2024-11-29 11:56:07 -05:00
Alexander Polyankin
3159eda4dc Old data picker in notebook for embedding (#50535) 2024-11-29 10:49:47 -05:00
github-automation-metabase
7030df04e8 Update Readme version references and published npm version to 0.52.3-nightly (#50696) 2024-11-29 15:42:12 +00:00
Chris Truter
1ab92fde40 Extra Search Rankers for exact matches and things you own (#50684) 2024-11-29 15:27:49 +00:00
Mahatthana (Kelvin) Nomsawadi
3e0b03e8fd Fix light theme embeddings has different text colors (#50678) 2024-11-29 14:22:37 +00:00
metamben
b403648472 Support display-name for ISO get-day-of-week exclusion expressions (#50606)
* Support display-name for ISO get-day-of-week exclusion expressions

Fixes #50574
2024-11-29 16:26:37 +03:00
Alexander Solovyov
84b0948e60 rename team, acquire Denis :) (#50682) 2024-11-29 15:53:48 +03:00
Alexander Solovyov
bb6428e537 update all that updates (#50642) 2024-11-29 15:48:24 +03:00
Oleksandr Yakushev
7368fb1de1 Introduce metabase.util.json to encapsulate usage of the underlying JSON library (#50353)
* Add metabase.util.json

* Replace direct Cheshire usage with metabase.util.json

* Add cheshire namespaces to :discouraged-namespaces in Kondo
2024-11-29 12:10:42 +00:00
Chris Truter
fe8f1f9a9d Use separate indexes for different versions (#50620)
This protects against us trying to read or write from an incompatible search index. In particular it prevents existing instances from being switched over to an incompatible table during an HA upgrade or downgrade.

~~It doesn't yet get rid of the needless re-initialization, but that will be a fast follow.~~ It breaks up the jobs so that we won't reindex on startup unless necessary.
2024-11-29 12:04:56 +02:00
Chris Truter
7a52063c5c Take default Search weights from Stats (#50674) 2024-11-29 09:06:55 +00:00
Chris Truter
b4e22eb6b0 Keep Search Index metadata sync'd via setting (#50581)
See https://www.notion.so/metabase/Search-Index-Maintenance-14b69354c9018047b670cbba1c3be50d

This ensures that when one instance starts or finishes reindexing, the other instances pick up and switch to the same tables.

Note: this does not stop blowing away the currently active table on deployment yet, we need to have a notion of version for that first.
2024-11-29 10:59:53 +02:00
Chris Truter
8f41692cb0 Avoid renaming Search Index tables (#50573)
This also avoids a brittle song and dance with non-authoritative atoms in the background. Now we juggle authoritative atoms all the time 😄
2024-11-29 09:45:42 +02:00
Denis Berezin
43092b1d2a Fix slack post recurrence field label (#50666) 2024-11-29 01:23:35 +03:00
appleby
bd3542401a Enable underlying-records drill in table viz for multi-stage queries (#50556)
* Enable underlying-records drill in table viz for multi-stage queries

* Fix e2e test

* Add tests for underyling-records drill for multi-stage queries

* Review feedback: filterv not-empty etc

* Review feedback: add a breakout-only query to drill-thru canned-queries
2024-11-28 13:53:31 -08:00
Aleksandr Lesnenko
9cc1a46c8a simplify use-license (#50613)
* simplify use-license

* rip moment
2024-11-28 14:14:36 -05:00
Phoomparin Mano
69958ce424 ci(sdk): remove unreliable loading indicator e2e for create question (#50555) 2024-11-28 23:30:31 +07:00
Alexander Solovyov
138560b595 skip META-INF/LICENSE since it conflicts with other licenses on MacOS (#50638) 2024-11-28 14:46:58 +00:00
Aleksandr Lesnenko
dda69aa5f8 Sankey polish (#50550)
* do not show column selection error on empty datasets

* persist default sankey column settings when saving

* add more specs to chart-definition logic

* more specs
2024-11-28 08:21:43 -05:00
Alexander Solovyov
6838a0793b update bigquery and netty (#50588) 2024-11-28 10:23:16 +03:00
adam-james
c45ea5c5ef Table Column Ordering Should Not Prevent Pivot Exports (#50599)
* Table Column Ordering Should Not Prevent Pivot Exports

Prior, when viz-settings existed for table column ordering, or if some columns were hidden in a regular table viz, the
pivot export could fail.

Now, if a pivot table is being exported, the table column sorting is properly ignored and the pivot export should work.

* address feedback
2024-11-28 02:36:16 +00:00
Denis Berezin
41dca76232 Fix issue with cypress config for e2e cross version tests (#50592) 2024-11-27 19:35:25 +00:00
Phoomparin Mano
8c2b6e8945 feat(sdk): make tooltips themeable (#50457)
* add background-inverse color mapping

* add tooltip themes

* tooltip theming

* apply to echarts tooltip

* update tooltip default color

* update tooltip defaults

* add sdk color mapping

* add additional theme colors

* add echarts tooltip story

* add loki tests

* remove background-inverse theme color option

* add to docs

* use ChartTooltipRoot for story and update loki snapshot

* update secondaryTextColor docstring

* fix unit tests
2024-11-27 18:38:29 +00:00
Phoomparin Mano
90979e9abd fix(sdk): entity picker theming fixes (#50449)
* use css variables for skeleton background color

* apply theme to folder color

* replace theme.white with themeColor

* use name of folder chevron color

* add background-inverse color mapping

* Revert "add background-inverse color mapping"

This reverts commit d0b546c583.

* avoid overriding folder chevron color in emotion

* use Mantine style overrides for NavLink
2024-11-28 00:27:12 +07:00
adam-james
f6aafc34b6 Backend Dependency Bump (#46309)
Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2024-11-27 17:13:04 +00:00
Chris Truter
0c964fe87c Fix CSV upload when materialized views are present (#50557)
Fixes https://github.com/metabase/metabase/issues/50501
2024-11-27 19:05:57 +02:00
Cam Saul
c6e9700797 Fix building with Java 11 and stop using Depstar (#50062) 2024-11-27 18:32:43 +03:00
Jeff Bruemmer
cab4af2e02 docs - notes on transparent embeds (#50377) 2024-11-27 14:58:26 +00:00
metamben
51d6ba5b6c Implement ISO day of week extraction (#50475)
* Implement ISO day of week extraction

Fixes #50424
2024-11-27 16:18:50 +03:00
Denis Berezin
1686e8a692 feat(sdk): Add cross-version e2e tests using a published SDK package (#50423) 2024-11-27 15:45:32 +03:00
Nicolò Pretto
fb0cf744e7 fix(sdk): make modals use the correct portal (#50565)
---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-11-27 13:32:09 +01:00
Chris Truter
89dbffbee5 Basic test for search reindexing (#50560) 2024-11-27 11:23:31 +00:00
lbrdnk
201a2ebee4 [Databricks] Add catalog validation into can-connect? implementation (#50468)
* Add catalog validation in can-connect? implementation

* Remove redundant let

* Adjust description

* Update modules/drivers/databricks/src/metabase/driver/databricks.clj

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

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2024-11-27 11:06:09 +01:00
Chris Truter
134702499b Enable New Search by default (#50520) 2024-11-27 06:36:23 +00:00
Chris Truter
b8c2c4b14d Send separate events for CSV appending and replacing (#50525) 2024-11-27 08:07:27 +02:00
Aleksandr Lesnenko
8d380fe7d1 temporarily hiding group into other (#50511)
* temporarily hiding group into other

* hide group into other

* remove assertions related to group into other

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-11-26 20:38:03 -05:00
Tyler Plude
0e7c6effa8 Adding .png version of no_results.svg to fix #49012 (#50426)
* Adding .png version of no_results.svg to fix #49012

* Adjusting text color to  to match existing color scheme

* Removing old unused no results assets; adding new png version of no_results.svg at matching resolution to pulse_no_results@2x.png

* Fixing namespace import cycle
2024-11-26 15:04:43 -08:00
Case Nelson
4ed8196c6d fix: snowflake allow setting schema to use (#50528)
Fixes: #50422

Although we passed additional-options through subname in url parameters
to DriverManager, we were also passing `:schema nil` as connection property.
2024-11-26 21:46:55 +00:00
Ryan Laurie
e118f02238 Fix embedding test build (#50542) 2024-11-26 14:40:41 -07:00
Jeff Bruemmer
1cfb805d94 docs - add expressions to list (#50473) 2024-11-26 15:52:41 -05:00
Jeff Bruemmer
af37dadef4 docs - Sankey (#50524) 2024-11-26 20:50:50 +00:00
adam-james
6780a67b53 Pivot Export Aggregations Improved and Won't Error (#50380)
* Pivot Export Aggregations Improved and Won't Error

Fixes #50207

WIP

- Totals now have appropriate aggregation implementation
- Totals for different row and column partial paths could collide before (eg. if a pivot-col value was equal to the
- measure idx), now the paths are unique and will not collide, causing errors

* add a test

* multiple measures need to have the correct order in each row

* clean up, add some comments explaining totals paths

* fix tests

* add test to show add-rows working correctly after :rows-part :cols-part added
2024-11-26 19:54:51 +00:00
bryan
26190d82c3 remove pivot-grouping row and columns in tandem (#50476)
* remove pivot-grouping row and columns in tandem

* add pivot card scalar test for csvs and xlsx.

* improve test feedback

* add a 'todo' for pivoted json exports

* indent
2024-11-26 12:32:24 -07:00
bryan
f1ee606e3a update our bug report template placeholder (#50519)
- so the placeholder matches the expected input
2024-11-26 12:32:15 -07:00
Chris Truter
79ca4f498a Restructure Search Module (#50471) 2024-11-26 18:25:21 +00:00
Alexander Polyankin
f584ab658d Use DataSelector in Field remapping options and delete unused legacy MBQL code (#50458) 2024-11-26 17:28:13 +00:00
Kamil Mielnik
202322f93d Add stage-number parameter to NativeParameterDimensionTarget (#50494)
* Add stage-number parameter to NativeParameterDimensionTarget

* Update unit test

* Recognize native query dimension parameters with stage-number

* Update test setup

---------

Co-authored-by: Tamás Benkő <tamas@metabase.com>
2024-11-26 16:48:21 +00:00
Alexander Polyankin
b7ab04d726 Use relative-time-interval in the QP for parameters (#50417) 2024-11-26 16:37:38 +00:00
Ryan Laurie
cfff2e84d4 Extend milestone setter timeout (#50515) 2024-11-26 16:11:09 +00:00
Mahatthana (Kelvin) Nomsawadi
ee23a50124 Disable ?locale on static embeds/public links (#50391)
* Disable `?locale` on static embeds/public links

* Fix E2E tests

* Add a new line for consistency
2024-11-26 15:13:36 +00:00
Alberto Perdomo
a4363903c1 Update links for SDK npm so they actually point to the npm page (#50499)
* Update link to SDK npm page

* Update link to SDK npm page
2024-11-26 15:02:05 +00:00
Chris Truter
ce5f60b7ca Enable New Search tests in CI (#50386) 2024-11-26 14:50:12 +00:00
Aleksandr Lesnenko
948bd56469 fix inability to select breakout dimension before metric (#50433) 2024-11-26 09:38:32 -05:00
github-automation-metabase
b90620b0d9 Add v0.51.5 to the list of releases (#50507)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-11-26 09:04:44 -05:00
Alexander Polyankin
87a28bab93 Fix pivot collapsed rows with legacy viz settings (#50410) 2024-11-25 19:31:36 -05:00
Romeo Van Snick
54a356a60a Replace postcss-nesting with postcss-nested (#50437)
* Add postcss-nested

* Use postcss-nested over postcss-nesting
2024-11-26 09:11:40 +11:00
Chris Truter
162437a227 Delete Hybrid Index Search (#50444) 2024-11-25 19:47:51 +00:00
Phoomparin Mano
7828b5e291 fix(sdk): show loader right after visualizing in notebook editor for the first time (#50411)
* show sdk loading state when visualizing for the first time

* rename to isQueryResultLoading

* check for loading indicator

* add notes on slow 3G
2024-11-26 02:37:57 +07:00
Aleksandr Lesnenko
095f1a1a74 sankey chart visual tests (#49457)
* sankey visual specs, polish

* Update Loki Snapshots

* improve type

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-11-25 18:04:13 +00:00
John Swanson
25bab869a4 Don't dissoc :id in before-update (#50375)
* Don't dissoc `:id` in `before-update`

There seems to be a nasty footgun in toucan2 here.

Say you're executing an `update!` command on a set of IDs, e.g.:

```
(t2/update! :model/Card :id [:in 1 2] {:view_count 1})
```

This works if:

- both cards 1 and 2 have `view_count=1` already

- both cards 1 and 2 have `view_count!=1`

However.

If one of the two cards has `view_count=1` and another has a different
view_count, then (if the `before-update` method doesn't have the primary
key attached) Toucan emits a call to update *every card in the
database*, without a where clause at all.
2024-11-25 08:26:59 -08:00
Mahatthana (Kelvin) Nomsawadi
c7e0bc4cf8 docs(sdk): Manually update chaneglog for master (#50447)
* Manually update chaneglog for master

* Update more changelog entry

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

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
2024-11-25 14:10:51 +00:00
Alberto Perdomo
62333310e3 Update npm packages from 1.xx.y to 0.xx.y (#50409) 2024-11-25 09:54:08 +00:00
Romeo Van Snick
5f86ebe6ee Simplify epic template to allow for easier editing (#50248)
* Simplify epic template to require easier editing

* Remove superflouous 'if any'

* Rename engineering doc to technical design doc

* Add link for testing plan

* Remove feature branch sentence
2024-11-25 14:38:41 +11:00
Denis Berezin
075163202f feat(sdk): migrate existing sdk tests to cypress component testing
* feat(sdk): migrate existing sdk tests to cypress component testing

* Self review
2024-11-23 10:05:05 +00:00
Cam Saul
d436dafd2c CI: Create dummy successful jobs for skipped driver jobs (#50432)
* Trigger CI tests

* Add dummy job generator

* [DO NOT MERGE] Remove driver test config from the list of backend changes

* Add missing runs-on

* Avoid too much nesting

* Revert changes to file paths and README
2024-11-22 23:39:39 +00:00
Kamil Mielnik
6694870932 [Epic] Show columns from all stages in the dashboard filters (#47167)
* FE - Allow to use in dashboard filters both pre- and post- last aggregation columns (#46670)

* Extract getFilterStageIndexes

* Update comment

* Include 2 last stages in filterable columns in getParameterColumns

* Move getJoinQueryHelpers to test-helpers

* Add basic query creation

* Add breakout columns

* Make tableName optional

* Implement 1-stage test, refactor assertions

* Rename

* Move filter utils up

* Use getGroupItems and appendStageIfAggregated in getFilterableColums

* Introduce Lib.filterGroups

* Revert "Introduce Lib.filterGroups"

This reverts commit 5f8b2d098e.

* Don't reuse getGroupItems or appendStageIfAggregated

* Move getFilterStageIndexes out of Lib

* Format code

* Revert types move

* Revert functions move

* Improve diff

* Group dashcard mapping options

* Adjust existing getParameterColumns usages (except unit tests)

* Remove redundant call

* Fix filtering

* Update unit tests

* Format code, remove TODO

* Add stage index assertions

* Add model test for 1-stage query

* Add partial boilerplate for 2-stage query

* Add a 2-stage case

* Add a 2-stage case for model

* Update unit test

* Fix click behavior mapping

* Remove duplicated functions

* Remove complex return type

* Move appendStageIfAggregated and getFilterStageIndexes to metabase-lib/filter.ts

* Re-group columns based on stage index instead of using ML-returned references for comparison

* Add new options to dimension types

* Use the new stage-number option

* Rename appendStageIfSummarized to ensureFilterStage and add explanatory comment

* Remove duplicated ensureFilterStage after merge

* FE - e2e - Cover dashboard filters with tests (#46958)

* Extract getFilterStageIndexes

* Update comment

* Include 2 last stages in filterable columns in getParameterColumns

* Move getJoinQueryHelpers to test-helpers

* Add basic query creation

* Add breakout columns

* Make tableName optional

* Implement 1-stage test, refactor assertions

* Rename

* Move filter utils up

* Use getGroupItems and appendStageIfAggregated in getFilterableColums

* Introduce Lib.filterGroups

* Revert "Introduce Lib.filterGroups"

This reverts commit 5f8b2d098e.

* Don't reuse getGroupItems or appendStageIfAggregated

* Move getFilterStageIndexes out of Lib

* Format code

* Revert types move

* Revert functions move

* Improve diff

* Group dashcard mapping options

* Adjust existing getParameterColumns usages (except unit tests)

* Remove redundant call

* Fix filtering

* Update unit tests

* Format code, remove TODO

* Add stage index assertions

* Add model test for 1-stage query

* Add partial boilerplate for 2-stage query

* Add a 2-stage case

* Add a 2-stage case for model

* Update unit test

* Fix click behavior mapping

* Remove duplicated functions

* Remove complex return type

* Remove unused @ts-expect-error directive
- use createQuestionAndDashboard helper instead of command
- sort imports

* Add boilerplate for query stages test suite

* Add createDashboard

* Try out the new function

* Organize code

* Add descriptions

* Move visitDashboard call out of createDashboard

* Move appendStageIfAggregated and getFilterStageIndexes to metabase-lib/filter.ts

* Re-group columns based on stage index instead of using ML-returned references for comparison

* Add boilerplate for base questions

* Add assertions for mapping options

* Simplify verifyDashcardMappingOptions interface

* Add assertions for all types of parameters

* Update test name

* Format code

* Add new options to dimension types

* Use the new stage-number option

* Add Q2 creation

* Introduce helper constants

* Rename appendStageIfSummarized to ensureFilterStage and add explanatory comment

* Add cases for models

* Extract subroutines

* Add Q3

* Extract createQ2Query and createQ3Query

* Extract createQ1uery, remove createM1

* Optimize verifyPopoverMappingOptions

* Add more assertions

* Add model assertions

* Add tooltip assertion

* Break large functions down

* Restructure tests to prevent memory-related crashes

* Refactor

* Update comment

* Update comment

* Remove createQ1

* Remove createQ2, createQ3

* Refactor

* Refactor

* Comment out failing assertions

* Add Q3 assertions

* Add Q3 assertions

* Add comment

* Introduce createAndVisitDashboardWithQueryMatrix

* Add Q4

* Fix assertions

* Add repro tags

* Add comment

* De-hardcode indexes

* Add Q5-Q8

* Rename

* Add Q5

* Add Q6

* Add Q7 & Q8

* Add Q9

* Fix structure

* Reuse Lib.ensureFilterStage

* Fix unit of time parameters

* Support explicit and implicit stage numbers for temporal-unit params

* Extend test with temporal unit parameter with stage number

* Update unit tests

* Let stage-path handle nil (default) stage-number

---------

Co-authored-by: Tamás Benkő <tamas@metabase.com>

* Allow filtering on columns from all stages in dashboards (#48254)

* Allow filtering on columns from all stages in dashboards

* Update tests

* Clean up

* Update unit tests

* Distinguish multiple "Summaries" column groups in dashboard filter mapping (#48261)

* Allow filtering on columns from all stages in dashboards

* Update tests

* Clean up

* Update unit tests

* Distinguish multiple "Summaries" column groups

* Fix imports

* Remove redundant attribute

* Update import

* Allow filter params targeting native stages (#48379)

* Move filters on nested native stages to parent stage in expand-mbql-params

Similar to the existing handling in move-join-condition-to-source-query.

This fixes filter params that directly target a native stage with a non-negative :stage-number, e.g. when applying
dashboard filters to a card where the card query is native.

Fixes #48258

* Add test for filter params explicitly targeting nested native queries

* FE - e2e - Cover dashboard drills with tests (#48289)

* Allow filtering on columns from all stages in dashboards

* Update tests

* Clean up

* Update unit tests

* Distinguish multiple "Summaries" column groups

* Fix imports

* Remove redundant attribute

* Fix type

* Add a test

* Add a test

* Reduce flakiness

* Fix race conditions with last_used_param_values
- see https://metaboat.slack.com/archives/C010L1Z4F9S/p1727947712609579

* Add a temporary workaround

* Fix name

* Fix applying parameters in Question

* Revert "Fix type"

This reverts commit 67f6778d50.

* Rename and reorder tests

* Add more tests

* Update tests to avoid hitting https://github.com/metabase/metabase/issues/46774

* Add Q8 tests and fix tests for Q9

* Update assertions

* Update assertions because of https://github.com/metabase/metabase/issues/48339

* Improve test names

* Add test

* Skip failing test

* Add more tests

* Add test

* Remove redundant code

* Remove invalid cases

* Add test

* Add tests

* Add more assertions

* Add more assertions

* Add assertions

* Add assertions

* Use helper functions

* Use helper functions

* Nest helpers consistently throughout the file

* Decrease flakiness

* Revert "Add a temporary workaround"

This reverts commit 48ed8770d6.

* Add a temporary workaround

* Add tests

* Add assertions

* Add tests

* Update unit tests

* Make temporary workaround safer

* Add TODOs to github links

* Extract a function to improve readability

* Simplify getParametersMappedToDashcard

* Fix failing tests by calling Lib.ensureFilterStage in the correct place and properly identifying the originalQuestion so that Question.prototype.isDirtyComparedTo returns expected result

* Remove redundant code

* Quick dirty fix to run in CI

* Format code

* Format code

* Update unit tests

* Fix test setup

* Revert "Remove redundant code"

This reverts commit 35b47a10f2.

* Use Lib.areLegacyQueriesEqual

* Create a new e2e test group: dashboard-filters-2 (#48610)

* Allow filtering on columns from all stages in dashboards

* Update tests

* Clean up

* Update unit tests

* Distinguish multiple "Summaries" column groups

* Fix imports

* Remove redundant attribute

* Fix type

* Add a test

* Add a test

* Reduce flakiness

* Fix race conditions with last_used_param_values
- see https://metaboat.slack.com/archives/C010L1Z4F9S/p1727947712609579

* Add a temporary workaround

* Fix name

* Fix applying parameters in Question

* Revert "Fix type"

This reverts commit 67f6778d50.

* Rename and reorder tests

* Add more tests

* Update tests to avoid hitting https://github.com/metabase/metabase/issues/46774

* Add Q8 tests and fix tests for Q9

* Update assertions

* Update assertions because of https://github.com/metabase/metabase/issues/48339

* Improve test names

* Add test

* Skip failing test

* Add more tests

* Add test

* Remove redundant code

* Remove invalid cases

* Add test

* Add tests

* Add more assertions

* Add more assertions

* Add assertions

* Add assertions

* Use helper functions

* Use helper functions

* Nest helpers consistently throughout the file

* Decrease flakiness

* Revert "Add a temporary workaround"

This reverts commit 48ed8770d6.

* Add a temporary workaround

* Add tests

* Add assertions

* Add tests

* Update unit tests

* Make temporary workaround safer

* Add TODOs to github links

* Extract a function to improve readability

* Simplify getParametersMappedToDashcard

* Fix failing tests by calling Lib.ensureFilterStage in the correct place and properly identifying the originalQuestion so that Question.prototype.isDirtyComparedTo returns expected result

* Remove redundant code

* Quick dirty fix to run in CI

* Format code

* Format code

* Update unit tests

* Fix test setup

* Create a new e2e test group because the old one was timing out in CI

* Add the group to GH action

* Revert "Remove redundant code"

This reverts commit 35b47a10f2.

* Use Lib.areLegacyQueriesEqual

* FE - e2e - Cover combination of unit of time parameter + non-last-stage filters with tests (#48726)

* Add JSDoc for entityPickerModalItem

* Add addToDashboard parameter to saveQuestion

* Add JSDoc for saveQuestion

* Fix import

* Add a test reproducing the bug

* Try to fix unit of time parameters

* Fix wrong stage-index for temporal unit parameters on composed ad hoc questions

* Fix ad-hoc question naming when there is an empty extra filter stage

* Fix unit tests

* FE - Do not add extra filtering stage for pivot tables (#48975)

* Avoid using Lib.ensureFilterStage for pivoted questions

* Fix unit test setup

* Add tests for pivot tables

* Optimize tests

* Test filter modal

* Revert redundant changes

* [WIP] Dashboard filter columns be fixes (#48906)

* Revert "Add a temporary workaround"

This reverts commit 4ea374870d.

* Fix some of the issues and unskip some of the E2E tests

* Acknowledge that metrics are transparent

* Fix breakouts by the same column with different temporal-units

* Use non-negative stageIndex for temporal unit parameters

* Add stage if there is an explicit reference to stage after the last

Instead of duplicating the ensure-filter-stage logic, just check if there is a parameter referencing the filter
stage (which is always one after the last in the query). If there is such a reference, add that stage.

---------

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

* Require only breakouts when adding new stage in ensure-filter-stage (#49067)

* Only require breakouts when adding new stage in ensure-filter-stage

Previously, this function required both breakouts and aggregations.

Closes #48339

* Update e2e tests after changes to Lib.ensureFilterStage

This resolves all-but-one of the TODOs related to #49339

Related to #49022

* Implementing parameter_mappings migration (#49256)

* FE - e2e - Update tests after `Lib.ensureFilterStage` changes (#49222)

* Unskip #19744 repro

* Remove sanity checks

* Update comment

* Fix typo

* Remove invalid test

* Ignore pivoted "table" viz and and inline Question.prototype.isPivoted

* Remove test for pivoted table

* FE - e2e - Click behavior (#49239)

* Unskip #19744 repro

* Remove sanity checks

* Update comment

* Fix typo

* Remove invalid test

* Ignore pivoted "table" viz and and inline Question.prototype.isPivoted

* Remove test for pivoted table

* Add a test

* Disable columns from non-last stage in click behavior

* Finish the test

* Refactor

* FE - e2e - Cover public & embedded dashboards with tests  (#49280)

* Add test for public dashboard

* Add test for embedded dashboard

* Add comment

* Add test for 2nd stage column

* Add test for 2nd stage aggregation column

* Add test for 2nd stage breakout column

* Add assertions for models

* Handle no auto-pivoting of ad-hoc questions from drill thrus

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>

* Add missing test setup

* Address some review comments (#49429)

* FE - Show columns from all stages in click behavior (target question)  (#48828)

* Add JSDoc for entityPickerModalItem

* Add addToDashboard parameter to saveQuestion

* Add JSDoc for saveQuestion

* Fix import

* Add a test reproducing the bug

* Try to fix unit of time parameters

* Fix wrong stage-index for temporal unit parameters on composed ad hoc questions

* Fix ad-hoc question naming when there is an empty extra filter stage

* Fix unit tests

* Fix non-unique keys

* Add stage-number to click behavior dimension target

* Call Lib.ensureFilteringStage in click behavior

* Use describeEE because click behavior tests use setTokenFeatures("all")

* Stop testing implementation details

* Stop testing implementation details

* Stop testing implementation details

* Modernize test and make it less flaky

* Address flake source

* Fix SAMPLE_DB_ID

* Unskip repro for #19744

* Add a test

* Update test name

* Introduce verifyNotebookQuery

* Use verifyNotebookQuery

* Use verifyNotebookQuery

* Move verifyNotebookQuery to helpers

* Assert items count in verifyNotebookQuery

* Extract helper functions

* Rename helpers

* Refactor

* Consistent comments

* Extract verifyVizTypeIsLine

* Add scrollIntoView calls for extra safety

* Add TODO

* Use verifyNotebookQuery

* Make stages optional

* Add createMultiStageQuery

* Remove redundant scrollIntoView calls
- We don't need them because the assertions are not using "be.visible"

* Improve test setup

* Add more assertions

* Add more assertions

* Add basic join support to verifyNotebookJoins

* Unnest code

* Implement join assertions

* Implement expressions and sort assertions

* Simplify code

* Add commented-out assertions

* Yes, it is correct
- it's stageIndex which sourceColumn comes from in sourceQuery

* Conditionally apply filter stage

* Allow mapping to all stages in click behavior

* Remove redundant argument

* Simplify diff

* Simplify diff

* Update test setup

* Remove TODO related to metabase#49282
- Closes #49282

* Support fetching param values on filter stage (#50120)

* Support fetching param values on filter stage

Fixes #48613

* Fix temporal-unit-parameters

* Enrich dimension targets in click_behavior with stage-numbers (#49911)

* Enrich dimension targets in click_behavior with stage-numbers

Fixes #49110

* Add missing stage-number

* Remove changeSynchronousBatchUpdateSetting references

* Update assertions to include time bucket

* Use mbql.u/legacy-last-stage-number in metabase.query-processor.card

---------

Co-authored-by: Tamás Benkő <tamas@metabase.com>
Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2024-11-23 01:49:10 +03:00
Noah Moss
e9f6c507db Check download perms recursively on referenced card-ids (#50307) 2024-11-22 22:27:09 +00:00
Sloan Sparger
50585b3189 Allow questions to run if there's an invalid loading-message setting value (#50419)
* prevent the UI from breaking if there is an invalid enum value set by MB_LOADING_MESSAGE

* add test case

* add enum validation on backend

* oops - fix set-value-of-type! call

---------

Co-authored-by: Noah Moss <noahbmoss@gmail.com>
2024-11-22 16:21:24 -06:00
Sloan Sparger
a14e5f75bf [Clean Up] Show alert with 3 month stale content rather than 6 (#50376)
* make the collection clean up alert show if content 3 months stale, rather than 6

* make test more robust
2024-11-22 16:09:53 -06:00
Jeff Bruemmer
e23bd004e2 sdk readme (#50372) 2024-11-22 22:06:47 +00:00
metamben
7393892bff Normalize :temporal_units in action, card, and dashboard entries (#50418)
* Normalize :temporal_units in action, card, and dashboard entries

Fixes #50371
2024-11-22 23:56:25 +03:00
Aleksandr Lesnenko
a9841dad20 sankey chart (#46245)
* sankey prototype

* formatting, tooltips

* layout, formatting

* handle invalid settings

* use metabase color palette

* add missing data for click behavior, hovers, add clicks support

* smart sankey default columns selection

* check more columns

* fix tooltip shows incorrect values for nodes

* polish, specs

* extend the viz settings type with sankey settings

* add isSensible to SankeyChart

* specs on sankey default columns computation

* import correct column predicates

* revert outdated changes in graph.js

* sankey colors

* format values in sankey tooltip

* change default sankey edge color to source

* increase the default size of sankey dashboard cards

* improve error messages

* use echarts option to hide overlapping labels

* increase padding

* click behavior, tooltip values

* fixes

* fix rebase: getFriendlyName got removed

* layout, labels

* polish

* remove non-existing viz type

* update spec

* polish
2024-11-22 12:52:09 -05:00
Nemanja Glumac
ed00dfd3ce Document null vs undefined setting type (#39223)
* Document `null` vs `undefined` setting type

* Improve the comment
2024-11-22 18:40:55 +01:00
Alexander Polyankin
65bdbe6e04 Migrate segment editor to MBQL lib (#50311) 2024-11-22 15:35:34 +00:00
Phoomparin Mano
5317db6d60 fix(sdk): summarize sdk component crashes with stage index errors (#50400)
* use -1 for stage index for breakout and aggregation list

* add e2e tests

* remove sum of total in e2e

* use test id matcher

* add issue to e2e name

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

* move stageIndex to a separate variable

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-11-22 22:15:52 +07:00
Alexander Polyankin
b378247ca2 Remove metabot v2 (#50384) 2024-11-22 09:27:54 -05:00
Chris Truter
7232d91a4e A single spae (#50405) 2024-11-22 17:18:56 +03:00
Ngoc Khuat
77fb4fceb6 Search ingestion test (cont) (#50399) 2024-11-22 16:09:35 +02:00
Ngoc Khuat
43a7c3f641 Search index EE ranker tests (#50342) 2024-11-22 14:06:10 +00:00
Ngoc Khuat
092a4fb63a Card ingestion test (#50388) 2024-11-22 17:33:05 +07:00
Cam Saul
ac9ba610ba 🏎️ 🚀 Partition Postgres CI jobs; shave 10 minutes off of CI 🏎️ 🚀 (#48699)
* Partition Postgres jobs (alternate approach)

* Make sure we're still testing SSL

* Improved Postgres job naming
2024-11-22 12:19:31 +02:00
Nemanja Glumac
8b1ffdf094 Unify (app) banners (#50356)
* Unify banners

* Fix and update unit tests
2024-11-22 10:45:33 +01:00
Chris Truter
6be94ca238 Provide a generic way to override search filter defaults (#50389) 2024-11-22 12:04:22 +03:00
Filip Hric
9f00d56275 add capability for sending bug reports (#49875)
* add capability for sending bug reports

* fix typing, linting and testing errors

* fix failures in unit and e2e tests

* fix ts error

* add bug report RTK

* move MB_BUG_REPORT_ENABLED handling to backend

* move bug reporter setting to global settings

* fix type errors

* fix bug-report-enabled setting visibility

* add options map to slack postMessage funcion

* fix failing tests

* fix post-chat-message handling

* fix type error

* rename bug reporting setting
2024-11-22 09:31:07 +01:00
Mahatthana (Kelvin) Nomsawadi
d96814e204 Improve SDK release job title (#50318) 2024-11-22 05:36:10 +00:00
Chris Truter
515111f761 Fix weight fallback, and fix the reason tests didn't run (#50370) 2024-11-22 05:02:48 +00:00
Jeff Bruemmer
d8843159f6 remove note on quotes 2024-11-21 18:43:10 -05:00
Nemanja Glumac
e96c532f8c Center the content of the "Onboarding" page (#50368) 2024-11-21 23:22:15 +01:00
Nemanja Glumac
106686bca9 Update videos for the "Onboarding" page (#50367) 2024-11-21 23:21:57 +01:00
Nick Fitzpatrick
b8c549b938 updating @reduxjs/toolkit (#50354)
* updating @reduxjs/toolkit

* kick ci

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
2024-11-21 16:55:27 -04:00
metamben
bd3fa8c064 Prevent coercion after nesting for all fields with coercion-strategy (#50289)
Fixes #48721
2024-11-21 23:21:49 +03:00
Sloan Sparger
b350934a12 [Trash] Track items being moved to trash (#49248)
* track items being moved to trash

* fix spelling

* fix unit tests
2024-11-21 14:01:24 -06:00
Aleksandr Lesnenko
bcc0b566b1 hide pivoted exports under env var (#50347)
* hide pivoted exports under env var

* only export pivoted when the env var is true

Also added tests to confirm.

* must specify :export for public settings

* spec

* change setting to :internal since it's only via env var

* use correct visibility add setting to settings.yaml for serialization

---------

Co-authored-by: Adam James <adam.vermeer2@gmail.com>
2024-11-21 11:48:47 -08:00
Jeff Bruemmer
53d97cc29c docs - note about metrics permissions (#50352)
* note about metrics permissions

* clarify viewing and editing

* clollection
2024-11-21 13:54:55 -05:00
John Swanson
401d7dbc38 Fix broken migration on MySQL 8.0.17 (#50350)
On MySQL 8.0.17, the following is prohibited:

```
WITH RECURSIVE MyRecursiveCTE (...) AS
(
  SELECT ... FROM bar UNION ALL
  SELECT ... FROM bar JOIN MyRecursiveCTE ON ...
)
```

Instead, you need to do:

```
WITH RECURSIVE MyRecursiveCTE (...) AS
(
  SELECT ... FROM bar UNION ALL
  SELECT ... FROM MyRecursiveCTE JOIN bar ON ...
)
```

Basically, just putting the CTE on the left vs. the right side of the
join (which is exactly equivalent under the hood) fixes the issue.

I can't actually find any documentation of this change, but it seems
that sometime between MySQL 8.0.17 and MySQL 8.0.33, MySQL started
allowing this, perhaps just an optimization where it now notices the
equivalence and does the right thing.

I originally tested this on what I believed was the oldest version of
MySQL we supported, but didn't read carefully enough. We recommend
8.0.33 or higher here:

https://www.metabase.com/docs/latest/databases/connections/mysql

But that's not for the AppDB - for that, we recommend 8.0.17 or higher.
2024-11-21 10:26:20 -08:00
Alexander Solovyov
df2e240446 [search] metrics in logs and exported to prometheus (#50339) 2024-11-21 17:40:46 +00:00
Sloan Sparger
5300031161 [Auto Clean-up] Add alert prompting admins to clean up a collection (#48381)
* add alert to prompt admins to clean up a collection

* clean up

* pr feedback

* fix i18n issue

* copy changes
2024-11-21 11:20:43 -06:00
Hervé Labas
02039eebb9 Add metrics support in diagnostics dialog (#50329)
* Add metrics support in diagnostics dialog
* Update unit test
2024-11-21 16:45:35 +00:00
Chris Truter
bc59e29174 Search Index: allow weight overrides per context (#50338) 2024-11-21 16:24:26 +00:00
Nemanja Glumac
f2d207df03 Do not show PaymentBanner on hosted instances (#50337)
* Do not show `PaymentBanner` on hosted instances

* Add test for the missing token status
2024-11-21 15:18:59 +00:00
Nicolò Pretto
e655081bc6 fix padding on published embeds list (#50268)
* fix padding on published embeds list

* add border to public links shared list to be consistent with embeds
2024-11-21 16:16:17 +01:00
Ngoc Khuat
7d76ab179f More search index ranker test (#50314) 2024-11-21 14:40:40 +00:00
John Swanson
2f8a7c697e Fix serdes of missing cards in click behavior (#50108)
* Fix serdes of missing cards in click behavior

When exporting a dashboard, we export its dashcards, including cards
referenced inside its viz_settings.

The problem is that viz_settings might have references to
now-nonexistent cards.

This is an initial stab at cleaning up the problem, specifically for
click behavior. If Dashboard D has Dashcard DC, which has a
click-behavior that links to Card C, then when we collect the
descendants of D, we'll include a reference to C - even if C has been
deleted.

So this makes two changes: first, when calculating the descendants of a
dashcard, don't include links to cards that don't exist. And, when
exporting the click behavior, remove the whole thing entirely if the
card it points to doesn't exist.
2024-11-21 05:23:07 -08:00
Chris Truter
21aff9dc7a Search Index refactor: calculate model rank on the fly (#50330)
Make model ranking dynamic, so that:

1. We can experiment with it on-the-fly in Stats.
2. We can make it context dependent in future.
2024-11-21 14:27:46 +02:00
Ngoc Khuat
80b7dcbb29 Channel test return error response (#50254) 2024-11-21 12:23:15 +00:00
Phoomparin Mano
5f6b9ecb17 fix(sdk): entity picker's hover and accent colors are not mappable via sdk theming (#50299)
* add stories for dark theme

* add dark theme editor stories

* add entity picker colors

* add editor-only picker

* remove redundant story wrapper for dark theme stories

* add theme keys to docs

* add warning message
2024-11-21 19:01:10 +07:00
github-automation-metabase
3990a6ea06 Update Readme version references and published npm version to 0.52.2-nightly (#50326) 2024-11-21 11:06:57 +00:00
Mahatthana (Kelvin) Nomsawadi
f1e738fc34 ci(sdk): Fix can't build SDK from master (#50319)
* Prevent tests file from being imported when building SDK

* Exclude more test files from SDK build
2024-11-21 10:49:31 +00:00
Ngoc Khuat
8513bc970a Handlebars helper ⚒️ (#50004) 2024-11-21 10:46:37 +00:00
Chris Truter
66e2910241 Basic Search Index Ranker tests (#50275) 2024-11-21 09:19:09 +00:00
Mahatthana (Kelvin) Nomsawadi
69802d15ec Put #locale under pro plan (#50219)
* Put `#locale` behind the feature flag

* Prepare folder structure for unit testing

* Refactor: extract a setup function as a shared util

* Add #locale tests

* Add all tests

* Prepare folder structure for unit testing

* Refactor: extract a setup function as a shared util

* Add locale tests

* Add all questions tests

* Fix failed E2E

* Tidy up questions tests

* Tidy up dashboards tests

* Fix test name typo

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

---------

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2024-11-21 08:52:10 +00:00
Phoomparin Mano
3f2f855cd0 fix(sdk): emit typescript files in the embedding cli when in a typescript project (#50278)
* emit typescript when in a typescript project

* also check dependencies for typescript dep
2024-11-21 15:21:39 +07:00
Romeo Van Snick
79858b9fa2 Allow searching a single select list picker (#49739)
* Allow searching a single select list picker

* Fix unit tests

* Add repro for 49642

* Remove selection when searching

* Rename parameter to value because it does not need to be a prefix

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

* Simplify loading state for ListField

* Use same DEBOUNCE_FILTER_TIME in ListField

* Don't rely on waitTimeContext in test

* Fix lint

* Add initialization state for filter widget

* Update Loki Snapshots

* Update Loki Snapshots

* Allow picking other values when selecting a single value dropdown value

* Add comment about initialization

* Use setup in test

* Update Loki Snapshots

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-11-21 15:53:31 +11:00
Ngoc Khuat
918925ad60 Handlebars reloadable templates (#49950) 2024-11-21 10:06:00 +07:00
bryan
379cf342d3 actually return values from getHidden (#50295)
* actually return values from getHidden

- Arrow functions with {}'s do not implicitly return!

* boolean fiddling
2024-11-20 21:28:28 +00:00
Phoomparin Mano
64219be813 fix(sdk): fix wrong e2e import path causing ci failure (#50297) 2024-11-20 20:22:13 +00:00
Phoomparin Mano
43ffbf0b24 fix(sdk): cli suggests a relative import path with reminder message (#50276)
* update suggested import path

* update suggested import path

* add small tests for import paths

* update comments

* clarify the import path message

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-11-21 02:55:14 +07:00
Phoomparin Mano
5fb95767da feat(sdk): revamp CreateQuestion and create question behaviour (#50088)
* revamp the create question component

* docs updates

* add stories and update styles

* prevent switching to visualization when it is not ready

* ensure CreateQuestion works in flex parents

* add basic e2e tests for CreateQuestion

* ensure that switching between editor and visualization works

* use the save button for the disabled state

* update the question title when the question is saved

* implement updating questions in place

* rename replaceQuestion

* make CreateQuestion props all optional

* add background color to modal header

* hide the save button if question is dirty

* hide save button instead of disabling per design feedback

* update e2e tests

* revert e2e helpers

* add title update assertions

* whitespace changes
2024-11-21 01:11:56 +07:00
github-actions[bot]
1ac47c7425 Update Translations for v51.5 (#50163)
* Add new strings for v51.4

* Update translations

* kick ci

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2024-11-20 10:45:17 -07:00
Tyler Plude
b4f057ab47 adding Tyler to DashViz team (#50181) 2024-11-20 09:36:58 -08:00
Roman Abdulmanov
3a5a7f385e Updated codeowners (#50285) 2024-11-20 17:24:39 +00:00
Jeff Bruemmer
3e3f408c09 fix links (#50282) 2024-11-20 12:06:14 -05:00
Ngoc Khuat
0002f20c6d skip connection check when creating/updating channel (#49661)
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2024-11-20 16:00:40 +00:00
Roman Abdulmanov
e96e46015d Bug triage fix (#50271) 2024-11-20 15:53:03 +00:00
Alberto Perdomo
55a4540329 Sdk update react next versions (#50222)
* Update versions in SDK introduction

* SDK - Update next-js versions

* Tweak wording about React versions

* Tweak Next.js versions

* Bump node version to 20

* Bump node version to 20
2024-11-20 14:58:40 +00:00
Kamil Mielnik
12f85cbb79 Fix - Notebook expression editor autocomplete issues (#49949)
* Allow navigating with arrow up/down between lines in expression editor

* Do not hijack up/down arrow keys for autocomplete suggestions navigation when there's only 1 suggestion

* Add explanatory comments

* Convert tokenizer to TS

* Add a test

* Format code

* Add basic test case

* Fix a deprecation

* Handle incomplete bracket identifier tokens

* Shorten code

* Add comment

* Fix suggestion not always getting selected

* Fix computation

* Fix types

* Update comment

* Add repros for #49882

* Add repro

* Fix comment

* Deprecate a HOC

* Update assertion

* Remove _.compose and default export

* Fix types in ExplicitSize

* Fix typing in ExpressionEditorTextfield

* Fix types

* Fix error handling

* Fix showing errors when expression is invalid

* Do not submit null expressions

* Fix typing

* Update assertion

* Fix flaky test

* Fix filter

* Decrease flakiness

* Fix crashing

* Add comment

* Fix incomplete bracket idenfitiers

* Fix type

* Improve typing

* Add an explanatory comment
2024-11-20 19:10:41 +07:00
Chris Truter
fbd2a24d0a Rank based on when the current user last viewed the item (#50224)
* Rank based on when the current user last viewed the item

* Fix tests
2024-11-20 13:02:43 +03:00
Mahatthana (Kelvin) Nomsawadi
9ed2c3a26f Quarantine the flaky assertions (#50198)
* Refactor: Speed up E2E tests by not relying on UI

* Quarantine flaky E2E assertions
2024-11-20 06:46:58 +00:00
Romeo Van Snick
e900711e8d Render table header when dataset is empty (#50136)
* Allow TableInteractive to render it's own empty message

* Pass renderEmptyMessage to visualization in model editor

* Add reproduction for #37300

* Use double equals ofr null check

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

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-11-20 09:22:19 +11:00
Romeo Van Snick
9bd17d26f7 Do not show values initially when single select search does not have a filter value (#49577)
* Do not show values initially when single select search does not have a filter

* Add repro for 49577

* Reword test case

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>

* Fix e2e test

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2024-11-20 09:22:00 +11:00
appleby
23cc30fe17 Prevent an exception in api.table/batch-fetch-card-query-metadatas when cards is empty (#50115)
* Don't try to fetch dbs for zero cards in api.table/batch-fetch-card-query-metadatas

Closes #48461

Ensure we don't throw an exception by attempting to fetch the Databases associated with potentially-deleted card ids in
api.table/batch-fetch-card-query-metadatas.

In particular, this ensures we don't generate an exception if the user does the following

1. Create a card "Source Card"
2. Create another card "Derived Card" with a :source-table of "Source Card"
3. Add Derived Card to a dashboard
4. Permanently delete (not just archive) the Source Card

* Add test for virtual-table query-metadata with deleted source card

* Add test for dataset query_metadata with deleted source card

* Add test for dashboard query-metadata with deleted source card

* Add test for card query-metadata with deleted source card

* Add metabase.api.test-util and use it in query-metadata-with-deleted-card tests

* Replace copy/pasted debug helpers with select-query-metadata-keys-for-debugging
2024-11-19 14:09:17 -08:00
Uladzimir Havenchyk
47d81c46bc chore: forbid legacyQuery usage with eslint (#50141)
* chore: forbid legacyQuery usage with eslint

* fixup

* fixup
2024-11-20 00:41:45 +03:00
Jeff Bruemmer
6895e51d4e add doc alias for generating docs (#47156) 2024-11-19 16:07:11 -05:00
Phoomparin Mano
5bbb9f847a feat(sdk): ability to render question layout when drilling down in interactive dashboard (#50017)
* allow passing custom views to underlying ad-hoc questions

* update readme docs

* accept component instead

* tweak layout story

* update docs

* add e2e tests

* cleanup tests

* remove incorrect tests

* simplify tests

* rename prop to renderDrillThroughQuestion and update docs

* swap docs order

* add missing marker

* clarify drill-through naming

* replace dead links
2024-11-20 03:00:35 +07:00
Jeff Bruemmer
893e297e0d onboarding checklist copy (#49570) 2024-11-19 19:11:22 +00:00
Chris Truter
1ecd0da57f Experimental search tweaks #2 (#50214) 2024-11-19 18:48:02 +00:00
Aleksandr Lesnenko
aa140ef998 Make iframe dashcards more permissive (#50177)
* allow more iframe attributes

* make iframe sandbox more permissive

* update spec
2024-11-19 13:46:08 -05:00
github-automation-metabase
c7bb60c811 Add v0.51.4 to the list of releases (#50189)
* Add v0.51.4 to the list of releases

* add 50.34

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2024-11-19 18:28:04 +00:00
Uladzimir Havenchyk
824545546a ci: attempt to fix trivy rate limit issue (#50225) 2024-11-19 17:51:25 +00:00
metamben
e2522f4fa7 Fix model conversion (#50215) 2024-11-19 16:39:35 +00:00
Chris Truter
5be9510069 For new search, default to excluding other people's collections (#50146) 2024-11-19 16:05:46 +00:00
Jeff Bruemmer
731497f63f docs - note on offset and rows (#50171) 2024-11-19 15:56:35 +00:00
Roman Abdulmanov
0b09b76ace bug triage fix (#50213) 2024-11-19 09:53:09 -05:00
Roman Abdulmanov
52d223d44b bug triage fix (#50210) 2024-11-19 14:43:03 +00:00
Phoomparin Mano
964d31ec8d fix(sdk): trigger save handler on question create when using SaveQuestionForm (#50137)
* trigger save handlers on question create

* add skeleton example stories for save forms

* update storybook stories

* add tests for saving questions

* docs update

* add createCard assertions

* rollback docs
2024-11-19 20:46:29 +07:00
Kamil Mielnik
409c93833f Fix flaky e2e tests by using synchronous-batch-updates: true by default (#50143)
* Use synchronous-batch-updates: true by default in e2e tests

* Remove changeSynchronousBatchUpdateSetting
2024-11-19 18:30:51 +07:00
Kamil Mielnik
06fef3905a Fix - Remove clause button shrinks in the notebook editor (#50150)
* Fix #50128

* Add repro for #50128
2024-11-19 18:21:00 +07:00
Nicolò Pretto
3f77c0c480 fix(sdk): handle relative urls for metabaseInstance in loading maps (#50135)
* fix(sdk): handle relative urls for metabaseInstance in loading maps

* addTrailingSlash  -> ensureTrailingSlash

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

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-11-19 12:00:58 +01:00
Chris Truter
17bb910200 Various tweaks for experimental search (#50142) 2024-11-19 08:22:14 +00:00
Nicolò Pretto
ceba6e407c feat(sdk): detect mismatch between sdk version and mb version (#50032)
* feat(sdk): detect mismatch between sdk version and mb version

* refactor: log utils to print the big headers

* Update enterprise/frontend/src/embedding-sdk/lib/version-utils.unit.spec.ts

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

* refactor: call -> callArguments

* add link to the docs

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-11-19 09:08:15 +01:00
Oisin Coveney
077236f2da Separate view from data for question titles (#50129) 2024-11-19 08:27:53 +02:00
Ngoc Khuat
667c3f93ef [Notification] Seed notifications on startup instead of using migrations 🌱 (#50127) 2024-11-19 10:00:48 +07:00
Ryan Laurie
320f0907cc Fix auto-translate locales file path (#50164) 2024-11-18 14:31:31 -07:00
Ryan Laurie
1a421b3ad5 Add Hungarian language support (#50165) 2024-11-18 14:30:49 -07:00
Aleksandr Lesnenko
42013c4e1d Fix pie chart legend issues (#50116)
* remove LegendVertical logic that preserves legend width

* memoize pie legend items

* prevent pie from jumping when toggle legend

* fix responsive legend logic, cleanup

* drop hyphens from the pie legend (#29597)

* eliminate flickering on render due to not having dimensions

* shortcut

* specs

* test vertical layout has no hyphens

* setup func

* set explicit showLegend=true default
2024-11-18 15:04:32 -05:00
Oleksandr Yakushev
1ab3e4e9d6 perf: Improve the performance of pivoted XLSX export (#50117)
* [xlsx-export] Cache the custom datetime formatter

* [xlsx-export] Optimize functions in m.q_p.pivot.postprocess

* cljfmt

---------

Co-authored-by: Adam James <adam.vermeer2@gmail.com>
2024-11-18 11:54:37 -08:00
Cam Saul
0c442b6222 Revert remaining broken JAR path (#50162) 2024-11-18 15:34:46 -03:00
Ryan Laurie
4ab6c6eb42 Update slack settings urls (#50042) 2024-11-18 10:19:56 -07:00
Jeff Bruemmer
2be5130e7c docs - sdk cli guide (#50098) 2024-11-18 11:06:02 -05:00
Nick Fitzpatrick
21ae344b09 search result order (#50048) 2024-11-18 11:33:45 -04:00
Nicolò Pretto
b3a46a7791 refactor(sdk): use ignore flag instead of mounted ref (#50069)
* Revert "fix(sdk): put a bandage on the flashing error on static question in strict mode (#49659)"

This reverts commit c57b3a38e0.

* refactor(sdk): use ignore flag instead of mounted ref
2024-11-18 16:27:25 +01:00
Chris Truter
ab60efa430 Make fulltext the default if its enabled (#50144) 2024-11-18 15:25:08 +00:00
Kamil Mielnik
d291c1509e Fix flaky x-rays test (#50131)
* Fix flaky test

* Add extra assertion

* Reset hover state

* Change order of assertions
2024-11-18 21:55:06 +07:00
lbrdnk
5203a15cdc Add temporal unit to display name (#48946)
* Add temporal unit to display name

* Remove temporal unit adjustments from FE

* formatColumn to displayNameForColumn

* Factor out getFriendlyName

* Adjust BE tests

* Add require

* Adjust FE unit tests

* Adjust temporal-unit-parameters.cy.spec.js

* Adjust dashboard-reproductions.cy.spec

* Convert formatColumn occurrence

* Adjust legacy display name logic generation

After `getFriendlyName` was removed from FE, capitalization
of display name should happen here. Logic is similar, should
be adjusted prior merging the PR.

* Adjust embedding-linked-filters.cy.spec.js

* Adjust joins-reproductions.cy.spec.js

* Adjust metrics-editing.cy.spec.js

* Adjust timelines-question.cy.spec.js

* Adjust offset.cy.spec.ts

* TMP Avoid duplication of temporal unit in display name in MLv2 code

* Probably FE fix: add default temporal bucket only if not present

* WIP Add ends-with-temporal-unit? function

Current strategy is to add temporal units to display names if same is not already present

* Adjust display-name-method :metadata/column

Append TU to display name only if different to what's already present

* Adjust FE: show temporal unit that's present on field instead of default on hover on QueryColumnPicker element

* Return also temporal-unit from visible-columns

* Enable tempora-unit to be returned from previous-stage-or-source-visible-columns

* WIP Adjust multi breakout multi stage e2e multiple-column-breakouts.cy.spec

* Adjust multiple-column-breakouts.cy.spec.ts

* It was not a bug.

* Revert changes in _BaseBucketPickerPopover

* Restore temporal-unit for next stages removal in stage.cljc

* Add inherent-temporal-unit

* Adjust display name temporal bucket logic

* Rename to inherited-temporal-unit

* Shutdown too broad display name capitalization

* Eastwood

* Adjust pivot-rows-order-test

* Adjust pivot-non-numeric-values-in-aggregations

* Adjust inherent to inherited

* Rename to inherited

* Add inherent-temporal-unit only to returned-columns

* Update e2e/test/scenarios/dashboard-filters/temporal-unit-parameters.cy.spec.js

* Update e2e/test/scenarios/question/multiple-column-breakouts.cy.spec.ts

* Update consistent-date-formatting-test

* Update dashboard/x-rays.cy.spec.js

* Update waterfall.cy.spec.js

* Return month default for default inherited-temporal-unit

* Update reproductions-3.cy.spec.js

* Update downloads/downloads.cy.spec.js

* Update legend.cy.spec.js

* Update pie_chart.cy.spec.js

* Update click-behavior.cy.spec.js

* Update embedding-linked-filters.cy.spec.js

* Return QueryColumnPicker's condition to original state

* Remove reundant export

* Update e2e/test/scenarios/question/multiple-column-breakouts.cy.spec.ts

* Comment

* Update nested.cy.spec.js

* Update e2e/test/scenarios/sharing/sharing-reproductions.cy.spec.js

* Adjust to TS types

* Adjust for cljfmt

* Capitalize

* Add propagation tests

* Add inherited-temporal-unit propagation for expressions

* Add default inherited-temporal-unit test cases

* Add qp temporal-bucket-test ns

* Simplify default unit logic

* Comment

* Use NULL_DISPLAY_VALUE

* Comment

* Comment

* Comment

* Comment

* Comment

* Comment

* Remove redundant code (for now)

* Update comments

* Comment

* Restore way too daring simplification

* cljfmt

* Adjust capitalize

* Update comment

* Update test

* Address remarks in tests

* Update test

* Address remarks

* typo
2024-11-18 14:49:18 +01:00
Uladzimir Havenchyk
552cf921ff fix: respect click behavior on public dashboards (#50067)
* fix: pass noop as navigateToNewCardFromDashboard from public or embedded dashboard

* add e2e test

* rework a fix
2024-11-18 14:21:43 +03:00
Romeo Van Snick
c8aa0a5420 Fix button group breaking (#50064)
* Use Flex instead of Group for items in button

* Allow column picker to stretch to match the height of the element

* Fix height of data picker buttons

* Make sure the whole button is clickable

* Add e2e test for metabase/metabase#50038

* Use correct id for issue in e2e test

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

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-11-18 21:54:42 +11:00
Chris Truter
ef09cc16c3 Normalize view count scores by p90 for corresponding model (#50126) 2024-11-18 10:02:11 +00:00
Kamil Mielnik
17887dcd2c Fix flaky test (#50077) 2024-11-18 15:11:12 +07:00
Nicolò Pretto
7951b71137 fix(49537): remove position relative from echarts tooltip container (#49964)
* attempt to fix 49537 by removing position relative from the tooltip
container

* Make echart tooltip container cover all iframe area

* Update the E2E test

* Update loki snapshots from CI

* Re-enable echarts tooltip assertion.

I couldn't find a better way to fail these assertions on the previous
version of the code, but these assertions are better than nothing.

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-11-18 06:02:03 +00:00
Oleksandr Yakushev
7d8f8a889b Bump Toucan dependency (#49962) 2024-11-16 12:37:39 +02:00
Case Nelson
1ea5557754 fix: Sync postgres materialized view fields (#50102)
* fix: Sync postgres materialized view fields

Fixes: #49912

* Disable test for redshift

* Fix formatting
2024-11-15 23:09:19 +00:00
adam-james
520db04167 XLSX Pivot Export - Initialize Pivot Table with Small Area Ref (#50060)
* XLSX Pivot Export - Initialize Pivot Table with Small Area Ref

This PR changes the native pivot export so that we first initialize the pivot table with an area ref that's only the
first 2 rows. Prior, I used `AreaReference/GetWholecolumn` which had the side effect of using lots of memory.

I think this is related to how the Pivot Table's Cache is built up as you add rows/cols to the pivot definition. So,
if you keep the area ref only as wide as the number of columns in the raw data, and just 2 rows, then the cache can
stay small.

After adding row/column data to the pivot table, you can then modify the area ref to be all rows in the relevant
columns (`A:E` for example).

This keeps the pivot-table object much smaller in size.

* need the extra xml schemas to get this to work

I'd like to try find a way around including this extra dep, it's a 13mb jar (ish), and I think that's a little bigger
than I'd like

* oops, didnt mean to have this in

* Add test for pivot table initialization being fast and lean on memory

* remove time based assertion, add comments in impl

* cljfmt

* fix test

* Pesky little whitespace

---------

Co-authored-by: Oleksandr Yakushev <alex@bytopia.org>
2024-11-15 21:54:47 +00:00
Noah Moss
09483a66d3 Unify TTLs for token check caching, simplify some code (#49916) 2024-11-15 21:41:57 +00:00
Noah Moss
b9bc8c1c21 Make sure the query to fetch result_metadata for native sandboxes doesn't use the streaming results handler (#50049) 2024-11-15 21:09:42 +00:00
adam-james
4d5aa8053a XLSX Pivot Exports Now Use The Sort Settings from Viz Settings (#50099)
* XLSX Pivot Exports Now Use The Sort Settings from Viz Settings

Prior to this PR, the xlsx pivot exports worked correctly except for the fact that no sorting (ascending or
descending) was applied to the pivot rows or columns. Now, those settings are used when they exist.

* only try to set sort when a correct setting exists

* add ooxml-full dep for correct classes

* Update src/metabase/query_processor/streaming/xlsx.clj

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

---------

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2024-11-15 20:39:54 +00:00
Noah Moss
ed893e19b2 Merge login_attributes when updating existing users via config file (#50050) 2024-11-15 15:31:13 -05:00
Case Nelson
bc3c54b6b1 fix: MYSQL filter database with dbname in sync (#50091)
Fixes: #50072

When we `describe-fields` we are passing db details, but sometimes we
have the database name in `dbname` rather than in `db` depending on the
connection specs and possibly environment. So we check for both now.
2024-11-15 11:13:00 -07:00
Dennis Schridde
13eb9ae2f1 Omit database details from H2 dump when is_attached_dwh (#50036)
== Goal ==

Hide attached DWH database details from anyone incl. admins:
* Do not show them in the UI
* Do not permit to change them
* Do not serialize them
  - This is what we're adding for H2 snapshots (dumps) with this PR.

The aim is that customers cannot gain access to (parts of) credentials,
and they cannot break a feature they are paying for by changing
connection details.

== Implementation ==

In 592360c9fa I wrongly understood that
database details would be omitted when dumping to H2, but this is only
true for dumping H2 databases.

Fix this by omitting database details also when dumping databases with
`is_attached_dwh` set.

== How to test ==

To prepare, download a H2 JAR matching the H2 version used by Metabase:
```
wget https://repo1.maven.org/maven2/com/h2database/h2/2.1.214/h2-2.1.214.jar
```

If the H2 version does not match, you will get an error when trying to
open the H2 shell:
```
Exception in thread "main" org.h2.jdbc.JdbcSQLNonTransientConnectionException: Unsupported database file version or invalid file header in file "[REDACTED]" [90048-232]
```

=== New behaviour ===

Setting the `is_attached_dwh` field hides the database details from H2 dumps:

1. Configure a database as described in https://www.metabase.com/docs/latest/configuring-metabase/config-file#databases.
   - In addition to the fields you would normally set, also set
     `is_attached_dwh: true`.
   - This also works when adding this flag to a database that previously
     did not have this flag set.
2. Start your Metabase instance.
3. Run `${metabase} dump-to-h2 ./dump-file-h2` to create the H2 snapshot file.
4. Run `java -cp h2-2.1.214.jar org.h2.tools.Shell -url "jdbc:h2:file:./dump-file-h2;ifexists=true"` to open a H2 shell.
5. Verify that `SELECT name,details FROM metabase_database;` shows `{}` for the database you added in step 1

=== Original behaviour ===

Behaviour without setting the `is_attached_dwh` field is unchanged:

1. Configure a database as described in https://www.metabase.com/docs/latest/configuring-metabase/config-file#databases.
   - Only set the fields you would normally set.  Do not set
     `is_attached_dwh` (or set it to `false`).
2. Start your Metabase instance.
3. Run `${metabase} dump-to-h2 ./dump-file-h2` to create the H2 snapshot file.
4. Run `java -cp h2-2.1.214.jar org.h2.tools.Shell -url "jdbc:h2:file:./dump-file-h2;ifexists=true"` to open a H2 shell.
5. Verify that `SELECT name,details FROM metabase_database;` shows a non-empty object (i.e. not `{}`) for the database you added in step 1

Fixes: 592360c9fa
Closes: https://github.com/metabase/harbormaster/issues/5526
2024-11-15 18:12:10 +01:00
Nicolò Pretto
6c0d44d1ca fix(sdk): remove `Cannot update a component XX while rendering a (#50078)
* fix(sdk): remove `Cannot update a component XX while rendering a
different component` error

* test(sdk): introduce jest test to make sure api.basename is set before
loading the locale
2024-11-15 16:54:03 +01:00
Uladzimir Havenchyk
5475a123b8 ci: revert old jar path (#50081) 2024-11-15 08:16:13 -07:00
Chris Truter
e85e79c80d Search Index recency ranker to use last-viewed-at (#50071) 2024-11-15 13:31:11 +00:00
Mahatthana (Kelvin) Nomsawadi
4a63f1aff6 Make SDK Next JS docs clearer (#50068)
* Update doc on Next JS examples

* Make comments consistent and remove typos

* Address review

Co-Authored-by: Poom poom@poom.dev

* Address review

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

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
2024-11-15 13:19:59 +00:00
Nicolò Pretto
dd068ca4bd enforce key prop on tooltip row in echarts tooltip (#50045) 2024-11-15 12:38:27 +01:00
Chris Truter
86f2266739 Search clean-up: separate permissions and logical filters (#50046) 2024-11-15 12:35:05 +02:00
Aleksandr Lesnenko
9fb6328cfb fix hiding incorrect y-axis on hover (#49920)
* fix hiding incorrect y-axis on hover

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-11-14 17:32:42 -05:00
Jeff Bruemmer
07dfbc2b2d note on downloads (#50055) 2024-11-14 15:55:18 -05:00
Abed Habli
f767715a72 Typo (#50043) 2024-11-14 15:38:52 -05:00
Cam Saul
ee3ccf1432 Use Java 17 to run the EE extras build steps (#50051) 2024-11-14 12:38:08 -08:00
Oisin Coveney
f49c703daf Add multi-step popover for default view components (#50018) 2024-11-14 22:35:03 +02:00
Noah Moss
290165d966 Make sure block perm enforcement allows native queries if powering a sandbox (#49974) 2024-11-14 10:08:48 -05:00
dpsutton
113d75ce93 sync the attached datawarehouse (#49970)
* sync the attached datawarehouse

requires either "sync_db" true or a table name

it will error
```shell
❯ http post 'localhost:3000/api/notify/db/attached_datawarehouse' x-metabase-apikey:apikey -pb
Must provide `sync_db` or a `table_name` to sync
```

It will sync the db when sync_db is true [NOTE: this is outdated. now just omitting the table name will sync the db]
```shell
❯ echo '{"synchronous?": true, "sync_db": true}' | http post 'localhost:3000/api/notify/db/attached_datawarehouse' x-metabase-apikey:apikey -pb
{
    "success": true
}
```

It will sync existing tables
```shell
❯ http post 'localhost:3000/api/notify/db/attached_datawarehouse' table_name=existing schema_name=public x-metabase-apikey:apikey -pb
{
    "success": true
}
```

it will error if it cannot find a table
```shell
❯ http post 'localhost:3000/api/notify/db/attached_datawarehouse' table_name=new schema_name=public x-metabase-apikey:apikey -pb
{
    "cause": "Unable to identify table 'public.new'",
    "data": {
        "schema_name": "public",
        "status-code": 404,
        "table_name": "new"
    },
    "message": "Unable to identify table 'public.new'",
    "schema_name": "public",
    "table_name": "new",
    "trace": [],
    "via": [
        {
            "data": {
                "schema_name": "public",
                "status-code": 404,
                "table_name": "new"
            },
            "message": "Unable to identify table 'public.new'",
            "type": "clojure.lang.ExceptionInfo"
        }
    ]
}
```

if i create that table
```sql
attached=# create table new (id int);
CREATE TABLE
```

it will then find and sync it

```shell
❯ http post 'localhost:3000/api/notify/db/attached_datawarehouse' table_name=new schema_name=public x-metabase-apikey:apikey -pb
{
    "success": true
}
```

* formatting

* Tests for attached datawarehouse

* PR nits

typo in `thorw` -> `throw`
comment explaining why `find-and-sync-new-table` is always sync
gensym the db name in test
remove a binding for a fn `sync!` that's only called once
test `{:sync_db true}` syncs the whole db

* stupid formatting 🦾

* Use absence of table_name as indicator to sync database
2024-11-14 08:07:39 -06:00
Mahatthana (Kelvin) Nomsawadi
bffdfada3d Translate more strings on static embed with #locale (#49868)
* Fix smartscalar texts to use user locale

* Fix Pie chart texts to use user locale

* Fix line chart tooltip texts to use user locale

* Add trend chart assertions

* Add pie chart assertions

* Add line chart other series tooltip assertions

* Update frontend/src/metabase/visualizations/echarts/pie/constants.ts

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

* Fix failed E2E tests

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
2024-11-14 12:56:11 +00:00
Nicolò Pretto
f707115294 fix(sdk): sdk version wrapped in quotes (#50014) 2024-11-14 13:53:05 +01:00
Chris Truter
87e3b95b1b Search clean-up: consolidate Filter specifications (#50019) 2024-11-14 12:49:16 +00:00
Uladzimir Havenchyk
87204effb2 ci: fix path to the jar file (#49965)
* ci: attempt to avoid rate trivy rate limit and fix jar path

* drop trivy related changes
2024-11-14 12:47:42 +00:00
Oisin Coveney
4761766738 fix(sdk): Split useSummarizeQuery into specialized hooks (#49841) 2024-11-14 12:21:18 +00:00
Uladzimir Havenchyk
e27d304930 update cross-spawn for dependabot (#50021) 2024-11-14 11:37:26 +00:00
Mahatthana (Kelvin) Nomsawadi
94ac40e640 ci(sdk): Fix some backports aren't included in the changelog (#49926) 2024-11-14 09:55:34 +00:00
Chris Truter
70ea4a0ab0 Fix query building for related updates (#50001) 2024-11-14 11:02:11 +02:00
Phoomparin Mano
aaedddf828 feat(sdk): add background-disabled color (#49900)
* add background-disabled color

* expect background-disabled to be mapped in tests
2024-11-14 14:35:56 +07:00
Chris Truter
4aaa13a857 Add user type visibility options to new search engine (#49951) 2024-11-14 09:33:33 +02:00
Case Nelson
9ae02bef47 fix: bigquery all parameterized types (#49914)
Fixes: #49913

In #49786 we handled parameterized STRING types like `STRING(255)`

Here we add handling for the other other types https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#parameterized_data_types

`BIGDECIMAL` and `DECIMAL` are aliases for `BIGNUMERIC` and `NUMERIC`
https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#parameterized_decimal_type
2024-11-13 15:52:03 -07:00
Cam Saul
200c69373d Don't hardcode Linux/x64 arch in Docker base image (#49979) 2024-11-13 22:39:05 +00:00
adam-james
00737e9910 Apply Column Sort To Pivot Sections (#49802)
* Apply Column Sort To Pivot Sections

Fixes #49437

This PR fixes the dataset API so that column sorts (ascending/descending settings on pivot-rows and pivot-cols) are
properly parsed and passed through the QP.

After that, I've also modified the post processor to use the sort orders properly in pivoted exports.

* println debugging :)

* fixing a few tests

* fix a few more tests
2024-11-13 13:58:01 -08:00
github-automation-metabase
473c4cd89e Add v0.50.33 to the list of releases (#49869) 2024-11-13 16:24:17 -05:00
Ryan Laurie
39f8f6a6ea Fix having to specify platform when pulling docker from ARM (#49976)
* revert (most of) #48910

* remove test code

* fix conflict
2024-11-13 12:50:58 -07:00
Cam Saul
4418173684 Revert CI uberjar build Java version from 21 to 11 (#49975) 2024-11-13 21:30:57 +03:00
Nicolò Pretto
85161494a9 feat(sdk): use Alert component for SDKError (#49895)
* wip: Alert component for SDKError

* use the alert component for the default sdk error component

* fix tests

* update e2e
2024-11-13 17:52:59 +01:00
Chris Truter
d0020aae8c Disable nice-to-have tests that work locally, but fail in CI (#49963) 2024-11-13 15:55:48 +00:00
Chris Truter
0434d5ad87 Optimize search index updates using delayed batches (#49899) 2024-11-13 15:01:59 +00:00
Chris Truter
e150fafa85 Basic API to twiddle with search weights (#49866) 2024-11-13 12:56:57 +00:00
Chris Truter
a31ff2e5d8 Fix search query issue with trailing quotation mark (#49933) 2024-11-13 12:11:45 +00:00
Kamil Mielnik
03af173dbc Fix flaky models metadata test (#49665)
* Fix flaky models metadata test

* Improve hack
2024-11-13 10:06:37 +03:00
Mahatthana (Kelvin) Nomsawadi
1204554eea ci(sdk): [master] Prevent SDK from being upgraded unintentionally (#49883)
* Update workflow on master

* [DEBUG] Disable steps for testing

* Add alberto as a reviewer

* [DEBUG] modify the branch name for testing

* Revert "[DEBUG] modify the branch name for testing"

This reverts commit 7d5d8bf802.

* Revert "[DEBUG] Disable steps for testing"

This reverts commit a8662c9e8b.
2024-11-13 03:34:01 +00:00
Cam Saul
b1ad9a1a30 Switch to Java 21 (#48854)
* Try snowflake 3.19.0

* Deafault to java 21 for drivers

* Trigger CI

* Try running things with --add-opens to see if it solves our problems

* Fix `update-view-dashboard-timestamp-test`

* Try snowflake 3.19.0

* Deafault to java 21 for drivers

* Try running things with --add-opens to see if it solves our problems

* Fix `update-view-dashboard-timestamp-test`

* Update deps.edn

* Switch to Java 21

* Docker image needs to use --add-opens option

* Add note about change to Java 21 to driver changelog

---------

Co-authored-by: Nemanja <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
2024-11-12 20:06:32 +00:00
Phoomparin Mano
69f6527edd feat(sdk): expose FilterPicker querying component (#49768)
* add filter picker skeleton

* add filter picker skeleton

* add picker in popover use case

* reuse FilterColumnPicker

* add question filter logic

* remove fixed width from popover

* add onClose handler

* add e2e test skeleton

* contain FilterBar in Box in story

* add a test for adding filters

* update e2e tests

* add filter picker to the docs

* inline props and functions

* update the props
2024-11-13 03:00:12 +07:00
Aleksandr Lesnenko
8eb105c7d6 update subscription checkboxes (#49805)
* update subscription checkboxes

* update spec
2024-11-12 19:42:12 +00:00
Chris Truter
db0f9119fc Keep search index updated (#49666) 2024-11-12 16:38:47 +00:00
Noah Moss
00dd363bcc Add a force parameter to permission graph endpoints to bypass revision number check (#49856) 2024-11-12 10:25:59 -05:00
Noah Moss
8fc9892750 Clarify cache API permissions and add tests (#49804) 2024-11-12 10:25:47 -05:00
Jeff Bruemmer
a9819e8cac docs - sdk revisions (#49855) 2024-11-12 10:22:08 -05:00
Oisin Coveney
d2d95df948 fix(sdk): Convert jwtProviderUri to authProviderUri (#49843) 2024-11-12 15:00:30 +02:00
Romeo Van Snick
c2735f6dbb Allow changing the limit using just the html input arrows (#49818)
* Allow using the arrow buttons to change the limit value

* Add a min prop to the number input

* Use base-10

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

* Ensure number is integer

* Add issue name to unit test

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

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-11-12 11:43:42 +00:00
Romeo Van Snick
d8ef4d3818 Use ParameterValueWidget for default value picker in native parameter settings (#49578)
* Use ParameterValueWidget for default value picker in native parameter settings

* Fix e2e test

* Fix native filter tests

* Fix e2e test

* Fix e2e test

* Add repro for #44665

* Assert that filter values are shown in the popover.

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

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-11-12 22:37:32 +11:00
Nicolò Pretto
8c6c93c724 skip json() -> JSON.stringify and just forward the text (#49792) 2024-11-12 11:36:43 +01:00
Ngoc Khuat
a6a1e56a12 Handlebars follow up (#49837) 2024-11-12 15:23:20 +07:00
Chris Truter
1baecd8b52 Implement enterprise search rankers in the database (#49861) 2024-11-12 08:19:51 +00:00
Oisin Coveney
6f0d3aac8d Remove some styled components in Summarize (#49836) 2024-11-12 09:38:38 +02:00
Kamil Mielnik
90d88fa634 Fix flaky homepage xrays test (#49765)
* Fix flaky test

* Add a comment
2024-11-12 17:52:37 +11:00
Chris Truter
a5a03934d6 Fix some CLJ formatting (#49860) 2024-11-12 06:13:57 +00:00
Chris Truter
09ee5aa2e8 Prefer search results with higher view counts (#49842) 2024-11-11 21:35:33 +00:00
Luis Paolini
7d6d88969b Make delete-all-field-values-for-database a subquery (#49835)
* Fixes https://github.com/metabase/metabase/issues/33037

* Align query and fix the linter
2024-11-11 18:13:41 -03:00
Luiz Arakaki
f9447d7435 fix dashboard filter required (#49627) 2024-11-11 16:24:33 -03:00
Jeff Bruemmer
dffe10a284 browse databases (#49850) 2024-11-11 13:47:25 -05:00
github-automation-metabase
02e50c2771 Add v0.51.3 to the list of releases (#49844)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-11-11 12:15:33 -05:00
Chris Truter
ec3091f6da Fulltext Search in Postgres (#49421) 2024-11-11 15:24:04 +00:00
Braden Shepherdson
c73fd9e67c [testing] Add appending stages to the query generators (#49567)
This also cleans up the testing to check everything more carefully,
and to expect the right things across multiple stages.

(This is a bit tricky since the order-bys get removed when the stage
gets aggregated, because the columns they were using are now gone.)
2024-11-11 15:08:49 +00:00
lbrdnk
4850a85b7c Map Oracle DATE to type/DateTime (#49592)
* Map Oracle DATE to type/DateTime

* Modify test

* Add test
2024-11-11 15:11:04 +01:00
Ngoc Khuat
f1cf4abbc7 [Notification] Convert all mustaches emails to handlebars (#49759) 2024-11-11 19:30:19 +07:00
Kamil Mielnik
dbf9bfffca Fix flaky notebook test (#49771)
* Fix flaky test

* Bring back waiting

* Decrease flakiness
2024-11-11 18:11:20 +11:00
Kamil Mielnik
fb1e407f46 Fix flaky alert tests (#49673)
* Fix flaky tests

* Fix flaky tests
2024-11-11 18:10:27 +11:00
Kamil Mielnik
3f9ac93432 Fix flaky test (#49758) 2024-11-11 18:10:01 +11:00
Ngoc Khuat
5da6fb67a1 [Notification] Handlebars 👴 (#49645) 2024-11-11 11:12:08 +07:00
Nemanja Glumac
f9efc2127d Make "Add database" more prominent (#49678)
* Remove dead code from browse models page

* Use the grid to control the gap

* Implement "Add database" button

* Add basic unit tests

* Make sure the feature works when there are no databases

* Add analytics to the db list

* Add "Add database" button to the sidebar

* Add E2E Snowplow tests

* Add unit tests

* Deal with authentication in each beforeEeach separately

* Add Snowplow E2E test for a database card

* Slightly tweak the title line height
2024-11-09 13:25:59 +01:00
Chris Truter
e5f93b0772 Deprecate scores from search API response (#49653)
Search currently returns a detailed list of the scores for each item, which is pretty hefty, and the type is also coupled to the current rankers, which will change in future. 

Removing from the type to start to just validate that nothing uses it.

Best to just not model this. Going to see about just removing it from the BE as well, and put in some other way to debug. Worst case an opt-in query parameter.
2024-11-09 09:32:02 +02:00
appleby
2aadf71ea6 Enable debugUnreturnedConnectionStackTraces in data-warehouse-connection-pool-properties (#49456)
* Add blurb from C3P0 docs to comment for unreturnedConnectionTimeout

* Enable debugUnreturnedConnectionStackTraces in data-warehouse-connection-pool-properties

Closes #47981

* Add defsetting for jdbc-data-warehouse-debug-unreturned-connection-stack-traces

And only enable debugUnreturnedConnectionStackTraces in the C3P0 config if the setting is enabled. There is some
memory cost to enabling the setting, and since maxPoolSize is user-configurable, it seems safer to disable
debugUnreturnedConnectionStackTraces by default.

* Add metabase.logger/level-enabled?

* Log a warning if C3P0 logs are not configured correctly to log stack traces

Log a warning if the user enables the jdbc-data-warehouse-debug-unreturned-connection-stack-traces but does not raise
the log level for the com.mchange package to INFO or higher.

* Add docs for MB_JDBC_DATA_WAREHOUSE_DEBUG_UNRETURNED_CONNECTION_STACK_TRACES

* Improve markdown docs for MB_JDBC_DATA_WAREHOUSE_DEBUG_UNRETURNED_CONNECTION_STACK_TRACES

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-11-08 14:23:32 -08:00
Case Nelson
a2a4e7a56c fix: Handle bigquery string(255) in sync (#49800)
Fixes: #49786
2024-11-08 21:59:31 +00:00
adam-james
63ca4c1744 Keep Pivoted Option works in Subscriptions (#49559)
* Keep Pivoted Option works in Subscriptions

Fixes: #49525

Even though the user could toggle 'Keep data pivoted` in the Sharing Sidebar UI, the setting was not being propagated
to the backend, so attachments would not be pivoted.

* add a cypress test

* add viz settings to get the pivot working

* fix for linter

* remove eslint ignore

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2024-11-08 21:06:23 +00:00
Braden Shepherdson
bb0c4a9c48 [testing] Add explicit joins to the query generators (#49566)
I had to add `only-safe-columns` to filter out columns with known issues
in current pMBQL. In particular, implicitly joining on a column which
appears twice (eg. because of a double- or self-join) is ambiguous with
classic `:field` refs, and will cause errors.

There's a `:dynamic` var to re-enable all the columns for tests that are
only exercising new `:column` refs.
2024-11-08 20:49:40 +00:00
Jeff Bruemmer
f9ac943512 docs - add notes on oracle connection (#49795)
* add notes on oracle connection

* edit
2024-11-08 19:48:50 +00:00
Oleksandr Yakushev
7a16dce71e Disable connection reuse for requests that serve streaming responses (#49773)
* Revert "[streaming-response] Use HttpEndpoint.isOpen() instead of reading a byte from TCP socket (#49460)"

This reverts commit 060baf0ce4.

* Disable connection reuse for requests that serve streaming responses
2024-11-08 19:39:40 +00:00
Noah Moss
0d67c7c918 Enforce collection perms on native source-card IDs instead of requiring native query perms (#49364) 2024-11-08 13:58:14 -05:00
Alex Yarosh
d189040aec docs: update links to learn (#49789)
* docs: update links to learn

* bad replace

* Update docs/exploration-and-organization/events-and-timelines.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-11-08 13:32:38 -05:00
Braden Shepherdson
ad97273959 [testing] Add order-by to the generative testing for queries (#49565)
This introduces a reusable `weighted-choice` function and a "weight"
system for the various steps. `:order-by` should be more rare than
filters, etc., `:limit` and `:append-stage` should be more rare still.
2024-11-08 18:05:05 +00:00
Luis Paolini
34827169dd Bump Oracle driver (#49430)
* Bump Oracle driver

Move to ojdbc11

* Update modules/drivers/oracle/deps.edn

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

---------

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2024-11-08 14:41:19 -03:00
Braden Shepherdson
a66a69e425 [testing] Add a few basic expressions to the generators (#49564)
Adds basic expressions to the query generators.

There's a lot more to do to robustly generate realistic expressions! But
this is enough to make expressions exist on queries, which then get
consumed as inputs to filters etc.
2024-11-08 11:35:33 -05:00
Ryan Laurie
4b7141f979 Prep for enabling multi-arch docker builds + Java 21 (#48910)
* build on java 21

* update docker image

* update test

* more using 21

* back to 11 for build

* update docker command

* update containerization

* update docker actions

* revert dockerfile change

* update other docker action versions

* use release commit for containerization
2024-11-08 09:27:47 -07:00
Jeff Bruemmer
1233547f77 remove cube driver from list of community drivers (#49780) 2024-11-08 15:38:00 +00:00
Mahatthana (Kelvin) Nomsawadi
02b09153ba Do not pollute SDK users window object (#49770) 2024-11-08 14:32:39 +00:00
Phoomparin Mano
df321012c3 fix(sdk): generated cli components has inconsistent styles after the style leak fix (#49723) 2024-11-08 21:30:16 +07:00
dpsutton
9d013a5f2d Revert "Remove old MB_API_KEY setting (#48592)" (#49507)
* Revert "Remove old `MB_API_KEY` setting (#48592)"

This reverts commit 187e9508a9.

* preserve metadata of the wrapped handler
2024-11-08 06:24:57 -08:00
Kamil Mielnik
88b03e22cd Remove @flaky tag from no longer flaking tests (#49608)
* Remove @flaky tag

* Unskip test and remove @flaky tag

* Remove @flaky tag

* Remove @flaky tag

* Revert "Remove @flaky tag"

This reverts commit 08c57add88.
2024-11-08 18:31:49 +07:00
Kamil Mielnik
946afe2916 Fix flaky 25885 repro (#49753) 2024-11-08 18:31:25 +07:00
Phoomparin Mano
6c8edfa7d3 feat(sdk): deprecate the ModifyQuestion component (#49747) 2024-11-08 10:02:06 +00:00
Kamil Mielnik
8d8ae87899 Fix flaky native query drill test (#49745)
* Try to fix flake

* See if timeout is necessary

* Revert "See if timeout is necessary"

This reverts commit 181f3c5e63.

* Revert change for coordinates filter
2024-11-08 09:52:19 +00:00
Kamil Mielnik
1eb307a55e Remove sandboxes tests from flaky jail (#49656)
* Remove @flaky tag

* Make workaround test pass

* Disable workaround test

* Uncomment and unquarantine the workaround test

* Disable normal test for now

* Revert "Disable normal test for now"

This reverts commit 68fa2175a7.

* Bring back quarantine

* Update comment
2024-11-08 16:46:09 +07:00
Phoomparin Mano
1b7c16c9e8 docs(sdk): fix dead link in sdk quickstart (#49749) 2024-11-08 16:17:55 +07:00
Mahatthana (Kelvin) Nomsawadi
57d786df8b Support localization in static embeds (#49441)
* Correct embedding hash options type semantically

* Pass `X-Metabase-Locale` to embed downloads

* wip locale header middleware

* Allow smart scalar text to be translated

* Stop using global variable

* Add more details to embedding types

* Extend the E2E util type and correct some properties types

* Add e2e test

* Fix dashboard name

* Add a test for static embed question

* Make a type name follows a convention

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

* Fix failed E2E tests due to missing default values

* Fix public embed not working with `?locale` anymore

* Revert "wip locale header middleware"

This reverts commit 83d8d1358c.

* Preserve locale when in the `as-admin` macro is used

Motivating issue:

```shell
❯ http get 'http://localhost:3000/api/embed/dashboard/eyJhbGciOiJIUzI1NiJ9.eyJyZXNvdXJjZSI6eyJkYXNoYm9hcmQiOjEyfSwicGFyYW1zIjp7fX0.QZ-tEWpgJeSMUuaPfuH6_VQwM2yXNMcuureWCtHsszU/dashcard/162/card/124' x-metabase-locale:fr -pb | jq '.data|.cols|map(.display_name)'
[
  "State",
  "Count"
]
```

I'm running a query that has aggregated columns and it is returning the
untranslated. Note that these are computed and dynamically given a
display name.

```clojure
(case tag
  :count     (i18n/tru "Count")
  :cum-count (i18n/tru "Cumulative count"))
```

The problem is that we run embedding things as admin. And that gets the
current user, which in embed and public spaces is nil, and so binds a
nil to user-locale, which defaults to english when translating.

After:

```
❯ http get 'http://localhost:3000/api/embed/dashboard/eyJhbGciOiJIUzI1NiJ9.eyJyZXNvdXJjZSI6eyJkYXNoYm9hcmQiOjEyfSwicGFyYW1zIjp7fX0.QZ-tEWpgJeSMUuaPfuH6_VQwM2yXNMcuureWCtHsszU/dashcard/162/card/124' x-metabase-locale:fr -pb | jq '.data|.cols|map(.display_name)'
[
  "State",
  "Nombre de lignes"
]

❯ http get 'http://localhost:3000/api/embed/dashboard/eyJhbGciOiJIUzI1NiJ9.eyJyZXNvdXJjZSI6eyJkYXNoYm9hcmQiOjEyfSwicGFyYW1zIjp7fX0.QZ-tEWpgJeSMUuaPfuH6_VQwM2yXNMcuureWCtHsszU/dashcard/162/card/124' x-metabase-locale:zh -pb | jq '.data|.cols|map(.display_name)'
[
  "State",
  "行数"
]

❯ http get 'http://localhost:3000/api/embed/dashboard/eyJhbGciOiJIUzI1NiJ9.eyJyZXNvdXJjZSI6eyJkYXNoYm9hcmQiOjEyfSwicGFyYW1zIjp7fX0.QZ-tEWpgJeSMUuaPfuH6_VQwM2yXNMcuureWCtHsszU/dashcard/162/card/124' x-metabase-locale:es -pb | jq '.data|.cols|map(.display_name)'
[
  "State",
  "Contar"
]
```

This is fetching a dashboard's card which is a query of orders grouped
by created at month, sum of total.

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
Co-authored-by: dan sutton <dan@dpsutton.com>
2024-11-08 08:09:28 +00:00
Romeo Van Snick
cd68d42db7 Handle touch start capture as well as mouse down for popover (#49465)
* Handle touch start capture as well as mouse down for popover

* Also stop event propagation for touch events on menu item
2024-11-08 14:59:20 +11:00
Ngoc Khuat
f340a3aecb [Notification] Send notification options (#49576) 2024-11-08 02:31:43 +00:00
Raphael Krut-Landau
c4868c667e Fix label and link on authentication upsell card (#49707)
Closes #49534
2024-11-07 18:18:33 -05:00
Alexander Solovyov
5331d3816f redshift defines "text" as varchar(255) and we want it to be way longer (#49710) 2024-11-07 20:49:17 +00:00
Jeff Bruemmer
7348161cc4 docs - notes on database browser (#49726)
* notes on database browser

* typo
2024-11-07 20:36:20 +00:00
Raphael Krut-Landau
75d2498163 Ensure that correct error messages show up in the Edit user modal (#48966) 2024-11-07 10:35:10 -05:00
Raphael Krut-Landau
7ffdac9257 Remove withFeatures from renderWithProviders (#49137) 2024-11-07 10:34:52 -05:00
Jeff Bruemmer
96f9898d40 link fix (#49700) 2024-11-07 10:28:10 -05:00
Nicolò Pretto
c57b3a38e0 fix(sdk): put a bandage on the flashing error on static question in strict mode (#49659) 2024-11-07 16:19:38 +01:00
Luis Paolini
df23ed88ce Note about apsaradb (#49675)
* note about apsaradb

* Update docs/installation-and-operation/configuring-application-database.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-11-07 12:02:18 -03:00
Alex Yarosh
809d568858 docs: remove nested queires admin setting (#49699)
* docs: remove nested queries setting

* docs: remove mention of nested query setting
2024-11-07 09:59:31 -05:00
Alex Yarosh
ab5f9266e0 docs: contact support to change cloud env var (#49555)
* docs: cloud environment variables

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-11-07 09:59:18 -05:00
Nemanja Glumac
dd50957580 Re-introduce "Upload CSV" button for instances with DWH attached (#49545)
* Move the upload CSV button to the main nav bar

* Remove the old `SidebarOnboardingSection`

* Remove obsolete unit tests

* Rework E2E tests

* Add some spacing around the button

* Fix E2E test

* Break `MainNavbar` unit test down

* Expand unit tests

* Update E2E tests

* Fix E2E test failure

* Move JSDoc where it belongs

* Provide context for translators

* Simplify the condition
2024-11-07 15:50:20 +01:00
Oisin Coveney
652fafea3c fix(sdk): Fix visualization default size (#49672) 2024-11-07 16:30:49 +02:00
Oisin Coveney
a4828dc9e2 feat(sdk): Add chart settings to InteractiveQuestion (#49167) 2024-11-07 16:13:44 +02:00
github-automation-metabase
1815b5248f Update Readme version references and published npm version to 1.52.1 (#49674) 2024-11-07 13:45:54 +00:00
Ngoc Khuat
977429c46f Email throttling config (#49477) 2024-11-07 12:25:00 +00:00
Kamil Mielnik
6bf6a5de38 Fix - Values from the returned rows not present in the visualization are interpolable in the URL but don't have values (#49530)
* Fix #46318

* Add repro for #46318

* Move setup to beforeEach
2024-11-07 15:54:50 +07:00
adam-james
63151f4e23 Filter out Empty Rows from Pivot Exports (#49512)
* Pivot Measures Order Used in Pivot Exports

Fixes #48442

A pivot table can have any number of measures, and the user can order these by dragging in the UI. Before this PR,
that order was ignored and measures would alway be in index order, which is confusing for any user who needs the
measures to be displayed in a particular order, especially if they've re-ordered them in the pivot viz settings UI.

A test has been added to check that measure order is used.

A few minor changes to the pivot qp and post-processor
 - measure indices are looked up in the pivot qp and added in viz-settings order
 - the pivot measures are only added if the qp has not already added them.
 - pivot-opts Malli spec has been made in the namespace, adjusted to allow `nil` as a valid pivot-opts output, and
 used in relevant functions

* address review points.

* add a rows order test

* Filter out Empty Rows from Pivot Exports

Fixes #49353

The linked issue is not actually related to pivot export size but is instead related to the 'Min of Created At: Month'
aggregation; the default aggregation function was `+`, so it broke when the date string was encountered.

That was fixed.

As I was trynig to keep the export small if possible, I noticed that in some cases empty rows are appended, so I added
the filter so that if a pivot row's values are completely empty, it doesn't add it.

Finally, this PR also adds the 'sub section totals' which I noticed were missing from the exports. This comes up when
you have 3+ pivot-rows configured, so you can see the subtotals for the first pivot row and the subtotals nested
within those sections for the second pivot row, and so on.

* add test for non-numeric values

* Make sure the new name refs match on aggregations not just breakouts

* cljfmt
2024-11-06 22:20:52 +00:00
Noah Moss
3953460236 Make sure a new table gets table-level block if any other tables have table-level block (#49509) 2024-11-06 17:13:00 -05:00
Ryan Laurie
ce19393b37 Fix auto-release artifact name collision (#49626) 2024-11-06 13:02:34 -07:00
Ryan Laurie
1a921a831a Push metabot to stats (#49554)
* push metabot to stats

* use metabot tag instead
2024-11-06 11:33:12 -07:00
Phoomparin Mano
dba17e6c36 feat(sdk): small usability improvements for embedding cli (#49591)
* move the database prompt to the very beginning

* ability to use sample database for cli

* print username and password in console

* no tenancy isolation as a default option

* highlight sample credentials file

* update credential log messages

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

* continue without tenancy isolation

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-11-06 23:50:20 +07:00
Alexander Solovyov
012e0c5f78 [serdes] meaningful API status codes (#49610)
previously import would return 200 w/o regard if it was successful or not

fixes #49602
2024-11-06 16:18:54 +00:00
Alexander Polyankin
240634d336 Fix :pivot-measures with column names (#49575)
* Fix :pivot-measures with column names

* Fix the test

* Update src/metabase/query_processor/pivot.clj

Co-authored-by: Braden Shepherdson <braden@metabase.com>

* Add a test

* Add a test

---------

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2024-11-06 15:46:58 +00:00
Kamil Mielnik
17c271d87f Fix flaky #31274 repro (#49601)
* Remove @flaky tag

* Fix flake

* Refactor

* Use getDashboardCard

* Shorten text

* Fix flake

* Revert previous changes

* Revert "Revert previous changes"

This reverts commit 16b56f268e.

* Fix flake
2024-11-06 15:44:34 +00:00
Kamil Mielnik
f6b8e1e8a3 Fix flaky datamodel test (#49583)
* Remove @flaky tag

* Fix flake

* Try typing delay instead

* Improve comment

* Bring back original solution
2024-11-06 15:32:35 +00:00
Luis Paolini
ebf8bb9215 Add static embedding iframe resizer package license note (#49609)
* Update static embedding iframe resizer

* Update docs/embedding/static-embedding.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-11-06 18:19:37 +03:00
Jeff Bruemmer
35d89b052e docs - sdk edits (#49480) 2024-11-06 09:35:37 -05:00
Nicolò Pretto
8766bfa37e fix type errors that appear on the mantine branch (#49590)
Co-Authored-by: Poom poom@poom.dev
2024-11-06 15:25:18 +01:00
Braden Shepherdson
46191072d0 [testing] Add filters to random query generators (#49448)
Adds filters to generative testing for queries.

There's a lot of new code here, but don't panic, it's quite straightforward:
generating filter values, in the right shapes for various filter expressions.
2024-11-06 09:18:27 -05:00
Uladzimir Havenchyk
82728422c3 convert qb actions to ts (#48611) 2024-11-06 14:36:14 +03:00
Oisin Coveney
d477b55947 Convert Embedding icon hook to CSS and use semantic colors (#49478) 2024-11-06 08:26:21 +00:00
Nicolò Pretto
6452cd3c17 feat(sdk): refactor the auth code to provide better error messages (#49214)
* refactor + more specific auth errors

* fix linting issues

* make tests pass, again

* make test pass for real?

* continues the refactor and hopefully makes tests pass

* try to simplify the logic a little bit more

* also logs to the console for the edge case of invalid session

* remove setLoginStatus

* fix typo

* fix debug line that should have been commented

* remove dead code

* remove test for code that doesnt exist

* address feedback from PR

* update test copy

* Update enterprise/frontend/src/embedding-sdk/store/auth.ts

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

* Update enterprise/frontend/src/embedding-sdk/store/auth.ts

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

* update copy for site settings error

* ex -> exception

* Update enterprise/frontend/src/embedding-sdk/store/auth.ts

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

* Update enterprise/frontend/src/embedding-sdk/store/auth.ts

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

* update tests to use the updated copy + small typos

* refactor: use jest spy on to check for console.error
Co-authored-by: "Mahatthana (Kelvin) Nomsawadi" <me@bboykelvin.dev>

* use full error message in test

* renamed response to session

* mock implementation of console.log

* fix(49482): don't create a new store on each MetabaseProvider render (#49492)

* fix(49482): don't create a new store on each MetabaseProvider render

* remove store prop as it seems to not be used

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-11-06 09:15:32 +01:00
Ngoc Khuat
3e33ab4cb9 [Notification] Pulse clean up 2 (#49519) 2024-11-06 15:10:05 +07:00
Ngoc Khuat
a0598e466a [Notification] Pulse clean up (#49419) 2024-11-06 05:14:02 +00:00
Ngoc Khuat
34ec746983 [Notification] Soft migrate dashsub and alert to notification (#49210) 2024-11-06 03:20:40 +00:00
github-automation-metabase
00d5c7178b Add v0.50.32 to the list of releases (#49568)
* Add v0.50.32 to the list of releases

* Update releases.md

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2024-11-06 01:32:18 +00:00
Jeff Bruemmer
71520bcc23 prettier formatting (#49551) 2024-11-05 16:56:30 -05:00
Alexander Polyankin
632e138681 Use column names instead of field refs for pivot viz settings (#49414) 2024-11-05 20:05:39 +00:00
metamben
b0eb248971 Check only :stages of the result of metric resolution in the QP (#49506)
The query can contain all kinds of things, in particular the whole original query in the case of pivot questions, so
we should check only the part that actually gets resolved by the middleware.
2024-11-05 19:06:14 +00:00
Case Nelson
e8e77d643e perf: Implement faster sync methods for mysql (#49011)
* perf: Implement faster sync methods for postgres

Fixes #48575

Pulls work from redshift into the common postgres driver.

* Fix tests and formatting

* Move nested-field-column sync to sync functions so describe-fields will also get them

* Fix test

* Fix test

* Remove fixed safety test

* Add test specific database-supports feature for pk metadata

* Fix test

* perf: faster mysql sync with describe-fields

Fixes: #49010

* Adrress PR feedback

* Fix tests

* Fix test

* Add nil table-schema

* Don't use subselect for field-comment

* Fix quoting weird identifiers

* Make format string inline

* Update src/metabase/driver/mysql.clj

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

* Update src/metabase/driver/mysql.clj

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

* Fix tests

* Fix database-type

* Fix tests

* Fix test

* Fix tests

* Exclude mysql table_schema

* Handle tinyInt1IsBit

* Fix test

* Only get one db at a time

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2024-11-05 09:26:00 -07:00
Denis Berezin
839b713f50 feat(sdk): Allow to hide columns in CollectionBrowser (#49449)
* Add possibility to hide columns in CollectionBrowser

* Add tests

* Review fixes

* Fix e2e
2024-11-05 19:23:14 +03:00
Luis Paolini
f1a6b53f5a Correct Azure SAML (#49349)
* Correct Azure SAML

* Update saml-azure.md

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-11-05 13:19:03 -03:00
Braden Shepherdson
5dd1cca580 [util] Add u.time/local-date, local-time and local-date-time (#49445)
These are helpful for creating literal dates and times in a
cross-platform way. Useful for generating queries, in particular for
expression and filter values.
2024-11-05 14:20:03 +00:00
Ryan Laurie
11324019e3 Add base color palette (#49356)
* add base color palette

* add some more comments

* fix formatting and color copy-pasta errors

* ignore existing bad base color usage

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>
2024-11-05 06:50:21 -07:00
Denis Berezin
9f49d1aa14 feat(sdk): Add isOpen prop to control CreateDashboardModal visibility (#49452)
* Add isOpen prop to control CreateDashboardModal

* Add props to storybook
2024-11-05 16:45:08 +03:00
Braden Shepherdson
fddd02bdc1 [MBQL lib] Match implicitly joined refs with multiple paths (#49446)
The ref (usually) contains enough information to unambiguously find the
matching implictly-joined column, even if there are several FKs that
could join the target table.

The remaining ambiguous case is if the *same* FK column exists
multiple times - current MBQL uses raw field IDs for the FK field, so it
can't distinguish between eg. an FK in the main table and the one from a
self-join.
2024-11-05 08:44:43 -05:00
Luis Paolini
13bc2e1b65 Update api-changelog.md (#49495)
Added https://github.com/metabase/metabase/pull/49206 to the changelog (missed that on the PR)
2024-11-05 08:35:23 -05:00
Denis Berezin
4dce302c1a Add a note about multiple dashboards (#49451) 2024-11-05 15:33:39 +03:00
Chris Truter
7991f9619e Update Macaw to 0.2.24 and set its run mode (#49337) 2024-11-05 12:59:37 +02:00
Kamil Mielnik
8ed623adf8 Update saveDashboard helper to wait for the GET /api/dashboard/:id (#49522)
* Update saveDashboard helper to wait for the GET /api/dashboard/:id request
- update aliases to be unique so that they don't interfere with aliases used in tests

* Remove no longer needed intercept + wait
2024-11-05 17:48:11 +07:00
Romeo Van Snick
c1862eeada Fixed width filters (#49464)
* Fix dirty yarn.lock

* Use fix width popover for filter pickers

* Add e2e test to reproduce #49321

* Do not rely on implementation width for test
2024-11-05 21:36:32 +11:00
Oleksandr Yakushev
060baf0ce4 [streaming-response] Use HttpEndpoint.isOpen() instead of reading a byte from TCP socket (#49460)
* [streaming-response] Use HttpEndpoint.isOpen() instead of reading a byte from TCP socket

* Comment out cancellation test
2024-11-05 11:50:15 +02:00
Romeo Van Snick
518e79b8fb Fix missing question type for metrics (#49489)
* Fix missing question type for metrics

* Add e2e test to reproduce #49454
2024-11-05 18:32:43 +11:00
Romeo Van Snick
e840233a4f Add custom selectionchange handler (#49511) 2024-11-05 18:00:10 +11:00
Kamil Mielnik
924c6d3153 Fix flaky #16559 repro (#49472)
* Fix flaky #16559 repro

* Wait for getCollections

* Clean up helper

* Wait for cardQuery before saving the dashboard
2024-11-04 23:41:50 -05:00
Case Nelson
516f03f510 fix: tests for clickhouse development (#49347) 2024-11-04 15:42:51 -07:00
github-automation-metabase
bd0a008013 Add v0.51.2 to the list of releases (#49510)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-11-04 17:35:19 -05:00
Ryan Laurie
6bffd075d7 Remove daisy-chaining from pre-release tests (#49093)
* only tag nightly on the current version

* add release channel setting to publish job

* clean up release workflow

* remove code from something else

* reduce depth of the release process stack

* update build job too

* remove dead arg
2024-11-04 14:31:09 -07:00
adam-james
e005f7bb76 Pivot Measures Order Used in Pivot Exports (#49367)
* Pivot Measures Order Used in Pivot Exports

Fixes #48442

A pivot table can have any number of measures, and the user can order these by dragging in the UI. Before this PR,
that order was ignored and measures would alway be in index order, which is confusing for any user who needs the
measures to be displayed in a particular order, especially if they've re-ordered them in the pivot viz settings UI.

A test has been added to check that measure order is used.

A few minor changes to the pivot qp and post-processor
 - measure indices are looked up in the pivot qp and added in viz-settings order
 - the pivot measures are only added if the qp has not already added them.
 - pivot-opts Malli spec has been made in the namespace, adjusted to allow `nil` as a valid pivot-opts output, and
 used in relevant functions

* address review points.

* add a rows order test
2024-11-04 20:23:08 +00:00
Ryan Laurie
89ad60ae1a Add release channel option to publish job (#48633)
* only tag nightly on the current version

* add release channel setting to publish job

* clean up release workflow

* remove code from something else

* fix step title
2024-11-04 12:42:11 -07:00
Braden Shepherdson
d82015eb22 [testing] Add breakouts to random query generators (#49413)
Also fix a bug in `lib.breakout/existing-breakouts` that treated
breakouts on duplicate columns from different joins as existing, even
though they're not.
2024-11-04 13:02:43 -05:00
Alex Yarosh
bfe568e8a1 remove case workaround (#49490) 2024-11-04 11:31:06 -05:00
Kamil Mielnik
1923709c5f Fix flaky custom column test (#49476)
* Fix flaky custom column test

* Fix flaky custom column test
2024-11-04 15:15:26 +00:00
Oisin Coveney
4162c2f0a4 Memoize useChartSettingsSections variables (#49470) 2024-11-04 16:33:19 +02:00
Phoomparin Mano
de559f49d6 feat(sdk): ability to enforce the destination collection to save to and hide the collection picker (#49251)
* add ability to hide the collection picker

* add save options

* make sure collectionId is fresh

* update sdk question form component

* make collectionId accept null

* apply saveOptions to sdk components

* revert to use initialCollectionId as context name

* target the correct collection id

* add e2e tests

* update e2e tests

* move into within

* update test

* remove collectionId from default args

* revert e2e of hide columns

* make e2e helper more generic

* use saveToCollectionId prop to save to a specific collection

* update e2e tests

* update comment formatting

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

* clean up leftover changes from an earlier version

* readme update

* indicate that saveToCollectionId is only applicable to static questions

* revert QuestionEditor.isSaveEnabled defaults

* update comment format

* remove unused initialCollectionId prop

* experiment: try to fix failing custom-columns e2e

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-11-04 20:49:13 +07:00
Romeo Van Snick
089fb7000c Assume question is dirty when edited from notebook (#49428)
* Consider a modified question dirty as well

* Add e2e tests for 48829
2024-11-04 22:10:55 +11:00
Oisin Coveney
d5377880e4 Move section logic to hook (#49334) 2024-11-04 11:20:57 +02:00
Romeo Van Snick
403c260eca Fix dirty yarn.lock (#49463) 2024-11-04 07:08:32 +00:00
Nick Fitzpatrick
06dd8dcffb Adding moderated status to entity picker (#49404)
* Adding moderated status to entity picker

* adjusting verified icon size

* size adjustments

* e2e test adjustments

* removing verified model icon

* fixing e2e test

* unit test

* unit test adjustment
2024-11-03 20:54:23 -04:00
Nick Fitzpatrick
4a6c1d268e Dashboard verifications (#48956)
* Adding moderation status to Dashboards

* react sins

* verification coll: subselect on card + dashboard

* fix the 3 failing BE tests

* add an api test for dashboard verification

* verified dashboards are never stale

* e2e tests

* code cleanup

* unit test and e2e test cleanup

* PR Feedback

* backend test fixes

* Nick shouldn't touch clojure

* type fix

* indent

* fix last 2 BE tests

---------

Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
2024-11-01 19:39:22 -06:00
Romeo Van Snick
896c516d98 Use list picker when searching a single value (#49323)
* WIP: use list picker when searching a single value

* Add test case for multi vs non-multi search fields

* Update loki snapshots

* Add special case to test for multiautocomplete filter

* Use single select value in test

* Add test for using list picker

* Explicitly make sure elements are visible

* Do not use list selector when search is disabled

* Add margin to multi autocomplete dropdown

* Update loki snapshots

* Update loki snapshots
2024-11-01 22:33:51 +00:00
Noah Moss
9cfc06eff2 Make sure metrics migration populates all permissions fields (#49443) 2024-11-01 21:19:28 +00:00
Alex Yarosh
afeeab14aa update custom expressions limitations (#49447) 2024-11-01 16:22:13 -04:00
Braden Shepherdson
972ef2b8a1 [MBQL lib] Relax schema to avoid spammy normalization warnings (#49190)
In particular, this allows for a nearly-blank query without its
`:database` set.
2024-11-01 19:45:07 +00:00
Raphael Krut-Landau
db82ec7146 Simplify the "Edit segment"/"Retire segment" actions and modal (#48998) 2024-11-01 12:26:16 -04:00
Raphael Krut-Landau
9fcfc5b5e7 Remove dead code: FullPageModal (#49184) 2024-11-01 12:25:38 -04:00
Raphael Krut-Landau
6742879b84 Give the command palette a higher z-index (#49387) 2024-11-01 12:25:19 -04:00
dpsutton
f1fc4f3ac9 bump snowflake driver version (#47997)
* bump snowflake for java 17+

* Update modules/drivers/snowflake/deps.edn

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

* Update deps.edn

---------

Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2024-11-01 12:44:14 -03:00
Case Nelson
5bbafa83f5 fix: add UserAgentEntry to databricks connection (#49361)
* fix: add UserAgentEntry to databricks connection

Fixes: #49350

* Add test

* Fix formatting
2024-11-01 09:08:52 -06:00
Denis Berezin
5879f90bfa fix(sdk): Fix interactive dashboard scroll in fullscreen mode (#49366)
* Fix scroll for EditableDashboard in fullscreen mode

* Fix scroll for InteractiveDashboard in fullscreen mode

* Display fullscreen control to dashboards by default

* Fix issue with public shared questions empty footer
2024-11-01 14:34:11 +03:00
Romeo Van Snick
ff0aa11054 Add yarn.lock change for elliptic 6.6.0 (#49424) 2024-11-01 11:25:23 +00:00
Romeo Van Snick
47a87dee16 Revert "Avoid native editor autocomplete suggestions flicker (#45136)" (#49417)
This reverts commit fedd146699.
2024-11-01 05:40:48 +00:00
Romeo Van Snick
7e3ddd69c3 Set elliptic to ^6.6.0 (#49383) 2024-11-01 03:27:59 +00:00
Braden Shepherdson
039046a8e4 [QP] Update breakouts in :order-by when setting time granularity (#49403)
Previously these were omitted, and it caused invalid SQL to be
generated, since the ORDER BY (time unit not updated) and GROUP BY
(time unit updated) did not line up.

Fixes #49263.
2024-10-31 19:41:00 +00:00
Braden Shepherdson
74ff7169c4 [testing] "Random walk" query generation (#49124)
Lays the foundation for a weighted probability approach to generating infinite sequences of valid queries.

Only has aggregations so far, but we can expand it to filters, breakouts, order-by, removals etc. etc. in later PRs.
2024-10-31 19:40:09 +00:00
Kamil Mielnik
50a1cdbbe9 Fix flaky #34574 repro (#49382)
* Fix flaky #34574 repro

* Format code

* Add a wait

* Decrease flakiness

* Fix flake

* Update comment
2024-10-31 19:37:28 +00:00
Kamil Mielnik
a4d50c7482 Fix flaky public links tests (#49392)
* Fix flaky test

* Fix flaky test
2024-10-31 18:51:29 +00:00
Denis Berezin
cf934f928d fix(sdk): pin iframe-resizer version to avoid excess logs for sdk cli (#49312) 2024-10-31 18:38:37 +00:00
lbrdnk
f40dc5f25e Adjust dependent dashboard cards (#49308)
* [WIP] Adjust dependent dashboard cards

* Use transducer to make it less hairy (?)

* Looks better now

* Exception handling and log

* Throw away indices

* Add mapping deletion

* Avoid redundant db roundtrips

* Add test

* Update update-mapping

* Docstring

* Docstrings

* Format

* Comment

* comment

* Shutdown deletion

* Adjust update generationcode

* Add tests

* Comment

* Remove deletion completely for now

* Use transaction

* Update test

* Comment

* Update src/metabase/models/card.clj

Co-authored-by: Braden Shepherdson <braden@metabase.com>

* Update src/metabase/models/card.clj

Co-authored-by: Braden Shepherdson <braden@metabase.com>

* Update src/metabase/models/card.clj

Co-authored-by: Braden Shepherdson <braden@metabase.com>

* Format and parens

* Address remaining remarks

* cljfmt

* Update src/metabase/models/card.clj

Co-authored-by: Braden Shepherdson <braden@metabase.com>

* Address review remarks

---------

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2024-10-31 18:49:22 +01:00
lbrdnk
6923ccb0fb [Databricks] Use system's information schema during sync (#48950)
* Use system schema

* Use data only from selected catalog

* Adjust tests

* Update modules/drivers/databricks/test/metabase/driver/databricks_test.clj

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

* Comments

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2024-10-31 17:50:42 +01:00
Oleksandr Yakushev
741b1bd4e7 [date-2] Extend fastpath fo date parsing for ms-including ISO timestamps (#49203) 2024-10-31 18:35:26 +02:00
Jeff Bruemmer
537228e1d5 docs - SDK readme (#49253) 2024-10-31 12:18:58 -04:00
Nick Fitzpatrick
54ec54b75c change command palette to use moderation icon from ee (#49224) 2024-10-31 12:52:51 -03:00
Raphael Krut-Landau
91a7e4d910 Remove a 10-second wait from an e2e test (mini-PR) (#49120) 2024-10-31 11:06:59 -04:00
Kamil Mielnik
5ad318b006 Fix flaky #25374 repros (#49379)
* Fix flaky 25374-3 test

* Fix flaky 25374-4 test

* Fix race conditions

* Decrease flakiness

* Fix wrong param

* Bullet-proofing
2024-10-31 14:40:49 +00:00
Mahatthana (Kelvin) Nomsawadi
c7231ee7d0 Update fullscreen dashboard filter on dark theme (#49343)
* Update fullscreen dashboard filter on dark theme

* Use the latest base color name

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2024-10-31 14:08:30 +00:00
Alexander Polyankin
c01d67df0e Allow boolean functions in custom columns (#49129) 2024-10-31 10:04:57 -04:00
Jeff Bruemmer
516ac41f95 docs - remove databricks community driver (#49386) 2024-10-31 13:45:03 +00:00
Luis Paolini
d50fb86a2b Add table_id in the database fields endpoint (#49206)
Fixes https://github.com/metabase/metabase/issues/14437
2024-10-31 10:07:42 -03:00
Alexander Polyankin
83f0efc8c3 Fix relative date time FE i18n issues (#49241)
* Fix relative date time FE i18n issues

* Fix an issue
2024-10-31 09:02:54 -04:00
Kamil Mielnik
e3d1b619ee Fix - Tab key does not change focus in expression editor (#49342)
* Fix #49036

* Add explanatory comments

* Improve comment

* Improve comment

* Update comment

* Add repro for #49036

* Exclude custom Shift + Tab handling
2024-10-31 19:59:25 +07:00
Nicolò Pretto
31b8daf1b3 docs(sdk): remove extra duplicated line (#49380) 2024-10-31 07:30:18 -04:00
Romeo Van Snick
08cf3417c0 Update http-proxy-middleware to ^2.0.7 (#49369) 2024-10-31 21:43:46 +11:00
Romeo Van Snick
ad8ba4bdcf Update markdown-to-jsx (#49370) 2024-10-31 21:37:43 +11:00
Romeo Van Snick
c56ec99934 Update elliptic to ^6.6.0 (#49371) 2024-10-31 21:37:31 +11:00
Romeo Van Snick
fedd146699 Avoid native editor autocomplete suggestions flicker (#45136)
* Manually remove bad matches when preparing results for ACE

* Do two-phase autocompletion

* Allow single-character completions

* Add test for flickering autocomplete results

* Fix autocomplete tests

* Simplify autocomplete helpers

* Handle empty results in autocomplete

* Fix e2e test
2024-10-31 20:48:15 +11:00
Noah Moss
216d887955 Skip model persistence for users using connection impersonation (#49185) 2024-10-30 17:39:51 -04:00
Case Nelson
318e448959 perf: Implement faster sync methods for postgres (#48576)
* perf: Implement faster sync methods for postgres

Fixes #48575

Pulls work from redshift into the common postgres driver.

* Fix tests and formatting

* Move nested-field-column sync to sync functions so describe-fields will also get them

* Fix test

* Fix test

* Remove fixed safety test

* Add test specific database-supports feature for pk metadata

* Fix test

* Adrress PR feedback

* Fix test

* Don't use subselect for field-comment

* Fix quoting weird identifiers

* Make format string inline
2024-10-30 14:24:39 -06:00
Oleksandr Yakushev
9ab8d426c3 [redshift] Disable legacy parsing implementation for Redshift driver (#49205) 2024-10-30 12:53:18 -07:00
Oleksandr Yakushev
38a9eb3a72 [qp] Convert timestamps to strings as the last post-processing step (#49209) 2024-10-30 12:52:21 -07:00
Noah Moss
6f7a54ad31 Add MB_NOT_BEHIND_PROXY env var to explicitly skip using X-Forwarded-For header (#49302) 2024-10-30 15:44:03 -04:00
Jeff Bruemmer
3fa450e20e docs - note on databricks legacy catalogs (#49354) 2024-10-30 14:17:35 -04:00
Denis Berezin
548a9a7433 fix(sdk): Editable dashboard should not overlap content below it (#49293)
* fix(sdk): Editable dashboard should not overlap content below it

* Add sizing note
2024-10-30 20:54:36 +03:00
Nemanja Glumac
35d99ba88b tech: Refactor and improve AppBanner (#49273)
* Remove unused component

* Remove extra space

* Remove cross-component dependency on the `Banner`

* Use named export

* Convert the Banner to TS

* Make `ReadOnlyBanner` use `Banner` under the hood

* Add test id to the banner

* Simplify render method and tests

* Add the missing test for ReadOnly banner

* Avoid using special ASCII characters for the common apostrophe

* Remove E2E spec

* Use `Banner` for `DatabaseInfoField`

* Use colors defined in the theme

* Remove the dependency on the `Banner` component again!

* Add a comment

* Use pattern matching
2024-10-30 12:35:04 +00:00
Oisin Coveney
a122a6b7cc Move ChartSettings to Dashboard and Question variants (#49220) 2024-10-30 13:20:50 +01:00
Oleksandr Yakushev
14433723a8 [insights] Ensure that timestamps aren't converted to ratios (#49204) 2024-10-30 12:00:35 +00:00
Nicolò Pretto
842f3f358f fix: make cards the same height in the share modal (#49298) 2024-10-30 09:34:31 +01:00
Mahatthana (Kelvin) Nomsawadi
53518074ff Update static embed card copy to avoid confusion (#49268)
* Update static embed card copy to avoid confusion

* Fix E2E tests

* Fix unit tests

* Update the copy inside static embed modal
2024-10-30 07:04:52 +00:00
lbrdnk
19680bf09b Select only compatible fields from idFields (Mongo specific) (#49262)
* Select only compatible fields from idFields

* Use isComparableWith to filter target fields

* Remove filter-comparable-fields

* Add test
2024-10-30 02:35:58 +01:00
adam-james
d23d7a3a03 Mongo objects should download as JSON, not EDN (#49255)
* Mongo objects should download as JSON, not EDN

Fixes #48198

Prior to this change, object columns (base or effective type of :type/Dictionary) were just formatted with `(str
value)` which results in a csv or json download containing EDN formatted objects.

This is a bug because we present object column values as json in the app, so the expected formatting of the download
should match this.

The formatter function now takes this type into account. As well, since this is a type of formatting that should be
always applied (even when format_rows is false), the function is modified to unconditionally apply the json/encode
formatting to dictionary types when encountered.

* add a test

* add proper condition to test

* card-download should be public

* uncomment json encoding formatter

* set-cell! should keep encoded json string for Objects

I think this is the correct change; I don't really understand the reason for wrapping, encoding, decoding, and then
string-ing that value. Maybe I'm missing something.

* Adjusted xlsx Object set-cell! implementation

* forgot the not... inverted
2024-10-29 17:09:51 -07:00
Romeo Van Snick
32cb5b785b Avoid overwriting text on snippet insertion in some cases (#49213)
* Update cursor position when selection changes

* Add reproduction for #33640

* Revert "Add reproduction for #33640"

This reverts commit 573f6320f5.

We cannot reproduce the bug with tests, so having a test is useless.
2024-10-30 10:15:01 +11:00
Jeff Bruemmer
d053ef08e9 docs - postgres auth providers (#49311) 2024-10-29 21:23:42 +00:00
Nick Fitzpatrick
8f3a30c5a5 fix broken css rule, remove description from field table (#49286)
* fix broken css rule, remove description from field table

* adding back description
2024-10-29 17:02:40 -03:00
Alex Yarosh
3ed6cb81f8 docs: clarify downloading results in static embedding (#49294)
* docs: clarify downloading results in embedding

* docs: static params table description

* format

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-10-29 14:14:01 -04:00
bryan
c3f9a20ea8 is-hosted and ag-mode are mutex (#49259) 2024-10-29 17:26:45 +00:00
Raphael Krut-Landau
16a4ac4aae In sidesheets, show correct sources for a model (#49119) 2024-10-29 11:05:40 -04:00
Jeff Bruemmer
a223f819c7 docs - add load-sample-content (#49284) 2024-10-29 14:18:28 +00:00
Noah Moss
28b0e3c5b5 Fix logic for deployment-model in stats ping (#49260) 2024-10-29 10:15:26 -04:00
Nicolò Pretto
32f9d0f2cf test(sdk): remove setupEnterprisePlugins from test setup as we don't (#49271)
have them in the real codebase + to remove warnings from test output
2024-10-29 13:12:54 +00:00
Oisin Coveney
58dab8c9fa Convert QB to typescript (#49035) 2024-10-29 13:00:39 +00:00
Romeo Van Snick
98cdc6dcc8 Remove dirty question overlay when an error occurred (#49217)
* Add reproduction for #12586

* Do not show the dirty overlay when an error occurred

* Fix tests that rely on dirty overlay

* Add issue tag to test case

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

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-10-29 11:43:14 +00:00
Romeo Van Snick
617d21025f Avoid filter popover overflow (#49211)
* Add max-height to the click actions popover to prevent overflow and infinite scroll

* Add reproduction for #48851

* Update reproduction to speed it up

* Use existing helper for table header click

* Add max height to string filter picker

* Revert "Add max-height to the click actions popover to prevent overflow and infinite scroll"

This reverts commit 166478d892.
2024-10-29 20:27:47 +11:00
Oisin Coveney
70904e8cd9 fix(sdk): Improve InteractiveQuestion chart selector (#48837) 2024-10-29 11:03:29 +02:00
Aleksandr Lesnenko
9b4d3d2b2e Add grey color accent (#49130)
* add grey accent color

* fix pie chart color assignment

* specs

* update grey accent

* update colors

* grey -> gray 🦅
2024-10-29 02:28:50 +00:00
bryan
abc35fe8b6 never show the ai section in AG (#49199)
- AG instances cannot connect to open ai
2024-10-29 01:05:19 +00:00
John Swanson
b465d938bb Items in the audit collection are not cleaned up (#49247)
The audit collection is a bit weird. Users have permissions on the
collection but even superusers don't actually have write permissions on
the elements within it.

For now, I'm just excluding anything in the audit collection from the
"stale" endpoint, so we won't suggest cleaning these up, but I wonder if
maybe there's a cleaner way here. It feels weird to fake permissions
like this.

Fixes https://github.com/metabase/metabase/issues/49164
2024-10-28 14:01:23 -07:00
Nemanja Glumac
b35755f9e0 Better Onboarding: Introduce "Admin onboarding checklist" (#48898)
* Add new route

* Add the navigation link

* Guard the route

* Add first pass of the page structure

* Add the bottom section

* Add placeholder dummy YT videos

* Add images

* Track checklist being opened

* Track checklist item expanded

* Track checklist item CTA clicked

* PoC: Stop the video on accordion change

* Use actual onboarding videos

* Fix missing unique `key` prop

* Final content tweaks

* Override the accordion styles defined in the `theme`

* Use predefined t-shirt sizes where possible

* Update copy

* Conditionally display the example dashboard CTA

* Add very basic unit test coverage

* Show onboarding link to new instances only

* Remember the last position in the onboarding

* Fix the mock settings types

* Scroll last opened item into view

* Properly display docs links

* Another accordion style override

* Add tests for the Onboarding page contents

* Add E2E Snowplow tests

* Conditionally display xray item contents based on settings

* Split tests

* Make sure items scroll into view when expanded

* Do not show example question CTA if example dashboard doesn't exist

* Allow YT videos to play in fullscreen

* Add comments about the example question

* Update rules for when we show the onboarding nav link

* Test the conditional documentation links display

* Reduce E2E test flakiness
2024-10-28 20:58:02 +01:00
Phoomparin Mano
3ea2530ca8 docs(sdk): add loading and error states to docs (#49246)
* document loader and error states

* document loader and error states in the docs

* revert changes to README.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-10-29 02:00:47 +07:00
Jeff Bruemmer
e2036b6142 samples sync (#49237) 2024-10-28 12:45:06 -04:00
Mahatthana (Kelvin) Nomsawadi
6a3fe64e3f Update instruction on running SDK built with master (#49240) 2024-10-28 16:02:30 +00:00
Aleksandr Lesnenko
1bb08949d2 Fix sunburst color assignment that causes pie chart crashing (#49183)
* pie chart crashes when light or dark accents of instance colors overriden

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-10-28 10:13:24 -04:00
Alexander Polyankin
006dbdecde E2E test for "Custom click behavior on a pivot table will go always to tab 1 on a destination dashboard with several tabs" (#49187)
* Add tests

* Add tests

* Add tests
2024-10-28 09:52:20 -04:00
Alexander Polyankin
372cbd3e5d Invert exclude filter checkbox state (#49178) 2024-10-28 09:52:05 -04:00
Alexander Polyankin
81e57dedae Fix adding a time in legacy date picker (#49121)
* Fix adding a time in legacy date picker

* Fix the test
2024-10-28 09:51:16 -04:00
Oisin Coveney
7d4bfaaee6 Convert ChartSettingsButton to mantine (#49171) 2024-10-28 15:34:03 +02:00
Phoomparin Mano
a22441d500 test(sdk): assert abort calls on static question unmount (#49197) 2024-10-28 20:25:01 +07:00
Kamil Mielnik
ec6c0880d0 Introduce verifyNotebookQuery e2e util (#49216)
* Add verifyNotebookQuery helper

* Use describeEE

* Fix DB id

* Refactor test

* Refactor tests

* Introduce customizeLinkText helper

* Use verifyNotebookQuery

* Fix test setup
2024-10-28 19:35:01 +07:00
Oisin Coveney
0532b7b1dc Move view styled components to corresponding component folders (#49140) 2024-10-28 11:23:39 +02:00
Aleksandr Lesnenko
727731bb13 Fix pie invalid other percentages (#49068)
* fix invalid pie other slice percentage label

* fix invalid percentages of grouped into other rows

* spec

* spec

* Update Loki Snapshots

* Update Loki Snapshots

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-10-25 22:01:08 +00:00
Noah Moss
6d7bc0684c Ensure we clean up model persistence table when model or DB is permanently deleted (#49112)
Co-authored-by: bryan <bryan.maass@gmail.com>
2024-10-25 21:15:52 +00:00
Alex Yarosh
0c40e7562f docs: minor 51 notes (#49191)
* minor 51 notes

* Update docs/questions/sharing/visualizations/line-bar-and-area-charts.md

* link

* Apply suggestions from code review

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

* review

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-10-25 20:47:22 +00:00
Aleksandr Lesnenko
a85f7507b3 temporary disable csp in cypress (#49186) 2024-10-25 20:06:21 +00:00
Jeff Bruemmer
5929e66476 docs - sdk updates (#49173) 2024-10-25 12:48:19 -04:00
Mahatthana (Kelvin) Nomsawadi
d616baf693 Fix static embed card download when param has accentuation (#49157)
* Fix static embed card download when param has accentuation

* Fix E2E util type

* Add a dashboard E2E test

* test question download with params

* Fix some names regarding tests

* Fix failed E2E tests
2024-10-25 17:27:18 +01:00
dpsutton
0a455d9a68 Fix csp directives for embed previews (#49155)
* Fix csp directives for embed previews

We set content security directives to allow for iframes on
dashboards. This list did not include 'self' so we can't actually host
an iframe pointing at our, well, self.

Embed previews work by just embedding an iframe with the dashboard and
this breaks if we don't allow iframes from our self.

* e2e test

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2024-10-25 16:17:29 +00:00
Alexander Polyankin
e20c00b155 Fix actions without parameters (#49125)
* Fix actions without parameters

* Update frontend/src/metabase/actions/components/ActionViz/ActionDashcardSettings.unit.spec.tsx

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

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-10-25 16:10:34 +00:00
Chris Truter
c6683ce7a0 Analyze tables for compound queries (#49144)
### Description

This PR updates Macaw to the latest version, which exposes a new analyzer which handles compound queries.

It also finishes the migration to using tagged-union result maps consistently across all the interfaces.

This should also remove the atrociously verbose analysis error messages in CI.
2024-10-25 16:18:09 +02:00
Phoomparin Mano
6a927deefb fix(sdk): support hiding columns in InteractiveQuestion (#49013)
* investigate hide columns

* add update viz settings in the sdk

* cleanup implementation

* add storybook for interactive question

* use the question callback to update viz settings

* remove onUpdateVisualizationSettings

* revert change to onUpdateVisualizationSettings

* add click action behaviour

* fix misspelling

* add onUpdateQuestion mock function

* add unit test for click action behaviour

* add e2e test for hiding question column header
2024-10-25 20:36:07 +07:00
Chris Truter
f022ed8198 Consistent error handling for both NQA interfaces (#49023)
This standards on a "just maps" approach to returning disabled, disallowed, or failed query analysis. This is as opposed to the hodgepodge approach of significant `nil`, untagged unions with keywords, and exceptions.

Essentially we have a classic "either" style tagged union, where `:error` is the tag.
2024-10-25 15:30:55 +02:00
Nicolò Pretto
d7e56b2641 test(sdk): add tests for auth flow (#49108)
* test(sdk): add tests for auth flow

* make the fetch token fn return something that will pass the validations
we'll add in the next project

* waitForRequest helper + add expects for card endpoints on api key test
2024-10-25 12:13:46 +00:00
Nicolò Pretto
9a455d6332 use default line height in the embedding homepage (#49114) 2024-10-25 13:58:02 +02:00
Oisin Coveney
ea8328f2bb Split View components into multiple files (#49034) 2024-10-25 09:09:48 +03:00
Phoomparin Mano
2fd311c521 fix(sdk): static question should cancel requests on component unmount (#48808)
* cancel request on unmount in static question

* use deferred promise

* remove logs

* alias cancelled to deferred.promise

* extract useLoadStaticQuestion hook

* add tests for request cancellation

* change updateQuestion method

* add sanity check with fetchMock
2024-10-25 05:54:27 +00:00
bryan
cca66d443c AG housekeeping (#49047)
* upgrades is-airgapped? defn to defsetting airgap-enabled

- uses the airgap-enabled settings value to remove Cloud section in
  SettingsEditor
- "Metabase Enterprise Airgap" -> "Enterprise Airgap"

* hide still need help section in airgap mode

* move flag checking into selectors

* fe lint

* ts type check

* use optional chaining and nullish coalescing

* hide StillNeedHelp in ag mode

* adding airgap-enabled to createMockSettings

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2024-10-24 19:19:28 -06:00
lbrdnk
0c90ddfa09 [Databricks] Use Sparksql formatting in prettify-native-form for Databricks (#49053)
* Format databricks as spark in prettify-native-form

* Add test to be generalized in follow up
2024-10-24 23:56:19 +03:00
Phoomparin Mano
e99c67a153 fix(sdk): ability to save questions in interactive question (#48866)
* implement saving questions in interactive question

* close modal on create question

* add e2e test for saving questions
2024-10-24 20:49:38 +00:00
Nick Fitzpatrick
ae92d2817f Update X-ray to use rtk query (#49113)
* Update X-ray to use rtk query

* PR feedback
2024-10-24 16:54:08 -03:00
Jeff Bruemmer
bf10c9b6fc links (#49127) 2024-10-24 19:40:03 +00:00
Jeff Bruemmer
82cf05cea8 docs - links 51.1 (#49122) 2024-10-24 15:10:36 -04:00
Alexander Polyankin
82c4a949d0 Fix date formatting of parameter values with time (#49046)
* Fix date formatting of parameter values with time

* Update frontend/src/metabase/parameters/utils/date-formatting.ts

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

* Adjust E2E test

* Fix tests

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-10-24 13:11:05 -04:00
Jeff Bruemmer
a94d58fc52 docs - embedded analytics sdk (#48530) 2024-10-24 12:59:31 -04:00
Alexander Polyankin
c6ac90b483 Fix boolean parameter parsing from query string in dashboards (#49052)
* Fix boolean parameter parsing from query string in dashboards

* Adjust E2E test

* Adjust E2E test

* Adjust E2E test

* Update e2e/test/scenarios/filters-reproductions/dashboard-filters-reproductions.cy.spec.js

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

* Update e2e/test/scenarios/filters-reproductions/dashboard-filters-reproductions.cy.spec.js

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

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-10-24 15:37:15 +00:00
Alexander Polyankin
16181dce67 Make it possible to remove a broken target when there are no options available (#49041) 2024-10-24 10:51:51 -04:00
Alexander Polyankin
0a1eca6b25 Remove myself from CODENOTIFY (#49045) 2024-10-24 10:51:42 -04:00
Chris Truter
1c01afcbcb Restrict native query table permissions to MySQL and PostgreSQL (#49078) 2024-10-24 13:58:19 +00:00
Oisin Coveney
5294948e6a Convert ChartSettings to a functional component (#48994) 2024-10-24 16:57:14 +03:00
Mahatthana (Kelvin) Nomsawadi
9ae3c870c0 Fix deployment failure (#49085) 2024-10-24 12:56:44 +01:00
Denis Berezin
df158d8896 fix(sdk): remove runtime error on aggregated question drill (#49064) 2024-10-24 14:20:38 +03:00
Mahatthana (Kelvin) Nomsawadi
df31f565bc Automate npm dist-tags (#48982)
* Remove outdated comment

* Add logic for automating npm dist tags

* Fix deprecated GitHub action output command

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

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

* Add comment and correct 51 dist tag

---------

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2024-10-24 10:13:33 +01:00
Anthony Lio
5c198037de feat(api-openapi): favors Scalar for open api documentation (#48199) 2024-10-24 11:57:39 +03:00
Mahatthana (Kelvin) Nomsawadi
b7e1ef6f4f Remove changelog not released on master (#48985) 2024-10-24 09:20:47 +01:00
Alexander Solovyov
b96f55194c remove Tim from team.json (#49071) 2024-10-24 14:02:03 +07:00
Aleksandr Lesnenko
b94da7585b enable pivot exports by default (#48859) 2024-10-24 02:19:44 +00:00
github-automation-metabase
7c0023fe1a Add v0.51.1 to the list of releases (#49058)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-10-23 22:01:27 +00:00
Alex Yarosh
94f582662e docs: pie and sunburst (#49056)
* pie charts

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-10-23 17:12:15 -04:00
Nick Fitzpatrick
c9bfb047ea Alert isValid check only looks at configured channels (#48485)
* converting UpdateAlertModalContent and CreateAlertModalContent to functional

* lint stuff

* e2e adjustments:

* type and e2e adjustments
2024-10-23 18:03:21 -03:00
Noah Moss
94081aeadd Expose model persistence refresh icon when model is still in creating state (#48961)
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2024-10-23 15:15:24 -04:00
Aleksandr Lesnenko
7d61485bc8 Add allowed iframe host setting (#48805)
* add allowed iframe host setting wip

* use allowed-iframe-hosts setting in the CSP header

* add a test for the frame-src csp directive

* Update allowed-iframe-hosts setting definition

* Add error state for forbidden iframe url domains

* Move out iframe e2e test suite

* Add e2e test

* Update error message in view mode

* Fix unit tests

* Update setting on the admin page

* Update error state

* Add links to error states

* Update docs links

* Update link anchors

* Add default allowed hosts to public setting

* Update allowed domain check logic

* Fix default value display in admin page

* Don't update setting without changes

* Update error message spacing

* correct the parsing of allowed-hosts string for CSP header entries

* fix test

* fix not handling wildcard ports

* Fix failing e2e test

* Fix subdomain test

* address review

 - the parse-allowed-iframe-hosts fn is now memoized
 - a * entry is handled and doesn't produce a weird *:* entry
 - no more try/catch, errors in parsing will be logged but the list returns all valid entries
 - when www. is encountered, an entry including www. is added
 - trailing / is 'cleaned' and the entry is used as if there was no trailing /

* Fixup test for expecting a few more frame sources

* indentation fix for linter 🥲

* Fix type error

---------

Co-authored-by: Adam James <adam.vermeer2@gmail.com>
Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>
Co-authored-by: dan sutton <dan@dpsutton.com>
2024-10-23 12:46:02 -05:00
Jeff Bruemmer
988514f03c metabase analytics to usage analytics (#48195) 2024-10-23 17:33:41 +00:00
Oleksandr Yakushev
434703431f Bump Methodical version (#49037) 2024-10-23 20:24:26 +03:00
Aleksandr Lesnenko
bcf0a42f9a fix pie chart crashes when small (#49038) 2024-10-23 16:44:56 +00:00
Nicolò Pretto
5d81bdc44d embedding homepage v2 (#49027)
* ui implementation of new emb homepage, tests will come later

* change padding of the last card to be consistent with the top one

* update beta badge spacing

* update tests

* fix stories type error

* use quick-start for url

* update HomeContent tests

* update events + related e2e

* Update frontend/src/metabase/home/components/EmbedHomepage/StaticEmbedContent.tsx
2024-10-23 16:41:15 +00:00
John Swanson
3a05e07fe1 Do not create personal collections for API keys (#48638)
* Do not create personal collections for API keys

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2024-10-23 09:36:56 -07:00
Alexander Solovyov
d4bfd14d6f logs should not be translated (#49033) 2024-10-23 16:08:48 +00:00
Anton Kulyk
dbdef76e63 Allow grouping bar chart series into "Other" category (#48265)
* Add `graph.max_categories` viz setting

* Allow grouping series into "other" category

* Add tooltip

* Toggle "other" series visibility

* WIP: new implementation for `graph.series_order`

* Remove not used function

* Make "other" series a regular `SeriesModel`

* Fix stacked bar charts

* Remove colors from "other" tooltip

* Sort "other" tooltip values

* Update `graph.max_categories` setting

- negative number validation
- 0 value turns off grouping

* Fix Loki test

* Add basic loki test

* Add loki test for stacked chart

* Add loki test for stacked normalized chart

* slight refactor of series_order setting

* Add screenshots

* Handle different kinds of aggregations for "other"

* Handle different aggregation kinds in tooltips

* Add `graph.other_series_aggregation_fn` viz setting

* Fix type errors

* Fix unit tests

* settings ui

* remove sorting by value to match series order setting, other color

* hide grouped series controls

* Add e2e test

* Update screenshots

* Fix incorrect series grouping for stacked charts

* group series into other settings

* Update e2e test to work with new viz settings

* Disable drills for the "Other" series

* fix max_categories setting popover positioning

* fix total row has misaligned columns on other series values

* Remove redundant `click({ force: true })`

* Rename aggregation fn viz setting

* Move aggregation fn setting to the popover

* WIP

* Update popover

* Fix `it.only`

* Fix legend sync issue

* Disable "Other" category by default (temporary)

* Enable aggregation fn picker for MBQL queries (temporary)

* Move "Other" category summary to a tooltip row

* Add `graph.max_categories_enabled` to viz settings type

* Reuse already computed "Other" value in tooltips

* Add null check

* Fix series length check

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2024-10-23 16:58:07 +01:00
appleby
f537c80069 Give more specific name to metricsv2 prometheus metrics (#49001)
This is to allow for the possibiliy of adding more metricsv2 usage and error metrics in the future while still
distinguishing the source of the errors.
2024-10-23 08:10:41 -07:00
Chris Truter
f9e6dfc686 Analyze native tables more conservatively by default (#48990)
### Description

This is a low level step towards applying table-level permissions to native queries.

It replaces the more generic and powerful `:ast-walker-1` analyzer with the more conservative `:basic-select` version we recently landed. The advantage of this version is that it protects against dynamic table references and false negatives due to masking.
2024-10-23 16:30:52 +02:00
Oleksandr Yakushev
3bf8ba58e5 Bump HoneySQL version (#48602) 2024-10-23 17:00:18 +03:00
Chris Truter
e3158b0bdc Restrict inferred encodings for Uploads (#49024) 2024-10-23 13:58:01 +02:00
Braden Shepherdson
d03df1309d [QP] Fix query caching for pivot queries (#48962)
This was throwing errors trying to `nippy/freeze!` an Atom.

That was because in certain circumstances a pMBQL query can end up in
`(:json_query metadata)` for a query, and those can contain an atom
due to `metabase.lib.cache` and both `CachedMetadataProvider` and
`InvocationTracker`.

I added `lib.query/serializable` as a single location to strip out
anything that isn't serializable, such as atoms. (And the entire
`:lib/metadata`, which is a wasted effort to serialize.)
2024-10-23 07:40:26 -04:00
Ngoc Khuat
bdc9c5a943 mention that send-invite is deprecated in v51 api change log (#49018) 2024-10-23 07:49:20 +02:00
Oisin Coveney
313f13f9aa Use useSelector and useDispatch in ChartSettingsSidebar (#48986) 2024-10-23 08:21:20 +03:00
Ngoc Khuat
f573f9dddc [Notification] Rework APIs for better modularization (#48876) 2024-10-23 11:08:11 +07:00
Ngoc Khuat
5752a704cc remove POST /api/user/:id/send_invite (#48976) 2024-10-23 10:23:32 +07:00
Alex Yarosh
6805734db4 docs: cumulative changes (#49009)
* cumulative changes

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-10-22 23:06:29 +00:00
Nemanja Glumac
ef4dd69a8d Add use-temp-storage hook (#48987)
* Add `use-temp-storage` hook

* Remove try/catch

* Add reducer

* Add tests

* Use RTK to create a new slice and reducer
2024-10-22 22:00:53 +00:00
bryan
23338803f9 fix grouped metrics + add some safety to it (#48995) 2024-10-22 12:50:23 -06:00
Aleksandr Lesnenko
cf2dd2c997 fix pie chart labels are hidden when they should not be (#48918)
* improve pie-sunburst chart labels visibility algo

* specs, docs

* Update Loki Snapshots

* handle big arcs > PI with small inner cord

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-10-22 18:20:49 +00:00
Alexander Polyankin
a0025d0df9 Fix native query preview for mongo (#48960)
* Fix native query preview for mongo

* Add tests

* Add tests

* Do not rely on join identity
2024-10-22 18:06:47 +00:00
appleby
5df7d88d78 Do not localize c3p0 metric descriptions (#48957)
Remove localization for some additional metrics that were missed in 2882692b.
2024-10-22 10:37:25 -07:00
Jeff Bruemmer
4be3342175 sidesheets and exports (#48963) 2024-10-22 13:10:52 -04:00
Alexander Polyankin
6deb7b700c Reset join condition state when the rhs table changes (#48951) 2024-10-22 12:33:39 -04:00
Kyle Doherty
80af6c8616 Add athena and databricks logos for engines + setup flow (#48959)
* add athena and databricks logos + update paths

* Add fallback for `druid-jdbc`

---------

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2024-10-22 11:55:32 -04:00
Romeo Van Snick
0cf6d56e61 Show "view-only" badge when the question is not editable (#48791)
* Fix reference in deprecation notice

* Add lock_filled icon

* Add view-only tag to the question header for questions with hidden source tables

* Simplify the useHasHiddenSourceTables helper

* Add typings to useHasHiddenSourceTables

* Show 'view-only' badge when the question is not editable

* Set up card endpoints

* Add test for hidden tables

* Add e2e test for View-only tag

* Add visibilityType to TableDisplayInfo

* Use unfiltered table display info to determine which tables are hidden

* Rename util to hooks

* Use rem for border-radius

* Sign in in beforeEach

* Add tests for more visibility types

* Fix unit tests

* Remove empty file

* Add test for unavailable cards

* Remove unnecessary card endpoint

* Add unit test for inaccessible card

* Move ViewOnlyTag to it's own file

* Add more unit tests for ViewOnly tag

* Use MBQL to create queryies where possible
2024-10-22 17:47:31 +02:00
Oisin Coveney
a1eeb98175 Change errors for JWT to accommodate SDK (#48875) 2024-10-22 18:25:49 +03:00
github-automation-metabase
1c9e93f917 Add v0.50.31 to the list of releases (#48981)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-10-22 13:42:43 +00:00
Oisin Coveney
221a498a1f Convert Visualization Settings Actions to TS (#48941) 2024-10-22 16:22:29 +03:00
Alexander Solovyov
25683917bb drop explicit dep on commons-fileupload (#48972)
it's been long ago that Ring has been updated to depend on org.apache.commons/commons-fileupload2-core
2024-10-22 06:16:55 -03:00
Luis Paolini
d4c49a85af Bump ring-core and ring-jetty-adapter (#48947)
There was a new version that supports jetty 11.0.24 https://github.com/ring-clojure/ring/blob/master/CHANGELOG.md
2024-10-22 10:06:47 +03:00
Romeo Van Snick
09f5a72ffe Popover timing tweaks (#48888)
* Increase the size of the overlay spacer

* Increase the delay of the popover opening

* Hard-code the popover delays

* Remove delay props from info components

* Fix unit test

* Shorten popover timeout to 500ms

* Make popover delay configurable again

* Increase openDelay for header info
2024-10-22 08:32:14 +02:00
adam-james
290845ef8c Fix a Couple bugs related to pivot exports (#48867)
* Fix a Couple bugs related to pivot exports

 - pivot-grouping value, when not an int (in the case of Oracle dbs), would cause exports to contain zero rows. This
 fixes that
 - json formatted/unformatted for the dataset API endpoints (unsaved questions) was not being used, so all exports
 were formatted

* json and csv use (int group) to check row inclusion

* grouping change fix tests

* json formatted/unformatted test

* xlsx formatters are correct when pivot-grouping col is removed

* cljfmt

* fix up failing tests

* fix test

* Update src/metabase/api/dataset.clj
2024-10-22 02:46:56 +00:00
Aleksandr Lesnenko
001e0886b4 tweak sunburst chart styles (#48421)
* tweak sunburst chart styles

* Update Loki Snapshots

* Update Loki Snapshots

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-10-22 01:56:14 +00:00
Ryan Laurie
4dc135ac95 Disable github actions running on a cron for forks (#48967)
* dont run release log on forks

* dont run cron actions on forks at all
2024-10-21 17:06:41 -06:00
Jeff Bruemmer
d1d4d7131d docs - various (#48958) 2024-10-21 17:34:44 -04:00
Oisin Coveney
7d87d7cf49 Split View into components (#48929) 2024-10-21 23:06:55 +03:00
Case Nelson
c712c35cb5 fix: bigquery repeated records should not expose nested fields (#48860) 2024-10-21 13:42:55 -06:00
Alexander Polyankin
78d29c9b06 Reset the question's viz settings when converting to a model (#48939)
* Reset the question's viz settings when converting to a model

* Update e2e/test/scenarios/models/reproductions.cy.spec.ts

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

* Test model metadata

* Test model metadata

* Test model metadata

* Test model metadata

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-10-21 18:39:26 +00:00
Kamil Mielnik
afcb2b472d Fix - Actions are broken in 50.30 when Models are based on SQL (#48927)
* Fix #48878 by avoiding to use entity framework which can serve incomplete card objects

* Make sure canWrite is a boolean

* Remove redundant optional chaining

* Add repro for #48878

* Optimize

* Improve comment

* Fix test setup
2024-10-21 15:11:21 +00:00
Mahatthana (Kelvin) Nomsawadi
1b833d29fd Automate SDK release version numbers (#48838)
* Automate npm version

* Make troubleshooting SDK release process easier

* Fix quote situation

* Allow deploying SDK to different branches at the same time

Because they won't be in conflict with each other

* Make checkout a bit faster

* Remove unnecessary console.log

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

* Tidy up `jq` command

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

* Tidy up multiple GitHub actions summary log

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

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2024-10-21 16:03:01 +01:00
Romeo Van Snick
a31dd8bd70 Add utm params to doc link in expression editor (#48852)
* Add helper to add utm params to url

* Add utm param to getDocsUrl

* Allow passing utm to docs url

* Add utm parameters to expression widget docs url

* Add useUrlWithUtm hook

* Make more utm props optional

* Use the utm hook and docs hook instead of adding utm tags manually to urls

* Simplify getDocsUrl

* Update unit tests for expression editor to contain utm params

* Only add parameters if they have a value

* Fix unit test

* Fix unit test

* Simplify docs url

* Use useDocsUrl on embedding page

* Use named arguments in useDocsUrl
2024-10-21 16:26:08 +02:00
Chris Truter
34a15cbab6 Bump HoneySQL to 2.6.1161 (#48252) 2024-10-21 16:16:22 +02:00
Ryan Laurie
b261643a8f Make metabot centered again (#48912) 2024-10-21 07:54:44 -06:00
Alexander Polyankin
ac2552fbbb Hide time inputs in the date picker when the column does not support date+time filters (#48818) 2024-10-21 09:52:50 -04:00
Oleksandr Yakushev
53813b94d7 Bump Toucan2 version (#48919) 2024-10-21 16:18:58 +03:00
Alexander Solovyov
bb397f792f upgrade jetty to 11.0.24 to mitigate DoS vulnerability (#48819)
https://github.com/jetty/jetty.project/security/advisories/GHSA-g8m5-722r-8whq
2024-10-21 12:17:30 +00:00
Nicolò Pretto
7be52702e4 run prettier on sdk readme (#48905)
* run prettier on sdk readme

* fix code snippets so that prettier can format them

* put back the empty new line on the package.json
2024-10-21 09:43:06 +00:00
Cam Saul
c92e8c993f Modularize metabase.pulse; add metabase.pulse.core API namespace (#48640)
* Modularize metabase.pulse; add metabase.pulse.core API namespace

* Rename metabase.pulse.send-test

* Split email result attachment stuff into its own namespace

* Update dashboard-subscription-test

* Allow metabase.email.result-attachment externally... for now

* More code cleanup

* Decouple models.card and email.messages

* Decouple models.collection and metabase.email.messages

* Hopefully the last fix 🔧

* Fix #48647 🙁

* Fix event handler

* :render/text, not :pulse/text

* Test fixes 🔧

* Test fix 🔧

* RESPECT the modules

* Remove unused namespace
2024-10-18 17:10:52 -07:00
Uladzimir Havenchyk
716fc312d3 fix react warnings (#48564) 2024-10-18 22:20:34 +00:00
bryan
1d1951136a More grouped metrics data (#48900)
* Adds query_executions_by_source_24h and entity_id_translations_last_24h

- add docstring

* clear eid translation count in stats-post-cleanup

* remove ->> with after? it's confusing

* dissoc the right path
2024-10-18 21:51:40 +00:00
Kyle Doherty
a249c0bc37 remove deprecated button from stories (#48909) 2024-10-18 20:46:16 +00:00
Nicolò Pretto
aa72eb83ae feat(sdk): defineEmbeddingSdkConfig to make typing easier (#48879)
* defineEmbeddingSdkConfig to make typing easier when the config is created outside of the jsx

* also add defineEmbeddingSdkTheme, move them to index.ts as i don't have a good name for what file to put them into :shrugs:

* updated the readme to use the defineXXX functions
2024-10-18 20:12:38 +02:00
Uladzimir Havenchyk
6a0b46e54d rework ChartSettings to typescript (#48877)
* rework ChartSettings to typescript

* lint
2024-10-18 17:48:10 +00:00
appleby
2882692b71 Do not localize prometheus metric descriptions (#48896) 2024-10-18 10:34:36 -07:00
Aleksandr Lesnenko
619202e3d4 Adds export description when unformatted option is selected (#48869)
* hide formatted export description when unformatted

* add unformatted copy
2024-10-18 12:38:07 -04:00
Dennis Schridde
ab604f2972 Self-heal database sync triggers (#48882)
== Behaviour without this fix ==

See #48881

== Behaviour with this fix ==

1. Metabase starts with an empty application database, and a config file
   containing configuration for a connected database
3. By the time it reaches "INFO metabase.task :: Task scheduler started",
   `qrtz_triggers` contains `metabase.task.sync-and-analyze.trigger.1`
   (sample DB) and `metabase.task.sync-and-analyze.trigger.2` (DB from
   config file)

Closes: https://github.com/metabase/metabase/issues/48881
Co-authored-by: Noah Moss <noah@metabase.com>
2024-10-18 17:43:11 +02:00
lbrdnk
63a3b4b3f5 Use case expression type inference logic similar to annotate middleware in MLv2 (#47902)
* Use type date for case expression when there are Date and DateTime args

* Use logic for getting case expr type from annotate middleware

* Add e2e test

* Add bigquery test

* Update test

* cljfmt and comment

* Adjust e2e test
2024-10-18 17:41:41 +02:00
Anton Kulyk
2cf1486f76 Optimize pie charts rendering with many rows (#48670) 2024-10-18 16:26:44 +01:00
7110 changed files with 537101 additions and 337172 deletions

View File

@@ -1,30 +1,68 @@
;; -*- comment-column: 100; -*-
{:config-paths ["macros" "src"]
{:config-paths ["macros" "src" "config"]
:linters
{:aliased-namespace-symbol {:level :warning}
:invalid-arity {:skip-args [metabase.lib.util.match/match]} ; TODO (cam): can we fix these?
{;;
;; enabled optional linters (these are disabled by default)
;;
:aliased-namespace-symbol {:level :warning}
:case-symbol-test {:level :warning}
:condition-always-true {:level :warning}
:def-fn {:level :warning}
:dynamic-var-not-earmuffed {:level :warning}
:equals-expected-position {:level :warning, :only-in-test-assertion true}
:keyword-binding {:level :warning}
:main-without-gen-class {:level :warning}
:minus-one {:level :warning}
:misplaced-docstring {:level :warning}
:missing-body-in-when {:level :warning}
:missing-docstring {:level :warning}
:missing-else-branch {:level :warning}
:namespace-name-mismatch {:level :warning}
:non-arg-vec-return-type-hint {:level :warning}
:plus-one {:level :warning}
:reduce-without-init {:level :warning}
:redundant-call {:level :warning}
:redundant-fn-wrapper {:level :warning}
:refer-all {:level :warning, :exclude [clojure.test]}
:self-requiring-namespace {:level :warning}
:single-key-in {:level :warning}
:unsorted-imports {:level :warning}
:unsorted-required-namespaces {:level :warning}
:unused-referred-var {:exclude {compojure.core [GET DELETE POST PUT]}}
:unused-alias {:level :warning}
:use {:level :warning}
:warn-on-reflection {:level :warning}
;;
;; other disabled-by-default linters it would be nice to enable soon
;;
;; TODO (cam): most of these either have a ton of things that need to be fixed or cause issues
;; with [[metabase.lib.util.match/match]] and friends -- we need to write a custom hook for those macros so Kondo
;; can understand them.
#_:docstring-leading-trailing-whitespace
#_:equals-false
#_:equals-true
#_:used-underscored-binding
;;
;; disabled linters
;;
:redundant-ignore {:level :off} ; lots of false positives, see https://github.com/clj-kondo/clj-kondo/issues/2414
:unexpected-recur {:level :off} ; TODO (cam): I think we just need to tell it how to handle MBQL match and we can enable this?
;;
;; globally-enabled custom linters
;;
:metabase/check-defmulti-arglists {:level :warning}
:metabase/check-me-humanize {:level :warning}
:metabase/defsetting-must-specify-export {:level :warning}
:metabase/mbql-query-first-arg {:level :warning}
:metabase/missing-test-expr-requires-in-cljs {:level :warning}
:metabase/modules {:level :warning} ; more config in `.clj-kondo/config/modules/config.edn`
:metabase/require-shape-checker {:level :warning}
:metabase/test-helpers-use-non-thread-safe-functions {:level :warning}
:metabase/test-helpers-use-non-thread-safe-functions {:level :warning} ; more config in `.clj-kondo/config/test-helpers/config.edn`
:metabase/validate-logging {:level :warning}
:metabase/validate-mb-driver-tests {:level :warning}
:metabase/validate-mb-once {:level :warning}
@@ -47,8 +85,8 @@
metabase.actions.test-util/with-actions-test-data-and-actions-enabled
metabase.actions.test-util/with-actions-test-data-tables
metabase.analytics.snowplow-test/with-fake-snowplow-collector
metabase.email-test/with-expected-messages
metabase.email-test/with-fake-inbox
metabase.channel.email-test/with-expected-messages
metabase.channel.email-test/with-fake-inbox
metabase.test.data.users/with-group
metabase.test.data.users/with-group-for-user
metabase.test.data/with-empty-h2-app-db
@@ -128,21 +166,24 @@
clojure.core.async/to-chan!
clojure.core.async/to-chan!!
metabase.channel.core/send!
metabase.models.notification/create-notification!
metabase.driver.sql-jdbc.execute/execute-prepared-statement!
metabase.pulse/send-pulse!
metabase.models.notification/create-notification!
metabase.pulse.send/send-pulse!
metabase.query-processor.store/store-database!
;; Safe in tests, where we typically use a private, temporary index per thread.
metabase.search.core/reindex!
metabase.util/run-count!
next.jdbc/execute!}}
:metabase/i-like-making-cams-eyes-bleed-with-horrifically-long-tests
{:level :warning
:max-length 180}
:max-length 150}
;; this is not enabled here, it is enabled below only for specific namespaces.
: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
@@ -165,21 +206,16 @@
:vertica}}
;;
;; disabled linters
;; misc config for built-in linters
;;
:unexpected-recur {:level :off} ; TODO (cam): I think we just need to tell it how to handle MBQL match and we can enable this?
:used-underscored-binding {:level :off} ; false positives: see https://github.com/clj-kondo/clj-kondo/issues/2152
;;
;; TODO (cam): here are some more linters we should experiment with enabling -- some might be useful.
;;
;; :docstring-leading-trailing-whitespace {:level :warning}
;; :docstring-no-summary {:level :warning}
;; :shadowed-var {:level :warning}
;; :def-fn {:level :warning}
:invalid-arity {:skip-args [metabase.lib.util.match/match]} ; TODO (cam): can we fix these?
:refer-all {:level :warning, :exclude [clojure.test]}
:unused-referred-var {:exclude {compojure.core [GET DELETE POST PUT]}}
;; TODO -- all of these entries are HACKS and we should fix them by writing real custom Kondo HOOKS for these
;; macros. Please don't add anything new to this list! Talk to your best bud Cam if you don't know how to write a
;; Kondo hook and he will pair with you on it. Thanks! -- Cam
:unresolved-symbol
{:exclude
[(build.uberjar/with-duration-ms)
@@ -190,7 +226,7 @@
(clojure.test/is [query= =? malli= qv=])
(clojure.tools.macro/macrolet)
instaparse.core/transform
(metabase.async.streaming-response/streaming-response)
(metabase.server.streaming-response/streaming-response)
(metabase.driver.druid.query-processor-test/druid-query-returning-rows)
(metabase.lib.util.match/match)
(metabase.lib.util.match/match-one)
@@ -213,7 +249,7 @@
metabase.driver.sql-jdbc.execute/set-time-zone-if-supported! {:namespaces ["metabase\\.driver.*"]}
metabase.driver/current-db-time {:namespaces ["metabase.*"]}
metabase.driver/supports? {:namespaces ["metabase.*"]}
metabase.public-settings.premium-features/enable-enhancements? {:namespaces ["metabase\\.models.*"]}
metabase.premium-features.premium-features/enable-enhancements? {:namespaces ["metabase\\.models.*"]}
metabase.query-processor.middleware.resolve-joins/maybe-resolve-source-table {:namespaces ["metabase.*"]}
metabase.query-processor.util/normalize-token {:namespaces ["metabase.*"]}
schema.core/both {:namespaces ["metabase.*"]}
@@ -227,232 +263,45 @@
clojure.core/pr {:message "Use metabase.util.log instead of clojure.core/pr"}
clojure.core/tap> {:message "Don't use tap> is source code"}
clojure.core/time {:message "Don't use time in source code"}
clojure.test.check/quick-check {:message "You probably meant to use clojure.test.check.clojure-test/defspec instead -- quick check will run the tests when it is evaluated rather than when we run the test suite."}
clojure.java.jdbc/get-connection {:message "Use sql-jdbc.execute/do-with-connection-with-options (for drivers) or t2/with-connection (for the app DB) instead of jdbc/get-connection"}
clojure.java.jdbc/with-db-connection {:message "Use sql-jdbc.execute/do-with-connection-with-options (for drivers) or t2/with-connection (for the app DB) instead of jdbc/with-db-connection"}
clojure.java.jdbc/with-db-metadata {:message "Use sql-jdbc.execute/do-with-connection-with-options + .getMetaData instead of jdbc/with-db-metadata"}
clojure.pprint/pprint {:message "Use metabase.util.log instead of clojure.pprint/pprint"}
clojure.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"}
java-time/with-clock {:message "Use mt/with-clock"}
java.util.UUID/randomUUID {:message "Use clojure.core/random-uuid instead of java.util.UUID/randomUUID"}
malli.core/explainer {:message "Use metabase.util.malli.registry/explainer instead of malli.core/explainer"}
malli.core/explain {:message "Use metabase.util.malli.registry/explain instead of malli.core/explain because it has built-in caching"}
malli.core/explainer {:message "Use metabase.util.malli.registry/explainer instead of malli.core/explainer because it has built-in caching"}
malli.core/validate {:message "Use metabase.util.malli.registry/validate instead of malli.core/validate because it has built-in caching"}
malli.core/validator {:message "Use metabase.util.malli.registry/validator instead of malli.core/validator because it has built-in caching"}
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 {:message "Use mt/with-temp instead of t2.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."}
cheshire.core {:message "Use metabase.util.json instead of cheshire.core directly."}
clojure.tools.logging {:message "Use metabase.util.log instead of clojure.tools.logging directly"}
grouper.core {:message "Use metabase.util.grouper instead of grouper.core"}
honeysql.core {:message "Use Honey SQL 2. Honey SQL 1 is removed as a dependency in Metabase 49+."}
honeysql.format {:message "Use Honey SQL 2. Honey SQL 1 is removed as a dependency in Metabase 49+."}
honeysql.helpers {:message "Use Honey SQL 2. Honey SQL 1 is removed as a dependency in Metabase 49+."}
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+."}
metabase.util.jvm {:message "All of metabase.util.jvm is re-exported from metabase.util; prefer that"}}
honeysql.util {:message "Use Honey SQL 2. Honey SQL 1 is removed as a dependency in Metabase 49+."}}
: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 that matches the name of the
;; module itself, e.g. the module namespace for `metabase.setup` would be `metabase.setup`.
;;
;; `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}
metabase.api #{metabase.api.common
metabase.api.dataset
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.async #{metabase.async.streaming-response
metabase.async.streaming-response.thread-pool
metabase.async.util} ; TODO -- consolidate these into a real API namespace.
metabase.audit #{metabase.audit}
metabase.bootstrap #{metabase.bootstrap}
metabase.cmd #{} ; there are no namespaces here since you shouldn't be using this in any other module.
metabase.channel #{metabase.channel.core}
metabase.config #{metabase.config}
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.email #{metabase.email
metabase.email.messages} ; TODO -- consolidate these into a real API namespace.
metabase.embed #{metabase.embed.settings}
metabase.events #{metabase.events}
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.metabot #{metabase.metabot}
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.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.public-settings #{metabase.public-settings
metabase.public-settings.premium-features}
metabase.pulse #{metabase.pulse
metabase.pulse.markdown
metabase.pulse.parameters
metabase.pulse.preview
metabase.pulse.render
metabase.pulse.render.image-bundle
metabase.pulse.render.js-svg
metabase.pulse.render.style} ; TODO -- consolidate these into a real API namespace.
metabase.query-processor :any ; TODO omg scream, 29 namespaces used outside of the module. WHAT THE HECC
metabase.query-analysis #{metabase.query-analysis
metabase.query-analysis.failure-map}
metabase.related #{metabase.related}
metabase.sample-data #{metabase.sample-data}
metabase.search #{metabase.search}
metabase.server #{metabase.server
metabase.server.handler
metabase.server.middleware.auth
metabase.server.middleware.exceptions
metabase.server.middleware.json
metabase.server.middleware.misc
metabase.server.middleware.offset-paging
metabase.server.middleware.session
metabase.server.protocols
metabase.server.request.util} ; TODO -- consolidate these into a real API namespace.
metabase.setup #{metabase.setup}
metabase.sync #{metabase.sync
metabase.sync.analyze
metabase.sync.concurrent
metabase.sync.field-values
metabase.sync.schedules
metabase.sync.sync-metadata
metabase.sync.sync-metadata.fields
metabase.sync.sync-metadata.tables
metabase.sync.util} ; TODO -- consolidate these into a real API namespace.
metabase.task #{metabase.task
metabase.task.index-values
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.troubleshooting #{metabase.troubleshooting}
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}}
;; 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.async :any
metabase.audit :any
metabase.auth-provider #{metabase.util metabase.public-settings}
metabase.bootstrap #{}
metabase.cmd :any
metabase.compatibility :any
metabase.channel :any
metabase.config #{metabase.plugins}
metabase.core :any
metabase.db :any
metabase.driver :any
metabase.email :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.metabot :any
metabase.models :any
metabase.moderation :any
metabase.notification :any
metabase.permissions :any
metabase.plugins :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.util}
metabase.query-processor :any
metabase.related :any
metabase.sample-data :any
metabase.search :any
metabase.server :any
metabase.setup :any
metabase.sync :any
metabase.task :any
metabase.troubleshooting :any
metabase.types #{metabase.util}
metabase.upload :any
metabase.util :any
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`
"^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
@@ -476,7 +325,6 @@
clojure.tools.namespace.parse ns.parse
colorize.core colorize
environ.core env
hf.depstar.api depstar
hiccup.core hiccup
hiccup.util hiccup.util
honey.sql sql
@@ -493,6 +341,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
@@ -507,51 +356,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.notify api.notify
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.async.streaming-response.thread-pool thread-pool
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
@@ -592,8 +400,6 @@
metabase.driver.sql.parameters.substitute sql.params.substitute
metabase.driver.sql.parameters.substitution sql.params.substitution
metabase.eid-translation eid-translation
metabase.email-test et
metabase.email.messages messages
metabase.formatter formatter
metabase.http-client client
metabase.legacy-mbql.normalize mbql.normalize
@@ -601,41 +407,19 @@
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.channel models.channel
metabase.models.dashboard-card dashboard-card
metabase.models.database database
metabase.login-history.core login-history
metabase.model-persistence.core model-persistence
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 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.models.setting setting
metabase.notification.core notification
metabase.notification.test-util notification.tu
metabase.permissions.core perms
metabase.plugins.initialize plugins.init
metabase.public-settings public-settings
metabase.public-settings.premium-features premium-features
metabase.pulse pulse ; NB some conflicts with metabase.models.pulse
metabase.pulse.markdown markdown
metabase.public-sharing.core public-sharing
metabase.premium-features.core premium-features
metabase.pulse.core pulse
metabase.pulse.render render
metabase.pulse.render.body body
metabase.pulse.render.style style
@@ -665,31 +449,23 @@
metabase.query-processor.streaming.xlsx qp.xlsx
metabase.query-processor.timezone qp.timezone
metabase.query-processor.util qp.util
metabase.related related
metabase.request.core request
metabase.revisions.core revisions
metabase.search.config search.config
metabase.search.filter search.filter
metabase.search.util search.util
metabase.search.scoring scoring
metabase.server.middleware.auth mw.auth
metabase.server.middleware.browser-cookie mw.browser-cookie
metabase.server.middleware.exceptions mw.exceptions
metabase.server.middleware.json mw.json
metabase.server.middleware.log mw.log
metabase.server.middleware.misc mw.misc
metabase.server.middleware.offset-paging mw.offset-paging
metabase.server.middleware.security mw.security
metabase.server.middleware.session mw.session
metabase.server.middleware.ssl mw.ssl
metabase.server.request.util req.util
metabase.search.in-place.filter search.in-place.filter
metabase.search.in-place.util search.util
metabase.search.in-place.scoring scoring
metabase.server.core server
metabase.server.protocols server.protocols
metabase.sso.core sso
metabase.sync.analyze.fingerprint sync.fingerprint
metabase.sync.field-values field-values
metabase.sync.field-values sync.field-values
metabase.sync.interface i
metabase.sync.schedules sync.schedules
metabase.sync.sync-metadata.fields.our-metadata fields.our-metadata
metabase.sync.util sync-util
metabase.sync.util-test sync.util-test
metabase.task.sync-databases task.sync-databases
metabase.test mt
metabase.test.data.dataset-definitions defs
metabase.test.data.env.impl tx.env.impl
@@ -701,6 +477,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
@@ -720,11 +497,12 @@
metabase.util.macros u.macros
metabase.util.malli mu
metabase.util.malli.schema ms
metabase.util.markdown markdown
metabase.util.password u.password
metabase.util.schema su
metabase.util.ui-logic ui-logic
metabase.util.urls urls
metabase.xrays xrays
metabase.xrays.core xrays
metabuild-common.core u
metabuild-common.output out
metabuild-common.shell shell
@@ -742,17 +520,15 @@
clojure.core.cache/defcache clojure.core/deftype
clojure.core.logic/defne clj-kondo.lint-as/def-catch-all
clojure.test.check.clojure-test/defspec clojure.test/deftest
clojure.test.check.properties/for-all clojure.core/let
clojurewerkz.quartzite.jobs/defjob clojure.core/defn
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.async.api-response-test/with-response 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.channel.http-test/with-captured-http-requests clojure.core/fn
metabase.channel.http-test/with-server 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
@@ -764,20 +540,21 @@
metabase.driver.sql-jdbc.actions/with-jdbc-transaction clojure.core/let
metabase.driver.sql-jdbc.connection/with-connection-spec-for-testing-connection clojure.core/let
metabase.driver.sql-jdbc.execute.diagnostic/capturing-diagnostic-info clojure.core/fn
metabase.integrations.ldap/with-ldap-connection clojure.core/fn
metabase.models.collection-test/with-collection-in-location clojure.core/let
metabase.models.json-migration/def-json-migration clj-kondo.lint-as/def-catch-all
metabase.models.setting.multi-setting/define-multi-setting clojure.core/def
metabase.models.setting/defsetting clj-kondo.lint-as/def-catch-all
metabase.public-settings.premium-features/defenterprise-schema clj-kondo.lint-as/def-catch-all
metabase.public-settings.premium-features/define-premium-feature clojure.core/def
metabase.pulse-test/with-pulse-for-card clojure.core/let
metabase.premium-features.core/defenterprise-schema clj-kondo.lint-as/def-catch-all
metabase.premium-features.core/define-premium-feature clojure.core/def
metabase.premium-features.defenterprise/defenterprise-schema clj-kondo.lint-as/def-catch-all
metabase.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/->
metabase.query-processor.error-type/deferror clojure.core/def
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.sso.ldap/with-ldap-connection clojure.core/fn
metabase.sync.util/sum-for clojure.core/for
metabase.sync.util/with-emoji-progress-bar clojure.core/let
metabase.test.data.interface/defdataset clojure.core/def
@@ -793,6 +570,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
@@ -804,6 +582,8 @@
metabase.util.namespaces/import-fns potemkin/import-vars
metabase.util.ssh/with-ssh-tunnel clojure.core/let
metabase.xrays.domain-entities.malli/defn schema.core/defn
metabuild-common.core/with-open-jar-file-system clojure.core/let
metabuild-common.files/with-open-jar-file-system clojure.core/let
monger.operators/defoperator clojure.core/def
potemkin.types/defprotocol+ clojure.core/defprotocol
potemkin.types/defrecord+ clojure.core/defrecord
@@ -819,25 +599,22 @@
{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/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.core/require hooks.clojure.core.require/lint-require
clojure.core/requiring-resolve hooks.clojure.core.require/lint-requiring-resolve
clojure.test/deftest hooks.clojure.test/deftest
clojure.test/is hooks.clojure.test/is
clojure.test/use-fixtures hooks.clojure.test/use-fixtures
malli.error/humanize hooks.malli.error/humanize
metabase-enterprise.advanced-permissions.models.permissions.application-permissions-test/with-new-group-and-current-graph hooks.common/with-two-top-level-bindings
metabase-enterprise.audit-app.pages-test/with-temp-objects hooks.common/with-one-binding
metabase-enterprise.cache.config-test/with-temp-persist-models hooks.common/with-seven-bindings
metabase-enterprise.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/defendpoint-async hooks.metabase.api.common/defendpoint
metabase.api.common/defendpoint-async-schema 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
@@ -845,15 +622,10 @@
metabase.api.embed-test/with-chain-filter-fixtures! hooks.common/let-one-with-optional-value
metabase.api.embed-test/with-temp-card hooks.common/let-one-with-optional-value
metabase.api.embed-test/with-temp-dashcard hooks.common/let-one-with-optional-value
metabase.api.persist-test/with-setup! hooks.common/with-one-top-level-binding
metabase.api.public-test/with-required-param-card! hooks.common/with-one-binding
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.async.streaming-response-test/with-start-execution-chan hooks.common/with-one-binding
metabase.api.macros/defendpoint hooks.metabase.api.macros/defendpoint
metabase.api.user-test/with-temp-user-email! hooks.common/with-one-binding
metabase.channel.template.handlebars-helper/defhelper hooks.metabase.channel.template.handlebars-helper/defhelper
metabase.channel.template.handlebars-test/with-temp-template! hooks.common/with-vec-first-binding
metabase.dashboard-subscription-test/with-link-card-fixture-for-dashboard hooks.common/let-second
metabase.db.schema-migrations-test.impl/test-migrations hooks.metabase.db.schema-migrations-test.impl/test-migrations
metabase.driver.bigquery-cloud-sdk-test/calculate-bird-scarcity hooks.metabase.query-processor-test.expressions-test/calculate-bird-scarcity
@@ -866,22 +638,41 @@
metabase.lib.test-util.macros/$ids hooks.metabase.test.data/$ids
metabase.lib.test-util.macros/mbql-query hooks.metabase.test.data/mbql-query
metabase.lib.test-util.macros/with-testing-against-standard-queries hooks.metabase.lib.test-util.macros/with-testing-against-standard-queries
metabase.model-persistence.api-test/with-persistence-setup! hooks.common/with-one-top-level-binding
metabase.model-persistence.api-test/with-setup! hooks.common/with-one-top-level-binding
metabase.model-persistence.test-util/with-persistence-enabled! hooks.metabase.model-persistence.test-util/with-persistence-enabled!
metabase.models.collection-test/with-collection-hierarchy! hooks.common/let-one-with-optional-value
metabase.models.collection-test/with-personal-and-impersonal-collections hooks.common/with-two-bindings
metabase.models.dashboard-tab-test/with-dashtab-in-personal-collection hooks.common/with-one-top-level-binding
metabase.models.dashboard-test/with-dash-in-collection! hooks.common/with-three-bindings
metabase.models.interface/define-batched-hydration-method hooks.metabase.models.interface/define-hydration-method
metabase.models.interface/define-simple-hydration-method hooks.metabase.models.interface/define-hydration-method
metabase.models.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.multi-setting/define-multi-setting-impl hooks.metabase.models.setting/define-multi-setting-impl
metabase.models.setting/defsetting hooks.metabase.models.setting/defsetting
metabase.public-settings.premium-features/defenterprise hooks.metabase.public-settings.premium-features/defenterprise
metabase.permissions.core/allow-changing-all-users-group-members hooks.common/do*
metabase.permissions.core/disable-perms-cache hooks.common/do*
metabase.plugins.classloader/require hooks.clojure.core.require/lint-require
metabase.premium-features.core/defenterprise hooks.metabase.premium-features.defenterprise/defenterprise
metabase.premium-features.defenterprise/defenterprise hooks.metabase.premium-features.defenterprise/defenterprise
metabase.public-sharing.api-test/with-required-param-card! hooks.common/with-one-binding
metabase.public-sharing.api-test/with-temp-public-card hooks.common/let-one-with-optional-value
metabase.public-sharing.api-test/with-temp-public-dashboard hooks.common/let-one-with-optional-value
metabase.public-sharing.api-test/with-temp-public-dashboard-and-card hooks.common/with-three-bindings
metabase.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
metabase.query-processor.middleware.cache-test/with-mock-cache! hooks.common/with-two-bindings
metabase.request.core/with-current-request hooks.common/with-used-first-arg
metabase.request.core/with-current-user hooks.common/with-used-first-arg
metabase.request.core/with-limit-and-offset hooks.common/with-used-first-two-args
metabase.sample-data-test/with-temp-sample-database-db hooks.common/with-one-binding
metabase.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
metabase.test.data.datasets/test-drivers hooks.metabase.test.data.datasets/test-drivers
@@ -890,11 +681,13 @@
metabase.test.data/dataset hooks.metabase.test.data/dataset
metabase.test.data/mbql-query hooks.metabase.test.data/mbql-query
metabase.test.data/run-mbql-query hooks.metabase.test.data/mbql-query
metabase.test.gentest/with-gentest hooks.metabase.test.gentest/with-gentest
metabase.test.util.async/with-open-channels hooks.common/let-with-optional-value-for-last-binding
metabase.test.util.log/with-log-level hooks.common/with-ignored-first-arg
metabase.test.util/discard-setting-changes hooks.common/with-ignored-first-arg
metabase.test.util/with-column-remappings hooks.common/with-ignored-first-arg
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
@@ -910,8 +703,10 @@
metabase.test/with-log-level hooks.common/with-ignored-first-arg
metabase.test/with-log-messages-for-level hooks.metabase.util.log.capture/with-log-messages-for-level
metabase.test/with-non-admin-groups-no-root-collection-perms hooks.common/do*
metabase.test/with-persistence-enabled! hooks.metabase.model-persistence.test-util/with-persistence-enabled!
metabase.test/with-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
@@ -927,46 +722,46 @@
metabase.util.log/warn hooks.metabase.util.log/info
metabase.util.log/warnf hooks.metabase.util.log/infof
metabase.util.malli.registry/def hooks.metabase.util.malli.registry/def
metabase.util/format-color hooks.metabase.util/format-color}
metabase.util/case-enum hooks.metabase.util/case-enum
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.sandbox.test-util/with-gtaps! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.sandbox.test-util/with-gtaps-for-user! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.serialization.test-util/with-world macros.metabase-enterprise.serialization.test-util/with-world
metabase-enterprise.test/with-gtaps! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.test/with-gtaps-for-user! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.advanced-permissions.api.util-test/with-impersonations! macros.metabase-enterprise.advanced-permissions.api.util-test/with-impersonations!
metabase-enterprise.query-reference-validation.api-test/with-test-setup! macros.metabase-enterprise.query-reference-validation.api-test/with-test-setup!
metabase.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!
metabase.api.public-test/with-sharing-enabled-and-temp-dashcard-referencing! macros.metabase.api.public-test/with-sharing-enabled-and-temp-dashcard-referencing!
metabase.lib.filter/deffilter macros.metabase.lib.filter/deffilter
metabase.lib.common/defop macros.metabase.lib.common/defop
metabase.models.params.chain-filter-test/chain-filter macros.metabase.models.params.chain-filter-test/chain-filter
metabase.models.params.chain-filter-test/chain-filter-search macros.metabase.models.params.chain-filter-test/chain-filter
metabase.models.query-analysis-test/with-test-setup macros.metabase.models.query-analysis-test/with-test-setup
metabase.models.user-test/with-groups macros.metabase.models.user-test/with-groups
metabase.query-processor.streaming/streaming-response macros.metabase.query-processor.streaming/streaming-response
metabase.related-test/with-world macros.metabase.related-test/with-world
metabase.task.setup.query-analysis-setup/with-test-setup! macros.metabase.task.setup.query-analysis-setup/with-test-setup!
metabase.test.data.users/with-group-for-user macros.metabase.test.data.users/with-group-for-user
metabase.test.util/with-temp-env-var-value! macros.metabase.test.util/with-temp-env-var-value!
metabase.test.util/with-temporary-raw-setting-values macros.metabase.test.util/with-temporary-raw-setting-values
metabase.test/with-group-for-user macros.metabase.test.data.users/with-group-for-user
metabase.test/with-persistence-enabled! macros.metabase.test.persistence/with-persistence-enabled!
metabase.test/with-temp-env-var-value! macros.metabase.test.util/with-temp-env-var-value!
metabase.test/with-temporary-raw-setting-values macros.metabase.test.util/with-temporary-raw-setting-values
metabase.util.namespaces/import-fn macros.metabase.util.namespaces/import-fn
metabase.xrays.domain-entities.malli/define-getters-and-setters macros.metabase.xrays.domain-entities.malli/define-getters-and-setters}}
{clojurewerkz.quartzite.jobs/build macros.quartz/build-job
clojurewerkz.quartzite.schedule.cron/schedule macros.quartz/schedule
clojurewerkz.quartzite.schedule.simple/schedule macros.quartz/simple-schedule
clojurewerkz.quartzite.triggers/build macros.quartz/build-trigger
metabase-enterprise.advanced-permissions.api.util-test/with-impersonations! macros.metabase-enterprise.advanced-permissions.api.util-test/with-impersonations!
metabase-enterprise.query-reference-validation.api-test/with-test-setup! macros.metabase-enterprise.query-reference-validation.api-test/with-test-setup!
metabase-enterprise.sandbox.test-util/with-gtaps! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.sandbox.test-util/with-gtaps-for-user! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.serialization.test-util/with-world macros.metabase-enterprise.serialization.test-util/with-world
metabase-enterprise.test/with-gtaps! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.test/with-gtaps-for-user! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase.api.card-test/with-ordered-items macros.metabase.api.card-test/with-ordered-items
metabase.api.collection-test/with-collection-hierarchy! macros.metabase.api.collection-test/with-collection-hierarchy!
metabase.api.collection-test/with-some-children-of-collection! macros.metabase.api.collection-test/with-some-children-of-collection!
metabase.api.embed-test/with-embedding-enabled-and-temp-card-referencing! macros.metabase.api.embed-test/with-embedding-enabled-and-temp-card-referencing!
metabase.api.embed-test/with-embedding-enabled-and-temp-dashcard-referencing! macros.metabase.api.embed-test/with-embedding-enabled-and-temp-dashcard-referencing!
metabase.lib.common/defop macros.metabase.lib.common/defop
metabase.lib.filter/deffilter macros.metabase.lib.filter/deffilter
metabase.models.params.chain-filter-test/chain-filter macros.metabase.models.params.chain-filter-test/chain-filter
metabase.models.params.chain-filter-test/chain-filter-search macros.metabase.models.params.chain-filter-test/chain-filter
metabase.models.query-analysis-test/with-test-setup macros.metabase.models.query-analysis-test/with-test-setup
metabase.models.user-test/with-groups macros.metabase.models.user-test/with-groups
metabase.public-sharing.api-test/with-sharing-enabled-and-temp-card-referencing! macros.metabase.public-sharing.api-test/with-sharing-enabled-and-temp-card-referencing!
metabase.public-sharing.api-test/with-sharing-enabled-and-temp-dashcard-referencing! macros.metabase.public-sharing.api-test/with-sharing-enabled-and-temp-dashcard-referencing!
metabase.query-analysis.task.test-setup/with-test-setup! macros.metabase.query-analysis.task.test-setup/with-test-setup!
metabase.query-processor.streaming/streaming-response macros.metabase.query-processor.streaming/streaming-response
metabase.test.data.users/with-group-for-user macros.metabase.test.data.users/with-group-for-user
metabase.test.util/with-temp-env-var-value! macros.metabase.test.util/with-temp-env-var-value!
metabase.test.util/with-temporary-raw-setting-values macros.metabase.test.util/with-temporary-raw-setting-values
metabase.test/with-group-for-user macros.metabase.test.data.users/with-group-for-user
metabase.test/with-temp-env-var-value! macros.metabase.test.util/with-temp-env-var-value!
metabase.test/with-temporary-raw-setting-values macros.metabase.test.util/with-temporary-raw-setting-values
metabase.util.namespaces/import-fn macros.metabase.util.namespaces/import-fn
metabase.xrays.domain-entities.malli/define-getters-and-setters macros.metabase.xrays.domain-entities.malli/define-getters-and-setters
metabase.xrays.related-test/with-world macros.metabase.xrays.related-test/with-world}}
:config-in-comment
{:linters {:unresolved-symbol {:level :off}}}
@@ -1021,9 +816,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,731 @@
;; 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 model-persistence 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.core
metabase.analytics.prometheus
metabase.analytics.snowplow}
:uses #{api
config
db
driver
eid-translation
integrations
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.cache
metabase.api.card
metabase.api.collection
metabase.api.common
metabase.api.common.validation
metabase.api.dashboard
metabase.api.dataset
metabase.api.field
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}
:uses #{}}
embed
{:api #{metabase.embed.settings}
:uses #{analytics models premium-features util}}
events
{:api #{metabase.events metabase.events.init metabase.events.notification}
:uses #{api driver models notification premium-features 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.slack}
:uses #{events models util}}
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}}
model-persistence
{:api #{metabase.model-persistence.api
metabase.model-persistence.core
metabase.model-persistence.init}
:uses #{api db driver events lib models premium-features public-settings query-processor request task 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.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
legacy-mbql
lib
moderation
permissions
plugins
premium-features
public-settings
public-sharing
pulse
query-analysis
query-processor
request
search
server
setup
sync
task
types
util
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 models plugins premium-features request server util}}
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 models plugins util}}
public-settings
{:api #{metabase.public-settings}
:uses #{api config models premium-features util}}
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 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
model-persistence
models
permissions
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 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 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 login-history models public-settings request sso 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}}
sso
{:api #{metabase.sso.api
metabase.sso.core
metabase.sso.init}
:uses #{api models permissions premium-features util}}
sync
{:api #{metabase.sync.api
metabase.sync.concurrent
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}
: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 model-persistence 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 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}
:uses #{api db driver models premium-features setup sync util}}
enterprise/advanced-permissions
{:api #{metabase-enterprise.advanced-permissions.api.routes
metabase-enterprise.advanced-permissions.api.util
metabase-enterprise.advanced-permissions.common
metabase-enterprise.advanced-permissions.models.permissions.group-manager}
:uses #{api audit driver 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}
:uses #{models premium-features sso util enterprise/sso}}
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/advanced-permissions
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 models premium-features public-settings request session sso 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 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.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.model-persistence.models.persisted-info/ready-database!
metabase.model-persistence.task.persist-refresh/job-init!
metabase.model-persistence.task.persist-refresh/refresh-tables!
metabase.model-persistence.task.persist-refresh/schedule-persistence-for-database!
metabase.models.collection.graph-test/clear-graph-revisions!
metabase.models.collection.graph-test/do-with-n-temp-users-with-personal-collections!
metabase.models.field-values/create-or-update-full-field-values!
metabase.models.moderation-review/create-review!
metabase.models.on-demand-test/add-dashcard-with-parameter-mapping!
metabase.models.setting-test/test-user-local-allowed-setting!
metabase.models.setting-test/test-user-local-only-setting!
metabase.models.setting.cache/restore-cache!
metabase.models.setting/set!
metabase.models.setting/validate-settings-formatting!
metabase.permissions.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.public-sharing.api-test/add-card-to-dashboard!
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.sso.ldap-test-util/start-ldap-server!
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/delete-task!
metabase.test.data.bigquery-cloud-sdk/execute!
metabase.test.data.impl.get-or-create/set-test-db-permissions!
metabase.test.data.impl/copy-db-tables-and-fields!
metabase.test.data.impl/get-or-create-database!
metabase.test.data.impl/get-or-create-default-dataset!
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.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,13 +0,0 @@
(ns macros.metabase.api.public-test)
(defmacro with-sharing-enabled-and-temp-card-referencing!
[table-kw field-kw [card-binding] & body]
`(let [~card-binding [~table-kw ~field-kw]]
~@body))
(defmacro with-sharing-enabled-and-temp-dashcard-referencing!
[table-kw field-kw [dash-binding card-binding dashcard-binding] & body]
`(let [~dash-binding [~table-kw ~field-kw]
~(or card-binding '_) nil
~(or dashcard-binding '_) nil]
~@body))

View File

@@ -0,0 +1,13 @@
(ns macros.metabase.public-sharing.api-test)
(defmacro with-sharing-enabled-and-temp-card-referencing!
[table-kw field-kw [card-binding] & body]
`(let [~card-binding [~table-kw ~field-kw]]
~@body))
(defmacro with-sharing-enabled-and-temp-dashcard-referencing!
[table-kw field-kw [dash-binding card-binding dashcard-binding] & body]
`(let [~dash-binding [~table-kw ~field-kw]
~(or card-binding '_) nil
~(or dashcard-binding '_) nil]
~@body))

View File

@@ -0,0 +1,13 @@
(ns macros.metabase.query-analysis.task.test-setup
(:require [macros.common]))
(defmacro with-test-setup!
"Set up the data required to test the Query Analysis related tasks"
[& body]
`(let [~(macros.common/ignore-unused 'c1) 1
~(macros.common/ignore-unused 'c2) 2
~(macros.common/ignore-unused 'c3) 3
~(macros.common/ignore-unused 'c4) 4
~(macros.common/ignore-unused 'archived) 5
~(macros.common/ignore-unused 'invalid) 6]
~@body))

View File

@@ -1,13 +0,0 @@
(ns macros.metabase.related-test
(:require [macros.common]))
(defmacro with-world [& body]
`(let [~(macros.common/ignore-unused 'collection-id) nil
~(macros.common/ignore-unused 'metric-id-a) nil
~(macros.common/ignore-unused 'metric-id-b) nil
~(macros.common/ignore-unused 'segment-id-a) nil
~(macros.common/ignore-unused 'segment-id-b) nil
~(macros.common/ignore-unused 'card-id-a) nil
~(macros.common/ignore-unused 'card-id-b) nil
~(macros.common/ignore-unused 'card-id-c) nil]
~@body))

View File

@@ -1,13 +0,0 @@
(ns macros.metabase.task.setup.query-analysis-setup
(:require [macros.common]))
(defmacro with-test-setup!
"Set up the data required to test the Query Analysis related tasks"
[& body]
`(let [~(macros.common/ignore-unused 'c1) 1
~(macros.common/ignore-unused 'c2) 2
~(macros.common/ignore-unused 'c3) 3
~(macros.common/ignore-unused 'c4) 4
~(macros.common/ignore-unused 'archived) 5
~(macros.common/ignore-unused 'invalid) 6]
~@body))

View File

@@ -1,5 +0,0 @@
(ns macros.metabase.test.persistence)
(defmacro with-persistence-enabled! [[persist-fn-sym] & body]
`(clojure.core/let [~persist-fn-sym (fn [])]
~@body))

View File

@@ -0,0 +1,13 @@
(ns macros.metabase.xrays.related-test
(:require [macros.common]))
(defmacro with-world [& body]
`(let [~(macros.common/ignore-unused 'collection-id) nil
~(macros.common/ignore-unused 'metric-id-a) nil
~(macros.common/ignore-unused 'metric-id-b) nil
~(macros.common/ignore-unused 'segment-id-a) nil
~(macros.common/ignore-unused 'segment-id-b) nil
~(macros.common/ignore-unused 'card-id-a) nil
~(macros.common/ignore-unused 'card-id-b) nil
~(macros.common/ignore-unused 'card-id-c) nil]
~@body))

View File

@@ -1,329 +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/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.cmd.dump-to-h2/dump-to-h2!
metabase.cmd.load-from-h2/load-from-h2!
metabase.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.email-test/reset-inbox!
metabase.email/send-email!
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-notifications!
metabase.pulse/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/create-token!
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.sync/sync-database!
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.
(vary-meta (first (:children node)) (partial merge (meta require-node) (meta node)))
;; this should also be dead code since we require requires to be vectors
(hooks/token-node? node)
(vary-meta node (partial merge (meta 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 namespace with the same name as the module e.g.
`metabase.db`."
[module config]
(let [module-config (get-in config [:api-namespaces module])]
(cond
(= module-config :any)
nil
(set? module-config)
module-config
:else
#{module})))
(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
:let [clj-kondo-ignore (some-> (meta node) :clj-kondo/ignore hooks/sexpr set)]
:when (not (contains? clj-kondo-ignore :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)

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

@@ -71,11 +71,7 @@
:type :metabase/i-like-making-cams-eyes-bleed-with-horrifically-long-tests)))))))
(defn- ignore? [node error-type]
(when-let [ignores (some-> node meta :clj-kondo/ignore hooks/sexpr)]
(when-let [ignores (cond
(coll? ignores) (set ignores)
(keyword? ignores) #{ignores})]
(contains? ignores error-type))))
(contains? (hooks.common/ignored-linters node) error-type))
(defn deftest-check-no-driver-keywords [node {:keys [drivers], :as _config}]
;; fail fast after we see the first error, where we see one hardcoded driver name there are likely several more and we

View File

@@ -1,7 +1,8 @@
(ns hooks.common
(:require
[clj-kondo.hooks-api :as hooks]
[clojure.pprint]))
[clojure.pprint]
[clojure.set :as set]))
(defn with-macro-meta
"When introducing internal nodes (let, defn, etc) it is important to provide a meta of an existing token
@@ -9,10 +10,83 @@
[new-node hook-node]
(with-meta new-node (meta (first (:children hook-node)))))
;;; Kondo stores information about ignored linters as rewrite-clj forms matching how they are specified in the code, so
;;; either
;;;
;;; <vector-node [<token-node :discouraged-namespace>]>
;;;
;;; or
;;;
;;; <token-node :discouraged-namespace>
;;;
;;; these are stored in
;;;
;;; (-> node meta :clj-kondo/ignore :linters).
;;;
;;; These are not a convenient shape(s) to work with, so the next few functions abstract that shape out and work with a
;;; set of keywords like
;;;
;;; #{:discouraged-namespace}
;;;
;;; instead.
(defn- unwrap-ignored-linters [linters]
(cond
(or (hooks/vector-node? linters)
(hooks/list-node? linters))
(into #{}
(map hooks/sexpr)
(:children linters))
(hooks/keyword-node? linters)
#{(hooks/sexpr linters)}
(and (set? linters)
(every? keyword? linters))
linters
(and (sequential? linters)
(every? keyword? linters))
(into #{} linters)
(keyword? linters)
#{linters}))
(defn- wrap-ignored-linters [linters]
(hooks/vector-node (mapv hooks/keyword-node linters)))
(defn ignored-linters
"Return a set of keywords all ignored linters associated with a node by looking at its metadata."
[node]
(or (some-> node meta :clj-kondo/ignore :linters unwrap-ignored-linters)
;; deal with the old pre-2024.09 shape mentioned in https://github.com/clj-kondo/clj-kondo/issues/2414
(some-> node :meta first hooks/sexpr :clj-kondo/ignore unwrap-ignored-linters)))
(defn update-ignored-linters
"Update the `:clj-kondo/ignore` linters in `node`'s metadata. `linters` should be a set of keywords."
[node f & args]
(letfn [(apply-f [linters]
(apply f linters args))
(update-linters [linters]
(-> (or (unwrap-ignored-linters linters)
#{})
apply-f
wrap-ignored-linters))]
(vary-meta node update-in [:clj-kondo/ignore :linters] update-linters)))
(defn merge-ignored-linters
"Merge the ignored linters from `source-nodes` into `node`. You can use this to propagate
ignored linters from parent nodes to child nodes."
[node & source-nodes]
(if-let [linters (not-empty (transduce (map ignored-linters) set/union #{} source-nodes))]
(update-ignored-linters node set/union linters)
node))
;;; This stuff is to help debug hooks. Trace a function and it will pretty-print the before & after sexprs.
;;;
;;; (hooks.common/trace #'calculate-bird-scarcity)
#_{:clj-kondo/ignore [:discouraged-var]}
(defn- trace* [f]
{:pre [(fn? f)]}
(fn traced-fn [node]
@@ -47,9 +121,9 @@
[{{[_ & args] :children, :as node} :node}]
(let [node* (-> (hooks/list-node
(list*
(with-meta (hooks/token-node 'do) {:clj-kondo/ignore [:redundant-do]})
(update-ignored-linters (hooks/token-node 'do) conj :redundant-do)
(for [arg args]
(vary-meta arg update :clj-kondo/ignore #(conj (vec %) :unused-value)))))
(update-ignored-linters arg conj :unused-value))))
(with-meta (meta node)))]
{:node node*}))
@@ -372,7 +446,51 @@
body))]
{:node node*}))
(defn node->qualified-symbol [node]
(defn with-used-first-two-args
"For macros like
(with-limit-and-offset limit offset
...)
=>
(let [_123 limit
[_456 offset]
...)
where the first arg should be linted and appear to be used."
[{{[_ x y & body] :children} :node}]
(let [node* (hooks/list-node
(list*
(hooks/token-node 'let)
(hooks/vector-node [(hooks/token-node (gensym "_")) x
(hooks/token-node (gensym "_")) y])
body))]
{:node node*}))
(defn with-vec-first-binding
"For macros like
(with-temp-file [binding \"temp.txt\" \"content\"]
(slurp binding))
=>
(let [binding nil]
(slurp binding))
where the first arg is a vector of bindings."
[{{[_ {[x & _args] :children} & body] :children} :node}]
(let [node* (hooks/list-node
(list*
(hooks/token-node 'let)
(hooks/vector-node
[(or x (hooks/token-node '_)) (hooks/token-node 'nil)])
body))]
{:node node*}))
(defn node->qualified-symbol
"If the node is a symbol, return it as a qualified symbol if it's not already. Otherwise return nil."
[node]
(try
(when (hooks/token-node? node)
(let [sexpr (hooks/sexpr node)]
@@ -382,8 +500,8 @@
(and resolved (:ns resolved))
(symbol (name (:ns resolved)) (name (:name resolved)))
;; if it wasn't resolved but is still qualified it's probably using the full namespace name rather than an
;; alias.
;; if it wasn't resolved but is still qualified it's probably using the full namespace name rather than an
;; alias.
(qualified-symbol? sexpr)
sexpr)))))
;; some symbols like `*count/Integer` aren't resolvable.
@@ -416,9 +534,4 @@
metadata to a node to suppress LSP warnings."
[node]
(letfn [(update-ignores [existing-ignores]
(hooks/vector-node
(cons
(hooks/keyword-node :clojure-lsp/unused-public-var)
(:children existing-ignores))))]
(vary-meta node update :clj-kondo/ignore update-ignores)))
(update-ignored-linters node conj :clojure-lsp/unused-public-var))

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

@@ -0,0 +1,26 @@
(ns hooks.malli.error
(:require
[clj-kondo.hooks-api :as hooks]
[hooks.common]))
(defn humanize [x]
(letfn [(check-node [node]
(when (hooks/list-node? node)
(let [[_ child] (:children node)]
(when (hooks/list-node? child)
(let [[symb] (:children child)]
(when-let [qualified-symb (hooks.common/node->qualified-symbol symb)]
(when ('#{malli.core/validate metabase.util.malli.registry/validate}
qualified-symb)
(hooks/reg-finding! (assoc (meta symb)
:message "Use malli.error/humanize with explain, NOT with validate. [:metabase/check-me-humanize]"
:type :metabase/check-me-humanize)))))))))]
(check-node (:node x))
x))
(comment
(humanize {:node (hooks/parse-string
(pr-str '(malli.error/humanize
(malli.core/validate
metabase.sync.sync-metadata.dbms-version/DBMSVersion
metabase.driver.druid.sync-test/dbms-version))))}))

View File

@@ -1,28 +0,0 @@
(ns hooks.metabase.api.automagic-dashboards-test
(:require [clj-kondo.hooks-api :as hooks]))
(comment
(def input (hooks/parse-string
"(with-indexed-model! [{:keys [model model-index model-index-value]}
{:query :some-query}]
:foo :bar :body)"))
(println (hooks/sexpr input))
(let [f (load-file ".clj-kondo/hooks/metabase/api/automagic_dashboards_test.clj")]
(f {:node input})))
(defn with-indexed-model!
[{node :node}]
(let [[_macro-call binding-and-query-info & body] (:children node)
[binding query-info] (:children binding-and-query-info)
node* (hooks/list-node
[(hooks/token-node 'do-with-indexed-model!)
query-info
(hooks/list-node
(list* (hooks/token-node 'fn)
(hooks/vector-node [binding])
body))])]
#_(println (hooks/sexpr node*))
{:node node*}))

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

@@ -0,0 +1,56 @@
(ns hooks.metabase.api.macros
(:require
[clj-kondo.hooks-api :as api]
[hooks.common]))
(defn defendpoint
[arg]
(letfn [(update-defendpoint [node]
(let [[defendpoint method route & more] (:children node)
[result-schema & more] (if (= (api/sexpr (first more)) :-)
(drop 1 more)
(cons nil more))
[_docstring & more] (if (api/string-node? (first more))
more
(cons nil more))
[metadata & more] (if (api/map-node? (first more))
more
(cons nil more))
[params & body] more
[bindings schemas] (when (api/vector-node? params)
(loop [bindings [], schemas [], [x y & more] (:children params)]
(cond
(not x)
[bindings schemas]
(= (api/sexpr x) :-)
(recur bindings (conj schemas y) more)
:else
(recur (conj bindings x) schemas (cons y more)))))]
(-> (api/list-node
(list
(api/token-node 'do)
defendpoint
method
route
(api/list-node
(list*
(api/token-node 'do)
(filter some? (list* metadata result-schema schemas))))
(api/list-node
(list*
(api/token-node `let)
(api/vector-node (into []
cat
[(mapcat (fn [a-binding]
[a-binding (api/map-node {})])
(take 4 bindings))
(mapcat (fn [a-binding]
[a-binding (api/list-node (list
(api/token-node 'clojure.core/constantly)
(api/token-node 'nil)))])
(drop 4 bindings))]))
body))))
(with-meta (meta node)))))]
(update arg :node update-defendpoint)))

View File

@@ -1,17 +0,0 @@
(ns hooks.metabase.api.search-test
(:require [clj-kondo.hooks-api :as hooks]))
(defn with-search-items-in-collection [{{[_ & args] :children, :as node} :node}]
;; (println \newline)
;; (clojure.pprint/pprint (hooks/sexpr node))
(let [[created-items-sym search-string & body] args
node* (hooks/list-node
(list*
(hooks/token-node 'let)
(hooks/vector-node
[created-items-sym (hooks/token-node 'nil)])
search-string
body))]
;; (println '=>)
;; (clojure.pprint/pprint (hooks/sexpr node*))
{:node node*}))

View File

@@ -0,0 +1,25 @@
(ns hooks.metabase.channel.template.handlebars-helper
(:require
[clj-kondo.hooks-api :as hooks]
[hooks.common]))
(defn defhelper
"defhelper hook"
[{:keys [node]}]
(let [[_ helper-name description argvec & body] (:children node)
helper-fn-name (symbol (str (hooks/sexpr helper-name) "*"))]
{:node (-> (hooks/list-node
(list (hooks/token-node 'do)
(hooks/list-node
(list (hooks/token-node 'defn)
(hooks/token-node helper-fn-name)
description
argvec
(hooks/list-node body)))
(hooks/list-node
(list (hooks/token-node 'defn)
helper-name
description
argvec
(hooks/list-node body)))))
(with-meta (meta node)))}))

View File

@@ -0,0 +1,19 @@
(ns hooks.metabase.model-persistence.test-util
(:require
[clj-kondo.hooks-api :as hooks]))
(defn with-persistence-enabled! [x]
(letfn [(update-node [node]
(let [[_symb bindings & body] (:children node)
[fn-binding] (:children bindings)]
(-> (hooks/list-node
(list*
(hooks/token-node `let)
(hooks/vector-node
[fn-binding (hooks/list-node
(list
(hooks/token-node `fn)
(hooks/vector-node [])))])
body))
(with-meta (meta node)))))]
(update x :node update-node)))

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
@@ -21,6 +22,7 @@
database-enable-actions
deprecation-notice-version
dismissed-custom-dashboard-toast
dismissed-onboarding-sidebar-link
email-configured?
email-from-address
email-from-name
@@ -161,6 +163,7 @@
token-features
token-status
toucan-name
trial-banner-dismissal-timestamp
uncached-setting
user-visibility
version
@@ -195,15 +198,18 @@
:message "Setting definition must provide an explicit value for :export? indicating whether the setting should be exported or not with serialization."
:type :metabase/defsetting-must-specify-export))))
{:node (-> (list
(hooks/token-node 'let)
{:node (-> (hooks/list-node
(list
(hooks/token-node 'let)
;; include description and the options map so they can get validated as well.
(hooks/vector-node
[anon-binding docstring
anon-binding (hooks/map-node options-list)])
getter-node
setter-node)
hooks/list-node
(hooks/vector-node
[anon-binding docstring
anon-binding (hooks/map-node options-list)])
(hooks/reg-keyword! (-> (hooks/keyword-node (keyword (hooks/sexpr setting-name)))
(with-meta (meta setting-name)))
'metabase.models.setting/defsetting)
getter-node
setter-node))
(with-meta (meta node)))}))
(defn defsetting
@@ -219,9 +225,11 @@
(defn my-setting! \"Docstring.\" [_value-or-nil]))
for linting purposes."
[{:keys [node]}]
[{:keys [node], :as context}]
(let [[setting-name docstring & options] (rest (:children node))]
(defsetting-lint node setting-name docstring options)))
(merge
context
(defsetting-lint node setting-name docstring options))))
(defn define-multi-setting
"Rewrite a [[metabase.models.define-multi-setting]] form like
@@ -236,9 +244,30 @@
(defn my-setting! \"Docstring.\" [_value-or-nil]))
for linting purposes."
[{:keys [node]}]
[{:keys [node], :as context}]
(let [[setting-name docstring thunk & options] (rest (:children node))]
(defsetting-lint node setting-name docstring (concat options [(hooks/token-node :multi-thunk) thunk]))))
(merge
context
(defsetting-lint node setting-name docstring (concat options [(hooks/token-node :multi-thunk) thunk])))))
(defn define-multi-setting-impl
[context]
(letfn [(update-node [node]
(let [[_define-multi-setting-impl setting-name & more] (:children node)]
(-> (hooks/list-node
(list*
(hooks/token-node 'do)
;; For a qualified setting name like `oss-namespace/setting`, then leave the symbol as is, so the
;; usage of that namespace/var gets recorded. Otherwise for an unqualified name convert it to a
;; keyword so we don't get unresolved var errors.
(if (and (hooks/token-node? setting-name)
(qualified-symbol? (hooks/sexpr setting-name)))
setting-name
(-> (hooks/keyword-node (keyword (hooks/sexpr setting-name)))
(with-meta (meta setting-name))))
more))
(with-meta (meta node)))))]
(update context :node update-node)))
(comment
(defn- defsetting* [form]

View File

@@ -0,0 +1,65 @@
(ns hooks.metabase.premium-features.defenterprise
(:require
[clj-kondo.hooks-api :as hooks]
[hooks.common]))
(defn defenterprise [{node :node}]
(let [[_defenterprise fn-name & args] (:children node)
[docstring & args] (if (hooks/string-node? (first args))
args
(cons nil args))
[_enterprise-namespace & args] (if (hooks/token-node? (first args))
args
(cons nil args))
[options fn-tail] (loop [options (hooks/map-node []), [x y & more :as args] args]
(if (hooks/keyword-node? x)
(recur (update options :children concat [x y]) more)
[options args]))]
{:node (hooks/list-node
(list
(hooks/token-node 'let)
(hooks/vector-node
[(hooks/token-node '_options) options])
(-> (hooks/list-node
(concat
(filter some?
(list (hooks/token-node 'defn)
fn-name
docstring))
fn-tail))
(with-meta (meta node))
hooks.common/add-lsp-ignore-unused-public-var-metadata)))}))
(comment
(defn- defenterprise* [form]
(hooks/sexpr
(:node
(defenterprise
{:node
(hooks/parse-string
(with-out-str
(clojure.pprint/pprint
form)))}))))
(defn- x []
(defenterprise*
'(defenterprise score-result
"Scoring implementation that adds score for items in official collections."
:feature :any
:fallback score-result-fallback
[result]
(conj (scoring/weights-and-scores result)
{:weight 2
:score (official-collection-score result)
:name "official collection score"}
{:weight 2
:score (verified-score result)
:name "verified"}))))
(defn- y []
(defenterprise*
'(defenterprise score-result
"Score a result, returning a collection of maps with score and weight."
metabase-enterprise.search.scoring
[result]
(weights-and-scores result)))))

View File

@@ -1,65 +0,0 @@
(ns hooks.metabase.public-settings.premium-features
(:require
[clj-kondo.hooks-api :as hooks]
[hooks.common]))
(defn defenterprise [{node :node}]
(let [[_defenterprise fn-name & args] (:children node)
[docstring & args] (if (hooks/string-node? (first args))
args
(cons nil args))
[_enterprise-namespace & args] (if (hooks/token-node? (first args))
args
(cons nil args))
[options fn-tail] (loop [options (hooks/map-node []), [x y & more :as args] args]
(if (hooks/keyword-node? x)
(recur (update options :children concat [x y]) more)
[options args]))]
{:node (hooks/list-node
(list
(hooks/token-node 'let)
(hooks/vector-node
[(hooks/token-node '_options) options])
(-> (hooks/list-node
(concat
(filter some?
(list (hooks/token-node 'defn)
fn-name
docstring))
fn-tail))
(with-meta (meta node))
hooks.common/add-lsp-ignore-unused-public-var-metadata)))}))
(comment
(defn- defenterprise* [form]
(hooks/sexpr
(:node
(defenterprise
{:node
(hooks/parse-string
(with-out-str
(clojure.pprint/pprint
form)))}))))
(defn- x []
(defenterprise*
'(defenterprise score-result
"Scoring implementation that adds score for items in official collections."
:feature :any
:fallback score-result-fallback
[result]
(conj (scoring/weights-and-scores result)
{:weight 2
:score (official-collection-score result)
:name "official collection score"}
{:weight 2
:score (verified-score result)
:name "verified"}))))
(defn- y []
(defenterprise*
'(defenterprise score-result
"Score a result, returning a collection of maps with score and weight."
metabase-enterprise.search.scoring
[result]
(weights-and-scores result)))))

View File

@@ -0,0 +1,17 @@
(ns hooks.metabase.search.api-test
(:require [clj-kondo.hooks-api :as hooks]))
(defn with-search-items-in-collection [{{[_ & args] :children, :as node} :node}]
;; (println \newline)
;; (clojure.pprint/pprint (hooks/sexpr node))
(let [[created-items-sym search-string & body] args
node* (hooks/list-node
(list*
(hooks/token-node 'let)
(hooks/vector-node
[created-items-sym (hooks/token-node 'nil)])
search-string
body))]
;; (println '=>)
;; (clojure.pprint/pprint (hooks/sexpr node*))
{:node node*}))

View File

@@ -1,11 +1,13 @@
(ns hooks.metabase.test.data.datasets
(:require [clj-kondo.hooks-api :as hooks]
[clojure.set :as set]))
(:require
[clj-kondo.hooks-api :as hooks]
[clojure.set :as set]
[hooks.common]))
(defn- only-core-drivers?
"Whether we're for sure only testing against the 'core' drivers that are also app DB types: `:postgres`, `:mysql`, or
`:h2`. Tests like these are ok to mark `:mb/once` or `:mb/driver-tests` since we always run the full test suite
against app DB drivers anyway."
`:h2`. Tests like these are ok to mark `:mb/driver-tests` since we always run the full test suite against app DB
drivers anyway."
[node]
(let [drivers (hooks/sexpr (second (:children node)))
drivers (cond
@@ -15,14 +17,6 @@
(when drivers
(empty? (set/difference drivers #{:h2 :mysql :postgres})))))
(defn- validate-mb-once [x]
(when (:mb/once (meta (:ns x)))
(hooks/reg-finding!
(assoc (meta (:ns x))
:message (str "You should not use test-driver or test-drivers in a namespace marked ^:mb/once"
" [:metabase/validate-mb-once]")
:type :metabase/validate-mb-once))))
(defn- validate-mb-driver-tests [x]
(when-not (:mb/driver-tests (meta (:ns x)))
(hooks/reg-finding!
@@ -33,7 +27,6 @@
(defn- validate-ns-tags [x]
(when-not (only-core-drivers? (:node x))
(validate-mb-once x)
(validate-mb-driver-tests x)))
(defn test-drivers [x]
@@ -45,7 +38,7 @@
(hooks/token-node 'do)
test-drivers
(-> drivers-expr
(vary-meta update :clj-kondo/ignore #(conj (vec %) :unused-value)))
(hooks.common/update-ignored-linters conj :unused-value))
body))
(with-meta (meta node)))))]
(update x :node update-node)))

View File

@@ -0,0 +1,14 @@
(ns hooks.metabase.test.gentest
(:require
[clj-kondo.hooks-api :as hooks]))
(defn with-gentest
"(with-gentest {:as limit-spec} [s1 val1 & more] body-form body-form...)"
[{{:keys [children] :as node} :node :as orig}]
(let [[token limit-spec bindings & body-nodes] children
node* (-> (hooks/list-node
(list token limit-spec
(hooks/list-node (list* (hooks/token-node 'let) bindings
body-nodes))))
(with-meta (meta node)))]
(assoc orig :node node*)))

View File

@@ -15,3 +15,17 @@
actual-arg-count)
:type :format))))))
x)
(defn case-enum
"Lint `(case-enum ...)` like `(condp = ...)`."
[x]
(letfn [(update-node [node]
(let [[_case-enum x & more] (:children node)]
(-> (api/list-node
(list*
(api/token-node 'clojure.core/condp)
(api/token-node 'clojure.core/=)
x
more))
(with-meta (meta node)))))]
(update x :node update-node)))

View File

@@ -0,0 +1,29 @@
(ns hooks.metabase.xrays.api.automagic-dashboards-test
(:require
[clj-kondo.hooks-api :as hooks]))
(comment
(def input (hooks/parse-string
"(with-indexed-model! [{:keys [model model-index model-index-value]}
{:query :some-query}]
:foo :bar :body)"))
(println (hooks/sexpr input))
(let [f (load-file ".clj-kondo/hooks/metabase/xrays/api/automagic_dashboards_test.clj")]
(f {:node input})))
(defn with-indexed-model!
[{node :node}]
(let [[_macro-call binding-and-query-info & body] (:children node)
[binding query-info] (:children binding-and-query-info)
node* (hooks/list-node
[(hooks/token-node 'do-with-indexed-model!)
query-info
(hooks/list-node
(list* (hooks/token-node 'fn)
(hooks/vector-node [binding])
body))])]
#_(println (hooks/sexpr node*))
{:node node*}))

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

@@ -3,7 +3,6 @@
[clj-kondo.hooks-api :as api]
[clj-kondo.impl.utils]
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.test :refer :all]
[hooks.clojure.test]))
@@ -44,9 +43,13 @@
(testing "Make sure we keep hooks.clojure.test/driver-keywords up to date"
(let [driver-keywords (-> (slurp ".clj-kondo/config.edn")
edn/read-string
(get-in [:linters :metabase/disallow-hardcoded-driver-names-in-tests :drivers]))]
(doseq [^java.io.File file (.listFiles (io/file "modules/drivers"))
:when (.isDirectory file)
:let [driver (keyword (.getName file))]]
(get-in [:linters :metabase/disallow-hardcoded-driver-names-in-tests :drivers]))
driver-modules (->> (slurp "modules/drivers/deps.edn")
edn/read-string
:deps
vals
(keep (comp keyword :local/root))
(into #{}))]
(doseq [driver driver-modules]
(is (contains? driver-keywords driver)
(format "hooks.clojure.test/driver-keywords should contain %s, please add it" driver))))))

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

@@ -1,10 +1,39 @@
(ns ^:mb/once hooks.common-test
(ns hooks.common-test
(:require
[clj-kondo.hooks-api :as api]
[clj-kondo.impl.utils]
[clojure.test :refer :all]
[hooks.common]))
(deftest ^:parallel ignored-linters-test
(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/modules}
(hooks.common/ignored-linters (api/parse-string s)))))))
(deftest ^:parallel merge-ignored-linters-test
(let [node-1 (api/parse-string "#_{:clj-kondo/ignore [:a]} [:a]")
node-2 (api/parse-string "#_{:clj-kondo/ignore [:b]} [:b]")
node-3 (api/parse-string "#_{:clj-kondo/ignore [:c]} [:c]")
node-1' (hooks.common/merge-ignored-linters node-1 node-2 node-3)]
(is (= #{:a :b :c}
(hooks.common/ignored-linters node-1')))
(testing "Updated metadata should match the shape Kondo expects"
(is (=? {:clj-kondo/ignore {:linters api/vector-node?}}
(meta node-1')))
(let [children (-> node-1' meta :clj-kondo/ignore :linters :children)]
(is (= (count children) 3))
(is (every? api/keyword-node? children))
(is (= [:a :b :c]
(sort (map api/sexpr children))))))))
(deftest ^:parallel node->qualified-symbol-test
(binding [clj-kondo.impl.utils/*ctx* {:namespaces (atom nil)}]
(is (= 'metabase.util.i18n/tru

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

@@ -0,0 +1,71 @@
(ns hooks.metabase.api.macros-test
(:require
[clj-kondo.hooks-api :as api]
[clojure.test :refer :all]
[hooks.metabase.api.macros]))
(defn- is-valid-node [x]
(is (api/node? x))
(doseq [child (:children x)]
(is-valid-node child)))
(deftest ^:parallel defendpoint-test
(letfn [(defendpoint [form]
(let [node (-> form pr-str api/parse-string)]
(is-valid-node node)
(-> {:node node}
hooks.metabase.api.macros/defendpoint
:node
api/sexpr)))]
(are [form expected] (= expected
(defendpoint form))
'(api.macros/defendpoint :post "/" :- [:map [:collection_id :int]]
"Create a new [[Timeline]]."
[_route-params
_query-params
{:keys [icon], collection-id :collection_id, :as body} :- [:map
[:name ms/NonBlankString]
[:default {:optional true} [:maybe :boolean]]]]
(body icon)
(body collection-id))
'(do
api.macros/defendpoint
:post
"/"
(do
[:map [:collection_id :int]]
[:map
[:name ms/NonBlankString]
[:default {:optional true} [:maybe :boolean]]])
(clojure.core/let [_route-params {}
_query-params {}
{:keys [icon], collection-id :collection_id, :as body} {}]
(body icon)
(body collection-id)))
'(api.macros/defendpoint :post "/"
[_route-params
_query-params
body
request
respond
raise]
(try
(respond :x)
(catch Throwable e
(raise e))))
'(do
api.macros/defendpoint
:post
"/"
(do)
(clojure.core/let [_route-params {}
_query-params {}
body {}
request {}
respond (clojure.core/constantly nil)
raise (clojure.core/constantly nil)]
(try
(respond :x)
(catch Throwable e
(raise e))))))))

View File

@@ -0,0 +1,19 @@
(ns hooks.metabase.model-persistence.test-util-test
(:require
[clj-kondo.hooks-api :as hooks]
[clojure.test :refer :all]
[hooks.metabase.model-persistence.test-util]))
(deftest ^:parallel with-persistence-enabled-test
(is (= '(clojure.core/let [persist-models! (clojure.core/fn [])]
(persist-models!)
:wow)
(as-> '(mt/with-persistence-enabled! [persist-models!]
(persist-models!)
:wow) <>
(pr-str <>)
(hooks/parse-string <>)
{:node <>}
(hooks.metabase.model-persistence.test-util/with-persistence-enabled! <>)
(:node <>)
(hooks/sexpr <>)))))

View File

@@ -1,4 +1,4 @@
(ns ^:mb/once hooks.metabase.util.log-test
(ns hooks.metabase.util.log-test
(:require
[clj-kondo.hooks-api :as api]
[clj-kondo.impl.utils]

View File

@@ -13,6 +13,8 @@
"test"
"enterprise/backend"
"bin/build"
"bin/lint-migrations-file"
"bin/release-list"
"modules/drivers"
".clj-kondo/src"
".clj-kondo/test"
@@ -91,7 +93,7 @@
metabase-enterprise.test/with-gtaps! [[:inner 0]]
metabase-enterprise.test/with-gtaps-for-user! [[:inner 0]]
metabase-enterprise.test/with-user-attributes [[:block 2]]
metabase.actions-test/with-actions-test-data-and-actions-permissively-enabled [[:block 0]]
metabase.actions.actions-test/with-actions-test-data-and-actions-permissively-enabled [[:block 0]]
metabase.actions.test-util/with-actions [[:block 1]]
metabase.actions.test-util/with-actions-disabled [[:block 0]]
metabase.actions.test-util/with-actions-enabled [[:block 0]]
@@ -100,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]]
@@ -112,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]]
@@ -124,17 +122,6 @@
metabase.api.embed-test/with-temp-dashcard [[:block 1]]
metabase.api.preview-embed-test/with-embedding-enabled-and-new-secret-key [[:block 0]]
metabase.api.preview-embed-test/with-new-secret-key [[:block 0]]
metabase.api.public-test/with-sharing-enabled-and-temp-card-referencing [[:block 3]]
metabase.api.public-test/with-sharing-enabled-and-temp-dashcard-referencing [[:block 3]]
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.async.streaming-response/streaming-response [[:block 2]]
metabase.async.streaming-response-test/with-streaming-response-thread-pool [[:block 0]]
metabase.async.streaming-response-test/with-test-driver-db! [[:block 0]]
metabase.async.util/cancelable-thread [[: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]]
@@ -177,11 +164,19 @@
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.public-sharing.api-test/with-sharing-enabled-and-temp-card-referencing [[:block 3]]
metabase.public-sharing.api-test/with-sharing-enabled-and-temp-dashcard-referencing [[:block 3]]
metabase.public-sharing.api-test/with-temp-public-card [[:block 1]]
metabase.public-sharing.api-test/with-temp-public-dashboard [[:block 1]]
metabase.public-sharing.api-test/with-temp-public-dashboard-and-card [[:block 1]]
metabase.pulse.api.alert-test/with-alert-in-collection [[:block 1]]
metabase.pulse.models.pulse-test/with-dashboard-subscription-in-collection [[:block 1]]
metabase.pulse.models.pulse-test/with-pulse-in-collection [[:inner 0]]
metabase.query-processor-test.pipeline-queries-test/pmbql-query [[:block 1]]
metabase.query-processor-test.pipeline-queries-test/run-pmbql-query [[:block 1]]
metabase.query-processor.debug/debug> [[:block 0]]
@@ -192,9 +187,20 @@
metabase.query-processor.store/with-metadata-provider [[:inner 0]]
metabase.query-processor.streaming/streaming-response [[:block 1]]
metabase.query-processor.test-util/format-rows-by [[:default]]
metabase.request.core/as-admin [[:block 0]]
metabase.request.core/with-current-request [[:inner 0]]
metabase.request.core/with-current-user [[:inner 0]]
metabase.request.core/with-limit-and-offset [[:inner 0]]
metabase.request.session/as-admin [[:block 0]]
metabase.request.session/with-current-user [[:inner 0]]
metabase.sample-data-test/with-temp-sample-database-db [[:block 1]]
metabase.search.api-test/do-test-users [[:block 1]]
metabase.server.middleware.session/as-admin [[:block 0]]
metabase.server.middleware.session/with-current-user [[:inner 0]]
metabase.server.streaming-response-test/with-streaming-response-thread-pool [[:block 0]]
metabase.server.streaming-response-test/with-test-driver-db! [[:block 0]]
metabase.server.streaming-response/streaming-response [[:block 2]]
metabase.session.api/http-401-on-error [[:block 0]]
metabase.sync.fetch-metadata/log-if-error [[:block 1]]
metabase.sync.sync-metadata.fields-test/with-test-db [[:block 0]]
metabase.sync.util/do-with-start-and-finish-debug-logging [[:default]]
@@ -269,12 +275,14 @@
metabase.upload.types/with-currency [[:default]]
metabase.upload.types/with-parens [[:default]]
metabase.util/auto-retry [[:block 1]]
metabase.util/case-enum [[:block 1]]
metabase.util/ignore-exceptions [[:block 0]]
metabase.util/or-with [[:block 1]]
metabase.util/profile [[:block 1]]
metabase.util/prog1 [[:inner 0]]
metabase.util/varargs [[:inner 0]]
metabase.util/with-us-locale [[:block 0]]
metabase.util.async/cancelable-thread [[:block 0]]
metabase.util.date-2/with-time-zone-same-instant [[:default]]
metabase.util.encryption-test/with-secret-key [[:block 1]]
metabase.util.honey-sql-2/with-database-type-info [[:default]]

View File

@@ -20,13 +20,8 @@
(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 'defendpoint-async '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/defendpoint-async '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))
(eval . (put 's/defn 'clojure-doc-string-elt 2))

View File

@@ -17,7 +17,7 @@ module.exports = {
{
vars: "all",
args: "none",
varsIgnorePattern: "^_",
varsIgnorePattern: "^_.+$",
ignoreRestSiblings: true,
},
],
@@ -108,7 +108,6 @@ module.exports = {
"When",
"Then",
"describeWithSnowplow",
"describeEE",
],
},
],
@@ -220,10 +219,10 @@ module.exports = {
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
argsIgnorePattern: "^_.+$",
varsIgnorePattern: "^_.+$",
ignoreRestSiblings: true,
destructuredArrayIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_.+$",
},
],
// This was introduced in 6.0.0
@@ -253,5 +252,36 @@ module.exports = {
extends: ["plugin:jest-formatting/recommended"],
files: ["*.cy.spec.ts", "*.cy.spec.js"],
},
{
files: ["frontend/src/**/*"],
rules: {
"no-restricted-syntax": [
"error",
{
selector: "Literal[value=/mb-base-color-/]",
message:
"You may not use base colors in the application, use semantic colors instead. (see colors.module.css)",
},
],
},
},
{
files: ["frontend/src/metabase/**/*"],
rules: {
"no-restricted-syntax": [
"error",
{
selector: "Literal[value=/mb-base-color-/]",
message:
"You may not use base colors in the application, use semantic colors instead. (see colors.module.css)",
},
{
selector:
"CallExpression[callee.property.name='legacyQuery'] > ObjectExpression > Property[key.name='useStructuredQuery'][value.value=true]",
message: "StructuredQuery usage is forbidden. Use MLv2",
},
],
},
},
],
};

263
.github/CODEOWNERS vendored
View File

@@ -1,16 +1,257 @@
# 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
# TL;DR: if @camsaul hasn't been involved you're probably doing it wrong
src/metabase @camsaul
modules @camsaul
enterprise/backend @camsaul
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/ui @metabase/core-frontend-admin-webapp
src/metabase/**/*permissions* @noahmoss
src/metabase/integrations @noahmoss
snowplow/* @metabase/data
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/embed @metabase/embedding
test/metabase/embed @metabase/embedding
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/model_persistence @metabase/core-backend-querying
test/metabase/model_persistence @metabase/core-backend-querying
src/metabase/models @metabase/devexp
test/metabase/models @metabase/devexp
src/metabase/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/public_sharing @metabase/core-backend-admin-webapp
test/metabase/public_sharing @metabase/core-backend-admin-webapp
src/metabase/pulse @metabase/core-workflows
test/metabase/pulse @metabase/core-workflows
src/metabase/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/sso @metabase/core-backend-admin-webapp
test/metabase/sso @metabase/core-backend-admin-webapp
src/metabase/sync @metabase/drivers
test/metabase/sync @metabase/drivers
src/metabase/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

@@ -66,12 +66,13 @@ body:
Copy and paste the JSON from `Admin -> Troubleshooting`.
_This will be automatically formatted into code, so no need for backticks._
placeholder: |
- Your browser and the version: (e.g., Chrome 52.1, Firefox 48.0, Safari 11.1, …)
- Your operating system: (e.g., OS X 10.10, Windows 10.1809, Ubuntu 16.04, …)
- Your databases: (e.g, MySQL, Postgres, MongoDB, …)
- Metabase version: (e.g., 0.19.3)
- Metabase hosting environment: (e.g., Elastic Beanstalk, Docker, Heroku, Jar-file on Ubuntu, …)
- Metabase internal database: (e.g., H2 (default), Postgres or MySQL)
{"browser-info": {
"language": "en-US",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
"vendor": "Google Inc."},
"metabase-info": {
"databases": [ "postgres",...
render: JSON
validations:
required: true

View File

@@ -5,20 +5,19 @@ about: This issue is used to track a feature/project that may span several days
and manage work.
title: "[Epic] Title"
labels: ".Epic"
---
**Links**
- product doc: _link to product doc_
- eng doc: _link to technical design doc, if any_
- feature branch: `branch-name` _this should be the feature branch where this work will be done in. PRs will be delivered against this branch_
- issue links: _related issues if any_
### Links
**Implementation Plan**
- [product doc](LINK_TO_PRODUCT_DOC)
- [technical design doc](LINK_TO_TECHNICAL_DESIGN_DOC)
- [testing plan](LINK_TO_TESTING_PLAN)
- feature branch: `BRANCH_NAME`
- issue links: _related issues, if any_
### Implementation Plan
***Milestone 1***
_insert tasklist here_
***Milestone 2***
```[tasklist]
#### Milestone 1
- [ ] _Add tasks here_
```

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

@@ -1,70 +0,0 @@
name: Build E2E Matrix
description: Build and output a custom matrix for E2E tests.
outputs:
matrix:
description: Parameterized matrix in JSON format
value: ${{ steps.matrix.outputs.result }}
runs:
using: "composite"
steps:
- uses: actions/github-script@v7
id: matrix
with:
script: | # js
const java = 11;
const defaultRunner = "ubuntu-22.04";
const defaultOptions = {
"java-version": java,
runner: defaultRunner,
edition: "ee",
context: "folder"
};
const testSets = [
["actions", {} ],
["admin", {} ],
["admin-2", {} ],
["binning", {} ],
["collections", {} ],
["custom-column", {} ],
["dashboard", {} ],
["dashboard-cards", {} ],
["dashboard-filters", {} ],
["embedding", {} ],
["embedding-sdk", { context: "embedding-sdk" } ],
["filters", {} ],
["filters-reproductions", {}],
["joins", {} ],
["metrics", {} ],
["models", {} ],
["native", {} ],
["native-filters", {} ],
["onboarding", {} ],
["organization", {} ],
["permissions", {} ],
["question", {} ],
["question-reproductions", {} ],
["search", {}],
["sharing", {} ],
["visualizations-charts", {} ],
["visualizations-tabular", {} ],
["oss-subset", { edition: 'oss', context: "special" } ],
["slow", { context: "special" } ],
["flaky", { context: "special" } ],
["mongo", { context: "qa-database" } ],
];
const config = testSets.map(([name, specialOptions]) => {
return {
...defaultOptions,
...specialOptions,
name,
}
});
const matrix = { include: config };
return matrix;

View File

@@ -2,6 +2,9 @@ name: Build ee-extra
description: Build Metabase Enterprise Edition with extra features
inputs:
java-version:
required: true
default: 21
iam-role:
description: "The IAM role to assume"
required: true
@@ -12,10 +15,10 @@ runs:
- name: Prepare Java
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: ${{ inputs.java-version }}
distribution: 'temurin'
- name: Reveal its original version.properties
run: jar xf ./bin/docker/metabase.jar version.properties && cat version.properties
run: jar xf ./bin/docker/metabase.jar version.properties && cat version.properties
shell: bash
- name: get major version
id: major_version
@@ -27,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
@@ -61,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'),
};
@@ -81,22 +81,11 @@ runs:
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
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
run: |
curl -OL ${{ fromJson(steps.drivers_registry.outputs.result).materialize }}
@@ -106,7 +95,8 @@ runs:
run: jar uf bin/docker/metabase.jar modules/*.jar
shell: bash
- name: Launch uberjar
run: java -jar ./bin/docker/metabase.jar &
run: >-
java --add-opens java.base/java.nio=ALL-UNNAMED -jar ./bin/docker/metabase.jar &
shell: bash
- name: Wait for Metabase to start
run: while ! curl 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done

View File

@@ -0,0 +1,101 @@
name: Create Backport PR
inputs:
target-version: # major version number like 34 or 86
required: true
backport-commit:
required: true
github-token:
required: true
github-token-2: # need a second token to approve the PR
required: true
runs:
using: "composite"
steps:
- id: create_backport_pull_request
name: Create backport pull request
env:
TARGET_VERSION: ${{ inputs.target-version }}
TARGET_BRANCH: release-x.${{ inputs.target-version }}.x
ORIGINAL_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
ORIGINAL_TITLE: ${{ github.event.pull_request.title }}
GITHUB_TOKEN: ${{ inputs.github-token }}
COMMIT: ${{ inputs.backport-commit }}
shell: bash
run: |
git config --global user.email "metabase-bot@metabase.com"
git config --global user.name "Metabase bot"
BACKPORT_BRANCH="backport-$TARGET_VERSION-$COMMIT"
# Checkout the target branch and create a new backport branch
git checkout ${TARGET_BRANCH}
git fetch --all
git checkout -b ${BACKPORT_BRANCH}
git cherry-pick ${COMMIT} || true
CONFLICTS=$(git ls-files -u | wc -l)
if [ "$CONFLICTS" -gt 0 ]; then
git cherry-pick --abort
echo "Could not cherry pick because of a conflict"
echo "has-conflicts=true" >> $GITHUB_OUTPUT
# Add a shell script for resolving conflicts
echo "git reset HEAD~1" > ./backport.sh
echo "rm ./backport.sh" >> ./backport.sh
echo "git cherry-pick ${COMMIT}" >> ./backport.sh
echo "echo 'Resolve conflicts and force push this branch'" >> ./backport.sh
chmod +x ./backport.sh
git add ./backport.sh
git commit -m "Add backport resolution script"
PR_BODY=$(cat <<-END
#${ORIGINAL_PULL_REQUEST_NUMBER}
> [!IMPORTANT]
> Manual conflict resolution is required.
Checkout the branch and run \`./backport.sh\` script. Force push your changes after cherry-picking.
END
)
else
echo "has-conflicts=false" >> $GITHUB_OUTPUT
PR_BODY="#${ORIGINAL_PULL_REQUEST_NUMBER}"
fi
git push -u origin ${BACKPORT_BRANCH}
BACKPORT_PR_URL=$(gh pr create --base "${TARGET_BRANCH}" --head "${BACKPORT_BRANCH}" --label "was-backported" --assignee "${GITHUB_ACTOR}" --title "🤖 backported \"${ORIGINAL_TITLE}\"" --body "${PR_BODY}")
BACKPORT_PR_NUMBER=${BACKPORT_PR_URL##*/}
echo "backport_pr_number=$BACKPORT_PR_NUMBER" >> $GITHUB_OUTPUT
echo "New PR has been created: #${BACKPORT_PR_NUMBER}"
git checkout ${{ github.sha }}
- name: Auto approve backport PR
if: ${{ steps.create_backport_pull_request.outputs.has-conflicts == 'false' }}
uses: juliangruber/approve-pull-request-action@v1
with:
github-token: ${{ inputs.github-token-2 }}
number: ${{ steps.create_backport_pull_request.outputs.backport_pr_number }}
- name: Enable Pull Request Automerge
if: ${{ steps.create_backport_pull_request.outputs.has-conflicts == 'false' }}
uses: peter-evans/enable-pull-request-automerge@v2
with:
token: ${{ inputs.github-token }}
pull-request-number: ${{ steps.create_backport_pull_request.outputs.backport_pr_number }}
merge-method: squash
- uses: ./.github/actions/notify-pull-request
if: ${{ steps.create_backport_pull_request.outputs.has-conflicts == 'true' }}
with:
include-log: false
message: Manual conflict resolution is required on \#${{ steps.create_backport_pull_request.outputs.backport_pr_number }}
- uses: ./.github/actions/notify-pull-request
if: ${{ failure() }}
with:
include-log: true
message: Something went wrong while creating backport

View File

@@ -68,10 +68,3 @@ runs:
- name: Unzip Metabase artifact containing an uberjar
run: unzip mb.zip
shell: bash
- name: Get the version info
run: |
jar xf target/uberjar/metabase.jar version.properties
cat version.properties
mv version.properties resources/
shell: bash

View File

@@ -90,7 +90,7 @@ runs:
if ${{ inputs.webhook }}; then
echo -e "${Y}Starting webhook test container..." &&
docker run -d -p 9080:8080/tcp tarampampam/webhook-tester serve --create-session 00000000-0000-0000-0000-000000000000 &&
docker run -d -p 9080:8080/tcp tarampampam/webhook-tester:1.1.0 serve --create-session 00000000-0000-0000-0000-000000000000 &&
while ! nc -z localhost 9080; do sleep 1; done &&
echo -e "${G}Webhook tester is up and running!"
fi

View File

@@ -28,3 +28,5 @@ runs:
env:
PULL_REQUEST_NUMBER: ${{ inputs.pull-request-number }}
BASE_REF: ${{ inputs.base-ref }}
- run: git checkout ${{ github.sha }} # return to original commit
shell: bash

View File

@@ -1,41 +0,0 @@
name: Get latest release branch
outputs:
branch-name:
value: ${{ steps.get-latest-release-branch.outputs.result }}
runs:
using: "composite"
steps:
- uses: actions/github-script@v7
id: get-latest-release-branch
with:
result-encoding: string
script: |
const releaseBranches = await github.rest.git.listMatchingRefs({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "heads/release-x.",
});
const getVersionFromBranch = branch => {
const match = branch.match(/release-x\.(.*?)\.x$/);
return match && parseInt(match[1]);
};
const latestReleaseBranch = releaseBranches.data
.filter(branch => getVersionFromBranch(branch.ref) !== null)
.reduce(
(prev, current) =>
getVersionFromBranch(prev.ref) > getVersionFromBranch(current.ref)
? prev
: current,
{ ref: "" },
);
const latestReleaseBranchName = latestReleaseBranch.ref.replace(
/^refs\/heads\//,
"",
);
console.log(`Latest release branch: ${latestReleaseBranchName}`);
return latestReleaseBranchName;

View File

@@ -10,10 +10,17 @@ runs:
using: "composite"
steps:
- uses: actions/github-script@v7
id: get-latest-release-branch
id: notify-pull-request
with:
result-encoding: string
script: |
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;
@@ -27,7 +34,7 @@ runs:
}
github.rest.issues.createComment({
issue_number: context.payload.issue.number,
issue_number: pr.number,
owner: context.repo.owner,
repo: context.repo.repo,
body,

View File

@@ -2,10 +2,10 @@ name: Prepare back-end environment
inputs:
java-version:
required: true
default: '11'
default: '21'
clojure-version:
required: true
default: '1.11.1.1262'
default: '1.12.0.1488'
m2-cache-key:
description: 'Key to cache M2 packages from Maven Central'
required: true

View File

@@ -33,18 +33,5 @@ runs:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock', '**/patches/*.patch') }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/cache@v4
if: steps.node-modules-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile --prefer-offline
shell: bash

View File

@@ -5,19 +5,24 @@ inputs:
default: "driver"
test-args:
required: false
build-static-viz:
required: true
default: false
runs:
using: "composite"
steps:
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: driver
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
if: ${{ inputs.build-static-viz == 'true' }}
- name: Build static viz frontend
run: yarn build-static-viz
shell: bash
if: ${{ inputs.build-static-viz == 'true' }}
- name: Test database driver
run: clojure -X:dev:ci:ee:ee-dev:drivers:drivers-dev:test ${{ inputs.test-args }}
shell: bash

View File

@@ -5,9 +5,9 @@
files:
# migrations related files
'resources/migrations/**':
- team:core-backend-components
- team:core-workflows
'src/metabase/db/custom_migrations.clj':
- team:core-backend-components
- team:core-workflows
options:
ignore_draft: true

View File

@@ -5,6 +5,7 @@ default: &default
shared_sources: &shared_sources
- "src/**/*.cljc"
- "src/**/*.cljs"
- "package.json"
shared_specs: &shared_specs
- "test/**/*.cljc"
@@ -79,7 +80,6 @@ backend_specs: &backend_specs
- "test_modules/**"
- "modules/drivers/*/test/**"
- "test_config/**"
- "dev/**"
- "test_resources/**"
backend_all: &backend_all
@@ -94,14 +94,13 @@ sources: &sources
- *backend_sources
e2e_ci: &e2e_ci
- ".github/actions/build-e2e-matrix/**"
- ".github/actions/prepare-frontend/**"
- ".github/actions/prepare-backend/**"
- ".github/actions/prepare-uberjar-artifact/**"
- ".github/actions/e2e-prepare-containers/**"
- ".github/actions/prepare-cypress/**"
- ".github/actions/run-snowplow-micro/**"
- ".github/workflows/e2e-tests.yml"
- ".github/workflows/e2e-*"
e2e_specs: &e2e_specs
- "**/*.cy.*.js"

View File

@@ -1,4 +1,5 @@
const fs = require("fs");
const { merge } = require("mochawesome-merge");
const logger = { debug: console.debug, error: console.error };
@@ -50,15 +51,16 @@ const extractTestResultsInfo = ({ results, stats }) => {
};
};
function parseReport() {
const content = fs.readFileSync(
"./cypress/reports/cypress-test-report.json",
"utf-8",
);
async function generateReport() {
const files = ["./cypress/reports/mochareports/*.json"];
const data = JSON.parse(content);
return await merge({ files });
}
return extractTestResultsInfo(data).failedTests.map(test => ({
exports.generateReport = generateReport;
function parseReport(report) {
return extractTestResultsInfo(report).failedTests.map(test => ({
title: test.fullTitle,
error: test.err?.message,
path: test.path,

View File

@@ -10,9 +10,9 @@ export PATH="$PATH:$JAVA_HOME/bin"
which java
# install clojure version needed for Metabase
curl -O https://download.clojure.org/install/linux-install-1.11.0.1100.sh
chmod +x linux-install-1.11.0.1100.sh
./linux-install-1.11.0.1100.sh
curl -O https://download.clojure.org/install/linux-install-1.12.0.1488.sh
chmod +x linux-install-1.12.0.1488.sh
./linux-install-1.12.0.1488.sh
RESOURCES_DIR=/app/source/resources

43
.github/team.json vendored
View File

@@ -12,42 +12,58 @@
"metamben",
"lbrdnk",
"appleby",
"uladzimirdev"
"uladzimirdev",
"wzimrin",
"ericnormand"
]
},
{
"name": "Drivers",
"label": ".Team/Drivers",
"members": ["snoe"]
"projectUrl": "https://github.com/orgs/metabase/projects/98/views/1",
"members": [
"snoe",
"rileythomp"
]
},
{
"name": "Embedding",
"label": ".Team/Embedding",
"projectUrl": "https://github.com/orgs/metabase/projects/88/views/1",
"members": ["WiNloSt", "deniskaber", "oisincoveney", "npretto", "heypoom"]
"members": [
"WiNloSt",
"oisincoveney",
"npretto",
"heypoom",
"sanex3339"
]
},
{
"name": "BEC",
"label": ".Team/BackendComponents",
"name": "Workflows",
"label": ".Team/Workflows",
"projectUrl": "https://github.com/orgs/metabase/projects/50/views/1",
"members": [
"tsmacdonald",
"qnkhuat",
"piranha",
"crisptrutski"
"crisptrutski",
"deniskaber",
"wotbrew",
"spalt08",
"stasgavrylov"
]
},
{
"name": "Admin Webapp",
"label": ".Team/AdminWebapp",
"members": [
"noahmoss",
"escherize",
"npfitz",
"johnswanson",
"rafpaf",
"sloansparger",
"iethree"
"iethree",
"nvoxland",
"fraserdrops",
"edpaget"
]
},
{
@@ -56,14 +72,17 @@
"members": [
"alxnddr",
"kulyk",
"adam-james-v"
"tsplude",
"lorem--ipsum",
"noahmoss"
]
},
{
"name": "DevEx",
"label": ".Team/DevEx",
"members": [
"camsaul"
"camsaul",
"escherize"
]
}
]

View File

@@ -5,8 +5,16 @@ on:
jobs:
create-backport:
if: github.event.pull_request.merged == true && (contains(github.event.pull_request.labels.*.name, 'backport') && github.event.action == 'closed' || github.event.label.name == 'backport')
runs-on: ubuntu-22.04
if: | # the PR must be closed and have a backport label
(github.event.pull_request.merged == true || github.event.action == 'closed') && (
contains(github.event.pull_request.labels.*.name, 'backport') ||
contains(github.event.pull_request.labels.*.name, 'double-backport') ||
contains(github.event.pull_request.labels.*.name, 'triple-backport') ||
github.event.label.name == 'backport' ||
github.event.label.name == 'double-backport' ||
github.event.label.name == 'triple-backport'
)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
@@ -19,91 +27,68 @@ jobs:
pull-request-number: ${{ github.event.pull_request.number }}
base-ref: ${{ github.event.pull_request.base.ref }}
- uses: ./.github/actions/get-latest-release-branch
name: Get latest release branch
id: get_latest_release_branch
- id: create_backport_pull_request
name: Create backport pull request
run: |
git config --global user.email "metabase-bot@metabase.com"
git config --global user.name "Metabase bot"
BACKPORT_BRANCH="backport-$COMMIT"
# Checkout the target branch and create a new backport branch
git checkout ${TARGET_BRANCH}
git fetch --all
git checkout -b ${BACKPORT_BRANCH}
git cherry-pick ${COMMIT} || true
CONFLICTS=$(git ls-files -u | wc -l)
if [ "$CONFLICTS" -gt 0 ]; then
git cherry-pick --abort
echo "Could not cherry pick because of a conflict"
echo "has-conflicts=true" >> $GITHUB_OUTPUT
# Add a shell script for resolving conflicts
echo "git reset HEAD~1" > ./backport.sh
echo "rm ./backport.sh" >> ./backport.sh
echo "git cherry-pick ${COMMIT}" >> ./backport.sh
echo "echo 'Resolve conflicts and force push this branch'" >> ./backport.sh
chmod +x ./backport.sh
git add ./backport.sh
git commit -m "Add backport resolution script"
PR_BODY=$(cat <<-END
#${ORIGINAL_PULL_REQUEST_NUMBER}
> [!IMPORTANT]
> Manual conflict resolution is required.
Checkout the branch and run \`./backport.sh\` script. Force push your changes after cherry-picking.
END
)
else
echo "has-conflicts=false" >> $GITHUB_OUTPUT
PR_BODY="#${ORIGINAL_PULL_REQUEST_NUMBER}"
fi
git push -u origin ${BACKPORT_BRANCH}
BACKPORT_PR_URL=$(gh pr create --base "${TARGET_BRANCH}" --head "${BACKPORT_BRANCH}" --label "was-backported" --assignee "${GITHUB_ACTOR}" --title "🤖 backported \"${ORIGINAL_TITLE}\"" --body "${PR_BODY}")
BACKPORT_PR_NUMBER=${BACKPORT_PR_URL##*/}
echo "backport_pr_number=$BACKPORT_PR_NUMBER" >> $GITHUB_OUTPUT
echo "New PR has been created"
git checkout master
env:
TARGET_BRANCH: ${{ steps.get_latest_release_branch.outputs.branch-name }}
ORIGINAL_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
ORIGINAL_TITLE: ${{ github.event.pull_request.title }}
GITHUB_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
COMMIT: ${{ steps.find_commit.outputs.commit }}
- name: Auto approve backport PR
if: ${{ steps.create_backport_pull_request.outputs.has-conflicts == 'false' }}
uses: juliangruber/approve-pull-request-action@v1
- name: how many backports?
id: how-many-backports
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.create_backport_pull_request.outputs.backport_pr_number }}
script: | # js
const labels = [
...${{ toJson(github.event.pull_request.labels) }},
{ name:"${{ github.event.label.name }}" }
];
- name: Enable Pull Request Automerge
if: ${{ steps.create_backport_pull_request.outputs.has-conflicts == 'false' }}
uses: peter-evans/enable-pull-request-automerge@v2
with:
token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
pull-request-number: ${{ steps.create_backport_pull_request.outputs.backport_pr_number }}
merge-method: squash
const backportLabelNames = labels.filter(label => label.name.includes('backport')).map(label => label.name);
- uses: ./.github/actions/notify-pull-request
if: ${{ steps.create_backport_pull_request.outputs.has-conflicts == 'true' }}
with:
include-log: false
message: Manual conflict resolution is required
let result = 1;
- uses: ./.github/actions/notify-pull-request
if: ${{ failure() }}
if (backportLabelNames.includes("triple-backport")) {
result = 3;
} else if (backportLabelNames.includes("double-backport")) {
result = 2;
}
console.log("backports", result);
return result;
- name: get release versions
id: get-latest-release-version
uses: actions/github-script@v7
with:
include-log: true
message: Something went wrong while creating a backport
script: | # js
const currentVersion = Number(${{ vars.CURRENT_VERSION }});
const result = {
latest: currentVersion,
secondLatest: currentVersion - 1,
thirdLatest: currentVersion - 2,
};
console.log(result);
return result;
- name: Single Backport
uses: ./.github/actions/create-backport
with:
target-version: ${{ fromJson(steps.get-latest-release-version.outputs.result).latest }}
backport-commit: ${{ steps.find_commit.outputs.commit }}
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
github-token-2: ${{ secrets.GITHUB_TOKEN }}
- name: Double Backport
if: ${{ fromJson(steps.how-many-backports.outputs.result) >= 2 }}
uses: ./.github/actions/create-backport
with:
target-version: ${{ fromJson(steps.get-latest-release-version.outputs.result).secondLatest }}
backport-commit: ${{ steps.find_commit.outputs.commit }}
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
github-token-2: ${{ secrets.GITHUB_TOKEN }}
- name: Triple Backport
if: ${{ fromJson(steps.how-many-backports.outputs.result) >= 3 }}
uses: ./.github/actions/create-backport
with:
target-version: ${{ fromJson(steps.get-latest-release-version.outputs.result).thirdLatest }}
backport-commit: ${{ steps.find_commit.outputs.commit }}
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
github-token-2: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -7,6 +7,8 @@ on:
jobs:
be-linter-cloverage:
# don't run this workflow on a cron for forks
if: ${{ github.event_name != 'schedule' || github.repository == 'metabase/metabase' }}
runs-on: ubuntu-22.04
timeout-minutes: 90
steps:

View File

@@ -1,72 +1,22 @@
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
steps:
- uses: actions/checkout@v4
- name: Prepare back-end environment
@@ -77,13 +27,10 @@ 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
steps:
- uses: actions/checkout@v4
- name: Prepare back-end environment
@@ -93,95 +40,100 @@ 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-java-11-ee-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')
runs-on: ubuntu-22.04
name: be-tests-java-11-ee-pre-check
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: java-11-ee-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()
with:
path: "target/junit/**/*_test.xml"
name: JUnit Test Report be-tests-java-11-ee-pre-check
reporter: java-junit
list-suites: failed
list-tests: failed
fail-on-error: false
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
name: be-tests-java-${{ matrix.java-version }}-${{ matrix.edition }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
edition: [oss, ee]
java-version: [11, 17, 21]
java-version: [21]
job:
- name: Enterprise Tests
edition: ee
build-static-viz: 'false'
test-args: >-
:only '"enterprise/backend/test"'
- name: EE App DB Tests (Part 1)
edition: ee
build-static-viz: 'true'
test-args: >-
:only '["test" ".clj-kondo/test"]'
:partition/total 2
:partition/index 0
- name: EE App DB Tests (Part 2)
edition: ee
build-static-viz: 'true'
test-args: >-
:only '["test" ".clj-kondo/test"]'
:partition/total 2
:partition/index 1
- name: OSS App DB Tests (Part 1)
edition: oss
build-static-viz: 'true'
test-args: >-
:only '["test" ".clj-kondo/test"]'
:partition/total 2
:partition/index 0
- name: OSS App DB Tests (Part 2)
edition: oss
build-static-viz: 'true'
test-args: >-
:only '["test" ".clj-kondo/test"]'
:partition/total 2
:partition/index 1
name: "Java ${{ matrix.java-version }} ${{ matrix.job.name }}"
env:
# Only run old migrations tests on pushes to master or release branches. All other branches should skip tests
# with the tag `mb/old-migrations-test`. `__ADDITIONAL_EXCLUDED_TAG__` is not used anywhere outside of splicing
# it in to the command below.
__ADDITIONAL_EXCLUDED_TAG__: >-
${{
(
github.event_name == 'push' &&
(
github.ref == 'master' ||
startsWith(github.ref, 'release-')
) &&
''
) ||
':mb/old-migrations-test'
}}
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
if: ${{ matrix.job.build-static-viz == 'true' }}
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: be-tests
java-version: "${{ matrix.java-version }}"
# Depending on which files changed, we might either have to build static-viz
# from scratch or download the previously built artifact
- name: Build static-viz frontend
if: needs.files-changed.outputs.backend_all == 'true'
if: ${{ matrix.job.build-static-viz == 'true' && !inputs.skip }}
run: yarn build-static-viz
- name: Download Static Viz Bundle Artifact
if: 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 }}
path: resources/frontend_client/app/dist
- name: Run tests
- name: "Test Java ${{ matrix.java-version }} ${{ matrix.job.name }}"
id: run-java-tests
if: matrix.java-version != 21
run: clojure -X:dev:ci:test:${{ matrix.edition }}:${{ matrix.edition }}-dev
- name: If using Java 21, only run tests on `master`
id: run-java-tests-21
if: matrix.java-version == 21 && github.ref_name == 'master'
run: clojure -X:dev:ci:test:${{ matrix.edition }}:${{ matrix.edition }}-dev
run: >-
clojure -X:dev:ci:test:${{ matrix.job.edition }}:${{ matrix.job.edition }}-dev
:exclude-tags '[:mb/driver-tests ${{ env.__ADDITIONAL_EXCLUDED_TAG__ }}]'
${{ matrix.job.test-args }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always() && (steps.run-java-tests.conclusion != 'skipped' || steps.run-java-tests-21.conclusion != 'skipped')
with:
input-path: ./target/junit/
output-name: be-tests-java-${{ matrix.java-version }}-${{ matrix.edition }}
output-name: be-tests-java-${{ matrix.java-version }}-${{ matrix.job.edition }}
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 }}
@@ -193,74 +145,37 @@ jobs:
if: failure()
with:
path: "target/junit/**/*_test.xml"
name: JUnit Test Report be-tests-java-${{ matrix.java-version }}-${{ matrix.edition }}
name: JUnit Test Report be-tests-java-${{ matrix.java-version }}-${{ matrix.job.edition }}
reporter: java-junit
list-suites: failed
list-tests: failed
fail-on-error: false
be-tests-stub:
needs: [be-tests]
if: |
!cancelled() &&
github.event.pull_request.draft == false && needs.be-tests.result == 'skipped'
runs-on: ubuntu-22.04
name: be-tests-java-${{ matrix.java-version }}-${{ matrix.edition }}
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
edition: [oss, ee]
java-version: [11, 17, 21]
steps:
- run: |
echo "Didn't run due to conditional filtering"
# 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
name: be-check-java-${{ matrix.java-version }}
timeout-minutes: 10
strategy:
matrix:
java-version: [11, 17, 21]
java-version: [21]
name: "Check Java ${{ matrix.java-version }}"
steps:
- uses: actions/checkout@v4
- name: Prepare backend
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: be-check
# TODO -- we should probably also check WITHOUT ee -- do a check with only OSS namespaces on the classpath
- name: Check namespaces
run: clojure -M:ee:drivers:check
be-check-stub:
needs: [files-changed, static-viz-files-changed, be-check]
if: |
always() &&
github.event.pull_request.draft == false &&
needs.be-check.result == 'skipped'
runs-on: ubuntu-22.04
name: be-check-java-${{ matrix.java-version }}
timeout-minutes: 10
strategy:
matrix:
java-version: [11, 17, 21]
steps:
- run: |
echo "Didn't run due to conditional filtering"
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
steps:
- uses: actions/checkout@v4
- name: Prepare back-end environment
@@ -269,3 +184,44 @@ jobs:
m2-cache-key: 'cljfmt'
- name: Run cljfmt
run: clojure -T:cljfmt check
be-tests-result:
needs:
- be-linter-eastwood
- be-linter-clj-kondo
- be-cljfmt
- be-check
- be-tests
if: always() && !cancelled()
runs-on: ubuntu-latest
timeout-minutes: 5
env:
needs: ${{ toJson(needs) }}
steps:
- name: Check backend job status
uses: actions/github-script@v7
env:
needs: ${{ toJson(needs) }}
with:
script: | # js
const needs = JSON.parse(process.env.needs);
const jobs = Object.entries(needs).map(
([jobName, jobValues]) => ({
name: jobName,
result: jobValues.result
}));
// 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 backend jobs failed');
jobs.forEach((job) => {
if (job.result !== 'success') {
console.log(`${job.name} - ${job.result}`);
}
});
process.exit(1);

View File

@@ -9,10 +9,11 @@ on:
jobs:
backport-reminder:
name: Decide whether to backport or not
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: jesusvasquez333/verify-pr-label-action@v1.4.0
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
valid-labels: 'backport, no-backport'
valid-labels: 'no-backport, backport, double-backport, triple-backport'
disable-reviews: true

View File

@@ -1,177 +0,0 @@
# Cherry-picks commits from current branch to a specified one in a command "@metabase-bot backport release-x.40.x"
name: Backport
on:
issue_comment:
types: [created]
jobs:
create_pull_request:
name: Creates a pull request
if: contains(github.event.comment.body, '@metabase-bot backport')
runs-on: ubuntu-22.04
steps:
- uses: tibdex/github-app-token@v2.1.0
id: generate-token
with:
app_id: ${{ secrets.METABASE_BOT_APP_ID }}
private_key: ${{ secrets.METABASE_BOT_APP_PRIVATE_KEY }}
- uses: actions/checkout@v4
name: Cherry-pick commits and create PR
with:
fetch-depth: 0
- name: Verify Membership
id: verify-membership
uses: ./.github/actions/verify-membership
with:
github_token: ${{ steps.generate-token.outputs.token }}
organization_name: metabase
username: ${{ github.event.comment.user.login }}
- run: |
result=${{ steps.verify-membership.outputs.is_member }}
if [ $result == false ]; then
echo User ${{ github.event.comment.user.login }} is not a member of Metabase organization
exit 1
fi
- uses: actions/github-script@v7
id: branch_info
with:
script: |
await github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: 'eyes',
});
// Example: @metabase-bot backport release-x.40.x
const [_botName, _command, targetBranch] = context.payload.comment.body.split(" ");
console.log(`Target branch is ${targetBranch}`);
const { data: originalPullRequest } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.issue.number,
});
const { data: commits } = await github.rest.pulls.listCommits({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.issue.number,
});
const targetRef = await github.rest.git.getRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `heads/${targetBranch}`,
});
const backportBranch = `backport-${originalPullRequest.head.ref}-${targetBranch}`
try {
await github.rest.git.getRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `heads/${backportBranch}`,
});
} catch(e) {
if (e.status === 404) {
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/heads/${backportBranch}`,
sha: targetRef.data.object.sha,
});
}
}
return {
backportBranch,
targetBranch,
originalPullRequest,
startSha: commits[0].sha,
endSha: commits[commits.length - 1].sha
}
- id: create_backport_pull_request
name: Create backport pull request
run: |
git config --global user.email "metabase-bot@metabase.com"
git config --global user.name "Metabase bot"
git fetch --all
git checkout "${BACKPORT_BRANCH}"
git reset --hard origin/${TARGET_BRANCH}
if [[ -z $(git ls-remote --heads origin ${ORIGINAL_HEAD_REF}) ]]; then
echo "PR has been merged, searching for a squashed commit in the base branch"
echo "searching for a commit in a ${ORIGINAL_BASE_REF} that contains pull request number ${ORIGINAL_PULL_REQUEST_NUMBER}"
SQUASHED_COMMIT=$(env -i git log ${ORIGINAL_BASE_REF} --grep="(#${ORIGINAL_PULL_REQUEST_NUMBER})" --format="%H")
if [ -n "${SQUASHED_COMMIT}" ]; then
echo "found commit ${SQUASHED_COMMIT}"
git cherry-pick ${SQUASHED_COMMIT}
else
echo "probably a PR wasn't merged with Squash And Merge button, searching again"
SQUASHED_COMMIT=$(env -i git log ${ORIGINAL_BASE_REF} --grep="#${ORIGINAL_PULL_REQUEST_NUMBER}" --format="%H")
if [ -n "${SQUASHED_COMMIT}" ]; then
echo "found commit ${SQUASHED_COMMIT}"
git cherry-pick ${SQUASHED_COMMIT}
else
echo "No squashed commit found for PR #${ORIGINAL_PULL_REQUEST_NUMBER}"
exit 1
fi
fi
else
echo "PR has not been merged, copying all commits"
git cherry-pick ${ORIGINAL_BASE_SHA}..${ORIGINAL_HEAD_SHA}
fi
git push origin "${BACKPORT_BRANCH}" --force-with-lease
if [[ $(gh pr list --base "${TARGET_BRANCH}" --head "${BACKPORT_BRANCH}" -s "open") ]]; then
echo "PR already exists"
else
BACKPORT_PR_URL=$(gh pr create --base "${TARGET_BRANCH}" --head "${BACKPORT_BRANCH}" --label "was-backported" --assignee "${GITHUB_ACTOR}" --title "🤖 backported \"${ORIGINAL_TITLE}\"" --body "#${ORIGINAL_PULL_REQUEST_NUMBER}")
BACKPORT_PR_NUMBER=${BACKPORT_PR_URL##*/}
echo "backport_pr_number=$BACKPORT_PR_NUMBER" >> $GITHUB_OUTPUT
echo "New PR has been created"
fi
env:
ORIGINAL_TITLE: ${{ fromJson(steps.branch_info.outputs.result).originalPullRequest.title }}
ORIGINAL_BASE_REF: ${{ fromJson(steps.branch_info.outputs.result).originalPullRequest.base.ref }}
ORIGINAL_BASE_SHA: ${{ fromJson(steps.branch_info.outputs.result).originalPullRequest.base.sha }}
ORIGINAL_HEAD_REF: ${{ fromJson(steps.branch_info.outputs.result).originalPullRequest.head.ref }}
ORIGINAL_HEAD_SHA: ${{ fromJson(steps.branch_info.outputs.result).originalPullRequest.head.sha }}
ORIGINAL_PULL_REQUEST_NUMBER: ${{ fromJson(steps.branch_info.outputs.result).originalPullRequest.number }}
TARGET_BRANCH: ${{ fromJson(steps.branch_info.outputs.result).targetBranch }}
BACKPORT_BRANCH: ${{ fromJson(steps.branch_info.outputs.result).backportBranch }}
START_SHA: ${{ fromJson(steps.branch_info.outputs.result).startSha }}
END_SHA: ${{ fromJson(steps.branch_info.outputs.result).endSha }}
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}
- name: Auto approve backport PR
uses: juliangruber/approve-pull-request-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
number: ${{ steps.create_backport_pull_request.outputs.backport_pr_number }}
- name: Enable Pull Request Automerge
uses: peter-evans/enable-pull-request-automerge@v2
with:
token: ${{ steps.generate-token.outputs.token }}
pull-request-number: ${{ steps.create_backport_pull_request.outputs.backport_pr_number }}
merge-method: squash
notify_when_failed:
runs-on: ubuntu-22.04
name: Notify about failure
needs: create_pull_request
if: ${{ failure() }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/notify-pull-request
with:
include-log: true
message: something went wrong while creating a backport

View File

@@ -3,14 +3,13 @@ name: Bugs Slack Notification
on:
issues:
types:
- opened
- labeled
jobs:
on-issue-opened:
on-issue-labeled:
runs-on: ubuntu-22.04
timeout-minutes: 5
if: |
contains(github.event.issue.labels.*.name, '.Needs Triage') &&
contains(github.event.issue.labels.*.name, 'Type:Bug')
github.event.label.name == '.Needs Triage' && contains(github.event.issue.labels.*.name, 'Type:Bug')
steps:
- name: Setting title
uses: actions/github-script@v7
@@ -34,7 +33,7 @@ jobs:
- name: Send the issue ${{ github.event.issue.number }} to Slack
id: slack
if: steps.check_labels.outputs.has_team_label == 'false'
uses: slackapi/slack-github-action@v1.23.0
uses: slackapi/slack-github-action@v1.26.0
with:
payload: |
{

View File

@@ -100,21 +100,14 @@ jobs:
oss: getCanonicalVersion(version, 'oss'),
};
const ossReleased = await hasBeenReleased({
const released = await hasBeenReleased({
github,
owner: context.repo.owner,
repo: context.repo.repo,
version: versions.oss,
});
const eeReleased = await hasBeenReleased({
github,
owner: context.repo.owner,
repo: context.repo.repo,
version: versions.ee,
});
if (ossReleased || eeReleased) {
if (released) {
throw new Error("This version has already been released!", version);
}
@@ -243,24 +236,11 @@ jobs:
./COMMIT-ID
./SHA256.sum
trigger-tests:
needs: [build-uberjar-for-release]
permissions:
actions: write
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: trigger pre-release testing
uses: actions/github-script@v7
with:
script: | # js
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'pre-release.yml',
ref: '${{ github.ref }}',
inputs: {
commit: '${{ inputs.commit }}',
version: '${{ inputs.version }}',
}
});
run-pre-release-tests:
name: Run pre-release tests for ${{ inputs.version }}
needs: build-uberjar-for-release
uses: ./.github/workflows/pre-release.yml
secrets: inherit
with:
commit: ${{ inputs.commit }}
version: ${{ inputs.version }}

View File

@@ -16,7 +16,7 @@ jobs:
set-milestone:
name: Automatically set milestone
runs-on: ubuntu-22.04
timeout-minutes: 15
timeout-minutes: 30
env:
isNewReleaseBranch: ${{ github.event_name == 'workflow_dispatch' }}
permissions:

View File

@@ -43,6 +43,8 @@ jobs:
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Compile CLJS
run: NODE_ENV=development yarn build-pure:cljs
- name: Publish to Chromatic
uses: chromaui/action@v10.2.0
env:

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

View File

@@ -1,18 +0,0 @@
name: Lint doc Markdown links
on:
push:
paths:
- docs/**
pull_request:
paths:
- docs/**
jobs:
markdown-link-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Lint doc links
run: yarn run docs-lint-links

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,254 @@
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
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()
runs-on: ubuntu-22.04
timeout-minutes: 10
outputs:
java_version: ${{ fromJson(steps.dependencies.outputs.result).java_version }}
node_version: ${{ fromJson(steps.dependencies.outputs.result).node_version }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Get build dependencies
uses: actions/github-script@v7
id: dependencies
with:
script: | # js
const {
getBuildRequirements,
getVersionFromReleaseBranch,
} = require('${{ github.workspace }}/release/dist/index.cjs');
const targetBranchName = '${{ github.base_ref || github.ref }}';
const version = getVersionFromReleaseBranch(targetBranchName);
const requirements = getBuildRequirements(version);
return {
java_version: requirements.java,
node_version: requirements.node,
};
build:
needs: [files-changed, get-build-requirements]
if: |
!cancelled() &&
github.event.pull_request.draft == false
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 || 11 }}"
- 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
resolve-sdk-version:
if: |
!cancelled()
runs-on: ubuntu-22.04
timeout-minutes: 10
outputs:
sdk_version: ${{ fromJson(steps.dependencies.outputs.result).sdk_version }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Get latest SDK release for this branch
uses: actions/github-script@v7
id: dependencies
with:
script: | # js
const { getSdkVersionFromReleaseBranchName } = require('${{ github.workspace }}/release/dist/index.cjs');
const branchName = '${{ github.base_ref || github.ref }}';
const sdk_version = await getSdkVersionFromReleaseBranchName({
github,
owner: context.repo.owner,
repo: context.repo.repo,
branchName,
});
return {
sdk_version,
};
e2e-tests:
needs: [get-build-requirements, build, resolve-sdk-version]
if: |
!cancelled() && needs.build.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 45
name: e2e-tests-embedding-sdk
env:
MB_EDITION: ee
DISPLAY: ""
# Any env starting with `CYPRESS_` will be available to all Cypress tests via `Cypress.env()`
# Example: you can get `CYPRESS_FOO` with `Cypress.env("FOO")`
CYPRESS_ALL_FEATURES_TOKEN: ${{ secrets.ENTERPRISE_TOKEN }}
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 }}
TZ: US/Pacific # to make node match the instance tz
CYPRESS_CI: true
steps:
- uses: actions/checkout@v4
- name: Prepare Docker containers
uses: ./.github/actions/e2e-prepare-containers
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Needed to omit newly added tests for functionality that is not yet released
- name: Sparse checkout tests from SDK release commit
uses: actions/checkout@v4
with:
ref: embedding-sdk-${{ needs.resolve-sdk-version.outputs.sdk_version }}
path: sdk-release-e2e
sparse-checkout: e2e
- name: Move tests from the release commit into the repo
run: |
rm -rf ./e2e/support/*
mv ./sdk-release-e2e/e2e/support/* ./e2e/support
rm -rf ./e2e/test-component/*
mv ./sdk-release-e2e/e2e/test-component/* ./e2e/test-component
shell: bash
- 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: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare JDK ${{ needs.get-build-requirements.outputs.java_version || 11 }}
uses: actions/setup-java@v4
with:
java-version: ${{ needs.get-build-requirements.outputs.java_version || 11 }}
distribution: "temurin"
- name: Prepare Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
- 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 Metabase
run: node e2e/runner/run_cypress_ci.js start
- name: Make app db snapshot
run: node e2e/runner/run_cypress_ci.js snapshot --browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run component tests for Embedding SDK
run: node e2e/runner/run_cypress_ci.js component --browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit
output-name: e2e-embedding-sdk
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: Upload Cypress Artifacts upon failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-recording-embedding-sdk-cross-version
path: |
./cypress
./logs/test.log
if-no-files-found: ignore
- name: Publish Summary
if: failure()
uses: actions/github-script@v7
with:
script: | #js
const {
generateReport,
parseReport,
formatSummary
} = require("./.github/scripts/handle-mochawesome-report.js");
const report = await generateReport();
const results = parseReport(report);
const summary = formatSummary(results);
await core.summary.addRaw(summary).write();
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-cross-version
steps:
- run: |
echo "Didn't run due to conditional filtering"

View File

@@ -0,0 +1,216 @@
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
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,
};
build:
needs: [files-changed, get-build-requirements]
if: |
!cancelled() &&
github.event.pull_request.draft == false &&
needs.files-changed.outputs.e2e_all == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 25
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
e2e-tests:
needs: [get-build-requirements, build]
if: |
!cancelled() && needs.build.result == 'success'
runs-on: ubuntu-22.04
timeout-minutes: 45
name: e2e-tests-embedding-sdk
env:
MB_EDITION: ee
DISPLAY: ""
# Any env starting with `CYPRESS_` will be available to all Cypress tests via `Cypress.env()`
# Example: you can get `CYPRESS_FOO` with `Cypress.env("FOO")`
CYPRESS_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
steps:
- uses: actions/checkout@v4
- name: Prepare Docker containers
uses: ./.github/actions/e2e-prepare-containers
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- 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: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare JDK ${{ needs.get-build-requirements.outputs.java_version || 21 }}
uses: actions/setup-java@v4
with:
java-version: ${{ needs.get-build-requirements.outputs.java_version || 21 }}
distribution: "temurin"
- name: Prepare Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Compile CLJS
run: yarn build-pure:cljs
shell: bash
- name: Build Embedding SDK package
run: yarn build-embedding-sdk
- name: Run Metabase
run: node e2e/runner/run_cypress_ci.js start
- name: Make app db snapshot
run: node e2e/runner/run_cypress_ci.js snapshot --browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run component tests for Embedding SDK
run: node e2e/runner/run_cypress_ci.js component --browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit
output-name: e2e-embedding-sdk
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: Upload Cypress Artifacts upon failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-recording-embedding-sdk-latest
path: |
./cypress
./logs/test.log
if-no-files-found: ignore
- name: Publish Summary
if: failure()
uses: actions/github-script@v7
with:
script: | #js
const {
generateReport,
parseReport,
formatSummary
} = require("./.github/scripts/handle-mochawesome-report.js");
const report = await generateReport();
const results = parseReport(report);
const summary = formatSummary(results);
await core.summary.addRaw(summary).write();
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

@@ -9,6 +9,8 @@ on:
jobs:
files-changed:
name: Check which files changed
# don't run this workflow on a cron for forks
if: ${{ github.event_name != 'schedule' || github.repository == 'metabase/metabase' }}
runs-on: ubuntu-22.04
timeout-minutes: 3
outputs:
@@ -124,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

@@ -0,0 +1,72 @@
name: E2E Matrix Builder
on:
workflow_call:
inputs:
chunks:
required: true
type: number
default: 30
outputs:
matrix:
value: ${{ jobs.build-matrix.outputs.matrix }}
regularChunks:
value: ${{ jobs.build-matrix.outputs.regularChunks }}
jobs:
build-matrix:
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
matrix: ${{ steps.matrix.outputs.config }}
regularChunks: ${{ steps.matrix.outputs.regularChunks }}
steps:
- uses: actions/setup-node@v3
with:
node-version: '22.x'
- uses: actions/github-script@v7
id: matrix
env:
chunks: ${{ inputs.chunks }}
with:
script: | # js
const java = 21;
const defaultRunner = "ubuntu-22.04";
const defaultOptions = {
"java-version": java,
runner: defaultRunner,
edition: "ee",
};
const allSpecs = "./e2e/test/scenarios/**/*.cy.spec.*";
// see config.js function getSplittableSpecs for logic that excludes some tests from auto splitting
const specialTests = [
{ name: "embedding-sdk", specs: "./e2e/test/scenarios/embedding-sdk/**.cy.spec.*" },
{ name: "oss-subset", edition: 'oss', tags: "@OSS @smoke+-@EE", specs: allSpecs },
{ name: "mongo", tags: "@mongo", specs: allSpecs },
];
const inputChunks = Number(process.env.chunks);
const regularChunks = inputChunks - specialTests.length;
const regularTests = new Array(regularChunks).fill(1)
.map((files, index) => ({
name: `e2e-group-${index + 1}`,
}));
// regular chunks need to come before special chunks
const testSets = [...regularTests, ...specialTests];
const config = testSets.map((options) => ({
...defaultOptions,
...options,
}));
core.setOutput("regularChunks", JSON.stringify(regularChunks));
core.setOutput("config", JSON.stringify({ include: config }));
console.log({ regularChunks });
console.log("matrix config", config);

View File

@@ -87,22 +87,26 @@ jobs:
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare JDK 11
- name: Prepare JDK 21
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 21
distribution: "temurin"
- name: Prepare Cypress environment
id: cypress-prep
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 \

172
.github/workflows/e2e-test.yml vendored Normal file
View File

@@ -0,0 +1,172 @@
name: E2E Test
run-name: E2E Test - ${{ inputs.name }}
on:
workflow_call:
inputs:
name:
required: true
type: string
edition: # oss | ee
required: false
type: string
default: ee
specs:
required: false
default: ./e2e/test/scenarios/**/*.cy.spec.*
type: string
tags:
required: false
type: string
runner:
required: false
type: string
default: ubuntu-22.04
total_chunks: # number of chunks
required: false
type: number
split_index: # index of the chunk
required: false
type: number
jobs:
e2e-tests:
runs-on: ${{ inputs.runner }}
timeout-minutes: 45
name: e2e-tests-${{ inputs.name }}-${{ inputs.edition }}
env:
MB_EDITION: ${{ inputs.edition }}
DISPLAY: ""
QA_DB_ENABLED: true
PR_NUMBER: ${{ github.event.pull_request.number || '' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HASH: ${{ github.event.pull_request.head.sha || github.sha }}-${{ github.run_attempt }}
JOB_NAME: ${{ inputs.name }}
# 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 || '' }}
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
TZ: US/Pacific # to make node match the instance tz
CYPRESS_CI: true
CYPRESS_QA_DB_MONGO: ${{ inputs.name == 'mongo' }}
CYPRESS_IS_EMBEDDING_SDK: ${{ inputs.name == 'embedding-sdk' }}
mongo: ${{ inputs.name == 'mongo' }}
postgres: ${{ inputs.name != 'mongo' }}
mysql: ${{ inputs.name != 'mongo' }}
openldap: true
maildev: true
webhook: true
steps:
- uses: actions/checkout@v4
- name: Prepare Docker containers
uses: ./.github/actions/e2e-prepare-containers
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
maildev: true
openldap: ${{ env.openldap }}
postgres: ${{ env.postgres }}
mysql: ${{ env.mysql }}
mongo: ${{ env.mongo }}
webhook: ${{ env.webhook }}
- name: Run Embedding SDK Storybook
if: inputs.name == 'embedding-sdk'
uses: ./.github/actions/run-embedding-sdk-storybook
- name: Retrieve uberjar artifact for ${{ inputs.edition }}
uses: actions/download-artifact@v4
with:
name: metabase-${{ inputs.edition }}-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: "temurin"
- name: Prepare Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
- name: Run 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
- name: Run auto-split Cypress tests on ${{ inputs.name }}
if: ${{ !inputs.specs }}
env:
SPLIT: ${{ inputs.total_chunks }}
SPLIT_INDEX: ${{ inputs.split_index }}
SPLIT_FILE: "./e2e/support/timings.json"
SPLIT_OUTPUT_FILE: "newTimes.json"
SPLIT_TIME_THRESHOLD: 5.0
# do not write cypress-split summary to github
SPLIT_SUMMARY: false
shell: bash
run: |
node e2e/runner/run_cypress_ci.js e2e \
--env grepTags="-@mongo+-@flaky+-@OSS --@quarantine",grepOmitFiltered=true \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run Tagged EE Cypress tests on ${{ inputs.name }}
if: ${{ inputs.specs }}
shell: bash
run: |
node e2e/runner/run_cypress_ci.js e2e \
--env grepTags="${{inputs.tags}} --@quarantine",grepOmitFiltered=true \
--spec '${{ inputs.specs }}' \
--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-${{ inputs.name }}
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: Upload Cypress Artifacts upon failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-recording-${{ inputs.name }}-${{ inputs.edition }}
path: |
./cypress
./logs/test.log
if-no-files-found: ignore
- name: Publish Summary
if: failure()
uses: actions/github-script@v7
with:
script: | #js
const {
generateReport,
parseReport,
formatSummary
} = require("./.github/scripts/handle-mochawesome-report.js");
const report = await generateReport();
const results = parseReport(report);
const summary = formatSummary(results);
await core.summary.addRaw(summary).write();

View File

@@ -1,43 +1,21 @@
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:
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
matrix: ${{ steps.e2e-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- name: Generate matrix for E2E tests
id: e2e-matrix
uses: ./.github/actions/build-e2e-matrix
uses: ./.github/workflows/e2e-matrix-builder.yml
with:
chunks: 50
# if this is a test on a release branch, we need to check the build requirements
get-build-requirements:
@@ -71,12 +49,8 @@ jobs:
};
build:
needs: [files-changed, e2e-matrix-builder, get-build-requirements]
if: |
!cancelled() &&
github.event.pull_request.draft == false &&
needs.e2e-matrix-builder.result == 'success' &&
needs.files-changed.outputs.e2e_all == 'true'
needs: [get-build-requirements]
if: ${{ !cancelled() && !inputs.skip }}
runs-on: ubuntu-22.04
timeout-minutes: 25
strategy:
@@ -97,7 +71,7 @@ jobs:
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
@@ -107,180 +81,97 @@ jobs:
with:
name: metabase-${{ matrix.edition }}-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
e2e-tests:
needs: [build, e2e-matrix-builder]
if: |
!cancelled() && needs.build.result == 'success'
runs-on: ${{ matrix.runner }}
timeout-minutes: 45
name: e2e-tests-${{ matrix.name }}-${{ matrix.edition }}
env:
MB_EDITION: ${{ matrix.edition }}
DISPLAY: ""
QA_DB_ENABLED: true
# 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 || '' }}
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message || github.even.head.sha }}
MB_SNOWPLOW_AVAILABLE: true
MB_SNOWPLOW_URL: "http://localhost:9090" # Snowplow micro
TZ: US/Pacific # to make node match the instance tz
CYPRESS_CI: true
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.e2e-matrix-builder.outputs.matrix) }}
reset-e2e-test-comment:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Prepare Docker containers
uses: ./.github/actions/e2e-prepare-containers
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
maildev: true
openldap: ${{ startsWith(matrix.name, 'admin') }}
postgres: ${{ matrix.name != 'mongo'}}
mysql: ${{ matrix.name != 'mongo'}}
mongo: ${{ matrix.name == 'mongo'}}
webhook: true
- name: Retrieve uberjar artifact for ${{ matrix.edition }}
uses: actions/download-artifact@v4
with:
name: metabase-${{ matrix.edition }}-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
- name: Get the version info
run: |
jar xf target/uberjar/metabase.jar version.properties
mv version.properties resources/
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: "temurin"
- name: Prepare Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
- name: Run Snowplow micro
uses: ./.github/actions/run-snowplow-micro
- name: Run OSS-specific Cypress tests
if: matrix.edition == 'oss' && github.event_name != 'schedule'
run: |
yarn run test-cypress-run \
--env grepTags=@OSS,grepOmitFiltered=true \
--spec './e2e/test/scenarios/**/*.cy.spec.(js|ts)' \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run slow and resource-intensive Cypress tests
if: matrix.name == 'slow' && github.event_name != 'schedule'
run: |
yarn run test-cypress-run \
--env grepTags="@slow",grepOmitFiltered=true \
--spec './e2e/test/scenarios/**/*.cy.spec.(js|ts)' \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run Flaky Cypress tests
if: matrix.name == 'flaky' && github.event_name != 'schedule'
run: |
yarn run test-cypress-run \
--env grepTags="@flaky --@quarantine",grepOmitFiltered=true \
--spec './e2e/test/scenarios/**/*.cy.spec.(js|ts)' \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run EE Cypress tests on ${{ matrix.name }}
if: matrix.context == 'folder' && github.event_name != 'schedule'
run: |
yarn run test-cypress-run \
--env grepTags="-@slow+-@mongo+-@flaky --@quarantine",grepOmitFiltered=true \
--folder ${{ matrix.name }} \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run E2E tests that depend on Mongo
if: matrix.name == 'mongo'
run: |
yarn run test-cypress-run \
--env grepTags="@mongo --@quarantine",grepOmitFiltered=true \
--spec './e2e/test/scenarios/**/*.cy.spec.(js|ts)' \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
env:
CYPRESS_QA_DB_MONGO: true
- name: Run Embedding SDK Storybook
if: matrix.context == 'embedding-sdk' && github.event_name != 'schedule'
uses: ./.github/actions/run-embedding-sdk-storybook
- name: Run E2E tests for Embedding SDK
if: matrix.context == 'embedding-sdk' && github.event_name != 'schedule'
run: |
yarn run test-cypress-run \
--env grepTags="-@slow+-@flaky --@quarantine",grepOmitFiltered=true \
--folder 'embedding-sdk' \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
env:
CYPRESS_IS_EMBEDDING_SDK: true
shell: bash
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
with:
input-path: ./target/junit
output-name: e2e-${{ matrix.name }}
bucket: ${{ vars.AWS_S3_TEST_RESULTS_BUCKET }}
aws-access-key-id: ${{ secrets.AWS_TEST_RESULTS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TEST_RESULTS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
trunk-api-token: ${{ secrets.TRUNK_API_TOKEN }}
- name: Upload Cypress Artifacts upon failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-recording-${{ matrix.name }}-${{ matrix.edition }}
path: |
./cypress
./logs/test.log
if-no-files-found: ignore
- name: Publish Summary
if: failure()
- name: Remove test results comment
uses: actions/github-script@v7
with:
script: | #js
const {
parseReport,
formatSummary
} = require("./.github/scripts/handle-mochawesome-report.js");
script: | # js
const { owner, repo } = context.repo;
const report = parseReport();
const summary = formatSummary(report);
const { data: comments } = await github.rest.issues.listComments({
owner,
repo,
issue_number: context.issue.number,
}).catch(console.error);
await core.summary.addRaw(summary).write();
if (!comments) {
return;
}
e2e-tests-skipped-stub:
needs: [e2e-tests, e2e-matrix-builder]
const comment = comments.find((comment) => comment.body.includes('## e2e tests failed on '));
if (comment) {
await github.rest.issues.deleteComment({
owner,
repo,
comment_id: comment.id,
});
}
e2e-tests:
name: ${{ matrix.name }}-${{ matrix.edition }}
uses: ./.github/workflows/e2e-test.yml
needs:
- e2e-matrix-builder
- build
if: |
!cancelled() &&
needs.e2e-tests.result == 'skipped'
runs-on: ${{ matrix.runner }}
timeout-minutes: 5
name: e2e-tests-${{ matrix.name }}-${{ matrix.edition }}
!cancelled() && needs.build.result == 'success'
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.e2e-matrix-builder.outputs.matrix) }}
matrix: ${{ fromJson(needs.e2e-matrix-builder.outputs.matrix) }}
secrets: inherit
with:
name: ${{ matrix.name }}
edition: ${{ matrix.edition }}
specs: ${{ matrix.specs }}
total_chunks: ${{ fromJson(needs.e2e-matrix-builder.outputs.regularChunks) }}
split_index: ${{ strategy.job-index }}
tags: ${{ matrix.tags }}
runner: ${{ matrix.runner }}
# run this separately to make it non-blocking
flaky-e2e-tests:
name: Flaky e2e Tests
uses: ./.github/workflows/e2e-test.yml
needs: build
if: |
!cancelled() && needs.build.result == 'success'
secrets: inherit
with:
name: Flaky
tags: "@flaky"
specs: "./e2e/test/scenarios/**/*.cy.spec.*"
e2e-tests-result:
needs:
- e2e-tests
- flaky-e2e-tests
runs-on: ubuntu-latest
timeout-minutes: 5
name: e2e-tests-result
if: always() && !cancelled()
env:
E2E_TESTS_RESULT: ${{ needs.e2e-tests.result }}
FLAKY_E2E_TESTS_RESULT: ${{ needs.flaky-e2e-tests.result }}
steps:
- run: |
- name: Stub
if: ${{ needs.e2e-tests.result == 'skipped' }}
run: |
echo "Didn't run due to conditional filtering"
- name: Test results
if: ${{ needs.e2e-tests.result != 'skipped' }}
run: | # sh
echo "E2E Tests: ${{ needs.e2e-tests.result }}"
echo "Flaky E2E Tests: ${{ needs.flaky-e2e-tests.result }}"
if [ "${{ needs.e2e-tests.result }}" != "success" ]; then
echo "E2E Tests failed"
exit 1
fi
pr-env:
needs: [build]

View File

@@ -1,34 +0,0 @@
name: Flake Issue Creator
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * 1-5' # every weekday at 1am US eastern time
jobs:
flake-issue-creator:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn --frozen-lockfile && yarn build
- name: Update flake issues
uses: actions/github-script@v7
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
script: | # js
const { updateFlakeIssues } = require('${{ github.workspace }}/release/dist/index.cjs');
if (!process.env.SLACK_BOT_TOKEN) {
throw new Error('SLACK_BOT_TOKEN is required');
}
await updateFlakeIssues({
github,
owner: context.repo.owner,
repo: context.repo.repo,
});

View File

@@ -1,35 +0,0 @@
name: Flake Status Report
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * 2,5' # Tuesdays and Fridays at 1am US eastern time
jobs:
flake-status-report:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn --frozen-lockfile && yarn build
- name: Post Flake Status Report
uses: actions/github-script@v7
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
script: | # js
const { summarizeFlakes } = require('${{ github.workspace }}/release/dist/index.cjs');
if (!process.env.SLACK_BOT_TOKEN) {
throw new Error('SLACK_BOT_TOKEN is required');
}
await summarizeFlakes({
github,
owner: context.repo.owner,
repo: context.repo.repo,
channelName: 'engineering-ci'
});

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:
@@ -123,3 +104,43 @@ jobs:
m2-cache-key: "cljs"
- name: Run frontend timezones tests
run: yarn run test-timezones
fe-tests-result:
needs:
- fe-lint
- fe-type-check
- fe-tests-unit
- fe-tests-timezones
if: always() && !cancelled()
runs-on: ubuntu-latest
timeout-minutes: 5
env:
needs: ${{ toJson(needs) }}
steps:
- name: Check frontend job status
uses: actions/github-script@v7
env:
needs: ${{ toJson(needs) }}
with:
script: | # js
const needs = JSON.parse(process.env.needs);
const jobs = Object.entries(needs).map(
([jobName, jobValues]) => ({
name: jobName,
result: jobValues.result
}));
// 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 frontend jobs failed');
jobs.forEach((job) => {
if (job.result !== 'success') {
console.log(`${job.name} - ${job.result}`);
}
});
process.exit(1);

View File

@@ -0,0 +1,53 @@
name: Generative Query Test
on:
workflow_dispatch:
inputs:
seed:
description: 'Seed value (empty = random; logged)'
type: number
iterations:
description: 'Number of test iterations (overrides `seconds`)'
type: number
seconds:
description: 'No further iteration after _this_ number of seconds since test started'
ref:
description: 'Ref to run generative tests on'
default: qgen-milestone-1
jobs:
generative-query-test:
runs-on: ubuntu-22.04
timeout-minutes: 90
name: Generative Query Test
env:
CI: 'true'
MB_GENTEST_SEED: ${{ inputs.seed }}
MB_GENTEST_LIMIT_ITERATIONS: ${{ inputs.iterations }}
MB_GENTEST_LIMIT_SECONDS: ${{ inputs.seconds }}
# TODO: Remove in favor of cp root with further tests
MB_GENTEST_RUN: true
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: generative-query-test
- name: Run test
run: clojure -X:dev:ci:test:ee:ee-dev :only 'metabase.query-processor-test.generative-test'
- name: Publish Test Report (JUnit)
uses: dorny/test-reporter@v1
if: failure()
with:
path: "target/junit/**/*_test.xml"
name: JUnit Test Report (Generative Query test)
reporter: java-junit
list-suites: failed
list-tests: failed
fail-on-error: false

32
.github/workflows/links.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Links
on:
repository_dispatch:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0"
jobs:
linkChecker:
runs-on: ubuntu-latest
permissions:
issues: write # required for peter-evans/create-issue-from-file
steps:
- uses: actions/checkout@v4
- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2
with:
fail: false
args: docs --config ./.lychee/config.toml --verbose --no-progress
format: markdown
- name: Create Issue From File
if: steps.lychee.outputs.exit_code != 0
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
content-filepath: ./.lychee/out.md
labels: "Type:Documentation"
assignees: jeff-bruemmer

View File

@@ -61,9 +61,9 @@ jobs:
with:
github-token: ${{secrets.METABASE_AUTOMATION_USER_TOKEN}}
script: |
github.issues.removeLabel({
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'loki-update'
})
});

View File

@@ -49,29 +49,16 @@ jobs:
m2-cache-key: "cljs"
- name: Compile CLJS
run: yarn build-pure:cljs
run: NODE_ENV=development yarn build-pure:cljs
- name: Build Storybook
# We won't be able to use Storybook play's `userEvent` with production build
# see https://github.com/storybookjs/storybook/issues/19758
run: NODE_ENV=development yarn build-storybook
- name: Serve Storybook
run: yarn http-server storybook-static -p 6006 &
shell: bash
- name: Wait for Storybook to become available
run: |
echo "Waiting for Storybook to be served..."
while ! curl --silent --fail http://localhost:6006; do
sleep 5
echo "Retrying..."
done
echo "Storybook is being served!"
- name: Run Loki Visual Tests
run: |
yarn test-visual:loki
yarn loki --requireReference --reactUri file:./storybook-static --chromeFlags='--headless --disable-gpu' --verboseRenderer
- name: Generate Visual Report on Failure
if: failure()

38
.github/workflows/main.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Slack Notification for New Feature Requests
on:
issues:
types:
- labeled
jobs:
on-issue-labeled:
runs-on: ubuntu-22.04
timeout-minutes: 5
if: |
contains(github.event.issue.labels.*.name, 'Type:New Feature')
steps:
- name: Setting title
uses: actions/github-script@v7
id: vars
with:
script: |
core.setOutput('issue_title', ${{ toJson(github.event.issue.title) }}.replaceAll(/"/g, '\\"'));
- name: Send the issue ${{ github.event.issue.number }} to Slack
id: slack
uses: slackapi/slack-github-action@v1.26.0
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "New incoming feature request: ${{ steps.vars.outputs.issue_title }}\n${{ github.event.issue.html_url }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_FEATURE_REQUEST_TRIAGE_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

View File

@@ -10,11 +10,18 @@ on:
required: true
commit:
description: "A full-length commit SHA-1 hash"
type: string
required: true
workflow_call:
inputs:
version:
description: "Metabase version (e.g. v0.46.3)"
type: string
required: true
commit:
description: "A full-length commit SHA-1 hash"
type: string
required: true
auto:
description: 'auto-patch release DO NOT SET MANUALLY'
type: boolean
default: false
jobs:
release-artifact:
@@ -79,7 +86,7 @@ jobs:
- name: Upload Metabase ${{ matrix.edition }} JAR as artifact
uses: actions/upload-artifact@v4
with:
name: metabase-${{ matrix.edition }}-uberjar
name: metabase-test-${{ matrix.edition }}-uberjar
path: |
./metabase.jar
./COMMIT-ID
@@ -93,7 +100,7 @@ jobs:
strategy:
matrix:
edition: [oss, ee]
java-version: [11, 17]
java-version: [21]
steps:
- name: Prepare JRE (Java Run-time Environment)
uses: actions/setup-java@v4
@@ -105,9 +112,10 @@ jobs:
- uses: actions/download-artifact@v4
name: Retrieve uberjar artifact
with:
name: metabase-${{ matrix.edition }}-uberjar
name: metabase-test-${{ matrix.edition }}-uberjar
- name: Launch uberjar (and keep it running)
run: java -jar ./metabase.jar &
run: >-
java --add-opens java.base/java.nio=ALL-UNNAMED -jar ./metabase.jar &
- name: Wait for Metabase to start
run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
@@ -142,10 +150,10 @@ jobs:
maildev: true
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare JDK 11
- name: Prepare JDK 21
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 21
distribution: "temurin"
- name: Prepare Cypress environment
id: cypress-prep
@@ -155,16 +163,34 @@ jobs:
- uses: actions/download-artifact@v4
name: Retrieve uberjar artifact for ${{ matrix.edition }}
with:
name: metabase-${{ matrix.edition }}-uberjar
name: metabase-test-${{ matrix.edition }}-uberjar
- name: Get the version info
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 }}
@@ -207,16 +233,16 @@ jobs:
- uses: actions/download-artifact@v4
name: Retrieve uberjar artifact
with:
name: metabase-${{ matrix.edition }}-uberjar
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@v2
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Build ${{ matrix.edition }} container
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
context: bin/docker/.
platforms: linux/amd64
@@ -233,7 +259,7 @@ jobs:
timeout-minutes: 3
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_RELEASE_USERNAME }}
password: ${{ secrets.DOCKERHUB_RELEASE_TOKEN }}
@@ -270,7 +296,7 @@ jobs:
IMAGE_TAG: ${{ needs.containerize.outputs.image_tag }}
steps:
- name: Login to Docker Hub # authenticated, to avoid being rate-throttled
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_RELEASE_USERNAME }}
password: ${{ secrets.DOCKERHUB_RELEASE_TOKEN }}
@@ -289,30 +315,6 @@ jobs:
run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
timeout-minutes: 3
trigger-auto-publish:
if: ${{ inputs.auto }}
needs: [run-sanity-check, check-uberjar-health, verify-docker-pull]
permissions:
actions: write
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: trigger auto publish
uses: actions/github-script@v7
with:
script: | # js
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'release.yml',
ref: '${{ github.ref }}',
inputs: {
commit: '${{ inputs.commit }}',
version: '${{ inputs.version }}',
auto: true,
}
});
tests-complete-message:
if: always()
runs-on: ubuntu-22.04

View File

@@ -1,35 +1,98 @@
name: Release Metabase Embedding SDK for React
run-name: Release SDK from ${{ inputs.branch }}
on:
workflow_dispatch:
inputs:
# TODO: Add a version validation, so the workflow won't fail when publishing to npm
sdk_version:
description: "SDK version (e.g. 0.1.3)"
type: string
required: true
git_ref:
description: "A git commit hash that will be used to build the SDK"
type: string
branch:
description: "Branch we want to release the SDK from"
type: choice
required: true
default: "master"
options:
- master
- release-x.51.x
- release-x.52.x
- release-x.53.x
concurrency:
# We want to ensure only one job is running at a time because
# We want to ensure only one job is running at a time per branch because
# there could be a conflict when updating the readme file.
group: ${{ github.workflow }}
group: ${{ github.workflow }}-${{ inputs.branch }}
cancel-in-progress: true
jobs:
workflow-summary:
name: Log inputs
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Generate workflow summary
run: |
tee -a $GITHUB_STEP_SUMMARY << EOF
**Inputs:**
- \`branch\`: ${{ inputs.branch }}
triggered by: @${{ github.event.sender.login }}
EOF
determine-version:
name: Determine SDK version
runs-on: ubuntu-22.04
timeout-minutes: 20
outputs:
sdk_version: ${{ steps.new-sdk-version.outputs.result }}
steps:
- name: Check out the code using the provided branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Get current SDK version
id: current-sdk-version
run: |
VERSION=$(jq -r .version ./enterprise/frontend/src/embedding-sdk/package.template.json)
echo "sdk_current_version=$VERSION" >> $GITHUB_OUTPUT
- name: Get next SDK patch version
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(".");
if (!suffix) {
return newVersion;
}
return `${newVersion}-${suffix}`
- name: Append workflow summary
run: |
tee -a $GITHUB_STEP_SUMMARY << EOF
**Derived inputs:**
- \`current_version\`: "${{ steps.current-sdk-version.outputs.sdk_current_version }}"
- \`next_version\`: "${{ steps.new-sdk-version.outputs.result }}"
EOF
check-git-tag:
needs: determine-version
runs-on: ubuntu-22.04
timeout-minutes: 20
env:
tag: embedding-sdk-${{ inputs.sdk_version }}
tag: embedding-sdk-${{ needs.determine-version.outputs.sdk_version }}
steps:
- name: Check out the code using the provided ref
- name: Check out the code using the provided branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.git_ref }}
ref: ${{ inputs.branch }}
fetch-depth: 0
fetch-tags: true
@@ -48,10 +111,10 @@ jobs:
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- name: Check out the code using the provided ref
- name: Check out the code using the provided branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.git_ref }}
ref: ${{ inputs.branch }}
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
@@ -65,14 +128,14 @@ jobs:
run: yarn embedding-sdk:test-unit
build-sdk:
needs: test
needs: [test, determine-version]
runs-on: ubuntu-22.04
timeout-minutes: 20
steps:
- name: Check out the code using the provided ref
- name: Check out the code using the provided branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.git_ref }}
ref: ${{ inputs.branch }}
fetch-depth: 0
fetch-tags: true
@@ -84,14 +147,10 @@ jobs:
with:
m2-cache-key: "release-sdk"
- name: Update readme
run: |
./bin/embedding-sdk/release_utils.bash update_readme ${{ inputs.sdk_version }}
- 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 ${{ inputs.sdk_version }}
./bin/embedding-sdk/release_utils.bash update_package_json_template ${{ needs.determine-version.outputs.sdk_version }}
- name: Update changelog
run: |
@@ -116,15 +175,17 @@ jobs:
path: ./changelog-diff
publish-npm:
needs: build-sdk
needs: [build-sdk, determine-version]
runs-on: ubuntu-22.04
timeout-minutes: 20
env:
sdk_version: ${{ needs.determine-version.outputs.sdk_version }}
steps:
- name: Check out master to prepare for a SDK version bump PR
- name: Check out branch to prepare for a SDK version bump PR
uses: actions/checkout@v4
with:
# when we created version update PR, it would only have diff from 2 files SDK readme and SDK package.json template
ref: master
ref: ${{ inputs.branch}}
- name: Setup git user
run: |
@@ -133,11 +194,11 @@ jobs:
- name: Update readme
run: |
bash ./bin/embedding-sdk/release_utils.bash update_readme ${{ inputs.sdk_version }}
bash ./bin/embedding-sdk/release_utils.bash update_readme ${{ env.sdk_version }}
- name: Bump published npm package version
run: |
bash ./bin/embedding-sdk/release_utils.bash update_package_json_template ${{ inputs.sdk_version }}
bash ./bin/embedding-sdk/release_utils.bash update_package_json_template ${{ env.sdk_version }}
- name: Retrieve SDK changelog diff
uses: actions/download-artifact@v4
@@ -151,13 +212,17 @@ jobs:
- name: Create a PR updating readme + published version, and changelog (using GitHub Metabase Automation account)
run: |
git checkout -b update-sdk-version-${{ inputs.sdk_version }}
git commit -a -m 'Update Readme version references and published npm version to ${{ inputs.sdk_version }}'
# 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
gh pr create --base master\
gh pr create --base ${{ inputs.branch }}\
--assignee "${GITHUB_ACTOR}"\
--title "Update SDK version to ${{ inputs.sdk_version }}"\
--body "Update Readme version references and published npm package version to ${{ inputs.sdk_version }}"
--title "docs(sdk): Update SDK version to ${{ env.sdk_version }}"\
--body "Update Readme version references and published npm package version to ${{ env.sdk_version }}"
env:
GH_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
@@ -169,7 +234,7 @@ jobs:
- name: Edit PR adding useful information (using Metabase bot app)
run: |
gh pr edit --add-reviewer @metabase/embedding --add-label no-backport
gh pr edit --add-reviewer @metabase/embedding,albertoperdomo --add-label no-backport
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
@@ -192,22 +257,29 @@ jobs:
path: sdk
- name: Publish to NPM
working-directory: sdk
run: |
cd sdk
echo //registry.npmjs.org/:_authToken=${{ secrets.NPM_RELEASE_TOKEN }} > .npmrc
npm publish
# Please keep the value in sync with `inputs.branch`'s release branch
npm publish --tag ${{fromJson('{"master": "nightly", "release-x.51.x": "51-stable", "release-x.52.x": "52-stable", "release-x.53.x": "53-stable"}')[inputs.branch]}}
- name: Add `latest` tag to the latest release branch (`release-x.53.x`) deployment
if: ${{ inputs.branch == 'release-x.53.x' }}
working-directory: sdk
run: |
npm dist-tag add @metabase/embedding-sdk-react@${{ env.sdk_version }} latest
git-tag:
needs: publish-npm
needs: [publish-npm, determine-version]
runs-on: ubuntu-22.04
timeout-minutes: 20
env:
tag: embedding-sdk-${{ inputs.sdk_version }}
tag: embedding-sdk-${{ needs.determine-version.outputs.sdk_version }}
steps:
- name: Check out the code using the provided ref
- name: Check out the code using the provided branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.git_ref }}
ref: ${{ inputs.branch }}
# Lightweight tags don't need committer name and email
- name: Create a new git tag

View File

@@ -1,15 +1,21 @@
name: Update Release Log
run-name: Update Release Log ${{ inputs.version }}
run-name: Update Release Log ${{ inputs.version || github.ref_name }}
on:
push:
branches:
- release-x.*
tags:
- v*
- nightly-*
- latest-*
- beta-*
workflow_dispatch:
inputs:
version:
description: 'Major Metabase version (e.g. 45, 52, 68)'
type: number
required: true
schedule:
- cron: '45 * * * *' # hourly
workflow_call:
inputs:
version:
@@ -21,9 +27,8 @@ jobs:
update-release-log:
runs-on: ubuntu-latest
timeout-minutes: 5
env:
VERSION: ${{ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call')
&& inputs.version || vars.CURRENT_VERSION }}
# don't run this workflow for forks
if: ${{ github.event_name != 'push' || github.repository == 'metabase/metabase' }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
@@ -33,9 +38,37 @@ jobs:
aws-region: ${{ vars.AWS_REGION }}
- uses: actions/checkout@v4
with:
ref: master # this only works on master
fetch-depth: 0 # we want all branches and tags
- name: Install Dependencies
run: yarn --cwd release --frozen-lockfile && npm i -g tsx
- name: Build release scripts
run: yarn --cwd release build
- name: Get version number
uses: actions/github-script@v7
with:
script: | # js
const {
getVersionFromReleaseBranch,
getMajorVersion,
} = require('${{ github.workspace }}/release/dist/index.cjs');
console.log({ context });
// if the version is explicitly set, use that
if (context.payload?.inputs?.version) {
core.exportVariable('VERSION', context.payload.inputs.version);
return;
}
// otherwise, get the version from the release branch name
const branch = context.payload.ref;
const version = getVersionFromReleaseBranch(branch);
const majorVersion = getMajorVersion(version);
console.log({ branch, version, majorVersion });
core.exportVariable('VERSION', majorVersion);
- name: generate release Log
run: cd release && tsx ./src/release-log-run.ts $VERSION > v$VERSION.html
- name: generate release channel log

View File

@@ -9,10 +9,12 @@ on:
type: number
required: true
schedule:
- cron: '15 0 * * 2-6' # every weekday at 7/8:15 pm Eastern Time
- cron: '0 21 * * 1-5' # every weekday at 4 pm EST/5 pm EDT
jobs:
auto-patch-trigger:
# don't run this workflow on a cron for forks
if: ${{ github.event_name != 'schedule' || github.repository == 'metabase/metabase' }}
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:

View File

@@ -7,6 +7,8 @@ on:
jobs:
check-release-status:
# don't run this workflow on a cron for forks
if: ${{ github.event_name != 'schedule' || github.repository == 'metabase/metabase' }}
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:

View File

@@ -39,6 +39,7 @@ on:
# - nightly
# - beta
# - latest
# - none (skips everything)
required: true
tag_rollout:
description: Rollout % (0-100)
@@ -52,9 +53,20 @@ on:
description: Apply to OSS
type: boolean
default: true
dot-x-tag:
type: boolean
default: false
jobs:
green-check-stub:
runs-on: ubuntu-22.04
timeout-minutes: 2
steps:
- name: Stub
run: echo "Stub to make this job successful even if all the rest of the steps are skipped"
check-version:
# skips everything if the tag_name is 'none' because all later jobs depend on this job
if: ${{ inputs.tag_name != 'none' }}
runs-on: ubuntu-22.04
timeout-minutes: 5
outputs:
@@ -92,21 +104,14 @@ jobs:
oss: getCanonicalVersion(version, 'oss'),
};
const ossReleased = await hasBeenReleased({
const released = await hasBeenReleased({
github,
owner: context.repo.owner,
repo: context.repo.repo,
version: versions.oss,
});
const eeReleased = await hasBeenReleased({
github,
owner: context.repo.owner,
repo: context.repo.repo,
version: versions.ee,
});
if (!ossReleased || !eeReleased) {
if (!released) {
throw new Error("This version has not been released yet!", version);
}
@@ -185,7 +190,7 @@ jobs:
return upload_path;
- name: Upload to s3 latest path
- name: Upload to s3 ${{ inputs.tag_name }} path
run: | # sh
aws s3 cp \
s3://${{ vars.AWS_S3_DOWNLOADS_BUCKET }}/${{ steps.source_path.outputs.result }}/metabase.jar \
@@ -270,26 +275,26 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history
- name: Add and push git tag
fetch-depth: 0 # we want all branches and tags
fetch-tags: true
- name: Add and push git tag for nightly/beta/latest
if: ${{ !inputs.dot-x-tag }}
run: | # sh
if [[ "${{ matrix.edition }}" == "ee" ]]; then
git tag -f ${{ inputs.tag_name }}-ee ${{ needs.check-version.outputs.ee }}
git tag -f ${{ inputs.tag_name }}-ee ${{ needs.check-version.outputs.oss }}
git push origin -f ${{ inputs.tag_name }}-ee
elif [[ "${{ matrix.edition }}" == "oss" ]]; then
git tag -f ${{ inputs.tag_name }}-oss ${{ needs.check-version.outputs.oss }}
git push origin -f ${{ inputs.tag_name }}-oss
fi
update-release-log:
needs: check-version
uses: ./.github/workflows/release-log.yml
with:
version: ${{ fromJSON(vars.CURRENT_VERSION) }} # cast string to number
secrets: inherit
- name: Add and push git tag for dot X tags
if: ${{ inputs.dot-x-tag && matrix.edition == 'oss' }} # we only need one git tag for dot X
run: | # sh
git tag -f ${{ inputs.tag_name }} ${{ needs.check-version.outputs.oss }}
git push origin tag -f ${{ inputs.tag_name }}
update-version-info:
if: ${{ !inputs.dot-x-tag }}
runs-on: ubuntu-22.04
needs: check-version
timeout-minutes: 5
@@ -333,7 +338,6 @@ jobs:
});
fs.writeFileSync('version-info.json', JSON.stringify(newVersionInfo));
- name: Upload new version-info.json to S3
run: |
if [[ "${{ matrix.edition }}" == "ee" ]]; then

View File

@@ -11,26 +11,40 @@ on:
commit:
description: 'A full-length commit SHA-1 hash'
required: true
skip-docker:
description: 'Skip Docker image publishing'
type: boolean
default: false
skip-s3:
description: 'Skip S3 artifact publishing'
type: boolean
default: false
skip-version-info:
description: 'Skip publishing version-info.json'
type: boolean
default: false
skip-tag:
description: 'Skip tagging the release'
type: boolean
default: false
skip-release-notes:
description: 'Skip publishing release notes'
release-channel:
description: 'The release channel to publish to (optional)'
type: choice
options:
- none
- latest
- beta
- nightly
required: true
default: 'none'
auto:
description: 'auto-patch release DO NOT SET MANUALLY'
type: boolean
default: false
workflow_call:
inputs:
version:
description: 'Metabase version (e.g. v0.46.3)'
type: string
required: true
commit:
description: 'A full-length commit SHA-1 hash'
type: string
required: true
release-channel:
description: 'The release channel to publish to (optional)'
type: string
# options:
# - none
# - latest
# - beta
# - nightly
required: true
default: 'none'
auto:
description: 'auto-patch release DO NOT SET MANUALLY'
type: boolean
@@ -74,21 +88,14 @@ jobs:
oss: getCanonicalVersion(version, 'oss'),
};
const ossReleased = await hasBeenReleased({
const released = await hasBeenReleased({
github,
owner: context.repo.owner,
repo: context.repo.repo,
version: versions.oss,
});
const eeReleased = await hasBeenReleased({
github,
owner: context.repo.owner,
repo: context.repo.repo,
version: versions.ee,
});
if (ossReleased || eeReleased) {
if (released) {
throw new Error("This version has already been released!", version);
}
@@ -185,6 +192,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: metabase-${{ matrix.edition }}-uberjar
overwrite: true
path: |
./metabase.jar
./COMMIT-ID
@@ -192,7 +200,6 @@ jobs:
./version.properties
upload-to-s3:
if: ${{ inputs.skip-s3 != true }}
runs-on: ubuntu-22.04
needs: download-uberjar
timeout-minutes: 15
@@ -242,7 +249,6 @@ jobs:
verify-s3-download:
if: ${{ inputs.skip-s3 != true }}
runs-on: ubuntu-22.04
needs: upload-to-s3
timeout-minutes: 15
@@ -276,7 +282,6 @@ jobs:
run: grep -q $(sha256sum ./metabase-downloaded.jar) SHA256.sum && echo "checksums match" || exit 1
containerize:
if: ${{ inputs.skip-docker != true }}
runs-on: ubuntu-22.04
needs: [check-version, download-uberjar]
timeout-minutes: 15
@@ -291,6 +296,8 @@ jobs:
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
@@ -361,7 +368,6 @@ jobs:
echo "Finished!"
verify-docker-pull:
if: ${{ inputs.skip-docker != true }}
runs-on: ubuntu-22.04
needs: containerize
timeout-minutes: 15
@@ -410,7 +416,6 @@ jobs:
timeout-minutes: 3
push-tags:
if: ${{ inputs.skip-tag != true }}
permissions: write-all
needs: [verify-s3-download, verify-docker-pull, check-version]
runs-on: ubuntu-22.04
@@ -429,21 +434,7 @@ jobs:
const { tagRelease } = require('${{ github.workspace }}/release/dist/index.cjs');
const OSSversion = '${{ needs.check-version.outputs.oss }}';
const EEversion = '${{ needs.check-version.outputs.ee }}';
// push EE tag
await tagRelease({
github,
owner: context.repo.owner,
repo: context.repo.repo,
version: EEversion,
commitHash: '${{ inputs.commit }}',
}).catch((err) => {
console.error('Failed to tag release', EEversion, err);
process.exit(1);
});
// push OSS tag
await tagRelease({
github,
owner: context.repo.owner,
@@ -454,83 +445,50 @@ jobs:
console.error('Failed to tag release', OSSversion, err);
process.exit(1);
});
- name: Reorder release tags to put OSS first
run: |
git config user.name github-actions
git config user.email github-actions@github.com
$GITHUB_WORKSPACE/release/reorder-tags.sh ${{ needs.check-version.outputs.ee }} ${{ inputs.commit }}
trigger-docs-update:
if: ${{ !inputs.auto && inputs.skip-release-notes != true }}
needs:
- push-tags
- check-version
get-extra-tags:
needs: [ check-version ]
runs-on: ubuntu-22.04
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
env:
NEW_OSS_VERSION: ${{ needs.check-version.outputs.oss }}
NEW_EE_VERSION: ${{ needs.check-version.outputs.ee }}
GH_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
outputs:
extra_tags: ${{ steps.taglist.outputs.extra_tags }}
steps:
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
script: | # js
await github.rest.repos.createDispatchEvent({
owner: '${{ github.repository_owner }}',
repo: '${{ secrets.DOCS_REPO }}',
event_type: 'trigger-docs-update',
client_payload: {
version: '${{ inputs.version }}'
}
});
- uses: actions/checkout@v4
with:
token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: update releases.md
sparse-checkout: release
- name: prepare release scripts
run: cd release && yarn && yarn build
- name: Get extra tags
id: taglist
uses: actions/github-script@v7
with:
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
result-encoding: string
script: | # js
const fs = require('fs');
const { getExtraTagsForVersion } = require('${{ github.workspace }}/release/dist/index.cjs');
const releaseText = fs.readFileSync('./docs/releases.md', 'utf8');
const version = '${{ inputs.version }}';
const newReleaseText = releaseText
.replace(
/## Metabase Enterprise Edition releases\n\n/,
`## Metabase Enterprise Edition releases\n\n- [${process.env.NEW_EE_VERSION}](https://github.com/metabase/metabase/releases/tag/${process.env.NEW_EE_VERSION})\n`
)
.replace(
/## Metabase Open Source Edition releases\n\n/,
`## Metabase Open Source Edition releases\n\n- [${process.env.NEW_OSS_VERSION}](https://github.com/metabase/metabase/releases/tag/${process.env.NEW_OSS_VERSION})\n`
);
const extra_tags = getExtraTagsForVersion({ version });
fs.writeFileSync('./docs/releases.md', newReleaseText);
console.log({ extra_tags });
core.setOutput('extra_tags', JSON.stringify(extra_tags));
- name: commit and push updates
run: | # bash
git config --global user.email "metabase-bot@metabase.com"
git config --global user.name "Metabase bot"
git checkout -b docs-add-$NEW_OSS_VERSION
cd docs/
git add releases.md
git commit -m "Add $NEW_OSS_VERSION to the list of releases"
git push origin docs-add-$NEW_OSS_VERSION --force
- name: open pr with updates
run: | # bash
gh pr create --fill \
--body "Like it says on the tin 😁" \
--label "Type:Documentation" \
--label "backport" \
--reviewer "jeff-bruemmer" \
--assignee "jeff-bruemmer"
add-extra-tags:
needs:
- get-extra-tags
- push-tags
- verify-docker-pull
- verify-s3-download
strategy:
matrix:
tag: ${{ fromJson(needs.get-extra-tags.outputs.extra_tags) }}
uses: ./.github/workflows/release-tag.yml
secrets: inherit
with:
version: ${{ inputs.version }}
tag_name: ${{ matrix.tag }}
tag_ee: ${{ contains(matrix.tag, 'v1') }}
tag_oss: ${{ contains(matrix.tag, 'v0') }}
dot-x-tag: true
trigger-cloud-issues:
if: ${{ !inputs.auto }}
@@ -577,8 +535,8 @@ jobs:
});
draft-release-notes:
if: ${{ !inputs.auto && inputs.skip-release-notes != true }}
needs: push-tags
if: ${{ !inputs.auto }}
needs: add-extra-tags
runs-on: ubuntu-22.04
timeout-minutes: 15
permissions: write-all
@@ -586,41 +544,26 @@ jobs:
AWS_S3_DOWNLOADS_BUCKET: ${{ vars.AWS_S3_DOWNLOADS_BUCKET }}
DOCKERHUB_OWNER: ${{ vars.DOCKERHUB_OWNER }}
DOCKERHUB_REPO: ${{ vars.DOCKERHUB_REPO }}
strategy:
matrix:
edition: [oss, ee]
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: prepare release scripts
run: cd release && yarn && yarn build
- uses: actions/download-artifact@v4
name: Retrieve uberjar artifact
with:
name: metabase-${{ matrix.edition }}-uberjar
- name: Read Checksum
run: |
CHECKSUM=$(cat SHA256.sum)
echo "CHECKSUM=$CHECKSUM" >> $GITHUB_ENV
- name: Publish draft release notes
uses: actions/github-script@v7
with:
result-encoding: string
script: |
script: | # js
const { publishRelease, getCanonicalVersion } = require('${{ github.workspace }}/release/dist/index.cjs');
const version = '${{ inputs.version }}';
const edition = '${{ matrix.edition }}';
const canonical_version = getCanonicalVersion(version, edition);
await publishRelease({
github,
owner: context.repo.owner,
repo: context.repo.repo,
version: canonical_version,
checksum: '${{ env.CHECKSUM }}',
version,
}).then(() => {
console.log('Successfully published release notes', '${{ inputs.version }}');
}).catch((err) => {
@@ -629,7 +572,6 @@ jobs:
});
publish-version-info:
if: ${{ !inputs.auto && inputs.skip-version-info != true }}
runs-on: ubuntu-22.04
needs: [push-tags, check-version]
timeout-minutes: 15
@@ -640,6 +582,11 @@ jobs:
AWS_S3_STATIC_BUCKET: ${{ vars.AWS_S3_STATIC_BUCKET }}
AWS_REGION: ${{ vars.AWS_REGION }}
steps:
- name: Finish early
if: ${{ inputs.auto }}
run: |
echo "skipping version info update for nightly patch"
exit 0
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
@@ -687,22 +634,20 @@ jobs:
--distribution-id ${{ vars.AWS_CLOUDFRONT_STATIC_ID }} \
--paths "/version-info.json" "/version-info-ee.json"
tag-nightly:
if: false
needs: [push-tags, verify-docker-pull, verify-s3-download, check-version]
set-release-channel:
needs: publish-version-info
uses: ./.github/workflows/release-tag.yml
secrets: inherit
with:
version: ${{ inputs.version }}
tag_name: nightly
tag_name: ${{ inputs.release-channel }}
tag_rollout: 100
tag_ee: true
tag_oss: true
publish-complete-message:
if: ${{ !inputs.auto }}
runs-on: ubuntu-22.04
needs: [draft-release-notes, verify-docker-pull, verify-s3-download, publish-version-info]
needs: [set-release-channel, add-extra-tags]
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
@@ -719,34 +664,7 @@ jobs:
script: | # js
const { sendPublishCompleteMessage } = require('${{ github.workspace }}/release/dist/index.cjs');
await sendPublishCompleteMessage({
owner: context.repo.owner,
repo: context.repo.repo,
version: '${{ inputs.version }}',
runId: '${{ github.run_id }}',
channelName: '${{ vars.SLACK_RELEASE_CHANNEL }}',
generalChannelName: 'general',
}).catch(console.error);
auto-publish-complete-message:
if: ${{ inputs.auto }}
runs-on: ubuntu-22.04
needs: tag-nightly
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Send auto publish complete message
uses: actions/github-script@v7
env:
SLACK_RELEASE_CHANNEL: ${{ vars.SLACK_RELEASE_CHANNEL }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
script: | # js
const { sendPublishCompleteMessage } = require('${{ github.workspace }}/release/dist/index.cjs');
const isAutoRelease = '${{ inputs.auto }}' === 'true';
await sendPublishCompleteMessage({
owner: context.repo.owner,
@@ -754,7 +672,7 @@ jobs:
version: '${{ inputs.version }}',
runId: '${{ github.run_id }}',
channelName: '${{ vars.SLACK_RELEASE_CHANNEL }}',
generalChannelName: '',
generalChannelName: !isAutoRelease ? '${{ vars.SLACK_GENERAL_CHANNEL }}' : '',
}).catch(console.error);
manage-milestones:
@@ -787,11 +705,11 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
version,
});
}).catch(console.error);
await openNextMilestones({
github,
owner: context.repo.owner,
repo: context.repo.repo,
version,
});
}).catch(console.error);

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