Compare commits

...

1189 Commits

Author SHA1 Message Date
Uladzimir Havenchyk
1d50822ae6 Merge branch 'master' into build-fe-parallel 2024-08-15 15:57:03 +03: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
Uladzimir Havenchyk
d63801e0e1 Merge branch 'master' into build-fe-parallel 2024-08-07 10:49:47 +03: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
3e4557f1af Merge branch 'master' into build-fe-parallel 2024-07-30 09:10:40 +03: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
Uladzimir Havenchyk
cdfd5b9d0a Merge branch 'master' into build-fe-parallel 2024-07-29 14:39:23 +03: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
Uladzimir Havenchyk
9f1a51b6a0 Merge branch 'master' into build-fe-parallel 2024-07-26 00:39:35 +03: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
Uladzimir Havenchyk
8a925a654e Merge branch 'master' into build-fe-parallel 2024-07-25 17:30:47 +03: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
Uladzimir Havenchyk
f8afc037f6 Merge branch 'master' into build-fe-parallel 2024-07-24 19:29:48 +03: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
Uladzimir Havenchyk
50b45ceda8 Merge branch 'master' into build-fe-parallel 2024-07-24 16:59:10 +03: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
Uladzimir Havenchyk
7dafa3a86c Merge branch 'master' into build-fe-parallel 2024-07-23 17:38:22 +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
a1099f8333 Merge branch 'master' into build-fe-parallel 2024-07-22 19:55:14 +03: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
Uladzimir Havenchyk
fa73f35160 Merge branch 'master' into build-fe-parallel 2024-07-22 17:51:16 +03: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
Uladzimir Havenchyk
8f849e1c58 drop static viz from build.clj 2024-07-19 21:37:48 +03: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
Uladzimir Havenchyk
5937e4e6d2 run fe builds in parallel 2024-07-19 19:13:02 +03: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
4502 changed files with 489556 additions and 199677 deletions

View File

@@ -28,7 +28,6 @@
:metabase/test-helpers-use-non-thread-safe-functions {:level :warning}
:metabase/validate-deftest {:level :warning}
:metabase/validate-logging {:level :warning}
:metabase/warn-about-schema= {:level :warning}
;;
;; disabled linters
@@ -53,7 +52,7 @@
(clojure.core.logic/fresh)
(clojure.core.logic/matcha)
(clojure.core.logic/run)
(clojure.test/is [query= =? malli=])
(clojure.test/is [query= =? malli= qv=])
(clojure.tools.macro/macrolet)
instaparse.core/transform
(metabase.async.streaming-response/streaming-response)
@@ -107,6 +106,7 @@
malli.core/explainer {:message "Use metabase.util.malli.registry/explainer instead of malli.core/explainer"}
me.flowthing.pp/pprint {:message "Use metabase.util.log instead of me.flowthing.pp/pprint"}
medley.core/random-uuid {:message "Use clojure.core/random-uuid instead of medley.core/random-uuid"}
metabase.driver/database-supports? {:message "Use metabase.driver.util/supports? instead of metabase.driver/database-supports?"}
metabase.lib.equality/find-column-indexes-for-refs {:message "Use lib.equality/closest-matches-in-metadata or lib.equality/find-closest-matches-for-refs instead of lib.equality/find-column-indexes-for-refs"}
metabase.test/with-temp* {:message "Use mt/with-temp instead of mt/with-temp*"}
toucan2.tools.with-temp {:message "Use mt/with-temp instead of t2.with-temp/with-temp"}}
@@ -114,6 +114,7 @@
:discouraged-namespace
{camel-snake-kebab.core {:message "CSK is not Turkish-safe, use the versions in metabase.util instead."}
clojure.tools.logging {:message "Use metabase.util.log instead of clojure.tools.logging directly"}
grouper.core {:message "Use metabase.util.grouper instead of grouper.core"}
honeysql.core {:message "Use Honey SQL 2. Honey SQL 1 is removed as a dependency in Metabase 49+."}
honeysql.format {:message "Use Honey SQL 2. Honey SQL 1 is removed as a dependency in Metabase 49+."}
honeysql.helpers {:message "Use Honey SQL 2. Honey SQL 1 is removed as a dependency in Metabase 49+."}
@@ -135,7 +136,7 @@
;; 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
;; 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`.
;;
@@ -149,7 +150,8 @@
{metabase.actions #{metabase.actions.core}
metabase.analytics #{metabase.analytics.prometheus
metabase.analytics.snowplow
metabase.analytics.stats} ; TODO -- consolidate these into a real API namespace.
metabase.analytics.stats
metabase.analytics.sdk} ; TODO -- consolidate these into a real API namespace.
metabase.analyze #{metabase.analyze}
metabase.api #{metabase.api.common
metabase.api.dataset
@@ -158,8 +160,10 @@
metabase.async #{metabase.async.streaming-response
metabase.async.streaming-response.thread-pool
metabase.async.util} ; TODO -- consolidate these into a real API namespace.
metabase.audit #{metabase.audit}
metabase.bootstrap #{metabase.bootstrap}
metabase.cmd #{} ; there are no namespaces here since you shouldn't be using this in any other module.
metabase.channel #{metabase.channel.core}
metabase.config #{metabase.config}
metabase.core #{metabase.core.initialization-status} ; TODO -- only namespace used outside of EE, this probably belongs in `metabase.server` anyway since that's the only place it's used.
metabase.db #{metabase.db
@@ -186,7 +190,6 @@
metabase.metabot #{metabase.metabot}
metabase.models :any ; TODO -- scream, 62 namespaces used elsewhere, but to be fair a lot of these don't *need* to be required.
metabase.moderation #{metabase.moderation}
metabase.native-query-analyzer #{metabase.native-query-analyzer}
metabase.permissions #{metabase.permissions.util} ; TODO -- this is currently the only namespace in this module. Give it a real API namespace?
metabase.plugins #{metabase.plugins
metabase.plugins.classloader} ; TODO -- not 100% sure the classloader belongs here
@@ -201,6 +204,8 @@
metabase.pulse.render.js-svg
metabase.pulse.render.style} ; TODO -- consolidate these into a real API namespace.
metabase.query-processor :any ; TODO omg scream, 29 namespaces used outside of the module. WHAT THE HECC
metabase.query-analysis #{metabase.query-analysis
metabase.query-analysis.failure-map}
metabase.related #{metabase.related}
metabase.sample-data #{metabase.sample-data}
metabase.search #{metabase.search}
@@ -259,9 +264,12 @@
metabase.analyze :any
metabase.api :any
metabase.async :any
metabase.audit :any
metabase.auth-provider #{metabase.util}
metabase.bootstrap #{}
metabase.cmd :any
metabase.compatibility :any
metabase.channel :any
metabase.config #{metabase.plugins}
metabase.core :any
metabase.db :any
@@ -278,11 +286,18 @@
metabase.metabot :any
metabase.models :any
metabase.moderation :any
metabase.native-query-analyzer :any
metabase.permissions :any
metabase.plugins :any
metabase.public-settings :any
metabase.pulse :any
metabase.query-analysis #{metabase.config
metabase.driver
metabase.legacy-mbql
metabase.lib
metabase.models
metabase.public-settings
metabase.query-processor
metabase.util}
metabase.query-processor :any
metabase.related :any
metabase.sample-data :any
@@ -355,6 +370,7 @@
metabase-enterprise.audit-app.pages.common common
metabase-enterprise.sandbox.api.table table
metabase-enterprise.test met
metabase.analytics.sdk sdk
metabase.analytics.stats stats
metabase.analyze.query-results qr
metabase.analyze.classifiers.category classifiers.category
@@ -409,6 +425,7 @@
metabase.api.user api.user
metabase.api.util api.util
metabase.async.streaming-response.thread-pool thread-pool
metabase.channel.core channel
metabase.cmd.copy.h2 copy.h2
metabase.config config
metabase.config.file config.file
@@ -483,8 +500,8 @@
metabase.models.setting.cache setting.cache
metabase.models.timeline timeline
metabase.models.timeline-event timeline-event
metabase.native-query-analyzer query-analyzer
metabase.native-query-analyzer.parameter-substitution nqa.sub
metabase.analysis.native-query-analyzer nqa
metabase.analysis.native-query-analyzer.parameter-substitution nqa.sub
metabase.plugins.initialize plugins.init
metabase.public-settings public-settings
metabase.public-settings.premium-features premium-features
@@ -566,6 +583,7 @@
metabase.util.encryption encryption
metabase.util.encryption-test encryption-test
metabase.util.files u.files
metabase.util.grouper grouper
metabase.util.honey-sql-2 h2x
metabase.util.i18n i18n
metabase.util.i18n.impl i18n.impl
@@ -592,7 +610,9 @@
toucan.models models}}}
:lint-as
{clojure.core.logic/defne clj-kondo.lint-as/def-catch-all
{cljs.cache/defcache clojure.core/deftype
clojure.core.cache/defcache clojure.core/deftype
clojure.core.logic/defne clj-kondo.lint-as/def-catch-all
clojure.test.check.clojure-test/defspec clojure.test/deftest
clojurewerkz.quartzite.jobs/defjob clojure.core/defn
honeysql.helpers/defhelper clj-kondo.lint-as/def-catch-all
@@ -644,12 +664,15 @@
metabase.test/with-temp-empty-app-db clojure.core/let
metabase.test/with-temp-file clojure.core/let
metabase.test/with-user-in-groups clojure.core/let
metabase.test/with-grouper-batches! clojure.core/fn
metabase.upload-test/with-upload-table! clojure.core/let
metabase.util.files/with-open-path-to-resource clojure.core/let
metabase.util.malli.defn/defn schema.core/defn
metabase.util.malli.defn/defn- schema.core/defn
metabase.util.malli.fn/fn schema.core/fn
metabase.util.malli/defmethod schema.core/defmethod
metabase.util.malli/defn schema.core/defn
metabase.util.malli/defn- schema.core/defn
metabase.util.malli/fn schema.core/fn
metabase.util.ssh/with-ssh-tunnel clojure.core/let
metabase.xrays.domain-entities.malli/defn schema.core/defn
@@ -755,6 +778,7 @@
metabase.test/with-log-messages-for-level hooks.common/with-ignored-first-arg
metabase.test/with-non-admin-groups-no-root-collection-perms hooks.common/do*
metabase.test/with-temp hooks.toucan2.tools.with-temp/with-temp
metabase.stale-test/with-stale-items hooks.toucan2.tools.with-temp/with-temp
metabase.test/with-temp-file hooks.metabase.test.util/with-temp-file
metabase.test/with-temporary-setting-values hooks.metabase.test.util/with-temporary-setting-values
metabase.util/format-color hooks.metabase.util/format-color
@@ -778,9 +802,12 @@
clojurewerkz.quartzite.schedule.simple/schedule macros.quartz/simple-schedule
clojurewerkz.quartzite.triggers/build macros.quartz/build-trigger
metabase-enterprise.sandbox.test-util/with-gtaps! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.sandbox.test-util/with-gtaps-for-user! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.serialization.test-util/with-world macros.metabase-enterprise.serialization.test-util/with-world
metabase-enterprise.test/with-gtaps! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.test/with-gtaps-for-user! macros.metabase-enterprise.sandbox.test-util/with-gtaps!
metabase-enterprise.advanced-permissions.api.util-test/with-impersonations! macros.metabase-enterprise.advanced-permissions.api.util-test/with-impersonations!
metabase-enterprise.query-reference-validation.api-test/with-test-setup macros.metabase-enterprise.query-reference-validation.api-test/with-test-setup
metabase.api.card-test/with-ordered-items macros.metabase.api.card-test/with-ordered-items
metabase.api.collection-test/with-collection-hierarchy macros.metabase.api.collection-test/with-collection-hierarchy
metabase.api.collection-test/with-some-children-of-collection macros.metabase.api.collection-test/with-some-children-of-collection
@@ -793,11 +820,12 @@
metabase.lib.common/defop macros.metabase.lib.common/defop
metabase.models.params.chain-filter-test/chain-filter macros.metabase.models.params.chain-filter-test/chain-filter
metabase.models.params.chain-filter-test/chain-filter-search macros.metabase.models.params.chain-filter-test/chain-filter
metabase.models.query-field-test/with-test-setup macros.metabase.models.query-field-test/with-test-setup
metabase.models.query-analysis-test/with-test-setup macros.metabase.models.query-analysis-test/with-test-setup
metabase.models.user-test/with-groups macros.metabase.models.user-test/with-groups
metabase.query-processor.streaming/streaming-response macros.metabase.query-processor.streaming/streaming-response
metabase.related-test/with-world macros.metabase.related-test/with-world
metabase.shared.util.namespaces/import-fn macros.metabase.shared.util.namespaces/import-fn
metabase.task.setup.query-analysis-setup/with-test-setup! macros.metabase.task.setup.query-analysis-setup/with-test-setup!
metabase.test.data.users/with-group-for-user macros.metabase.test.data.users/with-group-for-user
metabase.test.util/with-temp-env-var-value! macros.metabase.test.util/with-temp-env-var-value!
metabase.test.util/with-temporary-raw-setting-values macros.metabase.test.util/with-temporary-raw-setting-values
@@ -835,7 +863,19 @@
;; `metabase.driver.*`, excluding `-test` namespaces.
;;
{:pattern "metabase(?:(?:(?:-enterprise\\.sandbox)?\\.query-processor\\.)|(?:\\.driver\\.)).*(?<!-test)$"
:name qp-and-driver-source-namespaces}]
:name qp-and-driver-source-namespaces}
;;
;; driver namespaces
;;
{:pattern "metabase\\.driver.*$"
:name driver-namespaces}
;;
;; general QP tests are ones that run across multiple drivers. Anything `metabase.query-processor*-test`,
;; `metabase.driver.sql*-test` (excluding SQLServer and SQLite), or
;; `metabase-enterprise.sandbox.query-processor*-test`
;;
{:pattern "^metabase(?:((?:-enterprise\\.sandbox)?\\.query-processor)|(?:\\.driver\\.sql(?!server)(?!ite))).*-test$"
:name general-qp-and-driver-test-namespaces}]
:config-in-ns
{test-namespaces
@@ -843,7 +883,9 @@
{:inline-def {:level :off}
:missing-docstring {:level :off}
:private-call {:level :off}
:metabase/defsetting-must-specify-export {:level :off}}
:metabase/defsetting-must-specify-export {:level :off}
:discouraged-var {metabase.driver/database-supports? {:level :off}}}
:hooks
{:analyze-call
{clojure.core/defmacro hooks.clojure.core/non-thread-safe-form-should-end-with-exclamation
@@ -893,6 +935,11 @@
toucan.util.test {:message "Don't use application database inside MLv2 code"}
toucan2.core {:message "Don't use application database inside MLv2 code"}}}}
driver-namespaces
{:linters
{:discouraged-var
{metabase.driver/database-supports? {:level :off}}}}
qp-and-driver-source-namespaces
{:linters
{:discouraged-namespace
@@ -906,4 +953,8 @@
{medley.core/map-keys {:message "Use clojure.core/update-keys"}
medley.core/map-vals {:message "Use clojure.core/update-vals"}
metabase.db.query/query {:message "Don't use application database directly in QP code; use QP Store/metadata provider"}
metabase.db.query/reducible-query {:message "Don't use application database directly in QP code; use QP Store/metadata provider"}}}}}}
metabase.db.query/reducible-query {:message "Don't use application database directly in QP code; use QP Store/metadata provider"}}}}
general-qp-and-driver-test-namespaces
{:linters
{:metabase/disallow-hardcoded-driver-names-in-tests {:level :warning}}}}}

View File

@@ -1,4 +1,4 @@
(ns macros.metabase.models.query-field-test
(ns macros.metabase.models.query-analysis-test
(:require [macros.common]))
(defmacro with-test-setup [& body]

View File

@@ -0,0 +1,12 @@
(ns macros.metabase.task.setup.query-analysis-setup
(:require [macros.common]))
(defmacro with-test-setup!
"Set up the data required to test the Query Analysis related tasks"
[& body]
`(let [~(macros.common/ignore-unused 'c1) 1
~(macros.common/ignore-unused 'c2) 2
~(macros.common/ignore-unused 'c3) 3
~(macros.common/ignore-unused 'c4) 4
~(macros.common/ignore-unused 'arch) 5]
~@body))

View File

@@ -0,0 +1,12 @@
(ns macros.metabase-enterprise.query-reference-validation.api-test
(:require [macros.common]))
(defmacro with-test-setup [& body]
`(let [~(macros.common/ignore-unused 'card-1) 1
~(macros.common/ignore-unused 'card-2) 2
~(macros.common/ignore-unused 'card-3) 3
~(macros.common/ignore-unused 'card-4) 4
~(macros.common/ignore-unused 'card-5) 5
~(macros.common/ignore-unused 'coll-2) 100
~(macros.common/ignore-unused 'coll-3) 200]
~@body))

View File

@@ -2,19 +2,8 @@
(: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)))
[clojure.string :as str]
[hooks.common]))
(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,
@@ -159,7 +148,7 @@
(doseq [child (:children form)]
(walk f child)))]
(walk (fn [form]
(when-let [qualified-symbol (node->qualified-symbol form)]
(when-let [qualified-symbol (hooks.common/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)

View File

@@ -179,6 +179,64 @@
"Split it up into smaller tests! 🥰")
:type :metabase/i-like-making-cams-eyes-bleed-with-horrifically-long-tests)))))))
;;; don't include `:h2` since that will probably lead to a mountain of tests where we are specifically testing
;;; middleware or compilation behavior with just H2 since it's the default.
(def driver-keywords
#{;; core drivers
#_:h2
:postgres
:mysql
;; module drivers
:athena
:bigquery-cloud-sdk
:druid
:druid-jdbc
:googleanalytics
:mongo
:oracle
:presto-jdbc
:redshift
:snowflake
:sparksql
:sqlite
:sqlserver
:vertica})
(defn- ignore? [node error-type]
(when-let [ignores (some-> node meta :clj-kondo/ignore hooks/sexpr)]
(when-let [ignores (cond
(coll? ignores) (set ignores)
(keyword? ignores) #{ignores})]
(contains? ignores error-type))))
(defn deftest-check-no-driver-keywords [node]
;; 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)
(driver-keywords (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]}]
;; 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.
@@ -186,6 +244,7 @@
(= lang :clj))
(deftest-check-parallel node))
(deftest-check-not-horrifically-long node)
(deftest-check-no-driver-keywords node)
{:node node})
;;; this is a hacky way to determine whether these namespaces are required in the `ns` form or not... basically `:ns`
@@ -222,18 +281,9 @@
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]}]

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,20 +35,19 @@
(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}]
[{{[_ dataset & body] :children} :node this-ns :ns}]
(let [noop (constantly nil)
body (case (dataset-type dataset)
body (case (dataset-type this-ns dataset)
;; non-symbol, qualified symbols, and unqualified symbols from the current namespace/let-bound can all
;; get converted from something like
;;

View File

@@ -0,0 +1,44 @@
(ns hooks.clojure.test-test
(:require
[clj-kondo.hooks-api :as api]
[clj-kondo.impl.utils]
[clojure.java.io :as io]
[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)})
(mapv :message @(:findings clj-kondo.impl.utils/*ctx*))))
(deftest 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 check-driver-keywords-test
(testing "Make sure we keep hooks.clojure.test/driver-keywords up to date"
(doseq [^java.io.File file (.listFiles (io/file "modules/drivers"))
:when (.isDirectory file)
:let [driver (keyword (.getName file))]]
(is (contains? hooks.clojure.test/driver-keywords driver)
(format "hooks.clojure.test/driver-keywords should contain %s, please add it" driver)))))

View File

@@ -59,6 +59,7 @@
(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))

View File

@@ -78,9 +78,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",
@@ -133,6 +134,7 @@ module.exports = {
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:depend/recommended",
],
settings: {
"import/internal-regex": "^metabase/|^metabase-lib/",
@@ -160,6 +162,17 @@ module.exports = {
rules: {
"no-unconditional-metabase-links-render": "error",
"no-literal-metabase-strings": "error",
"depend/ban-dependencies": [
"error",
{
allowed: [
"underscore",
"moment",
"lodash.orderby",
"lodash.debounce",
],
},
],
},
},
{
@@ -189,7 +202,13 @@ 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",
{

View File

@@ -1,9 +1,5 @@
> [!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**
>

View File

@@ -35,6 +35,7 @@ runs:
["dashboard-cards", {} ],
["dashboard-filters", {} ],
["embedding", {} ],
["embedding-sdk", { context: "embedding-sdk" } ],
["filters", {} ],
["filters-reproductions", {}],
["joins", {} ],

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

@@ -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,27 @@ 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') }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/cache@v4
if: steps.node-modules-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile --prefer-offline
shell: bash

View File

@@ -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,7 +2,7 @@ name: Test database driver
inputs:
junit-name:
required: true
default: 'driver'
default: "driver"
test-args:
required: false
@@ -14,7 +14,7 @@ runs:
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: driver-${{ inputs.junit-name }}
m2-cache-key: driver
- name: Build static viz frontend
run: yarn build-static-viz
shell: bash
@@ -25,7 +25,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

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-backend-components
'src/metabase/db/custom_migrations.clj':
- team:core-backend-components
options:
ignore_draft: true
ignored_keywords:
- DO NOT REVIEW
- WIP
enable_group_assignment: false

View File

@@ -35,14 +35,22 @@ frontend_specs: &frontend_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 +61,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
@@ -100,6 +109,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;
}
}
}

15
.github/team.json vendored
View File

@@ -3,9 +3,9 @@
{
"name": "Querying Components",
"label": ".Team/QueryingComponents",
"projectUrl": "https://github.com/orgs/metabase/projects/97/views/1",
"members": [
"ranquild",
"uladzimirdev",
"kamilmielnik",
"nemanjaglumac",
"romeovs"
@@ -33,7 +33,7 @@
"name": "Query Processor",
"label": ".Team/QueryProcessor",
"projectUrl": "https://github.com/orgs/metabase/projects/83/views/8",
"members": ["camsaul", "snoe", "bshepherdson", "metamben", "lbrdnk"]
"members": ["camsaul", "snoe", "bshepherdson", "metamben", "lbrdnk", "appleby"]
},
{
"name": "Admin Webapp",
@@ -41,11 +41,11 @@
"members": [
"noahmoss",
"escherize",
"iethree",
"npfitz",
"johnswanson",
"rafpaf",
"sloansparger"
"sloansparger",
"iethree"
]
},
{
@@ -58,6 +58,13 @@
"kulyk",
"adam-james-v"
]
},
{
"name": "DevEx",
"label": ".Team/DevEx",
"members": [
"uladzimirdev"
]
}
]
}

View File

@@ -92,7 +92,7 @@ jobs:
if: ${{ steps.create_backport_pull_request.outputs.has-conflicts == 'false' }}
uses: peter-evans/enable-pull-request-automerge@v2
with:
token: ${{ steps.generate-token.outputs.token }}
token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
pull-request-number: ${{ steps.create_backport_pull_request.outputs.backport_pr_number }}
merge-method: squash

View File

@@ -0,0 +1,21 @@
# Config is in .github/auto_request_review.yml
name: Auto Request Review
on:
pull_request:
types: [opened, ready_for_review, reopened, synchronize]
jobs:
auto-request-review:
# Don't run on forked repos
if: ${{ !github.event.pull_request.head.repo.fork }}
permissions:
contents: read
pull-requests: write
name: Auto Request Review
runs-on: ubuntu-latest
steps:
- name: Request review based on files changes and/or groups the author belongs to
uses: necojackarc/auto-request-review@v0.13.0
with:
token: '${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}'

27
.github/workflows/backend-cloverage.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: Backend-Cloverage
on:
workflow_dispatch:
schedule:
- cron: '0 10 * * 1-5' # every weekday at 5am US eastern time
jobs:
be-linter-cloverage:
runs-on: ubuntu-22.04
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cloverage"
- name: Build static viz frontend
run: yarn build-static-viz
- name: Collect the test coverage
run: clojure -X:dev:ci:ee:ee-dev:test:cloverage
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./target/coverage/codecov.json
flags: back-end

View File

@@ -63,29 +63,6 @@ jobs:
token: ${{ github.token }}
filters: .github/static-viz-sources.yaml
be-linter-cloverage:
needs: files-changed
if: (github.ref_name == 'master' && needs.files-changed.outputs.backend_all == 'true')
|| contains(github.event.pull_request.labels.*.name, 'run-cloverage')
runs-on: ubuntu-22.04
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cloverage"
- name: Build static viz frontend
run: yarn build-static-viz
- name: Collect the test coverage
run: clojure -X:dev:ci:ee:ee-dev:test:cloverage
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./target/coverage/codecov.json
flags: back-end
be-linter-clj-kondo:
needs: [files-changed, static-viz-files-changed]
if: |

View File

@@ -107,8 +107,23 @@ jobs:
echo "PR has been merged, searching for a squashed commit in the base branch"
echo "searching for a commit in a ${ORIGINAL_BASE_REF} that contains pull request number ${ORIGINAL_PULL_REQUEST_NUMBER}"
SQUASHED_COMMIT=$(env -i git log ${ORIGINAL_BASE_REF} --grep="(#${ORIGINAL_PULL_REQUEST_NUMBER})" --format="%H")
echo "found commit ${SQUASHED_COMMIT}"
git cherry-pick ${SQUASHED_COMMIT}
if [ -n "${SQUASHED_COMMIT}" ]; then
echo "found commit ${SQUASHED_COMMIT}"
git cherry-pick ${SQUASHED_COMMIT}
else
echo "probably a PR wasn't merged with Squash And Merge button, searching again"
SQUASHED_COMMIT=$(env -i git log ${ORIGINAL_BASE_REF} --grep="#${ORIGINAL_PULL_REQUEST_NUMBER}" --format="%H")
if [ -n "${SQUASHED_COMMIT}" ]; then
echo "found commit ${SQUASHED_COMMIT}"
git cherry-pick ${SQUASHED_COMMIT}
else
echo "No squashed commit found for PR #${ORIGINAL_PULL_REQUEST_NUMBER}"
exit 1
fi
fi
else
echo "PR has not been merged, copying all commits"
git cherry-pick ${ORIGINAL_BASE_SHA}..${ORIGINAL_HEAD_SHA}

View File

@@ -17,30 +17,52 @@ jobs:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Send build start message
uses: actions/github-script@v6
uses: actions/github-script@v7
env:
SLACK_RELEASE_CHANNEL: ${{ vars.SLACK_RELEASE_CHANNEL }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
script: | # js
const { sendReleaseMessage } = require('${{ github.workspace }}/release/dist/index.cjs');
const { sendPreReleaseMessage } = require('${{ github.workspace }}/release/dist/index.cjs');
await sendReleaseMessage({
stage: 'build-start',
await sendPreReleaseMessage({
github,
owner: context.repo.owner,
repo: context.repo.repo,
version: '${{ inputs.version }}',
runId: '${{ github.run_id }}',
releaseSha: '${{ inputs.commit }}',
userName: '${{ github.actor }}',
channelName: '${{ vars.SLACK_RELEASE_CHANNEL }}',
}).catch(console.error);
trigger-milestone-check:
runs-on: ubuntu-22.04
timeout-minutes: 5
needs: start-message
steps:
- name: trigger pre-release milestone check
uses: actions/github-script@v7
with:
script: | # js
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'release-milestone-check.yml',
ref: '${{ github.ref }}',
inputs: {
commit: '${{ inputs.commit }}',
version: '${{ inputs.version }}',
}
});
check-version:
runs-on: ubuntu-22.04
timeout-minutes: 10

View File

@@ -1,80 +1,41 @@
name: Milestone Reminder
name: Automatically set milestone
run-name: Set milestone for ${{ github.event.head_commit.message }}
on:
pull_request:
types: [closed]
push:
branches:
- "master"
- release-x.**
jobs:
milestone-reminder:
if: github.event.pull_request.merged == true
name: Remind to set milestone
set-milestone:
name: Automatically set milestone
runs-on: ubuntu-22.04
timeout-minutes: 5
permissions:
pull-requests: write
issues: read
issues: write
contents: read
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
ref: master # we want the logic from master, even though we're triggering on a release branch
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- uses: actions/github-script@v7
with:
script: | # js
const { setMilestoneForCommits } = require('${{ github.workspace }}/release/dist/index.cjs');
const owner = context.repo.owner;
const repo = context.repo.repo;
const pullNumber = '${{ github.event.pull_request.number }}';
const branchName = `${{ github.ref }}`;
const commitMessage = context?.payload?.head_commit?.message ?? '';
// the github API doesn't expose linked issues, so we have to parse the body ourselves
function getLinkedIssueId(pull) {
// https://regexr.com/7sk94
const match = pull.data.body.match(/(close(s|d)?|fixe?(s|d)?|resolve(s|d)?) (#|https?:\/\/github.com\/.+\/issues\/)(\d+)/i);
return match && match?.[2];
}
function getMilestone(pullOrIssue) {
// pull has pull.data.milestone, issue has issue.milestone
return pullOrIssue?.data?.milestone || pullOrIssue?.milestone;
}
const pull = await github.rest.pulls.get({
await setMilestoneForCommits({
github,
owner,
repo,
pull_number: pullNumber,
});
if (getMilestone(pull)) {
console.log("Pull request has milestone", pull.data.milestone?.title);
process.exit(0);
}
const issueId = getLinkedIssueId(pull);
if (issueId) {
console.log('linked issue found', issueId);
const issue = await github.rest.issues.get({
owner,
repo,
issue_number: issueId,
});
const milestone = getMilestone(issue);
if (milestone) {
console.log("Linked issue has milestone", milestone.title);
process.exit(0);
}
}
console.log("No milestone found");
const author = pull.data.user.login;
const guideLink = "https://www.notion.so/metabase/Metabase-Branching-Strategy-6eb577d5f61142aa960a626d6bbdfeb3?pvs=4#3dea255ffa3b4f74942a227844e889fa";
const message = `@${author} Did you forget to add a milestone to the issue for this PR? _[When and where should I add a milestone?](${guideLink})_`;
await github.rest.issues.createComment({
owner,
repo,
issue_number: pullNumber,
body: message,
branchName,
commitMessages: [commitMessage],
});

View File

@@ -0,0 +1,42 @@
name: Conventional commit PR Title Reminder
on:
pull_request:
branches:
- master
paths:
- enterprise/frontend/src/embedding-sdk/**
jobs:
pr-title-reminder:
runs-on: ubuntu-22.04
timeout-minutes: 5
permissions:
pull-requests: write
steps:
- name: Check if the PR title is already following Conventional Commits style
uses: actions/github-script@v7
id: is-conventional-commit
with:
result-encoding: string
script: | # js
const pullRequestTitle = context.payload.pull_request.title
const conventionalCommitRegex = /^(?<type>\w+)\((?<scope>\w+)\):/
const match = pullRequestTitle.match(conventionalCommitRegex)
if (match) {
const { type, scope } = match.groups
return ['feat', 'fix', 'perf', 'docs', 'style', 'refactor', 'test', 'build', 'ci'].includes(type) && scope === 'sdk'
}
- name: Checkout repository so `gh` CLI works
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Remind PR authors to use conventional commit in the title
if: ${{ steps.is-conventional-commit.outputs.result != 'true' }}
uses: actions/github-script@v7
with:
script: |
const { updateComment } = require(".github/scripts/conventional-commit-pr-title-reminder/utils.js")
await updateComment({github, context})

View File

@@ -0,0 +1,162 @@
name: Cross-branch migration tests
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "resources/migrations/**"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
migrations-h2-ee:
runs-on: ubuntu-22.04
timeout-minutes: 5
env:
CI: 'true'
MB_DB_TYPE: h2
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cross-branch-migration-test
with:
base-ref: ${{ github.base_ref }}
migrations-postgres-12-ee:
runs-on: ubuntu-22.04
timeout-minutes: 5
env:
CI: 'true'
MB_DB_TYPE: postgres
MB_DB_PORT: 5432
MB_DB_HOST: localhost
MB_DB_DBNAME: circle_test
MB_DB_USER: circle_test
services:
postgres:
image: postgres:12-alpine
ports:
- "5432:5432"
env:
POSTGRES_USER: circle_test
POSTGRES_DB: circle_test
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cross-branch-migration-test
with:
base-ref: ${{ github.base_ref }}
migrations-postgres-latest-ee:
runs-on: ubuntu-22.04
timeout-minutes: 5
env:
CI: 'true'
MB_DB_TYPE: postgres
MB_DB_PORT: 5432
MB_DB_HOST: localhost
MB_DB_DBNAME: circle_test
MB_DB_USER: circle_test
services:
postgres:
image: circleci/postgres:latest
ports:
- "5432:5432"
env:
POSTGRES_USER: circle_test
POSTGRES_DB: circle_test
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cross-branch-migration-test
with:
base-ref: ${{ github.base_ref }}
migrations-mysql-8-0-ee:
runs-on: ubuntu-22.04
timeout-minutes: 5
env:
CI: 'true'
MB_DB_TYPE: mysql
MB_DB_HOST: localhost
MB_DB_PORT: 3306
MB_DB_DBNAME: circle_test
MB_DB_USER: root
services:
mysql:
image: cimg/mysql:8.0
ports:
- "3306:3306"
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cross-branch-migration-test
with:
base-ref: ${{ github.base_ref }}
migrations-mysql-latest-ee:
runs-on: ubuntu-22.04
timeout-minutes: 5
env:
CI: 'true'
MB_DB_TYPE: mysql
MB_DB_HOST: localhost
MB_DB_PORT: 3306
MB_DB_DBNAME: circle_test
MB_DB_USER: root
MB_MYSQL_TEST_USER: root
services:
mysql:
image: mysql:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: circle_test
ports:
- "3306:3306"
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cross-branch-migration-test
with:
base-ref: ${{ github.base_ref }}
migrations-mariadb-10-2-ee:
runs-on: ubuntu-22.04
timeout-minutes: 5
env:
CI: 'true'
MB_DB_TYPE: mysql
MB_DB_HOST: localhost
MB_DB_PORT: 3306
MB_DB_DBNAME: circle_test
MB_DB_USER: root
services:
mariadb:
image: circleci/mariadb:10.2.23
ports:
- "3306:3306"
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cross-branch-migration-test
with:
base-ref: ${{ github.base_ref }}
migrations-mariadb-latest-ee:
runs-on: ubuntu-22.04
timeout-minutes: 5
env:
CI: 'true'
MB_DB_TYPE: mysql
MB_DB_HOST: localhost
MB_DB_PORT: 3306
MB_DB_DBNAME: circle_test
MB_DB_USER: root
services:
mariadb:
image: circleci/mariadb:latest
ports:
- "3306:3306"
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/cross-branch-migration-test
with:
base-ref: ${{ github.base_ref }}

View File

@@ -40,6 +40,9 @@ jobs:
MB_ATHENA_TEST_ACCESS_KEY: ${{ secrets.MB_ATHENA_TEST_ACCESS_KEY }}
MB_ATHENA_TEST_SECRET_KEY: ${{ secrets.MB_ATHENA_TEST_SECRET_KEY }}
MB_ATHENA_TEST_S3_STAGING_DIR: ${{ secrets.MB_ATHENA_TEST_S3_STAGING_DIR }}
# These credentials are used to test the driver when the user does not have the athena:GetTableMetadata permission
MB_ATHENA_TEST_WITHOUT_GET_TABLE_METADATA_ACCESS_KEY: ${{ secrets.MB_ATHENA_TEST_WITHOUT_GET_TABLE_METADATA_ACCESS_KEY }}
MB_ATHENA_TEST_WITHOUT_GET_TABLE_METADATA_SECRET_KEY: ${{ secrets.MB_ATHENA_TEST_WITHOUT_GET_TABLE_METADATA_SECRET_KEY }}
steps:
- uses: actions/checkout@v4
- name: Test Athena driver
@@ -806,6 +809,11 @@ jobs:
MB_SNOWFLAKE_TEST_WAREHOUSE: ${{ secrets.MB_SNOWFLAKE_TEST_WAREHOUSE }}
MB_SNOWFLAKE_TEST_PK_USER: METABASE PK
MB_SNOWFLAKE_TEST_PK_PRIVATE_KEY: ${{ secrets.MB_SNOWFLAKE_TEST_PK_PRIVATE_KEY }}
# RSA Role testing:
MB_SNOWFLAKE_TEST_RSA_ROLE_TEST_DEFAULT_USER: RSA_ROLE_TEST_DEFAULT_USER
MB_SNOWFLAKE_TEST_RSA_ROLE_TEST_CUSTOM_USER: RSA_ROLE_TEST_CUSTOM_USER
MB_SNOWFLAKE_TEST_RSA_ROLE_TEST_ROLE: RSA_ROLE_TEST_ROLE
MB_SNOWFLAKE_TEST_RSA_ROLE_TEST_DB: RSA_ROLE_TEST_DB
steps:
- uses: actions/checkout@v4
- name: Test Snowflake driver

View File

@@ -2,12 +2,31 @@ name: E2E Cross-version Tests
on:
schedule:
- cron: '0 9 * * 0'
- cron: '0 9 * * 1-5'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
cross-version-testing:
files-changed:
name: Check which files changed
runs-on: ubuntu-22.04
timeout-minutes: 60
timeout-minutes: 3
outputs:
e2e_cross_version: ${{ steps.changes.outputs.e2e_cross_version }}
steps:
- uses: actions/checkout@v4
- name: Test which files changed
uses: dorny/paths-filter@v3.0.0
id: changes
with:
token: ${{ github.token }}
filters: .github/file-paths.yaml
cross-version-testing:
needs: files-changed
if: ${{ needs.files-changed.outputs.e2e_cross_version == 'true' || github.event_name == 'schedule'}}
runs-on: ubuntu-22.04
timeout-minutes: 20
strategy:
matrix:
version: [
@@ -52,11 +71,12 @@ jobs:
- name: Wait for Metabase to start on port 3000
run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
- name: Prepare Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
- name: Run Cypress on the source
run: |
yarn cypress run \
--browser chrome \
--browser ${{ steps.cypress-prep.outputs.chrome-path }} \
--config-file e2e/test/scenarios/cross-version/source/shared/cross-version-source.config.js \
--spec e2e/test/scenarios/cross-version/source/**/*.cy.spec.js
- name: Stop Metabase ${{ matrix.version.source }}
@@ -84,7 +104,7 @@ jobs:
- name: Run Cypress on the target
run: |
yarn cypress run \
--browser chrome \
--browser ${{ steps.cypress-prep.outputs.chrome-path }} \
--config-file e2e/test/scenarios/cross-version/target/shared/cross-version-target.config.js \
--spec e2e/test/scenarios/cross-version/target/**/*.cy.spec.js
- name: Upload Cypress Artifacts upon failure
@@ -97,20 +117,11 @@ jobs:
if-no-files-found: ignore
notify-on-failure:
needs: cross-version-testing
if: ${{ always() && contains(needs.*.result, 'failure') }}
if: ${{ always() && contains(needs.*.result, 'failure') && github.event_name == 'schedule' }}
name: Cross-version test failure
runs-on: ubuntu-22.04
env:
BRANCH_NAME: ${{ github.event.workflow_run.head_branch }}
AUTHOR_NAME: ${{ github.event.workflow_run.head_commit.author.name }}
timeout-minutes: 5
steps:
- name: Generate job summary
run: |
echo "# ${{ github.event.workflow_run.name }} workflow failed! :x:" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "View the failed run attempt (#${{ github.event.workflow_run.run_attempt }}) using the following link:" >> $GITHUB_STEP_SUMMARY
echo "${{ github.event.workflow_run.html_url }}" >> $GITHUB_STEP_SUMMARY
- uses: actions/setup-node@v4
with:
node-version: lts/Hydrogen # 18.x.x
@@ -119,11 +130,8 @@ jobs:
uses: actions/github-script@v7
with:
script: | # js
const FAILED_RUN_URL = "${{ github.event.workflow_run.html_url }}";
const FAILED_RUN_NAME = "${{ github.event.workflow_run.name }}";
const BREAKING_COMMIT = "${{ github.event.workflow_run.head_sha }}";
const AUTHOR = process.env.AUTHOR_NAME;
const BRANCH = process.env.BRANCH_NAME;
const FAILED_RUN_URL = "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}";
const REF_NAME = "${{ github.ref_name }}";
// notify slack of failure
const { WebClient } = require('@slack/web-api');
@@ -137,7 +145,7 @@ jobs:
"type": "header",
"text": {
"type": "plain_text",
"text": `:broken_heart: Cross-version tests are failing on ${BRANCH}`,
"text": `:broken_heart: Cross-version tests are failing on ${REF_NAME}`,
"emoji": true,
}
},
@@ -149,7 +157,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": `Commit <https://github.com/metabase/metabase/commit/${BREAKING_COMMIT}|${BREAKING_COMMIT.slice(0,7)}> has failing <${FAILED_RUN_URL}|${FAILED_RUN_NAME}> tests on the <https://github.com/metabase/metabase/commits/${BRANCH}|\`${BRANCH}\`> branch.`
"text": `See <${FAILED_RUN_URL}|failing run details>.`
}
},
]

View File

@@ -20,6 +20,15 @@ on:
type: string
required: false
default: "ee"
qa_db:
description: 'Select the type of Database you want to run your tests with'
type: choice
required: true
default: "none"
options:
- none
- sql
- mongo
jobs:
workflow-summary:
@@ -35,6 +44,7 @@ jobs:
echo '- `spec`: ${{ inputs.spec }}' >> $GITHUB_STEP_SUMMARY
echo '- `burn_in`: ${{ inputs.burn_in }}' >> $GITHUB_STEP_SUMMARY
echo '- `grep`: "${{ inputs.grep }}"' >> $GITHUB_STEP_SUMMARY
echo '- `qa_db`: "${{ inputs.qa_db }}"' >> $GITHUB_STEP_SUMMARY
echo '' >> $GITHUB_STEP_SUMMARY
echo 'triggered by: @${{ github.event.sender.login }}' >> $GITHUB_STEP_SUMMARY
@@ -44,9 +54,8 @@ jobs:
name: Stress test E2E flake fix
env:
DISPLAY: ""
QA_DB_ENABLED: true
CYPRESS_QA_DB_MONGO: true
CYPRESS_REPLAYIO_ENABLED: 1
QA_DB_ENABLED: ${{ contains(fromJSON('["sql", "mongo"]'), inputs.qa_db) }}
CYPRESS_QA_DB_MONGO: ${{ inputs.qa_db == 'mongo' }}
CYPRESS_ALL_FEATURES_TOKEN: ${{ secrets.ENTERPRISE_TOKEN }}
CYPRESS_NO_FEATURES_TOKEN: ${{ secrets.E2E_STARTER_TOKEN }}
MB_SNOWPLOW_AVAILABLE: true
@@ -67,9 +76,9 @@ jobs:
password: ${{ secrets.DOCKERHUB_TOKEN }}
maildev: true
openldap: true
postgres: true
mysql: true
mongo: true
postgres: ${{ inputs.qa_db == 'sql' }}
mysql: ${{ inputs.qa_db == 'sql' }}
mongo: ${{ inputs.qa_db == 'mongo' }}
- name: Download Metabase ${{ matrix.edition }} uberjar
uses: ./.github/actions/e2e-download-uberjar
@@ -84,6 +93,7 @@ jobs:
java-version: 11
distribution: "temurin"
- name: Prepare Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
- name: Run Snowplow micro
uses: ./.github/actions/run-snowplow-micro
@@ -96,7 +106,7 @@ jobs:
--spec '${{ github.event.inputs.spec }}' \
--env burn=${{ github.event.inputs.burn_in }},grep='${{ github.event.inputs.grep }}' \
--config-file e2e/support/cypress-stress-test.config.js \
--browser 'replay-chromium'
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Upload Cypress Artifacts upon failure
uses: actions/upload-artifact@v4

View File

@@ -39,8 +39,39 @@ jobs:
id: e2e-matrix
uses: ./.github/actions/build-e2e-matrix
# if this is a test on a release branch, we need to check the build requirements
get-build-requirements:
if: |
!cancelled() &&
contains(github.ref, 'release-x')
runs-on: ubuntu-22.04
timeout-minutes: 10
outputs:
java_version: ${{ fromJson(steps.dependencies.outputs.result).java_version }}
node_version: ${{ fromJson(steps.dependencies.outputs.result).node_version }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Get build dependencies
uses: actions/github-script@v7
id: dependencies
with:
script: | # js
const { getBuildRequirements, getVersionFromReleaseBranch } = require('${{ github.workspace }}/release/dist/index.cjs');
const version = getVersionFromReleaseBranch('${{ github.ref }}');
const requirements = getBuildRequirements(version);
return {
java_version: requirements.java,
node_version: requirements.node,
};
build:
needs: [files-changed, e2e-matrix-builder]
needs: [files-changed, e2e-matrix-builder, get-build-requirements]
if: |
!cancelled() &&
github.event.pull_request.draft == false &&
@@ -54,14 +85,19 @@ jobs:
env:
MB_EDITION: ${{ matrix.edition }}
INTERACTIVE: false
# make sure that builds on release branches get licenses, because we use them for releases
SKIP_LICENSES: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
with:
node-version: "${{ needs.get-build-requirements.outputs.node_version }}"
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: e2e-tests
m2-cache-key: uberjar
java-version: "${{ needs.get-build-requirements.outputs.java_version || 11 }}"
- name: Build uberjar with ./bin/build.sh
run: ./bin/build.sh
@@ -90,11 +126,6 @@ jobs:
COMMIT_INFO_MESSAGE: ${{ github.event.pull_request.title || github.event.head_commit.message || github.even.head.sha }}
MB_SNOWPLOW_AVAILABLE: true
MB_SNOWPLOW_URL: "http://localhost:9090" # Snowplow micro
CYPRESS_REPLAYIO_ENABLED: 1
CYPRESS_REPLAYIO_ENABLE_UPLOAD: 1
RECORD_REPLAY_METADATA_FILE: /tmp/replay-metadata.json
RECORD_REPLAY_METADATA_TEST_RUN_ID: ${{ github.run_id }}
REPLAY_API_KEY: ${{ secrets.REPLAY_IO_TOKEN }}
TZ: US/Pacific # to make node match the instance tz
strategy:
fail-fast: false
@@ -134,6 +165,7 @@ jobs:
distribution: "temurin"
- name: Prepare Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
- name: Run Snowplow micro
@@ -145,7 +177,7 @@ jobs:
yarn run test-cypress-run \
--env grepTags=@OSS,grepOmitFiltered=true \
--spec './e2e/test/scenarios/**/*.cy.spec.(js|ts)' \
--browser 'replay-chromium'
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run slow and resource-intensive Cypress tests
if: matrix.name == 'slow' && github.event_name != 'schedule'
@@ -153,7 +185,7 @@ jobs:
yarn run test-cypress-run \
--env grepTags="@slow",grepOmitFiltered=true \
--spec './e2e/test/scenarios/**/*.cy.spec.(js|ts)' \
--browser 'replay-chromium'
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run Flaky Cypress tests
if: matrix.name == 'flaky' && github.event_name != 'schedule'
@@ -161,7 +193,7 @@ jobs:
yarn run test-cypress-run \
--env grepTags="@flaky --@quarantine",grepOmitFiltered=true \
--spec './e2e/test/scenarios/**/*.cy.spec.(js|ts)' \
--browser 'replay-chromium'
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run EE Cypress tests on ${{ matrix.name }}
if: matrix.context == 'folder' && github.event_name != 'schedule'
@@ -169,7 +201,7 @@ jobs:
yarn run test-cypress-run \
--env grepTags="-@slow+-@mongo+-@flaky --@quarantine",grepOmitFiltered=true \
--folder ${{ matrix.name }} \
--browser 'replay-chromium'
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Run E2E tests that depend on Mongo
if: matrix.name == 'mongo'
@@ -177,10 +209,25 @@ jobs:
yarn run test-cypress-run \
--env grepTags="@mongo --@quarantine",grepOmitFiltered=true \
--spec './e2e/test/scenarios/**/*.cy.spec.(js|ts)' \
--browser 'replay-chromium'
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
env:
CYPRESS_QA_DB_MONGO: true
- name: Run Embedding SDK Storybook
if: matrix.context == 'embedding-sdk' && github.event_name != 'schedule'
uses: ./.github/actions/run-embedding-sdk-storybook
- name: Run E2E tests for Embedding SDK
if: matrix.context == 'embedding-sdk' && github.event_name != 'schedule'
run: |
yarn run test-cypress-run \
--env grepTags="-@slow+-@flaky --@quarantine",grepOmitFiltered=true \
--folder 'embedding-sdk' \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
env:
CYPRESS_IS_EMBEDDING_SDK: true
shell: bash
- name: Upload Test Results
uses: ./.github/actions/upload-test-results
if: always()
@@ -217,3 +264,11 @@ jobs:
steps:
- run: |
echo "Didn't run due to conditional filtering"
pr-env:
needs: [build]
if: |
!cancelled() &&
contains(github.event.pull_request.labels.*.name, 'PR-Env')
uses: ./.github/workflows/pr-env.yml
secrets: inherit

View File

@@ -0,0 +1,34 @@
name: Flake Issue Creator
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * 1-5' # every weekday at 1am US eastern time
jobs:
flake-issue-creator:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn --frozen-lockfile && yarn build
- name: Update flake issues
uses: actions/github-script@v7
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
script: | # js
const { updateFlakeIssues } = require('${{ github.workspace }}/release/dist/index.cjs');
if (!process.env.SLACK_BOT_TOKEN) {
throw new Error('SLACK_BOT_TOKEN is required');
}
await updateFlakeIssues({
github,
owner: context.repo.owner,
repo: context.repo.repo,
});

35
.github/workflows/flake-status.yml vendored Normal file
View File

@@ -0,0 +1,35 @@
name: Flake Status Report
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * 2,5' # Tuesdays and Fridays at 1am US eastern time
jobs:
flake-status-report:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn --frozen-lockfile && yarn build
- name: Post Flake Status Report
uses: actions/github-script@v7
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
script: | # js
const { summarizeFlakes } = require('${{ github.workspace }}/release/dist/index.cjs');
if (!process.env.SLACK_BOT_TOKEN) {
throw new Error('SLACK_BOT_TOKEN is required');
}
await summarizeFlakes({
github,
owner: context.repo.owner,
repo: context.repo.repo,
channelName: 'engineering-ci'
});

View File

@@ -4,15 +4,15 @@ on:
workflow_dispatch:
inputs:
spec:
description: 'Relative path of the target spec'
description: "Relative path of the target spec"
type: string
required: true
burn_in:
description: 'Number of times to run the test (e.g. 20)'
description: "Number of times to run the test (e.g. 20)"
type: string
required: true
grep:
description: 'Grep and filter tests to run in isolation'
description: "Grep and filter tests to run in isolation"
type: string
required: false
@@ -45,10 +45,12 @@ jobs:
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- name: Build cljs
run: yarn build:cljs
- name: Stress-test ${{ github.event.inputs.spec }} ${{ github.event.inputs.burn_in }} times
run: |
for i in {1..${{ github.event.inputs.burn_in }}}; do
yarn test-unit \
yarn jest --runInBand --ci --silent --no-cache \
--testPathPattern '${{ github.event.inputs.spec }}' \
--testNamePattern '${{ github.event.inputs.grep }}'
if [[ "$?" != 0 ]]; then

View File

@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
ref: ${{ github.head_ref }}
@@ -27,7 +27,9 @@ jobs:
run: yarn build-pure:cljs
- name: Build Storybook
run: yarn build-storybook
# We won't be able to use Storybook play's `userEvent` with production build
# see https://github.com/storybookjs/storybook/issues/19758
run: NODE_ENV=development yarn build-storybook
- name: Serve Storybook
run: yarn http-server storybook-static -p 6006 &
@@ -55,7 +57,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Remove 'loki-update' label
uses: actions/github-script@v3
uses: actions/github-script@v7
with:
github-token: ${{secrets.METABASE_AUTOMATION_USER_TOKEN}}
script: |

View File

@@ -3,7 +3,26 @@ name: Loki Visual Regression Testing
on: [pull_request]
jobs:
files-changed:
name: Check which files changed
runs-on: ubuntu-22.04
timeout-minutes: 3
outputs:
frontend_ci: ${{ steps.changes.outputs.frontend_ci }}
frontend_sources: ${{ steps.changes.outputs.frontend_sources }}
frontend_loki_ci: ${{ steps.changes.outputs.frontend_loki_ci }}
steps:
- uses: actions/checkout@v4
- name: Test which files changed
uses: dorny/paths-filter@v3.0.0
id: changes
with:
token: ${{ github.token }}
filters: .github/file-paths.yaml
visual-test:
needs: files-changed
if: needs.files-changed.outputs.frontend_ci == 'true' || needs.files-changed.outputs.frontend_sources == 'true' || needs.files-changed.outputs.frontend_loki_ci == 'true'
runs-on: ubuntu-latest
services:
docker:
@@ -19,7 +38,7 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Prepare frontend environment
uses: ./.github/actions/prepare-frontend
@@ -33,7 +52,9 @@ jobs:
run: yarn build-pure:cljs
- name: Build Storybook
run: yarn build-storybook
# We won't be able to use Storybook play's `userEvent` with production build
# see https://github.com/storybookjs/storybook/issues/19758
run: NODE_ENV=development yarn build-storybook
- name: Serve Storybook
run: yarn http-server storybook-static -p 6006 &
@@ -50,7 +71,7 @@ jobs:
- name: Run Loki Visual Tests
run: |
yarn loki test
yarn test-visual:loki
- name: Generate Visual Report on Failure
if: failure()

View File

@@ -1,4 +1,4 @@
name: Migrations
name: Lint migrations
on:
push:
@@ -9,14 +9,14 @@ on:
jobs:
check-migrations:
lint-migrations:
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: check-migrations
- name: Verify Liquibase Migrations
run: ./bin/lint-migrations-file.sh
- uses: actions/checkout@v4
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: lint-migrations
- name: Verify Liquibase Migrations
run: ./bin/lint-migrations-file.sh

17
.github/workflows/perf-test-labeled.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: Perf test command
on:
pull_request:
types: [ labeled ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run-perf-test:
if: ${{ github.event.label.name == 'Run-perf' }}
uses: ./.github/workflows/perf-test.yml
with:
wait_for_uberjar: true
secrets: inherit

150
.github/workflows/perf-test.yml vendored Normal file
View File

@@ -0,0 +1,150 @@
name: CI for Perf tests
run-name: Run perf test for ${{ github.ref_name }} by @${{ github.actor }}
on:
workflow_call:
inputs:
wait_for_uberjar:
description: "Wait for uberjar build"
required: false
type: boolean
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository
name: Build Metabase Docker image
timeout-minutes: 60
permissions:
id-token: write
contents: read
actions: read
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.PR_ENV_IAM_ROLE }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: us-east-1
- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
with:
registries: "${{ secrets.PR_ENV_AWS_ACCOUNT_ID }}"
- name: Wait for uberjar
id: wait_for_uberjar
if: ${{ inputs.wait_for_uberjar == true }}
run: |
## Get workflow run id for uberjar build
curl -Ls --output e2e-tests.json \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/actions/workflows/e2e-tests.yml/runs?head_sha=${{ github.event.pull_request.head.sha || github.sha }}
ID=$(jq -r '.workflow_runs[0].id' e2e-tests.json)
## Wait for uberjar build to complete
while [ true ]; do
curl -Ls --output uberjar.json \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/actions/runs/${ID}/jobs?filter=latest
jq -r '.jobs[] | select(.name == "build (ee)") | .steps[] | select(.name == "Prepare uberjar artifact") | .status' uberjar.json | grep -q "completed" && break
echo "Waiting for uberjar build..."
sleep 10
done
echo "run_id=$(jq -r '.workflow_runs[0].id' e2e-tests.json)" >> $GITHUB_OUTPUT
- name: Retrieve uberjar artifact for ee
uses: actions/download-artifact@v4
with:
name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ inputs.wait_for_uberjar && steps.wait_for_uberjar.outputs.run_id || github.run_id }}
- name: Move uberjar to bin/docker
run: |
jar xf target/uberjar/metabase.jar
mv target/uberjar/metabase.jar bin/docker/metabase.jar
- name: Build container
uses: docker/build-push-action@v6
with:
context: bin/docker/
platforms: linux/amd64
network: host
tags: ${{ secrets.PR_ENV_AWS_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com/metabase-enterprise:pr${{ github.event.number }}
push: true
launch_perf_test:
needs: [ build ]
runs-on: ubuntu-latest
name: Launch Perf Test
permissions:
id-token: write
contents: read
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.PR_ENV_TAILSCALE_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.PR_ENV_TAILSCALE_OAUTH_SECRET }}
tags: tag:ci
version: 1.50.1
sha256sum: d9fe6b480fb5078f0aa57dace686898dda7e2a768884271159faa74846bfb576
- name: Create OIDC Token
id: create-oidc-token
shell: bash
run: |
export OIDC_URL_WITH_AUDIENCE="$ACTIONS_ID_TOKEN_REQUEST_URL&audience=${{ secrets.PR_ENV_K8S_AUDIENCE }}"
IDTOKEN=$(curl -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" -H "Accept: application/json; api-version=2.0" "$OIDC_URL_WITH_AUDIENCE" | jq -r .value)
echo "::add-mask::${IDTOKEN}"
echo "idToken=${IDTOKEN}" >>$GITHUB_OUTPUT
- name: Setup Kube Context
uses: azure/k8s-set-context@v2
with:
method: kubeconfig
kubeconfig: |
kind: Config
apiVersion: v1
current-context: default
clusters:
- name: default
cluster:
certificate-authority-data: ${{ secrets.PR_ENV_K8S_CERTIFICATE_AUTHORITY_DATA }}
server: ${{ secrets.PR_ENV_K8S_SERVER }}
users:
- name: oidc-token
user:
token: ${{ steps.create-oidc-token.outputs.IDTOKEN }}
contexts:
- name: default
context:
cluster: default
namespace: default
user: oidc-token
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.PR_ENV_IAM_ROLE }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: us-east-1
- name: Download Deployment YAML template
run: aws s3 cp s3://metabase-pr-env/perf-test-pr.yml.tmpl ./perf-test-pr.yml.tmpl
- name: Trim SHA
env:
SHA: ${{ github.event.pull_request.head.sha || github.sha }}
id: split
run: echo "::set-output name=fragment::${SHA:5}"
- name: Render Deployment YAML
uses: nowactions/envsubst@v1
with:
input: ./perf-test-pr.yml.tmpl
output: ./perf-test-pr.yml
env:
IMAGE_TAG: pr${{ github.event.number }}
PR_NUMBER: ${{ github.event.number }}
RUN_ID: ${{ steps.split.outputs.fragment }}
SHA: ${{ github.event.pull_request.head.sha || github.sha }}
TEST_NAME: test
- name: Deploy PR Review ENV
run: |
kubectl apply -f ./perf-test-pr.yml

View File

@@ -0,0 +1,15 @@
name: PR Closed or Unlabeled
on:
pull_request:
types: [ closed, unlabeled ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pr-env:
if: ${{ github.event.action == 'closed' && contains(github.event.pull_request.labels.*.name, 'PR-Env') || github.event.label.name == 'PR-Env' }}
uses: ./.github/workflows/pr-env-destroy.yml
secrets: inherit

71
.github/workflows/pr-env-destroy.yml vendored Normal file
View File

@@ -0,0 +1,71 @@
name: CI for PR Review ENV Destroy
run-name: Destroying Dynamic PR Environment for ${{ github.ref_name }} by @${{ github.actor }}
on:
workflow_call:
jobs:
destroy_pr:
runs-on: ubuntu-latest
name: PR Review ENV Destroy
permissions:
id-token: write
contents: read
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.PR_ENV_TAILSCALE_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.PR_ENV_TAILSCALE_OAUTH_SECRET }}
tags: tag:ci
version: 1.50.1
sha256sum: d9fe6b480fb5078f0aa57dace686898dda7e2a768884271159faa74846bfb576
- name: Create OIDC Token
id: create-oidc-token
shell: bash
run: |
export OIDC_URL_WITH_AUDIENCE="$ACTIONS_ID_TOKEN_REQUEST_URL&audience=${{ secrets.PR_ENV_K8S_AUDIENCE }}"
IDTOKEN=$(curl -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" -H "Accept: application/json; api-version=2.0" "$OIDC_URL_WITH_AUDIENCE" | jq -r .value)
echo "::add-mask::${IDTOKEN}"
echo "idToken=${IDTOKEN}" >>$GITHUB_OUTPUT
- name: Setup Kube Context
uses: azure/k8s-set-context@v2
with:
method: kubeconfig
kubeconfig: |
kind: Config
apiVersion: v1
current-context: default
clusters:
- name: default
cluster:
certificate-authority-data: ${{ secrets.PR_ENV_K8S_CERTIFICATE_AUTHORITY_DATA }}
server: ${{ secrets.PR_ENV_K8S_SERVER }}
users:
- name: oidc-token
user:
token: ${{ steps.create-oidc-token.outputs.IDTOKEN }}
contexts:
- name: default
context:
cluster: default
namespace: default
user: oidc-token
- name: Destroy PR Review ENV
run: |
kubectl delete metabase -n hosting-pr${{ github.event.number }} hosting-pr${{ github.event.number }}
kubectl delete ns hosting-pr${{ github.event.number }}
- name: Setup psql client
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client
- name: Drop app database if exists
run: |
PGPASSWORD='${{ secrets.PR_ENV_DB_PASSWORD }}' \
psql \
-h ${{ secrets.PR_ENV_DB_HOST }} \
-U ${{ secrets.PR_ENV_DB_USER }} \
-d ${{ secrets.PR_ENV_DB_NAME }} \
-c "DROP DATABASE IF EXISTS hosting_pr${{ github.event.number }};"

17
.github/workflows/pr-env-labeled.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: PR-Env labeled
on:
pull_request:
types: [ labeled ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pr-env:
if: ${{ github.event.label.name == 'PR-Env' }}
uses: ./.github/workflows/pr-env.yml
with:
wait_for_uberjar: true
secrets: inherit

169
.github/workflows/pr-env.yml vendored Normal file
View File

@@ -0,0 +1,169 @@
name: CI for PR Review ENV
run-name: Building Dynamic PR Environment for ${{ github.ref_name }} by @${{ github.actor }}
on:
workflow_call:
inputs:
wait_for_uberjar:
description: "Wait for uberjar build"
required: false
type: boolean
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == github.repository
name: Build Metabase Docker image
timeout-minutes: 60
permissions:
id-token: write
contents: read
actions: read
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.PR_ENV_IAM_ROLE }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: us-east-1
- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
with:
registries: "${{ secrets.PR_ENV_AWS_ACCOUNT_ID }}"
- name: Wait for uberjar
id: wait_for_uberjar
if: ${{ inputs.wait_for_uberjar == true }}
run: |
## Get workflow run id for uberjar build
curl -Ls --output e2e-tests.json \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/actions/workflows/e2e-tests.yml/runs?head_sha=${{ github.event.pull_request.head.sha || github.sha }}
ID=$(jq -r '.workflow_runs[0].id' e2e-tests.json)
## Wait for uberjar build to complete
while [ true ]; do
curl -Ls --output uberjar.json \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/actions/runs/${ID}/jobs?filter=latest
jq -r '.jobs[] | select(.name == "build (ee)") | .steps[] | select(.name == "Prepare uberjar artifact") | .status' uberjar.json | grep -q "completed" && break
echo "Waiting for uberjar build..."
sleep 10
done
echo "run_id=$(jq -r '.workflow_runs[0].id' e2e-tests.json)" >> $GITHUB_OUTPUT
- name: Retrieve uberjar artifact for ee
uses: actions/download-artifact@v4
with:
name: metabase-ee-${{ github.event.pull_request.head.sha || github.sha }}-uberjar
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ inputs.wait_for_uberjar && steps.wait_for_uberjar.outputs.run_id || github.run_id }}
- name: Move uberjar to bin/docker
run: |
jar xf target/uberjar/metabase.jar
mv target/uberjar/metabase.jar bin/docker/metabase.jar
- name: Build container
uses: docker/build-push-action@v6
with:
context: bin/docker/
platforms: linux/amd64
network: host
tags: ${{ secrets.PR_ENV_AWS_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com/metabase-enterprise:pr${{ github.event.number }}
push: true
deploy_pr:
needs: [ build ]
runs-on: ubuntu-latest
name: PR Review ENV
permissions:
id-token: write
contents: read
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.PR_ENV_TAILSCALE_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.PR_ENV_TAILSCALE_OAUTH_SECRET }}
tags: tag:ci
version: 1.50.1
sha256sum: d9fe6b480fb5078f0aa57dace686898dda7e2a768884271159faa74846bfb576
- name: Create OIDC Token
id: create-oidc-token
shell: bash
run: |
export OIDC_URL_WITH_AUDIENCE="$ACTIONS_ID_TOKEN_REQUEST_URL&audience=${{ secrets.PR_ENV_K8S_AUDIENCE }}"
IDTOKEN=$(curl -H "Authorization: Bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" -H "Accept: application/json; api-version=2.0" "$OIDC_URL_WITH_AUDIENCE" | jq -r .value)
echo "::add-mask::${IDTOKEN}"
echo "idToken=${IDTOKEN}" >>$GITHUB_OUTPUT
- name: Setup Kube Context
uses: azure/k8s-set-context@v2
with:
method: kubeconfig
kubeconfig: |
kind: Config
apiVersion: v1
current-context: default
clusters:
- name: default
cluster:
certificate-authority-data: ${{ secrets.PR_ENV_K8S_CERTIFICATE_AUTHORITY_DATA }}
server: ${{ secrets.PR_ENV_K8S_SERVER }}
users:
- name: oidc-token
user:
token: ${{ steps.create-oidc-token.outputs.IDTOKEN }}
contexts:
- name: default
context:
cluster: default
namespace: default
user: oidc-token
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.PR_ENV_IAM_ROLE }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: us-east-1
- name: Setup psql client
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client
- name: Create app database if not exists
run: |
export PGPASSWORD='${{ secrets.PR_ENV_DB_PASSWORD }}'
export PGUSER=${{ secrets.PR_ENV_DB_USER }}
export PGHOST=${{ secrets.PR_ENV_DB_HOST }}
export PGDATABASE=${{ secrets.PR_ENV_DB_NAME }}
psql -tc "SELECT 1 FROM pg_database WHERE datname = 'hosting_pr${{ github.event.number }}'" \
| grep -q 1 \
|| psql -c "CREATE DATABASE hosting_pr${{ github.event.number }}"
- name: Download Deployment YAML template
run: aws s3 cp s3://metabase-pr-env/metabase.yml.tmpl ./metabase.yml.tmpl
- name: Render Deployment YAML
uses: nowactions/envsubst@v1
with:
input: ./metabase.yml.tmpl
output: ./metabase.yml
env:
IMAGE_TAG: pr${{ github.event.number }}
PR_NUMBER: ${{ github.event.number }}
MB_PREMIUM_EMBEDDING_TOKEN: ${{ secrets.PR_ENV_MB_PREMIUM_EMBEDDING_TOKEN }}
SHA: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Deploy PR Review ENV
run: |
kubectl apply -f ./metabase.yml
preview_links:
runs-on: ubuntu-latest
needs: [ deploy_pr ]
steps:
- uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
message: |
👋 Deploying a preview environment for commit ${{ github.event.pull_request.head.sha || github.sha }}.
✅ Preview:
https://pr${{ github.event.number }}.coredev.metabase.com
🗒️ [login instructions](https://www.notion.so/metabase/Ephemeral-PR-Environments-c74a3710c87a460dbf4fc0007a001458)

View File

@@ -11,6 +11,10 @@ on:
commit:
description: "A full-length commit SHA-1 hash"
required: true
auto:
description: 'auto-patch release DO NOT SET MANUALLY'
type: boolean
default: false
jobs:
release-artifact:
@@ -110,37 +114,32 @@ jobs:
run-sanity-check:
runs-on: ubuntu-22.04
timeout-minutes: 30
needs: [release-artifact, check-uberjar-health]
needs: [release-artifact]
strategy:
matrix:
edition: [oss, ee]
folder: [onboarding, search]
env:
MB_EDITION: ${{ matrix.edition }}
DISPLAY: ""
CYPRESS_ALL_FEATURES_TOKEN: ${{ secrets.ENTERPRISE_TOKEN }}
CYPRESS_NO_FEATURES_TOKEN: ${{ secrets.E2E_STARTER_TOKEN }}
CYPRESS_REPLAYIO_ENABLED: 1
# disabled because of out of memory issues
# probably related to https://github.com/cypress-io/cypress/issues/27415
CYPRESS_NO_COMMAND_LOG: 1
MB_SNOWPLOW_AVAILABLE: true
MB_SNOWPLOW_URL: "http://localhost:9090" # Snowplow micro
TERM: xterm
services:
maildev:
image: maildev/maildev:2.0.5
ports:
- "1080:1080"
- "1025:1025"
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
- name: Check out the code
uses: actions/checkout@v4
with:
ref: ${{ needs.release-artifact.outputs.commit }}
- name: Prepare Docker containers
uses: ./.github/actions/e2e-prepare-containers
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
maildev: true
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare JDK 11
@@ -149,6 +148,7 @@ jobs:
java-version: 11
distribution: "temurin"
- name: Prepare Cypress environment
id: cypress-prep
uses: ./.github/actions/prepare-cypress
- name: Run Snowplow micro
uses: ./.github/actions/run-snowplow-micro
@@ -163,7 +163,10 @@ jobs:
- name: Run a few important Cypress tests as sanity check
run: |
mkdir -p ./target/uberjar && cp metabase.jar ./target/uberjar/metabase.jar
yarn test-cypress-run --folder ${{ matrix.folder }}
yarn test-cypress-run \
--env grepTags="@smoke",grepOmitFiltered=true \
--spec './e2e/test/scenarios/**/*.cy.spec.(js|ts)' \
--browser ${{ steps.cypress-prep.outputs.chrome-path }}
- name: Upload Cypress Artifacts upon failure
uses: actions/upload-artifact@v4
@@ -176,7 +179,7 @@ jobs:
if-no-files-found: ignore
containerize:
needs: [release-artifact, run-sanity-check]
needs: [release-artifact]
runs-on: ubuntu-22.04
timeout-minutes: 15
strategy:
@@ -285,3 +288,61 @@ jobs:
- name: Wait for Metabase to start
run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
timeout-minutes: 3
trigger-auto-publish:
if: ${{ inputs.auto }}
needs: [run-sanity-check, check-uberjar-health, verify-docker-pull]
permissions:
actions: write
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: trigger auto publish
uses: actions/github-script@v7
with:
script: | # js
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'release.yml',
ref: '${{ github.ref }}',
inputs: {
commit: '${{ inputs.commit }}',
version: '${{ inputs.version }}',
auto: true,
}
});
tests-complete-message:
if: always()
runs-on: ubuntu-22.04
needs: [run-sanity-check, check-uberjar-health, verify-docker-pull]
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Send tests complete message
uses: actions/github-script@v7
env:
SLACK_RELEASE_CHANNEL: ${{ vars.SLACK_RELEASE_CHANNEL }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
script: | # js
const { sendTestsCompleteMessage } = require('${{ github.workspace }}/release/dist/index.cjs');
const allJobsSuccessful =
'${{ needs.run-sanity-check.result }}' === 'success' &&
'${{ needs.check-uberjar-health.result }}' === 'success' &&
'${{ needs.verify-docker-pull.result }}' === 'success';
await sendTestsCompleteMessage({
owner: context.repo.owner,
repo: context.repo.repo,
version: '${{ inputs.version }}',
runId: '${{ github.run_id }}',
channelName: '${{ vars.SLACK_RELEASE_CHANNEL }}',
testStatus: allJobsSuccessful ? 'success' : 'failure',
}).catch(console.error);

View File

@@ -1,3 +1,8 @@
# this file uses MBA https://github.com/metabase/mba to spin up a Metabase
# instance then runs the test script in the MBA instance sharing the same
# network to interact with presto container
# TODO: get rid of MBA and use actions/prepare-backend instead
name: Kerberized Presto Integration Test
on:
@@ -5,10 +10,10 @@ on:
push:
branches:
- master
- 'release**'
- 'feature**'
- "release**"
- "feature**"
tags:
- '**'
- "**"
jobs:
files-changed:
@@ -52,7 +57,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
path: presto-kerberos-docker
- name: Bring up Presto+Kerberos cluster
run: cd presto-kerberos-docker && docker-compose up -d && cd ..
run: cd presto-kerberos-docker && docker compose up -d && cd ..
- name: Run Presto test query from command line (sanity check)
run: cd presto-kerberos-docker && ./test.sh && cd ..
# Since we are managing the Docker containers from the GitHub action container, we need to copy all the
@@ -63,6 +68,7 @@ jobs:
run: docker cp presto-kerberos:/etc/krb5.conf resources
- name: Copy client.keytab file to resources
run: docker cp presto-kerberos:/home/presto/client.keytab resources
- name: Checkout mba
uses: actions/checkout@v4
with:
@@ -74,11 +80,30 @@ jobs:
run: ls -latr mba-src
- name: Symlink mba
run: cd mba-src && sudo ln -s $(pwd)/src/main.clj /usr/local/bin/mba && chmod +x /usr/local/bin/mba && cd ..
- name: Ensure mba
run: which mba
- name: Run Metabase via MBA
run: /home/runner/work/metabase/metabase/mba-src/src/main.clj --mb . --data-db postgres-data -n example.com up
run: mba --mb . --data-db postgres-data -n example.com compose config > mba-compose.yml
- name: Adjust generated docker-compose config
uses: actions/github-script@v7
with:
script: | #js
const fs = require("fs");
const config = fs.readFileSync("mba-compose.yml", "utf8");
const newConfig = config.replace(
/name:\s+example.com/,
"name: example.com\n external: true",
);
fs.writeFileSync("mba-compose.yml", newConfig);
- name: Print compose config
run: cat mba-compose.yml
- name: Run mba
run: docker compose -f mba-compose.yml up -d
- name: Run test script in MBA instance
run: >
mba --mb . --data-db postgres-data -n example.com \
run .github/scripts/run-presto-kerberos-integration-test.sh
run: docker compose -f mba-compose.yml exec metabase .github/scripts/run-presto-kerberos-integration-test.sh

View File

@@ -9,7 +9,7 @@ on:
type: string
required: true
git_ref:
description: 'Valid git reference e.g. branches, tags, hashes'
description: 'A git commit hash that will be used to build the SDK'
type: string
required: true
@@ -35,7 +35,7 @@ jobs:
- name: check tags
run: |
if [ $(git tag -l | grep $tag) ]
if [ $(git tag -l | grep $tag$) ]
then
echo "::error::Tag '${{ env.tag }}' already exists. If you expect to run this workflow with the same tag, please remove the tag first and rerun this workflow again."
exit 1
@@ -89,19 +89,13 @@ jobs:
./bin/embedding-sdk/release_utils.bash update_readme ${{ inputs.sdk_version }}
- name: Bump published npm package version
# NOTE: this should happen before "Build SDK bundle" as we inject SDK version into the code during build step
run: |
./bin/embedding-sdk/release_utils.bash update_package_json_template ${{ inputs.sdk_version }}
# TODO: Remove this step after the build utils script is merged to master
- name: Upload release utils script, so it can be used later on when checking out `master` branch
uses: actions/upload-artifact@v4
with:
name: release-util
path: ./bin/embedding-sdk/release_utils.bash
- name: Update changelog
run: |
yarn embedding-sdk:generate-changelog
yarn embedding-sdk:generate-changelog -o changelog-diff
- name: Build SDK bundle
run: yarn run build-embedding-sdk
@@ -115,11 +109,11 @@ jobs:
name: metabase-sdk
path: ./resources/embedding-sdk
- name: Upload changelog
- name: Upload changelog diff
uses: actions/upload-artifact@v4
with:
name: sdk-changelog
path: ./enterprise/frontend/src/embedding-sdk/CHANGELOG.md
name: sdk-changelog-diff
path: ./changelog-diff
build-jar:
needs: test
@@ -168,15 +162,8 @@ jobs:
- name: Setup git user
run: |
git config --global user.email "metabase-bot@metabase.com"
git config --global user.name "Metabase bot"
# TODO: Remove this step after the build utils script is merged to master
- name: Download release utils script
uses: actions/download-artifact@v4
with:
name: release-util
path: ./bin/embedding-sdk/
git config --global user.email "github-automation@metabase.com"
git config --global user.name "Metabase Automation"
- name: Update readme
run: |
@@ -186,23 +173,17 @@ jobs:
run: |
bash ./bin/embedding-sdk/release_utils.bash update_package_json_template ${{ inputs.sdk_version }}
- name: Retrieve SDK changelog
- name: Retrieve SDK changelog diff
uses: actions/download-artifact@v4
with:
name: sdk-changelog
name: sdk-changelog-diff
# We need to do this because it's impossible to download an artifact to an existing location
- name: Move over the downloaded changelog
- name: Update changelog
run: |
mv CHANGELOG.md ./enterprise/frontend/src/embedding-sdk/CHANGELOG.md
cat changelog-diff enterprise/frontend/src/embedding-sdk/CHANGELOG.md > new-changelog
mv new-changelog enterprise/frontend/src/embedding-sdk/CHANGELOG.md
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.METABASE_BOT_APP_ID }}
private-key: ${{ secrets.METABASE_BOT_APP_PRIVATE_KEY }}
- name: Create a PR updating readme + published version, and changelog
- name: Create a PR updating readme + published version, and changelog (using GitHub Metabase Automation account)
run: |
git checkout -b update-sdk-version-${{ inputs.sdk_version }}
git commit -a -m 'Update Readme version references and published npm version to ${{ inputs.sdk_version }}'
@@ -211,10 +192,33 @@ jobs:
--assignee "${GITHUB_ACTOR}"\
--title "Update SDK version to ${{ inputs.sdk_version }}"\
--body "Update Readme version references and published npm package version to ${{ inputs.sdk_version }}"
gh pr edit --add-reviewer @metabase/embedding
env:
GH_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.METABASE_BOT_APP_ID }}
private-key: ${{ secrets.METABASE_BOT_APP_PRIVATE_KEY }}
- name: Edit PR adding useful information (using Metabase bot app)
run: |
gh pr edit --add-reviewer @metabase/embedding --add-label no-backport
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- name: Auto approve PR (using GitHub Actions account)
run: |
gh pr review --approve
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Enable Pull request auto-merge (using GitHub Metabase Automation account)
run: |
gh pr merge --auto --squash
env:
GH_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: Retrieve build SDK package artifact
uses: actions/download-artifact@v4
with:
@@ -239,11 +243,7 @@ jobs:
with:
ref: ${{ inputs.git_ref }}
- name: Setup git user
run: |
git config --global user.email "metabase-bot@metabase.com"
git config --global user.name "Metabase bot"
# Lightweight tags don't need committer name and email
- name: Create a new git tag
run: |
git tag ${{ env.tag }}

43
.github/workflows/release-log.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Update Release Log
run-name: Update Release Log ${{ inputs.version }}
on:
workflow_dispatch:
inputs:
version:
description: 'Major Metabase version (e.g. 45, 52, 68)'
type: number
required: true
schedule:
- cron: '45 * * * *' # hourly
jobs:
update-release-log:
runs-on: ubuntu-latest
timeout-minutes: 5
env:
VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.version || 50 }} # Update this for the next major release
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_S3_RELEASE_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_S3_RELEASE_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- uses: actions/checkout@v4
with:
fetch-depth: 0 # we want all branches and tags
- name: Install Dependencies
run: yarn --cwd release --frozen-lockfile && npm i -g tsx
- name: generate release Log
run: cd release && tsx ./src/release-log.ts $VERSION > v$VERSION.html
- name: upload release log to the web
run: |
aws s3 cp \
release/v$VERSION.html \
s3://${{ vars.AWS_S3_STATIC_BUCKET }}/release-log/v$VERSION.html
- name: Create cloudfront invalidation
run: |
aws cloudfront create-invalidation \
--distribution-id ${{ vars.AWS_CLOUDFRONT_STATIC_ID }} \
--paths /release-log/v$VERSION.html

View File

@@ -0,0 +1,52 @@
name: Release Milestone Check
run-name: Pre-release Milestone check for ${{ inputs.version }}
on:
workflow_dispatch:
inputs:
version:
description: "Metabase version (e.g. v0.46.3)"
type: string
required: true
commit:
description: "A full-length commit SHA-1 hash"
required: true
jobs:
check-milestone:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: yarn --cwd release --frozen-lockfile && yarn --cwd release build
- uses: actions/github-script@v7
env:
SLACK_RELEASE_CHANNEL: ${{ vars.SLACK_RELEASE_CHANNEL }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
with:
script: | # js
const {
checkMilestoneForRelease,
sendMilestoneCheckMessage,
} = require('${{ github.workspace }}/release/dist/index.cjs');
const version = '${{ inputs.version }}';
const commitHash = '${{ inputs.commit }}';
const issueCount = await checkMilestoneForRelease({
github,
owner: context.repo.owner,
repo: context.repo.repo,
version,
commitHash,
});
await sendMilestoneCheckMessage({
channelName: process.env.SLACK_RELEASE_CHANNEL,
issueCount,
version,
});

View File

@@ -0,0 +1,55 @@
name: Release Notes Preview
run-name: Preview ${{ inputs.version }} release notes
on:
workflow_dispatch:
inputs:
version:
description: 'Metabase version (e.g. v0.46.3)'
type: string
required: true
jobs:
preview-release-notes:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: Fail early on the incorrect version format
if: ${{ !(startsWith(inputs.version,'v0.') || startsWith(inputs.version,'v1.')) }}
run: |
echo "The version format is invalid!"
echo "It must start with either 'v0.' or 'v1.'."
echo "Please, try again."
exit 1
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Get Release Version
uses: actions/github-script@v7
env:
DOCKERHUB_OWNER: test_owner
DOCKERHUB_REPO: test_repo
AWS_S3_DOWNLOADS_BUCKET: test_bucket
with:
script: | # js
const { getChangelog } = require('${{ github.workspace }}/release/dist/index.cjs');
const fs = require('fs');
const version = '${{ inputs.version }}';
const notes = await getChangelog({
version,
github,
owner: context.repo.owner,
repo: context.repo.repo,
});
fs.writeFileSync(`release-notes-preview-${version}.md`, notes);
- name: Upload Release Notes
uses: actions/upload-artifact@v4
with:
name: release-notes-preview-${{inputs.version}}.md
path: |
${{ github.workspace }}/release-notes-preview-*.md

91
.github/workflows/release-patch.yml vendored Normal file
View File

@@ -0,0 +1,91 @@
name: Release 1b - Auto Patch
run-name: Patch Release ${{ inputs.version }}
on:
workflow_dispatch:
inputs:
version:
description: 'Major Metabase version (e.g. 45, 52, 68)'
type: number
required: true
schedule:
- cron: '15 0 * * 2-6' # every weekday at 7/8:15 pm Eastern Time
jobs:
auto-patch-trigger:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: yarn --cwd release --frozen-lockfile && yarn --cwd release build
- name: Trigger auto-patch
uses: actions/github-script@v7
with:
script: | # js
const {
getLatestGreenCommit,
getNextPatchVersion,
hasCommitBeenReleased,
} = require('${{ github.workspace }}/release/dist/index.cjs');
// Don't forget to update this for the next major release 🤞
const AUTO_RELEASE_VERSIONS = [49, 50];
async function releasePatchFor(majorVersion) {
const nextPatch = await getNextPatchVersion({
github,
owner: context.repo.owner,
repo: context.repo.repo,
majorVersion,
});
const goodCommit = await getLatestGreenCommit({
github,
owner: context.repo.owner,
repo: context.repo.repo,
branch: `release-x.${majorVersion}.x`,
});
const hasBeenReleased = await hasCommitBeenReleased({
github,
owner: context.repo.owner,
repo: context.repo.repo,
ref: goodCommit,
majorVersion: Number(majorVersion),
});
if (nextPatch && goodCommit && !hasBeenReleased) {
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'tag-for-release.yml',
ref: 'refs/heads/master',
inputs: {
commit: goodCommit,
version: nextPatch,
auto: true,
}
});
} else {
console.log(
{ nextPatch, goodCommit, hasBeenReleased }
);
console.error(`No new patch version or no green commit found for v${majorVersion}`);
}
}
if (context.eventName === 'workflow_dispatch') {
const inputVersion = Number(context.payload.inputs.version);
if (typeof inputVersion !== 'number') {
console.log('Invalid version number', inputVersion);
throw new Error(`Invalid version number: ${inputVersion}`);
}
await releasePatchFor(inputVersion);
} else { // scheduled release of AUTO_RELEASE_VERSIONS
await Promise.all(AUTO_RELEASE_VERSIONS.map(releasePatchFor));
}

View File

@@ -1,9 +1,9 @@
name: Release Status Check
name: Release and Backport Status Check
on:
workflow_dispatch:
schedule:
- cron: '0 11 * * 1-5' # every weekday at 6am US eastern time
- cron: '0 7 * * 1-5' # every weekday at 8am/9am Central European Time
jobs:
check-release-status:
@@ -38,3 +38,31 @@ jobs:
repo: context.repo.repo,
channelName: process.env.SLACK_RELEASE_CHANNEL,
});
open-backport-reminder:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn --frozen-lockfile && yarn build
- name: Check release status and post to Slack
uses: actions/github-script@v7
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
script: | # js
const { checkOpenBackports } = require('${{ github.workspace }}/release/dist/index.cjs');
if (!process.env.SLACK_BOT_TOKEN) {
throw new Error('SLACK_BOT_TOKEN is required');
}
const ossReleased = await checkOpenBackports({
github,
owner: context.repo.owner,
repo: context.repo.repo,
channelName: 'engineering-ci',
});

72
.github/workflows/release-tests.yml vendored Normal file
View File

@@ -0,0 +1,72 @@
name: Release Code Tests
on:
push:
branches:
- "master"
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
files-changed:
name: Check which files changed
runs-on: ubuntu-22.04
timeout-minutes: 3
outputs:
release_source: ${{ steps.changes.outputs.release_source }}
steps:
- uses: actions/checkout@v4
- name: Test which files changed
uses: dorny/paths-filter@v3.0.0
id: changes
with:
token: ${{ github.token }}
filters: .github/file-paths.yaml
release-type-check:
needs: files-changed
if: needs.files-changed.outputs.release_source == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: "release"
- name: prepare dependencies in release directory
run: yarn --cwd release --frozen-lockfile
- name: Run frontend type-check
run: yarn --cwd release type-check
release-tests-unit:
needs: files-changed
if: needs.files-changed.outputs.release_source == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: "release"
- name: prepare dependencies in release directory
run: yarn --cwd release --frozen-lockfile
- name: Run release unit tests
run: yarn --cwd release test:unit
release-test-build:
needs: files-changed
if: needs.files-changed.outputs.release_source == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: "release"
- name: prepare dependencies in release directory
run: yarn --cwd release --frozen-lockfile
- name: Build release bundle
run: yarn --cwd release build
- name: Smoke test release bundle
run: node release/dist/index.cjs

View File

@@ -31,6 +31,10 @@ on:
description: 'Skip publishing release notes'
type: boolean
default: false
auto:
description: 'auto-patch release DO NOT SET MANUALLY'
type: boolean
default: false
jobs:
check-version:
@@ -90,6 +94,34 @@ jobs:
return versions;
publish-start-message:
runs-on: ubuntu-22.04
needs: [check-version]
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Send publish start message
uses: actions/github-script@v7
env:
SLACK_RELEASE_CHANNEL: ${{ vars.SLACK_RELEASE_CHANNEL }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
script: | # js
const { sendPublishStartMessage } = require('${{ github.workspace }}/release/dist/index.cjs');
await sendPublishStartMessage({
owner: context.repo.owner,
repo: context.repo.repo,
version: '${{ inputs.version }}',
runId: '${{ github.run_id }}',
channelName: '${{ vars.SLACK_RELEASE_CHANNEL }}',
}).catch(console.error);
download-uberjar:
needs: check-version
runs-on: ubuntu-22.04
@@ -228,7 +260,7 @@ jobs:
- name: Upload to S3
run: aws s3 cp ./metabase.jar s3://${{ vars.AWS_S3_DOWNLOADS_BUCKET }}/${{ steps.version_path.outputs.result }}/metabase.jar
- name: Upload to s3 latest path
if: ${{ steps.latest_path.outputs.result != 'false' }}
if: ${{ !inputs.auto && steps.latest_path.outputs.result != 'false' }}
run: aws s3 cp ./metabase.jar s3://${{ vars.AWS_S3_DOWNLOADS_BUCKET }}/${{ steps.latest_path.outputs.result }}/metabase.jar
- name: Create cloudfront invalidation
run: |
@@ -374,7 +406,7 @@ jobs:
echo "Finished!"
- name: Tag the container image as latest
if: ${{ steps.latest_version_check.outputs.result == 'latest' }}
if: ${{ !inputs.auto && steps.latest_version_check.outputs.result == 'latest' }}
run: |
echo "Pushing ${{ env.DOCKERHUB_REPO }}:latest ..."
docker tag localhost:5000/local-metabase:${{ steps.canonical_version.outputs.result }} ${{ env.DOCKERHUB_REPO }}:latest
@@ -482,16 +514,25 @@ jobs:
$GITHUB_WORKSPACE/release/reorder-tags.sh ${{ needs.check-version.outputs.ee }} ${{ inputs.commit }}
trigger-docs-update:
if: ${{ inputs.skip-release-notes != true }}
needs: push-tags
if: ${{ !inputs.auto && inputs.skip-release-notes != true }}
needs:
- push-tags
- check-version
runs-on: ubuntu-22.04
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
env:
NEW_OSS_VERSION: ${{ needs.check-version.outputs.oss }}
NEW_EE_VERSION: ${{ needs.check-version.outputs.ee }}
GH_TOKEN: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
steps:
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.DOCS_UPDATE_TOKEN }}
script: |
github.rest.repos.createDispatchEvent({
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
script: | # js
await github.rest.repos.createDispatchEvent({
owner: '${{ github.repository_owner }}',
repo: '${{ secrets.DOCS_REPO }}',
event_type: 'trigger-docs-update',
@@ -499,9 +540,96 @@ jobs:
version: '${{ inputs.version }}'
}
});
- uses: actions/checkout@v4
with:
token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
- name: update releases.md
uses: actions/github-script@v7
with:
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
script: | # js
const fs = require('fs');
const releaseText = fs.readFileSync('./docs/releases.md', 'utf8');
const newReleaseText = releaseText
.replace(
/## Metabase Enterprise Edition releases\n\n/,
`## Metabase Enterprise Edition releases\n\n- [${process.env.NEW_EE_VERSION}](https://github.com/metabase/metabase/releases/tag/${process.env.NEW_EE_VERSION})\n`
)
.replace(
/## Metabase Open Source Edition releases\n\n/,
`## Metabase Open Source Edition releases\n\n- [${process.env.NEW_OSS_VERSION}](https://github.com/metabase/metabase/releases/tag/${process.env.NEW_OSS_VERSION})\n`
);
fs.writeFileSync('./docs/releases.md', newReleaseText);
- name: commit and push updates
run: | # bash
git config --global user.email "metabase-bot@metabase.com"
git config --global user.name "Metabase bot"
git checkout -b docs-add-$NEW_OSS_VERSION
cd docs/
git add releases.md
git commit -m "Add $NEW_OSS_VERSION to the list of releases"
git push origin docs-add-$NEW_OSS_VERSION --force
- name: open pr with updates
run: | # bash
gh pr create --fill \
--body "Like it says on the tin 😁" \
--label "Type:Documentation" \
--label "backport" \
--reviewer "jeff-bruemmer" \
--assignee "jeff-bruemmer"
trigger-cloud-issues:
needs: push-tags
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
script: | # js
const version = '${{ inputs.version }}';
const enterpriseVersion = version.replace(/^v0\./, "v1.");
github.rest.repos.createDispatchEvent({
owner: '${{ github.repository_owner }}',
repo: '${{ vars.OPS_REPO }}',
event_type: 'create-release-issues',
client_payload: {
version: enterpriseVersion,
}
});
trigger-ee-extra-pr:
needs: verify-s3-download
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.METABASE_AUTOMATION_USER_TOKEN }}
script: | # js
const version = '${{ inputs.version }}';
const enterpriseVersion = version.replace(/^v0\./, "v1.");
github.rest.repos.createDispatchEvent({
owner: '${{ github.repository_owner }}',
repo: 'metabase-ee-extra',
event_type: 'update-ee-extra-build',
client_payload: {
version: enterpriseVersion,
auto: '${{ inputs.auto }}',
}
});
draft-release-notes:
if: ${{ inputs.skip-release-notes != true }}
if: ${{ !inputs.auto && inputs.skip-release-notes != true }}
needs: push-tags
runs-on: ubuntu-22.04
timeout-minutes: 15
@@ -553,7 +681,7 @@ jobs:
});
publish-version-info:
if: ${{ inputs.skip-version-info != true }}
if: ${{ !inputs.auto && inputs.skip-version-info != true }}
runs-on: ubuntu-22.04
needs: [push-tags, check-version]
timeout-minutes: 15
@@ -611,7 +739,66 @@ jobs:
--distribution-id ${{ vars.AWS_CLOUDFRONT_STATIC_ID }} \
--paths "/version-info.json" "/version-info-ee.json"
publish-complete-message:
if: ${{ !inputs.auto }}
runs-on: ubuntu-22.04
needs: [draft-release-notes, verify-docker-pull, verify-s3-download, publish-version-info]
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Send publish complete message
uses: actions/github-script@v7
env:
SLACK_RELEASE_CHANNEL: ${{ vars.SLACK_RELEASE_CHANNEL }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
script: | # js
const { sendPublishCompleteMessage } = require('${{ github.workspace }}/release/dist/index.cjs');
await sendPublishCompleteMessage({
owner: context.repo.owner,
repo: context.repo.repo,
version: '${{ inputs.version }}',
runId: '${{ github.run_id }}',
channelName: '${{ vars.SLACK_RELEASE_CHANNEL }}',
generalChannelName: 'general',
}).catch(console.error);
auto-publish-complete-message:
if: ${{ inputs.auto }}
runs-on: ubuntu-22.04
needs: [push-tags, verify-docker-pull, verify-s3-download]
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Send auto publish complete message
uses: actions/github-script@v7
env:
SLACK_RELEASE_CHANNEL: ${{ vars.SLACK_RELEASE_CHANNEL }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
script: | # js
const { sendPublishCompleteMessage } = require('${{ github.workspace }}/release/dist/index.cjs');
await sendPublishCompleteMessage({
owner: context.repo.owner,
repo: context.repo.repo,
version: '${{ inputs.version }}',
runId: '${{ github.run_id }}',
channelName: '${{ vars.SLACK_RELEASE_CHANNEL }}',
generalChannelName: '',
}).catch(console.error);
manage-milestones:
if: ${{ !inputs.auto }}
permissions: write-all
runs-on: ubuntu-22.04
needs: [draft-release-notes, publish-version-info] # this will ensure that the milestone stays open until the release notes are published

View File

@@ -2,7 +2,7 @@ name: Re-run Flaky Workflows
on:
workflow_run:
workflows: [Backend, Driver Tests, E2E Tests, Frontend]
workflows: [Backend, Driver Tests, E2E Tests, Frontend, Backend-Cloverage]
types: [completed]
branches: [master, 'release-x.**', 'backport-**']
@@ -10,7 +10,7 @@ jobs:
rerun-on-failure:
name: 'Re-run ''${{ github.event.workflow_run.name }}'' workflow'
runs-on: ubuntu-22.04
# Do not re-run scheduled workflow runs. That's only Replay.io E2E tests for now.
# Do not re-run scheduled workflow runs
if: github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.event != 'schedule'
env:
BRANCH_NAME: ${{ github.event.workflow_run.head_branch }}

View File

@@ -0,0 +1,38 @@
name: Security Issue Slack Notification
on:
issues:
types:
- labeled
jobs:
on-issue-opened:
runs-on: ubuntu-22.04
timeout-minutes: 5
if: github.event.label.name == 'SECURITY'
steps:
- name: Setting title
uses: actions/github-script@v7
id: vars
with:
script: |
core.setOutput('issue_title', ${{ toJson(github.event.issue.title) }}.replaceAll(/"/g, '\\"'));
- name: Send the issue ${{ github.event.issue.number }} to Slack
id: slack
uses: slackapi/slack-github-action@v1.26.0
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ steps.vars.outputs.issue_title }}\n${{ github.event.issue.html_url }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_SECURITY_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

257
.github/workflows/tag-for-release.yml vendored Normal file
View File

@@ -0,0 +1,257 @@
name: Release 1a - Tag Release Artifact
run-name: Tag ${{ inputs.version }}
on:
workflow_dispatch:
inputs:
version:
description: 'Metabase version (e.g. v0.46.3)'
type: string
required: true
commit:
description: 'A full-length commit SHA-1 hash'
required: true
auto:
description: 'auto-patch release DO NOT SET MANUALLY'
type: boolean
default: false
jobs:
start-message:
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Send build start message
uses: actions/github-script@v7
env:
SLACK_RELEASE_CHANNEL: ${{ vars.SLACK_RELEASE_CHANNEL }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
with:
script: | # js
const { sendPreReleaseMessage } = require('${{ github.workspace }}/release/dist/index.cjs');
await sendPreReleaseMessage({
github,
owner: context.repo.owner,
repo: context.repo.repo,
version: '${{ inputs.version }}',
runId: '${{ github.run_id }}',
releaseSha: '${{ inputs.commit }}',
userName: '${{ github.actor }}',
channelName: '${{ vars.SLACK_RELEASE_CHANNEL }}',
}).catch(console.error);
check-version:
runs-on: ubuntu-22.04
timeout-minutes: 10
outputs:
ee: ${{ fromJson(steps.canonical_version.outputs.result).ee }}
oss: ${{ fromJson(steps.canonical_version.outputs.result).oss }}
steps:
- name: Fail early on the incorrect version format
if: ${{ !(startsWith(inputs.version,'v0.') || startsWith(inputs.version,'v1.')) }}
run: |
echo "The version format is invalid!"
echo "It must start with either 'v0.' or 'v1.'."
echo "Please, try again."
exit 1
- uses: actions/checkout@v4
with:
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Get Release Version
uses: actions/github-script@v7
id: canonical_version
with:
script: | # js
const { isValidVersionString, getCanonicalVersion, hasBeenReleased } = require('${{ github.workspace }}/release/dist/index.cjs');
const version = '${{ inputs.version }}';
if (!isValidVersionString(version)) {
throw new Error("The version format is invalid! It must start with either 'v0.' or 'v1.'.");
}
const versions = {
ee: getCanonicalVersion(version, 'ee'),
oss: getCanonicalVersion(version, 'oss'),
};
const ossReleased = await hasBeenReleased({
github,
owner: context.repo.owner,
repo: context.repo.repo,
version: versions.oss,
});
const eeReleased = await hasBeenReleased({
github,
owner: context.repo.owner,
repo: context.repo.repo,
version: versions.ee,
});
if (ossReleased || eeReleased) {
throw new Error("This version has already been released!", version);
}
return versions;
check-commit:
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- name: Check out the code to verify the release branch
uses: actions/checkout@v4
with:
fetch-depth: 0 # IMPORTANT! to get all the branches
sparse-checkout: release
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Get Release Branch
uses: actions/github-script@v7
id: release_branch
with:
result_encoding: string
script: | # js
const { getReleaseBranch } = require('${{ github.workspace }}/release/dist/index.cjs');
const version = '${{ inputs.version }}';
const releaseBranch = getReleaseBranch(version);
return releaseBranch;
- name: Ensure that the specified commit exists in the ${{ steps.release_branch.outputs.result }} release branch
run: |
RELEASE_BRANCH=${{ steps.release_branch.outputs.result }}
git checkout $RELEASE_BRANCH
git branch --contains ${{ inputs.commit }} | grep -q $RELEASE_BRANCH \
&& echo "Commit found in correct release branch" \
|| (echo "Commit not found in correct release branch" && exit 1)
tag-uberjar-for-release:
needs: [check-version, check-commit]
runs-on: ubuntu-22.04
timeout-minutes: 10
strategy:
matrix:
edition: [oss, ee]
env:
INTERACTIVE: false
steps:
- name: Get correct version number
run: | # bash
if [ '${{matrix.edition}}' == 'ee' ]; then
version='${{ needs.check-version.outputs.ee }}'
else
version='${{ needs.check-version.outputs.oss }}'
fi
echo "VERSION=$version" >> $GITHUB_ENV
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17 # 11 throws an error on jar uf
- name: Retrieve test build uberjar artifact for ${{ matrix.edition }}
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: `metabase-${{ matrix.edition }}-${{ inputs.commit }}-uberjar`,
per_page: 1,
});
if (!artifacts.data?.artifacts?.[0]?.id) {
console.warn(`No existing artifacts found for ${{ inputs.commit }}, need to build jar`);
if ("${{matrix.edition}}" === 'oss') {
// only trigger the build job on OSS, otherwise we'll get double builds
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'build-for-release.yml',
ref: 'refs/heads/master',
inputs: {
commit: '${{ inputs.commit }}',
version: '${{ inputs.version }}',
}
});
}
throw new Error('aborting in favor of build script');
}
const artifact_id = artifacts.data.artifacts[0].id;
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact_id,
archive_format: 'zip',
});
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/mb.zip`, Buffer.from(download.data));
- name: Unzip Metabase artifact containing an uberjar
run: |
unzip mb.zip
mv target/uberjar/metabase.jar metabase.jar
- name: Update version.properties in jar
run: | # sh
jar xf metabase.jar version.properties
echo "Old version.properties:"
cat version.properties
sed -i "s/^tag=.*/tag=$VERSION/" version.properties
echo "\n\nNew version.properties:"
cat version.properties
echo "\n\nUpdating metabase.jar with new version.properties"
jar uf metabase.jar version.properties
- name: Store commit's SHA-1 hash
run: echo ${{ inputs.commit }} > COMMIT-ID
shell: bash
- name: Calculate SHA256 checksum
run: sha256sum ./metabase.jar > SHA256.sum
shell: bash
- name: Upload JARs as artifact
uses: actions/upload-artifact@v4
with:
name: metabase-release-${{ matrix.edition }}-${{ inputs.commit }}-uberjar
path: |
./metabase.jar
./COMMIT-ID
./SHA256.sum
trigger-tests:
needs: [tag-uberjar-for-release]
permissions:
actions: write
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- name: trigger pre-release testing
uses: actions/github-script@v7
with:
script: | # js
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'pre-release.yml',
ref: '${{ github.ref }}',
inputs: {
commit: '${{ inputs.commit }}',
version: '${{ inputs.version }}',
auto: '${{ inputs.auto }}',
}
});

134
.github/workflows/translation-update.yml vendored Normal file
View File

@@ -0,0 +1,134 @@
name: Update Translations
run-name: Update Translations for v${{ inputs.version }} - ${{ inputs.step }}
on:
workflow_dispatch:
inputs:
step:
type: choice
description: Upload untranslated strings | Download translated strings
options:
- upload
- download
required: true
version:
type: string
description: "The version number for which to update translations (e.g. 43, 58.7)"
required: true
permissions:
contents: write
pull-requests: write
jobs:
upload-translations:
name: Upload Translations
if: ${{ inputs.step == 'upload' }}
runs-on: ubuntu-22.04
timeout-minutes: 20
env:
POEDITOR_API_TOKEN: ${{ secrets.POEDITOR_API_TOKEN }}
POEDITOR_PROJECT_ID: 200535
VERSION: ${{ inputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: manage-translations
- name: install gettext
run: sudo apt-get install gettext
# TODO: check for untranslated strings
- name: Upload strings to be translated
run: | # sh
./bin/i18n/update-translation-template
./bin/i18n/export-pot-to-poeditor
echo "Strings uploaded to POEditor"
- name: Commit changes
env:
GH_TOKEN: ${{ github.token }}
run: | # sh
git config user.name github-actions
git config user.email github-actions@github.com
BRANCH_NAME="update-translations-v$VERSION"
git checkout -b $BRANCH_NAME
git add locales/
git commit -m "Add new strings for v$VERSION"
git push -u origin $BRANCH_NAME
gh pr create \
--reviewer "${GITHUB_ACTOR}" \
--assignee "${GITHUB_ACTOR}" \
--title "Update Translations for v$VERSION" \
--body "Update translations from POEditor for v$VERSION
See [translation update documentation](https://www.notion.so/metabase/Process-for-updating-translations-421db70048fe400da1153ad0b61102f4)
## To Do
- [x] Upload new strings to POEditor
- [ ] Message contributors on POEditor (manual)
- [ ] Copy source strings to english language (manual)
- [ ] Download translations from POEditor (github action)
- [ ] Merge this PR and backport to the release branch (manual)
" \
--label "backport" \
--label "Customization/i18n"
# TODO: notify contributors
# TODO: copy source strings to english language
download-translations:
name: Download Translations
if: ${{ inputs.step == 'download' }}
runs-on: ubuntu-22.04
timeout-minutes: 20
env:
POEDITOR_API_TOKEN: ${{ secrets.POEDITOR_API_TOKEN }}
POEDITOR_PROJECT_ID: 200535
VERSION: ${{ inputs.version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
# assumes there's already a branch with that name from the upload step
ref: update-translations-v${{inputs.VERSION}}
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: manage-translations
- name: Prepare build scripts
run: cd ${{ github.workspace }}/release && yarn && yarn build
- name: Automatically translate untranslated strings
uses: actions/github-script@v7
with:
script: | # js
const { autoTranslateSupportedLanguages } = require('${{ github.workspace }}/release/dist/index.cjs');
await autoTranslateSupportedLanguages();
- name: Download translated strings
run: | # sh
cd ${{ github.workspace }}
./bin/i18n/import-po-from-poeditor
./bin/i18n/build-translation-resources
- name: Commit changes
run: | # sh
git config user.name github-actions
git config user.email github-actions@github.com
BRANCH_NAME="update-translations-v$VERSION"
git add locales/
git commit -m "Update translations"
git push -u origin $BRANCH_NAME

72
.github/workflows/tusk-sanity-check.yml vendored Normal file
View File

@@ -0,0 +1,72 @@
# This allows Tusk to manually run workflows to check lint/build/tests before creating a PR.
# If you have any questions, please reach out to support@usetusk.ai.
name: Tusk Sanity Check
on:
workflow_dispatch:
inputs:
taskId:
description: "Tusk Task ID"
required: true
runType:
description: "Tusk Run Type"
required: true
runId:
description: "Tusk Run ID"
required: true
jobs:
sanity_check:
runs-on: ubuntu-latest
steps:
- name: Log inputs
run: |
echo "Tusk Task ID: ${{ github.event.inputs.taskId }}"
echo "Tusk Run Type: ${{ github.event.inputs.runType }}"
echo "Tusk Run ID: ${{ github.event.inputs.runId }}"
echo "Current Branch: ${{ github.ref }}"
echo "Repository default branch: ${{ github.event.repository.default_branch }}"
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
- name: Check which files changed
uses: dorny/paths-filter@v3.0.0
id: changes
with:
token: ${{ github.token }}
filters: .github/file-paths.yaml
# Similar to .github/workflows/frontend.yml
- name: Prepare front-end environment
if: steps.changes.outputs.frontend_all == 'true'
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: "cljs"
- run: yarn build-pure:cljs
name: Compile CLJS
- name: Run lint-staged
if: steps.changes.outputs.frontend_all == 'true'
run: |
BASE_COMMIT=$(git merge-base origin/${{ github.event.repository.default_branch }} HEAD)
npx lint-staged --shell --no-stash --diff="$BASE_COMMIT...HEAD"
# You must include this step after running all auto-fixing steps
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "fix(${{ github.run_id }}): auto linting" # The commit message MUST start with "fix(${{ github.run_id }}):"
commit_options: "--no-verify" # No verify because we already ran it above
skip_fetch: true
skip_checkout: true
status_options: "--untracked-files=no"
add_options: "--update"
- name: Check types
if: steps.changes.outputs.frontend_all == 'true'
run: yarn type-check-pure

3
.gitignore vendored
View File

@@ -112,3 +112,6 @@ modules/drivers/*/.lsp/*
# airgap
/resources/airgap/
# swc
.swc/

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

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