Compare commits

...

4396 Commits

Author SHA1 Message Date
Aleksandr Lesnenko
d3ac84ad17 claude code workflows 2025-04-11 20:14:00 -04:00
appleby
97387d0942 Enable expression-literals for redshift and vertica (#56534)
* Support drivers that need special handling for literal string expressions

* Enable the :expression-literals feature for vertica

* Enable the :expression-literals feature for redshift

* Review feedback: lift comment about inlined literals from h2 to sql driver
2025-04-11 16:33:52 -07:00
bryan
63198734e2 properly address metabase's bb executable (#56606)
- if you have bb on your path, then this would never be hit.

Testing by uninstalling bb will not uncover this issue if you have
repo/path/metabase/bin on your PATH!
2025-04-11 22:54:27 +00:00
appleby
2a4e8d1c69 Enable expression-literals for sqlite and starburst (#56533)
* Rename True and False expressions in literal expression tests

Speculative fix for sqllite failing the tests.

* Update literal expression tests to work with drivers that treat empty string as null

* Add empty-string-literal-expression-test and remove empty string form standard-literal-expression-defs

* Fix logical merge conflicts in case-with-literal-expression-test

* Enable the :expression-literals feature for sqlite and starburst

* Review feedback: drop format-nil->empty-str

As pointed out by metamben in code review `(str nil)` is already the empty string. In fact, the culprit here was a
missing `format-nil-values?` arg to `format-rows-by`.
2025-04-11 15:03:52 -07:00
Uladzimir Havenchyk
de8c20bf55 test: use mousemove instead of realHover for echart tooltip (#56583) 2025-04-12 00:44:57 +03:00
Alexander Polyankin
ba131b1abd Close the MultiAutocomplete dropdown on Esc, preventing the outer Popover from closing (#56562) 2025-04-11 15:39:31 -04:00
Nick Fitzpatrick
452dbefda4 Add route prop to disable command palette, Disable in setup routes (#56507)
* Add route prop to disable command palette, Disable in setup routes

* increase wait timeout

* refresh user on setup

* Lets try a unit test instead

* removing refresh user from UserStep
2025-04-12 00:09:12 +05:30
Ryan Laurie
fd7c0db61f fix frontend test flake (#56597) 2025-04-11 08:50:04 -06:00
Uladzimir Havenchyk
5e19281112 test: fix a broken entity picker test (#56586) 2025-04-11 17:27:37 +03:00
Jeff Bruemmer
50df68482e docs - note on quotes (#56520)
* note on quotes

* edit

* tags

* format

* spacing

* edit
2025-04-11 14:25:41 +00:00
Noah Moss
c17c259d79 Remove a workaround which is no longer needed due to update of Apache POI (#56572)
* Remove a workaround which is no longer needed due to update of Apache POI

* clean ns
2025-04-11 13:33:23 +00:00
metamben
3be8f6ab2b Require only id and value for parameters when running questions (#56565)
This is the BE part of #51813
2025-04-11 15:40:41 +03:00
Sébastien
50664531b3 closes metabase#56307: faint line on tooltip arrow in FF (#56588) 2025-04-11 13:43:56 +02:00
Oisin Coveney
1f19dee6c5 Fail SDK unit tests when there are console errors #55529 2025-04-11 11:16:54 +01:00
William
c3c5edc272 Calculate and cache entity_ids on select (#54411)
We need to ensure that we consistently have entity-ids in metadata (and potentially elsewhere) even before we've finished backfilling them in.  To do this, we check for entity-ids in the field/table/database/card after-select and run calculation/deduplication logic to get them when necessary.  We then cache the results (because these calculations can be slow), and a separate job then drains the cache and writes the results back to the db.
2025-04-11 00:19:38 +00:00
John Swanson
728fa82bc2 Feature: Database Routing (#54648)
* Migrations for database sandboxing (#53125)

Two changes here:

- add a self-referential foreign key,
`metabase_database.router_database_id`, to allow marking a mirror
database's router database. Databases with this set are mirror
databases, databases without it are primary databases.

- add a `db_sandbox` table with only three columns:

  - `id`, primary ID,

  - `db_id`, the `metabase_database.id` this sandbox is for, and

  - `user_attribute`, the user attribute used to map users to a
    particular mirror database.

* CRUD API for database routing (#54102)

* Migrations for database sandboxing

Two changes here:

- add a self-referential foreign key,
`metabase_database.primary_database_id`, to allow marking a mirror
database's primary database. Databases with this set are mirror
databases, databases without it are primary databases.

- add a `db_sandbox` table with only three columns:

  - `id`, primary ID,

  - `db_id`, the `metabase_database.id` this sandbox is for, and

  - `user_attribute`, the user attribute used to map users to a
    particular mirror database.

* Bulk endpoint for creating mirror dbs

The error case is a bit wonky right now, it just returns the errors for
the details that failed... without the details or name.

Co-authored-by: Ed Paget <ed@metabase.com>

* Add endpoint for marking a database as a RouterDB

Co-authored-by: Ed Paget <ed@metabase.com>

* Rebase fixes

* Exclude mirrordbs from regular db endpoints

* kondo fixes

* mark `DatabaseRouter` as not serialized

* serdes fix

* copy fix

* delete and update routers

Also reorganized things to be a bit less cattywompus.

Now we have:

- `POST api/ee/database-routing/mirror-database` to create a new mirror database
- `POST api/ee/database-routing/router` to create a new router using an
  existing database
- `PUT api/ee/database-routing/router/:id` to update a router to use a
  new user attribute
- `DELETE api/ee/database-routing/router/:id` to delete a router and all
  of the associated mirror databases.

* GET endpoint for mirrors of a particular router db

* Don't test database conn for mirror dbs

---------

Co-authored-by: Ed Paget <ed@metabase.com>

* Modify the API - don't care about database routers (#55036)

* Modify the API - don't care about database routers

Add a `router_user_attribute` to the `GET /api/database/:id` API
endpoint.

Modifies the database routing API to address only by the database ID.
There's now just two endpoints:

- POST /ee/database-routing/mirror-database to create a mirror database

- PUT /ee/database-routing/router-database/:id to change the
`user_attribute` used for routing an existing database. Can be set to
`null` to turn of database routing for the database.

* fix test

* kondo

* DB Routing: Sloan's API improvements (#55438)

* router_user_attribute on `/database/`

* unique database names for mirror dbs

* Don't delete mirror databases when deleting router

* query param to check conn details

* no making a mirror a router

* Require `:manage-database` perms to get dest dbs

(rather than superuser.)

* set `visible-if`, NA on dest dbs

* Add conditions when making db router

* fix db migrations

* fix tests

* kondo

* reorder migrations for mysql/mariadb

* Implement database routing (#55053)

* Swap DB for DB routing

Caching should work, field values does not currently.

* Rename the metadata replacement dynamic var

for clarity. Since we're using it outside of tests now.

* Refactor Advanced Field Values

Previously we had 3 types of Advanced field values:

- sandbox,
- impersonation,
- and linked-filter

Each of these three had their own function, `hash-key-for-*`, and the
caller of this function was responsible for generating the correct hash
key for the field provided.

For example, `hash-key-for-advanced-field-values` took a `fv-type` and
called either `hash-key-for-linked-filters` or `hash-key-for-sandbox` or
`hash-key-for-impersonation` depending on the type.

The big problem here is that the hash keys aren't composable. You can
see this being an issue in `hash-key-for-linked-filters`, where the
enterprise version needs to also check whether the field is sandboxed,
and if so, include sandboxing data in the generated hash as well as the
linked filter data.

If we add more orthogonal things to the hash (like database routing) we
would end up with a rat's nest where each hashing function partially
implements a bunch of other hashing functions to make things work. E.g.
`hash-key-for-database-routing` might check if the field is sandboxed,
and if so include data about the sandbox, but also
`hash-key-for-linked-filters` should check if the field is
sandboxed *or* impersonated *or* subject to db-routing and include data
about those, and ...

Instead, I've replaced all these functions with `hash-input-for-*`
functions, which return self-contained maps that reflect
their *internal* knowledge of what should/should not be cached.

For example, the `hash-input-for-sandbox` function returns either
`nil` (if the field is not sandboxed for the current user) or
`{:sandbox-attributes {<the user attributes used for the sandbox>}}` (if
it is).

`hash-input-for-field-values` simply merges all of these together into
one lump.

To tell whether we're generating a `full` or `advanced` field value, we
can just check to see whether the hash input has any data other than the
field ID.

The one downside here is that we'll no longer be able to look at the DB
and distinguish between different types of FieldValues. As far as I can
tell, the code itself does not ever do this, so I think this is an
acceptable tradeoff.

* database routing for field vals

* move things around a bit

* fix tests

* Lint

* WIP: database routing

* fix test

* more tests, caching tests

* kondo

* stray #p

* Exclude mirror databases from search

* Exclude mirror databases from sync

* Do not create permissions for mirror databases

* fix more tests

* lint

* Add another e2e test for field values

* Don't grab database from query in h2 driver

* Fix my rebase error

* [DB Routing] Implement UI (#55132)

* save

* wip

* wip

* lots of progress

* iteration

* more progress, add delete mirror modal

* type clean up, bug fixes, code organization

* address lots of TODOs

* prevent configuring uploads to routed dbs, prevent db routing if db is upload destination db, replace all usages of routed database and mirror database in favor of destination database

* clean up url usage, add health check to destination database lists

* support hidden fields for database details

* fix types and TODOs

* render warning that model features can not be enabled when db routing is enabled, add unit tests for DestinationDatabasesList

* add e2e coverage for db routing CRUD

* move db routing e2e to a new file, make tests nicer, add test coverage for not showing destination databases outside of database settings

* test that db routing can not be enabled if other conflicting features are enabled

* finish e2e tests as much as possible, add feature token to session properties payload

* move more code into enterprise folder, add redirects and permissions checks for destination db routes, handle no user attributes on instance state, fix failing unit tests, make alerts tooltips when features cant be enabled based on other features being enabled

* test fixes, impl error states kyle provided

* split up tests by ee and oss

* error state updates, fix failing e2e tests

* fix failing oss e2e test, beef up db management perms test

* PR feedback

* impl more feedback

* Fix BE tests

* another be test

* pr feedback

* fix one of the failing e2e tests

* include_mirror_databases -> router_database_id

* skip test

---------

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

* fix deletion of router dbs with dest dbs (#55831)

* Don't require superuser perms to get dest db (#55754)

* [DB Routing] Database pages tech debt - RTKQuery + TS migrations (#55744)

* convert DatabaseList to typescript

* make DatabaseEditApp use rtkquery, remove old initialize approach, remove related redux code, port code to use api db rather than metabase lib Database class

* remove dismissDatabaseSyncSpinner redux code in favor of rtkquery

* fix some mistakes causes tests to fail

* port DatabaseList to typescript

* port adding sample database to rtkquery

* misc fixes

* fix failing unit test

* convert admin/databases/database.js and admin/databases/selectors.js to TS

* editParamsForUserControlledScheduling.js to editParamsForUserControlledScheduling.ts

* remove all usages of metabase lib Database class from Database pages

* fix type errors

* fix failing e2e

* prettier

* [DB Routing] Port Admin DB page components to Mantine (#55811)

* port components to mantine for admin db pages

* fix failing tests

* remove unused comment

* fix type issue

* Require opt in/out of database routing (#55841)

I was considering possible errors here and I think this will work well
as a safety harness.

In dev/testing (non-prod) environments, let's add an assertion to the
JDBC driver that if we're about to connect to a database. Either:

- we're *explicitly* trying to only connect to Router Databases. For
example, sync should *never* connect to mirror databases or go through
Database Routing. OR

- we've enabled Database Routing, and we *don't* want to access the
Router Database (unless of course DB routing has been configured to send
us there)

Another way of putting this is that there are two obvious ways for this
feature to go sideways: we accidentally sync a mirror database or do
something else that shouldn't work for mirror databases, OR we
accidentally skip the Database Routing process and connect to the router
database when we shouldn't.

Of course, we can't guarantee that all drivers will call
`(database-routing/check-allowed-access!)` before connecting! But we can
just call it from the JDBC router and that should be sufficient to catch
any issues in development in the vast vast majority of cases.

* [DB Routing] UI feedback part 1 (#55893)

* make dest db validate on creation, invalidate cache of user attributes after user is updated

* add test coverage for updates and uncomment e2e tests parts that were previously failing

* fix type issue

* Fix audit/query logging for DB routing (#56103)

[ADM-585: Handle audit logging and query logging](https://linear.app/metabase/issue/ADM-585/handle-audit-logging-and-query-logging)

* exclude destination dbs from serialization (#56076)

* Decrease the pool size for mirror DBs (#56104)

DB metadata seems like an odd thing - it's the Metabase Database
converted to a snake-hating map, so `router_database_id` becomes
`router-database-id`.

We can't write a function of `:model/Database` that decides whether
we're looking at a mirror database (because we're not looking at a
`:model/Database` here). So we're reduced to just checking the key.
Feels weird, but I think the cleanest way available here?

* Fix sandbox on a routed DB with question as filter (#56393)

This only affected turning on sandboxing, and was not an error for
sandboxing itself.

When we configure sandboxing, we want to make sure the column types for
the query we're using match the columns in the sandboxed table.

As part of this, we ran the query anonymously with
`(request/with-current-user nil ...)`. With Database Routing, however,
we added a new constraint: you can't run any queries against a database
with routing configured anonymously.

Instead just run the query as a superuser. This is effectively the same,
and it's consistent with what we do when actually *enforcing* the row
level restrictions anyway: we preprocess the source query as an admin
and then splice it into the user's query.

The one thing that gives me pause: I'm not really sure why we would have
done `(request/with-current-user nil ...)` in the first place here.

* Add database-router usage e2e tests (#56255)

* Improve error messages and UI for config (#56392)

* Improve error messages and UI for config

- improve error messages when a dest db can't be found

- improve the admin UI for configuring DB routing: https://metaboat.slack.com/archives/C07L6VCCYQL/p1744044752380479

* changes suggested by Jeff

* fix error msg tests

* disable linting for DB Routing description

* fix getting a destination db

db `can-read/write?` use router DB if necessary, since destination
databases don't actually have permissions saved.

* i18n for errors

* spelling 😁

* fix tests

---------

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

* Fix options for Destination DBs (#56450)

* Fix options for Destination DBs

This may still require a bit of frontend work.

* Set destination-database=true for destination db modal

---------

Co-authored-by: Fraser McIntosh <fraser@metabase.com>

* Fix impersonation with Database Routing (#56503)

* Fix impersonation with Database Routing

Database routing was not working with impersonation, because by the time
the driver calls `set-role-if-supported!` the router database (which is
configured for impersonation) has already been swapped out for the
mirror database (which is not).

To fix this, have a new impersonation middleware set a dynamic var,
`*impersonation-role*`, which is preferred by `set-role-if-supported!`
if set. This way, in queries, `set-role-if-supported!` will use the
pre-calculated role (which seems better than computing it twice anyway).

Co-authored-by: Ed Paget <ed@metabase.com>

* Add impersonation tests

* Add sandbox question test

---------

Co-authored-by: Ed Paget <ed@metabase.com>
Co-authored-by: Fraser McIntosh <fraser@metabase.com>

* keep metadata store on metadata provider swap (#56502)

* keep metadata store on metadata provider swap

Before, we would blow away the existing QP store entirely when using
`*DANGER-allow-replacing-metadata-provider* to swap out the existing
metadata provider.

Instead we can only initialize the QP store when it was truly
uninitialized, and replace *only* the metadata provider when we're
trying to do that.

This is just in case something in QP post-processing needs data from the
original store, e.g. something that was stored with
`qp.store/store-miscellaneous-value!`.

Co-authored-by: Ed Paget <ed@metabase.com>

* only allow replacing md provider once

---------

Co-authored-by: Ed Paget <ed@metabase.com>

---------

Co-authored-by: Ed Paget <ed@metabase.com>
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Fraser <fraser@metabase.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-04-10 13:21:23 -07:00
Alexander Polyankin
9eb88c3478 Pass missing props in MultiAutocomplete (#56506) 2025-04-10 15:15:22 -04:00
Uladzimir Havenchyk
24b79c324c test: fix another flakiness (#56563) 2025-04-10 22:04:51 +03:00
Konstantin Darutkin
c3e6655d45 fix: controlled column reordering in datagrid (#56543) 2025-04-10 19:40:08 +01:00
Aleksandr Lesnenko
8f57a69882 fix incorrect series colors in static viz (#56415)
* fix static charts may have incorrect series colors

* use hex colors in static viz
2025-04-10 14:02:08 -04:00
Timofey Kachalov
067057efda Add CI job checking outdated Embedding SDK API documentation (#56452) 2025-04-10 21:54:31 +04:00
Nick Fitzpatrick
98c2872f2b Adm 505 collection and everywhere shortcuts (#56457)
* rest of global, and some collection shortcuts

* adjust collection item commands, e2e tests

* adjust e2e test

* remove bulk move
2025-04-10 16:32:56 +00:00
Timofey Kachalov
10b7df74e9 docs(sdk): Add generated documentation files for @metabase/embedding-sdk-react (#56367) 2025-04-10 20:18:59 +04:00
Edward Paget
b46ae17a3b feat: upgrade ring-jetty to 1.14.1 (#55921)
* feat: upgrade ring-jetty to 1.14.1

Moves us onto Jetty 12 which has some features (pthreading, QoSHanlder)
that we may want to take advantage of.

* fixup! customize jetty metrics

* fixup! license info for jetty ee9

* fixup! make a var private

* fixup! don't use deprecated method

* fixup! create custom statistics handler

Replicate the Jetty 11 statistics handler that is able to report on
asynchronously handled requests separately from synchronously handled
ones. Also ports it to directly report statistics to our prometheus
rather than needing to build a connector between the stats handler
object and our metrics reporting

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

* fixup! fix race condition in stats test

* fixup! missing private annotation

* fixup! use normal jetty release with logging fix

---------

Co-authored-by: John Swanson <john.swanson@metabase.com>
2025-04-10 16:16:23 +00:00
Timofey Kachalov
b373500c04 docs(sdk): Setup automatic documentation generation for @metabase/embedding-sdk package (#56366)
Co-authored-by: jeff bruemmer <jeff.bruemmer@gmail.com>
2025-04-10 20:06:06 +04:00
Uladzimir Havenchyk
31f31e59f0 ci: simulate slow network in stress test (#56464)
* ci: simulate slow network in stress test

* fixup
2025-04-10 19:04:08 +03:00
Nick Fitzpatrick
cf806ce408 Growing entity picker (#56462)
* resize observer entity picker

* adding e2e test

* e2e adjustments
2025-04-10 21:08:01 +05:30
Aleksandr Lesnenko
baab33ecca fix bars width on dst timezone data (#56466)
* fix bars width on dst timezone data

* specs
2025-04-10 11:06:17 -04:00
metamben
acea8921ab Support binning by column with a single numerical value (#56517)
Fixes #53521

--

Co-authored with lyulifeng (lyulifengg@gmail.com)
2025-04-10 14:43:02 +00:00
Timofey Kachalov
4d38da9476 Refactor Embedding SDK CI workflow and improve notify-pull-request action (#56545) 2025-04-10 18:24:38 +04:00
Gustavo Saiani
231d159585 Improve links (#56549) 2025-04-10 11:06:45 -03:00
Nicolò Pretto
59bd5a5905 call e2e-component-tests-embedding-sdk-cross-version from (#56454)
* call e2e-component-tests-embedding-sdk-cross-version from
embedding-sdk.yml

* add e2e-component-tests-embedding-sdk-cross-version to the tests-results
so it needs to pass (or be skipped)
2025-04-10 13:34:29 +00:00
John Swanson
6d647bccde Reset all errored triggers to WAITING on startup (#55769)
* Reset all errored triggers to `WAITING` on startup

Co-authored-by: Ed Paget <ed@metabase.com>

* Add explanatory comments

---------

Co-authored-by: Ed Paget <ed@metabase.com>
2025-04-10 05:44:56 -07:00
lbrdnk
c198bc44e7 Make category semantic type available for all types (#56505)
* Make Category semantic type available for all types

* Update test
2025-04-10 12:56:32 +02:00
lbrdnk
20e9cd8fc1 Fix percentile with expression argument on Clickhouse (#56488)
* Fix percentile honeysql generation on Clickhouse

* Fix lib/case arities

* Add test

* Whitespace
2025-04-10 09:05:32 +02:00
Riley Thompson
76241f7db7 Revert "Remove partner drivers (#56403)" (#56529)
This reverts commit 44274c63ad.
2025-04-10 01:51:38 +00:00
Aleksandr Lesnenko
722fc1a45f fix dashboard empty state for no query creation users (#56340)
* fix dashboard empty state for no query creation users

* fix unit specs
2025-04-09 22:03:35 +00:00
Edward Paget
d20183be8e fix: allow metabase jars to start on JVM 24 and up (#56518)
Metabase jars would crash when running on JVM 24 because the getReourse
method on the ClassLoader object was changed to return null if there is
no file at the provided path. This adds a ".keep-me" file to the
resources directory that Metabase can use to check if it is running in a
jar.
2025-04-09 21:17:50 +00:00
Riley Thompson
b626947efb Document athena permissions (#56525) 2025-04-09 21:11:35 +00:00
Nathan Voxland
c583ae13e6 Added include_metadata argument to search API (#56397) 2025-04-09 15:01:38 -05:00
Case Nelson
a8ecef4802 fix: resolve snowflake sync cost issue (#56337)
* fix: resolve snowflake sync cost issue

Using information_schema queries will cause snowflake to wake an
instance and thus incur costs. Using `show` queries will not do so.

In addition this adds a new multi-method for manipulating the results of
`describe-fields-sql`.

* Fix database-position and sorting

* Fix kondo

* Add order-by to mysql describe-fields

* Sort deps

* Use identity not map identity

* Fix databricks

* Address PR comments
2025-04-09 13:49:57 -06:00
Nick Fitzpatrick
c1062d680a remove duplicate function, translate dates (#56449) 2025-04-10 00:47:41 +05:30
Nathan Voxland
1762ab78d5 Created queue listener and updated search to use it (#55069) 2025-04-09 13:16:00 -05:00
Ryan Laurie
10890aee1f update CI config for automatic translation update (#56500) 2025-04-09 12:02:43 -06:00
Phoomparin Mano
87bbb5b9a1 Expose PDF and dashcard result download toggles in the embedding modal (#56211)
* scaffold separate download options for dashboard static embeds

* parse the display options to hash options

* add toggles to the embed preview

* workaround for duplicate types

* cleanup the dashboard workaround

* cleanup the dashcard workaround

* downloads parameter should not show up on OSS

* replace the download button tests

* update existing tests

* fix test for Download buttons

* remove unnecessary fallback

* add a new snowplow schema

* update unit tests

* fix snowplow test assertions

* add snowplow tests

* use results instead of dashcard for consistency

* make the JSON schema backwards-compatible

* split download settings into two components

* use downloadsEnabled.results instead

* snowplow type must be results, not dashcard

* revert StaticEmbedSetupPane changes as it is unused

* create a new field for snowplow tracking
2025-04-10 00:06:29 +07:00
Nick Fitzpatrick
cfb87dc8a1 Remove copy and move shortcuts from dashboards (#56493)
* Remove copy shortcut from dashboards

* Also remove mod+m shortcuts
2025-04-09 22:26:18 +05:30
Raphael Krut-Landau
9fc01e8dc6 (mini-PR) Remove irrelevant msgctxt from error diagnostic modal (#56484)
Like it says on the tin
2025-04-09 09:33:23 -04:00
Jeff Bruemmer
cc4202abde docs - data picker entities (#56448)
* entity types for data picker

* dropdown and sidebar

* separate page

* note on metrics

* notes

* edit

* table
2025-04-09 09:20:22 -04:00
Kamil Mielnik
c3ec3d1a90 Fix - Column sorting does not work well with predefined column orders (#56486)
* Fix loading state shown after change

* Repro #56482

* Repro #56482

* Revert 69a7c65c99

* Add extra assertion
2025-04-09 20:17:42 +07:00
Eric Normand
6658efa2f9 Allow lhs and rhs columns to be selected in existing join (#56446)
* Allow lhs and rhs columns to be selected in existing join

* Only mark selected if there is a current selection (tests)

Also simplify the test.
2025-04-09 08:05:00 -05:00
Kamil Mielnik
d703d1a3e7 SEM-113 Format the visualization of the task results (#56383)
* Add new buttons

* Move TaskModal to its own dir

* CopyButton

* Rename

* Download

* Fix setTimeout usage in CopyButton

* Style code

* Styling

* See logs link

* Improve styling

* Format code

* Improve comment

* Extract formatTaskDetails

* Rename

* Extract getFilename

* Improve comment

* Fix text selection

* Add unit tests boilerplate

* Add test

* Remove unit test

* Remove unused function

* Test downloading

* Test task details

* Comments

* Remove useMemo

* Simplify props

* Clean up timeouts
2025-04-09 17:53:28 +07:00
Kamil Mielnik
971252a066 Fix - In some circumstances the type dropdown is not visible in full on table metadata page (#56442)
* Fix #56428

* Repro #56442

* Make vertical padding same as horizontal
2025-04-09 08:25:45 +00:00
Ngoc Khuat
2390fca3af Fix flaky unsubscribe test (#56472) 2025-04-09 08:14:05 +00:00
Uladzimir Havenchyk
db87251a3a test: several fixes for flaky tests (#56441)
* test: wait for data to load in a flaky test

* fix two more tests

* fix one more test
2025-04-09 08:36:07 +03:00
appleby
64dcfe501e Enable expression literals on additional drivers (#56334)
* Enable expression literals on drivers that pass tests

Closes QUE-780

* Update .devcontainer/Dockerfile for java 21 and node 22

This Dockerfile is apparently used by the "metabase assembler", which in turn is used by
.github/workflows/presto-kerberos-integration-test.yml to run the Presto Kerberos tests.

* Add case-with-literal-expression-test

* Review feedback: remove extra whitespace

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

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2025-04-08 17:20:36 -07:00
metamben
23db3d6618 Preserve non-default effective type of column in field-ref metadata (#56453)
Fixes #55171
2025-04-09 01:58:21 +03:00
github-actions[bot]
785db78108 Update translations 2025-04-08 (#56418)
* Update translation sources 2025-04-08

* Update translations

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-04-08 22:04:39 +00:00
metamben
11239d8d7b Support formatting postgres and oracle concatenation operator (#56331)
Fixes #55961
2025-04-08 23:32:18 +03:00
Riley Thompson
44274c63ad Remove partner drivers (#56403) 2025-04-08 16:31:57 -04:00
Alexander Polyankin
9c8720bc0a New MultiAutocomplete for inline editing (#56195) 2025-04-08 19:01:15 +00:00
Edward Paget
6fb0244736 feat: make cluster locking reusable (#56310)
* feat: make cluster locking reusable

Builds a more generic interface for cluster locking using our existing
retry mechanism and jdbc level timeouts that will work with any database
rather than just postgresql.

* fixup! handle alt error text on mysql/mariadb

* fixup! don't lock on h2

* fixup! move malli annotations to retry
2025-04-08 16:18:52 +00:00
Romeo Van Snick
95afcd14b1 Allow selecting multiple ranges and running those in native editor (#56420)
* Store all native editor selected ranges in redux

* Pass all selected ranges to redux

* Add repro for metabase#54799

* Fix unit tests

* Fix typo

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

* Do not intersperse space in when running selected text

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-04-08 16:59:34 +02:00
Ryan Laurie
1abbfdd637 Move toast handling into useAdminSetting Hook (#56406)
* move toast to useAdminSetting hook

* update tests

* circular import or something
2025-04-08 07:50:48 -06:00
Edward Paget
f6fbcab4d0 fix: mock time to middle of a utc day (#56296)
This test was flaking if it was run close to the boundary of a UTC day
where the models could be created one day and then the clock ticked over
to a new day before the query ran.
2025-04-08 13:49:00 +00:00
Edward Paget
b4bcdb65d3 feat: add basic schema for sso saml settings api (#56318) 2025-04-08 13:44:04 +00:00
Nathan Voxland
0ac5d0bf7f Don't update report_card.result_metadata if it has not changed (#56314)
* Don't update card metadata if it has not changed

* Store stored-metadata as a different field on info

* Fixed failing tests

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

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>

* Addressed review comments

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

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

* Addressed review comments

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

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

* Addressed review comments

* fixup! exclude info map from legacy normalization

* fixup! test that metadata equality skips update

* fixup! make adding the info map conditional

* fixup! use qp.store instead of adding to info map

* fixup! remove #p

* fixup! remove cyclic dep

* fixup! move load and store fns to same ns

* fixup! test name

---------

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Braden Shepherdson <braden@metabase.com>
Co-authored-by: Edward Paget <ed.paget@gmail.com>
2025-04-08 08:27:48 -05:00
Braden Shepherdson
ba72e829bf [revisions] Include card_schema in revisions; default to 20 (#56394)
The new `:card_schema` field on `:model/Card` was wrongly excluded from Revisions.

This PR includes them, and adds a default value for old Revisions which predate `:card_schema`.
2025-04-08 13:08:09 +00:00
Sébastien
f4511c2b97 closes VIZ-613 caret on readonly input in FF (#56380) 2025-04-08 13:45:33 +02:00
github-automation-metabase
ed9e654155 Bump net.snowflake/snowflake-jdbc from 3.23.1 to 3.23.2 (#56363)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-04-08 11:44:05 +03:00
github-automation-metabase
c92fe37769 Bump io.netty/netty-common from 4.1.118.Final to 4.2.0.Final (#56362)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-04-08 11:38:36 +03:00
Filipe Silva
e1fd2d1cdd devex: add claude tooling (#56391) 2025-04-08 09:37:04 +01:00
Oleksandr Yakushev
89f7b64763 [metrics] Add hiccup and allocation rate metrics (#56345) 2025-04-08 11:17:52 +03:00
Nick Fitzpatrick
2621458071 Adm 504 shortcut viewer and dashboard shortcuts (#55945)
* most dashbaord actions, shortcut side drawer

* fix build error

* converting back to modal. start setting up shortcut grouping

* Shortcut Glossary

* most global actions

* modal polish, adding shortcut context

* shortcuts e2e tests

* remove commented code

* check for context in hook, PR feedback

* fix error

* linter 🙄
2025-04-08 00:53:41 -03:00
Uladzimir Havenchyk
cbcf698e30 test: wait for data to load in a flaky test (#56409) 2025-04-08 00:40:25 +03:00
Riley Thompson
d6b7f86354 Prevent Athena sync failing due to catalog (#56038) 2025-04-07 14:35:48 -04:00
Ryan Laurie
be9cffd831 Convert General Settings Page to use new components (#55064) 2025-04-07 12:22:49 -06:00
Case Nelson
ba40a8354e fix: snowflake can-connect with ssh without touching other drivers (#56325)
* fix: snowflake can-connect with ssh without touching other drivers

* Adjust host-and-port for can-connect without calling incorporate-ssh-tunnel-details
2025-04-07 12:15:26 -06:00
Aleksandr Lesnenko
ee794794ca change table cells vertical align to top instead of center for wrapping (#56256) 2025-04-07 13:52:27 -04:00
Nathan Voxland
c409a653c5 Don't need to be running "configure the scheduler" liquibase tasks during testing (#56176) 2025-04-07 12:45:34 -05:00
Case Nelson
830be48c20 fix: dont log db-details (#56386)
We were inadvertently logging db-details in the rarely used
`maybe-test-and-migrate-details`. This changes to more of a data
diff where we can still get important information on how it changed.
2025-04-07 11:41:11 -06:00
Aleksandr Lesnenko
2dba03a0d0 fix readability of map buttons (#56341) 2025-04-07 13:10:41 -04:00
Romeo Van Snick
10fff67c18 Split up expression resolver (#56350)
* Rename checkCompiledExpression to diagnoseExpression

* Add tests for arg count validation

* Add arg validator tests

* Add test for unsupported functions to diagnostics

* Add isCallExpression matcher

* Add visit helper

* Move unsupported function check to diagnostics

* Move arg validator to diagnostics

* Move arg count validation to diagnostics

* Remove EQUIVALENT_CLAUSES since we have them in config.js

* Remove database argument where no longer needed

* Add COMPARISON_OPERATORS to config

* Add LOGICAL_OPS to config

* Add NUMBER_OPERATORS to config

* Add FIELD_MARKERS to config

* Move comparison validator to diagnostics

* Simplify resolver

* Move checkers before Lib.diagnoseExpression

* Fix diagnoseExpression return type

* Move case or if operator argument check to diagnostics

* Remove unused tokenName

* Make expression types more specific

* Convert resolver to typescript

* Add test for multi-arg infix operators

* Add checker for unknown functions

* Add more tests for coalesce typing

* Add more tests for comparison operator resolving

* Add test for number operators

* Add test for logic operators

* Remove branches that are handled in the config already

* Allow mbql clause config to define the arg types

* Allow case/if to define argType too

* Move getNode and getToken to utils

* Make resolver fn required

* Validate field names in resolver

* Move trim into getMBQLName

* Fix top-level literals

* Handle expression refs

* Allow number operators to be multiple

* Add more tests for custom arg validators

* Test operator resolvers more

* Add more tests for multi arg functions with options

* Use better formatting in test

* Be more generic in getNode and getToken

* Use correct location for errors
2025-04-07 18:40:55 +02:00
Sébastien
c375e64c2d Closes VIZ-579: jarring layout change in object detail view (#56287)
* fixed console warning

* closes VIZ-579 object detail layout no longer jumps

* e2e
2025-04-07 18:26:28 +02:00
Ryan Laurie
0601021d0c use PAT for repository dispatch (#56335) 2025-04-07 10:07:11 -06:00
metamben
796a3c8290 Make mr/def assert that the docstring is a compile time string (#56381)
This is to make adding typos more difficult.
2025-04-07 15:52:27 +00:00
Vamsi Peri
2b577eb3f5 New entry for metabot team (#56384) 2025-04-07 14:46:26 +00:00
github-automation-metabase
1f197ad4cd Bump dev.weavejester/hashp from 0.3.0 to 0.4.0 (#56353)
Inspect dependency changes here: https://github.com/weavejester/hashp/compare/0.3.0...0.4.0

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-04-07 17:41:53 +03:00
Ryan Laurie
5d102ec856 Move Enterprise settings types to general types file (#56174)
* move Enterprise settings types to general types file

* not so fancy
2025-04-07 08:17:57 -06:00
Kamil Mielnik
a14ebf5f29 SEM-223 Show database type instead of MBQL type in UI (#56374)
* Show db type instead of semantic type

* Update unit tests

* Fix flaky test
2025-04-07 21:14:35 +07:00
Eric Normand
54b509bf2f Fix relative-time-view rendering (#56326) 2025-04-07 09:10:27 -05:00
Noah Moss
e2fbe3142f Retain formatting for links with no URL (#56327)
* Retain formatting for links with no URL

* Rework approach to fix tests
2025-04-07 13:34:33 +00:00
Nick Fitzpatrick
e3ba446fbd switch css rule for <FileInput /> component (#56349) 2025-04-07 10:14:50 -03:00
github-automation-metabase
83d3bc708d Bump cider/cider-nrepl from 0.53.2 to 0.54.0 (#56351)
Inspect dependency changes here: https://github.com/clojure-emacs/cider-nrepl/blob/v0.54.0/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-04-07 15:28:28 +03:00
lbrdnk
56aaaa96d7 Invalidate card's cache on PUT (#56365)
* Invalidate card cache on put

* Add test
2025-04-07 14:16:29 +02:00
Kamil Mielnik
3196d30a33 Fix - Field order sidesheet loading state breaks metadata page layout (#56369)
* Revert "Revert "Prevent CLS""

This reverts commit 043ea8a9e7.

* Add loading and error handling

* Add tests

* Refactor

* Rename tests

* Add issue tags
2025-04-07 18:42:56 +07:00
Anton Kulyk
146c4dd8df Fix goal line doesn't appear on a normalized stacked bar chart (#56298)
* Normalize goal line value

* Add visual test
2025-04-07 11:41:40 +01:00
Kamil Mielnik
117785089c SEM-220 Show the data type above the Field Type dropdown (#56289)
* Make it work

* Use Mantine

* Update tests

* Display db type instead of mbql type

* Show db type instead of semantic type

* Revert "Show db type instead of semantic type"

This reverts commit 5a51c5abca.

* Update tests

* Prevent CLS

* Revert change

* Revert "Prevent CLS"

This reverts commit f74b6e80af.
2025-04-07 10:10:54 +00:00
Kamil Mielnik
216212b27a SEM-156 Extract column sorting into a separate control (#56060)
* SEM-156 Extract column sorting into a separate control (#55696)

* Add new 'Table settings' button
- remove unused CSS classes

* Add 'Edit column order' button

* Update sort_arrows icon

* Update header

* Update header

* Remove global CSS classes from MetadataHeader

* Prevent button from shrinking

* Styling

* Drop inline styles from MetadataHeader

* Add FieldOrderSidesheet & FieldOrderDropdown boilerplate

* Connect FieldOrderDropdown

* Make the sort_arrows icon math-perfect

* Sort attributes

* Lift state

* Use Select instead of Menu

* Rename FieldOrderDropdown to FieldOrderPicker

* Sort props

* Avoid using t in top level context

* Fix outline being cut off

* Add onUpdateFieldOrder prop

* Drop connect usage

* Add SortableField boilerplate

* Add inner components

* Handle disabled drag

* Remove copypasta

* Styling

* Icons

* Remove comment

* Fix dnd

* Remove redundant key prop

* useDragOverlay

* Prevent flicker

* Remove old sort button

* Keep sidesheet in sync when closed

* Drop SortableColumn

* Remove SortableList from MetadataTableColumnList

* Improve spacing

* Simplify SortableField interface

* Fix state issues

* Update unit tests

* Update unit tests

* Make focus state match border radius of the content

* Add comment

* Update e2e tests

* Remove comment

* Use useDisclosure

* Add a comment

* Reduce sorting complexity

* Rename

* Simplify logic
2025-04-07 14:47:30 +07:00
Noah Moss
f231f3b519 Disable indefinite vertical panning on leaflet maps, and enable smooth horizontal wrapping (#56329) 2025-04-04 23:34:34 -04:00
Tyler Plude
4126202645 Hide trend line widget when multiple series present (#54107)
* Hide trend line widget when multiple series present

* Adding unit test for trend line hidden state

* Prettier
2025-04-04 17:32:59 -07:00
Tyler Plude
d8705ab9b9 Fixing typo in embed type ui (#56116) 2025-04-04 16:25:36 -07:00
Aleksandr Lesnenko
88ce89e065 fix bar width on non-linear x-axis scales (#56265) 2025-04-04 22:05:04 +00:00
Oleksandr Yakushev
6e957d4ab7 perf: Optimize available-drivers-info (#55970) 2025-04-05 01:02:06 +03:00
bryan
c9d926e018 Do not enforce table cruftiness during updates (#56312)
* do not enforce table cruftiness during updates

- matches original behavior

* add test
2025-04-04 14:25:30 -06:00
Nemanja Glumac
d186e5d0e8 Empty states for visualizations (#55706)
This commit introduces empty states for visualizations 
in order to help less experienced users create their first chart. 

These new empty states come in two flavors:
1. With a "Summarize" button CTA that will open the summarize sidebar
2. With a link to our helpful documentation (for more complex charts)

We have been previously relying on the `placeholderSeries` dummy data to display a greyed out chart preview when we cannot render a chart. That functionality is now replaced with a new property called `hasEmptyState`.

`checkRenderable()` util will try to render a chart based on the series and settings. If it is unable to do so, it will throw a `ChartSettingsError`. This, in combination with hasEmptyState and a few other properties, is a cue to render a new, empty state for that visualization.
2025-04-04 21:34:37 +02:00
Case Nelson
304da4aba7 Revert "fix: properly test snowflake ssh connection details" (#56315)
This reverts commit 0fc5cbe7dc.
2025-04-04 13:14:06 -06:00
Luis Paolini
9e10b9c131 Add note about allowtcpforwarding (#56320) 2025-04-04 19:11:12 +00:00
Raphael Krut-Landau
a65865fce2 Test that sandboxing fails closed when misconfigured (#56110) 2025-04-04 15:04:58 -04:00
Aleksandr Lesnenko
3a93e08dbe skip loki flaky table test (#56305)
* skip loki flaky table test

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-04-04 18:27:41 +00:00
Riley Thompson
921e0a4ffc Replace - with _ in Mongo join aliases (#56185) 2025-04-04 18:18:09 +00:00
appleby
3c40ebd387 Expression literals milestone 2 (#56254)
* Initial BE changes for custom expression literals (#55206)

* Empty

* Add `value` support in the expression editor (#55203)

* Literals in filters tests (#55283)

* E2E tests for literals in custom columns (#55288)

* BE changes for :value wrapped expression literals

* Extend BE test with more literal values

* Add float value to qp test for expression literals

* Add Float and Boolean cases to literal-expression-test

* Remove ^:internal from value clause

:value clauses are now generated by the frontend when creating a top-level expression literal and preserved when
converting legacy <-> pMBQL.

* Add some lib.convert tests for literal custom expressions

* Add legacy schema tests for literal custom expressions

* Add normalize / canonicalize tests for literal custom expressions

* Remove vestigial "date" expression from fields clause in query-with-literal-custom-expression-test

* Fix literal-expression-test for cljs

CLJS parses 1.00 as 1 and hence :type/Integer not :type/Float

* Fix js_test expression-clause-<->-legacy-expression-test for wrapped literals

* Move QP tests into expressions_test.clj and add more tests

* Remove commented out :value and update comment in stage-expressions->legacy-MBQL

* Restrict QP literal expressison tests to supported drivers

* Update boolish->bool to accept BigDecimal inputs

Apparently some DBs return BigDecimal results for boolean expressions.

* Temporarily remove literal-expression-case-test

Needs more debugging

* Move aggregations tests into expression_aggregations_test.clj

* Add some basic filter tests to QP expressions_test.clj

* E2E tests for literal custom columns in other clauses and fixes (#55295)

* E2E tests for literal custom columns in other clauses and fixes (#55295)

* Move changes from the FE branch

* Move changes from the FE branch

* Move changes from the FE branch

* Fix filter schema and false = false filter (#55417)

* Fix date/string literals effective type (#55427)

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix malformed order-by clauses

* Remove tests for offset expressions as non-aggregation expressions

These tests were initially added in #42302, but we disabled offset in custom columns in #43224.

Remove these tests so we can re-enabled nest-expressions when expressions appear in an order-by clause.

https://metaboat.slack.com/archives/C0645JP1W81/p1742317450874479

* Add order-by to the list of places to check in should-nest-expressions?

This is to support order-by of custom expressions, in particular literal custom expressions.

https://metaboat.slack.com/archives/C0645JP1W81/p1742317450874479

* Rename round-trip-expression-literal-test and move it next to existing literal tests in the same file

* Uncomment filter-literal-boolean-expression-with-no-operator-test

The schema was relaxed in bd82763beb, so now the test passes.

* Uncomment filter-literal-expression-with-and-or-test

* Add round-trip-filter-expression-test

* Add more cases to legacy schema filter-test

* Remove unused import

* Review feedback: set/difference -> disj

* Add :expression-literals driver feature (#55662)

* Add the :expression-literals database feature

And enabled it for postgres, mysql, bigquery, and snowflake.

These are the tier 1 and tier 2 DBs, minus redshift which is currently failing some tests.

* Add lib.metadata/database-supports? helper

* Check if :expression-literals feature is enabled in diagnose-expression

* Use standard-literal-expression-values in order-by test expectation

* Add comment about compiler warning to boolish->bool

* Add breakout-by-literal-expression-test

* Add expression-literals-test to nested-queries-test

* Add compound expressions involving literal custom columns to e2e filters tests

* Use lib.schema.common/is-clause? to detect :value expr in diagnose-expression

* Review feedback: fix order-by-integer-literal-expression-test

* Review feedback: conj -> vector

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>

* Add explicit CAST when compiling string literal expressions in H2 driver (#55920)

* Add explicit CAST when compiling string literal expressions in H2 driver

Closes QUE-726

* Add e2e test for nested question with literal custom columns

* Add :expression-literals feature to various mock providers used in tests

* Update diagnose-expression tests

* Ensure legacy :value options are normalized in mbql.normalize

Values coming from the FE in expression-clause-for-legacy-expression call normalize and expect to have :value options
converted from strings to keywords.

* Add base_type to value literals in adjustTopLevelLiteral

* Consistent spelling of base_type

* Use lib.metadata/database-supports? to check for database :features (#56114)

* Use lib.metadata/database-supports? to check for database :features

Closes QUE-836

* Convert a couple more tests to use meta/updated-metadata-provider

* Add e2e test to ensure that sandboxing on literal custom column fails closed (#56190)

* Add e2e test to ensure that sandboxing on literal custom column fails closed

Closes QUE-844

* Review feedback: dedup CustomColumnType definition

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-04-04 11:02:06 -07:00
bryan
260a02887e Mage jar download finds latest major version (#56309)
* scrape releases page to find latest major version

e.g.:

```
$./bin/mage jar-download 50
Warning: JARS not found in env.
Looking for latest version of 50 on release page 1
Downloading from: https://downloads.metabase.com/enterprise/v1.50.35/metabase.jar
              to: /Users/bcm/dv/mb/metabase/jars/metabase_1.50.35.jar ...
Downloaded 1.50.35.jar to /Users/bcm/dv/mb/metabase/jars
```

* better feedback
2025-04-04 12:00:43 -06:00
Sébastien
c03a20dae7 Closes VIZ-588 wrong hover index (#55910)
* closes VIZ-588 wrong hover index

* test

* type
2025-04-04 17:54:34 +02:00
github-actions[bot]
9a521649a3 Update translations 2025-04-01 (#56045)
* Update translation sources 2025-04-01

* Update translations

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-04-04 15:21:36 +00:00
Kamil Mielnik
89153b5504 SEM-210 Show database and table of each segment in the segment admin list (#56151)
* Make segment name clickable

* Upadte e2e test

* Convert SegmentItem to TS

* Modernize SegmentItem

* Add cells

* Add TableBreadcrumbs component

* Use TableBreadcrumbs in SegmentEditor

* Use real data

* Improve data handling

* Handle ellispis

* Add tests

* Add test for no schema

* Rename

* Prettier

* Update icon color

* Fix icon shrinking

* Use TableBreadcrumbs in SegmentItem

* Fix icon shrinking

* Update max width

* Update tests

* Sort

* Remove css file
2025-04-04 14:51:06 +00:00
Eric Normand
c4749ad880 Implement text() and date() on bigquery (#56180) 2025-04-04 14:33:22 +00:00
Eric Normand
dcaeb12485 Implement text() and date() on mysql (#56177) 2025-04-04 14:31:31 +00:00
Eric Normand
c1ae2a738a text() and date() on snowflake (#56178) 2025-04-04 14:31:07 +00:00
Kamil Mielnik
eec2e8034a SEM-211 Show database name for the segment's table in the editing screen (#56213)
* Add TableBreadcrumbs component

* Use TableBreadcrumbs in SegmentEditor

* Use real data

* Improve data handling

* Handle ellispis

* Add tests

* Add test for no schema

* Rename

* Prettier

* Update icon color

* Fix icon shrinking

* Remove css file
2025-04-04 14:13:21 +00:00
Uladzimir Havenchyk
18f5b5282b test: scroll in the virtual table (#56269)
* test: scroll in the virtual table

* fix linting issues

* revert assert back
2025-04-04 14:02:03 +00:00
Jeff Bruemmer
e8ba2da551 drop leading equals operator (#56294) 2025-04-04 09:53:06 -04:00
Jeff Bruemmer
631bb25266 add metabase logo (#56292) 2025-04-04 13:40:44 +00:00
Mahatthana (Kelvin) Nomsawadi
8aa1b56dc6 Deploy SDK with Metabot (#56282) 2025-04-04 14:36:46 +01:00
Kamil Mielnik
d1ce4b64a2 Fix product screenshot link in README (#56268) 2025-04-04 19:48:35 +07:00
Uladzimir Havenchyk
29c361e150 test: wait for data in a flaky test (#56248)
* test: wait for data in a flaky test

* one more check

* set smaller viewport

* add wait

* add a helper
2025-04-04 19:45:16 +07:00
github-automation-metabase
a8463d2a47 Update Readme version references and published npm version to 0.55.1-nightly (#56277) 2025-04-04 12:28:45 +00:00
Mahatthana (Kelvin) Nomsawadi
a54b7ed035 Fix wrong default cell background color on SDK (#55669) 2025-04-04 12:24:56 +01:00
Phoomparin Mano
2725e33502 ci(sdk): set the nightly version in master to 55 (#56273) 2025-04-04 18:23:28 +07:00
Phoomparin Mano
8a8e0c6e5b Enable PDF and card result downloads individually in static and public embedding (#56131)
* scaffold setting up individual downloads

* use downloadsEnabled as boolean for result downloads

* allow SDK to use a single withDownloads props for compatibility

* sdk static dashboard should continue to support single withDownloads prop

* update downloads prop to be string compatible

* fix the areDownloadsEnabled matcher

* refactor download plugin matcher

* do not modify EmbedDisplayParams for now

* fix misleading types

* remove ConnectedDashboard default

* undo LookAndFeelSettings

* revert embed flow and analytics changes

* add test cases for public resource downloads

* add test cases for public question download

* do not support PDF downloads on questions

* remove redundant showDashboardCardActions

* create types for download results

* rename cardResult to dashcard

* replace cardResult with dashcard

* add downloadsEnabled to storybook

* update unit test for areDownloadsEnabled

* update unit test for no-token case

* update unit test for oss case

* try to disable downloads in storybook

* update story defaults

* make downloadsEnabled a component default

* add default to downloadsEnabled in PublicOrEmbeddedDashboardView for loki

* revert changes as loki diffs seems good now

* fix loki diff issue in stories
2025-04-04 17:24:21 +07:00
Aleksandr Lesnenko
1d819fac28 skip tooltip loki specs (#56250) 2025-04-03 23:10:40 +00:00
Oreon Lothamer
4b6ed446b2 add additional fields to payload for create-release-issues (#55956) 2025-04-03 09:44:31 -10:00
Eric Normand
ce99b5c4f5 Integration branch for generalizing cast tests (#55952)
* Empty

* Date generalized tests (#55953)

* Centralize and generalize tests for `integer()`

Also make room for other casting functions to be similarly tested

* Remove unsued imports

* Move postgres date cast test into cast_test.clj

* Rename :cast to :expressions/date

* Remove old imports

* Remove unused features

* Remove more!

* Fix test files

* Centralize and generalize tests for `integer()` (#55950)

* Centralize and generalize tests for `integer()`

Also make room for other casting functions to be similarly tested

* Remove unsued imports

* Example tests for integer()

* Remove empty line

* Use field type

* Appease the Kondo

* Check for Number instead of Integer

* Cast to big-integer before comparing (for snowflake)

* Remove split-part-test. It doesn't belong in this branch.

* Rename :cast to :expressions/integer

* Fix parens after merge

* Unified text() tests

* Appease the kondo

* Appease the whitespace demons

* Oops, wasn't filtering for drivers

* Use literal string for redshift
2025-04-03 13:16:15 -05:00
Nathan Voxland
0eff2ec6de Support for individual google sheets (#54938)
Co-authored-by: bryan <bryan.maass@gmail.com>
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-04-03 12:52:58 -05:00
Jeff Bruemmer
832be65250 docs - various changes (#56230)
* path

* add firebolt driver

* remove api description
2025-04-03 17:50:41 +00:00
Phoomparin Mano
c5d31e8ba2 fix(sdk): fix dataset endpoint being called on every re-render (#56100)
* fix missing useMemo in ad-hoc question

* add a test case for EMB-288

* fix test case for interactive dashboard
2025-04-03 23:43:36 +07:00
Uladzimir Havenchyk
5546d00759 test: use dynamic data for referencing columns and tables instead of static (#56139) 2025-04-03 14:31:51 +00:00
Raphael Krut-Landau
d02f98c519 (mini-PR) Localize string in sidesheet (#56221)
Let's localize the string "Learn more" in the question info sidesheet
2025-04-03 10:26:07 -04:00
Edward Paget
23ffd1ce0a fix: make saml issuer identity required in FE (#56154) 2025-04-03 09:08:46 -05:00
Timofey Kachalov
1bb78814cf feat(sdk): Use dts rollup to generate a single .d.ts file with types (#56205) 2025-04-03 17:47:56 +04:00
Kamil Mielnik
103a64f3ad Fix - When DB is stuck in a Sync Loop, DB List in Native Editor Blinks Constantly (#55995)
* Add a repro for #55951

* Fix typos

* Refactor repro

* Fix #55951

* Remove unused components

* Use 'loading'

* Format code

* Fix test setup

* Rename isLoading back to isSearchLoading since it indicates Search.loadList usage

* Use 1 /search API call instead of 2

* Get rid of rawData

* Update unit tests
2025-04-03 20:27:21 +07:00
dpsutton
45c30a4676 Changelog for api/card/:card-id/query/export-format (#56189)
Examples in 52:
-----

```
52:

WORKS (form data)
curl 'http://localhost:3002/api/card/119/query/csv' \
  -H "x-api-key: $KEY_52" \
  -H 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8' \
  --data-raw 'parameters=%5B%7B%22id%22%3A%227c1e5d79-453a-490e-a507-ffba548aa071%22%2C%22type%22%3A%22id%22%2C%22value%22%3A%5B%225%22%5D%2C%22target%22%3A%5B%22dimension%22%2C%5B%22template-tag%22%2C%22param%22%5D%5D%7D%5D&format_rows=true&pivot_results=false'

WORKS (query param)
curl 'http://localhost:3002/api/card/119/query/csv?parameters=%5B%7B%22id%22%3A%227c1e5d79-453a-490e-a507-ffba548aa071%22%2C%22type%22%3A%22id%22%2C%22value%22%3A%5B%225%22%5D%2C%22target%22%3A%5B%22dimension%22%2C%5B%22template-tag%22%2C%22param%22%5D%5D%7D%5D&format_rows=true&pivot_results=false' \
  -X POST \
  -H "x-api-key: $KEY_52"

DOES NOT WORK (json body)
curl 'http://localhost:3002/api/card/119/query/csv' \
  -H "x-api-key: $KEY_52" \
  -H 'Content-Type: application/json' \
  --data-raw '{"parameters": [{"id":"7c1e5d79-453a-490e-a507-ffba548aa071","type":"id","value":["5"],"target":["dimension",["template-tag","param"]]}], "format_rows": true}'
```

Examples for 53:
---------
```
53:
WORKS
curl 'http://localhost:3003/api/card/113/query/csv' \
  -H 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8' \
  -H "x-api-key: $KEY_53" \
  --data-raw 'parameters=%5B%7B%22id%22%3A%229971a99a-32cb-4b6c-8339-584884e3b3e2%22%2C%22type%22%3A%22id%22%2C%22value%22%3A%5B%225%22%5D%2C%22target%22%3A%5B%22dimension%22%2C%5B%22template-tag%22%2C%22param%22%5D%5D%7D%5D&format_rows=true&pivot_results=false'

WORKS:
curl 'http://localhost:3003/api/card/113/query/csv' \
  -H "x-api-key: $KEY_53" \
  -H 'Content-Type: application/json' \
  --data-raw '{"parameters": [{"id":"9971a99a-32cb-4b6c-8339-584884e3b3e2","type":"id","value":["5"],"target":["dimension",["template-tag","param"]]}], "format_rows": true}'

DOES NOT WORK
curl 'http://localhost:3003/api/card/113/query/csv?parameters=%5B%7B%22id%22%3A%229971a99a-32cb-4b6c-8339-584884e3b3e2%22%2C%22type%22%3A%22id%22%2C%22value%22%3A%5B%225%22%5D%2C%22target%22%3A%5B%22dimension%22%2C%5B%22template-tag%22%2C%22param%22%5D%5D%7D%5D&format_rows=true&pivot_results=false' \
  -X POST \
  -H "x-api-key: $KEY_53"
```
2025-04-03 08:25:21 -05:00
Oisin Coveney
6d7ae96779 fix(sdk): Add questionProps to dashboard components (#55993) 2025-04-03 16:23:31 +03:00
Romeo Van Snick
4187e57c4a Multi line help text (#56155)
* Allow detecting enclosing function in multiline expressions

* Add repro for metabase#56152
2025-04-03 15:07:10 +02:00
Alex Yarosh
8bd3844525 update api and anv var docs (#56198) 2025-04-03 08:48:49 -04:00
Kamil Mielnik
bff123bb45 SEM-212 Allow clicking on the Segment's name to navigate to its edit screen (#56146)
* Make segment name clickable

* Upadte e2e test
2025-04-03 15:18:11 +07:00
Chris Truter
b63e596d37 Revert search engine default to in-place (#56199) 2025-04-03 06:08:59 +00:00
Edward Paget
2600de0663 fix: deadlock in last used at (#56173)
* fix: deadlock in last used at

This prevents bulk updates to last used at from deadlocking by creating
a new table in metabase's database that can be used by instances to take
cluster wide locks. It adds an initial implementation of a customizeable
db-based locking mechanism.

For the last_used_at update, a metabase instance will first set a
session variable to control locking timesout then take a cluster lock
using SELECT * FROM metabase_cluster_lock WHERE lock_name = 'name' then
execute the update_at.

If another table is holding this lock metabase will wait .5s for the
lock to be released then timeout its SQL transaction, sleep the Thread
for 1s then retry taking the lock. This makes sure we're not holding DB
connections waiting for locks.

* fixup! kondo

* Update resources/migrations/001_update_migrations.yaml

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

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

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

* fixup! finish method rename

---------

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-04-02 20:47:20 -05:00
Riley Thompson
5f7b7cb812 Fix MySQL JSON decimals (#56102) 2025-04-03 00:17:04 +00:00
Tyler Plude
e04d00c264 Fix formatter support for field id or name col settings (#55067)
* Fix formatter support for when both field ids and col names are used in viz settings

* Apply fix in qp common as well, which date formatter consumes

* Addressing PR feedback and breaking up large test

* Fixing or->merge reversion; adding datetime formatter tests

* Improving viz setting merges based on types of field_ref and column setting keys

* Addressing PR feedback
2025-04-02 14:48:52 -07:00
Jeff Bruemmer
d2bcabb33c docs - remove partner drivers (#56184) 2025-04-02 21:35:17 +00:00
Eric Normand
e1c7441569 Unified tests for splitPart() (#55941)
* Unified tests for `splitPart()`

* Remove postgres specific split-part-test

* Remove Redshift split-part-test

* Remove snowflake split-part-test

* Remove mysql split-part-test

* Remove bigquery-specific split-part test

* Fix MySQL implementation of splitPart()

* Only allow string literals for 2nd and 3rd args of replace()

* Only allow non-empty string for delimiter of splitPart()

* Better non-blank string

* Make position in splitPart() positive literal or numeric expression

* WIP new examples tests + corner cases

* Oops, go back to non-empty string

* Improve tests

* Improve test message

* Empty string on non-positive position in splitPart() for mysql and postgre

* Fix Redshift error

* Snowflake: return empty string with non-positive position

* Also test zero position

* Correct misplaced paren

* Fix `splitPart()` for snowflake

* Nicer comment on weird mysql implementation

* Rename positive-integer schema

* Clearer parameter comments
2025-04-02 21:01:55 +00:00
eliotmetabase
8ff8ed3494 Change decimal field for Number question to only accept positive integers and update E2E test to cover edge cases (#56112) 2025-04-02 13:03:47 -07:00
Oleksandr Yakushev
f0ba0e628a perf: Optimize settings retrieval (#55969) 2025-04-02 22:52:57 +03:00
bryan
8d5baa6a73 dont skip mage tests when BE job is skipped (#56170)
* dont skip mage tests when BE job is skipped

* checkout metabase for mage tests

* make mage tests its own thing

* add mage test workflow

* if it aint broke dont fix it

* remove dupe mage test from backend workflow
2025-04-02 19:50:37 +00:00
Jeff Bruemmer
dbefc5643a docs - table viz updates (#56162)
* paginate table on dashcards
2025-04-02 15:03:08 -04:00
Eric Normand
d1a4eb463e Rename :cast in tier 2 databases (#56158)
* Empty

* Rename :cast in tier 2 databases
2025-04-02 13:23:36 -05:00
Case Nelson
273ecb3b63 fix: attempt #2 to skip adding non-existent partner jars (#56171) 2025-04-02 11:49:45 -06:00
Edward Paget
bc2c0b2fa7 fix: correct setting name check for static stats (#56145)
* fix: correct setting name check for static stats

also fix namespace for the defenterprise in token check to load the
embedding stats module

* fixup! use get-raw-value

* fixup! use-get-value-of-type
2025-04-02 17:37:54 +00:00
Case Nelson
3f6b4e3938 fix: ee-build should skip adding jars when there are none (#56166) 2025-04-02 11:18:44 -06:00
Eric Normand
e2ae5b91a8 Split :cast into three features (#56153)
* Split :cast into three features

* Update frontend feature names

* Update changelog

* PoC

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-04-02 17:01:19 +00:00
Jeff Bruemmer
073300b47e docs - mention config file on api keys page (#56150) 2025-04-02 12:45:37 -04:00
Riley Thompson
74b62202b9 Make mongo between condition inclusive (#56087) 2025-04-02 12:13:44 -04:00
Noah Moss
f07d1810ea Remove opacity from viz settings gear icon (#56143)
* remove opacity from view button icon

* remove reference to ViewButtonIcon CSS module
2025-04-02 11:28:01 -04:00
Braden Shepherdson
9cd41f0b6f Fix chain filters on public dashboards (#56096)
Fixes [QUE-838](https://linear.app/metabase/issue/QUE-838/linked-filters-are-not-working-on-public-dashboards).

Query params were getting parsed incorrectly to a map like `{:17fdc812 ...}`
with a keyword rather than a string. These failed to match any of the
dashboard's parameters (which are keyed by strings like `"17fdc812"`)
and returned no values (but did not throw any errors in prod).
2025-04-02 13:12:00 +00:00
Kamil Mielnik
acacf330ec Fix - Visibility explanation copy is the same across all 3 options (#56081)
* Fix #56077

* Repro #56077
2025-04-02 19:06:10 +07:00
Mahatthana (Kelvin) Nomsawadi
a9a62e5b82 Fix storybook not working with MetabotQuestion (#56127) 2025-04-02 12:47:43 +01:00
Alexander Solovyov
1020b3dcee fix testing and CDPATH issues with mage (#56125)
also make script code a bit simpler with early breaks
2025-04-02 13:40:45 +03:00
Ngoc Khuat
339b7d1dd4 Flaky test fix: unsubscribe-receive-email-test (#56123) 2025-04-02 09:26:37 +00:00
lbrdnk
e0e833aa52 Add String->Float coercion strategy (#55863)
* Implement string to decimal coercion

* Use float coercion

* Add coercion to mongo

* Use float8

* Update dataset def

* Update coercion to float

* Temp dynamic-dataset-loading

* Comment

* Use ->float multimethod

* Rename dataset

* Enable test for dbs with preloaded datasets
2025-04-02 11:13:32 +02:00
Ngoc Khuat
0dc44b4551 Add job context for all quartz jobs (#55889) 2025-04-02 03:44:47 +00:00
Ryan Laurie
8ef81c9a91 revert #56007 (#56111) 2025-04-01 16:11:44 -06:00
Uladzimir Havenchyk
641e170996 test: add native query test to flaky group (#56093) 2025-04-01 21:01:08 +00:00
John Swanson
3f78551385 Add ./bin/mage start-maildev command (#56074)
* Add `./bin/mage start-maildev` command

```
$ ./bin/mage start-maildev
Killing existing `mb-maildev` container...
Running: docker run -d -p 1080:1080 -p 1025:1025 --name mb-maildev maildev/maildev
8b01ba798a18192d02d1fdc3e7874fd03586f91063069db017d44baf30a38c47
Configure Metabase to send emails using localhost:1025
View Maildev UI at http://localhost:1080
```

* Update bb.edn

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

---------

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-04-01 13:12:03 -07:00
Case Nelson
e5ed289651 task: update ee-extra to understand noop from registry (#55934) 2025-04-01 13:59:28 -06:00
Luiz Arakaki
ff42a7c926 Update usage analytics to 54 (#55908)
Closes #55568
Resolve field entity-ids
Adds is_verified to the content model
Adds status to the tasks model
Minor changes to the content
2025-04-01 15:00:38 -03:00
Jeff Bruemmer
94abd0f302 docs - note on caching and permissions (#56034)
* note on caching and permissions

* differentiate caching

* clarify caching

* remove impersonation note
2025-04-01 13:54:14 -04:00
William
a4ee7f4eb7 Bigquery handles nested fields in nested queries appropriately (#56033)
Before, when you had an outer query referring to something in a nested field from the inner query, the query processor
would assume the field is still nested and generate invalid sql.  Now, it will just refer to the alias.
2025-04-01 12:06:54 -05:00
Aleksandr Lesnenko
2aa82343e2 fix scatter charts freeze (#56016) 2025-04-01 11:48:16 -04:00
Nicolò Pretto
ebc59ff5fd ci: run sample app tests and sdk cross version tests on draft prs (#56008) 2025-04-01 15:43:05 +00:00
Uladzimir Havenchyk
90f1364fe2 test: add a fix for flaky test but move to jail anyway (#56071) 2025-04-01 15:29:58 +00:00
Arkadi Yaroslavtsev
bb58f77a79 Add cloud-ops as codeowners of prometheus.clj (#56073)
So that cloud-ops can verify new metrics are sound and usable for cloud o11y. 

See https://www.notion.so/metabase/Implementing-a-Prometheus-metric-for-your-feature-14569354c901804b97a3dfcf2fecfc22?pvs=4#15169354c90180a7a4daf6b43820cdd8
2025-04-01 10:12:43 -04:00
Stas Gavrylov
0f094446f1 WRK-213: Adjust available intervals for 'by the minute' schedule option (#56068) 2025-04-01 16:21:53 +03:00
Ngoc Khuat
a582ad33c4 [Notification] Improve memory usage for alerts (#55896) 2025-04-01 11:29:17 +00:00
Uladzimir Havenchyk
83ebdb8afd test: move flaky test to jail (#56039) 2025-04-01 14:13:20 +03:00
lbrdnk
0eec5c335f Fix coercion for model (#55870)
* Fix coercion for model

* Add test

* Update test
2025-04-01 11:03:25 +02:00
Kamil Mielnik
f541df16f8 Global scrollIntoView & scrollBy mocks (#55983)
* Remove redundant mocks

* Use jest.fn

* Remove scrollIntoViewMock from setup

* Remove mockScrollIntoView

* Remove mockScrollTo and mockScrollBy

* Introduce getScrollIntoViewMock

* Remove remaining scrollIntoView mocks
2025-04-01 08:57:18 +00:00
Sébastien
08a13afd28 Closes VIZ-289 duplicated cards never ending loading state (#55256)
* closes VIZ-289 duplicated cards never ending loading state

* added test
2025-04-01 10:37:44 +02:00
Oisin Coveney
49cec30f3f Fix console.warn message (#56004) 2025-04-01 11:36:27 +03:00
Romeo Van Snick
f6cecc0960 Fix overflow in expression editor suggestions (#55986)
* Fix overflow in custom expression suggestions

* Add repro for #55984

* Use isScrollableHorizontally helper

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

* Use isScrollableHorizontally helper

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

* Don't allow icon to shrink

* Allow suggestion names to break

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-04-01 08:17:25 +00:00
Nemanja Glumac
d9779da94a Respect whitelabeling when showing the instructional video (#55987) 2025-04-01 10:26:49 +03:00
Oisin Coveney
f2b5cf8fcb QueryDownloadPopover -> QuestionDownloadWidget + QueryDownloadWidget -> QuestionDownloadPopover (#55894) 2025-04-01 10:01:28 +03:00
Romeo Van Snick
1e48077705 Merge expression tokenizer and lexer (#55916)
* Move the lexifier to it's own file

* Remove duplicate type union member

* Remove unused typeinferencer

* Add ParseError type to errors

* Lexify straight in to pratt.Token

* Remove unused TOKEN type

* Use pratt.Token type everywhere

* Fix type

* Remove unused __support__/expressions helper file

* Ignore END_OF_INPUT when matching suggestions
2025-04-01 08:33:53 +02:00
Tyler Plude
00527b55c0 Add display-as image support for table static viz (#55388)
* Add display-as image support for table static viz

* Adding table unit test for view-as image setting
2025-03-31 16:42:07 -07:00
Ryan Laurie
f62755dc9b Add Important Info to Pull Requests (#56007) 2025-03-31 16:34:02 -06:00
Uladzimir Havenchyk
1a990b898b test: fix flake caused by popover appearance order (#55989)
* test: fix flake caused by popover appearance order

* put back flaky tag
2025-04-01 00:23:13 +03:00
Uladzimir Havenchyk
0bebb404eb test: fix flake caused by data not loaded on slow network (#55998) 2025-04-01 00:22:30 +03:00
Braden Shepherdson
eef8dd149b [refs] Fixing Audit DB init and audit content export to handle idents (#56032)
Fixes #55929. (Requires a new export for 54 that also gets backported.)

Adds a new setting `install-analytics-database` that skips loading the
database at all, if set to false. That allows the dev instance that
exports the analytics content to have no real audit DB, and therefore to
generate the right `entity_id` hashes for the audit export!

Existing audit DBs are fine; the checksum will see these new entity_ids
in the export and overwrite any existing content.
2025-03-31 21:17:55 +00:00
Alexander Polyankin
b86d92d156 E2E repro for "Custom Expression having a date function between 2 aggregation functions returning dates doesn't work" (#55930) 2025-03-31 19:04:01 +00:00
Alexander Polyankin
a1b5478734 Show a more user-friendly error message when there are incompatible types (#55927) 2025-03-31 18:56:53 +00:00
Eric Normand
edd33406f7 Implement splitPart() for BigQuery (#55918)
* Implement splitPart() for BigQuery

* Always return string instead of null

* Better test failure message

It's running fine on my machine ;)

* Use coalesce instead
2025-03-31 12:46:31 -05:00
Alexander Polyankin
eb303b3596 Fix compilation of case with clauses that need pre-processing (#55958) 2025-03-31 13:40:31 -04:00
Nathan Voxland
13f81f354f Limit tsvector inserts to 1048575 bytes (#55954) 2025-03-31 12:36:19 -05:00
Case Nelson
8135a2f41f fix: Ensure that local timestamps params work (#55931)
* fix: Ensure that local timestamps params work

Fixes #53371

By filtering a timestamp or date column on an OffsetDateTime it results
in an index being missed since the lhs needs to be upcast by the db engine
to a `timestamp with timezone`.

This ensures we only pass OffsetDateTime to `timestamp with timezone`
columns.

Context about decision here:
https://metaboat.slack.com/archives/C0645JP1W81/p1743111964032089

* Handle sending a datetime range rather than just a date

* Feature gate to dynamic dataset loading

* Fix kondo

* Remove comment
2025-03-31 11:35:15 -06:00
Eric Normand
8737a30d70 splitPart() test for Redshift (#55938) 2025-03-31 11:43:14 -05:00
Eric Normand
004ba66176 splitPart() on Snowflake (#55935) 2025-03-31 11:41:12 -05:00
Eric Normand
9fed60a967 splitPart() for MySQL and MariaDB (#55914)
* Remove commented code from postgres test

* Add splitPart() to MySQL
2025-03-31 11:37:39 -05:00
Alex Yarosh
37b8a235ca docs: can't permanently delete collections (#56014)
* Update delete-and-restore.md

* format

* Update delete-and-restore.md

---------

Co-authored-by: jeff bruemmer <jeff.bruemmer@gmail.com>
2025-03-31 12:15:51 -04:00
Jeff Bruemmer
f4eeb43daf scan section in sparksql (#56015) 2025-03-31 15:51:29 +00:00
Romeo Van Snick
c38c533c72 Case-sensitivity arg name vs example disambiguation (#55965)
* Rename caseInsensitive to caseSensitivity

* Use literal string for case-insensitive template

* Update argument description to be more clear

* Support inline expression highlights

* Render help text description with Markdown

* Add more markdown to help text strings

* Use markdown code blocks to mark code in help text descriptions

* Highlight argument references in help text descriptions

* Fix arg alignment

* Fix HelpText unit tests

* Fix FunctionBrowser tests

* Render FunctionBrowser descriptions using Markdown too

* Mark true

* Fix e2e tests

* Fix e2e tests

* Remove commented-out code

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

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-03-31 17:18:02 +02:00
Riley Thompson
1d70e07d79 Fix Snowflake casted date field relative time filters (#55225) 2025-03-31 11:09:01 -04:00
Jeff Bruemmer
a2f38e43de formatting (#56009) 2025-03-31 14:38:44 +00:00
Edward Paget
ba9c2face3 fix: typo in token check stats name (#55999) 2025-03-31 14:13:41 +00:00
Jeff Bruemmer
4da41fc578 docs - add ClickHouse and Starburst to list of supported databases (#56001) 2025-03-31 10:00:44 -04:00
Riley Thompson
e7dda8b9ff Mark Mongo binData as a text like type during sync (#55792) 2025-03-31 09:40:00 -04:00
Aleksandr Lesnenko
babdb67fb5 Fix table row heights with rich content (#55960)
* allow wrapping links

* fix image rendering, add specs

* update wrapping setting validation and visibility
2025-03-31 09:05:22 -04:00
Oisin Coveney
63dadf79d5 docs(sdk): Add docs for dashboard types (#55988)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-31 11:36:52 +00:00
github-automation-metabase
a310eeb305 Bump io.github.clojure/tools.build from 0.10.7 to 0.10.8 (#55973)
Inspect dependency changes here: https://github.com/clojure/tools.build/blob/v0.10.8/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-31 07:18:31 +00:00
github-automation-metabase
c3e042e91e Bump cider/cider-nrepl from 0.53.0 to 0.53.2 (#55971)
Inspect dependency changes here: https://github.com/clojure-emacs/cider-nrepl/blob/v0.53.2/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-31 07:02:19 +00:00
Ngoc Khuat
c5f4bf9fc7 When randomize sync db schemas, avoid at 0th minute marks (#55891) 2025-03-31 06:01:25 +00:00
Alex Yarosh
14f6682637 Update impersonation.md (#55957) 2025-03-30 14:38:37 -04:00
Romeo Van Snick
5f68e7a88c Fix offset example (#55942)
* Apply all passes to examples

* Add format test for offset example

* Make sure all help texts return a string

* Add repro for #55940

* Typo
2025-03-30 10:41:39 +02:00
Uladzimir Havenchyk
2593cf1957 test: add flaky test to a flaky group (#55871) 2025-03-28 17:01:43 -04:00
Alex Yarosh
3ed041bc60 docs: mb_api key docstring (#55924)
* mb_api key docstring

* formatting

* edit

---------

Co-authored-by: jeff bruemmer <jeff.bruemmer@gmail.com>
2025-03-28 16:55:22 -04:00
Aleksandr Lesnenko
d7b1ec1435 disable column reordering on raw query views (#55581) 2025-03-28 20:00:53 +00:00
Aleksandr Lesnenko
f00ca484c8 Table pagination viz settings in dashcards, rows count footer (#55735) 2025-03-28 19:29:03 +00:00
Anton Kulyk
a3ed24fb9c Use clickable styles only for links in detail view (#55903) 2025-03-28 19:13:15 +00:00
Anton Kulyk
50e1b0de63 Don't show dashcard's info tooltip in edit mode (#55905) 2025-03-28 18:29:39 +00:00
Case Nelson
4169b8cc2b fix: properly test snowflake ssh connection details (#55879) 2025-03-28 12:20:12 -06:00
Uladzimir Havenchyk
589c133fac deps: upgrade rspack to 1.3 (#55901) 2025-03-28 17:58:57 +00:00
Eric Normand
676f833a0b Tests for integer() on redshift (#55868)
* Tests for `integer()` on redshift

* Appease the kondo
2025-03-28 12:54:27 -05:00
Ngoc Khuat
329eb07013 Change version for alert api change log from 53 to 54 (#55890) 2025-03-28 18:23:49 +02:00
bryan
be9d37cad2 move mage docs into developer docs (#55915)
- also improve usability of setup-autocomplete test
2025-03-28 16:13:27 +00:00
Aleksandr Lesnenko
9a7704896c prevent text wrapping from being applied to links (#55882) 2025-03-28 15:51:36 +00:00
Noah Moss
22856615ae Auto-categorize truncation units as datetime columns in insights code (#55861)
* Auto-categorize truncation units as datetime columns in insights code

* detect datetime units on the FE as well when rendering trend visualization

* prettier

* add unit test

* typo

* fix comment alignment
2025-03-28 14:55:57 +00:00
Alexander Polyankin
8e5807c8e7 Enable type checking in the expression editor (#55737) 2025-03-28 09:55:26 -04:00
Nick Fitzpatrick
8ca8411c71 force <DefaultLogoIcon /> on welcome page (#55869) 2025-03-28 09:48:46 -03:00
Jeff Bruemmer
305667abed docs - api keys in config file (#55771) 2025-03-28 11:21:29 +00:00
lbrdnk
c421a23bd8 Provide LEVEL_ONE_TYPES to FE (#55766)
* Provide LEVEL_ONE_TYPE to FE

* Apply suggestions from code review

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

---------

Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
2025-03-28 10:25:46 +01:00
Uladzimir Havenchyk
b6e957c05b test: another attempt to fix dashboard flaky test (#55873) 2025-03-28 07:44:57 +03:00
appleby
174508dd10 Update driver-changelog for :cast :distinct-where :split-part features (#55664) 2025-03-27 18:16:15 -07:00
Tyler Plude
67b4bf4cdb Fix bottom margin on query builder view #55876 (#55878) 2025-03-27 17:09:49 -07:00
Tyler Plude
b42e24382a Add new Tanstack table viz settings support to static viz (#55517)
* Initial support for text wrapping in static viz

* Add text-align support

* Add row index support

* Fixing broken unit tests

* Adding new unit test coverage for Tanstack viz settings

* Fixing typo in whitespace; removing debug def

* Removing defs & outdated comment

* Addressing PR feedback

* Adding column width support to minibar columns; improving doc strings

* Adding minibar column width support; improving doc strings; moving consts to style namespace

* Fixing broken unit test after font size change

* Remove trailing whitespace
2025-03-27 16:53:46 -07:00
Uladzimir Havenchyk
a78e2fa04b test: add test to a flaky group (#55867) 2025-03-27 20:56:20 +00:00
Luiz Arakaki
2f40fe4e79 support keys in env vars (#55756)
# Support Environment Variables for API Keys
### Overview
This PR adds support for using environment variables to define API keys in the configuration file, enhancing security and flexibility for deployment environments.
### Changes
- Modified API key validation to support environment variable substitution in the key field
- Added runtime validation for API keys from environment variables to ensure proper formatting
- Refactored tests to properly validate environment variable integration
- All API keys (including those from environment variables) still must follow the required format:
  - Must be between 11-254 characters
  - Must start with mb_
  - Must match the pattern mb_[A-Za-z0-9+/=]+
### Usage
```
api-keys:
  - name: "ENV API Key"
    key: "{{env API_KEY_FROM_ENV}}"
    creator: "admin@example.com"
    group: "admin"
```

### Testing
- Creation of API keys from environment variables
- Validation of API key format from environment variables
- Error handling for improperly formatted environment variable values

# Skip keys if they exist
To guarantee that it is possible to keep the same yaml file on each instance initialization, if there is a key in the instance and the config file has a key with the same name, the creation is skipped.
2025-03-27 20:04:16 +00:00
Tyler Plude
12add5657c Minibar chart support in table static viz (#55736)
* Minibar chart support in table static viz

* Fixing unit test; adding new minibar unit test

* Fixing clj kondo warnings

* Addressing PR feedback

* Removing dead minibar code

* Removing old minibar unit tests
2025-03-27 12:49:39 -07:00
Eric Normand
30b14f3243 integer() for snowflake (#55774)
* Empty

* Implement and test snowflake integer()

* Use card-with-source-metadata-for-query in snowflake tests

* Use lib/functions instead of lib/expression-clause in snowflake
2025-03-27 14:49:22 -05:00
Eric Normand
721736df58 integer() for BigQuery (#55704)
* integer() for BigQuery

* Fix BigQuery tests for integer()

* Change to backticks

* kick ci

* Fix for BigQuery

* Capitalize name of field

* Use STRING type for casting in BigQuery

* Sometimes we get an integer back, and that's okay

* Use mt/card-with-source-metadata-for-query in bigquery tests

* use lib/functions instead of lib/expression-clause in bigquery
2025-03-27 14:48:42 -05:00
Alex Yarosh
34d1b99615 docs: don't forget to use headers in split files (#55856)
* Update uploads.md

* Update docs/databases/uploads.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-27 19:02:13 +00:00
Edward Paget
dade705ce7 feat: add remaining token check stats and settings (#55638)
* feat: add remaining token check stats and settings

Adds the remaining five data points we want to report during the token
check request. Adds a new module to internal stats that does the
embedding counts and setting checks.

* fixup! log stats

* fixup! move enterprise settings into defenterprise

* fixup! remove row count
2025-03-27 13:57:25 -05:00
Edward Paget
5448ab30e4 fix: only remove vis_settings from dashboardcard (#55846)
* fix: only remove vis_settings from dashboardcard

Fixes loading serialized dashboard cards where we would previously
delete and recreate them on each load.

In order to handle circular dependencies caused by links to other
dashboards in a dashboardcard's visualization_settings we were removing
the dashboardcards entirely from the dashboard model to break the cycle.
Later when we traversed back through the dependency path we would load
the original dashboard a second time with the restored dashboardcards.

However, on the load of the cycle breaking change we could entirely drop
dashcards belonging to the dashboard because the serialization code was
treating our cycle breaking changes as an edit to the dashboard to drop those
cards. This meant when we got back to the the second load of the
dashboard we would create the dashcards fresh instead of updating
existing instances.

The fix here is that we only remove the values from the dasboard card
model that can cause the cycle -- in this case just the
visualization_settings column. This seemed the most straightforward fix,
but there are other possibilities here.

One is that we could _just_ preserve the entity_id column in dashcards
which would eliminate the possibility of any other cycles here.

Another option would be to change how we handle nested models in serialization.
There is not really a foreign key dependency here between dashboard A
and dashboard B linked by the dashboard card. If we instead just created
those dashboards first _then_ went back and created their dashcards we
don't have any problems at all. We could move nested models up to the
same level of handling in serialization that we do for models, which
would let us create the dashboards first then create any dashboard cards
in a subsequent step.

* fixup! update docstring
2025-03-27 18:49:48 +00:00
Riley Thompson
25a6329fec Upgrade ClickHouse JDBC driver version to 0.8.2 (#55713) 2025-03-27 14:31:31 -04:00
Alexander Polyankin
53780a436b Use :value for bigint values in queries (#55698) 2025-03-27 18:07:27 +00:00
Braden Shepherdson
4d318a1183 [models] Add card_schema column, for future use in after-select (#55714)
Closes QUE-794 and QUE-705.

This will enable us to *know*, rather than *infer*, what version of
`report_card` we're looking at.

One example: in the near future, I'm going to add some values to
`result_metadata` on cards. If we later discovered a bug in that logic
and could no longer trust those fields written to AppDB in
`result_metadata`, the `card_schema` will tell us with certainty
whether the card was saved with the broken logic (`:card_schema N`)
or the new logic (`:card_schema (+ N k)`).

The upgrade steps could drop the invalid fields and, if desired, infer
the correct ones.

Note that there's nothing here about writing back! This is about
cleaning up old cards during `after-select`.

There are no upgrades yet; the current version is still the default.
2025-03-27 13:47:43 -04:00
Case Nelson
000ea868f5 fix: move classloader to init as soon as possible (#55786) 2025-03-27 11:03:27 -06:00
dpsutton
1a6a9a0916 Bit more logging (#55837)
```
2025-03-27 15:25:21,322 INFO sync.describe-database :: Checking "PUBLIC"."LARGE_NUMBERS"
2025-03-27 15:25:21,757 INFO sync.describe-database :: "PUBLIC"."LARGE_NUMBERS": SELECT privileges confirmed
2025-03-27 15:25:21,759 INFO sync.describe-database :: Checking "PUBLIC"."SINGLE_ROW_TABLE"
2025-03-27 15:25:21,975 INFO sync.describe-database :: "PUBLIC"."SINGLE_ROW_TABLE": SELECT privileges confirmed
2025-03-27 15:25:21,976 INFO sync.describe-database :: Checking "PUBLIC"."SLOW_QUERY_VIEW"
2025-03-27 15:25:22,219 INFO sync.describe-database :: "PUBLIC"."SLOW_QUERY_VIEW": SELECT privileges confirmed
```

This will list all tables it enumerates and then which ones it
removes. There are also two error handling states:

```
2025-03-27 15:29:25,418 INFO sync.describe-database :: "schema"."some_table": SELECT privileges confirmed
2025-03-27 15:29:25,419 INFO sync.describe-database :: "schema"."some_table": Assuming SELECT privileges: caught timeout exception
2025-03-27 15:29:25,419 INFO sync.describe-database :: "schema"."some_table": Assuming no SELECT privileges: caught exception
java.lang.Exception: Some exception
	at metabase.driver.sql_jdbc.sync.describe_database$eval194718.invokeStatic(NO_SOURCE_FILE:33)
	at metabase.driver.sql_jdbc.sync.describe_database$eval194718.invoke(NO_SOURCE_FILE:33)
        [more stacktrace from the exception]
```

This is essentially just changing the log level. We can and perhaps
should change these back to debug or trace in the future but this is
useful for now.
2025-03-27 11:44:52 -05:00
Eric Normand
aa2457d52c integer() for MySQL (#55691)
* WIP Implement `integer()` for all :sql descendants

* Add test-data to tests

* Just do MySQL

* Undo change to query_processor_test

* Remove unused imports

* Remove extra blank line in query_processor

* Convert postgres tests to mysql

* Appease MySQL syntax

* Remove old tests for mysql integer()

* Remove unsupported postgres tests

* Fix kondo

* kick ci

* Fix up for MariaDB

* Fix queries in test

* Try bigger numbers for MariaDB

* Remove ability to cast integer to integer

* Check that boolean = 1 in mysql

* Use mt/card-with-source-metadata-for-query

* Use lib/functions instead of lib/expression-clause

* Use lib/functions instead of lib/expression-clause in postgres

* Use card-with-source-metadata-for-query for postgres tests
2025-03-27 16:38:49 +00:00
Sébastien
471f077083 Closes viz-447 disable text selection when dragging/resizing dashcards (#55528)
* closes viz-447 disable text selection when dragging/resizing dashcards

* eslint

* fixed e2e
2025-03-27 17:21:49 +01:00
Sébastien
4ee67dba0c upgrade @octokit/rest to address ReDos vulnerabilities (metabase#351) (#55828) 2025-03-27 12:15:50 -03:00
Alexander Solovyov
20276982a8 notifications: log skipping reason (#55701) 2025-03-27 17:15:17 +02:00
Riley Thompson
37068e88df Remove stack traces from SQLExceptions (#55765) 2025-03-27 15:02:58 +00:00
Alexander Polyankin
4de6e9f7e2 Ignore parameters targets with stage-number out of range (#55761) 2025-03-27 14:59:15 +00:00
Alexander Solovyov
43292e6a0e config.yml.sample (#55804) 2025-03-27 14:06:44 +02:00
Nicolò Pretto
f5f4dbbc4b make rspack error when the port is already in use (#55803)
* make rspack error when the port is already in use

* adds rspack.config.js to the frontend_sources on file-paths

* use PORT env
2025-03-27 12:48:22 +01:00
Romeo Van Snick
3a865cc16b Update some function names to match modern casing (#55672)
* Update some function names to match modern casing

* Fix test cases

* Update casing in docs for isEmpty, notEmpty, lTrim, rTrim, isNull, and notNull

* Fix isNull and isEmpty casing in tests

* Fix case in unit test

* Fix casing in e2e tests
2025-03-27 11:38:47 +01:00
Kamil Mielnik
5a1d677444 RFC 118. Prettier - arrowParens: “always” (#55807)
* Update .prettierrc
- remove "arrowParens": "avoid" so that it defaults to "always" instead

* Run "yarn prettier"
2025-03-27 09:18:07 +00:00
Mahatthana (Kelvin) Nomsawadi
651894d137 Fix Slack channel couldn't be found when it's behind pagination (#55748)
* Fix couldn't find Slack channel

When the first `conversations.list` doesn't return the Slack channel we
want, we need to continue to paginate until we found it.

* [debug] for testing

* Revert "[debug] for testing"

This reverts commit 67dd2c0405.

* Simplify logic

Co-Authored-By: Timofey Kachalov <timofei@metabase.com>

---------

Co-authored-by: Timofey Kachalov <timofei@metabase.com>
2025-03-27 06:04:40 +00:00
Sébastien
2d86842776 reverts #53898 (#55695) 2025-03-27 06:49:56 +01:00
Luis Paolini
13ec3265ef Add group mappings in keycloak (#55775)
* Add group mappings in keycloak

* Apply suggestions from code review

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-03-27 02:02:26 +00:00
Ryan Laurie
4c29538c1f allow assertion functions (#55772) 2025-03-26 17:15:02 -06:00
Ryan Laurie
930bb87382 Only Show Sync Status to Admin Who Started Gdrive Sync (#55587)
* rename and reorganize

# Conflicts:
#	enterprise/frontend/src/metabase-enterprise/google_drive/GdriveConnectionModal.tsx
#	enterprise/frontend/src/metabase-enterprise/google_drive/GdriveSyncStatus.tsx

* resolve conflicts

* only show sync status to admin who created it

* Add connection info to disconnect modal (#55588)

* rename and reorganize

# Conflicts:
#	enterprise/frontend/src/metabase-enterprise/google_drive/GdriveConnectionModal.tsx
#	enterprise/frontend/src/metabase-enterprise/google_drive/GdriveSyncStatus.tsx

* resolve conflicts

* update disconnect modal

* better spacing
2025-03-26 22:18:32 +00:00
Uladzimir Havenchyk
c5a1cdecc8 test: another fix for dashboard flaky test (#55759)
* test: another fix for dashboard flaky test

* increase timeout
2025-03-26 21:04:07 +00:00
Raphael Krut-Landau
b47569f399 In e2e sandboxing tests, compare two users with different attributes (#55556) 2025-03-26 16:44:49 -04:00
Alex Yarosh
7800b2f488 Update mongodb.md (#55789) 2025-03-26 20:41:06 +00:00
Ryan Laurie
1657085257 Don't load gsheets sync status component for non-admins (#55724)
* don't load gsheets sync status for non-admins

* kick ci
2025-03-26 14:34:14 -06:00
Jeff Bruemmer
aa91ebc7a2 docs - alert updates (#54623)
* update question caching

* update alerts

* remove images

* notifications

* add supported schedules

* edits
2025-03-26 20:21:45 +00:00
lbrdnk
e168a7c35d Adjust jdbc-get-tables and probe query logging (#55658) 2025-03-26 20:51:21 +01:00
Case Nelson
2a1adfeee8 feat: Bring starburst driver in house (#55123)
* feat: Bring starburst driver in house

* Fixing lints and github service

* Fix kondo and reflection warnings

* Fix some tests

* Fixing tests

* Fix database check test

* Fix tests

* Hide impersonation

* Cleanup

* Cleanup kondo override

* Add License

* Update modules/drivers/starburst/test/metabase/test/data/starburst.clj

Co-authored-by: Riley Thompson <riley@metabase.com>

* Update modules/drivers/starburst/test/metabase/test/data/starburst.clj

Co-authored-by: Riley Thompson <riley@metabase.com>

* Update modules/drivers/starburst/test/metabase/test/data/starburst.clj

Co-authored-by: Riley Thompson <riley@metabase.com>

* Address Review comments

* Better exception messages

* Fix source version for metabase

* Fix source test

---------

Co-authored-by: Riley Thompson <riley@metabase.com>
2025-03-26 13:41:00 -06:00
Aleksandr Lesnenko
746d806428 remove outdated snapshots (#55663) 2025-03-26 18:48:52 +00:00
Noah Moss
4b65251933 Translate comparison text for smart scalars on the BE (#55722)
* Translate comparison text for smart scalars on the BE

* lint

* add back space

* refactor
2025-03-26 18:30:45 +00:00
Edward Paget
b227d94cdc feat: use semi-join for collection permissions (#55727)
Improve the performance of the collection permission query by using a
semi-join instead of an inner join to the permission tables. This
ensures each collection only needs to be tested once for a route that
gives a user permission to access it rather than multiple times.

This reduces the query time for users that are members of lots of
collections since we dont need postgresql to create large join tables or
return the same collection id more than once from this query.
2025-03-26 12:53:41 -05:00
Alexander Polyankin
b29ae5d7f9 Migrate useUserListQuery to RTK (#55721) 2025-03-26 16:16:26 +00:00
Raphael Krut-Landau
6bde1d3b4a Add e2e test for sandboxing multistage questions (#55565) 2025-03-26 12:11:52 -04:00
Alexander Polyankin
7549ce42f9 Migrate EditUserModal to RTK (#55719) 2025-03-26 15:07:40 +00:00
Riley Thompson
a391b89276 Remove JS from mongo queries (#55499) 2025-03-26 10:39:19 -04:00
Ngoc Khuat
f50b9fc2bc [Notification] more 🪵 (#55751) 2025-03-26 13:03:15 +00:00
Uladzimir Havenchyk
07263fff52 test: make dashboard flaky test more robust and stable (#55715)
* test: make dashboard flaky test more robust and stable

* revert flaky

* add additional check

* fix that works locally

* revert prev version

* add missing line
2025-03-26 15:03:18 +03:00
Romeo Van Snick
396fa05998 Operator prefix suggestions (#55697)
* Match functions even when the current token is an identifier

* Add repro for metabase#55686

* Use existing function in test
2025-03-26 10:16:52 +01:00
Ngoc Khuat
7772e1ae37 Log context (#55746) 2025-03-26 08:51:36 +00:00
Kamil Mielnik
a5343da112 SEM-176 Use new semantic type picker everywhere (#55539)
* Add baseType prop to SemanticTypePicker

* Update unit tests

* Fix legacy v1/ Field['base_type'] typing, to make it same as Field['base_type'] from api/

* Use isa

* Add a hack for numerical types

* Fix typo

* Pass field

* Reuse type

* Use effective type

* First pass on the tech doc

* Handle booleans

* Use isa

* Refactor

* Update test

* Update test

* Assume no type can have 2 level-one ancestors

* Add comments

* Extract getCompatibleSemanticTypes

* Refactor isDeprecated

* Refactor

* Add fieldId param

* Add test for booleans

* Make initialValue required

* Do not assume a field cannot have multiple level-one ancestors
- these types have 2 level-one ancestors: type/JSON, type/XML, type/DruidJSON, type/OracleCLOB

* Extract FIELDS

* Add test

* Test Entity Name

* Remove '

* Add test

* Update test

* Add test for base_type fallback

* Update comment

* Refactor tests

* Add Field containing JSON tests

* Refactor

* Add a comment

* Improve naming

* Improve naming

* Use SemanticTypePicker in DatasetFieldMetadataSidebar

* Use Field from types/api

* Extract DatasetFieldMetadataSemanticTypePicker

* Fix typing

* Pass label, tabIndex, and onKeyDown

* Remove old picker

* Use SemanticTypePicker in FieldTypeDetail

* Remove unused prop

* Remove redundant margin

* Fix #55617

* Use SemanticTypePicker in Field

* Remove old SemanticTypePicker

* Reuse FkTargetPicker

* Introduce new top-level frontend directory: frontend/src/metabase/metadata
- Move semantic type picker + subcomponents in there

* Add readme

* Get rid of global CSS classes

* Remove old FKTargetPicker component

* Pass databaseId to components

* Don't check for text-like fields

* Merge branch 'SEM-97-limit-semantic-types' into SEM-176-new-semantic-type-picker-everywhere

* Update test

* Update tests

* Sort options by label

* Update test

* Fix docs links

* Change reproductions suite to TypeScript

* Repro #55618

* Repro #55617

* Make sure combobox flips if there is no space underneath
2025-03-26 14:42:17 +07:00
Romeo Van Snick
60988ea706 Add Expressionable type (#55683)
* Add Expressionable

* Accept Lib.Expressionable in expression editor

* Remove type casts in AggregationPicker and FilterPicker
2025-03-26 08:40:01 +01:00
Mahatthana (Kelvin) Nomsawadi
20facf4b69 ci(sdk): make 54 the latest in release workflow (#55741) 2025-03-26 13:14:19 +07:00
Edward Paget
6aa3663a64 fix: add index to field_usage query_execution_id (#55712)
* fix: add index to field_usage query_execution_id

Supports faster deletes on the query_execution table. Without this index
deleting rows from that table leads to a seq scan on the field usage
table for each row deleted to handle the ON DELETE CASCADE trigger.

* fixup! drop empty preconditions
2025-03-26 01:04:21 +00:00
Fraser
f7d4c635e1 Encode settings key in url (#55734) 2025-03-26 13:44:55 +13:00
github-automation-metabase
47278fdcf6 Bump com.google.cloud/google-cloud-bigquery from 2.48.0 to 2.49.0 (#55606)
Inspect dependency changes here: https://github.com/googleapis/java-bigquery/blob/v2.49.0/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-25 23:23:10 +00:00
github-automation-metabase
15c65e7ad3 Bump io.github.tonsky/clj-reload from 0.9.0 to 0.9.4 (#55600)
Inspect dependency changes here: https://github.com/tonsky/clj-reload/blob/0.9.4/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-25 23:22:57 +00:00
github-automation-metabase
a00bff5b0f Bump com.microsoft.sqlserver/mssql-jdbc from 12.9.0.jre11-preview to 12.10.0.jre11 (#55609)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-25 23:22:45 +00:00
Ryan Laurie
f39269dffd Less noise and more emojis in release channel (#55705)
* less noise and more emojis in release channel

* remove variable
2025-03-25 21:47:20 +00:00
Alexander Polyankin
df239d0174 Migrate UserSuccessModal to RTK (#55716) 2025-03-25 14:56:33 -04:00
Edward Paget
b3dfcd4a88 fix: reset connection pool after app-db tz change (#55567) 2025-03-25 12:48:36 -05:00
github-automation-metabase
20bfdbb4bc Bump com.google.guava/guava from 33.4.0-jre to 33.4.5-jre (#55599)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-25 17:18:52 +00:00
Uladzimir Havenchyk
df11338cfb test: make scrollable echarts tooltip stable (#55699)
* test: make scrollable echarts tooltip stable

* make test better
2025-03-25 16:44:57 +00:00
Jeff Bruemmer
33b34e456c docs - expression updates (#55645) 2025-03-25 16:09:03 +00:00
Alexander Solovyov
9381eadebb add dimensions to sample content (#55507) 2025-03-25 17:53:07 +02:00
Alexander Solovyov
140f48eb43 update athena to 3.5.0 (#55391) 2025-03-25 15:18:36 +00:00
Uladzimir Havenchyk
f9d20ea838 test: skip flaky calendar test as it is broken (#55689) 2025-03-25 14:11:45 +00:00
Ryan Laurie
aa8594fae7 remove smoke test (#55655) 2025-03-25 07:57:58 -06:00
Uladzimir Havenchyk
6be63025c9 test: mark broken column tests as broken and not flaky (#55674) 2025-03-25 16:33:46 +03:00
Alex Yarosh
7722d8db9c Update e2e-tests.md (#55676) 2025-03-25 12:46:24 +00:00
Sébastien
6a1588be90 Closes viz-456: decimals setting not being honored compact formatting (#55181)
* closes viz-456 decimals not being honored compact formatting

* fixup

* .
2025-03-25 13:43:21 +01:00
lbrdnk
857228f952 Querying generative test MS2 (#53921)
This PR adds defgentest and transforms with-gentest into gt/iterate. It also adds new test that uses cards.
2025-03-25 13:38:12 +01:00
Filip Hric
7d2e94f352 update cypress and some of its dependencies to the latest version (#55614) 2025-03-25 10:15:56 +00:00
Kamil Mielnik
b174d2e240 SEM-97 Limit the semantic Field Types choices to the actual field type category when editing table metadata (#55343)
* Add baseType prop to SemanticTypePicker

* Update unit tests

* Fix legacy v1/ Field['base_type'] typing, to make it same as Field['base_type'] from api/

* Use isa

* Add a hack for numerical types

* Fix typo

* Pass field

* Reuse type

* Use effective type

* First pass on the tech doc

* Handle booleans

* Use isa

* Refactor

* Update test

* Update test

* Assume no type can have 2 level-one ancestors

* Add comments

* Extract getCompatibleSemanticTypes

* Refactor isDeprecated

* Refactor

* Add fieldId param

* Add test for booleans

* Make initialValue required

* Do not assume a field cannot have multiple level-one ancestors
- these types have 2 level-one ancestors: type/JSON, type/XML, type/DruidJSON, type/OracleCLOB

* Extract FIELDS

* Add test

* Test Entity Name

* Remove '

* Add test

* Update test

* Add test for base_type fallback

* Update comment

* Refactor tests

* Add Field containing JSON tests

* Refactor

* Add a comment

* Improve naming

* Improve naming

* Use Field from types/api

* Fix typing

* Don't check for text-like fields
2025-03-25 09:55:32 +00:00
Noah Moss
6f17b2319a Baseline-align text in NativeQueryClickFallback (#55653) 2025-03-24 18:52:19 -04:00
Raphael Krut-Landau
89a4b2651a Add e2e tests for sandboxing implicitly and explicitly joined tables (#55443) 2025-03-24 18:41:25 -04:00
John Swanson
88f6005128 Return 5000 unique user attribute keys (#55649)
Previously we looked at 1000 users and got the set of unique user
attribute names from them. So if 1000 users each had a `name` and user
1001 had `some-other-attribute`, we would give you back `name` as the
complete set of available attributes.

This modifies the magic number (to 5000 from 1000) and the logic. We
select the first 5000 unique *attributes*. So if 1000 users each have a
`name`, that only counts as 1, and we'll continue looking for other
unique attributes before returning to the client.
2025-03-24 22:01:07 +00:00
Luiz Arakaki
711d29bbbb Add constraints to key (#55211)
Implemented validation that ensures API keys when created with config.yml:
Start with the mb_ prefix
Have a minimum length of 12 characters and max 254
Prefix (first 7 characters) must be unique
String must be Base64
2025-03-24 18:01:00 -03:00
github-actions[bot]
cde8cbbbba Update translations 2025-03-24 (#55641)
* Update translation sources 2025-03-24

* Update translations

* kick ci

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-03-24 20:48:26 +00:00
Ryan Laurie
dc6c57f07b v54 release code updates (#55643)
* add v54 build requirements

* remove required checks copy script
2025-03-24 13:06:15 -06:00
Alexander Polyankin
f42397e56d Add hover effect for dirty query state (#55627)
* Add

* Hover effect

* Remove unused compact prop

* Remove unused borderless prop

* Rename className

* Rename className

* Fix circular button padding and icon

* Fix circular button padding and icon

* Fix circular button padding and icon

* Fix circular button padding and icon

* Fix circular button padding and icon

* Fix circular button padding and icon
2025-03-24 12:54:54 -04:00
Raphael Krut-Landau
9360d1414e Refactor sandboxing e2e tests (#55540) 2025-03-24 11:55:30 -04:00
Ryan Laurie
7eee9af182 Gsheets frontend refactoring (#55564)
* rename and reorganize

# Conflicts:
#	enterprise/frontend/src/metabase-enterprise/google_drive/GdriveConnectionModal.tsx
#	enterprise/frontend/src/metabase-enterprise/google_drive/GdriveSyncStatus.tsx

* resolve conflicts

* oops forgot one
2025-03-24 09:33:46 -06:00
Noah Moss
728f04302f Use field refs instead of field ids/names for tiles queries (#55570)
* Use field refs instead of field ids/names for tiles queries

* Fix up embedded + public endpoints

* use field_refs

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2025-03-24 11:29:30 -04:00
Ryan Laurie
1c0bbf23fd allow SegmentedControl to have colors (#55582) 2025-03-24 08:36:25 -06:00
Aleksandr Lesnenko
16bbc2931d fix charts glitches in safari (#55589) 2025-03-24 10:06:59 -04:00
github-automation-metabase
e07c8d7f39 Bump org.graalvm.polyglot/polyglot from 24.1.2 to 24.2.0 (#55603)
* Bump org.graalvm.polyglot/polyglot from 24.1.2 to 24.2.0

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

* update js-community version too

---------

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2025-03-24 13:34:53 +00:00
Nick Fitzpatrick
85e4594069 Setting shouldUpdateUrl to false when calling popState in QB (#55362)
* resetting qb state before running card on back navigation

* try something else

* adding e2e test for notebook navigation

* wait for fk call in test

* increase timeout

* e2e adjustment
2025-03-24 09:56:37 -03:00
github-automation-metabase
b927a8def2 Bump ring/ring-core from 1.13.0 to 1.13.1 (#55604)
Inspect dependency changes here: https://github.com/ring-clojure/ring/blob/1.13.1/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-24 12:27:20 +00:00
github-automation-metabase
6b9387b268 Bump ch.qos.logback/logback-classic from 1.5.17 to 1.5.18 (#55597)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-24 12:26:06 +00:00
github-automation-metabase
380da21796 Bump cider/cider-nrepl from 0.52.1 to 0.53.0 (#55598)
Inspect dependency changes here: https://github.com/clojure-emacs/cider-nrepl/blob/v0.53.0/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-24 12:25:52 +00:00
github-automation-metabase
da45d95ac3 Bump org.eclipse.jetty.websocket/websocket-jetty-server from 11.0.24 to 11.0.25 (#55601)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-24 14:13:14 +02:00
Ngoc Khuat
0f5a6253e3 Fix query limit for alerts (#55610) 2025-03-24 11:19:45 +00:00
Alexander Solovyov
4050d70935 ci: Add manual workflow for deploying Athena JDBC driver (#55519) 2025-03-24 10:56:14 +02:00
Oreon Lothamer
92c9e8736d paginate pr-env job id retrieval (#55590) 2025-03-21 20:05:41 -10:00
Mahatthana (Kelvin) Nomsawadi
746b6ed780 Let embedders select exposed entities (#55463)
* Control visible entities in multi-stage data picker (#54845)

* Add props to DataSelector, and keeps the same behaviors.

* Read entity_types from URL search params

* Fix type errors

* Fix SDK not rendering multi-stage data picker

* Add redux slice tests

* Add E2E tests

* WIP add integration tests

* Add all integration tests

* Put tests file in a proper folder

So the SDK build process doesn't check test file types

* Cover more E2E scenarios

* Cover the new code with a test

* Add more assertions to make sure more paths are tested

* Fix imports

* Make functions easier to understand

* Fix test case name typo

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

* Clarify embed state type

* Address review: Make code more concise

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

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>

* Control visible entities in simple data picker (#55329)

* Filter simple data picker by "entity_types"

* Add a happy path for multi-stage data picker E2E test

* Fix loading a wrong entity

* Control visible entities on new item menu dropdown (#55331)

* Control visible entities on new item menu dropdown

* Hide action following product discussion

* Make a new menu item more accessible

* Add tests

* Control visible entities in Browse sidebar (#55332)

* Control visible entities in Browse sidebar

* Add relevant tests

* Fix test case typos

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

* Add comment to clarify magic value

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

---------

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

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-03-22 09:48:30 +07:00
Eric Normand
62cce4b7af [Integration branch] Cast string to date custom expression function (#55435) 2025-03-21 23:03:36 +00:00
Nick Fitzpatrick
4e0ca8b1d3 use-escape-to-close-modal, fix closing entity picker on esc (#55549)
* use-escape-to-close-modal, fix closing entity picker on esc

* add test for duplicate modal

* adding comment
2025-03-21 18:10:31 -03:00
Case Nelson
aebf3c8a2d support: Add snowplow logging for starburst-legacy-impersonation (#55569)
* support: Add snowplow logging for starburst-legacy-impersonation

* Fix tests
2025-03-21 14:57:53 -06:00
Eric Normand
50b372feff [INTEGRATION] splitPart() custom expression function (#55429)
* Empty

* Add split-part backend (#55425)

* feat: prepare fe part of split-part (#55483)

* Add split-part backend

* feat: prepare fe part of split-part

* rename function and add test

* use postgres for testing

* add test for an error

* add db flag

* remove docs page

* update copy

---------

Co-authored-by: Eric Normand <ericwnormand@gmail.com>

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>
2025-03-21 20:44:41 +00:00
Alexander Polyankin
3ca34fbcf6 Multi-stage filter picker in chill mode (#55052) 2025-03-21 20:09:15 +00:00
Oreon Lothamer
78801d0533 point to correct workflow for pr-env lookup (#55580) 2025-03-21 09:53:45 -10:00
Eric Normand
6909e8d742 Frontend and Backend for url-pathname (#55353) (#55375)
* feat: prepare fe part of url-pathname

* fix dropdown styling

* fixup example

* rename function to path and update example

* Backend for url-pathname

* Rename to path()

* Backend tests for `path()`

* Frontend and Backend for url-pathname (#55353)

* feat: prepare fe part of url-pathname

* fix dropdown styling

* fixup example

* rename function to path and update example

* Backend for url-pathname

* Rename to path()

* Backend tests for `path()`

---------

Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>

* Fix kondo

* Fix kondo

* feat: prepare fe part of url-pathname (#55291)

* fix description

* fix styling

* cleanup

* fix rebase

* fix rebase

* add tests

* add tests

* update test

* fix test

* address review

* prevent url translations

* make tests less flaky

* update copy

* add category

* remove docs page and add feature flag

---------

Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2025-03-21 19:24:10 +00:00
Aleksandr Lesnenko
31eefe0d39 specify renderHook renderer explicitly (#55572) 2025-03-21 19:23:57 +00:00
Oleksandr Yakushev
0267393d72 [sync-metadata] Use equalsIgnoreCase to match fields instead of lowercasing (#55239) 2025-03-21 21:03:40 +02:00
Romeo Van Snick
8f617a8d78 Clean up custom expression compiler (#54415)
* Convert typeinferencer to typescript

* Split up diagnostics

* Split of lib check from diagnostics function

* Move getDatabase to util file

* Move isErrorWithMessage to utils

* Add getExpressionMode helper

* Simplify branches

* Move resolveMBQLField to separate module

* Simplify expressions import

* Remove unused options

* Fix type of mock env

* Move compiler to separate file

* Remove unused arguments to compiler

* Move passes to separate file

* Return expression from diagnose

* Remove unused processSource helper

* Fix types in passes

* Make resolving optional in compiler

* Add fuzz testing for compiler

* Mock legacy mbql to clause in fuzz test

* Remove need for compare

* Use default parameters

* Remove compare and compareSeed

* Remove unused recursive-parser

* Remove fuzz testing for recursive parser

* Remove unused arguments

* Colocate helper with the tests that use it

* Use compileExpression in formatter tests

* Use compileExpression in typeinferencer tests

* Order compiler passes

* Move StartRule and ClauseType to metabase-lib/v1/expressions

* Remove useShorthands pass

* Fix token escaping in pratt compiler #54751

* Remove POPULAR_ functions and aggregations

* Move compiler passes out of pratt compiler

* Make getMBQLName optional

* Add missing adjustBooleans pass

* Type startRule in compiler

* Move resolverPass to field-resolver

* Add isCompilerPass helper

* Allow use of short-circuiting for disabling passes

* Only render friendly errors

* Mark ExpressionError and ResolverError as user-friendly

* Add check for missing comma in argument list

* Simplify diagnostic checks

* Always return error and expression

* Make compileExpression and diagnoseAndCompile generic to StartRule

* Remove diagnoseAndCompileExpression helper

* Remove unused completer utils

* Move enclosingFunction to expressions module

* Fix typeinferencer tests

* Fix e2e test

* Detect cycles

* Inline passes

* Flatten compiler

* Remove prevError

* Remove default from diagnoseAndCompile type definition

* Use try/catch to simplify diagnoseAndCompile

* Wrap diagnostic errors in their own type

* Remove unnecessary wrapping of diagnostic error

* Move errors to top-level expression module

* Remove duplicate error types in expressions

* Fix error format in tests

* Add comments to passes

* Add tests for passes

* Fix lint

* Fix type imports

* Flesh out references in test data with base-type

* Use fleshed out field reference in all test cases

* Add boolean expression to test data

* Port recursive-parser tests for compiler

* Fix support for unary +

* Add cast support to test database

* Move cast calls to separate test

* Add test for escaping identifiers

* Unskip test

* Fix compiler tests to support top-level literal

* Typo

* Use normal quotes

* Fix typeinferencer for value clause

* Use all passes by default

* Fix pratt compiler tests

* Unskip garbage test

* Use dedent from ts-dedent

* Remove ClauseType helper for expression and make everything use Lib.ExpressionClause

* Coerce clause to be expression clause in filter and aggregation pickers

* Fix diagnostic test

* Wrap diagnostic error in a DiagnosticError

* Use instanceof to check type of error

* Do not assume all diagnostic errors are human-friendly
2025-03-21 19:51:50 +01:00
Romeo Van Snick
55fefac833 Add placeholder to custom expression editor (#55537)
* Add placeholder to custom expression editor

* Ignore placeholder in e2e test
2025-03-21 19:48:43 +01:00
github-actions[bot]
a36e2fca46 Add Slovenian Localization + Synchronize Translations (#55307)
* Update translation sources 2025-03-17

* Update translations

* don't add lithuanian yet

* language is always locale

* Fix the `ttag` i18n calls for pluralized strings

Pluralized strings *without* the number interpolated into them (eg.
"Month" and "Months") were not getting found by `i18n/trun` in CLJS,
which made them fall back to English.

This fixed the `ttag/msgid` call to be correctly formed in both cases.

* update some localized strings

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
Co-authored-by: Braden Shepherdson <braden@metabase.com>
2025-03-21 11:38:35 -06:00
Jeff Bruemmer
4353626e7a fix links (#55548) 2025-03-21 13:23:53 -04:00
dpsutton
4a068f02b3 Handle snowflake timeouts (#55546)
We are running a probe query on snowlfake to see if the current db user
can see views

```
select true from X where 1 <> 1 limit 0
```

Something like this.

But on large views, it seems snowflake does not quickly determine this
has no rows and it can take a while.

This leads to the connection being closed. Then in the error handler we
attempt to rollback. But if the connection is closed _this_ throws and
we have now thrown from the error handler and we break sync.

This does two things
1. set a timeout on sql statements. This does 10 seconds.
2. If a timeout occurs, assume that they _can_ see the object

The idea is that timeouts might happen but it's trying to run a query
that it would quickly reject if the permissions were lacking. So
timeouts mean you can see the data, it's just taking a while
2025-03-21 12:13:36 -05:00
Sébastien
ccaddac0c4 closes viz-358 precision for scientific notation (#55542) 2025-03-21 18:05:33 +01:00
Sébastien
bc3b10d93c closes viz-230 no color picker for waterfall series (#55530) 2025-03-21 18:05:16 +01:00
Stas Gavrylov
460a36571a WRK-116: Add custom cron scheduling option to Schedule (#55472)
* WRK-116: Add custom cron scheduling option to Schedule. Integrate in Alerts notifications

* WRK-116: Remove 'every' label for custom schedule option. Introduce 'separate' group for GroupControlsTogether.
2025-03-21 18:46:13 +02:00
Riley Thompson
a34c663134 Bring Clickhouse driver into Metabase repo (#54740)
* Bring Clickhouse driver into Metabase repo

---------

Co-authored-by: Luiz Arakaki <luiz.arakaki@metabase.com>
2025-03-21 12:37:18 -04:00
Sébastien
43b23ec5c5 Closes VIZ-498 can't change back to dollar sign in header (#55167)
* closes VIZ-498 can't change back to dollar sign in header

* added unit test

* fixup
2025-03-21 17:36:02 +01:00
Edward Paget
f385ca3b47 feat: enable the field scanning task for audit db (#55379) 2025-03-21 16:27:31 +00:00
Edward Paget
0bff778586 feat: add embedding stats to token request (#55491)
* feat: add embedding stats to token request

Adds the embedding_users, internal_users, domains, and query_execution_*
stats to the token check request in order to track embedding usage.

This creates a new internal_stats module to share code between the
anonymously reported stats the stats for the token check request to
avoid some circular depedencies. This also seperates creation of a stat
and how it is reported, so we could move over other stats calculated for
the phone home metric.

* temp! add a logging statement to figure out why CI is different

* fixup! exclude api-key email

* fixup! exclude api-key/internal type users
2025-03-21 16:22:07 +00:00
Phoomparin Mano
5bd573c163 docs(sdk): indicate support for react 19 (#55527)
* update docs and cli

* unify wording for cli message

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

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-21 23:22:03 +07:00
bryan
9ff6f46311 fix localhost:* in embedding app origins sdk (#55481)
* fix localhost:* in embedding app origins sdk

We need to call the setting's getter directly, and not use
`setting/get-value-of-type`. The setter it adds localhost:* which is required.

* add test

* test fix

* update module config

* improve test feedback

* fix ci
2025-03-21 10:14:56 -06:00
Timofey Kachalov
84f4b08e52 Enable shoppy compatibility testing on CI (#55536) 2025-03-21 19:58:19 +04:00
Jeff Bruemmer
104e1d59d8 remove unused images (#55544) 2025-03-21 11:53:54 -04:00
Jeff Bruemmer
c725834726 docs - accessibility notes (#55493)
* accessibility notes

* update accessibility page
2025-03-21 11:23:04 -04:00
Aleksandr Lesnenko
ea33b84c8f use whitelabel colors in the static viz (#55231)
* use whitelabel colors in the static viz

* Fix backend whitelabel test for app colors

* update CI

---------

Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-03-21 10:34:27 -04:00
Edward Paget
0cb3f4157d fix: return 404 when logout without session (#55464)
* fix: return 404 when logout without session

* fixup! remove #p
2025-03-21 14:09:53 +00:00
Mahatthana (Kelvin) Nomsawadi
54c3894552 Reduce noise in SDK Slack channel (#55513) 2025-03-21 09:20:03 +00:00
Oisin Coveney
ecc332187a Use SDK-specific ID types and reconcile the changes (#55448) 2025-03-21 10:48:08 +02:00
Timofey Kachalov
2b192818f6 docs(sdk): Extract embedding docs code snippets to separate files and type-check them (#55253) 2025-03-21 12:45:29 +04:00
Nicolò Pretto
6f3d2566eb test: add renderHookWithProviders helper (#55449)
* test: add renderHookWithProviders helper

* remove defaults from getTestStoreAndWrapper and destructure options to
only pass down the correct args
2025-03-21 09:40:59 +01:00
Darth Spectrum
4379a56a85 Not retrying to send notifications to missing slack channels (#55180)
Fixes #49647
2025-03-21 09:42:31 +02:00
Tyler Plude
c29938b1ea Fix cond fmt of null vs empty str in table static viz (#55386)
* Fix cond fmt of null vs empty str in table static viz

* Adding unit test

* Add TextWrapper support in json exports

* Updating unit tests with TextWrapper
2025-03-21 00:44:59 +00:00
Alexander Polyankin
ce6a272e22 [Integration branch] Literals in expressions - value support (#55202)
* Empty

* Add `value` support in the expression editor (#55203)

* Literals in filters tests (#55283)

* E2E tests for literals in custom columns (#55288)

* E2E tests for literal custom columns in other clauses and fixes (#55295)

* Move changes from the FE branch

* Move changes from the FE branch

* Move changes from the FE branch

* Fix filter schema and false = false filter (#55417)

* Fix date/string literals effective type (#55427)

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Fix date/string literals effective type

* Forbid top-level constants until the BE is fixed (#55459)

* Use matches

* Make test flaky

---------

Co-authored-by: Mike Appleby <86076+appleby@users.noreply.github.com>
2025-03-20 20:10:13 -04:00
Nathan Voxland
3fa59859db Store created-by-id in the gsheets config (#55191) 2025-03-20 17:10:03 -05:00
metamben
5071cef855 Use actual time zone marker (Z) when parsing offset times (#54987)
Fixes #53724

Also remove (date)time formats moment cannot handle anyway.
2025-03-20 23:26:29 +03:00
Edward Paget
63d22989e9 fix: use custom dns resolver when fetching geojson (#55460) 2025-03-20 13:27:28 -05:00
Alex Yarosh
6b0449351f Update mongodb.md (#55470) 2025-03-20 14:02:13 -04:00
Tyler Plude
0a3c48b0c1 Fix sig-figs-after-decimal (#55377)
* Fix number formatter for small decimals

* Fixing bug when decimal is not ; Removed param as input value should always be numerical
2025-03-20 10:43:28 -07:00
Uladzimir Havenchyk
bbcac9ead3 ci: set default number of times for running e2e stress test (#55462) 2025-03-20 20:37:50 +03:00
Aleksandr Lesnenko
a1f7d7fba0 Apply fix from 51937 to new minibar cell (#55477) 2025-03-20 17:11:31 +00:00
Phoomparin Mano
f3a1576201 ci(sdk): run embedding sdk component tests across react 18 and 19 (#55405)
* add script to change react version

* cleanup version

* cleanup version change script

* setup workflow

* fix workflow dependencies

* cleanup workflow dependencies

* fix clojure missing

* setup @cypress/react

* combine cypress harness packages

* add clarification messages

* remove @cypress/react18

* remove backup files

* cleanup package.json

* cleanup cypress test harness

* clarify cross React version tests

* clarify messages

* change react version after making appdb snapshot

* log dependencies in change-react-version

* revert me - use fake uberjar to speed up testing

* update test jar

* mkdir for testing purposes

* remove react 17 from matrix

* clarify React 17

* remove testing config

* let git handle the backup and restore mechanism

* move the artifact download step for a better diff
2025-03-20 23:25:51 +07:00
Nicolò Pretto
b196a4e0c3 ci(sdk): adds embedding-sdk-tests-result (#55344)
* ci(sdk): adds embedding-sdk-tests-result

* ci: should run the sdk tests as part of the embedding-sdk workflow

* let's try without concurrency

* rename "frontend" -> "embedding SDK"
2025-03-20 12:40:03 +01:00
Alexander Polyankin
d6e3e3d187 [Integration branch] Add integer(<value>) MBQL function for Postgres (#55364)
* Integration

* Support for `text` MBQL function on the FE (#55274)

* Cast text backend on postgres (#55292)

* Add `text()` custom expression that casts to text

* Add :cast to list of all possible features

* Complete testing plan

* Fix kondo warnings

* Fix test

* Empty

* Add e2e tests (#55361)

* Fix failed tests for text() function (#55374)

* Add UI for integer() function, with e2e tests (#55366)

* Set category

* Set category

* Set category

* Set category

* Fix tests

* Cast integer backend (#55381)

* integer() custom expression with simple tests

(more tests coming)

* MOAR tests

* EVEN MOAR tests

* Change type to BigInteger

---------

Co-authored-by: Eric Normand <ericwnormand@gmail.com>
2025-03-20 01:56:43 +00:00
Aleksandr Lesnenko
9dfa4dcdef Data grid cell selection (#54775) 2025-03-19 21:03:30 -04:00
Oleksandr Yakushev
7d5fcecf28 [pivot] Optimize CLJC pivot exsport for csv files (#55235) 2025-03-19 22:21:45 +00:00
Alexander Solovyov
d6dc7e5f3c [serdes] introduce (partial) schema coercion for Dashboard (#55354)
This adds coercion support for serialization and adds a very limited partial schema for a Dashboard, in hopes that
this grows to be a full schema for our data models at some point.

fixes #54941
2025-03-19 21:38:43 +00:00
Alexander Polyankin
94d46b2290 [Integration branch] Add text(<value>) MBQL function for Postgres (#55268) 2025-03-19 19:52:39 +00:00
Filip Hric
cbc59ff0b2 run only previously failed tests when rerunning pipeline (#54900) 2025-03-19 12:54:30 -06:00
Aleksandr Lesnenko
61ba3c325e Tanstack data grid table interactive dashcards (#54703) 2025-03-19 18:36:33 +00:00
Raphael Krut-Landau
e7dea2105d Add e2e test that filter values are sandboxed #54539 2025-03-19 14:34:49 -04:00
Oisin Coveney
928683dc71 fix(sdk): Fix ad-hoc question view when clicking into SDK dashboard (#55254)
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
2025-03-19 17:37:06 +02:00
Ryan Laurie
90f891214e Sync Localizations with Crowdin (#52334)
* sync translations with crowdin

* remove poeditor integration

* fix run name

* update to new project

* sync

* path

* move to config

* not master lol

* kick ci

* update crowdin config

* remove croatian

* roflcopter

* token

* maybe fetch harder

* test code - revert this

* test

* more tokens

* just use the cli

* line breaks

* le facepalm

* no verify

* token swap

* auto approve

* revert

* remove zh e2e test

* remove test code

* don't backport translations

* don't backport translations
2025-03-19 08:24:24 -06:00
Ryan Laurie
7e5d8c9f4a Support huge piles of open backports (#55342)
* support huge piles of open backports

* correct string
2025-03-19 08:06:31 -06:00
Romeo Van Snick
0c9bc4fab2 Do not reopen helptext when selecting completion (#55280)
* Do not reopen helptext when selecting completion

* Add e2e tests for help text and suggestions
2025-03-19 14:07:07 +01:00
Alex Yarosh
4ee726ee16 docs: add Learn redirects for Maps (#55367)
* Update map.md

* Update map.md
2025-03-19 09:00:01 -04:00
Oisin Coveney
2d4a7d05df fix(sdk): Entity ID support for CreateDashboardModal (#55358) 2025-03-19 13:25:40 +02:00
github-automation-metabase
b8f7bff12b Bump io.netty/netty-buffer from 4.1.118.Final to 4.1.119.Final (#54568)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-19 12:56:03 +02:00
Ngoc Khuat
e7af871ca1 Add display type for notification subscription (#54954) 2025-03-19 10:47:15 +00:00
Romeo Van Snick
331c9bd7e2 Add function browser to the custom expression editor (#55102)
* Add FunctionBrowser component

* Move header into CombineColumns for consistency

* Render the function browser

* Allow wrapping shortcuts

* Render toolbar buttons on top again

* Add missing Lib import

* Fix e2e test

* Use ellipsis in placeholder

* Add test-id to function browser

* Add e2e tests for function browser

* Add category to help text configs

* Only render supported functions in function browser

* Convert to helptext in getFilteredClauses

* Group functions by category

* More e2e tests

* Add empty state to function browser search

* Add more breakpoints for expression editor layout

* Move function browser item into its own component

* Increase width of function browser

* Add case to functions

* Remove unnecessary maw prop

* Sort functions

* Add tests for FunctionBrowser

* Remove nested component definitions

* Use standard breakpoints

* Add spacing between toolbar buttons

* Fix functions test

* Add category to distinct-if

* Fix tests that were broken by sorting

* Fix unit test examples

* Add more unit tests for filtering

* Do not enter parentheses when there are no arguments to the clause

* Sort by displayName

* Sort by structure

* Add e2e about clauses with no args

* Fix sorting test

* Fix font sizes for function browser

* Fix function browser spacing

* Allow replacing selection with function browser
2025-03-19 10:13:32 +01:00
Oisin Coveney
d094e67e54 Remove dashboardActions and dashboardProps spreading in favor of explicit props (#55175) 2025-03-19 07:14:12 +00:00
Kamil Mielnik
c5d7b545ee Fix - App crashes when editing segment field details in data reference (#55333)
* Fix #55322

* Repro #55322

* Simplify diff
2025-03-19 13:43:30 +07:00
Raphael Krut-Landau
34ef924bce Add e2e tests that parameter values can be sandboxed (#54655) 2025-03-18 22:32:53 -04:00
Ngoc Khuat
aa3db88a58 [Notification] Fix task history report when channel failed to send and we skip it (#55312) 2025-03-19 10:33:00 +09:00
Fraser
62af27038b Replace Confirm with ConfirmModal (#55310)
* Replace Confirm with ConfirmModal
2025-03-19 13:02:26 +13:00
Luis Paolini
8f425c9fee Upgrade jspdf to 3.0.1 (#55363) 2025-03-18 20:15:47 -03:00
Aleksandr Lesnenko
c381149964 loki-update should update only diff (#55246) 2025-03-18 20:38:05 +00:00
Nick Fitzpatrick
6850c93eaa For your consideration hoc (#54933)
* Context Driven Indicator Menu

* add unit tests

* unit test adjustments

* Ho
C time

* hasSeenAll

* cleanup, passing tests

* adjusting some tests, PR feedback

* more small adjustments. Starting to add docs

* hopfully final adjustments

* adjusting storybook path
2025-03-18 17:16:51 -03:00
Braden Shepherdson
0195ff7ecd [refs] Support remapped columns in lib; handle more ident cases (#55311)
Closes QUE-764.

Adds support for returning "remapped" columns, which have not been
supported in the library previously.

- Refactor `lib.field/remapped-field` to `lib.metadata`
- Add `lib.metadata.calculation/remapped-columns`


Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2025-03-18 19:48:24 +00:00
Edward Paget
55b4c2446a fix: improve startup by not scheduling all dbs (#55297)
* fix: improve startup by not scheduling all dbs

Improve long startup times by not scheduling tasks for all dbs on
startup. Due to the lack of bulk operations in quartz if an installation
has 500 dbs we need to load and scan through all associated db scanning
triggers 500 times for all dbs which means loading about 500k records in
1000 operations.

This is generally pretty fast on a per operation basis (about .5s
in local development), but on some postgresql installations this can
blow up to a few seconds per db, which makes the whole operation take 40
minutes plus. Additionally there maybe both lock contention and resource
contention between the quartz scheduler and the main app thread that
draws out this time.

Instead we want to init the schedule and put it into standby mode -- where
we can schedule tasks but are not executing them -- before we process
the configuration file. That we can schedule all necessary tasks as part
of loading the database from the config file and not need to then
iterate all database to schedule their tasks later in the startup.

Long term, it would be good to support rescheduling tasks using a bulk
operation in quartz (there are TODOs in their code base for supporting
this) rather than needing to update each trigger individually.

* fixup! doc string for check-health! function
2025-03-18 18:47:45 +00:00
Alex Yarosh
460ced3b6f docs: overhaul maps docs (#55313)
* map comparison

* docs: maps overhaul

* Apply suggestions from code review

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

* review feedback

* Apply suggestions from code review

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-18 18:16:00 +00:00
Alexander Solovyov
87f6d7e8f7 fix some mage installer logic (#55277)
* fix some mage installer logic

* make `cd bin && ./mage` work

get the absolute path, + cd to mb repo root in subshell

---------

Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
2025-03-18 17:44:00 +00:00
Luis Paolini
e7bf5d57ed Update root folder Dockerfile (#54110)
Update the clojure version
2025-03-18 14:11:42 -03:00
Noah Moss
c8314f52cf Migrate Chinese site & user locales from zh to zh_CN (#55287) 2025-03-18 12:50:20 -04:00
Phoomparin Mano
588abf10ed feat(sdk): do not setup sandboxing and show user switcher if using a sample database (#55105)
* do not setup sandboxing if using a sample database

* do not ask for tenancy columns if using a sample database

* alter copywriting when in sample database mode

* improve copywriting for scenarios with a sample database

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

* fix misleading comments

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-03-18 16:28:28 +00:00
Alex Yarosh
5dd9e138a8 Update expressions-list.md (#55350) 2025-03-18 12:06:16 -04:00
Alex Yarosh
fea7185b21 Update introduction.md (#55349) 2025-03-18 16:02:53 +00:00
Oisin Coveney
3c63deb4bb Remove InteractiveQuestionProviderWithLocation since it's really not necessary (#55165) 2025-03-18 17:53:42 +02:00
github-automation-metabase
7e816edff6 Bump io.github.eerohele/pp from 7ac1bc56de95520ff4938df05e3518e9b051415d to 9598f4c72b528480a85ea41651c45b08d1717428 (#55242)
Inspect dependency changes here: 7ac1bc56de...9598f4c72b

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-18 11:49:11 -04:00
William
b92b5d2e68 Backfill job handles many duplicates (#55228)
The backfill job originally retried up to 20 times and then gave up.  However, some instances apparently have ~150
duplicates or more, so 20 retries is insufficient.  In addition, 2 db calls per conflict is sort of a problem when the
conflict count is O(duplicates^2).  This bumps up the retry limit and reduces the db calls to 1 per 50 conflicts.
2025-03-18 14:40:12 +00:00
Kamil Mielnik
76cabfcf73 SEM-149 Hide unused semantic types (FE only) (#55327)
* Hide deprecated semantic types

* Add tests

* Update tests
2025-03-18 21:21:25 +07:00
Kamil Mielnik
9a8dc14501 Fix - Prevent browser close/go back while changes are unsaved (#55161)
* Disallow navigating from model/{slug}/query and model/{slug}/metadata to model/{slug} when there are unsaved changes

* Reset state

* Simplify reset

* Use appropriate redux action when programmatically invoking navigation

* Disallow navigating from metric/{slug}/query and metric/{slug}/metadata to metric/{slug} when there are unsaved changes

* Remove mentions on inexisting /metric/metadata and /metric/{slug}/metadata routes

* Rename test

* Add repro for #32037 (models)

* Improve assertions

* Fix state cleanup

* Fix flaky test

* Deal with race conditions

* Add repro for metrics

* Correctly reset ui state when cancelling editing a model/metric

* Add repro for editing model's query

* Remove log

* Add a comment
2025-03-18 21:21:20 +07:00
Jeff Bruemmer
b57516c465 update site urls (#55337) 2025-03-18 10:19:06 -04:00
Stas Gavrylov
be7d1b04df WRK-129: Add 'by the minute' option to Schedule (#55184)
* WRK-129: Add 'by the minute' option to Schedule. Add NotificationSchedule component
2025-03-18 16:12:25 +02:00
Stas Gavrylov
6be9eb6905 Fix incorrect condition to hide parameters section in SubscriptionSidevar (#55320)
* Fix incorrect condition to hide parameters section in SubscriptionSidebar
* Add unit tests for advanced filtering parameters display
2025-03-18 14:10:08 +00:00
Ngoc Khuat
ab9103a67f [Notification] Handle description for new schedule types (#55249) 2025-03-18 13:38:18 +00:00
Nick Fitzpatrick
8b4e79dd79 fixing hover state on time grouping dropdown (#55284) 2025-03-18 10:08:47 -03:00
Alexander Polyankin
c38c616056 Remove source-table being accessed directly in the QB (#55267) 2025-03-18 09:07:44 -04:00
Jeff Bruemmer
60d9c209e7 minor modal message fix (#55217) 2025-03-18 09:03:53 -04:00
Phoomparin Mano
87354c136f fix(sdk): mark all react-dom dependency requests as external for React 19 compatibility (#55071)
* fix externals configuration to enable compatibility

* tweak externals configuration
2025-03-18 19:04:08 +07:00
Mahatthana (Kelvin) Nomsawadi
0be73a6e90 Add a new embedding selector + make selector names consistent (#55260) 2025-03-18 11:36:51 +00:00
Mahatthana (Kelvin) Nomsawadi
57bd674360 Update embedding team codeowners files (#55317) 2025-03-18 11:36:30 +00:00
Filip Hric
9a4605143f remove filiphric from e2e tests codeowners (#55316) 2025-03-18 10:31:40 +01:00
Romeo Van Snick
c7a03ed080 Custom expression close on exit modal (#55047)
* Revert "Skip tests that deal with the click outside and escape behaviour of the custom expression editor"

This reverts commit 2c05bc08c2.

* Revert "Remove CloseModal component"

This reverts commit ad1795e05a.

* Revert "Move usePreventClosePopover into utils"

This reverts commit de31b21282.

* Add PreventPopoverExit util

* Remove use of non-existant hook

* Prevent popover from closing on outside click or escape

* Rename argument to avoid confusion with double negatives

* Prevent custom expression editor from closing in aggregation sidebar

* Allow exiting the component when navigating away from custom expression editor

* Add a comment explaining why the useClickOutside does not work

* Add comment on how CloseModal works

* Remov empty file

* Add comment on what children should be

* Allow overriding cancel button text on ConfirmModal

* Allow passing more props to ConfirmModal

* Fix primary button on ConfirmModal

* Use ConfirmModal for custom expression editor

* Fix e2e test

* Remove second message in closemodal

* Update loki
2025-03-18 09:01:00 +01:00
Uladzimir Havenchyk
5aeb52544a ci: decrease build job timeout (#55264) 2025-03-18 09:32:39 +03:00
Ryan Laurie
34722e2025 Add Basic Admin Setting Component (#55063)
* add admin settings input widget

* stupid typescript

* stupid me

* silly typescript

* rename component
2025-03-17 17:25:57 -06:00
Gustavo Saiani
425043a096 Update links (#55298) 2025-03-17 18:06:33 -03:00
Uladzimir Havenchyk
c0c045a568 fix(qb): do not cut layout with two sidebars (#55163)
* fix(qb): do not cut layout with two sidebars

do not show data reference sidebar automatically on small screens

* rename wrapper
2025-03-17 20:13:49 +00:00
Jeff Bruemmer
cc9b45c6dd docs - sdk edits (#55056) 2025-03-17 20:03:29 +00:00
Aleksandr Lesnenko
d0efa299de move crypto-browserify to dev deps (#55279) 2025-03-17 19:25:46 +00:00
Alexander Polyankin
a22366e29f Remove unused metabase-lib/v1 code (#55262)
* Remove StructuredQuery

* Remove query base classes

* Remove query base classes
2025-03-17 13:16:03 -04:00
Jeff Bruemmer
0de7a3047d docs - update generated docs (#55275) 2025-03-17 12:35:23 -04:00
John Swanson
bcbf3e946b dev: just warn if can't watch UserKeyValue schemas (#55178)
If you run an uberjar with `MB_RUN_MODE=dev`, you get an exception
because you try to run the `watch-directory!` bit (which only works for
actual files) in an uberjar environment.

Let's just print a warning but continue along.
2025-03-17 16:29:50 +00:00
Ryan Laurie
fd976b7237 fix temporal strings for i18n (#55270) 2025-03-17 15:58:38 +00:00
Alexander Polyankin
0804a5ebca Improve Select all/none labels (#55109) 2025-03-17 10:16:22 -04:00
Romeo Van Snick
95b6eeec4c Custom expression better examples (#55048)
* Rename arg to caseInsensitive

* Add matcher for internal [:dimension name]

* Add formatting support for internal dimension clause

* Use raw MBQL in examples

* Format examples at certain width

* Remove unused suggest code

* Fix unit test for help text

* Add unit test for rendering examples on multiple lines in HelpText

* Improve spacing

* Make sure that all help texts can be formatted properly

* Add custom formatExample helper to format example expressions

* Use useAsync to format example

* fixup! Add custom formatExample helper to format example expressions

* Add HighlightExpression component

* Export all modules
2025-03-17 14:23:17 +01:00
Anton Kulyk
52b92aa7f5 Fix object detail view ignores link formatting (#55200)
* Fix `row` type to be `RowValue[]`

* Use richer `clicked` object in object detail view

* Fix column settings not available in detail view

* Add e2e test
2025-03-17 12:47:52 +00:00
Alexander Polyankin
efb52f7916 Remove StructuredQuery from metabase-lib/v1 (#55223) 2025-03-17 11:40:41 +00:00
Romeo Van Snick
6b8c581ea6 Fix Custom Expression snippet completion when error occurs (#55164)
* Avoid rerendering editor when error change

* Add delay support to CustomExpression.type

* Add test for breaking snippets
2025-03-17 12:07:10 +01:00
Kamil Mielnik
db12bcbd4f Fix - Filtering the semantic types list is super annoying (#54965)
* Rename Select to LegacySelect

* Convert frontend/src/metabase/lib/core.js to TypeScript

* Format code

* Extract SemanticTypePicker

* Fix type

* Fix styling

* Fix nulls

* Add nothingFoundMessage

* Extract DefaultSelectItem

* Add CurrencyPicker

* Optimize

* Add checked icon to CurrencyPicker

* Improve overflow in SelectItem

* Add FkTargetPicker

* Style font-weights to be the same as in other inputs around

* Fix colors

* Add a comment

* Fix imports

* Style dropdowns

* Make currency input full width

* Add Combobox component

* Show currency symbol next to value

* Modernize field settings button

* Modernize FieldVisibilityPicker

* Update tests

* Update test

* Update and merge tests

* Update tests

* Remove bold, fix padding and move components to their own dirs

* Update unit tests

* Update e2e tests

* Update tests

* Reduce flakiness

* Add comment

* Repro #53595

* Replace CSS modules overrides with props

* Fix symbol styling for selected option in CurrencyPicker
2025-03-17 14:45:27 +07:00
Ngoc Khuat
22d48678bb Quartz guide (#55068) 2025-03-17 16:41:17 +09:00
github-automation-metabase
39a1a17303 Bump net.snowflake/snowflake-jdbc from 3.22.0 to 3.23.1 (#55245)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-17 04:46:42 +00:00
github-automation-metabase
26c0cdaf94 Bump org.clojure/tools.reader from 1.5.1 to 1.5.2 (#55244)
Inspect dependency changes here: https://github.com/clojure/tools.reader/blob/v1.5.2/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-17 04:40:39 +00:00
github-automation-metabase
119579dc6c Bump org.clj-commons/hickory from 0.7.5 to 0.7.7 (#55243)
Inspect dependency changes here: https://github.com/clj-commons/hickory/compare/Release-0.7.5...Release-0.7.7

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-17 13:27:04 +09:00
github-automation-metabase
bb688aff2e Bump com.github.seancorfield/honeysql from 2.6.1281 to 2.7.1295 (#55240)
Inspect dependency changes here: https://github.com/seancorfield/honeysql/blob/v2.7.1295/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-17 13:26:51 +09:00
Fraser
e1f1d8e6ed Replace ConfirmContent with ConfirmModal (#54947)
* Replace ConfirmContent with ConfirmModal
2025-03-17 13:42:16 +13:00
Fraser
db090a59c0 Use the new ConfirmModal in DeleteConfirmModal (#54946)
* Use the new ConfirmModal in DeleteConfirmModal

* Delete ConfirmDeleteModal and use ConfirmModal directly
2025-03-17 13:41:05 +13:00
Alex Yarosh
b6e05875da docs: hiding columns (#55233)
* hiding columns

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-15 19:57:25 +00:00
Aleksandr Lesnenko
b1b183f7b9 render cartesian charts when the dimension column is not available (#54870) 2025-03-14 23:40:20 -04:00
Noah Moss
ea73a601b7 Shared FE/BE pivots (#53000)
* POC - moving two pivot functions into CLJC

* Debug logs in frontend pivot impl

* POC continued

* setting isCollapsed consistently

* Working replication of valuesByKey map construction

* sorting logic

* hook up new code to the FE impl

* Fixing small potential bug in valuesByKey

* Fixing bug in clojure vs javascript string key for valuesByKey

* fix valueColumns key name

* Some performance improvements + cleanup

* A couple more attempts at perf improvements

* Fix bugs

* port format-values-in-tree

* WIP add-subtotals

* @tsp - Improved build-values-by-key perf; some debug perf lines in frontend land

* @tsp - in progress conversion of add-subtotals

* @tsp - working converted Pivot.add_subtotals

* @tsp - fixing bug in add-subtotal mapcat recursion

* @tsp - add-subtotal restoring map to mapcat (oops)

* @tsp - adding working Pivot.add_value_column_nodes to replace addValueColumnNodes

* @tsp - removing debug logs & perf timing logs

* Appease whitespace linter

* More formatting code ported, cleanup

* Fix bugs, cleanup

* Fix some tests

* Start hooking up the BE, fix some bugs

* Fix lint/formatting errors

* Fix comparator + i18n

* Fix another module issue

* Test using js-specific i18n function

* Revert "Test using js-specific i18n function"

This reverts commit 9a8604b583885f1c35f48507112e3a142ca0d3a0.

* Bump up timeout on cypress assertion

* WIP - migrate row section getter to cljc

* fix tests

* Fix e2e test

* Switch exports over to fully using CLJC code paths, delete now-unused code

* Delete outdated postprocess tests

* Bug fix

* Fix build

* cleanup, consolidation

* fix function call

* more cleanup

* empty test ns

* misc cleanup/docstrings

* WIP tests

* more tests and refactor

* small fix

* fix getting column title for value columns

* Fix some tests

* Fix another test

* Revert a couple changes

* Fix some more tests

* Fix more tests, fix default values for pivot viz settings

* Ensure headers respect format-rows? settings in exports, and fix more
tests

* Fix lint issues

* fix another test

* Fix a test, a little cleanup

* Try to fix another test by setting format-rows middleware to false for subscription attachments

* Revert "Try to fix another test by setting format-rows middleware to false for subscription attachments"

This reverts commit d860522a6d17c27e67afabccf119039508c96cca.

* Update formatting logic to fix another test

* Fix conditional formatting

* Fix last BE test

* remove test not needed anymore

* Fix drill through + more cleanup

* clean ns

* remove old code from .clj-kondo/config.edn

* add a comment + tweak keywords

* perf improvements and refactoring the CSV export path

* Performance improvements

* Fix bad rebase

* more perf improvements

* fix test

* lint

* oops, fix test

* more optimizations, memoize backend formatting

* fix range-based conditional formatting

* remove unused function

* add some new backend unit tests

* fix FE type checks - caused by an experiment that I didn't revert fully

* address PR review feedback

* fix up tests

---------

Co-authored-by: Tyler Plude <tsplude@gmail.com>
2025-03-14 22:49:11 +00:00
Uladzimir Havenchyk
33072d65d4 ci: adjust timeouts to catch possible build stucks earlier (#55151)
* ci: adjust timeouts to catch possible build stucks earlier

* adjust memory

* Update .github/workflows/e2e-tests.yml

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

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2025-03-14 22:38:55 +00:00
William
c43780e97f Add background job to backfill entity ids (#54060)
We are adding entity_ids to dbs, tables, and fields, but existing rows don't have entity_ids yet, and newly created dbs/tables/fields don't have entity_ids when created. This job adds those missing ids.
2025-03-14 21:21:15 +00:00
Oleksandr Yakushev
e8c6375b24 [pivot] Use m.u.performance/juxt* when constructing pivots (#54555) 2025-03-14 23:19:49 +02:00
Jeff Bruemmer
e477f074fd docs - include deprecated in env vars, not in config template (#54873)
* include deprecated in env vars, not in config template

* whitespace

* tests

* config file test

* whitespace

* combine functions

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

* format

---------

Co-authored-by: bryan <bryan.maass@gmail.com>
2025-03-14 20:59:40 +00:00
Alexander Solovyov
10be466d6f skip actions when duplication a dashboard: they raise an exception right now (#55197)
Ideally, we'd copy them too, but we need to decide if we should duplicate them or not (do a deep or shallow copy) is a
too hard to make immediately, and this at least will unblock people being unable to duplicate dashboard with actions
defined.

somewhat improves on #38224
2025-03-14 20:34:55 +00:00
Riley Thompson
e09377b3de Add Mongo support for mage start-db (#54939)
* add start-db mongo to mage

* different container names for different versions

* image -> container

* move eol url to db info
2025-03-14 16:14:59 -04:00
bryan
5505ebc3dd setup discouraged-tag linting for #p (#55187)
* setup discouraged-tag linting for #p

- this is fine to use in dev, but shouldn't get comitted
  so this will fail kondo linting.

* sample #p commit (check linting)

* Revert "sample #p commit (check linting)"

This reverts commit 171130c668.

I added it to double check the linter will complain correctly
2025-03-14 20:02:50 +00:00
Noah Moss
70ef40a740 Revert "Ensure that ad-hoc questions show visualization (#55156)" (#55210)
This reverts commit 106ee4f4ef.
2025-03-14 19:55:15 +00:00
Edward Paget
6a89c7502c feat: send setting information via snowplow (#54981)
* feat: send setting information via snowplow

* fixup! return full values for locale

* fixup! kondo

* fixup! remove #p

* fixup! newline
2025-03-14 19:52:51 +00:00
bryan
a19ce07aa7 mage installer (#54994)
* moves mage to mage_core, adds installer at mage

- not sure if this will always work or not

* respond to review

* review2

* review3
2025-03-14 18:48:20 +00:00
Luiz Arakaki
33592a3528 add api keys to config.yml
API Key Configuration via config.yml
Overview
This PR adds support for configuring API keys through the config.yml file in Metabase Enterprise. This enhancement allows administrators to define and manage API keys declaratively through configuration, making it easier to set up and maintain API access across different environments.

Features
Adds support for defining API keys in config.yml under the api-keys section
API keys can be configured with:
name (required)
group ("admin" or "all-users")
creator (email of the user to assign it, user must exist in the instance or be created in the config file, must be superuser)
Automatically creates API keys on Metabase startup if they don't already exist
Skips creation of API keys that already exist (based on name)
Validates configuration including:
Required fields
Valid group values
Creator permissions
Example Configuration
version: 1
config:
  api-keys:
    - name: "My Admin API Key"
      group: admin
      description: "API key for admin operations"
      creator: admin@metabase.com
    - name: "My All Users API Key"
      group: all-users
      description: "API key for general operations"
      creator: admin@metabase.com
Security Considerations
API keys are only created by admin users
Keys are properly hashed before storage
Existing keys are preserved to maintain continuity
Group validation ensures keys have appropriate permission levels
Use Cases
Automated deployment and configuration
Infrastructure as code
Consistent API key setup across environments
DevOps automation
Testing
Unit tests cover key creation, validation, and error cases
Tests for configuration parsing and application
Validation of group permissions
Error handling for invalid configurations
This enhancement is part of Metabase Enterprise's advanced configuration capabilities, providing more flexibility in managing API access through configuration files.
2025-03-14 15:35:09 -03:00
Alexander Polyankin
241dc386b1 DistinctIf in the expression editor (#55129) 2025-03-14 18:22:43 +00:00
Aleksandr Lesnenko
95e0a447a7 fix empty tooltip on the help menu item (#55198) 2025-03-14 18:21:08 +00:00
Anton Kulyk
47d4ebb437 Fix drill through for "empty" pie chart slices (#55188)
* Add repro test

* Use null instead of "empty" label in click object
2025-03-14 18:06:22 +00:00
William
99e8f5ff70 Add distinct-where function to mbql (#55131)
Add distinct-where custom expression function
2025-03-14 16:57:09 +00:00
Oleksandr Yakushev
ed5a723b0a [mongodb] Optimize post-processing of Mongo queries (#54881) 2025-03-14 18:44:00 +02:00
Jeff Bruemmer
6320ee4fe2 docs - remove auth flows (#55185)
* remove auth flows

* add description
2025-03-14 12:25:12 -04:00
Noah Moss
3da9eadd09 Use timezoned timestamp for export filenames (#54872)
* Use timezoned timestamp for export filenames

* clean ns

* tweak docstring

* add unit test + make namespace aliases consistent

* use new function in xlsx exports
2025-03-14 16:18:29 +00:00
github-automation-metabase
3a404dcc3b Bump org.clojure/tools.reader from 1.5.0 to 1.5.1 (#54885)
Inspect dependency changes here: https://github.com/clojure/tools.reader/blob/v1.5.1/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-14 16:15:25 +00:00
github-automation-metabase
b7f887c6c0 Bump com.github.seancorfield/honeysql from 2.6.1270 to 2.6.1281 (#54882)
Inspect dependency changes here: https://github.com/seancorfield/honeysql/blob/v2.6.1281/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2025-03-14 16:10:30 +00:00
Edward Paget
710e5da548 feat: add sdk embedding to snowplow features (#54988)
* feat: add sdk embedding to snowplow features

* fixup! remove extra ?
2025-03-14 10:46:20 -05:00
Nick Fitzpatrick
cde799a53a hide empty tooltips with empty hints in PermissionsSelectOption (#55145) 2025-03-14 12:22:34 -03:00
Oisin Coveney
106ee4f4ef Ensure that ad-hoc questions show visualization (#55156) 2025-03-14 15:22:18 +00:00
Nicolò Pretto
77e231de6c fix(sdk): don't set the color scheme on the host app (#54918) 2025-03-14 16:02:02 +01:00
Nathan Voxland
f94deea7a8 Don't allow a migrate down if you are running an old version of metabase (#54984) 2025-03-14 09:48:52 -05:00
Edward Paget
b7648138de feat: add malli schema, test converage to ldap api (#55130)
* feat: add malli schema, test converage to ldap api

Restores the malli schema that was causing e2e tests to fail on the
first attempt and updates those e2e tests to look for the new error
message returned when the api request is rejected due to schema
validation issues.

Expand test cases around ldap connection testing errors so those
messages can be caught on future api changes.

* fixup! error capitalization
2025-03-14 09:23:16 -05:00
Oisin Coveney
2ec9773d05 Use InteractiveQuestion to create StaticQuestion (#54700) 2025-03-14 14:05:57 +00:00
Romeo Van Snick
b1063dd9f3 Custom expression repros (#55107)
* Add reproduction for #54638

* Add reproduction for #54722

* Add reproduction for #31964

* Correct user of metabase issue in test name

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

* Correct use of issue name in test title

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

* Use addCustomColumn helper

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

* Use helpers to open filter and summarize popovers

* Check for textbox role instead on cm-content class

* Just use enter

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-03-14 14:28:17 +01:00
Braden Shepherdson
e91e344bd4 [refs] Put :idents on column lists returned by MBQL lib (#54777)
I enforced this by checking the return values of `visible-columns` and
`returned-columns`. I want to check that in (for dev and test only) but
it fails tests currently.

The trouble is that cards don't have `:ident` in their `result_metadata`.
That's coming later, so the enforcement flag is disabled for now.
2025-03-14 12:27:27 +00:00
Chris Truter
47bae0413d Remove pin on kixi-stats (#55152) 2025-03-14 10:00:11 +00:00
Oisin Coveney
fb1bf78398 Add template strings (#55150) 2025-03-14 09:27:24 +00:00
github-automation-metabase
20e3f6c3bb Bump potemkin/potemkin from 0.4.7 to 0.4.8 (#54887)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-14 08:56:18 +00:00
Oisin Coveney
129cd93aa6 feat(sdk): Add DownloadWidget and DownloadWidgetDropdown (#54546) 2025-03-14 08:25:45 +00:00
Kamil Mielnik
dbd6176658 Fix styling (#55101) 2025-03-14 14:22:41 +07:00
Nick Fitzpatrick
08884decff Adm 464 disabled input text color (#55054)
* formula

* adding text-disabled color for input
2025-03-14 02:51:26 -03:00
Luis Paolini
bcf8d922cf Add doc for alternate hostname (#55139)
docs for https://github.com/metabase/metabase/pull/51948
2025-03-13 20:52:23 -04:00
Aleksandr Lesnenko
59c9fd5006 fix model reproductions and filters flakes (#54950)
* fix model reproductions flake

* try a different approach
2025-03-13 19:18:57 -04:00
Edward Paget
b0618df0be fix: more efficient query for execution stats (#55126) 2025-03-13 21:39:45 +00:00
Raphael Krut-Landau
63f7907c2d Simplify Schedule component and improve Schedule story (#54727) 2025-03-13 15:15:52 -04:00
Sloan Sparger
89c0e17f85 [CI] Fix e2e admin database page flakes (#55099) 2025-03-13 12:57:47 -05:00
bryan
7ceebc1df7 mage update (#55108) 2025-03-13 17:09:55 +00:00
Uladzimir Havenchyk
38edfe5102 refactor: convert ParameterFieldWidget to ts (#54916) 2025-03-13 20:01:06 +03:00
Jeff Bruemmer
30cccd3811 docs - note on self-hosted upgrades (#55096) 2025-03-13 12:19:33 -04:00
Uladzimir Havenchyk
dba810264c fix: update filter widget value when we reset value to the default one (#54915)
* rework filters reset tests to work with real data

* fix test

* fix stupid issue

* rename methods

* rework fix and fix the test
2025-03-13 19:09:30 +03:00
Alex Yarosh
e75a354792 Update mysql.md (#55095) 2025-03-13 10:33:29 -04:00
metamben
5000cfec10 Use source column type in drills (#54871)
* Resolve day bucketed columns and do the resolution without bucketing
2025-03-13 14:08:46 +00:00
Timofey Kachalov
7bc0c091b9 test(sdk): Perform type-checking of Embedding SDK CLI snippets (#54972) 2025-03-13 18:07:27 +04:00
Oisin Coveney
1f760489a4 feat(sdk): Ensure that all dashboards use entity ID the same way (#55010) 2025-03-13 15:55:43 +02:00
Romeo Van Snick
220038a90c Bump axios for dependabot alert #188 (#55074) 2025-03-13 14:41:04 +01:00
Oisin Coveney
77456687f0 Remove all mentions of saveToCollection (#54983) 2025-03-13 13:45:45 +02:00
Oisin Coveney
0494356eb9 Add stable IDs for SaveQuestion / InteractiveQuestion (#55024) 2025-03-13 13:45:27 +02:00
Oisin Coveney
65cd90a5b6 feat(sdk): Add entity IDs to CollectionBrowser (#54985) 2025-03-13 13:27:20 +02:00
Phoomparin Mano
7a3dceb4e2 Fix React console errors on unrecognized props in styled components (#55081)
* do not forward unrecognized props

* make shouldForwardProps more explicit
2025-03-13 18:02:53 +07:00
Oisin Coveney
fa41120629 feat(sdk): Add stable ID support where missing (#54975) 2025-03-13 09:47:11 +00:00
Oisin Coveney
bd72a75db8 refactor(sdk): Add targetCollection and deprecate saveToCollection (#54971) 2025-03-13 11:43:47 +02:00
Dan Stone
b998d1e9ff Truncate slack header titles and links if the exceed block limits (#54956)
* Truncate mrkdwn links

They could exceed block limits

* Truncate header block text

* Remove incorrect (testing) block in escaping test

* Make length consts under test public

* Add link truncation test

* Add header truncation tests
2025-03-13 09:33:09 +00:00
Romeo Van Snick
bc2a2ebf22 Custom expression multiline UI (#54084)
* Use lezer parser for custom expressions (#53540)

* Add @lezer/generator

* Add missing value on Token

* Add script to generate lezer grammar parser

* Add @lezer/lr

* Add more tests to tokenizer

* Add lezer grammar for custom expressions

* Generate lezer parser for custom expressions

* Convert TOKEN and OPERATOR to enums

* Make Token type more specific

* Add isReference to identifier token

* Typo

* Add more tests for tokenizer

* Add tokenize alternative that uses lezer grammar

* Remove old tokenizer

* Update location of grammer in generate rule

* Add test cases for tokens that share a prefix

* Merge tokens when necessary

* Only add character error when text is 1 character long

* Reduce the need to manually merge nodes

* Stop the iteration when node is found

* Update tests to be more specific

* Simplify tokenize

* Uncommit edge cases

* Generate parser as js

* Move previous tokenizer tests into expressions folder

* Add typing to unit test

* Allow escaping [] in reference

* Add test for escaping closing bracket

* Handle invalid parses manually

* Add support for signed expressions

* Document parser more

* Add custom tokenizer for Reference

* Make tests more explicit

* Fix e2e test

* Merge old test suite into tokenizer test suite

* Move @lezer/generator to devDependencies

* Custom expression suggestions (#53679)

* Add new suggesters for custom expressions

* Add test for joined fields

* Move complete into separate folder

* Split up completions into separate files

* Split up completion tests too

* Copy more tests from legacy completer

* Fix types

* Lezer highlight for custom expressions (#53651)

* Rename generated parser to lezer

* Add lezer highlighting rules to parser

* Add HighlightExpression component

* Use HighlightExpression in expression HelpText

* Add type annotation to highlighter

* Add test for highlight

* Simplify unit test

* Move syntax highlighting to shared module

* Rename util.tsx to util.ts

* Add monospace font variable

* Use monospace font from theme for syntax block

* Use relative font size in HighlightExpression

* Use mantine var for border-radius

* Add test id to example

* Fix tests that rely on example content

* Move highlighting code to metabase/ui/syntax

* Replace ACE with codemirror in custom expression editor (#53746)

* Rename generated parser to lezer

* Add lezer highlighting rules to parser

* Add HighlightExpression component

* Use HighlightExpression in expression HelpText

* Add type annotation to highlighter

* Add test for highlight

* Simplify unit test

* Move syntax highlighting to shared module

* Rename util.tsx to util.ts

* Add monospace font variable

* Use monospace font from theme for syntax block

* Use relative font size in HighlightExpression

* Use mantine var for border-radius

* Add test id to example

* Fix tests that rely on example content

* Move highlighting code to metabase/ui/syntax

* Replace custom expression editor with CodeMirror editor

* Add test mock for CodeMirror

* Colocate custom expression tests (#53812)

* Remove unused DISPLAY_QUOTES

* Colocate custom expressions diagnostic tests

* Colocate custom expressions process tests

* Colocate custom expressions recursive-parser tests

* Colocate custom expressions typeinferencer tests

* Colocate custom expressions completer tests

* Colocate custom expressions format tests

* Colocate custom expressions resolver tests

* Colocate custom expressions index tests

* Colocate custom expressions pratt compiler tests

* Colocate fuzz tests with custom expressions code

* Update paths for fuzz tests

* Fix types in fuzz test

* Fix types in process test

* Remove unused var

* Remove unused var in generator

* Merge types for custom expressions (#53902)

* Add missing expression types to metabase-types

* Add more explicit types to matchers

* Use Expression type from metabase-types everywhere instead of custom type

* Move matchers to separate file

* Further use Expression types for matchers

* Add types for Metric and Segment matchers

* Fix types in format

* Fix missing types

* Clean up imports

* Split string helpers into separate submodule

* Split identifier helpers into separate submodule

* Avoid importing from index file in expressions module

* Render suggestions and help text in new custom tooltip (#53760)

* Add new help text component for custom expression editor

* Add new suggestions listbox for custom expression editor

* Add helper to find help text by function name

* Add enclosingFunction helper that is more forgiving to broken syntax

* Add new tooltip component for custom expression editor

* Add extension to render custom react tooltips

* Render suggestions in custom tooltip

* Export custom types

* Remove old expression editor popover components

* Add typings to process

* Add missing shortcuts

* Fix example font size

* Fix type imports

* Fix click on helptext

* Stop click propagation

* Fix process types

* Remove superflouous optional chain

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

* Fix types whith optional expressionIndex

* Use imports instead of React namespace

* Use index for key

* Rename util to utils

* Remove unused box shadow

* Remove brackets around placeholder names

* Resize tooltip to avoid it overflowing the window

* Fix line height for args

* Fix missing key icons

* Fix chevron alignment

* Fix types

* Move Listbox resizing classes to Tooltip

* Fix completion template for functions with no arguments

* Add unit tests for enclosingFunction

* Add darker background to expression example

* Remove bold from function call

* Fix imports

* Fix HelpText tests

* Add custom color for highlighted syntax argument

* Use colors from design system

* Fix blurring when switching to a different tab

* Remove trailing comma

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

* Split up effect

* Remove background from template arguments

* Improve tooltip position

* Fix Popover position when selection changes

---------

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

* Fix custom expression editor e2e tests (#53761)

* Fix e2e tests for custom expressions

* Fix unit test

* Fix e2e tests

* Fix types

* Fix moveToStart and moveToEnd by using Home/End

* Add test for popover position

* Remove JSDoc in favor of inline comments

* Add examples of side effects

* Remove shouldContain helper in favour of value()

* Add comment to wait

* Use CustomExpressionEditor helper instead of @formula

* Add wait to reduce flakiness

* Add back in the useful comment about popover position

* Remove superflouous cy.viewport call

* Add helper to accept completion

* Rename helper to verifyHelptextPosition

* Convert comments to cy.logs

* Make sure we don't avoid testing the regression

* Allow customising key with which to accept completion

* Use acceptCompletion helper

* Fix tooltip position bug

* Remove unnused wait

* Add selectCompletion helper

* Fix helper using H

* Add better emulation of copy/paste in reproduction

* Ignore ts error

* Multiline formatter for the custom expression editor (#53973)

* Make type name meaningful

* Add more tests for not isnull, etc

* Remove unreachable code

* Add isEmpty matcher

* Pass query to format tests

* Add stronger types to formatStringLiteral

* Fix CallOptions import

* Implement multiline formatter as a prettier plugin

* Reimplement legacy formatter as new formatter with infinite print width

* Use the new formatter in the expression editor

* Remove legacy expression format files

* Document utils

* Simplify Expression type further

* Fully type test cases

* Remove cast in test

* Add more tests and fix formatting

* Use recurse helper to recurse into path children

* Prefix logical operators

* Improve formatting of logical connectors

* Wait for expression editor to be ready

* Avoid passing unknown html props

* Use selectCompletion helper

* Remove unused @ts-expect-error

* Align UI more to design

* Remove shortcuts in suggestions popover

* Disable popular functions in completions

* Render shortcuts as separate component

* Move NameInput to separate component

* Fix button location when no name input is present

* Remove unused ExpressionWidgetInfo component

* Avoid flicker of shortcut buttons

* Tweak name input padding

* Deduplicate styleTags in Editor

* Do not format on blur and pass through all valid changes

* Split of diagnose and compile step

* Remove unused props

* Do not trigger completion on focus

* Show update button when no name is passed

* Expose expression types

* Use diagnoseAndCompileExpression in lint extension too

* Add toolbar with format button

* Only show popover when user has interacted with editor

* Throw ResolverError when types mismatch

* Fix missing highligh for boolean

* Render errors

* Disable format button when the expression contains an error

* Remove shortcut and popular function completion

* Move Shortcut type to component that uses it

* Fix blur for CustomExpression helper

* Add format helper

* Fix e2e tests

* Fix format helper

* Fix blur helper

* Use actual ellipsis in placeholder

* Add helper for nameInput

* Remove buttons from tab sequence once hidden

* Do not autofocus shortcuts

* Hide shortcuts when error occurs

* Allow reading multiline value

* Fix e2e tests

* Fix unit tests

* Add more tests for multiline custom expression editor

* Debounce error checking

* Add max height to tooltip

* Fix formatting

* Document changing reproduction

* Test wording

* Disable format button when expression is empty

* Do not try compiling when source is empty

* Cancel changes when source changes

* Autofocus editor

* Use Tooltip to mark button

* Remove default autoFocus on button

* Simplify shortcuts show and hide style

* Move shortcuts styles to parent element

* Fix line number alignment

* Add a gap between Cancel and Done buttons

* Always close helptext when suggestions are being shown

* Add usePreventClosePopover hook

* Prevent closing popover from the custom expression editor

* Add tests for not closing on click outside and escape

* Move toolbar down

* Fix e2e tests

* Add format_code icon

* Use correct icon for formatting code

* Use new format code icon in native editor too

* Update Loki Snapshots

* Merge useEffect cases into one

* Allow clicking the shortcuts

* Debounce validation

* Fix React update loop

* Prevent flicker in the listbox completions

* Tweak the linting delay

* Hide shortcuts when there is an error

* Only prevent closing popover when editor is rendered

* Fix width and height for editor widget

* Fix format button positioning

* Fix button alignment in expression editor

* Allow blurring tooltip by clicking nothing

* Add button role to header

* Show modal when clicking outside of editor

* Allow closing editor when it's empty

* Add tests for clicking outside of expression editor

* Fix missing onClose handler

* Add bigger timeout

* Rename Format to Auto-format

* Hide format button when there is an error or editor is empty

* Fix label names in test

* Fix format button test

* Deduplicate tests for exiting the editor

* Fix test

* Fix repro

* Only prevent closing popover when the source has changed

* Fix e2e test

* Hide lint point

* Fix types

* Fix tooltip helptext layout

* Update loki reference

* Only show format button when the expression was validated

* Scale the expression editor with the screen width

* Move usePreventClosePopover into utils

* Remove CloseModal component

* Remove custom PreventCloseContext from Popover

* Skip tests that deal with the click outside and escape behaviour of the custom expression editor

* Remove canPreventCloseHandlers from ClausePopover

* Add lineWrapping to editor

* Fix loki

* Fix loki screenshots

* Fix e2e test

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
2025-03-13 10:03:48 +01:00
William
a258b878f2 SQL Server doesn't cast when compiling uuid field filters (#54996)
Apparently, a filter like `blah in (cast([uuid] as uuid))` is fine in postgres, but sqlserver doesn't like it very
much.  This gives sql server the syntax it needs.
2025-03-13 08:32:44 +00:00
Jeff Bruemmer
3e84a67233 docs - include sdk videos (#54980)
* include sdk videos

* remove queries
2025-03-12 19:42:45 -04:00
Ryan Laurie
c4b56e2920 Add Settings Hooks (#54935)
* add settings hooks

* less hax

* fix type
2025-03-12 17:05:39 -06:00
Aleksandr Lesnenko
b299b37501 mark tooltip specs flaky (#55060) 2025-03-12 23:05:22 +00:00
Ryan Laurie
28c37766de fix bug in env var url component (#54937) 2025-03-12 17:05:06 -06:00
Uladzimir Havenchyk
4413c19c09 rework filters reset tests to work with real data (#54991)
* rework filters reset tests to work with real data

* fix test

* fix stupid issue

* rename methods
2025-03-12 22:05:45 +00:00
Edward Paget
dec524e3f7 fix: bump saml20 library for assertion sig fix (#55055)
Bumps the version of the saml library in order to pull in the fix for messages without top-level signatures, but with assertion signatures.
2025-03-12 21:19:45 +00:00
bryan
9620f5d384 [github action] Update github PRs with links to linear issues (#54779)
* first crack at linear pr link bot

* try it again

* bump actions versions

* bump

* try again

Added Node.js setup step
Added dependency installation step for node-fetch
Changed the ES module import to a CommonJS require statement
Changed variable name from fetch to nodeFetch for clarity

* extract script

* use the right graphql query

* add debug

* look at the right part of the linear api response

* lets see the issue numbers

* again

* again

* again

* again

* again

* again

* again

* again

* again

* fix formatting

* remove ???'s

* improve logging

* check all magic closing words

* refine checking logic

* test

* some review responses

* again

* make github object a thing

* install octokit

* install octokit again

* install octokit again

* running

* running

* running

* running

* running

* delimit message with spaces

* delimit message with spaces

* delimit message with spaces

* delimit message with spaces

* test

* only try to close metabase/metabase issues

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
2025-03-12 13:33:09 -06:00
bryan
0fc06d0a45 fix if statement ordering (#55046) 2025-03-12 18:39:25 +00:00
bryan
f23dc6cb09 mage stats repl (#54993) 2025-03-12 11:47:19 -06:00
lbrdnk
a70efb20c2 Add describe-fields query logging (#55039) 2025-03-12 18:40:49 +01:00
Stas Gavrylov
af2a0dc1b0 Add typescript-plugin-css-modules to improve autocomplete (#55009)
* Add typescript-plugin-css-modules

* Fix TS errors related to className prop
2025-03-12 19:30:28 +02:00
bryan
645d38ff4e never unhide tables w/ cruft settings (#54998)
* never update hidden table visibility_types

* apply the same logic to table recreation

* testing: cruftyness doesnt unhide tables in syncs
2025-03-12 11:25:36 -06:00
Ngoc Khuat
43149ed615 Prevent concurrent init notification and send pulse trigger tasks (#55000) 2025-03-12 15:53:25 +00:00
Alexander Polyankin
809647806d Add E2E tests for bigint values in query results (#54929) 2025-03-12 11:42:16 -04:00
Alexander Solovyov
376b9530a9 CD for internal-tools (#55029) 2025-03-12 14:58:13 +00:00
Edward Paget
8ef101c649 fix: default saml to use http-post binding (#55017)
* fix: default saml to use http-post binding

* fixup! use library release
2025-03-12 14:47:32 +00:00
Aleksandr Lesnenko
f99da3d0f6 make tooltip scrollable (#53730)
* make tooltip scrollable

* specs
2025-03-12 14:42:21 +00:00
Oisin Coveney
70daac31ba Change name of files from Result -> DefaultView (#55014) 2025-03-12 14:40:44 +00:00
Oisin Coveney
6586b589c8 fix(sdk): Popovers not working on Safari (#55012) 2025-03-12 14:20:52 +00:00
Uladzimir Havenchyk
1948044e1d upgrade rspack and swc. includes memory fix (#54970) 2025-03-12 14:13:32 +00:00
Oisin Coveney
4f090e349d Convert cardId to questionId for consistency (#55013) 2025-03-12 14:11:09 +00:00
github-automation-metabase
dd8cff3854 Bump org.jsoup/jsoup from 1.18.3 to 1.19.1 (#54886)
Inspect dependency changes here: https://github.com/jhy/jsoup/blob/jsoup-1.19.1/CHANGES.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-12 13:26:51 +00:00
github-automation-metabase
097f4858a5 Bump com.github.seancorfield/next.jdbc from 1.3.994 to 1.3.1002 (#54883)
Inspect dependency changes here: https://github.com/seancorfield/next-jdbc/blob/v1.3.1002/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-12 15:09:48 +02:00
Filip Hric
9b0866e41b tag tests as flaky (#54957) 2025-03-12 12:45:40 +00:00
Phoomparin Mano
1e590475c9 feat(sdk): experimental react 19 version range support (#54904)
* support react 19 version range in embedding sdk

* sync supported react versions

* add oxford comma

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

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-12 15:15:24 +07:00
Ngoc Khuat
90e3218d66 [Notification] Deadline-based priority queue (#54647) 2025-03-12 02:36:16 +00:00
Fraser
e33e273491 Replace BulkDeleteConfirmModal with ConfirmModal (#54997) 2025-03-12 14:07:07 +13:00
Alexander Polyankin
2781834c49 Remove empty section title from AccordionList (#54860) 2025-03-11 19:51:12 +00:00
Ryan Laurie
0cf6f48ffe Remove legacy setup checklist (#54599)
* remove legacy setup checklist
2025-03-11 13:22:47 -06:00
Konstantin Darutkin
27ffe25aae feat: add data-grid-customization (#54752) 2025-03-11 18:22:11 +00:00
Ryan Laurie
59c81f57e9 Add use-toast hook (#54819)
* add use-toast-hook

* use the new toast hook

# Conflicts:
#	frontend/src/metabase/admin/performance/components/ModelPersistenceConfiguration.tsx

* bonus change slipped in

* use those callbacks
2025-03-11 11:54:20 -06:00
Sloan Sparger
47cb73d999 [DB Routing] Reorganize database page (#54627)
* add new database header, make layout adjustments

* start building connection section

* reorganize connection info section content, migrate danger info section

* reorg

* flow rewired together mostly, connection details form is now in a modal

* make section content components the entire section for better hide/show logic, remove old code comments, show proper engine name in edit db header, hide model actions section if no actions can be taken

* lots of polishing

* fix BE punctuation

* test e2e fixes in ci

* more test fixes

* more test fixes

* fix unit tests

* fix last failing unit test

* fix last e2e test?

* final polish pass from self review

* fix model persistence section and its related tests, reorganize the tests

* fix model persistence section and its related tests, reorganize the tests

* impl feedback from arakaki around creation flow and date format

* clean up last commit

* make modal scroll container limited to the body, remove use of force to find inputs in cypress tests

* impl PR feedback
2025-03-11 12:44:13 -05:00
Timofey Kachalov
dcce112be0 Use a proper sample app release branch (#54857) 2025-03-11 21:18:04 +04:00
Edward Paget
f067c2844a fix: question stats are calculated in sql query (#54932)
* fix: question stats are calculated in sql query

Previously instances could OOM when calculating these question stats if
they had too many cards because we load all these cards into memory.

We were doing this full calculation because we have some data we want to
calculate metrics over stored as json in a text column. This uses native
mysql/mariadb and postgresql json fuctions to calculate those metrics
inside the database prevent us from needing to load everything. That
also means we no longer calculate these json-based metrics for metabase
instances running h2.

* fixup! use older path_exists json function
2025-03-11 11:21:53 -05:00
Stas Gavrylov
e9edc39a9e Make postcss-modules eslint plugin conditional to fix VS Code (#54978) 2025-03-11 16:04:06 +00:00
Nemanja Glumac
489be7cbcd Empty states for the native editor (#54438)
* Add a native editor placeholder text

Resolves CLO-3674

* Keep the "data reference" panel open by default

Resolves CLO-3675

[ci skip]

* Add empty state for snippet sidebar

Resolves CLO-3684

* Empty state for query results panel

Resolves CLO-3676

* More refined way to initialize data reference

* Update copy in e2e tests

* Fix more tests

* Open data reference whenever native editor is open

* Do not alter the initializeQB flow

* Close the data reference sidebar when question settings are open

* Fix a failing Mongo test

* Address review comment
2025-03-11 16:06:54 +01:00
Ryan Laurie
842c421454 fix release notes generation (#54977) 2025-03-11 08:38:55 -06:00
Jeff Bruemmer
eb884a97cd docs - poeditor -> crowdin (#54973)
* crowdin link

* more links

* links
2025-03-11 13:56:24 +00:00
Oisin Coveney
0fbbf95479 Change end to flex-end to remove rspack warnings (#54899) 2025-03-11 12:13:29 +00:00
Nicolò Pretto
1436293fe4 make sdk not error on type error (#54964) 2025-03-11 12:31:07 +01:00
Ngoc Khuat
17bc5eaf31 when an alert failed to execute, make sure task history's status is failed (#54949) 2025-03-11 11:03:33 +00:00
Sébastien
37ec722486 avoid ref on fn component error in console (#54959) 2025-03-11 10:00:44 +00:00
Phoomparin Mano
576567b379 fix(sdk): remove react-router console error in LegendLabel when in React 19 (#54926) 2025-03-11 06:51:50 +00:00
Mahatthana (Kelvin) Nomsawadi
59d5f32f10 fix(sdk): Improve _.compose type + fix SDK type (#54850)
* Improve _.compose type + fix SDK types

* Use a simpler type overloading

* Fix Englishz

* Fix type errors

* Add a comment to clarify extrat type overload

* Clarify the source of code
2025-03-11 06:03:42 +00:00
Ngoc Khuat
590ddeba8f [Notification] fix exception during init notification triggers and skip inactive notifications (#54879)
* make sure init notification skips inactive notifications

* probably going to fix the exception stuff
2025-03-11 13:43:02 +09:00
Fraser
928c6db5c6 Refactor model caching widget to tsx and switch to css modules (#54572)
* Refactor model caching widget to tsx and switch to css modules

* Update cron example to valid one

* Translate or in cron tooltip
2025-03-11 12:48:32 +13:00
Ryan Laurie
001d9b6a5f update some e2e spec timings (#54877) 2025-03-10 16:31:21 -06:00
bryan
bc1a66fcf3 don't try to destructure the setting when missing (#54942)
* don't try to destructure the setting when missing

* also on gsheets status
2025-03-10 22:27:31 +00:00
Riley Thompson
c8a767ece6 Abandon fingerprinting if connecting to DB fails (#54697) 2025-03-10 21:55:01 +00:00
bryan
3d677c736c add deps required by defenterprise{,-schema} (#54875) 2025-03-10 17:15:20 -04:00
bryan
1158d45637 update gsheets setting visibility (#54930) 2025-03-10 20:07:13 +00:00
Nick Fitzpatrick
de4ca7278c Legacy permission and cloud migration modals (#54922) 2025-03-10 16:59:15 -03:00
Eric Normand
2ba1dc95a1 Increase stage limit to 1000 and clarify error message. (#54917) 2025-03-10 14:07:00 -05:00
Alexander Polyankin
311044f5b4 Repro for "Multiple bucketing menus can be opened simultaneously" (#54859) 2025-03-10 14:15:33 -04:00
Alexander Polyankin
0113bac8c7 Fix leaving native query editor with parameters (#54863) 2025-03-10 14:15:18 -04:00
Phoomparin Mano
b178fee0c4 fix(sdk): mark react-dom/client as external to fix warnings in React 19 (#54919) 2025-03-11 00:52:28 +07:00
Phoomparin Mano
44107fdb93 Make pivot tables draggable compatible with React 19 (#54914)
* prevent react-draggable usage in pivot tables

* simplify refs
2025-03-10 23:57:40 +07:00
Alexander Polyankin
c27c08c753 Sortable cleanup (#54865) 2025-03-10 16:14:38 +00:00
Kamil Mielnik
788994f16d Fix - SQL view is opened when creating a question on small screens (#54267)
* Add reproduction for #54124

* Allow closing of sidebar

* Initial fix for #54124

* Add a hook

* Fix translations

* Extract hook

* Revert "Allow closing of sidebar"

This reverts commit 6caa95823e.

* Revert "Add reproduction for #54124"

This reverts commit 781e9af5f3.

* Implement new spec

* Drop redundant ref

* Beautify

* Revert "Fix translations"

This reverts commit 7b8ad142f9.

* Add extra assertion

* Repro #54124

* Refactor

* Merge effects

* Simplify useNotebookScreenSize's return value

* Fix check

---------

Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2025-03-10 14:59:07 +00:00
bryan
b117dc258a Google Sheets Integration - Feature Branch (#51436)
* add fall-through for ignored embedding requests

* Gsheets mb api (#51307)

* send flag to show "connect gsheets" button to FE

* clean up docstring + add etl-connections condition

* metabase api WIP

* align APIs

* include site-url in the HM temp-url api call

* cleanup

* update HM<->MB api to be working (minus temp-url)

* cleanup

* remove some notes

* indentation + linting

* add tests

* fix typo

* remove illustrative (when true ...)

* add frontend for gsheets sync

* update frontend to use changed API

* Gsheets integration: more api alignment (#51492)

* add frontend for gsheets sync

* update frontend to use changed API

* wip

* cleanup

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>

* fix: declare gsheet setting fn before using in getter

* fix: delay u.secret instantiation to prevent build race condition

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

* build: push ee-extra to dev repo, not ee

Cloud wants ee-extra, not just ee

* move settings out of auth middleware ns

- update kondo modules
- add metabase.api.auth ns

* More cleaning up

- update docstring
- remove declares + use {set,get}-value-of-type{!,}
- remove nil state from gsheets setting

* rely on more hm stubs

* save folder_owner to gsheets

* gsheets and hm http client => enterprise

+ move tests too

* require the right namespace

* add migration for is_gsheet to metabase_table

* Gsheets service account be flow (#51997)

* update setup flow to use service-account

* align GET api/ee/gsheets/service-account response

* align the HM service account endpoint

* fix migration yaml

* update test for service accounts

* indentation + migration quibble

* improve error messages + kondo housekeeping

* remove unreachable if-let branch + fix serdes test

* add is_gsheet to mock and test data

* add gsheets setting to serialization test

* fix fe-type-check

* typechecker

* [kondo] defendpoint -> defendpoint2

* Gsheets table management (#52145)

* include dwh ∈ GET /api/ee/upload-management/tables

* cljfmt

* simplify preliminary gsheet definition

* archive cards is a query param

* gsheets: update polling logic + better errors (#52162)

* update polling logic + better errors

* codify protocol for polling folder done-ness

* align on FE polling logic + the real sync complete

* [WIP] testing happy path

* status should be "active"

- remove a bunch of extra debugging

* remove outdated tests + cljfmt

* check admin + use the connection's id w/ delete

- cleanup

* fix :delete /folder + schema on :get /folder

* Gsheets frontend (#51946)

* non-oauth UI

* update api and add disconnect modal

* update illustration and add error displays

* add gsheets sync status

* better copy

* remove test code'

* fix bad api error

* updates to sync status

* Update sidebar entrypoint

* gate things behind the right features

- only show gsheets button
- http requests to /api/ee/gsheets/*

* model/Table has a db_id column not database_id

* add and use simple events

* differentiate failure modes

* + tests and error status codes

* make form submit on enter

* reset gsheet status when there is no gdrive conn

* add debug info

* FIXME FOR TESTING - disable feature checks

* fail on sync error + partially allow deletes

* add database page entrypoint

* FIXME FOR TESTING - set token-status-cache-ttl to 1 second (vs 12 hrs)

* only show _active_ dwh tables

* fix config.edn (howd it break tho?)

* handle multiple gdrive connections

- on delete, delete them all
- when looking at syncing, look at the most recent one

* add auto-cruft-tables to metabase_database.setting

- Here's the contract:

There should be an array of strings located at: db > settings >
"auto-cruft-tables". Each string will get fed into re-pattern. The table
names get lowercased before getting matched on. That list of regexes is
combined with our built in list of crufty regex patterns. We use re-find
to match them against the lower-cased table names. If there's a match we
will mark the table crufty (this is called a "Hidden Table" in the UI).
This way, if someone names their sheet `I'mUnique____dlt_loads` or
whatever they can at least fish it out of the hidden section.

Note: It will get set back to being crufty (aka what the ui calls
hidden) on the next sync... but this is configurable so we can fine-tune
the regexes to match the tables we want to hide more closely.

Examples:

If you put ["a"] in the config.yml: any table with A or a in it will be
marked hidden. So be sure to use anchors for the suffix or what-not. For
our thing, I think we want something like:

* add bunch of tests for auto-cruft

* mocked api tests

* add commment + mock hm responses

* documentation

* when multiple gdrive conns, sort by status, then created-at time

* cleanup

* joda time Instant/ofEpochSecond 0 -> t/instant 0

* if no gdrive conns are found, reset state

- add gdrive sorting tests

* indentation

* fix complete sync state and add error state

* update sync unit tests

* update sync unit tests

* add frontend analytics events

* don't show reconnect copy from DB page

* Add 10 minute timeout for polling connection

- return errors as json-encoded :error in the response body
- minor cleanup how we auto cruft tables (no change to behavior)
- add script for running the flow locally: from the repl

* better FE sync state and form validation

* refresh setting on error

* remove fake error state

* Delete connections on reset

- Change order of timeout checks in :get /folder handler
- add auto-cruft-columns setting

* update gsheets routes to use the new ns-handler

* loosen up gdrive link validation

* update regex

* add docstring to dynamic timeout var

* simplify api use via gdrive conn id

- move ->config into hm.client ns

* recover from suddenly-missing gdrive conn @ id

* cleanup hm.client

- indentation

fix [[make-request]] args

* fail to load invalid + present cruft patterns

* remove some extra comments + use hm-delete-conn

* fix update-table-metadata

- (no longer update nil -> nil)

* auto cruft columns

- pull the regex comparrison code into crufty ns
  - reuse it on 2
- add defsetting so having the setting on the database doesn't complain
- pass database down into field syncing + grab vis types

* indent

* fix a few tests

* fix gsheets tests

* add harbormaster client test

* kondo + cljfmt

* migrate to underscores for auto_cruft_*

- add tests for field + fix schema for table syncs

* use kebab-case for settings but accept snake_cased

* cljfmt + kebab case stragglers

* fix update-field-metadata-if-needed! signature

* fixing tests

* rename macro double -> run-twice

* remove test code

* prettier

* cruft settings are db-local

* Fix search index update job restart issue (#53229)

* more idiomatic crufty db-local settings

* add auto cruft fields test

* bump gsheets sync timeout to 10 seconds

* handle going back to loading state

* kondo + add empty cruft tables test

* add get folder timeout test, update dox,

- remove regex folder check

* add cruft columns config.yml setup tests

* remove def + actually run the test

* test code for bruyan

* reset gsheets status on every error response

* save dbId and actually show it

* bust cache on gsheets setting

* solve initial-sync-status-table-only-test failure

* Update src/metabase/sync/sync_metadata/crufty.clj

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

* Update enterprise/backend/src/metabase_enterprise/advanced_config/file/databases.clj

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

* Update enterprise/backend/src/metabase_enterprise/advanced_config/file/databases.clj

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

* Update enterprise/backend/src/metabase_enterprise/gsheets.clj

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

* respond to Noah's review comments

* kondo

* update modal copy

* update error copy

* status click target update

* improve crufty/name? api

* modularize gsheets

* remove temp gsheets

- token status checks happen once per 12h
- remove hm/conn and mb/sync-info from :get /folder response

* gdrive-conn is now unused

* remove comment

* fix modules

* add docstring

* add harbormaster module

* kondo

* fix the tests

* module linter

* fix typo

* cljfmt

* setup api-key setting before reading it

* sort ns

* ::snowplow/simple_event -> :snowplow/simple_event

* hard code error message

* remove test code

* update frontend tests

* update module linter config

* add simple schema snowplow event schema

* fix schema name

* update some tests

* add a test

* better docstring

* better docstrings

* fix e2e tests

* fix fe token mock

* respond to review comments

+ fix timeout 50000 -> 5000
+ make internal regex function private

* build: push ee-extra to dev repo, not ee

Cloud wants ee-extra, not just ee

* fix strings

* remove resolved comment

* adds prometheus metrics to gsheets api

- :metabase-gsheets/sync-creation-begin
- :metabase-gsheets/sync-creation-ok
- :metabase-gsheets/sync-creation-error
  - failure-reason is one of:
  - "timeout" - gsheets.api/sync-complete? didn't return true after 10 minutes
  - "status_error" - HM said the sync connection had status == error
- :metabase-gsheets/connection-deleted

* Refines prometheus events

They are now:

- :metabase-gsheets/connection-creation-began
- :metabase-gsheets/connection-creation-ok
- :metabase-gsheets/connection-creation-error {:reason "status_error"}
- :metabase-gsheets/connection-creation-error {:reason "timeout"}
- :metabase-gsheets/connection-deleted

* comment

* allow resolution of snake_cased setting names

* review responses

* add logging if any part of the batch-delete fails

* remove unused schema

* Revert "remove unused schema"

This schema is actually used! 🎉

This reverts commit f5dbd78051.

* update loki icon reference image

* switch off flaky test setup

* mark date filter picker tests flaky (#54866)

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Filipe Silva <filipematossilva@gmail.com>
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2025-03-10 14:41:39 +00:00
Luis Paolini
26b310be01 Fixes https://github.com/metabase/metabase/issues/12987 (#51692) 2025-03-10 14:34:55 +00:00
Alexander Solovyov
3332a7d59e disable backend codeowners (#54831) 2025-03-10 10:57:11 +00:00
Chris Truter
f10b22c2f2 Scrap the ability to resolve table names, just use ids (#54839) 2025-03-10 10:48:34 +00:00
Stas Gavrylov
5ec66916c3 WRK-114, WRK-115: Update Alerts scheduling component (#54788)
* WRK-114,WRK-115: Replace SchedulePicker with Schedule in Alerts.

Integrated a newer feature-rich component for Alerts scheduling.
Fixed bug related to incorrect handling of '*' values in minute and hour
alerts.

* Remove scaling transition from popInFromBottom animation.

This transition used for all modals led to a bug with sizing in some
Mantine components, when they were used inside a modal:
https://github.com/mantinedev/mantine/issues/6967#issuecomment-2417439117
2025-03-10 12:44:57 +02:00
John Swanson
9c6fe31a4c Fix schema-wide data permissions for huge schemas (#54858) 2025-03-10 03:02:51 -07:00
Mahatthana (Kelvin) Nomsawadi
89054f1a73 ci(sdk): Fix mysterious sdk deployment failure on 52 (#54890)
* Reuse Personal Access Token on all tasks

* Fix permission when pushing to GitHub

* Use annotated tag for better information

* Remove steps for faster testing

* Revert "Remove steps for faster testing"

This reverts commit 8bd5d2e07f.
2025-03-10 08:48:10 +00:00
Fraser
262a69e01b Create confirm modal component (#54632)
* Create confirm modal component and use in query builder
2025-03-10 11:30:02 +13:00
Oleksandr Yakushev
19e805d085 test: Reuse source database in load_from_h2 tests (#54165) 2025-03-08 18:18:28 +02:00
Nick Fitzpatrick
1bf46c862f Migrating composed modals to simple modals (#54685)
* Migrating composed modals to simple modals

* fixup
2025-03-08 09:36:45 -04:00
Ryan Laurie
5088ddb83a Refactor SettingHeader (#54823)
* Refactor SettingHeader

* use divs

* index to ts

* index to ts

* fix title

* add boxprops
2025-03-08 00:21:08 +00:00
Nick Fitzpatrick
80e982b224 Fixing select dropdown in append data modal collection view (#54864) 2025-03-07 18:17:56 -04:00
Ryan Laurie
90490efa14 mark date filter picker tests flaky (#54866) 2025-03-07 21:41:37 +00:00
Ryan Laurie
727c8c7ff4 Use PAT for git tagging (#54868)
* use PAT for git tagging

* use token more
2025-03-07 21:01:40 +00:00
Ryan Laurie
fbb5088df3 Allow sending release notes to website (#53418)
* allow sending release notes to website

* use generic version

* cleanup and add tests

* whitespace

* linkify website changelog
2025-03-07 12:29:56 -07:00
Ryan Laurie
f78fa85411 fetch settings using RTK Query (#54687)
* fetch settings using RTK Query

* type fixes

* 💪

* fix type 🤞
2025-03-07 12:13:41 -07:00
bryan
b05fd4f511 adds cljfmt-updated task (#54861) 2025-03-07 18:47:40 +00:00
Filipe Silva
fe66a8f862 fix: download all clj deps before builds (#54852)
Prevents a race condition where both clojure and shadow-cljs would be
downloading deps at the same time.
2025-03-07 18:23:26 +00:00
Aleksandr Lesnenko
e4a6d8a81e feat(sdk): Revamp TableInteractive visualization component: update header styles, add text wrapping, and row indices (#54399)
* use tanstack datagrid for the table visualization implementation
2025-03-07 18:18:19 +00:00
Anton Kulyk
769bd1ee1b Fix "decimals" viz setting ignored when formatting numbers (#53053)
* Respect "decimals" setting when formatting compact numbers

* Update loki screenshots
2025-03-07 17:07:05 +00:00
Alexander Polyankin
da5e954e63 Fix initial focus of the filter modal (#54817) 2025-03-07 11:41:35 -05:00
metamben
5a9d4baa53 Allow single argument between parameters on the backend (#54848)
Backend part of the fix for #54364
2025-03-07 15:52:46 +00:00
Nathan Voxland
4f7b3c27cf Added additional API tests for /public and /api/public (#54756) 2025-03-07 09:21:50 -06:00
Chris Truter
40ba06c779 Expire pending search indexes eventually (#54834) 2025-03-07 16:20:31 +02:00
Dan Stone
1fc41425ff Drop public channel requirement for slack images (#54276)
* Prefer slack_file for images, so metabase no longer requires a public files channel

This removes the requirement to have a public files channel so share
images or other files in slack bot posts. Simplifying the integration
and lessening requirements to get setup.

It enables the posting of images files directly to public or private
channels without sharing - improving privacy and security.

* Files channel deprecation note

* Drop slack-files-channel requirement from slack /settings API

* Remove remaining files-channel calls

* Remove files channel input from SlackSetupForm

* Remove slack-files-channel from SettingsManagerSettings

* Remove slack-files-channel from API docs

* Drop files channel configuration guidance

* Remove slack channel prompt/description

* Instead of polling files.read reuse the complete call

There was an accidental introduction of files.read.

The goal is to preserve the previous behaviour of reusing
completeUploadExternal.

This limits the oauth scope requirements of the bot token.

* If more than 50 slack blocks, send using multiple messages

* Escape mkdwn special-processing chars in card links

* Simplify slack attachment uploading

- Its easy to mapv
- (cond) over nested (if)s
- Fix out of date docstring

* Remove slack-files-channel from config-template.md

* Remove metabase_files check from e2e suite
2025-03-07 14:11:51 +00:00
Phoomparin Mano
2917e8c418 Replace defaultProps in styled and functional components (#54725)
* cleanup defaultProps in BaseItemsTable

* cleanup StrategyFormLauncher and QuestionModerationSection

* cleanup BookmarkToggle and TableSimple

* cleanup additional styled components

* cleanup PermissionsSelect and SmartScalarSettingsWidget

* additional styled default props cleanup

* cleanup defaultProps

* cleanup remaining defaultProps

* cleanup type imports

* cleanup IconContainer

* cleanup NodeRootProps

* remove text.0

* forward ref for BookmarkButton

* cleanup DoneButton

* default to ContentTable instead

* forward ref for legend description icon

* forward ref for more icons

* forward ref for more icons

* forward sortingIcon ref

* forward IconButtonWrapper ref

* merge classes for items table
2025-03-07 20:37:18 +07:00
Chris Truter
e83347e888 Create search index within transaction (#54832)
Not all drivers will actually do DDL statements transactionally, but it doesn't hurt to try.
2025-03-07 12:43:04 +00:00
Chris Truter
55067acdb0 Revert search indexing error workaround in #52072 (#52111)
- Fix flake by disabling index (cop out)
- Make h2 implementation thread-safe
- Small optimization
- Hide some log noise
2025-03-07 12:39:28 +00:00
Jeff Bruemmer
ce06b0b2da update banner (#54800) 2025-03-07 07:34:14 -05:00
Alexander Polyankin
699acf861a Remove unused temporal interval translations (#54826) 2025-03-07 06:41:04 -05:00
Phoomparin Mano
87c2542531 Replace findDOMNode in core components (#54650)
* replace use of findDOMNode in core components

* do not wrap input in div

* always populate scrollElementRef

* remove scrollElement from TokenField

* do not export _TokenField

* remove scrollElementRef

* use appropriate ref container

* cleanup root container

* use the scrollingContainerRef instead

* pass the elementRef directly

* use full-width container

* remove full-width container

* use display contents to preserve layout

* attach listRootRef conditionally

* try to update Loki snapshots

* modify snapshots

* fallback to scrollingContainer instead of elementRef

* revert loki snapshot

* revert loki snapshot to master
2025-03-07 13:54:27 +07:00
Alexander Polyankin
d8ce2f9efe Fix a case when the template tag's type was changed and the original question was an MBQL query (#54804)
* Do not use originalQuestion when changing the template tag's type

* Do not use originalQuestion when changing the template tag's type

* Fix test

* Fix

* Fix

* Fix

* Fix

* Fix
2025-03-06 17:23:32 -05:00
Uladzimir Havenchyk
2bc8821ac4 fix: select dataset editor header column after reordering by the corner (#54692)
* fix: select dataset editor header column after reordering by the corner

* enable fix

* use index

* rename method
2025-03-06 21:43:24 +00:00
Ryan Laurie
4cba32d8bb Enable multi-arch builds in publish workflow (#54473)
* build multi-arch arm image

* refactor artifact fetching and containerizing

* fixes after testing

* use old master for caution's sake

* enable multi-arch in publish workflow

* sync
2025-03-06 14:08:50 -07:00
Nathan Voxland
b93b078706 Hash id in core_session table (#53266) 2025-03-06 15:04:18 -06:00
Nathan Voxland
04693bc9d1 Don't update dashboard updated_by if only last_viewed_at changes (#54613) 2025-03-06 13:18:44 -06:00
Tyler Plude
52baee0550 Fix frontend parsing of allowed iframe hosts (#54111)
* Fix frontend parsing of allowed iframe hosts

* Adding spec for allowed domain list parsing change
2025-03-06 11:17:57 -08:00
bryan
68d6537dd7 update download jar (#54811) 2025-03-06 18:38:38 +00:00
Filipe Silva
4fb7432514 fix: add socket to cloud dev aliases (#54803) 2025-03-06 18:34:28 +00:00
Alexander Polyankin
ef154c5fd2 Make expression editor not crash on missing entities (#54768)
* Make expression editor not crash on missing entities

* Review comments
2025-03-06 18:13:42 +00:00
Case Nelson
78cd2283cd support: More logging for field sync. (#54774)
Part of #54559

This adds `trace` level logging to:
- `metabase.driver.athena`
- `metabase.sync.sync-metadata.fields.sync-instances`

That should help us diagnose sync issues where describe-fields and
fingerprinting seem to be out of sync.
2025-03-06 10:58:32 -07:00
Jeff Bruemmer
a0cab0ce80 docs - note on literals with special characters (#54806)
* note on literals with triple braces

* edit
2025-03-06 17:38:06 +00:00
bryan
45f541521b eid-translation module (#54542) 2025-03-06 09:41:33 -07:00
Alexander Polyankin
2bcf0ca5e8 Fix offset intervals translations (#54772) 2025-03-06 11:40:16 -05:00
Alexander Polyankin
e4c50175c2 Clarify parsing & escaping of filter values (#54771) 2025-03-06 11:28:03 -05:00
Nicolò Pretto
bbd40b5997 fix: CheckboxTooltip should have only 1 child (#54798) 2025-03-06 16:14:17 +01:00
Timofey Kachalov
8cbecd8908 Add Sample Apps compatibility with Embedding SDK tests documentation (#54723) 2025-03-06 18:17:51 +04:00
Phoomparin Mano
e476bee260 Remove findDOMNode from visualization components (#54707)
* remove findDOMNode usage in viz components

* remove type cast

* expose rootElement via ref
2025-03-06 19:59:45 +07:00
Filip Hric
16d69499f0 stabilize flaky test (#54789) 2025-03-06 13:37:43 +01:00
Filipe Silva
037c3eb57c fix: package.json script should use && (#54753)
* fix: package.json script should use &&

Followup from https://github.com/metabase/metabase/pull/54667

* fix: cloud:dev process labels were switched
2025-03-06 12:35:07 +00:00
Eric Normand
44bc8c72f2 Clean template tags when changing databases (#54453)
* Clean template tags when changing databases

* WIP add tests

* Remove println

* Make :dimension optional on :field-filter

* Don't run native queries with incomplete field filters

* Add helpful comment

* Fix cypress tests

* Remove commented code
2025-03-06 12:03:17 +00:00
Eric Normand
6406f7b2bd Fix type logic for datetimeDiff() for days on postgres (#54709)
* Subtracting 2 dates gives a number of days (integer)

* Add test for all postgres time units for datetimeDiff()
2025-03-06 11:52:57 +00:00
Ngoc Khuat
0cd7a19b1b [Notification] Dedup send queue (#54320) 2025-03-06 17:24:55 +07:00
Mahatthana (Kelvin) Nomsawadi
fa7ca671b6 ci(sdk): Send SDK release notification to Slack (#54733)
* Update Slack util

* Standardize job name

* Add slack notification for SDK

* Debug: remove other jobs

* Add failure message

* Add build successful notification

* Connect Slack jobs with real jobs

* Debug: disabled steps

* debug: mock failure

* Re-enable everything

* Update channel name
2025-03-06 06:58:14 +00:00
bryan
e1800cda38 fix examples for mage cljfmt-files (#54773)
* fix examples for mage cljfmt-files

+ test was broken

* fix tests + ./bin/mage by itself is ok
2025-03-05 22:43:40 +00:00
Oleksandr Yakushev
e9195acea6 [db-pool] Try again to address the thread deadlock caused by c3p0 (#52351) 2025-03-05 23:53:55 +02:00
Riley Thompson
fceee59fad Update required driver fields and placeholders (#53693) 2025-03-05 16:36:26 -05:00
Alexander Polyankin
4a766ed1aa Fix temporal unit interval translations (#54686) 2025-03-05 20:21:55 +00:00
Alexander Polyankin
a88224854a Repro test (#54762) 2025-03-05 14:33:27 -05:00
Alexander Polyankin
594584dbb5 Fix large filter pill text wrapping (#54757) 2025-03-05 14:33:14 -05:00
Vamsi Peri
9313a21937 New semantic layer team (#54736)
* New semantic layer team

* Update team.json
2025-03-05 19:06:17 +00:00
Alexander Polyankin
fe707e4c5e Do no singularize or pluralize table and column names in drills (#54659) 2025-03-05 13:38:40 -05:00
Alexander Polyankin
715ee2c568 Support relative-time-interval in the expression editor (#54671) 2025-03-05 13:37:05 -05:00
Luis Paolini
199c50319f Add a nitpick for postgres and impersonation (#54424)
* Add a nitpick for postgres and impersonation

Something that a customer saw, and might be interesting for posterity

* Update docs/permissions/impersonation.md

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

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-05 18:29:36 +00:00
Luis Paolini
b35f4f0f72 Update running-metabase-on-docker.md (#54571)
* Update running-metabase-on-docker.md

Add a note since people think that this is the official way to run Metabase

* Update running-metabase-on-docker.md

* Update running-metabase-on-docker.md

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2025-03-05 18:27:19 +00:00
John Swanson
561ccbc397 allow healthchecks for h2 dbs (#54674) 2025-03-05 09:47:56 -08:00
Alexander Polyankin
1316be26cd Fix token unescaping in the expression editor (#54751) 2025-03-05 17:46:58 +00:00
Jeff Bruemmer
05e28ddd34 check for anchors (#54743) 2025-03-05 12:17:46 -05:00
Nathan Voxland
57e157c082 Only include personal emails in admin recipients (#54658) 2025-03-05 10:34:11 -06:00
Nathan Voxland
fd2edb8ba8 Don't allow pulse.updated_at to change when dashboard changes (#54670) 2025-03-05 10:31:52 -06:00
Aleksandr Lesnenko
12e2dd86e2 use new endpoints for tiles in the pin map viz (#54475)
* use new endpoints to load tiles for pin map

* Fix public endpoints for unauthneticated users

* use new BE api for pin maps

---------

Co-authored-by: Noah Moss <noahbmoss@gmail.com>
2025-03-05 11:01:20 -05:00
Edward Paget
b35022d96a fix: update saml20 for full SAML SLO support (#54285)
* fix: update saml20 for full SAML SLO support

Update metabase to use a new version of the saml20-clj library that
correctly builds and signs HTTP Redirect requests and provides support
for checking LogoutResponses.

Note right now SAML SLO cannot be enabled just through the API it
requires the following settings to work correctly:

* saml-slo-enable - must be true
* saml-identity-provider-slo-uri - must be set to the IdP's SLO endpoint
* session-cookie-samesite - must be set to none

For the samesite none cookie to work metabase must be served over SSL.
Without this setting Chrome (and other browsers) will not send the
cookie when Okta redirects to our SLO endpoint which means we can't sign
out the user session.

* fixup! kondo lints
2025-03-05 09:41:18 -06:00
Jeff Bruemmer
047053159e docs - images and links (#54734) 2025-03-05 09:35:37 -05:00
Nicolò Pretto
cbf51e6dc3 fix(sdk): wrong icon on visualization selector (#54724) 2025-03-05 15:13:59 +01:00
Jeff Bruemmer
2772090d72 docs - rename SQL snippets to snippets (#54507)
* SQL snippets to snippets

* rename file

* snippet folder
2025-03-05 08:37:03 -05:00
Ngoc Khuat
f68c0e25c0 Return http channels for admins or users with settings permissions only (#53210)
* feat(frontend): allow non admin users to create alerts (#54426)

---------

Co-authored-by: Konstantin Darutkin <spalt08@mail.ru>
2025-03-05 13:05:51 +00:00
Chris Truter
7a4c66d413 Table Data Editing APIs (#54651) 2025-03-05 10:47:39 +00:00
Nicolò Pretto
c1aeb94b8f docs: update some other docs about e2e for the sdk (#54718) 2025-03-05 10:50:04 +01:00
Alexander Polyankin
7f07975d15 Prevent from using millisecond with datetime-diff (#54531)
* Fixes

* Fix

* Fix

* Fix

* Add tests

* Add tests

* Add tests

* Fix description

* Fix description
2025-03-05 12:11:09 +03:00
Stas Gavrylov
6f6909c5aa WRK-81: Subscriptions can include unwired filters which is confusing (#54508)
* WRK-81: Hide unwired filters from subscriptions panel

* WRK-81: Refactor AddEditEmailSidebar to TypeScript.

* WRK-81: Refactor AddEditSlackSidebar to TypeScript

* Hide parameters section if none are connected. Update typings
2025-03-05 10:59:26 +02:00
Mahatthana (Kelvin) Nomsawadi
70cada082b Update stable tag (#54710) 2025-03-05 08:39:58 +00:00
Roman Abdulmanov
5755ee06f6 Disabled feature merged notifications (#54713) 2025-03-05 11:10:04 +03:00
Phoomparin Mano
6a15b7f463 Remove the legacy isModal context from ModalContent (#54660) 2025-03-05 13:44:51 +07:00
Ngoc Khuat
f283daa3f0 Moduralize notification (#54556)
* moduralize notification, tests are passing

* kondo and clj-format

* test fixes

* fix some spacing

* test fixes
2025-03-05 04:14:47 +00:00
bryan
ba3e008d41 Metabase Automation Genius Engine (#54091)
* booting up mage

* indent -> format

* formatter help

* Kondo commands

* Clear cache when running Kondo

* start-db command

* Add aliases in deps.edn

* comments + more

* subsume new commands into bb

* add mage_verbose env var

* add tests

* refine tests + check github action output

* run the tests

* add mage tests to backend workflow instead

* min version + rip out b/ask!

* Fix start-db latest

* actually call it with --help

* add readme entry for bb tasks

* move project-root-dir into util

* add mb download jar + cleanup bb.edn

* cleanup + fix jar downloader

* run tests

* finish removing bask

* add mage and jar downloader

* setup ./bin/mage entrypoint [responding to user research]

* uopdate examples

* update readme

* add todos

* add autotab + deprecate obsolete scripts

* migrate instructions for cljfmt over to mage

* respond to ./bin/mage kondo-updated master

* linting branding, clean up cli for fmt

* fix comment

* more tests

* better explainations of what mage is doing

* remove empty task -new-task!

fix start-db

* handle missing deps-edn-hash

* make start-db work with mysql and maria

* improve ux + simplify option and arg parsing

* add optional :usage-fn to task definitions

* cljfmt-* {-c}, and jar-download working

* last bit of cleanup

* docs

* add examples exit-codes test: ./bin/mage -test-examples

* add deprecation warns to old shell scripts + docs

* remove typo

* better errors

* typos

---------

Co-authored-by: Cam Saul <github@camsaul.com>
2025-03-04 16:56:11 -07:00
Oisin Coveney
22557bf7b6 Convert rest of RuleEditor to Mantine (#54476) 2025-03-04 22:20:06 +00:00
Alexander Polyankin
96fed1a4c2 Show an error message when overwriting a card with a cycle (#54610)d
* Fix bug

* Fix bug
2025-03-04 16:54:30 -05:00
Oisin Coveney
6e784167ea Convert RulePreview to Mantine (#54472) 2025-03-04 21:24:39 +00:00
Oisin Coveney
0e6d999f8f Convert ColorRange + RuleBackground to Mantine (#54469) 2025-03-04 21:24:23 +00:00
Alexander Polyankin
a9379e2579 Do not display the raw data toggle when displaying table, even with reordered columns (#54668) 2025-03-04 15:21:33 -05:00
Uladzimir Havenchyk
fb645c672d fix: clear dashboard url from undefined when filter is removed (#54600)
* fix: clear url when filter is removed

* add e2e test
2025-03-04 22:36:11 +03:00
Filipe Silva
d768c1e51e build: fixes for cloud dev (#54667)
* fix: :dev-start would not call start!

* build: cloud:dev npm script for when working in cloud
2025-03-04 19:14:12 +00:00
Oisin Coveney
d1aa6ff450 Convert RuleListing to Mantine (#54471) 2025-03-04 10:54:36 -08:00
Oisin Coveney
9eea43baee Convert RuleDescription to Mantine (#54470) 2025-03-04 10:50:23 -08:00
Timofey Kachalov
0ba3bfecb8 Integrate Sample Apps e2e tests with CI (#54579) 2025-03-04 22:07:22 +04:00
Alex Yarosh
f3189fcc43 docs: Update Usage analytics (#54657)
* Update usage-analytics.md

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-04 17:49:01 +00:00
Konstantin Darutkin
8d82cbafd6 fix(frontend): update single alert condition style (#54587) 2025-03-04 17:19:20 +00:00
Nicolò Pretto
9da93a751d docs(sdk): update the command to run sdk e2e (#54666) 2025-03-04 18:17:20 +01:00
Nicolò Pretto
b427265c7d fix(sdk): move import of mantine css to index file of sdk (#54602)
* fix(sdk): move import of mantine css to index file of sdk

* put back the css in core app
2025-03-04 18:03:51 +01:00
Phoomparin Mano
d45816434e Bump react-virtualized to 9.22.5 to unblock React 19 (#54645)
* bump react-virtualized to 9.22.6

* bump the types for react-virtualized to latest in DefinitelyTyped

* try using 9.22.5 instead of 9.22.6
2025-03-05 00:01:52 +07:00
Phoomparin Mano
ded9cde3b2 Bump react-grid-layout to 1.4.4 to unblock React 19 (#54644)
* bump react-grid-layout to 1.4.4

* bump the types for react-grid-layout to latest in DefinitelyTyped
2025-03-04 23:44:07 +07:00
Carlos Sánchez Páez
9f8fd15204 54138 Upgrade node to v22 in Dockerfile & docker-compose (#54436)
* 54138 Upgrade node to v22 in Dockerfile & docker-compose

* Update docker-compose.yml

---------

Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
2025-03-04 11:30:48 -05:00
Luis Paolini
12db805680 Update activating-the-enterprise-edition.md (#54430)
* Update activating-the-enterprise-edition.md

Added proxy for containers

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-03-04 12:34:29 +00:00
Mahatthana (Kelvin) Nomsawadi
f4171427b2 feat(sdk): Simple data picker (#54489)
* Simple data picker UI (#52964)

* Add SimpleDataPicker base component

* Finish the flattened list version of the simple data picker

* Add selected entity state

* Fix the new simple data picker got run with loki accidentally

* Update frontend/src/metabase/embedding-sdk/components/SimpleDataPicker/SimpleDataPicker.tsx

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

* Fix selected data source icon color

* Add an empty state

---------

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

* Real simple data picker (#52965)

* Connect data to the data picker

* Sort the entities alphabetically

* Make sure the data picker icon is always table

* Fix unit tests

* Fix interactive embedding E2E tests

* Force table icon on the DataPickerTarget for simple data picker

* Remove commented out code

* Remove tests that don't apply to the new simple data picker

* Fix passing wrong table ID

* Ensure we can only join data from same DB

* Make component name better

* todo

* better simple data picker UX

* Add multi stage embedding data picker back

* Able to force complex data picker in interactive embedding

* Fix tests for simple data picker

* Add old tests back

* Add simple data picker tests back

* Fix unit tests

* Fix SDK tests

* Remove ability to force multi stage data picker

* Add cross-db join tests for simple data picker

* Simplify code

* Fix popover not closing since Mantine prop changes

* Add simple data picker data source ordering tests

* Fix conflicts from merging master

* poc async plugins

* Remove SDK plugins poc code

* Fix unit tests after moving code to EE folder

* Mock search query explicitly

Co-Authored-By: Alexander Polyankin <alexander.polyankin@metabase.com>

* Don't modify cljs objects

Co-Authored-By: Alexander Polyankin <alexander.polyankin@metabase.>

* Reduce the ambiguity around NaN value

Co-Authored-By: Alexander Polyankin <alexander.polyankin@metabase>

* Remove dependency from an unrelated module

Co-Authored-By: Alexander Polyankin <alexander.polyankin@metabase>

* Fix SDK unit tests not running because EE plugins

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase>

* Fix embedding data picker not filtering by selected database (#54272)

* Fix embedding data picker not filtering by selected database

* Add an E2E test

* Fix SavedEntityPicker doesn't filtered out items in a selected DB

* Fix TypeScript types

* Address review, not passing unnecessary props

* Fix failed tests by using the same snippet in the past

* Hide metrics/saved questions from multi-stage data picker (#54409)

* Hide metrics from multi-stage data picker

* Hide saved questions from multi-stage data picker

* Modify saved questions tests

* Modify metrics tests

* Address review: create a new test suite and put tests there

* Adjust the data picker min-height according to review

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase>
2025-03-04 10:05:45 +00:00
Roman Abdulmanov
86338d9a8b removed GH project urls (#54639) 2025-03-04 12:18:05 +03:00
Mahatthana (Kelvin) Nomsawadi
a3647a71c5 refactor: "Get embedding code" width too narrow (#54574)
* A more idiomatic fix

* Add an assertion
2025-03-04 07:41:29 +00:00
Sébastien
0fbe8cf3b1 Closes viz-474: conditional formatting polish (#54483)
* :x

* fixup

* useToggle -> useDisclosure

* deprecate useToggle in favor or useDisclosure
2025-03-04 08:33:21 +01:00
Ngoc Khuat
92ff77263a Robustly initialize notification triggers (#54577) 2025-03-04 04:29:52 +00:00
Raphael Krut-Landau
91f4922e15 Increase e2e test coverage for sandboxing (#53776)
Let's improve coverage of sandboxing in e2e tests.

These tests cover the following kinds of sandboxing policies:
* Filter by regular column
* Filter by custom column
* Use a custom view to filter a table

The tests verify that these sandboxing policies correctly affect:
* Saved questions
* Models
* Questions based on questions
* All of the above, when viewed in a dashboard
* Adhoc questions
* Filter values
2025-03-03 21:02:07 -05:00
Ryan Laurie
9a65e0b6c4 Build multi-arch arm images (#54156)
* build multi-arch arm image

* refactor artifact fetching and containerizing

* fixes after testing

* backwards compatibility

* use old master for caution's sake

* update release code tests

* just bash it
2025-03-03 21:53:42 +00:00
Noah Moss
874c11e806 Guard enforced-sandboxes-for-user against nil user-ids (#54605)
* guard enforced-sandboxes-for-user against nil user-ids

* add comment

* Fix e2e test

* try again to fix e2e test
2025-03-03 16:52:06 -05:00
Oisin Coveney
cd06480c6b fix(sdk): Fix ColorSelector in Conditional Formatting (#54402) 2025-03-03 13:07:18 -08:00
Uladzimir Havenchyk
d71862d041 fix: close date filter on esc (#54499)
* fix: close date filter on esc

* fix test

* fixup
2025-03-03 21:03:50 +00:00
Alexander Polyankin
92a5a6816d Repro for "Date filter translations: Key not being translated" (#54619) 2025-03-03 20:43:16 +00:00
Nick Fitzpatrick
c76be91169 Updating InputWithSelectPrefix to Mantine components (#54536)
* updating InputWithSelectPrefix to Mantine components

* fixing the border, and tests
2025-03-03 14:39:28 -06:00
Alexander Polyankin
9ef9186dd7 Fix duplicates introduced by column sync (#54611) 2025-03-03 20:11:44 +00:00
Oisin Coveney
609d4923f9 Add "for React" to SDK in legalese modal and settings page (#54534) 2025-03-03 12:02:15 -08:00
Oisin Coveney
752e9246e5 fix(sdk): Fix ColorRangeSelector in Conditional Formatting (#54450) 2025-03-03 12:01:32 -08:00
Nick Fitzpatrick
f12e332019 add ability to style SpecialTagInput, update MultiAutocomplete styles (#54533)
* add ability to style SpecialTagInput, update MultiAutocomplete styles

* get outta here, stupid

* adjusting padding
2025-03-03 15:43:33 -04:00
John Swanson
b112fa202a Healthcheck endpoint for databases (#54446)
* Healthcheck endpoint for databases

* Update test/metabase/api/database_test.clj

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>

---------

Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
2025-03-03 11:18:59 -08:00
Alexander Polyankin
dd66622ec9 Remove extra queries on public & embedded dashboard load (#52993) 2025-03-03 18:03:48 +00:00
Case Nelson
0252fb2aa0 fix: Cast LocalDateTime to date in oracle (#54529)
* fix: Cast LocalDateTime to date in oracle

Fixes #53371

Remember that oracle Date is a timestamp type with seconds resolution.
This changes our inlining of LocalDateTime values to use a date rather
than timestamp if the LocalDateTime has no millisecond part.

We can see `timestamp` causes full scan:
```
SQL> explain plan for select * from test where d > timestamp '1970-01-01 00:00:00';
SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY());
--------------------------------------------------------------------------
| Id  | Operation	  | Name | Rows  | Bytes | Cost (%CPU)| Time	 |
--------------------------------------------------------------------------
|   0 | SELECT STATEMENT  |	 |     1 |    35 |     2   (0)| 00:00:01 |
|*  1 |  TABLE ACCESS FULL| TEST |     1 |    35 |     2   (0)| 00:00:01 |
--------------------------------------------------------------------------
```

We can see `to_date` causes idx scan for both date and timestamp LHS.
```
SQL> explain plan for select * from test where d > to_date('1970-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS');
SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY());

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT		    |	    |	  1 |	 35 |	  0   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| TEST  |	  1 |	 35 |	  0   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN		    | IDX_D |	  1 |	    |	  0   (0)| 00:00:01 |

SQL> explain plan for select * from test where ts > to_date('1970-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS');
SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY());
PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------
|   0 | SELECT STATEMENT		    |	     |	   1 |	  35 |	   0   (0)| 00:00:01 |
|   1 |  TABLE ACCESS BY INDEX ROWID BATCHED| TEST   |	   1 |	  35 |	   0   (0)| 00:00:01 |
|*  2 |   INDEX RANGE SCAN		    | IDX_TS |	   1 |	     |	   0   (0)| 00:00:01 |
```

* Fix kondo
2025-03-03 11:01:03 -07:00
Ryan Laurie
954b21a88a Fix invisible close icons on some legacy modals (#54056)
* fix invisible close icons on some legacy modals

* fix alignment
2025-03-03 10:46:52 -07:00
Alexander Polyankin
8529330c88 Make :time-interval work with 0 instead of :current in the UI (#54525) 2025-03-03 12:35:07 -05:00
Nick Fitzpatrick
1e4a44f00a updating mantine patch (#54598) 2025-03-03 12:13:18 -04:00
John Swanson
7f51520b96 Override some deps licenses (#54589) 2025-03-03 15:59:23 +00:00
Jeff Bruemmer
f0098c980a clarify cloud (#54592) 2025-03-03 10:47:21 -05:00
Chris Truter
c5f6a34cc1 Add prometheus info metric (#54523) 2025-03-03 17:41:13 +02:00
github-automation-metabase
9d4fa545a7 Bump thheller/shadow-cljs from 2.28.20 to 2.28.21 (#54170)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-03 10:31:45 -05:00
Sloan Sparger
572a75bfad [Cards in Dashboards] Allow changing save location when saving a modified dashboard question (#54526)
* fix

* add unit tests
2025-03-03 09:24:06 -06:00
Noah Moss
bc514f1f2f Fix pivot csv export with multiple pivot cols and no row totals (#54540)
* Fix pivot csv export with multiple pivot cols and no row totals

* revert re-enabling a couple tests since they fail on mysql
2025-03-03 10:15:17 -05:00
Timofey Kachalov
18e077c721 Update sample app ports in documentation (#54575) 2025-03-03 19:12:43 +04:00
Timofey Kachalov
a7b8a23519 Run cypress tests against the nodejs sample app (#54250) 2025-03-03 19:00:54 +04:00
Jeff Bruemmer
0a32925830 docs - note on license (#54586)
* note on license

* Update docs/embedding/sdk/quickstart.md
2025-03-03 09:27:41 -05:00
Mahatthana (Kelvin) Nomsawadi
6e9dd0f77c Remove unnecessary step that updates GH CLI (#54581) 2025-03-03 13:58:46 +00:00
John Swanson
e22e19509c Allow impersonated users to hit cache again (#54521)
* Allow impersonated users to hit cache again

As part of this I refactored a bit: `impersonation` is now its own
module, used by the `advanced-permissions` module.

The real changes are in:

- `middleware.cache`, where we're no longer not caching impersonated users,

- `metabase.impersonation.middleware`, where we're adding a key to the
  query if it'll be impersonated, and

- `metabase.query-processor.util/select-keys-for-hashing`, where we're
  selecting that key as part of the query hash.

- a new test in `metabase-enterprise.impersonation.cache-test`, an e2e
  test which verifies that impersonated users get a different cache than
  non-impersonated users.

* Fix throwing when sandbox/gtap both enforceable

`enforce-impersonations?` was returning `false` because due to the
sandbox, we had "unrestricted" data access from another group (the
sandboxed group).

i refactored a bit:

- `enforced-impersonations-for-db?` now is responsible for throwing in the
sandbox conflict case, rather than `connection-impersonation-role`.

- this way, if there's a conflicting sandbox, we'll throw before we even
check to see whether those impersonations will be enforced (rather than
checking and deciding "nope, they have unrestricted access so we won't
enforce them.")

* kondo yay
2025-03-03 05:36:36 -08:00
Chris Truter
919a393bf3 Recalculate columns for Upload model when updating (#54069)
* Recalculate metadata for derived models when updating Upload table
* Preserve modified metadata
* Test for display names being consistent
* Less ominous language
2025-03-03 15:35:28 +02:00
Romeo Van Snick
06f0eee2d2 Remove the ACE editor (#54558)
* Remove ace styles

* Remove ace-builds types

* Remove ace-builds alias from webpack and rspack config

* Remove ace mocks

* Remove ace packages

* Remove ace references in jest config

* Remove ace global in jest mock
2025-03-03 10:21:28 +01:00
Sébastien
be318cf2d5 Auto formatting adapts to currency style if needed (#54349)
* wip

* test

* fix

* fixup
2025-03-03 09:41:04 +01:00
github-automation-metabase
b44f22b6fa Bump org.slf4j/slf4j-api from 2.0.16 to 2.0.17 (#54566)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-03 07:13:07 +00:00
github-automation-metabase
08847cdf6b Bump ch.qos.logback/logback-classic from 1.5.16 to 1.5.17 (#54561)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-03 07:05:39 +00:00
github-automation-metabase
3517c25fea Bump io.github.tonsky/clj-reload from 0.8.0 to 0.9.0 (#54563)
Inspect dependency changes here: https://github.com/tonsky/clj-reload/blob/0.9.0/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-03 06:56:46 +00:00
github-automation-metabase
6ab2325841 Bump cider/cider-nrepl from 0.52.0 to 0.52.1 (#54562)
Inspect dependency changes here: https://github.com/clojure-emacs/cider-nrepl/blob/v0.52.1/CHANGELOG.md

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-03 13:48:49 +07:00
github-automation-metabase
e112875105 Bump org.apache.sshd/sshd-core from 2.14.0 to 2.15.0 (#54565)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-03 13:48:26 +07:00
github-automation-metabase
e4497bfe8a Bump metabase/saml20-clj from 2.2.7.173 to 3.0.0.175 (#54564)
Inspect dependency changes here: https://github.com/metabase/saml20-clj/compare/v2.2.7.173...head

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-03-03 13:47:58 +07:00
Romeo Van Snick
cc946a888f Move Custom Expression editor to CodeMirror (#54253)
* Use lezer parser for custom expressions (#53540)

* Add @lezer/generator

* Add missing value on Token

* Add script to generate lezer grammar parser

* Add @lezer/lr

* Add more tests to tokenizer

* Add lezer grammar for custom expressions

* Generate lezer parser for custom expressions

* Convert TOKEN and OPERATOR to enums

* Make Token type more specific

* Add isReference to identifier token

* Typo

* Add more tests for tokenizer

* Add tokenize alternative that uses lezer grammar

* Remove old tokenizer

* Update location of grammer in generate rule

* Add test cases for tokens that share a prefix

* Merge tokens when necessary

* Only add character error when text is 1 character long

* Reduce the need to manually merge nodes

* Stop the iteration when node is found

* Update tests to be more specific

* Simplify tokenize

* Uncommit edge cases

* Generate parser as js

* Move previous tokenizer tests into expressions folder

* Add typing to unit test

* Allow escaping [] in reference

* Add test for escaping closing bracket

* Handle invalid parses manually

* Add support for signed expressions

* Document parser more

* Add custom tokenizer for Reference

* Make tests more explicit

* Fix e2e test

* Merge old test suite into tokenizer test suite

* Move @lezer/generator to devDependencies

* Custom expression suggestions (#53679)

* Add new suggesters for custom expressions

* Add test for joined fields

* Move complete into separate folder

* Split up completions into separate files

* Split up completion tests too

* Copy more tests from legacy completer

* Fix types

* Lezer highlight for custom expressions (#53651)

* Rename generated parser to lezer

* Add lezer highlighting rules to parser

* Add HighlightExpression component

* Use HighlightExpression in expression HelpText

* Add type annotation to highlighter

* Add test for highlight

* Simplify unit test

* Move syntax highlighting to shared module

* Rename util.tsx to util.ts

* Add monospace font variable

* Use monospace font from theme for syntax block

* Use relative font size in HighlightExpression

* Use mantine var for border-radius

* Add test id to example

* Fix tests that rely on example content

* Move highlighting code to metabase/ui/syntax

* Replace ACE with codemirror in custom expression editor (#53746)

* Rename generated parser to lezer

* Add lezer highlighting rules to parser

* Add HighlightExpression component

* Use HighlightExpression in expression HelpText

* Add type annotation to highlighter

* Add test for highlight

* Simplify unit test

* Move syntax highlighting to shared module

* Rename util.tsx to util.ts

* Add monospace font variable

* Use monospace font from theme for syntax block

* Use relative font size in HighlightExpression

* Use mantine var for border-radius

* Add test id to example

* Fix tests that rely on example content

* Move highlighting code to metabase/ui/syntax

* Replace custom expression editor with CodeMirror editor

* Add test mock for CodeMirror

* Colocate custom expression tests (#53812)

* Remove unused DISPLAY_QUOTES

* Colocate custom expressions diagnostic tests

* Colocate custom expressions process tests

* Colocate custom expressions recursive-parser tests

* Colocate custom expressions typeinferencer tests

* Colocate custom expressions completer tests

* Colocate custom expressions format tests

* Colocate custom expressions resolver tests

* Colocate custom expressions index tests

* Colocate custom expressions pratt compiler tests

* Colocate fuzz tests with custom expressions code

* Update paths for fuzz tests

* Fix types in fuzz test

* Fix types in process test

* Remove unused var

* Remove unused var in generator

* Merge types for custom expressions (#53902)

* Add missing expression types to metabase-types

* Add more explicit types to matchers

* Use Expression type from metabase-types everywhere instead of custom type

* Move matchers to separate file

* Further use Expression types for matchers

* Add types for Metric and Segment matchers

* Fix types in format

* Fix missing types

* Clean up imports

* Split string helpers into separate submodule

* Split identifier helpers into separate submodule

* Avoid importing from index file in expressions module

* Render suggestions and help text in new custom tooltip (#53760)

* Add new help text component for custom expression editor

* Add new suggestions listbox for custom expression editor

* Add helper to find help text by function name

* Add enclosingFunction helper that is more forgiving to broken syntax

* Add new tooltip component for custom expression editor

* Add extension to render custom react tooltips

* Render suggestions in custom tooltip

* Export custom types

* Remove old expression editor popover components

* Add typings to process

* Add missing shortcuts

* Fix example font size

* Fix type imports

* Fix click on helptext

* Stop click propagation

* Fix process types

* Remove superflouous optional chain

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

* Fix types whith optional expressionIndex

* Use imports instead of React namespace

* Use index for key

* Rename util to utils

* Remove unused box shadow

* Remove brackets around placeholder names

* Resize tooltip to avoid it overflowing the window

* Fix line height for args

* Fix missing key icons

* Fix chevron alignment

* Fix types

* Move Listbox resizing classes to Tooltip

* Fix completion template for functions with no arguments

* Add unit tests for enclosingFunction

* Add darker background to expression example

* Remove bold from function call

* Fix imports

* Fix HelpText tests

* Add custom color for highlighted syntax argument

* Use colors from design system

* Fix blurring when switching to a different tab

* Remove trailing comma

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

* Split up effect

* Remove background from template arguments

* Improve tooltip position

* Fix Popover position when selection changes

---------

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

* Fix custom expression editor e2e tests (#53761)

* Fix e2e tests for custom expressions

* Fix unit test

* Fix e2e tests

* Fix types

* Fix moveToStart and moveToEnd by using Home/End

* Add test for popover position

* Remove JSDoc in favor of inline comments

* Add examples of side effects

* Remove shouldContain helper in favour of value()

* Add comment to wait

* Use CustomExpressionEditor helper instead of @formula

* Add wait to reduce flakiness

* Add back in the useful comment about popover position

* Remove superflouous cy.viewport call

* Add helper to accept completion

* Rename helper to verifyHelptextPosition

* Convert comments to cy.logs

* Make sure we don't avoid testing the regression

* Allow customising key with which to accept completion

* Use acceptCompletion helper

* Fix tooltip position bug

* Remove unnused wait

* Add selectCompletion helper

* Fix helper using H

* Add better emulation of copy/paste in reproduction

* Ignore ts error

* Multiline formatter for the custom expression editor (#53973)

* Make type name meaningful

* Add more tests for not isnull, etc

* Remove unreachable code

* Add isEmpty matcher

* Pass query to format tests

* Add stronger types to formatStringLiteral

* Fix CallOptions import

* Implement multiline formatter as a prettier plugin

* Reimplement legacy formatter as new formatter with infinite print width

* Use the new formatter in the expression editor

* Remove legacy expression format files

* Document utils

* Simplify Expression type further

* Fully type test cases

* Remove cast in test

* Add more tests and fix formatting

* Use recurse helper to recurse into path children

* Prefix logical operators

* Improve formatting of logical connectors

* Wait for expression editor to be ready

* Avoid passing unknown html props

* Use selectCompletion helper

* Remove unused @ts-expect-error

* Always close helptext when suggestions are being shown

* Keep completion identity constant

* Fix unit test

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2025-03-02 12:25:24 +01:00
bryan
46df39bffc Bump #p version, add :dev-start alias, and dev app allows #p (#54398)
* dev mode starts webapp + works with hashp

- starts app in one go with :dev-start

* docstring

* docs

* fix ci

* reorder dev deps
2025-02-28 16:04:54 -07:00
Oisin Coveney
a6cdb8e7f4 SDK legalese text overflow (#54541) 2025-02-28 22:26:34 +00:00
Eric Normand
2f84e20584 Allow zoom on joined binned column (#54226)
* Add condition for join alias to match source alias

* Add test for zoom order of joined fields

* Improve nil handling in test

* Remove unneeded dependency

* WIP Check not using generous? true

* Remove `:generous?` option

* Get rid of unused require
2025-02-28 21:20:53 +00:00
Case Nelson
d47b1af7c4 fix: nested field refs from join-alias with spaces (#54231)
* fix: nested field refs from join-alias with spaces

Fixes: #37600

Join aliases get escaped by drivers (truncation and/or tr space to
underscore). However, when join fields are referenced in future stages,
the references were not being renamed and so the query was being created
with invalid columns from the previous stage.

* Fix tests, drop methods namespace

* Re-assoc info after conversion

* Just change query, none of the mw keys

* Add before/after mw for escape join alias to be able to use and capture converted pmbql queries

* Fix kondo errors

* Fix nest-breakouts

* Fix breakouts tests

* Field rename should happen in add-alias-info.

* Fix tests

* Don't use card name for collection name

* Format rows for sqlite

* Uncomment assertion
2025-02-28 14:12:21 -07:00
Nick Fitzpatrick
7a926d81a9 Various UI Polish (#54501)
* lots of UI fixes

* adjusting focus color with theme

* updating z-index in tests

* only change focus color

* updating loki screenshots

* e2e adjustments, PR feedback
2025-02-28 16:48:57 -04:00
Nemanja Glumac
b1b5efe9be Empty states for events (#54157)
Resolves CLO-3630
Resolves CLO-3627
Resolves CLO-3629
Resolves CLO-3626
Resolves CLO-3660
2025-02-28 21:25:13 +01:00
Riley Thompson
127724f0a0 Add support for filtering Mongo UUIDs with string patterns (#54390) 2025-02-28 19:10:50 +00:00
Ryan Laurie
5eb9ee24ad allow configuration of mantine tooltip bg color (#54524) 2025-02-28 17:59:19 +00:00
Sloan Sparger
afa15c0588 [Impersonation] Adds e2e test for enforcement of impersonation on cached questions (#54456)
* adds e2e test for enforcement of impersonation when working with cached questions

* assert response is cached for admin users
2025-02-28 10:47:01 -06:00
appleby
b9414bb439 Fix e2e test flake for issue 29943 reproduction (#54304)
Rather than dragging the Custom column left by a fixed -100 px, drag the Total column right 10 px past the right edge
of the Custom column's bounding box. The idea is to make the test more flake resistant since (1) we drag based on the
size of the target column header rather than a fixed offset, (2) since there are no more columns to the right of
Custom, it's OK if we overshoot the distance slightly.
2025-02-28 08:18:20 -08:00
bryan
ece8c586a9 defendpoint returns a thunk + add call-core-fn (#54395) 2025-02-28 08:57:45 -07:00
Alberto Perdomo
a5a7e5188d Update interactive-embedding-quick-start-guide.md (#54485)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-28 15:54:50 +00:00
Sloan Sparger
b46b264806 [Cards in Dashboards] Save dashboard question directly to tab (#53580)
* wip - got the FE working w/o a real endpoint for DQs created from a dashboard

* progress

* wire in real endpoint with some ugly code

* get working for copy form and clean up code

* fix failing unit tests

* fix failing e2e tests

* fix tab select hidden when creating a question directly from a dashboard

* adds unit test coverage

* add e2e tests

* fix console warn when tab id field is not used in formik form

* small fixes

* fix flakes from two modals sometimes being opened at the same time
2025-02-28 09:44:13 -06:00
Case Nelson
6b8dd38c3e fix: BigQuery ClassNotFound in future (#54474)
Follow up to #52990

When `future` is called clojure uses `Executors.newCachedThreadPool`
This means that the Threads remain in a pool for up to a minute.

That means that if `future` gets called anywhere before
`classloader/the-classloader` is called then that `Thread` can remain in
the pool with a bad classloader. Then when BigQuery's `future` tries to
`Class/forName` `BigQuery$JobOption` it will be calling it from the
classloader context of that initial `future` call and not be able to
find the class.

This adds a very early call to `classloader/the-classloader` in `init!`
and a safety call to it right in BigQuery. In the long term we should
probably be much more strict and explicit about the executors we use.
2025-02-28 08:32:40 -07:00
Kamil Mielnik
2c42eef428 Fix - Uncaught TypeError when making native query parameter required (#54494)
* Fix #52812

* Fix types

* Repro #52812

* Add logs

* Bring back lost values

* Simplify code
2025-02-28 15:04:48 +00:00
Uladzimir Havenchyk
7a3c5f26d4 fix quarter picker styles (#54457)
* fix quarter picker styles

* update loki screenshots

* screenshots
2025-02-28 14:59:20 +00:00
Filip Hric
f6ae0f2844 stabilize flaky test (#54480) 2025-02-28 15:51:18 +01:00
Riley Thompson
9a37543f40 Handle non-JSON native mongo queries (#54210) 2025-02-28 14:49:54 +00:00
Romeo Van Snick
5ca7303e3c Use CodeMirror for code samples (#54268)
* Add @codemirror/legacy-modes package

* Add @codemirror/lang-html

* Add @codemirror/lang-javascript

* Add @xiechao/codemirror-lang-handlebars

* Add CodeBlock component

* Add custom metabase syntax highlighter for codemirror

* Use custom highlighing

* Render code sample using CodeBlock

* Add @codemirror/lang-python

* Add python support

* Restructure code

* Add classname to CodeBlock

* Deduplicate codemirror packages

* Add erb support

* Improve syntax highlighting

* Remove fold gutter

* Remove unused TextEditor

* Remove unused ace imports

* Add highlighted text to CodeBlock

* Fix tests

* Fix e2e test

* Disable current line highlighting

* Add the nonce plugin to Codemirror

* Sort languages

* Rename variable to be more descriptive

* Remove TODO

* Rename util to utils

* Find all occurences of highlighted text in source

* Use explicit classes in highlight

* Remove reliance on overriding based on language

* Remove null in signature

* Remove unused classnames

* Initialise highlighted text statefield

* Add e2e test for disappearing highlighted texts

* Replace all jade references with pug

* Remove erb support and replace it with HTML

* Add comment as to what is being tested

* Remove javascript as a code language
2025-02-28 15:48:02 +01:00
Braden Shepherdson
ce13e14c70 [refs] Include parent_id when hashing Fields to be unique (#53933)
Nested fields (Mongo, Postgres JSON unfolding, etc.) can have the same
name within one table, if their parent paths are different.

Including the parent (if any) as part of a Field's `serdes/hash-fields` makes the hashes truly unique.
2025-02-28 14:35:19 +00:00
Alexander Polyankin
858efafed7 Fix field-id propagation in filter parts (#54448) 2025-02-28 09:34:49 -05:00
Romeo Van Snick
81e9289400 Dependabot fixes octokit dompurify (#54406)
* Udpate @octokit/rest to address regex vulnerabilities

* Update tsx to fix esbuild vuln

* Fix types
2025-02-28 15:24:13 +01:00
Oisin Coveney
8850ab249f Convert components of RuleEditor to Mantine (#54104) 2025-02-28 06:24:08 -08:00
Uladzimir Havenchyk
a5e8e826b0 fix: prevent icon overflow on resize (#54189)
* fix: prevent icon overflow on resize

* add repro

* adapt join step to smaller screens
2025-02-28 17:20:27 +03:00
Braden Shepherdson
81a4a369ab [MBQL Lib] Joins added after summaries have no :fields (#54344)
When you add a summary clause (aggregation or breakout), any `:fields`
clauses are removed from the stage and its joins.

However the reverse order was not correct: a join clause added after
summaries would keep its specified `:fields` clause, or get the default
`:fields :all`. This change fixes that quirk.
2025-02-28 08:52:49 -05:00
Ngoc Khuat
3cdbe363c7 Fix alerts double sending on stats (#54478) 2025-02-28 19:47:39 +07:00
Nick Fitzpatrick
e75592cc22 Mantine UI Regressions part 1 (#54312)
* ui regressions

* updating reference images

* update loki screenshots

---------

Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>
2025-02-28 08:42:12 -04:00
Sloan Sparger
d19309da1c [Cards in Dashboards] Use last selected collection for default save location if more recent than a dashboard (#53571)
* use the last saved collection if the use saved to a collection more recently than saving to a dashboard

* make changes not affect models/metrics, fix e2e tests

* unit tests

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2025-02-28 08:21:12 -04:00
Kamil Mielnik
ceb20066a0 Enable custom no-color-literals ESLint rule (#54427)
* Enable no-color-literals rule

* Fix all strings in the file being highlighted if only one of them violates the rule

* Silence violations

* Revert "Fix all strings in the file being highlighted if only one of them violates the rule"

This reverts commit 11a3c6aca7.

* Fix all strings in the file being highlighted if only one of them violates the rule
2025-02-28 14:08:17 +07:00
Aleksandr Lesnenko
f724e1b58d add tanstack data grid (#54375)
* add tanstack data grid

* review

* drop forwardref
2025-02-28 03:59:11 +00:00
Remi Kristelijn
9895b2d76f fix: remove aria-expanded where it is not allowed (#53833) 2025-02-27 21:05:36 -05:00
Aleksandr Lesnenko
b7e0843d42 fix tooltip content overflows (#54444) 2025-02-27 17:38:29 -05:00
Jeff Bruemmer
1f6e7546d2 fix typo (#54464) 2025-02-27 17:17:37 -05:00
Noah Moss
01993856fc New tiles APIs to support parameterization and public sharing/embedding (#54150)
* New tiles APIs to support parameterization

* Public + embedding endpoints

* fix up tests, light refactor

* address feedback

* fix test
2025-02-27 17:13:43 -05:00
Alexander Polyankin
4f0eeaae99 Change offset help text (#54455) 2025-02-27 22:09:17 +00:00
Sloan Sparger
66ef7ccc70 [Cards in Dashboards] Allow dashboards w/o questions saved inside it to be shallow cloned (#53780)
* revert the removal of shallow cloning a dashboard, prevent shallow copy if dashboard has a dashboard question

* load dashboard in copy modal to avoid cases where provided entity is incomplete and does not contain dashcard data

* type fix

* add e2e test coverage

* remove old e2e test

* address pr feedback and add test coverage for case

* fix lint
2025-02-27 15:51:50 -06:00
Jeff Bruemmer
b1c4f96690 docs - SDK questions (#54451) 2025-02-27 16:02:00 -05:00
Fraser
2b690f30fa Check caching schedule setting value exists (#54392) 2025-02-28 09:45:40 +13:00
Uladzimir Havenchyk
f6dd88a771 fix: MonthPicker styles after migration to mantine v7 (#54352)
* fix monthpicker styles after migration to mantine v7

* fixup

* fix styles

* update loki screenshots
2025-02-27 23:05:18 +03:00
John Swanson
af12aba3ec Add a clj-kondo hook for bad single-quotes in i18n (#54149)
For i18n, we had a lot of things like

```
(tru "this user's string will be broken")
```

During i18n, we use `java.text.MessageFormat` to format messages. These
have a great idea: you can format messages with parameters like `{0}`, or
escape these cases with single-quotes like `'{0}'` when you actually
want the string "{0}". And of course, you can escape a single-quote
itself just by doubling it, so "''" becomes a "'".

All this makes sense. But then they had a problem. What if there's an
unescaped single-quote in the argument to MessageFormat?

A lesser program might have thrown an exception here, but not
MessageFormat! Nay! We must persist, lads, not give up at the first sign
of trouble!

Instead, let's just decide that the programmer probably *meant* to close
that single-quote! So, for example, "This user's message is totally
frickin broken" is interpreted AS IF you'd written "This user's message
is totally frickin broken'" (which ends up as "This users message is
totally frickin broken"), which - doubtless - is what you intended.

Unfortunately there are *some* few cases where - IT TURNS OUT - we don't
actually want this behavior! For example,

```
(deferred-tru "Key to retrieve the JWT user's email address.")
```

becomes "Key to retrieve the JWT users email address." Which is slightly
annoying.

So: let's have a kondo rule that will enforce statically that you don't
have unescaped single-quotes in your template strings for `tru`,
`deferred-tru`, `trs`, or `deferred-trs`.
2025-02-27 18:51:57 +00:00
appleby
f617c87173 Fix drills for mapped model metadata (#54057)
* Fix underlying-records and pivot drills for mapped model metadata

* Fix zoom-in.timeseries drill for mapped model metadata

* Fix zoom-in.binning drill for mapped model metadata

* Fix zoom-in.geographic drill for mapped model metadata

* Replace breakout->filterable-column with breakout->resolved-column

* Fix sort drill for mapped model metadata

* Restrict fix to possible-model-mapped-breakout-column?

* Add e2e tests

* Move shared e2e helpers into outer scope

* Add tests for source-card-type and source-card-is-model?

* Fix indentation

* Remove unused require

* Rename local vars from filterable-column to resolved-column

The old name was a holdover from before the function got renamed.

* Cleanup some->> -> some->

This pipeline used to have more parts that required some->>. Since the only remaining func wants the resolved-column
threaded as the first arg, switch to some-> instead and drop the now useless lambda.
2025-02-27 10:17:05 -08:00
Braden Shepherdson
902b2b69ce [refs] Make lib.convert internal; use lib/query etc. to convert (#54211)
Fixes QUE-681.


Drops `metabase.lib.convert` from the "exported" namespaces under `lib` module, and refactors all usage to
prefer `lib/query` and friends. These require a `MetadataProvider` where `lib.convert/->pMBQL` does not, but
since most of the calls were in QP middleware there was already one handy.

A few API handlers were calling `lib.convert/->pMBQL` and some of those require new `MetadataProvider`s.

Note that currently `lib.convert/->pMBQL` and `->legacy-MBQL` are still exported from `metabase.lib.core`,
and used a few places in the QP! That's an unfortunate temporary measure, and I've started the ball rolling
on alternative ways to factor both of the main offenders (like `annotate/aggregation-name` called from some
drivers).
2025-02-27 12:33:59 -05:00
Alexander Polyankin
3b7be3eda7 Add support for bigint in formatting (#54376) 2025-02-27 11:20:43 -05:00
Timofey Kachalov
1a03bcc59c Convert Visualization.jsx to typescript (#54303) 2025-02-27 20:18:16 +04:00
Nicolò Pretto
54a7b1c707 fix(sdk): expose the correct type for saveToCollection (#54428) 2025-02-27 16:32:00 +01:00
Oisin Coveney
b58d497885 Ensure that markdown files also include prop changes (#54382)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2025-02-27 13:35:44 +00:00
Alexander Polyankin
8118cb1933 Support large integers in query results (#54308)
* PoC

* Base pass

* First pass

* First pass

* First pass

* First pass

* Basic test

* Basic test

* Basic test

* Basic test

* Basic test

* Basic test

* Basic test

* Basic test

* Basic test

* Basic test

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes
2025-02-27 07:03:11 -05:00
Uladzimir Havenchyk
6ac028a9bc Revert "upgrade rspack and swc (#54131)" (#54417)
This reverts commit 4875aba153.
2025-02-27 15:58:19 +04:00
Raphael Krut-Landau
cf7a3fa6af Widen the 'Get embedding code' popover so we can see the copy link button (#54414)
Closes #54407

Before:

![widen-get-embedding-popover--before.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/utGnP2ljFMMNOgi82vVn/b08058f1-4b63-4331-9067-b4e629b338fd.png)

After:

![widen-get-embedding-popover--after.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/utGnP2ljFMMNOgi82vVn/3aef6862-fa57-4275-a52a-420563c0f623.png)
2025-02-27 06:34:29 -05:00
Filip Hric
8a3b6323bf fix flaky test (#54408) 2025-02-27 11:10:54 +01:00
Phoomparin Mano
fb25682fe8 feat(sdk): use questionId={new} for creating new questions (#54323) 2025-02-27 13:18:40 +07:00
Aleksandr Lesnenko
2d561440a0 Reduce usage of legacy tooltip (#53447)
* reduce usage of legacy tooltip

* update Link component tooltip

* update e2e specs

* fix tooltip usages

* lint

* unit specs

* forward ref

* specs

* smart scalar tooltip color

* use tooltip secondary color

* drop flaky legacy tooltips and popovers from loki tests

* one more usage
2025-02-27 06:16:59 +00:00
Jeff Bruemmer
1071dbbcc5 docs - base url for api docs (#54374) 2025-02-27 00:44:07 +00:00
Ryan Laurie
ee401487ca optional sql server 2017 (#54389)
* optional sql server 2017

* disable sqlserver 2017 tests
2025-02-26 22:34:32 +00:00
Oisin Coveney
0c7e18ac30 Convert ChartSettingsTableFormatting components to TS (#54103) 2025-02-26 21:06:16 +00:00
Oisin Coveney
cee7052c31 Add for React in two places on the core app (#54234) 2025-02-26 12:45:40 -08:00
Aleksandr Lesnenko
b974b6bc1c support markdown in the link description tooltip (#53097) 2025-02-26 14:41:12 -05:00
Jeff Bruemmer
5c2132facb Update interactive-embedding-quick-start-guide.md (#54377) 2025-02-26 13:50:03 -05:00
Alberto Perdomo
c9f655bef9 Updates to SDK docs (#54363)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-26 17:51:10 +00:00
Jeff Bruemmer
fe5c9864d1 dashboardCardMenu (#54366) 2025-02-26 12:45:41 -05:00
Alberto Perdomo
22fb69ebbc SDK - Document color theming limitation (#54351)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-26 16:18:37 +00:00
github-automation-metabase
a562562dd4 Update Readme version references and published npm version to 0.54.3-nightly (#54348) 2025-02-26 16:01:02 +00:00
Denis Berezin
e9705f56ec Fixed Question Notifications UI issues after mantine upgrade (#54327) 2025-02-26 18:19:05 +03:00
Riley Thompson
ea38120e5a Cast column to float for Redshift and SQLServer AVG (#53756)
* cast to float for redshift avg

* cast sqlserver avg as float

* remove ::floors-average

* fix test comparison
2025-02-26 09:19:34 -05:00
John Swanson
fbf8c6db83 Remove unused cards in usage analytics (#53598)
[ADM-159: Get rid of unused questions in Usage Analytics](https://linear.app/metabase/issue/ADM-159/get-rid-of-unused-questions-in-usage-analytics)
2025-02-26 05:39:29 -08:00
Kamil Mielnik
2c23bc8284 Repro #54236 (#54326) 2025-02-26 18:52:40 +07:00
Nicolò Pretto
789f1d5002 fix(sdk): move some emotion to css, scope it to .mb-wrapper and use it in the sdk (#54202)
* fix(sdk): move some css to css, scoped it to .mb-wrapper and use it in
the sdk

* make the dashboard test not flake if they render 6 or 7 rows
2025-02-26 11:57:27 +01:00
Filip Hric
c9a9a33e65 fix a test (#53878) 2025-02-26 11:55:30 +01:00
Uladzimir Havenchyk
208e191c12 ci: fix flaky test about sticky panel (#54125)
* fix flaky test about sticky panel

* rework fix

* drop waitFor

* fixup
2025-02-26 12:09:21 +03:00
Phoomparin Mano
250b47b0d8 feat(sdk): cli should ask to remove the instance early if one exists (#53545) 2025-02-26 15:20:18 +07:00
Ngoc Khuat
72538ba54b [Notification] Alert refactor WIP (#51101)
* [Notification] First Notification API (#50770)

* [Notification] CRUD notification APIs (#50921)

* [Notification] Send notification card (#51120)

* [Notification] Send notification APIs (#51267)

* [Notification] Migrate alerts (#50724)

* [Notification] send card notification tests (#51447)

* [Notification] use malli registry (#51439)

* [Notification] Create notification API use current user as creator (#51676)

* [Notification] module readme (#51657)

* [Notification] CRUD api permissions  (#51561)

* [Notification] Send notification APIs (#51267)

* [Notification] add spec update tests (#51630)

* [Notification] management api (#51649)

* [Notification] Transaction emails (#51688)

* [Notification] add spec update tests  (#52078)

* [Notification] send emails about alerts when update card (#52087)

* [Notification] POST /api/notification/send do not requires creator_id (#52374)

* [Notification] Fix unable to send test to webhook (#52502)

* [Notification] Card notification archive when send_once = true (#52375)

* [Notification] unsubscribe notification APIs (#52109)

* [Notification] Quartz trigger management (#52431)

* [Notification] Publish events (#51852)

* [Notification] confirmation email when setting up alert (#52494)

* [Notification] Remove alerts APIs except GET and DELETE (#52012)

* [Notification] unsubscribe notification UI (#52186)

* New UX for Question alerts (#51647)

---------

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2025-02-26 08:36:48 +01:00
Nemanja Glumac
ecb1d83170 Point all hosting-related upsells to the main Cloud upsell (#53951)
The Product decision was to point all existing upsells 
(that were previously leading to https://www.metabase.com/cloud) 
to the existing, central Cloud upsell in the app.

This makes it easier to initiate the migration directly from within the app.
2025-02-25 23:10:46 +00:00
Jeff Bruemmer
0376d71bd7 docs - sdk edits (#54311) 2025-02-25 17:19:36 -05:00
Fraser
cbc1ab534f Use CSS Modules and add border-radius to Entity Picker input (#53869) 2025-02-26 11:15:17 +13:00
Oisin Coveney
17578a74c3 fix(sdk): [EMB-154] Pivot table visualization settings tabs caused jarring width change (#54023) 2025-02-25 14:05:22 -08:00
Nick Fitzpatrick
493430dffd Adding DatePicker, Embed, Overlay and other loki tests back (#54310) 2025-02-25 17:37:50 -04:00
Uladzimir Havenchyk
3bd9329f5d refactor: rework click behavior buttons to mantine (#53769)
* rework click actions buttons to mantine

* use new button and wrap text
2025-02-25 23:09:38 +03:00
Tyler Plude
d5834ea250 Introduce attachment-row-limit and enforce download-row-limit minimum of 1048576 (#52134)
* Removing unused require

* Raising download-row-limit min to 1048576

* Removing unused require

* Raising download-row-limit min to 1048576

* Fix default to not be nil; remove useless unit test

* Change to 2**20 - 1 to account for header row

* Restore more efficient row total values in downloads row limits test

* Improve docstring for env var

* Testing if removing broken unit test fixes all of CI

* Adding new MB_ATTACHMENT_ROW_LIMIT env var; fixing unit test that dependend on old mb-row-download behavior

* Fixing nil support in min call by moving safe-min to u/safe-min and using that over clojure.core/min

* Fixing condition that tests if we're in a subscription email to include check for :pulse

* Removing default value for download-row-limit; updating limit logic; fixing test

* Fixing cljfmt

* Addressing PR feedback

* Fix circular dependency

* Fix imports for modules

* Fixing broken import

* Adding missing doc string
2025-02-25 11:39:58 -08:00
Remi Kristelijn
8c792da0d1 Enable zoom on mobile (#53830) 2025-02-25 12:05:02 -07:00
Timofey Kachalov
01bad49f5b fix(sdk): Add missing support of mapQuestionClickActions plugin for InteractiveDashboard (#54240) 2025-02-25 22:39:42 +04:00
John Swanson
07b490db9f Fix two bugs in DQ updates/creation (#54292)
- allow not specifying a `collection_id` when creating a new
card (inferring it from the `dashboard_id` instead)

- correctly check perms on the *dashboard*'s `collection_id` when moving
a card to a dashboard
2025-02-25 10:34:18 -08:00
Oisin Coveney
7c67445fbe Ensure that other popovers close when a new one is opened (#54214) 2025-02-25 10:23:20 -08:00
Jeff Bruemmer
c46fba0914 update image and add version note (#54294) 2025-02-25 13:01:53 -05:00
Jeff Bruemmer
70e81f8304 docs - sdk questions edits (#54279) 2025-02-25 13:01:41 -05:00
Nemanja Glumac
c953d31f79 Upsells follow up (#53727)
* Clean up the upsell exports

Resolves CLO-3582

* Get rid of styled components in upsells

Resolves CLO-3567

* Define urls in a single place

Resolves CLO-3566

* Tidy up the cloud upsell

* Tidy up `UpsellBanner`

* Nit: Format the sentence correctly

* Use safer approach when setting color for the `UpsellGem`
2025-02-25 18:42:34 +01:00
Sébastien
3cebfb8f19 Fixed conditional formatting for numerical primary/foreign keys (#54139)
* conditional formatting for numerical primary/foreign keys

* clearer conditionals?

* import
2025-02-25 18:39:15 +01:00
Nicolò Pretto
75b6a348d7 fix warning about missing ref on forwardref for FullWidthContainer (#54252) 2025-02-25 18:21:09 +01:00
Nicolò Pretto
af88536cef fix(sdk): add forwardRef to remove 'Function components cannot be given (#54280)
refs' console.error
2025-02-25 17:03:33 +00:00
Phoomparin Mano
837df59223 fix(sdk): deprecate the CreateQuestion component (#54212) 2025-02-26 00:00:53 +07:00
Jeff Bruemmer
4c90b40871 Update quickstart-with-sample-app.md (#54284) 2025-02-25 16:55:06 +00:00
Stas Gavrylov
6975288d2d Remove Unsubscribe link from unsaved subscription test email for non-users (#54242) 2025-02-25 16:38:27 +00:00
Ryan Laurie
fd9c44866d add some nice logging about skipping snapshots in e2e tests (#53757) 2025-02-25 16:31:55 +00:00
Alexander Polyankin
f3ff38b8da Fix a case with broken dates and timelines (#54271) 2025-02-25 16:24:21 +00:00
Nemanja Glumac
0b254b23c7 Remove unused timeline-related entries from services.js (#54188) 2025-02-25 17:04:36 +01:00
Timofey Kachalov
d60b09d348 Adjust SDK version compatibility warning color (#54260) 2025-02-25 19:58:08 +04:00
Oisin Coveney
f77ff5e492 fix(sdk): Rename saveToCollectionId to saveToCollection (#54225)
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2025-02-25 22:06:30 +07:00
github-automation-metabase
6ef61ccb1a Update Readme version references and published npm version to 0.54.2-nightly (#54261) 2025-02-25 14:45:55 +00:00
Jeff Bruemmer
57c292adfd docs - display as image (#54200)
* Update table.md

* headings

* Update docs/questions/visualizations/table.md
2025-02-25 09:09:28 -05:00
Alberto Perdomo
8737e62f1a Remove beta label for SDK (#53925)
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-25 14:00:11 +00:00
Jeff Bruemmer
bf5de5ca23 docs - sdk pages (#54224)
* Update JWT SSO authentication documentation

* links

* edits
2025-02-25 08:55:20 -05:00
Nicolò Pretto
76add4254f sdk debug info component (#54201)
* sdk debug info component

* remove extra BUILD_TIME

* move the component to components/public so it gets automatically wrapped in the nextjs compat layer
2025-02-25 13:44:54 +00:00
Timofey Kachalov
3a55dcde58 Always run Pivot Table queries immediately (#54195) 2025-02-25 16:30:05 +04:00
Uladzimir Havenchyk
d878b0eb25 deprecate emotion (#54177)
* deprecate emotion

* drop enterprise folder

* Update frontend/src/metabase/.eslintrc

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

---------

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2025-02-25 15:20:51 +03:00
Phoomparin Mano
65b050eb7d feat(sdk): use new querying layout for create question flow (#53976) 2025-02-25 12:11:01 +00:00
Romeo Van Snick
a56a344ef3 Allow closing Native editor sidebar reference (#54197)
* Add reproduction for #54124

* Allow closing of sidebar
2025-02-25 10:51:50 +01:00
dpsutton
80b6e485cb fix redshift (#54232)
```clojure
upload-test=> (driver/allowed-promotions :redshift)
{}
upload-test=> (mt/transitive {})
nil
```

just have to expect the allow-list of `{}` rather than nil
2025-02-25 08:53:14 +00:00
Nathan Voxland
536b5f4fd6 Support bulk-fetching personal collection names to improve performance (#53572) 2025-02-24 16:37:13 -06:00
Riley Thompson
d1ad389d45 Gracefully handle null arrays in results (#54203) 2025-02-24 17:31:14 -05:00
Tyler Plude
e2dfb4d715 Fix static fix thai translations (#54155) 2025-02-24 18:58:26 -03:00
Tyler Plude
2536241c25 Fix static viz to respect custom formatting (#54154) 2025-02-24 13:25:53 -08:00
Riley Thompson
48c31a60af Fix mongo uuid not displaying correctly (#53564)
* Fixes the display by checking if the Mongo binary data is a UUID and converting it if so.

* Fixes the filtering by changing how we infer the base type so we can differentiate UUIDs and binData

* Fixes the existing UUID tests so that they use BSON UUIDs instead of strings.
2025-02-24 20:49:25 +00:00
Oisin Coveney
8f1578ec5c Use SELECT 1 instead of SELECT * FROM ORDERS (#54151) 2025-02-24 12:39:46 -08:00
Riley Thompson
db4c1e8f1a Destroy DB in count of grouping tests (#53700) 2025-02-24 14:38:27 -05:00
Phoomparin Mano
33a64e993f fix(sdk): improve example component import paths in cli (#53473) 2025-02-25 01:57:35 +07:00
Dan Stone
e4bd3a44a7 Take the :type of implicit action parameters from the table field, not what is saved in the database (#53914)
* Add implicit actions schema change test

* For now, we define the column set as being determined by models
  - this can break actions if new required columns are added
* Type changes however should be reflected in the derived parameters
* Drops, renames behaviour remains undefined for now

* Fix field :type change being ignored by implicit action params

* Add round trip test for implicit action params
2025-02-24 17:55:51 +00:00
John Swanson
174db1c92e Allow duplicating dashboard but not with DQs (#53766)
If you try to shallow-copy a dashboard but it has DQs, throw a 400.

(Also, when copying a dashboard, don't copy cards that are archived.)
2025-02-24 09:26:20 -08:00
Kyle Doherty
b5b19eacd5 Storybook cleanup (#53982)
* set up our own sort order, do some initial renaming

* consolidate viz stories into one folder

* Move app section specific components / patterns into app folder

* mark old components as deprecated in storybook

* group ui components under components

* add additional new components to proper folder

* move utils to components directory

* move data display to components

* move old core components into components directory w/ caveats

* move parameters stories into components

* move old segmented control to deprecated folder

* move deprecated radio to components folder

* move status components into components/feedback

* tweak order of pages

* run test-visual:loki-update

* rename colors_Default to Colors_Default

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2025-02-24 12:25:26 -05:00
Nick Fitzpatrick
e6e4ced878 Small UI fixes (#54198)
* Fixing some UI issues

* fixing query builder header icon
2025-02-24 13:23:37 -04:00
Jeff Bruemmer
05392dde3e docs - sdk quickstart (#54161) 2025-02-24 11:20:29 -05:00
Kamil Mielnik
20e70189c0 Fix - Variable type picker covered by field picker (#54184)
* Upgrade mantine to 7.17.0

* Fix #52811

* Repro #52811
2025-02-24 21:45:13 +07:00
Nick Fitzpatrick
aa501351a6 Upgrading Mantine to 7.17 (#54163) 2025-02-24 10:10:06 -04:00
Mahatthana (Kelvin) Nomsawadi
83cbb31e36 Fix summarize sidebar bucket label not visible when selected (#54176)
* Fix summarize sidebar bucket label not visible when selected

* Make binning label visible when adding a dimension
2025-02-24 14:08:35 +00:00
Nicolò Pretto
231e16b876 chore: restore no-restricted-imports rules for enterprise folder (#53436)
* chore: restore no-restricted-imports rules for the sdk

* fix imports + add eslint-ignore for when we can't

* address feedback on PR: export BadgeProps + use types we already had

* also change enterprise/frontend/.eslintrc

* add comment to explain why we copy paste them

* "name": "@storybook/testing-library" -> @storybook/test

* add eslint ignore for an import used in a utils file for stories
2025-02-24 14:13:13 +01:00
Mahatthana (Kelvin) Nomsawadi
12b56354ee Fix embedding SDK admin settings typo (#54134)
* Fix embedding SDK admin settings typo

* quickstarttttttt

* Fix unit tests
2025-02-24 12:50:06 +00:00
Nicolò Pretto
1008b43a55 ci: make the sdk e2e run on draft prs and comment non-used stub (#54137) 2025-02-24 12:26:14 +01:00
Dan Stone
2eb5285fa9 On csv upload allow column promotion from boolean to int / float (#52607)
* On csv upload allow column promotion from boolean to int / float

* Fix incorrect arglist

* Add postgres support for bool -> int, float upload migrations

* Improve compatibility with old drivers

* Rename alter-upload-columns to alter-table-columns

* Formatting, sparking joy

* Flip alter-column-using-hsql-expr arg order

* Docstring tweak alter-column-using-hsql-expr

* More symmetry with existing tests, redshift

* Add driver changelog note re `alter-table-columns!`

* Prefer ::driver over :default

* Allow drivers to specify the promo allowlist

* Prefer parser errors for redshift upload promos

* Ensure promo tests respect driver allowlist

* Make index-test/transitive available as a test util

* Add transitivity test

* Add allowlist note about transitivity requirement

* s/upload-promotion-allowlist/allowed-promotions/g

* Prefer case over condp

* Unlearn boolean/predicate habit

bikeshed: Personal style vs metabase style:
e.g I prefer flags/booleans to not have ?, reserving that only for
questions i.e predicates

* Fix alignment

* s/internal-allowed-promotions/translate-type-keywords/g

* Fix wierd comment line break

* Fix missing potemkin import
2025-02-24 11:05:29 +00:00
Denis Berezin
82768f0750 Fix new dashboard subscription button UI (#54152) 2025-02-24 12:41:45 +03:00
Uladzimir Havenchyk
4875aba153 upgrade rspack and swc (#54131) 2025-02-24 11:33:44 +03:00
Ngoc Khuat
6804aeefae Fix unit for notification send prometheus metrics (#54164) 2025-02-24 10:04:47 +02:00
Kamil Mielnik
9ae89b2b1a Fix - Card reference in a native query with a long title does not wrap (#54123)
* Fix #53171

* Repro #53171

* Handle undefined message
2025-02-24 15:04:18 +07:00
Kamil Mielnik
1e1dbb259c Remove redundant "in" in a translation string (#54122) 2025-02-24 15:02:32 +07:00
Kamil Mielnik
a9c0eb0571 Fix - Alignment in DateOffsetIntervalPicker 2025-02-24 15:02:14 +07:00
Timofey Kachalov
ec7d155054 Always set a ref in PivotTable to properly scale it (#54126) 2025-02-24 11:42:43 +04:00
Kamil Mielnik
79ab5476bc Fix - Resize handle misplaced in Notebook view (#54079)
* Fix #53817

* Fix another usage
2025-02-24 08:07:04 +01:00
Alex Yarosh
12f7f98e23 docs: caching and impersonation (#54153)
* caching impersonation

* Update docs/configuring-metabase/caching.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2025-02-21 23:08:55 +00:00
Maxime Pauvert
f0cb2d0f48 Update map.md (#54143) 2025-02-21 17:47:43 -05:00
Nemanja Glumac
bad4e01917 Empty states for collections (#54136)
Resolves CLO-3623
Resolves CLO-3638

* Replace artwork for collection empty state

* Fix the deprecated prop warning

* Update the "New" menu trigger

* Remove previous artwork

* Update the copy
2025-02-21 21:47:40 +01:00
Denis Berezin
a6f36291b6 Fix disabled Select text display (#54085) 2025-02-21 21:22:51 +03:00
Case Nelson
efcd6f3190 tech-debt: move sync.concurrent out of sync module (#54092)
Moving this fixes a circular dependency with sync and
models.database health check.
2025-02-21 09:39:44 -07:00
Nemanja Glumac
6211123deb Empty states for "It's ok" modals (#54101)
Resolves CLO-3624
* Add SVG assets

* Update the modal UI

Resolves CLO-3631
Resolves CLO-3632
Resolves CLO-3637
2025-02-21 16:35:57 +01:00
Alberto Perdomo
da12a8741d SDK - initialSqlParameters is only supported in SQL questions (#54114)
Co-authored-by: jeff bruemmer <jeff.bruemmer@gmail.com>
2025-02-21 14:46:21 +00:00
Phoomparin Mano
7ad55f5099 fix(sdk): fix visual artifacts in binning options (#53961)
* add trigger button class with visibility

* add visibility clauses

* Remove empty file

* Colocate visibility logic

So we don't have to repeat this logic on every call site

* Fix E2E tests

* Remove leftover prop type

* Passing ref since we need it for popover

* Fix the rest of the failed e2e tests

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2025-02-21 14:40:14 +00:00
Alexander Polyankin
3e8fe57187 Removes impl files (#54078) 2025-02-21 09:33:45 -05:00
Eric Normand
5cbbfeb4a8 Convert back to original type when binning by day (mysql) (#53777)
* Convert back to original type when binning by day (mysql)

* Use h2x/->datetime instead of custom one in mysql

* Interpret base-type into database-type

* Remove println

* Undo using base-type to derive database-type

* Fix mysql date binning to maintain type

* Improve postgres bucketing test

* Fix test

* Refactor for clarity

* Whitespace

* Track type info when casting unix timestamps and date strings

* Track type when casting temporal strings (psql)

* Revert changing test (fix instead)

* Add very helpful comment

* Add very helpful and useful comment
2025-02-21 17:05:54 +03:00
Uladzimir Havenchyk
5a0a238277 refactor: replace emotion with css modules (#53981)
- replace emotion components with mantine
- replace emotion styles with css modules
2025-02-21 16:54:28 +03:00
Aleksandr Lesnenko
6a95864afa fix series names overflow available space in viz settings (#54112) 2025-02-21 08:50:46 -05:00
Nicolò Pretto
ff1d319d12 devex: add user selector for the sdk storybook (#54075) 2025-02-21 13:40:19 +01:00
Timofey Kachalov
c4e499cd2a fix(sdk): Add dir attribute for PublicComponentStylesWrapper (#54082) 2025-02-21 16:24:34 +04:00
Nicolò Pretto
39bd897d09 chore: remove css import from sdk storybook (#54081) 2025-02-21 11:18:25 +01:00
Sébastien
73be8e8a83 Allowing users to show/hide values on their stacked series (#53835)
* allowing users to show/hide values on their stacked series

* fixup

* not showing the new widget when settings[graph.show_stack_values] === total
2025-02-21 10:18:36 +01:00
Sébastien
4de9c8d5fd Allow users to format their durations (#53898)
* added duration formatting

* added a test

* .
2025-02-21 10:18:10 +01:00
Timofey Kachalov
98da9ea0ee Remove the custom override of use-popover (#53969) 2025-02-21 13:14:45 +04:00
Timofey Kachalov
39c57131e6 Fix alert icon box-sizing (#52378) 2025-02-21 13:14:02 +04:00
Jeff Bruemmer
0981abbfdd docs - notes on EIDs and static embedding (#54098) 2025-02-20 15:41:19 -05:00
Cam Saul
ca614e63f1 Restore deleted hook file (#54096) 2025-02-20 19:14:04 +00:00
Alexander Polyankin
2a6318acfd Check for min arg count in expressions (#54012) 2025-02-20 13:38:17 -05:00
github-automation-metabase
02e29320bb Bump clj-kondo/clj-kondo from 2024.11.14 to 2025.02.20 (#54048)
* GH job to auto-upgrade backend deps weekly

* Run on push to this branch

* Run on this branch

* Disable reviewers

* Should open PR against master

* Exclude Kondo for now

* Try tagging backend dev with `reviewers`

* Run against `master`

* Set `master` as the base

* Add backend team as reviewers for deps.edn

* Enable auto-merge

* Fix antq config

* Use squash-merge

* Try creating PR using GH CLI

* Set commit username

* Set GH token

* Manually create branch

* Better branch name

* Checkout master before creating commit

* Set fetch-depth 0

* Leverage git stash

* Git diff

* Fix

* Unique branch name

* Push branch to origin

* Re-enable auto-merge

* Use GH Actions bot as author

* Open separate PRs for each dep bump

* Fix GH Action config

* Update Action name

* Fix script

* Final cleanup

* Bump clj-kondo/clj-kondo from 2024.11.14 to 2025.01.16

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

* Bump clj-kondo/clj-kondo from 2024.11.14 to 2025.01.16

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

* Bump Methodical & Toucan 2 for updated Kondo configs

* Update some Kondo configs

* Fix Kondo errors

---------

Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-02-20 18:33:38 +00:00
Ngoc Khuat
acddb50a3b Track notification wait time and total send time (#54080) 2025-02-21 00:18:04 +07:00
Nicolò Pretto
28b11beef3 fix: remove typo from packages we remove from the filter list (#54072) 2025-02-20 17:59:16 +01:00
Alex Yarosh
ed3430dc1a Update editor.md (#54086) 2025-02-20 11:48:34 -05:00
Case Nelson
78077ba2e0 feat: Reduce cost of initial field scanning (#53387)
* feat: Reduce cost of initial field scanning

Setting a Field `has_field_values` to `:autolist` moves from classify
based on fingerprinting to the initial Field creation only based on
semantic and base types.

Querying for field values and receiving too many values or too many
bytes will no longer delete FieldValues or change Field
`has_field_values` but rather set the `has_more_values` to true.

During sync, if a `has_field_values` is `:autolist` or `:list` but
FieldValues is nil, we will not fetch a new cache of FieldValues. This
way, the only way to cache new FieldValues would be by triggering an
adhoc request to `GET /api/field/:id/values`.

* Unmark FKs as auto-list

* Fix tests to manually activate field values for param_values

* Add search to e2e helper when filter has more

* Fix e2e tests

* Fix helper

* Fixing more tests

* Fix e2e test
2025-02-20 09:06:32 -07:00
Konstantin Darutkin
398cb39a1a test: repro tests for #32750 and #41831 (#54076) 2025-02-20 15:10:18 +00:00
Edward Paget
5b153e5b54 fix: hide sqlite from engines on cloud hosting (#53702)
* fix: hide sqlite from engines on cloud hosting

* fixup! set custom driver heirarchy
2025-02-20 08:37:49 -06:00
Alexander Polyankin
10fba041f1 [Tests] BigInteger in filters - public & embedded questions & dashboards (#53955) 2025-02-20 09:11:58 -05:00
Konstantin Darutkin
465fe5aef7 fix: WRK-70 wording (#54070)
* fix: WRK-70 wording

* fix: review issues
2025-02-20 14:07:47 +00:00
Nemanja Glumac
20bf09ffc8 Upsell Performance Tools (#53720)
* Add upsell component for performance tools

* Make `tools` a regular route

When the "audit_app" feature flag is missing, we will show the upsell.
This now applies to all non-enterprise routes, which removes the need
for the route guard.

It also greatly simplifies the tools "plugin" system.

The logic is now as follows:
1. If the feature flag is enabled, the route shows enterprise component
(erroring questions page)
2. if the feature flag is not present, the route falls back to the upsell component

* Get rid of styled components

* Center the tools upsell

* Delete test case that's not valid anymore

* Add e2e coverage
2025-02-20 14:46:27 +01:00
Sébastien
dc43e40f47 Fewer warnings in the console (#53528)
* fewer warnings in the console

* fixed test
2025-02-20 13:15:04 +01:00
Uladzimir Havenchyk
89f67a2870 drop unused styled files (#54013) 2025-02-20 12:05:54 +00:00
Timofey Kachalov
636d817e71 Fix global css reset for svg elements (#53928) 2025-02-20 11:34:38 +04:00
github-automation-metabase
6127271a89 Bump io.netty/netty-buffer from 4.1.117.Final to 4.1.118.Final (#54043)
* Bump io.netty/netty-buffer from 4.1.117.Final to 4.1.118.Final

Inspect dependency changes here:

* Fix missing newline at end of file

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-20 01:56:10 +00:00
github-automation-metabase
87b712c945 Bump com.amazonaws/aws-java-sdk-core from 1.12.780 to 1.12.782 (#54052)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2025-02-20 01:36:35 +00:00
Riley Thompson
d4304f2211 Convert java.sql.Arrays to Clojure vectors (#53551)
Implements `read-column-thunk [:sql-jdbc Types/ARRAY]` to convert `java.sql.Array`s to Clojure vectors.
2025-02-20 00:16:08 +00:00
github-automation-metabase
29678e13c7 Bump com.microsoft.sqlserver/mssql-jdbc from 12.8.1.jre11 to 12.9.0.jre11-preview (#54051)
Inspect dependency changes here:

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:35:48 +00:00
github-automation-metabase
00995815a9 Bump io.github.clojure/tools.build from 0.10.6 to 0.10.7 (#54038)
Inspect dependency changes here: https://github.com/clojure/tools.build/blob/v0.10.7/CHANGELOG.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:30:30 +00:00
github-automation-metabase
5b217313a7 Bump com.facebook.presto/presto-jdbc from 0.290 to 0.291 (#54046)
Inspect dependency changes here:

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:29:51 +00:00
github-automation-metabase
2fd421e7c1 Bump org.xerial/sqlite-jdbc from 3.48.0.0 to 3.49.1.0 (#54050)
Inspect dependency changes here: https://github.com/xerial/sqlite-jdbc/compare/3.48.0.0...3.49.1.0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:26:05 +00:00
github-automation-metabase
32d65255dd Bump io.github.tonsky/clj-reload from 0.7.1 to 0.8.0 (#54039)
Inspect dependency changes here: https://github.com/tonsky/clj-reload/blob/0.8.0/CHANGELOG.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:25:54 +00:00
Cam Saul
df62a1a7da GH job to auto-upgrade backend deps weekly (#53934) 2025-02-19 16:25:23 -07:00
github-automation-metabase
41ad985ce7 Bump com.google.cloud/google-cloud-bigquery from 2.46.0 to 2.48.0 (#54042)
Inspect dependency changes here: https://github.com/googleapis/java-bigquery/blob/v2.48.0/CHANGELOG.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:19:15 +00:00
github-automation-metabase
9ec45e2325 Bump com.oracle.database.jdbc/ojdbc17 from 23.6.0.24.10 to 23.7.0.25.01 (#54045)
Inspect dependency changes here:

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:18:58 +00:00
github-automation-metabase
50bbfc20da Bump lambdaisland/deep-diff2 from 2.11.216 to 2.12.219 (#54040)
Inspect dependency changes here: https://github.com/lambdaisland/deep-diff2/blob/v2.12.219/CHANGELOG.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:15:31 +00:00
github-automation-metabase
0e0b8187aa Bump com.clojure-goes-fast/clj-async-profiler from 1.6.0 to 1.6.1 (#54034)
Inspect dependency changes here: https://github.com/clojure-goes-fast/clj-async-profiler/blob/1.6.1/CHANGELOG.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 23:11:59 +00:00
github-automation-metabase
f61ca1f637 Bump com.amazonaws/aws-java-sdk-core from 1.12.780 to 1.12.781 (#54049)
Inspect dependency changes here:

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 15:06:57 -08:00
github-automation-metabase
f54ef358e8 Bump io.netty/netty-common from 4.1.117.Final to 4.1.118.Final (#54044)
Inspect dependency changes here:

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 15:04:47 -08:00
github-automation-metabase
54a3958e83 Bump org.apache.tika/tika-core from 3.0.0 to 3.1.0 (#54041)
Inspect dependency changes here:

Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2025-02-19 15:03:38 -08:00
github-automation-metabase
37bccd57f0 Bump com.clojure-goes-fast/clj-memory-meter from 0.3.0 to 0.4.0 (#54035)
Inspect dependency changes here: https://github.com/clojure-goes-fast/clj-memory-meter/blob/0.4.0/CHANGELOG.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 15:02:37 -08:00
github-automation-metabase
ef6f8a3445 Bump com.github.seancorfield/next.jdbc from 1.3.981 to 1.3.994 (#54036)
Inspect dependency changes here: https://github.com/seancorfield/next-jdbc/blob/v1.3.994/CHANGELOG.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-02-19 15:02:13 -08:00
Noah Moss
220d92c651 Ensure CLJS/CLJC files get translations included in the FE bundle (#53984)
* Ensure CLJS/CLJC files get translated included in the FE bundle

* Fix backend test

* clean ns

* add e2e test

* Fix another e2e test
2025-02-19 14:14:02 -05:00
Filip Hric
6b58f641bc tag test as flaky (#53980) 2025-02-19 19:47:58 +01:00
Alexander Solovyov
02b7effe1a update athena driver to 3.4.0 (#53979) 2025-02-19 19:28:17 +01:00
Nemanja Glumac
a92d113b3e Fix "Migrating to Metabase Cloud" for local dev instances (#53971) 2025-02-19 19:15:36 +01:00
Chris Truter
59974f065a Helper to simplify retrying jobs on failure (#53960) 2025-02-19 16:55:51 +00:00
Noah Moss
07591c1787 Add back discarding-rff for preemptive caching, and expand backend and e2e test coverage (#53639)
* WIP: e2e querying test for preemptive caching

* WIP restructure BE tests for better coverage

* Misc cleanup

* revert some unneeded changes

* Fix tests

* Revert some typo fixes to avoid polluting this PR

* Refactor cypress test

* Try again to fix Cypress test in CI

* Address feedback

* fix tests

* fix tests again
2025-02-19 10:41:14 -05:00
Konstantin Darutkin
524658912e fix: WRK-67 new action modal is too hard to close (#53905)
* fix: the-new-action-modal-is-too-hard-to-close

* refactor: do not use absolute positioning

* test: add tests for click outside

* fix: review issues
2025-02-19 15:35:50 +00:00
Kamil Mielnik
eecde2f2a2 Fix - Redundant GET /api/action request when viewing non-model object details (#53032)
* Fix #50266

* Add a boolean cast

* Add repro for #50266

* Improve test name

* Add RTK Query API middleware to storybook store

* Add the effect cleanup

* Fix "Promise was collected" error

* Fix other hooks

* Add missing RTK Query middleware in storybook

* Fix "Promise was collected" error

* Clean up the effect

* Fix tests

* Fix storybook setup correctly
2025-02-19 22:08:26 +07:00
Kamil Mielnik
0b7a11ef8c Fix "Promise was collected" error in visual tests (#53889)
* Add missing RTK Query middleware in storybook

* Fix "Promise was collected" error
2025-02-19 12:43:47 +00:00
Phoomparin Mano
8423d6382a fix(sdk): hide "New Question" in EditableDashboard sidebar (#53908) 2025-02-19 18:23:56 +07:00
Alexander Polyankin
96ee8b4181 Support BigInteger in filter display names (#53916) 2025-02-18 21:13:01 -05:00
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
Dennis Schridde
c1cdce9698 Reduce cache TTL for billing info from 5h to 5min (#48762)
Store API can handle higher load and customers might want to see
changes earlier.

Fixes: cc28ee6041
2024-10-18 16:31:10 +02:00
Nick Fitzpatrick
b853f9d0e0 Fixing broken Configure Slack links (#48758)
* cleaning up links, adjusting tests

* guard rails

* linter fix
2024-10-18 10:54:07 -03:00
Aleksandr Lesnenko
5dab3610bf filter out virtual cards when creating a subscription (#48861) 2024-10-18 09:01:03 -04:00
Oisin Coveney
405ed53baa fix(sdk): Change QuestionEditor tab name to 'Editor' (#48821) 2024-10-18 10:23:28 +03:00
Phoomparin Mano
d91bbcd489 fix(sdk): reduce visual artifacts on PDF/PNG exports on custom sdk themes (#48645)
* debug pdf export styling

* apply sdk theme background overrides

* add overflow override

* tweak style overrides

* move WithThemeBackground outside of data-metabase-theme selector

* move EmbedFrame css rule up

* remove fallback mb-color-background
2024-10-17 23:46:22 +00:00
Phoomparin Mano
9ffc1851ea fix(sdk): fix defaultProps react error (#48764)
* remove defaultProps from Modal

* bump patch version of react-markdown

* fix isOpen prop
2024-10-17 23:26:02 +00:00
Phoomparin Mano
f481cad337 fix(sdk): hide downloads by default (#48755)
* hide downloads by default in the sdk

* update readme to reflect withDownloads prop

* update readme formatting

* update tests
2024-10-17 22:53:14 +00:00
Noah Moss
6db1495263 Track SCIM users + API response success/error counts (#48702) 2024-10-17 18:23:34 -04:00
Nick Fitzpatrick
6ccadee046 adding webhook counter to AlertListItem (#48853)
* adding webhook counter to AlertListItem

* PR feedback
2024-10-17 16:08:06 -03:00
lbrdnk
e094c38bfe Splice expression into appropriate stage during v2 metric expansion (#48800)
* Fix expression stage

* Add test

* Parallel test

* Adjust test

* Adjust test
2024-10-17 21:06:40 +02:00
lbrdnk
eefd754357 Use name from metric aggregation after preprocessing (#48705)
* Use metric's aggregation :name

* Add test
2024-10-17 19:02:53 +03:00
Alexander Polyankin
fe8642dad5 Fix question header when the original question is a native query (#48815) 2024-10-17 11:58:30 -04:00
Case Nelson
7925599ed3 fix: Always cast json number types as decimal (#48648)
* fix: Always cast json number types as decimal

Fixes #48507

* Fix tests

* Fix tests

* Fix test
2024-10-17 09:34:05 -06:00
Mahatthana (Kelvin) Nomsawadi
4fb45165d5 Prepare SDK npm version for release version number automation (#48839) 2024-10-17 16:22:14 +01:00
Alexander Polyankin
c42d411cab Hide the toggle all checkbox when there are no search results (#48817) 2024-10-17 09:52:50 -04:00
Kamil Mielnik
816a1c11bb Add missing key prop to components and elements used inside jt (#48825) 2024-10-17 20:46:00 +07:00
metamben
f47eafd36f Support resolving names in source-metadata by ID (#48765)
Fixes #48639
2024-10-17 16:37:56 +03:00
Alexander Solovyov
004848ae9d [serdes] check full export for escaping cards (#48521) 2024-10-17 09:26:49 -04:00
github-automation-metabase
af760c29fc Update Readme version references and published npm version to 0.1.40 (#48827) 2024-10-17 11:57:51 +00:00
dpsutton
deac5cbcc7 Let non-admins see tables in recents (#48769)
* Let non-admins see tables in recents

```shell
❯ http get "localhost:3000/api/activity/recents?context=views" Cookie:"metabase.SESSION=ba..3d" -pb
{
    "recents": [
        {
            "can_write": false,
            "database": {
                "id": 6,
                "initial_sync_status": "complete",
                "name": "pg restaurants"
            },
            "description": null,
            "display_name": "Restaurants",
            "id": 112,
            "model": "table",
            "name": "restaurants",
            "table_schema": "public",
            "timestamp": "2024-10-15T22:11:39.412100Z"
        },
        {
            "can_write": false,
            "database": {
                "id": 6,
                "initial_sync_status": "complete",
                "name": "pg restaurants"
            },
            "description": null,
            "display_name": "Reviews",
            "id": 110,
            "model": "table",
            "name": "reviews",
            "table_schema": "public",
            "timestamp": "2024-10-15T19:53:19.999445Z"
        }
    ]
}
```

We were getting permissions of a "fake" table. Instead, let the db
select it and get the proper stuff. Worked for admins because
mi/can-read? is presumably always true for tables, and worked in tests
because we mocked mi/can-read?

* bump ci
2024-10-16 15:41:04 -05:00
appleby
00100b1cb5 Add a new prometheus metrics in m.qp.middleware.metrics/adjust (#48598)
* Add new promethues counter for :metabase-metrics/adjust-errors

To record errors in metabase.query-processor.middleware.metrics/adjust

* Add prometheus metrics test to metrics middleware tests

* Also inc :metabase-metrics/adjust-errors when throwing an exception

* Make splice-compatible-metrics private

It doesn't seem to be used outside of metabase.query-processor.middleware.metrics.

* Add test for :metabase-metrics/adjust-errors when exception is thrown

* Move inc-and-throw! helper into metabase.analytics.prometheus

* Add inc-and-throw! test to prometheus tests

* Rename inc-test to inc!-test and use approx= and metric-value helpers

* Add try/catch to metrics adjust and record metric errors in a single place

Record promethues metrics in a single place in metabase.query-processor.middleware.metrics and ensure we record
failures for any exception throw.

* Improve testing description string

* Rename :metabase-metrics/adjust-errors to :metabase-query-processor/metrics-errors

* Move metrics adjustment try/catch into a new helper

This ensures we count all exceptions generated by adjust-metric-stages.

* Add new prometheus metric to count number of MB metrics seen by the QP

This new metric is intended to count the number of metrics that the query processor metrics middleware sees and
attempts to adjust.

* Add more metrics metrics tests

- Ensure that queries with no metrics do not incremement either counter
- Ensure that successful calls to adjust do not increment the error counter
- Ensure that exceptions throw from other libs also increment the error counter

* Rename test to adjust-prometheus-metrics-test and add helper to reduce code dup

* If no metrics are found immediately return query in metrics middleware adjust

Don't attempt to adjust query if we don't find any :metric clauses.

* Appease cljfmt

* Improve metric description

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

* Improve epsilon test in approx=

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

* Remove adjust-metric-stages-counting-errors

This function was an attempt to avoid double-counting errors, but probably not worth the effort.

See

https://github.com/metabase/metabase/pull/48598#discussion_r1800197964
https://github.com/metabase/metabase/pull/48598#discussion_r1800200421

* Count metrics directly when mocking prometheus/inc!

Based on PR feedback here:

https://github.com/metabase/metabase/pull/48598#discussion_r1800207674

* Remove prometheus/inc-and-throw!

Value prop was always questionable, but now that it's only called from a single place, just remove it and inline the
call to prometheus/inc!. Easy to add back later if it proves generally useful.

PR discussion thread

https://github.com/metabase/metabase/pull/48598#discussion_r1799728596

* Rename match-one-metric to find-first-metric

https://github.com/metabase/metabase/pull/48598#discussion_r1803321025

* Rename :metabase-query-processor/metrics-errors to metric-errors

https://github.com/metabase/metabase/pull/48598#discussion_r1803313818

* Throw an exception rather than logging a warning if we fail to adjust a metric

https://github.com/metabase/metabase/pull/48598#discussion_r1803328482

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2024-10-16 20:06:43 +00:00
bryan
94496eb579 SDK embedding prometheus (#48578)
* add prometheus tracking for sdk-embedding

* indentation

* improve track-sdk-response api

* register :metabase-sdk/response-{ok,error} + test

* avoid cyclic dependency whe nusing prometheus

fixes:
[ /metabase/api/common ]
<- /metabase/models/setting
<- /metabase/analytics/settings
<- /metabase/analytics/prometheus
<- /metabase/analytics/sdk
<- /metabase/models/view_log
<- /metabase/events/schema
<- /metabase/events
<- [ /metabase/api/common ]
<- /metabase/public_settings/premium_features
<- /metabase/auth_provider
<- /metabase/driver
<- /dev/debug_qp
<- /dev

* nix dependency: events.schema --> models.view-log

- make them both read context from view-log-impl instead

* cljfmt
2024-10-16 18:00:20 +00:00
bryan
e878691190 keywords aren't allowed anywhere but the top level (#48802) 2024-10-16 16:20:55 +00:00
Chris Truter
29bbf6faf0 Expose more basic table analysis from Macaw (#48264) 2024-10-16 16:20:08 +01:00
metamben
7e13d9bec5 Set :lib/source-uuid from the field ref, not from column metadata (#48472) 2024-10-16 18:05:10 +03:00
github-automation-metabase
0fb1063d1a Update Readme version references and published npm version to 0.1.39 (#48799) 2024-10-16 14:55:28 +00:00
Oisin Coveney
e883cdfffc Convert dashcardData dashboard reducers to TS (#48679) 2024-10-16 17:07:55 +03:00
Mahatthana (Kelvin) Nomsawadi
6a01238f67 Remove the uberjar build process from SDK release workflow (#48729) 2024-10-16 14:10:53 +01:00
Noah Moss
6ca8939993 Ensure new fields in permissions table are set properly for Examples collection (#48746) 2024-10-16 09:09:59 -04:00
Nicolò Pretto
302a994654 embedding-sdk:dev: --watch that makes "fixed" dts (#48574)
* faster --watch command for the sdk

* apparently we want an empty line at the end of jsons, but prettier removes it?

* format tasks.json with prettier 😕

* vscods tasks, move watch task from webpack config to the fixup script

* cleanup webpack config

* adds clean + waits for dist folder when not existing

* minimal doc for the sdk commands
2024-10-16 15:05:32 +02:00
Anton Kulyk
31622ad3b3 Fix flaky x-ray test (#48786)
* Don't assert dynamic value

* Restart CI
2024-10-16 12:38:13 +00:00
Mahatthana (Kelvin) Nomsawadi
534e679ef3 Fix hidden files not uploading as GitHub Actions artifacts (#48779) 2024-10-16 08:50:30 +00:00
Alexander Solovyov
b607af0849 make sure all top-level API paths are present in OpenAPI doc (#48718) 2024-10-16 10:32:24 +03:00
Mahatthana (Kelvin) Nomsawadi
344dba38df Do not open sidesheets on SDK (#48630)
* Don't open sidesheet on SDK dashboards

* Add E2E test

* Fix `className` not passed

* Fix unit tests

* Fix E2E tests
2024-10-16 08:22:14 +01:00
Ngoc Khuat
73d13e8019 [Notification] Cron trigger (#48719) 2024-10-16 04:15:22 +00:00
Raphael Krut-Landau
d4def48591 Add insights link (or tab) to question and dashboard sidesheets (#48283) 2024-10-15 20:09:27 -04:00
github-automation-metabase
595f302e3d Add v0.50.30 to the list of releases (#48766)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-10-15 22:31:28 +00:00
bryan
e5c181bdc3 Adds missing schemas + data for metrics to snowplow stats ping (#48476)
* adds data + schema for metrics stats ping

* remove comment

* annotate todos

* fill in the rest of the metrics values

- and add defaults

* fix some definitions + use a single timestamp

* shuffle stuff around to appease the namespace linter

- we aren't reaching into the api API, so the linter is more of a
  formality here.

* update docstring

* fix jsonschema, maybe

* review responses

- revert changes to 1-0-0
- add metrics section to new file: 1-0-1
- bump ::instance_stats to "1-0-1"
- add tags into 1-0-1
- make the code return tags (empty for now until we know what to tag things.)

- also fix test that broke from shuffling settings around

* remove a footgun

* add tags to metrics,

add grouped_metrics to jsonschema 1-0-1

format 1-0-1

* indent

* cljfmt

* version should match filename

* update instance stats 1-0-1 schema

* require `tags` in grouped_metric + snowcat comment

* fix formatting noise

* update schema to make it valid

* remove grouped_metrics from instance_stats schema

* cljfmt appeasement

* unbin cache_num_queries_cached value

- alphabetize metrics generation

* we can now guarantee metric values will be ints

* jsonschema for instance_uuid, settings, and grouped_metrics

* add analytics_uuid and make it required

* lint + alphabetize instance stats json schema

* update setting key type

- add maxLength to some strings

* lint jsonschema

- Add description to setting.items.tags
- add maxLength, and {min,max}imum to setting.items.value

* Bump instance stats to 2-0-0

- remove analytics_uuid string length == 36 check
- adds assertion to ensure required fields are set (and it passes)
- adds info for embedding settings

* adds a grouped-metric to stats ping

- adds length info to the schema to pass jsonschema linting

* cljfmt
2024-10-15 14:47:12 -06:00
Aleksandr Lesnenko
8e950e8c1c use simple_event schema to track iframe card creation (#48739) 2024-10-15 14:44:48 -04:00
Anton Kulyk
54b141c724 Fix maps visualization crashing on x-rays (#48742)
* Add default value for `hiddenIndices`

* Add e2e test
2024-10-15 19:26:47 +01:00
Uladzimir Havenchyk
880119e76b fix circular deps in query_builder/components (#48604)
* fix circular deps in query_builder/components

* js -> ts
2024-10-15 16:22:38 +00:00
adam-james
8d52a03f0a Incremental Pivot Processing for Exports (#46995)
* Incremental Pivot Processing for Exports

WIP

Fixes pivot exports for CSV and xlsx.

The CSV export should use less memory by incrementally building up the data structure and aggregating necessary row
data right away, so the memory overhead becomes only as large as the total pivot result.

In cases where the pivot rows/cols do combine into many many columns and rows, this can still be a large set of data,
but it should behave much better now in most cases.

The Excel export is a little more straightforward: create the export rows in the same fashion, streaming one row at a
time, and just post-process the sheet to add the pivot table in one shot at the end.

* WIP adding row totals.

* aggregate totals as rows are added

Row, column, section, and grand totals are all aggregated as each row is added.
This means the final step of building pivot output becomes just an exercise of lookups/arrangement, no further
aggregation is needed.

* CSV pivot works per-row, export respects formatting

This is a big step forward; we don't need to hold the entire dataset in memory, we instead aggregate a row's data into
the pivot datastructure, which only holds onto:

- unique values for each pivot-row in a sorted set
- unique values for each pivot-col in a sorted set
- grand total for each measure N values, where N is number of measures, ususally 1 or 2
- row totals for each combination of each pivot-row * N measures
- col totals for each combination of each pivot-col * N measures
- totals for each 'section', determined by unique values of first pivot-row * N measures
- values for each measure in every 'cell'; Row Combos * Col Combos * N Measures

So, there can still be a decent amount of data to store; but it will never hold onto all of the 'raw rows' from the
dataset.

We can never completely guarantee that Row Combos * Col Combos * N Measures remains small, but two things let us move
forward anyway:

- there's now visible feedback in the app that the download is running (or if it's failed)
- Pivot table utility diminishes rapidly with huge output anyway; users still need to curate/set up their data
- effectively to improve the table's utility, so we can assume that a slow-to-download pivot table is also slow to
- use/less effective, and will likely be something the user doesn't want (as often).

* some test fixes

* now, if we export 'raw pivot rows', they don't show pivot-grouping

and they also don't include the 'extra' rows for totals/subtotals/grand totals (any row with pivot-grouping > 0).

This means that now the non-pivot version of a pivot table export will match what a user sees if they change the viz
to a regular table.

* remove old test

* re-incorporate some changes from master

* fix csv for non-pivots due to oversight in my changes

This is just a temporary change, I think I should clean up this bit of the code a little, I can probably make it a
little more readable and use some cleaner logic regarding if the rows are 'raw pivot rows' or not.

* start moving format_rows to POST bod, add pivot_results too

There's still wiring work to do, but this starts to add format_rows and pivot_results to POST body for the various API
endpoints. Also modify tests to improve coverage/consistency across downloads and alerts/subscriptions.

The tests will not pass on this commit, but fixes will be incoming

* native pivot tables in xlsx

* add precondition to pass migration linter

* try to get migrations fixed

* pasing pivot-results through api and attachments

* fix tests for format_rows in BODY vs query param

* tests!

* might have the tests all fixed now

* the pivoted export now respects col/row totals settings

* add test coverage for public questions and dashboards

* col and row totals work as expected

* build-pivot refactor for clarity

* docstring change + tiny refactor in helper fn

* see if dashcard download works with format_rows

* csv pivot handles nil values

* pass format_rows and pivot_results in :params not :body

* fix some other tests

* pivot-grouping col filtered out of xlsx

* pivot-grouping-col removed for all rows

* configurable pivot exports and attachments (#47880)

* exports fe

* specs

* ui

* specs

* format/unformatted now works for xlsx

* format test changes for xlsx formatting

* embedding endpoints accept pivot_results

* cljfmt and eslint fix

* empty

* embedding test should have formatting defaulted to true

* embed test fixes

* Use `Chip` for export settings widget

* downloads e2e test fix

* fix public download limit test

* public card download defaults

* fix public download defaults in some tests

* Fix visual test

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>
2024-10-15 09:16:02 -07:00
Aleksandr Lesnenko
ba06b99e2c fix iframe dashcards crash subscriptions (#48589)
* fix iframe dashcards crash subscriptions

* add a test to ensure iframes are filtered out of subscriptions

---------

Co-authored-by: Adam James <adam.vermeer2@gmail.com>
Co-authored-by: adam-james <21064735+adam-james-v@users.noreply.github.com>
2024-10-15 14:21:20 +00:00
Romeo Van Snick
b8997a1efd Remove "Replace or save question" UI when saving and edited question from a metric (#48669)
* Remove 'Save as new question' toggle when saving questions from editing a metrics' ad-hoc question

* Allow visitQuestion to work for metrics

* Use visitQuestion in metric test

* Add test for #48555 (showing the 'Save as new?' ui for metrics)

* Add issue info to repro

* Use visitMetric, visitModel and visitQuestion helpers in createQuestion

* Move check to make it more clear what the save ui does

* Use cy.button for Done button

* Remove unnecessary .within

* Sign in as normal user

* Add missing dataset alias
2024-10-15 15:45:48 +02:00
Uladzimir Havenchyk
caf4284014 chore: more another flaky test to jail (#48677) 2024-10-15 14:35:33 +03:00
Kamil Mielnik
46af3b4c07 Refactor remaining e2e API commands to TS helper functions (#48672)
* Refactor createDashboardWithQuestions, createQuestionAndAddToDashboard and editDashboardCard to TS function helpers

* Fix createNativeQuestionAndDashboard that got out of sync
2024-10-15 10:22:47 +00:00
Ngoc Khuat
1a2a9c8132 [Notification] Task history and retry (#48437) 2024-10-15 10:06:08 +00:00
Nicolò Pretto
dcb843bf9a fix flaky test on embed share behaviour snowplow events (#48665)
* increase time tolerance to make tests less flaky on ci when CPU is under heavy load

* Update e2e/test/scenarios/sharing/public-sharing-embed-button-behavior.cy.spec.js

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

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2024-10-15 08:14:00 +00:00
Romeo Van Snick
86ff88a113 Change Metrics and Summaries copy (#48451)
* Rename Common Metrics to Metrics

* Rename Basic Metrics to Summaries

* Update chill mode button copy to 'Add a summary or metric'

* Rename 'Pick the metric you want to see' button to include summary

* Fix type in test

* Rename Summaries to Basic functions

* Fix test

* Undo cross-version test changes
2024-10-15 09:42:56 +02:00
Ngoc Khuat
a1d8face34 [Notification] Migrate emails (#48392)
* [Notification] Migrate user invited email (#48215)

* [Notification] Migrate alert create email (#48292)

* [Notification] Migrate slack token error email (#48333)
2024-10-15 03:16:18 +00:00
Raphael Krut-Landau
188ad3f074 Show dashboard tab entity ids in dashboard info sidesheet (#48385) 2024-10-14 22:42:52 -04:00
metamben
71c506a4fd Implement inactive field removal (#48636)
* Implement inactive field removal
2024-10-14 22:21:33 +00:00
lbrdnk
9b5ecc0530 Use information_schema as a basis for describe-database in Databricks driver (#48585)
* Use information_schema for describe-database

* Unrelated fix: set dynamic-dataset-loading defaults to true

* cljfmt

* Fix test
2024-10-14 21:31:18 +00:00
Raphael Krut-Landau
3fcdf9d593 Add missing newline (#48704) 2024-10-14 23:45:59 +03:00
Raphael Krut-Landau
84330bf3d1 In question sidesheet, improve the 'Based on' section (#48315) 2024-10-14 15:00:08 -04:00
Uladzimir Havenchyk
c5ac891d2a fix: calculate row for object details correctly (#48673) 2024-10-14 17:35:32 +00:00
bryan
fc64d930f2 jwt token gen to be gated by enable-embedding-sdk (#48637) 2024-10-14 17:20:55 +00:00
Cam Saul
6024bf019c Collapse metabase.shared.* namespaces (#48646)
* Collapse `metabase.shared.*` namespaces

* Fix Kondo warnings

* Does updating the stories-data keys fix the failing tests?

* Appease msgcat

* Appease msgcat

* Fix typo

* Make the build happy

* Appease fslint
2024-10-14 10:06:10 -07:00
Romeo Van Snick
3b4a578689 Enforce empty line before it and describe (#48628)
* Add eslint-plugin-jest-formatting

* Turn on jest formatting for unit.spec and cy.spec files

* Fix e2e test formatting

* Fix unit test formatting

* Fix formatting in frontend/test

* Remove commented out code

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

* Fix more files

* Fix more lint

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-10-14 15:36:36 +00:00
Kamil Mielnik
464902f886 Fix flaky dashcards test (#48676)
* Revert "fix flakiness during resize (#48556)"

This reverts commit 03b6584bda.

* Move .should call up to fix flaky test

* Use consistent naming
2024-10-14 22:12:38 +07:00
Romeo Van Snick
c172fe43ee Do not save metric viz settings to metric (#48609)
* Add repro for #44171

* Do not save viz settings for metrics

* Lowercase description

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

* Rename variable to be more descriptive

* Use visitDashboard

* Fix typo in excludeVisualisationSettings

* Check the request does not contain visualization_settings too

* Allow visitQuestion to work for metrics

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2024-10-14 14:18:27 +00:00
Uladzimir Havenchyk
6007bccaaf deps: upgrade cookie package (#48661) 2024-10-14 16:40:56 +03:00
John Swanson
187e9508a9 Remove old MB_API_KEY setting (#48592)
* Remove `MB_API_KEY` env var

A bit awkwardly, we never set `:deprecated` on the setting before. We
can retroactively deprecate this as of v50.

I'm keeping the setting purely to emit the warning message on startup.
2024-10-14 04:57:34 -07:00
John Swanson
8aa3342e6f version and channel query params for version info (#48616)
* version and channel query params for version info

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

* omit blanks from query params for version info
2024-10-14 04:56:49 -07:00
Kamil Mielnik
bd318208f9 Update markdown link that has been moved (#48663)
* Update GitHub link that has been moved

* Get rid of a failing link
2024-10-14 18:18:05 +07:00
Oisin Coveney
a288c15e57 feat(sdk): Add chart viz selection for InteractiveQuestion (#47744) 2024-10-14 09:07:35 +00:00
Alexander Solovyov
cd2cd950d0 [ParseSQL] log less warnings/errors (#48614)
Two reasons: it's very noisy, and the feature is not very user-visible, so does not make a lot of sense yet
2024-10-14 08:15:06 +00:00
Cam Saul
4a509927d7 🏎️ SHAVE 16 MINUTES OFF OF MYSQL TESTS IN CI 🏎️ (#48489)
* Experimental: try splitting MySQL test jobs into 4 partitions intstead of 2

* user-http-request should make sure users are initialized

* Fix MySQL deadlocks in tests

* Bump init timeout to 90 seconds

* Fix metabase.api.session-test/logout-test
2024-10-14 10:50:29 +03:00
Alexander Polyankin
980291218d Add e2e tests for native query drills (#48503) 2024-10-12 02:46:27 +00:00
Jeff Bruemmer
b1c644f9a4 docs - collection cleaning (#48241) 2024-10-11 21:37:02 +00:00
Noah Moss
d1798f1051 Use saved card metadata to filter fields in query metadata for sandboxed tables (#48577) 2024-10-11 20:52:39 +00:00
Oisin Coveney
5e57ffccdb Convert loadingDashboards redux actions to TS (#48456) 2024-10-11 19:26:30 +03:00
Romeo Van Snick
cbbb11be4e Create metric button and docs link in empty state (#48468)
* Add 'Create metric' button to empty metrics page

* Add e2e test for 'Create metric' button

* Remove duplicate main on Browse page

* Add docs link

* Split off common test for BrowseMetrics

* Add whitespace

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

* Use cy.button

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

* Hide Create metric button when the user does not have data access

* Use findByText for link

* Add test for hiding the 'Create metric' button when the user does not have data access

* Fix unit tests

* Improve copy

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

* Add whitespace

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

* Add explanatory comment for enterprise

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-10-11 16:31:53 +02:00
Nick Fitzpatrick
a207b5c02b adding snowplow event for archiving stale items (#48586)
* adding snowplow event for archiving stale items

* adding total_items_archived to cleanup events
2024-10-11 11:21:46 -03:00
Uladzimir Havenchyk
39df704f51 upgrade rspack and swc (#48558) 2024-10-11 17:13:30 +03:00
Mahatthana (Kelvin) Nomsawadi
a03ea880e1 docs(sdk): Add a guide on how to use the SDK with Next.js (#48569)
* Add Next.js to SDK readme

* Fix typo
2024-10-11 15:02:08 +01:00
github-automation-metabase
74a14bba68 Add v0.50.29 to the list of releases (#48600)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-10-11 09:52:06 -04:00
Romeo Van Snick
2880304fd8 Repro: App crashes when editing custom expression referencing metric when dependent metadata is not loaded (#48560)
* Add repro for #47058

* Delay the response and test for the actual metric button

* Move setup to before and find summarize block using helper

* Use beforeEach
2024-10-11 12:22:56 +02:00
Abed Habli
068d5536fa Document MySQL row limit issue with Vitess (#48568)
* Write Vitess limitation for row limits in MySQL databases

* Update docs/databases/connections/mysql.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-10-11 11:58:50 +02:00
Ngoc Khuat
989f595dfc keep the keys in send-pulse task history underscored (#48601) 2024-10-11 09:32:56 +00:00
Oisin Coveney
09c57642c6 Migrate dashboard embed endpoints to RTK (#48444) 2024-10-11 10:53:52 +03:00
Ryan Laurie
e4192dd585 Remove duplicated lines from release workflow (#48599) 2024-10-10 18:47:10 -06:00
Ryan Laurie
5dc06d13d8 Make beta releases play nicer (#48596)
* fix last release detection to support pre-releases

* better base commit detection for release log

* disable auto nightly tag due to race condition
2024-10-10 18:28:00 -06:00
appleby
c16d05a018 Relax concat args to allow any ExpressionArg (#48506)
* Relax the arg types to ExpressionArg for concat expressions in the legacy schema

Relax the arg types to ExpressionArg for concat since many DBs allow to concatenate non-string types. This also aligns
with the corresponding MLv2 schema and with the reference docs we publish.

Fixes #39439

* Add nested concat schema tests

* Add nested-concat query-processor tests
2024-10-10 16:52:43 -07:00
Nick Fitzpatrick
0cec8d7d2b 48049 error diagnostic command palette (#48544)
* Moving diagnostic state to redux, adding CP action

* changing key binding

* adding e2e test

* adjusting e2e test

* type adjustment
2024-10-10 20:43:36 +00:00
dpsutton
2410012a5f Always startup prometheus metrics (#48547)
* Always startup prometheus metrics

previously only started up when a port was provided

```
MB_PROMETHEUS_SERVER_PORT=9191 java -jar metabase.jar
```

But these counters are useful to be included in anonymous stats. So
let's start up the collectors and then we can get their values like:

```clojure
prometheus=> (dotimes [_ 500] (inc :metabase-email/messages))
nil
;; prometheus/value is iapetos.core/value here
prometheus=> (-> system :registry :metabase-email/messages prometheus/value)
501.0
```

* rename `metabase.analytics.prometheus/inc` to `inc!`

it side effects a value and now no longer shadows `clojure.core/inc` so
we're all happy
2024-10-10 15:39:42 -05:00
Alexander Polyankin
3fe1ef7cb6 Select all changes for dashboards (#48531) 2024-10-10 19:17:22 +00:00
Uladzimir Havenchyk
03b6584bda fix flakiness during resize (#48556)
* fix flakiness during resize

* keep error message
2024-10-10 16:15:47 +00:00
Oisin Coveney
63425f5b66 Rename ResizeObserver variable to prevent global clash (#48563) 2024-10-10 14:15:28 +00:00
Oisin Coveney
fd0987b26f Fix types on dashboard API, and add types for dashboard redux (#48399) 2024-10-10 14:10:46 +03:00
Nicolò Pretto
d6314cc476 don't set enable-embedding and setup-embedding-autoenabled in /setup (#48517)
* don't set enable-embedding and setup-embedding-autoenabled in setup actions + cleanup

* update jest test

* shouldn't expect the secret key to be there either 🙃
2024-10-10 09:29:48 +02:00
Nicolò Pretto
29a24980f1 Point to a solution when the "Unknown premium setting xxx" is shown during tests (#48526) 2024-10-10 09:29:37 +02:00
Ngoc Khuat
fc43d3cd7f [Notification] System event notification (#47857)
* [Notification] Notification and subscription (#47707)

* [Notification] Notification and subscription (#47707)

* [Notification] Handlers + recipients (#47759)

* [Notification] Channel template table and model (#47782)

* [Notification] Render system event emails (#47859)

* [Notification] Strict type for channel template and notification recipient (#47910)

* [Notification] Event hydration (#47953)

* [Notification] Send asynchronously (#48200)
2024-10-10 09:12:57 +03:00
Cal Herries
6324f9481f Lean on DB queries for describe-table for Mongo (#46598)
This PR reimplements driver/describe-table for MongoDB. Before we would query a sample of documents from a collection and analyse them in Clojure. Instead, we now now execute a query that does a similar aggregation, but most of the calculation is done in the Mongo database.

Based on a few tests the performance is slightly slower when the collection contains small or deeply nested documents but much faster for large ones. But the main difference is in memory usage. This uses very little memory in the Metabase instance because all of the aggregation is done in the database.


Nested fields are a naturally recursive problem but here we unroll potential recursions to a `max-depth` number of queries that look for nesting at each depth level.

* ~ use DB to describe the table

* ~ optimize root query

* ~ nested-level-query works and gets objects too

* + root query gets objects too

* + driver/describe-table :mongo works

* ~ remove old implementation

* Various fixes for faster sync

Upgraded driver to 5.2.0
Updated data load to insert many rather than 1 row at a time.
Dropped max-depth to 7, see comment.

---------

Co-authored-by: Case Nelson <case@metabase.com>
2024-10-09 16:07:39 -06:00
Jeff Bruemmer
10fc583f40 docs - add time grouping (#47930) 2024-10-09 21:15:39 +00:00
Jeff Bruemmer
9e6c8a0595 docs - snowflake connection update (#47780)
* account v host snowflake connection

* add screenshot
2024-10-09 17:04:02 -04:00
Jeff Bruemmer
53d7fc7e22 docs - user provisioning with SCIM (#48411) 2024-10-09 16:19:52 -04:00
appleby
01a9255def Do not ignore-errors in pprint-native-query-with-best-strategy (#48246)
Return a description of the Exception that occurred instead.

This is helpful for debugging if query->raw-native-query throws an exception.
2024-10-09 12:34:11 -07:00
appleby
5ce94838a4 Add some more examples to db querying docstrings in dev.clj (#48248) 2024-10-09 12:33:50 -07:00
appleby
8f112be58c Remove duplicate is-clause? fn (#48423)
* Move mbql.u/{mbql-clause?,is-clause?,check-clause} to schema.helpers

And remove duplicate definitions.

Closes #39333

* Fix docstring of schema.helpers.mbql-clause?

This func is apparently no longer used by code in `normalize`, which has it's own local def.
2024-10-09 12:31:54 -07:00
github-automation-metabase
0f3497726f Update Readme version references and published npm version to 0.1.38 (#48535) 2024-10-09 19:20:25 +00:00
Alex Yarosh
d68fbb3acb docs: add a clarification about disabling password logins (#48532)
* add a clarification to sso docs

* rephrase

* Update docs/people-and-groups/authenticating-with-saml.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-10-09 19:18:24 +00:00
Nemanja Glumac
35a5df38a1 [MS2] Better Onboarding UX: Expanded CSV upload permissions (#48475)
* Use more granular permissions

* Simplify the "upload spreadsheet" button logic

* Simplify the "add database" button logic

* Go back to using the existing `databases` prop

* Conditionally display `UploadInput`

* Refine `canUpload` logic

* Reduce prop drilling

* Make visual logic more "reader-friendly"

* Fix and expand tests

* Pass down the existing prop `hasDataAccess`

* Remove the Metabase "learn" link

* Move sub-components out of the render
2024-10-09 17:29:38 +00:00
Phoomparin Mano
000dfe1bf4 fix(sdk): allow CLI to check React version without installing and allow continuing setup if React is missing (#48491)
* check sdk version via package.json and allow continuing setup

* make package version checks more flexible
2024-10-09 23:21:06 +07:00
Jeff Bruemmer
e423bc34f8 update api and env var docs (#48414) 2024-10-09 14:38:58 +00:00
Alexander Polyankin
51cecaf448 Remove source hacks for native query drills (#48482) 2024-10-09 10:19:56 -04:00
Noah Moss
4a1327283b Ensure that features in stats ping can only be enabled if available (#48493) 2024-10-09 09:23:00 -04:00
Romeo Van Snick
1b28389c80 Metrics empty copy (#48449)
* Update copy on metrics page

* Update copy in empty metric builder

* Fix e2e test
2024-10-09 09:12:22 +00:00
Oisin Coveney
77cb69f88e fix(sdk): Attempt to fix resize observer issues (#48227) 2024-10-09 08:40:29 +00:00
Chris Truter
89e9200331 Ensure we realize row before putting it on queue (#48446) 2024-10-09 09:51:07 +07:00
Alexander Polyankin
16044dbcb6 Remove "Draw box to filter" from grid maps for native queries (#48463) 2024-10-08 18:31:19 -04:00
Aleksandr Lesnenko
291384d1f0 add iframe dashcards tracking (#48382)
* track iframe creation

* Update Loki Snapshots

* Update frontend/src/metabase/visualizations/visualizations/IFrameViz/utils.unit.spec.ts

Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>
2024-10-08 21:48:09 +00:00
dpsutton
5fd75e0d06 Ensure the temp directory exists (#48488)
https://github.com/metabase/metabase/issues/41919#issuecomment-2400542908

This issue goes away in 5.3.1 of apache poi. Seems like they have a
yearly release cadence so we can ensure this exists for the time being
and then remove this when we can bump to 5.3.1

```diff
index b763a1ffdf..c87992c935 100644
--- a/deps.edn
+++ b/deps.edn
@@ -122,7 +122,7 @@
   {:mvn/version "2.23.1"}             ; allows the slf4j2 API to work with log4j 2
   org.apache.logging.log4j/log4j-layout-template-json
   {:mvn/version "2.23.1"}             ; allows the custom json logging format
-  org.apache.poi/poi                        {:mvn/version "5.2.5"}              ; Work with Office documents (e.g. Excel spreadsheets) -- newer version than one specified by Docjure
+  org.apache.poi/poi                        {:mvn/version "5.3.1"}              ; Work with Office documents (e.g. Excel spreadsheets) -- newer version than one specified by Docjure
   org.apache.poi/poi-ooxml                  {:mvn/version "5.2.5"
                                              :exclusions  [org.bouncycastle/bcpkix-jdk15on
                                                            org.bouncycastle/bcprov-jdk15on]}
```
2024-10-08 16:17:37 -05:00
Aleksandr Lesnenko
c6b0b2b722 isomorphic viz settings computation (#47963)
* isomorphic viz settings computation

* stories

* drop duplicated static formatter

* drop formatValue from the renderingContext

* clean up

* stories

* fix static charts stories

* clean up mocked env

* update sunburst formatters

* no longer injecting formatValue

* exclude modules without name

* Update Loki Snapshots

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-10-08 16:29:18 -04:00
Ryan Laurie
62861cc74f Update Settings Copy to kick Ci + fix milestone setting bug (#48486)
* update setting copy

* update settings context strings

* fix milestone check
2024-10-08 14:22:47 -06:00
Cam Saul
b817282924 🏎️🚀 🏎️🚀 🏎️🚀 Test partitioning for MySQL: shave ~5 minutes off of CI runs 🏎️🚀🏎️🚀 🏎️🚀 (#48422)
* SQUASH!

* Add another sanity checc

* Another test fix attempt

* Appease Kondo
2024-10-08 12:11:27 -07:00
Nick Fitzpatrick
372d529bee Collection of UI updates to the alert modal (#48431)
* collection of UI updates to the alert modal

* remiving unused es lint directive

* adding tag to cypress test
2024-10-08 15:47:37 -03:00
github-automation-metabase
9df336d051 Update Readme version references and published npm version to 1.51.0 (#48483) 2024-10-08 18:21:01 +00:00
Alex Yarosh
cdea683a7a fix links (#48478) 2024-10-08 13:51:20 -04:00
Nemanja Glumac
662bf17c92 [MS1] Better Onboarding: Educational Section in the Main Sidebar (#48369)
* [MS 1.1] Better Onboarding via First-Time UX (#48202)

* Add new `learn` icon

* Add initial visual elements WIP

* Add a menu WIP

* Use named export instead of a named one

* Encapsulate the menu item logic

* Redo the styling

* Add todo notes

* Get rid of the `style` prop where possible

* Fix CSS logic for the container

* Collapse section when the sidebar is closed

* Use Mantine prop instead of the `style`

* Fix the translation issue

* Collapse section completely when the sidebar is closed

* Remove hard coded color reference from SVG

* Simplify element positioning

* Collapse sidebar when closed

* Fix E2E tests unscoped selectors

* Rename props

* Extract `SidebarOnboardingSection` logic into a separate component

* Allow only admins to add data

* Remove "Add your own data" button

* Simplify menuitem component

* Add initial unit tests

* Use predefined vars for the CSV button subtitle

* Show Upload CSV modal

* Enable file uploads

* Improve file organization

* Tidy up types

* Add analytics

* Remove "Upload CSV" button from the sidebar

* Fix "unmocked GET request"

* Make menu usable on small screens

* Make sure sidebar is scrollable
2024-10-08 19:40:56 +02:00
appleby
1f733b9849 Fix typo in devguide (#48247) 2024-10-08 11:16:51 -06:00
Chris Truter
20cfb42399 Require explicit flag to calculate available_models for search (#48133)
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2024-10-08 18:46:03 +02:00
Alexander Polyankin
3a0a96909a Fix query_metadata not including metadata for native queries (#48459)
* Fix query_metadata not including native queries

* Fix query_metadata not including native queries

* fix tests
2024-10-08 16:43:34 +00:00
Nicolò Pretto
173227ae9f update embedding homepage now that we don't auto-enable embedding (#48455)
* update embedding homepage now that we don't auto-enable embedding

* more cleanup and a test "Enable interactive embedding"
2024-10-08 17:47:49 +02:00
Alexander Polyankin
4aa67506aa Native query drill (#48232) 2024-10-08 14:49:59 +00:00
Ryan Laurie
2ec9fdb178 Update release channel settings copy (#48425)
* update release channel copy

* update e2e tests
2024-10-08 07:49:03 -06:00
Raphael Krut-Landau
0b7bf918c4 Mock audit info requests (#48432)
This PR
* mocks audit requests in tests of `DashboardInfoSidebar` and `QuestionInfoSidebar` (these tests were flaking)
* introduces a helper, `setupAuditEndpoints`, to facilitate this in the future
* uses the helper in one other place where audit requests were getting mocked
2024-10-08 08:58:28 -04:00
Nicolò Pretto
537ba4172e SDK launch in core app (#48107)
Co-authored-by: Oisin Coveney <oisin@metabase.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: bryan <bryan.maass@gmail.com>
Co-authored-by: Nicolò Pretto <info@npretto.com>
2024-10-08 15:40:42 +03:00
Alexander Polyankin
f03e6d8caa Default to = operator when Filtering on this field is set to A list of all values or Search box (#48412) 2024-10-08 08:19:56 -04:00
lbrdnk
724958737d [Databricks] Address initial remarks (#48377)
* Address initial remarks

* Extract hive-like to separate module and set it as dependency

* Remove hive-like also from spark
2024-10-08 09:16:04 +00:00
Phoomparin Mano
74be2dcce5 fix(sdk): update utm tags in embedding sdk cli (#48419) 2024-10-08 15:55:38 +07:00
Kamil Mielnik
f6aab536e0 [Epic] Search in selection in entity picker (#47755)
* Maintain selected folder state in Entity Picker (#47309)

* Keep tabs mounted

* Rename TablePicker onChange to onItemSelect to match QuestionPicker and also call it for folders

* Inline small functions

* Remove unused type

* Rename

* Remove TODOs

* Remove duplication

* Reduce diff

* Rename

* Lift state from TabsView

* Remove redundant callback

* Store folder state in DataPickerModal

* Refactor computing tabs

* Consolidate search tab definition with recents tab definition

* Simplify computeInitialTab interface

* Extract RECENTS_CONTEXT

* Store tab state in DataPickerModal

* Propagate initial tab state

* Fix a flicker

* Keep tab state in EntityPickerModal

* Fix typing computeInitialTab

* Remove Notebook prefix

* Pass onItemSelect to individual tabs from EntityPickerModal

* Auto select folder

* Fix types

* Adjust remaining tabs definitions to use render

* Adjust tabs definitions to use render in tests

* Fix inverted condition

* Fix TS error

* Fix types

* Rename EntityTab to EntityPickerTab, TabId to EntityPickerTabId

* Rename EntityTabRenderProps to EntityPickerTabRenderProps

* Separate tab models from tab ids

* ESLint

* ESLint

* Recognize folders inside EntityPickerModal

* Add missing prop

* Remove console.log

* Simplify handleFolderSelect

* Revert changes that will go to a different PR

* Fix unit tests

* Refactor

* Remove keepMounted prop

* Fix type

* Remove useMemo from tabs computation (#47505)

* Extract getTabs for DataPickerModal

* Extract getTabs for EntityPickerModal

* Add explicit return type

* Revert "Add explicit return type"

This reverts commit feb3f58c3c.

* Revert "Extract getTabs for EntityPickerModal"

This reverts commit 4e875a1fc1.

* Revert "Extract getTabs for DataPickerModal"

This reverts commit cdda8ea185.

* Remove useMemo

* Maintain tab state in Entity Picker (#47794)

* Store picker path state in data picker modal

* Adjust remaining QuestionPicker usages

* Store collection picker state

* Use dedicated onPathChange prop

* Store dashboard picker state

* Improve naming

* Fix unit tests

* Remove accidental code

* Return to previously opened tab when search input is cleared in Entity Picker (#47798)

* Restore previous tab when clearing search input

* Add a unit test for new behavior

* Update comment

* Don't use effect

* Add more tests

* Reduce diff

* Fix flakes

* Change search input placeholder depending on selected folder & tab in Entity Picker (#47801)

* Make TabFolderState generic, pass folder to EntityPickerSearchInput

* Simplify interface

* Extract getSearchInputPlaceholder

* Reduce diff

* Remove TODO

* Implement it

* Shorten code

* Reduce diff

* Use database to scope search if there's only 1 schema

* Add scoped search in the Search tab in Entity Picker (#47839)

* Cleanup entity picker search types (#48098)

* Add e2e tests for local search in the entity picker (#48122)

* Sync the value back into selectedItem when it changes

* Await element

* Handle empty tabs

* Pick everywhere tab

* Click Everywhere in unit tests

* Use deep equality to sync value

* Sync back the path value to the dashboard too

* Run test as admin to avoid (unrelated) permissions issues

* Filter scoped results too

* Fix post-merge issues

* Fix type issues

* Fix null scoped search results

* Sign in as admin to appease the tests

* Use useDeepCompareEffect when syncing back state

* Add default value for searchResultFilter to avoid double condition

* Avoid using useEffect to sync selectedItem

* Avoid overwriting path in useEnsureCollectionSelected

* Fix e2e test

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2024-10-08 08:05:08 +00:00
Oisin Coveney
9f50306f2a Removes unneeded query parameters (#48401) 2024-10-08 06:36:12 +00:00
Cam Saul
cd4d764632 🏎️🚀🏎️🚀 🏎️🚀 SHAVE 7 MINUTES OFF OF NON-CORE DRIVER TEST RUNS IN CI 🏎️🚀🏎️🚀 🏎️🚀 (#47681)
* Parallel driver tests PoC

* Set fail-fast to false for now

* Try splitting up non-driver tests to see how broken tests are

* Whoops fix plain BE tests

* Ok nvm I'll test this in another branch

* Fix fail-fast

* Experiment with the improved Hawk split logic

* Fix some broken/flaky tests

* Experiment: try splitting MySQL 8 tests into FOUR jobs

* Divide other Postgres and MySQL tests up and use num-partitions = 2

* Another test fix 🔧

* Flaky test fix 🔧

* Try making more stuff fast

* Make athena fast??

* Fix a few more things

* Test fixes? 🔧

* Fix configs

* Fix Mongo job syntax

* Fix busted test from #46942

* Fix Mongo config again

* wait-for-port needs to specify shell I guess

* More cleanup

* await-port can't have a timeout-minutes I guess

* Let's only parallelize MySQL for now.

* Cleanup action

* Cleanup wait-for-port action

* Fix another flaky test

* NOW driver tests will be FAST

* Need to mark driver tests too

* Fix wrong tag

* Use Hawk 1.0.5

* Fix busted metabase.public-settings-test/landing-page-setting-test

* Fix busted `metabase.api.database-test/get-database-test` etc. (hopefully)

* Fix busted `metabase.sync.sync-metadata.fields-test/sync-fks-and-fields-test` for Oracle

* Maybe this fixed `metabase.query-processor.middleware.permissions-test/e2e-ignore-user-supplied-perms-test` maybe not

* Fix busted metabase.api.dashboard-test/dependent-metadata-test because endpoint had differemt sort order than test

* Ok my test fix did not work

* Fix metabase.sync.sync-metadata.fields-test/sync-fks-and-fields-test for Redshift

* Better test name

* More test fixes 🔧

* Schema fix

* PR feedback

* Split off test partitioning into separate PR

* Fix failing Oracle tests

* Another round of test fixes, hopefully

* Fix failing Redshift tests

* Maybe the last round of test fixes

* Fix Oracle

* Fix stray line
2024-10-08 04:32:12 +00:00
Alexander Polyankin
cffae16871 Select All follow-ups (QB) (#48405) 2024-10-07 18:46:47 -04:00
Jeff Bruemmer
4a6700f2ce docs - metrics v2 (#47872) 2024-10-07 14:54:32 -04:00
metamben
de50ba7164 Implement better partitioning and sorting in window functions (#48028)
Implement better partitioning and sorting in window functions
2024-10-07 18:36:58 +00:00
Alexander Polyankin
39ba5b866d Allow Box props in Icon (#48398) 2024-10-07 17:25:52 +00:00
Alex Yarosh
6bcd9acf05 docs: gauge chart (#48269)
* gauge

* progress addition

* alternatives

* update link

* 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-07 16:34:16 +00:00
Raphael Krut-Landau
e0984e2a85 Fix unit tests in CollectionInfoSidebar (#48403) 2024-10-07 16:29:16 +00:00
Case Nelson
eaabfa7929 feat: move auth providers behind ee token (#48245)
* feat: move auth providers behind ee token

Fixes #48235

Introduces new premium feature `database-auth-providers`.
Moves fetch-auth behind defenterprise - oss will always return an empty
map.
Add metabase.util.http to test outbound http requests.

* Fix broken refs

* Drop defmethod as adhoc overrides aren't desirable outside ee

* Drop unessary require

* Fix token and tests

* Fix tests

* Fix formatting

* Fix var cast exception

* Fix connection test

* Move test to ee namespace

* Move more tests behind enterprise

* Fix checked-section hiding
2024-10-07 10:13:26 -06:00
Vamsi Peri
d6eeaf1ec6 Update team.json remove Emmad (#48397) 2024-10-07 09:21:23 -05:00
Jeff Bruemmer
0988835652 docs - iframe cards (#48375) 2024-10-07 10:02:00 -04:00
Ryan Laurie
217597420a Hide entity ids when an instance has serialization disabled (#48327)
* look I did a clojure!

* only show entity ids when serialization is enabled

* update tests

* ok fine typescript

* fix test
2024-10-07 07:56:59 -06:00
Ryan Laurie
b5954d603f Update pre-release version nomenclature (#48357)
* support for pre-release suffixes

* handle milestones better

* update prerelease function in github action

* update zero coalescing
2024-10-07 07:41:35 -06:00
Ngoc Khuat
7c3f18ddca Further improved send pulse log (#48342) 2024-10-07 04:05:42 +00:00
Raphael Krut-Landau
4fa5aa7299 Collection sidesheets (#48082) 2024-10-05 17:12:23 -04:00
Emmad Usmani
2fb8287acc sunburst click behavior e2e test (#48367)
* sunburst click behavior e2e test

* await error text before going back
2024-10-05 21:03:53 +00:00
Aleksandr Lesnenko
55a42c7e80 hide dashcard actions when editing iframe card content (#48314)
* hide dashcard actions when editing iframe card content

* spec

* renaming

* check if viz supports previewing
2024-10-05 02:37:19 +00:00
Ryan Laurie
4e343c1da5 Add Release Channel selection in-product (#48126)
* add update channels in product

* support for changing release notes to show beta and nightly info

* dont export setting

* obey the linter and add tests

* export setting

* update e2e tests

* clojure magic

* clojure-foo

* better localization

* sorry mr linter

* add more tests 💪
2024-10-04 22:02:31 +00:00
Jeff Bruemmer
313fde9879 docs - databricks (#48365) 2024-10-04 14:36:24 -04:00
Aleksandr Lesnenko
4cfabbecc1 fix incorrect handling of offset-based timezones (#48329)
* fix incorrect handling of offset-based timezones

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-10-04 16:18:36 +00:00
Nick Fitzpatrick
e5fcbc4b3f RC -> beta (#48346) 2024-10-04 12:15:26 -03:00
Alex Yarosh
154e62921d remove unnecessary hash links (#48331) 2024-10-04 10:47:23 -04:00
Emmad Usmani
d4f9a2045c sunburst improvements (#48316)
* sunburst improvements

* fix dimension picker styles

* simplify styles

* update e2e test

* add loki specs

* add missing newlines
2024-10-04 07:41:01 -07:00
Jeff Bruemmer
7ed9dbd34d docs - image updates (#48274) 2024-10-04 09:13:57 -04:00
Raphael Krut-Landau
2451a779ab Tiny edit to metric copy (#48328) 2024-10-04 06:59:48 -04:00
Ngoc Khuat
2603f2402e Do not clear http channels when sending pulse (#48330) 2024-10-04 09:46:19 +00:00
Oisin Coveney
3c16a1bdb0 Add API endpoints for public + embedded entities (#48290) 2024-10-04 10:30:20 +03:00
Ryan Laurie
40ed53ef8e Fix root collection links in sidebars (#48263)
* fix root collection links in sidebars

* use collection url function
2024-10-03 22:09:41 +00:00
Jeff Bruemmer
aee56f5892 docs - saml page edits and SLO (#47261) 2024-10-03 20:47:56 +00:00
Nick Fitzpatrick
dbb6df1814 guard database create route (#48308) 2024-10-03 17:31:39 -03:00
Oreon Lothamer
b1493c27c0 add security-events: write to uberjar permissions (#48320) 2024-10-03 10:21:01 -10:00
Luiz Arakaki
f256171055 tweak the copy of CC and BCC setting (#48272) 2024-10-03 13:53:08 -05:00
lbrdnk
a44015ae4c Use context for field id computation while hydrating dashbaord (#47820)
* Use context for field id computation while hydrating dashbaord

* Update docstring

* Fix target

* Update lookup

* Fix param-target usage

* Unskip e2e

* Bind *param-id-context* in public dashboard compputation

* Fix context update

* Fix field-ids->param-field-values-ignoring-current-user

* Add tests

* Comments

* cljfmt

* Update field-ids->param-field-values-ignoring-current-user

* Update src/metabase/models/params.clj

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

* Update src/metabase/models/params.clj

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

* Use atom instead of volatile!

* Avoid dynamic function var

* Update src/metabase/models/params.clj

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

* Address remarks

---------

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2024-10-03 20:49:29 +02:00
Luiz Arakaki
205f2239bd allow embedding external content on dashboards (#47994)
* embed cards

* safety

* rename params

* review, renaming

* min and default size of iframe cards

* move ml auto to parent

* use truncate

* spec failures

* empty state

* consistent iFrame copy

* renaming, no fe tracking

* iframe copy

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
2024-10-03 16:09:43 +00:00
Aleksandr Lesnenko
0d27f8749c tweak area-focus-blur-styles (#48282) 2024-10-03 11:05:28 -04:00
Nicolò Pretto
70a8ab70a8 feat(sdk): support locale prop on MetabaseProvider (#47569)
* wip locale header middleware

* wip fe code for the locale provider for both public/static and sdk

* clean up code

* move api.baseurl assignment outside of useEffect to make it work on first render

* e2e test for locale

* Revert "wip locale header middleware"

This reverts commit c215eac3f8.

* remove public/static code as we want to focus on the sdk

* adds docs for `X-Metabase-Locale` header and for why we don't use I18NApi.locale

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

* doc: explain why we have the unused state
2024-10-03 16:28:08 +02:00
Nick Fitzpatrick
fd615bf20a Add isLoadingTabs prop to EntityPicker (#47447)
* isLoadingTabs

* skeleton loading state

* adjusting skeleton colors

* maz color tweak

---------

Co-authored-by: Maz Ameli <maz@metabase.com>
2024-10-03 10:56:57 -03:00
Romeo Van Snick
65841e8440 Edit metric and model links (#48231)
* Update the labels for the Edit question action for models and metrics

* Use the metric and model editor by default

* Add e2e tests for metric and model cards

* Remove console.log

* Add extra mode for editing metrics or models

* Use slug to do exact match of path

* Rename editor mode to query

* Rename as param to mode
2024-10-03 13:34:46 +00:00
Uladzimir Havenchyk
ed3ce1e618 fix a warning about outdated meta tag (#47915) 2024-10-03 13:23:11 +00:00
Kamil Mielnik
bb24220a1e Fix redundant isSmallAppBar prop warning (#48287) 2024-10-03 16:04:43 +03:00
Chris Truter
9e09a6d1da Fix appending to models with existing non-ascii columns (#48237) 2024-10-03 10:06:57 +00:00
Ngoc Khuat
24232c6736 add more logging for sending pulse (#48286) 2024-10-03 08:16:29 +00:00
appleby
e2b74d79f6 Add tests for exporting self-joined renamed columns (#48244)
* Add BE test for exporting self-joined renamed columns
* Add e2e test for exporting self-joined renamed columns

See also

- Not renamed fields in a same table join inherit the renamed name in exports #48046
- backport: Support both name & field ref-based column keys in viz settings on read and upgrade on write #48243
2024-10-02 16:53:19 -07:00
Ryan Laurie
a8f48df215 Batch Add Milestones to new release branch (#48250)
* add action to batch process release branch milestones

* top level await workaround

* add more logging

* cleanup
2024-10-02 16:47:43 -06:00
Emmad Usmani
61e610b3b9 add sunburst to pie chart (#47208)
* add sunburst to pie chart

* fix type errors

* consider all slice percent values for formatting percent on chart

* fix lint error

* refactor nested functions outside of parent

* create and use getArrayFromMapValues helper

* fix bug with percent significant digits

* improve color picker

* fix total visibility in small dashcards

* fix missing field remappings

* use aggregated value for click behavior

* update minimum slice percentage logic

* fix total text truncation

* remove colors from tooltip for middle and outer slices

* update e2e spec

* update snapshot

* update ring setting titles

* address feedback

* update comment
2024-10-02 22:39:18 +00:00
Case Nelson
3fd17081b2 fix: bigquery more resilient querying (#48175)
* fix: bigquery more resilient querying

Inline some function calls to make it easier to track what's happening.

Make sure that cancellation during the initial query and subsequent page
fetches are handled properly. Explicitly throw when cancelled.

Only retry queries if bigquery says they are retryable.

Try to cancel the BigQuery job if an exception or cancellation occurs.

* Add comment explaining execution flow

* Bump bigquery deps

* Bump biquery dependencies

* Fix tests

* Fix formatting
2024-10-03 00:46:48 +03:00
Aleksandr Lesnenko
5faa6f367a rename number of decimal places setting (#48273) 2024-10-02 20:46:09 +00:00
Jeff Bruemmer
a1093dd15a docs - webhooks draft (#48239) 2024-10-02 16:31:34 -04:00
Emmad Usmani
7764892c86 fix aggressive legend truncation (#48207)
* fix aggressive legend truncation

* add e2e test

* revert LegendVertical changes

* update legendTitles calculation in PieChart

* restore size prop in LegendVertical

* fix e2e test
2024-10-02 20:19:23 +00:00
github-automation-metabase
825e19b83e Add v0.50.28 to the list of releases (#48270)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-10-02 14:16:40 -04:00
Oreon Lothamer
23c85cf032 build ee-extra docker image (#47960) 2024-10-02 07:55:40 -10:00
Nick Fitzpatrick
ae8f28abac adding swag button (#48155)
* adding swag button

* adding unit tests

* updating copy and colors

* adjusting rc version detection

* adding t-shirt icon. Updating gradient and copy

* final adjustments

* I can't spell
2024-10-02 14:45:03 -03:00
github-automation-metabase
7821f9829f Update Readme version references and published npm version to 0.1.37 (#48268) 2024-10-02 17:44:20 +00:00
Alberto Perdomo
10e8b58506 docs(sdk): Improvements to SDK readme (#47711)
* Improvements to SDK readme

* Add live demo site to SDK readme

* Remove suggested workarounds for SSR

* Use - for bullets for consistency

* Remove Loom

* Update enterprise/frontend/src/embedding-sdk/README.md

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

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-10-02 16:36:50 +00:00
Nicolò Pretto
67fc1c91b5 fix(sdk): fix zindex issues after switch to portals (#48256)
* fix(sdk): fix zindex issues after switch to portals

* Target portal to a different root than popovers and co

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-10-02 15:55:32 +02:00
Arkadi Yaroslavtsev
66f8f30c21 Removing nemanja from querying (#48255) 2024-10-02 06:46:42 -04:00
Romeo Van Snick
3a3785d27b Disable value column on Browse metrics page (#48217)
* Remove value column from Browse metrics page

* Remove tests for metric values

* Fix markdown test
2024-10-02 09:11:40 +02:00
Ryan Laurie
670ec10011 Add alternative release channel info to version-info.json (#48153)
* allow updating version-info with other channel info

* polish + tests

* found the version swallower
2024-10-01 17:40:24 -06:00
Emmad Usmani
b85167704d fix pie chart e2e test flake (#48212) 2024-10-01 19:45:18 +00:00
Alex Yarosh
bc96b28870 [docs] Trash (#43049)
* trash

* Trash update

* review comments

* link

* why are you complaining

* text to tables

* Apply suggestions from code review

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

* review comments

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-10-01 14:37:35 -04:00
Alex Yarosh
f39c331ddc docs: JWT groups with environment variables (#48240)
* docs: JWT groups with env vars

* typo
2024-10-01 14:30:52 -04:00
Oleksandr Yakushev
f14bfd4ad3 perf: Do fewer moderation_reviews queries when fetching recent views (#48169) 2024-10-01 19:59:59 +03:00
Uladzimir Havenchyk
46a91cc4f6 fix: allow aggregation removal from qb sidebar (#48230) 2024-10-01 19:47:08 +03:00
Emmad Usmani
e46b627347 fix uncentered pie chart (#48179) 2024-10-01 09:29:29 -07:00
Romeo Van Snick
21fb561ea5 List metrics in native editor data reference (#48191)
* Add metrics to table pane

* Add test for metric in data reference sidebar

* Clean up other reference tests

* Add test for when the table has no metrics

* Use helper for sidebar header title

* Rename sidebar to create distinction from existing helper
2024-10-01 18:20:42 +02:00
Chris Truter
4b278779ac Future-proof CSV uploads from next HoneySQL upgrade (#48220) 2024-10-01 18:05:20 +02:00
Nicolò Pretto
abe04bc24e fix(sdk): modal pushing content below when opened (#48216)
* fix(sdk): modal pushing content below when opened

* render the portal below the content so we don't need the zIndex

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

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-10-01 17:39:31 +02:00
Nicolò Pretto
9861c417ad fix: wrap Filter by this value in t (#48226) 2024-10-01 14:15:32 +00:00
Oisin Coveney
c5f27d495f Merge remote-tracking branch 'origin/fix(sdk)/fix-react-17-and-resize-observer' 2024-10-01 16:52:08 +03:00
Raphael Krut-Landau
24c5e69d8a fix: Don't show error page when command palette documentation link is clicked (#47862) 2024-10-01 09:41:59 -04:00
Uladzimir Havenchyk
896af8a312 add eslint plugin for storybook (#48206)
* add eslint plugin for storybook

* fixup

* fixup

* fixup
2024-10-01 16:16:02 +03:00
Oisin Coveney
e8756d9d9d revert scalar change for this branch 2024-10-01 16:10:10 +03:00
Oisin Coveney
b105525834 Move changes to another brnach 2024-10-01 16:09:14 +03:00
Noah Moss
424134263f Sync DBs in a future when initializing MB from config file (#48176) 2024-10-01 09:01:45 -04:00
Oisin Coveney
8b984479e9 Merge branch 'master' into fix(sdk)/fix-react-17-and-resize-observer 2024-10-01 15:52:00 +03:00
Oisin Coveney
62ca675b3a make sure that themes are respected 2024-10-01 15:51:48 +03:00
Oisin Coveney
33fb74e083 Attempt a fix at font size scaling 2024-10-01 14:27:09 +03:00
Chris Truter
b28aa417be Upload test fixes for drivers without auto mb-id (#48194) 2024-10-01 10:18:41 +00:00
Romeo Van Snick
012408eb2a Show "New metric" command panel (#48201)
* Add 'New metric' action to command palette

* Add test for 'New metric' in command palette
2024-10-01 11:21:57 +02:00
Romeo Van Snick
e98c0e38bc Browse cleanup (#48136)
* Simplify browse components imports

* Move metrics-related browse components to separate folder

* Move models related browse components to separate subdir

* Split up browse/test-utils

* Move schemas related browse code to separate folder

* Move databases related browse code to separate folder

* Move tables related browse code to separate folder

* Fix import paths

* Avoid drilling into metric module

* Avoid drilling into models module

* Move enterprise tests for browse models

* Format comments

* Remove unused sortModelsByVerification plugin helper

* Support skipToken in useFetchModels

* Simplify models content verification

* Fix filter button query

* Do not filter recent models if there are no verified models

* Use filterButton helper everywhere

* Fixup comment

* Use new var-style color
2024-10-01 11:15:02 +02:00
Nicolò Pretto
688b9ad95d fix(sdk): decrease specificity of css reset in embedding sdk (#48193) 2024-10-01 09:46:34 +02:00
Romeo Van Snick
3716a0a51b Await dashcard query when editing to fix flake (#48181)
* Await dashcard query when editing

* Reload to fix flake

* Reset filters to fix flake

* Await dashcard query when editing

* Wait for query

* WIP

* Hard-visit dashboard

* Split up test to avoid navigation issues
2024-10-01 08:34:01 +02:00
Chris Truter
7420aa6065 Fix search test flake (#48187) 2024-10-01 06:07:07 +00:00
Kamil Mielnik
2c3b5838c6 Fix - metrics do not work with offset in custom expressions (#48188)
* Allow using metrics with offset in custom expressions

* Unskip and update repro
2024-10-01 12:35:36 +07:00
Jeff Bruemmer
a5466e05c6 Update WebhookChannelEdit.tsx (#48211) 2024-10-01 08:27:00 +07:00
Noah Moss
76d8b61867 Fix shape of metadata in Snowplow stats ping to conform to new schema (#48205) 2024-09-30 20:22:15 -04:00
Vamsi Peri
8ab526f2e9 Add GreptimeDB to the list of community drivers (#48214) 2024-09-30 21:54:56 +00:00
John Swanson
0ef2052fb9 Do not cache all token check failures (#48147)
* Do not cache all token check failures

We want to cache token checks to avoid an issue where we repeatedly ask
the store "hey, is this token valid?? is this token valid?? is this
token valid??" for the same token.

However, transient errors can also occur. For example, maybe a network
issue causes the HTTP request to fail entirely. In this case, if we
cache the result, the user needs to restart metabase (or wait 5 minutes
until the cache is cleared) before they can attempt to validate their
token again.

This PR moves the cache logic deeper into the stack. We want to cache
"successful" responses from the store API - cases where the store has
told us categorically that the token is or is not valid. We don't want
or need to cache other things that might happen. Maybe your token isn't
the right length - we can recalculate that, it's ok. Maybe you get a 503
error from the Store - we should let you retry. Maybe your network is
having issues and you can't contact the Store at all - again, we should
let you retry.

The one potential issue I see here is that if the store goes down, we'll
massively increase the number of requests we send to the store,
potentially making it harder to recover. If this is a concern, I can add
a circuit breaker: if we repeatedly get errors back from the store, back
off and stop making requests for a while.

* Add a circuit breaker to store API requests

In the pathological case where the store goes down for >5 minutes, the
cache will expire and all instances everywhere will start repeatedly
making requests for token validation at once. This might make recovering
from an outage more difficult.

This adds a circuit breaker around the API request. If the call
repeatedly throws (5XX errors, socket timeouts, etc.) then we'll pause
for 1 minute, during which time all calls to token validation will
immediately fail without making any request to the API.

After one minute, we'll allow one request through to the API. If it
succeeds, we'll go back to normal operation. Otherwise, we'll wait
another minute.
2024-09-30 14:22:12 -07:00
Noah Moss
1dd41ef5d0 Fix timezone comparisons in failing execution stats test (#48204) 2024-09-30 20:52:16 +00:00
Nicolò Pretto
dcc33cebdf updateSetting e2e typed helper (#48161)
* putSetting helper

* change all usages of cy.request("PUT" "api/setting/..." to putSetting(...) in e2e tests

* Update e2e/support/helpers/api/putSetting.ts

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

* Update e2e/support/helpers/api/putSetting.ts

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

* sort exports

* putSetting -> updateSetting as per PR suggestion

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-09-30 17:17:29 +02:00
Romeo Van Snick
474b137abb Disable "Compare to the past" UI components (#48134)
* Temporarily disable compare to the past ui components

* Temporarily disable compare to the past tests

* Skip Compare to past unit tests
2024-09-30 16:35:06 +02:00
Luiz Arakaki
e8307b280e Rename Metabase analytics to Usage analytics and other small fixes (#48151)
* rename usage analytics and few fixes

* update e2e tests

* update some other strings too

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
2024-09-30 11:25:23 -03:00
Uladzimir Havenchyk
268b6c48ad refactor: rework stories from MDX to MDX + CSF (#48054)
* refactor: rework stories from MDX to MDX + CSF

* short syntax

* fix or bypass typescript errors

* fix leftovers

* cleanup leftovers

* convert js stories to tsx

* restore some comments

* fix linting
2024-09-30 15:25:07 +03:00
Noah Moss
e12e36044e Fix non-bool value in CSV upload availability check for stats ping (#48167) 2024-09-27 19:38:05 +00:00
Braden Shepherdson
e8deecc58f [QP] Don't attach :temporal-unit :default to every temporal clause (#48085)
This was old logic to support certain drivers (eg. pre-JDBC Druid) and
isn't required for most. It's perfectly sound to filter or even break
out on a datetime column without bucketing.

Adds a new `:temporal/requires-default-unit` driver feature, and enables it only for the legacy Druid driver.

Fixes #47341
2024-09-27 13:38:06 -04:00
Nicolò Pretto
93cd63aca9 test(sdk): test that "Custom" fonts work with the sdk (#48160) 2024-09-27 17:08:20 +02:00
Romeo Van Snick
974ee22073 Reset the dashboard parameter when setting the default value (#48089)
* Reset the dashboard parameter when setting the default value

* Fix test for filter default

* Add test for setting parameters when editing the defaults

* Use plain dispatch

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

* Use cy.log instead of comments

* Use icon selector

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2024-09-27 14:51:17 +00:00
adam-james
3dfcb3d561 Pivot Options are Properly Calculated for Questions based on Models with Joins (#47830)
Fixes 46575

Creating a Pivot Table Question that is based off of a model that has at least one column derived from a join failed
to display row totals.

This is because the pivot-options map was being mis-calculated; not all column indices were correctly found/passed in
to the :pivot-rows or :pivot-cols keys, causing the pivot query not to compute all necessary data.

Here, I just modify the :lib/source key of the columns whose source is a card (as determined by the existence of
:lib/card-id). The columns being checked will all have :source/breakout, which caused, in the issue's repro example,
the "NAME" column to be missed. If it instead has :lib/source :source/card, the logic inside
`lib/find-matching-column` works.
2024-09-27 14:38:53 +00:00
Ryan Laurie
015d6521cd Pass credentials to nightly build tag workflow (#48159) 2024-09-27 06:21:34 -06:00
lbrdnk
22260b7334 Temporarily fix hive-like dependency (#48148) 2024-09-27 13:46:08 +02:00
Ryan Laurie
4040b9d23f 🏳️ Realign description inputs (#48152) 2024-09-27 03:38:07 -06:00
Oisin Coveney
a387bc6d7b Convert ChartType components to Mantine (#47745) 2024-09-27 12:06:24 +03:00
Chris Truter
847a3230e5 Fix edge cases where uploads munged display names (#48149) 2024-09-27 10:30:35 +03:00
Chris Truter
1f95447352 Periodically recreate the search index (#48137) 2024-09-27 05:15:18 +00:00
Nicolò Pretto
ed24366ea9 fix(sdk): remove ts limitation on custom fonts + some minimal e2e tests for the fonts (#48071)
* IS_EMBEDDING_SDK_BUILD -> IS_EMBEDDING_SDK to keep things simple, as we already have that name in other places

* don't load metabase css in sdk stories

* first two stories

* make the store not a global "singleton" anymore

* basic test for font-family styles in the SDK

* allow any custom font in theme.fontFamily as we actually support it

* fix tests using hardcoded default font family
2024-09-26 18:53:00 +02:00
Ryan Laurie
d489654cba Add additional dashboard info to sidesheet (#48078)
* create dashboard settings sidebar

* only show settings to dashboard editors

* add dashboard details

* update localization

* fix merged type

* fix mixed-up creation and editing
2024-09-26 09:09:32 -06:00
lbrdnk
c04928d5b6 Databricks JDBC driver (#42263)
* Databricks JDBC driver base

* Add databricks CI job

* WIP data loading -- it works, further cleanup needed

* Cleanup

* Implement ->honeysql to enable data loading

* Hardcode catalog job var

* Implement driver methods and update tests

* Derive hive instead of sql-jdbc

* Cleanup leftovers after deriving hive

* Run databricks tests on push

* Cleanp and enable set-timezone

* Disable database creation by tests

* Add Databricks to broken drivers for timezone tests

* Exclude Databricks from test

* Enable have-select-privilege?-test

* Restore sql-jdbc-drivers-using-default-describe-table-or-fields-impl post rebase

* Restore joined-date-filter-test

* Adjust to work with dataset definition tests

* Adjust alternative date tests

* Remove leftover reflecttion warning set

* Update test exts

* cljfmt vscode

* Add databricks to kondo drivers

* Update metabase-plugin.yaml

* Update databricks_jdbc.clj

* Rework test extensions

* Update general data loading code to work with Databricks

* Reset tests to orig

* Use DateTimeWithLocalTZ for TIMESTAMP database type

* Convert to LocalDateTime for set-parameter

* Update test extensions field-base-type->sql-tyoe

* Update database-type->base-type

* Enable creation of time columns in test data even though not supported

* Fix typo

* Update tests

* Udpate tests

* Update drivers.yml

* Disable dynamic dataset loading tests

* Adjust the iso-8601-text-fields-should-be-queryable-date-test

* Update load-data/row-xform

* Add time type exception to test

* Update test data loading and enable test

* Whitespace

* Enable all driver jobs

* Update comment

* Make catalog mandatory

* Remove comment

* Remove log level from spec generation

* Update sql.qp/datetime-diff

* Update read-column-thunk

* Remove comment

* Simplify date-time->results-local-date-time

* Update comment

* Move definitions

* Update test extension types mapping

* Remove now obsolete ddl/insert-rows-honeysql-form implementation

* Update sql-jdbc.conn/connection-details->spec for perturb-db-details

* Update load-data/do-insert!

* Remove ssh tunnel from driver as tests do not work with it

* Update test

* Promote ::dynamic-dataset-loading to :test/dynamic-dataset-loading and modify corresponding tests

* Adjust to broken TIMESTAMP_NTZ sync

* Update read-column-thunk to return timestamps always in Z

* Comment

* Disable tests for dynamic datasets

* Return spark jobs into drivers.yml

* Update Databricks CI catalog

* Remove vscode cljfmt tweak

* Update iso-8601-text-fields-expected-rows

* Update datetime-diff

* Formatting

* cljfmt

* Add placeholder test

* Remove comment

* cljfmt

* Use EnableArrow=0 connection param

* Remove comment

* Comment

* Update tests

* cljfmt

* Update driver's deps.edn

* Update tests

* Implement alternative `describe-table`

* WIP Workaround for timestamp_ntz sync, will be thrown away probably

* Update metabase-plugin.yaml with schema filters

* Update driver to use schema filters and remove now redundant sync implemnetations

* Update tests

* Update tests extensions

* Update test

* Add feature flags for fast sync

* Implement describe-fields

* Implement describe-fks-sql

* Enable fast sync features

* Use full_data_type

* Comment

* Add exception for timestamp_ntz columns to new sync code

* Implement db-default-timezone

* Add timestamp_ntz ignored test

* Add db-default-timezone-test

* Fix typo

* Update setReadOnly

* Add comment on setAutoCommit

* Update chunk-size

* Add timezone-in-set-and-read-functions-test

* Drop Athena from driver exceptions

* Use set/intersection instead of a filter

* Add explicit fast-sync tests

* Update describe-fields-sql and add comment

* Add preprocess-additional-options

* Add leading semicolon test

* Disable dataset creation and update comment

* Rename driver to `databricks`

* Use old secret names

* Fix wrongly copied hsql list

* Temporarily allow database creation

* Add *allow-database-deletion*

* Temporarily allow database creation

* Disable database creation

* cljfmt

* cljfmt
2024-09-26 16:22:20 +02:00
Chris Truter
e1d68af3aa Reorganize search namespaces to isolate legacy code (#48108) 2024-09-26 10:50:26 +00:00
Oisin Coveney
1ab2ce5948 use shim check for shimming 2024-09-26 13:08:58 +03:00
Oleksandr Yakushev
402ddc7e58 perf: Improve the performance of /api/collection/tree when there are many collections (#48026)
* perf: Faster is-trash? for collections

* perf: Faster annotate-collections and collections->tree

* perf: Optimize path generation in collection->tree
2024-09-26 12:19:26 +03:00
Oleksandr Yakushev
3ced541f50 perf: Use vectors to iterate over all user permissions (#48025) 2024-09-26 12:19:03 +03:00
Noah Moss
2173e65974 Migrate stats ping to Snowplow (#47823)
Co-authored-by: Thomas Schmidt <thomas@metabase.com>
2024-09-25 15:34:23 -04:00
Ryan Laurie
3624863eb4 invalidate channels html as well (#48120) 2024-09-25 13:28:06 -06:00
John Swanson
7e00dc3216 Require :encryption for string settings (#48067)
* Require `:encryption` for string settings

For settings that are not typed as JSON, CSV, or strings, encryption now
defaults to `:no` (*except* if you have
explicitly marked your setting as `:sensitive?` - these will default to
`:when-encryption-key-set`).

I went through all our settings and provided what I think are reasonable
values here. I tried to be conservative - when I wasn't sure whether a
stored setting was sensitive, I kept it as encrypted. For example, the
`ldap-port` setting is probably non-sensitive but theoretically someone
could be using a weird port for security-by-obscurity, so I kept that
encrypted.

* Change possible values for `:encryption`

`:maybe` was confusing: let's be more explicit that the value will be
encrypted `:when-encryption-key-set` to make it obvious what actually
turns encryption on and off.
2024-09-25 12:26:21 -07:00
Nick Fitzpatrick
35e7d3a842 Query Validator e2e updates (#48093)
* test with disabled query analysis and feature disabled in token

* types

* useSetting
2024-09-25 15:46:56 -03:00
Nemanja Glumac
635ad3a4e0 Pre fill non-sensitive user information during setup for hosted instances (#48019)
* Pre-fill cloud user info from search params

* Autofocus password field for hosted instances

* Add tests

* Parse setup user info and store it immediatelly

* Autofocus password input field for hosted instances

* Add e2e reproduction

* Fix the user info

* Fix unit test
2024-09-25 19:03:09 +02:00
Anton Kulyk
dddf499a36 Additional tooltip metrics for waterfall and scatter charts (#48088) 2024-09-25 17:50:26 +01:00
Ryan Laurie
77fc050915 Only update version info for latest tag (for now) (#48096)
* only update version info for latest tag (for now)

* add another safety check
2024-09-25 10:45:06 -06:00
Ryan Laurie
ba5b982008 Automatically tag automatic releases as nightly (#48101)
* auto tag nightly releases

* update dependencies
2024-09-25 10:44:35 -06:00
Ryan Laurie
c28f288d27 Fix release log generation 😅 (#48091)
* fix release log generation

* proper github actions type casts
2024-09-25 10:44:16 -06:00
Oisin Coveney
d5ff47ef60 feat(sdk): Filter DataPicker models for CreateQuestion (#47542) 2024-09-25 16:30:01 +00:00
Sloan Sparger
d2ca54511e [Permissions] PR Feedback for 47630 (#48116) 2024-09-25 11:23:11 -05:00
Oisin Coveney
c20874b131 Merge branch 'fix(sdk)/fix-react-17-and-resize-observer' of github.com:metabase/metabase into fix(sdk)/fix-react-17-and-resize-observer 2024-09-25 18:40:39 +03:00
Oisin Coveney
015a176b08 Just get the major release number and check that in actual places 2024-09-25 18:39:21 +03:00
Oisin Coveney
983593ef44 Update resize-observer.ts 2024-09-25 17:59:23 +03:00
Oisin Coveney
66772671c1 Update check-version.unit.spec.ts 2024-09-25 17:58:48 +03:00
github-automation-metabase
2e2e99d7a9 Add v0.50.27 to the list of releases (#48102)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-09-25 10:57:19 -04:00
Oisin Coveney
b1a7b8bc57 Merge branch 'master' into fix(sdk)/fix-react-17-and-resize-observer 2024-09-25 17:55:43 +03:00
Jeff Bruemmer
74e03ef850 docs - update notice for community drivers (#48111) 2024-09-25 10:55:41 -04:00
Sloan Sparger
0cab39b680 display warning that native query access is restricted if a table or schema is set to blocked (#47630) 2024-09-25 09:54:57 -05:00
Oisin Coveney
026adec1ea First attempt at a fix 2024-09-25 16:43:14 +03:00
lbrdnk
0857356df9 Remove CLJS_SRC_PATH_DEV from ignored watch dirs (#48063) 2024-09-25 09:50:41 +03:00
Alexander Polyankin
957f616709 Make select all/none search-aware (#48086)
* Fix cancelling of editing of a metric

* Fixes

* Fixes

* Fixes
2024-09-24 16:43:45 -04:00
Case Nelson
1e45098d6f Bump redshift driver (#47957) 2024-09-24 12:46:44 -06:00
Case Nelson
1186871dd7 feat: BigQuery Faster Sync (#48027)
* feat: BigQuery Faster Sync

Use describe-fields for much faster big-query sync.

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2024-09-24 12:45:53 -06:00
Ryan Laurie
f8a5a30d79 Separate Releasing from "Latest" release determination (#47868)
* Support manual release channels

s3 tag

fix check

generate matrix

generate matrix

add git tagging

channel observability

version info update

handle some edge cases

* remove testing code

* update unit tests

* support rollout percentage for  latest channel

* update rollout onlyh

* update unit tests

* address review comments
2024-09-24 11:14:00 -06:00
Alexander Polyankin
13d8dabd06 Fix cancelling of editing of a metric (#48081) 2024-09-24 16:45:10 +00:00
Romeo Van Snick
7ffdd99787 Verified metrics (#47886)
* Support skipToken in useFetchMetrics

* WIP

* Add user setting for verified metrics

* Add verified metrics to the VERIFIED_CONTENT plugin

* Use metric plugins for verified metrics

* Move helpers down

* Do not filter for verified metrics if there are none, regardless of user setting

* Add label to filter button

* Revalidate search when card gets (un-)verified

* Add e2e test for verified metrics

* Avoid checking for verified metrics on when content-verification is not enabled

* Fix broken test

* Simplify content verification plugin structure for metrics

* Add content moderation types and API helpers

* Update content moderation plugin to make use of the moderation api in metabase/api

* Fix lint

* Fix missing list tag

* Store verified metric filter preference

* Move all helpers to the bottom

* Ensure the user setting gets updated when chaning the filter

* Add comment about component similarity

* Undo changes to embedding-sdk
2024-09-24 16:44:30 +00:00
Romeo Van Snick
9d36cc1487 Reset filters in dashboard click action (#48075)
* Use default values for parameters in dashboard filters when used from click action

* Add test for setting non-specified parameters to default in dashboard accessed via click action
2024-09-24 18:23:59 +02:00
Chris Truter
5639635553 Speed up minimal Postgres fulltext search (#48053) 2024-09-24 16:49:21 +03:00
Ryan Laurie
35d4611ca9 Dashboard Settings Sidebar + Enhance Dashboard Info Sidebar (#47905)
* create dashboard settings sidebar

* update e2e tests

fix

* only show settings to dashboard editors

* update copy

* update e2e test

* fix types

* update tests for new copy

* fix import
2024-09-24 13:16:20 +00:00
Chris Truter
7f45d2d2e4 Another fix to avoid dynamic scope in search (#48052) 2024-09-24 09:25:07 +00:00
Ryan Laurie
011335a8ec Sidesheet Polish 🇵🇱 (#47935)
* size and padding fixes

* linkify and align stuff in question details

* reorganize and divide question overflow menu

* hide history for analytics content

* fix verification icon alignment

* whoopsie lets commit all the files

* fix css file name
2024-09-23 22:04:41 -06:00
Sloan Sparger
af906decec [E2E] Remove the default-ee spec (#47162)
* removes the default-ee snapshot in favor for a blockUserGroupPermissions util

* commit default-ee removal i forgot, replace default strings with undefined

* fix oopsie

* fixes failures for not removing enough permissions for tests in sandboxes.cy.spec.js

* rename var
2024-09-23 16:27:54 -05:00
lbrdnk
5b61229dc2 Downgrade gh runner image for sqlserver 2017 job (#48060) 2024-09-23 21:00:50 +00:00
Nemanja Glumac
e6f80ff0a6 Remove unused var card-or-throw (#48057) 2024-09-23 18:12:00 +02:00
Nicolò Pretto
ac1a651dd5 make expectGoodSnowplowEvent output an informative error (#48044) 2024-09-23 09:49:03 +02:00
Nicolò Pretto
3069da5d05 reduce logs in cypress tests by checking before removing folder (#48043) 2024-09-23 09:47:56 +02:00
Sloan Sparger
e66aad3481 [E2E] Improve + Fix tests that use sandboxing (#46465)
* fixes some tests where data permissions were overwriting sandboxing permissions, makes assertions in tests where sandboxing user is used but the test also passes if you were to sign in as the normal user, fixes one test that sandboxes the wrong table for the test

* do not push - wip changes

* add assertions to that network requests are provided sandboxed data, fix faulty test in dashboard-filters-source.cy.spec.js

* use helpers to clean up parts of pagination assertions

* rename assertDatasetIsSandboxed to assertDatasetReqIsSandboxed

* adds assertions on api response data

* clean up

* fix typo

* refactor helper to be easier to follow

* golfing

* pr feedback

* fix

* fix
2024-09-20 11:16:46 -05:00
Chris Truter
48aad35c79 Tweak some sheet around CSV uploads (#48000)
* Return the table id from csv upload (as a header)

* Add date format that google sheets uses

* Smuggle id

* done?

* comment

* with empty h2 db

* dashing

* fix flaky test

* Parse the correct date class

---------

Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2024-09-20 15:15:04 +02:00
Filip Hric
84d13d180c Add snowplow to e2e docs (#47765)
* add snowplow mention to e2e docs

* tweak new snowplow doc page to be more in line with old section

* Update docs/developers-guide/e2e-tests.md

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

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2024-09-20 12:50:40 +02:00
Ryan Laurie
1869c83f39 Admin webapp owns the ui lib now (#48030) 2024-09-19 15:04:34 -06:00
Chris Truter
775d9c941d Some polish around experiment search (#47986) 2024-09-18 18:56:15 +03:00
Uladzimir Havenchyk
7251ee1203 update jspdf (#47969) 2024-09-18 09:05:08 +00:00
Chris Truter
f7b482c6a9 Minimal search using only index (#47918) 2024-09-17 23:46:17 +00:00
Aleksandr Lesnenko
43a7ce0630 echarts viz ergonomic tweaks (#47980) 2024-09-17 21:10:21 +00:00
adam-james
23595c1255 Pivot Exports/Downloads Should Not include pivot-grouping or 'Extra' Rows (#47832)
* Pivot Exports/Downloads Should Not include pivot-grouping or 'Extra' Rows

Fixes 46561

When downloading a pivot table's data, a column 'pivot-grouping' is included as well as 'extra' rows that correspond
to various totals in the table.

This PR removes the pivot-grouping column and any of these 'extra' rows from the downloads/exports.

* fix xlsx

* Fix csv

* fix json

* add test and fix some failing tests

* fmt

* Update src/metabase/query_processor/streaming/csv.clj

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

* static viz table renders filter out pivot-grouping

* address review feedback

* add some comments to try explain the changes

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2024-09-17 19:26:30 +00:00
amardatar
44806ac67c Fix text alignment for dashboard text card (#47540) 2024-09-17 20:31:02 +02:00
github-automation-metabase
e4bd821058 Add v0.50.26 to the list of releases (#47970)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-09-17 11:03:32 -05:00
Alex Yarosh
ff683759ef docs: make password resetting instructions more prominent (#47958)
* make resetting instructions more prominent

* link
2024-09-17 13:00:49 -03:00
Uladzimir Havenchyk
a5c0f91c9f bypass race condition to avoid flakiness in click behaviour test (#47917)
* increase timeout to fix flakiness

* add more timeout

* timeout

* WIP

* bypass race condition
2024-09-17 15:36:34 +03:00
Case Nelson
85857aeb61 fix: snowflake compile day trunc to timestamp_ltz (#47874)
Fixes #47426

Date operations return values based on the timestamp offset rather than
the session/db timezone. Converting to `timestamp_ltz` first ensures
that we get predictable results.

In the test, it is important that database timezone matches
report_timezone so that post-processing gives proper results.
2024-09-16 16:03:49 -06:00
metamben
1174d9cc9e Fix ordering by the accumulated column (#47875) 2024-09-14 02:15:11 +03:00
metamben
d8786ffc63 Ensure :effective-type for columns from an aggregation in a card (#47936)
* Ensure :effective-type for columns from an aggregation in a card

Fixes #47184

* Synchronize effective-type with the base-type on override

When :base-type in the column metadata is overridden with the :base-type in the field ref, set it as :effective-type
too.  If :effective-type is also set in the field ref, it wins.
2024-09-14 01:15:32 +03:00
Phoomparin Mano
c7bd308b55 feat(sdk): add visual cues in sdk around evaluation usage and feature flags (#47821)
* add license problem hook

* add warning banner

* style cue component

* update cue component

* report issue to console

* report issue to console

* use sdk loader for pre-initialization

* extract print problem method

* use non-standard shadows

* add unit tests

* prevent console log spam during tests

* mock the embedding token feature

* mock the embedding token feature by default

* add more test cases

* add test case

* add test cases

* increase popover z-index

* simplify test setup

* simplify test setup

* do not load individual component when a license error happens

* move SdkLicenseProblemDisplay component out

* replace colors with color-mix

* replace colors with color-mix

* make the text unthemed to ensure legibility

* hard-code colors to prevent them from being themed

* hard-code colors to prevent them from being themed

* update border styles

* make the chevron unthemed

* unset console text color

* only set stroke on errors

* optimistic query settings

* document the sdk license condition

* remove redundant condition

* add notes on api keys always being allowed on localhost

* move the no auth method message to warning component

* rename sdk license problem to usage problem

* add eslint rule for stories

* rename sdk license problem to usage problem

* move sdk usage problem display out of the init controller

* specify fallback font if instance is down or CORS error

* add comments on conditions pending on the CORS PR

* add notes on non-localhost checks

* make test ids constant

* add test case for neither provided

* fix types

* address code reviews

* pass `embedding-sdk` flag in `token-features`

* address code review

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

* remove appName from console logs

* rename embedding-sdk to embedding_sdk

* add the embedding_sdk premium token feature

* do not setup enterprise plugin in sdk test

* do not localize visual cue messages

* fix unit test in setup-sdk-auth

* rename tests

* remove unused eslint-disable

* enable embedding_sdk premium feature for sdk unit tests

* revert security_test.clj to use embedding instead of embedding-sdk

* remove unneeded test

* changes to support the style leak fixes

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-09-14 03:18:55 +07:00
Alexander Polyankin
50b88711bf Add Select all to dashboard parameters (#47897) 2024-09-13 16:17:04 -04:00
appleby
16e31051b0 Revert to non-truncating mbql.u/unique-name-generator in annotate-native-cols (#47866)
* Rollback to legacy unique-name-generator in annotate-native-cols

* Add native query long column alias test to nested queries tests

* Add native query long column alias test to dataset api tests

* Add native query long column alias test to models e2e tests

* Move limit into inner native query

* PR suggestion: simplify lambda argslist

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

* PR suggestion: remove unnecessary mt/with-temp-copy-of-db

* Tweak test name

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2024-09-13 18:58:04 +00:00
Uladzimir Havenchyk
ea233941c2 add more e2e tests for offset feature (#47628)
* add offset e2e tests

* mark test not flaky

* add basic tests

* add more tests

* WIP

* working version

* cleanup

* oops

* improve naming

* fix test

* improve formatting

* update comment and ts

* add a test for metric

* space

* update tests and create a new issue

* add one more test

* re-enable test

* make imports consistent

* rewrite tests to put data through UI
2024-09-13 20:23:32 +03:00
Nicolò Pretto
e07e28ee1f first iteration to scope sdk styles to our components (#47764)
* first iteration to scope sdk styles to our components

* basic css reset for buttons

* clean up duplicated css

* make sdk components use instance font if no font is passed

* cleanin up and remove defaultProps not needed

* fix tests

* adds EMBEDDING_SDK_PORTAL_CONTAINER_ELEMENT_ID

* Update enterprise/frontend/src/embedding-sdk/components/public/MetabaseProvider.tsx

* Update enterprise/frontend/src/embedding-sdk/components/public/MetabaseProvider.tsx

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

* fix import

* prettier --write

* we don't need theme.fontFamily, added a comment

* rename EMBEDDING_SDK_PORTAL_CONTAINER_ELEMENT_ID to EMBEDDING_SDK_PORTAL_ROOT_ELEMENT_ID

* fix unit test

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-09-13 19:16:20 +02:00
Ryan Laurie
677afd795e Dashboard Info Sidebar (#47893)
* Dashboard Info Sidebar

* e2e test updates

* add unit tests

* e2e test updates

* fix e2e tests

* fix more e2e tests

* update back behavior
2024-09-13 17:11:05 +00:00
Alex Yarosh
e11b3a7717 docs: multiline export (#47925)
* multiline export

* Update docs/installation-and-operation/serialization.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-09-13 16:02:37 +00:00
Alex Yarosh
72d0152953 docs: progress bar docs (#47792)
* progress bar

* rephrase

* better word

* streamline the article

* rename image

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-09-13 15:57:23 +00:00
Nick Fitzpatrick
3751b96761 correctly parse collection id, update path state on handleNewDashboard (#47318) 2024-09-13 09:24:17 -06:00
dpsutton
1addcc198a Controlled upgrades (#47877)
* Initial commit of controlled upgrades

- new setting upgrade-threshold (`MB_UPGRADE_THRESHOLD`)
  number 0-100
- conditionally removing latest from upgrade checks

AS OF RIGHT NOW IT ALWAYS REMOVES the latest.
Should help FE make this optional

* dumb mistake

* handle no latest version info

* implement and basic test

* More tests, refactor name

* more tests

* cljfmt does not like commas in source code.

* Just move site-uuid to the declaration and don't declare it

nothing is sacred in the settings order. no reason. i think i was just
trying to minimize the diff, which a dumb and ignoble goal.

* add context strings

* update unit tests

* use display version

* Have upgrade threshold include current major version

hopefully helps rotate people from early to late, and late to early
across major versions. Idea from sanya and quite nice!

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
2024-09-13 09:58:35 -05:00
Aleksandr Lesnenko
24235d2b67 Fix pie rows settings include filtered out values (#47879)
* dedupe a bit

* remove pie row settings for values not from dataset

* remove unnecessary filtering

* series -> rows

* extend spec

* feedback
2024-09-13 14:32:50 +00:00
Uladzimir Havenchyk
54ffe92a6b fix broken test about resizing column by readonly user (#47916)
* fix broken test about resizing column by readonly user

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

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

---------

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2024-09-13 16:58:27 +03:00
Alexander Solovyov
49cfe35881 [serdes] field name is only unique in combination with parent_id (#47808)
so we need to account for that in serialization paths, storage
paths and when exporting/importing foreign keys
2024-09-13 09:32:26 +03:00
Ryan Laurie
0d70e9b002 More question details in sidebar (#47705)
* more detailed question info

small styling updates

refine styling to match designs

update more e2e test

remove some changes

small styling updates

more question details

more question details

DateTime to typescript

test updates

type updates

export fix

fixes

* Icon Updates

* consolidate styles

* test updates

* address review comments
2024-09-12 20:36:18 +00:00
Ryan Laurie
059b2ce10e Remove more metabse settings (#47510)
* remove more metabse settings

* fix missing update for latest version check

* test updates

* fix setting selectors
2024-09-12 12:38:58 -06:00
Ryan Laurie
10775a08ed cleanup data reference tooltips (#47747)
* cleanup data reference tooltips

* update test
2024-09-12 12:38:46 -06:00
Alexander Polyankin
344faf7fcf Add Select all in ListValuePicker (#47865)
* Unify FilterPickerForm

* Unify FilterPickerForm

* Add Select all in ListValuePicker

* Layout changes

* Layout changes

* Add tests

* Add tests

* Revert "Unify FilterPickerForm"

This reverts commit a7dfe8848d.

* Revert "Unify FilterPickerForm"

This reverts commit 8f002b8721.
2024-09-12 18:37:18 +00:00
Phoomparin Mano
381c321ace fix(sdk): remove the unknown premium feature console warnings (#47885)
* remove the unknown premium feature warning

* remove ee-plugins from sdk

* remove ee-overrides from sdk
2024-09-13 00:39:30 +07:00
Nicolò Pretto
b8073ded7d update prettier so we can use satisfies (#47858) 2024-09-12 18:22:06 +02:00
Romeo Van Snick
6b06a99367 Show temporal metric value on browse metrics table (#47814)
* Render values for temporal metrics

* Render data as rich

* Add tests for temporal metric

* Add TODO about isDate

* Check for errors in dataset

* Add unit test for timeseries dataset

* Add check for rows earlier

* Group tests better

* Add e2e test for metrics with no value

* Add test for metric with error
2024-09-12 18:11:56 +02:00
Chris Truter
d5af9a22f4 Basic batching for search index population (#47892) 2024-09-12 15:49:20 +00:00
Alexander Polyankin
8486a9f9c8 Allow filtering on all stages in the QB (#47818) 2024-09-12 11:03:04 -04:00
Alexander Polyankin
2c60164c8b Fix empty header in BooleanFilterPicker (#47889) 2024-09-12 14:55:18 +00:00
Chris Truter
2de9801625 Include completions of the final word in fulltext search (#47848) 2024-09-12 16:51:26 +02:00
Chris Truter
f9eab41bf2 Basic search index management (#47846) 2024-09-12 12:02:18 +00:00
Alexander Solovyov
0064a6aac7 store user_parameter_value asynchronously (#47719) 2024-09-11 17:57:13 +03:00
Jeff Bruemmer
d908592d02 remove firebolt link (#47852) 2024-09-11 10:25:31 -04:00
John Swanson
0c4a3f8a93 Fix some minor collections issues (#47472)
* Fix some minor collections issues

- explicitly provide access to the trash to all users, in the same way
we provide access to personal collections. Due to migration order, we
don't necessarily have a permissions row with the correct `perm_type`,
`perm_value`, and `collection_id` for the Trash collection. That's ok -
we don't actually move things to the Trash, so there isn't any
item where `collection_id=$trash.id` - but this may affect things like
effective ancestors for children of the trash. Let's be explicit about
the permissions that users have.

- replace a case where we manually calculated effective location and
then got the parent_id with just hydrating `:effective_parent`. This is
more efficient.

- replace the simple hydration method for `effective-location-path` with
a batched hydration method that fetches `visible-collection-ids` *once*
and then uses it to figure out the effective location path for each
collection passed.
2024-09-11 07:20:24 -07:00
Jeff Bruemmer
655b38dd2e update api docs (#47851) 2024-09-11 10:12:16 -04:00
Cam Saul
3beb7fbea2 Misc. API auto-generated documentation fixes. (#47827) 2024-09-11 09:23:14 -04:00
Raphael Krut-Landau
0833bebbac ci(admin/performance): Test several caching strategies and methods (#45231)
This PR tests that the user can assign any of three cache invalidation strategies ("duration", "adaptive", and "don't cache") to dashboards and questions. The tests check that the following things are true:
* These strategies can be applied directly (via the sidebar)
* Dashboards and questions can inherit their caching strategy from the database that underlies them
* Dashboards and questions can inherit their caching strategy from the instance-wide default policy
* When a question inside a dashboard has been assigned a strategy, this is overridden by the strategy assigned to the dashboard.

What these tests do not examine:
* the schedule strategy
* the minimum query duration
* edge-case strategies, such as very long durations or very large values for the adaptive strategy multiplier

These may be addressed in follow-up work.

Closes #45355
2024-09-11 08:57:29 -04:00
Mahatthana (Kelvin) Nomsawadi
e5ce416141 Retry the assertion until it's true (#47845) 2024-09-11 12:28:26 +00:00
Romeo Van Snick
e45836b85d Always show metrics and models in menu (#47723)
* Alway render models and metrics links

* Remove useHasMetrics and useHasModels helpers'

* Update metrics test for metrics in sidebar

* Fix unit test

* Fix e2e tests
2024-09-11 09:24:25 +02:00
Aleksandr Lesnenko
1baad2a18c fix static visualizations dashcard settings merging (#47789)
* fix static visualizations dashcard settings merging

* cleanup, fix types

* drop an empty file
2024-09-11 04:04:26 +00:00
github-automation-metabase
1b785b2d6c Add v0.50.25 to the list of releases (#47822)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-09-10 23:51:33 +00:00
metamben
e38ddceca8 Enable named aggregations in offset expressions (#47783)
Fixes #47735
2024-09-11 01:34:46 +03:00
John Swanson
15291292c4 Move stale endpoint to /ee/stale/${collection-id} (#47188)
* Move stale endpoint to /ee/stale/${collection-id}

It's an enterprise-only endpoint, so it makes sense to put the whole
thing under enterprise.

* refactors ui to use ee stale endpoint

lint fixes, change endpoint location

fix failure e2e test

* Fix endpoint location

---------

Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
2024-09-10 14:36:12 -07:00
John Swanson
e3c94e4a1b Don't encrypt site-locale (#47731)
* Don't encrypt `site-locale`

* Fix test for `site-locale`

The previous test required encryption. Theoretically the referenced
error just depends on the fact that something is logged during the
process of getting the value, so I reworked it to depend on that
directly rather than triggering it through an encryption key rotation.
2024-09-10 12:29:24 -07:00
Alexander Polyankin
73829ade32 Remove FE hacks for empty display names for column groups (#47812) 2024-09-10 18:39:09 +00:00
Alexander Polyankin
4427ae5d6f Remove column group singularization (#47805) 2024-09-10 13:41:05 -04:00
Romeo Van Snick
6b563b2d30 Show Scalar metric value on Browse metrics page (#47685)
* Add metric actions

* Fix dot menu width

* Refetch card when it's being (un-)bookmarked

* Add tests for metric dot menu

* Make sure bookmarked metric appears in sidebar

* Make sure restoring a metric works

* Add more tests for readonly users

* Use non-root collection for metric test

* Render Scalar metric values

* Add tooltip

* Render Scalar metric value using formatValue

* Move isMetricScalar and getMetricValue to utils

* Add e2e tests for scalar metric values

* Fix unit tests

* Add card query endpoint to metabase/api

* Use card query from api instead of question loader

* Add test for non-numeric scalar metric

* Move providesCardQueryTag to utils

* Use skipToken for query

* Clean up getDatasetScalarValueForMetric
2024-09-10 18:47:38 +02:00
Chris Truter
5830d8dc94 Tidy up CSV encoding detection (#47809) 2024-09-10 17:28:05 +01:00
Chris Truter
56d2164015 Introduce Postgres-only search index (#47752) 2024-09-10 16:12:47 +00:00
Chris Truter
05ec3b33fc Basic character set handling (#47799) 2024-09-10 14:49:43 +00:00
Alexander Polyankin
a8305b6272 Extract MetricEditor component from DatasetEditor (#47774) 2024-09-10 14:24:47 +00:00
Romeo Van Snick
6685b249cd Metrics dot menu (#47391)
* Add metric actions

* Fix dot menu width

* Refetch card when it's being (un-)bookmarked

* Add tests for metric dot menu

* Make sure bookmarked metric appears in sidebar

* Make sure restoring a metric works

* Add more tests for readonly users

* Use non-root collection for metric test
2024-09-10 16:14:02 +02:00
Aleksandr Lesnenko
82b13c2530 show additional columns in the tooltip (#47700)
* show additional columns in the tooltip

* specs, tweaks

* drop stack dependency

* handle invalid columns

* change copy
2024-09-09 21:59:40 +00:00
Braden Shepherdson
6e290bc6c7 [QP] Correctly handle :lib/internal-remap columns in :result_metadata (#47587)
Fixes #45938.

Remapping is handled at the top level of the query, and should be
ignored for inner queries. This PR hides it from `results_metadata` on
source queries.

It also fixes the interaction with `large-int-id` logic to make big
integers JS-safe.
2024-09-09 19:48:46 +00:00
Oleksandr Yakushev
635f04d95f perf: Use more efficient query validation when the argument is valid (#47724) 2024-09-09 19:32:03 +00:00
Ryan Laurie
b797ea4f03 Question Info + Settings Sidesheets (#47157)
* Question Settings Sidesheet (#47699)
2024-09-09 12:24:49 -06:00
metamben
18e669c046 Convey cancelation info when the client closes the connection (#47740)
Fixes #4755
2024-09-09 20:23:55 +03:00
Anton Kulyk
41b4b6872d Toggle series visibility from chart legend (pie charts) (#47581)
* Add series visibility props to `ChartWithLegend`

* Mark pie slices as visible or hidden

* Don't let to hide the last visible slice

* Add space between legend dot and title

* Fix legend dot outer circle is clipped by overflow

* Use `ChartSettingSeriesOrder` for `pie.rows` setting

* Actually hide slices and exclude from total calc

* Don't show "0%" next to hidden slice legend items

* Hide the "Other" slice

* Make overflow slices popover interactive

* Fix hover

* Fix incorrect visibility state in legend popover

* Add e2e test

* Remove debug stuff

* Fix hover and drill issues with slice index calc

* Fix `pie.rows` ordering bug

* Revert "Fix hover and drill issues with slice index calc"

This reverts commit f104aaa584.

* Fix hover and drill issues with slice index calc (2)

`dataIndex` based approach

* Use a special data key for the "Other" slice

* Fixed viewport size in legend e2e test

* Fix jumping legend width

* Fix dot and label vertical alignment

* Rework pie e2e test

* Fix legend dot and label alignment
2024-09-09 17:37:11 +01:00
Emmad Usmani
c1b850ef61 handle errors without crashing in SliceNameWidget (#47729)
* handle errors without crashing in SliceNameWidget

* add test
2024-09-09 16:31:13 +00:00
Case Nelson
07dd373f35 fix: bigquery add null checks to result processing (#47590)
* fix: bigquery add null checks to result processing

Fixes #47339

On the related issue there are different stacktraces indicating
likely sources of null pointer exceptions.

1. `.getNextPage` is likely returning a nil value. I was unable to reproduce this but one thing I did notice is that `hasNextPage` is recommended over checking `.getNextPageToken`. Added nil handling around `page` possibly being nil.

2. `cancel-chan` may be triggered before processing begins and such `execute-bigquery` would pass nil as a TableResult to the initial reducer. Testing if cancel-chan happens at just the right moment would be too flaky for CI testing but I was able to reproduce this locally and is fixed by the nil handling added.

3. `cancel-chan` may be triggered during query processing. This is covered by a test now.

* Check hasNextPage in test:

* Add test for null getNextPage

* Fix cljfmt
2024-09-09 09:47:27 -06:00
github-automation-metabase
7e228527c9 Update Readme version references and published npm version to 0.1.36 (#47762) 2024-09-09 11:42:56 +00:00
Phoomparin Mano
4d9b144b6d fix(sdk): remove usage of legacy query in static question (#47727)
* remove legacy queries from static question in sdk

* remove second query argument

* remove the databaseSupportsPivotTables check from isSensible
2024-09-09 18:21:17 +07:00
Anton Kulyk
6cca5fb344 Recalculate "graph.metrics" and "graph.dimensions" if empty (#47692)
* Add repro

* Update `isValid` check for metrics and dimensions

* Fix unit test
2024-09-09 11:43:28 +01:00
Phoomparin Mano
4333267824 feat(sdk): add the create question component demo to the cli (#47348) 2024-09-09 16:48:24 +07:00
Romeo Van Snick
d566fae9d3 Browse metrics page (#47277)
* Add custom image for empty metrics

* Add useFetchMetrics helper

* Copy browse models page to metrics page

* Add route for browse metrics page

* Add useHasMetrics hook

* Add link to browse metrics page to the sidebar

* Simplify MetricsTable component

* Render description markdown in table too

* Add unit tests for browse metrics page

* Remove custom padding

* Fix line height of markdown cell

* Add e2e tests for browse page

* Fix metrics sorting

* Fix types

* Fix column widths and cell padding

* Typo

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

* Remove name check

* Simplify alphabet

* Remove resetSnowplow

* Use helper to get metric in table

* Use MouseEvent from React directly

* Use --mb-color-icon-primary

* Test ellipsification of description

* Simplify useHasMetrics

* Move useHasMetrics MainNavBar

* Merge sortMetrics and sortModels into sortCards

* Fix metric default description

* Extract SidebarSkeleton to a separate component

* Test sorting via Collection too

* Use ModelTableRow to fix cursor

* Share more components between ModelsTable and MetricsTable

* Use the same simplified structure in ModelsTable as for MetricsTable

* Render block-level elements as inline so ellipsis detection works

* Pick better testid for metric name

* Remove delay

* Avoid type specificty error in sortCards

* Add test for not opening in new tab

* Remove useFetchMetrics defaults

* Fix unit test import

* Test meta-click with cypress

* Add comment on inline markdown elements

* Use model-name test id

* Use correct colors for icon

* Remove delay from browse models page too

* Make meta key in test platform-dependent

* Fix hover color on metrics table

* Add focus styling for celss in the models and metrics table

* Use MarkdownPreview for table cells

* Define --mb-color-icon-primary

* Make the collection link take up the whole height of the cell

* Remove tabIndex from table rows

* Rename ModelsTable.module.css to BrowseTable.module.css

* Rename CardsTable to BrowseTable

* Remove single module.css class in favor of styled components

* Allow customising allowed elements

* Allow forcing all markdown on one line

* Render bold and italics in markdown descriptions and move content onto one line

* Fix legacy tooltip in test

* Make sure getValueForSorting returns a string

* Remove empty file

* Remove icon for metrics in the table

* Remove else statement.

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

* Remove async findBy where possible

* Add github issue link for TODO item

* Disambiguate between getMetricDescription type

* Be explicit with sortModelOrMetric

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2024-09-09 11:39:23 +02:00
Alexander Solovyov
fd6e2f11e2 [serdes] api: better error when archive looks weird (#47721) 2024-09-09 10:59:41 +03:00
Oisin Coveney
fc73743631 fix(sdk): Fix entity ID logic to use the correct status (#47748)
* Fix entity ID status

* bump ci

---------

Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
2024-09-07 04:24:44 +00:00
Oisin Coveney
836bb7d025 Split ChartType components into files (#47737) 2024-09-06 23:18:31 +00:00
Noah Moss
da106c7217 Fix admin override for public actions (#47717) 2024-09-06 17:14:05 -04:00
Ryan Laurie
ad6775b3e6 Basic Sidesheet Components (#47100)
* Basic Sidesheet Components

* sidesheet samples and storybook stories

* add unit tests and fix more imports

* small styling updates

* small styling updates

* fix tests

* Update frontend/src/metabase/common/components/Sidesheet/SidesheetCard.tsx

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

* fix type problem

---------

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2024-09-06 14:53:20 -06:00
github-automation-metabase
df0ccc8649 Update Readme version references and published npm version to 0.1.35 (#47738) 2024-09-06 20:51:36 +00:00
Noah Moss
346e30b2cd Simplify backend Snowplow API in preparation for migrating stats ping to Snowplow (#47687) 2024-09-06 20:49:21 +00:00
Alexander Polyankin
842c2107e5 Hide temporal comparisons in the notebook editor for metrics (#47732) 2024-09-06 20:40:14 +00:00
Oisin Coveney
387db2abcd fix(sdk): Use modal instead of hacky form for saving questions (#47448) 2024-09-06 13:16:48 -07:00
Alexander Polyankin
38dcee804c Add docs url to the metric editor (#47702)
* Add metric sidebar

* Add tests

* Rename ResizableNotebook to DatasetNotebook

* Add tests

* Add tests

* Add tests

* Add tests
2024-09-06 13:49:01 -04:00
bryan
d284a70301 fix test: make sure there is a db and perm group (#47728) 2024-09-06 17:39:34 +00:00
Nicolò Pretto
2835164939 fix(sdk): default font not working (#47712)
* fix(sdk) default font on not working

* fix initial state for the sdk
2024-09-06 17:40:32 +02:00
Ryan Laurie
eb9dca9b44 Reduce frequency of release status messages (#47722)
* reduce release status messages

* fix comment
2024-09-06 08:03:19 -06:00
Alexander Solovyov
5cc1dbfe2c [serdes] option to dump full stacktraces on errors (#47676) 2024-09-06 16:25:38 +03:00
Ryan Laurie
e86ef791ef Fix Transparent disabled state on mantine switch label (#47677)
* make custom disabled state more specific than transparent style

* make it less nesty
2024-09-06 07:12:08 -06:00
Oleksandr Yakushev
45ed2c6f57 perf: Optimize some query processor functions (#47658)
* perf: [metabase.util.performance] Faster mapv for small collections

* perf: Optimize some query processor functions
2024-09-06 15:22:21 +03:00
Chris Truter
6c11dc6e2f Fix missed spots still using dynamic user vars for search (#47709)
* Fix miss

* Another spot, plus clean up
2024-09-06 12:16:58 +02:00
Mahatthana (Kelvin) Nomsawadi
e9db88131f Always allow localhost:* on CORS (#47663)
* Always allow localhost:* on CORS

* Use `embedding-app-origin-sdk` method for the headers

* Fix BE code formatting

* Fix BE formatting
2024-09-06 08:55:07 +00:00
Alexander Solovyov
b1a36a05dd clojure 1.12.0 (#47708) 2024-09-06 08:40:32 +00:00
Oisin Coveney
8ba6a7da11 Add CardDisplayType type to narrow values for charts (#47543) 2024-09-05 14:51:49 -07:00
Jeff Bruemmer
42394d2737 update api docs (#47703) 2024-09-05 16:56:19 -04:00
Alexander Polyankin
3fd01b63e6 New can-run/can-save restrictions for metrics (#47626) 2024-09-05 20:54:13 +00:00
John Swanson
87a08b9d15 Add a quick test for perms on timeline API (#47636)
We had a security issue where it was possible to query timelines without
having the requisite permissions on the collection. This test checks to
make sure this doesn't happen again.
2024-09-05 13:16:24 -07:00
Alexander Polyankin
f0ac75a392 Metrics notebook step restrictions (#47368) 2024-09-05 15:23:49 -04:00
adam-james
8a02e75ffd Catch Errors in Download process and only write error message (#47482)
* walk the error to remove any visualization settings

Thanks Dan for the patch, this approach is nice because it doesn't require changing all 3 streaming-response-writer
implementations (json csv and xlsx). It keeps behaviour basically the same, but just cleans up the output to not
include potentially sensitive column/dataset details.

* add a test that confirms json/csv errors are cleaned

* walk the error to remove any visualization settings

Thanks Dan for the patch, this approach is nice because it doesn't require changing all 3 streaming-response-writer
implementations (json csv and xlsx). It keeps behaviour basically the same, but just cleans up the output to not
include potentially sensitive column/dataset details.

* add a test that confirms json/csv errors are cleaned

* fix dataset error test

* cljfmt

* try to be a little more surgical with what we take out of the error

* formatting again, oops

* pass export format, only modify the obj for file exports

In the case of errors being saved to files, the obj is a map with a :status :failed key assoc'd by the qp somewhere
along the way. The format-exception cond branch is not used in this case, so we can't rely on modifying
`format-exception` to just dissoc ex-data.

Instead, I've kept the obj modification, but it excludes the query and the preprocessed keys, which are the only 2
keys where we see :viz-settings. This doesn't eliminate the problem of needing to exclude other keys in the future,
but it does improve the surface area - the query and viz settings are the most likely candidates for holding
potentially sensitive info.

I'd prefer to stick with this solution, as we can get a fix for the security concern in quicker, and perhaps a
non-security bug can be opened regarding the most correct way to indicate errors to users whose downloads have failed.

* keep format-exception the same

* cleaner passing of export-format to write-error!
2024-09-05 11:57:53 -07:00
Alexander Polyankin
6c87abd0fa Revert multiple inheritance with SnowflakeVariant (#47680) 2024-09-05 14:21:29 -04:00
metamben
05e02e511d Support field remapping in pivot queries (#47592)
* Support field remapping in pivot queries

* Generate breakouts without inversions
2024-09-05 20:55:48 +03:00
Oleksandr Yakushev
8eb25e5b14 perf: Miscellaneous card rendering improvements (#47679)
* perf: Optimize reading rows into vectors in JDBC driver

* perf: Use direct interop when computing with-time-zone-same-instant
2024-09-05 20:25:48 +03:00
Phoomparin Mano
d74fbe95ed fix(sdk): fix typescript type references to embedding-sdk not resolving (#47659)
* replace plain embedding-sdk imports

* fix direct module imports
2024-09-05 23:48:47 +07:00
Cam Saul
db9ca5ec1e Use :description instead of :doc/message for Malli docstrings (#47643) 2024-09-05 07:31:28 -07:00
Cam Saul
3febfbf4c1 Fix LSP for defendpoint (#47641) 2024-09-05 07:31:13 -07:00
Oleksandr Yakushev
bf67dbf911 [insights] Simplify args to simple-linear-regresion (#47665) 2024-09-05 14:28:08 +00:00
Jeff Bruemmer
2af9fff059 docs - embedding params edits (#47635) 2024-09-05 09:52:56 -04:00
Nicolò Pretto
f7a7fe7ee5 newsletter-toggle-clicked event (#47410)
* newsletter-toggle-clicked event

* use ValidateEvent,

* rename event -> simple_event and trackEvent -> trackSimpleEvent

* use the renamed trackSimpleEvent function
2024-09-05 15:06:16 +02:00
Chris Truter
efba19516b Fix query type and respect user parameters in search (#47631) 2024-09-05 13:05:49 +00:00
Ngoc Khuat
73ac543318 Dashboard subscriptions and alerts should exclude archived cards (#47650) 2024-09-05 12:55:29 +00:00
Dennis Schridde
7ff0ab3dff Revert "Hide upload config when data warehouse is attached" (#47611)
The way this was implemented, it also hid the section for management
of uploaded CSV files.  Further, admins might want to intentionally
switch from uploading to the data warehouse provided by Metabase to
one of their own.

This reverts commit fbaf58ad03.

References: https://github.com/metabase/harbormaster/issues/5121
References: https://metaboat.slack.com/archives/C032LFJFANL/p1725296255637989
2024-09-05 14:45:08 +02:00
Alexander Solovyov
5e3fd29ff4 [serdes] improve dir detection (#47653) 2024-09-05 14:58:35 +03:00
Oleksandr Yakushev
28a737bc23 perf: Add more timeseries insights optimizations (#47651)
* perf: [insights] Optimize last-2 allocations

* perf: [insights] Optimize best-fit allocations when creating validation sample

* perf: [insights] Optimize simple-linear-regression
2024-09-05 09:50:33 +00:00
Tim Macdonald
458669de81 Use i18n-appropriate string interpolation for card copying (#47652)
Come to find out languages like Turkish put the `X` first in "Copy of
`X`"
2024-09-05 08:32:29 +00:00
Cam Saul
7c25508a76 API endpoint dox generation should resolve schemas from the registry (#47634)
* API endpoint dox generation should resolve schemas from the registry #46799

* Update Kondo config

* Fix formatting
2024-09-05 09:36:01 +02:00
Romeo Van Snick
4732fbe3f4 Rename 'Date Filter' to 'All Options' in field filters (#47553)
* Rename 'Date Filter' to 'All Options' in field filters

* Fix i18n test
2024-09-05 09:26:06 +02:00
Aleksandr Lesnenko
798c81a7f4 fix hidden pivot table scroll bar in QB (#47629)
* fix hidden pivot table scroll bar in QB

* Update Loki Snapshots

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-09-04 21:52:52 -04:00
appleby
03aff86409 Store ::nil markers in CachedMetadataProvider for failed lookups (#47589)
* Fix typo in MetadataProvider docstring

* Fix typo in caching-test: s/Second/Third/

* Store ::nil markers in CachedMetadataProvider for failed lookups

Store ::nil markers in CachedMetadataProvider for any ids for which the wrapped/uncached upstream provider fails to return
metadatas. This prevents repeatedly querying the uncached-provider for ids that don't exist.

The downside is that if the uncached-provider suddenly starts returning metadata for an id that previously did not
exist, we won't pick up on it, but the assumption here is that this is no different / worse than cache invalidation
for existing ids that happen to change after we cache them.

* PR suggestion: remove unnecessary test assertion
2024-09-04 19:20:26 -06:00
Cam Saul
495106ffef Bump Kondo version to 2024.08.29 (#47418)
* Bump Kondo version to 2024.08.29

* Fix Kondo warnings from new version of Kondo

* Fix failing tests because schema was broken
2024-09-05 00:22:42 +00:00
Alex Yarosh
69d61c2c25 docs: clarify cumulative aggregations (#47545)
* cumulative aggregations

* Apply suggestions from code review

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

* cumulative articles

* consolidate cumsum and cumcount articlesa

* links

* remove previews

* sort clarification

* Apply suggestions from code review

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

* link

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-09-04 19:56:57 -04:00
bryan
6305e59edc Entity id translation analytics (#47432)
* tracking entity id translation

* add total and more tests

* indentation

* realign the last test
2024-09-04 22:48:19 +00:00
Case Nelson
b46a6592e7 fix: sqlserver handle uniqueidentifier uuids (#47544)
* fix: sqlserver handle uniqueidentifier uuids

Fixes #46148

Include sqlserver in `uuid-type` handling as its `uniqueidentifier` type
stores uuids.

* Don't be so precise with varchar size

* Add seam for drivers to cast to text type

* Fix arg order
2024-09-04 16:31:26 -06:00
Emmad Usmani
d74acdaa0e remove static viz import from pie chart option (#47159) 2024-09-04 18:49:23 +00:00
Nicolò Pretto
9f706d5433 rename event -> simple_event and trackEvent -> trackSimpleEvent (#47608)
* rename event -> simple_event and trackEvent -> trackSimpleEvent

* add empty line at the end of the file

Co-authored-by: Thomas Schmidt <thomas@metabase.com>

---------

Co-authored-by: Thomas Schmidt <thomas@metabase.com>
2024-09-04 19:16:02 +02:00
Uladzimir Havenchyk
7287a346ff clean output folder to avoid bloating (#47609) 2024-09-04 19:23:11 +03:00
Alexander Polyankin
f0c6f55951 Fix :selected? property of visible-columns (CLJS only) (#47618)
* Fix visible-columns :selected? flag

* Add comment

* Add comment

* Add comment

* Add comment

* Update src/metabase/lib/js.cljs

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

---------

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2024-09-04 16:15:52 +00:00
Ryan Laurie
a25f953dc3 Pass string auto param to ee-extra (#47623) 2024-09-04 10:11:36 -06:00
Nick Fitzpatrick
e62bf9b493 Notifications Followup (#47453) 2024-09-04 09:51:28 -06:00
Aleksandr Lesnenko
c86e4b3fa3 fix time series with gaps stacked bar charts crash when enabling all labels (#47599) 2024-09-04 10:23:24 -04:00
Mahatthana (Kelvin) Nomsawadi
063023140b Update default locked parameter value (#47607)
* Add E2E tests

* Default locked parameter value to `[]`

* Fix unit tests
2024-09-04 14:35:19 +01:00
Alexander Solovyov
240f93c3fa add more stuff to migrations doc (#47605) 2024-09-04 14:06:16 +03:00
Uladzimir Havenchyk
71f208f11a upgrade webpack to address security issue (#47585) 2024-09-04 11:41:11 +03:00
github-automation-metabase
94a909059f Add v0.50.24 to the list of releases (#47591)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-09-03 19:27:03 -04:00
Alex Yarosh
0435633e70 pro callout (#47593) 2024-09-03 17:51:40 -04:00
Oisin Coveney
e99815024b fix(sdk): Add onSave behavior to QuestionEditor (#47538) 2024-09-03 14:39:47 -07:00
Oisin Coveney
f186deb2d1 Remove phantom tooltips when there is no label on tooltip (#47539) 2024-09-03 14:39:29 -07:00
Uladzimir Havenchyk
4dda4801c9 upgrade micromatch to address security issue (#47571) 2024-09-03 21:57:02 +03:00
Noah Moss
ff08864b07 Don't update updated_at when setting last_used_at on a card (#47574) 2024-09-03 18:18:31 +00:00
Alexander Polyankin
88fc1aa8f4 [FE] Allow multiple breakouts for a column (#46776) 2024-09-03 18:02:10 +00:00
Jeff Bruemmer
dd19282fe7 Update partner-and-community-drivers.md (#47577) 2024-09-03 13:29:49 -04:00
github-automation-metabase
7fee2ecfde Add v0.49.25 to the list of releases (#47572)
* Add v0.49.25 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-09-03 16:53:35 +00:00
Braden Shepherdson
9053d6fe2b [MBQL lib] Allow temporal bucketing of Date(Time) expressions (#47427)
Fixes #47341.

### Description

The QP now supports temporal bucketing of custom expressions, but that has
not been surfaced in the UI until now.

### How to verify

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

1. Use a database other than H2, since it doesn't support time zones.
1. New question -> Anything with a DateTime column
1. Create a custom expression like `convertTimezone([Date Column], "America/New_York", "UTC")`
1. Break out by that expression

The temporal bucketing should work in the UI and in the query results, save properly, etc.
2024-09-03 15:27:55 +00:00
Anton Kulyk
57fe9712b3 Toggle series visibility from chart legend (cartesian charts) (#47089)
* Move current click handler to legend title

* Add `onToggleSeriesVisibility` prop to `Legend`

* Update `LegendItemDot` component

* Update `LegendItemTitle`

* Toggle series visibility

* Fix hover effect

* Don't let to hide the last visible series

* Add `visible` property to `BaseSeriesModel`

* Fix dangling split axis label when hiding a series

* Update `graph.series_order` viz setting widget

* Fix can't toggle series visibility from legend popover

* Fix legend dot clipped by `overflow: hidden`

* Fix eslint error

* Fix legend popover scroll

* Add unit tests

* Add e2e tests

* Fix show/hide series for scatter charts

* Default `LegendItemDot` to visible state

* Only apply legend dot hover effect if there's a click handler

* Don't allow to remove the last series in `ChartSettingSeriesOrder`

* Fix tooltip performance drop

* Fix e2e tests around `series_order` viz setting widget

* Use `text-medium` for outer circle background

* Update dot style

* tweak inner circle color

* Update copy

* Use div instead of button if can't toggle visibility

* Fix legend layout issue

* Don't show trendlines for hidden series

* Fix missing prop value

* Disable visibility toggle outside of dashboard/qb view

* Add public dashboard test

* Add tooltip footer e2e helpers

* Fix chart tooltip shows hidden series data

---------

Co-authored-by: Kyle Doherty <5248953+kdoh@users.noreply.github.com>
2024-09-03 16:01:10 +01:00
Dennis Schridde
57b91425d5 Fix migration ID of metabase_database.is_attached_dwh for backport (#47517)
This migration is supposed to be backported to v50 and thus needs a v50
migration ID.  Since v51.2024-08-27T00:00:00 was already applied to dev
instances, we set `preConditions[].onFail = "MARK_RAN"`, so that if the
table is already present, the backdated migration does not fail.  See
the discussion on PR #47419 for more details.

This will not need an (automatic) backport, since I will include it in
PR #47419.

Fixes: 592360c9fa
References: https://github.com/metabase/metabase/pull/47419#discussion_r1738929516
2024-09-03 15:21:14 +02:00
Ryan Laurie
7592b715b3 Refine 'last' version logic (#47512)
* refine 'last' version logic

* better comment placement
2024-09-03 07:09:03 -06:00
Alexander Solovyov
a359852b4b [serdes] reveal exception causes (#47551)
I still don't want users' eyes to bleed looking at (unnecessary?) stacktraces, but we need to be able to see exception
causes to determine what is going wrong

references #47520
2024-09-03 11:23:00 +00:00
Cal Herries
0af1d7494b Use app DB for query execution metrics (#46586) 2024-09-03 10:14:52 +03:00
metamben
8ba9687dac Implement a simple greedy approximation for dedupe-joins (#47529)
* Implement a simple greedy approximation for dedupe-joins
2024-09-02 22:34:09 +00:00
Oisin Coveney
0693980e9a Remove drilled props from ViewFooter components (#47213) 2024-09-02 11:51:20 -07:00
Oisin Coveney
c2b7cc9e80 feat(sdk): Use stable IDs in SDK components (#47210)
Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
Co-authored-by: Nicolò Pretto <info@npretto.com>
2024-09-02 11:10:03 -07:00
Oisin Coveney
0711fba1b0 fix(sdk): Add toggle for saving questions (#47442) 2024-09-02 17:59:06 +00:00
appleby
d7ddb63b49 Disallow duplicate order-by clauses in ::lib.schema.order-by/order-bys (#47489)
* Move query-processor.util/remove-lib-uuids to lib.schema.util

This function will soon be needed in lib.schema.util in order to implement distinct order-by clause schema checking.

This function feels like it should live in lib.util instead of lib.schema.util, but that would create the following
circular import dependency since lib.util indirectly requires stuff from lib.schema.util:

  lib.schema.util -> lib.util -> lib.schema.util

* Don't create queries with duplicate order-bys in remove_replace_test.cljc

Otherwise, theses tests would fail soon when we add update the order-by schema to reject duplicates.

* Declare lib.order-by/order-bys to return ::lib.schema.order-by/order-bys

Previously it inlined the schema instead.

* Disallow duplicate order-by clauses in ::lib.schema.order-by/order-bys

Fixes: 39384
2024-09-02 09:45:02 -06:00
Noah Moss
0aac6b9e93 Use consistent approach for disabling permission checks in QP to fix sandboxing error in downloads (#47481) 2024-09-02 14:54:22 +00:00
Noah Moss
1560728f0a Use table name in inactive table error if user has access to it (#47484) 2024-09-02 09:14:39 -04:00
Anton Kulyk
25c2269023 Followup on "Fix crash when navigating between bookmarked dashboards" (#47400)
* Add repro test for #47170

* Use type guard when checking for cancelled request

* Export `isObject` type guard

* Avoid type casting

* Update e2e test
2024-09-02 11:32:31 +00:00
github-automation-metabase
5b25578e8a Update Readme version references and published npm version to 0.1.34 (#47508) 2024-09-02 11:03:11 +00:00
Chris Truter
cbaaa08a0f Use original display name for fields in uploaded tables (#47303) 2024-09-02 10:53:42 +00:00
Chris Truter
ed9bddf0c8 Use function arguments rather than a dynamic var (#47469) 2024-09-02 11:57:18 +02:00
Phoomparin Mano
d29aa557ea feat(sdk): improve license, mock server and post-install for embedding cli (#47229)
* ask for tenancy isolation columns

* deny all permissions for all users group

* create new collections

* add jwt group mappings

* add the permissions step

* add multi-tenancy message in helper text format

* add permission graph

* wire together permissions

* use schema permissions

* use fields from table metadata from query_metadata

* add tenancy field reference

* remove log messages

* deny access to unsandboxed tables

* make permission graph more explicit

* deny access to sample database for customer groups

* add unit test for permission graph

* split permission groups and sandboxes

* jwt settings and hard-coded user attributes

* handle errors when updating sso mappings

* add express api and user switcher

* only fallback to api keys when license is invalid

* add util to sample tenancy column values

* conditional BASE_SSO_API imports

* improve embedding error message

* setup jwt configuration after license step

* setup permissions at the last step

* add missing import

* update steps that requires license

* fix incorrect imports

* add missing useContext

* handle permission update error

* remove tenancyIsolationEnabled field

* add tenancy column sampling

* differentiate tenancy column query error

* rename tenancyColumnValues to tenantIds

* assign sampled tenant ids to user attributes

* add tenant ids

* define collection permissions

* reference sandboxing group by name

* update snippet to be same as the README

* extract ask for tenancy columns to a separate step

* use the customer_id attribute

* query the table query metadata at origin

* append tables correctly

* improve error handling in table scanning

* add retry logic to metadata fetching

* only query metadata for selected fields

* fix race condition with retry

* update loading state and retries

* update comments on jwt license

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

* filter the target table by id

* highlight last selected tenant column

* use breakout to get list of ids

* temporary workaround to reload the whole page

* update row value types

* update row value types

* ask if they want to setup a pro license

* post-installation improvements for cli

* block non-selected tables

* remove the source-field from sandboxing

* use the fk_target_field_id as instead of target.id

* update unit test

* add learn more message

* install mock server dependencies

* fix post-setup step formatting

* fix text wrapping

* skip tenancy columns and permissions if token is not provided

* only show the server dir step when license is enabled

* skip permission setup if there is no tenancy column

* remove source-field as we only reference our own column

* add runIf flag to skip steps

* remove the gitignore mention as this is automatic

* configure permission if there are some tenancy columns

* make native permission types more strict

* add notice about setting up local mb instance

* support multiple tenancy columns

* map the tenancy column name as the user attribute

* add component import guide

* fix deprecated punycode in node-fetch

* warn on unsampled tables

* show helper text on tenancy columns

* allow sampling repeated tenant

* add instruction to change directory into mock server

* align the learn more message

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2024-09-02 16:44:37 +07:00
Chris Truter
12e9f8161a Indicate which column is used in reference validator sort test (#47441) 2024-09-02 09:02:03 +00:00
Alexander Solovyov
85dea40f61 [serdes] fix grammar mistakes in the doc (#47499) 2024-09-02 11:59:53 +03:00
Tim Macdonald
3286bdce35 Upgrade Macaw to 0.2.10 (#47498)
Includes https://github.com/metabase/macaw/pull/97, which will prevent
some false positives
2024-09-02 08:49:51 +00:00
Alexander Solovyov
9d20e3c2cd [serdes] a bit more valuable ns docstring (#47445)
fixes #46039
2024-09-02 11:09:23 +03:00
Oleksandr Yakushev
19a3e637e7 perf: Optimize insights and fingerprinting of time series (#47414)
* perf: Use optimized stats functions for computing insights

* perf: Rewrite fingerprinters/with-error-handling to not generate closures

* fix: Don't reuse global-fingerprinter object
2024-08-31 12:56:36 +03:00
adam-james
6e1f3851a3 Bugfix part2 snowflake variants in attachments 46981 (#47488)
* Snowflake Variant cols should also work in attachments

A previous PR fixed the snowflake variant bug by using a try/catch aroung the global-type-settings function.
I realized there was a second codepath using the same function and it gets used in xlsx attachment code, so I've made
the change there as well to prevent the same error in attachments.

* add a test to confirm the viz-settings-for-col function doesn't throw
2024-08-31 05:57:29 +00:00
Uladzimir Havenchyk
1b2dcb7195 ci: put failing tests into e2e job summary (#47134)
* ci: put failing tests into e2e job summary

* cleanup
2024-08-30 22:28:43 +00:00
Uladzimir Havenchyk
0e514b4549 fix prepare-containers action (#47480) 2024-08-31 00:52:48 +03:00
Noah Moss
128039b1dc Disallow connection impersonation roles which are not single strings (#47474) 2024-08-30 19:16:33 +00:00
John Swanson
096b496849 Query ref validation: fix non-deterministic sort (#47449)
... and the associated flaky test!
2024-08-30 12:08:11 -07:00
Ryan Laurie
30b08dd108 Remove MetabaseSettings.docsUrl() (#47433)
* add useDocsUrl hook and update lint rule

* remove all uses of MetabaseSettings.docsUrl

* update tests

* revert non-docsurl change
2024-08-30 12:42:22 -06:00
Noah Moss
088f6d4ea5 Allow group deletion via SCIM (#47416) 2024-08-30 14:00:35 -04:00
Raphael Krut-Landau
b8cfe19736 fix(admin/performance): Don't show tooltip on default policy (#47319) 2024-08-30 13:55:48 -04:00
Jeff Bruemmer
f9354a384d docs - update API docs (#47471) 2024-08-30 17:25:34 +00:00
adam-james
0677d95bdc Snowflake Variant Type should not prevent downloads or attachments (#47434)
* Snowflake Variant Type should not prevent downloads or attachments

Fixes #46981

The :type/SnowflakeVariant key matches 2 methods in `metabase.query-processor.streaming.common/global-type-settings`.

In this case, it seems that the variant type can be any type, so we shouldn't try to guess anything here, except if
the user has provided a :semantic_type, which we can use.

Otherwise, we'll keep going without formatting details about the variant column, which is likely fine already, as it
should result in strings in the export/attachments.

* add a test
2024-08-30 09:12:42 -07:00
Case Nelson
f06643c286 fix: bigquery handle local date params as date (#47423)
Fixes #30602

We were overriding localdate in bigquery driver to produce
offsetdatetimes for no apparent reason. This causes a number of problems
when dealing with date type columns.
2024-08-30 10:09:30 -06:00
Case Nelson
0931ccec8c Bigquery verify bignumeric fingerprint and bin (#47381)
* Bigquery verify bignumeric fingerprint and bin

Fixes #28573

Field values must be scanned.

In 45.3, these fields were not being fingerprinted properly. (tag `v1.45.3`)
In a 45 point release that appears to have been fixed. (branch `release-x.45.x`)
Confirmed fixed in master, adding test

* cljfmt
2024-08-30 10:08:48 -06:00
github-automation-metabase
6bd7859201 Update Readme version references and published npm version to 0.1.33 (#47466) 2024-08-30 15:58:12 +00:00
Braden Shepherdson
bef93ce0b4 [QP, debug] Fix preprocessing diffs in Portal (#47154)
The Portal diff view wants `[before after]` pairs of the original data,
not the three-part output of `clojure.data/diff`. This fixes the
`qp.debug/debug>` output from the preprocessing middleware to emit
correct diffs.

Also, since the diffs are not useful when the query is converted between
legacy and pMBQL, this also attaches the *converted* input query to the
output query's Clojure metadata, and this converted value is used as the
basis for the diff.
2024-08-30 14:51:23 +00:00
Aleksandr Lesnenko
730a2657b4 fix trend lines scaling (#47361)
* fix trend lines scaling
2024-08-30 14:50:45 +00:00
Chris Truter
d3aba662ce Trigger BE tests when test_resources are updated (#47455) 2024-08-30 17:39:31 +03:00
metamben
0ef7e4bcfd Check joins in lib.metadata/editable? (#47421) 2024-08-30 17:01:52 +03:00
Chris Truter
550f9c36d7 Add serialization baseline for Channel (#47451) 2024-08-30 20:32:23 +07:00
Chris Truter
cf5c932f21 Update serialization fixtures to track new database field (#47446) 2024-08-30 13:21:08 +03:00
Oisin Coveney
976de66801 Remove ButtonBar (#47212) 2024-08-30 13:12:09 +03:00
Tim Macdonald
7d34ca123b Use published version of Hawk (#47440) 2024-08-30 09:31:04 +00:00
Chris Truter
312a46bd43 Add test against serialization YAML format changing (#47349) 2024-08-30 11:57:14 +03:00
Oleksandr Yakushev
1e78f8bd2d perf: Perform string->datetime conversion once during timeseries insights (#47424) 2024-08-30 10:09:22 +03:00
Ngoc Khuat
d897f2016f [notification] webhook for alert (#45201)
* [notification] New method: `channel/can-connect?` (#44955)

* [notification] Channel APIs (#45207)

* [notification] namespaced channel type (#45527)

* [Notification] Render alert for http channel (#45545)

* [notification] Add channel description (#45840)

* [notification] update API to enable http channels for alert (#45839)

* [Notification] Remove channel details for users without write perms (#46034)

* [Notification] Serdes channel (#46031)

* [Notification] Update http details schema (#45960)

* [Notification] Deactivate channels will delete PulseChannel (#46115)

* [Notification] audit log for channel create and update (#46113)

* [Notification] Disallow undefined key for http channel details (#46712)

* [Notification] Handle channel name conflicts (#46818)

* Webhooks Admin Section (#46194)

* [notification] Fix test pulse endpoint does not work properly for http channels (#46474) (#47050)

* [Notification] Fix unable to update multiple channels per type (#47111)

* [Notification] Record Task History when pulse sends channel message (#46218)

* Enabling Webhook Alerts (#47022)

* [Notification] fix cyclic deps (#47379)

* [notification] channel serdes spec (#47386)

Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2024-08-30 04:54:01 +00:00
Aleksandr Lesnenko
0ccc471c7b fix formatting null values adds prefix and suffix (#47435) 2024-08-29 23:21:35 -04:00
bryan
05c2fb221d Realign migration ids (#47367)
* move migration in release to match master

* add column if not exists
2024-08-29 22:46:06 +00:00
bryan
b0dbb38e74 Static embed dashboard and question endpoints (#47270)
* entity id translation + tests

* add api level test

* simplify definition of eid-table->model + add test

* update tests to take keywords

* improve comment

* generate the eid-table->model map

* delete now-obsolete test

* make it work in oss

* put the resulting response into a key, so we can add more information later

* formatting

* use model names without the model/ prefix as keys

* Creates list of `api/model->db-model`

- update keys for util/entity_id request
- update shape of util/entity_id response
- add test for not-found eids

* formatting

* Respond to code review feedback

* entity-ids work on /embed/{card,dashboard}* routes

* make entity id translation work for all tokens

* Merge branch 'static-embed-dashboard-and-question-endpoints' of github.com:metabase/metabase into static-embed-dashboard-and-question-endpoints

* massage schema. add tons of tests

* decode more eids

* test alignment

* don't require ns inside of itself :think:

* make the test functions to create tokens better

* bring back `dashboard-url`

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>
2024-08-29 16:09:11 -06:00
github-automation-metabase
b644dcca22 Add v0.50.23 to the list of releases (#47422)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-08-29 17:15:21 -04:00
Nick Fitzpatrick
b7349ec5f6 Query validator FE (#47098)
* Query Validator FE

* collection path, unit tests

* wrapping feature with token flag

* updating util function, adding row type

* updating session_test.clj

* type adjustment

* fixing other table sorting

* Empty state, clean up utils

* unit test adjustment

* e2e adjustment
2024-08-29 16:20:54 -03:00
Ryan Laurie
2b25fcab13 Milestone Check Perms Fix (for real this time) 😅 (#47401)
* another attempt at perms fix

* try again

* try manual graphql auth

* try with global env

* Try setting defaults in graphql

* try some more things

* use my own graphql instance

* one more test

* remove test code

* remove rogue curly brace
2024-08-29 13:08:26 -06:00
Dennis Schridde
592360c9fa Hide attached DWH database details (#47247)
== 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

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

The Metabase backend already contains provisions in the implementation
of `metabase.models.interface/to-json` for `:model/Database` to hide the
`details` of the database in HTTP responses, if the user lacks write
permission on the database.  We utilize this by adding an
`is_attached_dwh` column to the `database` table and rejecting
`metabase.models.interface/can-write?` when this flag is enabled.  In
the "admin" UI, we show a replacement text instead of the edit form when
the flag is set.  (It might be correct to show this whenever `details`
is absent.  See below for possible follow-up work.)

However, several sections of the frontend code expected the `details`
field to always be present.  In order to make `details` optional, as the
backend seems to handle it, we fix the respective code to treat this
case in the way that appears appropriate in the context.

Database details are already generally excluded from H2 dump snapshots
(see `metabase.cmd.copy/*copy-h2-database-details*`), thus nothing
changes there.

== How to test ==

=== New behaviour ===

Setting the `is_attached_dwh` field hides the database details:

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. Verify the database shows up in the "admin" section
   (`/admin/databases`).
4. Verify that clicking the database to see its details only reveals
   "This database cannot be modified."
5. Verify that responses from the backend do not include a `details`
   field for this database.

=== 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. Verify the database shows up in the "admin" section
   (`/admin/databases`).
4. Verify that clicking the database to see its details only reveal the
   regular edit form, showing connection fields like `host`, `user`,
   etc. with the values you configured.

== How this will be rolled out ==

1. Upgrade existing Metabase Cloud instances with data warehouse to a
   Metabase version that supports `is_attached_dwh`.
2. Set `is_attached_dwh` in the database section of the config file for
   Metabase Cloud instances with a data warehouse.

== Possible follow-up work ==

In https://github.com/metabase/metabase/issues/25715, absent
`database.details` was identified as a bug.  Since then, `details` was
made `NOT NULL` in the application database, so this bug can no longer
occur.  However, today backend responses can be missing the `details`
field, if the current user lacks write permission to the database
setting (see above).  Fully re-evaluating the fix to #25715 in this
context is outside the scope of this PR.

Closes: https://github.com/metabase/harbormaster/issues/5051
2024-08-29 19:36:53 +02:00
Cam Saul
7fb88340d4 Update Kondo to 2024.08.01 and add deps.edn aliases to run from the JVM (#47370)
* Add `clojure -M:kondo` and `clojure -M:kondo:kondo/all` and bump version

* Fix Kondo errors

* Fix Kondo+LSP issues with `defendpoint`, `defenterprise`, etc.

* Use replace-deps instead of deps for speed

* Ok apparently maybe we do need to copy configs when we run Kondo on CI

* Oops `./bin/kondo.sh` should not try to use `clj-kondo`

* Remove references to GA driver folders
2024-08-29 10:24:33 -07:00
Noah Moss
f148925047 Migrate Tooltip in FormField to mantine to fix z-index issue (#47314) 2024-08-29 16:57:26 +00:00
Luiz Arakaki
bbe366ea94 Update instance_analytics for 50 major release (#47323)
This updates the instance analytics YAMLs:
- v50.22
- fixes several fk-target-field-id references
2024-08-29 16:51:06 +00:00
John Swanson
b0d9bc53c4 Fixup backported migrations (#47398)
These migrations will be backported to v49.

Three changes:

- update IDs/locations of the migrations to v49 vs v51

- add one preCondition (when adding the foreign key constraint)

- add `onFail: MARK_RAN` to the index preconditions. I forgot this
before, so it blows up when the precondition doesn't hold.
2024-08-29 09:05:58 -07:00
Ryan Laurie
268268b08d Flake Jail Update (#47407) 2024-08-29 15:58:08 +00:00
Emmad Usmani
0139fd780d allow re-ordering and re-naming pie chart slices (#46607)
* allow re-ordering and re-naming pie chart slices

* aggregate rows with same dimension value

* show warning when dimension has unaggregated values

* change colors from sidebar

* implement renaming

* styles for slice name widget

* handle numeric slice keys for binned values relative dates etc

* implement slice disabling

* remove old colors setting

* implement merging new and removing existing rows from query results

* fix formatting bugs

* port settings to static viz

* fix bug with unaggregated data

* address todos

* add loki test

* fix measure column settings widget erroring

* fix settings sidebar crashing

* add e2e tests

* update snapshots

* fix pie_chart.cy.spec.js CI-only flakes

* fix #21504 repro failure

* fix click action value

* use nestedSettings instead of seriesSettings

* fix settings sidebar crashing

* fix row with 0 key not being draggable

* fix flaky test

* filter other slices from sidebar
2024-08-29 15:57:36 +00:00
Ryan Laurie
badd7d0803 Combine filter header buttons (#46984)
* combine filter header buttons

* refined styling

* unit tests

* another import conflict

* omg another one

* remove double border for filter button

* use vars and update imports
2024-08-29 09:45:22 -06:00
Thomas Schmidt
5edd793d5b Minor schema fixes before pushing to Snowcat Cloud (#47403) 2024-08-29 17:38:10 +02:00
Thomas Schmidt
6becc1a78f Add new generic analytics event and bring types to trackSchemaEvent (#46972) 2024-08-29 15:35:53 +00:00
dpsutton
3f8317ad5b Increase log level to INFO from error (#47397)
* Increase log level to INFO from error

Closes #47396

logs before:
```
2024-08-29 08:37:03,836 INFO db.liquibase :: Checking if Database has unrun migrations...
2024-08-29 08:37:04,045 INFO db.liquibase :: Database has unrun migrations. Checking if migration lock is taken...
2024-08-29 08:37:04,047 INFO db.liquibase :: No migration lock found.
2024-08-29 08:37:04,047 INFO db.liquibase :: Migration lock acquired.
2024-08-29 08:37:04,167 INFO db.liquibase :: Running 83 migrations ...
```

logs after:

```
2024-08-29 08:39:45,019 INFO db.liquibase :: Running 83 migrations ...
...
2024-08-29 08:39:45,166 INFO liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v49.2024-06-27T00:00:00::calherries ran successfully in 0ms
2024-08-29 08:39:45,182 INFO liquibase.changelog :: Columns is_defective_duplicate(boolean) added to metabase_field
2024-08-29 08:39:45,182 INFO liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v49.2024-06-27T00:00:01::calherries ran successfully in 14ms
2024-08-29 08:39:45,199 INFO liquibase.changelog :: Custom SQL executed
2024-08-29 08:39:45,200 INFO liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v49.2024-06-27T00:00:02::calherries ran successfully in 16ms
2024-08-29 08:39:45,202 INFO liquibase.changelog :: Foreign key fk_field_parent_ref_field_id dropped
2024-08-29 08:39:45,202 INFO liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v49.2024-06-27T00:00:03::calherries ran successfully in 1ms
2024-08-29 08:39:45,204 INFO liquibase.changelog :: Foreign key constraint added to metabase_field (parent_id)
2024-08-29 08:39:45,205 INFO liquibase.changelog :: ChangeSet migrations/001_update_migrations.yaml::v49.2024-06-27T00:00:04::calherries ran successfully in 2ms
...
```

* empty commit to bump CI
2024-08-29 11:20:19 -04:00
Ngoc Khuat
9adbbb9a57 Fix failed to backfill cache config due to number overflow (#47390)
* handle cache config overflowed

* fix root too

* do not comment out test

* make cljfmt happy

---------

Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2024-08-29 11:09:25 -04:00
Noah Moss
37162aa2fa Exclude inactive tables from the perms cache, and block queries over inactive tables in the QP (#47363) 2024-08-29 10:48:48 -04:00
metamben
f2ef2de94b Make metric metadata keep the metric's name (#47313)
* Make metric metadata keep the metric's name

This is a fix for the problem reported in #40355, which is fixed separately for v50 and backported to v49.

* Patch broken test

* Normalize dataset-query

* Normalize legacy queries only
2024-08-29 17:25:43 +03:00
Ryan Laurie
9fdc1f9f01 Add Malay Language Support (#47138) 2024-08-29 14:17:28 +00:00
Ryan Laurie
a8599337a4 Update milestone check workflow (#47377) 2024-08-29 07:39:19 -06:00
Nicolò Pretto
76b0a3f513 locale query string support on public links and static embeds (#47186)
* keep locale in url query params

* e2e tests

* ugly fix for the missing baseUrl error

* applies suggestion from Kelvin to make code more demure

* Update e2e/test/scenarios/sharing/public-question.cy.spec.js

Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>

* remove it.skip added by mistake

* sort imports

* handle native question/ SyncedParametersList too

* shorter and more accurate comment 😅

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

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

---------

Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-08-29 15:14:41 +02:00
Alexander Solovyov
66df724997 update slack-web-api in release helper (#47385) 2024-08-29 13:20:01 +03:00
Alexander Solovyov
036513db84 update aws-java-sdk-core: brings in new jackson with fixed vulnerability (#47384) 2024-08-29 13:05:19 +03:00
Ngoc Khuat
5d4d797d44 Fix formatting on master (#47382) 2024-08-29 07:15:11 +00:00
Ngoc Khuat
1ccdce4c90 Record field usage (again) (#46704) 2024-08-29 04:20:52 +00:00
metamben
b6602d562c Support multiple bucketings of a column in nested queries (#47362)
* Support multiple bucketings of a column in nested queries

Fixes #46644

* Fix e2e test
2024-08-29 01:41:07 +03:00
Chris Truter
f49407fcbd Fix CSV uploads for non-ASCII headers (#47297) 2024-08-28 21:59:58 +00:00
Nick Fitzpatrick
0352066fe3 Adding schema name to recents, search results in CP (#47255)
* Adding schema name to recents, search results in CP

* adding unit test

* fixup tests + clarify recent item schema

---------

Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
2024-08-28 15:17:41 -03:00
Nick Fitzpatrick
5626216aea Support ctrl + click on command palette links again (#47328)
* remove prevent default on CP links

* unit flakes?
2024-08-28 15:17:24 -03:00
Noah Moss
f5eecf02e7 Populate permission cache only for one DB at a time (#47332) 2024-08-28 14:16:50 -04:00
Phoomparin Mano
41b7f329aa feat(sdk): generate sample Express.js api and user switcher components via cli (#47060)
* ask for tenancy isolation columns

* deny all permissions for all users group

* create new collections

* add jwt group mappings

* add the permissions step

* add multi-tenancy message in helper text format

* add permission graph

* wire together permissions

* use schema permissions

* use fields from table metadata from query_metadata

* add tenancy field reference

* remove log messages

* deny access to unsandboxed tables

* make permission graph more explicit

* deny access to sample database for customer groups

* add unit test for permission graph

* split permission groups and sandboxes

* jwt settings and hard-coded user attributes

* handle errors when updating sso mappings

* add express api and user switcher

* only fallback to api keys when license is invalid

* add util to sample tenancy column values

* conditional BASE_SSO_API imports

* improve embedding error message

* setup jwt configuration after license step

* setup permissions at the last step

* add missing import

* update steps that requires license

* fix incorrect imports

* add missing useContext

* handle permission update error

* remove tenancyIsolationEnabled field

* add tenancy column sampling

* differentiate tenancy column query error

* rename tenancyColumnValues to tenantIds

* assign sampled tenant ids to user attributes

* add tenant ids

* define collection permissions

* reference sandboxing group by name

* update snippet to be same as the README

* extract ask for tenancy columns to a separate step

* use the customer_id attribute

* query the table query metadata at origin

* append tables correctly

* improve error handling in table scanning

* add retry logic to metadata fetching

* only query metadata for selected fields

* fix race condition with retry

* update loading state and retries

* update comments on jwt license

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

* filter the target table by id

* highlight last selected tenant column

* use breakout to get list of ids

* temporary workaround to reload the whole page

* update row value types

* update row value types

* block non-selected tables

* remove the source-field from sandboxing

* use the fk_target_field_id as instead of target.id

* update unit test

* remove source-field as we only reference our own column

* make native permission types more strict

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Oisin Coveney <oisin@metabase.com>
2024-08-29 00:05:10 +07:00
Phoomparin Mano
c574c09dd7 feat(sdk): setup permissions and sandboxing for embedding cli (#46857)
* ask for tenancy isolation columns

* deny all permissions for all users group

* create new collections

* add jwt group mappings

* add the permissions step

* add multi-tenancy message in helper text format

* add permission graph

* wire together permissions

* use schema permissions

* use fields from table metadata from query_metadata

* add tenancy field reference

* remove log messages

* deny access to unsandboxed tables

* make permission graph more explicit

* deny access to sample database for customer groups

* add unit test for permission graph

* split permission groups and sandboxes

* jwt settings and hard-coded user attributes

* handle errors when updating sso mappings

* add util to sample tenancy column values

* improve embedding error message

* setup jwt configuration after license step

* setup permissions at the last step

* handle permission update error

* add tenancy column sampling

* differentiate tenancy column query error

* rename tenancyColumnValues to tenantIds

* define collection permissions

* reference sandboxing group by name

* extract ask for tenancy columns to a separate step

* query the table query metadata at origin

* append tables correctly

* improve error handling in table scanning

* add retry logic to metadata fetching

* only query metadata for selected fields

* fix race condition with retry

* update loading state and retries

* filter the target table by id

* highlight last selected tenant column

* use breakout to get list of ids

* update row value types

* block non-selected tables

* remove the source-field from sandboxing

* use the fk_target_field_id as instead of target.id

* update unit test

* remove source-field as we only reference our own column

* make native permission types more strict

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>
2024-08-28 23:13:58 +07:00
Ryan Laurie
68f3d1b782 Quieter Patch Releases (#47356) 2024-08-28 10:12:47 -06:00
Anton Kulyk
48749a2eff Fix crash when navigating between bookmarked dashboards (#47311) 2024-08-28 16:00:33 +00:00
Oisin Coveney
5ec1821711 Split and convert ViewFooter elements to TS (#47126) 2024-08-28 18:45:03 +03:00
lbrdnk
bd2d8479d9 Revert "Add :legacy/merge-indents? to .cljfmt.edn (#47345)" (#47357)
This reverts commit 3759c8d46a.
2024-08-28 15:32:41 +00:00
Raphael Krut-Landau
ca29573958 fix(admin/performance): Ensure that the strategy form is not considered dirty if the user changes an empty field to that field's default value, or vice versa (#46543) 2024-08-28 10:10:03 -04:00
lbrdnk
3759c8d46a Add :legacy/merge-indents? to .cljfmt.edn (#47345) 2024-08-28 15:54:31 +02:00
Braden Shepherdson
cb222495ce [QP] Return datetimes in SQL Server, even with date-sized truncation (#47248)
Previously, truncating a `:type/DateTime` column by `:month` or `:day`
would return a `:type/Date`, which subtly broke the query.

In particular, if you try to order-by the breakout column `Created At (month)`
then it would not get de-duplicated, causing a SQL error about conflicting
ORDER BY clauses.

Fixes #46992.
2024-08-28 09:18:09 -04:00
Uladzimir Havenchyk
d50d19021e replace webpack with Rspack for the main app (#46366) 2024-08-28 12:22:28 +03:00
Alexander Polyankin
1cf14d8c83 Add isDateOrDateTime and fix isTemporal and isDateWithoutTime usages (#47250) 2024-08-27 22:30:26 -04:00
Aleksandr Lesnenko
d4e284eb85 fix stacked row tooltip shows null values (#47333) 2024-08-28 01:59:53 +00:00
Jeff Bruemmer
533711e014 docs - clarify caching doc (#47330)
* clarify caching doc

* edit
2024-08-27 21:16:09 +00:00
John Swanson
8a7cc88512 Speed up calculation of effective_ancestors (#47324)
Previously, `visible-collection-ids` was effectively "free" in that we'd
cached `collection-id->collection` for *all* collections, within a
single request, and then locally filtered it for permissions without
needing to hit the database again.

To be honest, there is probably a better fix for this - we're repeatedly
calling `visible-collection-ids` when we probably could just save a
single copy of it and use it when calculating the effective location of
every collection.

However, this is a very quick and low-risk fix, and I want to prioritize
getting this done, and then we can improve it later.

Locally, I copied down the database from stats and timed the
`/api/search?model_ancestors=true` endpoint.

Before my "speedup" PR (https://github.com/metabase/metabase/pull/46942)
it took ~7 seconds to return results.

After my "speedup" PR, it took ~15s to return results. :grimace:

With this change, it takes 818ms to return results. 🎉
2024-08-27 20:56:40 +00:00
Alexander Polyankin
e144032025 Summarize step changes for metrics (#47200) 2024-08-27 19:25:49 +00:00
appleby
52284e622b Ensure that CI checks fail if cljs tests fail (#47192)
* Fix typo in expression-clause-normalization-test

s/time-interval/relative-time-interval/

* Add missing table-id to card def to fix failing legacy-ref-test

* Ensure that if yarn test-cljs fails it fails the CI checks

When configured to autorun, the command

   shadow-cljs compile test

will exit success even if test failures occur in the node test. See

   https://github.com/thheller/shadow-cljs/issues/425

In order to ensure our CI checks fail when cljs tests fail, we need to invoke
node directly. To prevent running the tests twice, remove `:autorun true` from
the `:test` target in shadow-cljs.edn.
2024-08-27 19:15:50 +00:00
Raphael Krut-Landau
5880661213 fix(questions + admin/performance): Improve Clear cache button text and question refresh button tooltip (#46791) 2024-08-27 14:16:43 -04:00
Jeff Bruemmer
7046722c5c docs - notes on public links (#47315) 2024-08-27 17:31:00 +00:00
appleby
458084407e zoom-in-timeseries-drill: do not include :hour and :minute for DATE columns (#46997)
* zoom-in-timeseries-drill: do not include :hour and :minute for DATE columns

When the user attempts to drill through a DATE column, we should not return :hour or :minute drill throughs from
available-drill-thrus. Previously we did, which resulted in an error being displayed when the user attempted to select
them.

Modify next-breakout-unit in zoom_in_timeseries.cljc to not return :hour or :minute units for :type/Date columns,
which prevents these from being returned by available-drill-thrus, which prevents them appearing in UI context menus.

* Use lib.temporal-bucket/available-temporal-buckets

Per review feedback, use lib.temporal-bucket/available-temporal-buckets to get the valid-current-units in
metabase.lib.drill-thru.zoom-in-timeseries.

* Do not construct zipmap just to lookup the next unit

Rather than constructing a zipmap from `valid-current-units', which requires iterating over the seq twice, just
traverse the seq once and return the next item in the seq (if any).

Constructing a zipmap made sense in the old code because it was constructed once from static data and used many times
for lookup. In the new version, the vec of `valid-current-units` is dynamic and dependent on the type of the breakout.

* PR suggestion: use threading macro rather than nested sexps

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

* PR suggestion: use threading macro rather than transducer / eduction

* PR suggestion: reduce boilerplate in zoom-in-timeseries tests

Reduce code dup by looping over aggregation and bucketing options rather than having a separate deftest for each.

---------

Co-authored-by: Braden Shepherdson <braden@metabase.com>
Fixes #39366
2024-08-27 17:27:47 +00:00
Nicolò Pretto
e441f1d58c poc of using loki to test png/pdf exports (#45650)
* use loki to test png exports on questions

* try to put the img in the body to see if it fixes the scrollbar issues in ci

* fix linting issues

* let's try again in ci

* Attempt to make CI wait before taking a snapshot for downloaded PNGs

* Use the snapshots from CI for PNG downloads

* pdf export test thanks to kelvin suggestion about just testing the png

* refactored the code to extract a util function

* remove pdf tests as they broke in ci 🤷

* Update frontend/src/metabase/env.ts

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

* Update frontend/src/metabase/lib/loki-utils.ts

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
2024-08-27 18:09:52 +02:00
John Swanson
f749c695a4 oops: enable relevant feature before a test (#40973) 2024-08-27 08:55:57 -07:00
Tim Macdonald
e9a28c250f Disable query analysis queueing for query changes in prod (#47231)
Analyze queries synchronously on save
2024-08-27 14:38:53 +00:00
Chris Truter
c5912a5286 Delete old serialization extension points and fallbacks (WIP) (#47273) 2024-08-27 14:00:22 +00:00
Luis Paolini
9fe5a85e91 Bump MS SQL Driver to 12.8.1 (#47264)
Lotsa fixes for this
2024-08-27 10:47:27 -03:00
bryan
339ff2433d Entity id translation service (#47094)
* entity id translation + tests

* add api level test

* simplify definition of eid-table->model + add test

* update tests to take keywords

* improve comment

* generate the eid-table->model map

* delete now-obsolete test

* make it work in oss

* put the resulting response into a key, so we can add more information later

* formatting

* use model names without the model/ prefix as keys

* Creates list of `api/model->db-model`

- update keys for util/entity_id request
- update shape of util/entity_id response
- add test for not-found eids

* formatting

* Respond to code review feedback

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>
2024-08-27 13:45:42 +00:00
github-automation-metabase
6e191b74e3 Add v0.49.24 to the list of releases (#47300) 2024-08-27 09:30:44 -04:00
github-automation-metabase
3a60853f38 Add v0.50.22 to the list of releases (#47275)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-08-27 09:17:17 -04:00
Ngoc Khuat
73e9a8a3b9 Fix flaky test update-db-to-never-scan-values-on-demand-test (#47295) 2024-08-27 12:16:05 +00:00
Chris Truter
2ba5c4d93e Stop serializing LegacyMetric (#47268) 2024-08-27 11:11:09 +00:00
Uladzimir Havenchyk
de7ff21dfd add uladzimirdev to querying team (#47298) 2024-08-27 11:05:05 +00:00
Chris Truter
ebf18f35b2 Use Serialization spec for Collection (#47240) 2024-08-27 11:05:57 +02:00
Chris Truter
b7cac603ae More logging around serialization error (#47278) 2024-08-27 08:52:44 +00:00
Kamil Mielnik
ccd3b577fb Refactor e2e helpers and commands to TypeScript function helpers (#47237)
* Convert e2e-custom-column-helpers to TS

* Refactor createTimeline, createTimelineEvent & createTimelineWithEvents to TS

* Fix circular imports
2024-08-27 08:36:11 +00:00
appleby
c73c198a7b Remove failing assertion in CLJS diagnose-expression-test (#47271)
Failing after changes in 13983247ee

Per slack conversation, ok to disable:

https://metaboat.slack.com/archives/C013N8XL286/p1724711461313089?thread_ts=1724414568.662469&cid=C013N8XL286
2024-08-27 00:37:18 +00:00
Chris Truter
f984a3e039 Track query analysis failures (#47216) 2024-08-26 23:35:01 +00:00
John Swanson
da2a0a1b7c Don't encrypt boolean settings (by default) (#47179)
* Don't encrypt boolean settings (by default)

We have tooling to disable encryption on settings even when the
`MB_ENCRYPTION_SECRET_KEY` is set. Turn it on by default for all boolean
settings, which don't need to be encrypted.

I also optimized the code that decrypts settings on startup because I
didn't want to delay startup if someone had set a bunch of boolean
settings. With 20 set, the old version added about 200+ ms to startup,
about 10ms per boolean setting, whether or not it was encrypted or in
the DB already. The optimized version selects all the never-encrypt
values from the database at once (a bit silly, but we also just exclude
raw `true` and `false` values so we don't bother checking them) and
updates them if they're encrypted - this adds ~40ms to startup with 20
encrypted boolean settings (about 2ms per boolean setting) and ~5ms to
startup on subsequent runs, when no encrypted values are in the DB.
2024-08-26 22:48:04 +00:00
Braden Shepherdson
13983247ee [MBQL lib] Disable expression type checking entirely (#47245)
This testing is too strict to support some legitimate use cases that
have no workaround at present. We can bring back this type-checking
eventually, once it's possible to correctly express things like
automatic coercion of strings to numbers in `SUM` aggregations.

Fixes #44431.
2024-08-26 17:44:18 -04:00
Uladzimir Havenchyk
f28ea99c64 fix import order in the files with disabled rules (#47217)
* fix import order in the files with disabled rules

* remove hack

* minor
2024-08-26 23:36:56 +03:00
Jeff Bruemmer
42caad57a3 docs - locale for static and public links (#47194) 2024-08-26 16:34:33 -04:00
Alex Yarosh
e8904acf4b docs: serialization clarification (#45480)
* serialization clarification

* Update docs/installation-and-operation/serialization.md

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

* Update docs/installation-and-operation/serialization.md

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

* Update docs/installation-and-operation/serialization.md

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

* Update docs/installation-and-operation/serialization.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-08-26 16:23:23 -04:00
Paul Leclercq
db21f7ed40 Docs: migrate down using docker compose command (#39497)
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2024-08-26 12:54:35 -07:00
Daksh Shah
aceaac27c8 Update upgrade instructions for Azure (#38638) 2024-08-26 12:52:39 -07:00
Bruno Ferreira
151334aac1 Adds missing glue:GetCatalogImportStatus (#41388)
Seems that `glue:GetCatalogImportStatus` is also needed for the integration with Amazon Athena because there's multiple AccessDenied on cloudtrail if this permission is missing:
```
{
    "eventVersion": "1.09",
    "userIdentity": {
        "type": "IAMUser",
        "principalId": "***********************",
        "arn": "arn:aws:iam::*************:user/metabase",
        "accountId": "**********************",
        "accessKeyId": "*******************",
        "userName": "metabase"
    },
    "eventTime": "2024-04-11T08:29:00Z",
    "eventSource": "glue.amazonaws.com",
    "eventName": "GetCatalogImportStatus",
    "awsRegion": "eu-west-1",
    "sourceIPAddress": "***********",
    "userAgent": "DriverVersion/02.00.35.1001/JDBCVersion/4.2/PluginName/IAM, aws-sdk-java/1.12.339 Linux/5.10.213-201.855.amzn2.x86_64 OpenJDK_64-Bit_Server_VM/11.0.22+7 java/11.0.22 clojure/1.11.1 vendor/Eclipse_Adoptium cfg/retry-mode/legacy",
    "errorCode": "AccessDenied",
    "errorMessage": "An unknown error occurred",
    "requestParameters": null,
    "responseElements": null,
    "requestID": "*************************************",
    "eventID": "*************************************",
    "readOnly": true,
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "*************************************",
    "eventCategory": "Management",
    "tlsDetails": {
        "tlsVersion": "TLSv1.3",
        "cipherSuite": "TLS_AES_128_GCM_SHA256",
        "clientProvidedHostHeader": "glue.eu-west-1.amazonaws.com"
    }
}
```
2024-08-26 12:52:18 -07:00
Tony-metabase
565f70c7e7 Update appearance.md (#36538)
* Update appearance.md

Adding information about how colors are selected by Metabase because there is the confusion that the order in which you select colors is the order you get on the chart

* Update appearance.md

Removed code reference and tried to simplify the context

* Update docs/configuring-metabase/appearance.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-08-26 12:50:56 -07:00
İbrahim Gurses
7a5133398c Add Peaka community driver link to documentation (#44152)
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2024-08-26 12:48:30 -07:00
Raphael Krut-Landau
45d8be7ef1 fix(dashboard): In dashboard value source modal, after closing question picker modal, don't also close the first modal (#47242) 2024-08-26 15:33:33 -04:00
John Swanson
af6d6e7fe4 Much better collection permission performance (#46942)
There are a few separate changes here:

- Migrations: add and populate indexed columns perm_value, perm_type, and collection_id to permissions

These fields allows us to efficiently run queries based on collection permissions in the DB without string manipulation. Keeping the table as permissions allows us to do this migration in-place. Note that in some cases collections may have been deleted from the database without deleting the associated permissions row (since there was no foreign key before). We need to be defensive here: if we have a permissions row without a corresponding collection, delete the row before running the rest of the migration.

- Write perm_value, perm_type, and collection_id for new collection permissions

A very simple before-insert method sets these fields before a collection permission is written to the DB.

- Replace collection/permissions-set->visible-collection-ids and collection/visible-collection-ids->honeysql-filter-clause with collection/honeysql-filter-clause

Previously, just about everywhere we used permissions-set->visible-collection-ids, what we were essentially doing was an in-app join: select all the collection IDs you have permission on, then convert it to a SQL clause like WHERE collection_id IN ( all of those collection IDs).

Replace both of these with honeysql-filter-clause, which uses the new fields we added to permissions above to construct a honeysql filter representing "all the collections I have permissions on", without needing to round-trip them to the application and back to the DB.

Of course, we can then write a function visible-collection-ids, which uses honeysql-filter-clause, for those cases where we do actually need the whole bunch in the application (we use this, for example, when constructing the effective-location for a collection).

I also added one more toggle to the VisibilityConfig that's passed into the honeysql-filter-clause (and used to be passed to permissions-set->visible-collection-ids), allowing you to select only the effective children of some collection.
2024-08-26 12:06:29 -07:00
metamben
8b1f884059 Support dashboard filters targeting multiple stages in QP (#46935)
* [MBQL lib] Map dashboard filters to last stage w/aggregations

Originally we used the last stage's columns for dashboard filters, but
then if you eg. use a custom expression to clean up the results of the
aggregation, then you can't filter at the most useful spot - before the
aggregations.

Fixes #19744. Related to #26244, #33958.

* Add stage-number option to the dimension not to the field

* Remove FE changes

* Support negative stage numbers

* Add tests for multi-stage parameter expansion

* Specify schema for dimension options

* Fix legacy MBQL schema

* Append stage when running cards with top level summary

* Fix schema

* Only ensure filter stage when the parameters say it's used

* Implement ensure-filter-stage

* Format clj

* Add ensure-filter-stage test

---------

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2024-08-26 20:16:00 +03:00
Raphael Krut-Landau
118e713d82 Fix error message in Create API Key modal (#47161) 2024-08-26 12:15:19 -04:00
Alexander Solovyov
879195def7 [serdes] query action depends on stuff in its dataset_query (#47220) 2024-08-26 17:59:39 +02:00
Noah Moss
0dd4013dc0 Use more precise query contexts when recording execution of public downloads (#47201) 2024-08-26 11:27:05 -04:00
John Swanson
1926bf93cb Re-add creator to query validation API (#47183) 2024-08-26 07:50:28 -07:00
Alexander Polyankin
84e5008bc8 Remove unneeded index.ts files in querying (#47190) 2024-08-26 14:13:52 +00:00
lbrdnk
b75577b529 Fix DateTimeRange substitution for open ranges (#47175)
* Fix DateTimeRange substitution for open ranges

* Add E2E repro for #47172

* cljfmt

* Add test for datetime column

* Update range boundary for open range

* Update test names

* Apply suggestions from code review

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

* Fix e2e

---------

Co-authored-by: Nemanja <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-08-26 14:51:45 +02:00
lbrdnk
ed509b5306 Add database type adjustments to server side generated temporal values (#47039)
* Add database type adjustments to server side generated temporal values

* Speculative base type change

* Infer timezone only from _actual_ user, not global user level

* Set timezone for actual user in test extensions

* Add test case

* Update type info generation

* Adjust server side relative datetime

* Update src/metabase/driver/sql/query_processor.clj

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

* Fix base type logic

* Fix typo

* Fix formatting

* Update user name handling

* cljfmt

* Address review comments

---------

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2024-08-26 12:36:15 +02:00
Chris Truter
61ca125c7e Add logging catch around query analysis worker (#47206) 2024-08-26 10:25:16 +00:00
github-automation-metabase
2bb3eedecb Update Readme version references and published npm version to 0.1.32 (#47174)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-08-26 07:23:57 +00:00
Alexander Solovyov
9b614cabda [serdes] a few improvements, instance_analytics cleanup script (#47136) 2024-08-24 05:04:00 +00:00
Cam Saul
d2034416e0 Fix mu/fn and mu/defn support for map schemas on key-value args (#47153)
* Fix #46846

* Don't use `-v` to check if script has arg since it doesn't work on all bash versions

* Fix typo
2024-08-23 17:25:23 -06:00
Aleksandr Lesnenko
b30af986d3 fix echarts tooltip positioning (#47202) 2024-08-23 22:27:00 +00:00
Case Nelson
25d30ca9aa feat: BigQuery nested fields (#47106)
* feat: BigQuery nested fields

Updates dataset definitions to allow `nested-fields`

Adds the `::sql.qp/nfc-path` to include nfc-path in the field
identifier.

* Add bigquery to nested-fields feature. Rework geographical-tips to allow adding to bigquery

* Parse RECORD type into maps

* Fix tests

* Fix tests

* Fix formatting

* Handle arrays of records

* Fix formatting

* Conditionally add nested-fields

* Fix test

* Update docs/developers-guide/driver-changelog.md

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

* Update docs/developers-guide/driver-changelog.md

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

* Update modules/drivers/bigquery-cloud-sdk/src/metabase/driver/bigquery_cloud_sdk.clj

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

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2024-08-23 22:05:17 +00:00
metamben
001b8890d7 Strip expression metadata for field expression (#47155)
* Strip expression metadata for field expression

Fixes #44940.
2024-08-23 21:30:29 +00:00
Sloan Sparger
83fea34fb8 [Permissions] Data permissions graph utils reorganization (#47023)
* reorganizes data-permissions.ts to be a folder split by a file per concern, moves some logic out into other utils files where it makes sense

* pr feedback and fix lints
2024-08-23 14:07:13 -05:00
Raphael Krut-Landau
af24dd9110 feat(admin/performance): In Admin / Performance, add a tab where you can manage the caching policies of dashboards and questions (#42990)
Closes #42567
2024-08-23 14:57:54 -04:00
Alexander Polyankin
17bff867ce Fix issues with column matching for multiple breakouts of the same column (#46979)
* Fix binning matching

* Add tests

* Add tests

* Add tests

* typo

* Update src/metabase/lib/equality.cljc

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

* Fix alignment

* Fix alignment

* Update src/metabase/lib/js.cljs

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

---------

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2024-08-23 17:21:46 +00:00
Nick Fitzpatrick
839717c961 Fix padding prop on Mantine Modals (#46900)
* move default modal padding to general modal component

* small adjustments. Using base modal where apropriate

* shame
2024-08-23 11:57:52 -03:00
Raphael Krut-Landau
da829723b9 fix(browse): Remove some dead code (#46861) 2024-08-23 10:25:11 -04:00
Chris Truter
0d50f7b1e6 Lower logging level for query analysis (#47178) 2024-08-23 14:00:50 +00:00
Alexander Polyankin
7e879221af Add subfolders in metabase/querying (#47160)
* Add subfolders in querying

* Add subfolders in querying

* Add subfolders in querying

* Remove FilterContent

* Remove FilterContent

* Remove FilterContent

* Remove FilterContent

* Remove FilterContent
2024-08-23 09:39:47 -04:00
Ngoc Khuat
42dc5239db [serialization] extract subtree should hydrate entities (#47171) 2024-08-23 12:59:02 +00:00
Jeff Bruemmer
e9c4972229 update env vars (#47072) 2024-08-23 12:49:11 +00:00
Mahatthana (Kelvin) Nomsawadi
d6a938f131 Update UTM tags in static embed modal links (#47116)
* Update interactive embedding CTA UTM tags

* Make the UTM tags more readable

* Update static embed doc UTM tags

* Update static embed appearance customization doc UTM tags

* Update font upsell UTM tags

* Update tests

* Fix wrong upgrade URL

* Update tests
2024-08-23 13:31:26 +01:00
Phoomparin Mano
852ddc274a fix(sdk): apply the default viz height only in visualization view (#47169)
* only use viz height for visualization view

* move the default viz height fallback

* default to full-height if height is zero or unavailable

* remove test wrapper
2024-08-23 18:56:35 +07:00
Oleksandr Yakushev
743ae09aca perf: [insights] Use direct conversions in ->millis-from-epoch to avoid clojure.java-time overhead (#47145) 2024-08-23 09:53:08 +03:00
Oleksandr Yakushev
4935863049 perf: [date-2.parse] Add a fastpath for timestamps that are likely ISO instants (#47143) 2024-08-23 05:55:31 +00:00
Jeff Bruemmer
65b3ef01d4 docs - api docs update (#46373) 2024-08-22 19:07:33 -04:00
Nick Fitzpatrick
e10bf5f950 extending table component features (#47030)
* extending table component features

* adding unit tests

* PR Feedback

* PR Feedback

* unit test adjustment
2024-08-22 15:31:43 -03:00
Noah Moss
3685eb4b2a Properly detect when Snowflake is using a local key file when expanding connection properties (#46348) 2024-08-22 14:08:21 -04:00
bryan
6eecf77e7d recents updates to better support metrics (#47032)
* recents updates to better support metrics

allows updating metric views through the API
improves parent_collection calculation

* add 2 tests for metrics
2024-08-22 17:48:02 +00:00
Cam Saul
31f209f33e Cljfmt config part 4 (#47047) 2024-08-22 16:24:16 +00:00
Aleksandr Lesnenko
418a20fd70 fix pivot table overflow (#47102)
* fix pivot tables overflow & edit styles

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-08-22 15:55:47 +00:00
Romeo Van Snick
8dd2eeefff Simplify finding metrics in Summarize (#46887)
* Use global search for aggregation picker

* Add names to aggregation picker items so they can be searched

* Render info icon metric descriptions

* Add unit tests for global aggregation picker search

* Add test for searching metrics

* Add a test for metrics descriptions

* Sort metrics

* Fix e2e test

* Use Flex from metabase/ui

* Handle markdown in metric description

* Add test for sorted metrics

* Update Markdown styling in metric description

* Fix clojure formatting

* Test for markdown in the Metric description

* Fix lint

* Fix test for markdown

* Use simpler equality test

* Fix overflow in test
2024-08-22 16:35:03 +02:00
John Swanson
5c0800aca4 Don't allow viewing a timeline without coll perms (#46863)
If we don't have access to the collection, we shouldn't have access to
the timelines.
2024-08-22 06:38:04 -07:00
Alexander Solovyov
35d73f950f [serdes] extract result_metadata.fk_target_field_id (#47122) 2024-08-22 16:24:24 +03:00
Chris Truter
5944b20bfb Bump macaw to 0.2.6 (#47119) 2024-08-22 13:05:48 +00:00
Alexander Solovyov
372fd8d9b3 [serdes] keep nulls in export when there are nulls in the db (#47121)
this retains previous behavior
2024-08-22 13:05:30 +00:00
Ngoc Khuat
22a80f2cb2 Fix n+1 when getting field values for dashboard (#47113) 2024-08-22 12:49:54 +00:00
Uladzimir Havenchyk
88ac0ed7c1 handle warnings from reselect about broken selectors rules (#47076)
* handle reselect warnings about wrong usage of selectors

* return stable references

* add a comment

* address excellent review
2024-08-22 11:22:41 +00:00
Chris Truter
0030c91580 Add support for pipe separator in CSVs (#47114) 2024-08-22 11:09:01 +00:00
Mahatthana (Kelvin) Nomsawadi
b3c72d9cec Fix iframe resizer not working (#47115) 2024-08-22 11:49:02 +01:00
Kamil Mielnik
6a5faa8bac Fix SchemaItem type (#47068) 2024-08-22 07:21:22 +00:00
bryan
00ff56e8ee Ensure blocked tables downgrade into blocked dbs (#47093)
* tests ensure blocked tables downgrade > blocked db

* implement the blocked table -> blocked db rollback

- move/add tests for it
2024-08-21 19:22:38 -06:00
adam-james
8bed390b6e Add missing day in :minute timestamp formatter (#47104) 2024-08-21 22:48:05 +00:00
Nemanja Glumac
a4e55cf4c9 Repro #42773: "-modified" suffix briefly shown in a model's name input during creation (#47103) 2024-08-21 21:52:10 +00:00
Noah Moss
c985f362fc Make sure we insert special segmented permission paths for sandboxed tables on downgrade to 49 (#47085) 2024-08-21 17:43:38 -04:00
Vamsi Peri
1fe4c5c176 removing cal (#47096) 2024-08-21 22:25:10 +02:00
Roman Abdulmanov
74e9d6971f Add notification about closed Epics (#47099) 2024-08-21 22:24:09 +02:00
Cam Saul
80813cb5de Cljfmt config part 3 (#47046)
* Cljfmt config part 2

* Part 3 WIP

* Part 3 WIP

* Part 3 WIP

* Part 3 WIP

* Part 3 WIP

* Use fork with https://github.com/weavejester/cljfmt/pull/348 and https://github.com/weavejester/cljfmt/pull/350

* Backport updated config and linter fork from part 3

* Update formatting

* Reformat

* Fix bad indentation from #47064
2024-08-21 19:27:08 +00:00
Ryan Laurie
3964d71e02 Create Question and Dashboard Sharing Menu (#46593)
* QuestionAlertWidget to FC + TS

* update e2e tests

* use regular alert for unsubscribes

* Create Question and Dashboard Sharing Menu

* Handle some edge cases

* top notch unit tests

* more testing and tweaking

* fix imports

* more tests

* add alerts to question sharing menu

* add tests for alerts

* update e2e tests

* use Oisin's toolbarbutton

* fix rebase

* prompt to save before sharing questions

* show prompt to set up notification channels

* fix import

* update tests and hide on notebook screen

* fixes

* clean up pulse types

* update e2e tests

* fix a bunch more tests

* more e2e test fixes

* maybe green now? 🤞

* last one 🥺

* design updates

* make channel setup modal nicer

* simpler component props

* lint fix

* lint fixes
2024-08-21 19:08:54 +00:00
metamben
cb12f351b6 Prevent metrics from being returned for inaccessible collections (#46994) 2024-08-21 21:45:52 +03:00
Mahatthana (Kelvin) Nomsawadi
ccec5ce938 Fix docker-compose not available on Mac (#47054) 2024-08-21 19:06:34 +01:00
Alex Yarosh
b7a867ab49 docs: Update MongoDB Atlas connection instructions (#47088)
* mongodb connection

* mongodb connection info

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-08-21 17:39:35 +00:00
Cam Saul
457392bd3b Cljfmt config part 2 (#47035)
* Cljfmt config part 2

* Backport updated config and linter fork from part 3

* Update formatting
2024-08-21 17:29:41 +00:00
Oisin Coveney
0a6d0a1928 feat(sdk): Edit Question (#46894) 2024-08-21 18:15:53 +03:00
Chris Truter
9e08c3e949 Improve Query Analysis sweeper scheduling (#47064) 2024-08-21 15:15:19 +00:00
Jeff Bruemmer
0ec737a7c6 docs - blocked at table level (#46937)
* blocked at table level

* edits

* note on sql questions
2024-08-21 11:12:31 -04:00
Uladzimir Havenchyk
ae0359f7f8 dx: forbid imports from storybook testing-library outside stories (#47056) 2024-08-21 17:55:31 +03:00
github-automation-metabase
47b8b4cbbf Add v0.50.21 to the list of releases (#47073)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-08-21 10:53:00 -04:00
Oisin Coveney
6d52d18be5 fix(#46893) - Sharing popover in query builder view should be next to button (#47065) 2024-08-21 17:36:12 +03:00
Luis Paolini
d275c0bb53 Bump presto driver to v288 (#47071) 2024-08-21 11:28:50 -03:00
Nicolò Pretto
270db4c6e3 bump onboarding version to 1.3.0 (#47055) 2024-08-21 16:23:17 +02:00
Alexander Polyankin
9108dd750c Rearrange buttons in the dashboard editing panel (#46809) 2024-08-21 09:31:39 -04:00
Chris Truter
468bed10cc Strip model cache tables from query analysis (#47063) 2024-08-21 12:17:50 +00:00
Roman Abdulmanov
a6116b85b4 Add notification about closed Epics (#47062) 2024-08-21 12:38:33 +01:00
Nicolò Pretto
8132d87efa skip analytics opt out step for people on cloud (#46965)
* poc of removing data usage step for the tech plan

* pretend it's not cloud if hasAddedPaidPlanInPreviousStep is true

* split the jest tests files to simulate pro cloud, pro selfhosted and starter cloud scenarios
2024-08-21 12:57:42 +02:00
Phoomparin Mano
4453abb13a feat(sdk): embedding cli opens the metabase store to get trial token and applies the license (#46810)
* open metabase store to get trial token

* remove license env from instance setup as we provide the license key later

* activate metabase license

* fix password field missing

* fix formatting for generated component files message

* activate license key

* add missing auth options for postgres

* add function to print with padding

* prevent infinite loop and update section representation

* show the activate license error in red

* rename variable
2024-08-21 17:36:53 +07:00
Chris Truter
1b9a267551 Bump Macaw to 0.2.3 and improve logging (#47031) 2024-08-21 10:20:19 +00:00
Nemanja Glumac
75629e969e Include collection path in the app bar for metrics (#47051) 2024-08-21 11:23:06 +02:00
Romeo Van Snick
63c074d2a2 Allow editing the breakout bin from the compare aggregation picker and provide presets (#46844)
* Add offset presets

* Render OffsetPresets initially

* Add BucketInput

* Render BucketInput and do not rely on referential equality for Lib.Bucket

* Make sure the currently selected bucket shows in the presets

* Lift label into CompareAggregations

* Fix spacing of label

* Fix labels based on comparison type

* Use Switch for include current period

* Include current bucket in CurrentPeriodInput label

* Fix unit tests

* Add more unit tests for CompareAggregations

* Update e2e test for column compare to handle presets

* Group offset tests

* Add tests for moving average

* Add tests to verify changing the bucket works

* Fix type

* Make sure temporal columns are buckatable before picking them

* Make getPreferredPresets more clear

* Add test for temporal expression column

* Fix lint
2024-08-21 11:11:42 +02:00
Alexander Solovyov
62fdd015f9 [serdes] move Action to using spec (#46973) 2024-08-21 11:33:33 +03:00
Mahatthana (Kelvin) Nomsawadi
f07084aa80 Improve text contrast in object detail in static embed (#46968)
* Theme object detail texts

* Add loki tests
2024-08-21 09:24:43 +01:00
Nicolò Pretto
d3777b3ed8 fix padding on setup completed step when on cloud (#47021) 2024-08-21 09:41:06 +02:00
Alexander Solovyov
c5e85d17b1 [serdes] move most of the models over to using spec (#46966) 2024-08-21 09:49:38 +03:00
Aleksandr Lesnenko
b259818634 hide echarts tooltip on scroll (#46996)
* hide echarts tooltip on scroll

* lint
2024-08-21 03:59:45 +00:00
Aleksandr Lesnenko
b8a88121c0 fix echarts tooltip issues (#46946)
* fix echarts tooltip issues

* fix types

* use another merge-ref package
2024-08-20 22:30:24 -04:00
Alex Yarosh
cba3922ddf clean up Azure AD references (#47041) 2024-08-20 19:05:15 -04:00
Alex Yarosh
1a7fec770c docs: bring back code highlighting (#47029)
* highlight 1

* highlight 2
2024-08-20 16:02:22 -04:00
Uladzimir Havenchyk
16291a0f99 fix: upgrade elliptic to resolve security issues (#47014) 2024-08-20 22:31:13 +03:00
Nemanja Glumac
ed8de16f26 refactor: Simplify question data source (#46989)
* Split utils from `QuestionDataSource`

* Do the computation inside the component

* Compute query only once

* Fix imports order
2024-08-20 21:22:48 +02:00
Cam Saul
ef42d3067c Update cljfmt config and add to GH Actions (#46998)
* Cljfmt

* Fix new GH action
2024-08-20 18:23:16 +00:00
Uladzimir Havenchyk
9c75ad629f remove pnpm lockfile (#47024) 2024-08-20 20:42:49 +03:00
lbrdnk
a556e1cd8e Update later stage stale references on clause removal (#46926)
* Add update-stale-references and test

* Update test
2024-08-20 18:18:01 +02:00
Uladzimir Havenchyk
92d615073a refactor: sort import members inside destructuring (#47009)
* refactor: sort import members inside destructuring

* Show an error message when the temporal unit is not applicable to a dashboard card (#46983)

* Fix tests

* Add tests

* Add tests

* Fix types

* Fix types

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2024-08-20 17:29:08 +03:00
Jeff Bruemmer
a5fe34ef23 docs - locked filter note (#46940) 2024-08-20 08:54:41 -04:00
Uladzimir Havenchyk
eb43ebfbd0 hide terminal-report logs from console (#46891)
* hide terminal-report logs from console

* disable html output from testing-library-dom

* revert failing code
2024-08-20 15:50:22 +03:00
Nicolò Pretto
e0a0734c62 make the newsletter signup a checkbox instead of a button (#46783)
* make the newsletter signup a checkbox instead of a button

* update copy on unit test

* fix describe nesting

* update the ui to be like the design

* make tests use userEvent.click to avoid warning about missing act

* use the subscribeToNewsletter function

* add basic e2e test for newsletter subscription

* move wait to the end of the test to see if it passes in ci

* remove async to see if it fixes the issue

* trying to mock the response

* make it clear why we're mocking the response

* use getUserEmail as suggested by Sloan

* inline var a suggested on code review
2024-08-20 14:28:39 +02:00
Nemanja Glumac
49db9a9b77 Fix 46221: Wrong collection shown in ad-hoc model-based questions (#47008)
* Remove `Collections` entity loader

* Load collections directly within the component

* Add E2E repro for #46221
2024-08-20 14:15:13 +02:00
Alexander Polyankin
fff6e35c3e Show an error message when the temporal unit is not applicable to a dashboard card (#46983)
* Fix tests

* Add tests

* Add tests

* Fix types

* Fix types
2024-08-20 07:49:10 -04:00
Nemanja Glumac
07c1e2549a Remove extra bottom margin from summarized ad-hoc question (#46993) 2024-08-20 09:01:19 +02:00
Cam Saul
ee25e763e3 Test defn/defmacro exclamation point linter should also use :parallel/disallowed (#46943)
* Kondo Config cleanup

* Restore warnings for with-log-messages-for-level until #28827 is merged

* Updated clojure.test hooks

* Fix kondo warning

* Test defn/defmacro exclamation point linter should also use :parallel/disallowed (part 1)

* WIP

* Time for me to learn to spell

* Finish the cleanup

* Remove code I was typing as an example

* Fix renamed var

* Fix the SAML tests

* Fix Kondo warning
2024-08-20 12:10:08 +07:00
Nemanja Glumac
bcb10910e3 tech: Delete old analytics code (#46986) 2024-08-20 00:41:33 +02:00
bryan
2bbcf745c8 Add no-access table-level and schema-level permission (#46542)
* allow `:blocked` to be saved for table level perms

* Adds 2 tests for table level blocked permission settings

- N.B. these are NOT ENFORCED YET

* update test that asserted we cannot set block on tables (we can)

* WIP: Pairing on making perms checking less wild

* cleanup, update docs, and add a test for view-data perm only

- Added a test where we have data permissions, but not create query, and
  I think it is failing when we have create query and blocked data
  permissions.
- renamed some functions from check-x -> has-x? since they return a
  value instead of throwing now

* Revert "WIP: Pairing on making perms checking less wild"

Keep the same behavior, but stick with the saner flow control

This reverts commit 63bcb5b401138555a081378574b15d6506469e60.

* update docs

* update test to be passing

- TODO: make sure it's correct w.r.t. perm settings

* Allow schema level blocked setting in permgraph

* remove invalid test cases

- continue to have a forcing function to test newly added perms

* conform function output

* ensure a single blocked table blocks native queries to its DB

* update error message

- we now catch this error in `metabase.models.query.permissions/has-perm-for-query?`

* we now check for data permissions to process query for card

* add more explanation to what we are testing

- to help see why it fails on CI and passes locally

* remove excess `def`

* Add test for table-level data X collection perms

- update test found to be in-error

* update param values qp permission check style

* set view-data and create-query explicitly

* set viewdata and createquery explicitly in qp test

* Respond to review comments (which fixes a case)

* setting a table to blocked: leave other tables the same

* [Permissions] Add "No access" schema/table permission (#46509)

* first pass

* refactors downgrading native permission logic and updates calculation so that "No access" downgrades native permissions to "No"

* stub for permissions help info on table block

* modal changes wip, updates downgrading create queries permissions to all happen at a single call site

* clean up, sandboxing modal copy changes, removes rekoke/limit access modal changes to make the diff smaller and move code to a seperate PR

* updates permissions help section to contain the final copy

* sandboxing copy fix and remove modal that was dropped from requirements

* adds blocked at the schema level, updates no access copy to blocked, updates permissions help section to contain new blocked and schema level changes

* fixes failed unit and e2e tests after sandboxing copy changes

* improve the block e2e test to include table blocking

* fixes failing blocked test, fixes other schemas create queries permissions getting correct with one schema was droped to blocked view data access, fixes a bug that prevents the save bar from going away when all permissions for group are set to the default values

* clean up

* remove color changes

* prevents parent being set to blocked preventing edits for children entities

* add new hasPermissionValueInSubgraph fn, adds modal to warn users we have to upgrade the view data permissions when they upgrade create queries permissions when a child entity is set to blocked

* adds test coverage for new modal

* removes unused function, adds new updateEntityPermission fn to help consolidate some logic elsewhere

* unit test fix and type fix

* most pr feedback

* updates the confirmation modal copy when changing a parent entity that contains a child with blocked permissions and/or sandboxed children, adds test coverage for that, adds test coverage for permission view data column not appearing in oss

* type fix

* [Permissions] Add e2e test coverage for blocked permissions enforcements (#46663)

* adds test coverage for enforcement of blocked permissions

* moves tests around based on pr feedback

* copy changes

* adds fix to make sure that blocked permissions are not removed from sibling tables that have the create queries permissions upgraded (#46854)

* Fix table name lookup for dbs w/ 1 schema per db

* add test for blank schema identifiers

* Refine sandboxed user perms for query builder access (#46939)

* Refine sandboxed user perms for query builder access

- Limit create-queries permissions to unblocked tables only
- Check user permissions for each table before granting query builder access
- Prevent querying of blocked joined tables from query builder for sandboxed users

* Adjust permissions for sandboxed users

- Grant view-data permissions only for unblocked tables
- Revert create-queries permissions to all tables in sandbox
- Remove unnecessary intermediate variable

* when sandboxing we no longer grant unrestricted view perms for blocked tables

* Update enterprise/backend/src/metabase_enterprise/sandbox/query_processor/middleware/row_level_restrictions.clj

remove blank line

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

* - make coalesce-test exhaustive (except for sandbox)

* Update enterprise/backend/src/metabase_enterprise/sandbox/query_processor/middleware/row_level_restrictions.clj

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

* t2/select ... -> database/table-id->database-id

* update comment

* [Permissions] Prevent "Granular" option in DB View Data options from changing permissions to unrestricted (#46976)

* fix

* adds back most of the code and limits it to only happen with impersonations, updates test to handle differing logic between the two flows

* removes test that is not longer needed

* more sandbox join table perms tests

---------

Co-authored-by: John Swanson <john.swanson@metabase.com>
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2024-08-19 16:33:43 -05:00
Mahatthana (Kelvin) Nomsawadi
668b6f36ed Update outdated loki snapshots (#46950)
* Update outdated loki snapshots

* Update the line snapshot using the one from CI

* try bumping the timeout to reduce flake

* Revert the linechart snapshot since it's still flaking

* skip the flaking story for themed line chart

* skip the flaking story for line chart

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
2024-08-19 14:41:30 -06:00
Oleksandr Yakushev
ce972eea52 perf: Remove redundant fetching of field values during DB sync (#46674) 2024-08-19 23:16:34 +03:00
Alex Yarosh
7cb5c14421 docs: special field filter syntax (#46982)
* field filter syntax

* Update docs/questions/native-editor/sql-parameters.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-08-19 19:36:27 +00:00
Nemanja Glumac
2899046d8c tech: Remove the last GoogleAnalytics tracking bits and references (#46980)
* Remove simple references to `trackStructEvent`

* Remove `withAnalytics` entities helper

* Remove `trackLoginSSO`

* Remove auth trackers

* Remove permissions trackers

* Remove performance trackers

* Remove settings trackers

* Remove pulse trackers

* Remove undo trackers

* Remove click actions trackers

* Remove `trackStructEvent`

* Remove GoogleAnalytics from the server security middleware

* Remove GoogleAnalytics from Kondo config

* Fix type failures

* Revert "Remove GoogleAnalytics from Kondo config"

This reverts commit 363557c44f.
2024-08-19 17:25:44 +00:00
John Swanson
57e1a4fba0 Allow missing Content-type header on GeoJSON (#46920)
If the content-type header is missing entirely, let it through. We're
not trying to be overly restrictive here, just prohibit things that are
clearly not GeoJSON.

Fixes https://github.com/metabase/metabase/issues/46918
2024-08-19 08:53:06 -07:00
github-actions[bot]
7bbf91fdb4 Update Translations for v50.21 (#46609)
* Add new strings for v50.20

* update translations for 50.21

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2024-08-19 15:44:40 +00:00
lbrdnk
4b31f83c03 Throw reasonable error when incompatible temporal unit is used in time unit parameter (#46525)
* Throw reasonable error when incompatible temporal unit is used in time unit param

* Remove redundant function

* Add :curated flag to catch exceptions

* Update test/metabase/query_processor_test/date_bucketing_test.clj

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

* Address review remarks

* Update test

* Make vars private

---------

Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
2024-08-19 17:28:40 +02:00
Ryan Laurie
c78b46d62b Remove unnecessary calls to /api/collection (#46752)
* use ee api to find custom reports collection

* remove deprecated hook

* fix race condition

* add unit tests

* fix circular dependency

* fix unit tests

* another plugin strategy
2024-08-19 14:48:54 +00:00
Kamil Mielnik
65ac2f18ca Remove unused @ts-expect-error directive (#46959)
- use createQuestionAndDashboard helper instead of command
- sort imports
2024-08-19 11:58:08 +00:00
Chris Truter
df1b106f52 Simple util to measure allocations for single-threaded code (#46951) 2024-08-19 10:41:43 +00:00
Kamil Mielnik
2aad9b407b Refactor e2e JavaScript API commands to TypeScript function helpers (#46934)
* Remove unused file

* Refactor getCurrentUser command to a TS function util

* Refactor createAlert command to a TS function util

* Refactor createModerationReview command to a TS function util

* Reuse createModerationReview

* Refactor createPulse command to a TS function util

* Remove references to deleted files

* Improve typing
2024-08-19 09:14:31 +00:00
Cam Saul
23725b4e9d Misc Kondo Config cleanup (#46907)
* Kondo Config cleanup

* Restore warnings for with-log-messages-for-level until #28827 is merged

* Updated clojure.test hooks

* Fix kondo warning

* Time for me to learn to spell
2024-08-16 16:48:13 -07:00
dpsutton
5e70671108 Include missing opts arg for transform->nested (#46944)
was missing from the call.

Also had to disable hooks to commit:

```
✖ clj-kondo --config ./.clj-kondo/config.edn --config-dir ./.clj-kondo --parallel --lint:
metabase/enterprise/backend/test/metabase_enterprise/serialization/v2/extract_test.clj:458:20: warning: Unresolved var: ts/extract-one
metabase/enterprise/backend/test/metabase_enterprise/serialization/v2/extract_test.clj:1691:8: warning: Unresolved var: mbc/ensure-audit-db-installed!
metabase/enterprise/backend/test/metabase_enterprise/serialization/v2/extract_test.clj:1757:18: warning: Unresolved var: ts/create!
linting took 247ms, errors: 0, warnings: 3
error Command failed with exit code 1.
```
2024-08-16 16:47:39 -06:00
Aleksandr Lesnenko
c6141aa747 use echarts tooltip (#46359)
* use ECharts tooltip on cartesian charts

* fix tooltip lag when changing hovered series

* facelift tooltip

* fix static viz crashes due to tooltip option

* facelift

* pie chart echarts tooltip

* facelift

* facelift

* facelift

* tweaks

* e2e specs

* return back the pie other slices tooltip

* more specs

* specs

* fix pie total

* fix tooltip overflow

* fix specs

* fix infinite rerender in embedding mode for charts that have warnings

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-08-16 11:39:07 -04:00
Alexander Solovyov
3b0e3a6b9c [serdes] extract-nested instead of relying on hydration (#46912) 2024-08-16 15:36:31 +00:00
Cam Saul
d959430ab9 Beautiful log message capturing ⭐ 😻 (#28827)
* Beautiful log message capturing ⭐ 😻

* Don't have log.cljs try to load log.capture, don't know how to make that work

* Remove restriction against use in parallel tests

* Fix tests using invalid syntax

* Port legacy tests

* Make this stuff work with Cljs

* Fix bad syntax

* Convert usages of old version of with-log-messages-for-level to new version

* Update other stuff to use the updated macro

* Fix stuff

* Fix Cljs tests

* Fix world's largest test

* Appease Kondo

* Fix comment

* ClojureScript: only emit capture code in dev builds
2024-08-16 17:17:45 +03:00
github-automation-metabase
d48bfdb7f7 Update Readme version references and published npm version to 0.1.31 (#46931) 2024-08-16 14:14:32 +00:00
Oleksandr Yakushev
6b9b5d9836 Fix warnings/errors in memoized-supports? when SnakeHatingMap is passed as database (#46868) 2024-08-16 16:50:08 +03:00
Jeff Bruemmer
4bc9b1fbaa docs - notes on memory usage (#46156)
* notes on memory usage

* typo

* Update observability-with-prometheus.md

* Update running.md

* update link

---------

Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
2024-08-16 08:34:49 -05:00
Roman Abdulmanov
62e7619798 Update team.json (#46922) 2024-08-16 14:15:28 +01:00
Denis Berezin
b9ba40d88a feat(sdk): Add CreateDashboardModal component and hook (#46802) 2024-08-16 13:10:59 +00:00
Nemanja Glumac
9c887592be MS4: E2E sandboxing test coverage for "Link to the data source from notebook" project (#46903)
* Add sandboxing E2E tests

* Fix types

* Ignore TS error for now
2024-08-16 11:55:47 +00:00
Oisin Coveney
8394213df0 feat(sdk): Create Question (#46618) 2024-08-16 14:17:57 +03:00
Ngoc Khuat
147985f1a3 no top level trs (#46911) 2024-08-16 10:11:48 +00:00
Anton Kulyk
8272ac4760 Fix public dashboards are cut when printing (#46829)
* Fix public dashboards are cut when printing

* Add comment
2024-08-16 10:18:13 +01:00
Uladzimir Havenchyk
0f306ca5eb fix CSP error in prod (#46890) 2024-08-16 11:42:29 +03:00
Chris Truter
28e5fac967 Put a band-aid around flake with spec generator (#46762) 2024-08-16 10:08:10 +02:00
Ngoc Khuat
015ca44ea5 Fix unable to send pulse with multi-series (#46908) 2024-08-16 13:59:10 +07:00
Oleksandr Yakushev
2c3a214f31 perf: Optimize CSV exporting (#45757)
* perf: Use more efficient iteration and formatting in CSV export

* perf: Replace clojure.data.csv functions with more efficient implementations

* fix: Fix formatting for integer numbers in scientific notation
2024-08-15 22:24:27 +00:00
bryan
a43b09cdfe skip some troubleshooting stats when hosted (#46749)
* skip some troubleshooting stats when hosted

* fix typo

* just skip "system-info" and "app db details"
2024-08-15 19:16:18 +00:00
Chris Truter
10ecdd7ccf Remove double prefix (#46884) 2024-08-15 19:28:53 +02:00
Uladzimir Havenchyk
606a163086 ci: enable cypress-terminal-report only at CI (#46866)
* disable cypress-terminal-report locally

* one more check

* cleanup
2024-08-15 20:26:04 +03:00
Alex Yarosh
d842fad9b3 docs: concat clarification (#46851)
* concat

* we fixed this!

* format

* links

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-08-15 12:06:11 -04:00
Chris Truter
d2fc33a3b5 Add missing field to serialization exception (#46883) 2024-08-15 10:37:22 +00:00
Uladzimir Havenchyk
bb79405630 ci: deduplicate e2e-tests clojure cache (#46770) 2024-08-15 13:03:58 +03:00
Mahatthana (Kelvin) Nomsawadi
acf87c0cdb Remove incorrect logic to hide hidden db fields (#46876) 2024-08-15 09:23:27 +00:00
Oleksandr Yakushev
1e9bd94d9b perf: Reuse ZoneRegion/UTC instead of creating new object when parsing dates (#46871) 2024-08-15 12:15:34 +03:00
Chris Truter
121b89ab07 Clean up serdes v2 exceptions (#46577) 2024-08-15 09:07:06 +00:00
Nicolò Pretto
e79b57b11e reduce logs during setup tests (#46834)
* refactor: memoize getSteps selector

* screen.getXXX.click() => userEvent.click(...) to avoid missing act() warning

* use mockSettings so that MetabaseSettings.setAll is called and we avoid the unknown features warning
2024-08-15 11:06:43 +02:00
Ngoc Khuat
266c96a595 Speed up updating user parameter value (#46615) 2024-08-15 07:35:14 +00:00
Uladzimir Havenchyk
643dc98b58 ci: restore default strategy for yarn cache (#46768) 2024-08-14 15:42:13 -06:00
Uladzimir Havenchyk
a9ac74047e ci(manual backport): improve logic for searching commit that wasn't merged correctly (#46729)
* ci(manual backport): improve logic for searching commit that wasn't merged correctly

* fixup
2024-08-15 00:29:23 +03:00
Cam Saul
80af26758b Add Kondo linter to disallow hardcoded driver names in tests (#41384)
* Add Kondo linter to disallow hardcoded driver names in tests

* Fix all tests using hardcoded driver names

* Test fixes 🔧

* Appease Kondo

* Remove normal-drivers-except

* Test fix 🔧

* Test fixes 🔧

* MongoDB test fixes
2024-08-14 20:23:38 +00:00
Nick Fitzpatrick
bd13952fca 46657 pulse edit migration (#46693)
* Functional and typed

* migrate Recipient Picker

* removing dead code
2024-08-14 16:41:07 -03:00
Raphael Krut-Landau
2b7741f594 fix(browse): Use a simple, CSS-based approach to representing paths responsively (#46530) 2024-08-14 15:36:56 -04:00
Uladzimir Havenchyk
e426b1a3b9 make local cypress dx great again (#46839) 2024-08-14 17:32:45 +02:00
Mahatthana (Kelvin) Nomsawadi
76cb82a047 Theme Mantine DatePicker (#46816)
* Remove unpassed props

* Add tests

* Theme mantine date picker
2024-08-14 16:27:49 +01:00
Nicolò Pretto
365e8d9e76 convert hasPremiumFeature to TypeScript and add missing token features keys (#46837) 2024-08-14 14:11:23 +00:00
metamben
8030e76ad0 Remove support for questions with metric source (#46789)
* Remove support for questions with metric source

* Fix e2e test
2024-08-14 17:04:38 +03:00
Romeo Van Snick
bf07ac9263 Moving average with offset clause (#46726)
* Add type picker to comparison modal

* Adjust offset input labels based of comarison type

* Pass comparisonType to column picker

* Add current period picker

* Use deepCompareEffect to avoid rerender loops

* Add moving average helpers

* Add moving average clause to query

* Prevent less than 1 period moving average from being created

* Fix unit test for CompareAggregations

* Use the ComparisonType type for the comparisonType arg

* Hardcode the mapping for offset <-> moving-average column types

* Convert column types in the comparisonType callback instead of a hook

* Remove unused parameter

* Automatically change to 2 when setting an invalid value for moving average periods

* Use expression parts in test

* Use named arguments for movingAverage

* Fixup test for moving average offset input

* Fix type issue

* Pass on includePreviousPeriod to getAggregations
2024-08-14 15:42:00 +02:00
Anton Kostenko
0a4806ed0c Switch Perf test events to labels from comments (#46835)
* Switch Perf test events to labels from comments
2024-08-14 09:34:07 -04:00
Phoomparin Mano
3df927c974 fix(sdk): optimistic update query builder and update questions in notebook (#46652)
* update question state

* update question state

* reload metadata for runQuestionOnNavigate

* fix runnable queries

* fix cannot run question

* extract question predicate functions to question.ts

* update types

* create utils subfolder for query builder

* fix query builder predicate imports

* naming tweaks to be more self-explanatory

* document the non-intuitive loadQuestion useEffect

* change imports to support metric

* remove unused import

* revert originalQuestion check to try to fix e2e failures

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>
2024-08-14 20:12:38 +07:00
John Swanson
621d3fe3f7 Don't disable triggers before data perms migration (#46826)
I didn't consider that we might not have permissions necessary to
disable triggers.
2024-08-14 05:56:26 -07:00
Anton Kostenko
30ce108c9a Switch perf test trigger from label to comment (#46828) 2024-08-14 08:39:58 -04:00
Anton Kostenko
75cbcb033f Add workflow to run per test on pr by /perf command (#46779)
* Add workflow to run per test on pr by /perf command

* Fix yaml name
2024-08-14 08:04:46 -04:00
Nemanja Glumac
234e32135a Remove the assertion about the tooltip on returning to the notebook page (#46805) 2024-08-14 11:43:43 +00:00
Kamil Mielnik
a4f1223d1d Remove flaky tag (#46822) 2024-08-14 11:06:44 +00:00
Oisin Coveney
30bf9c3225 Add label for #46771 test (#46821) 2024-08-14 10:27:15 +00:00
Oisin Coveney
7fa6cf56f2 fix #46765 - Add dashboard filter popover does not close on click outside (#46771) 2024-08-14 12:59:33 +03:00
Kamil Mielnik
c805442231 Fix column-compare.cy.spec.ts flake (#46817)
* Fix flake

* Inline the function
2024-08-14 16:55:07 +07:00
Uladzimir Havenchyk
fab6177105 dx: handle CSP errors in pivot table (#46766) 2024-08-14 09:53:37 +00:00
lbrdnk
d62f868fb8 Enable type info computation for string id fields (#46488)
* Enable type info computation for fields coming from model source query

* Add test

* Add handling for fields coming from joins
2024-08-14 10:34:29 +02:00
Oisin Coveney
07767290f5 Fix broken popover in Segments form (#46723) 2024-08-14 11:30:11 +03:00
Romeo Van Snick
9fa749d6b8 Automatically select offset breakout or move it to the front (#46573)
* Add defaultTemporalBucket helper

* Add helper to pick default breakout

* Move breakout to the front or add one if it does not exist

* Add updateQuery to AggregationPicker props

* Add tests for creation and reordering of temporal breakouts

* Reuse defaultTemporalBucket in withDefaultTemporalBucket

* Reorder query operations to make sure the correct names get generated

* Remove dependency on referential equality of breakout

* Rename updateQuery to onQueryChange

* Remove onAddAggregations and onUpdateAggregation for onQueryChange

* Extract query update in to separate function

* Remove on{Add,Update,Remove}Aggregation in favor of onQueryChange

* Remove aggregations from summarize details

* Fix e2e tests

* Remove conflicting test

* Fix recent clause in unit tests

* Fix superflouous check for columnAndBucket

* Future proof breakout check

* Remove reliance on details in the useSummarize hook

* Remove details in unit tests

* Removal of default summarization should not trigger a query change
2024-08-14 10:25:22 +02:00
Mahatthana (Kelvin) Nomsawadi
763ebb7421 Fix exported png got different backgrounds based on screen density (#46769) 2024-08-14 08:15:16 +01:00
github-automation-metabase
e2bcdb1462 Add v0.50.20 to the list of releases (#46804)
* Add v0.50.20 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-08-14 00:54:12 +00:00
metamben
e4d8849516 Fix handling explicit joins in metrics (#46798) 2024-08-14 02:43:30 +03:00
Alexander Polyankin
a7e59b9863 Expect broken field refs in filter drills (#46691)
* Handle column matching errors

* Fix test

* Fix test

* Fix test

* Fix test

* Fix test
2024-08-13 19:12:32 -04:00
Aleksandr Lesnenko
2cf4f2d42c disallow close global function usage (#46753) 2024-08-13 22:08:02 +00:00
github-automation-metabase
e38e689b6c Add v0.49.23 to the list of releases (#46800)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-08-13 17:45:02 -04:00
Nemanja Glumac
0ff6ef5224 e2e: Fix dashboard ID filter flakes (#46787) 2024-08-13 20:33:45 +02:00
metamben
460ac41f6f Use the metric's source instead of the metric itself as base (#46688) 2024-08-13 14:21:37 -04:00
Nemanja Glumac
719f3ed6ac e2e: Fix dashboard number filter flakes (#46785)
* Try to fix dashboard-filters-number flake

* Try to fix dashboard-filters-number flake

* Intercept all dashboard data requests for number filters
2024-08-13 19:56:42 +02:00
Anton Kulyk
02f5a20e38 Ellipsify long dashboard filter values (strings only) (#46073)
* Clean up `Ellipsified`

* Add `multiline` prop to `Ellipsified`

* Ellipsify long string parameter values
2024-08-13 16:38:02 +01:00
Noah Moss
873fc865d5 Speed up permissions migrations (round 2) (#46393)
* new version of data_access migration + run ANALYZE beforehand

* relax constraints on migration timestamps

* more migration rewrites

* fix bug in migration

* fix another bug and remove extraneous logging

* reorder migrations to fix ID validation

* start adapting the changes to mysql as well

* wip

* add more ANALYZE calls

* revert logging changes

* finish duplicating work for mysql + a bit of clean up

* create H2 versions of migrations without the ANALYZE calls

* remove ANALYZE call from view_data.sql (probably not necessary)

* fix mysql syntax

* fix another mysql bug

* another mysql fix

* Don't exclude inactive tables for data_access

* Don't write rows for Administrators group

* Don't write rows for Admins (H2/MySQL)

* disable triggers before perms migration

---------

Co-authored-by: John Swanson <john.swanson@metabase.com>
2024-08-13 08:06:07 -07:00
github-automation-metabase
73c7e67505 Update Readme version references and published npm version to 0.1.30 (#46772) 2024-08-13 13:53:29 +00:00
Phoomparin Mano
4c3df61d2a feat(sdk): generate sample react component with the embedding cli (#46538)
* add setup commands

* fix settings definition

* update environment variables for cli

* handle instances not being ready

* update error messages

* add more specific loading messages

* loading spinner state

* improve error message

* use a fixed demo setup token

* remove extraneous spinner

* update status checks

* update container messages

* update wait timing

* create api keys

* extract constants

* remove manual steps

* Add anonymous tracking + other things. will need to clean up

* Modify SDK for better structure

* remove line from print.ts

* Update webpack.embedding-sdk-cli.config.js back to production

* Add types and add quick note

* Fix a typo

* Add index file, simplify types, use an array

* Add safer json parsing

* use delay of 100ms between each setup call

* Suggestions from review

* ensure that cli works

* Attempt to fix jest errors

* Remove node-fetch from sdk code to hopefully get unit tests working again

* add database connection

* add connection details handling

* refactor asking for database connection info

* apply actual database id for syncing schema

* fix failing database sync step

* allow table selection

* create model for each table

* handle errors in model creation

* fix incorrect model display name

* create x-rays based on user data

* consolidate instance setup message

* workaround for inquirer eventemitter issue

* add sample components

* fix yarn.lock file

* add sample components

* set spinner to fail state when instance setup fails

* use a transparent background by default

* update cli welcome messages

* add import notice

* refactor imports

* update snippet to add dashboard dropdown

* cli add credential file to users .gitignore

* add docs on quickstart

* clear screen with console.clear

* address code review feedback

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

* allow node 18 lts

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>
Co-authored-by: Nicolò Pretto <info@npretto.com>
2024-08-13 20:30:13 +07:00
Nemanja Glumac
67644874f3 Repro #46756: Add/remove a single column in a model with tables joined by themselves adds/removes all columns (#46757) 2024-08-13 12:05:30 +02:00
Uladzimir Havenchyk
82e95749fd fix: get correct values from theme to fill css variables (#46740) 2024-08-13 12:47:07 +03:00
Chris Truter
558cf9463c Fix false negatives for query reference validation (#46735) 2024-08-13 08:29:55 +00:00
Mahatthana (Kelvin) Nomsawadi
ea3007efb3 Fix conventional commit reminder (#46760)
* Fix conventinoal commit reminder

* debug conventional commit reminder

* debug conventional commit reminder

* Revert readme used to test the workflow
2024-08-13 08:33:12 +01:00
Luis Paolini
9a33e10893 fix(sdk): always pull the latest image in the cli (#46739)
Fixes https://github.com/metabase/metabase/issues/46738
2024-08-13 14:12:35 +07:00
Nicolò Pretto
210aebe60b fix(sdk): increase setup timeout to 15s to avoid 'user already created' issue on retry 2024-08-13 14:09:41 +07:00
Nicolò Pretto
8b4f855411 fix(sdk): fix health endpoint when polling whether metabase instance is ready (#46730) 2024-08-13 14:05:00 +07:00
Nicolò Pretto
df81b2de3b fix(sdk): make sure generated password has at least one number, one upper case and one lower case character to avoid issues with password policies (#46737) 2024-08-13 14:04:21 +07:00
Mahatthana (Kelvin) Nomsawadi
7fd0d80201 Fix tooltip style is mistakenly applied to popover (#46683)
* Fix tooltip styles leaking to popover

* Fix snapshot now showing the tooltips and dropdowns

* Update the loki snapshot using built storybook for consistency
2024-08-13 06:41:20 +00:00
Nemanja Glumac
b7fad81ddb Fix the distance between "Field to map to" and "required" (#46747) 2024-08-13 07:25:20 +02:00
Nemanja Glumac
020f98c28c Prevent opening data source in a new tab for embedding SDK (#46743)
* Prevent opening data source in a new tab for embedding SDK

* Add unit tests for embedding SDK context
2024-08-13 07:24:42 +02:00
Ryan Laurie
63295cefc6 Remove unnecessary api call from create collection form (#46736) 2024-08-12 17:02:55 -06:00
Nemanja Glumac
1cce770449 test: Update embedding state mocks (#46744) 2024-08-13 00:52:35 +02:00
Alexander Polyankin
cb79783158 FE - Support multiple breakout positions (#46555) 2024-08-12 16:54:37 -04:00
appleby
6f8332bcca Add appleby to team.json and github-slack-map.json (#46748)
* Add appleby to Query Processor team in team.json

* Add appleby to github-slack-map.json
2024-08-12 17:45:05 -03:00
Nemanja Glumac
f5ac1f279c Show loading state while fetching data in a new model page (#46694)
* Show new model loading state while fetching

* Show new model loading state while fetching

* Add unit test

* Use `DelayedLoadingSpinner` instead

* Update the test

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

* Prettier

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-08-12 21:39:47 +02:00
adam-james
34e0b67ca9 Add Timeseries insights even when Custom Columns exist (#46253)
* Add Timeseries insights even when Custom Columns exist

WIP

Fixes 46244

I don't know why it was (maybe still is) required that the :other columns be empty before providing insights.

* might be a solution to changing trendlines when data doesn't change

The insights code that powers the frontend trendline requires taking a sample of the dataset.

This sampling has some randomness associated by design, and should maintain its randomness. But it makes some sense to
use the exact same sample when the input has not changed at all, hence trying this memoize approach out.

Might not be the final solution, but it's a start

* add test to show that insights are computed

* use java.util.random with a seed to keep insights stable
2024-08-12 10:00:34 -07:00
Oisin Coveney
8e918199f8 Convert Dashboard Header buttons to Mantine (#46632) 2024-08-12 19:23:28 +03:00
Duncan Mak
86d2e1bbc1 Support hhmm timezone format (#46172)
* Add testcase from https://github.com/metabase/metabase/issues/43915

* Try a custom formatter if the default formatter for OffsetDateTime doesn't work

* Add testcase

* Make auxillary formatter private

* Catch a more specific exception

* Throw IllegalArgumentException on invalid dates

* Use strict resolver and fix test

* Empty commit to assign credit where it's due

---------

Co-authored-by: Chris Truter <chris@metabase.com>
2024-08-12 18:04:17 +02:00
adam-james
47d9fc19c5 Dowload Row Limit Env Var (#46401)
* Dowload Row Limit Env Var

Adds `MB_DOWNLOAD_ROW_LIMIT` to enable changing the row limit on downloads and alert/subscription attachments (not the
rendered tables, but the .csv, etc.).

Based on: #44982 (Thanks, @r-kot)

Partially implements: #28144

The difference in this PR compared to #44982 is that the download limit applies to all downloads, the only exception
being when the limit is above `qp.i/absolute-max-results` (1048575, based on Excel's limitation); in such a case, the
user supplied limit is only used if the download is csv or json, and `qp.i/absolute-max-results` is used for xlsx.

This PR also fixes alert/subscription attachment limits; prior to this, they were set to the in-app limit of 2000
rows, but now they will follow the user supplied download-row-limit.

This PR also adds a test to the downloads-and-exports test namespace, confirming that they follow the supplied limit,
or the max limit if none is supplied.

* add test confirming the default limit works

* fix test to use the download-row-limit

* address review feedback

* Update src/metabase/public_settings.clj

Co-authored-by: Cal Herries <39073188+calherries@users.noreply.github.com>

* add test covering case where download-row-limit is unset

---------

Co-authored-by: Cal Herries <39073188+calherries@users.noreply.github.com>
2024-08-12 14:57:52 +00:00
Uladzimir Havenchyk
b53a898e12 ci: move flaky specs to jail (#46715) 2024-08-12 17:19:11 +03:00
Kamil Mielnik
bcd1a90cb6 Refactor parameters filters utils to TS (#46719)
* Refactor filter utils to TS

* Remove type casts

* Improve dimension instantiation

* Fix typing
2024-08-12 14:15:48 +00:00
Chris Truter
eca4bb5f84 Improve test coverage around query_table (#46718) 2024-08-12 13:41:53 +00:00
Denis Berezin
10e21e2507 feat(sdk): Add edit mode for interactive dashboard component (#46255) 2024-08-12 16:33:35 +03:00
Uladzimir Havenchyk
84433da548 dx: get rid of csp error from cljs devtool (#46705) 2024-08-12 16:30:58 +03:00
Alexander Solovyov
92aed870d0 [serdes] convert database, card and dashboard with friends to using spec (#46147) 2024-08-12 16:19:57 +03:00
Nick Fitzpatrick
8dbe627364 44723 human readable coercion strategies (#46347)
* Revert "Remove unused humanizeCoercionStrategy and its test suite (#36136)"

This reverts commit 5375347e33.

* humanize coercion strategies, add e2e test

* unit test adjustment

* pr feedback
2024-08-12 09:26:51 -03:00
Uladzimir Havenchyk
3313704cd5 refactor: replace lodash with alternatives and forbid its usage (#46660)
* dx: raise an error if lodash is used

* fix lint errors

* use ts-deepmerge

* don't throw an error

* use correct type

* use merge form icepick
2024-08-12 11:31:47 +00:00
Chris Truter
b8adf4d5c1 Fix query analysis clean up and add logging (#46651) 2024-08-12 12:49:43 +03:00
Alexander Solovyov
1628d5fa67 [serdes] ability to skip errors (#46591) 2024-08-12 09:46:36 +00:00
Oisin Coveney
056b6a39da Convert QueryBuilder action buttons to Mantine (#46631) 2024-08-12 11:20:21 +03:00
Oisin Coveney
abacb880e6 fix(sdk): Add location-specific provider for SDK (#46681) 2024-08-12 11:19:40 +03:00
Ngoc Khuat
479b3e385f limit the anon stats on query execution to 30 days (#46560) 2024-08-12 05:02:55 +00:00
Oleksandr Yakushev
a97bdb2529 perf: Use database-id instead of database object in memoizing calls to driver/supports? (#46673) 2024-08-10 10:05:30 +03:00
Aleksandr Lesnenko
f83bfa6601 Fix exports E2E flakes (#46690)
* conditional dismissal step

* check for download status in the container

* try fixing flakes again

* try again

* chartPathWithFillColor already verifies chart has been rendered
2024-08-10 00:39:25 -04:00
Nemanja Glumac
528cccd9a0 Safely open in a new tab for a subpath scenario (#46684)
* Introduce subpath-safe URL utils

* Open data source links from a notebook safely on a subpath

* Open browse model links safely on a subpath

* Uniform naming

* Use the existing URL helper

* Trim url

* Add unit tests

* Add one more test case

* Fix test name 😅

* Make URLs non-optional strings
2024-08-09 22:17:18 +00:00
adam-james
c35f2503c3 Export Formatting Correctness (#46306)
* Export Formatting Correctness

WIP

Several bugs exist around the correctness of export formatting, this aims to fix them.

Fixes #27374

When a model has viz settings/metadata changed after save, the download won't incorporate said changes. At least it's
clear that scale doesn't work.

* number formatter merges settings from columns too

* column formatting on aggregated cols works in xlsx now too

* fixes 43040 by grabbing global-type-settings in csv formatter
2024-08-09 12:50:12 -07:00
github-automation-metabase
b5ad29da99 Update Readme version references and published npm version to 0.1.29 (#46686) 2024-08-09 17:43:58 +00:00
Raphael Krut-Landau
d36ee579d6 fix(admin/performance): Ensure that the tab's title (e.g. Database caching) and 'Performance' are visible in document title (#46602) 2024-08-09 13:37:36 -04:00
Oleksandr Yakushev
7397af5897 Include function name in generated lambda name when using malli/defn (#46678) 2024-08-09 20:16:49 +03:00
Oisin Coveney
db5347d5e3 Split form component from SaveQuestionModal (#46649) 2024-08-09 17:57:34 +03:00
Mahatthana (Kelvin) Nomsawadi
69e011853d fix(sdk): Fix unmapped theme colors (#46650)
* Refactor

* Fix wrong colors when passing empty SDK `colors`

* Clean up CSS custom properties

* Add missing color mapping to the SDK

* Add missing colors to the main app

* Only override additional dynamic colors when values are passed

* Fix unit tests

* Address review

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

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2024-08-09 14:11:37 +00:00
Uladzimir Havenchyk
7c77185acb dx: get rid of most of CSP errors in dev mode (#46666)
* dx: get rid of csp errors in TableInteractive

* get rid of csp errors in mantine
2024-08-09 16:14:49 +03:00
Romeo Van Snick
e6b84e42e0 Move the compare to the past aggregation to the bottom of the dropdown and hide it when no temporal breakouts are available (#46500)
* Move the compare to the past aggregation to the bottom of the dropdown

* Fix missing icon property

* Hide 'Compare to the past' when there are no temporal columns

* Update copy in tests

* Add test for questions with no temporal columns

* Fix unit test for AggregationPicker

* Allow adding a compare aggregation when the first breakout is not temporal too

* Rename to 'Compare to the past' in custom column action

* Rename to 'Compare to the past' in column drill

* Update copy in tests for actions and drills

* Move canAddTemporalAggregation to CompareAggregation utils

* Use aggregations from the query always

* Remove unnecessary displayName check
2024-08-09 11:24:08 +02:00
adam-james
d5884d5706 Last Used Param Value doesn't fill in with default value if cleared (#46468)
* Last Used Param Value doesn't fill in with default value if cleared

Fixes #46368

The Last used parameter value is cleared when the frontend sends `nil` as the parameter's value. This works except in
cases where a user clears a parameter with a default value. In this case, we want to indicate that the parameter is
cleared, so we store `nil` in the appdb in such a case.

* Update src/metabase/query_processor/dashboard.clj

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

* add assertion showing that 'nil' with default is still stored

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2024-08-08 17:44:34 -07:00
Ryan Laurie
e5950f94ac Log full version history in release log (#46659)
* log full version history

* remove test code
2024-08-08 16:10:40 -06:00
Case Nelson
a37544cc80 fix: uuid join conditions should not cast (#46614)
Fixes: #46558

In #45575 we introduced casting uuid fields for drilldowns.

However we failed to include a check that the rhs was itself another
field of uuid type and so no casting should occur. This broke joins on
models when the database_type of the field may not be known.
2024-08-08 16:05:39 -06:00
Aleksandr Lesnenko
ad537f2ad9 fix downloads e2e flakes (#46612)
* fix downloads e2e flakes

* fix flake
2024-08-08 19:31:54 +00:00
Nemanja Glumac
94134a2600 MS2 follow up: add more unit tests for joins (#46619)
* MS2 follow up: add more unit tests for joins

* Address review comments re: variable naming
2024-08-08 19:25:10 +00:00
Nemanja Glumac
e56f1b6486 MS3: Open notebook data source in new tab (tooltip) (#46552)
* Add tooltip to the data step cell

* Conditionally display tooltip

* Add unit tests for the data step

* Add unit tests for the join step

* Move the abstraction to the NotebookDataPicker

* Cover the tooltip behavior with E2E test

* Update test
2024-08-08 18:55:48 +00:00
Emmad Usmani
a4bec904a6 automatically use compact formatting for pie chart total (#46505)
* automatically use compact formatting for pie chart total

* add story and snapshots
2024-08-08 15:45:35 +00:00
Mahatthana (Kelvin) Nomsawadi
cf7a09e3a1 More styling on dark theme (#46637) 2024-08-08 16:40:33 +01:00
Nick Fitzpatrick
82d25cafe2 45003 entity picker recents context (#46289)
* useLogRecentItem

* updating tests

* unit tests

* e2e test

* PR Feedback

* log questions / models

* Accept :dataset instead of :model

* Adding e2e test for recent activity datasets, reverting 'await' changes

* Add e2e for collection moving error

---------

Co-authored-by: dan sutton <dan@dpsutton.com>
2024-08-08 11:57:11 -03:00
Oisin Coveney
ae9cae6ed9 Add ToolbarButton to start replacing dashboard header buttons (#46628) 2024-08-08 17:34:33 +03:00
Uladzimir Havenchyk
6d8c039239 ci: replace docker-compose and fix mba usage (#46517) 2024-08-08 17:17:14 +03:00
Oisin Coveney
ea677b3696 Refactors getScheduleText to use ts-pattern (#46627) 2024-08-08 16:41:31 +03:00
Kamil Mielnik
4957660c6c FE - Cover Unit of Time in getParameterColumns with tests (#46529)
* Add test boilerplate

* Rename test and add assertions

* Add broken test for models

* Add unit of time tests

* Deduplicate code

* Add date parameter tests

* Add test for multiple stages

* Fix model test setup and refactor getColumnsInfos

* Remove redundant assertions

* Format codee

* Extract createQuestion and createModel

* Add unit of time model tests

* Add test for model

* Extract constants

* Add a warning

* Build dataset queries with mbql

* Introduce queryOrders

* Revert redundant change

* Improve Question creation
2024-08-08 13:25:04 +00:00
Alexander Polyankin
448eaa0eed Disable broken card refs (#46594)
* Try without broken refs

* Disable broken test

* Disable broken test
2024-08-08 08:49:15 -04:00
Chris Truter
13da5ff5aa Disable Validation API if Analysis is disabled (#46266) 2024-08-08 12:09:26 +00:00
Oisin Coveney
162e24a78a Split AlertModals into multiple files (#46376) 2024-08-08 15:00:20 +03:00
Mahatthana (Kelvin) Nomsawadi
cfee367c09 Fix spammy GitHub Actions comments (#46625)
* Fix spammy GitHub Actions comments

* [DEBUG] trigger conventional commit reminder

* fix syntax errors

* Mock update

* mock another update

* 3rd update

* test if the comment would be updated only if the actual commet changes

* Remove all code relating to testing

* Fix type not compatible with node 18
2024-08-08 12:56:42 +01:00
Chris Truter
6da3a02502 Hide non-qualified fields from query validator (#46587) 2024-08-08 13:51:21 +02:00
Mahatthana (Kelvin) Nomsawadi
a4df4eb7c5 Follow-up milestone 2 for [Epic] Re-design transparent theme for static embedding and public links (#46491)
* Update new Metabase base colors

* Make hover and selected state consistency

* Fix wrong embed frame border color

* Refactor: extract props

* Fix border color

* Fix pivot table cell hover color

* Fix smart scalar text contrast

* Add smart scalar tests + update text color design

* Theme dashboard card menu

* Remove dashcard action menu tests since they don't work in loki

* Fix storybook background color for dark theme

* Update loki snapshots

* Disable untestable tests

* Make sure all storybook inherit all necessary base styles

* Skip untestable tests

* Update loki snapshots
2024-08-08 11:31:40 +00:00
Oisin Coveney
14d8eb86af Convert AlertListPopoverContent to TS (#46413) 2024-08-08 14:22:18 +03:00
github-automation-metabase
14fa99c1d1 Update Readme version references and published npm version to 0.1.28 (#46624) 2024-08-08 10:43:56 +00:00
Ngoc Khuat
afa66abf94 Fix oom during sync field values (#46524) 2024-08-08 10:34:09 +00:00
Oisin Coveney
d75f1685b8 Add useCreateQuestion and useSaveQuestion for SDK's Create Question (#46621) 2024-08-08 12:50:40 +03:00
Cal Herries
b6f4e51724 Reset report_card.last_used_at for all cards (#45448) 2024-08-08 12:33:36 +03:00
Phoomparin Mano
178997d776 feat(sdk): connect databases, generate models and x-rays from the CLI (#46502)
* add setup commands

* fix settings definition

* update environment variables for cli

* handle instances not being ready

* update error messages

* add more specific loading messages

* loading spinner state

* improve error message

* use a fixed demo setup token

* remove extraneous spinner

* update status checks

* update container messages

* update wait timing

* create api keys

* extract constants

* remove manual steps

* Add anonymous tracking + other things. will need to clean up

* Modify SDK for better structure

* remove line from print.ts

* Update webpack.embedding-sdk-cli.config.js back to production

* Add types and add quick note

* Fix a typo

* Add index file, simplify types, use an array

* Add safer json parsing

* use delay of 100ms between each setup call

* Suggestions from review

* ensure that cli works

* Attempt to fix jest errors

* Remove node-fetch from sdk code to hopefully get unit tests working again

* add database connection

* add connection details handling

* refactor asking for database connection info

* apply actual database id for syncing schema

* fix failing database sync step

* allow table selection

* create model for each table

* handle errors in model creation

* fix incorrect model display name

* create x-rays based on user data

* consolidate instance setup message

* workaround for inquirer eventemitter issue

* fix yarn.lock file

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>
2024-08-08 16:30:42 +07:00
Mahatthana (Kelvin) Nomsawadi
6fb1e51d8f Fix unintentional color changes (#46516)
* Sync storybook colors with the main app

* Fix Metabase badge color

* Fix wrong mixed brand colors

* Add mistakenly removed colors

* Update comments

* Correct `brand-light` color

* Fix wrong Mantine button color when passing `color` prop

* Update loki snapshots
2024-08-08 10:01:07 +01:00
Uladzimir Havenchyk
e1af9340b8 dx: automate babel deduplication (#46495) 2024-08-08 09:15:33 +03:00
Aleksandr Lesnenko
7d6b458c2b make series style settings tab first (#46549)
* make series style settings tab first

* spec
2024-08-08 06:14:32 +00:00
Case Nelson
e0c710780f fix: Handle tokens in strings when parsing params (#46547)
* fix: Handle tokens in strings when parsing params

Fixes #38051
Fixes #36262
Fixes #11755

* Fix handling snippets with single quotes in name
2024-08-08 04:57:16 +00:00
Aleksandr Lesnenko
c31c0e45b7 Fix pie e2e flake (#46613)
* fix pie e2e flake

* try fixing pie e2e flake

* try fixing pie e2e flakes

* last resort

* drop realHover
2024-08-07 22:29:20 -04:00
Alexander Polyankin
41fc438c34 Migrate field ref-based column keys in column_settings (#46025) 2024-08-07 23:37:52 +00:00
Nemanja Glumac
07da3e1de3 MS2: Open notebook data source in new tab (joins) (#46582)
* Add E2E support for notebook joins

* Add negative test cases
2024-08-08 00:52:03 +02:00
Aleksandr Lesnenko
b85747312c bump loki tolerance (#46600)
* bump loki tolerance

* fix loki-update command

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-08-07 22:32:53 +00:00
Raphael Krut-Landau
3f9e2b7bf9 fix(webapp/sidenav): Move Browse sidebar section in between Trash and other collections (#46457) 2024-08-07 21:22:25 +00:00
Alex Yarosh
40fbf96b6a docs: fix titles (#46599) 2024-08-07 16:46:25 -04:00
Dennis Schridde
fbaf58ad03 Hide upload config when data warehouse is attached (#45842)
== Goal ==

Prevent admins of Metabase Cloud instances with Metabase Cloud Storage
from accidentally breaking their upload configuration, since in this
scenario that is automatically managed by Metabase Cloud to use the
attached data warehouse.

== How to test ==

On a subscription with Metabase Cloud Storage:
* The "Uploads" section in the left sidebar of `/admin/settings` does
  not show
* A "not found" page is shown at `/admin/settings/uploads` where one
  would otherwise expect the "Uploads Settings" page
* `PUT /api/setting` with an `uploads-settings` field in the body fails
  with `403 Forbidden` and the setting is not changed
* `PUT /api/setting/uploads-settings` fails with `403 Forbidden` and
  the setting is not changed
* `GET /api/setting` contains an element with `key: "uploads-settings"`
  and a value
* `GET /api/setting/uploads-settings` responds with the value
* `GET /api/session/properties` contains the `uploads-settings` field

Closes: https://github.com/metabase/harbormaster/issues/5121
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2024-08-07 20:32:39 +02:00
Jeff Bruemmer
09de0eceac snowflake connection info (#46588) 2024-08-07 14:56:46 -03:00
github-automation-metabase
19397799a3 Add v0.50.19 to the list of releases (#46515)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-08-07 13:34:07 -04:00
Emmad Usmani
9eea034bb2 truncate total text in pie chart (#46466)
* truncate total text in pie chart

* add story

* Update Loki Snapshots

* add e2e test

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-08-07 09:10:53 -07:00
github-automation-metabase
fd2639077d Update Readme version references and published npm version to 0.1.27 (#46589) 2024-08-07 15:57:24 +00:00
Romeo Van Snick
527ec55390 Handle non-number cases in NumberFingerprint (#46579)
* Add unit test for #46574

* Handle non-numeric values in NumberFingerprint

* Be more realistic about NumberFingerprintDisplayInfo type

* Add comment on why the types are unknown
2024-08-07 15:53:20 +00:00
Chris Truter
7dd9fd5fa7 Protect against invalid file uploads (#46566) 2024-08-07 15:30:26 +00:00
Phoomparin Mano
4ce37a2516 feat(sdk): CLI to bootstrap an embedding-ready Metabase instance (#46080)
* add setup commands

* fix settings definition

* update environment variables for cli

* handle instances not being ready

* update error messages

* add more specific loading messages

* loading spinner state

* improve error message

* use a fixed demo setup token

* remove extraneous spinner

* update status checks

* update container messages

* update wait timing

* create api keys

* extract constants

* remove manual steps

* Add anonymous tracking + other things. will need to clean up

* Modify SDK for better structure

* remove line from print.ts

* Update webpack.embedding-sdk-cli.config.js back to production

* Add types and add quick note

* Fix a typo

* Add index file, simplify types, use an array

* Add safer json parsing

* use delay of 100ms between each setup call

* Suggestions from review

* ensure that cli works

* Attempt to fix jest errors

* Remove node-fetch from sdk code to hopefully get unit tests working again

* fix yarn.lock file

* revert capture groups change

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>
2024-08-07 22:24:33 +07:00
Ryan Laurie
33aa003a10 Generate better release logs for success (#46504)
* generate better release logs for success

* fix env

* fix env

* fix refname

* create invalidation

* remove test code
2024-08-07 09:00:14 -06:00
Uladzimir Havenchyk
63d029c763 e2e: add cypress-terminal-report (#46483)
* e2e: add cypress-terminal-report

* enable video recording

* revert error

* add a comment

* Update e2e/support/cypress.js

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

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2024-08-07 14:53:19 +00:00
Dennis Schridde
e97a8e7e93 Delete database using config file (#46437)
== Goal ==

Currently the config file (`MB_CONFIG_FILE_PATH`) only allows adding or
changing databases, but not removing them.  Since connected databases
can be managed as a service by us, it becomes necessary to delete any
information Metabase has about them, including any stored credentials.

Since this is a destructive operation with no way to revert (without
restoring from a backup), we raise the bar for accidental deletion and
require not just a (boolean) flag, but a magic string to be set.

== How to test ==

1. Configure a database as described in https://www.metabase.com/docs/latest/configuring-metabase/config-file#databases.
2. Start your Metabase instance.
3. Verify the database shows up in the "admin" section and it works.
   Create a dashboard and questions using the database.
4. Add a `delete: "DELETE_WITH_DEPENDENTS:${name}"` line to your
   database configuration section.
5. Restart your Metabase instance.
6. Verify the database no longer shows up in the "admin" section.
   Notice that questions using it are gone, too.

References: https://github.com/metabase/harbormaster/issues/5173
2024-08-07 16:52:48 +02:00
dpsutton
e5a3827ef7 Exclude javax.annotation/javax.annotation-api (#46546)
dep is brought in by google cloud

From `clj -X:deps tree :aliases '[:ee :drivers]'`

```
  . metabase/bigquery-cloud-sdk metabase/modules/drivers/bigquery-cloud-sdk
    . com.google.cloud/google-cloud-bigquery 2.38.1
      . com.google.cloud/google-cloud-core 2.35.0
      [...]
      . javax.annotation/javax.annotation-api 1.3.2
```

Before this change:

```
❯ clj -X:deps tree :aliases '[:ee :drivers]' | grep 'javax.annotation/javax.annotation-api'
      . javax.annotation/javax.annotation-api 1.3.2
```

After:

```
❯ clj -X:deps tree :aliases '[:ee :drivers]' > deps-master

❯ echo $?
0
```
2024-08-07 09:48:56 -05:00
Uladzimir Havenchyk
f4e6024c90 e2e: allow cypress to start with --browser=firefox passed (#46569) 2024-08-07 13:57:05 +00:00
Chris Truter
ba66cf3220 Consider the first 10 lines when inferring upload separator (#46321) 2024-08-07 13:36:38 +00:00
Raphael Krut-Landau
b9a7566f2c fix(webapp/browse): Fix e2e test of recently viewed models (#46568)
* fix(webapp/browse): Fix e2e test of recently viewed models

* Remove try/catch block from e2e config file
2024-08-07 13:39:21 +02:00
lbrdnk
582fa9ade6 Add relative-time-interval mbql function 2 (#46438)
* Add :relative-time-interval mbql function

* Add relativeDateFilterPartsRelativeTimeInterval

* Update display-name-method :relative-time-interval

* Update desugar-relative-time-interval

* Define relative-time-filter op

* Add or update tests

* Update tests

* Update display-name-method

* Update test

* Fix positive relative-time-interval shift

* Add checkins:1-per-day:60 dataset

* Update var name

* Bail out from optimization of relative-time-interval desugared filters

* Update dataset kondo hook

* Generate cache required for kondo hooks in kondo.sh

* Rename dataset
2024-08-07 11:36:41 +02:00
Raphael Krut-Landau
2d99a35387 fix(webapp/browse): Fix bug where verified filter is applied to recents even when no verified models exist (#46462) 2024-08-06 22:56:35 -04:00
Anton Kulyk
657abc0a96 Fix default viz settings are ignored when saving a question from raw table view (#46045)
* Add repro test

* Fix selectors and getSubmittableQuestion

* Add null check
2024-08-07 00:06:12 +00:00
Ryan Laurie
195e89f8a6 Allow edits to users with empty name fields (#46511)
* allow edits to uers with empty name fields

* add repro for 40750

* whoopsie
2024-08-06 17:01:19 -06:00
Nemanja Glumac
e122df47d3 MS1: Open notebook data source in new tab (#46228)
* WIP Open notebook data source in new tab

* WIP

* Implement the new functionality with `pickerInfo`

* Use destructured value

* Add the simplest possible E2E test as PoC

* Smoke test

* Add basic coverage for questions

* Add basic coverage for models

* Source question has been archived scenario

* Add basic permissions test

* Expand to the user without wite query permissions

* Fix title

* Add another permission scenario

* Add E2E coverage for a source being native

* Add coverage for the native model

* Address review comment re: `pickerInfo`

* Extract `getUrl` to utils

* Add support for the middle/scroll click

* Add unit tests

* Add a negative test case

* Fix title
2024-08-07 00:18:36 +02:00
Jeff Bruemmer
beda4b0c3d Add product categories to release notes (#46298) 2024-08-06 17:49:06 -04:00
metamben
d312a304f9 Support consuming question or model based metrics (#46356) 2024-08-07 00:42:15 +03:00
Uladzimir Havenchyk
b377285034 ci: do not save same m2 cache multiple times (#46545) 2024-08-07 00:04:53 +03:00
Alexander Polyankin
259f55ba70 Convert audit v2 column_settings to column names (#46460)
* Add column_settings migration

* Remove old getColumnKey

* Remove old getColumnKey

* Fix export

* Change comment

* Change comment

* Change comment

* Change comment

* Add RemoveFieldRefsFromDashboardCardColumnSettings

* fix

* chore

* chore

* chore

* chore

* chore

* chore

* chore

* chore

* chore

* chore

* chore

* Fix

* Fix

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* Update loki

* Update loki

* Fix the homepage dashboard being loaded everywhere

* Fix the homepage dashboard being loaded everywhere

* Fix tests

* Fix tests

* Fix tests

* Fixes

* Fix tests

* Fix tests

* Fix tests

* Fix

* Fix

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fixes

* Fix typo

* Fix types

* Improve migration performance

* Fixes

* Revert changes

* Revert changes

* Revert changes

* Revert changes

* Remove migration
2024-08-06 14:51:22 -04:00
Jeff Bruemmer
832aa96972 docs - add MariaDB page (#45763) 2024-08-06 18:48:31 +00:00
Alexander Polyankin
d3a515858a Support both name & field ref-based column keys in viz settings on read and upgrade on write (#46383) 2024-08-06 17:29:34 +00:00
dpsutton
ce61da58c8 Fix bad i18n string (#46454)
Fixes #46440

couple things come together here.

Bad escaping:
The `{` characters are used for format strings and placeholders like

```clojure
impl=> (translate "fr" "After {0}" ["Bob"])
"Après Bob"
```

And if you want _literal_ {'s in your translation string, you must
escape them like "'{" or "'}" using an apostrophe. But this isn't the
end of our worries.

in `resources/zh-CN.edn`, we actually have _two_ translations for the
original string:

```clojure
"User lookup filter. The placeholder '{login'} will be replaced by the user supplied login."
"用户找过滤器,占位符 '{login'} 将替换为用户提供的登录名。"

,,,

"User lookup filter. The placeholder '{login}' will be replaced by the user supplied login."
"用户查找筛选器。占位符“{login}”将替换为用户提供的登录名。"
```

And this later has unescaped curlies.

The fix for that is at
https://poeditor.com/projects/po_edit?per_page=20&id=200535&id_language=31&filter=&order=&search=User+lookup+filter
but will need to wait for the new source translation string in this
instance with the corrected escaping.

```clojure
;; simulate what happens at runtime
impl=> (translated-format-string "zh_CN"
                                 "User lookup filter. The placeholder '{login}' will be replaced by the user supplied login."
                                 {})
"用户查找筛选器。占位符“{login}”将替换为用户提供的登录名。"
impl=> (MessageFormat. *1 (locale "zh_CN"))
Execution error (NumberFormatException) at java.lang.NumberFormatException/forInputString (NumberFormatException.java:67).
For input string: "login"
;; the problematic zh-CN string
impl=> (MessageFormat. "用户查找筛选器。占位符“{login}”将替换为用户提供的登录名。")
Execution error (NumberFormatException) at java.lang.NumberFormatException/forInputString (NumberFormatException.java:67).
For input string: "login"
;; minimal reproduction
impl=> (MessageFormat. "“{login}”")
Execution error (NumberFormatException) at java.lang.NumberFormatException/forInputString (NumberFormatException.java:67).
For input string: "login"
```
2024-08-06 10:49:41 -05:00
Chris Truter
e2dfd06b14 Gracefully handle ignored errors during sync (#45968) 2024-08-06 18:24:04 +03:00
Raphael Krut-Landau
5e6ca94619 fix(browse/models): Correct the number of recently viewed models shown (#46487) 2024-08-06 11:05:10 -04:00
Uladzimir Havenchyk
1a803fb5dc ci: re-enable node cache to speedup initial yarn install (#45892) 2024-08-06 14:11:17 +00:00
Denis Berezin
22944e115f feat(sdk): Add storybook docs for embedding SDK e2e tests debug (#46496) 2024-08-06 15:55:00 +03:00
Oleksandr Yakushev
5ed7d786d3 chore: Load system-wide user.clj when REPL starts (#46514) 2024-08-06 10:05:09 +00:00
Chris Truter
97594871e9 Use message's query for async updates (#46508) 2024-08-06 09:11:14 +00:00
Oleksandr Yakushev
0d517c998f perf: Optimize validation with Malli (#46485)
* perf: Optimize validation

* Bump Malli version

* perf: Optimize validation
2024-08-06 10:54:15 +03:00
Oleksandr Yakushev
a792ca29d9 fix: Reduce bcrypt work factor when running tests (#45315) 2024-08-05 22:14:41 +00:00
Ngoc Khuat
3c4a1ce35f Remove uncessary db calls when updating card (#46480) 2024-08-05 21:49:41 +00:00
Uladzimir Havenchyk
741ae589a3 ci: enable video recordings for failing cypress tests (#46281) 2024-08-06 00:32:02 +03:00
Case Nelson
d5601723b4 fix: mongo ObjectId should be orderable (#46501)
* fix: mongo ObjectId should be orderable

Fixes #46259

Mongo ObjectId derive :type/TextLike but that can't be an orderable
type, so we mark the specific Mongo type as orderable for malli schemas.

* Fix test
2024-08-05 19:15:16 +00:00
Sloan Sparger
46dc7687f9 [Bug Fix] Items can be dragged from the Trash into the Trash (#46389)
* prevents users from moving items to the trash if they are in the trash already and archives instead of moves in cases where item is moved to or from the trash

* reverts detecting if dragging in or out of the trash not setting the collection id, this will be prevented on the BE instead

* adds test coverage for dragging and dropping items to/from/within the trash (one of which is failing until we can make a BE change)

* Throw away `collection_id` when marking archived

This is a hack around a frontend issue. Apparently, the undo
functionality depends on calculating a diff between the current state
and the previous state. Sometimes this results in the frontend telling
us to *both* mark an item as archived *and* "move" it to the Trash.

Let's just say that if you're marking something as archived, we throw
away any `collection_id` you passed in along with it.

---------

Co-authored-by: John Swanson <john.swanson@metabase.com>
2024-08-05 11:01:57 -05:00
Ryan Laurie
c810c38de0 Fix auto release schedule off by one (#46469) 2024-08-05 08:36:35 -06:00
Alexander Solovyov
64dbaa13ea fix db switching in ts/with-dbs (#46481)
mt/with-temp opens transaction which is used by toucan to make requests, so `mt/with-db` had no impact on database used inside of mt/with-temp
2024-08-05 14:21:53 +00:00
Chris Truter
39bb33ec4c Various hardenings for SQL analysis (#46432)
### Description

This change should fix some explosions in stats due to phantom fields, while also making things a bit more rigorous.

- Record the table schema in query_field - especially useful for unknown tables
- Allow null table names in query_field - they might be phantoms, or they might not
  - We still have the option to filter them out in tools we build on top
- Tighten up matching logic to consider schema
2024-08-05 15:46:28 +02:00
Mahatthana (Kelvin) Nomsawadi
3d5233bc6a [Milestone 2] Re-design transparent theme for static embedding and public links (#46428)
* Update popover dark theme on part of ParameterFieldWidget (#45813)

* Add filter visual tests

* Simplify embed CSS colors

* [WIP] theme filter popover

* Move theme to global node, so it affects portal too

* Fix embed colors

* Theme part of ParameterFieldWidget

* Add story for parameter with dropdown

* Update loki snapshots

* Update more popover style

* Update loki snapshots

* Remove outdated snapshots

* Update loki snapshots with production build

* Fix loki not working with `userEvent`

* Theme mantine popover

* Improve dark theme text-brand visibility

* Update loki snapshots from master change

* Fix new colors not working in SDK

* Fix flaky Loki tests

* Filter popover dark theme part 2 (#46284)

* Theme Date all options

* wip add month and year filter

* Fix wrong CSS custom property declaration

* Test hover state

* Update Loki snapshots

* Theme date month and year

* Add quarter and year tests

* Theme date single and date range

* Style relative date

* Update frontend/src/metabase/admin/datamodel/components/filters/pickers/DatePicker/DatePickerHeader.styled.tsx

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

---------

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

* Complete theming filter popover night mode (#46365)

* Style unit of time and number widget

* Attempt to fix flaky Loki snapshots

* Address white background checkbox on dark theme

* Style search filter single value

* Fix mis color

* Update snapshots

* Remove duplication on play functions since they're long

* Milestone 2 polishing (#46382)

* Matches the footer padding with header padding

* Update snapshots

* Add E2E to prevent further problem

* Try to reduce flaky Loki tests

* Remove unused color shades (#46421)

* Update no results illustration to work better on dark theme

* Update loki snapshots

---------

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2024-08-05 10:20:34 +00:00
Kamil Mielnik
a05452ef2e "Reset all filters" button (#46322)
* Refactor dashboard helpers to TypeScript

* Reuse existing helper

* Refactor cy.createQuestionAndDashboard to a function helper
- there was no good place to put it, so I also created new helpers/api directory
- and I moved all helpers using cy.request (with 1 exception, where a CSV download helper also does a bunch of assertions) in there

* Merge TS command definitions into a single file

* Export types

* Make dashboardDetails optional

* Export StructuredQuestionDetails

* Remove duplicated function

* Extract createNativeQuestion to separate file
- 1 exported helper per file, no exceptions!

* Reuse const

* Add test for unit of time parameters

* Improve assertions

* Extract createDashboardWithParameters

* Add tests for time parameters

* Fix hardcoded parameter_mappings ids

* Format code

* Extract checkButtonVisible

* Improve test names

* Add tests for location parameters

* Reuse const

* Update test name

* Add WidgetStatusButton

* Add unit tests for WidgetStatusButton

* Rename handler

* Remove redundant assertions

* Add iconSize prop

* Fix styling

* Replace WidgetStatusIcon with WidgetStatusButton
- Remove WidgetStatusIcon

* Fix tooltip issue

* Fix tooltip for good

* Use default compact button size

* Prevent overflow

* Fix alignment issues in parameter sidebar
- Remove iconSize prop
- Simplify StatusConfig

* Update padding in Unit of Time input to make it consistent with other inputs in dashboard parameter sidebar

* Update unit tests

* Rename WidgetStatusButton to WidgetStatus

* Explicitly specify what is a button

* Update helpers in tests

* Update when buttons are displayed according to the new spec, update tests

* Simplify label

* Remove utils

* Adjust padding

* Update reset icon

* Make the button gray when color is undesired

* Remove old definitions

* Add missing export

* Remove unused type

* Add test for location (single value)

* Add test for id (single value)

* Add more assertions

* Add test for id (multiple values)

* Improve name

* Add tests for number (single and multi value)

* Add tests for text (single and multi value)

* Rename file

* Update comment

* Update test name

* Use unique ids

* Use new color name

* Add a test for chevron icons alignment

* Lift className up

* Make types more specific

* Sort attributes

* Revert "Make types more specific"

This reverts commit 2e6994b5ed.

* Revert "Use new color name"

This reverts commit 2cc68df6ba.

* Remove TODO

* Introduce editFilter util, refactor chevron assertions to work with any number of chevrons

* Connect label to the default value input in ParameterSettings

* Add a whitespace in the default value label when required "(required)" is shown

* Add parameter sidebar tests for unit of time

* Add parameter sidebar tests for date filters

* Extract checkParameterSidebarDefaultValue

* Add parameter sidebar tests for location - single values

* Add parameter sidebar tests for location - multiple values

* Use constants for test case names

* Add parameter sidebar tests for id parameters - single values

* Add parameter sidebar tests for id parameters - multi values

* Add parameter sidebar tests for number parameters - single values

* Add parameter sidebar tests for number parameters - multi values

* Add parameter sidebar tests for text parameters - single values

* Add parameter sidebar tests for text parameters - multi values

* Extract checkDashboardFilters

* Use checkDashboardFilters in time parameters

* Use checkParameterSidebarDefaultValue in checkDashboardFilters

* Use checkDashboardFilters everywhere

* Sort helpers

* Rename checkDashboardFilters to checkDashboardParameters

* Rename checkOnlyOneButtonVisible to checkStatusIcon

* Add test suite for sql filters, coverage for text filter - single value

* Add a whitespace in the default value label when required "(required)" is shown - SQL filters
- Similar to 930dd3a50a

* Add test suite for sql filters, coverage for number filters

* Add test for sql filters - date

* Remove unused things, rename placeholder to labelOrPlaceholder

* Apply label only to 1 input

* Add test for sql filters - field parameters

* Fix date tests

* Make all sql filters tests work

* Add assertions for required without default in text filters

* Add assertions for required without default in date filters

* Add assertions for required without default in field filters

* Allow clearing required SQL filters without default value

* Add a test to ensure comma-separated numeric values work

* Update unit test

* Update helper

* Update e2e tests

* Use != null and == null checks with defaultValue instead of just checking if its truthy/falsy

* Run `yarn test-visual:loki` and then `yarn loki approve`
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069

* Add button boilerplate

* Add getCanResetFilters selector

* Move canResetFilters to utils

* Add explicit return types

* Implement the button action

* Rename

* Simplify action

* Optimize: use single action

* Use parameterHasNoDisplayValue to account for empty strings

* Run `yarn test-visual:loki` and then `yarn loki approve` after merging master
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069

* Rename getHiddenParameterSlugs to getTabHiddenParameterSlugs

* Take all tabs into account

* Add unit tests for canResetFilter

* Format test name

* Fix non-human-friendly aria-label

* Add assertions for "Reset all filters" button's visibility

* Unnest helpers from describe

* Add a test for comma-separated values

* Improve typing

* Fix typing

* Add tests for multiple tabs and auto-apply-filters on/off

* Improve test name

* Remove redundant util

* Remove redundant condition

* Verify card results get filtered

* Test that all tabs are affected

* Fix test case with autoApplyFilters: false

* Add tests for resetting to default value

* Fix wrong initial state in reduce

* Fix updated parameters not being applied

* Add reset all filters assertions

* Remove unused attribute

* Run `yarn test-visual:loki` and then `yarn loki approve`
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069

* Run `yarn test-visual:loki` and then `yarn loki approve`
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069
2024-08-05 09:18:48 +00:00
Kamil Mielnik
35d9a8177e Update "Clear" and "Reset" buttons (#46050)
* Refactor dashboard helpers to TypeScript

* Reuse existing helper

* Refactor cy.createQuestionAndDashboard to a function helper
- there was no good place to put it, so I also created new helpers/api directory
- and I moved all helpers using cy.request (with 1 exception, where a CSV download helper also does a bunch of assertions) in there

* Merge TS command definitions into a single file

* Export types

* Make dashboardDetails optional

* Export StructuredQuestionDetails

* Remove duplicated function

* Extract createNativeQuestion to separate file
- 1 exported helper per file, no exceptions!

* Reuse const

* Add test for unit of time parameters

* Improve assertions

* Extract createDashboardWithParameters

* Add tests for time parameters

* Fix hardcoded parameter_mappings ids

* Format code

* Extract checkButtonVisible

* Improve test names

* Add tests for location parameters

* Reuse const

* Update test name

* Add WidgetStatusButton

* Add unit tests for WidgetStatusButton

* Rename handler

* Remove redundant assertions

* Add iconSize prop

* Fix styling

* Replace WidgetStatusIcon with WidgetStatusButton
- Remove WidgetStatusIcon

* Fix tooltip issue

* Fix tooltip for good

* Use default compact button size

* Prevent overflow

* Fix alignment issues in parameter sidebar
- Remove iconSize prop
- Simplify StatusConfig

* Update padding in Unit of Time input to make it consistent with other inputs in dashboard parameter sidebar

* Update unit tests

* Rename WidgetStatusButton to WidgetStatus

* Explicitly specify what is a button

* Update helpers in tests

* Update when buttons are displayed according to the new spec, update tests

* Simplify label

* Remove utils

* Adjust padding

* Update reset icon

* Make the button gray when color is undesired

* Remove old definitions

* Add missing export

* Remove unused type

* Add test for location (single value)

* Add test for id (single value)

* Add more assertions

* Add test for id (multiple values)

* Improve name

* Add tests for number (single and multi value)

* Add tests for text (single and multi value)

* Rename file

* Update comment

* Update test name

* Use unique ids

* Use new color name

* Add a test for chevron icons alignment

* Lift className up

* Make types more specific

* Sort attributes

* Revert "Make types more specific"

This reverts commit 2e6994b5ed.

* Revert "Use new color name"

This reverts commit 2cc68df6ba.

* Remove TODO

* Introduce editFilter util, refactor chevron assertions to work with any number of chevrons

* Connect label to the default value input in ParameterSettings

* Add a whitespace in the default value label when required "(required)" is shown

* Add parameter sidebar tests for unit of time

* Add parameter sidebar tests for date filters

* Extract checkParameterSidebarDefaultValue

* Add parameter sidebar tests for location - single values

* Add parameter sidebar tests for location - multiple values

* Use constants for test case names

* Add parameter sidebar tests for id parameters - single values

* Add parameter sidebar tests for id parameters - multi values

* Add parameter sidebar tests for number parameters - single values

* Add parameter sidebar tests for number parameters - multi values

* Add parameter sidebar tests for text parameters - single values

* Add parameter sidebar tests for text parameters - multi values

* Extract checkDashboardFilters

* Use checkDashboardFilters in time parameters

* Use checkParameterSidebarDefaultValue in checkDashboardFilters

* Use checkDashboardFilters everywhere

* Sort helpers

* Rename checkDashboardFilters to checkDashboardParameters

* Rename checkOnlyOneButtonVisible to checkStatusIcon

* Add test suite for sql filters, coverage for text filter - single value

* Add a whitespace in the default value label when required "(required)" is shown - SQL filters
- Similar to 930dd3a50a

* Add test suite for sql filters, coverage for number filters

* Add test for sql filters - date

* Remove unused things, rename placeholder to labelOrPlaceholder

* Apply label only to 1 input

* Add test for sql filters - field parameters

* Fix date tests

* Make all sql filters tests work

* Add assertions for required without default in text filters

* Add assertions for required without default in date filters

* Add assertions for required without default in field filters

* Allow clearing required SQL filters without default value

* Add a test to ensure comma-separated numeric values work

* Update unit test

* Update helper

* Update e2e tests

* Use != null and == null checks with defaultValue instead of just checking if its truthy/falsy

* Run `yarn test-visual:loki` and then `yarn loki approve`
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069

* Use parameterHasNoDisplayValue to account for empty strings

* Run `yarn test-visual:loki` and then `yarn loki approve` after merging master
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069

* Run `yarn test-visual:loki` and then `yarn loki approve`
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069

* Run `yarn test-visual:loki` and then `yarn loki approve`
- see https://metaboat.slack.com/archives/C505ZNNH4/p1721289287037069
2024-08-05 15:48:04 +07:00
Romeo Van Snick
019fb467d6 Custom labels for number parameter (#44230)
* Make number also have custom parameter values

* Render the correct label in the dropdown for number inputs

* Mock paramter values endpoint in number input test

* Add test for custom labels on number input

* Fix number input test

* Allow entering comma separated values using labels

* Only show custom labels in popover

* Use getLabel and getValue helpers to avoid indexing confusion

* Remove calls to parameter endpoints for number input

* Do not parse the value from the label

* Add support for number parameters in the source picker modal

* Filter number values

* Add e2e test for number parameters with custom source

* Remove card option for number parameters

* Set the correct initial value for number parameters without fields

* Do not render number parameter as search box when it is a list

* Fix e2e tests for number lists

* Remove e2e tests for card source dashboard filters

* Add tests for native filter custom source

* Show the dropdown when picking the default value for number parameters

* Clear values_source_config when changing parameter type

* Restore a parameters' values_source_config when changing the parameter type back

* Clear and restore values_source_config for template tags when chaning type

* Add e2e test for restoring of template tag sources_value_config

* Add e2e test for clear and restore of static-list for dashboard parameters

* Fix input type for numbers

* Fix broken test

* Display labels for ParameterValuePicker too

* Clear and restore values_source_type when changing parameter type

* Clear and restore values_source_type for tag parameters

* Clear and restore values_query_type when changing parameter type

* Clear and restore value_query_type for parameters tags

* Update tests to test for reset to also apply to values_source_config and values_query_type
2024-08-05 09:23:47 +02:00
Emmad Usmani
6eaff50e3f add both option for pie chart percentages (#46399)
* add both option for pie chart percentages

* create story snapshot
2024-08-05 05:53:11 +00:00
Radosław Kotkiewicz
d71cb6e6cb expose MB_DB_QUERY_TIMEOUT_MINUTES setting (#44759) 2024-08-04 17:25:03 +02:00
Emmad Usmani
5edfd8ac97 add pie.decimal_places setting (#46397)
* add pie.decimal_places setting

* add unit spec

* add stories

* Update Loki Snapshots

* add placeholder text

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-08-02 15:46:05 -07:00
Aleksandr Lesnenko
cffca8af58 fix missing horizontal scroll on pivot tables (#46400)
* fix pivot table missing horizontal scroll

* spec

* Update Loki Snapshots

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-08-02 18:44:14 -04:00
Ryan Laurie
c924c38e2f test(sdk) Update the Query Editor Button (#46097)
* YOLO

* fix a lot of tests

* fix more tests

* fix unit tests

* remove comment

* update tests and formatting

* add debug code

* remove debug code
2024-08-02 16:18:48 -06:00
Sloan Sparger
fab23e52be [Permissions] Fix advanced permissions edits not always saving #46453 2024-08-02 17:06:33 -05:00
Raphael Krut-Landau
9c8168a20e fix: In delayed error/loading wrapper, on error, display the error (#46395) 2024-08-02 17:14:38 -04:00
Raphael Krut-Landau
1df7e96518 Remove global css module that was applying red borders (#40112) 2024-08-02 16:23:27 -04:00
Alexander Polyankin
b9354860eb Perf fix for card metadata in QP (#46443) 2024-08-02 19:36:44 +00:00
Sloan Sparger
1d27703540 [Auto Clean-up] Clean-up modal (#44512)
* wip

* moves code to enterprise folder, adds enterprise guards, updates conditionals as to when to show the feature

* impls filter date logic, improves styling, mocks out real endpoint with collection items endpoint, updates table with isLink boolean rath
er than using custom item renderer, removes dead code

* use the actual url for stale

* so many things... updated design, custom table component, polish, misc. refactors, more correct api typing

* updates to pagination component and reverts some now unused changes to the base items table

* impls pr feedback

* fixes

* fixes failing unit test

* completes pr feedback from raffi

* implements second round of feedback from raffi

* adds tests and couple of small fixes / feedback

* migrate clean up action to enterprise plugin and fix related e2e test, also skip the collection items count query when we do not need the value

* finish main base case e2e test

* clean up helper code for manual testing and add OSS test to make sure feature is not available in OSS

* better handling of min-height on smaller screens

* adds internal undo notification for bulk archiving in the clean up modal

* reset pagination when items are archived/unarchived to keep users from getting stuck on a page beyond the current view

* pr feedback

* further cleanup

* unit test fix

* fixes issue where archiving all items in the modal and then undoing does not result in the stale items list getting refetched

---------

Co-authored-by: John Swanson <john.swanson@metabase.com>
2024-08-02 14:10:07 -05:00
Emmad Usmani
5b109bdbeb fix flaking tab reorder e2e test (#46455) 2024-08-02 12:09:14 -07:00
Ryan Laurie
b0fa8500de test(sdk) Don't show notebook toggle button for brand new questions (#46350)
* hide notebook button for brand new questions

* test notebook button visibility for new questions

* move brand new check inside shouldRender

* test embedding SDK notebook button

* update unit tests

* add spy to shouldRender
2024-08-02 19:07:59 +00:00
John Swanson
7e826d723e Fix coll permissions for audit collection (#46351)
* Fix coll permissions for audit collection

We've had a function in `models.collection` for a while that has taken a
permissions set and returned a set of collection IDs that the user has
permissions on. I refactored this recently, but didn't notice that it
was actually doing the permissions checks slightly incorrectly.
Specifically, because it only looks at the user's permissions and the
collection IDs and doesn't use `mi/can-read?` or `mi/can-write?`, it's
completely indifferent to whether a collection is an audit collection or
not.

This is arguably not a *permissions* issue: the two errors that could
come about here are:

- someone sees the audit collection even though the audit feature is
disabled, or

- someone is presented with the audit collection in a context where only
writable collections should be present - when they try to actually write
to it, it fails (since then we're doing the real permissions check).

The primary motivation for this fix was to prevent audit dashboards and
cards from appearing in the list of stale items.

* Fix hardcoded collection ID

We were creating a timeline in a fixed collection ID, that in tests
happened to be the ID of the Metabase Analytics collection.
2024-08-02 09:43:09 -08:00
lbrdnk
b4b8f6e963 Avoid sorting by missing aggregation reference (#46386)
* Update values-from-card-query

* Add test

* Update values-from-card-query

* Add missing issue no
2024-08-02 19:24:00 +02:00
Ryan Laurie
1c7de429b0 Properly handle SMTP Settings environment variables (#46302)
* properly handle SMTP environment variables

* disable clear button when set by env var

* allow the SMTP form to validate with any combination of environment variables

* add unit tests for SMTP connection form

* BONUS: fix console error for jt keys

* fix types
2024-08-02 11:21:56 -06:00
github-automation-metabase
69588cffea Update Readme version references and published npm version to 0.1.26 (#46447) 2024-08-02 16:24:41 +00:00
Jeff Bruemmer
8d621e0b01 remove reference to Google Analytics (#46445) 2024-08-02 12:23:50 -04:00
Jeff Bruemmer
da92a622e5 docs - various link fixes (#46441)
* link fixes

* more links
2024-08-02 17:57:36 +02:00
Uladzimir Havenchyk
6abe4bb8e9 test: do not allow cypress to raise an error on timeline hover (#46230)
* do not update size if width or height is 0

* add a comment
2024-08-02 18:48:35 +03:00
Alexander Solovyov
2512d29a37 [xray] separate limits for max cards in section and max total cards (#46436) 2024-08-02 15:32:44 +00:00
Nicolò Pretto
07bc6afa9d update the UI of the downloads toggle to make it look like the others… (#46409)
* update the UI of the downloads toggle to make it look like the others in the page

* make unit tests pass

* make e2e pass
2024-08-02 16:50:15 +02:00
Sloan Sparger
5607dc9c6c [Permissions] Update ordering of create query permissions options (#46391)
* updates the ordering of create queries permissions options so that granular permissions is the last option

* fix unit test

* move granular option above no
2024-08-02 09:31:15 -05:00
Nicolò Pretto
c08b85cf98 Embed downloads ms3 - analytics (#46335)
* update static_embed_code_copied to use downloads (#45944)

* copy schema file for better diff

* adds downloads field to appearance in embed_flow schema

* update event to send `downloads` parameter, update e2e tests

* fix test for dwonloads: false

* fix: use correct schema version for embed flow analytics (#46053)

* update `dashboard_pdf_exported` and use it in embedding context (#46076)

* copy schema for better diff

* adds `dashboard_accessed_via` to the `dashboard_pdf_exported` event

* download_results_clicked event (#46132)

* adds download_results_clicked event + e2e tests

* make strings nullable

* adds maxLength

* switch back to if/then as it seems more readable

* refactor: use the resourceType to determine the download params instead of re-doing the logic

* fix ''question' is possibly 'undefined'.'

* split resource_type into resource_type and accessed_via to also consider interactive-embedding and sdk

* edit comment

* adds test for ad-hoc-question

* Update frontend/src/metabase/query_builder/actions/downloading.ts

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

* makes describe message more consistent

* "else if" => if

* fix describe block name

* convert downloads event to use enum for download_type and export_type

* resource_type should be an enum too

* fix line added in the wrong place during merges

---------

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

* Update frontend/src/metabase/public/components/EmbedFrame/EmbedFrame.tsx

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

* adds enum schema to dashboard_accessed_via

* fix accessed_via for sdk embeds

* update comments to explain why we send 0 when dashboardId is null

* only send dashboard_id as a number when it is a number, as expected by snowplow

* remove un-needed async/await from saveAsPDF function

* rename frontend/src/metabase/redux/downloading-analytics.ts -> frontend/src/metabase/redux/downloads-analytics.ts

* fix cy.log message

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-08-02 16:16:19 +02:00
John Swanson
2c7d0cf146 Revert "Preprocess queries before data perms check (#45601)" (#46429)
This reverts commit c7a5aee1f8.
2024-08-02 13:38:23 +00:00
Noah Moss
002238217a Add extra geojson content type (#46427) 2024-08-02 13:37:23 +00:00
Chris Truter
5ba895be36 Tighten up queue test (#46420) 2024-08-02 12:58:44 +00:00
Nicolò Pretto
3108d9fed1 fix low contrast on night theme embed frame "Export as pdf" (#46288)
* update embed frame pdf button colors to use --mb-color- vars

* change download pdf button color to brand color

* testing adding the images that actually differ
2024-08-02 14:56:14 +02:00
Jeff Bruemmer
d81c74b822 add note about locked parameters (#46392) 2024-08-02 08:40:58 -04:00
Roman Abdulmanov
0b3d8d6dee Added another webhook (#46414) 2024-08-02 11:51:03 +00:00
Ngoc Khuat
9f1cbc3c79 Reduce memory usage when sending anon stat (#46404) 2024-08-02 16:29:02 +07:00
Chris Truter
979897ebbc Fix log formatting for query analyzer (#46410) 2024-08-02 09:14:06 +00:00
Alexander Solovyov
49e6dbdfe3 [serdes] http api: be more picky about files we unpack from an archive (#46362)
Previously we unpacked everything and picked up first entry as the directory
containing the data. This works well when archives are passed as is. However,
if a user unpacks and then packs an archive, there is a good chance that some
hidden directories will appear - and they are first in order.

So we skip those right now, and additionally check known markers of the
serialization data directory.
2024-08-02 10:29:31 +03:00
Nemanja Glumac
32b7af2747 e2e: Remove flaky tag from timeseries question with a goal test in alert-types spec (#46367) 2024-08-02 09:07:57 +02:00
Emmad Usmani
a5cd7d04b8 fix viz settings not persisted during question edit (#46308)
* fix lost settings

* add e2e test

* trigger ci
2024-08-01 22:37:27 -04:00
Emmad Usmani
cd6cadf007 fix pie slice border missing in backend static viz (#46384)
* fix pie border missing in batik static viz

* refactor args

* fix typo
2024-08-01 18:38:10 +00:00
Ryan Laurie
db8f114f6e fix db connection form icons (#46290)
* fix db connection form icons

* fix db connection form icons

* appease typescript
2024-08-01 12:22:17 -06:00
Oreon Lothamer
67cca0771e change pr-env conditional (#46352) 2024-08-01 08:17:48 -10:00
lbrdnk
07648603d2 Avoid adding temporal-unit to lhs cols (#46262)
* Avoid adding temporal-unit to lhs cols

* Use :default temporal-unit

* Simplify logic, update comments

* Update substitute-field-filter-test

* Update align-temporal-unit-with-param-type-test

* Update field-filter-date-test

* Use end-excludding gte lt filter for DateTime fields

* Update substitute-field-filter-test

* Update align-temporal-unit-with-param-type-test

* Update field-filter-date-test

* Update bigquery test + comment

* Update date-str->qp-aware-offset-dt

* Add guard for unexpected date string format

This is just for the completeness, I haven't encountered it.

* Address review remarks

* Update comment
2024-08-01 20:16:37 +02:00
Nick Fitzpatrick
5b4fe7cd3f Permissions modal dismiss patch (#46381)
* dismiss permissions modal regardless of network request

* Spelling is hard
2024-08-01 14:23:02 -03:00
Ryan Laurie
acea9a2979 Automatic Nightly Patch Releases (#46254)
* add auto-release patch job

* better error handling

* update schedule

* address review feedback
2024-08-01 10:35:34 -06:00
Chris Truter
8005283add Detect queries referencing unknown tables (#46185)
* Squash

* Clean up query modifier for validating card references (#46283)

* Fixup bad git merge on test expectation

* Tweak docstrings and de-densify logic
2024-08-01 16:17:02 +02:00
lbrdnk
ae63a13cc1 Revert "Add :relative-time-interval mbql function (#46211)" (#46370)
This reverts commit 72a201819b.
2024-08-01 14:11:14 +00:00
github-automation-metabase
f92e056942 Add v0.49.22 to the list of releases (#46355)
* Add v0.49.22 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-08-01 09:35:32 -04:00
lbrdnk
72a201819b Add :relative-time-interval mbql function (#46211)
* Add :relative-time-interval mbql function

* Add relativeDateFilterPartsRelativeTimeInterval

* Update display-name-method :relative-time-interval

* Update desugar-relative-time-interval

* Define relative-time-filter op

* Add or update tests

* Update tests

* Update display-name-method

* Update test

* Fix positive relative-time-interval shift
2024-08-01 11:12:14 +02:00
Ngoc Khuat
683faf64e9 Fix x-ray generate invalid query for table with Date column (#46317) 2024-08-01 06:34:52 +00:00
Emmad Usmani
bfc6838a7b fix pie chart total graphic not being removed (#46349)
* fix pie chart total graphic not being removed

* add e2e test
2024-07-31 21:58:25 +00:00
John Swanson
c4196d99fb Some improvements to the REST API for query field validation (#46024)
* Allow filtering on collection

* Add `effective_ancestors` to collection data

Note: I removed the `qv=` comparator. I think it'.s better to be more explicit
about what exactly we're asserting. In particular, I hadn't updated the
`:count` when we were filtering on collection type, so the count was
still the total for *every* collection even though the results were being
restricted by the collection. However the `qv=-data` function was still
reporting that everything was OK, because it was accounting for other
data from the App DB by just asserting that the count we'd specified was
lower than the actual count. I'd argue it's better for tests to fail
locally because I have garbage in my app DB (which I can clean up) than
succeed when they really shouldn't.

* Consolidate effective ancestors

For the Search API, we're currently returning slightly different
ancestors:

- it never has the Root Collection, and

- the ancestors don't have a `personal_owner_id`

We could change the API (and maybe will soon - it seems pretty
unexpected to have `effective_ancestors` sometimes act one way and
sometimes act another) but for now we can just reshape things to look
the same as they did before, while using the same code under the hood.
2024-07-31 11:28:02 -08:00
Gustavo Saiani
58d7b2ca84 Update links to Learn section of metabase.com (#46336) 2024-07-31 15:04:19 -03:00
Noah Moss
d55b6a313c SCIM feature branch (#44243)
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
2024-07-31 13:45:02 -04:00
Emmad Usmani
4ec1fd883f migrate pie chart to echarts (#43555)
* echarts pie

* setup rendering pipeline for static pie chart (#43547)

* setup rendering pipeline for static pie chart

* remove more donut code from BE

* compute viz settings for static pie chart (#43548)

* compute viz settings for static pie chart

* create chartModel for pie chart (#43549)

* create chartModel for pie chart

* render static pie chart (#43550)

* render static pie chart

* render static pie chart legend (#43551)

* disable animation

* alter static-viz pie chart be tests to account for echarts-impl

The old implementation had a different implementation for legends, separate from the 'categorical/donut' js
render. Echarts nicely combines the legend into the pie render, so we don't need to worry about that stuff anymore.

Instead, I've written a simple set of assertions on the echarts pie implementation now.

* Get rid of this test that was attempting to use old code path

* echarts pie

* One last spot where we don't need old pie stuff anymore.

* add loki specs

* save snapshots

* fix small slices disappearing

* update snapshots

* add repro story for exteremely small slice

* add snapshot

* fix rounded total

* fix percent formatting in legend

* fix date dimension formatting

* fix binned and relative date dimension labels on legend

* add specs and snapshots for null and unaggregated dimensions

* hide overlaping labels on chart

* fix null dimension color

* show error when metric column has a negative value

* move legend to botom

* make dot margin smaller

* add columns to legend

* sort legend vertically

* dont use grid if only one row for legend

* never hide legend in static viz

* fix empty column culling

* show single legend item

* add long dimension name story

* fix long dimension name in legend

* right justify percentages in legend

* remove negative error and re-add stories

* handle negative values

* create chart definition for dynamic pie chart

* render chart with responsiveness

* add comment for borderWidth calculation

* center legend

* fix legend centering

* add story for missing currency formatting

* fix missing currency formatting

* fix graalvm crashing

* fix column settings computation

* add another currency formatting repro

* fix wrong order of col settings computations

* convert colors to hex

* fix colors missing from viz settings

* temp todo comment

* fix colors in dynamic viz

* update snapshots

* fix crashing due to invalid dimension/metric setting

* fix chart crashing for boolean dimension with labels on chart

* add repro

* fix regression in label formatting

* fix labels on small slices

* update specs

* emphasis state for slice hover

* recreate old label hiding logic

* include height measurement in getIsLabelVisible

* move d3 slices to chart model

* fix labels on static viz

* wip basic hover state and tooltip

* fix emphasis style getting stuck by memoizing everything

* update total display value

* fix stuck emphasis by setting notMerge to false for pie only

* handle other slice in tooltip

* fix bugs in total graphic

* use OTHER_SLICE_KEY const in static viz legend

* implement legend and connect to hover state

* implement click actions

* fix slice not clickable

* handle all zero slices

* add repro

* update specs

* update pie_chart.cy.spec.js

* update chart_drill.cy.spec.js

* add repro for single column legend

* use minimum 2 legend columns

* fix legend text overlap

* use more margin for single row legend

* update specs

* add repro for 28568

* add repro for 38424

* fix percent label not showing on large slices

* hide total text when chart is small

* replace comment about animations

* show warning for mixed positive and negative values

* delete old chart files

* fix type errors

* update d3 import

* update specs

* remove branch from uberjar.yml

* dont put single slice into other

* fix lint errors and pie render test

* update more d3 imports

* remove unused settings

* revert preview-card-width change

* remove unused import

* remove majorWidth option from formatting

* use debounceLeading refresh mode in ChartWithLegend

* remove TOTAL_GRAPHIC_OPTION constant

* delete unit test for pie chart

* fix failing test by doing set comparison instead

* fix typo in comment

* remove SUNBURST_SERIES_OPTION constant

* fix lint by removing unused eslint-disable

* move default color computation to getValue

* fix static pie test to show that we will always render the legend

* update pie border color for night mode and embedding

* fix styles for embedding case and add stories

* skip embedding stories

---------

Co-authored-by: Adam James <adam.vermeer2@gmail.com>
2024-07-31 17:11:55 +00:00
adam-james
e8d5dac2ca Quick Followup to Pull #45691 (#46286)
Since I set auto-merge to #45691, I missed some bits of review feedback.
Luckily, nothing was blocking, so these are small readability/docs changes
2024-07-31 08:56:15 -07:00
Raphael Krut-Landau
3bf08eadda fix(webapp/browse): Use user locale if available in Browse models (#45914) 2024-07-31 10:03:57 -04:00
Uladzimir Havenchyk
9f6d99b5e0 dx: drop eslint-loader (#46279)
* cleanup webpack config

* drop eslint-loader
2024-07-31 16:11:06 +03:00
Jeff Bruemmer
d9eb14e8c3 update firefox link (#46330) 2024-07-31 14:59:06 +02:00
Alex Yarosh
e33c21ff4c docs: import clarification (#46328) 2024-07-31 08:51:33 -04:00
Uladzimir Havenchyk
5b8e1fb2d0 test: reduce flakiness by waiting longer for loader to disappear (#46320) 2024-07-31 15:12:05 +03:00
github-automation-metabase
052d75f0bb Add v0.50.18 to the list of releases (#46304)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-07-31 08:00:17 -04:00
Jeff Bruemmer
498db82c35 correct tar command (#46299) 2024-07-31 07:56:51 -04:00
Alexander Solovyov
fed8a1f244 make search results filterable by concrete ids (#46276) 2024-07-31 14:54:07 +03:00
Uladzimir Havenchyk
8ad5011b66 dx: cleanup webpack config (#45902) 2024-07-31 11:53:34 +00:00
Ngoc Khuat
200541d5ab Fix sync indexes mark all fields with same name as indexed if one of them is (#46313) 2024-07-31 07:27:34 +00:00
github-actions[bot]
e2086b2f73 Update Translations for v50.16 (#46015)
* Add new strings for v50.15

* import updated translations

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
2024-07-30 22:22:17 +00:00
Oreon Lothamer
d41071987b Don't create PR Env on external PRs (#46301)
* don't run pr envs on external
2024-07-30 11:23:48 -10:00
Nick Fitzpatrick
e62aaa1e52 Show error when geojson coordinates are outside lat/lng bounds (#46064) 2024-07-30 16:44:50 -03:00
Alexander Polyankin
e12323976c Pass parameter values as JSON (#46250) 2024-07-30 16:29:42 +00:00
John Swanson
cbbcf4c872 Add an API to get stale dashboards and cards (#44711)
* Make an internal API for retrieving stale content

This introduces the `metabase.stale` module, which has one public
function (so far): `metabase.stale/find-candidates`. This takes a set of
`collection-ids`, a cutoff date, and pagination/sort info.

Next, we introduce an HTTP API endpoint that will figure out the appropriate
set of `collection-ids` for a given user/request, call this function,
and return the results in the shape we want.

Also: for e2e tests, we need a way to mark a card or dashboard as stale. I
think the easiest way to do this is to just create a testing endpoint
that we can call to update the `last_used_at` or `last_viewed_at` of the
card/dashboard to set it to ~7 months ago.


---------

Co-authored-by: bryan <bryan.maass@gmail.com>
2024-07-30 08:21:25 -08:00
Uladzimir Havenchyk
c364cd21f7 do not run licenses step only when the value is true (#46272) 2024-07-30 15:35:00 +00:00
Cal Herries
7e0ae60a1f + handle double-quotes in table and schema name in privileges query (#46268) 2024-07-30 15:10:57 +00:00
Nemanja Glumac
01af236aa6 ci: Fix E2E flake for the reproduction #21559 (#46269)
* Fix flaky reproduction 21559

* Improve the test structure and assertions

* Remove the flaky tag
2024-07-30 16:10:08 +02:00
Raphael Krut-Landau
fc312267a1 fix(webapp/sidenav): Fix bookmark reordering (#45632) 2024-07-30 09:35:05 -04:00
Uladzimir Havenchyk
e56d54b832 deps: update testing packages (#46242)
* test: update testing-library packages

* upgrade jest

* drop useless types

* drop babel-jest

* fix types

* fix canvas error
2024-07-30 15:55:58 +03:00
Denis Berezin
fc5115d622 feat(sdk): Add Embedding SDK analytics context for API requests (#45059)
* Add SDK context header

* Update naming

* Update naming

* Add client header for embedded context

* Add client header for embedded context

* Add sdk version header

* Fix e2e

* Fix storybook build

* Refactor to inject version in build step

* Fix unit tests

* Self review

* Fix e2e

* Fix e2e

* Fix e2e

* Fix e2e

* Fix e2e
2024-07-30 12:49:44 +03:00
Chris Truter
928ef0d9f3 Detect queries referencing unknown fields (#46143) 2024-07-30 11:28:54 +02:00
Oisin Coveney
06ec01861b cursor:pointer on ParameterValueWidget (#46223) 2024-07-30 10:52:43 +03:00
Ngoc Khuat
02db079b9c Add a "See this dashboard" link for dashboard sub for slack (#45029) 2024-07-30 14:41:45 +07:00
Uladzimir Havenchyk
3dcbd7f9fe deps: update react-use and remove resolutions (#46226) 2024-07-30 09:04:34 +03:00
Uladzimir Havenchyk
44a09c59c4 build: disable licenses generation for e2e tests (#46225) 2024-07-30 09:02:46 +03:00
Luis Paolini
00aa457e05 Upgrade webpack to v5.93.0 (#46251)
* Upgrade webpack

* deduplicate webpack deps

* add ^

---------

Co-authored-by: Uladzimir Havenchyk <uladzimir.dev@gmail.com>
2024-07-29 23:09:24 -03:00
Aleksandr Lesnenko
da6fe862dc Indicate in-progress exports (#45697)
* indicate in-progress exports

* specs, public dashboards

* add onbeforeunload hook when uploads are in-progress
2024-07-30 00:01:49 +00:00
Cal Herries
17f6443996 Increase slack upload timeout to 20 seconds (#46235) 2024-07-29 21:42:19 +03:00
Ryan Laurie
4a7d51a65b Use regular mantine buttons for filter and summarize buttons in query builder (#46106)
* use mantine buttons for filter and summarize

* Restore fancy color hover states

* Add css modules

* oh the cleverness of me

* better var name

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>
2024-07-29 17:31:20 +00:00
Braden Shepherdson
6e64a3e04c [perf] Better CLJC memoization; bounded strategy, fast versions (#46199)
Expands and refactors `metabase.util.memoize` to support better cross-platform memoization.

**Better basic memoization**

Use `clojure.core.memoize/memo` (and its clone in CLJS) rather than `clojure.core/memoize` for
the "everything forever" strategy.

**Bounded memoization**

There are a few places (eg. `u/kebab-case-en`) where we want zero-overhead *hits* and expect the input space
to be fixed. To guard against runaway memory usage, this **bounded** strategy dumps the entire cache when it
overflows. It logs an INFO level note when that happens - the intent here is that the threshold should never
actually get hit!

**Fast JVM versions**

In the special case where the function to memoize takes exactly 1 argument which is a valid map key, we can
use `ConcurrentHashMap.computeIfAbsent` as the basis of the cache and have much less overhead.

`fast-memo` and `fast-bounded` implement this in CLJ; in CLJS they just call `memo` and `bounded`.
2024-07-29 16:53:01 +00:00
Aleksandr Lesnenko
029a6c7271 Infer id numeric columns as non metrics (#45662)
* infer id numeric columns as non metrics

* update spec
2024-07-29 11:34:25 -04:00
Cal Herries
0bc880ad7e Avoid all tables in memory during sync (#46193)
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2024-07-29 15:30:17 +00:00
Jeff Bruemmer
a31adea8bc docs - updates env vars for main branch (#45946) 2024-07-29 11:17:59 -04:00
Nemanja Glumac
de8e196e4a e2e: Rewrite dashboard card resizing spec (#46212)
* Use function helpers

* Only assert the resize down

* Refactor repro 31701

* Remove flaky tag

* Better organize describe blocks

* Move custom `requestTimeout` config to the common block for resizing tests
2024-07-29 16:35:57 +02:00
Chris Truter
d0f9ef1c96 Track table references, even if we don't query their columns (#46128) 2024-07-29 13:02:10 +00:00
Chris Truter
a0e8395f37 Track column references whether they resolve to Fields or not (#46101) 2024-07-29 11:39:08 +00:00
Uladzimir Havenchyk
a5239fb5bd test(jest): get rid of warnings about duplicated manual mock (#46146)
* test(jest): get rid of warnings about duplicate manual mock

* update file-paths
2024-07-29 13:03:26 +03:00
github-automation-metabase
20005edc32 Update Readme version references and published npm version to 0.1.25 (#46222) 2024-07-29 08:43:26 +00:00
Oisin Coveney
337bf6883b feat(sdk): Add API keys for development mode (#46067) 2024-07-29 11:17:36 +03:00
Kamil Mielnik
7770cc69f6 Structure e2e API helpers (#46041)
* Refactor dashboard helpers to TypeScript

* Reuse existing helper

* Refactor cy.createQuestionAndDashboard to a function helper
- there was no good place to put it, so I also created new helpers/api directory
- and I moved all helpers using cy.request (with 1 exception, where a CSV download helper also does a bunch of assertions) in there

* Merge TS command definitions into a single file

* Export types

* Make dashboardDetails optional

* Export StructuredQuestionDetails

* Remove duplicated function

* Extract createNativeQuestion to separate file
- 1 exported helper per file, no exceptions!

* Reuse const

* Remove old definitions

* Add missing export
2024-07-29 14:16:33 +07:00
Denis Berezin
9d1569bda5 Migrate DashboardSidebars to TS (#46161)
* Migrate DahboardSidebars to TS

* More fixes for types
2024-07-26 23:54:32 +03:00
Alexander Polyankin
f27d115bb5 Fix the homepage dashboard being loaded everywhere (#46202)
* Fix homepage dashboard being loaded everywhere

* Fix

* Fix
2024-07-26 16:41:52 -04:00
Oleksandr Yakushev
7b14ccd974 perf: Allocation improvements on sync-db/fingerprinting path (#46167)
* perf: Optimize metabase.lib.schema.util/unique-uuids?

* perf: Allocation improvements on sync-db/fingerprinting path
2024-07-26 23:29:09 +03:00
Jeff Bruemmer
d2c2bccbe8 link fixes (#46200) 2024-07-26 15:59:29 -04:00
Alexander Polyankin
dc760a8bfa Remove unused dimension options from query_metadata (#46195)
* Remove unused dimension options

* Fix test
2024-07-26 15:35:27 -04:00
Braden Shepherdson
f95cff571d [perf] Fix memoization based on dashboard_load_id (#45809)
The `dashboard_load_id` is attached to the body for queries, not as a
query parameter. This correctly receives the `dashboard_load_id` and
uses it for `/query` calls.
2024-07-26 19:02:16 +00:00
github-automation-metabase
d2dc669c68 Add v0.50.17 to the list of releases (#46197)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-07-26 13:08:12 -04:00
Ryan Laurie
8f8a3351b4 Filter invalid recent and search items in move modal (#46086)
* filter invalid recent and search items in move modal

* e2e test disabled moving search and recent items

* update test
2024-07-26 10:52:49 -06:00
bryan
646b651703 Put SDK client and version into data on-thread (#46173)
* pull sdk info into data on-thread

* include api tests for query_execution and view_log

* Try mt/test-helpers-set-global-values!

- disambiguate names used in tests

* pass test + cleanup test helper

* make sure view logging is enabled in test
2024-07-26 16:48:07 +00:00
Alexander Polyankin
b17416a845 [perf] Fetch query metadata with DB calls directly (#45891)
* Remove unused properties

* Remove unused properties

* Remove comment

* Experiment

* Simplify

* general cleanup and adding dashboard links handling

* fix tests, link cards; sort output

* include databases from queries, not just tables, fix card sort

* use a simplified get-databases that doesn't throw

* Fix tests

---------

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2024-07-26 15:34:27 +00:00
Oisin Coveney
71814c602d Add tests for #45452 (#46178) 2024-07-26 17:34:10 +02:00
Braden Shepherdson
ee2df9120b [perf] Add a test for the Clojure-side lib.cache/side-channel-cache (#46133)
This was missed in the original PR #45394 due to clumsy `git`
wrangling; my bad.
2024-07-26 15:00:26 +00:00
Ryan Laurie
05646572e8 Populate newly created metrics in recents (#46166)
* refetch metric after save to log view

* Update e2e/test/scenarios/metrics/metrics-editing.cy.spec.js

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

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-07-26 14:37:54 +00:00
Ryan Laurie
ae14aa31bc Add e2e tests for 45831 - instance analytics db appearing in permissions (#46061) 2024-07-26 07:52:13 -06:00
Cal Herries
fbf7a23309 Skip long values in JSON unfolding query (#46089) 2024-07-26 16:42:39 +03:00
Alexander Polyankin
99b59ed58f Fix for temporal unit parameters in click behaviors (#46112)
* Add a test

* Add a unit test for TextLike
2024-07-26 08:40:01 -04:00
Raphael Krut-Landau
d4cebf6043 fix(admin/nav): Ensure that the "Exit admin" button can be clicked regardless of locale or viewport size (#45882)
Closes #45876
2024-07-25 23:22:45 -04:00
adam-james
7efce7dfd3 Some Email/Attachment Improvements and Fixes (#45691)
* fix conditional formatting color lookup with correct col names

The column names for color lookup are expected to be the same as the :name key of each column, and applying column
formatting broke this lookup. This fixes it.

* move overflow-x into pulse body div to exlude card title from scroll

* add a test for conditional formatting w/ a hidden row.

This still fails at the moment, working on a fix yet.

* apply conditional formatting in static viz even when col is hidden

Conditional formatting that depends on a hidden column was not being rendered in the static viz, but now we pass all
columns into the color selector fn, thus when rendering the table with the ordered/hidden columns, all other columns
will still use their appropriate conditional formatting

* I missed a linter warning

* fix tab rendering

* fix test

* fix up tests with some better structural searching
2024-07-26 09:45:01 +07:00
Nemanja Glumac
77619a5084 Document E2E mongo connectivity workaround (#46162) 2024-07-25 23:47:07 +02:00
Nemanja Glumac
a05ae7bb8b e2e: Fix dashboard card resizing flake (#46158)
* Do not store elements in a `const`

* Remove mid-test save and edit dashboard
2024-07-25 15:32:34 -06:00
metamben
84f932b5b6 Add Azure managed identity support (#46011)
Add Azure managed identity support 

---------

Co-authored-by: Case Nelson <case@metabase.com>
2024-07-26 00:30:11 +03:00
Uladzimir Havenchyk
8d841b1b0d ci: patch esbuild preprocessor to show errors in watch mode (#46074) 2024-07-26 00:22:06 +03:00
Raphael Krut-Landau
0079088e57 feat(admin/performance): Improve short label for duration policy (#45933)
Closes #45127
2024-07-25 16:37:43 -04:00
Raphael Krut-Landau
6b5ce3b6e6 fix(admin/performance): Fix default time bug in Schedule policy (#45915)
Closes #45916
2024-07-25 16:37:15 -04:00
Uladzimir Havenchyk
63b483b67b dx: deduplicate yarn.lock (#45923) 2024-07-25 23:18:02 +03:00
bryan
2febfbb44d Saving SDK data for embedding statistics (#45954)
* Adds a middleware that sets 2 dynamic vars

- These vars will be used to insert context for embedding analytics

* migration adding embedding_client and embedding_version to qe and vl tables

* clarify function api

* headers come in -> dynamic vars -> written to db

When the vars are set we insert their values into query execution and
query_log under embedding_client and embedding_version.

* update update migrations

* add predconditions to migrations

* fix tablenames + dataset_test

* Code Review responses

- remove commented out requires
- clarify test for merge-count-maps
2024-07-25 19:30:17 +00:00
Raphael Krut-Landau
613db813ac feat(question): Make two messages in the question footer - query runtime and cache age - more useful (#46072)
Closes #46009
2024-07-25 15:09:02 -04:00
John Swanson
72e9b9a4af Lock down the trash collection more (#45866)
* Lock down the trash collection more

Oops. I was very thorough in checking that you couldn't modify the
trash collection in the sense of moving things to or from it. I missed
the most obvious thing: actually modifying the trash collection itself.
So if someone wanted, they could change the name of the Trash to
"Definitely Not the Trash".

* Remove the Trash Collection from serialization

Serialization tests were failing due to the previous change, but this
got me thinking, and I realized that serializing the Trash collection is
completely unnecessary. We want to create it programatically on
startup (which we are) and then nothing should change it afterwards.
2024-07-25 18:44:53 +00:00
John Swanson
f9e2720154 Loosen N+1 query detection again (#46081)
I tightened this up by removing the condition here, thinking that CI
would catch it if it was necessary - but I'm getting failures in
development. Oops - didn't realize that this defmethod wasn't actually
applied during CI runs.
2024-07-25 18:44:19 +00:00
Noah Moss
b17b351b01 Request-level caching for sandboxes (#46138)
Co-authored-by: bryan <bryan.maass@gmail.com>
2024-07-25 13:55:17 -04:00
Raphael Krut-Landau
53bc5dda7b fix(webapp): Localize 'Settings' in command palette (#46124)
Closes #46123
2024-07-25 12:36:19 -04:00
Oisin Coveney
d840db5f89 Remove extra scrollbars from summarization sidebar (#46134) 2024-07-25 18:26:01 +02:00
use-tusk[bot]
433494c757 Updating Tusk Sanity GitHub workflow (#46150)
* Updating Tusk Sanity GitHub workflow

* fix: automatic Tusk self-review

---------

Co-authored-by: use-tusk[bot] <144006087+use-tusk[bot]@users.noreply.github.com>
2024-07-25 17:19:00 +01:00
bryan
d9961ef0bb Use the new private defn (#46013)
* add mu/defn-

* use new built-in mu/defn-

* mu/defn- preserves metadata

---------

Co-authored-by: Noah Moss <noahbmoss@gmail.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2024-07-25 16:01:45 +00:00
Nemanja Glumac
4df6519710 [E2E] Rewrite and expand repro #27643 (#45887)
* Rewrite repro for 27643

* Add TODO for the remaining tasks

* Make a test name consistent with others

* Finish the E2E test for #27643

* Fix the test to use PostgresDB

Since H2 originally doesn't fail the test

* Attempt to fix a flake on CI by waiting for table to finish syncing

* Create QA snapshot with fully synced field metadata

* Fix failed tests from field metadata change

* Simplify question scenarios

* Simplify dashboard scenarios

* Fix permissions

* Rework titles

* Add comment about PG

* Add limit to speed things up

* Fix and improve dashboard assertions

* Fix and improve question assertions

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-07-25 15:11:20 +00:00
adam-james
ba54b95c69 Bigquery Pagination Use next page to get proper results (#46095)
* Bigquery Pagination Use next page to get proper results

Fixes 45953

WIP

* use new-page in values-iterator

* disable just the part of the test that is still flaky

Want to keep the other part of the test that does prove we're not getting duplicates due to incorrect pagination.
2024-07-25 15:10:33 +00:00
github-automation-metabase
2581b4ad9d Add v0.50.16 to the list of releases (#46118)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-07-25 10:33:16 -04:00
Noah Moss
5741b9fe8d Make the sandbox cleanup logic more robust, and reorganize some perms code for better testing (#46102) 2024-07-25 10:16:19 -04:00
adam-james
1911899330 Number formatter Reports correct Decimal places for negative Numbers (#46104)
* Number formatter Reports correct Decimal places for negative Numbers

Fixes #41640

Prior to this, the number formatter would get the incorrect number of decimal places for negative numbers.

The way the decimal places count is derived works as follows:

 - convert number to a string
 - split the string on the separator (decimal, comma, whatever the instance has set)
 - destructure that split into [int decimal]
 - count decimal to get the number of decimals.

That all works for positive numbers, but for negative numbers, the regex was just splitting on 'not digits', so we got
an extra group due to the leading negative sign. This would incorrectly destructure  the 'int' part of the number into
the count, thus we would always get 1 instead of the correct value.

This fixes it by just taking last instead of destructuring.

* correct comparison to always use abs value in conditonal check

* tiny incorrectness in the test
2024-07-25 07:14:36 -07:00
Anton Kulyk
575fa4edd8 Don't show "Download results" button until dashcard query is complete (#46060)
* Don't show "Download" button until query complete

* Fix `PublicOrEmbeddedDashboardPage` tests

* Add tests

* Remove redundant dataset error checks

* Revert "Remove redundant dataset error checks"

This reverts commit fc7810f045.
2024-07-25 13:56:54 +01:00
Mahatthana (Kelvin) Nomsawadi
c24e48413a Allow stress testing E2E tests with PostgresDB (#46065)
* Modify the E2E stress test workflow to allow running PostgresDB

* Fix syntax

* Add qa_db to workflow summary

* Only run necessary containers

* Fix QA DB snapshots running when QA_DB_ENABLED=false

* Use more generic option that's not only specific to postgres
2024-07-25 13:03:35 +01:00
Cal Herries
3ec2ca99d6 Fix driver changelog for 0.50.16 entries (#46042) 2024-07-25 11:43:31 +00:00
Luis Paolini
f1319da6a6 Make drivers build in parallel rather than sequentially (#45897)
* Make drivers build in parallel rather than sequentially

* Make the whitespace linter happy

* Add duration to steps
2024-07-25 07:56:58 -03:00
use-tusk[bot]
de1a0b28bb Updating Tusk Sanity GitHub workflow (#46116)
Co-authored-by: use-tusk[bot] <144006087+use-tusk[bot]@users.noreply.github.com>
2024-07-25 11:55:25 +01:00
Oleksandr Yakushev
1624877666 [perf] Improve DB syncing times (#46103)
* perf: Add explicit .entryAt method for SnakeHatingMap

Otherwise, SHM invokes .keySet on itself which triggers the contstruction of the list of keys on each map access.

* perf: Cache (un)successful requiring of EE in dynamic-ee-oss-fn

* perf: Add a quicker path for getting metadatas from cache

* perf: Minor improvements
2024-07-25 13:16:13 +03:00
lbrdnk
d6ff929fb4 Enable e2e repro for the issue #38181 (#46082) 2024-07-25 10:14:21 +00:00
Anton Kulyk
8cb3e540dd Fix document title when opening a multi-series question from dashboard (#46004)
* Add repro

* Fix onOpenQuestion uses unexpected card object
2024-07-25 10:50:24 +01:00
Kamil Mielnik
8a2019c033 Refactor e2e dashboard helpers to TypeScript (#46037)
* Refactor dashboard helpers to TypeScript

* Reuse existing helper
2024-07-25 16:42:12 +07:00
Kamil Mielnik
40bf76ef14 Fix comma in location.svg (#46056) 2024-07-25 13:29:58 +07:00
Braden Shepherdson
80a20c0228 [perf] Add a Clojure-side impl for lib.cache/side-channel-cache (#45394)
It's based on a (global, synchronized) `WeakHashMap` using the query map
itself as the key. That gives the cache the same lifespan as the query
map, which is generally brief but often includes many calls to
expensive, cached functions like `visible-columns`.
2024-07-24 23:42:16 -04:00
Alexander Polyankin
e74130a8b9 Revert "fix: param-fields when native model is aggregated (#45068)" (#46108)
This reverts commit 6495def057.
2024-07-24 23:56:37 +00:00
Nemanja Glumac
d992abdfbc ci: Fix request timeout in E2E dashboard filters flake (#46091)
* Make filter corrupted again™

* Speed up the test by limiting the number of rows

* Make the repro more correct, and more resilient

* Remove intercepts

* Improve assertions
2024-07-24 17:06:02 -06:00
Alexander Polyankin
5519ad2e0f Fix a race condition with models creation (#46066)
* Fix a race condition with models creation

* Fix the test

* Fix the test
2024-07-24 17:51:58 -04:00
Jeff Bruemmer
e727f1be9d docs - notes on view data vis (#46093)
* notes on view data vis

* Update docs/permissions/data.md

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

---------

Co-authored-by: Alex Yarosh <alexandra@metabase.com>
2024-07-24 21:05:32 +00:00
Jeff Bruemmer
05f6129d5a note on projected coordinates (#46079) 2024-07-24 17:04:26 -04:00
Noah Moss
1e4e8e31be Cross branch migration testing workflow (#45998)
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2024-07-24 13:37:27 -04:00
Phoomparin Mano
3fe3739194 feat(sdk): add CLI to download and start Metabase locally for better onboarding experience (#45784)
* add webpack configuration for cli

* add requirements checking

* docker check

* docker start command

* port checks

* add getting started steps

* add final install message

* cleanup cli text

* handle force-closing prompt

* build the cli when running build-embedding-sdk

* wording updates

* add redundant prompt in case of small terminals

* remove redundant instruction

* make sure the user confirms the step

* change container name to metabase-enterprise-embedding

* migrate cli to es modules instead of webpack

* add shebang line for npx

* add cli dependencies to devDependencies

* Revert "add cli dependencies to devDependencies"

This reverts commit 5d5e952c2b.

* Revert "add shebang line for npx"

This reverts commit 766fdda09e.

* Revert "migrate cli to es modules instead of webpack"

This reverts commit 7d1b065163.
2024-07-25 00:35:12 +07:00
Phoomparin Mano
850f52488d docs(sdk): readme updates on react 17 partial compatibility (#46043) 2024-07-25 00:34:26 +07:00
Denis Berezin
871955e8eb feat(sdk): Add SDK storybook and e2e tests tooling (#45512) 2024-07-24 19:16:50 +03:00
Alexander Polyankin
3f7044618b Disallow multi-stage metrics (#46054) 2024-07-24 16:12:42 +00:00
Nemanja Glumac
65e38984e8 ci: Fix ace editor E2E typing flakes (#46048)
* Rewrite startNewNative helpers

* Update existing tests

* Fix table hovercards E2E flake

* Fix repro 37009

* Update repro 30680

* Add comment

* Fix nested question flake

* Fix typo
2024-07-24 14:48:22 +00:00
adam-james
f257598e8f Embedding Parameter Values set in Tokens work properly when nil or empty list (#45771)
* Embedding Parameter Values set in Tokens work properly when `nil` or empty list

Fixes: #40292

If a locked parameter's value is set to `nil` or `[]` in the embedding JWT, we want to treat this as 'no value has
been set' on that filter, but we should still run the query as normal. Likewise, any linked filters should still
properly derive their values from the unfiltered values of the filter to which they are linked.

* when a parameter's value is nil or empty seq, don't include it

This is a partial solution as I still need to find the place that's still erroring on the empty list case in terms of
the linked parameter's values.

* Treat empty list like `nil` for the token param

When you're using a filter in the App, it makes intuitive sense that when you've not selected anything from a filter's
drop down list (or entered any text, etc.), then the filter is effectively not applied.

For token params, we should behave similarly; `nil` and `[]` can both be accepted, and signal that the user intends
for that filter to basically NOT apply.

This also means we should not pass the constraint to the linked filters, since it errors, but even if it worked, it
would return 0 results, making it impossible to properly apply the linked filter at all.

So, this change causes empty lists to be treated as nil, AND will remove any parameters with `nil` as a value before
being passed to the query processor, which results in the proper behaviour of not having constraints on the linked
filter, and having the 'parent' filter not filtering anything.

* Embed preview should always use params from the token

In making a screenshot, I discovered a slight bug in previews, where if the embed had been previously published, it
could pull embedding params from the db that don't match the settings on screen. So, always pull the settings from the
token, which updates as the user is making changes in the Preview Embed UI.

* for previews, merge the embedding params sources instead

* alter 'nil' behaviour to work just as if the key doesn't exist

* fix one spot where I was passing maps into set functions

* Adjust tests to check for consistent behaviour in dash/qstn embeds

* fix an e2e test

* fix up last 2 failing e2e tests

* add the test case of a locked param having no value set in token

* some further e2e changes
2024-07-24 14:44:33 +00:00
John Swanson
50d0c35a77 Improve N+1 detection for simple hydration methods (#45848)
We have N+1 detection for simple hydration methods that checks to see
whether the hydration method made any DB queries at all. This makes
sense, because a simple hydration method is called on each instance
individually - if we make database calls *each time*, we're in trouble.

Where this runs into issues is with cached data, where the simple
hydration method is populating the cache - e.g. `:can_read` or
`:can_write` dereferencing `api/*current-user-permissions-set*`.
Currently we specifically exclude those hydration methods from the
check.

But after running into this again for a different simple hydration
method, I think there's a more robust approach:

- first, run the hydration method without counting DB queries

- then, run it again and make sure we don't make any additional DB
queries.

There is a potential downside here: if someone wrote a simple hydration
method with side effects, they'd potentially be very confused (in
development - this doesn't run in prod!) when those side effects
happened twice for a single hydration. But I *think* that's fairly
unlikely.
2024-07-24 06:33:02 -07:00
Alexander Polyankin
7628e33deb Fix broken details-only check in viz (#45959)
* Proper fix

* Add e2e repro

* E2E repro

* Update e2e/test/scenarios/models/reproductions.cy.spec.ts

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

* Update e2e/test/scenarios/models/reproductions.cy.spec.ts

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

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-07-24 13:32:44 +00:00
Uladzimir Havenchyk
f308cc1e47 test: wait for element to be rendered in flaky test (#45978) 2024-07-24 15:39:06 +03:00
Uladzimir Havenchyk
0cd024f752 dx: clean output folder before building jar (#45911)
* dx: clean output folder before building jar

* clean output only in prod mode
2024-07-24 15:30:00 +03:00
Nick Fitzpatrick
6a9230f146 Add repro for 38041 (#46003) 2024-07-24 09:18:38 -03:00
github-automation-metabase
03b802ee87 Update Readme version references and published npm version to 0.1.24 (#46044) 2024-07-24 12:04:10 +00:00
Phoomparin Mano
bfdcf0cb73 fix(sdk): throw errors when sdk hooks are used outside of redux context (#45999)
* handle errors when useMetabaseAuthStatus is used outside of sdk context

* address review comments feedback

* extract useSdkContext

* fix import type error
2024-07-24 18:12:42 +07:00
Chris Truter
ce9b57beaf Docstrings and refinements to the query-analysis module (#46023) 2024-07-24 12:56:21 +02:00
Nemanja Glumac
0cbd98df9d Fix E2E models flake 35039 (#46038) 2024-07-24 12:44:52 +02:00
Phoomparin Mano
3ceac07d4d fix(sdk): support React 17 backwards compatibility (#46012)
* polyfill useSyncExternalStore for React 17

* adds the shim

* use ReactDOM.render instead of createRoot for backwards compat

* use createRoot for React 18 environment

* refactor renderRoot compatibility

* remove semver dependency

* add small test for version

* use the same check for react 17
2024-07-24 17:25:21 +07:00
Chris Truter
52615c3774 Abandon deduplicating queue due to a race condition (#46014) 2024-07-24 09:09:54 +00:00
Chris Truter
f0323abee4 Decouple query analysis models from validation API (#46002) 2024-07-24 07:21:36 +00:00
Ngoc Khuat
7369c056f0 [perf] Only update ParameterCard when it changes (#45901) 2024-07-24 05:51:16 +00:00
Cam Saul
65bb3bb3a9 Make Redshift sync much more robust (#46021)
* Potential Redshift sync flake fix

* Make Redshift sync much more robust
2024-07-24 01:26:07 +00:00
Noah Moss
fb9c56e866 Tweak some sandboxing-related comments (#45862)
Co-authored-by: bryan <bryan.maass@gmail.com>
2024-07-23 23:57:54 +00:00
Cal Herries
2081799850 Skip syncing field values for oracle CLOB columns (#44654) 2024-07-23 21:19:30 +00:00
Jeff Bruemmer
61012d1f66 docs - mysql appdb note (#45956)
* notes

* more notes

* edits

* update app db page

* file-based db mention

* anchor link
2024-07-23 17:01:46 -04:00
Noah Moss
97ea91eb58 Add mu/defn- as private counterpart to mu/defn (#45962) 2024-07-23 20:54:06 +00:00
Nick Fitzpatrick
fad4fe4c85 don't trigger onChange when create dialog is open (#45989) 2024-07-23 15:58:19 -03:00
Raphael Krut-Landau
92bd6c5ede Fix several problems with the localization of the Performance feature (#45773) 2024-07-23 14:43:25 -04:00
github-automation-metabase
335cebb461 Add v0.50.15 to the list of releases (#46017)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-07-23 14:31:53 -04:00
Alexander Polyankin
4110cbacee Fix e2e-models-metadata flakes (#45995) 2024-07-23 14:14:53 -04:00
Chris Truter
a293958d93 Rename feature to query-reference-validation (#45986) 2024-07-23 17:42:02 +00:00
Uladzimir Havenchyk
b83b9955b4 fix webpack refresh in static mode (#45987)
* fix webpack refresh in static mode

* clean output

* revert
2024-07-23 16:56:27 +00:00
Ryan Laurie
8724560f52 Fix Analytics DB Appearing in Permissions (#45831)
* what does this break?

* Revert "what does this break?"

This reverts commit 93e09edeb3.

* don't show audit db in permissions
2024-07-23 16:25:37 +00:00
use-tusk[bot]
07e6a0416b Creating Tusk Sanity GitHub workflow (#46006)
Co-authored-by: use-tusk[bot] <144006087+use-tusk[bot]@users.noreply.github.com>
2024-07-23 17:20:26 +01:00
Nemanja Glumac
4c1964db7e ci: Fix dashboard subscription E2E flake 24223 (#45993)
* Rewrite reproduction for 24223

* Fix test
2024-07-23 17:41:17 +02:00
Luis Paolini
7772e623f0 Make the translation artifacts build in parallel rather than sequentially (#45898) 2024-07-23 12:15:53 -03:00
Uladzimir Havenchyk
7b7d84f166 dx: make fe stress test faster (#45980)
* dx: make fe stress test faster

* uncomment

* invalidate cache and run in band
2024-07-23 17:43:28 +03:00
Chris Truter
5f669eeb57 Track queries with inactive tables (#45971) 2024-07-23 16:29:04 +02:00
Kamil Mielnik
a4541b8d3b Fix - Calendar widget jumps when switching months (#45803)
* Add repro for #39487

* Refactor test

* Add repro for 'on' filter

* Fix metabase#39487

* Refactor test

* Change order of tests

* Improve assertions

* Group tests

* Add tests for filter pills

* Refactor tests

* Rename helpers

* Add filter modal tests

* Add tests for filter drill

* Add notebook tests

* Fix test

* Add one more repro

* Fix typo

* Optimize tests

* Simplify the fix
- apply the fix everywhere
- remove fix for width

* Update tests

* Improve comment

* Move min height to Calendar
2024-07-23 14:27:31 +00:00
github-automation-metabase
122c4e98d7 Add v0.50.14 to the list of releases (#45958)
Co-authored-by: Metabase bot <metabase-bot@metabase.com>
2024-07-23 09:50:06 -04:00
Noah Moss
6443715133 Set validCheckSum for permissions migration to ANY (#45981) 2024-07-23 13:38:54 +00:00
Alexander Polyankin
a459bea253 Fix editing models with metadata overrides (#45951) 2024-07-23 09:34:27 -04:00
Nemanja Glumac
4a87571b2b Fix the (object detail) flake for repro 39477 (#45973)
* Fix the flake for repro 39477

* Expand the repro
2024-07-23 14:37:22 +02:00
github-automation-metabase
621c19bc9d Update Readme version references and published npm version to 0.1.23 (#45982) 2024-07-23 12:18:30 +00:00
Nemanja Glumac
64f0054dd9 ci: Fix the native snippet flake (#45976)
* Wait for the native editor to be ready

* Add comment

* Make ace editor slightly more resilient to re-renderings

* Improve the test readability
2024-07-23 13:19:37 +02:00
Chris Truter
3c0b5ab72f Tweak failure map size and test (#45970) 2024-07-23 10:02:54 +00:00
Nemanja Glumac
db7cadb6f5 ci: Quarantine dashboard-card-resizing flake (#45972)
[ci skip]
2024-07-23 11:43:11 +02:00
Oisin Coveney
62bb5bc9d2 fix(sdk) - fix popover errors on dashboard parameters (#45671) 2024-07-23 10:59:02 +02:00
Nemanja Glumac
558a98395a 45877 follow up: Improve a11y of the ListField component (filter picker options dropdown) (#45883)
* Use Mantine checkbox

* Update E2E tests

* Remove unused `checkedColor` prop
2024-07-23 10:49:42 +02:00
Alexander Solovyov
083df744db [cache] remove mentions of removed cache settings from docs (#45921) 2024-07-23 11:27:53 +03:00
Tim Macdonald
3f30da9cc7 Add qv= test helper (#45810)
Makes much nicer test output than the resp= nonsense
2024-07-23 08:06:56 +00:00
Alexander Solovyov
183bc66217 we had unlimited xrays since 2018 and it is time to end this madness (#45909) 2024-07-23 10:39:40 +03:00
lbrdnk
3bf053c491 Add temporal bucketing to expression references (#45492)
* Add test

* Add bucketing to expression references

* Restore original schema

* Update e2e test

* Update test as per review remarks

* Apply suggestions from code review

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

* Remove alignment

* Rename ::field-type-info

* Update log level

* Remove redundant log

---------

Co-authored-by: Vamsi Peri <vamsi@metabase.com>
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2024-07-23 08:07:13 +02:00
lbrdnk
1546661b00 Move parse-currency to util.jvm ns (#45939)
* Move parse-currency to jvm-util ns

* Use util.jvm ns
2024-07-23 08:06:43 +02:00
John Swanson
cb66e220b6 Require geojson to be json or plaintext (#45718)
Also modify the tests to not actually make HTTP requests. We have the
clj-http-fake client which works well for this sort of thing.
2024-07-22 20:40:37 +00:00
Uladzimir Havenchyk
e02589a386 replace babel-loader with swc-loader (#45843)
- babel is kept to transpile fonts file as swc emotion plugin doesn't handle our case correctly. I didn't find a root cause of wrong behaviour, but the safe past is to keep using babel + emotion plugin for one file and all others can be transpiled with swc
- react fast-refresh now handled by swc
- swc-loader can't read browserslist config from package.json, so we had to manually specify supported browsers in webpack
2024-07-22 19:49:03 +03:00
Alexander Polyankin
cfc6152928 Remove unused properties from query_metadata (#45858) 2024-07-22 11:57:16 -04:00
Roman Abdulmanov
2dcd3b4e4e update team json (#45936) 2024-07-22 22:01:44 +07:00
Raphael Krut-Landau
5b8d87a3b3 fix(admin): Parse cron expressions correctly in Safari v16.3 (#45654)
* fix(admin): Don't use regex lookbehinds in Schedule utility functions since these fail on Safari 16.3

* Remove blank describe block
2024-07-22 10:56:57 -04:00
Jeff Bruemmer
eef46fd37d caching order (#45930) 2024-07-22 10:45:06 -04:00
Alexander Polyankin
5bc284a3d2 Fix search field values with has_more_values: true (#45922) 2024-07-22 14:30:50 +00:00
Abed Habli
fcf8c51c80 Rename Azure AD to Microsoft Entra ID (#45863)
* Rename Azure to Microsoft Entra ID

* adding a new screenshot
2024-07-22 09:21:42 -04:00
Kamil Mielnik
b354780cd2 Repro #28270, #33708 - Object relationships in nested questions (#45854)
* Add repro for #28270

* Refactor assertions

* Add repro for #33708

* Fix typo

* Skip the repros
2024-07-22 19:39:21 +07:00
Nemanja Glumac
62688d781f ci: Run without Replay (#45799)
* Uninstall ReplayIO

* Remove Replay config

* Install and use custom Chrome v111

* Simplify comment

* Set a specific Chrome version commit

* Skip repro for #22517
2024-07-22 14:34:03 +02:00
Ngoc Khuat
7d398c1710 [dev tool] monitor all toucan2 queries (#45176) 2024-07-22 10:01:41 +00:00
Uladzimir Havenchyk
4516e643c2 refactor: drop prop-types from tsx files (#45871) 2024-07-22 11:52:20 +03:00
metamben
8d22b08fee Support out of order expression references (#45872)
* Support out of order expression references
* Return just the cycle for cyclic expression references
* Prevent "yarn test-cljs" from testing twice
2024-07-20 12:57:52 +00:00
Alexander Polyankin
3e4bf91fe2 Check for cardId being undefined (#45860) 2024-07-19 19:21:52 -04:00
Case Nelson
a82419a2fd fix: replacing joins and conditions updates alias (#45774)
* fix: replacing joins and conditions updates alias

Fixes #37074

* Only change alias if conditions or table changed

* Fix test

* Fix fe test

* Address PR feedback
2024-07-19 23:05:50 +00:00
Nemanja Glumac
05af78853f Fix #45877: Duplicated boolean options in a filter dropdown menu (#45880)
* Fix duplicated boolean options in a dropdown filter

* Add repro for 45877
2024-07-19 22:30:37 +00:00
Alexander Polyankin
66afb0d7fe Fix right section overflow in MultiSelect (#45838)
* Fix right section in MultiSelect

* Fix right section in MultiSelect

* Update MultiSelect.styled.tsx

* Add a test

* Add a test
2024-07-19 17:49:05 -04:00
Alexander Polyankin
aa4be30eb3 Remove can_run_adhoc_query (#45847)
* Remove can_run_adhoc_query from the FE

* Remove can_run_adhoc_query from the FE

* Disable can_run_adhoc_query on dashboard

Was impacting performance on dashboard load. Timings locally for me:

get dash: 3178 -> 199
get metadata: 3604 -> 1002

So dashboard went from 6 seconds to load to 1 second.

* Fixup test from disabling can_run_adhoc_query

---------

Co-authored-by: dan sutton <dan@dpsutton.com>
2024-07-19 21:19:42 +00:00
Cam Saul
1695a18d84 Redshift CI flake fix: enable robust sync behavior in tests (#45873)
* I think this should fix Redshift test flakes

* PR feedback

* PR feedback

* Make some flaky X-Ray tests ^:mb/once
2024-07-19 13:16:02 -07:00
Phoomparin Mano
b69d4d5ecd fix(sdk): missing semantic text colors mapping (#45859)
* missing text semantic colors mapping

* add foreground color test

* update tests to use SdkGlobalStylesWrapper
2024-07-20 01:15:17 +07:00
Uladzimir Havenchyk
8ef0691e87 fix: install frontend dependencies in dockerfile (#45802)
* fix: install frontend dependencies in dockerfile

* do not skip optional deps
2024-07-19 14:32:48 -03:00
lbrdnk
f4a93cba9c Move desugar-host-and-domain to jvm-util (#45808) 2024-07-19 19:19:52 +02:00
lbrdnk
a5eb647e62 Add basic auth params to dbms-version call on Druid (#45729)
* Add basic auth to dbms-version

* Add test
2024-07-19 19:16:40 +02:00
bryan
5bb2a1523c Don't show Invalid questions for Joins in Query Builder (#45768)
* adds database_id to recents, and question collection items

* don't show unjoinable things in recents either

* unskip repro

* fix types

* fix repro

* fix tests in model/recent_views

* add unit test for invalid join in recents

* fix tests in test/metabase/api/collection_test.clj

* update type

* improve unit tests

---------

Co-authored-by: Ryan Laurie <iethree@gmail.com>
2024-07-19 15:46:27 +00:00
Raphael Krut-Landau
36652d4118 fix(cache/admin): Remove old caching components (#45755) 2024-07-19 11:07:25 -04:00
Noah Moss
e5e3ef876f Speed up permission migrations by 95% under specific conditions (#45775) 2024-07-19 14:33:26 +00:00
John Swanson
ec4d4418c4 Add report_dashboard.last_viewed_at (#44240)
* Add `report_dashboard.last_viewed_at`

- defaults to `now()` (it's intended to be used as a timestamp after which
we're *sure* the item hasn't been used, not a definitive timestamp we're
sure the dashboard was actually used at)

- updated whenever the QP processes a query for a dashcard

---------

Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2024-07-19 06:55:23 -07:00
github-automation-metabase
be6ad03804 Update Readme version references and published npm version to 0.1.22 (#45850) 2024-07-19 13:54:39 +00:00
Noah Moss
9832bb0608 Add .jar extension in example serialization command (#45849) 2024-07-19 09:49:57 -04:00
Nicolò Pretto
a09d136ede fix(sdk): make png/pdf export work in the sdk (#45751)
* remove dynamic import to make html2canvas work on the sdk

* Revert "remove dynamic import to make html2canvas work on the sdk"

This reverts commit a8b511fa28.

* manually import html2canvas-pro and jspdf in the sdk
2024-07-19 15:03:07 +02:00
Braden Shepherdson
f5835c5900 [perf] Properly buffer while streaming JSON to API responses (#45684)
Previously, due to over-eager `.flush()` calls in Cheshire, we were
flushing the output stream for every `data.rows` entry. Typically this
resulted in 3 + N TCP packets sent, where N is the number of rows being
returned.

This PR rebuilds how we stream the JSON responses to avoid extra
`.flush()` calls. For the unit test in this PR, that reduced the number
of packets sent over the wire from 37524 to 4.

Fixes #34795.
2024-07-19 08:58:44 -04:00
Alberto Perdomo
6f570c8e19 fix(sdk) Update README.md for SDK (#45792)
Warning about React 17
Update supported and planned features
2024-07-19 13:19:02 +01:00
lbrdnk
9c708c217e Remove :foreign-keys feature or convert to :metadata/key-constraints where appropriate (#44894)
* Post sync hook stub for implicit joins testing stub

* Add join alias to field lvalues to enable sorting on joined fields

* Disable :foreign-keys on Mongo

* Require :left-join support for implicit joins instead of :foreign-keys

* Update implicit joins tests

* Adjust sync-fields-test

* Update implicit joins feature check test

* Transform post-sync-hook to normal function

* Add foreign key relationships only for dbmses without :foreign-keys feature

* Update test to handle Oracle correctly

* Split convoluted fn

* Avoid unnecessary computations for datasets with no fks

* Update docstring

* Fix driver usage

* Transform :foreign-keys to :metadata/key-constraints in test data loading code

* Update sync_test.clj

* Update driver_test.clj

* Update moviedb.clj

* Update dataset_definition_test.clj

* Update fetch_metadata.clj

* Update fields_test.clj

* Update driver.clj

* Update driver/sql.clj

* Set sql driver join support to true for all joins

Deriving drivers are expected to set to false where applicable.

* Update sqllite.clj

* Remove foreign-keys from spark

* Remove :foreign-keys from presto

* Remove :foreign-keys from Athena

* Remove foreign-keys from big query

Reading docs it seems fk inference should be ok. Let's see the test results. Act based on that.

* Update test_metadata.cljc

* Set key-constraints to false for bigquery

* Add foreign keys to sqlite manually until sync is fixed

* Return driver require to Athena

* Correct typo

* Add naive primary key heuristic

* Update pk fk logic to handle name components correctly

* Add alias escaping to presto

* Add ordering to test

* Add order by to test

* Update test

* Remove use of rewrite-fields-to-force-using-column-aliases in order by fields

* Add exception to alias forcing

* Different approach to exception from alias forcing

* Alternative approach for prefixing idents in bigq

* All seelcted fields by desired alias

* Rewrite only fields not from this source table

* Update test

* Enable breakout-on-fk-field-test for :left-join drivers

* Add feature comment

* Explicit joins tests foreign-keys removal

* Update nested_queries_test.clj

* Update remapping tests

* Update tests

* Update tests to handle sqlite results format

* Disable metadata/key-constraints on sqlite during tests until

* Address remarks

* Remove mt/with-mock-fks-for-drivers-without-fk-constraints

* Update bigquery test

* Update tests

* Adjust row level restrictions

* Add parameterized-sql feature

* Update comment

* Update leftovers

* Order keys

* Remove foreign keys from frontend

* Fix FE unit

* Update driver changelog

* Address review remark

* Update test/metabase/query_processor/test_util.clj

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

* Update docs/developers-guide/driver-changelog.md

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

* Update docs/developers-guide/driver-changelog.md

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

* Update modules/drivers/bigquery-cloud-sdk/src/metabase/driver/bigquery_cloud_sdk/query_processor.clj

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

* Update docs/developers-guide/driver-changelog.md

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

* Update test

* Update comment and reduce expression

* Update comment

* Address remarks

* Fix merge

---------

Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
2024-07-19 13:55:09 +02:00
Alexander Polyankin
473ae3b6bd Add a repro for "Cannot create another filter value if it starts with the same value as an existing value" (#45837) 2024-07-19 07:11:15 -04:00
Mahatthana (Kelvin) Nomsawadi
143f27577a Skip repro 27643 again for issue that hasn't been fully fixed (#45841) 2024-07-19 10:42:35 +02:00
Aleksandr Lesnenko
9c44162334 update trend chart copy (#45814) 2024-07-18 18:51:02 -04:00
metamben
15376b55d4 Remove dead code (#45815) 2024-07-19 01:39:57 +03:00
Noah Moss
d47b153392 Exclude deactivated admins from legacy no-self-service email (#45726) 2024-07-18 18:34:24 -04:00
metamben
d364df916e Derive MySQLEnum from Text instead of TextLike (#45752)
* Derive MySQLEnum from Text instead of TextLike

Fixes #44807.

This change is in accordance with https://dev.mysql.com/doc/refman/8.0/en/enum.html describing the ENUM types as a
kind of string.  All our string operations seem to work with MySQL ENUM fields.
2024-07-19 01:13:53 +03:00
Raphael Krut-Landau
df2d409771 fix(webapp/collections): Tweak the height of action menu items so they align well with icons (#45618) 2024-07-18 17:35:38 -04:00
Alex Yarosh
0e41258185 docs: extract requires a db with regex (#45828)
* docs: extract requires a db with regex

* Update docs/questions/sharing/visualizations/table.md

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-07-18 20:29:09 +00:00
Jeff Bruemmer
57dfd4a629 docs - json filter limitation (#45822) 2024-07-18 16:14:56 -04:00
Chris Truter
bd842dae52 Track query analysis failures in an in-memory map (#45793) 2024-07-18 22:13:57 +02:00
Alexander Polyankin
48985218c2 Fix parameter mapping (#45806) 2024-07-18 16:00:05 -04:00
Alexander Polyankin
abcefc989e E2E repro for Field Filter's Default Value Not Working on Dashboard with UNIX timestamp (#45811) 2024-07-18 15:59:45 -04:00
Nemanja Glumac
f2710c35ec Unskip repro for #27643 (#45785) 2024-07-18 20:59:19 +02:00
Ryan Laurie
8a1d6b2f79 Remove stupid perf unit test (#45812) 2024-07-18 18:15:03 +00:00
Tim Macdonald
122b0766d6 Include cards from the root collection in the Query Validator Tool (#45770)
Include  cards from the root collection in the Query Validator Tool

[Fixes #45756]
2024-07-18 18:59:20 +01:00
Case Nelson
bcd5a0026e test: add database feature to test identifiers with spaces (#45680)
* tests for drivers with spaces in their identifiers

* Add driver feature

* Fix tests

* Remove ambiguous alias for sqlite

* Try to fix bigquery and sqlite tests not seeing left-join support

* Add explicit support for left-join because of foreign-keys during test hacks

* Handle left-join support weirdness

* Fix test
2024-07-18 09:25:46 -06:00
Nemanja Glumac
5e49f15b84 45749 follow up: guard against the potential null (#45796) 2024-07-18 15:32:20 +02:00
Uladzimir Havenchyk
e8e87857d2 Remove flakiness from e2e repro but move it to jail anyway (#45791)
* Remove flakiness from e2e repro

* add to flaky group anyway

* add to flaky group anyway

* fixup! add to flaky group anyway
2024-07-18 13:17:18 +00:00
Kamil Mielnik
16eb7df08d Fix flaky test (#45794) 2024-07-18 18:58:02 +07:00
Chris Truter
115de918cb Asynchronously fix missing, stale, or orphaned Query Analysis (#45711) 2024-07-18 11:15:10 +00:00
Anton Kulyk
f4f71ea7bd Clean up dashboard URL management (#44639)
* Fix falsy tabSelected/tabRenamed checks

* Update URL management (WIP)

* Fix tests failing because of whitespace changes

* Fix tests failing because of parameter order

* Use one hook for parameters and tab URL management

* Fix tests failing because of parameter order

* Fix test failing because of whitespace changes

* Revert

* Fix DashboardTabs tests

* Fix tests failing because of parameter order

* Fix test

* Fix test failing because of whitespace changes

* Remove unit tests that should be e2e tests now

* Fix tab navigation

* Fix string encoding/decoding

* Revert test changes

* Consistent question search params

* Update DashboardTabs tests

* Fix `SyncedParametersList`

* Fix e2e tests

* Fix nav usage

* Fix types

* Remove `useSyncedQueryString`

* Fix test

* Move slug utils to dashboard utils

* Fix nav

* Revert nav change

* Fix e2e tests

* Fix public/embedded dashboards, handle site url

* Add repro test

* Bring back and fix `PublicOrEmbeddedDashboardPage` tests

* Move `SyncedParametersList` to qb
2024-07-18 11:30:57 +01:00
Nemanja Glumac
c0b63285b6 Do not render ExecutionTime if there is no time to format (#45749)
* Do not render if there is no time to format

* Add a unit test

* Render time if 0

* Simplify the logic with explicit check for `undefined`
2024-07-18 09:45:09 +00:00
github-automation-metabase
18bbd3adab Update Readme version references and published npm version to 0.1.21 (#45783) 2024-07-18 07:18:21 +00:00
Kamil Mielnik
d62bc6ca80 Fix - App crashes when navigating back during model creation (#45709)
* Refactor EditoTabs
- get rid of options prop
- use named export

* Remove unused data-testid

* Remove redundant id and aria-labelledby

* Remove redundant props spread

* Bring back data-testid in use
- Thanks VSCode for randomly showing me search results or not...

* Fix navigation issue

* Add a repro for first issue

* Adjust EntityPickerModal root element so that it works with "be.visible" assertion in Cypress

* Add a repro for second issue

* Refactor tests
- Fix not enough history entries issue

* Change order of tests to start with simpler one

* Fix invalid request issue

* Add more assertions

* Format code
2024-07-18 13:57:47 +07:00
Phoomparin Mano
1e48f9629a feat(sdk): theme option to customize popover's z-index (#45613)
* customize popover z-index

* make popover z-index customizable

* make the popover z-index customizable

* add tests for popover z-index

* also specify z-index for mantine popover
2024-07-18 13:55:20 +07:00
Cam Saul
bab905c069 Use single connection for test data loading & big test data loading improvements (#45268)
* Reuse connection for test data loading & JDBC data loading overhaul

* Revert silly change

* Remove unneeded logic for recording which datasets are loaded or not-yet-loaded

* Ok so I guess we do need the code to detect duplicate dataset loading after all

* B I G  improvements

* Appease Kondo

* Test fixes 🔧

* More test fixes 🔧

* Fix dataset-already-loaded?-test

* Fix test

* Fix Presto JDBC and greatly improve test data load speed for it

* Postgres test fix 🔧

* Fix compilation errors

* MySQL fixes 🔧

* Fix syntax error

* MySQL fixes 🔧

* Implement `dataset-already-loaded?` for Athena and cache the set of existing databases

* Fix Redshift

* Fix Presto JDBC

* Vertica test fix 🔧

* Fix Oracle dataset-already-loaded?

* Test fixes and parallelize some API tests.

* Test fixes 🔧

* Oracle test fix? 🔧

* Another test fix 🔧

* Stop putting random spaces in code bodies this is not JavaScript code

* with-temp-vals-in-db should merge in original value of Database settings

* The most test fixes 🔧

* 3 or 4 test fixes 🔧

* Add schemas around stuff to catch errors

* Appease Kondo

* Implement dataset-already-loaded? for vertica

* Implement dataset-already-loaded? for SQLite and Snowflake
2024-07-17 21:06:11 -07:00
Case Nelson
7ea19b4f72 fix: UUID filters across supported databases (#45575)
* [WIP] Testing driver filters

* Only test returned values in CI

* Add :uuid-type for dbs that support that type (test oracle's support)

* Try again for oracle test, redshift does not support uuid-type

* Add tests, support where available

* Add empty/null tests

* Adjust test query for athena

* Reset logging

* Fix comments

* Add Athena uuid conversion

* Address PR review

* Add comments

* Address PR comments

* Use varchar for portability. Add inline uuid casting for athena

---------

Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2024-07-17 19:13:55 -06:00
Emmad Usmani
7b4e4c3349 fix tab actions not working in firefox (#45682)
* fix tab actions not working in firefox

* add e2e test

* update e2e tests that need awaitRequest: false
2024-07-17 22:12:21 +00:00
Alexander Polyankin
03905e7940 Bulk filter modal incorrectly suggests that you can filter by values in a JSON column (#45748) 2024-07-17 17:31:21 -04:00
Oreon Lothamer
0293ce541f ephemeral pr envs on label (#45602)
* ephemeral pr envs on label
2024-07-17 11:13:14 -10:00
adam-james
60ad50b9b8 Field Filter Value Normalization in Embedding Endpoints (#45447)
* Field Filter Value Normalization in Embedding Endpoints

Fixes 27643

Since we use query-params to pass paramter values, we have to normalize the parameter map values.

This PR is a WIP, as I'm trying to find a way to do this hollistically/properly.

First commit here is mostly as a marker for where to start working on this properly, as I think the json parsing won't
catch all cases, nor should the normalization happen without some attempt to use a schema to properly validate, maybe
even coerce things.

* read strings if boolean or numbers, replace blank str with nil

Also update the common dashboard param values fn to use embedding params from the URL blob if the app db doesn't have
embedding params. This happens upon first preview where nothing will have been written to the Appdb yet.

* Add query-param normalization test, add related embedding test

* schema didn't work in this case after all.

Worth a shot, but don't want this to block the PR, so reverting to the previous schema

* Add comment pointing out the downsides/reasons for this solution

It's nto a perfect solution, but it's probably the best we can get at the moment, without adding a new filter
type (boolean) and/or improving the design of hte embedding endpoints and how filters/parameters work
2024-07-17 20:33:14 +00:00
John Swanson
c7a5aee1f8 Preprocess queries before data perms check (#45601)
When we run queries, we preprocess them, during which the sandboxing
middleware adds information that we use when checking permissions
later on in query processing.

When we checked data permissions before saving a card, we were checking
permissions on the raw query, without preprocessing. Without the data
provided by the sandboxing middleware, the permission check sometimes
failed (depending on the permissions for other tables in the DB).

Note the big hack here: preprocessing can fail, for lots of reasons.
This broke a *lot* of tests that were passing in invalid queries. If an
exception occurs during preprocessing, we catch and just use the
original query like we were before.
2024-07-17 19:20:14 +00:00
lbrdnk
45728b0824 Fix deserialization of mongo native query string (#45566)
* Fix deserialization of mongo native query string

* Add test
2024-07-17 20:23:25 +02:00
Tim Macdonald
8b9e7afe90 Don't return duplicate cards in the Query Validator Tool (#45677)
* Don't return duplicate cards in the Query Validator Tool

[Fixes #45673]
2024-07-17 18:35:51 +01:00
Cam Saul
dcbddc9ebc Sync Snowflake VARIANT type as new :type/SnowflakeVariant (#45674)
* Sync Snowflake `VARIANT` type as :type/SnowflakeVariant`

* Test fix 🔧
2024-07-17 10:02:02 -07:00
Uladzimir Havenchyk
7cfb0e72e2 build: do not run duplicated steps during jar building (#42699) 2024-07-17 19:13:38 +03:00
Alexander Polyankin
96e60529c9 Add fallback filter widgets for uncommon (or unknown by Metabase) data types (#45578) 2024-07-17 16:12:03 +00:00
Nicolò Pretto
489a0ac8da fix(sdk): fix downloads not working on sdk (#45657) 2024-07-17 15:30:46 +00:00
Ryan Laurie
271affa885 Install release packages before building (#45660)
* install before running script

* freeze dat lockfile
2024-07-17 09:22:00 -06:00
Oleksandr Yakushev
5b35e8a429 perf: Optimize XLSX export by using more efficient iteration (#45669) 2024-07-17 18:13:57 +03:00
Nicolò Pretto
dec3a0ec03 fix public resource flake (#45731) 2024-07-17 15:10:17 +00:00
Tim Macdonald
9fc76a7e09 Fix Emacs indentation of with-anaphora (#45716) 2024-07-17 14:30:45 +00:00
Ryan Laurie
e6b500087a Use automation token for checkout in docs update action (#45663) 2024-07-17 08:27:11 -06:00
Sloan Sparger
24caede62a Add model icon to model section of a collection (#45696) 2024-07-17 09:13:06 -05:00
Nemanja Glumac
ce8f43e111 Repro #33327: Visualization does not recover from an error in native query editor (#45715) 2024-07-17 21:08:36 +07:00
Mahatthana (Kelvin) Nomsawadi
ffa54f0f45 [Milestone 1] Re-design transparent theme for static embedding and public links (#45633)
* refactor: Simplify code (#44275)

* Remove dead code

* Remove values same as default options

* Simplify hook API: Removing unused argument

* review: Remove redundant code

* Update look and feel copy (#44277)

* Update static embed tab name

* Update copies + rearrange settings

* Use Mantine Select

* Fix E2E tests by applying new copies

* Fix unit tests

* Fix more E2E tests

* review: Add a comment on Mantine `value` quirk

* Adjust spacing and relevant tests

* Move `transparent` theme to its own toggle option (#44362)

* Reorder the function to match the visual order

* Make function name consistent

* Introduce the new background option (do nothing yet)

* Remove redundant exports

* Tighten up values to reduce confusion

* Make the parameters order consistent

* Only show background option on dashboads (spec)

* Allow dashboard embed background to be transparent

* Make filter background and header/footer transparent

* Fix type error

* Fix unit tests

* Fix E2E tests

* Fix checkerboard pattern not showing when no background

* Add unit tests

* Add missing copy update

* Remove remnants from outdated solutions within the PR

* Improve code comment references

* Fix E2E tests since the last copy change

* Fix type errors from merging master

* Update light theme style (#44488)

* Add background to dashboard filter on light theme

* Make position sticky works with transparent background

* Fix sticky filters not working on theme=transparent

* Fix unit tests

* Simplify IntersectionObserver components + fix E2E tests

* Add storybook for embedded dashboard

* Clarify the use of ExplicitSize context

* Remove unused code

* Formatting

* Review: Better mock `isWithinIframe`

* Update dark theme to match the new design (#45134)

* Update light theme checkerboard colors

* Update checkerboard colors

* Consolidate dashboard light/dark border style

* Use `--mb-color-text-primary` for light theme dashboard

* Update embed dashboard dark theme primary color

* Migrate dashboard text-secondary color

* Migrate text-tertiary color

* Migrate gold, axis, and split line to CSS custom properties

* Fix failed e2e tests

* Fix static viz not working

* Update loki snapshots

* Remove unnecessary CSS custom property

* Make diff more consistent

* Address review: reusing type

* Support backward compatibility when passing `theme=transparent` (#45214)

* Match preview query with the actual code query

* Handle backward compatibility when `theme=transparent` on dashboard

* Add unit tests

* Address review: Make tests less repetitive

* Update Metabase banner upsell UI (#45424)

* Prepare folder for nested components

* Update upsell UI

- add `fullWidth` variant
- align title to the left

* Fix Upsell banner having horizontal scroll on full width

* Add new Metabase banner upsell component

* Fix unit tests

* Address review: Fix typo

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

* Address review: Move upsel UI to `admin/upsells`

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

* Remove unnecessary ESLint disable comment

We can remove it since the file is in admin folder, and is already excluded from the rule.

* Address review: remove default value property

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

* Address review: Extract magic number

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>

* More UI updates (#45450)

* Update dark theme text colors to match the new design

* Update powered by metabase logo

* Update loki snapshots

* Fix unit tests

* Fix formatting

* Fix wrong dark theme metabase logo badge color

* Address review: Compress SVG with svgo

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

* Fix E2E tests

* Update loki snapshots

* Clarify Metabase base colors with comments

---------

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

* Add more tests (#45628)

* Add static embed question stories

* Add loki snapshots

* Add transparent theme for static dashboard tests

* Add transparent theme tests for static questions

* Assert `background` option in analytics tests

* Remove tests for logic that has been moved

* Update loki snapshots

* Fix failed E2E tests from merging master

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2024-07-17 14:51:34 +01:00
Kamil Mielnik
9ec6c7293e Refactor EditorTabs component (#45705)
* Refactor EditoTabs
- get rid of options prop
- use named export

* Remove unused data-testid

* Remove redundant id and aria-labelledby

* Remove redundant props spread

* Bring back data-testid in use
- Thanks VSCode for randomly showing me search results or not...
2024-07-17 20:44:19 +07:00
Raphael Krut-Landau
35b3dfc667 fix(webapp/collections): Allow only one action menu popover to be open at once (#45619)
This also makes collections tabbable

No longer skip e2e test: "scenarios > collections > trash > should open only one context menu at a time"
2024-07-17 09:42:26 -04:00
Alexander Polyankin
68ade651a1 Fix offset error (#45693) 2024-07-17 08:15:12 -04:00
Ngoc Khuat
f5d4361776 Fix pulse being sent multiple times (#45703) 2024-07-17 09:36:08 +00:00
Oleksandr Yakushev
2a4a283987 perf: Work around Apache POI ColumnHelper performance bug (#45667) 2024-07-17 12:22:07 +03:00
Cam Saul
8aeebaa2ea Debug QP improvements from today's eng demo (#45376)
* Debug QP improvements from today's eng demo

* More taps

* Fixes 🔧
2024-07-16 20:00:25 -07:00
Tim Macdonald
1a07aa45ed Add type hints to dev/migrate.clj to avoid reflection warnings (#45679) 2024-07-17 01:58:52 +00:00
bryan
5c62992b7d add defendpoint dox (#45683)
* get-sub-props -> ->sub-props because it doesn't 'get' anything

* add defendpoint dox

* make style consistent

* respond to review comment

* fix formatting
2024-07-16 22:50:04 +00:00
Noah Moss
4431c4acfa Refactor perms middleware to enforce view-data at the table-level (#45615) 2024-07-16 18:36:48 -04:00
Case Nelson
36b7c2dc13 fix: add timezone to bigquery param substitution (#45661)
* fix: add timezone to bigquery param substitution

Fixes #43597

* Fix indentation and remove report-timezone lookup from loop
2024-07-16 16:25:09 -06:00
Nemanja Glumac
bdcf0f2e19 Fix typo in the (segment) Revision logic (#45651) 2024-07-16 23:30:21 +02:00
Nick Fitzpatrick
72d36b0f9c Adjusting unit tests (#45643) 2024-07-16 17:06:49 -03:00
Nick Fitzpatrick
dcfdbec602 Alert on asset download error (#45444)
* Alert on asset download error

* moving function to metabase global

* removing alert, adjusting e2e test

* update CSP
2024-07-16 17:05:00 -03:00
Alexander Polyankin
738cb39cd1 Fix field values endpoints in public & embedded dashboards (#45659)
* Fix field values endpoints

* E2E tests
2024-07-16 18:53:12 +00:00
github-automation-metabase
55d4f0fd70 Add v0.49.21 to the list of releases (#45658) 2024-07-16 14:43:44 -04:00
metamben
f961d4fb9f Preserve display-name and long-display-name in aggregation expressions (#45502)
Fixes #13437.
2024-07-16 21:22:20 +03:00
Ryan Laurie
99a3681712 Reconcile Milestones with Release Branch before release (#44631)
* Reconcile release branch commits with milestone issues

polish up pre-release milestone check

add and trigger new github action

handle already fixed issues

updates

* cleanup

* replace global imports

* prettier install

* update imports
2024-07-16 11:56:32 -06:00
Nicolò Pretto
f4d1d87398 Embed pdf export - MS2 (#44463)
* add pdf export button to static embed and public sharing (#43743)

* add export button to embed frame, it works on static embed and public sharing

* move css around to make dashcard border show up on static/public embed pdf exports
the library we use to render an html node to an image doesn't seem to support box shadow
the original fix was done in ParametersAndCardsContainer, but that component is not used in the static/public embeds

* fix types

* fix night theme pdf export
- use padding for the title instead of starting to draw the image from 60px, to keep the bg color
- change the css to also apply the bg-color to the first child of the EmbedFrame, to make it work when exporting to pdfs, where the EmbedFrame is not part of the exported dom

* refactor: exportTabAsPdfButtonText function

* give a default to the filename, even though it should always be there

* exportTabAsPdfButtonText -> getExportTabAsPdfButtonText

* introduce .WithThemeBackground to not have a css rule too much generic

* feat: adds endpoint to download results of a dashcard part of a public dashboard (#44156)

* Flag to hide download buttons (#44206)

* pass down downloadsEnabled to hide downloads buttons in public and embedded questions or dashcards

* Update frontend/src/metabase/dashboard/components/DashCard/DashCardMenu/DashCardMenu.tsx

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

* PLUGIN_DOWNLOADS_ENABLED -> PLUGIN_RESOURCE_DOWNLOADS

* adds comment to areDownloadsEnabled function to explain what it does

---------

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

* logic to handle downloads url parameter (#44363)

* minimal support for downloads url parameter

* updates StaticEmbedSetupPane test to epxect downloads=false instead of hide_download_button=true

* fix prettier mistakes

* tmp fix to the tests until we have the new analytics events

* fix eslint issues

* update embedding snippets e2e

* update embedding questions e2e

* try to clean up the mess of downloads/downloadsEnabled

* adds `hasPremiumFeature` check to the plugin, adds unit test for the logic

* adds TODOS for analytics

* unit tests for downloads flag (#45178)

* fix download pdf button not showing up when titled=false and there's only one tab

* unit tests for downloads flag on dashboards and questions

* adds test about the container id, not sure if we should keep it

* adds a comment to explain why we enable premium features in the tests

* move downloadsEnabled outside of the Boolean cast as it's already a boolean

* E2E tests for public/static downloads (#45240)

* wip e2e tests

* make downloadUtils ts friendly

* assertNotEmpty function

* adds tests for public questions

* e2e tests for static embed downloads

* publicUid -> publicUuid

* fix assertNotEmpty

* fix parameter not renamed

* Apply suggestions from code review

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

* remove duplicated test

* fix another typo i forgot to rename

* fix another rename issue

* convert e2e-downloads-helpers to ts

* refactor: put method calculation in getEndpoint function

* adds note to downloadUtils

---------

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

* Update e2e/test/scenarios/embedding/embedding-snippets.cy.spec.js

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

* change requires to import to reflect that we changed to export the source code in downloadUtils

* makes downloadsEnabled prop more consistent across components

* colocate downloadsEnabled with hideDownloadButton in embed-display-options

* defaults displayOptions.downloads to true to simplify logic

* remove unused queryString parameter in tests setup function

* reword TODO

* Revert "defaults displayOptions.downloads to true to simplify logic"

This reverts commit aebf4cf3cf.

* fix png export when on dark theme (public/embed) not having the dark … (#45497)

* fix png export when on dark theme (public/embed) not having the dark background

* move the border-radius fix for the dashcard export to saveChartImage

* remove comments

---------

Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2024-07-16 19:27:40 +02:00
Nemanja Glumac
1890179ab9 FE part of #37893: Do not offer alerts for models (#45611)
* Do not display alert icon for models

* Add e2e repro for #37893

* Put the guard higher

* Fix unrelated test

* Go back to keeping the logic in `shouldRender`

* Remove whitespace
2024-07-16 19:10:25 +02:00
Chris Truter
d392a4984b Implement SQL Analysis worker (#45549) 2024-07-16 18:46:46 +02:00
Nemanja Glumac
386797b232 Fix typo in a task fetching error message logic (#45652) 2024-07-16 16:17:40 +00:00
Braden Shepherdson
bcff4138ee [QP] Test :results_metadata disambiguates column names eg. ID_2 (#45109)
This makes the names inconsistent with what's in `data.cols` on the same
API response(!) but consistent with what MBQL lib will return.
2024-07-16 11:28:45 -04:00
Alexander Polyankin
6fe489a1cc Optimize autocomplete filters in FilterModal (#45532)
* Optimize input in FilterModal

* Optimize input in FilterModal

* Fix
2024-07-16 11:11:02 -04:00
Alexander Polyankin
7eeb4b186f Fix string filters with multiple values in dashboards (#45599) 2024-07-16 10:04:53 -04:00
Jeff Bruemmer
c057f236cf docs - clarify caching policy interactions (#45584) 2024-07-16 10:01:01 -04:00
Kamil Mielnik
09ab44a3f9 Fix - useIsTruncated gives incorrect results (#45625)
* Get rid of tolerance

* Use range rect and element rect instead of clientWidth/clientHeight/scrollWidth/scrollHeight

* Fix types

* Mock Range.prototype.getBoundingClientRect

* Mock getBoundingClientRect in unit tests
2024-07-16 13:49:47 +00:00
github-automation-metabase
00d574e586 Update Readme version references and published npm version to 0.1.20 (#45639) 2024-07-16 12:33:50 +00:00
Kamil Mielnik
35c8477120 Fix - Data source picker sources not refreshed after archiving a question (#45570)
* Add repro for #32252

* Have a test for archiving a question and a collection

* Refactor cy.createCollection and cy.archiveCollection to TS

* Refactor collection and user helpers to TS

* Keep collection helpers together

* Sort code

* Format code

* Use new createCollection helper

* Add return type to createCollection

* Fix typing

* Fix #32252

* Fix typing

* Deprecate openNewCollectionItemFlowFor

* Revert "Fix typing"

This reverts commit ecf3179868.

* Fix TS error
2024-07-16 11:56:31 +00:00
Phoomparin Mano
dfab26710d fix(sdk): rename scalar theme option to number (#45610)
* rename scalar to number

* try to update loki reference image

* change scalar to number

* update loki reference image
2024-07-16 18:55:16 +07:00
Phoomparin Mano
97cfe29e89 feat(sdk): add useMetabaseAuthStatus hook to get current authentication status (#45606)
* add authentication status hook

* update docs
2024-07-16 18:00:32 +07:00
Phoomparin Mano
b5fa28e210 fix(sdk): sync fetch request token function with store (#45596)
* sync fetch request token function with store

* update unit test

* update docs

* use re-render to rerender test
2024-07-16 17:51:47 +07:00
Oisin Coveney
e1869d52bc Fix padding for QueryDownloadPopover (#45627)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-07-16 10:45:13 +00:00
Kamil Mielnik
642e333d96 Refactor e2e collection helpers and commands to TS (#45624)
* Refactor cy.createCollection and cy.archiveCollection to TS

* Refactor collection and user helpers to TS

* Keep collection helpers together

* Sort code

* Format code

* Add return type to createCollection

* Fix typing

* Deprecate openNewCollectionItemFlowFor
2024-07-16 10:41:42 +00:00
Ngoc Khuat
2767fce7ad Batch processing usage metadata (#45007) 2024-07-16 10:38:50 +00:00
Kamil Mielnik
1e5bef2a0c Fix - More than 10 Series (using Add Series Dashboard Feature) cause Filter UI to be inaccessible (#45550)
* Add a repro for #43219

* Fix #43219

* Create questions in parallel

* Make 2 elements scrollable so that the 'Make sure to make a selection ...' element is not weirdly cut off when scrolling horizontally to see inside of parameter-mapper-container

* Fix assertion

* Be more specific which element is to be scrolled

* Avoid realMouseWheel which does not work reliably in CI
2024-07-16 14:46:05 +07:00
Nemanja Glumac
cc91b1c762 Fix #45594: Segment name is missing from the segment revision history title (#45604)
* Fix segment name in a revision history title

* Remove redundant `tableMetadata`

* Add repro for #45594
2024-07-16 09:39:47 +02:00
Ryan Laurie
efeab36be9 Swap out devex team (#45608) 2024-07-16 08:54:38 +03:00
Sloan Sparger
2984cdbe9c Skip fetching collection permissions graph on update (#45561)
* updates the fe to skip refetching the graph when updating the collection graph, adds tests

* Moves the skip_graph flag to be part of the body.

- the FE tooling makes it awkward for PUTs to include query params

* fixes failing unit tests

* pr feedback

---------

Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
2024-07-15 21:26:43 -06:00
Aleksandr Lesnenko
d224f1ad51 remove unnecessary explicit size (#45612) 2024-07-15 21:35:43 -04:00
adam-james
04dac01909 Add Temporal Units List to Dashboard Parameters Schema (#44454)
* Add Temporal Units List to Dashboard Parameters Schema

Closes: #44361

This adds an entry to the Dashboard Parameter schema so that we can validate
the list of temporal_units that might be passed from the frontend when adding
or updating the `Unit of Time` type parameters.

* This is the way

the real reason the schema wasn't working... well, it was, but the un-decoded versoin of parameters was being passed
to `update-dashboard` because inside defendpoint, you can use map destructuring and bind the whole map to whatever
with :as keyword.

If you decode/validate on all of the symbols in the destructuring, that's great, but if you then pass the map bound
with `:as whatever`, you don't get that decoded goodness, just the data that our http middleware produces (that is, it
might not be the shape you expect).

So, here I've created a private Schema for the :body of the request and use the same schemas to validate each key in
that map. The result should be the same but we can pass a fully decoded/validated map along.

* change test to look for the error in the right place
2024-07-15 23:21:30 +00:00
Ryan Laurie
20ab934fd5 Import updated translations (#45607) 2024-07-15 22:24:33 +00:00
Alexander Polyankin
7c254a936d E2E repro for "Selecting Exclude Hours of the day from Date Filter doesn't give the option to deselect 12:00 am" (#45603) 2024-07-15 21:20:33 +00:00
Ryan Laurie
7c97239c9a Fix translation imports (#45600) 2024-07-15 14:51:01 -06:00
Ryan Laurie
28070212e5 Automate docs version list update PR (#45048)
* automate version list update pr

* updates

* remove release-list babashka script 😢

* Revert "remove release-list babashka script 😢"

This reverts commit 372a570f9af030abd6f297116e14568b3b51afa6.

* add deprecation message
2024-07-15 14:06:50 -06:00
Ryan Laurie
49175b79c3 Automate (most of) updating translations (#36420)
* automate updating translations for major releases

* add reviewer to PR

* auto translate

* auto-translate works!

* update

* automate translation updates in CI

* fixes

* whitespace

* sort scripts

* just checkout the branch to begin with

* fix tests!

* fix import
2024-07-15 14:02:23 -06:00
Nemanja Glumac
7e4b748279 Fix segments revision history (#45581)
* Fix segments revision history

* Simplify fetchSegments selector

* Fix breadcrumbs

* Add E2E reproduction for #45577
2024-07-15 21:43:08 +02:00
Nick Fitzpatrick
26aaa6a84d prevent moving snippet collections into descendents, remove recents tab (#45477)
* prevent moving snippet collections into descendents, remove recents tab

* PR feedback
2024-07-15 16:06:56 -03:00
Ryan Laurie
fe2a5f5326 Run release code tests separately in CI (#45505)
* run release code tests separately

* remove extra install from frontend unit tests

* use the right dir

* fix dependency issues
2024-07-15 12:47:41 -06:00
Tim Macdonald
9c02ca6475 Make the Query Validator endpoint admin-only (#45573)
[Fixes #45572]
2024-07-15 19:52:12 +02:00
lbrdnk
cc5791f438 Update query-dependents (#44205) 2024-07-15 19:10:00 +02:00
Chris Truter
4ef76d2f0f Consolidate query analysis code (#45483)
* Consolidate query analysis code

* Tighten up more

* Missed a spot

* More encapsulation

* Remove blank line
2024-07-15 19:01:08 +02:00
Oisin Coveney
51c1d83ea6 fix(sdk): Allow mapping dashboard buttons for future customization (#45356) 2024-07-15 16:30:43 +00:00
Ngoc Khuat
8a870948cc update check sum of v50.2024-06-12T12:33:08 migration that was changed in #45539 (#45563) 2024-07-15 14:49:20 +00:00
Jeff Bruemmer
b14769401c notes on regexextract (#45442) 2024-07-15 10:31:15 -04:00
Jeff Bruemmer
bcd36c1ca9 add 50.13 to list of releases (#45562) 2024-07-15 10:21:34 -04:00
Ngoc Khuat
13a927ea57 update supported DB version for postgres to 12. 9.5 is out of support 3 years ago (#45535) 2024-07-15 13:35:22 +00:00
Ngoc Khuat
4a1d8ff425 fix cache config migration fails with float setting on mysql (#45539) 2024-07-15 13:32:36 +00:00
github-automation-metabase
eacabf921b Update Readme version references and published npm version to 0.1.19 (#45558) 2024-07-15 13:29:51 +00:00
Alexander Polyankin
38b532887a Fix underlying records drill from pivot tables (#45507) 2024-07-15 09:16:21 -04:00
Alexander Polyankin
2895cc3a2b fix(sdk): Remove default Count aggregation without triggering a query update (#45398)
* Remove default Count aggregation without triggering a query update

* Fix flaky test
2024-07-15 09:15:50 -04:00
Alexander Polyankin
49cda8b708 E2E repro for 43088: (#45533)
"Admins can't create queries on Metabase Analytics models"
2024-07-15 09:15:19 -04:00
Uladzimir Havenchyk
abf1c6b231 refactor: create typed dashboard reducers (#45156)
* Create typed dashboard reducers

* fix reference

* fix export

* Move more reducers

* move parameterValues

* fixup! move parameterValues

* rtkCreateAction -> createAction
2024-07-15 15:58:35 +03:00
Phoomparin Mano
fa335318ae feat(sdk): ability to pass parameters to static questions (#45498)
* parameterized static questions

* sdk parameter values

* use parameters to construct parameter input

* add a unit test for passing the correct parameters

* fix parameter parsing

* move TEST_PARAM to top of file

* update readme docs

* address code review
2024-07-15 19:40:32 +07:00
Uladzimir Havenchyk
037bf09f09 refactor: rework QueryModals to a functional component (#45457)
* refactor: rework QueryModals to a functional component

* destructure props
2024-07-15 11:52:56 +00:00
Nick Fitzpatrick
7f52f5b67f add support for disabled command palette items. Make search states disabled (#45432) 2024-07-15 08:51:07 -03:00
Romeo Van Snick
cc8a4f071d Add missing type in the base64 string for cards (#45482)
* Pass missing type to clean card in url

* Add reproduction for #34517
2024-07-15 12:27:00 +02:00
Kamil Mielnik
5a3ee5bd81 Repro #42949 - Create column actions always visible (#45487)
* Add repro for #42949

* Add more repros for #42949
2024-07-15 15:12:53 +07:00
Ngoc Khuat
78a25608c3 Temporarily disable tracking field usage (#45536) 2024-07-15 14:32:24 +07:00
Kamil Mielnik
79dcbb6f09 Repro #23857 - Inconsistent and confusing "Duplicate" action mechanism (#45465)
* Add repro for the frontend part of metabase#23857

* Avoid cy.visit
2024-07-15 14:31:29 +07:00
Aleksandr Lesnenko
1e808e6c80 fix legend order (#45446) 2024-07-12 21:17:21 -04:00
bryan
4dcd413fd0 add skip_graph to coll perm PUT (#45438)
* add skip_graph to coll perm PUT

- also no longer ignores revision and groups
  so we don't print this warning:
  2024-07-11 16:17:32,293 WARN api.common :: Unexpected parameters at [:put "/api/collection/graph"]: [:revision :groups]

* namespace should be a keyword

* decode the keyword

* add a typehint to avoid reflection

* Adds test for skip_graph

* handle revision 0 🤦
2024-07-12 16:56:41 -06:00
Alexander Polyankin
51bec61446 Do not reset table.columns when some column is deleted (#45509)
* Do not reset `table.columns` when some column is deleted

* Do not reset `table.columns` when some column is deleted

* Fix

* Fix

* Make API calls more obvious
2024-07-12 22:21:22 +00:00
Alexander Polyankin
b2104283e8 Add FE repro for the visual glitch when working with models that have an expression with the same name as the column (#45503)
* Add FE repro for #35840

* Add FE repro for #35840
2024-07-12 18:02:12 -04:00
Uladzimir Havenchyk
3e519b93be do not allow to render empty SaveQuestionModal content (#45476)
* do not allow to render empty SaveQuestionModal content

when question is already saved and QB rerenders still open SaveQuestionModal there is a moment when content is empty before modal is closed

* fixup! do not allow to render empty SaveQuestionModal content
2024-07-12 23:49:10 +02:00
Kamil Mielnik
d81046a6f3 Repro #26919 - Aggregating with Custom Column first doesn't show sub-totals in pivot table (#45479) 2024-07-12 23:47:26 +02:00
Nemanja Glumac
5707fcdce0 Fix model metadata tooltip visibility (#45508) 2024-07-12 23:31:08 +02:00
bryan
534951b7e4 parallelize coll perm graph group lookup (#45256)
* parallelize coll perm graph group lookup w/ core.async

* respond to code review

* add + uses ExecutorCompletionService map function

* rename test

* more tests

* no concurrency for cljs

* fix timeout + add more tests

* use claypoole

* cleanup

* add kondo hooks for claypoole

* cleanup

* Can't use libraries that don't have a license

Revert "add kondo hooks for claypoole"

This reverts commit 9d93b55b28.

* ignore unused value

-- TODO: check back in on claypoole to see if the kondo config gets merged

* fix linter
2024-07-12 20:30:21 +00:00
Ryan Laurie
676b48f139 Refactor issue tracing (#45034)
* refactor and improve milestone check code

* whitespace
2024-07-12 19:48:21 +00:00
Ryan Laurie
646dd399a8 Fix cross-version test flakes (#45440)
* fix cross-version flakes

* more flake fix

* fix slack message

* tired_face

* ref name is what I want already
2024-07-12 19:41:14 +00:00
Alexander Polyankin
fc789c2d71 Fix pivoted table crash (#45485) 2024-07-12 15:16:23 -04:00
Alexander Polyankin
fde8b90f48 Fix deselecting the last join column (#45475)
* Fix fields in joins

* Fix deselecting the last join column

* Update frontend/src/metabase/query_builder/components/notebook/steps/JoinStep/JoinStep.unit.spec.tsx

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

* Fix reference

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-07-12 14:53:53 -04:00
Ryan Laurie
f3a25fb38e remove zx/globals refs (#45500) 2024-07-12 18:22:41 +00:00
John Swanson
e1e8e0c4aa Don't set :max-rows in search (#45443)
This was a huge footgun.

We were accidentally limiting *ALL* queries run in our transducer to
1000 results. This included the query to fetch permissions, so when we
checked permissions we were checking a small percentage of your *actual*
permissions (e.g. 1000 / ~6300 for me on stats).
2024-07-12 15:44:17 +00:00
Uladzimir Havenchyk
38039ecf3b refactor: do not spread props to QueryModals (#45459) 2024-07-12 18:35:02 +03:00
metamben
8bd91f5fa9 Preserve type namespace of base-type in legacy-expression-for-expression-clause (#45331)
* Preserve type namespace of base-type in legacy-expression-for-expression-clause

Fixes #44584.
2024-07-12 18:13:06 +03:00
github-automation-metabase
a54fb927a2 Update Readme version references and published npm version to 0.1.18 (#45484) 2024-07-12 14:46:31 +00:00
Braden Shepherdson
52d772006a [perf] Fix remaining thread leak in BigQuery query execution (#45253)
This comes in two parts.

**Rebuilt query logic**

I rewrote the query exec logic to use one `future` and one `a/go` block,
reporting results to a `promise`. This is easier to follow and doesn't leak
threads like the original implementation with two `future`s.

The single future is guaranteed to exit. It blocks on the BigQuery call.
That will either complete or throw an exception. Either the exception or
the BigQuery result is sent to the promise, and then the future is
complete. The only reference to that future is overwritten after the `promise`
resolves, so the `future`, its closure, and its thread don't persist longer than needed.

**Return a reducible result**

Previously the results were returned as a lazy sequence, but that brings
a lot of `seq` overhead, and is a risk of retaining the entire result
set in memory until the query is all done. Above all, it doesn't support
`reduced?` to explicitly drop any further results.

The `thunk` function style of `qp.reducible/reducible-rows` doesn't fit
neatly here, so I implemented the reducible logic directly on top of the
`Iterable` BigQuery results.

**Verifying**

This is a bit tricky. I've been testing it like this:

- Add a BigQuery database to my instance
- Create a saved question and note its ID (say, 123)
- Create an API key in (EE) Metabase and save it in an env var
- Install the `siege` load testing tool
- Install VisualVM and monitor my Clojure REPL process's thread count
- `siege --concurrent=15 --time=30s --header="x-api-key: $API_KEY" "http://localhost:3000/api/card/123/query POST"`

That will create a bunch of new threads while it's getting called, but
within a minute of the last queries they'll gradually drop out of the
thread pools and it will return to the baseline number of threads.
2024-07-12 13:39:30 +00:00
Alexander Solovyov
007127f412 [serdes] spec check requires up-to-date db (#45455) 2024-07-12 15:05:13 +03:00
Oisin Coveney
f3b6e9bcee fix(sdk): Add README for dashcard menu modifications (#45417) 2024-07-12 14:45:17 +03:00
Uladzimir Havenchyk
cc300e671a Update fast-loops (#45415) 2024-07-12 11:41:48 +00:00
Alexander Polyankin
53955c281e Fix type/PK -> type/Name and type/FK field remapping in the QB (#45047) 2024-07-12 07:19:43 -04:00
Chris Truter
979c0d6635 Implement transfer queues for performing async backfills (#45408) 2024-07-12 13:09:04 +02:00
Romeo Van Snick
a6c785623c Do not show revert button for default parameter (#45216)
* Coerce value to array

* Add reproduction for #38083
2024-07-12 12:05:20 +02:00
Nemanja Glumac
250453b5e1 Repro #44435: Long text filters overflow the window width (#45377)
* Add reproduction for #44435

* Fix and skip the repro
2024-07-12 10:03:07 +02:00
Denis Berezin
7e6adfaa3f feat(sdk): Add event handlers docs, refactor handlers naming (#45374)
* Add event handlers docs for SDK

* Invert events logic and update documentation

* Apply prettier
2024-07-11 22:48:12 +00:00
Nemanja Glumac
dc75e08d94 chore: upgrade concurrently (#45419) 2024-07-11 15:05:41 -06:00
Phoomparin Mano
49926e6873 feat(sdk): support multiple interactive questions by decoupling from query builder reducer (#45133)
* create sdk load question

* store question result in sdk context

* remove dataset data type

* update question

* handle navigate to new card

* add loading states

* fix on query change

* update question change logic

* refactor question loading and query params

* fix ad-hoc question in dashboards

* extract useLoadQuestion into a separate hook

* cleanup run question on load

* revert changes in interactive question component

* store original question in the question result state

* turn the question into ad-hoc questions

* refactor run question methods

* add a separate isQueryRunning state for better ux

* isQueryRunning should default to false

* simulate re-running the query in unit tests

* add tests for rendering multiple valid questions

* refactor sync question method

* extract raw series and computed pivot logic

* add getCardAfterVisualizationClick

* separate single and multiple question tests

* fix import paths

* is question native

* pass queryResult instead of queryResults

* temporarily remove checkNotNull for aggregation picker to avoid sdk crash
2024-07-12 00:23:29 +07:00
Alexander Solovyov
8e3b98d8fb [serdes] allow entity ids in targets (#45290) 2024-07-11 20:14:49 +03:00
Nemanja Glumac
9c1d21c46d Fix the markdown preview in model details (#45413)
* Fix the markdown preview in model details

* Add repro for #34574

* Use real `Tab` instead of a blur

* Fix test flakiness
2024-07-11 18:26:48 +02:00
Ryan Laurie
5baa23dd3a Properly handle frontend test dependencies (#45433)
* properly handle frontend test dependencies

* better yarn syntax
2024-07-11 16:26:09 +00:00
lbrdnk
84651267d4 Restore foreign key support (#44572) 2024-07-11 17:42:05 +02:00
Aleksandr Lesnenko
17d2967757 funnel chart handle duplicated steps (#45333)
* handle duplicated funnel chart steps

* fix import
2024-07-11 11:26:55 -04:00
Kamil Mielnik
793561f519 Fix broken docs link (#45418) 2024-07-11 15:10:48 +00:00
Uladzimir Havenchyk
14d8ba142c fix: render children of DebouncedFrame only when width is specified (#45365)
It prevents blinking during QB loading - initially we rendered an absolute container with width 0 in the top left corner which caused a blink
2024-07-11 17:39:51 +03:00
Uladzimir Havenchyk
d797301953 fix: adjust Popover styles to avoid horizontal scroll on body (#45414) 2024-07-11 17:15:52 +03:00
Alexander Solovyov
855951533c [serdes] use spec instead of a pipeline for Card (#45209) 2024-07-11 13:58:42 +00:00
Ryan Laurie
515af74d44 Flaky test issue automation (#43714)
* WIP flaky test issue creator

* add summary and workflows

* adjust recent flake period

* code cleanup and add tests

* Update .github/workflows/flake-status.yml

Co-authored-by: Tim Macdonald <tim@metabase.com>

---------

Co-authored-by: Tim Macdonald <tim@metabase.com>
2024-07-11 07:48:46 -06:00
Oisin Coveney
e62d098b6d Split dashboard header buttons into files (#45232) 2024-07-11 12:17:02 +00:00
Kamil Mielnik
359ae5804d Fix flaky collections test (#45370)
- getAllCollectionItemNames was breaking the chain in Cypress, so assertions did not know how to wait for DOM to be updated
2024-07-11 13:39:27 +07:00
Nemanja Glumac
b8948be99a Fix and reproduce #45300: Broken filter modal when joining using FKs (#45304)
* Add repro for #45300

* Remove empty line

* Fix

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2024-07-11 00:21:57 +00:00
adam-james
763dc88786 Dashboard Paramter Value Now Works in Preview Embed (#45265)
* Dashboard Paramter Value Now Works in Preview Embed

Fixes: #44962

Prior, a common util fn used both in the embed and preview_embed endpoints was causing the preview_embed to error out
when fetching dashboard parameter values because it was checking if embedding was enabled. This check is needed for
the normal embedding endpoints, but we want the preview embed endpoints to work without needing to publish the
dashboard first.

* pass proper args

* put args back in proper order.

oops

* change form back to previous, but keep preview check

* autocorrect mistake? Or perhaps a silly typo?

* change one test to show that the preview flag is working

Didn't create a whole new test for this flag as it is provable just by adjusting this test to not bother enabling
embedding on the dashboard.

* improve the docstring
2024-07-10 23:45:22 +00:00
bryan
e32b7c036c Async coll perm graph revision (#45258)
* Log changes when they make sense + async coll perm-graph revision

* - Make revision-number consistent

Decouples the creation of a revision number from the (potentially
expensive) writing of before and after for the coll perms-graph
revision.

* get id from the perms revision entity

* Move the revision id creation into the transaction

The revision id creation should only happen iff the perm updates went
through successfully.

* write a test that checks the incomplete revision

* remove sleep from tests
2024-07-10 16:36:49 -06:00
Cal Herries
a99081cddd Soft-delete defective duplicate fields (#45151) 2024-07-10 21:29:06 +00:00
Nick Fitzpatrick
cd53fa9384 Migrate Model Indexes to RTK (#43981)
* Migrate Model Indexes to RTK

* Sorting out types... I think?

* remove unneeded comment

* replacing the selector with an initiate to ensure that there is data

* catching and throwing error

* Updating unit tests
2024-07-10 17:12:06 -03:00
Jeff Bruemmer
ce477eed28 docs - add note about parameters for datetime functions (#45388) 2024-07-10 16:09:46 -04:00
John Swanson
e0762f613a Make import work on a fresh install (#45297)
This introduces a new metadata on commands, `:requires-init`. If set,
we'll run `metabase.core/init!` before running the command. `init!` will
initialize the database and run our normal startup, though it won't
actually start the Metabase server.

This allows you to use

```
env MB_CONFIG_FILE_PATH=... java -jar metabase.jar import /my/metabase/export
```

We'll run the normal init process (creating the internal user, loading
from the config file, etc), then run the command.

On my machine this adds about 2-3 seconds to the time it takes to run an
`import`.
2024-07-10 12:43:55 -07:00
adam-james
97ef3d16dd Static Viz and Exports/Downloads Respect Dashcard Viz Settings (#45164)
* start adding some util fns to download-exports-test ns

* wip improving test util fns

* add subscription attachment util fn

* add tests to catch download/export differences

* viz-settings from card and dashcard  merged properly

* revert these changes which probably aren't needed

* split test: downloads can be parallel, email attachments cannot

* normalize viz-settings no matter their origin

* Update test/metabase/api/downloads_exports_test.clj

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

* Incorporate some review feedback

* rendered table cards also respect column names

* Clean up table render tests and remove unhelpful render test utils

The big removal of code in the render test utils namespace is a clean up task that could've happened sooner, but this
table test adjustment is the perfect opportunity to clean up.

I had made the test utils before I truly knew how best to use `mt/with-temp`, so it had a lot of poorly implemented
'generators' that were doing a poor job of creating mock data for the rendering functions anyway.

So, reworking a few table tests here to just use a temp card is way more inline with the rest of the codebase, and
actually improves confidence that the tests are testing on well-formed data to begin with.

---------

Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2024-07-10 19:23:42 +00:00
Noah Moss
fe73834439 put the backport disclaimer on one line so that it wraps properly when rendered (#45380) 2024-07-10 15:07:21 -04:00
bryan
bc32ba9e15 Add admin-only user-local setting that controls perms tutorial (#45076)
* add admin-only user-local setting that controls perms tutorial

* Adding modal and banner, user setting for dismissable banner

* copy changes

* adjust so modal only appears on data permission page

* e2e adjustments, adding banner test

* never show the modal or banner on new instances

* add test

* e2e adjustments, copy update

* more PR feedback

* move modal/banner settings & tests + clarify tests

* query for v50 migration execution works on mysql

- move changelog lookup into metabase.db.liquibase

* no race conditions in changelog-table-name

The previous implementation of this function was hitting this
liquibase issue: https://github.com/liquibase/liquibase/issues/2966

* revert changelog-table-name

- simply lookup the changlog row

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2024-07-10 13:06:19 -06:00
Cal Herries
60919cce5c Add default value to report_card.last_used_at (#45323) 2024-07-10 19:00:25 +00:00
Nemanja Glumac
2e773875f6 Repro #45036 and #44910: Multiple popovers can be opened simultaneously (#45369)
* Reproduce #45036

* Add repro for #44910
2024-07-10 17:36:22 +02:00
Kamil Mielnik
e52eaee0ba Repro #45359 - Incorrect font in e2e tests in CI (#45274)
* Add a test verifying that fonts are loaded

* Verify font is mentioned in HTML

* Bring back working assertions

* Add wait

* Disable speedy

* Disable CSP and emotion cache

* Revert "Disable CSP and emotion cache"

This reverts commit 573e99bfa4.

* Revert "Disable speedy"

This reverts commit 6f9962b869.

* Don't use local fonts

* Revert "Don't use local fonts"

This reverts commit 17c58aa73d.

* Force Lato

* Fix storybook file name

* ESLint

* Add more !important

* Revert !important

* Add font-family assertion

* Move test
2024-07-10 21:38:22 +07:00
Tim Macdonald
0d563b7af9 REST API endpoint for Query Validator Tool (#45137) 2024-07-10 16:23:10 +02:00
Nemanja Glumac
10d98f264c Repro #40622: Filter modal UI breaks when there are many tables in a question (#45352) 2024-07-10 20:41:09 +07:00
Chris Truter
d814074bea Bump macaw to 0.1.65 (#45354)
A bunch of small improvements, notably a timeout and support for MSSQL square bracket quotes.
2024-07-10 12:04:11 +00:00
Ryan Laurie
fb0daedfc1 Fix cross-version tests (#44691)
* try fixing cross-version tests

* restore legacy metrics

* its not legacy in v43

* Dont got echarts either

* newfangled echarts

* run cross-version tests on code changes in the tests

* enable slack message

* don't always run cross-version tests

* whitespace
2024-07-10 11:57:35 +00:00
github-automation-metabase
778c5da996 Update Readme version references and published npm version to 0.1.17 (#45350) 2024-07-10 10:20:58 +00:00
Chris Truter
e91850954a Add dialect based feature flags for macaw (#45234) 2024-07-10 12:07:22 +02:00
Phoomparin Mano
7af7213e64 feat(sdk): ability to specify a function to fetch the refresh token (#45313)
* add refresh auth token function

* provide a default implementation for refreshing auth tokens

* rename getRequestToken to fetchRequestToken

* add docs on customizing jwt authentication

* clarify docs, add error handling and failing tests

* update tests to pass

* re-export FetchRequestTokenFn type

* re-export EmbeddingSessionToken type
2024-07-10 16:55:45 +07:00
Cal Herries
4db6ede44a fix uniqueConstraintExists precondition (#45336) 2024-07-10 04:47:27 +00:00
Denis Berezin
51330810cb feat(sdk): Add Dashboard loading event handlers (#45153)
* feat(sdk): Add Dashboard loading event handlers

* Refactor to redux state

* Fix logic with load with cards data

* Fix nasty e2e fails

* Fix nasty e2e fails

* Add global events

* Fix issue with loading event

* Fix issue with loading event

* Review fixes

* Add unit tests

* Fix unit tests
2024-07-10 02:07:58 +03:00
Cal Herries
b39e3e8251 Extend dev/migration-sql-by-id with db-type argument (#45249) 2024-07-09 22:57:17 +00:00
Alexander Polyankin
395a0949c3 Sync table.columns and graph.metrics viz settings based on the desired column alias (#45237) 2024-07-09 22:05:22 +00:00
Jeff Bruemmer
d22913439a warning for mysql (#45322) 2024-07-09 17:43:19 -04:00
Uladzimir Havenchyk
a7cd3ab4bc perf: pass uuid to BE to enable metadata caching during fetching dashboard (#45210)
* perf: pass uuid to BE to enable metadata caching during fetching dashboard

* fixup! perf: pass uuid to BE to enable metadata caching during fetching dashboard

* Add wildcard on interceptions

* Add tests
2024-07-10 00:25:43 +03:00
Aleksandr Lesnenko
658a71f5b7 fix funnel chart settings crash on null (#45262) 2024-07-09 21:09:03 +00:00
Aleksandr Lesnenko
7c7d189234 fix incorrect y-axis extent computation (#45159) 2024-07-09 20:51:15 +00:00
Alexander Solovyov
ebe2b8726f restrict open redirects imitating no host in them (#45278) 2024-07-09 20:14:29 +00:00
Noah Moss
2a1d585156 Exclude internal content when populating :has_question_and_dashboard for current user. (#45317) 2024-07-09 20:01:56 +00:00
John Swanson
11e9a7d5a2 Lock down the Trash collection (#44921)
Prevent anything from being moved to the trash, or created in the trash.
2024-07-09 19:09:31 +00:00
Alex Yarosh
374483b74e docs: add releases (#45316) 2024-07-09 15:00:17 -04:00
Aleksandr Lesnenko
eb8555a683 fix object detail view is not scrollable on mobile (#45312) 2024-07-09 14:57:02 -04:00
Phoomparin Mano
a81b51e2bf remove the --force flag from installation guide (#45311) 2024-07-09 18:41:24 +00:00
dpsutton
d97465fc1e Fixes the formatting (#45308)
Before
====

```
2024-07-04 15:54:39,084 INFO metabase.server :: Shutting Down Embedded Jetty Webserver
Exception in thread "Thread-9" java.util.IllegalFormatConversionException: f != java.lang.Long
2024-07-04 15:54:39,122 WARN db.liquibase :: (#object[liquibase.Liquibase 0x2b7e6614 liquibase.Liquibase@2b7e6614])
	at java.base/java.util.Formatter$FormatSpecifier.failConversion(Unknown Source)
	at java.base/java.util.Formatter$FormatSpecifier.printFloat(Unknown Source)
	at java.base/java.util.Formatter$FormatSpecifier.print(Unknown Source)
	at java.base/java.util.Formatter.format(Unknown Source)
	at java.base/java.util.Formatter.format(Unknown Source)
	at java.base/java.lang.String.format(Unknown Source)
	at clojure.core$format.invokeStatic(core.clj:5770)
	at clojure.core$format.doInvoke(core.clj:5764)
	at clojure.lang.RestFn.invoke(RestFn.java:423)
	at metabase.db.liquibase$wait_for_all_locks.invokeStatic(liquibase.clj:258)
	at metabase.db.liquibase$wait_for_all_locks.invoke(liquibase.clj:251)
	at metabase.db.setup$release_migration_locks_BANG_.invokeStatic(setup.clj:175)
	at metabase.db.setup$release_migration_locks_BANG_.invoke(setup.clj:170)
	at metabase.db$release_migration_locks_BANG_.invokeStatic(db.clj:91)
	at metabase.db$release_migration_locks_BANG_.invoke(db.clj:86)
	at metabase.core$destroy_BANG_.invokeStatic(core.clj:90)
	at metabase.core$destroy_BANG_.invoke(core.clj:81)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.base/java.lang.Thread.run(Unknown Source)
```

And now it will correctly log

```
2024-07-09 16:04:28,345 INFO db.liquibase :: Waiting for migration lock(s) to be released (max 0.4 secs)
```

Why no tests?
====

There _is_ a test that would have caught this. And in fact running at
the repl will catch it:

```clojure
liquibase=> (do (require 'clojure.test 'metabase.db.liquibase-test)
                (clojure.test/run-test metabase.db.liquibase-test/wait-for-all-locks-test))

Testing metabase.db.liquibase-test

ERROR in (wait-for-all-locks-test) (Formatter.java:4515)

:h2
 Will timeout if a lock is not released
expected: (= :timed-out (liquibase/wait-for-all-locks sleep-ms timeout-ms))
  actual: java.util.IllegalFormatConversionException: f != clojure.lang.Ratio
```

But this _passes_ in CI:

```
❯ clj -X:dev:test :only metabase.db.liquibase-test/wait-for-all-locks-test
Finding tests took 23.5 s.
Running 1 tests
Running before-run hooks...

Ran 1 tests in 1.461 seconds
3 assertions, 0 failures, 0 errors.
{:test 1, :pass 3, :fail 0, :error 0, :type :summary, :duration 1461.175042, :single-threaded 1}
Ran 0 tests in parallel, 1 single-threaded.
Finding and running tests took 25.0 s.
All tests passed.
Running after-run hooks...
```

And that's because the log level in testing is FATAL and this is an INFO
level log.

Discussed ways to improve this like adding a null logger during CI but
we aren't ready to increase CI times for that just yet.
2024-07-09 12:16:21 -05:00
Nick Fitzpatrick
3c7cc680c5 move subtext to command palette item generation. Support model-indexes (#44638)
* move subtext to command palette item generation. Support model-indexes

* changing text, adding unit tests

* PR Feedback
2024-07-09 13:46:29 -03:00
Nicolò Pretto
797e9d02d6 fix flaky unit test by removing un-needed waitForElementToBeRemoved (#45291) 2024-07-09 17:44:43 +02:00
Jeff Bruemmer
911dafbefe copy change in csv modal (#45185) 2024-07-09 10:38:17 -04:00
Nemanja Glumac
f434c6c986 Add the default pinned metric description (#45287)
* Add the default pinned metric description

* Expand unit tests to repro #45270
2024-07-09 16:21:36 +02:00
Oisin Coveney
57ce93aaec feat(sdk): Add overflow menu options to Interactive Dashboard cards (#45138) 2024-07-09 17:18:17 +03:00
Cal Herries
d1d3c97f73 Only drop idx_uniq_field_table_id_parent_id_name if it exists (#45246) 2024-07-09 07:57:58 -06:00
Nemanja Glumac
6946a5d3dd Enable "Add to dashboard" for metrics v2 (#45271)
* Enable "Add to dashboard" for metrics v2

* Add repro for #44220
2024-07-09 13:58:04 +02:00
Romeo Van Snick
9b167f7cbc Pass missing size to info icon (#45272) 2024-07-09 12:04:50 +02:00
Alexander Solovyov
30c0bd021a /api/testing/set-time: ability to set JVM time during development (#45230) 2024-07-09 09:49:07 +00:00
Ngoc Khuat
aa110f2e09 Use team instead of group for auto request review (#45221) 2024-07-09 16:01:27 +07:00
Elton Okawa
d237bb3158 refactor: Tests depend on exported default polling value (#45264) 2024-07-09 09:38:08 +02:00
Romeo Van Snick
43e09e64e5 Do not insert newlines when typing text in the native editor. (#45129)
* Move focus to separate helper

* Use focus method to do initial focus

* Use focus method for other _editor.focus calls

* Move focus to componentDidMount

* Cancel focus timeout  on unmount

* Add delay to broken test

* Switch to requestAnimationFrame

* Remove wait in test
2024-07-09 08:57:31 +02:00
Noah Moss
2d7891b8ed Allow unrestricted data perms to override block even if another table has legacy no-self-service (#45118) 2024-07-08 23:17:04 +00:00
Aleksandr Lesnenko
b54d62c8f2 fix stacking settings on line charts (#45197) 2024-07-08 19:05:45 -04:00
Aleksandr Lesnenko
600fe62a4b Fix combined cards crash when cards have invalid settings (#45115)
* fix combined cards crash when some cards have invalid viz settings

* fix mock column was not metric

* ensure combined scalar column has proper type to handle the case when the card returns empty results
2024-07-08 19:05:02 -04:00
metamben
5f400a76da Remove SQL Server rowcount-override support (#44029)
Fixes #39789.
2024-07-09 01:14:57 +03:00
Raphael Krut-Landau
431a9395d3 fix: Don't require submit buttons to have the 'filled' variant (#45247)
This PR also specifies the 'filled' variant for the question duplication
modal, since the previous default 'filled' variant for submit button was
added to make that specific button filled.
2024-07-08 17:06:20 -04:00
bryan
fdd75ffca2 Remove enable nested queries (#44447)
* update e2e test for command pallete to use a valid setting

* remove the setting from the ui, make it always true, unless set false from env

* remove enable-nested-queries from admin section on fe

- fix unused oldValue -> _oldValue

* tests aren't allowed to change enable-nested-queries

* fix test + disallow setting nested queries from code

* we cannot set enable-nested-queries

- set the env var instead

* add checks for the enable-nested-queries setting

* make resolve-source-cards work with enable-nested-queries setting

* fix recents uri interception

* return enable_nested_queries setting to client

* adjust fetchmock url matcher

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2024-07-08 15:04:59 -06:00
John Swanson
775d7183bb Nicer error messages for linting migrations (#43667)
* Nicer error messages for linting migrations

In general, just throw exceptions instead of using clojure spec here.

You'll only get one error per run, but that seems fine.

I did keep some specs around, but run them slightly differently. Rather
than validating the whole collection of changeSets at once with `s/+`,
just `doseq` through the changeSets and validate each one separately.

That way, the value that's presented as erroneous is much smaller (a
single changeSet) and it's easier to see what went wrong.

* Update bin/lint-migrations-file/test/lint_migrations_file_test.clj

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

* Update bin/lint-migrations-file/src/lint_migrations_file.clj

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

* Require preConditions for certain liquibase change types to encourage idempotence (#44578)

Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>

* remove `!`s from non-side-effecty fns

* add preConditions to a few v51 migrations

---------

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2024-07-08 13:55:39 -07:00
Jeff Bruemmer
889e92a9ca docs - note on info schema (#45244) 2024-07-08 16:42:32 -04:00
Noah Moss
5bdabe119c Batch permission updates with many tables (#45110) 2024-07-08 15:37:47 -04:00
Cam Saul
958aaa90e2 Require Card ref permissions to use Card reference template tag in native query (#45000)
* Split unrelated changes into separate PR

* Fix test since user perms set reset fix split into other PR

* Fix syntax error

* Test fixes 🔧

* Test fix??? 🔧

* Test fix 🔧
2024-07-08 13:52:18 -04:00
Noah Moss
040ff46b84 Don't return an archived dashboard as the most recently viewed dashboard (#45229) 2024-07-08 13:41:40 -04:00
Nemanja Glumac
b6df6e217c Fix #44754: qbnewq modal can't be dismissed with keyboard (#45148)
* Use Mantine Modal for QB Newb disclaimer

* Add repro for #44754

* Use theme spacing units

* Tweak the design slightly

* Fix E2E test
2024-07-08 15:50:53 +00:00
Nemanja Glumac
beb5b3f360 Use filled button variant for the "Duplicate entity" modal (#45218) 2024-07-08 14:56:48 +00:00
Jeff Bruemmer
d8ddaa9247 add note about MySQL and MariaDB re: offset (#45219) 2024-07-08 10:47:52 -04:00
Jeff Bruemmer
77417112d1 add 50.10 to list of versions (#45190) 2024-07-08 10:47:25 -04:00
lbrdnk
d53e7e493b Add tables pre-fetching to dashboard load (#45107)
* Move collect-source-tables to util

* Add table prefetching

* Add test comparing call counts of select

* Update comment

* Add exception handling

* Add nil handling

* Handle possibye empty table-ids

* Update exception handling and test case

* Update src/metabase/models/card.clj

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

---------

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2024-07-08 16:18:25 +02:00
Nick Fitzpatrick
c44d88e97c Fix Menu button in admin app on mobile view (#45058)
* use useClickOutside, add repro test

* adjusting aria label
2024-07-08 10:45:29 -03:00
Tim Macdonald
a35ed3cd00 Alphabetize EE API routes (#45215)
(Cleans up [#45137])
2024-07-08 13:43:02 +00:00
Nemanja Glumac
1f0712f2cc fix: Do not collide "no results" with "running the query" (#45167)
* Do not colide "no results" with "running the query"

Fixes #41464

* Add E2E reproduction for #41464
2024-07-08 14:05:17 +02:00
Mahatthana (Kelvin) Nomsawadi
7ff39c9e3b docs(sdk): Document how to reload Metabase embedding SDK components (#45194)
* Document how to reload Metabase embedding SDK components

* Improve readme clarity on useEffect block
2024-07-08 12:41:28 +01:00
Uladzimir Havenchyk
a2fb599a8d ci: pin replayio version (#45122) 2024-07-08 14:38:38 +03:00
Oisin Coveney
d784c95928 Use Mantine Components for QueryDownloadWidget and QueryDownloadPopover (#45104) 2024-07-08 11:49:21 +03:00
Uladzimir Havenchyk
59199fdd5a refactor: drop unused js file (#45183) 2024-07-08 10:59:50 +03:00
Cal Herries
446bb823c1 Allow defective duplicate fields (#44866) 2024-07-05 19:47:06 +00:00
Alexander Polyankin
28513ae886 Remove field ref matching from table.columns (#45180) 2024-07-05 19:41:37 +00:00
Uladzimir Havenchyk
c168b34ee3 lint: add stylelint support for emotion components (#45132)
* lint: add stylelint support for emotion components

* drop comment

* fix pattern order

* Use one version of typescript

* use :focus not :outline

* Use the logical CSS property "inset-inline-start:" (not "inline-start:" which doesn't exist) as replacement for the physical css property "left:"

* Use mb-color-focus for focus color

* Drop dead code

---------

Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
2024-07-05 20:59:46 +03:00
Case Nelson
e3378d4ea9 fix: limit xrays on agg models to source fields (#44863)
* fix: limit xrays on agg models to source fields

Fixes #43793

1. `table-like?` was checking aggregations but not breakouts. This meant
   that legacy metric definitions would try to apply to the second stage
   which is generally illegal and would cause things like implicit joins
   to come in where they make no sense.
2. Trying to bin a `count` metric-like model would give a bin span of
   0.0 which would blow up those questions.
3. Trying to self reference breakout fields, in the precense of a
   question's  aggregation meant that most fields would not be exposed to
   the next stage and should be ignored. (similar to 1.)

* Fix tests
2024-07-05 11:31:42 -06:00
Cal Herries
0a54587cd5 Skip fingerprinting or scanning field values for fields with base-type=type/Collection (#45160) 2024-07-05 11:13:31 -06:00
Cal Herries
d60facf3fc Add INFO log for each table before JSON unfolding during field sync (#45162) 2024-07-05 10:14:10 -06:00
Anton Kulyk
77e1a47228 Show alert sending time in alert form (#45062)
* Show alert sending time in alert form

* F
2024-07-05 16:33:12 +01:00
Alexander Polyankin
41250c623f Remove field refs from DatasetEditor (#44999) 2024-07-05 10:50:12 -04:00
Alexander Solovyov
b200d29857 fix serialization errors we get on big old databases (#45177) 2024-07-05 16:54:48 +03:00
Romeo Van Snick
0d5bc020d7 Allow setting labels for filters (#44352)
* Add csv-stringify package

* Split values at comma

WIP: Parse values using json

* Add label to ParameterValue and add ParameterValue to value config

* Use custom label in FieldValuesWidget

* Allow passing displayValue from outside of RemappedValue

* Allow passing displayValue in ParameterFieldWidgetValue

* Get custom value label in FormatterParameterValue

* Allow rendering custom displayValue in FieldValuesWidget

* Add custom ParameterValue types

* Fix ParameterValuePicker type

* Fix jest import for csv-stringify

* Add missing RTKQ exports for paramters

* Use direct implementation of useGetParameterValues

* Fix ValueSourceModal tests

* Add tests for value parsing and stringifying

* Use custom label in list too

* Render the custom label in a parameter value

* Setup parameter mocks in embed test

* Add info about splitting values with comma

* Add model hint when user is using labels

* Add test for cusom labels on dashboards

* Handle label-value pairs in test

* Test custom labels in parameter search input

* Use the label to parse the value for text inputs

* Fix comma's to commas

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

* Use strong instead of styling link

* Use getInput instead of ignoring eslint rule

* Use arrow function

* Add newlines between tests

* Use uppercase for test value

* Name value

* Use getLabel and getValue helpers to avoid indexing confusion

* Pull out confusing condition

* Move out getLabel helper

* Be more explicit about non-existent config values

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

* Move setupParameterValuesEndpoints to setup

* Add loading state

* Do not use alert to implement info box

* Fix formatting

* Remove undefined from getValue signature

* Use getLearnUrl

* Remove dependency on column

* Make custom field labels work in the absence of fields

* Support custom values for non-field parameters

* Add test for native question parameters

* Add newline in test

* Add test case for when show-metabase-links is false

* Just fall back to rendering value when fetching label, or in case it failed

* Add test for loading state of FormattedParameterValue

* Do not fetch custom label for FormattedParameterValue

* Add table with ip addresses

* Add test for IPAddress filter with custom labels

* Add test for custom labels on type/Quantity fields

* Remove getInput helper in test

* Remove unused hasCustomLabel value

* Split up into common and premium tests

* Make fieldValues a map for performance

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2024-07-05 14:05:25 +02:00
Elton Okawa
b78222eac1 Fix/logs keep pooling after unmount (#44585) 2024-07-04 23:44:54 +02:00
Nemanja Glumac
ba55d38aaf Repro #39504: Pivot table disappears (#45143) 2024-07-04 20:31:34 +00:00
Case Nelson
6495def057 fix: param-fields when native model is aggregated (#45068)
* fix: param-fields when native model is aggregated

Fixes #42829

The param-field lookup required result_metadata to match
filterable-columns in order to find parameter targets. This adds a
fallback where if the param field is missing from result_metadata,
then we look at filterable-columns.

* Unskip test
2024-07-04 14:00:20 -06:00
adam-james
6b3dc8e831 Fix Wrong Migration IDs for User Parameter Values Migration (#45120)
Per discussion in Slack, I made a mistake with the migration IDs as I wanted to backport to 50 but used 51 IDs.
This PR uses 50 IDs and places the migrations in the correct place.

Not sure if it's mergable in this state because Stats has run with the PR containing the incorrect migration IDs.
2024-07-04 11:35:29 -07:00
Alexander Polyankin
9fc1a21030 Fix actions menu permission checks (#44931) 2024-07-04 12:08:03 -04:00
Romeo Van Snick
f022f911b9 Refine the reproduction for " Entity picker surfaces recent questions that are not valid joins" (#44974) (#45091)
* Refine the reproduction for 44794

* Move skip to top-level again

* Remove superflouous click

* Verify wether or not the recents tab exists and is open

* Make the test description more descriptive

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

* Move question details to a variable

---------

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2024-07-04 18:04:21 +02:00
Braden Shepherdson
ee52a52a52 [repro] Add e2e repro for Zoom In on pivot tables row headers (#45066)
This works on master, but this reproduction will prevent #38265 from
reoccurring.
2024-07-04 08:46:04 -04:00
Alexander Polyankin
07b98cee6a E2E repro for "Editing Column description of Model is confusing if it contains aggregations" (#45113)
* Fix checks and tests

* Fix checks and tests
2024-07-04 08:44:36 -04:00
Uladzimir Havenchyk
ec6e1f80f9 Pass correct redux action name (#44970) 2024-07-04 13:54:32 +03:00
Alexander Solovyov
638d79c457 [serdes] a bit more descriptive exceptions (#45093) 2024-07-04 07:28:24 +00:00
Mahatthana (Kelvin) Nomsawadi
bd9355233f Reproduce #27643: Field filter linked to Boolean column causes an error when used in Embedding (#45038)
* Add a repro for #27643

* Clarify the race condition behavior in the comment
2024-07-04 06:55:31 +01:00
Noah Moss
00c318ea95 Ignore unknown columns when reverting cards and dashboards (#45067) 2024-07-03 23:23:48 +00:00
adam-james
bac53b24cf User Parameter Values Are Unique Per Dashboard (#45064)
* User Parameter Values Are Unique Per Dashboard

Fixes: #43001

Might be related: #44858

User Parameter Values previously stored just the `parameter-id` and `user-id` as data to look up the last used
parameter value. This isn't sufficient as the parameter id is not guaranteed to be unique, in particular this is true
when a dashboard is duplicated: the parameters are copied to the new dashboard without changing the parameter id at
all.

This means that we need to also store the dashboard-id in the user_parameter_value table and use that to update/get
the last used value.

The migration removes existing entries to the user_parameter_value table because I want a non-nullable constraint on
the dashboard_id column, and existing entries will not have a value. The only way to backfill those values would be to
look through every dashboard containing parameters, and for every parameter check for a matching ID. Even if you can
do this, there's no way to disambiguate if the same paramter exists on 2 dashboards anyway, so one of them will be
wrong. I think it's not worth the trouble considering that removing the entries in this table doesn't break anything;
it just becomes a mild inconvenience that a user has to select a filter value again (since the dashboard will use the
default value).

* alter test to check for uniqueness across dashboard

This test makes 2 dashboards with parameters of the same ID and asserts that changing the value on dashboard-a does
not change the value on dashboard-b.

* adjust migration to pass linter rules

* remove the extra rollback on migration

* Update src/metabase/models/user_parameter_value.clj

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

* Update src/metabase/models/user_parameter_value.clj

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

* adjust parameters in test so we don't get logged warnings

* put update!/insert! in a transaction to avoid any race conditions

---------

Co-authored-by: bryan <bryan.maass@gmail.com>
2024-07-03 22:06:29 +00:00
Cam Saul
42b167b8b9 Support compiling SQL with inlined parameters directly (#45008)
* Support compiling SQL with inlined parameters directly

* Test fix

* Make `format-honeysql` a multimethod

* Add test for #32543

* Test also fixes #44915

* Add explicit test for #44915

* Better test for #44915

* More test fixes 🔧

* Fix Kondo error
2024-07-03 14:37:10 -07:00
bryan
6533335c5c Adds plan alias info + exposes it in troubleshooting (#45051) 2024-07-03 15:46:01 -04:00
github-automation-metabase
957b755e70 Update Readme version references and published npm version to 0.1.16 (#45106) 2024-07-03 15:48:21 +00:00
Kamil Mielnik
daafe4a976 Optimize: compute chart title href only on mouseenter and focus (#45095)
* Optimize: compute chart title href only on mouseenter and focus

* Improve comment

* Improve comment

* Format code

* Update existing tests

* Extract helpers

* Update unit tests

* Make getHref argument-less
2024-07-03 15:17:19 +00:00
Jeff Bruemmer
1bc6b7490e add note about permissions update (#45101) 2024-07-03 10:53:53 -04:00
Aleksandr Lesnenko
22bf4ccbfc fix night theme png downloads (#44941)
* include dark background to PNG exports when night theme is enabled

* fix css

* override border for png downloads
2024-07-03 14:31:19 +00:00
Ngoc Khuat
6e472b381b Auto request review workflow (#44332) 2024-07-03 21:13:18 +07:00
Noah Moss
f26eee4ee4 Only check create-queries perms when fetching DB/schema metadata (#45045) 2024-07-03 09:32:30 -04:00
Braden Shepherdson
fa20f4c60a [MBQL lib] Allow a space in datetime literal strings (#45060)
`Lib.diagnoseExpression` is stricter about this than the QP or FE
expression parser, making it reject expressions that tried to compare
datetimes to strings like `2024-07-02 14:34:17Z`.

Those used to work in 49.x, but a new `Lib.diagnoseExpression` call
while editing expressions caused it to regress.

Fixes #44916.
2024-07-03 09:02:09 -04:00
Braden Shepherdson
870e85305b [perf] Add caching on dashboard_load_id; reusable MetadataProviders (#45050)
**MetadataProvider cache**

The reusable MetadataProviders is a generally useful thing - within some
dynamic scope like an API request, a `clojure.core.cache` instance can
be provided as `lib.metadata.jvm/*metadata-provider-cache*`, and that
will be used to cache the provider for each `database-id`.

Reusing those providers can significantly reduce appdb traffic,
re-fetching the same metadata in different `MetadataProvider`
instances.

**Dashboard loads**

The FE can supply `?dashboard_load_id=uuid_string` on requests for a
dashboard load:

- `/api/dashboard/:id`
- `/api/dashboard/:id/query_metadata`
- `/api/dashboard/:id/dashcard/:dashcard_id/card/:card_id/query`

That provides a good cache key across that burst of N+2 API requests
that are part of a single load. Currently it is used for two things:

- Caching `get-dashboard` (used by the first two requests)
- Selecting the `clojure.core.cache` for `*metadata-provider-cache*`

Both use a TTL of 10 seconds, which is generally enough for the first
screenful of a dashboard load, if not the whole thing. (Browsers will
only issue a handful of requests at once, so a few long-running queries
might delay later parts of the dashboard from loading until after the
TTL expires.)
2024-07-03 09:00:16 -04:00
Chris Truter
0d2b4b063b Support duplicate prefixes in long column names for CSV uploads (#44885) 2024-07-03 12:53:58 +00:00
Oisin Coveney
1175cafb63 fix(sdk): modify Custom column widget in notebook to conform to some styles (#45044) 2024-07-03 15:13:38 +03:00
Kamil Mielnik
f6197cc993 Fix - Ellipsis tooltip cut off/not visible in GUI editor (#45030)
* Fix #39771

* Add repro for #39771

* Add explanatory comment

* Fix z-index

* Use Mantine Tooltip in Ellipsified to fix z-index issues

* Revert "Fix z-index"

This reverts commit 951e3dca86.

* Revert "Fix #39771"

This reverts commit 4165da5022.

* Update repro to new tooltip

* Update assertions
2024-07-03 18:41:43 +07:00
Kamil Mielnik
0539f89448 Add repro for extra case related to metabase#42385 (#45083) 2024-07-03 18:22:30 +07:00
Romeo Van Snick
d044534746 Add reproduction for #44974 (#44978) 2024-07-03 13:16:21 +02:00
Oisin Coveney
63167c7408 fix(sdk): Improve filter/summarize/notebook layouts (#45039) 2024-07-03 12:49:01 +03:00
Kamil Mielnik
ce319ae888 Add repro for #43216 (#44972) 2024-07-03 13:51:22 +07:00
Cam Saul
3f769c77d5 Test for #40775 (#45072) 2024-07-02 22:19:45 +00:00
Denis Berezin
ab1930dd9d Remove excess deprecation logs in production build (#45069) 2024-07-02 21:42:44 +00:00
Cam Saul
bc4e3854d4 Misc unrelated code cleanup from #45000, split into a different PR. (#45001) 2024-07-02 14:34:34 -07:00
Uladzimir Havenchyk
c82be6a7fe Add e2e tests for basic field remapping logic (#45055)
* Add e2e tests for basic field remapping logic

* await for PUT
2024-07-02 21:17:55 +00:00
Cam Saul
4ebe04efb7 Debug QP 2.0 (#39804)
* Debug QP 2.0

* Update for the ensure-legacy and ensure-pmbql wrappers
2024-07-02 21:12:07 +00:00
Nemanja Glumac
c932732f2f Fix #35954: SQL-converted question with field filter breaks filtered dashboard if reverted back to its editor version (#44987)
* Make sure the query is native

* Convert the comment to JSDoc

* Add E2E reproduction

* Fix mapping

* Add test scenarios for the public sharing and embedding

* Simplify API payload

* Extract and significantly expand the reproduction scope


---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2024-07-02 22:36:04 +02:00
Jeff Bruemmer
1e35115cdd docs - oracle note (#44543)
* clarify driver vs database reqs

* note
2024-07-02 10:19:33 -07:00
Sloan Sparger
6193a2316b Performance: partial data-permissions graph refactor (#44795)
* only send permissions updates for groups that have been modified in the graph

* Support partial permission graph updates on the BE (#44797)

* handles keeping track of advanced permissions changes to send relevant group data when updating the graph, merges response

* tests and optimizations

* respect group-ids set when fetching connection impersonations, sandboxes, and admin group perms

* fix typo

* add e2e test

* fix BE test

* impls pr feedback, reduces code needed since advanced permissions state is always reset on save

* last fixes

---------

Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Co-authored-by: Noah Moss <noahbmoss@gmail.com>
2024-07-02 12:13:02 -05:00
Sloan Sparger
9730dca6b7 fixes typo in trash spec (#44986) 2024-07-02 12:08:28 -05:00
John Swanson
39a63ad6c3 prevent collections with special types / non-null namespaces from appearing in recents (#44763)
* recent views sometimes don't show special colls

colls with a non-null namespace are special: they can't interact with
normal collections, dashboards, cards, etc at all. (Currently the only
use for these we have is snippets.) At some point we could add a
`namespace` argument to this endpoint to support looking at recent
collections in a different namespace, but that'd be a bigger refactor
without a whole lot to gain. For now we can just exclude these
completely, which is what we want for current usages of the recents
endpoint anyway.

We won't exclude non-null types across the board, because sometimes
we'll want to see these. But we will be particular about when to display
them.

We'll never display the `trash` collection, but will display the
instance analytics collection when we're not trying to make selections.

* Hack an e2e test around an existing bug

So, the entity picker that pops up when you're selecting a collection to
put a Snippet into shows you "Recent" collections - which previously
included snippet collections.

We should either make the Recents API support a namespace parameter for
collections so it could actually support this case, or the entity picker
shouldn't show a recents tab here (realistically, how many collections
are people going to have for snippets that they would need this tab
anyway).
2024-07-02 10:37:17 -06:00
Cam Saul
ee59ece958 Calculate metadata without running queries [JDBC] (#43430)
* Calculate metadata without running queries [JDBC]

* Appease Kondo

* Test fixes 🔧

* Overhauled Card metadata calculation code

* Test fixes 🔧

* Kondo fix 🔧

* Ok maybe I fixed stuff

* Work around https://github.com/aws/amazon-redshift-jdbc-driver/issues/118

* Maybe fixx the Cypress tests

* Experimental possible e2e test fix 🔧

* Test fixes 🔧

* Do things a little differently.

* Try re-enabling the field refs
2024-07-02 09:12:30 -07:00
Alex Yarosh
00ac183e82 docs: warnings about question marks (#44920)
* question marks

* remove all question mark notes except about json
2024-07-02 11:26:05 -04:00
Kamil Mielnik
06c0218c1b Fix - Invalid join clause does not disappear after changing query source to use a different database (#45025)
* Reset JoinDraft state on database change (fixes metabase#42385)

* Add repro for #42385

* Use admin user
2024-07-02 21:03:12 +07:00
Alexander Polyankin
e048976f2e Repro parameter field matching issues for questions based on sql models (#44942) 2024-07-02 09:45:35 -04:00
Ryan Laurie
75bd6557ec Hide docs issues in release notes (#45037) 2024-07-02 07:26:09 -06:00
Jeff Bruemmer
67f0ea1662 add 50.9 to list of releases (#45033) 2024-07-02 06:46:31 -06:00
Ryan Laurie
1c1d58ee56 Remove incorrect default parameter from release note generation code (#45031) 2024-07-02 05:56:09 -06:00
Phoomparin Mano
213b6d2c81 fix(sdk): runtime error when font family is not provided (#44989)
* add default font family

* use metabase provider internal component for tests
2024-07-02 15:29:54 +07:00
Kamil Mielnik
20674a669f Repro #34350 - Unable to switch question to query table in another database (#44969)
* Add repro for #34350

* Reduce diff
2024-07-02 07:47:22 +00:00
Ryan Laurie
2bf642319d Allow ad-hoc release-notes generation (#44980)
* make ad-hoc changelog generation actually useful

* add github action

* remove test code

* fix whitespace

* fix formatting
2024-07-02 01:22:41 -06:00
Ryan Laurie
04855ca92d fix missing release dependency (#45011) 2024-07-02 07:15:28 +00:00
Uladzimir Havenchyk
11f03823ca Add a repro for 'Permission error before finishing referencing a question in the native query' (#44995) 2024-07-02 13:54:59 +07:00
Ryan Laurie
d549cd6414 Create new release note sections (#44967)
* Create new release note sections

* add explanatory text
2024-07-02 00:29:05 -06:00
Alexander Solovyov
282fb413a5 cached metadata provider: lower the log level for metadata retrieval so DEBUG is less busy (#44977) 2024-07-02 09:07:49 +03:00
bryan
4b58eb986e Return info about the proper billing status on the license page (#44855)
* return data about the proper billing status

* fix copy

* fix the tests
2024-07-01 22:57:32 +00:00
Cal Herries
95817d084e Better display names for CSV upload tables (#44862) 2024-07-01 14:05:33 -06:00
Aleksandr Lesnenko
270e37f115 support sorting on funnel bar charts (#44943)
* support sorting on funnel bar charts

* fix funnel bar row display setting

* spec
2024-07-01 18:57:39 +00:00
bryan
9003927973 Adds a property to a defsetting (#44990)
* mark a defsetting as being :sensitive?

* add test
2024-07-01 18:18:11 +00:00
Denis Berezin
8786c23a50 feat(sdk): Improve dashboard and question loaders to show in the middle (#44710)
* Fix SDK components loaders

* Review fixes
2024-07-01 15:10:59 +00:00
Romeo Van Snick
9256999d77 Add reproduction for "Accurate Error Messaging for Cross DB Joins in Notebook Editor" (#44975)
* Add reproduction for #38989

* Use saveQuestion instead of clicking trough the UI

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

* Use openOrdersTable instead of manually clicking through the ui

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

* Create question programmatically in test

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-07-01 15:01:38 +00:00
Cal Herries
8c0d9ab1d0 Memoize driver.u/supports? only in prod (#44938) 2024-07-01 08:21:13 -06:00
Alexander Polyankin
e45f93fa2c Support specific date filters with 00:00 time (#44859) 2024-07-01 09:50:58 -04:00
Kamil Mielnik
781c9484e4 Repro #28106 - Scrolling up on schema list jumps to the top when creating a new question (#44965)
* Add a test table with many schemas

* Add a repro for #28106

* Format code

* Add issue tag
2024-07-01 12:27:47 +00:00
Kamil Mielnik
2c8bf0f8aa Repro #27521 - Query fails when selecting two fields from nested query, when fields are identical except for their join-alias (#44909)
* Add repro for #27521

* Improve assertions

* Add comments

* Use saveQuestion helper

* Use openOrdersTable helper
2024-07-01 12:16:04 +00:00
Oisin Coveney
7fafc1aa7b feat(sdk): Add customizable layout to interactive question (#44775) 2024-07-01 13:52:18 +03:00
Romeo Van Snick
44427fb61d Add a reproduction for "Cannot find the new column in pick columns after alter schema and synced" (#44882)
* Add a reproduction for metabase#41765

* Navigate manually to the admin page
2024-07-01 10:37:47 +02:00
Ryan Laurie
dd2d231190 Milestone tracing logic update (#44956) 2024-07-01 02:36:18 -06:00
Ngoc Khuat
a73a1d3861 [dev tool] Generate sql statement for a migration (#44872) 2024-07-01 07:40:47 +00:00
Nicolò Pretto
983814bae5 replace html2cavas with html2canvas-pro to support color css functions (#44888) 2024-07-01 09:23:05 +02:00
Ngoc Khuat
cd40cc7215 Fix unable to rollback due to dropped not null constraint on 50 (#44886) 2024-07-01 13:47:59 +07:00
Alexander Solovyov
ce550ca1f5 fix: one of transactions was removed and that causes problems on downgrade (#44908) 2024-07-01 09:28:43 +03:00
adam-james
9757569743 Wrap non-latin characters in a span specifying working font (#44580)
* Wrap non-latin characters in a span specifying working font

Fixes: #38753

CSSBox seems to have a bug where font fallback doesn't work properly. This is noticeable when a font does not contain
glyphs that are present in the string being rendered. For example, Lato does not have many international characters,
so the rendered version of tables (that show up in Slack messages) will not render properly, making the card
unreadable.

Since this appears to be a downstream bug, I've opted to work around this limitation by wrapping any non-latin
characters in a <span> that specifies the font family to be sans-serif, which should contain the glyphs to properly
render.

This leaves Lato in place for other characters.

For now, I figured it's worth trying this solution over using Noto for 2 reasons:
- we can keep Lato, which has been the decided font style for the app for some time (this keeps things consistent
where possible)
- the Noto font containing all glyphs is quite a large font (>20mb, I think) and it would be nice to avoid bundling
that if we can.

* stub installed fonts test

* typo

* Do wrapping, but now per-string, and in Clojure data not html string

I've decided that a reasonable solution is to still wrap strings containing non-lato characters. But it's not done
with str/replace to the html string but rather in a postwalk over the Hiccup data prior to rendering.

Seems like a decent compromise of issues without patching CSSBox or fixing upstream (may be good to do, but will take
longer to get a fix in).

* add test checking that glyphs render correctly

* Add a test that directly checks the wrapping fn

* Change the string to keep the linter quiet

* Change how we check if string can be rendered to faster method, new Lato Font

With Sanya's help, the way I check if a given string is renderable with Lato is now faster.

Also use the full Lato font, not just the 'latin' lato so we can cover more chars

* change lato so that it loads the fn even in a fresh test run
2024-06-28 19:34:06 -07:00
Aleksandr Lesnenko
6f91db0ea8 improve cartesian charts performance (#44861)
* improve cartesian charts performance

* drop unused import
2024-06-28 23:21:05 +00:00
Uladzimir Havenchyk
53f58806b3 Add a repro for 'Filter values in dropdown are not getting populated in SQL question based dashboard' (#44927) 2024-06-29 00:11:53 +03:00
Jesse Devaney
43ed85df83 Fix pin maps unnecessarily filtering out null values (#44853)
* prevent pin maps from filtering out rows with null values

- since pin maps are just displaying where the data is by latitude and longitude, we do not need to filter the pin just because one of the rows is null.
- the metric column selection does not make sense for pins as they just represent that data through coordinates (no aggregations or values displayed), so we should not be filtering out any data just because it is null

* add unit test
2024-06-28 20:38:16 +00:00
Alex Yarosh
6d8f077974 docs: add 50.8 (#44925) 2024-06-28 20:22:28 +00:00
Jeff Bruemmer
fb5990945a ClickHouse note (#44929) 2024-06-28 16:21:31 -04:00
Chris Truter
23ef0e2055 Be explicit about truncating characters versus bytes (#44876) 2024-06-28 18:57:28 +02:00
github-automation-metabase
074c78de53 Update Readme version references and published npm version to 0.1.15 (#44918) 2024-06-28 16:21:53 +00:00
Oisin Coveney
92c1961544 fix(sdk): Fix SDK types, split files, and improve navigation within SDK InteractiveQuestion (#44898) 2024-06-28 18:55:28 +03:00
Chris Truter
59f98b0668 Rather support old files, than duplicate columns (#44873)
* Rather support old files, than duplicate columns

* Cope with driver specific failure modes

* Restore bytes comment
2024-06-28 17:36:28 +02:00
Denis Berezin
d480a4d302 fix(sdk): Upgrade outdated dependencies to remove installation warnings (#44774)
* Upgrade visx packages

* Fixup some dependencies

* Fix textarea styles

* Fix charts diff
2024-06-28 17:42:10 +03:00
Alexander Polyankin
d796bb6439 Fix changing viz type for nodata users (#44693) 2024-06-28 08:49:56 -04:00
Alexander Polyankin
de24931065 Add repro for Dashboard click through behavior to a question does not pass time filters correctly (#44833) 2024-06-28 08:49:43 -04:00
Alexander Polyankin
e199281b3f Add repro for API allows count(field) which kills the metrics page (#44836) 2024-06-28 08:49:27 -04:00
Alexander Polyankin
f0e633610b Add repro for "Join UI picks the first schema even if a different one is selected" (#44837) 2024-06-28 08:49:05 -04:00
Kamil Mielnik
8651009e97 Repro #33427 - Question editor does not work if model joins the same table more than once (#44884)
* Add repro for #33427

* Update e2e/test/scenarios/models/reproductions.cy.spec.ts

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

---------

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2024-06-28 10:42:56 +00:00
Mahatthana (Kelvin) Nomsawadi
da0c9cb645 Patch storybook to fix failed loki tests with runtime error (#44875) 2024-06-28 09:21:38 +01:00
Nemanja Glumac
5088602802 Repro #34955: Custom column of type datetime with dashboard filter (#44838)
* Add repro for #34955

* Add a comment
2024-06-28 08:10:56 +00:00
Kamil Mielnik
90ef5e8e4c Repro #40635 - Metabase model does not display information correctly (#44824)
* Add repro for #40635

* Comment out failing assertions

* Skip repro

* Improve test name
2024-06-28 15:08:40 +07:00
Oisin Coveney
d0274f7ba9 feat(sdk): Add filter, summarize, and notebook functionality to InteractiveQuestion (#44494) 2024-06-28 10:47:11 +03:00
Uladzimir Havenchyk
6167b36a28 Add a repro for 'Page hangs when one of parameters contains {{x}} value' (#44852) 2024-06-28 03:54:00 +00:00
dpsutton
9fb1bd7dd5 Ensure we close the canceled chan in query processor after query (#44860)
Customer complaints that thread growth was unbounded. Investigated and
found bigquery involved and isolated to the cancel thread bits. Gist is
this:

```clojure
      (when cancel-chan
        (future                       ; this needs to run in a separate thread, because the <!! operation blocks forever
          (when (a/<!! cancel-chan)
            (log/debug "Received a message on the cancel channel; attempting to stop the BigQuery query execution")
            (reset! cancel-requested? true) ; signal the page iteration fn to stop
            (if-not (or (future-cancelled? res-fut) (future-done? res-fut))
              ;; somehow, even the FIRST page hasn't come back yet (i.e. the .query call above), so cancel the future to
              ;; interrupt the thread waiting on that response to come back
              ;; unfortunately, with this particular overload of .query, we have no access to (nor the ability to control)
              ;; the jobId, so we have no way to use the BigQuery client to cancel any job that might be running
              (future-cancel res-fut)
              (when (future-done? res-fut) ; canceled received after it was finished; may as well return it
                @res-fut)))))
```

The important parts is that we closeover the cancel-chan and start a
thread that is trying to pull from it. If we never put anything on that
channel or never close that channel this thread will just remain blocked
waiting.

In a thread dump, that looks like the following:
(note, I've made it set the thread names to make it easy to follow run a
query 30 times)

```
Full thread dump OpenJDK 64-Bit Server VM (21.0.2+13-LTS mixed mode):
...

"bigquery-cancel-thread" #73 [95747] prio=5 os_prio=31 cpu=2.76ms elapsed=208.53s tid=0x000000029e00f600 nid=95747 waiting on condition  [0x00000002c1266000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #108 [93211] prio=5 os_prio=31 cpu=154.60ms elapsed=128.72s tid=0x000000029f0dc200 nid=93211 waiting on condition  [0x000000029fa06000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #116 [116527] prio=5 os_prio=31 cpu=0.16ms elapsed=61.14s tid=0x00000002c1917c00 nid=116527 waiting on condition  [0x000000029fc12000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #118 [98315] prio=5 os_prio=31 cpu=161.69ms elapsed=60.27s tid=0x00000002b91cca00 nid=98315 waiting on condition  [0x000000029fe1e000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #119 [121607] prio=5 os_prio=31 cpu=0.13ms elapsed=59.35s tid=0x00000002b9236400 nid=121607 waiting on condition  [0x00000002a002a000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #120 [99079] prio=5 os_prio=31 cpu=0.13ms elapsed=58.55s tid=0x000000029e295600 nid=99079 waiting on condition  [0x00000002a0506000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #121 [122375] prio=5 os_prio=31 cpu=0.10ms elapsed=57.75s tid=0x00000002b921f400 nid=122375 waiting on condition  [0x00000002c0e4e000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #122 [123655] prio=5 os_prio=31 cpu=0.18ms elapsed=56.97s tid=0x0000000134bfa000 nid=123655 waiting on condition  [0x00000002c105a000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #123 [122631] prio=5 os_prio=31 cpu=0.11ms elapsed=56.28s tid=0x000000013569be00 nid=122631 waiting on condition  [0x00000002c1472000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #124 [96007] prio=5 os_prio=31 cpu=0.10ms elapsed=55.42s tid=0x0000000133b54e00 nid=96007 waiting on condition  [0x00000002c167e000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #125 [97799] prio=5 os_prio=31 cpu=0.09ms elapsed=54.73s tid=0x0000000131c19a00 nid=97799 waiting on condition  [0x00000002c2206000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #126 [96519] prio=5 os_prio=31 cpu=0.10ms elapsed=53.97s tid=0x000000012370f600 nid=96519 waiting on condition  [0x00000002c2412000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #127 [124167] prio=5 os_prio=31 cpu=0.10ms elapsed=53.33s tid=0x0000000134312200 nid=124167 waiting on condition  [0x00000002c28ea000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #128 [97287] prio=5 os_prio=31 cpu=0.12ms elapsed=52.57s tid=0x00000001233ae000 nid=97287 waiting on condition  [0x00000002c4706000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #129 [104715] prio=5 os_prio=31 cpu=0.10ms elapsed=51.83s tid=0x0000000131e47a00 nid=104715 waiting on condition  [0x00000002c4912000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #130 [102919] prio=5 os_prio=31 cpu=0.08ms elapsed=51.10s tid=0x0000000123540200 nid=102919 waiting on condition  [0x00000002c4b1e000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #131 [117263] prio=5 os_prio=31 cpu=0.17ms elapsed=50.37s tid=0x00000001233d1200 nid=117263 waiting on condition  [0x00000002c4d2a000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #132 [114951] prio=5 os_prio=31 cpu=0.09ms elapsed=49.71s tid=0x000000013484dc00 nid=114951 waiting on condition  [0x00000002c4f36000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #133 [103687] prio=5 os_prio=31 cpu=0.14ms elapsed=49.08s tid=0x0000000123517200 nid=103687 waiting on condition  [0x00000002c5142000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #134 [91419] prio=5 os_prio=31 cpu=0.08ms elapsed=48.38s tid=0x0000000131b43600 nid=91419 waiting on condition  [0x00000002c534e000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #135 [127495] prio=5 os_prio=31 cpu=0.14ms elapsed=47.66s tid=0x0000000131ce7000 nid=127495 waiting on condition  [0x00000002c555a000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #139 [103955] daemon prio=5 os_prio=31 cpu=0.12ms elapsed=23.22s tid=0x0000000121aaca00 nid=103955 waiting on condition  [0x00000002c5766000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #140 [105219] daemon prio=5 os_prio=31 cpu=0.10ms elapsed=22.54s tid=0x0000000133f47600 nid=105219 waiting on condition  [0x00000002c5972000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #141 [105731] daemon prio=5 os_prio=31 cpu=0.15ms elapsed=21.69s tid=0x00000001353ba800 nid=105731 waiting on condition  [0x00000002c5b7e000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #142 [114435] daemon prio=5 os_prio=31 cpu=0.08ms elapsed=20.89s tid=0x0000000131e76400 nid=114435 waiting on condition  [0x00000002c5d8a000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #143 [106499] daemon prio=5 os_prio=31 cpu=0.10ms elapsed=20.12s tid=0x0000000123107e00 nid=106499 waiting on condition  [0x00000002c5f96000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #144 [113923] daemon prio=5 os_prio=31 cpu=0.11ms elapsed=19.52s tid=0x00000002c1918400 nid=113923 waiting on condition  [0x00000002c61a2000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #145 [107011] daemon prio=5 os_prio=31 cpu=0.13ms elapsed=18.93s tid=0x00000002a6ad3e00 nid=107011 waiting on condition  [0x00000002c63ae000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #146 [113667] daemon prio=5 os_prio=31 cpu=0.12ms elapsed=18.37s tid=0x00000001341a2800 nid=113667 waiting on condition  [0x00000002c65ba000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #147 [113155] daemon prio=5 os_prio=31 cpu=0.16ms elapsed=17.74s tid=0x000000013445da00 nid=113155 waiting on condition  [0x00000002c67c6000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #148 [107779] daemon prio=5 os_prio=31 cpu=0.13ms elapsed=17.19s tid=0x0000000134704e00 nid=107779 waiting on condition  [0x00000002c69d2000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #149 [112643] daemon prio=5 os_prio=31 cpu=0.17ms elapsed=16.54s tid=0x000000011f185000 nid=112643 waiting on condition  [0x00000002c6bde000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #150 [108035] daemon prio=5 os_prio=31 cpu=0.24ms elapsed=15.95s tid=0x000000011f1be200 nid=108035 waiting on condition  [0x00000002c6dea000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #151 [108547] daemon prio=5 os_prio=31 cpu=0.11ms elapsed=15.38s tid=0x00000001302cf800 nid=108547 waiting on condition  [0x00000002c6ff6000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #152 [109059] daemon prio=5 os_prio=31 cpu=0.24ms elapsed=14.85s tid=0x0000000133c4be00 nid=109059 waiting on condition  [0x00000002c7202000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #153 [109315] daemon prio=5 os_prio=31 cpu=0.10ms elapsed=14.15s tid=0x00000001339dc000 nid=109315 waiting on condition  [0x00000002c740e000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #154 [109571] daemon prio=5 os_prio=31 cpu=0.17ms elapsed=13.57s tid=0x0000000134ea3600 nid=109571 waiting on condition  [0x00000002c761a000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #155 [110083] daemon prio=5 os_prio=31 cpu=0.20ms elapsed=12.95s tid=0x0000000121d7aa00 nid=110083 waiting on condition  [0x00000002c7826000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #156 [110339] daemon prio=5 os_prio=31 cpu=0.12ms elapsed=12.35s tid=0x0000000134ff5c00 nid=110339 waiting on condition  [0x00000002c7a32000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #157 [110595] daemon prio=5 os_prio=31 cpu=0.09ms elapsed=11.65s tid=0x0000000133e27000 nid=110595 waiting on condition  [0x00000002c7c3e000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #158 [111107] daemon prio=5 os_prio=31 cpu=0.13ms elapsed=11.04s tid=0x0000000131e8b800 nid=111107 waiting on condition  [0x00000002c7e4a000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #159 [174339] daemon prio=5 os_prio=31 cpu=0.13ms elapsed=10.51s tid=0x0000000134ff6400 nid=174339 waiting on condition  [0x00000002c8056000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #160 [173827] daemon prio=5 os_prio=31 cpu=0.12ms elapsed=9.79s tid=0x0000000133ff7c00 nid=173827 waiting on condition  [0x00000002c8262000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #161 [173315] daemon prio=5 os_prio=31 cpu=0.11ms elapsed=9.18s tid=0x0000000122c9b600 nid=173315 waiting on condition  [0x00000002c846e000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #162 [131331] daemon prio=5 os_prio=31 cpu=0.12ms elapsed=8.58s tid=0x0000000133b9c400 nid=131331 waiting on condition  [0x00000002c867a000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #163 [172547] daemon prio=5 os_prio=31 cpu=0.14ms elapsed=8.06s tid=0x0000000134d4cc00 nid=172547 waiting on condition  [0x00000002c8886000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #164 [131587] daemon prio=5 os_prio=31 cpu=0.15ms elapsed=7.35s tid=0x000000029e17f800 nid=131587 waiting on condition  [0x00000002c8a92000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #165 [131843] daemon prio=5 os_prio=31 cpu=0.16ms elapsed=6.71s tid=0x00000002b9513a00 nid=131843 waiting on condition  [0x00000002c8c9e000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #166 [132355] daemon prio=5 os_prio=31 cpu=0.10ms elapsed=6.12s tid=0x0000000122dede00 nid=132355 waiting on condition  [0x00000002c8eaa000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)
--
"bigquery-cancel-thread" #167 [132867] daemon prio=5 os_prio=31 cpu=0.11ms elapsed=5.54s tid=0x00000001233b1000 nid=132867 waiting on condition  [0x00000002c90b6000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park(java.base@21.0.2/Native Method)

```

Simple repro:

```clojure
bigquery-profile=> (require '[clojure.core.async :as a])
nil
bigquery-profile=> (let [c (a/chan)
                         t (Thread. (fn []
                                      (when (a/<!! c)
                                        (println "got something")))
                                    "Forever-running")]
                     (.start t)
                     (a/close! c)
                     (Thread/sleep 4000)
                     (let [thread-names (into #{} (map ^[] Thread/.getName) (.keySet (Thread/getAllStackTraces)))]
                       (contains? thread-names "Forever-running")))
false
bigquery-profile=> (let [c (a/chan)
                         t (Thread. (fn []
                                      (when (a/<!! c)
                                        (println "got something")))
                                    "Forever-running")]
                     (.start t)
                     #_(a/close! c) ;; if we don't close it will never stop running
                     (Thread/sleep 4000)
                     (let [thread-names (into #{} (map ^[] Thread/.getName) (.keySet (Thread/getAllStackTraces)))]
                       (contains? thread-names "Forever-running")))
true
```

So this PR just adds a transducer around the rf that closes the
`cancel-chan` if it's open. Note that multiple closes are fine: from the
docstring: "Closing a closed channel is a no-op".
2024-06-28 03:19:30 +00:00
John Swanson
02f9341353 Error on import into an empty appdb (#44840)
I was thinking about the potential options here.

On one hand, we could initialize the app db ourselves. This is a little
problematic, because:

- our `init!` function is in `metabase.core` and calling it yields a
painful cyclical dependency. It's also pretty tied to outputting things
to the user that they might not expect during an import, e.g. "Looks
like this is a new installation ... preparing setup wizard", and starts
up jobs, etc.

- if we choose to *only* initialize the database ourselves (only the
bits that we actually *need* initialized), I'm a little nervous about
maybe missing something. Right now we need to create the internal user
and create users from the config file before running the import. If we
added a third thing, would we remember to update this?

- we could refactor to put all of the above in one spot, but this is a
P1 and it feels important to close this out as quickly as possible. We
also don't claim to support initializing the app DB from an import in
the first place.

So: just throw an exception if the app db hasn't been set up yet. Our
heuristic here is whether a single non-internal user has been created.
So if you want to use your config, you can run:

```
MB_CONFIG_FILE_PATH=dev/config.yml java -jar metabase.jar
java -jar metabase.jar import /my/exported/dump
```

If you try to run `java -jar metabase.jar import ...` on a fresh
DB, it'll now fail with the error message:

```
You cannot `import` into an empty database. Please set up Metabase
normally, then retry.
```
2024-06-27 12:56:19 -07:00
Sloan Sparger
678c0b5410 Highlight Trash collection in sidebar when viewing root trash collection or a trashed item (#44258)
* highlights the trash link in the sidebar when viewing root trash collection or a trashed item

* impls pr feedback

* impls more pr feedback

* fixes unit tests and logical mistake that allowed urls with invalid collection ids to match on undefined trash id due to it not being loaded yet
2024-06-27 13:41:39 -05:00
bryan
0d4790d99a Single Log Out saml-slo-enabled defsetting (#44794)
* stop using strings for enum values (prefer kw)

* only do SLO when saml-slo-enabled is true

* make defsetting docstring formatting consistent

* log-direction is a string

* add test for enabling / disabling saml slo

- also return a 403 when the client tries, but it's disabled
2024-06-27 18:21:16 +00:00
Alex Yarosh
83c54806d3 docs: clarify migrate down instructions (#44843)
* docs: clarify migrate down for docker

* add jar instructions

* wording
2024-06-27 14:13:05 -04:00
Nemanja Glumac
f3a9d26202 Unskip repro for #14957: Saving a question before query has been executed can be slow with UI "hanging" (#44825) 2024-06-27 18:56:04 +02:00
lbrdnk
88a31b4121 Fix order by field refs (#44740)
* Fix order by field refs

* Update test to handle all drivers

* Untangle fix-order-by-field-refs
2024-06-27 17:34:26 +02:00
lbrdnk
a4158f13fe [Mongo] Convert bson Decimal128 negative zero to BigInteger zero (#44611)
* Convert bson Decimal128 negative zero to BigInteger zero
2024-06-27 17:33:38 +02:00
Nicolò Pretto
692841e082 remove dashboardcontrols from normal dashboard (#44688)
* let's see how many things break

* add missing useSyncURLSlug

* remove cardTitled prop that's not needed

* remove DashboardControls

* remove @ts-expect-error for dashboardId

* move props destructuring at the top

* remove use-dashboard-nav.ts as it's not needed anymore

* remove import of use-dashboard-nav from dashboard/hooks/index.ts

* remove unused props from dashboard
2024-06-27 17:22:16 +02:00
Uladzimir Havenchyk
b3be46e69c Parse not a number passed to id filter (#44826) 2024-06-27 15:20:29 +00:00
Oisin Coveney
11cf86e63c fix(sdk): Convert components in InteractiveQuestion to context-aware components (#44738) 2024-06-27 15:07:55 +00:00
Romeo Van Snick
2d911b9bf6 Reproduction for "When List style field is changed to show remapped foreign key, then cached values are not updated" (#44806)
* Add a reproduction for metabase#15542

* Add comment on force: true usage in sidebar
2024-06-27 16:58:45 +02:00
Oisin Coveney
6e7e51f581 fix(sdk): Move InteractiveQuestionResult variables into provider (#44730) 2024-06-27 14:31:37 +00:00
Nicolò Pretto
fea2aac7ff add e2e test for public dashboard title (#44822)
* refactor: move prepareDashboard to a separate function

* test: page title on public dashboard
2024-06-27 16:27:29 +02:00
Noah Moss
e1e4d983cb Fix n+1 query in sandboxing enforcement (#44793) 2024-06-27 10:20:52 -04:00
Alexander Polyankin
1e030333a2 E2E repro for Metrics fields disapearing when joinning question (#44785) 2024-06-27 12:53:40 +00:00
Alexander Polyankin
437684cd3d Fix numeric parameter parsing (#44792)
* Fix numeric parameter parsing

* Update frontend/src/metabase-lib/v1/parameters/utils/parameter-parsing.unit.spec.js

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

* Update frontend/src/metabase-lib/v1/parameters/utils/parameter-parsing.unit.spec.js

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

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2024-06-27 12:53:11 +00:00
Alexander Polyankin
a11d4dd705 E2E repro for Adding filter of summarized field grouped by latitude and longitude on a map breaks breadcrumbs (#44787) 2024-06-27 12:52:03 +00:00
Alexander Polyankin
024664890f Coerce the default parameter value when the parameter is no longer multi-select (#44690) 2024-06-27 08:20:36 -04:00
Kamil Mielnik
55fed903ab Repro #41785 - Using Column picker to remove columns on model breaks question with ERROR: column source.name_2 does not exist Position (#44808)
* Add repro for #41785

* Update comment
2024-06-27 19:09:02 +07:00
Anton Kulyk
de786c3188 Fix graph.metrics sync after adding a new query stage (#44697)
* Add repro

* Accept non-aggregation cols in graph metrics sync

* Address feedback
2024-06-27 11:19:56 +01:00
Cal Herries
5260e2a333 Memoize driver.u/supports? (#44719) 2024-06-27 10:17:12 +02:00
Anton Kulyk
e0381e9bc9 Fix FE crash for line/area/bar charts with no data (#44769)
* Add test

* Fix `xDomain` calculation in QB selectors

* Make database `features` optional

* Update reproductions-3.cy.spec.js

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

---------

Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2024-06-27 08:26:05 +01:00
Denis Berezin
7091c9eb47 feat(sdk): Improve dashboard to question navigation (#44648)
* Add dashboard question header

* Add dashboard data preserve after question drill

* Review fixes

* Review fixes

* Potential fix for e2e

* Potential fix for e2e

* Add basic unit tests

* Fix Dashboard reloading on unmount, fix ad hoc question title in SDK

* Move dashboard reset to SDK component

* Fix issue with dashboard rerender

* Fix one more reported issue with rerender
2024-06-27 00:23:36 +00:00
Uladzimir Havenchyk
a4a68f426d Add a repro for 'Visible Columns errors when source query is a table joined on itself' (#44737)
* Add a repro for 'Visible Columns errors when source query is a table joined on itself'

* verify warning icon is not rendered
2024-06-26 17:53:55 +00:00
Uladzimir Havenchyk
6667721ac0 Add a repro for 'Cannot change question data source to raw data after selecting saved question' (#44757)
* Add a repro for 'Cannot change question data source to raw data after selecting saved question'

* Update e2e/test/scenarios/question-reproductions/reproductions-2.cy.spec.js

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

* Update e2e/test/scenarios/question-reproductions/reproductions-2.cy.spec.js

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

* Update e2e/test/scenarios/question-reproductions/reproductions-2.cy.spec.js

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

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-06-26 19:42:56 +03:00
Jesse Devaney
f84e0d2321 Update default map.type display for breakouts with un-binned coordinates (#44717)
* fix map default display type with un-binned coordinates

- default to `"map.type"` = "pin" when coordinates are not binned
- default to `"map.type"` = "grid" when coordinates are binned

* add tests

* refactor breakouts usage
2024-06-26 16:03:44 +00:00
Alexander Polyankin
c0f10581e6 Allow clicking "Remove all" for the first group in FieldPanel and omit removing the first field in the group (#44645) 2024-06-26 15:54:55 +00:00
Alexander Polyankin
ca72311518 Fix broken field normalization in metadata (#44721)
* Fix broken field normalization in metadata

* Handle Fields.actionTypes.UPDATE action in tables reducer to keep table's original_fields in sync

* Add an e2e test for fields

* Format code

* Use a different table, since accounts table is not available in e2e tests

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-06-26 11:50:19 -04:00
Jesse Devaney
7ade61330d Fix invalid API request fired on chart legend click (#44579)
* remove invalid else conditional

* fix RowChart firing invalid API request on legend item click

* fix clicking on non-breakout legend on dashboards

* add E2E test to validate and enforce the desired behavior
2024-06-26 11:12:24 -04:00
Alex Yarosh
08be787014 docs: add 50.7 to releases (#44712) 2024-06-26 17:01:13 +02:00
Nemanja Glumac
fea908d474 Unskip the repro for #18770 (Post-aggregation filters) (#44748) 2024-06-26 16:30:05 +02:00
Noah Moss
cfb3de0231 Skip unecessary quartz job deletion migration (#44652) 2024-06-26 10:17:07 -04:00
Alexander Polyankin
03ca0ec174 Add missing tests for temporal unit parameters parsing and fix issues (#44685) 2024-06-26 09:11:38 -04:00
Chris Truter
fb4bbfa6e7 Fix appends for long column names (#44727) 2024-06-26 15:00:24 +02:00
Mahatthana (Kelvin) Nomsawadi
dd7996b756 Remove the workflow until we figured out a better workflow (#44749) 2024-06-26 12:55:13 +01:00
github-automation-metabase
68c2fbf023 Update Readme version references and published npm version to 0.1.14 (#44746) 2024-06-26 11:45:16 +00:00
Arkadi Yaroslavtsev
726589d824 Pass enterprise version to cloud issues (#44701) 2024-06-26 07:43:37 -04:00
Anton Kulyk
a03d3a85d2 Remove description length check from copy question form (#44736) 2024-06-26 12:37:12 +01:00
Chris Truter
48b6f349b7 Opt out of non-reserved SQL keywords (#44609) 2024-06-26 11:36:33 +00:00
Romeo Van Snick
d145a24747 Add reproduction for "Closing Drop-down in Join column selector causes non-drop-down columns to disappear" (#44675)
* Add reproduction for #19894

* Use startNewQuestion
2024-06-26 13:09:01 +02:00
Phoomparin Mano
43a9a796ea docs(sdk): remove vite incompatibility from sdk docs (#44729) 2024-06-26 17:54:34 +07:00
Anton Kulyk
9ce72a44cd Bump dashboard description max length limit to 1.5K (#44470)
* Bump dashboard description max len limit to 1.5K

* Extract `DASHBOARD_DESCRIPTION_MAX_LENGTH` const

* Handle description max length in dashboard sidebar

* Add red border to dashboard description box

* Add test
2024-06-26 11:31:16 +01:00
Uladzimir Havenchyk
5f4c2638f2 Remove repro for #40223 that's not valid anymore (#44682) 2024-06-26 12:08:53 +02:00
Oisin Coveney
e1ffb582f0 Split SummarizeContent from SummarizeSidebar (#44539) 2024-06-26 09:54:04 +00:00
Alexander Solovyov
a91a363a60 enable-query-caching is now default true (#44227) 2024-06-26 12:27:11 +03:00
Alexander Solovyov
c7e2a0078a [cache] surface last run time and make sure "nocache" won't use cache (#44679) 2024-06-26 11:10:19 +03:00
Phoomparin Mano
87914fd870 fix(sdk): upgrade D3.js to the latest version for Vite compatibility (#44562) 2024-06-26 14:06:57 +07:00
Sloan Sparger
6665c0a4f0 Fix trash banner icon color regression (#44304)
* fixes spacing and color issue of trash icon in archive banner

* css var for color

---------

Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
2024-06-25 18:59:15 -05:00
Emmad Usmani
45b4b1b247 fix pivot table horizontal scrollbar not appearing (#44514)
* fix pivot horizontal scroll

* fix scroll on dashboard

* add e2e test

* fix unit tests

* fix e2e test
2024-06-25 22:56:17 +00:00
Alexander Polyankin
b6a307d00b E2E test for custom date expression error (#44694) 2024-06-25 17:49:02 -04:00
Alexander Polyankin
7e74dd2279 Add E2E repro for convertTimezone (#44705) 2024-06-25 17:48:54 -04:00
Alexander Polyankin
22baa028fb Add repro for 32804 (#44709) 2024-06-25 17:48:35 -04:00
Alex Yarosh
091f94b160 add 49.18 (#44699) 2024-06-25 20:51:29 +02:00
Cal Herries
52b23ee2f7 Fix testing week-of-year extraction in general-timezone-support-test (#44583) 2024-06-25 12:15:13 -06:00
Aleksandr Lesnenko
3e554323a7 bump echarts (#44695) 2024-06-25 17:14:43 +00:00
Nemanja Glumac
6a68804eb6 Repro #35043: Date range filter - from newer to older date (#44687) 2024-06-25 18:54:09 +02:00
Nicolò Pretto
eaf1e80dec refactor DashboardControls (#44558)
* WIP PublicOrCustomEmbedDashboardPage without using dashboard controls

* add usePublicDashboardEndpoints instead of WithPublicDashboardEndpoints

* fix type error by setting null as default value for hide_parameters and hide_download_button

* use usePublicDashboardEndpoints inside WithPublicDashboardEndpoints

* also migrate embed

* i don't think we need useDashboardNav public/static embed

* SetTitle component to use instead of the `title` hoc

* wrap setEmbedDashboardEndpoints/setPublicDashboardEndpoints in useEffect as per PR comment

* after the fix for metabase#38640 we don't need the public routes in the main app

* renamed test file

* change tests to use PublicOrEmbeddedDashboardPage

* remove PublicOrEmbeddedDashboardControlled and change imports for PublicOrEmbeddedDashboardPage

* remove debug prop left by mistake
2024-06-25 17:02:20 +02:00
Noah Moss
e7e4fd6f87 Fix parsing of MB_JETTY_SKIP_SNI (#44651) 2024-06-25 10:00:23 -04:00
Alexander Polyankin
e5e0c2ccd0 Fix expressions with the same name as their base column (#44641)
* Pass expressionPosition

* Add a test

* Update e2e/test/scenarios/question-reproductions/reproductions-3.cy.spec.js

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

* Rename expressionPosition to expressionIndex

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-06-25 13:25:42 +00:00
Alexander Polyankin
113d95366d Add e2e repro (#44656) 2024-06-25 09:12:22 -04:00
Ngoc Khuat
191d845941 Fix flaky test: update-db-to-never-scan-values-on-demand-test (#44658) 2024-06-25 19:26:30 +07:00
Oisin Coveney
d8a54827ee Split content from FilterModal into FilterContent (#44534) 2024-06-25 15:26:20 +03:00
Romeo Van Snick
3e54ff961e Add reproduction for "Result inconsistencies with Preview in GUI editor #40399" (#44630)
* Add e2e test to verify that step previews only care about the step being previewed

* Use getNotebookStep and find preview button using cy.icon

* Remove empty line

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

---------

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2024-06-25 14:21:04 +02:00
Nemanja Glumac
7b706ff9e6 Repro #33330: Cumulative count breaks in certain situations (#44671) 2024-06-25 13:47:36 +02:00
Uladzimir Havenchyk
689f8d7e58 refactor: drop old and unused endpoint (#44629)
* Drop old and not used  endpoint

* fixup! Drop old and not used  endpoint

* fixup! fixup! Drop old and not used  endpoint
2024-06-25 13:41:28 +03:00
Mahatthana (Kelvin) Nomsawadi
1fa5a933c6 refactor(sdk): Make sense of dashboard and embed code (#44636)
* Make the code makes more sense

* Fix type error
2024-06-25 10:25:43 +01:00
Nemanja Glumac
f43a15076d Refactor: Time-series chrome component (#44568)
* Move SimpleSpecificDatePicker to the form

* Extract `isSpecificValue` helper

* Integrate the toggle into `SimpleDateIntervalPicker`

* Make DateOperatorPicker do only one thing

Separation of concerns - lift SimpleRelativeDatePicker up to the form.

* Fix unit tests

* Add back the test for the `SimpleSpecificDatePicker`

* Keep the rendering logic in the `SimpleDatePicker`
2024-06-25 11:17:18 +02:00
Ryan Laurie
3fcc0f6e14 Tag core-release group in pre-release messages (#44663) 2024-06-25 02:11:04 -06:00
Phoomparin Mano
70eea1167b fix(sdk): missing css variables when rendering under a portal (#44473)
* apply css variables injection right under the public component

* refactor css variables

* fix name changes

* apply css variables to global styles

* update path

* render component wrapper as full-width

* move style resets to public component styles wrapper

* update unit tests for global styles
2024-06-25 12:51:52 +07:00
Cal Herries
a57718bd52 Fix querying TIMESTAMP WITH LOCAL TIME ZONE for oracle (#44456) 2024-06-24 20:16:22 -06:00
adam-james
a27c151078 Sanitize SVG before parsing with Batik to prevent render failures when invalid characters are in the SVG content (#44516)
* Add Temporal Units List to Dashboard Parameters Schema

Closes: #44361

This adds an entry to the Dashboard Parameter schema so that we can validate
the list of temporal_units that might be passed from the frontend when adding
or updating the `Unit of Time` type parameters.

* Sanitize the SVG before parsing it with Batik

WIP

Fixes: #43677

There are characters that are invalid according to the Batik XML Parser. This sanitizes the svg string to strip out
some of those characters so that the render can continue.

* Use the xml 1.0 spec allowed unicode chars list for the regex

* Remove accidentally merged code

* still miseed a line
2024-06-24 21:52:09 +00:00
Case Nelson
6317927039 fix: dont always optimize between expressions (#44493)
* fix: dont always optimize between expressions

Fixes #42291

The frontend produces expressions like

```
[:between
 [+ [:field ... {:temporal-bucket :day] [:interval 2 :day]]
 [:relative-datetime -1 :week]
 [:relative-datetime 0 :week]]
```

This should not be optimized because of the mixed `:day` and `:week`
units. However, it was being optimized since the compatible units
weren't being properly picked up by the match.

* Disable suspcicios args eastwood lint, kondo does it better

* Stop autobucket to day when adding a time interval
2024-06-24 14:18:53 -06:00
Case Nelson
8198461c9b perf: disable view log and card used updates during metadata fetches (#44502)
* perf: disable view log and card used updates during metadata fetches

* Disable writes for view_count and last_used_at

* Disable view_count tests

* Disable last-used-at tests

* Disable view_count test

* Fix view count test

* Disable view_count e2e testing
2024-06-24 10:21:34 -06:00
Alexander Polyankin
9b305a03e6 Add a try-catch for MBQL lib diagnoseExpression (#44628) 2024-06-24 16:07:58 +00:00
Alexander Polyankin
1d5d9cb430 Fix the operator list for type/TextLike PKs (#44569)
* Fix the operator list for `type/TextLike` PKs

* Fix the bug with using wrong operators

* Fix the bug with using wrong operators

* Update test/metabase/lib/filter_test.cljc

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>

* Test FKs too

* Update test/metabase/lib/filter_test.cljc

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>

---------

Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
2024-06-24 16:00:09 +00:00
Nemanja Glumac
172c7cc3af Repro #44550: Missing display name for the filter with an offset (#44624) 2024-06-24 16:53:56 +02:00
Jeff Bruemmer
d3aa47a58d fix link (#44622) 2024-06-24 10:23:04 -04:00
Nemanja Glumac
dc4a553056 Visually improve time-series chrome component (#44554)
* Get rid of the styled component

* Stack date operator on top of actual filter pickers

* Use the existing `CurrentDatePicker`

* Fix unit test

* Conditionally apply padding to the `CurrentDatePicker`

* Remove the custom prop
2024-06-24 14:18:21 +00:00
Denis Berezin
e74f0bbf41 Migrate ViewTitleHeader and its children to TS (#44513)
* part 1

* part 1

* part 2

* part 3

* part 4

* Self review

* Self review

* Fix merge conflicts

* Fix e2e

* review fixes

* review fixes
2024-06-24 17:12:36 +03:00
Uladzimir Havenchyk
f21ad7da0a test: add a test for the edge case in mapping on parameter change (#44610)
* test: add a test for the edge case in mapping on parameter change

* fixup! test: add a test for the edge case in mapping on parameter change
2024-06-24 16:41:59 +03:00
Mahatthana (Kelvin) Nomsawadi
1c2b5cc346 refactor: Create static embed view components (#44555)
* Remove `this` reference from the markup

* Move functions inline

* Introduce a view component making it purer

* Introduce question embed view component

* Address review: Don't lie about types

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

* Address review: Make code consistent

---------

Co-authored-by: Nicolò Pretto <info@npretto.com>
2024-06-24 14:30:13 +01:00
Ngoc Khuat
f135ea4f07 Tidy pulse code, remove unused methods (#44603) 2024-06-24 20:27:45 +07:00
Alexander Polyankin
4bda202926 Fix new column shortcuts overwriting viz settings (#44582) 2024-06-24 09:08:32 -04:00
Alexander Polyankin
1f74c4312a Fix setting the join strategy for not yet existing join clauses (#44557) 2024-06-24 09:07:13 -04:00
Alexander Polyankin
8954c23632 Fix setting the temporal bucket of columns in a join condition to "Don't bin" (#44564) 2024-06-24 09:06:33 -04:00
Nemanja Glumac
bf5df6cd2b Increase the Codecov frontend target (#44613)
* Fix the comment

* Update the threshold for the front-end
2024-06-24 14:44:55 +02:00
Alexander Polyankin
b34b9607c4 Fix model metadata editing for SQL models with manually sorted columns (#44574) 2024-06-24 08:37:29 -04:00
Uladzimir Havenchyk
b228f16bb6 refactor: split DashCardCardParameterMapper into smaller components to reduce complexity (#44526)
* Exrtract 'useResetParameterMapping'

* Extract 'DashCardCardParameterMapperButton'

* Extract 'DashCardCardParameterMapperContent'

* cleanup

* Drop if/else

* cleanup
2024-06-24 13:16:42 +03:00
lbrdnk
260f8b0392 Add role to spec even if used in :connection-uri (#44397)
This PR removes `:role` removal from spec, even if it was added in `:connection-uri`.
It seems that `:connection-uri` is ignored on `do-with-connection-options` code path.
Hence use of non-default roles is again available on Snowflake.
2024-06-24 12:12:37 +02:00
lbrdnk
ba42baaf0f Adjust distinct aggregation expansion on Mongo (#44442)
This commit adds `$size` operator wrapping to `$addToSet`. That enables use of `:distinct`
clause in expressions on Mongo.
2024-06-24 12:10:11 +02:00
Ryan Laurie
452382bcca Fix infinite backport PR recursion in milestone setter (#44593)
* fix infinite backport PR recursion

* dedupe issue numbers
2024-06-24 01:57:22 -06:00
Alexander Solovyov
ea69066d83 add a test to check that openapi definitions can be generated (#44586) 2024-06-24 10:40:33 +03:00
Alexander Solovyov
839f1f775c xray should not filter again models with filters (#44547)
This not only does not make sense, but also fails for models with aggregations (and thus not having those fields for filtering available).
2024-06-24 10:13:15 +03:00
Ryan Laurie
2f6e5d7fcd Update Milestone Setter (#44521) 2024-06-23 23:28:46 -06:00
Alexander Solovyov
bdf67dbe3f [openapi] do not die when :query-params is not a map (#44549) 2024-06-22 11:32:26 +02:00
Uladzimir Havenchyk
981d69ab2a refactor: Rework undo to typescript (#44479)
* refactor: Rework undo to typescript

* fixup! refactor: Rework undo to typescript

* fixup! fixup! refactor: Rework undo to typescript

* Convert UndoListing to ts

* fixup! Convert UndoListing to ts

* Update frontend/src/metabase/redux/undo.ts

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

* address review

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
2024-06-22 07:22:46 +00:00
Jeff Bruemmer
674ac9787c notes on upload perms (#44575) 2024-06-21 17:02:40 -04:00
Denis Berezin
dbcd84484c Add global styles to storybook, fix default fonts display (#44559)
* Add global styles to storybook, fix default fonts display

* Update loki testing screenshots
2024-06-21 22:45:52 +03:00
adam-james
998b28cddb Disable Pivot Export Post Processing Step (#44561)
This PR disables the 'make exports look pivoted' post processing step for csv and xlsx exports.

This is in response to a reported issue that Large Pivot Table downloads are failing entirely: #44556

A more hollistic fix and improvement to the post processing feature will be worked on, so the post processing code is
left untouched in this PR.

The dynamic vars in the csv and xlsx namespaces each default `false` and disable the export from running any post
processing. The var should remain `false` until we've got a plan for these types of exports, and there is no way for
users (either through ENV or UI) to change this, so the feature is effectively disabled.
2024-06-21 18:28:27 +00:00
Jeff Bruemmer
7a83278718 docs - actions and public dashboards (#44551) 2024-06-21 18:16:34 +00:00
Cam Saul
89f12e7c01 Set useLocalSessionState=true for MySQL DW connections [PERFORMANCE BOOST] (#44509)
* Set `useLocalSessionState=true` for MySQL DW connections

* Fix GH issue number

* Test fixes 🔧

* Lint fix 🔧
2024-06-21 10:04:22 -07:00
github-automation-metabase
e2670a1567 Update Readme version references and published npm version to 0.1.13 (#44553) 2024-06-21 16:13:22 +00:00
Nicolò Pretto
ecce383824 convert embed.ts to ts and to use createSlice from rtk (#44496)
* convert embed.ts to use createSlice from rtk

* only store in the state what we care about for interactive embedding

* use DEFAULT_EMBED_OPTIONS keys to filter searchOptions

* removed unused hash parameter

* adds basic unit test
2024-06-21 16:04:21 +00:00
John Swanson
0637fefa67 Fix dev migrate! command (#44545)
There were two problems here:

- wrong args to `mdb/migrate!` (passing the db-type as well as the data
source), and

- in MySQL, the changelog table name is not `:databasechangelog`. Use
`metabase.db.liquibase/changelog-table-name` to get the actual table name.
2024-06-21 14:41:23 +00:00
Mahatthana (Kelvin) Nomsawadi
74b2c11ea5 refactor: Extract refactor code out of feature branch to avoid conflicts (#44540)
* refactor: Simplify code (#44275)

* Remove dead code

* Remove values same as default options

* Simplify hook API: Removing unused argument

* review: Remove redundant code

* Refactor
2024-06-21 15:22:28 +01:00
Anton Kulyk
ce48b30e16 Revert graph settings sync change (#44535)
* Skip repro for 10493

* Add repro for 44532

* Remove `ensureMetricsAndDimensions`
2024-06-21 14:34:05 +01:00
Kamil Mielnik
fa192d940b Fix - Missing schema name in data picker (#44468)
* Show table's schema name when available

* Add a test

* Add a test for empty table schema
2024-06-21 20:19:57 +07:00
Phoomparin Mano
dbaddac9cb add demo video to the sdk readme (#44531) 2024-06-21 20:18:14 +07:00
Oisin Coveney
0b9bfbd21d Split FilterModal components into separate files and folders (#44530) 2024-06-21 12:38:01 +00:00
Oisin Coveney
bd6391cef0 Make notebook props explicit (#44529)
Co-authored-by: Nicolò Pretto <info@npretto.com>
2024-06-21 12:11:35 +00:00
Oisin Coveney
27fc6ae43e Convert ViewTitleHeaderRightSide and associated components to TS (#44368) 2024-06-21 14:53:30 +03:00
Nicolò Pretto
2c04840477 convert browser.js to typescript (#44524)
* file renamed to .ts

* fixed ts errors in browser.ts
2024-06-21 12:17:45 +02:00
Kamil Mielnik
3565d5e2b8 Update browserslist-db (#44522)
- Run "npx update-browserslist-db@latest"
2024-06-21 08:38:59 +00:00
Ryan Laurie
db3b8979c5 ci: Move cloverage to run nightly (#44365)
* move cloverage to a nightly run

* what a mess
2024-06-21 00:54:21 -06:00
Chris Truter
0e8787805f Track metabase.nqa module dependencies (#44464) 2024-06-21 05:58:51 +02:00
Noah Moss
c966918bda Don't run sandboxing rollback test on mysql (#44515)
* Don't run sandboxing rollback test on mysql

* Update test/metabase/db/schema_migrations_test.clj
2024-06-21 02:03:17 +00:00
Cam Saul
1dceed32b8 Make the App DB transaction isolation level READ_COMMITTED for MySQL [MEGA PERFORMANCE BOOST] (#44505)
* Make the App DB transaction isolation level READ_COMMITTED for MySQL/MariaDB [MEGA PERFORMANCE BOOST]

* Add test
2024-06-21 01:44:34 +00:00
Mateusz Burzyński
514564290f Update @replayio/cypress (#44396) 2024-06-20 23:18:29 +02:00
John Swanson
cb055ac9de Don't sort official collections first in trash (#44322)
Add a new query parameter to `/api/collection/:id/items` and
`/api/collection/root/items`. If `official_collections_first` is passed,
we'll sort official collections first, or not, as requested. If it isn't
passed, we'll default to `false` for the trash collection, or `true` for
normal collections.
2024-06-20 21:17:38 +00:00
Nick Fitzpatrick
7f9e369c34 Fix crash on restoring bookmarked items, update bookmarks on restore (#44414)
* Fix crash on restoring bookmarked items, update bookmarks on restore

* adding bookmark assertions to e2e tests

* removing unintended createDashboard change
2024-06-20 17:55:03 -03:00
Cam Saul
08c841f3ef Oops fix the order we attempt to set DW transaction isolation in (#44501) 2024-06-20 20:41:10 +00:00
Jeff Bruemmer
d0096dc0fa clarify database vs driver (#44503) 2024-06-20 16:16:21 -04:00
Noah Moss
dce9879067 Fix rollback when sandboxing is configured (#44481) 2024-06-20 14:24:26 -04:00
Nemanja Glumac
442cedd5b9 Fix flaky E2E segments test (#44487) 2024-06-20 12:04:51 -06:00
Nicolò Pretto
105a72a008 remove code from useDashboardUrlParams and related files (#44426)
* simplify bordered logic

* 🧹 setTitled

* 🧹 setHideDownloadButton

* 🧹 setHideParameters

* inline useEmbedDisplayOptions

* move DEFAULT_EMBED_DISPLAY_OPTIONS to costants file so we can remove use-embed-display-options.ts

* move consts up in the file

* update deps of useEffect

* fix ts error in the sdk

* use useEmbedFrameOptions in useDashboardUrlParams

* embed frame should not touch the `embed` slice, which is used for interactive embedding
2024-06-20 17:05:35 +02:00
Mahatthana (Kelvin) Nomsawadi
05417a3a6c Add a link to embedding SDK changelog (#44480) 2024-06-20 15:35:48 +01:00
Alexander Polyankin
b3749f8fe5 E2E tests for click behaviors with temporal unit parameters (#44436) 2024-06-20 10:29:28 -04:00
Raphael Krut-Landau
79c8e9bd82 fix(admin): Add e2e tests of the database caching policy form's basic functionality (in Admin / Performance) (#44416)
Closes #44478
2024-06-20 10:14:44 -04:00
Ngoc Khuat
4a03070a9b Fix unable to sync json column with value is an array (#44465) 2024-06-20 14:05:00 +00:00
Raphael Krut-Landau
7e7414e86e fix(cache): Add missing question mark in the 'Clear cache' confirmation modal (#44453) 2024-06-20 07:47:20 -05:00
Phoomparin Mano
dab2d85277 fix(sdk): font size, color and padding in viz (#44283)
* funnel start color should be text-dark

* change pivot table font size unit to em for scaling

* change funnel and legend item unit to em

* change funnel font size to em

* change object detail font size to em

* change gauge font size to em

* add cartesian chart padding config

* update docs

* remove isEmbeddingSdk prop

* simulate the 0.875em base font size

* chart padding override should apply in query builder

* add cartesian padding to stories

* update readme docs

* fix collection browser option in readme docs

* fix pivot table font size scaling

* update loki

* update loki

* use em for smart scalar

* update chart default padding

* revert smart scalar font size scaling due to measurement

* dynamic font family and font size as defaults

* pivot table

* add more properties to sdk docs

* make FONT_SIZES constant local

* link to discussion on query builder extra spacing

* enforce that font is passed to getLeftHeaderWidths
2024-06-20 19:14:09 +07:00
Phoomparin Mano
992b2e899f fix(sdk): load custom font files when font is set to custom (#44432)
* load custom font family

* always return custom font family

* add tests for returning custom font family
2024-06-20 18:26:43 +07:00
github-automation-metabase
488e08a7dd Update Readme version references and published npm version to 0.1.12 (#44466) 2024-06-20 09:56:14 +00:00
Uladzimir Havenchyk
5638d79768 Adjust undo toast timeout 12s -> 8s (#44422)
* Adjust undo toast timeout 12s -> 8s

* typo

* Address review
2024-06-20 11:48:46 +03:00
Alberto Perdomo
0081f202bc Update SDK README.md (#44427)
Remove warnings about not using MB versions in production. This is a left over from the time we were pointing to builds off master and RCs.
2024-06-20 07:33:48 +00:00
Raphael Krut-Landau
e5c14e16ae fix: Use an indicator-agnostic testid (#44265)
* Use an indicator-agnostic testid

* Run sed

* Use correct testid
2024-06-19 20:32:15 -04:00
Case Nelson
523ea2488b fix: populate param-fields for named fields on public dashboards (#44440)
* Update e2e test

* Update e2e test

* fix: populate param-fields for named fields on public dashboards

* Add name to public hydration

* Add tests

* Add tests

* Fix tests

---------

Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
2024-06-19 17:26:25 -06:00
Raphael Krut-Landau
08613cb3b6 fix(cache): Fix two bugs in Admin / Performance (#44255)
Ensures that minimum query durations are correctly displayed in the form post-save (#44249) and that all times can be used in the Schedule component  (#44257)
2024-06-19 18:53:03 -04:00
Raphael Krut-Landau
c006657dce feat: Use skeletons to indicate that the main navigation sidebar is loading (#44010) 2024-06-19 18:38:05 -04:00
Cal Herries
3f788bbaf2 Exclude native query matches in search scoring when the search should exclude native queries (#43982)
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
2024-06-19 22:06:02 +00:00
adam-james
bbde99dd31 User parameter value json fix (#44420)
* UserParameterValue transforms wrapped to properly escape string vals

The `json-in` and `json-out` functions used for toucan model transforms do not perform any string escaping logic. This
makes sense as we don't want to make assumptions about the shape of data flowing in/out of the db. But, this did mean
that for the User paramter values table, string values were causing an error to be logged. This doesn't break
anything, as the function will still correctly return the string, but it can clutter up logs.

So, this PR wraps all incoming values in a map and unwraps it for outgoing values.

* Add migration to wrap existing user param values with ::wrapper key

Since the in/out transform for UserParameterValues is updated, we need to migrate any existing values to have this wrapping.

* Simplify the solution to the problem.

Since we're already getting what we need from the json-in/json-out *except* that it's logging a parse error, we can
create a json-out that works the same way (tries to parse and returns the string as-is if it fails) without logging an
error at all.

* take away the arg and keywordize inside the json-out fn

* remove irrelevant comment

Signed-off-by: Adam James <adam.vermeer2@gmail.com>

* Add a little more test coverage for different value types

* faster test thanks to Dan!

* Add a comment about the data being tested

---------

Signed-off-by: Adam James <adam.vermeer2@gmail.com>
2024-06-19 21:50:47 +00:00
Alexander Polyankin
80c34c673d Disable parameter mapping to native models (#44372) 2024-06-19 21:21:57 +00:00
adam-james
89bdaa2fa8 XLSX Pivot Table Downloads have 'Native' Pivot Table (#43791)
* XLSX Pivot Table Downloads have 'Native' Pivot Table

Addresses: #2473

The xlsx downloads work fine for regular tables. However, on Pivot Table downloads, the resulting file isn't pivoted
and is formatted somewhat strangely (it contains additional rows related to totals, has an extra 'pivot-grouping'
column).

Now, the downloaded xlsx file contains 2 sheets:
- the data sheet containing the question's rows unpivoted. If you were constructing a pivot table yourself, you would
probably start with this shape of data.
- the pivot sheet containing a 'native' Pivot table whose reference points to the data on the data sheet, and whose
columns, rows, and values align with the cols, rows, and measures set up in Metabase

* Silly typo!

* Exported Pivot uses correct aggregation (sum, count, stddev, avg, min, max)

* data for pivot exports now also uses the formatting

* Add a test asserting that a pivot table exists in the xlsx file

* add-row! is a method dispatching on sheet class

* remove unnecessary hint

* address review feedback:

 - consolidate the aggregation function key fns into one function in the .xlsx namespace
   this was moved out of postprocessing so that the xlsx specific fns don't litter the post processing namespace at
   this time

 - clean up an unnecessary destructiring inside the native-pivot function
 - don't shadow 'name' inside the body of a fn

* Add tests that confirm zero-col and zero-row situations work

* Consolidate the atoms used to store pivot rows/options
2024-06-19 21:14:05 +00:00
Alex Yarosh
301ab32cef docs: Serialization API uses POST (#44439)
* call attention to POST

* wording
2024-06-19 16:24:01 -04:00
Nemanja Glumac
737c24af95 MS2: Expose "Include this {period}" in time-series chrome (#44247)
* Expose "Include this {period}" in timeseries chrome

* Fix type errors

* Simplify type guards

* Add unit tests

* Remove Flex wrapper around Switch

* Extract `IncludeCurrentSwitch` component

* Add E2E smoke tests

* Cover the toggle behavior with E2E tests

* Simplify test with a simple helper
2024-06-19 20:14:47 +00:00
Chris Truter
870dcd6c4a Don't analyse non-SQL cards with Macaw (#44350) 2024-06-19 12:48:15 -06:00
Denis Berezin
fa32093271 feat(sdk): Add interactive dashboards to embedding SDK (#44161)
* Temp

* Add support for saved questions

* Try to fix question not found issue

* Try to fix question not found issue

* Fix unit tests

* Add basic unit test

* Fix unit tests

* Fix unit tests, fix question not found issue

* Review fixes

* Review fixes

* Refactor components structure, review fixes

* Adjust readme
2024-06-19 18:05:19 +00:00
Anton Kulyk
4f53b0b9a9 Fix updating table questions in the notebook editor before running a query (#44428)
* Add repro test

* Fix null check
2024-06-19 18:33:02 +01:00
Braden Shepherdson
3ccf4d411c [QP] Fix breakouts on a nested model (#44418)
Fixes #43993 for real.

The earlier fix #44182 was needlessly restricting the
"nominal refs" check to fields which were using numeric IDs,
when really any match on nominal refs is valid.
2024-06-19 17:24:00 +00:00
Braden Shepherdson
891260cb57 [MBQL lib] Put :fields :all on joins on deleting last aggregation/breakout (#44321)
Part of #44298.
2024-06-19 17:09:42 +00:00
Mahatthana (Kelvin) Nomsawadi
863bc82af1 Clarify SDK release workflow (#44385) 2024-06-19 17:51:05 +01:00
github-automation-metabase
6f5c43d358 Update Readme version references and published npm version to 0.1.11 (#44421) 2024-06-19 16:50:54 +00:00
Mahatthana (Kelvin) Nomsawadi
0a550944f6 docs(sdk): Update readme pointing to the most recent v50 version (#44411)
* Update readme pointing to newer 50 release

* Update enterprise/frontend/src/embedding-sdk/README.md

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

---------

Co-authored-by: Phoomparin Mano <poom@metabase.com>
2024-06-19 17:22:50 +01:00
Ryan Laurie
9e4cbda477 ci: Automatically add milestones to prs and issues (#44357)
* automatically add milestones to prs and issues

* test code

* test code

* test commit (#3138)

* test commit (#43320)

* test commit (#44357)

* remove test code

* add newlines

* prefer older version milestones
2024-06-19 09:54:36 -06:00
Alex Yarosh
f0db81fccd docs: change paid to pro/enterprise (#44383)
* docs: change paid to pro/enterprise

* Apply suggestions from code review

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

---------

Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
2024-06-19 15:28:12 +00:00
Jeff Bruemmer
5efb56c065 docs - add 50.6 to list of releases (#44399)
* add 50.6 to list of releases

* 49.17
2024-06-19 10:33:51 -04:00
Ryan Laurie
c643f094f1 Send five flakiest tests to flake job (#44402) 2024-06-19 14:24:16 +00:00
dependabot[bot]
c17bb33f0e Bump ws from 7.5.9 to 7.5.10 (#44345)
Bumps [ws](https://github.com/websockets/ws) from 7.5.9 to 7.5.10.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.5.9...7.5.10)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
2024-06-19 17:16:28 +03:00
Uladzimir Havenchyk
400a1a2a10 fix: Do not pass template variables to findColumnIndexesFromLegacyRefs (#44377)
* fix: Do not pass template variables to findColumnIndexesFromLegacyRefs

* Add repro
2024-06-19 16:57:46 +03:00
Alexander Solovyov
f284a522e3 [openapi] fix query parameter detection and add default/description handling (#44239)
Also OpenAPI generation now handles parameter renaming, like in `{c :count}` destructuring.
2024-06-19 16:24:35 +03:00
Uladzimir Havenchyk
b41a5e840f Make dashboard filter auto-wire less presumptuous - add toast animation and hint messages (#44378) 2024-06-19 16:11:19 +03:00
github-automation-metabase
0e9076c0ff Update Readme version references and published npm version to 0.1.10 (#44398) 2024-06-19 13:07:43 +00:00
Kamil Mielnik
6daecbc66b Upgrade RTK to v2 (#44339)
* Upgrade @reduxjs/toolkit from ^1.9.3 to ^2.2.5

* Fix typing

* Upgrade redux-actions and @types/redux-actions

* Fix type errors

* Fix type errors

* Upgrade react-redux from ^8.0.5 to ^9.1.2
- remove @types/react-redux as it's no-longer-needed

* Upgrade redux-promise from ^0.5.0 to ^0.6.0
- upgrade @types/redux-promise

* Remove unused @types/redux-logger

* Revert "Upgrade redux-actions and @types/redux-actions"

This reverts commit 65005a0053.

* Remove createWeakSelector as weakMapMemoize is the default memoization strategy now

* Do not call unsubscribe if it does not exist

* Do not subscribe

* Remove console.log

* Make DelayedLoadingSpinner always render something with data-testid="spinner" so that tests can be aware of when things are loading

* Fix JoinStep unit tests

* Fix AddToDashSelectDashModal unit tests

* Fix SegmentApp unit tests

* Bring back original subscription logic

* Fix DataUsageStep unit tests

* Fix ManageApiKeys unit tests

* Simplify comment

* Fix MainNavbar unit tests

* Fix HomeRecentSection unit tests

* Use afterEach instead of afterAll to reset mocks

* Remove explanatory variable
2024-06-19 18:04:34 +07:00
Ngoc Khuat
613318f786 Metabase channel (#43924) 2024-06-19 09:25:42 +00:00
Ryan Laurie
35f97092e0 ci:Pass enterprise version to ee-extra build (#44386) 2024-06-19 02:38:34 -06:00
Nemanja Glumac
ce95331f30 Rename date/time empty filter options in the simple mode (#44102)
* Rename "empty" date/time filter options

* Add repro for #44101
2024-06-19 10:35:21 +02:00
Oisin Coveney
7de0faa635 Split View Header components into separate files (#44347) 2024-06-19 11:16:03 +03:00
adam-james
37abc08449 Pivot Tables with no Pivot Columns should still download (#44329)
* Pivot Tables with no Pivot Columns should still download

Fixes #44159

Pivot Tables can still be valid without columns, and therefore the download should respect such a query and be
successfully exported.

In this PR, the postprocessing of pivot results into 'visual pivot' exports for csv takes into account the zero-column
configuration and the download no longer fails.

* add a test to confirm that zero cols and >1 measures works as well

* Handle the case where there are zero pivot-rows.

This is a similar problem to the zero pivot-cols case, just with rows.

The app actually doesn't render these tables correctly, but that's a separate frontend bug
2024-06-18 13:20:00 -07:00
Benoit Vinay
6622470420 Add upload button for attached data warehouse (#43511)
* DWH plans added

* UploadCSV button component created

* Comments added

* Main nav bar updates

* Misc

* Align main nav bar button with link

* Misc comment

* Upload package created

* Various upload cleanup

* Misc

* Display button rule cleaned up

* Tracking added to upload CSV button

* Misc comment

* e2e tests WIP

* More comments

* e2e tests basic created

* NEw tracking schema

* e2e tests updated / Tracking WIP

* Analytics cleanup for button

* Misc

* Misc e2e tests Snowplow

* Removed forced Upload CSV button in FE

* Upload helpers created

* Misc unit tests updates

* Updated analytics

* Fix for e2e tests

* Upload fixture paths updated

* Misc for Snowplow

* Misc for plan

* More tests cleanup

* Misc

* Source added to analytics

* Plan unit tests fixed

* Update frontend/src/metabase/nav/containers/MainNavbar/MainNavbarContainer/MainNavbarView.tsx

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

* Update frontend/src/metabase/components/upload/constants.ts

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

* Misc imports

* Retrieving `uploads-settings` DB

* Remove default UploadCSV component export

* Misc

* Button copy updated

* Analytics updated with optional properties

* Default upload file input id updated

* csvupload schema updated

* Removed before

* No bad Snowplow events added

---------

Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
2024-06-18 12:48:32 -04:00
Romeo Van Snick
4f6bf67629 Add RTK endpoints for loading and searching parameters (#44291)
* Add RTK endpoints for loading and searching parameters

* Add Parameter API types

* Move types to metabase-types

* Add return type to normalizeQuery
2024-06-18 18:02:06 +02:00
Oisin Coveney
cc17b9e88e fix(sdk): Fix spacing between collection browser and breadcrumbs (#44342) 2024-06-18 18:35:55 +03:00
Anton Kulyk
1b78f5a361 Fix timeline events filtering in the query builder (#44355)
* Add repro test

* Fix timeline events filtering

* Don't include first date of next interval
2024-06-18 16:23:04 +01:00
Alexander Polyankin
bdbaee5a2a E2E repro for "Fix field values remapping with models & custom dropdown source in public dashboards" (#44315) 2024-06-18 14:09:27 +00:00
John Swanson
d6873e86d5 Fix missing can_restore on collections (#44287)
I'd fixed the `can_restore` on non-collections to always be present, but
forgot about fixing it for collections as well.
2024-06-18 07:01:48 -07:00
Nick Fitzpatrick
413efacef5 [Bug Fix] Use effective location when building initial path in entity picker (#44327)
* use effective location when building initial path in entity picker

* unit test adjustment

* more unit test adjustments
2024-06-18 10:59:14 -03:00
Nemanja Glumac
bc78552d5f Fix metabase lib returning the string "null" as the drill through value (#44234)
* Convert drill-through (CLJ) values to JS

* Convert the drill-through `:null` to an actual `null`

Resolves #44232

* Use new function in `filter-drill-details`

* display-info->js should check for nil before seqable?

* fix js object comparison

* Add test for the `drill-value->js` function

* Simplify the test

* Fix the JS object equality in the test

---------

Co-authored-by: Alexander Solovyov <alexander@solovyov.net>
2024-06-18 15:56:36 +02:00
Nemanja Glumac
cb9fac1ddd Update Past to Previous in date filters (#44299) 2024-06-18 15:55:54 +02:00
Alexander Polyankin
191572d90f E2E repro for "Fix issue with root collection in QuestionPicker" (#44318) 2024-06-18 09:33:07 -04:00
Alexander Polyankin
9c18d099ce Add auto-wiring e2e tests for temporal unit parameters (#44326) 2024-06-18 09:30:29 -04:00
Nemanja Glumac
844188a97e Preemptively fix the E2E flake in alerty types (#44344) 2024-06-18 15:15:31 +02:00
Roman Abdulmanov
4ab0cfca9c Mark external PRs with the label (#44343) 2024-06-18 15:44:13 +04:00
Oisin Coveney
8cb98be8af fix(sdk): Remove night mode toggle from SDK static dashboards (#44284) 2024-06-18 11:44:04 +03:00
Oisin Coveney
f57be777d4 fix(sdk): Add theming options for Collection Browser's empty content message (#44281) 2024-06-18 11:05:28 +03:00
Ngoc Khuat
4d907fe8fb dev/rollback! n migrations (#40488) 2024-06-18 14:58:29 +07:00
Ngoc Khuat
62e8739fed Writing migration notes (#44116)
* Writing migration notes
2024-06-18 05:57:19 +00:00
Alexander Polyankin
337dbbe074 Fix remapped values in public dashboards (#44254) 2024-06-17 21:34:35 -04:00
Nick Fitzpatrick
1c83904ee2 Search events 1-1-0 (#44314)
* search events 1-1-0

* backwards compatible adjustment

* making context optional
2024-06-17 18:33:00 -03:00
Jesse Devaney
7f19247f7f Fix incorrect goal line plotting when using non-linear y-axis scales (log/pow) (#44320)
* refactor: de-duplicate variable usage

* fix incorrect goal-line plotting in pow and log y-axis scales

* add Loki variants to validate and enforce desired behavior

* update loki snapshots
2024-06-17 20:57:02 +00:00
Case Nelson
ea9dfd1d2b Change run to make-run in process-query-for-card (#44244)
* Change run to make-run in process-query-for-card

Fixes #44160

There were two levers where a card could change how it was run.

`qp` this is basically `qp/process-query` with some optional userland
flags and constraints marked on the passed in query.
In the case of pivot tables in the
`/pivot/:card-id/query` endpoints it was `qp.pivot/process-query`

'run' this defaults to a streaming response that takes the `qp` param
and `export-format` and passes a query to qp. Most often this is
overriden to not stream the response.

Unfortunately, if `run` is overwritten, then `qp` is thrown away, and
the caller who overrides `run` must determine the correct `qp` to use.

However, when running `process-query-for-dashcard` it is difficult to properly set
`qp` for all of the dashcards without doing card lookups. So [this commit](https://github.com/metabase/metabase/blob/release-x.50.x/src/metabase/query_processor/card.clj#L230-L232) did a check to swap the runner in the presence of a pivot query that calls the **default** runner with a `qp.pivot/run-pivot-query`. The problem is that pulse needs to use a non-default runner, but there's no way for `process-query-for-card` to do both.

This commit changes `run` to `make-run` which raises the abstraction to
a function that produces a runer given a `qp`. This allows
`process-query-for-card` to change the `qp` as needed while keeping the
passed in runner.

There's really three things going on that could be teased apart
further/better.

1. `qp` - this conflates the processor (`qp/process-query` `qp.pivot/run-pivot-query`)
  and modifying query (`qp/userland-query`,
  `qp/userland-query-with-default-constraints` `(update query :info merge info)`)
2. `make-run` - How the above are processed: (streaming/realized)

* Fix tests
2024-06-17 11:29:57 -07:00
Alberto Perdomo
66a189f77f Update SDK README.md (#44292)
Tweak the callout about the SDK still being in development
2024-06-17 18:27:37 +01:00
Alex Yarosh
f8298e49e2 remove audit mentions (#44309) 2024-06-17 11:29:01 -04:00
Raphael Krut-Landau
01db0a2a70 fix: Remove references in the FE to the deprecated enable-query-caching setting (#44263)
* wip

* Remove references to the old enable-query-caching setting

* remove fixme

* linter

* remove some more instances

* fix imports
2024-06-17 10:06:52 -05:00
Alexander Polyankin
a0dfc99c41 E2E repro for "Dashboard filters do not work with SQL models" (#44297) 2024-06-17 14:51:12 +00:00
Ryan Laurie
a72afa4751 Rework slow test group (#44286)
* skip super slow xray test

* unmark not very slow tests
2024-06-17 08:49:18 -06:00
Nemanja Glumac
5fd247c5a1 MS1: Elevate "include this {period}" and "starting from" in the relative date picker (#44279)
* Elevate include this period in the relative date picker (#44179)

* Mock new row with "include {period}"  string

* Implement "include this" using a toggle

* Elevate "starting from" option in the relative date picker (#44242)

* Elevate "Starting from" option in the filter picker

* Tweak the date offset close icon

* Fix tests
2024-06-17 15:59:01 +02:00
Jeff Bruemmer
fdc0b71512 add 50.5 (#44293) 2024-06-17 09:33:18 -04:00
Ryan Laurie
13c71cd054 ci(release): Fix ee-extra trigger in release script (#44282) 2024-06-17 11:43:58 +00:00
Raphael Krut-Landau
93334133ea fix: Remove help email from error diagnostic modal (#44165) 2024-06-15 03:36:04 +00:00
Jesse Devaney
aac751c212 Fix tool-tip values not being scaled in waterfall charts (#44180)
* fix column scaling issues in waterfall chart

- refactor dataset scaling to behave like scatter and cartesian chart models

* add E2E test
2024-06-14 21:12:53 -03:00
Raphael Krut-Landau
9a68f25867 fix(webapp): Tweak dashboard move toast to add internal spaces and ttag context (#44191) 2024-06-14 17:17:59 -04:00
Jeff Bruemmer
9ac932ae16 Note on SQLite and cloud (#44237) 2024-06-14 15:42:51 -04:00
Aleksandr Lesnenko
74e73d2b6a fix charts crash in safari when dataset timezone is not in iana format (#44193)
* fix charts crash in safari when dataset timezone is not in iana format

* Update Loki Snapshots

* better fix: apply offset instead of finding a timezone with such offset

* remove unused specs

* Update Loki Snapshots

* review

---------

Co-authored-by: Metabase Automation <github-automation@metabase.com>
2024-06-14 19:18:58 +00:00
Cal Herries
dd1eb6cb4d Fix fields from Amazon Athena Tables failing to sync if there is not an underscore in the Table Name (#44032) 2024-06-14 18:26:21 +00:00
John Swanson
27e1ff6452 Fix collection id on collection items endpoint (#44236)
* Fix a potential bug in `hydrate-can-restore`

I had a bug here. I wanted to hydrate `:collection` on the items and
then return the original items, but instead I was `dissoc`ing
`:collection` from the items. If the original items passed in already
had `:collection` keys this would break them.

AFAIK this didn't cause any issues, but it could have - so fixing it here.

* Add a test

* Present collection items in the collection

When fetching collection items, we need to fetch the true
`collection_id` in order to figure out things like `can_restore` and
`can_delete`, but set it to the displayed/effective `collection_id` when
we actually send it out.

This fixes a bug where collections had their `collection_id` match their
`id` when returned by this endpoint.
2024-06-14 18:22:50 +00:00
Ryan Laurie
6d87ed281e ci(release):Tag tech writers in release message (#44216) 2024-06-14 08:39:25 -06:00
Jeff Bruemmer
7d2112e697 Update partner-and-community-drivers.md (#44218) 2024-06-14 11:16:03 -03:00
Sloan Sparger
f702aee6a0 Sort trash collection by last_edited_at desc (#44181) 2024-06-14 09:04:49 -05:00
Alex Yarosh
8c416bd9ab update list of releases (#44217) 2024-06-14 09:56:40 -04:00
Phoomparin Mano
dd00df1a06 Replace usage of color-mod with color-mix and remove the postcss function (#44175)
* replace color-mod with color-mix

* update alpha values to round to 5%

* add deprecation notice to lighten, darken and alpha

* update loki reference image

* add alpha value css variables to storybook preview

* update loki reference image
2024-06-14 13:29:13 +00:00
Abed Habli
0e8469f4b0 capitalize the ‘U’ in user interface (#44196) 2024-06-14 09:12:06 -04:00
Ryan Laurie
e1ade5c665 Trigger ee extra build (#44138) 2024-06-14 06:40:15 -06:00
John Swanson
e677eb7ad2 Always provide can_restore (#44124)
Previously we were just adding this when the item was archived. Instead,
always send a value - if the item is not archived, it can't be restored,
so it will be `false` in this case.

Making this change will make fixing a frontend bug easier, because the
frontend will be able to just trust the `can_restore` value coming in
from the backend.
2024-06-14 05:25:03 -07:00
github-automation-metabase
012a763522 Update Readme version references and published npm version to 0.1.9 (#44212) 2024-06-14 12:13:41 +00:00
Oisin Coveney
d7a1e86798 fix(sdk): Update README to move Embedding the collection browser to Features currently supposed (#44208) 2024-06-14 11:46:42 +00:00
Ryan Laurie
4bbc3163e2 Better Release Slack Notifications (#44195)
* add additional release slack message

* trigger slack messages from build

* fixes

* remove silly var name
2024-06-14 05:35:30 -06:00
Ryan Laurie
c769688711 Update release script to trigger ops issue creation (#39634)
* update release script to trigger ops issue creation

* update secret vars
2024-06-14 05:27:35 -06:00
Kamil Mielnik
5258ec54f8 Fix background-color usage in CSS-in-JS (#44204) 2024-06-14 11:25:30 +00:00
Ryan Laurie
4f25a4720b Combine collections e2e specs (#43841)
* combine collections e2e specs

* obey the linter
2024-06-14 05:12:09 -06:00
Raphael Krut-Landau
1bfcdf8c90 fix(admin): Rename some variables (#43817) 2024-06-14 06:40:19 -04:00
Oisin Coveney
7854e07a62 fix: Ensure interactive embedding CTA matches instance features (#44197) 2024-06-14 13:32:50 +03:00
Oisin Coveney
81a586df95 fix(sdk): Add theming to collection browser breadcrumbs (#44066) 2024-06-14 12:19:04 +03:00
Nemanja Glumac
884901f20a Remove "is empty" and "not empty" from time-series chrome (#44164)
* Remove "is empty" and "not empty" from time-series chrome

* Fix unit test
2024-06-14 11:00:58 +02:00
Phoomparin Mano
9decd3e8ed docs(sdk): add theming changes to embedding SDK docs (#44172)
* docs update

* add dashboard.backgroundColor
2024-06-14 08:58:04 +00:00
Romeo Van Snick
62123c073e Use MultiAutocomplete in dashboard filters (#43293)
* Use MultiAutocomplete in dashboard filters

* Handle prefix on MultiAutocomplete

* Remove unnecessary tests for empty values

* Remove input className

* Handle numbers in MultiAutocomplete

* Accept number values in MultiAutocomplete

* Use MultiAutocomplete in NumberInputWidget

* Filter out empty items

* Do not expect formatted number in values

* Do not allow adding multiple values when multi is false

* Handle undefined values

* Make value optional

* Fix MultiAutocomplete types

* Make MultiAutoComplete generic in its value type

* Refine MultiAutocomplete type in NumberInputWidget

* Refine MultiAutocomplete type in FieldValuesWidget

* Fix typo

* Fix MultiAutocomplete tests

* Add helpers to work with MultiSelect and MultiAutocomplete inputs

* Handle MultiAutocomplete input in tests

* Fix filter helper

* Use multiAutocompleteInput helper

* Find the value remove button in test

* Fix tests for NumberInputWidget

* Fix tests for DefaultPicker

* Fix type in NumberInput

* Fix dasboard test

* Fix embedding test

* Add helpers to remove values

* Fix chained filter test

* Fix nested test

* Fix embedding tests

* Fix filter tests

* Use removeMultiAutocompleteValue

* Use removeMultiAutocompleteValue

* Remove unused variable

* Use multiAutocompleteInput helper

* Handle comma's in values

* Handle multiselect

* Fix filter test

* Add filter

* Format field value

* Fix embedding tests

* Allow rendering custom label for item

* Use renderValue in FieldValuesWidget

* Fix data prop type

* Be more explicit about broken types in FieldValuesWidget

* Fix default behaviour for label

* Fix embedding tests

* Force click

* Fix sharing test

* Use removeMultiAutocompleteValue

* Handle multiautocomplete inputs

* Force click filter

* Close the suggestions menu

* Fix email test

* Fix sharing filter

* Set viewport in test

* Fix sharing test

* Remove debugging logs

* Use removeMultiAutocompleteValue

* Close the suggestions menu using blur

* Remove commented out code

* Remove the unused color prop

* Move shared types to types file

* Rename ValueType to TValue

* Add missing forwardRef

* Add tests for filter and renderValue

* Use TokenField for single value parameters

* Fix single value test

* Be more specific about when to select a single input

* Fix single value e2e test

* Handle undefined parameter

* Accept all RowValue types in MultiSelect

* Accept all RowValue types in ListField

* Accept all RowValue types in SingleSelectListField

* Be more precise about the FieldValuesWidget value types

* Be more specific about when to render normal input

* Remove duplicate import

* Remove maxSelectedValues from MultiAutocomplete

* Parse values in FieldValuesWidget

* Remove parsing complexity from MultiAutocomplete

* Be more strict when parsing numbers

* Do not use multiselect when arity is 1

* Remove spurious changes

* Pass prefix from FieldValuesWidget

* Remove number MultiAutocomplete story

* Remove renderValue from MultiAutocomplete

* Add custom component to MultiAutocomplete

* Add missing data prop

* Remove spurious changes in MultiAutocomplete

* Remove SelectItem reference

* Use renderValue in FieldValuesWidget
2024-06-14 10:04:18 +02:00
Nick Fitzpatrick
a8d5ea6437 fix(command-palette): fix docs url (#44113) 2024-06-13 22:49:44 -04:00
Raphael Krut-Landau
a95ff7f595 fix: Remove console warnings in cache-related code (#44173)
This PR removes:
- a warning about missing React keys in the `Schedule` component
- a warning about invalid props in the `StrategyFormLauncher` component
2024-06-13 22:32:54 -04:00
Raphael Krut-Landau
e33acdc6b6 feat(admin/cache): Use distinct routes for each performance tab (#44139) 2024-06-14 00:38:32 +00:00
Raphael Krut-Landau
1088baf011 [Browse] Add skeletons to Browse models (#44008)
* adds a shimmer effect to the skeletons
* adds a `natural` prop that makes the skeletons have a random width between 50% and 80%
* adds a skeleton to Browse models

Closes #44111
2024-06-13 20:33:56 -04:00
Braden Shepherdson
ba182e1745 [QP] Fix :fields clauses in nest-query with extra aggs outside model (#44182)
Fixes #43993.
2024-06-13 22:55:07 +00:00
Sloan Sparger
458fbf9efb fixes coloring for bulk actions bar button (#44178) 2024-06-13 17:14:59 -05:00
Nick Fitzpatrick
4772b5e249 Adding snippets back into getCollection (#44097)
* adding snippets back into getCollection

* e2e test

---------

Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
2024-06-13 17:01:58 -05:00
Phoomparin Mano
04a08d3304 replace css variables in static viz (#44131) 2024-06-14 03:04:15 +07:00
Noah Moss
2e94093025 Don't sync JWT registered claims as login attributes (#43976) 2024-06-13 19:10:53 +00:00
Noah Moss
d971a83601 Minor refactoring in JWT/SAML tests (#43866)
* little bit of refactoring in sso test code

* use :once instead of :each
2024-06-13 14:22:37 -04:00
Noah Moss
16599b223e Relax constraints on GET /api/user/:id endpoint (#44100) 2024-06-13 14:13:18 -04:00
Noah Moss
c7bf7d1def Fix login_history indexed columns (#44091) 2024-06-13 14:13:01 -04:00
Phoomparin Mano
d843973a8e feat(sdk): option to hide dashboard card title (#43859)
* expose card title settings

* Add dashboard test skeleton

* add a sample dashcard to the test

* dashboard grid should have card title by default

* add unit test for card title

* remove unused delay in unit test

* fix width and height being smaller than min values

* flip grid layout condition

---------

Co-authored-by: Oisin Coveney <oisin@metabase.com>
2024-06-14 00:54:01 +07:00
Raphael Krut-Landau
c7e46dc961 fix(ui-library): Don't animate Buttons (micro-PR) (#44137) 2024-06-13 16:10:33 +00:00
Phoomparin Mano
ee38f0e449 feat(sdk): apply theme options to tables in static dashboard (#44007)
* apply cell background color

* add id column overrides

* do not add transparency to id column cell when overridden

* fix static dashboard theming

* update loki reference image

* add style resets and regenerate loki snapshots

* add style resets and regenerate loki snapshots
2024-06-13 21:34:26 +07:00
Aleksandr Lesnenko
6e87cb9306 Fix invalid areas when line style is step (#44107)
* fix area step

* specs
2024-06-13 11:08:22 -03:00
Chris Truter
68bd9781ae Update Macaw to fix double blank lines (#44119) 2024-06-13 15:20:53 +02:00
Alex Yarosh
c5ef3fe772 [docs] update the list of releasts for 50.3 and 49.16 (#44125) 2024-06-13 09:11:19 -04:00
Anton Kulyk
ffbad1d6ae Fix broken line/area/bar charts after adding a second stage filter (#44053)
* Rework column sync to work with series objects

* Reuse previous metrics and dimensions if available

* Add repro test
2024-06-13 13:57:43 +01:00
Alexander Polyankin
3afe4821a0 Fix issue with root collection in QuestionPicker (#44081) 2024-06-13 03:52:09 +00:00
dpsutton
8824bd9a19 Handle errors when inferring separator of csv (#44073)
* Handle errors when inferring separator of csv

This file

```
"c1","c2"
"a,b,c","d"
```

was failing to upload for a silly reason: when we were checking for
which separator it used, we had a parse error when using a semi-colon
and that blew up the whole pipeline.

* Use cal's helpful test suggestions
2024-06-12 17:21:52 -05:00
Raphael Krut-Landau
e2144d140d Remove dead props in getButtonOverrides (#44082) 2024-06-12 16:55:17 -04:00
John Swanson
837beda619 Set can_delete to false for unarchived items (#44088)
Although a user may have the necessary permissions to delete an item, if we're not going to allow deleting unarchived items, can_delete should be false for them too.
2024-06-12 20:24:22 +00:00
Jeff Bruemmer
eb9bb2dad7 docs - minor edit (#44089) 2024-06-12 16:14:52 -04:00
Raphael Krut-Landau
6240dee136 [Browse] Use a loading skeleton instead of a spinner for Browse models in the nav (#43970)
* Add our first Mantine Skeleton

* Sort

* Simplify Skeleton.tsx
2024-06-12 15:16:34 -04:00
Alexander Polyankin
bab6387cdf Consolidate temporal unit pickers between dashboards and timeseries chrome (#44061) 2024-06-12 18:47:13 +00:00
Raphael Krut-Landau
44cfdf48e2 Make model persistence tab available on OSS (#44059) 2024-06-12 14:36:26 -04:00
Anton Kulyk
0cce65e2cb Move syncColumnSettings to metabase/visualization (#44074)
* Move `syncColumnSettings` to metabase/visualization

* Remove unused `SettingsSyncOptions`

* Fix type errors
2024-06-12 19:14:05 +01:00
Sloan Sparger
edcd2ff7c9 Fix "Manage database" perms incorrectly show up on the schema-level permissions page (#43601) 2024-06-12 13:02:01 -05:00
Jeff Bruemmer
fa8c7a2361 docs - release list 50.1 (#44076) 2024-06-12 13:26:21 -04:00
Alexander Solovyov
d638e94971 certain settings should be decrypted for cache config migration to run (#44048) 2024-06-12 11:22:04 -06:00
Ryan Laurie
d7bd5603bc Combine and reorganize admin e2e specs (#43853)
* combine and reorganize admin specs

* fix import and reorganize more
2024-06-12 11:20:47 -06:00
Ryan Laurie
acd7c31f22 Combine embedding e2e specs (#43843) 2024-06-12 11:20:25 -06:00
Ryan Laurie
cbda131e84 Combine native e2e specs (#43844) 2024-06-12 11:20:01 -06:00
Ryan Laurie
121054b293 Update how we run maildev in pre-release testing (#44072) 2024-06-12 10:27:22 -06:00
Oisin Coveney
fad00d4346 Convert Badge and CollectionBadge (#43997) 2024-06-12 17:18:15 +03:00
Alexander Polyankin
084dd3b2ae Allowlist for temporal unit parameters (#43967) 2024-06-12 10:05:24 -04:00
Ngoc Khuat
937e3daac1 Fix get card query_metadata and dashboard query_metadata throws 500 when users don't have view perms on any tables (#44052) 2024-06-12 15:53:50 +02:00
Nemanja Glumac
01e9387f62 Fix broken filter E2E test (#44051)
* Fix broken E2E test

* Remove linter warning
2024-06-12 12:31:03 +00:00
Oisin Coveney
14db7aeeac feat(sdk): Add collection browser (#43606) 2024-06-12 11:37:42 +03:00
Uladzimir Havenchyk
f7502d96e7 Restore icons in the new filter popup (#44025)
* Restore icons in the new filter popup

* it.each
2024-06-12 07:40:48 +00:00
Ivan Križnar
bae0aedf2c Fix scrollbar interaction in the custom expression suggestion list (#43995)
* Fix dismissing popup

* Undo revert

* Merge refs

* Update frontend/src/metabase/query_builder/components/expressions/ExpressionEditorTextfield/ExpressionEditorTextfield.tsx

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

* Update frontend/src/metabase/query_builder/components/expressions/ExpressionEditorSuggestions/ExpressionEditorSuggestions.tsx

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

* Update frontend/src/metabase/query_builder/components/expressions/ExpressionEditorSuggestions/ExpressionEditorSuggestions.tsx

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

* Use semantically correct HTML

* Fix popmenuTarget type

---------

Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
2024-06-12 09:07:40 +02:00
Aleksandr Lesnenko
ae2c960913 fix single series bar hover (#43984)
* fix single series bar hover

* prefer reduced motion
2024-06-12 01:17:09 +00:00
Case Nelson
febfe4a5aa [Metrics V2] Metrics with filters on implicitly joined columns produce query error when added in a Summarize block (#43987)
* [Metrics V2] Metrics with filters on implicitly joined columns produce query error when added in a Summarize block

* Handle multiple metrics with same implicit join

* Address PR feedback
2024-06-11 16:12:51 -06:00
Nemanja Glumac
9ebb679f6d Fix "collection items sorting" E2E flake (#44023)
* Fix "collection items sorting" E2E flake

* Add comments

* Remove the `@flaky` tag
2024-06-11 19:45:45 +00:00
Nemanja Glumac
ce5d2547e7 Remove the custom resize handle from the notebook native query preview sidebar (again) (#44021) 2024-06-11 19:25:02 +00:00
Jeff Bruemmer
6c1458ff2f uploads in config file (#43891) 2024-06-11 14:13:32 -04:00
Nemanja Glumac
8af1555502 Fix the dashboard drill E2E flake (#44016) 2024-06-11 17:02:41 +00:00
bryan
7b849da346 Make recents understand context (#43478)
* adds the endpoint and a test

* add recents endpoint, todo: tests

* add post recents endpoint

* return recent views for both lists, but make the endpoint work

* Make recent-views context aware

- pruning is context aware, only checks for the recently-inserted
  context
- Adds endpoints:
    - POST to create selection recents,
    - GET activity/recents
      - requres context query param to be one of:
      - all, views, selections

- Adds context arg to update-users-recent-views!
- Cleans up arg schema for update-users-recent-views

* impl GET api/activity/recents

- return recent-selections and recent-views from
- send context == collection from pinned card reads

* update callsites of recent-views/update-users-recent-views!

- to use :view param where necessary

* fixes models/recent-view tests

* adds more activity/recent-view tests

* wip

- fix whitespace linter

* Fix command palette e2e test

- reuse util snake-keys

* updates fe to use new recents endpoints

* fixes fe type issue

* snake-keys -> deep-snake-keys

- I've been betrayed by lsp rename

* snake-keys -> deep-snake-keys

- I've been betrayed by lsp rename

* log selection events for created collections

* mysql doesn't allow default values for TEXT types

* log a recent view on data-picker selection

* decouple view-log context from card-event view context

* fix a doc typo

* stop double logging recent-views on POST

* maybe fixes some tests

* some e2e fixes

* fix mysterious divide by zero during score search

* fix divide by zero possibilities everywhere in score-items

metabase.api.activity/score-items used to throw when there weren't any
items being scored (even though there's a `(when (seq items) ...)` check)

* more test fixes

* fix more e2e tests, + rename endpoint in tests

* fix oopsie

* fixes a few more tests

* address review comments/questions

* allow for a comma delimited list in qps like ?context=views,selections

returns all recent view items with those contexts, most recent first
under the `:recents` key.

* refactors FE around new endpoint

* fixes for unit tests

* use ms/QueryVectorOf for context

* fix models/recent_views tests

* use multiple query params instead of comma delimited value on FE

* ignore timestamp when deduping recents

* review comments + test fixing

* update docstring

* fix api/activity_test s

* actually dedupe

* add test for deduping by context

* e2e fix: shows up-to-date list of recently viewed items after another page is visited

* e2e fix: should undo the question replace action

* e2e fix: should replace a dashboard card question (metabase#36984)

* e2e fix: should preselect the most recently visited dashboard

* fix 6 more e2e tests

* fixes fe type check and unit failure

* renames unit test mocking function

* fix a flaky e2e test

* widen Item to accept str or kw where sensible

- allow strings or keywords for moderated_status, and authority_level

* simplify impl + add test

* add view-log to events schema

* add collection context to view log

* fix the final 2 failing e2e tests

* click dashboard tab when the user has can-read? on recent entities

---------

Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
2024-06-11 10:12:29 -06:00
John Swanson
7374e61ed7 Improve the Trash data model (#42845)
* Improve the Trash

Ok, so I had a realization at the PERFECT time, immediately after the RC
cutoff. Great job, brain!

Here's the realization. For the Trash, we need to keep track of two
things:

- where the item actually is located in the hierarchy, and

- what collection we should look at to see what permissions apply to the
item.

For example, a Card might be in the Trash, but we need to look at
Collection 1234 to see that a user has permission to Write that card.

My implementation of this was to add a column,
`trashed_from_collection_id`, so that we could move a Card or a
Dashboard to a new `collection_id`, but keep track of the permissions we
actually needed to check.

So:

- `collection_id` was where the item was located in the collection
hierarchy, and

- `trashed_from_collection_id` was where we needed to look to check
permissions.

Today I had the realization that it's much, much more important to get
PERMISSIONS right than to get collection hierarchy right. Like if we
mess up and show something as in the Trash when it's not in the Trash,
or show something in the wrong Collection - that's not great, sure. But
if we mess up and show a Card when we shouldn't, or show a Dashboard
when we shouldn't, that's Super Duper Bad.

So the problem with my initial implementation was that we needed to
change everywhere that checked permissions, to make sure they checked
BOTH `trashed_from_collection_id` and `collection_id` as appropriate.

So... there's a much better solution. Instead of adding a column to
represent the *permissions* that we should apply to the dashboard or
card, add a column to represent the *location in the hierarchy* that
should apply to the dashboard or the card.

We can simplify further: the *only time* we want to display something in
a different place in the hierarchy than usual is when it was put
directly into the trash. If you trash a dashboard as a part of a
collection, then we should display it in that collection just like
normal.

So, we can do the following:

- add a `trashed_directly` column to Cards and Dashboards, representing
whether they should be displayed in the Trash instead of their actual
parent collection

- use the `collection_id` column of Cards and Dashboards without
modification to represent permissions.

There's one main downside of this approach. If you trash a dashboard,
and then delete the collection that the dashboard was originally in,
what do we do with `dashboard.collection_id`?

- we have to change it, because it's a foreign key

- we can't set it to null, because that represents the root collection

In this initial implementation, I've just cascaded the delete: if you
delete a dashboard and then delete a collection, the dashboard will be
deleted. This is not ideal. I'm not totally sure what we should do in
this situation.

* Rip out all the `trashed_from_collection_id`

* Migration to delete trashed_from_collection_id

* fixes

* don't move collections

And don't allow deleting collections

* only show cards/dashboards with write perms

* Show the correct archived/unarchived branch

* some cleanup

* add a todo for tomorrow

* Fix for yesterday's TODO

* more wip

* refactor

* memoize collection info

* move around memoization a bit

* fix schema migration test

* oops, delete server.middleware.memo

* Use a migration script (postgres only for now)

* Fix some tests

* remove n+1 queries in `collection-can-restore`

* fix test

* fix more tests, and x-db migration script

* fix h2 rollback

* fix mysql/mariadb migration

* lint

* fix some mariadb/mysql tests

* fix h2 rollback

* Fix mysql rollback

* Fix Postgres migration

* "Real" `trash_operation_id` UUIDs from migration

* fix mariadb migration

* Separate MySQL/MariaDB migrations

* trashed directly bit->boolean

* Remove `trashed_from_*` from migrations

* Rename `api/updates-with-trashed-directly`

Previously named `move-on-archive-or-unarchive`, which was no longer
accurate since we're not moving anything!

* Add `can_delete`

* Delete test of deleted code

* Can't move anything to the Trash

The Trash exists as a real collection so that we can list items in and
such without needing special cases. But we don't want anything to
_actually_ get moved to it.

* integrates can_delete flag on FE

* Update src/metabase/models/collection.clj

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

* Update src/metabase/search/impl.clj

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

* Better name for `fix-collection-id`

Also consolidated it into a single function. It takes the
trash-collection-id as an argument to prevent a circular dependency.

* s/trashed/archived/ on the backend

In the product, we want to move to "trashed" as the descriptor for
things that are currently-known-as-archived.

It'd be nice to switch to that on the backend as well, but that'll
require quite a lot of churn on the frontend as we'd need to change the
API (or have an awkward translation layer, where we call it `trashed` on
the backend, turn it into `archived` when sending data out via the API,
and then the FE turns around and called it "trashed" again).

For now, let's just be consistent on the backend and call it `archived`
everywhere. So:

- `archived_directly` instead of `trashed_directly`, and
- `archive_operation_id` instead of `trash_operation_id`

* Fix up a couple docstrings

* Rename `visible-collection-ids` args

for `collection/permissions-set->visible-collection-ids`:

- `:include-archived` => `:include-archived-items`

- `:include-trash?` => `:include-trash-collection`

* select affected-collection-ids in the tx

* Stop dealing with `:all` visible collection ids

This used to be a possible return value for
`permissions-set->visible-collection-ids` indicating that the user could
view all collections. Now that function always returns a set of
collection IDs (possibly including "root" for the root collection) so we
don't need to deal with that anymore.

* Don't use separate hydration keys for collections

Dispatch on the model of each item (but still keep them in batches for
efficiency.)

* vars for collectable/archived-directly models

* Round up loose `trashed_directly`s

* Fix a test

* Use `clojure.core.memoize` instead of handrolled

It's slightly different (TTL instead of exactly per-request) but that
should be fine.

* FE lint fixes

* 😭 e2e test fix

---------

Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
2024-06-11 11:31:14 -04:00
Phoomparin Mano
a742b3408b feat(sdk): theme option to customize the dashboard card border (#43963)
* add option to customize dashcard border

* use the shadow CSS variable

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

* make the shadow and border decoration call more explicit

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

* pass in theme as argument

---------

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2024-06-11 22:14:46 +07:00
Romeo Van Snick
d876627b24 Unary number parameter (#43921)
* Allow picking arity of number parameters

* Limit to input to have arity 1 when multi is false

* Use MultiAutocomplete in NumberInputWidget when arity is 1

* Add test cases for single value numbers

* Only change arity when it is n

* Fix unit tests for NumberInputWidget

* Move arity check for numbers to getNumberParameterArity
2024-06-11 16:57:14 +02:00
Jeff Bruemmer
64f82436ef docs - updates for 50 (#44002) 2024-06-11 10:38:15 -04:00
Nemanja Glumac
28fc332064 Fix "line/bar chart" tooltip flake (#43975)
* Fix the typo

* Replace `realHover` with the `mouseMove` trigger

* Be explicit when targetting elements by their index

* fix combo chart tooltip e2e specs

* cy.wait as a last resort

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2024-06-11 14:09:24 +00:00
Aleksandr Lesnenko
6ec9de852e move stackable settings (#43978) 2024-06-11 13:42:56 +00:00
Nemanja Glumac
eebf4b5239 Fix E2E flake in the native_subquery spec (#43991)
* Re-work `startNewNativeQuestion` helper

* Fix native_subquery flakes

* Simplify the helper

* Remove the `flaky` tags
2024-06-11 14:10:58 +02:00
Kamil Mielnik
c0a804bfe6 Copy question link from dashboard (#43816)
* Improve typing in Question

* Remove dead CSS

* Improve typing in getUrlWithParameters

* Add LegendLabel

* Drop navigateToNewCardFromDashboard in PublicOrEmbeddedDashboard

* Extract getNewCardUrl and move getParametersMappedToDashcard closer to it

* Add link to dashboard chart title

* Update title-drill tests

* Format code

* Update test

* Add HrefMemo

* Use state to memoize href

* Recompute state on getHref prop change

* Format code

* Refactor href computation

* Update test

* Use selector instead of useMemo

* Fix unit tests

* Ensure type safety

* Revert getDashCardById type change to not make this PR too large

* Use complete dashboard

* Add a workaround for metabase#43990
2024-06-11 17:39:45 +07:00
Kamil Mielnik
40ef144430 Revert "Fix scrollbar interaction in the custom expression suggestion list (#…" (#43992)
This reverts commit a297e9a6ad.
2024-06-11 10:14:33 +00:00
Phoomparin Mano
6113998662 apply full width to static dashboard (#43954) 2024-06-11 17:05:35 +07:00
Mahatthana (Kelvin) Nomsawadi
ddb6299993 Release a test from the flaky test jail (#43946) 2024-06-11 09:06:03 +01:00
Mahatthana (Kelvin) Nomsawadi
459429985c ci(sdk): Remind SDK PR author to use conventional commits PR title (#43932)
* Remind embedding SDK PR author to use conventional commits

* Only remind PR author when PR title isn't conventional commits

* Add branch for testing

* Fix gh cli command

* Fix getting wrong user login

* Ensure we don't create more than 1 comment

* Improve comment format

* Add more info for non-changelog related type

* Check non-changelog related types

* Update the comment for consistency

* Revert "Add branch for testing"

This reverts commit 4a1be68828.
2024-06-11 07:30:35 +01:00
Chris Truter
a46b9d7fc2 More precise migration range logs (#43962) 2024-06-11 08:21:58 +02:00
Denis Berezin
e8fedf0164 feat(sdk): SDK theming part 6 - text-brand, text-dark, text-light, text-medium, admin-navbar, accentX (#43687)
* Migrate text-brand

* Migrate text-dark

* Migrate text-light

* Migrate text-medium

* Migrate admin-navbar

* make compact formatting consistent across all series (#43472)

* make compact formatting consistent across all series

* fix rebase

* [Browse] Show Browse models link in nav only when there are models (#43286)

* Upgrade to TypeScript v5.4 (#43736)

* use correct github api for CI (#43750)

* update list of releases (#43754)

* Multi Series Dashcards Render with Filters Applied To All Series (#43428)

* Multi Series Dashcards Render with Filters Applied To All Series

Fixes: #39083

Multi-series dashcards now properly render when a subscription is set up with filters that impact the values of each
card in the multi-series card.

* Small refactor for executing dashcards in a pulse context.

- move execute-dashboard-subscription to pulse.util
- this fn now will also execute all card series cards
  and put those results into a list on the key :series-results in the dashcard
  which is then used in the render multimethod to send the correct data to the javascript context

A small todo was taken care of as well, we can now use :dashboard-subscription in the :context key

* Fix up render fn

The shape of hte data going into the javascript was a bit unclear before. This keeps things a little more
understandable.

Next step is probably to create some Malli schemas inside the js_svg namespace to document and enforce the needed data shapes

* pull :data up a level from :result in the series cards

* Update src/metabase/pulse/render/body.clj

Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>

* Remove unneeded let

* set/rename-keys won't work here because we raise the :data key

I've realised a suggested change to just use set/rename-keys won't do what we need. We need instead to raise :data
from within the result key up to the same level (and dissoc result).

I've renamed the helper function to make its purpose a bit clearer

---------

Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>

* Hydrate can_run_adhoc_query and address review comments (#43747)

This is a followup on #43625.

* Consolidate dashboard-card specs (#43716)

* Consolidate joins specs (#43717)

* Update translations for v50 and add Danish Language Support (#43314)

* update translations for v50

* add Danish

* update translations for v50 release

* alphabetical order is nice

* Move database role to url parameters from connection properties on Snowflake (#43602)

* Move role to url parameters from connection properties

* Fix test

* Fix width of save button in cache sidebar (#43755)

* Remove dead code (#43603)

* Combine search e2e specs (#43718)

* Highlight the table cell data in dashboards when the cell is an ID column (#43728)

* highlight id cell column

* add simpletable stories

* add simple table test data

* add loki reference image

* Update frontend/src/metabase/visualizations/components/TableSimple/TableCell.styled.tsx

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

---------

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

* Remove old repro for 39150 (#43749)

* Fix remaining `tinyint` booleans in MySQL (#43296)

* Correct type for `report_card.dataset`

This was missed in the original migration of boolean types to
${boolean.type} in MySQL/MariaDB, and then missed again by me when I
migrated `collection_preview` over a week ago.

* Change all boolean types to `bit(1)` in MySQL

Liquibase changed their boolean type in MySQL from `bit(1)` to
`tinyint(4)` in version 4.25.1. Our JDBC driver does not recognize these
as booleans, so we needed to migrate them to `bit(1)`s.

As discussed [here](#36964), we
changed all existing `boolean` types that were in the
`001_update_migrations.yml` but not the SQL initialization file.

For new installations, this works: things in the SQL initialization file
get created with the `bit(1)` type.

However, for existing installations, there's a potential issue. Say I'm
on v42 and am upgrading to v49. In v43, a new `boolean` was added.

In this case, I'll get the `boolean` from the liquibase migration rather
than from the SQL initialization file, and it need to be changed to a
`bit(1)`.

I installed Metabase v41 with MySQL, migrated the database, and then
installed Metabase v49 and migrated again. I made a list of all the
columns that had the type `tinyint`:

```
mysql> SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, COLUMN_TYPE,        COLUMN_DEFAULT, IS_NULLABLE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_TYPE = 'tinyint' AND TABLE_SCHEMA='metabase_test';
+---------------+------------------------------+-------------------+-------------+----------------+-------------+
| TABLE_SCHEMA  | TABLE_NAME                   | COLUMN_NAME       | COLUMN_TYPE | COLUMN_DEFAULT | IS_NULLABLE |
+---------------+------------------------------+-------------------+-------------+----------------+-------------+
| metabase_test | core_user                    | is_datasetnewb    | tinyint     | 1              | NO          |
| metabase_test | metabase_field               | database_required | tinyint     | 0              | NO          |
| metabase_test | metabase_fieldvalues         | has_more_values   | tinyint     | 0              | YES         |
| metabase_test | permissions_group_membership | is_group_manager  | tinyint     | 0              | NO          |
| metabase_test | persisted_info               | active            | tinyint     | 0              | NO          |
| metabase_test | report_card                  | dataset           | tinyint     | 0              | NO          |
| metabase_test | timeline                     | archived          | tinyint     | 0              | NO          |
| metabase_test | timeline                     | default           | tinyint     | 0              | NO          |
| metabase_test | timeline_event               | archived          | tinyint     | 0              | NO          |
| metabase_test | timeline_event               | time_matters      | tinyint     | NULL           | NO          |
+---------------+------------------------------+-------------------+-------------+----------------+-------------+
10 rows in set (0.01 sec)
```

Then wrote migrations. For each column, we:

- turn it into a `bit(1)`,

- re-set the previously existing default value, and

- re-add the NOT NULL constraint, if applicable.

* Change author and add missing `dbms`

---------

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

* Add ts-pattern library (#43752)

* Add events to measure search performance (#43135)

* new_search_query event

* Filters in object, search click event

* updating event schema

* type and event schema adjustments

* delete comments BE code

* adjusting tests

* PR feedback

* typos and spacing

* Fixup missing colors

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Raphael Krut-Landau <raphael.kl@gmail.com>
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: adam-james <21064735+adam-james-v@users.noreply.github.com>
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: SakuragiYoshimasa <ysrhsp@outlook.com>
Co-authored-by: John Swanson <john.swanson@metabase.com>
Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
2024-06-10 22:13:47 +00:00
Aleksandr Lesnenko
8936df34fb fix bar normalized stacking breaks line charts (#43957)
* fix bar normalized stacking breaks line charts

* spec
2024-06-10 21:24:30 +00:00
Emmad Usmani
80d33f6869 remove unused timeseries interval (#43421)
* remove two year timeseries interval

* use two year instead of five year interval

* update binning e2e spec
2024-06-10 21:17:15 +00:00
Nemanja Glumac
c62003fff3 Fix the flaky "bookmark" E2E test (#43965)
* Fix the flaky "bookmark" E2E test

Resolves #43871

* Remove the `flaky` tag
2024-06-10 22:27:02 +02:00
Alexander Polyankin
f530b0fd31 E2E tests for temporal unit parameters (#43688) 2024-06-10 16:24:51 -04:00
lbrdnk
f971c42ada Add connection string parsing to Snowflake (#43923)
* Add connection string parsing

* Add test case with role suffixed key
2024-06-10 22:04:10 +02:00
metamben
be9740ca70 Enable Clojure logging in the browser (#43959)
Messages at INFO level and higher will appear in the browser console.
2024-06-10 22:39:47 +03:00
Uladzimir Havenchyk
dc4614151c [Dashboard] Replace automatic wiring of the cards with opt-in variant (#43827) 2024-06-10 22:19:17 +03:00
Nemanja Glumac
84fd549fff Fix "CC typing suggestion" E2E flake (#43956)
* Fix E2E flake "cc-typing-suggestion"

Resolves #43872

* Remove `@flaky` tag

* Improve the assertion
2024-06-10 20:34:46 +02:00
Cal Herries
a2f3d74950 Actually validate view_log.context matches ::view-log/context on insert (#43801) 2024-06-10 18:04:08 +00:00
Nemanja Glumac
121fe66f67 Fix flaky E2E test "sidebar should be resizable" (#43947)
* Fix flaky E2E test "sidebar should be resizable"

* Remove the `flaky` tag

* Remove unused intercept
2024-06-10 17:35:36 +00:00
Ivan Križnar
a297e9a6ad Fix scrollbar interaction in the custom expression suggestion list (#43837)
* Expose `ExpressionEditorSuggestions` ref

* Add popup ref

* Prevent popup being dismissed when active

* Update displayName
2024-06-10 19:08:15 +02:00
metamben
8609c02bb6 Bulk load data for can_run_adhoc_query and table metadatas (#43899) 2024-06-10 19:47:31 +03:00
Raphael Krut-Landau
46215d51fc Remove classnames (#43869) 2024-06-10 12:33:38 -04:00
Raphael Krut-Landau
752749f79e [Cache] Fix save button bug and several smaller issues (#43810) 2024-06-10 15:49:25 +00:00
Chris Truter
5fc87983ff Avoid guessing Liquibase table name (#43928) 2024-06-10 15:29:09 +00:00
Raphael Krut-Landau
b6dea77ab0 Use the metric icon for metrics (#43893)
Closes #43894
2024-06-10 10:48:26 -04:00
Anton Kulyk
f106ffa776 Fix stacked redirects to homepage dashboard crashing the app (#43836)
* Add repro test

* Move home selectors to `metabase/selectors/app`

* Prevent unnecessary redirects to home dashboard

* Rename

* Handle navbar home link

* Fix unit tests

* Fix navigating away from an archived dashboard

* Handle sub-root Metabase URLs
2024-06-10 15:30:07 +01:00
Chris Truter
2cf666d9af Rename 'direct' fields references to 'explicit' (#43823) 2024-06-10 13:58:41 +00:00
Cal Herries
67fec430a5 Change the uploads-enabled setting's visibility to internal (#43849) 2024-06-10 07:54:03 -06:00
Denis Berezin
7046fef3c4 feat(sdk): SDK theming part 5 - success, summarize, warning, white, text-white, bg-white (#43676)
* Migrate success

* Migrate summarize

* Migrate warning

* Migrate white

* Add colors to storybook

* Fix CI

* Fix CI

* Codereview fixes

* Convert warning color
2024-06-10 16:34:51 +03:00
Jeff Bruemmer
88734ca33c note on locked filters (#43886) 2024-06-10 08:34:32 -04:00
Kamil Mielnik
897a22f298 Time-over-time comparison - e2e tests (#43724)
* Sort functions

* Add boilerplate for aggregateOffset and tests

* Simplify assertion

* Make basic case work

* Handle name generation

* Do not require "lib/uuid" attribute to be present since MLv2 will normalize it under the hood anyway

* Fix typing

* Group tests

* Refactor offsetClause to return a new clause instead of a new query
- Move offsetClause to expressions.ts
- Add assertion

* Revert "Sort functions"

This reverts commit ab9ce2b24e.

* Move tests

* Handle names dynamically

* Shorten a test

* Update comment

* Add TODO

* Update expression types

* Add diffOffsetClause & percentDiffOffsetClause

* Add a test for diffOffsetClause

* Add TODOs

* Add tests for diffOffsetClause and percentDiffOffsetClause

* Unwrap tests

* Add skeleton for new tests

* Refactor first offsetClause tests

* Add tests for names

* Fix case of non-datetime columns

* Handle a case with offset < 1 and no breakouts

* Handle a case with offset < 1 and breakouts on non-datetime column

* Handle a case with offset < 1 and breakouts binned datetime column

* Handle a case with offset < 1 and breakout on non-binned datetime column

* Refactor

* Refactor

* Remove TODO

* Add tests for diffOffsetClause

* Add tests for percentDiffOffsetClause

* Move offset stuff to offset.ts and offset.unit.spec.ts

* Use template string for prefixes

* Use breakoutColumn + isDate to check column type

* Refactor

* Fix error message

* Add boilerplate for CompareAggregations

* Fix title

* Render aggregations list

* Style AccordionList

* Sort props

* Fix bucket name

* Use displayName instead shortName

* Support parseValue prop in NumberInput

* Add period input accepting integers only

* Accept non-negative values only

* Do not accept zeros

* Add state

* Add submit button

* Export offset functions via Lib

* Make it possible to skip rightSection

* Add column picker

* Map offset user input to api input (negative value)

* Add label

* Fix crash

* Extract shouldCreate

* Make onSelect in AggregationPicker support multiple values

* Extract ReferenceAggregationPicker

* Extract ColumnPicker

* Extract getAggregations

* Rename

* Add custom items

* Refactor item component

* Extract OffsetInput

* Remove unused data-testid

* Style OffsetInput

* Generate titles according to specs

* Generate label

* Generate help

* Extract utils

* Use different width for the 1st step

* Format code

* Use MultiSelect directly

* Avoid custom parseValue

* Revert MultiaAutocomplete changes

* Improve typing in describeTemporalInterval and
 describeRelativeDatetime

* Use describeTemporalUnit to pluralize

* Use interface

* Avoid setting value as DOM attribute

* Fix test

* Add onAdd prop to AggregationPicker and revert the change to have onSelect pass multiple aggregations

* Reduce number of props

* Render checkboxes in custom items

* Introduce and use --mb-color-brand-lighter

* Avoid !important

* Remove redundant prop

* Rename ExtractColumn to ExtractColumnAction

* Add lines.svg

* Fix positioning in case dir attribute is not present in any parent component

* Add CompareAggregationsAction

* Fix warning about isSelected being used as DOM attribute

* Fix positioning in case dir attribute is not present in any parent component

* Remove redundant Box

* Compute the title

* Add compareAggregationsDrill boilerplate

* Add compare-aggregations drill stub

* Update comment

* Compute title and aggregation

* Add TODO

* Use proper title when there's only 1 aggregation

* Show visualization on submit

* Limit aggregation choice to 1 in compare aggregations drill

* Redirect to chart upon submission

* Do not navigate to chart view

* Do not navigate to chart view

* Make drill-thru tests expect the new compare-aggregations drill

* Add type attribute to all ListItems

* Add aggregationIndex to drillInfo

* Add aggregationDrillDetails and wire it up

* Add tracking helpers

* Add new schema

* Add tracking in column header

* Add tracking in plus modal

* Add tracking in aggregation picker

* Fix destructuring

* Add functionsUsedByExpression

* Fix schema number

* Add tests boilerplate

* Implement test for notebook editor

* Add test for column header

* Add a test for summarize sidebar

* Add a test for the plus button

* Add expectNoBadSnowplowEvents call in afterEach

* Format code

* Add missing redux store state in tests

* Add data for tests

* Move createQuestion call out of beforeEach

* Add tests for labels when there are no aggregations

* Add describe

* Add group helper

* Revert "Add group helper"

This reverts commit e047a223e9.

* Optimize: use cy.log() instead of it()

* Format code

* Add tests for 1 breakout, add helpers

* Add test for non-binned datetime column text

* Add test for non-datetime column text

* Nest tests

* Add test for multiple aggregations and no breakout, fix getTitle in this case

* Add all text tests

* Reduce nesting

* Enable test

* Format code

* Add tests

* Rename function

* Format code

* Simplify code

* Add assertions

* Format code

* Add column assertions

* Run tests with all 3 aggregations

* Remove logs

* Introduce CUSTOM_EXPRESSIONS_USED

* Avoid force click

* Remove explicit assertion

* Use be.visible instead of exist

---------

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2024-06-10 11:56:46 +00:00
Ngoc Khuat
35b8b8b814 Fix flaky skip-if-empty-test by making sure pulse card follow ordres (#43913) 2024-06-10 08:05:22 +00:00
Uladzimir Havenchyk
8f399a1b3e Replace deprecated option from typescript v5 with eslint rule (#43767) 2024-06-10 10:43:50 +03:00
Ngoc Khuat
7b919f8b27 Task history sorted by started at (#43809) 2024-06-10 06:17:16 +00:00
Ngoc Khuat
51098a6cfa If there is an error in sync processes, make sure we catch the right exception (#43821) 2024-06-10 05:39:12 +00:00
Jesse Devaney
c93403e98f Fix stacked bar chart tool-tips when total value is negative (#43883)
* fix stacked bar chart tooltips when total value is negative

* add E2E test
2024-06-10 03:01:19 +00:00
Nick Fitzpatrick
92242d99b0 43475 command palette icon tweaks (#43652)
* Initial commit

* unit test, always white on active

* Run Prettier 🙄

* removing yellow color from verified model icon

* linter and type fix
2024-06-09 10:14:10 -06:00
Nick Fitzpatrick
7f4fd36b4e Refresh on login when user locale is different from site locale (#43775) 2024-06-09 09:08:28 -06:00
Braden Shepherdson
522b0df40a [MBQL lib] Move the field_ref matching hack from #43848 (#43902)
I'm not sure it's any less hacky in the CLJS but it keeps the TS
wrappers thin.

Context:
- #43799 is the original issue
- #43848 added the hack being removed here
2024-06-08 11:15:33 -04:00
Aleksandr Lesnenko
85ba3ac755 add line symbol on hover (#43887) 2024-06-07 21:04:57 -03:00
Ryan Laurie
f54fd3b1b6 Combine actions e2e specs (#43846) 2024-06-07 17:07:37 -06:00
Alexander Polyankin
6dff2dfe7e Fix parameter mapping with models (#43848) 2024-06-07 22:47:49 +00:00
Raphael Krut-Landau
74500ba310 Micro-edit: spaces not white spaces (#43860)
This PR simplifies a bit of text used in the cache cron schedule component: we can say "spaces" (which is normal English) not "white spaces" (which is developerese)
2024-06-07 18:07:33 -04:00
Raphael Krut-Landau
4e81aed3fb Fix unit test (#43895) 2024-06-07 18:02:03 -04:00
Aleksandr Lesnenko
f307977168 reset series displays when changing card display (#43868) 2024-06-07 21:12:41 +00:00
Nemanja Glumac
1d904a7eff Use params instead of body in RTK Query GET requests (#43786)
Resolves #41511
2024-06-07 22:59:50 +02:00
Jeff Bruemmer
9e191a48e6 docs - line charts updates (#43845) 2024-06-07 20:59:21 +00:00
Raphael Krut-Landau
95adc26b34 recents (#42138) 2024-06-07 16:28:10 -04:00
Raphael Krut-Landau
1b164bf49d [Browse] Remove Metabase analytics models from Browse models (#43778)
Closes #43251
2024-06-07 16:24:24 -04:00
Noah Moss
2cb5dd1919 Move around audit content to make perm checks more consistent + general cleanup (#43693) 2024-06-07 15:52:45 -04:00
Nemanja Glumac
19e92f3ee0 Use RTK Query to obtain task/job information (#43798)
* Type `TaskInfo`

* Re-write `JobInfoApp` to use RTK Query

* Re-write `JobTriggersModal` to use RTK Query

* Remove unused `fetchJobInfo` action

* Remove `TaskApi` from `services.js`

* Remove `JobApp` styled component

* Simplify fetching logic
2024-06-07 19:20:50 +00:00
Nemanja Glumac
bbde8ff568 Upgrade @testing-library/cypress to v10.0.2 (#43842) 2024-06-07 21:03:32 +02:00
Jeff Bruemmer
e34d653777 docs - update upload setting metadata (#43855) 2024-06-07 19:01:01 +00:00
Sloan Sparger
296636e5a6 Fix CloudPanel unit flake (#43856) 2024-06-07 18:36:20 +00:00
Raphael Krut-Landau
9f27f3775f Fix typo (#43808)
Fixes a small typo
2024-06-07 14:35:18 -04:00
Mahatthana (Kelvin) Nomsawadi
dfdaab03b3 ci(sdk): Automate merging SDK doc PR (#43751)
* Automate SDK doc PR

* Prevent auto merge

* Dry run npm publish for testing

* Speed up testing by not building jars

* Fix auto approve step

* disable concurrency so I could test multiple runs in parallel

* Test auto-merge

* Fix auto merge

* Revert "disable concurrency so I could test multiple runs in parallel"

This reverts commit 60e90076eb.

* Revert "Speed up testing by not building jars"

This reverts commit 4e53a54414.

* Revert "Dry run npm publish for testing"

This reverts commit 9b5d761c8d.

* Enable all commented out steps

* Remove unnecessary steps
2024-06-07 17:18:14 +01:00
github-automation-metabase
e13c64ec2c Update Readme version references and published npm version to 0.1.8 (#43832) 2024-06-07 16:56:25 +01:00
Mahatthana (Kelvin) Nomsawadi
905625eb5a ci(sdk): Ensure we append new release to the chaneglog instead of overwriting it. (#43729)
* Mock that the changelog is different from the one in master

* Apply changelog patch incase the changelog is created from another branch

* Dry run npm publish so I could test

* Fix failed patch

* Speed up testing by not building jar

* Fix adding new changelog to master

* feat(sdk): A placeholder for an actual feature in the changelog

* Mock that the changelog diverges from master

* Revert "Speed up testing by not building jar"

This reverts commit acb80d7465.

* Revert "Dry run npm publish so I could test"

This reverts commit f4e679efd9.

* Revert "Mock that the changelog diverges from master"

This reverts commit 0e77a68e1b.
2024-06-07 16:15:53 +01:00
Phoomparin Mano
40d11066a9 Customize dashboard, dashcard and question background color for embedding SDK (#43618)
* dashcard background color

* add bg-dashboard and bg-dashboard-card

* rename background-visualization to background-question

* apply bg-question to embedded questions

* use CSS variables along with theme object

* add css variables to more places

* add ability to reference design system colors for defaults

* use CSS variables for defaults

* fix chart skeleton test

* fix legend item title
2024-06-07 22:07:27 +07:00
Alexander Solovyov
33df115357 [sync] parse naked json values (#43812) 2024-06-07 17:42:16 +03:00
Alexander Polyankin
2b01d9fd3c Remove unused containers/DataPicker (#43802) 2024-06-07 10:31:49 -04:00
Ryan Laurie
4520bf9324 Run smaller smoke test suite for pre-release check (#43633)
* run smaller smoke test suite for pre-release check

* fix run command
2024-06-07 08:14:12 -06:00
Alex Yarosh
0d4c0e7850 format sql (#43753) 2024-06-07 09:59:32 -04:00
Romeo Van Snick
ceeac2912c Merge combine column components (#43593)
* Move expressionClause to handleSubmit

* Allow passing the first column as a prop and allow auto picking of columns

* Use CombineColumns component in header drills

* Remove duplicate CombineColumnsDrill component and helpers

* Allow separators to be null

* Calculate example in Example component to avoid useMemo call

* Fix test reference in test

* Append suffix to duplicate columns

* Rename parameter to something more expressive

* Enable autoPickColumn for all instances of the combine column popover

* Fix tests

* Fix notebook tests

* Make test typescript

* Correct types of openTable function
2024-06-07 12:38:56 +02:00
Mahatthana (Kelvin) Nomsawadi
dd30ead9a8 Add single CORS origin limitation (#43805) 2024-06-07 09:08:21 +00:00
Cal Herries
3c97497126 Change MySQL ENUM columns to have base_type=type/TextLike (#43533) 2024-06-06 22:10:17 -06:00
Nemanja Glumac
25c4cb0bd8 Fix milestone reminder (#42861)
* Add a helper to extract linked issues from PR body

* Add tests

* Tweak the workflow

* Fix the workflow

* Delete obsolete code

* Improve the message

* Fix whitespace error
2024-06-07 00:44:55 +02:00
Jesse Devaney
f54e3d5a76 Fix RowChart X-Axis ticks formatter (#43783)
* fix RowChart XAxis ticks formatter

- remove scaling from x-axis tick values like we did for y-axis tick values in ECharts charts

* add loki variant
2024-06-06 18:26:54 -04:00
Jesse Devaney
486e3370af hide "show_series_values" setting when "show_values" setting is disabled (#43785) 2024-06-06 21:54:35 +00:00
Ryan Laurie
1e50d9f3a8 Send more tests to flake jail (#43761)
* mark more tests as flaky

* all the flakes
2024-06-06 15:40:05 -06:00
Aleksandr Lesnenko
e3f166bf7b fix timeline events covers series (#43780) 2024-06-06 21:00:03 +00:00
Nick Fitzpatrick
6d0f5e69d6 Add events to measure search performance (#43135)
* new_search_query event

* Filters in object, search click event

* updating event schema

* type and event schema adjustments

* delete comments BE code

* adjusting tests

* PR feedback

* typos and spacing
2024-06-06 17:40:27 -03:00
Sloan Sparger
c7048cf89e Add ts-pattern library (#43752) 2024-06-06 14:58:18 -05:00
SakuragiYoshimasa
49b126efcd Fix remaining tinyint booleans in MySQL (#43296)
* Correct type for `report_card.dataset`

This was missed in the original migration of boolean types to
${boolean.type} in MySQL/MariaDB, and then missed again by me when I
migrated `collection_preview` over a week ago.

* Change all boolean types to `bit(1)` in MySQL

Liquibase changed their boolean type in MySQL from `bit(1)` to
`tinyint(4)` in version 4.25.1. Our JDBC driver does not recognize these
as booleans, so we needed to migrate them to `bit(1)`s.

As discussed [here](#36964), we
changed all existing `boolean` types that were in the
`001_update_migrations.yml` but not the SQL initialization file.

For new installations, this works: things in the SQL initialization file
get created with the `bit(1)` type.

However, for existing installations, there's a potential issue. Say I'm
on v42 and am upgrading to v49. In v43, a new `boolean` was added.

In this case, I'll get the `boolean` from the liquibase migration rather
than from the SQL initialization file, and it need to be changed to a
`bit(1)`.

I installed Metabase v41 with MySQL, migrated the database, and then
installed Metabase v49 and migrated again. I made a list of all the
columns that had the type `tinyint`:

```
mysql> SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, COLUMN_TYPE,        COLUMN_DEFAULT, IS_NULLABLE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_TYPE = 'tinyint' AND TABLE_SCHEMA='metabase_test';
+---------------+------------------------------+-------------------+-------------+----------------+-------------+
| TABLE_SCHEMA  | TABLE_NAME                   | COLUMN_NAME       | COLUMN_TYPE | COLUMN_DEFAULT | IS_NULLABLE |
+---------------+------------------------------+-------------------+-------------+----------------+-------------+
| metabase_test | core_user                    | is_datasetnewb    | tinyint     | 1              | NO          |
| metabase_test | metabase_field               | database_required | tinyint     | 0              | NO          |
| metabase_test | metabase_fieldvalues         | has_more_values   | tinyint     | 0              | YES         |
| metabase_test | permissions_group_membership | is_group_manager  | tinyint     | 0              | NO          |
| metabase_test | persisted_info               | active            | tinyint     | 0              | NO          |
| metabase_test | report_card                  | dataset           | tinyint     | 0              | NO          |
| metabase_test | timeline                     | archived          | tinyint     | 0              | NO          |
| metabase_test | timeline                     | default           | tinyint     | 0              | NO          |
| metabase_test | timeline_event               | archived          | tinyint     | 0              | NO          |
| metabase_test | timeline_event               | time_matters      | tinyint     | NULL           | NO          |
+---------------+------------------------------+-------------------+-------------+----------------+-------------+
10 rows in set (0.01 sec)
```

Then wrote migrations. For each column, we:

- turn it into a `bit(1)`,

- re-set the previously existing default value, and

- re-add the NOT NULL constraint, if applicable.

* Change author and add missing `dbms`

---------

Co-authored-by: John Swanson <john.swanson@metabase.com>
2024-06-06 21:55:33 +02:00
Nemanja Glumac
2473fa2f8b Remove old repro for 39150 (#43749) 2024-06-06 21:53:50 +02:00
Phoomparin Mano
ea2d0a7e03 Highlight the table cell data in dashboards when the cell is an ID column (#43728)
* highlight id cell column

* add simpletable stories

* add simple table test data

* add loki reference image

* Update frontend/src/metabase/visualizations/components/TableSimple/TableCell.styled.tsx

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

---------

Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
2024-06-07 02:20:44 +07:00
Ryan Laurie
8cb8d6405d Combine search e2e specs (#43718) 2024-06-06 12:05:33 -06:00
Raphael Krut-Landau
df62bb0cb4 Remove dead code (#43603) 2024-06-06 13:56:09 -04:00
Raphael Krut-Landau
e199d76e6f Fix width of save button in cache sidebar (#43755) 2024-06-06 13:53:02 -04:00
lbrdnk
4a88a0c86a Move database role to url parameters from connection properties on Snowflake (#43602)
* Move role to url parameters from connection properties

* Fix test
2024-06-06 19:34:06 +02:00
Ryan Laurie
2cdae6bc9a Update translations for v50 and add Danish Language Support (#43314)
* update translations for v50

* add Danish

* update translations for v50 release

* alphabetical order is nice
2024-06-06 17:30:05 +00:00
Ryan Laurie
7a9767e110 Consolidate joins specs (#43717) 2024-06-06 11:14:54 -06:00
Ryan Laurie
3d1cbd3b8e Consolidate dashboard-card specs (#43716) 2024-06-06 11:14:43 -06:00
metamben
8eeacc60c4 Hydrate can_run_adhoc_query and address review comments (#43747)
This is a followup on #43625.
2024-06-06 20:07:30 +03:00
adam-james
b8907454c9 Multi Series Dashcards Render with Filters Applied To All Series (#43428)
* Multi Series Dashcards Render with Filters Applied To All Series

Fixes: #39083

Multi-series dashcards now properly render when a subscription is set up with filters that impact the values of each
card in the multi-series card.

* Small refactor for executing dashcards in a pulse context.

- move execute-dashboard-subscription to pulse.util
- this fn now will also execute all card series cards
  and put those results into a list on the key :series-results in the dashcard
  which is then used in the render multimethod to send the correct data to the javascript context

A small todo was taken care of as well, we can now use :dashboard-subscription in the :context key

* Fix up render fn

The shape of hte data going into the javascript was a bit unclear before. This keeps things a little more
understandable.

Next step is probably to create some Malli schemas inside the js_svg namespace to document and enforce the needed data shapes

* pull :data up a level from :result in the series cards

* Update src/metabase/pulse/render/body.clj

Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>

* Remove unneeded let

* set/rename-keys won't work here because we raise the :data key

I've realised a suggested change to just use set/rename-keys won't do what we need. We need instead to raise :data
from within the result key up to the same level (and dissoc result).

I've renamed the helper function to make its purpose a bit clearer

---------

Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
2024-06-06 09:58:58 -07:00
Alex Yarosh
60bb8d6158 update list of releases (#43754) 2024-06-06 12:44:51 -04:00
Ryan Laurie
5a481f98b8 use correct github api for CI (#43750) 2024-06-06 10:12:51 -06:00
Sloan Sparger
18d5388de0 Upgrade to TypeScript v5.4 (#43736) 2024-06-06 11:04:10 -05:00
Raphael Krut-Landau
080efbc837 [Browse] Show Browse models link in nav only when there are models (#43286) 2024-06-06 15:43:15 +00:00
Aleksandr Lesnenko
b9c10c5178 make compact formatting consistent across all series (#43472)
* make compact formatting consistent across all series

* fix rebase
2024-06-06 15:32:32 +00:00
metamben
2bfaab28e6 Batch load card metadata (#43625) 2024-06-06 11:04:46 -04:00
github-automation-metabase
56b3b5054f Update Readme version references and published npm version to 0.1.7 (#43734) 2024-06-06 16:04:34 +01:00
Mahatthana (Kelvin) Nomsawadi
3164995660 Reference new Metabase 50 RC version (#43735) 2024-06-06 15:26:14 +01:00
Ngoc Khuat
13e51d4ecc add mt/inbox as testing context for test helpers' (#43731) 2024-06-06 21:22:00 +07:00
Alexander Solovyov
74e524c057 do not output exceptions used only for tests (#43723) 2024-06-06 17:03:06 +03:00
Jeff Bruemmer
18581104b9 docs - models and caching (#43681) 2024-06-06 09:45:08 -04:00
Ryan Laurie
01840901fe Backport reminder bot (#43637)
* WIP backport reminder bot

* polish and automate backport reminder

* do better english
2024-06-06 07:12:46 -06:00
Ryan Laurie
4b66bdbabc Fix OSS tests in CI (#43660)
* fix OSS tests in CI

* update tests that went on vacation for a while

* do safer cypress things

* better helper name
2024-06-06 07:02:46 -06:00
Oisin Coveney
b87281c531 Update README to reflect API changes in Static Dashboard (#43727) 2024-06-06 13:00:09 +00:00
Alexander Polyankin
855c840bc2 Fetch ad-hoc query metadata on the BE (#43675)
* adhoc-query-metadata

* Get ad-hoc query metadata from the BE

* Fix broken ad-hoc queries

* Fix broken ad-hoc queries

* Fix tests

* Add a test

* Add tests

* Add tests

* Fix whitespace

* Fix whitespace

* Fix tests
2024-06-06 07:13:19 -04:00
Kamil Mielnik
49360f68bf Analytic events for time-over-time comparison (#43589)
* Sort functions

* Add boilerplate for aggregateOffset and tests

* Simplify assertion

* Make basic case work

* Handle name generation

* Do not require "lib/uuid" attribute to be present since MLv2 will normalize it under the hood anyway

* Fix typing

* Group tests

* Refactor offsetClause to return a new clause instead of a new query
- Move offsetClause to expressions.ts
- Add assertion

* Revert "Sort functions"

This reverts commit ab9ce2b24e.

* Move tests

* Handle names dynamically

* Shorten a test

* Update comment

* Add TODO

* Update expression types

* Add diffOffsetClause & percentDiffOffsetClause

* Add a test for diffOffsetClause

* Add TODOs

* Add tests for diffOffsetClause and percentDiffOffsetClause

* Unwrap tests

* Add skeleton for new tests

* Refactor first offsetClause tests

* Add tests for names

* Fix case of non-datetime columns

* Handle a case with offset < 1 and no breakouts

* Handle a case with offset < 1 and breakouts on non-datetime column

* Handle a case with offset < 1 and breakouts binned datetime column

* Handle a case with offset < 1 and breakout on non-binned datetime column

* Refactor

* Refactor

* Remove TODO

* Add tests for diffOffsetClause

* Add tests for percentDiffOffsetClause

* Move offset stuff to offset.ts and offset.unit.spec.ts

* Use template string for prefixes

* Use breakoutColumn + isDate to check column type

* Refactor

* Fix error message

* Add boilerplate for CompareAggregations

* Fix title

* Render aggregations list

* Style AccordionList

* Sort props

* Fix bucket name

* Use displayName instead shortName

* Support parseValue prop in NumberInput

* Add period input accepting integers only

* Accept non-negative values only

* Do not accept zeros

* Add state

* Add submit button

* Export offset functions via Lib

* Make it possible to skip rightSection

* Add column picker

* Map offset user input to api input (negative value)

* Add label

* Fix crash

* Extract shouldCreate

* Make onSelect in AggregationPicker support multiple values

* Extract ReferenceAggregationPicker

* Extract ColumnPicker

* Extract getAggregations

* Rename

* Add custom items

* Refactor item component

* Extract OffsetInput

* Remove unused data-testid

* Style OffsetInput

* Generate titles according to specs

* Generate label

* Generate help

* Extract utils

* Use different width for the 1st step

* Format code

* Use MultiSelect directly

* Avoid custom parseValue

* Revert MultiaAutocomplete changes

* Improve typing in describeTemporalInterval and
 describeRelativeDatetime

* Use describeTemporalUnit to pluralize

* Use interface

* Avoid setting value as DOM attribute

* Fix test

* Add onAdd prop to AggregationPicker and revert the change to have onSelect pass multiple aggregations

* Reduce number of props

* Render checkboxes in custom items

* Introduce and use --mb-color-brand-lighter

* Avoid !important

* Remove redundant prop

* Rename ExtractColumn to ExtractColumnAction

* Add lines.svg

* Fix positioning in case dir attribute is not present in any parent component

* Add CompareAggregationsAction

* Fix warning about isSelected being used as DOM attribute

* Fix positioning in case dir attribute is not present in any parent component

* Remove redundant Box

* Compute the title

* Add compareAggregationsDrill boilerplate

* Add compare-aggregations drill stub

* Update comment

* Compute title and aggregation

* Add TODO

* Use proper title when there's only 1 aggregation

* Show visualization on submit

* Limit aggregation choice to 1 in compare aggregations drill

* Redirect to chart upon submission

* Do not navigate to chart view

* Do not navigate to chart view

* Make drill-thru tests expect the new compare-aggregations drill

* Add type attribute to all ListItems

* Add aggregationIndex to drillInfo

* Add aggregationDrillDetails and wire it up

* Add tracking helpers

* Add new schema

* Add tracking in column header

* Add tracking in plus modal

* Add tracking in aggregation picker

* Fix destructuring

* Add functionsUsedByExpression

* Fix schema number

* Add tests boilerplate

* Implement test for notebook editor

* Add test for column header

* Add a test for summarize sidebar

* Add a test for the plus button

* Add expectNoBadSnowplowEvents call in afterEach

* Format code

* Add missing redux store state in tests

---------

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2024-06-06 18:03:32 +07:00
Kamil Mielnik
54d9fb2257 Time-over-time comparison - Unit tests (#43653)
* Use createQueryWithClauses in createQueryWithCountAggregation

* Support column-specific aggregations in createQueryWithClauses

* Add tests for compare option presence

* Fix case

* Add a test for onAdd

* Split tests

* Rename tests

* Add boilerplate for CompareAggregations unit tests

* Fix assertion

* Add more tests

* Add offset input tests

* Add tests

* Update frontend/src/metabase/query_builder/components/CompareAggregations/CompareAggregations.unit.spec.tsx

* Update tests after merge

* Use constants instead of factory functions
2024-06-06 07:44:54 +00:00
Mahatthana (Kelvin) Nomsawadi
ac6bb7b452 Followed-up tasks for changelog generation (#43656)
* Check git tag for an exact match

* Set npm publish to dry run, so I can test

* Uses new github automation account for creating a PR

* Remove unnecessary step

* Automatically set `no-backport` on the SDK doc version bump PR

* Fix step to edit PR with correct permission

* Remove npm dry run after finished testing
2024-06-06 08:42:24 +01:00
Denis Berezin
e430b776e3 feat(sdk): SDK theming part 4 - danger, dark, error, filter, focus, saturated, shadow (#43608)
* Migrate danger

* Migrate dark

* Migrate error

* Migrate filter

* Migrate focus

* Migrate saturated

* Migrate shadow

* Fix CI

* Fix CI

* Fix CI
2024-06-06 03:26:18 +03:00
metamben
0ade074b53 Remove serdes support for legacy metrics (#43272) 2024-06-05 23:17:17 +00:00
Ryan Laurie
7789ce34bf move github-slack-map to fix release script build (#43692) 2024-06-05 21:48:57 +00:00
Denis Berezin
6fcbf23e54 feat(sdk): SDK theming part 3 - brand, brand-light, brand-lighter (#43598)
* Migrate brand

* Migrate brand-light, brand-lighter

* Fix unit tests

* Code review fixes

* Fix CI
2024-06-06 00:17:00 +03:00
Jesse Devaney
6ac4fe977f Fix column scaling ("Multiply by a number") bugs (#43668)
* return empty string so non-empty labels do not get hidden by empty labels

* fix function name

* apply scaling in transformed dataset

* add missing option to OptionsType

* fix double scaling

* add column scaling to waterfall transformed dataset

* add column value scaling to dataset transform

* fix stacked bar segment labels not responding to column scaling

* fix tooltip values displayed

* since scaling as added to transformedDataset, use transformedDataset for formatters

* revert changes to display percentage instead of absolute value

* fix stacked data labels

* add loki variant for custom y-axis range with column scaling

* fix stack segmented label formatters compact calculation

* scale original dataset and use that instead of modifying transformedDataset

* update loki snapshots

* fix scatter plot dataset scaling

* fix tooltip values being double scaled

* add E2E test to validate behavior

* add helper for not duplicating the column scaling

* port multiple y-axis metrics with column scaling fixes to RowChart

* add waterfall and scatterplot loki variants

* fix type errors and failing unit tests

* fix failing unit tests

* update loki snapshots
2024-06-05 16:47:49 -04:00
Nemanja Glumac
5bf50a2131 Add E2E reproduction for #39150 (#43610)
* Add E2E reproduction for #39150

* Fix typo in the test title

* Move the viewport config to the `describe` block

* Add the second repro scenario as per the review comment

* Scope the variable to the relevant test
2024-06-05 22:47:38 +02:00
Anton Kulyk
c7c5b3568b Fix long field names handling for series names and in the model editor (#43394)
* Fix long names in model editor

* Fix long names in series name input
2024-06-05 19:04:01 +00:00
Alexander Polyankin
13aae6632d Performance fix for getUrlWithParameters when there are no parameters (#43626)
* Simple performance fix for getUrlWithParameters

* Fix tests
2024-06-05 14:50:55 -04:00
Jeff Bruemmer
f05fa8e607 column heading options (#43409) 2024-06-05 14:09:09 -04:00
Dennis Schridde
937e30fbed Expose attached-dwh token feature flag to frontend (#43657)
This allows frontend code to conveniently check whether the feature
flag is enabled or disabled.  This is in addition to the raw flag's
presence (or absence) in `(:features token-status)`.

References: https://github.com/metabase/metabase/issues/42381
References: https://github.com/metabase/metabase/pull/43511
2024-06-05 19:55:17 +02:00
Denis Berezin
8659846f0b feat(sdk): SDK theming part 2 - bg-error, bg-medium, bg-night, bg-white, border (#43512)
* Migrate bg-error

* Migrate bg-medium

* Migrate bg-night

* Migrate bg-white

* Migrate border

* Fix CI

* Fix unit tests

* Fix unit tests

* Code review fixes

* Code review fixes
2024-06-05 20:26:09 +03:00
Chris Truter
50e4cf7798 More wiring and documentation around Macaw (#43580) 2024-06-05 17:02:05 +00:00
Chris Truter
2a260cc9ff Demonstrate nesting dynamic redefines (#43496) 2024-06-05 18:42:52 +02:00
Kamil Mielnik
f61a065796 Previous period comparison shortcut in chill mode - column headers (#43500)
* Sort functions

* Add boilerplate for aggregateOffset and tests

* Simplify assertion

* Make basic case work

* Handle name generation

* Do not require "lib/uuid" attribute to be present since MLv2 will normalize it under the hood anyway

* Fix typing

* Group tests

* Refactor offsetClause to return a new clause instead of a new query
- Move offsetClause to expressions.ts
- Add assertion

* Revert "Sort functions"

This reverts commit ab9ce2b24e.

* Move tests

* Handle names dynamically

* Shorten a test

* Update comment

* Add TODO

* Update expression types

* Add diffOffsetClause & percentDiffOffsetClause

* Add a test for diffOffsetClause

* Add TODOs

* Add tests for diffOffsetClause and percentDiffOffsetClause

* Unwrap tests

* Add skeleton for new tests

* Refactor first offsetClause tests

* Add tests for names

* Fix case of non-datetime columns

* Handle a case with offset < 1 and no breakouts

* Handle a case with offset < 1 and breakouts on non-datetime column

* Handle a case with offset < 1 and breakouts binned datetime column

* Handle a case with offset < 1 and breakout on non-binned datetime column

* Refactor

* Refactor

* Remove TODO

* Add tests for diffOffsetClause

* Add tests for percentDiffOffsetClause

* Move offset stuff to offset.ts and offset.unit.spec.ts

* Use template string for prefixes

* Use breakoutColumn + isDate to check column type

* Refactor

* Fix error message

* Add boilerplate for CompareAggregations

* Fix title

* Render aggregations list

* Style AccordionList

* Sort props

* Fix bucket name

* Use displayName instead shortName

* Support parseValue prop in NumberInput

* Add period input accepting integers only

* Accept non-negative values only

* Do not accept zeros

* Add state

* Add submit button

* Export offset functions via Lib

* Make it possible to skip rightSection

* Add column picker

* Map offset user input to api input (negative value)

* Add label

* Fix crash

* Extract shouldCreate

* Make onSelect in AggregationPicker support multiple values

* Extract ReferenceAggregationPicker

* Extract ColumnPicker

* Extract getAggregations

* Rename

* Add custom items

* Refactor item component

* Extract OffsetInput

* Remove unused data-testid

* Style OffsetInput

* Generate titles according to specs

* Generate label

* Generate help

* Extract utils

* Use different width for the 1st step

* Format code

* Use MultiSelect directly

* Avoid custom parseValue

* Revert MultiaAutocomplete changes

* Improve typing in describeTemporalInterval and
 describeRelativeDatetime

* Use describeTemporalUnit to pluralize

* Use interface

* Avoid setting value as DOM attribute

* Fix test

* Add onAdd prop to AggregationPicker and revert the change to have onSelect pass multiple aggregations

* Reduce number of props

* Render checkboxes in custom items

* Introduce and use --mb-color-brand-lighter

* Avoid !important

* Remove redundant prop

* Rename ExtractColumn to ExtractColumnAction

* Add lines.svg

* Fix positioning in case dir attribute is not present in any parent component

* Add CompareAggregationsAction

* Fix warning about isSelected being used as DOM attribute

* Fix positioning in case dir attribute is not present in any parent component

* Remove redundant Box

* Compute the title

* Add compareAggregationsDrill boilerplate

* Add compare-aggregations drill stub

* Update comment

* Compute title and aggregation

* Add TODO

* Use proper title when there's only 1 aggregation

* Show visualization on submit

* Limit aggregation choice to 1 in compare aggregations drill

* Redirect to chart upon submission

* Do not navigate to chart view

* Do not navigate to chart view

* Make drill-thru tests expect the new compare-aggregations drill

* Add type attribute to all ListItems

* Add aggregationIndex to drillInfo

* Add aggregationDrillDetails and wire it up

* Fix destructuring

* Fix tests

---------

Co-authored-by: Braden Shepherdson <braden@metabase.com>
2024-06-05 15:53:51 +00:00
Oisin Coveney
5c5f6c39a1 fix(sdk): Fix static dashboard API (#43581) 2024-06-05 18:36:47 +03:00
Ryan Laurie
a691754a94 Add team devex (#43662)
* Add DevEx to team.json

* no trailing commas in json
2024-06-05 09:20:47 -06:00
Ryan Laurie
7251aa834c Put New Tests in Flake Jail + Parole Well Behaved Tests (#43623)
* tag flakiest tests as such

* let well behaved tests out of flake jail

* more bad actors off the streets

* add another flake

* sandboxes re-offended already
2024-06-05 07:40:45 -06:00
Alexander Polyankin
f28991450a Temporal unit parameters in dashboards (#43212) 2024-06-05 08:39:31 -04:00
Aleksandr Lesnenko
f025758d8f Set min bar height for non-zero bars (#43485)
* set min bar height for non-zero values

* fix y-axis split logic uses transformed dataset instead of actual data
2024-06-05 11:41:28 +01:00
Aleksandr Lesnenko
0fb138af86 Fix RowChart shrinks on hover (#43634)
* fix memoization

* extend the basic row chart e2e spec
2024-06-05 11:22:43 +01:00
Tim Macdonald
4ec415a024 Use a more obvious test error message (#43642)
(When scrolling through CI logs I always do a double-take when I see a
huge stack trace with "Just an error". I think this is a little
clearer?)
2024-06-05 10:15:18 +00:00
Oisin Coveney
7c636450c2 Convert Pagination Controls to TS (#43586) 2024-06-05 13:04:25 +03:00
Ngoc Khuat
b561b0111c Add inbox as testing context to debug flaky pulse tests (#43570) 2024-06-05 09:36:07 +00:00
Mahatthana (Kelvin) Nomsawadi
44fb3171f4 Fix flaky interactive-embedding.cy.spec.js (#43588)
* Fix flaky test

* Fix the flake for real

* Fix stress test failing because of mismatched height

* Review: Move viewport setting to shared config
2024-06-05 08:01:36 +00:00
Alexander Solovyov
1e4fe0f1b8 [cache] config should be editable if entity is accessible (#43522) 2024-06-05 08:35:41 +03:00
Ryan Laurie
03d60d8fed Make Backports Automerge Again (#43635) 2024-06-05 01:14:28 +00:00
Sloan Sparger
b97d9791ec uses data-autofocus attribute to avoid mantine modal moving focus to the modal close button (#43546) 2024-06-04 18:07:48 -05:00
Ryan Laurie
75fbccb765 Consolidate permissions e2e specs (#43552) 2024-06-04 15:52:39 -06:00
Ryan Laurie
68938adb0c Consolidate custom column e2e specs (#43616) 2024-06-04 15:52:00 -06:00
Ryan Laurie
fa0cf11b25 Combine e2e native filter specs (#43527)
* consolidate e2e native filter specs

* fix helper

* fix runQuery call
2024-06-04 15:51:47 -06:00
Ryan Laurie
590be77299 Consolidate dashboard e2e specs (#43613)
* consolidate dashboard e2e specs

* fix import
2024-06-04 15:51:35 -06:00
Ryan Laurie
ce5b1cfe2f Consolidate chart viz e2e specs (#43619) 2024-06-04 15:51:17 -06:00
Ryan Laurie
384af8167e Release from tagged test jars (#43545)
* allow releasing from tagged test jars

* always listen to nemanja

* use java 17
2024-06-04 15:29:55 -06:00
Jeff Bruemmer
5b5b05973e docs - license step (#43534) 2024-06-04 16:55:58 -04:00
Phoomparin Mano
9d61985fcc feat(sdk): font size scaling and adjustment for visualizations (#43264)
* support test utilities in sdk import

* add relative unit default chart font size in embedding defaults

* make font size follow sdk root

* feat(sdk): add font size settings to axis ticks

* feat(sdk): add font size settings to series labels

* re-add hasTimelineEvents from merge commits

* apply default font size at the theme level

* add table header cell font size

* calculate cell font size based on 12.5px

* rename theme.chart to theme.cartesian

* refactor visualization theme

* refactor default viz theme

* remove chart style config

* add goal line

* pass font size to chart measurements

* use px as reference unit

* support row chart viz

* add missing echarts font size

* add table cell font sizes

* use css variables for funnel color

* fix theme type in smart scalar story

* add bar chart to storybook for visual test

* add line chart to storybook for visual test

* add loki reference images

* add loki reference images for row chart

* add loki shared reference images to stories filter

* update loki reference image

* synchronize base font size

* add theme provider to funnel test setup

* add missing default visualization theme

* add unit test for get size in px

* update loki reference image

* fix static viz build error
2024-06-05 03:36:49 +07:00
Nick Fitzpatrick
7d0357d983 remove modified padding on ellipsifyed sidebar items (#43585) 2024-06-04 17:21:27 -03:00
Aleksandr Lesnenko
a727faddda loki CI improvements (#43607) 2024-06-04 15:49:00 -03:00
Jeff Bruemmer
d9aaa9fd43 docs - caching updates (#42857) 2024-06-04 13:25:10 -04:00
Case Nelson
cefd7a61e8 Add can_run_adhoc_query to Card hydration (#43464) 2024-06-04 11:04:03 -04:00
Jeff Bruemmer
c5404ea285 Docs env var info (#43150) 2024-06-04 14:43:18 +00:00
Raphael Krut-Landau
8b6a4c966e [Browse] Add brand-colored dot to filter icon when the filter is active (#43350)
Closes #42964
2024-06-04 10:33:42 -04:00
Ryan Laurie
91b4bd6b34 Add build requirements for v50 (#43537) 2024-06-04 08:07:11 -06:00
Ryan Laurie
d53b0a7a80 Consolidate sharing e2e specs (#43514) 2024-06-04 08:06:49 -06:00
Nicolò Pretto
fea8f89a57 temporarily removes the SameSite=None suggestion box (#43524)
* temporarily removes the SameSite=None suggestion box

* fix copy
2024-06-04 13:05:06 +02:00
Oisin Coveney
ecad0c94b5 fix(sdk): Fix map visualizations breaking (#43491) 2024-06-04 13:43:26 +03:00
dependabot[bot]
237a663b3a Bump mysql2 from 3.9.7 to 3.9.8 (#43446)
Bumps [mysql2](https://github.com/sidorares/node-mysql2) from 3.9.7 to 3.9.8.
- [Release notes](https://github.com/sidorares/node-mysql2/releases)
- [Changelog](https://github.com/sidorares/node-mysql2/blob/master/Changelog.md)
- [Commits](https://github.com/sidorares/node-mysql2/compare/v3.9.7...v3.9.8)

---
updated-dependencies:
- dependency-name: mysql2
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Chris Truter <chris@metabase.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
2024-06-04 11:18:03 +01:00
Kamil Mielnik
0da1dd1662 Previous period comparison shortcut in chill mode - "+" button (#43493)
* Sort functions

* Add boilerplate for aggregateOffset and tests

* Simplify assertion

* Make basic case work

* Handle name generation

* Do not require "lib/uuid" attribute to be present since MLv2 will normalize it under the hood anyway

* Fix typing

* Group tests

* Refactor offsetClause to return a new clause instead of a new query
- Move offsetClause to expressions.ts
- Add assertion

* Revert "Sort functions"

This reverts commit ab9ce2b24e.

* Move tests

* Handle names dynamically

* Shorten a test

* Update comment

* Add TODO

* Update expression types

* Add diffOffsetClause & percentDiffOffsetClause

* Add a test for diffOffsetClause

* Add TODOs

* Add tests for diffOffsetClause and percentDiffOffsetClause

* Unwrap tests

* Add skeleton for new tests

* Refactor first offsetClause tests

* Add tests for names

* Fix case of non-datetime columns

* Handle a case with offset < 1 and no breakouts

* Handle a case with offset < 1 and breakouts on non-datetime column

* Handle a case with offset < 1 and breakouts binned datetime column

* Handle a case with offset < 1 and breakout on non-binned datetime column

* Refactor

* Refactor

* Remove TODO

* Add tests for diffOffsetClause

* Add tests for percentDiffOffsetClause

* Move offset stuff to offset.ts and offset.unit.spec.ts

* Use template string for prefixes

* Use breakoutColumn + isDate to check column type

* Refactor

* Fix error message

* Add boilerplate for CompareAggregations

* Fix title

* Render aggregations list

* Style AccordionList

* Sort props

* Fix bucket name

* Use displayName instead shortName

* Support parseValue prop in NumberInput

* Add period input accepting integers only

* Accept non-negative values only

* Do not accept zeros

* Add state

* Add submit button

* Export offset functions via Lib

* Make it possible to skip rightSection

* Add column picker

* Map offset user input to api input (negative value)

* Add label

* Fix crash

* Extract shouldCreate

* Make onSelect in AggregationPicker support multiple values

* Extract ReferenceAggregationPicker

* Extract ColumnPicker

* Extract getAggregations

* Rename

* Add custom items

* Refactor item component

* Extract OffsetInput

* Remove unused data-testid

* Style OffsetInput

* Generate titles according to specs

* Generate label

* Generate help

* Extract utils

* Use different width for the 1st step

* Format code

* Use MultiSelect directly

* Avoid custom parseValue

* Revert MultiaAutocomplete changes

* Improve typing in describeTemporalInterval and
 describeRelativeDatetime

* Use describeTemporalUnit to pluralize

* Use interface

* Avoid setting value as DOM attribute

* Fix test

* Add onAdd prop to AggregationPicker and revert the change to have onSelect pass multiple aggregations

* Reduce number of props

* Render checkboxes in custom items

* Introduce and use --mb-color-brand-lighter

* Avoid !important

* Remove redundant prop

* Rename ExtractColumn to ExtractColumnAction

* Add lines.svg

* Fix positioning in case dir attribute is not present in any parent component

* Add CompareAggregationsAction

* Fix warning about isSelected being used as DOM attribute

* Fix positioning in case dir attribute is not present in any parent component

* Remove redundant Box

* Compute the title

* Use proper title when there's only 1 aggregation

* Show visualization on submit

* Do not navigate to chart view

* Add type attribute to all ListItems
2024-06-04 09:53:55 +00:00
Kamil Mielnik
6763b13cfc Update dead jetty docs links (#43573)
* Update dead jetty docs link

* Update dead jetty docs link
2024-06-04 16:43:22 +07:00
Nicolò Pretto
816e1b0dbc refactor public/embed reducers and related code (#43495)
* move parameters and dashboard reducers to the common ones as they're used everywhere

* convert reducers-{common,main,public}.js to typescript, done with --no-verify

* convert reducers to named exports
2024-06-04 10:39:00 +02:00
Kamil Mielnik
3305c815b0 Previous period comparison shortcut in notebook mode (#43220)
* Sort functions

* Add boilerplate for aggregateOffset and tests

* Simplify assertion

* Make basic case work

* Handle name generation

* Do not require "lib/uuid" attribute to be present since MLv2 will normalize it under the hood anyway

* Fix typing

* Group tests

* Refactor offsetClause to return a new clause instead of a new query
- Move offsetClause to expressions.ts
- Add assertion

* Revert "Sort functions"

This reverts commit ab9ce2b24e.

* Move tests

* Handle names dynamically

* Shorten a test

* Update comment

* Add TODO

* Update expression types

* Add diffOffsetClause & percentDiffOffsetClause

* Add a test for diffOffsetClause

* Add TODOs

* Add tests for diffOffsetClause and percentDiffOffsetClause

* Unwrap tests

* Add skeleton for new tests

* Refactor first offsetClause tests

* Add tests for names

* Fix case of non-datetime columns

* Handle a case with offset < 1 and no breakouts

* Handle a case with offset < 1 and breakouts on non-datetime column

* Handle a case with offset < 1 and breakouts binned datetime column

* Handle a case with offset < 1 and breakout on non-binned datetime column

* Refactor

* Refactor

* Remove TODO

* Add tests for diffOffsetClause

* Add tests for percentDiffOffsetClause

* Move offset stuff to offset.ts and offset.unit.spec.ts

* Use template string for prefixes

* Use breakoutColumn + isDate to check column type

* Refactor

* Fix error message

* Add boilerplate for CompareAggregations

* Fix title

* Render aggregations list

* Style AccordionList

* Sort props

* Fix bucket name

* Use displayName instead shortName

* Support parseValue prop in NumberInput

* Add period input accepting integers only

* Accept non-negative values only

* Do not accept zeros

* Add state

* Add submit button

* Export offset functions via Lib

* Make it possible to skip rightSection

* Add column picker

* Map offset user input to api input (negative value)

* Add label

* Fix crash

* Extract shouldCreate

* Make onSelect in AggregationPicker support multiple values

* Extract ReferenceAggregationPicker

* Extract ColumnPicker

* Extract getAggregations

* Rename

* Add custom items

* Refactor item component

* Extract OffsetInput

* Remove unused data-testid

* Style OffsetInput

* Generate titles according to specs

* Generate label

* Generate help

* Extract utils

* Use different width for the 1st step

* Format code

* Use MultiSelect directly

* Avoid custom parseValue

* Revert MultiaAutocomplete changes

* Improve typing in describeTemporalInterval and
 describeRelativeDatetime

* Use describeTemporalUnit to pluralize

* Use interface

* Avoid setting value as DOM attribute

* Fix test

* Add onAdd prop to AggregationPicker and revert the change to have onSelect pass multiple aggregations

* Reduce number of props

* Render checkboxes in custom items

* Introduce and use --mb-color-brand-lighter

* Avoid !important

* Remove redundant prop

* Fix warning about isSelected being used as DOM attribute

* Fix positioning in case dir attribute is not present in any parent component

* Add type attribute to all ListItems
2024-06-04 08:15:47 +00:00
Raphael Krut-Landau
2f0bc49783 [Browse] Don't show filter icon when no models have been verified (#43284)
On the Browse models page we have a filter icon which opens a popover with a switch that toggles "Show only verified models". With this change, the icon is not rendered if there are no verified models at all.
2024-06-03 22:21:22 -04:00
Raphael Krut-Landau
85e113420d [Browse] Unify breadcrumbs into one link (#43313)
* [Browse] Unify breadcrumbs into one link

* Avoid !important
2024-06-03 22:08:48 -04:00
Aleksandr Lesnenko
95d4179e28 Amend stack values labels control copy (#43553) 2024-06-04 01:53:49 +00:00
Emmad Usmani
9c7e96a857 fix data labels under trend/goal lines (#42928)
* fix data labels under trend/goal lines

* fix fontFamily missing

* update specs

* fix type errors

* snapshots

---------

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2024-06-03 22:09:06 +00:00
Cal Herries
9f73b0ceb8 Skip fingerprinting or scanning field values for fields with base_type=type/* (#43483) 2024-06-03 15:49:13 -06:00
Jeff Bruemmer
12e25b65a1 notes and links to relevant docs (#42975) 2024-06-03 16:56:24 -04:00
Jeff Bruemmer
3206c87a61 docs - druid jdbc and json unfolding (#43267) 2024-06-03 16:49:34 -04:00
Sloan Sparger
4c2aed648f Fix bulk action delete button hover contrast (#43518) 2024-06-03 15:19:31 -03:00
Ryan Laurie
f10ab55f8a Combine tabular viz e2e specs (#43519) 2024-06-03 11:34:07 -06:00
Nemanja Glumac
97fe4c437c Use actions/checkout@v4 everywhere (#43525) 2024-06-03 19:14:01 +02:00
Nemanja Glumac
34b6159658 Use actions/github-script@v7 everywhere (#43526) 2024-06-03 19:13:43 +02:00
Aleksandr Lesnenko
cb4264c6b3 measure auto compactness on correct values (#43477)
* measure auto compactness on correct values

* snapshots
2024-06-03 16:22:33 +00:00
Cal Herries
5c8de49521 Don't throw an exception when a non-existent setting is in the config file (#43425) 2024-06-03 09:44:32 -06:00
Cal Herries
6bf7bfca9a Catch exceptions from driver/database-supports? outside driver code (#43429) 2024-06-03 09:44:06 -06:00
Denis Berezin
d228123152 feat(sdk): SDK theming part 1 - black, bg-light, bg-dark, bg-black (#43413)
* Convert black

* Convert bg-light

* Convert bg-dark

* Convert bg-black

* Fix CI

* Fix CI

* Fix tests

* Update visual test fixtures

* Fix visual tests
2024-06-03 18:29:33 +03:00
12978 changed files with 1694698 additions and 1404827 deletions

View File

@@ -0,0 +1 @@
Fix flakey test $ARGUMENTS

View File

@@ -0,0 +1 @@
Fix issue $ARGUMENTS

View File

@@ -0,0 +1 @@
Fetch unresolved comments for this branch's PR, then fix them

View File

@@ -0,0 +1 @@
Repro issue $ARGUMENTS in a failing test

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,798 @@
;; 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
internal-stats
models
premium-features
public-settings
server
util}}
analyze
{:api #{metabase.analyze.core metabase.analyze.query-results}
:uses #{config driver legacy-mbql lib models sync util}}
api
{:api #{metabase.api.auth
metabase.api.cache
metabase.api.card
metabase.api.collection
metabase.api.common
metabase.api.common.validation
metabase.api.dashboard
metabase.api.database
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.models.channel
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}
database-routing
{:api #{metabase.database-routing.core}
:uses #{premium-features}}
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
database-routing
db
legacy-mbql
lib
logger
models
notification
plugins
premium-features
public-settings
pulse
query-processor
sync
task
upload
util
enterprise/database-routing}}
eid-translation
{:api #{metabase.eid-translation.core}
:uses #{}}
embed
{:api #{metabase.embed.settings metabase.embed.app-origins-sdk}
:uses #{analytics models premium-features tiles util}}
events
{:api #{metabase.events metabase.events.init metabase.events.notification}
:uses #{api channel 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}}
internal-stats
{:api #{metabase.internal-stats}
:uses #{db models}}
legacy-mbql
{:api #{metabase.legacy-mbql.normalize
metabase.legacy-mbql.predicates
metabase.legacy-mbql.schema
metabase.legacy-mbql.schema.helpers
metabase.legacy-mbql.util}
:uses #{lib models types util}}
lib
{:api #{metabase.lib.binning
metabase.lib.binning.util
metabase.lib.card
metabase.lib.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}}
lib-be
{:api #{metabase.lib-be.init}
:uses #{models task 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.notification.models
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.util.spec-update
metabase.models.view-log-impl
metabase.models.visualization-settings}
:uses #{analytics
analyze
api
audit
channel
config
db
driver
events
legacy-mbql
lib
moderation
notification
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.api
metabase.notification.core
metabase.notification.init
metabase.notification.models
metabase.notification.payload.core}
:uses #{analytics
api
channel
config
driver
events
models
permissions
premium-features
public-settings
query-processor
request
task
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}}
pivot
{:api #{metabase.pivot.core}
:uses #{util models}}
plugins
{:api #{metabase.plugins metabase.plugins.classloader}
:uses #{config driver util}}
premium-features
{:api #{metabase.premium-features.core
metabase.premium-features.token-check}
:uses #{config db internal-stats models plugins util}}
public-settings
{:api #{metabase.public-settings}
:uses #{api config models 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 tiles util}}
pulse
{:api #{metabase.pulse.api
metabase.pulse.core
metabase.pulse.init
metabase.pulse.task.send-pulses}
:uses #{api channel config db driver events integrations models notification permissions plugins premium-features
query-processor request task util
enterprise/advanced-config enterprise/advanced-permissions enterprise/sandbox}}
query-analysis
{:api #{metabase.query-analysis.core metabase.query-analysis.init}
:uses #{config driver legacy-mbql lib public-settings query-processor task util}}
query-processor
{:api #{metabase.query-processor
metabase.query-processor.card
metabase.query-processor.compile
metabase.query-processor.dashboard
metabase.query-processor.debug
metabase.query-processor.error-type
metabase.query-processor.interface
metabase.query-processor.metadata
metabase.query-processor.middleware.annotate
metabase.query-processor.middleware.cache-backend.db
metabase.query-processor.middleware.constraints
metabase.query-processor.middleware.fetch-source-query
metabase.query-processor.middleware.fetch-source-query-legacy
metabase.query-processor.middleware.limit
metabase.query-processor.middleware.permissions
metabase.query-processor.middleware.wrap-value-literals
metabase.query-processor.pipeline
metabase.query-processor.pivot
metabase.query-processor.preprocess
metabase.query-processor.reducible
metabase.query-processor.schema
metabase.query-processor.setup
metabase.query-processor.store
metabase.query-processor.streaming
metabase.query-processor.streaming.common
metabase.query-processor.streaming.interface
metabase.query-processor.timezone
metabase.query-processor.util
metabase.query-processor.util.add-alias-info
metabase.query-processor.util.nest-query
metabase.query-processor.util.persisted-cache
metabase.query-processor.util.relative-datetime
metabase.query-processor.util.transformations.nest-breakouts
metabase.query-processor.writeback}
:uses #{analytics
analyze
api
audit
config
db
driver
events
formatter
legacy-mbql
lib
model-persistence
models
permissions
pivot
premium-features
public-settings
request
server
types
util}}
request
{:api #{metabase.request.core}
:uses #{api config models permissions public-settings util}}
revisions
{:api #{metabase.revisions.api metabase.revisions.core metabase.revisions.init}
:uses #{api config events models util}}
sample-data
{:api #{metabase.sample-data}
:uses #{plugins sync util}}
search
{:api #{metabase.search.api
metabase.search.appdb.scoring
metabase.search.config
metabase.search.core
metabase.search.in-place.scoring
metabase.search.ingestion
metabase.search.init
metabase.search.spec}
:uses #{analytics api audit config db driver models permissions premium-features public-settings request task util}}
segments
{:api #{metabase.segments.api}
:uses #{api events legacy-mbql lib models permissions search util xrays}}
server
{:api #{metabase.server.core
metabase.server.middleware.json
metabase.server.middleware.session
metabase.server.streaming-response}
:uses #{analytics api config core db driver embed models premium-features public-settings session request util enterprise/sso}}
session
{:api #{metabase.session.core
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.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 db driver legacy-mbql lib models plugins premium-features public-settings}}
xrays
{:api #{metabase.xrays.api metabase.xrays.core}
:uses #{analyze api db driver legacy-mbql lib models public-settings query-processor util}}
enterprise/advanced-config
{:api #{metabase-enterprise.advanced-config.api.logs
metabase-enterprise.advanced-config.models.pulse-channel
metabase-enterprise.advanced-config.file
metabase-enterprise.advanced-config.crufty}
:uses #{api db driver models permissions premium-features setup sync util}}
enterprise/advanced-permissions
{:api #{metabase-enterprise.advanced-permissions.api.routes
metabase-enterprise.advanced-permissions.common
metabase-enterprise.advanced-permissions.models.permissions.group-manager}
:uses #{api audit driver enterprise/impersonation lib models permissions premium-features query-processor util enterprise/sandbox}}
enterprise/airgap
{:api #{}
:uses #{premium-features util}}
enterprise/api
{:api #{metabase-enterprise.api.routes
metabase-enterprise.api.routes.common}
:uses :any}
enterprise/audit-app
{:api #{metabase-enterprise.audit-app.api.routes}
:uses #{api
audit
db
driver
lib
models
permissions
plugins
premium-features
query-processor
sync
util
enterprise/serialization}}
enterprise/auth-provider
{:api #{}
:uses #{premium-features util}}
enterprise/billing
{:api #{metabase-enterprise.billing.api.routes}
:uses #{api premium-features util}}
enterprise/cache
{:api #{metabase-enterprise.cache.strategies}
:uses #{api models premium-features query-processor util}}
enterprise/content-verification
{:api #{metabase-enterprise.content-verification.api.routes}
:uses #{api models moderation util enterprise/api}}
enterprise/core
{:api #{metabase-enterprise.core.init}
:uses #{enterprise/enhancements}}
enterprise/dashboard-subscription-filters
{:api #{}
:uses #{premium-features}}
enterprise/database-routing
{:api #{metabase-enterprise.database-routing.core metabase-enterprise.database-routing.api}
:uses #{api config database-routing events lib models premium-features query-processor util}}
enterprise/enhancements
{:api #{metabase-enterprise.enhancements.init}
:uses #{models premium-features sso util enterprise/sso}}
enterprise/gsheets
{:api #{metabase-enterprise.gsheets.api}
:uses #{api analytics enterprise/harbormaster models premium-features server util}}
enterprise/harbormaster
{:api #{metabase-enterprise.harbormaster.client}
:uses #{api cloud-migration models util}}
enterprise/impersonation
{:api #{metabase-enterprise.impersonation.core
metabase-enterprise.impersonation.api}
:uses #{api audit driver enterprise/sandbox lib models permissions premium-features query-processor util}}
enterprise/internal-stats
{:api #{metabase-enterprise.internal-stats}
:uses #{models premium-features}}
enterprise/llm
{:api #{metabase-enterprise.llm.api}
:uses #{analytics analyze api models query-processor util}}
enterprise/query-reference-validation
{:api #{metabase-enterprise.query-reference-validation.api}
:uses #{api models public-settings request util}}
enterprise/sandbox
{:api #{metabase-enterprise.sandbox.api.routes
metabase-enterprise.sandbox.api.util}
:uses #{api
audit
db
legacy-mbql
lib
models
permissions
plugins
premium-features
query-processor
request
util
enterprise/impersonation
enterprise/api}}
enterprise/scim
{:api #{metabase-enterprise.scim.api metabase-enterprise.scim.routes}
:uses #{analytics api models permissions public-settings server util enterprise/serialization}}
enterprise/search
{:api #{}
:uses #{premium-features search}}
enterprise/serialization
{:api #{metabase-enterprise.serialization.api
metabase-enterprise.serialization.cmd
metabase-enterprise.serialization.v2.backfill-ids}
:uses #{analytics api config db legacy-mbql lib logger models plugins premium-features public-settings setup util}}
enterprise/snippet-collections
{:api #{}
:uses #{models permissions premium-features util}}
enterprise/sso
{:api #{metabase-enterprise.sso.api.routes
metabase-enterprise.sso.integrations.sso-settings
metabase-enterprise.sso.integrations.sso-utils}
:uses #{api channel embed events 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/data-editing
{:api #{}
:uses #{api actions util}}
enterprise/task
{:api #{metabase-enterprise.task.truncate-audit-tables}
:uses #{premium-features query-processor task util enterprise/cache}}
enterprise/upload-management
{:api #{metabase-enterprise.upload-management.api}
:uses #{api models premium-features upload util}}}
;; namespaces matching these patterns (with `re-find`) are excluded from the module linter. Since regex literals
;; aren't allowed in EDN just used the `(str <regex>)` version i.e. two slashes instead of one.
;;
;; this is mostly intended for excluding test namespaces or those rare 'glue' namespaces that glue multiple modules
;; together, e.g. `metabase.lib.metadata.jvm`.
:linters
{:metabase/modules
{:ignored-namespace-patterns
#{"-test$" ; anything ending in `-test`
"test[-.]util" ; anything that contains `test.util` or `test-util`
"test\\.impl" ; anything that contains `test.impl`
"test-setup" ; anything that contains `test-setup`
"^metabase(?:-enterprise)?\\.test" ; anything starting with `metabase.test` or `metabase-enterprise.test`
"^metabase\\.http-client$"}}}} ; `metabase.http-client` which is a test-only namespace despite its name.

View File

@@ -0,0 +1,132 @@
{:linters
{:metabase/test-helpers-use-non-thread-safe-functions
;; TODO -- seems silly to maintain different blacklists and whitelists here than we use for the deftest `^:parallel`
;; checker...
{:explicitly-safe
#{ ;; these toucan methods might actually set global values if it's used outside of a transaction,
;; but since mt/with-temp runs in a transaction, so we'll ignore them in this case.
toucan2.core/delete!
toucan2.core/update!
toucan2.core/insert!
toucan2.core/insert-returning-instance!
toucan2.core/insert-returning-instances!
toucan2.core/insert-returning-pk!
toucan2.core/insert-returning-pks!
clojure.core.async/<!!
clojure.core.async/>!!
clojure.core.async/alts!!
clojure.core.async/close!
clojure.core.async/poll!
clojure.core.memoize/memo-clear!
clojure.core/conj!
clojure.core/persistent!
clojure.core/reset!
clojure.core/swap!
clojure.core/volatile!
clojure.core/vreset!
clojure.core/vswap!
clojure.java.jdbc/execute!
methodical.core/add-aux-method-with-unique-key!
methodical.core/remove-aux-method-with-unique-key!
next.jdbc/execute!
;; Definitely thread safe
metabase.test.util.dynamic-redefs/patch-vars!
;; TODO: most of these symbols shouldn't be here, we should go through them and
;; find the functions/macros that use them and make sure their names end with !
;; best way to do this is try remove each of these and rely on kondo output to find places where it's used
clojure.test/grant-collection-perms!
clojure.test/grant-collection-perms-fn!
clojure.test/grant-perms-fn!
clojure.test/purge-old-entries!
clojure.test/revoke-collection-perms!
clojure.test/save-results!
metabase-enterprise.advanced-permissions.models.permissions/update-db-download-permissions!
metabase-enterprise.internal-user/install-internal-user!
metabase-enterprise.sso.integrations.saml-test/call-with-login-attributes-cleared!
metabase.actions.actions/perform-action!
metabase.actions.models/insert!
metabase.analytics.snowplow-test/fake-track-event-impl!
metabase.analytics.snowplow/track-event-impl!
metabase.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,5 +0,0 @@
(ns macros.common
"Helpers for common Metabase macro shapes so we don't have to define the same macroexpansions over and over.")
(defn ignore-unused [symb]
(vary-meta symb assoc :clj-kondo/ignore [:unused-binding]))

View File

@@ -1,12 +1,13 @@
(ns macros.metabase.api.card-test
(:require [macros.common]))
(ns macros.metabase.api.card-test)
(defmacro with-ordered-items
[collection model-and-name-syms & body]
`(let ~(into []
(comp (partition-all 2)
(mapcat (fn [[model binding]]
[(macros.common/ignore-unused binding) model])))
[binding model])))
model-and-name-syms)
~collection
~@(->> (partition-all 2 model-and-name-syms)
(map second))
~@body))

View File

@@ -1,17 +1,24 @@
(ns macros.metabase.api.collection-test
(:require [macros.common]))
(ns macros.metabase.api.collection-test)
(defmacro with-collection-hierarchy [bindings & body]
`(let [~(macros.common/ignore-unused 'a) nil
~(macros.common/ignore-unused 'b) nil
~(macros.common/ignore-unused 'c) nil
~(macros.common/ignore-unused 'd) nil
~(macros.common/ignore-unused 'e) nil
~(macros.common/ignore-unused 'f) nil
~(macros.common/ignore-unused 'g) nil]
(defmacro with-collection-hierarchy! [bindings & body]
`(let [~'a nil
~'b nil
~'c nil
~'d nil
~'e nil
~'f nil
~'g nil]
~'a
~'b
~'c
~'d
~'e
~'f
~'g
~bindings
~@body))
(defmacro with-some-children-of-collection [collection-or-id-or-nil & body]
`(let [~(macros.common/ignore-unused '&ids) ~collection-or-id-or-nil]
(defmacro with-some-children-of-collection! [collection-or-id-or-nil & body]
`(let [~'&ids ~collection-or-id-or-nil]
~'&ids
~@body))

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,11 +1,11 @@
(ns macros.metabase.api.embed-test)
(defmacro with-embedding-enabled-and-temp-card-referencing
(defmacro with-embedding-enabled-and-temp-card-referencing!
[table-kw field-kw [card-binding] & body]
`(let [~card-binding [~table-kw ~field-kw]]
~@body))
(defmacro with-embedding-enabled-and-temp-dashcard-referencing
(defmacro with-embedding-enabled-and-temp-dashcard-referencing!
[table-kw field-kw [dash-binding card-binding dashcard-binding] & body]
`(let [~dash-binding [~table-kw ~field-kw]
~(or card-binding '_) nil

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,12 @@
(ns macros.metabase.models.query-analysis-test)
(defmacro with-test-setup [& body]
`(let [~'card-id 1
~'table-id 2
~'tax-id 3
~'total-id 4]
~'card-id
~'table-id
~'tax-id
~'total-id
~@body))

View File

@@ -1,9 +0,0 @@
(ns macros.metabase.models.query-field-test
(:require [macros.common]))
(defmacro with-test-setup [& body]
`(let [~(macros.common/ignore-unused 'card-id) 1
~(macros.common/ignore-unused 'table-id) 2
~(macros.common/ignore-unused 'tax-id) 3
~(macros.common/ignore-unused 'total-id) 4]
~@body))

View File

@@ -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,18 @@
(ns macros.metabase.query-analysis.task.test-setup)
(defmacro with-test-setup!
"Set up the data required to test the Query Analysis related tasks"
[& body]
`(let [~'c1 1
~'c2 2
~'c3 3
~'c4 4
~'archived 5
~'invalid 6]
~'c1
~'c2
~'c3
~'c4
~'archived
~'invalid
~@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

@@ -0,0 +1,9 @@
(ns macros.metabase.server.statistics-handler-test)
(defmacro with-server
[_ _ [connector chan-start-handle chan-finish-handle chan-done-request] & body]
`(let [~connector nil
~chan-start-handle nil
~chan-finish-handle nil
~chan-done-request nil]
~@body))

View File

@@ -1,8 +0,0 @@
(ns macros.metabase.shared.util.namespaces)
(defmacro import-fn
"Kondo macro replacement for [[metabase.shared.util.namespaces/import-fn]]."
([sym]
`(def ~(-> sym name symbol) "docstring" ~sym))
([sym name]
`(def ~name "docstring" ~sym)))

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,8 @@
(ns macros.metabase.util.namespaces)
(defmacro import-fn
"Kondo macro replacement for [[metabase.util.namespaces/import-fn]]."
([sym]
`(def ~(-> sym name symbol) "docstring" ~sym))
([sym name]
`(def ~name "docstring" ~sym)))

View File

@@ -0,0 +1,20 @@
(ns macros.metabase.xrays.related-test)
(defmacro with-world [& body]
`(let [~'collection-id nil
~'metric-id-a nil
~'metric-id-b nil
~'segment-id-a nil
~'segment-id-b nil
~'card-id-a nil
~'card-id-b nil
~'card-id-c nil]
~'collection-id
~'metric-id-a
~'metric-id-b
~'segment-id-a
~'segment-id-b
~'card-id-a
~'card-id-b
~'card-id-c
~@body))

View File

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

View File

@@ -0,0 +1,5 @@
(ns macros.metabase-enterprise.database-routing.e2e-test)
(defmacro with-temp-dbs! [bindings & body]
`(let [~@(interleave bindings (repeat nil))]
~@body))

View File

@@ -0,0 +1,6 @@
(ns macros.metabase-enterprise.impersonation.util-test)
(defmacro with-impersonations! [impersonations-and-attributes-map & body]
`(let [~'&group ~impersonations-and-attributes-map]
~'&group
~@body))

View File

@@ -0,0 +1,18 @@
(ns macros.metabase-enterprise.query-reference-validation.api-test)
(defmacro with-test-setup! [& body]
`(let [~'card-1 1
~'card-2 2
~'card-3 3
~'card-4 4
~'card-5 5
~'coll-2 100
~'coll-3 200]
~'card-1
~'card-2
~'card-3
~'card-4
~'card-5
~'coll-2
~'coll-3
~@body))

View File

@@ -1,6 +1,6 @@
(ns macros.metabase-enterprise.sandbox.test-util
(:require [macros.common]))
(ns macros.metabase-enterprise.sandbox.test-util)
(defmacro with-gtaps! [gtaps-definition & body]
`(let [~(macros.common/ignore-unused '&group) ~gtaps-definition]
`(let [~'&group ~gtaps-definition]
~'&group
~@body))

View File

@@ -1,59 +1,112 @@
(ns macros.metabase-enterprise.serialization.test-util
(:require [macros.common]))
(ns macros.metabase-enterprise.serialization.test-util)
(defmacro with-world [& body]
`(let [~(macros.common/ignore-unused 'db-id) nil
~(macros.common/ignore-unused 'table-id) nil
~(macros.common/ignore-unused 'table) nil
~(macros.common/ignore-unused 'table-id-categories) nil
~(macros.common/ignore-unused 'table-id-users) nil
~(macros.common/ignore-unused 'table-id-checkins) nil
~(macros.common/ignore-unused 'venues-pk-field-id) nil
~(macros.common/ignore-unused 'numeric-field-id) nil
~(macros.common/ignore-unused 'name-field-id) nil
~(macros.common/ignore-unused 'latitude-field-id) nil
~(macros.common/ignore-unused 'longitude-field-id) nil
~(macros.common/ignore-unused 'category-field-id) nil
~(macros.common/ignore-unused 'category-pk-field-id) nil
~(macros.common/ignore-unused 'date-field-id) nil
~(macros.common/ignore-unused 'users-pk-field-id) nil
~(macros.common/ignore-unused 'user-id-field-id) nil
~(macros.common/ignore-unused 'checkins->venues-field-id) nil
~(macros.common/ignore-unused 'last-login-field-id) nil
~(macros.common/ignore-unused 'collection-id) nil
~(macros.common/ignore-unused 'collection-id-nested) nil
~(macros.common/ignore-unused 'user-id-temp) nil
~(macros.common/ignore-unused 'personal-collection-id) nil
~(macros.common/ignore-unused 'pc-felicia-nested-id) nil
~(macros.common/ignore-unused 'pc-nested-id) nil
~(macros.common/ignore-unused 'pc-deeply-nested-id) nil
~(macros.common/ignore-unused 'metric-id) nil
~(macros.common/ignore-unused 'segment-id) nil
~(macros.common/ignore-unused 'dashboard-id) nil
~(macros.common/ignore-unused 'root-dashboard-id) nil
~(macros.common/ignore-unused 'card-id) nil
~(macros.common/ignore-unused 'card-arch-id) nil
~(macros.common/ignore-unused 'card-id-root) nil
~(macros.common/ignore-unused 'card-id-nested) nil
~(macros.common/ignore-unused 'card-id-nested-query) nil
~(macros.common/ignore-unused 'card-id-native-query) nil
~(macros.common/ignore-unused 'card-id-pivot-table) nil
~(macros.common/ignore-unused 'dashcard-id) nil
~(macros.common/ignore-unused 'dashcard-top-level-click-id) nil
~(macros.common/ignore-unused 'dashcard-with-click-actions) nil
~(macros.common/ignore-unused 'dashcard-with-textbox-id) nil
~(macros.common/ignore-unused 'card-id-root-to-collection) nil
~(macros.common/ignore-unused 'card-id-collection-to-root) nil
~(macros.common/ignore-unused 'pulse-id) nil
~(macros.common/ignore-unused 'pulsecard-root-id) nil
~(macros.common/ignore-unused 'pulsecard-collection-id) nil
~(macros.common/ignore-unused 'card-id-template-tags) nil
~(macros.common/ignore-unused 'card-id-filter-agg) nil
~(macros.common/ignore-unused 'card-id-temporal-unit) nil
~(macros.common/ignore-unused 'snippet-id) nil
~(macros.common/ignore-unused 'snippet-collection-id) nil
~(macros.common/ignore-unused 'snippet-nested-collection-id) nil
~(macros.common/ignore-unused 'nested-snippet-id) nil
~(macros.common/ignore-unused 'card-id-with-native-snippet) nil
~(macros.common/ignore-unused 'card-join-card-id) nil]
`(let [~'db-id nil
~'table-id nil
~'table nil
~'table-id-categories nil
~'table-id-users nil
~'table-id-checkins nil
~'venues-pk-field-id nil
~'numeric-field-id nil
~'name-field-id nil
~'latitude-field-id nil
~'longitude-field-id nil
~'category-field-id nil
~'category-pk-field-id nil
~'date-field-id nil
~'users-pk-field-id nil
~'user-id-field-id nil
~'checkins->venues-field-id nil
~'last-login-field-id nil
~'collection-id nil
~'collection-id-nested nil
~'user-id-temp nil
~'personal-collection-id nil
~'pc-felicia-nested-id nil
~'pc-nested-id nil
~'pc-deeply-nested-id nil
~'metric-id nil
~'segment-id nil
~'dashboard-id nil
~'root-dashboard-id nil
~'card-id nil
~'card-arch-id nil
~'card-id-root nil
~'card-id-nested nil
~'card-id-nested-query nil
~'card-id-native-query nil
~'card-id-pivot-table nil
~'dashcard-id nil
~'dashcard-top-level-click-id nil
~'dashcard-with-click-actions nil
~'dashcard-with-textbox-id nil
~'card-id-root-to-collection nil
~'card-id-collection-to-root nil
~'pulse-id nil
~'pulsecard-root-id nil
~'pulsecard-collection-id nil
~'card-id-template-tags nil
~'card-id-filter-agg nil
~'card-id-temporal-unit nil
~'snippet-id nil
~'snippet-collection-id nil
~'snippet-nested-collection-id nil
~'nested-snippet-id nil
~'card-id-with-native-snippet nil
~'card-join-card-id nil]
~'db-id
~'table-id
~'table
~'table-id-categories
~'table-id-users
~'table-id-checkins
~'venues-pk-field-id
~'numeric-field-id
~'name-field-id
~'latitude-field-id
~'longitude-field-id
~'category-field-id
~'category-pk-field-id
~'date-field-id
~'users-pk-field-id
~'user-id-field-id
~'checkins->venues-field-id
~'last-login-field-id
~'collection-id
~'collection-id-nested
~'user-id-temp
~'personal-collection-id
~'pc-felicia-nested-id
~'pc-nested-id
~'pc-deeply-nested-id
~'metric-id
~'segment-id
~'dashboard-id
~'root-dashboard-id
~'card-id
~'card-arch-id
~'card-id-root
~'card-id-nested
~'card-id-nested-query
~'card-id-native-query
~'card-id-pivot-table
~'dashcard-id
~'dashcard-top-level-click-id
~'dashcard-with-click-actions
~'dashcard-with-textbox-id
~'card-id-root-to-collection
~'card-id-collection-to-root
~'pulse-id
~'pulsecard-root-id
~'pulsecard-collection-id
~'card-id-template-tags
~'card-id-filter-agg
~'card-id-temporal-unit
~'snippet-id
~'snippet-collection-id
~'snippet-nested-collection-id
~'nested-snippet-id
~'card-id-with-native-snippet
~'card-join-card-id
~@body))

View File

@@ -1,329 +0,0 @@
(ns hooks.clojure.core
(:require
[clj-kondo.hooks-api :as hooks]
[clojure.set :as set]
[clojure.string :as str]))
(defn- node->qualified-symbol [node]
(try
(when (hooks/token-node? node)
(let [sexpr (hooks/sexpr node)]
(when (symbol? sexpr)
(let [resolved (hooks/resolve {:name sexpr})]
(when-not (= :clj-kondo/unknown-namespace (:ns resolved))
(symbol (name (:ns resolved)) (name (:name resolved))))))))
;; some symbols like `*count/Integer` aren't resolvable.
(catch Exception _
nil)))
(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.revision/revert!
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- non-thread-safe-form-should-end-with-exclamation*
[{[defn-or-defmacro form-name] :children, :as node}]
(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)))]
(walk (fn [form]
(when-let [qualified-symbol (node->qualified-symbol form)]
(when (and (not (contains? symbols-allowed-in-fns-not-ending-in-an-exclamation-point qualified-symbol))
(end-with-exclamation? 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`."
(:string-value defn-or-defmacro) qualified-symbol)
:type :metabase/test-helpers-use-non-thread-safe-functions)))))
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]}]
(when (or (not cljc)
(= lang :clj))
(non-thread-safe-form-should-end-with-exclamation* node))
{: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

@@ -4,114 +4,7 @@
[clojure.string :as str]
[hooks.common]))
(def ^:private disallowed-parallel-forms
"Things you should not be allowed to use inside parallel tests. Besides these, anything ending in `!` not whitelisted
in [[allowed-parallel-forms]] is not allowed."
'#{clojure.core/alter-var-root
clojure.core/with-redefs
clojure.core/with-redefs-fn
metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.sandbox.test-util/with-gtaps-for-user!
metabase-enterprise.sandbox.test-util/with-user-attributes
metabase-enterprise.test/with-gtaps!
metabase-enterprise.test/with-gtaps-for-user!
metabase-enterprise.test/with-user-attributes
metabase.actions.test-util/with-actions
metabase.actions.test-util/with-actions-disabled
metabase.actions.test-util/with-actions-enabled
metabase.actions.test-util/with-actions-test-data
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.test.data.users/with-group
metabase.test.data.users/with-group-for-user
metabase.test.persistence/with-persistence-enabled
metabase.test.util.log/with-log-level
metabase.test.util.log/with-log-messages-for-level
metabase.test.util.misc/with-single-admin-user
metabase.test.util/with-all-users-permission
metabase.test.util/with-discarded-collections-perms-changes
metabase.test.util/with-env-keys-renamed-by
metabase.test.util/with-locale
metabase.test.util/with-non-admin-groups-no-root-collection-for-namespace-perms
metabase.test.util/with-non-admin-groups-no-root-collection-perms
metabase.test.util/with-temp-env-var-value
metabase.test.util/with-temp-vals-in-db
metabase.test.util/with-temporary-raw-setting-values
metabase.test.util/with-temporary-setting-values
metabase.test.util/with-user-in-groups
metabase.test/with-actions
metabase.test/with-actions-disabled
metabase.test/with-actions-enabled
metabase.test/with-actions-test-data
metabase.test/with-actions-test-data-and-actions-enabled
metabase.test/with-actions-test-data-tables
metabase.test/with-all-users-permission
metabase.test/with-discarded-collections-perms-changes
metabase.test/with-env-keys-renamed-by
metabase.test/with-expected-messages
metabase.test/with-fake-inbox
metabase.test/with-group
metabase.test/with-group-for-user
metabase.test/with-locale
metabase.test/with-log-level
metabase.test/with-log-messages-for-level
metabase.test/with-non-admin-groups-no-root-collection-for-namespace-perms
metabase.test/with-non-admin-groups-no-root-collection-perms
metabase.test/with-persistence-enabled
metabase.test/with-single-admin-user
metabase.test/with-temp-env-var-value
metabase.test/with-temp-vals-in-db
metabase.test/with-temporary-raw-setting-values
metabase.test/with-temporary-setting-values
metabase.test/with-user-in-groups})
;;; TODO -- we should disallow `metabase.test/user-http-request` with any method other than `:get`
(def ^:private allowed-parallel-forms
"These fns are destructive, but are probably fine inside ^:parallel tests because it usually means you're doing
something to an atom or something like that."
'#{clojure.core/assoc!
clojure.core/compare-and-set!
clojure.core/conj!
clojure.core/disj!
clojure.core/dissoc!
clojure.core/persistent!
clojure.core/pop!
clojure.core/reset!
clojure.core/reset-vals!
clojure.core/run!
clojure.core/swap!
clojure.core/swap-vals!
clojure.core/volatile!
clojure.core/vreset!
clojure.core/vswap!
clojure.core.async/<!
clojure.core.async/<!!
clojure.core.async/>!
clojure.core.async/>!!
clojure.core.async/alt!
clojure.core.async/alt!!
clojure.core.async/alts!
clojure.core.async/alts!!
clojure.core.async/close!
clojure.core.async/ioc-alts!
clojure.core.async/offer!
clojure.core.async/onto-chan!
clojure.core.async/onto-chan!!
clojure.core.async/poll!
clojure.core.async/put!
clojure.core.async/take!
clojure.core.async/to-chan!
clojure.core.async/to-chan!!
metabase.driver.sql-jdbc.execute/execute-prepared-statement!
metabase.pulse/send-pulse!
metabase.query-processor.store/store-database!
next.jdbc/execute!})
(defn- warn-about-disallowed-parallel-forms [form]
(defn- warn-about-disallowed-parallel-forms [form config]
(letfn [(error! [form message]
(hooks/reg-finding! (assoc (meta form)
:message message
@@ -119,12 +12,12 @@
(f [form]
(when-let [qualified-symbol (hooks.common/node->qualified-symbol form)]
(cond
(disallowed-parallel-forms qualified-symbol)
(error! form (format "%s is not allowed inside a ^:parallel test or test fixture" qualified-symbol))
(contains? (:parallel/unsafe config) qualified-symbol)
(error! form (format "%s is not allowed inside a ^:parallel test or test fixture [:metabase/validate-deftest]" qualified-symbol))
(and (not (allowed-parallel-forms qualified-symbol))
(and (not (contains? (:parallel/safe config) qualified-symbol))
(str/ends-with? (name qualified-symbol) "!"))
(error! form (format "destructive functions like %s are not allowed inside a ^:parallel test or test fixture. If this should be allowed, add it to the whitelist in .clj-kondo/hooks/clojure/test.clj"
(error! form (format "destructive functions like %s are not allowed inside a ^:parallel test or test fixture. If this should be allowed, add it to the whitelist in the Kondo config file [:metabase/validate-deftest]"
qualified-symbol)))))
(walk [form]
(f form)
@@ -135,7 +28,7 @@
(defn- deftest-check-parallel
"1. Check if test is marked ^:parallel / ^:synchronized correctly
2. Make sure disallowed forms are not used in ^:parallel tests"
[{[_ test-name & body] :children, :as _node}]
[{[_ test-name & body] :children, :as _node} config]
(let [test-metadata (:meta test-name)
metadata-sexprs (map hooks/sexpr test-metadata)
combined-metadata (transduce
@@ -152,9 +45,9 @@
(hooks/reg-finding! (assoc (meta test-name)
:message "Test should not be marked both ^:parallel and ^:synchronized"
:type :metabase/validate-deftest)))
;; only when the custom `:metabase/deftest-not-marked-parallel` is enabled: complain if tests are not explicitly
;; marked `^:parallel` or `^:synchronized`. This is mostly to encourage people to mark everything `^:parallel` in
;; places like `metabase.lib` tests unless there is a really good reason not to.
;; only when the custom `:metabase/deftest-not-marked-parallel-or-synchronized` is enabled: complain if tests are
;; not explicitly marked `^:parallel` or `^:synchronized`. This is mostly to encourage people to mark everything
;; `^:parallel` in places like `metabase.lib` tests unless there is a really good reason not to.
(when-not (or parallel? synchronized?)
(hooks/reg-finding!
(assoc (meta test-name)
@@ -162,30 +55,61 @@
:type :metabase/deftest-not-marked-parallel-or-synchronized)))
(when parallel?
(doseq [form body]
(warn-about-disallowed-parallel-forms form)))))
(def ^:private number-of-lines-for-a-test-to-be-considered-horrifically-long
200)
(warn-about-disallowed-parallel-forms form config)))))
(defn- deftest-check-not-horrifically-long
[node]
[node {:keys [max-length], :as _config}]
(let [{:keys [row end-row]} (meta node)]
(when (and row end-row)
(let [num-lines (- end-row row)]
(when (>= num-lines number-of-lines-for-a-test-to-be-considered-horrifically-long)
(when (and max-length
(>= num-lines max-length))
(hooks/reg-finding! (assoc (meta node)
:message (str (format "This test is horrifically long, it's %d lines! 😱 " num-lines)
"Do you really want to try to debug it if it fails? 💀 "
"Split it up into smaller tests! 🥰")
:type :metabase/i-like-making-cams-eyes-bleed-with-horrifically-long-tests)))))))
(defn deftest [{:keys [node cljc lang]}]
(defn- ignore? [node 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
;; don't need multiple warnings for a single test.
(letfn [(f [node]
(when (and (hooks/keyword-node? node)
(set? drivers)
(contains? drivers (hooks/sexpr node)))
(hooks/reg-finding! (assoc (meta node)
:message (format "Do not hardcode driver name %s in driver tests! [:metabase/disallow-hardcoded-driver-names-in-tests]"
(hooks/sexpr node))
:type :metabase/disallow-hardcoded-driver-names-in-tests))
::error))
(walk [node]
(cond
(ignore? node :metabase/disallow-hardcoded-driver-names-in-tests)
nil
(= (f node) ::error)
::error
:else
(reduce
(fn [_acc child]
(when (= (walk child) ::error)
(reduced ::error)))
nil
(:children node))))]
(walk node)))
(defn deftest [{:keys [node cljc lang config]}]
;; run [[deftest-check-parallel]] only once... if this is a `.cljc` file only run it for the `:clj` analysis, no point
;; in running it twice.
(when (or (not cljc)
(= lang :clj))
(deftest-check-parallel node))
(deftest-check-not-horrifically-long node)
(deftest-check-parallel node (get-in config [:linters :metabase/validate-deftest])))
(deftest-check-not-horrifically-long node (get-in config [:linters :metabase/i-like-making-cams-eyes-bleed-with-horrifically-long-tests]))
(deftest-check-no-driver-keywords node (get-in config [:linters :metabase/disallow-hardcoded-driver-names-in-tests]))
{:node node})
;;; this is a hacky way to determine whether these namespaces are required in the `ns` form or not... basically `:ns`
@@ -222,20 +146,11 @@
nil)))))))
(defn- warn-about-schema= [{[_is assertion-node] :children, :as _is-node}]
(let [{[assertion-symb-node] :children} assertion-node]
(when (and (hooks/token-node? assertion-symb-node)
(= (hooks/sexpr assertion-symb-node) 'schema=))
(hooks/reg-finding! (assoc (meta assertion-symb-node)
:message "Use =? or malli= instead of schema="
:type :metabase/warn-about-schema=)))))
(defn is [{:keys [node lang]}]
(when (= lang :cljs)
(warn-about-missing-test-expr-requires-in-cljs node))
(warn-about-schema= node)
{:node node})
(defn use-fixtures [{:keys [node]}]
(warn-about-disallowed-parallel-forms node)
(defn use-fixtures [{:keys [node config]}]
(warn-about-disallowed-parallel-forms node config)
{:node node})

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]
@@ -42,13 +116,14 @@
;;;; Common hook definitions
(defn do*
"This is the same idea as [[clojure.core/do]] but doesn't cause Kondo to complain about redundant dos or unused values."
"This is the same idea as [[clojure.core/do]] but doesn't cause Kondo to complain about redundant dos or unused
values."
[{{[_ & 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*}))
@@ -288,8 +363,8 @@
(-> (hooks/vector-node
[(hooks/vector-node (map :model binding-infos))
(-> (hooks/list-node (list* (hooks/token-node `let)
(hooks/vector-node (mapcat (juxt :binding :value) binding-infos))
body))
(hooks/vector-node (mapcat (juxt :binding :value) binding-infos))
body))
(with-meta (meta body)))])
(with-meta (meta body)))))
@@ -364,14 +439,58 @@
where the first arg should be linted and appear to be used."
[{{[_ arg & body] :children} :node}]
(let [node* (hooks/list-node
(list*
(hooks/token-node 'let)
(hooks/vector-node [(hooks/token-node (gensym "_"))
arg])
body))]
(list*
(hooks/token-node 'let)
(hooks/vector-node [(hooks/token-node (gensym "_"))
arg])
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)]
@@ -381,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.
@@ -407,3 +526,12 @@
;; should be 1
(format-string-specifier-count "%-02d"))
(defn add-lsp-ignore-unused-public-var-metadata
"Add
^{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
metadata to a node to suppress LSP warnings."
[node]
(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-testing-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,45 +0,0 @@
(ns hooks.metabase.api.common
(:require
[clj-kondo.hooks-api :as api]
[clojure.string :as str]))
(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))))
(-> (api/list-node
(list*
(api/token-node 'clojure.core/defn)
(api/token-node (route-fn-name (api/sexpr method) (api/sexpr route)))
body))
(with-meta (meta node)))))))]
(update arg :node update-defendpoint)))
(comment
(-> {: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)}
defendpoint
:node
api/sexpr))

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

@@ -4,9 +4,9 @@
(defn with-testing-against-standard-queries [{{[_ & args] :children} :node}]
(let [[query-sym & body] args
node* (hooks/list-node
(list*
(hooks/token-node 'let)
(hooks/vector-node
[query-sym (hooks/token-node 'nil)])
body))]
(list*
(hooks/token-node 'let)
(hooks/vector-node
[query-sym (hooks/token-node 'nil)])
body))]
{:node 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

@@ -1,5 +1,7 @@
(ns hooks.metabase.models.interface
(:require [clj-kondo.hooks-api :as hooks]))
(:require
[clj-kondo.hooks-api :as hooks]
[hooks.common]))
(defn define-hydration-method
"This is used for both [[metabase.models.interface/define-simple-hydration-method]] and
@@ -14,5 +16,6 @@
(hooks/token-node 'defn)
fn-name
fn-tail))))
(with-meta (update (meta node) :clj-kondo/ignore #(hooks/vector-node (cons :clojure-lsp/unused-public-var (:children %))))))]
(with-meta (meta node))
hooks.common/add-lsp-ignore-unused-public-var-metadata)]
{:node 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
@@ -181,12 +184,13 @@
setter-node (-> (list
(hooks/token-node 'defn)
(with-meta
(hooks/token-node (symbol (str (hooks/sexpr setting-name) \!)))
(meta setting-name))
(hooks/token-node (symbol (str (hooks/sexpr setting-name) \!)))
(meta setting-name))
(hooks/string-node "Docstring.")
(hooks/vector-node [(hooks/token-node '_value-or-nil)]))
hooks/list-node
(with-meta (update (meta node) :clj-kondo/ignore #(hooks/vector-node (cons :clojure-lsp/unused-public-var (:children %))))))]
(with-meta (meta node))
common/add-lsp-ignore-unused-public-var-metadata)]
(when (nil? (second (drop-while (comp not #{[:k :export?]} first) options-list)))
(when-not (contains? ignored-implicit-export? (:value setting-name))
@@ -194,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
@@ -218,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
@@ -235,21 +244,42 @@
(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]
(hooks/sexpr
(:node
(defsetting
{:node
(hooks/parse-string
(with-out-str
#_{:clj-kondo/ignore [:unresolved-namespace]}
(clojure.pprint/pprint
form)))}))))
(:node
(defsetting
{:node
(hooks/parse-string
(with-out-str
#_{:clj-kondo/ignore [:unresolved-namespace]}
(clojure.pprint/pprint
form)))}))))
(defn x []
(defsetting*

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,63 +0,0 @@
(ns hooks.metabase.public-settings.premium-features
(:require
[clj-kondo.hooks-api :as hooks]))
(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 (update (meta node) :clj-kondo/ignore #(hooks/vector-node (cons :clojure-lsp/unused-public-var (:children %))))))))}))
(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

@@ -11,6 +11,10 @@
[]
(not-empty (set (keys (:clj (hooks/ns-analysis 'metabase.test.data.dataset-definitions))))))
(defn- local-def?
[ns* sexpr]
(= ns* (:ns (hooks/resolve {:name sexpr}))))
(defn- dataset-type
"`dataset` can be one of:
@@ -21,7 +25,7 @@
We can only determine if an unqualified symbol refers to something in the dataset definitions namespace if there are
cached results available from [[global-dataset-symbols]]."
[dataset]
[this-ns dataset]
(let [sexpr (hooks/sexpr dataset)
global-defs (global-dataset-symbols)]
(cond
@@ -31,48 +35,45 @@
(namespace sexpr)
:qualified
(empty? global-defs)
:unqualified/unknown
(contains? global-defs sexpr)
:unqualified/from-dataset-defs-namespace
;; either something defined in the current namespace or let-bound in the current scope.
(local-def? this-ns sexpr)
:unqualified/local-def
:else
:unqualified/local-def)))
:unqualified/unknown)))
(defn dataset
[{{[_ dataset & body] :children} :node}]
(let [noop (constantly nil)
body (case (dataset-type dataset)
;; non-symbol, qualified symbols, and unqualified symbols from the current namespace/let-bound can all
;; get converted from something like
;;
;; (dataset whatever
;; ...)
;;
;; to
;;
;; (let [_ whatever]
;; ...)
(:non-symbol :qualified :unqualified/local-def)
(list* (hooks/token-node 'let)
(hooks/vector-node [(hooks/token-node '_) dataset])
body)
[{{[_ dataset & body] :children, :as node} :node this-ns :ns}]
(let [node' (case (dataset-type this-ns dataset)
;; non-symbol, qualified symbols, and unqualified symbols from the current namespace/let-bound can all
;; get converted from something like
;;
;; (dataset whatever
;; ...)
;;
;; to
;;
;; (let [_ whatever]
;; ...)
(:non-symbol :qualified :unqualified/local-def)
(hooks/list-node
(list*
(hooks/token-node 'let)
(hooks/vector-node [(hooks/token-node '_) dataset])
body))
;; for ones that came from the dataset defs namespace or ones whose origin is unknown, just ignore them
;; and generate a `print` form:
;;
;; (print ...)
;;
;; (this used to be a `do` form (which makes a lot more semantic sense), but that resulted in warnings
;; about unused values
(:unqualified/from-dataset-defs-namespace :unqualified/unknown)
(list* (hooks/token-node noop)
body))]
{:node (with-meta (hooks/list-node (with-meta body
(meta dataset)))
(meta dataset))}))
;; for ones that came from the dataset defs namespace or ones whose origin is unknown, just ignore them
;; and generate a form like
;;
;; (do ...)
(:unqualified/from-dataset-defs-namespace :unqualified/unknown)
(hooks/list-node
(list*
(hooks/token-node `do)
body)))]
{:node (with-meta node' (meta node))}))
(defn- special-token-node?
"Whether this node is one of the special symbols like `$field`."

View File

@@ -0,0 +1,49 @@
(ns hooks.metabase.test.data.datasets
(: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/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
(keyword? drivers) #{drivers}
(set? drivers) drivers
:else nil)]
(when drivers
(empty? (set/difference drivers #{:h2 :mysql :postgres})))))
(defn- validate-mb-driver-tests [x]
(when-not (:mb/driver-tests (meta (:ns x)))
(hooks/reg-finding!
(assoc (meta (:ns x))
:message (str "Namespaces that run driver tests (test-driver or test-drivers) should be marked"
" ^:mb/driver-tests [:metabase/validate-mb-driver-tests]")
:type :metabase/validate-mb-driver-tests))))
(defn- validate-ns-tags [x]
(when-not (only-core-drivers? (:node x))
(validate-mb-driver-tests x)))
(defn test-drivers [x]
(validate-ns-tags x)
(letfn [(update-node [node]
(let [[test-drivers drivers-expr & body] (:children node)]
(-> (hooks/list-node
(list*
(hooks/token-node 'do)
test-drivers
(-> drivers-expr
(hooks.common/update-ignored-linters conj :unused-value))
body))
(with-meta (meta node)))))]
(update x :node update-node)))
(defn test-driver
"We can use the same hook for `test-driver` as we use for `test-drivers`."
[x]
(test-drivers x))

View File

@@ -0,0 +1,14 @@
(ns hooks.metabase.test.gentest
(:require
[clj-kondo.hooks-api :as hooks]))
(defn iterate*
"(iterate {:as limit-spec} [s1 val1 & more] body-form body-form...)"
[{{:keys [children] :as node} :node :as orig}]
(let [[token limit-spec bindings & body-nodes] children
node* (-> (hooks/list-node
(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

@@ -27,11 +27,11 @@
(hooks/vector-node (into []
(mapcat (fn [[setting-name v]]
(concat
[(with-meta (hooks/token-node '_) (meta setting-name)) v]
[(with-meta (hooks/token-node '_) (meta setting-name)) v]
;; if the setting name is namespace-qualified add a `_`
;; entry for it too.
(when (namespaced-symbol-node? setting-name)
[(with-meta (hooks/token-node '_) (meta setting-name)) setting-name]))))
(when (namespaced-symbol-node? setting-name)
[(with-meta (hooks/token-node '_) (meta setting-name)) setting-name]))))
(partition 2 (:children bindings))))
bindings)]
{:node (-> (list*

View File

@@ -0,0 +1,15 @@
(ns hooks.metabase.test.util.generators.jvm
(:require
[clj-kondo.hooks-api :as hooks]))
(defn with-random-cards
"(with-random-cards <metadata-provider> <integer-count-value> & body-forms)"
[{{:keys [children] :as node} :node :as orig}]
(let [[token num-cards & body-nodes] children
node* (-> (hooks/list-node
(list token num-cards
(hooks/list-node (list* (hooks/token-node 'let)
(hooks/vector-node [(hooks/token-node '&cards) (hooks/list-node ())])
body-nodes))))
(with-meta (meta node)))]
(assoc orig :node node*)))

View File

@@ -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,74 @@
(ns hooks.metabase.util.i18n
(:require
[clj-kondo.hooks-api :as api]
[clojure.string :as str]
[hooks.common]))
(defn- valid-apostrophes?
"Returns true if `s` contains only doubled quotes (''') or complete placeholder-escaping quotes ('{...}'), false otherwise."
[s]
(loop [chars (seq s)]
(if (empty? chars)
true
(let [c (first chars)]
(if (= c \')
(cond
;; Doubled quotes: skip both
(and (next chars) (= (second chars) \'))
(recur (nthrest chars 2))
;; Placeholder escape. We allow for intentional escaping, like either '{0}` or '{{`, but not 'arbitrary
;; strings' So basically, just require the *next* character to be a `{`, find the next single-quote, and
;; continue on from there.
;;
;; Technically a string like "foo bar's happy but i'm not" is totally fine, but we'll say it's invalid
;; because... that inner string literal is probably not what we actually want. So since we've never done
;; this intentionally as far as I can tell, let's just remove the possibility to avoid ambiguity.
(= (second chars) \{)
(let [at-closing (drop-while #(not= \' %) (next chars))]
(if (seq at-closing)
(recur (next at-closing))
false))
;; Unpaired single quote: invalid
:else
false)
(recur (rest chars)))))))
(defn format-str-arg-node->str
[node]
(cond
;; it's just a string literal
(api/string-node? node) (api/sexpr node)
;; it's `(str "some" "strings")`
(and (api/list-node? node)
(= 'str (api/sexpr (first (:children node))))
(every? api/string-node? (rest (:children node))))
(apply str (map api/sexpr (rest (:children node))))
;; it's something else, no good
:else
(do
(api/reg-finding!
(assoc (meta node)
:message "Must be a string literal or a call to `str` with string literal arguments."
:type :metabase/validate-string-or-str-args-to-i18n))
nil)))
(defn strict-apostrophes
"Checks the node to make sure it's not a i18n call that will result in dropped apostrophes."
[{:keys [node]}]
(let [format-str-arg (second (:children node))
;; `format-str-arg` must be either a `"string"` or `(str "a call " "to" "str")` (to allow for splitting long
;; strings into shorter lines)
format-str (format-str-arg-node->str format-str-arg)]
(when-not (valid-apostrophes? format-str)
(api/reg-finding!
(assoc (meta node)
:message "Format string contains invalid single quote usage. Use '' for literals or '{...}' for escaping."
:type :metabase/validate-escaped-single-quotes-in-i18n))))
{:node node})
(def tru strict-apostrophes)
(def trs strict-apostrophes)
(def deferred-tru strict-apostrophes)
(def deferred-trs strict-apostrophes)

View File

@@ -109,8 +109,6 @@
actual-arg-count)
:type :metabase/validate-logging)))))
(defn infof
"Valid logf, debugf, etc."
[{:keys [node], :as x}]

View File

@@ -0,0 +1,26 @@
(ns hooks.metabase.util.log.capture
(:require
[clj-kondo.hooks-api :as api]))
(defn with-log-messages-for-level [x]
(letfn [(update-binding [[lhs-node _rhs-node]]
[lhs-node (api/list-node
(list
(api/token-node 'clojure.core/fn)
(api/vector-node [])))])
(update-bindings [bindings-node]
(-> (api/vector-node
(into []
(comp (partition-all 2)
(mapcat update-binding))
(:children bindings-node)))
(with-meta (meta bindings-node))))
(update-node [node]
(let [[_with-log-messages-for-level bindings & body] (:children node)]
(-> (api/list-node
(list*
(api/token-node 'clojure.core/let)
(update-bindings bindings)
body))
(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

@@ -0,0 +1,55 @@
(ns hooks.clojure.test-test
(:require
[clj-kondo.hooks-api :as api]
[clj-kondo.impl.utils]
[clojure.edn :as edn]
[clojure.test :refer :all]
[hooks.clojure.test]))
(set! *warn-on-reflection* true)
(defn- deftest-warnings
[form]
(binding [clj-kondo.impl.utils/*ctx* {:config {:linters {:metabase/disallow-hardcoded-driver-names-in-tests {:level :warning}}}
:ignores (atom nil)
:findings (atom [])
:namespaces (atom {})}]
(hooks.clojure.test/deftest {:node (api/parse-string form)
:config {:linters
{:metabase/disallow-hardcoded-driver-names-in-tests
{:drivers
#{:athena}}}}})
(mapv :message @(:findings clj-kondo.impl.utils/*ctx*))))
(deftest ^:parallel disallow-hardcoded-driver-names-in-tests-test
(is (= []
(deftest-warnings
"(mt/test-drivers (mt/normal-drivers)
(do-something))")))
(is (= ["Do not hardcode driver name :athena in driver tests! [:metabase/disallow-hardcoded-driver-names-in-tests]"]
(deftest-warnings
"(mt/test-drivers (mt/normal-drivers)
(when-not (= driver/*driver* :athena)
(do-something)))")))
(testing "make sure :clj-kondo/ignore is propagated correctly"
(is (= []
(deftest-warnings
"(mt/test-drivers (mt/normal-drivers)
#_{:clj-kondo/ignore [:metabase/disallow-hardcoded-driver-names-in-tests]}
(when-not (= driver/*driver* :athena)
(do-something)))")))))
(deftest ^:parallel check-driver-keywords-test
(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]))
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

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

@@ -0,0 +1,33 @@
(ns hooks.metabase.util.i18n-test
(:require [clj-kondo.hooks-api :as api]
[clj-kondo.impl.utils]
[clojure.string :as str]
[clojure.test :refer [deftest testing is are]]
[hooks.metabase.util.i18n]))
(defn- warnings
[form]
(binding [clj-kondo.impl.utils/*ctx* {:config {:linters {:metabase/validate-string-or-str-args-to-i18n {:level :warning}
:metabase/validate-escaped-single-quotes-in-i18n {:level :warning}}}
:ignores (atom nil)
:findings (atom [])
:namespaces (atom {})}]
(hooks.metabase.util.i18n/strict-apostrophes {:node (api/parse-string (pr-str form))})
(mapv :message @(:findings clj-kondo.impl.utils/*ctx*))))
(deftest ^:parallel strict-apostrophes-warns
(are [form] (= ["Format string contains invalid single quote usage. Use '' for literals or '{...}' for escaping."]
(warnings (quote form)))
(metabase.util.i18n/tru "this isn't good bob")
(metabase.util.i18n/tru "'this is not good either'")
(metabase.util.i18n/tru "''this isn't''")
(metabase.util.i18n/tru "nope you can not escape 'like {{0}} so {{1}}'")
(metabase.util.i18n/tru (str "it works" "when strings" "are concatenated'"))))
(deftest ^:parallel strict-apostrophes-doesnt-warn-on-good-ones
(are [form] (= []
(warnings (quote form)))
(metabase.util.i18n/tru "this isn''t bad")
(metabase.util.i18n/tru (str "not sure why you'" "'d do this" "... but ok"))
(metabase.util.i18n/tru "you can '{{0}}' do things like that")
(metabase.util.i18n/tru "or '{{ this or }}}}}}}}}}' that")))

View File

@@ -0,0 +1,19 @@
(ns hooks.metabase.util.log.capture-test
(:require
[clj-kondo.hooks-api :as api]
[clojure.test :refer :all]
[hooks.metabase.util.log.capture]))
(deftest ^:parallel with-log-messages-for-level-test
(is (= '(clojure.core/let [messages-1 (clojure.core/fn [])
messages-2 (clojure.core/fn [])]
(concat (messages-1)
(messages-2)))
(-> (hooks.metabase.util.log.capture/with-log-messages-for-level
{:node (-> '(with-log-messages-for-level [messages-1 [my.namespace :debug]
messages-2 :info]
(concat (messages-1) (messages-2)))
pr-str
api/parse-string)})
:node
api/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

@@ -1,31 +1,348 @@
;; https://github.com/weavejester/cljfmt/blob/master/cljfmt/resources/cljfmt/indents/clojure.clj
{:extra-indents
{auto-parse [[:inner 0]]
cond-> [[:inner 0]]
check [[:inner 0]]
deferred-tru [[:inner 0]]
defprotocol+ [[:block 1] [:inner 1]]
potemkin/defprotocol+ [[:block 1] [:inner 1]]
let-404 [[:block 1]]
metabase.legacy-mbql.util/match-one [[:inner 0]]
merge-with [[:inner 0]]
metabase.test/dataset [[:inner 0]]
metabase.test/formatted-rows [[:inner 0]]
metabase.test/mbql-query [[:inner 0]]
metabase.test/test-drivers [[:inner 0]]
metabase.test/with-temporary-setting-values [[:block 1]]
;; If we just treat these as functions we can ignore this, despite some files not being consistent
;metabase.models.permissions/set-has-full-permissions-for-set? [[:inner 0]]
;metabase.models.permissions/set-has-full-permissions? [[:inner 0]]
;metabase.models.permissions/set-has-partial-permissions? [[:inner 0]]
metabase.models.permissions/set-has-partial-permissions-for-set? [[:inner 0]]
publish-event! [[:block 1]]
metabase.query-processor.streaming/streaming-response [[:inner 0]]
metabase.util/prog1 [[:inner 0]]
metabase.util/select-keys-when [[:inner 0]]
;; This supports a lot of existing formatting, but these are functions so the
;; existing formatting is probably wrong.
;toucan2.core/select [[:inner 0]]
;toucan2.core/update! [[:inner 0]]
}
:sort-ns-references? true}
;; Cljfmt config. See https://github.com/weavejester/cljfmt#formatting-options
{:sort-ns-references?
true
:function-arguments-indentation
:community
:parallel?
true
:paths
["src"
"test"
"enterprise/backend"
"bin/build"
"bin/lint-migrations-file"
"bin/release-list"
"modules/drivers"
".clj-kondo/src"
".clj-kondo/test"
#_"dev"]
;; See https://github.com/weavejester/cljfmt/blob/master/cljfmt/resources/cljfmt/indents/clojure.clj for the default
;; definitions
;;
;; [[:block 0]]
;; ^ number of special args
;;
;; `:block` indentation means format with all arguments indented 2 spaces except for the 'special' arguments which
;; normally are supposed to go on the first line. e.g. `let` gets [[:block 1]] because it has one 'special' arg.
;;
;; [[:inner 0]]
;; ^ depth
;; [[:inner 2 0]]
;; ^ argument index to restrict this rule to
;;
;; `:inner` indentation is like `:defn` indentation. `[[:inner 0]]` (default for `defn`) means all arguments at depth
;; zero get indented 2 spaces if not on the first line regardless of number of elements on the first line.
:extra-indents
{;; clojure.core stuff
fn* [[:inner 0]]
let* [[:block 1]]
with-meta [[:default]]
;; library stuff. Libraries that specify their own `:style/indent` specs are included in the section after this
;; since it is generated automatically.
clojure.core.logic/fresh [[:block 1]]
clojure.core.logic/matcha [[:block 1]]
clojure.core.logic/run [[:block 2]]
clojure.core.match/match [[:block 1]]
clojure.test.check.properties/for-all [[:block 1]]
clojure.test.check.properties/for-all* [[:block 1]]
clojure.test.check/quick-check [[:block 1]]
clojure.tools.macro/macrolet [[:block 1] [:inner 2 0]]
clojurewerkz.quartzite.jobs/build [[:default]]
clojurewerkz.quartzite.jobs/with-description [[:default]]
clojurewerkz.quartzite.jobs/with-identity [[:default]]
clojurewerkz.quartzite.schedule.cron/schedule [[:default]]
clojurewerkz.quartzite.schedule.cron/with-misfire-handling-instruction-do-nothing [[:default]]
clojurewerkz.quartzite.triggers/build [[:default]]
clojurewerkz.quartzite.triggers/with-description [[:default]]
clojurewerkz.quartzite.triggers/with-identity [[:default]]
clojurewerkz.quartzite.triggers/with-priority [[:default]]
clojurewerkz.quartzite.triggers/with-schedule [[:default]]
def-map-type [[:block 2] [:inner 1]]
defprotocol+ [[:block 1] [:inner 1]]
defrecord+ [[:block 2] [:inner 1]]
deftype+ [[:block 2] [:inner 1]]
net.cgrand.macrovich/case [[:block 0]]
potemkin.namespaces/import-vars [[:default]]
potemkin.types/def-map-type [[:block 2] [:inner 1]]
potemkin.types/defprotocol+ [[:block 1] [:inner 1]]
potemkin.types/defrecord+ [[:block 2] [:inner 1]]
potemkin.types/deftype+ [[:block 2] [:inner 1]]
potemkin/def-map-type [[:block 2] [:inner 1]]
potemkin/defprotocol+ [[:block 1] [:inner 1]]
potemkin/defrecord+ [[:block 2] [:inner 1]]
potemkin/deftype+ [[:block 2] [:inner 1]]
potemkin/import-vars [[:default]]
taoensso.nippy/extend-freeze [[:inner 0]]
taoensso.nippy/extend-thaw [[:inner 0]]
throttle.core/with-throttling [[:block 1]]
;; the rest of the stuff in this list is generated automatically based on `:style/indent` specs
;; by running [[dev.generate-cljfmt-config/specs]]... use that code to update this list
metabase-enterprise.impersonation.util-test/with-impersonations! [[:inner 0]]
metabase-enterprise.cache.config-test/with-temp-persist-models [[:block 1]]
metabase-enterprise.sandbox.test-util/with-gtaps! [[:inner 0]]
metabase-enterprise.sandbox.test-util/with-gtaps-for-user! [[:inner 0]]
metabase-enterprise.sandbox.test-util/with-user-attributes [[:block 2]]
metabase-enterprise.serialization.test-util/with-dbs [[:inner 0]]
metabase-enterprise.serialization.test-util/with-random-dump-dir [[:block 1]]
metabase-enterprise.serialization.test-util/with-world [[:block 0]]
metabase-enterprise.sso.integrations.jwt-test/with-users-with-email-deleted [[:block 1]]
metabase-enterprise.test/with-gtaps! [[:inner 0]]
metabase-enterprise.test/with-gtaps-for-user! [[:inner 0]]
metabase-enterprise.test/with-user-attributes [[:block 2]]
metabase.actions.actions-test/with-actions-test-data-and-actions-permissively-enabled [[:block 0]]
metabase.actions.test-util/with-actions [[:block 1]]
metabase.actions.test-util/with-actions-disabled [[:block 0]]
metabase.actions.test-util/with-actions-enabled [[:block 0]]
metabase.actions.test-util/with-actions-test-data [[:inner 0]]
metabase.actions.test-util/with-actions-test-data-and-actions-enabled [[:block 0]]
metabase.actions.test-util/with-actions-test-data-tables [[:block 1]]
metabase.actions.test-util/with-empty-db [[:inner 0]]
metabase.actions.test-util/with-temp-test-data [[:inner 0]]
metabase.api.card-test/with-cards-in-readable-collection [[:block 1]]
metabase.api.card-test/with-cards-in-writeable-collection [[:block 1]]
metabase.api.card-test/with-ordered-items [[:inner 0]]
metabase.api.card-test/with-temp-native-card! [[:block 1]]
metabase.api.card-test/with-temp-native-card-with-params! [[:block 1]]
metabase.api.collection-test/with-collection-hierarchy [[:block 1]]
metabase.api.collection-test/with-french-user-and-personal-collection [[:block 2]]
metabase.api.collection-test/with-some-children-of-collection [[:block 1]]
metabase.api.common/check [[:default]]
metabase.api.common/define-routes [[:block 0]]
metabase.api.common/let-404 [[:block 1]]
metabase.api.embed-test/do-response-formats [[:block 1]]
metabase.api.embed-test/with-embedding-enabled-and-new-secret-key [[:block 0]]
metabase.api.embed-test/with-embedding-enabled-and-temp-card-referencing [[:block 3]]
metabase.api.embed-test/with-embedding-enabled-and-temp-dashcard-referencing [[:block 3]]
metabase.api.embed-test/with-new-secret-key [[:block 0]]
metabase.api.embed-test/with-temp-card [[:block 1]]
metabase.api.embed-test/with-temp-dashcard [[:block 1]]
metabase.api.preview-embed-test/with-embedding-enabled-and-new-secret-key [[:block 0]]
metabase.api.preview-embed-test/with-new-secret-key [[:block 0]]
metabase.cmd.copy/step [[:block 1]]
metabase.cmd.copy/with-connection-rollback-only [[:block 1]]
metabase.cmd.copy/with-disabled-db-constraints [[:block 2]]
metabase.config/build-type-case [[:block 0]]
metabase.dashboard-subscription-test/with-link-card-fixture-for-dashboard [[:block 2]]
metabase.db.liquibase/with-liquibase [[:block 1]]
metabase.db.liquibase/with-scope-locked [[:block 1]]
metabase.db.schema-migrations-test.impl/test-migrations [[:block 2]]
metabase.db/with-application-db [[:inner 0]]
metabase.driver.bigquery-cloud-sdk.query-processor/with-temporal-type [[:default]]
metabase.driver.druid.client/DELETE [[:default]]
metabase.driver.druid.client/GET [[:default]]
metabase.driver.druid.client/POST [[:default]]
metabase.driver.druid.query-processor-test/druid-query [[:block 0]]
metabase.driver.druid.query-processor-test/druid-query-returning-rows [[:block 0]]
metabase.driver.mongo.query-processor/mongo-let [[:block 1]]
metabase.driver.sql-jdbc.actions/with-jdbc-transaction [[:block 1]]
metabase.driver.sql-jdbc.connection/with-connection-spec-for-testing-connection [[:block 1]]
metabase.driver.sql-jdbc.execute.diagnostic/capturing-diagnostic-info [[:block 1]]
metabase.driver.sql.query-processor/apply-top-level-clause [[:default]]
metabase.driver/with-driver [[:block 1]]
metabase.lib.binning/with-binning [[:default]]
metabase.lib.core/with-binning [[:default]]
metabase.lib.core/with-join-alias [[:default]]
metabase.lib.core/with-join-conditions [[:default]]
metabase.lib.join/with-join-alias [[:default]]
metabase.lib.join/with-join-conditions [[:default]]
metabase.lib.test-util.macros/$ids [[:inner 0]]
metabase.lib.test-util.macros/mbql-query [[:inner 0]]
metabase.lib.util.match/match [[:inner 0]]
metabase.lib.util.match/match-one [[:inner 0]]
metabase.lib.util.match/replace [[:inner 0]]
metabase.lib.util.match/replace-in [[:inner 0]]
metabase.models.collection-test/with-collection-hierarchy [[:block 1]]
metabase.models.collection-test/with-current-user-perms-for-collections [[:block 1]]
metabase.models.collection-test/with-personal-and-impersonal-collections [[:block 1]]
metabase.models.dashboard-test/with-dash-in-collection [[:inner 0]]
metabase.models.interface/define-batched-hydration-method [[:inner 0]]
metabase.models.interface/define-simple-hydration-method [[:inner 0]]
metabase.models.params.chain-filter-test/with-clean-field-values-for-field [[:block 1]]
metabase.models.params.chain-filter-test/with-fk-field-to-field-remapping [[:block 0]]
metabase.models.params.chain-filter-test/with-human-readable-values-remapping [[:block 0]]
metabase.models.setting.multi-setting/define-multi-setting [[:inner 0]]
metabase.models.setting/defsetting [[:block 1]]
metabase.models.task-history/with-task-history [[:block 1]]
metabase.permissions.core/allow-changing-all-users-group-members [[:block 0]]
metabase.permissions.core/disable-perms-cache [[:block 0]]
metabase.public-sharing.api-test/with-sharing-enabled-and-temp-card-referencing [[:block 3]]
metabase.public-sharing.api-test/with-sharing-enabled-and-temp-dashcard-referencing [[:block 3]]
metabase.public-sharing.api-test/with-temp-public-card [[:block 1]]
metabase.public-sharing.api-test/with-temp-public-dashboard [[:block 1]]
metabase.public-sharing.api-test/with-temp-public-dashboard-and-card [[:block 1]]
metabase.pulse.api.alert-test/with-alert-in-collection [[:block 1]]
metabase.pulse.models.pulse-test/with-dashboard-subscription-in-collection [[:block 1]]
metabase.pulse.models.pulse-test/with-pulse-in-collection [[:inner 0]]
metabase.query-processor-test.pipeline-queries-test/pmbql-query [[:block 1]]
metabase.query-processor-test.pipeline-queries-test/run-pmbql-query [[:block 1]]
metabase.query-processor.debug/debug> [[:block 0]]
metabase.query-processor.error-type/deferror [[:block 1]]
metabase.query-processor.middleware.cache-backend.interface/with-cached-results [[:block 4]]
metabase.query-processor.middleware.process-userland-query-test/with-query-execution [[:block 1]]
metabase.query-processor.store/cached [[:block 1]]
metabase.query-processor.store/with-metadata-provider [[:inner 0]]
metabase.query-processor.streaming/streaming-response [[:block 1]]
metabase.query-processor.test-util/format-rows-by [[:default]]
metabase.request.core/as-admin [[:block 0]]
metabase.request.core/with-current-request [[:inner 0]]
metabase.request.core/with-current-user [[:inner 0]]
metabase.request.core/with-limit-and-offset [[:inner 0]]
metabase.request.session/as-admin [[:block 0]]
metabase.request.session/with-current-user [[:inner 0]]
metabase.sample-data-test/with-temp-sample-database-db [[:block 1]]
metabase.search.api-test/do-test-users [[:block 1]]
metabase.server.middleware.session/as-admin [[:block 0]]
metabase.server.middleware.session/with-current-user [[:inner 0]]
metabase.server.streaming-response-test/with-streaming-response-thread-pool [[:block 0]]
metabase.server.streaming-response-test/with-test-driver-db! [[:block 0]]
metabase.server.streaming-response/streaming-response [[:block 2]]
metabase.session.api/http-401-on-error [[:block 0]]
metabase.sync.fetch-metadata/log-if-error [[:block 1]]
metabase.sync.sync-metadata.fields-test/with-test-db [[:block 0]]
metabase.sync.util/do-with-start-and-finish-debug-logging [[:default]]
metabase.sync.util/sum-for [[:block 1]]
metabase.sync.util/sync-operation [[:block 3]]
metabase.sync.util/with-db-logging-disabled [[:default]]
metabase.sync.util/with-duplicate-ops-prevented [[:default]]
metabase.sync.util/with-emoji-progress-bar [[:block 1]]
metabase.sync.util/with-error-handling [[:block 1]]
metabase.sync.util/with-start-and-finish-logging [[:default]]
metabase.sync.util/with-start-and-finish-logging* [[:default]]
metabase.sync.util/with-sync-events [[:default]]
metabase.task/rerun-on-error [[:block 1]]
metabase.test/$ids [[:inner 0]]
metabase.test/as-admin [[:inner 0]]
metabase.test/dataset [[:inner 0]]
metabase.test/discard-setting-changes [[:block 1]]
metabase.test/format-rows-by [[:default]]
metabase.test/let-url [[:block 1]]
metabase.test/mbql-query [[:inner 0]]
metabase.test/native-query [[:block 0]]
metabase.test/query [[:block 1]]
metabase.test/run-mbql-query [[:inner 0]]
metabase.test/test-driver [[:inner 0]]
metabase.test/test-drivers [[:inner 0]]
metabase.test/test-helpers-set-global-values! [[:block 0]]
metabase.test/throw-if-called! [[:block 1]]
metabase.test/with-actions [[:block 1]]
metabase.test/with-actions-disabled [[:block 0]]
metabase.test/with-actions-enabled [[:block 0]]
metabase.test/with-actions-test-data [[:inner 0]]
metabase.test/with-actions-test-data-and-actions-enabled [[:block 0]]
metabase.test/with-actions-test-data-tables [[:block 1]]
metabase.test/with-additional-premium-features [[:block 1]]
metabase.test/with-current-user [[:inner 0]]
metabase.test/with-driver [[:block 1]]
metabase.test/with-empty-db [[:inner 0]]
metabase.test/with-empty-h2-app-db [[:block 0]]
metabase.test/with-metadata-provider [[:inner 0]]
metabase.test/with-premium-features [[:block 1]]
metabase.test/with-temp [[:inner 0]]
metabase.test/with-temp-copy-of-db [[:block 0]]
metabase.test/with-temp-scheduler [[:block 0]]
metabase.test/with-temp-test-data [[:inner 0]]
metabase.test/with-temp-vals-in-db [[:block 3]]
metabase.test/with-test-user [[:inner 0]]
metabase.test/with-user-in-groups [[:inner 0]]
metabase.test.data/$ids [[:inner 0]]
metabase.test.data/dataset [[:inner 0]]
metabase.test.data/mbql-query [[:inner 0]]
metabase.test.data/native-query [[:block 0]]
metabase.test.data/query [[:block 1]]
metabase.test.data/run-mbql-query [[:inner 0]]
metabase.test.data/with-empty-h2-app-db [[:block 0]]
metabase.test.data/with-temp-copy-of-db [[:block 0]]
metabase.test.data.datasets/test-driver [[:inner 0]]
metabase.test.data.datasets/test-drivers [[:inner 0]]
metabase.test.data.one-off-dbs/with-blank-db [[:block 0]]
metabase.test.data.one-off-dbs/with-blueberries-db [[:block 0]]
metabase.test.data.users/with-test-user [[:inner 0]]
metabase.test.util/discard-setting-changes [[:block 1]]
metabase.test.util/let-url [[:block 1]]
metabase.test.util/throw-if-called! [[:block 1]]
metabase.test.util/with-temp-scheduler [[:block 0]]
metabase.test.util/with-temp-vals-in-db [[:block 3]]
metabase.test.util/with-user-in-groups [[:inner 0]]
metabase.test.util.public-settings/with-additional-premium-features [[:block 1]]
metabase.test.util.public-settings/with-premium-features [[:block 1]]
metabase.test.util.thread-local/test-helpers-set-global-values! [[:block 0]]
metabase.timeseries-query-processor-test.util/test-timeseries-drivers [[:block 0]]
metabase.timeseries-query-processor-test/run-mbql-query [[:inner 0]]
metabase.upload-test/with-upload-table! [[:inner 0]]
metabase.upload.types/with-currency [[:default]]
metabase.upload.types/with-parens [[:default]]
metabase.util/auto-retry [[:block 1]]
metabase.util/case-enum [[:block 1]]
metabase.util/ignore-exceptions [[:block 0]]
metabase.util/or-with [[:block 1]]
metabase.util/profile [[:block 1]]
metabase.util/prog1 [[:inner 0]]
metabase.util/varargs [[:inner 0]]
metabase.util/with-us-locale [[:block 0]]
metabase.util.async/cancelable-thread [[:block 0]]
metabase.util.date-2/with-time-zone-same-instant [[:default]]
metabase.util.encryption-test/with-secret-key [[:block 1]]
metabase.util.honey-sql-2/with-database-type-info [[:default]]
metabase.util.i18n/deferred-trs [[:default]]
metabase.util.i18n/deferred-tru [[:default]]
metabase.util.i18n/trs [[:default]]
metabase.util.i18n/trsn [[:default]]
metabase.util.i18n/tru [[:default]]
metabase.util.i18n/trun [[:default]]
metabase.util.jvm/auto-retry [[:block 1]]
metabase.util.jvm/varargs [[:block 1]]
metabase.util.jvm/with-us-locale [[:block 0]]
metabase.util.malli/disable-enforcement [[:block 0]]
metabase.util.malli/with [[:default]]
metabase.util.malli/with-api-error-message [[:default]]
metabase.util.namespaces/import-fns [[:default]]
metabuild-common.core/exit-when-finished-nonzero-on-exception [[:block 0]]
metabuild-common.core/step [[:block 1]]
metabuild-common.entrypoint/exit-when-finished-nonzero-on-exception [[:block 0]]
metabuild-common.steps/step [[:block 1]]
methodical.core/defmethod [[:inner 0]]
methodical.core/defmulti [[:inner 0]]
methodical.core/with-dispatcher [[:default]]
methodical.core/with-method-table [[:default]]
methodical.core/with-prefers [[:default]]
methodical.interface/with-dispatcher [[:default]]
methodical.interface/with-method-table [[:default]]
methodical.interface/with-prefers [[:default]]
methodical.macros/defmethod [[:inner 0]]
methodical.macros/defmulti [[:inner 0]]
saml20-clj.sp.response/validate-confirmation-datas [[:block 1]]
toucan2.connection/with-transaction [[:block 1]]
toucan2.core/build [[:block 0]]
toucan2.core/compile [[:block 0]]
toucan2.core/debug [[:block 0]]
toucan2.core/define-after-insert [[:inner 0]]
toucan2.core/define-after-select [[:inner 0]]
toucan2.core/define-after-update [[:inner 0]]
toucan2.core/define-before-delete [[:inner 0]]
toucan2.core/define-before-insert [[:inner 0]]
toucan2.core/define-before-select [[:inner 0]]
toucan2.core/define-default-fields [[:inner 0]]
toucan2.core/define-named-query [[:block 1]]
toucan2.core/deftransforms [[:block 1]]
toucan2.core/with-transaction [[:block 1]]
toucan2.tools.after/define-after-impl [[:default]]
toucan2.tools.after-insert/define-after-insert [[:inner 0]]
toucan2.tools.after-select/define-after-select [[:inner 0]]
toucan2.tools.after-update/define-after-update [[:inner 0]]
toucan2.tools.before-delete/define-before-delete [[:inner 0]]
toucan2.tools.before-insert/define-before-insert [[:inner 0]]
toucan2.tools.before-select/define-before-select [[:inner 0]]
toucan2.tools.compile/build [[:block 0]]
toucan2.tools.compile/compile [[:block 0]]
toucan2.tools.compile/resolved [[:block 0]]
toucan2.tools.debug/debug [[:block 0]]
toucan2.tools.default-fields/define-default-fields [[:inner 0]]
toucan2.tools.named-query/define-named-query [[:block 1]]
toucan2.tools.simple-out-transform/define-out-transform [[:inner 0]]
toucan2.tools.transformed/deftransforms [[:block 1]]
toucan2.tools.with-temp/with-temp [[:inner 0]]
toucan2.util/try-with-error-context [[:inner 0]]}}

View File

@@ -1,11 +1,11 @@
FROM mcr.microsoft.com/vscode/devcontainers/java:11
FROM mcr.microsoft.com/vscode/devcontainers/java:21
# Set up nodesource, install node, yarn, fontconfig for static viz, rlwrap for dev ergonomics
RUN ( curl -fsSL https://deb.nodesource.com/setup_18.x | bash ) \
RUN ( curl -fsSL https://deb.nodesource.com/setup_22.x | bash ) \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com \
&& apt-get update && apt-get -y install --no-install-recommends nodejs yarn rlwrap fontconfig
# install Clojure
RUN curl https://download.clojure.org/install/linux-install-1.11.1.1262.sh | bash
RUN curl https://download.clojure.org/install/linux-install-1.12.0.1488.sh | bash

View File

@@ -20,67 +20,62 @@
(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 'defsetting 'clojure-doc-string-elt 2))
(eval . (put 'setting/defsetting 'clojure-doc-string-elt 2))
(eval . (put 's/defn 'clojure-doc-string-elt 2))
(eval . (put 'p.types/defprotocol+ 'clojure-doc-string-elt 2))
(eval . (put 'methodical/defmethod 'clojure-doc-string-elt 3))
(eval . (put 'methodical/defmulti 'clojure-doc-string-elt 2))
(eval . (put 'mi/define-simple-hydration-method 'clojure-doc-string-elt 3))
(eval . (put 'define-premium-feature 'clojure-doc-string-elt 2))
(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))
(eval . (put 'p.types/defprotocol+ 'clojure-doc-string-elt 2))
(eval . (put 'methodical/defmethod 'clojure-doc-string-elt 3))
(eval . (put 'methodical/defmulti 'clojure-doc-string-elt 2))
(eval . (put 'mi/define-simple-hydration-method 'clojure-doc-string-elt 3))
(eval . (put 'mi/define-batched-hydration-method 'clojure-doc-string-elt 3))
(eval . (put 'mr/def 'clojure-doc-string-elt 2))
(eval . (put 'mu/defn 'clojure-doc-string-elt 2))
(eval . (put 'mr/def 'clojure-doc-string-elt 2))
(eval . (put 'mu/defn 'clojure-doc-string-elt 2))
;; Define custom indentation for functions inside metabase.
;; This list isn't complete; add more forms as we come across them.
;;
;; `put-clojure-indent' is a safe-local-eval-function, so use a bunch of calls to that
;; instead of one call to `define-clojure-indent'
(eval . (put-clojure-indent 'api/let-404 1))
(eval . (put-clojure-indent 'c/step 1))
(eval . (put-clojure-indent 'impl/test-migrations 2))
(eval . (put-clojure-indent 'let-404 0))
(eval . (put-clojure-indent 'lib.schema.match/match 1))
(eval . (put-clojure-indent 'lib.schema.match/match-one 1))
(eval . (put-clojure-indent 'lib.schema.match/replace 1))
(eval . (put-clojure-indent 'lib.schema.match/replace-in 2))
(eval . (put-clojure-indent 'lib.util.match/replace 1))
(eval . (put-clojure-indent 'macros/case 0))
(eval . (put-clojure-indent 'match 1))
(eval . (put-clojure-indent 'mi/define-methods '(:form)))
(eval . (put-clojure-indent 'mt/dataset 1))
(eval . (put-clojure-indent 'mt/format-rows-by 1))
(eval . (put-clojure-indent 'mt/query 1))
(eval . (put-clojure-indent 'mt/test-driver 1))
(eval . (put-clojure-indent 'mt/test-drivers 1))
(eval . (put-clojure-indent 'prop/for-all 1))
(eval . (put-clojure-indent 'api/let-404 1))
(eval . (put-clojure-indent 'c/step 1))
(eval . (put-clojure-indent 'impl/test-migrations 2))
(eval . (put-clojure-indent 'let-404 0))
(eval . (put-clojure-indent 'lib.schema.match/match '(:defn)))
(eval . (put-clojure-indent 'lib.schema.match/match-one '(:defn)))
(eval . (put-clojure-indent 'lib.schema.match/replace '(:defn)))
(eval . (put-clojure-indent 'lib.schema.match/replace-in '(:defn)))
(eval . (put-clojure-indent 'lib.util.match/replace '(:defn)))
(eval . (put-clojure-indent 'macros/case 0))
(eval . (put-clojure-indent 'match 1))
(eval . (put-clojure-indent 'mt/dataset 1))
(eval . (put-clojure-indent 'mt/format-rows-by '(:form)))
(eval . (put-clojure-indent 'mt/query 1))
(eval . (put-clojure-indent 'mt/test-driver 1))
(eval . (put-clojure-indent 'mt/test-drivers 1))
(eval . (put-clojure-indent 'mt/with-anaphora 1))
(eval . (put-clojure-indent 'prop/for-all 1))
(eval . (put-clojure-indent 'qp.streaming/streaming-response 1))
(eval . (put-clojure-indent 'tc/quick-check 1))
(eval . (put-clojure-indent 'u/profile 1))
(eval . (put-clojure-indent 'u/prog1 1))
(eval . (put-clojure-indent 'u/select-keys-when 1))
(eval . (put-clojure-indent 'with-meta '(:form)))
(eval . (put-clojure-indent 'tc/quick-check 1))
(eval . (put-clojure-indent 'u/profile 1))
(eval . (put-clojure-indent 'u/prog1 1))
(eval . (put-clojure-indent 'u/select-keys-when '(:form)))
(eval . (put-clojure-indent 'with-meta '(:form)))
;; these ones have to be done with `define-clojure-indent' for now because of upstream bug
;; https://github.com/clojure-emacs/clojure-mode/issues/600 once that's resolved we should use `put-clojure-indent'
;; instead. Please don't add new entries unless they don't work with `put-clojure-indent'
(eval . (define-clojure-indent
(l/matcha '(1 (:defn)))
(l/matche '(1 (:defn)))
(l/matcha '(1 (:defn)))
(l/matche '(1 (:defn)))
(p.types/def-abstract-type '(1 (:defn)))
(p.types/defprotocol+ '(1 (:defn)))
(p.types/defrecord+ '(2 nil nil (:defn)))
(p.types/deftype+ '(2 nil nil (:defn)))
(p/def-map-type '(2 nil nil (:defn)))
(p/defprotocol+ '(1 (:defn)))
(p/defrecord+ '(2 nil nil (:defn)))
(p/deftype+ '(2 nil nil (:defn)))
(tools.macro/macrolet '(1 ((:defn)) :form))))
(p.types/defprotocol+ '(1 (:defn)))
(p.types/defrecord+ '(2 nil nil (:defn)))
(p.types/deftype+ '(2 nil nil (:defn)))
(p/def-map-type '(2 nil nil (:defn)))
(p/defprotocol+ '(1 (:defn)))
(p/defrecord+ '(2 nil nil (:defn)))
(p/deftype+ '(2 nil nil (:defn)))
(tools.macro/macrolet '(1 ((:defn)) :form))))
(cider-clojure-cli-aliases . "dev:drivers:drivers-dev:ee:ee-dev:user")
(clojure-indent-style . always-align)
(cljr-favor-prefix-notation . nil)

View File

@@ -6,6 +6,10 @@
// can use this flag to enable it. This is set to true in CI
const shouldLintCssModules =
process.env.LINT_CSS_MODULES === "true" || process.env.CI;
const plugins = ["react", "no-only-tests"];
if (shouldLintCssModules) {
plugins.push("postcss-modules");
}
module.exports = {
rules: {
@@ -17,11 +21,14 @@ module.exports = {
{
vars: "all",
args: "none",
varsIgnorePattern: "^_",
varsIgnorePattern: "^_.+$",
ignoreRestSiblings: true,
},
],
"no-empty": [1, { allowEmptyCatch: true }],
// Note: adding this rule to a eslint config file in a subfolder will remove
// *not* carry over the restricted imports from parent folders, you will
// need to copy them over
"no-restricted-imports": [
"error",
{
@@ -62,6 +69,13 @@ module.exports = {
warnOnUnassignedImports: false,
},
],
"sort-imports": [
"error",
{
// allows this rule to work with import/order
ignoreDeclarationSort: true,
},
],
"no-console": [2, { allow: ["warn", "error", "errorBuffer"] }],
"react/no-is-mounted": 2,
"react/prefer-es6-class": 2,
@@ -78,9 +92,10 @@ module.exports = {
"react/forbid-component-props": [2, { forbid: ["sx"] }],
"react-hooks/exhaustive-deps": [
"warn",
{ additionalHooks: "(useSyncedQueryString|useSafeAsyncFunction)" },
{ additionalHooks: "(useSafeAsyncFunction)" },
],
"prefer-const": [1, { destructuring: "all" }],
"no-restricted-globals": ["error", "close"],
"no-useless-escape": 0,
"no-only-tests/no-only-tests": [
"error",
@@ -100,7 +115,6 @@ module.exports = {
"When",
"Then",
"describeWithSnowplow",
"describeEE",
],
},
],
@@ -124,7 +138,7 @@ module.exports = {
"jest/globals": true,
},
parser: "babel-eslint",
plugins: ["react", "no-only-tests", "postcss-modules"],
plugins,
extends: [
"eslint:recommended",
"plugin:react/recommended",
@@ -133,6 +147,8 @@ module.exports = {
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:depend/recommended",
"plugin:storybook/recommended",
],
settings: {
"import/internal-regex": "^metabase/|^metabase-lib/",
@@ -159,7 +175,19 @@ module.exports = {
files: ["*.js", "*.jsx", "*.ts", "*.tsx"],
rules: {
"no-unconditional-metabase-links-render": "error",
"no-color-literals": "error",
"no-literal-metabase-strings": "error",
"depend/ban-dependencies": [
"error",
{
allowed: [
"underscore",
"moment",
"lodash.orderby",
"lodash.debounce",
],
},
],
},
},
{
@@ -169,11 +197,13 @@ module.exports = {
"frontend/src/metabase/setup/**/*",
"frontend/lint/**/*",
"*.stories.*",
"stories-data.*",
"e2e/**/*",
"**/tests/*",
"release/**/*",
],
rules: {
"no-color-literals": "off",
"no-unconditional-metabase-links-render": "off",
"no-literal-metabase-strings": "off",
},
@@ -189,14 +219,20 @@ module.exports = {
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/consistent-type-imports": [
"error",
{
fixStyle: "inline-type-imports",
},
],
"@typescript-eslint/no-import-type-side-effects": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
argsIgnorePattern: "^_.+$",
varsIgnorePattern: "^_.+$",
ignoreRestSiblings: true,
destructuredArrayIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_.+$",
},
],
// This was introduced in 6.0.0
@@ -208,8 +244,9 @@ module.exports = {
"plugin:jest/recommended",
"plugin:jest-dom/recommended",
"plugin:testing-library/react",
"plugin:jest-formatting/recommended",
],
plugins: ["jest", "jest-dom", "testing-library"],
plugins: ["jest", "jest-dom", "testing-library", "jest-formatting"],
files: [
"*.unit.spec.ts",
"*.unit.spec.tsx",
@@ -218,6 +255,56 @@ module.exports = {
],
rules: {
"jest/valid-title": ["error", { ignoreTypeOfDescribeName: true }],
"jest/expect-expect": [
"error",
{
"assertFunctionNames": ["expect*", "assert*"],
"additionalTestBlockFunctions": []
}
],
},
},
{
// Enable jest formatting for cypress tests too, the plugin logic just works
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)",
}
],
},
},
{
files: ["docs/**/snippets/**/*.{ts,tsx,js,jsx}"],
rules: {
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/no-var-requires": "off",
"import/no-commonjs": "off",
"import/no-default-export": "off",
"import/order": "off",
"import/no-unresolved": "off",
"no-color-literals": "off",
},
},
],

269
.github/CODEOWNERS vendored
View File

@@ -1,14 +1,261 @@
# 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
src/metabase/**/*permissions* @noahmoss
src/metabase/integrations @noahmoss
enterprise/frontend/src/embedding-sdk @metabase/embedding
frontend/src/metabase/embedding-sdk @metabase/embedding
frontend/src/metabase/public/containers/PublicOrEmbeddedQuestion @metabase/embedding
frontend/src/metabase/public/containers/PublicOrEmbeddedDashboard @metabase/embedding
frontend/src/metabase/ui @metabase/core-frontend-admin-webapp
# snowplow/* @metabase/data
src/metabase/analytics/prometheus.clj @metabase/cloud-ops
.github @metabase/devexp
.clj-kondo @metabase/devexp
deps.edn @metabase/backend-developers
docs @metabase/tech-writers
#
# Backend modules <=> teams that own them
#
# modules/drivers @metabase/drivers
# 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

@@ -1,13 +1,9 @@
> [!IMPORTANT]
> For those employed by Metabase: if you are merging into master, please add either a `backport` or a `no-backport` label
> to this PR. You will not be able to merge until you do this step. Refer to the section [Do I need to backport this
> PR?](https://www.notion.so/metabase/Metabase-Branching-Strategy-6eb577d5f61142aa960a626d6bbdfeb3?pvs=4#89f80d6f17714a0198aeb66c0efd1b71)
> in the Metabase Branching Strategy document for more details. If you're not employed by Metabase, this section does not
> apply to you, and the label will be taken care of by your reviewer.
> For those employed by Metabase: if you are merging into master, please add either a `backport` or a `no-backport` label to this PR. You will not be able to merge until you do this step. Refer to the section [Do I need to backport this PR?](https://www.notion.so/metabase/Metabase-Branching-Strategy-6eb577d5f61142aa960a626d6bbdfeb3?pvs=4#89f80d6f17714a0198aeb66c0efd1b71) in the Metabase Branching Strategy document for more details. If you're not employed by Metabase, this section does not apply to you, and the label will be taken care of by your reviewer.
> **Warning**
>
> If that is your first contribution to Metabase, please sign the [Contributor License Agreement](https://docs.google.com/a/metabase.com/forms/d/1oV38o7b9ONFSwuzwmERRMi9SYrhYeOrkbmNaq9pOJ_E/viewform) (unless it's a tiny documentation change). Also, if you're attempting to fix a translation issue, please submit your changes to our [POEditor project](https://poeditor.com/join/project/ynjQmwSsGh) instead of opening a PR.
> If that is your first contribution to Metabase, please sign the [Contributor License Agreement](https://docs.google.com/a/metabase.com/forms/d/1oV38o7b9ONFSwuzwmERRMi9SYrhYeOrkbmNaq9pOJ_E/viewform) (unless it's a tiny documentation change). Also, if you're attempting to fix a translation issue, please submit your changes to our [Crowdin project](https://crowdin.com/project/metabase-i18n) instead of opening a PR.
Closes https://github.com/metabase/metabase/issues/[issue_number]

View File

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

15
.github/actions/await-port/action.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: Wait for localhost port to be ready
inputs:
port:
required: true
runs:
using: composite
steps:
- name: Wait for port ${{ inputs.port }} to be ready
shell: bash
run: |
while ! nc -z localhost ${{ inputs.port }}; do
sleep 0.1;
done

View File

@@ -1,69 +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", {} ],
["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

@@ -0,0 +1,120 @@
name: Build ee-extra
description: Build Metabase Enterprise Edition with extra features
inputs:
java-version:
required: true
default: 21
iam-role:
description: "The IAM role to assume"
required: true
runs:
using: composite
steps:
- name: Prepare Java
uses: actions/setup-java@v3
with:
java-version: ${{ inputs.java-version }}
distribution: 'temurin'
- name: Reveal its original version.properties
run: jar xf ./bin/docker/metabase.jar version.properties && cat version.properties
shell: bash
- name: get major version
id: major_version
run: echo "major_version=$(cat version.properties | grep 'tag=' | cut -d'.' -f2)" >> $GITHUB_OUTPUT
shell: bash
- name: get drivers registry
run: |
curl -OL https://raw.githubusercontent.com/metabase/metabase-registry/main/registry.yaml
shell: bash
- uses: actions/setup-node@v4
with:
node-version: lts/Jod # 22.x.x
- run: rm package.json && npm install yaml
shell: bash
- name: parse drivers registry
uses: actions/github-script@v7
id: drivers_registry
with:
script: | # js
const { parse } = require('yaml');
const fs = require('fs');
const registry = parse(fs.readFileSync('registry.yaml', 'utf8'));
const drivers = registry.drivers;
const majorVersion = '${{ steps.major_version.outputs.major_version }}';
const getDriverUrl = (driverName) => {
const driver = drivers.find(driver => driver.name === driverName);
if (!driver) {
throw new Error(`Driver ${driverName} not found in the registry`);
}
const driverUrl = driver.versions[majorVersion] ?? driver.versions.default;
if (!driverUrl) {
throw new Error(`Driver ${driverName} version ${majorVersion} not found in the registry`);
}
return driverUrl;
};
const extraDrivers = {
firebolt: getDriverUrl('firebolt'),
starburst: getDriverUrl('starburst'),
clickhouse: getDriverUrl('clickhouse'),
materialize: getDriverUrl('materialize'),
};
console.log(extraDrivers);
return extraDrivers;
- name: Download Firebolt driver
if: ${{ fromJson(steps.drivers_registry.outputs.result).firebolt != 'noop' }}
run: |
curl -OL ${{ fromJson(steps.drivers_registry.outputs.result).firebolt }}
working-directory: modules
shell: bash
- name: Download Starburst driver
if: ${{ fromJson(steps.drivers_registry.outputs.result).starburst != 'noop' }}
run: |
curl -OL ${{ fromJson(steps.drivers_registry.outputs.result).starburst }}
shell: bash
working-directory: modules
- name: Download Clickhouse driver
if: ${{ fromJson(steps.drivers_registry.outputs.result).clickhouse != 'noop' }}
run: |
curl -OL ${{ fromJson(steps.drivers_registry.outputs.result).clickhouse }}
shell: bash
working-directory: modules
- name: Download Materialize driver
if: ${{ fromJson(steps.drivers_registry.outputs.result).materialize != 'noop' }}
run: |
curl -OL ${{ fromJson(steps.drivers_registry.outputs.result).materialize }}
shell: bash
working-directory: modules
- name: Bundle additional drivers into the Uberjar
run: if test -n "$(find modules -maxdepth 1 -name '*.jar' -print -quit)"; then jar uf bin/docker/metabase.jar modules/*.jar; fi
shell: bash
- name: Launch uberjar
run: >-
java --add-opens java.base/java.nio=ALL-UNNAMED -jar ./bin/docker/metabase.jar &
shell: bash
- name: Wait for Metabase to start
run: while ! curl 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
shell: bash
- name: Kill the java process
run: pkill -f metabase.jar
shell: bash
- name: configure aws credentials
if: ${{ github.ref_name == 'master' }}
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ inputs.iam-role }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: us-east-1
- name: Login to Amazon ECR
if: ${{ github.ref_name == 'master' }}
uses: aws-actions/amazon-ecr-login@v2

View File

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

@@ -0,0 +1,67 @@
name: Cross-branch migration test
inputs:
base-ref:
required: true
runs:
using: "composite"
steps:
- name: Check out base branch
uses: actions/checkout@v4
with:
ref: ${{ inputs.base-ref }}
- name: Prepare backend environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: cross-branch-migrations
- name: Run backend on base branch
run: |
clojure -M:run:ee > metabase.log 2>&1 & echo $! > metabase_pid
tail -F metabase.log &
shell: bash
- name: Wait for Metabase to start
run: |
while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}' > /dev/null; do
if ! kill -0 $(cat metabase_pid) 2>/dev/null; then
cat metabase.log
echo "Metabase process has exited."
exit 1
fi
sleep 1
done
shell: bash
- name: Stop Metabase on base branch
run: kill $(cat metabase_pid)
shell: bash
- name: Check out pull request branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Run backend on pull request branch
run: |
clojure -M:run:ee > metabase.log 2>&1 & echo $! > metabase_pid
tail -F metabase.log &
shell: bash
- name: Wait for Metabase to start
run: |
while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}' > /dev/null; do
if ! kill -0 $(cat metabase_pid) 2>/dev/null; then
cat metabase.log
echo "Metabase process has exited. Check that your migration changes work on an instance that has been previously initialized on your PR's target branch."
exit 1
fi
sleep 1
done
shell: bash
- name: Stop Metabase on pull request branch
run: kill $(cat metabase_pid)
shell: bash

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

@@ -10,24 +10,27 @@ inputs:
maildev:
description: Maildev container
required: true
default: 'false'
default: false
openldap:
description: OpenLDAP container
required: true
default: 'false'
default: false
postgres:
description: Postgres container
required: true
default: 'false'
default: false
mysql:
description: MySQL container
required: true
default: 'false'
default: false
mongo:
description: Mongo container
required: true
default: 'false'
default: false
webhook:
description: Webhook tester container
required: false
default: false
runs:
using: "composite"
@@ -84,4 +87,11 @@ runs:
while ! nc -z localhost 27004; do sleep 1; done &&
echo -e "${G}Mongo is up and running!"
fi
if ${{ inputs.webhook }}; then
echo -e "${Y}Starting webhook test container..." &&
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
shell: bash

View File

@@ -0,0 +1,63 @@
name: Fetch artifact
description: Fetches a specific artifact and downloads it to the current directory
inputs:
name:
description: The name of the artifact to fetch
required: true
runs:
using: "composite"
steps:
- name: find_release_artifact
id: find_release_artifact
uses: actions/github-script@v7
with:
result-encoding: string
script: | # js
const fs = require('fs');
const artifacts = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
name: "${{ inputs.name }}",
per_page: 1,
});
if (!artifacts.data?.artifacts?.[0]?.id) {
throw new Error(`No artifacts found for ${{ inputs.commit }}`);
}
const artifact_id = artifacts.data.artifacts[0].id;
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact_id,
archive_format: 'zip',
});
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/mb.zip`, Buffer.from(download.data));
- name: unzip uberjar artifact
shell: bash
run: unzip mb.zip
- name: Move the Uberjar
shell: bash
run: | # bash
if [ -e "metabase.jar" ]; then
echo "metabase.jar is already in the right place"
elif [ -e "target/uberjar/metabase.jar" ]; then
echo "moving metabase.jar to current directory"
mv target/uberjar/metabase.jar metabase.jar
else
echo "Could not find the metabase.jar file"
exit 1
fi
- name: Verify that this is a valid JAR file
shell: bash
run: file --mime-type ./metabase.jar
- name: Reveal its version.properties
shell: bash
run: jar xf metabase.jar version.properties && cat version.properties

View File

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

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

@@ -1,12 +1,20 @@
name: Prepare cypress environment
description: Cypress preparation steps
outputs:
chrome-path:
description: Path to the custom Chrome executable
value: ${{ steps.setup-chrome.outputs.chrome-path }}
runs:
using: "composite"
steps:
- name: Install Replay.io browser
run: npx @replayio/cypress install
shell: bash
- name: Install Chrome v111
uses: browser-actions/setup-chrome@v1
with:
# https://chromium.cypress.io/linux/stable/111.0.5563.146
chrome-version: 1097615
id: setup-chrome
- name: Check to see if dependencies should be cached
if: ${{ contains(github.event.head_commit.message, '[ci nocache]') }}

View File

@@ -1,11 +1,17 @@
name: Prepare front-end environment
inputs:
node-version:
description: "The version of Node.js to use, overriding .nvmrc"
required: false
runs:
using: "composite"
steps:
- name: Prepare Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }} # this overrides, if present
node-version-file: ".nvmrc"
- name: Check to see if dependencies should be cached
if: ${{ contains(github.event.head_commit.message, '[ci nocache]') }}
run: |
@@ -18,11 +24,14 @@ runs:
with:
path: ~/.m2
key: ${{ runner.os }}-cljs-${{ hashFiles('**/shadow-cljs.edn') }}
- name: Get node_modules cache
uses: actions/cache@v4
id: node-modules-cache
if: ${{ !contains(github.event.head_commit.message, '[ci nocache]') }}
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock', '**/patches/*.patch') }}
- run: yarn install --frozen-lockfile --prefer-offline
shell: bash

View File

@@ -0,0 +1,33 @@
name: Run Embedding SDK Storybook
runs:
using: "composite"
steps:
- name: Prepare frontend environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Compile CLJS
run: yarn build-pure:cljs
shell: bash
- name: Build Storybook
run: yarn build-storybook-embedding-sdk
shell: bash
- name: Serve Storybook
run: yarn http-server storybook-static -p 6006 &
shell: bash
- name: Wait for Storybook to become available
run: |
echo "Waiting for Storybook to be served..."
while ! curl --silent --fail http://localhost:6006; do
sleep 5
echo "Retrying..."
done
echo "Storybook is being served!"
shell: bash

View File

@@ -2,22 +2,29 @@ name: Test database driver
inputs:
junit-name:
required: true
default: 'driver'
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-${{ inputs.junit-name }}
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' }}
env:
MB_EDITION: ee
- name: Test database driver
run: clojure -X:dev:ci:ee:ee-dev:drivers:drivers-dev:test ${{ inputs.test-args }}
shell: bash
@@ -25,7 +32,7 @@ runs:
uses: dorny/test-reporter@v1
if: failure()
with:
path: 'target/junit/**/*_test.xml'
path: "target/junit/**/*_test.xml"
name: JUnit Test Report ${{ inputs.junit-name }}
reporter: java-junit
list-suites: failed

View File

@@ -0,0 +1,14 @@
name: Create Backend Dep Bump PRs
inputs:
github-token:
required: true
runs:
using: "composite"
steps:
- name: Open PRs to Bump Backend Deps
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
shell: bash
run: bash ${{ github.action_path }}/upgrade-deps.sh

View File

@@ -0,0 +1,81 @@
#! /usr/bin/env bash
# Script is adapted from https://github.com/nnichols/clojure-dependency-update-action/blob/master/dependency-check.sh
# make sure we're in the root dir of the metabase repo
script_dir=`dirname "${BASH_SOURCE[0]}"`
cd "$script_dir/../../.."
echo `pwd`
# Configure Git user opening PRs to the GH Actions bot.
git config --global user.email "metabase-bot@metabase.com"
git config --global user.name "Metabase bot"
# Run antq to check for outdated dependencies and output to UPGRADE_LIST
echo "::group::Checking for outdated dependencies"
UPGRADE_LIST=$(clojure -M:outdated --reporter=format --error-format="{{name}},{{version}},{{latest-version}},{{diff-url}}")
echo "$UPGRADE_LIST"
echo "::endgroup::"
# Parse the output of antq into a list of upgrades, and remove any failed fetches
UPGRADES=$(echo ${UPGRADE_LIST} | sed '/Failed to fetch/d' | sed '/Unable to fetch/d' | sed '/Logging initialized/d' | sort -u)
echo "::group::Upgrades"
echo ${UPGRADES}
echo "::endgroup::"
# Make sure we're on master
git checkout master
# Iterate over all upgrades
for upgrade in $UPGRADES; do
echo "::group::Processing upgrade"
# Parse each upgrade into its constituent parts
IFS=',' temp=($upgrade)
DEP_NAME=${temp[0]}
OLD_VERSION=${temp[1]}
NEW_VERSION=${temp[2]}
DIFF_URL=${temp[3]}
MODIFIED_FILE=${temp[4]}
BRANCH_NAME="dependencies/clojure/$DEP_NAME-$NEW_VERSION"
# Checkout the branch if it exists, otherwise create it
echo "Checking out" $BRANCH_NAME
git checkout $BRANCH_NAME || git checkout -b $BRANCH_NAME
# IF we successfully created a new branch, update the dependency
if [[ $? == 0 ]]; then
# Use antq to update the dependency
echo "Updating" $DEP_NAME "version" $OLD_VERSION "to" $NEW_VERSION
UPDATE_CMD="clojure -M:outdated --upgrade --force --focus=${DEP_NAME}"
eval ${UPDATE_CMD} || $(echo "Cannot update ${DEP_NAME}. Continuing" && git checkout master && continue)
TITLE="Bump $DEP_NAME from $OLD_VERSION to $NEW_VERSION"
BODY="Inspect dependency changes here: $DIFF_URL"
# Commit the dependency update, and link to the diff
git add deps.edn modules
git commit -m ${TITLE} -m ${BODY} --no-verify
git push -u origin $BRANCH_NAME
# Open the PR
echo "Opening pull request for" $DEP_NAME
PR_URL=$(gh pr create --base master --head $BRANCH_NAME --label "no-backport" --title ${TITLE} --body ${BODY})
PR_NUMBER=${PR_URL##*/}
echo "Opened PR #$PR_NUMBER"
# Make the PR Auto-Merge
gh pr merge -R metabase/metabase --squash --auto "$PR_NUMBER"
# Print a blank line, and reset the branch
echo "Checking out master" master
git checkout master
fi
echo "::endgroup::"
done

17
.github/auto_request_review.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
# The reviewers configuration for the auto_request_review workflow
# See https://github.com/necojackarc/auto-request-review/tree/master?tab=readme-ov-file#reviewers-configuration
# for the spec
files:
# migrations related files
'resources/migrations/**':
- team:core-workflows
'src/metabase/db/custom_migrations.clj':
- team:core-workflows
options:
ignore_draft: true
ignored_keywords:
- DO NOT REVIEW
- WIP
enable_group_assignment: false

View File

@@ -5,6 +5,7 @@ default: &default
shared_sources: &shared_sources
- "src/**/*.cljc"
- "src/**/*.cljs"
- "package.json"
shared_specs: &shared_specs
- "test/**/*.cljc"
@@ -25,24 +26,36 @@ frontend_sources: &frontend_sources
- "babel.config.json"
- ".eslintrc.js"
- "postcss.config.js"
- "rspack.config.js"
- "webpack.config.js"
- "webpack.embedding-sdk.config.js"
- "webpack.static-viz.config.js"
- ".nvmrc"
frontend_embedding_sdk_sources:
- "enterprise/frontend/src/embedding-sdk/**"
frontend_specs: &frontend_specs
- *shared_specs
- "frontend/test/**"
- "frontend/**/tests/**"
- "frontend/**/*.unit.*"
- "jest.config.json"
- "jest.config.js"
- "jest.tz.unit.conf.json"
release_source: &release_sources
- "release/**"
frontend_all: &frontend_all
- *frontend_ci
- *frontend_sources
- *frontend_specs
frontend_loki_ci: &frontend_loki_ci
- ".github/workflows/loki.yml"
- ".loki/**"
- ".storybook/**"
backend_ci: &backend_ci
- ".github/actions/prepare-frontend/**"
- ".github/actions/prepare-backend/**"
@@ -53,6 +66,7 @@ backend_ci: &backend_ci
backend_presto_kerberos:
- "**/presto_jdbc/**"
- "**/presto_jdbc.clj"
- ".github/workflows/presto-kerberos-integration-test.yml"
backend_sources: &backend_sources
- *shared_sources
@@ -70,7 +84,7 @@ backend_specs: &backend_specs
- "test_modules/**"
- "modules/drivers/*/test/**"
- "test_config/**"
- "dev/**"
- "test_resources/**"
backend_all: &backend_all
- *default
@@ -84,14 +98,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"
@@ -100,6 +113,10 @@ e2e_specs: &e2e_specs
- "e2e/support/**"
- "e2e/snapshot*/**"
e2e_cross_version: &e2e_cross_version
- ".github/workflows/e2e-cross-version.yml"
- "e2e/test/scenarios/cross-version/**"
e2e_all:
- *default
- *e2e_ci

View File

@@ -0,0 +1,68 @@
exports.updateComment = updateComment;
/** @param {import('@types/github-script').AsyncFunctionArguments} AsyncFunctionArguments */
async function updateComment({ github, context }) {
const githubUsername = context.payload.sender.login;
const comment = `${CONVENTIONAL_COMMIT_REMINDER_COMMENT_IDENTIFIER}
@${githubUsername} You have modified embedding SDK code. Please make sure the PR title follows [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) style.
Here are all the supported types that will be shown in the changelog:
- \`feat\`
- \`fix\`
- \`perf\`
These types \`docs\`, \`style\`, \`refactor\`, \`test\`, \`build\`, and \`ci\` are also encouraged for non-changelog related tasks.
Please also make sure to include \`sdk\` scope, otherwise, the changelog will not include this task.
For example, these are valid PR titles:
- \`feat(sdk): Add interactive dashboard component\`
- \`feat(sdk): Support theming pie chart\`
- \`fix(sdk): Fix static dashboard crash\``;
const owner = context.repo.owner;
const repo = context.repo.repo;
const pullRequestNumber = context.issue.number;
const comments = await github.rest.issues.listComments({
owner,
repo,
issue_number: pullRequestNumber,
});
const existingComment = getExistingConventionalCommitReminderComment(
comments.data,
);
if (existingComment) {
return await github.rest.issues.updateComment({
owner,
repo,
comment_id: existingComment.id,
body: comment,
});
} else {
return await github.rest.issues.createComment({
owner,
repo,
issue_number: pullRequestNumber,
body: comment,
});
}
}
const CONVENTIONAL_COMMIT_REMINDER_COMMENT_IDENTIFIER =
"<!---conventional commit reminder comment ID-->";
/**
* @typedef Comment
* @property {string} body
*
* @param {Comment[]} comments
*/
function getExistingConventionalCommitReminderComment(comments) {
for (const comment of comments) {
if (
comment.body.startsWith(CONVENTIONAL_COMMIT_REMINDER_COMMENT_IDENTIFIER)
) {
return comment;
}
}
}

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