* init branch
* FE - add codemirror diffing, add diff support to native query editor, fake a proposed query
* Add /ee/metabot-tools/get-transforms endpoint
Returns a sequence of all python or native query transforms.
BOT-391 [Backend] Create transform index tool API
* Add test that get-transforms does not include non-native MBQL transforms
* Add /ee/metabot-tools/get-transform-details endpoint
* allow opening metabot on transforms admin pages
* use transforms_codegen profile for metabot on transforms page
* send transform in context
* show metabot on edit + create transforms page
* accept tranform suggestions from metabot
* Cleanup malli schemas for get-transforms and get-transform-details
* add transform context on edit query page
* use transforms instead of data queries
* Parse out tables from transforms in metabot user context
* wip on creation flow
* hack in a message to metabot on save
* quick fix preview error not displaying correctly
* misc. fe improvements
* fix transform context on subsequent edits for the same transform
* half hacky way to use current editor state for context in transform editing
* Switch /ee/metabot-v3/get-transforms from :get to :post
This endpoint doesn't expect args of it's own in the body, but does accept the standard metabot conversation_id that
it echoes back.
* Show 'Apply Changes' button when a transform change is generated by the agent
* handle new transforms better
* Ensure we have a fallback for context items that don't have SQL to parse
* persist diff of transform to the conversation history
* temp - make metabot always visible on transforms admin pages
* Change button label to "Proposed changes to <transform>"
* copy change for create transform buttons in chat
* better hidden message ui
* hack - better emtpy convo text
* hide suggested prompts
* Add basic snippets tools
* ensure proposed queries go through nativeQuery.setQueryText so that template tags are parsed
* better todos
* even better todo list ui
* crude sidebar ui for query transforms diffs
* better suggestion chat ui
* good'nuff @mentions
* debug logging for search table bug
* further logging
* Ensure we parse template tags for transform edits in Metabot sidebar (#64001)
* cleaner, more copy/pastable, better flowing @mentions in metabot
* Fix metabot get-transforms api test to :post not :get
* Update metabot tools test with basic python transform tests
* Ensure transform :source and :target keys get snake cased when returned from metabot tool apis
* Add get-transform-python-library-details metabot tool api endpoint
* Enhance context with :used_tables for python transforms
* surface transforms in @-mention search
* some type fixes
* python FE progress
* python fe improvements + edit experience now works
* clear proposed on cancel
* fix accept in sidebar not saving
* better diff colors
* smaller todos
* cleaner code for todos
* improve ranking of transforms in search by hardcoding a last_viewed_at time in user-recency-expr
* first pass at nested @mentions
* Conditionally add transforms to model->db-model
* Add transforms-python to module deps for metabot
* Move native-query-transform? into transforms.util and re-use existing utils
metabot-v3.tools.transforms defined a couple of helper functions that were nearly identical to ones that have since
been added to transforms.util ns. Move some things around and make use of the existing transforms.util predicates,
which are now exported from the module's core namespace.
* lots of fe clean up
* prevent rewinding conversation for admin pages
* @mention solution that plays nicely with documents
* fix search bug
* fix type issues and few small feedback things
* Add transforms to search for Metabot (#64134)
* index transforms content
* Add support for transforms & query search in metabot search tool API
* fixup whitespace
* update to use new :fields syntax
* Fix up serach-native-query malli types
* Fix the 15-day interval for transforms to be db-agnostic
* move engine loading to metabase.search.init to break circular dep
* fix kondo
* Revert "Fix the 15-day interval for transforms to be db-agnostic"
This reverts commit 11b34e4cd4a8a5a0cf8041a1d82d487ed8c81025.
* add transform to set of appdb scorer models; unrevert db type fix
* fix kondo
* implement requisite multimethods for transforms not to error in in-place search engine
* ensure we enforce metabot/unknown contexts for transforms in in-place search backend as well
* fix filter test
* transform->postprocess to reduce naming ambiguity; add a basic transform ingestion test
* add a metabot result postprocessing test
* add transforms scoring test
* expand ingestion tests
* fix tests + kondo
* address feedback
* make suggestion models configurable for a Metabot instance
* fix @mention recents in documents, update suggestion sidebar component to not accept / reject items + calculate isViewing better
* quick fixes
* for rye guy
* Handful of fixes for transforms search (#64287)
* Add both search and search_v2 endpoints, and fix bug with search-native-query option
* add a docstring
* add a basic unit test for search-native-query option
* address comments
* better state management for suggested transofrms, move css around, clean up suggestion message code
* Update the list of source tables in Python editor when metabot changes it (#64258)
If metabot proposes changes to the list of input tables for a Python transform, update the PythonDataPicker component
to keep it in sync with the text of the transform source.
* python tables reference fix
* bug fixes and better state organization
* better draft support
* fix types
* add on leave modal, clear transforms on route leave, calc dirty state, fix onChange but for native query editor, better logic for showing cta text for transform suggestions
* Ensure transforms get deleted synchronously from the search index (#64382)
* Delete transforms from search index in t2/define-before-delete
* kondo
* fix up tests
* Stop pretending to snake_case transform source and target keys
The malli schemas were wrong, so these weren't actually getting snake_cased anyway.
See also:
https://github.com/metabase/ai-service/pull/387#discussion_r2414569482
* Fix failing test & kondo warning
* Add transforms dependency check API for metabot (#64542)
* WIP - add dependency check API for metabot
* omit bad_cards for now
* update return format
* add tests
* Fix fn call
* revert unneeded refactor
* Fix search transform-ingestion-test to use mt/native-query
* switch test to mt/native-query
* Fix module usage test
* fix up tests to use lib/native-query instead
* try to fix last test
* switch native-query-transform? to use lib.query/native?
* more mbql 5/metabase lib updates
* revert the 1-pixel fix
* Subtract a pixel when computing metabot chat filler height to avoid scrollbar flicker (#64690)
* Fix MetabotAgentSuggestionMessage only show "create" for new transforms (#64598)
https://metaboat.slack.com/archives/C09CR3MT1KR/p1760034396345789
* Surface broken cards from Metabot dependencies check API (#64781)
* fix missing sidebar diff after mbql5 change
* surface broken cards
* add test
* fix kondo
* remove unused code
* Fix up dep check question terminology & schema
* fix up test
* fix up another test
* address feedback
* Update the transform source schema to use ::queries.schema/query
* remove unused require
* address FE feedback
* fix modules config test
* @mentions tests and improvements
* couple of e2e tests fixes
* prevent leave confirmation when saving
* fix most of unit tests
* add back searchable models in metabot @mentions
* More tests for transform search + transform dependencies tool, and some new future-proofing read checks (#64896)
* add some future-proofing read checks to transform deps checks + related tests
* add some more transform search tests
* remove 404 check; move read check later in impl
* convert from toucan transform instance to metadata
* clean ns
* Move honeysql helper to simplify module dependencies
* fix more function calls in tests
* fix more calls
* fix (hopefully) last two calls
* kondo fix
* fix module config
* Fix detection of requires in threading macros
* Add metabase.driver.sql.query-processor back as a driver API namespace
* Add tests for metabot tools snippets and check-transform-dependencies endpoints (#64894)
* Add tests for metabot tools snippets API endpoints
* Add test for metabot tools check-transform-dependencies endpoint
* Remove trailing blank line to appease linter
* copy over appdb implementations of add-interval-honeysql-form to h2x; add back the sql.qp version for other drivers
* switch other driver methods back to sql.qp
* update relevant callsites
* move some test logic
* fix up error
* restore :added meta
* fix tests, move over one more pg timestamp helper
* oops, update callsites
* make function public
* add MetabotChatEditor.unit.spec.tsx
* add links.unit.spec.ts
* add AIMarkdown.unit.spec.tsx
* add MetabotAgentTodoMessage.unit.spec.tsx
* add MetabotAgentSuggestionMessage.unit.spec.tsx
* add metabot/state/reducer.unit.spec.ts w/ tests for suggested transforms state
* add e2e test coverage for create + update flow for both native sql + python transforms
* FE pr feedback and lint fix
* unit test fixes
* fix search test
* add temp metabot toggle button in admin nav
* fix a couple of failing FE tests
* attempt fix ci flake issue with metabot.unit.spec.tsx
* remove metabot-only restriction on transform search
* remove redundant logs in transform api endpoints to address ngoc's comment
* fix a number of transform search tests
* fix another test
* fix hopefully last search test
* bot feedback
* bot feedback
* fix function name
---------
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
Co-authored-by: Mike Appleby <86076+appleby@users.noreply.github.com>
Co-authored-by: Mihael Konjevic <konjevic@gmail.com>
Co-authored-by: Tyler Plude <tsplude@gmail.com>
Make native validation allow using current-level aliases in other clauses
`select a as b from table where b > 1` wasn't passing validation because the b alias wasn't in scope in the where.
This should now be fixed.
Also, native validation keeps more context when generating references, which should allow for better error messages.
Instrumentation adds a lot of overhead. Unfortunately, even 30 seconds timeout wasn't enough for some of our unit tests. We're doubling that value in order to minimize the chances of this workflow halting/failing again.
* Add workflow_dispatch trigger
* Rename workflow to 'Frontend Test Coverage'
* Fix remote sync settings test
* Fix sync type setting validation test
* Fix check sync task type is production
* Update plain type to collection_type
* Cascade changes to collection type
* Update deps checks when collection type changes
* Fix task type check in export
* move setting check to api for better status report
* add tests for sync-type
* Don't mark newly created entities as updated or removed UXW-1806
* UXW-1821 enabled badge
* UXW-1818: hide branch picker and push button for non-admins
* cleanup and UXW-1814
* remove border from the branch picker button
* cleanup
* UXW-1829 update diff modal ui
* UXW-1807: token should appear masked
* Allow setting of nil token
* UXW-1833: show backend error when saving invalid git settings
* Add new collection update/create events
* Remove per collection imp/exp; change dirty status table
* Redo event handling add removed status
* Sync object table on syncs
* Fix status names
* Added /current-task/cancel API and track version in remote_sync_task
* Add is_remote_synced to api responses
* Fix adding is_remote_sync hydration
* Fixed compilation error
* remove hashp
* Fix loading is_remote_sync hydration
* Resolve ambiguous reference
* Fix n+1 detector
if it gets a heterogeneous set of things we should hydrate each type
separately.
* Add can-create? handlers
* remote sync: a few bugfixes and improvements from my bugbash (#64372)
* Set `collection.type` on archive/unarchive
When unarchiving or archiving collections that have the `remote-synced`
type, we need to set their new type appropriately.
When archiving, we should give them a normal (nil) type.
When unarchiving any collection *to* a remote-synced collection, we
should set the type to `remote-synced`.
* Allow serdes without archived items
and use it in remote sync export.
During dependency checking, we do *not* want to exclude archived items:
if card A uses card B, and card B is archived, we need to include Card B
in the list of dependencies! Otherwise we'll say that it's fine to
remote sync card A when it's not.
* Add tests
* Documents are descendants of collections
* don't include cards as document descendants
* fix tests, dashboard descendants args
* remove #p and unnecessary query
* remove another `#p`
* Update auto sync token to enable import job
* More is_remote_sync hydration fixes
* Fix lints and document oss serdes
* Fix cards to be valid for update events
* Don't actually import if nothing has changed in the remote repo
* Remove hashp
* UXW-1817: change branches should update content
* UXW-1813 ensure sync dirty state is properly invalidated
* UXW-1864 fix how collections changes appear in the diff
* Fix ee-available? check
* Improve is_remote_synced hydration
* Fix some more oss/ee issues
finish remote ChangeLog model
* fix invalidation on removal
* fix missing require
* Don't need to handle transforms directories specially
* fix tests to make sure state is fully reset
* remove duplicate require
* Fix deadlock on import
* Fixing tests
* Fix document tests
* Fix kondos
* handle removed sync_status
* UXW-1851: show moving out of synced collection error
* feature flag, misc fixes
* dirty state tracking for snippets
* Fix ns typo
* Add remote-sync token and config
* enforce remote_sync token feature on the FE
* allow cancelling the remote-sync
* Track timeline
* Force re-import when configuring for production mode
* Fixed compilation error
* Force re-import when configuring for production mode only when auto-sync is enabled
* Throwa 400 error if there are dirty objects when doing an import
* force import button
* Better archiving checks with remote synced collections
* Better tests for documents and remote-sync deps
* Remove hashp
* remote hashp
* Remove other hashp
* More consistent collection write checks
* Fix broken collection tests
* Fix broken documents tests
* improve imports/exports frontend
* Implement can-create? for timeline-event
* tweak copy
* Always update branch setting
* Initial Commit
* Fix more tests
* Remove bad parallel annotations
* Show error toast when adding a collection that has references outside of the repo
* reasonable structure, error handling
* timelines editing is less frequent, we can invalidate dirty state on any edit
* Fix dirty state api tests for mysql
* bring error details back
* Fix collection move tests
* Fix remove parallel from can_restore tests
Splitting this into smaller tests seems to introduce some kind of state
that causes tests to fail in parallel
* Fix make logs use unique names for be tests
* Bump toucan2 versions
* Fix var name
* Fix check that there are exportable collections
* Add test for exportable check
* Started on e2e test
* Fix issue with merge
* Fix arguments to card descendants
* Handle new ingestable interface
* Put back changes in cypress-runner
* Fix remaining failing enterprise tests
* Fix one set of app tests
* Clean remote sync state in obj tests
* single collection
* Fix unit test - enterprise getIcon function only applied when new feature is enabled (ResultItem.unit.spec.tsx)
* Fix ts issues / Clean up
* FE fixes
* Remove parallel annotations
* Fix missing import from merging master
* Fix the fix
* always create collection to sync
* no unsyncing
* Remove associating location to trash from search
* Prevent users from switching branches with unsynced changes + show warning
* Create remote-sync collection when it doesn't exist
* Prevent changing to production with unsynced changes
* Make sure dirty state refetches on admin settings load
* single synced collection ui update
* Cannot change to production mode when there are unsynced changes
* Fix failing query
* unquote branches
* fix eastwood
* fix timeline event publishing
* fix import
* Move dashboard remote sync api tests into ee
...where they can reference the setting
* Created /stash API and renamed create branch api to /create-branch
* Fix settings issue
* Fix remaining permissions message tests
* Make sure drop target always works for trash
* Add checks for if we're in trash elsewhere
* cleanup
* git-sync to remote-sync
* more git-sync to remote-sync
* Don't allow export if it overwrites an external commit
* - Don't assume a "main" branch
- Attempt an import when no remote-sync branch exists when enabling dev mode
* Fix creating remote sync library
* refactor to middleware
* hack: add a delay for refetching instance settings or dirty state after remote sync task finishes
* UXW-1953: confirmation flow when switching branches in prod
* Update modal when switching branches with dirty state / Component refactorings
* Create a branch off the last-used commit, not the branch itself
* Add options modal when trying to push while remote is ahead
* Support force option on export
* Update branch setting and complete task in txn
* Let export! set branch in stash and fix tests
* Fix PR feedback nits
* Update enterprise/backend/src/metabase_enterprise/remote_sync/api.clj
* Consistent documentation style in remote-sync
* Add option to pull from remote / Adjust push/pull icons / Adjust out-of-sync options modal
* modals UI polish
* constants clean up
* Add api schemas and make error messages consistent
* fix check-403 to write-check
* Apply suggestions from code review
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
* Clean up a couple components / Move things around
* Address renaming suggestions
* Fix var names and bad merge
* double->float in schema
* Share error handling
* Update enterprise/backend/src/metabase_enterprise/remote_sync/settings.clj
* Update enterprise/backend/src/metabase_enterprise/remote_sync/settings.clj
* Update enterprise/backend/src/metabase_enterprise/remote_sync/settings.clj
* Addressing small PR comments
* Refetch properties when branch is created (current branch changed)
* Make sure /current-task is only called when import and export are not in progress
* Replace unset color variables
* Improve element padding on side panel
* Remove a couple trailing spaces reported by clj whitespace linter
* Show error when settings request fails / Make sure current-task also waits for the PUT settings mutation
* Fix document perm tests
* Allow empty remote-url, moved import and export calls to impl
* Fix minor prettier issue
* Fix another lil lint issue
* temp
* e2e push / pull
* Unify more of the import implementation
* fix CI failures
* fix mysql ci failures
* Address metabot critiques
* Address additional metabot feedback
* last round of docstring feedback
* library admin settings e2e
* Add attribution to TODO
* fix ws
* fix missed commiting file
* fix another missing file
* production switch branches
* More clojure like docstrings
* More docstring fixes
* adding branch switching test
* Address Nick's PR review comments (most of them)
* Fix more nits
* Resolving Nick's comments part 2
* Improving remote-sync settings handling
* attempt to repair synced_folder icon
* Fail if attempting to connect to an uninitialized repo
* correct the name of synced_collection.svg
* add new repository icon
* Add default-branch to source protocol
* Update Git Sync to Remote Sync in Admin settings (#64993)
* Make api docstrings and errors more generic
* Use check-400 to simplify api
* fix ws
* Rollback BaseSMTPConnectionForm.tsx (fixes a e2e test)
* fix e2e tests?
* Fix small merge issue
* Always use `last-version` instead of caring about import vs. export version
* starting warning modal tests
* Fetch source at the beginning of import/export operations
* Fix broken test
* Delete branches that were deleted on remote
* Fix missing test suffix
* Fix eastwood
* Adjust branching e2e test, skip failing tests
---------
Co-authored-by: Edward Paget <ed.paget@gmail.com>
Co-authored-by: Nathan Voxland <nathan@metabase.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Anderson <anderson@metabase.com>
Co-authored-by: eliotmetabase <eliot@metabase.com>
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Maz Ameli <maz@metabase.com>
* init branch
* FE - add codemirror diffing, add diff support to native query editor, fake a proposed query
* Add /ee/metabot-tools/get-transforms endpoint
Returns a sequence of all python or native query transforms.
BOT-391 [Backend] Create transform index tool API
* Add test that get-transforms does not include non-native MBQL transforms
* Add /ee/metabot-tools/get-transform-details endpoint
* allow opening metabot on transforms admin pages
* use transforms_codegen profile for metabot on transforms page
* send transform in context
* show metabot on edit + create transforms page
* accept tranform suggestions from metabot
* Cleanup malli schemas for get-transforms and get-transform-details
* add transform context on edit query page
* use transforms instead of data queries
* Parse out tables from transforms in metabot user context
* wip on creation flow
* hack in a message to metabot on save
* quick fix preview error not displaying correctly
* misc. fe improvements
* fix transform context on subsequent edits for the same transform
* half hacky way to use current editor state for context in transform editing
* Switch /ee/metabot-v3/get-transforms from :get to :post
This endpoint doesn't expect args of it's own in the body, but does accept the standard metabot conversation_id that
it echoes back.
* Show 'Apply Changes' button when a transform change is generated by the agent
* handle new transforms better
* Ensure we have a fallback for context items that don't have SQL to parse
* persist diff of transform to the conversation history
* temp - make metabot always visible on transforms admin pages
* Change button label to "Proposed changes to <transform>"
* copy change for create transform buttons in chat
* better hidden message ui
* hack - better emtpy convo text
* hide suggested prompts
* Add basic snippets tools
* ensure proposed queries go through nativeQuery.setQueryText so that template tags are parsed
* better todos
* even better todo list ui
* crude sidebar ui for query transforms diffs
* better suggestion chat ui
* good'nuff @mentions
* debug logging for search table bug
* further logging
* Ensure we parse template tags for transform edits in Metabot sidebar (#64001)
* cleaner, more copy/pastable, better flowing @mentions in metabot
* Fix metabot get-transforms api test to :post not :get
* Update metabot tools test with basic python transform tests
* Ensure transform :source and :target keys get snake cased when returned from metabot tool apis
* Add get-transform-python-library-details metabot tool api endpoint
* Enhance context with :used_tables for python transforms
* surface transforms in @-mention search
* some type fixes
* python FE progress
* python fe improvements + edit experience now works
* clear proposed on cancel
* fix accept in sidebar not saving
* better diff colors
* smaller todos
* cleaner code for todos
* improve ranking of transforms in search by hardcoding a last_viewed_at time in user-recency-expr
* first pass at nested @mentions
* Conditionally add transforms to model->db-model
* Add transforms-python to module deps for metabot
* Move native-query-transform? into transforms.util and re-use existing utils
metabot-v3.tools.transforms defined a couple of helper functions that were nearly identical to ones that have since
been added to transforms.util ns. Move some things around and make use of the existing transforms.util predicates,
which are now exported from the module's core namespace.
* lots of fe clean up
* prevent rewinding conversation for admin pages
* @mention solution that plays nicely with documents
* fix search bug
* fix type issues and few small feedback things
* Add transforms to search for Metabot (#64134)
* index transforms content
* Add support for transforms & query search in metabot search tool API
* fixup whitespace
* update to use new :fields syntax
* Fix up serach-native-query malli types
* Fix the 15-day interval for transforms to be db-agnostic
* move engine loading to metabase.search.init to break circular dep
* fix kondo
* Revert "Fix the 15-day interval for transforms to be db-agnostic"
This reverts commit 11b34e4cd4a8a5a0cf8041a1d82d487ed8c81025.
* add transform to set of appdb scorer models; unrevert db type fix
* fix kondo
* implement requisite multimethods for transforms not to error in in-place search engine
* ensure we enforce metabot/unknown contexts for transforms in in-place search backend as well
* fix filter test
* transform->postprocess to reduce naming ambiguity; add a basic transform ingestion test
* add a metabot result postprocessing test
* add transforms scoring test
* expand ingestion tests
* fix tests + kondo
* address feedback
* make suggestion models configurable for a Metabot instance
* fix @mention recents in documents, update suggestion sidebar component to not accept / reject items + calculate isViewing better
* quick fixes
* for rye guy
* Handful of fixes for transforms search (#64287)
* Add both search and search_v2 endpoints, and fix bug with search-native-query option
* add a docstring
* add a basic unit test for search-native-query option
* address comments
* better state management for suggested transofrms, move css around, clean up suggestion message code
* Update the list of source tables in Python editor when metabot changes it (#64258)
If metabot proposes changes to the list of input tables for a Python transform, update the PythonDataPicker component
to keep it in sync with the text of the transform source.
* python tables reference fix
* bug fixes and better state organization
* better draft support
* fix types
* add on leave modal, clear transforms on route leave, calc dirty state, fix onChange but for native query editor, better logic for showing cta text for transform suggestions
* Ensure transforms get deleted synchronously from the search index (#64382)
* Delete transforms from search index in t2/define-before-delete
* kondo
* fix up tests
* Stop pretending to snake_case transform source and target keys
The malli schemas were wrong, so these weren't actually getting snake_cased anyway.
See also:
https://github.com/metabase/ai-service/pull/387#discussion_r2414569482
* Fix failing test & kondo warning
* Add transforms dependency check API for metabot (#64542)
* WIP - add dependency check API for metabot
* omit bad_cards for now
* update return format
* add tests
* Fix fn call
* revert unneeded refactor
* Fix search transform-ingestion-test to use mt/native-query
* switch test to mt/native-query
* Fix module usage test
* fix up tests to use lib/native-query instead
* try to fix last test
* switch native-query-transform? to use lib.query/native?
* more mbql 5/metabase lib updates
* revert the 1-pixel fix
* Subtract a pixel when computing metabot chat filler height to avoid scrollbar flicker (#64690)
* Fix MetabotAgentSuggestionMessage only show "create" for new transforms (#64598)
https://metaboat.slack.com/archives/C09CR3MT1KR/p1760034396345789
* Surface broken cards from Metabot dependencies check API (#64781)
* fix missing sidebar diff after mbql5 change
* surface broken cards
* add test
* fix kondo
* remove unused code
* Fix up dep check question terminology & schema
* fix up test
* fix up another test
* address feedback
* Update the transform source schema to use ::queries.schema/query
* remove unused require
* address FE feedback
* fix modules config test
* @mentions tests and improvements
* couple of e2e tests fixes
* prevent leave confirmation when saving
* fix most of unit tests
* add back searchable models in metabot @mentions
* More tests for transform search + transform dependencies tool, and some new future-proofing read checks (#64896)
* add some future-proofing read checks to transform deps checks + related tests
* add some more transform search tests
* remove 404 check; move read check later in impl
* convert from toucan transform instance to metadata
* clean ns
* Add tests for metabot tools snippets and check-transform-dependencies endpoints (#64894)
* Add tests for metabot tools snippets API endpoints
* Add test for metabot tools check-transform-dependencies endpoint
* Remove trailing blank line to appease linter
* add MetabotChatEditor.unit.spec.tsx
* add links.unit.spec.ts
* add AIMarkdown.unit.spec.tsx
* add MetabotAgentTodoMessage.unit.spec.tsx
* add MetabotAgentSuggestionMessage.unit.spec.tsx
* add metabot/state/reducer.unit.spec.ts w/ tests for suggested transforms state
* add e2e test coverage for create + update flow for both native sql + python transforms
* FE pr feedback and lint fix
* unit test fixes
* fix search test
* add temp metabot toggle button in admin nav
* fix a couple of failing FE tests
* attempt fix ci flake issue with metabot.unit.spec.tsx
* remove metabot-only restriction on transform search
* remove redundant logs in transform api endpoints to address ngoc's comment
* fix a number of transform search tests
* fix another test
* fix hopefully last search test
---------
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
Co-authored-by: Mike Appleby <86076+appleby@users.noreply.github.com>
Co-authored-by: Noah Moss <noahbmoss@gmail.com>
Co-authored-by: Mihael Konjevic <konjevic@gmail.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Due to `useEngineDocMarkdownContent` changes the dynamic imports are needed for `import(`docs/databases/connections/${docFileName}.md`)`
Co-authored-by: Jonathan Sheely <jsheely@thirtytech.net>
* Collections are delete-able
The `can_delete` flag for collections was the only missing bit to have
collections be deletable, since I added an API endpoint to delete
collections a while ago! I thought FE work was required, doh.
Fixes UXW-1090
* Fix e2e tests
* Rework X-Rays to use Lib
* Test change
* Fix the last few failing tests
* Remove dead code
* PR feedback
* Claude updates
* Fix typos
* Oops
* e2e test fix 🔧
* Assert premium features for some middleware
* Fix an existing bug
These tests started failing here, which revealed that they formerly
never actually were testing what they thought they were.
A few reasons:
- they turned on `advanced-permissions` feature by itself, so sandboxing
was always off here
- they set up sandboxing in a nonstandard way
- one had a typo so we weren't even wrapping the body with
`with-download-perms!` (it was a separate block entirely)
This hid the bug that some of the tests were intended to reproduce - if
a card used for sandboxing had a native query, then we required that you
have download permissions on the entire database, which is wrong.
* fix test
* make assertions with/without tokens for sandboxing
* Add comments about why `:feature :none`
* Update enterprise/backend/test/metabase_enterprise/sandbox/query_processor/middleware/sandboxing_test.clj
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
* add a nicer docstring and change fn name
replace `any-native-unsandboxed-stage?` with
`any-native-stage-not-introduced-by-sandbox?`
* Block without feature enabled
* CR response
---------
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
* Allow any scheme for URLs, not just http/https
* Explicitly allow app:// and capacitor:// schemes
* fix flakiness in e2e test
* Only accept HTTP/HTTPS when no protocol is specified
---------
Co-authored-by: Uladzimir Havenchyk <uladzimir@metabase.com>
* ugly solution #1
* revert the ugly part
* refactor and tests
* fix(modular): make links/click behavior that link to the same origin as the host app work and open them on a new tab
* update tests to expect a click behavior
* clean up tests
* tests for the same domain issue
* add also basic support for links, just in case
* Update e2e/test-component/scenarios/embedding-sdk/dashboard-click-behavior.cy.spec.tsx
* refactor tests as per feedback to use mockIsEmbeddingSdk
* don't remove column settings
* Remove unnecessary default value
* Remove unnecessary export
* Show move to trash icon in CollectionBrowser
* Make the trash button easier to work with
* Add a dropdown
* Fix icon
* Archive resources in the collection browser
* Add tests
* Update UX
* Prevent external type change
* Remove custom style
* subtler add data button in side nav
* fix tests
* update test
* fix unrelated broken test
* fix another unrelated broken test
* try fixing test again
* undo changes to unrelated tests
* Cursor's attempt at fixing related test
* Extend db connection timeout in tests
We allow for 10 seconds in the app, and 3 seconds in test. I extend that
3 seconds to 5 seconds. This should really only affect bigquery.
In bigquery, we test if you "can connect" by connecting to the project
and then attmepting to find any datasets that you are able to see. This
is important because each test run connects to the same project but is
scoped down to fewer datsets. It's possible we could change this
behavior and return if you can list datasets at all, but it is nice if
you can see at least one dataset based on your inclusion and exclusion
filters.
For reference, the filters for my current CI run are:
```clojure
bigquery-cloud-sdk=> (update details :service-account-json (constantly "<<redacted>>"))
{:project-id nil,
:service-account-json "<<redacted>>",
:dataset-filters-type "inclusion",
:dataset-filters-patterns "sha_4c3ca6238018e2b60025297f3e5c39671588adf2_QLGKZKIAOSQXOGGDURQY",
:include-user-id-and-hash true,
:project-id-from-credentials "metabase-bigquery-driver"}
```
In my repl, i'm seeing the following behavior:
```clojure
bigquery-cloud-sdk=> (time (let [client (database-details->client details)
project-id (get-project-id details)
datasets (.listDatasets client project-id (u/varargs BigQuery$DatasetListOption))
]
(vec (for [^Dataset dataset (.iterateAll datasets)
:let [dataset-id (.. dataset getDatasetId getDataset)]
]
dataset-id))))
"Elapsed time: 2692.292292 msecs"
["BQ_tupac_sightings"
"Shakespeare"
...
"v6_sample_dataset"]
bigquery-cloud-sdk=> (count *1)
273
```
So just enumerating all datasets takes ~2.7 seconds so we are flirting
with the fail limit of 3 seconds.
I extend this to 5 seconds and this should only give a bit of breathing
room to bigquery and everything else remains the same.
* fix flakiness in e2e test
---------
Co-authored-by: Uladzimir Havenchyk <uladzimir@metabase.com>
* Add migrations
* Add new columns to serde spec
* Update serde baseline
Will change again in follow up once sql-jdbc behaviour is ported
* Extend sql-jdbc describe-table
* Sync new field columns
* Extend field our-metadata to the new sync columns
* Fix tests
* Add postgres support new field columns
* Add generic driver tests for nullability and defaults
* Extend clickhouse test driver to :not-null? :default field defs
* Add new columns to mysql describe-fields-sql
* Add new features for better test specification
- :describe-is-nullable
- :describe-default-expr
In both cases if the feature is unsupported, the driver must return `nil` for the respective field metadata keyword.
* Add :database-is-generated test and driver feature
* Fix load-data inserts when rows empty
* Do not return generated-column-sql for redshift
* Fix snowflake-test/describe-table-test
* Fix bigquery load-tabledef when table has no rows
* Use generation_expression rather than :extra for mysql/mariadb
* Fixup driver features
* Amend pk-sync-test to verify the new :database_is_pk behaviour more explicitly as the semantic type changes
* Add sync tests for default/generated/nullable
* Formatting
* Add SQLite support for generated/nullable/default
* Add SQL-Server support for generated/nullable/default
* Only test dynamic dataset databases for now
* For druid JDBC all columns (apart from __time) are nullable
* Vertica does not support generated columns
* Starburst does not support generated columns
* Presto does not support generated columns
* Revert accidental database-required behaviour change
* Assert table synced
* Use def'd datasets rather than inline
* Oracle features
* Vertica features
* Opt starburst, presto out of defaults
* Add :test/create-table-without-data to deal with mongo
* Add some new lines to mig yml
* Add note about sync to driver test
* Do not spam logs for pk changes on upgrade
* Further logging guard refinement
* Fix migration conflicts
* [Search] Separate out embeddable_text from searchable_text and use labeled format for embedding
* add embeddable_text to test data
* update mock-embeddings in tests to use new format for embeddable strings
* Fix more tests
* Fix more tests
* Fix last tests
* Fix last test
* improve comments & add a test that transform fns are not applied
Avoids FE ordering depending on hash iteration order on initial sync - in particular avoids
breakage in tests relying on id positionally if hashes change.
* Remove double beforeEach setup probably from a mistake
* Fix the flaky test. I hope...
* Attempt to fix the test that failed the interception
* Revert change
* Fix the flake on Cypress CI
Closes QUE-2613.
`convertTimezone` now checks the type of the field ref, since we might not know to make the compiled
column a timezone-backed column when the previous stage is a native query.
* Remove double border
* Remove overflowing corners on functionbrowser
* Fix HelpText header background in dark mode
* Remove dot in customexpression editor
* Fix dark mode completions in native editor
* Move color fixes to CodeMirror component
* Move CodeMirror cursor fix in darkmode to shared CodeMirror module
* Move completion styles to shared CodeMirror component
* Enable highlighting of partials in Python completions
* Remove more shared CM code
* Fix e2e test
* Fix timout in e2e test
This addresses most of QUE-2686 #64774 but a second PR is required to fix a
56-specific issue that doesn't apply to `master`.
The FE was not using the new
`lib.metadata.cached-provider/cached-metadata-provider` except where
it gets added by `lib/query`. Previously, the FE constructed the
*uncached* MP once (ish) and then passed it to `lib/query` many times.
Each of those queries got its MP wrapped with `cached-metadata-provider`
but the next time the query got converted via `lib/query` its cached
values (eg. `visible-columns`, `returned-columns`) were lost.
This PR wraps the `lib.js.metadata/metadata-provider*` with
`cached-metadata-provider` from the start, so the cached values have
the same lifespan as the `MetadataProvider`, rather than each individual
query.
I also noticed that `/query_metadata` requests don't use
`lib-be.metadata.jvm/with-metadata-provider-cache`, so they end up
recreating `MetadataProvider`s for the same underlying database over and
over. That increases AppDB traffic and CPU usage to recompute
`returned-columns` etc. repeatedly. Both of those scale fast with the
complexity of the query.
* disable excessive spam in the prs
* to-revert: change source code to trigger the build
* test2
* :shrugs:
* Revert "to-revert: change source code to trigger the build"
This reverts commit 37f6abb085.
* clean up and comment
This fixup broke because QP started returning the db-shaped
viz-settings (e.g. `:table.columns`) instead of the normalized
viz-settings (e.g.
`:metabase.models.visualization-settings/table-columns `) under
`[:json_query :viz-settings]`.
The existing test for this fix did not catch the regression because the
shape of viz settings was faked out for testing, and did not get
transformed like real viz settings. `{:ver 2}` stayed as `{:ver 2}`,
while `{:table.columns []}` is transformed into
`{::visualization-settings/table-columns []}`
* Fix date range picker text inputs not in sync with calendar inputs (#64602)
* Unskip and update test
* Add repro for #64602
* Add unit tests
* Add issue tags
* Rename date to displayedDate
* Update the last instance of deprecated `FormRadioWidget`
This commit replaces a deprecated `FormRadioWidget` with the
`FormRadioGroup` component (which is a light wrapper around
the plain Radio.Group from Mantine).
* Remove the deprecated `FormRadio` component
* Revise alert creation instructions in documentation
Updated instructions for creating alerts, including clearer steps and options for different alert types. Adjusted formatting for consistency and added details on editing and managing alerts.
* Enhance clarity in delete and restore documentation
Updated the documentation for deleting and restoring items to clarify the impact on related content and improve phrasing.
* Apply suggestions from code review
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
We call native-query-deps on query save on mongo queries. This ensure that doesn't error, while still flagging if we don't implement native-query-deps for a driver that is supposed to support it.
* use disk at query time of notification payload creation
We have some nice work to dump query results to disk if they are larger
than a row-count threshold. But this presupposes that results can fit
into memory. It's completely possible, and relatively easy, to do some
kind of "select *" operation in a dashboard where the only limit that
prevents billions of rows coming back is the excel limit we add in.
This tries to optimistically use the disk. If creates a new rff that has
two modes: in-memory and a gzipped dataoutput stream. The first is in
operation for the first 2,000 rows. If we never exceed this limit it
remains a regular reducing function. Once this threshold is exceeded, we
open a new file and stuff the rows in there and don't keep them in
memory any longer. This prevents us from having to hold the entire
result set in memory at once.
On the consumption side, we have a threshold such that if a file is
_larger_ than this, we won't attempt to load it and render it for static
viz. This is what lets us defensively decline to do an operation that
would reasonably lead to an OOM.
Optimizations for the future:
- give up on file creation once it exceeds the threshold size. We can
easily monitor the size of the file as we go and stop the transduction
or results.
- clear out files more frequently. This will probably litter lots of
temp files, some possibly quite large, on teh disk. We need to more
frequently clear them up. The directory is marked as deleteOnExit, but
we need to ensure we don't put lots of files in there during process
lifetime.
- better error rendering of "too large" error. Right now it hits the
default error rendering (previously it would oom). We can make this
better.
- explore how parallel we can get now. Presumably we are now quite
memory effecient. Can we go back to 3, or 10, worker threads?
* fix typo and reintroduce constant for row threshold
* more references to typo constant
* missed one somehow?
* include pulses (alerts) for autocommit off for downloads
we want to stream results. and now we do into a file so this can respect
the page size which only happens in pg when using autocommit false
* special error msg for too large results/dont attach large results
feedback that query results were too large
alerts also by default include results. let's check for the
render/too-large and not include them in that case. Was actually getting
a seq error on the deftype that holds the file. maybe want to give that
a seqable method?
* fix tests
we had an unrealized temp storage file going through
* unification all to streaming before moving to temp-storage
* move streaming to the temp-storage namespace
* don't deref results if no one wants attachments
* don't log the error here. it's pretty normal
* doc strings
* better logging and truncate results above threshold
once we are above the size that we won't read the file, we don't have to
keep piping results to it.
Concretely, what does this get us? If someone absentmindedly did
`select * from transactions` it could be 100s of GBs or more. Without
this, we would fill up the disk for the instance even though we don't
try to render it in the email. But once we know that there's no way we
will read the contents of the file, we really don't have to write to it
any longer.
* Make settings for size limit and whether to enforce
maybe someone has a beefy machine and they don't mind chugging through
843mb of query results to get a graph. they can easily set
`MB_ENFORCE_NOTIFICATION_TEMP_FILE_SIZE_LIMIT` to false and the old
behavior will be restored. If someone doesn't like the 10mb limit and
prefers a 50mb limit they can do
`MB_NOTIFICATION_TEMP_FILE_SIZE_MAX_BYTES=52428800` and then they will
have the higher limit
* Huge performance improvements
The real gist here is removing the gzip on the output. This was crushing
our performance. 18 seconds instead of ~4 seconds. Real bad. And it's
better to not gzip anyways. We really want to be tied pretty closely to
the size of the results. GZiping uses a ton of cpu and gets it very
compact. But we want a number that is pretty representative of the
results. Repeated values get gzipped down to almost nothing and then
they could still OOM the instance. But 50mb of results might get
squashed down to ~8mb of text. We want to be tethered close the size in
a csv or in memory.
Also changed the serialization to write chunks of rows and not a single
row. Its totally possible that the gzip fix did all of the work and
chunks or individual rows all get put together into the
bufferedoutputstream so it doesn't matter anyways. But the good thing is
that the format of this file is entirely the work of this namespace and
no one else gets to see it.
* Check for fidelity of regular results and disk based
timing wise: running the same card 356 (a join of people, products,
orders) and verify timing stays consistent (we are only 100ms longer
with disk)
```clojure
temp-storage=> (time
(-> (toucan2.core/select-one-fn :dataset_query :model/Card :id 356)
metabase.query-processor/process-query
:data :rows count))
"Elapsed time: 740.709583 msecs"
18760
temp-storage=>
(time (->
(metabase.notification.payload.execute/execute-card 1 356)
:result
(select-keys [:notification/truncated?
:status :running_time
:data.rows-file-size
:data])
(update :data (fn [d] (select-keys d [:rows])))))
"Elapsed time: 840.608 msecs"
{:status :completed,
:running_time 724,
:data.rows-file-size 8056845,
:data {:rows #object[metabase.notification.payload.temp_storage.StreamingTempFileStorage
"0x3336077d"
{:status :pending, :val nil}]}}
```
Compare in memory results:
```clojure
temp-storage=> (let [card-id 356
regular-rows (-> (toucan2.core/select-one-fn :dataset_query :model/Card :id card-id)
(metabase.query-processor/process-query)
:data :rows)
disk-rows (-> (metabase.notification.payload.execute/execute-card 1 356)
:result :data :rows)
dereffed @disk-rows]
(doseq [[f results] [["/tmp/results.from-disk" dereffed]
["/tmp/results.from-qp" regular-rows]]]
(with-open [w (clojure.java.io/writer f)]
(doseq [row results]
(io/copy (str (pr-str row) \newline) w))))
[(= regular-rows dereffed) (= (count regular-rows) (count dereffed))])
[true true]
```
and then compare the files written above:
```shell
/tmp
❯ diff results.from-disk results.from-qp
/tmp
❯ echo $?
0
```
* weird postgres types
* postgres 12 didn't like gen_random_uuid so just hardcode one
everyone else promised they wouldn't use
7e3cd49d-bfe1-4620-83dd-0c163719175c for anything important
* formatting, lints
* alignment
* reformat, remove unused aliases
* remove errant comment
* cleanup logic and add some comments
unconditionally add to rowcount and in-memory collection of rows. For
two of three branches, this is "done": (1) collecting in memory, and (2)
streaming to disk but our "batch" isn't full. Only when the batch is a
multiple of 5,000 rows (number completely picked at random, balancing
this) we can then write the row block to disk.
Totally possible this can switch to just writing to disk on each row and
rely on the buffered writer to handle batching. But the use of the
in-memory collection being similar across almost all of the branches
makes this solution feel a bit cleaner for the moment.
also does things like inverting `if-not` so the short branch is at the
top and not hanging at the end where it's esay to miss.
* unify two file size settings
used to have some notion of `enforce` and `file-size-limits` Rather than
juggle both, you can just set the filesize to 0 to make it unbounded
* reuse human-readable-size in more places, fix some typos
* typos, fixes
* prometheus metrics
* followup to metrics
I’ve added a new metric
```clojure
(prometheus/counter :metabase-notification/temp-storage
{:description "Number and type of temporary storage uses"
;; memory, disk, above-threshold, truncated, not-limited
:labels [:storage]})
```
to record the different scenarios of query results:
- stayed in `memory`
- wrote them to `disk` but remained under the threshold
- wrote to disk and they went `above-threshold`
- wrote to disk and they went so far above threshold that we abandoned the query so the results were `truncated`
- wrote to disk but the limit was set to 0 so the results were `not-limited`
and these look like: (replaced # with ♯ so git message will include)
```
❯ http get :9191/metrics | grep temp
♯ HELP metabase_notification_temp_storage_total Number and type of temporary storage uses
♯ TYPE metabase_notification_temp_storage_total counter
metabase_notification_temp_storage_total{storage="memory",} 2.0
metabase_notification_temp_storage_total{storage="disk",} 2.0
metabase_notification_temp_storage_total{storage="truncated",} 2.0
```
* make predicates a bit more clojurey
* missed a refactor somehow
* better styling
thread the human readable size through
* styling changes
* bit of formatting
---------
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
* Add currency label style options to formatting.md
Added options for displaying currency labels in the formatting section.
* Clarify currency label style options
Updated the currency label style section to clarify options for displaying currency labels, including examples for Canadian dollars.
* Apply suggestions from code review
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* subtler background lines on cartesian charts
* increase font size on cartesian charts and legends to 13px
* improve size and spacing of legends for pies and choropleths
* change legend color to text-primary
* change case and color of pie chart center subtext
* change small funnel text to 13px
* tweak the number of y-axis tick marks when set to auto for small charts
* Update Loki Snapshots
* Update Loki Snapshots
* update specs, polish
* specs
* specs
* cleanup
* Update Loki Snapshots
* subtler background lines on cartesian charts
* increase font size on cartesian charts and legends to 13px
* improve size and spacing of legends for pies and choropleths
* change legend color to text-primary
* change case and color of pie chart center subtext
* change small funnel text to 13px
* tweak the number of y-axis tick marks when set to auto for small charts
* Update Loki Snapshots
merge in updated loki tests
* update specs, polish
* specs
* specs
* cleanup
* Update Loki Snapshots
merge master's loki snapshots
* Update Loki Snapshots
* update be specs
* move border-subtle definition from colors.module to colors.ts
* table border color fixes
* fix overly thick dashboard heading border-bottom
* Cursor's attempt at fixing related tests
* Cursor again attempts to fix tests
* specs
* cleanup
* another attempt to fix specs
* Update Loki Snapshots
* fix cartesian chart and pivot table lines in dark mode
* Update Loki Snapshots
* attempt to fix chart test
* spec
* unrelated test fix but I need to merge this PR
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
* command palette update
Updated keyboard shortcuts for opening the chat sidebar in Metabot documentation.
* Simplify custom action creation instructions
Removed instructions for creating a custom action from the command palette.
* Update appearance settings reference to 'Branding'
* Remove Metabot reference from exploration.md
Removed mention of asking Metabot in the exploration section.
* Add 'boolean' to filters page
Added boolean expressions support to custom filter documentation.
* Add boolean keywords to expressions doc
Updated section on conditional operators to include comparison and boolean logic operators.
* Fix anchor so old links work
* Fix missing period
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
---------
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
When using the `underlying-records` drill ("See these Orders") on a bucketed temporal value, such as a data point in
a time series, use a `:between` filter with the endpoints of the bucket, rather than `:=`.
The queries work with `:=` (because the QP expands them to `:between`) but some parts of the filter UI
render it badly. With `:between`, the filter is rendered properly as a date range.
* Make Metabot logo gray when brand color customization is defined
* Add MetabotLogo stories and test them with Loki
Signed-off-by: Jakub Chodorowicz <jakub@chodorowicz.com>
---------
Signed-off-by: Jakub Chodorowicz <jakub@chodorowicz.com>
Fixes QUE-2561
For example, in our Sample Database, `Orders.PRODUCT_ID` is remapped to
`Products.TITLE` by default. If you go to the **Table Metadata** in admin
and set `Products.TITLE` to "Do not include"
(which is `:visibility-type :sensitive` internally) it should not be
used for remapping.
* Add useEffectOnceIf hook
* Fix entity picker list not scrolling to chosen element
* Remove explicit dependencies
* Move useEffectOnceIf to VirtualizedList folder
We had tried this previously, but the athena driver has these libraries
uberjar'd into it. So we need this to be in lockstep. See
https://github.com/metabase/metabase/pull/63894 for more info.
but i'll include some info here:
there are two copies on the classpath:
```clojure
user=> (enumeration-seq (.. (Thread/currentThread) getContextClassLoader (getResources "io/netty/buffer/ByteBufAllocator.class")))
(#object[java.net.URL 0x3bb34fe "jar:file:/private/tmp/fixed-athena/plugins/bigquery-cloud-sdk.metabase-driver.jar!/io/netty/buffer/ByteBufAllocator.class"]
#object[java.net.URL 0x4ac1867d "jar:file:/private/tmp/fixed-athena/plugins/athena.metabase-driver.jar!/io/netty/buffer/ByteBufAllocator.class"])
```
one in the bigquery driver jar and one in the athena driver jar. The
bigquery driver jar has an explicit dep and we can control it
independently. The athena jar has it uberjar'd in and we can't control
it independently. So we want to make sure that we are relying on the
version that is (unfortunately) baked into athena.
For this we can see the athena 3.6.0 jar has the following
pom.properties file:
`META-INF/maven/io.netty/netty-buffer/pom.properties`
```properties
artifactId=netty-buffer
groupId=io.netty
version=4.1.124.Final
```
So we will pin that version in bigquery as well so we only have a
single version (but still two copies) on the classpath.
This way whichever classfile is resolved (and this can vary depending on
whether an athena db or bigquery db is synced first, or health checked)
it should behave the same
* fix long snippet names overflow
* add percent width so it uses most space both in SQL models and SQL editor
* fix sidebar width in transforms page
* for SnippetRow, use flex instead of width percentages, fix collection row
* fix snippetrow background so it expands snippet instead of inserting it into the editor
When investigating a separate issue I've noticed that we're logging "Loading ..." even for entities that are not actually being loaded. That's because we were printing this line when something is a dependency - even if it exists in the database and is not provided in the export.
This changes the approach somewhat, we will still have some indication we need some entity, but only at DEBUG level, and instead the "Loading ..." will appear only if we're genuinely about to read something from an export and put it in the database.
Not only it's easier to understand what's going on, it's going to be way less noisy.
* WRK-903 Update command palette modal (#64039)
* Remove metabot from command palette
* Remove footer
* Style search input
* Icon color
* Remove actions section when there is no search query
* Rename 'recent items' to 'recents'
* Show 10 recents by default
* Style item
* Update copy (Search results -> Results)
* Use project react import convention
* Move link to search results to group header
* Close palette on results link click
* Fix types
* Use disabled prop in useCommandPalette
* Update item bg
* Align search icon
* Update color whem is active
* Update table icon
* Fix wrong item being selected
* Use stack
* Fix icons shrinking
* Hide subtext on overflow
* Update unit tests
* Fix types
* Clean up
* Hide actions in a different way
* Update helper
* Remove redundant changes
* Update unit tests
* Update unit tests
* Update helper
* Update test
* Update test
* Update tests
* Update test
* Update test
* Update tests
* Add a border to search input
* Update test
* Simplify text overflow handling
* Avoid parent().parent()
* ESLint
* Improve assertion
* Improve assertion
* Remove borders between result groups in command palette
* update styles of the app bar (#64105)
* update styles of the app bar
* rework profilelink to ts
* fix some tests
* fix another e2e test
* update search style
* fix shortcuts conflict
* unify search buttons between oss and enterprise
* don't translate metakey
* fix colors
* let's have two keydown handlers
* fix test
* fix typecheck
* address review comments
* fix showplow event in test
* show metabot icon on small screens
* fix test
* do not show metabot button within iframe
* attempt to fix flaky test
* lint
* address review comments
* address review comments
* add a unit test
* update colors
* address comments
* update skeleton
---------
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
* support returning one action with "onClick" to call it immediately
* feat(sdk): add question to the clicked object, part of EMB-796
* feat(sdk): clean up the data we pass as `clicked`, part of EMB-796
makes export types checker happy
remove source
* add stories
* only require `onClick` for the "immediate" actions
* address feedback: fix type of onClick and add warning in case of wrong
shape
* allow cc review to be skipped
* Update .github/workflows/claude-code-review.yaml
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
* trying to retrigger when labels change
---------
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
* Claude code review (experimental)
* Run my job PLEASE!
* Fix syntax
* More guidelines
* Minor change to see if we can get some useful feedback
* Seriously run my damn workflow
* Add GH token
* Remove paths
* Appease Claude
* Tell Claude how to get the Clojure Style Guide
* Attempt Clojure style guide again
* Give Claude ReadFile perms for the style guide
* Move info about community style guide to CLAUDE.md
* Try again
* Another pass
* Seriously please follow Community style guidelines
* More advice.
* LEARN ABOUT TEST NAMING CLAUDE!!!!
* More advice
* Appease Kondo
* I have a lot to say I guess
* Iterate on CLAUDE.md
* Clarify module linter cheating rule
* CLAUDE u iz dumb
* Chaos
* Dumb as a rocc
* EVEN. MORE. GUIDELINES.
* Clarify semicolon rules more
* Threaten our AI overlords
* Are you dense?
* Annoyed
* BE SUPER DUPER EXPLICIT
* Fun time
* fun
* More dumb comment examples
* Clarify defmethod rules
* SERIOUSLY!!!
* I don't think Claude can count
* More examples of what to avoid
* U not listening
* Clarify
* Use emojys
* Parens
* Be. Even. More. Explicit. About. Semicolons.
* Be SUPER EXPLICIT
* Clarify
* Discourage `qp.store/with-metadata-provider`
* Move SmartScalar subcomponents to separate files
* Update getValueHeight to support multiple comparisons
* Fix dashcard header height
* Fix overflow with cheap tactics
* Hide all but 1 comparisons if they don't fit
* Fix line height
* Move PreviousValueComparison to its own directory
* Extract DetailCandidate
* Extract VariationPercent
* Extract DetailCandidate
* Remove inTooltip prop in VariationPercent
* Add hidden comparisons to the tooltip
* Update constant
* Add ellipsis badge
* Do not use " • " as text separator
* Make tooltip text white
* Wrap text in the tooltip
* Fix text alignment
* Revert static viz change
* Add e2e test
* Update tests
* Update Loki Snapshots
* Remove separator in static viz
* Update Loki Snapshots
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
* Allow passing error/friendly in malli schema's to declare them to be be safe for users to see
* Add a user-friendly error message when aggregations don't contain aggregations
* Allow :error/message to be a thunk
* Add repro for metabase#61893
* Use deferred-tru for error message
* Remove deferred-tru
* Fix regression with :async? requests
- callbacks were not passed and clj-http would throw
* Fix data correctness issue if cancelled during table read
Fixes an issue where cancellation during the read stage
could cause the python run to receive (and output) truncated/empty incorrect data and write back / succeed anyway.
* Add cancellation test
* Give script a bit more time for CI
* Disable cancellation test for problematic drivers
* Also disable redshift
* Also disable mongo
* Fix regression due to merge conflict
* disable comments in an iframe
* Remove comments from UI for embedded scenario
* Make isWithinIframe check external for CommentsMenu
* Add e2e test to check that comments are not available in embedded app
* Update Loki Snapshots
---------
Co-authored-by: stasgavrylov <stasgavrylov@gmail.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
* Add missing class to ClickActionIcon
* Remove superflous transition
* Move ClickActionsTextIcon to css
* Move ClickActionControl to css modules and metabase/ui
* Tweak css to match prevouis button height
* Split fields returned for cards/models into core fields and related_tables
* Update tests, and fix implementation to always include :related_tables
* typo
* fix kondo
* add separate with_related_tables flag to get-table-details API
* add test for new flag
* fix malli recursive schema
* add back query-needed?
* support related-tables when fetching table details as well, not just models
* add get-table-details-related-tables-test
* don't overwrite tyler's 404 fix
* Extract lazy-evaluation of currencyMapCache to an iife
* Add getCurrencySymbolNative
* Add narrow symbol support
* Update unit tests
* Add test
* Add e2e test
* Fix issue with current value not being shown
* Fix#54317: Object detail navigation state doesn't reset
Added a verification that caps the selected object index.
* Fix#54317: Changed useState and reseted index.
Now using useEffect and reseting to the first index.
* Fix#54317: Added an e2e test
* Adjust test to new filters
---------
Co-authored-by: Sébastien <sebastien@metabase.com>
Co-authored-by: Jakub Chodorowicz <jakub.chodorowicz@metabase.com>
Co-authored-by: Jakub Chodorowicz <jakub@chodorowicz.com>
* js source of truth for colors
* use more betterer colors
* keyboard shortcut for toggling dark mode
* Adds colorConfig for defining a light and dark color for each color variable
* Copies over dark colors from `dark-mode` branch (excluding variables that don't exist in colorConfig`
* Ports other style changes from `dark-mode` branch
* Revert 3301ed93693
* Ports mantine theme logic from `dark-mode` but uses SSOT colorConfig instead of SEMANTIC_COLOR_SCHEMES
* Fix TS errors
* Fix text color and random white bg on permissions table
* Removing a bunch of usages of JS color... probably breaking things
* Updates mantine color scheme when resolvedColorScheme changes
* a bunch more
* fix progress bars. shame on Nick
* Stubs out forcing light mantine theme when isEmbedding (since it has its own dark mode)
* Fix hard-to-read dark mode straggler caused by one-off bg color
* add orionAlphaInverse colors
* make lighthouse illustration work with CSS vars
* Fixes hover states of query builder header buttons in dark mode
* Updates PivotTables in dark mode to behave similarly to night mode
* Fix upsell CTA hover color in dark mode
* Tweaks admin nav dark mode color
* some small fixes
* Fixes some incorrect brand color values when white-labeling
* Tweaks admin nav bar colors and uses same colors on dark mode as light mode (if it ain't broke...)
* Fix gauge visualization text/input colors in dark mode
* Makes things legible and more consistent in query builder in dark mode
* Fixes a few filter chip stragglers in dark mode
* metabot visits the dark side
* Use ColorSchemeToggle for dashboard night mode button
* Prevents dashboard from using night mode when theme=night is set in the hash
* Update color.ts
* Revert "Prevents dashboard from using night mode when theme=night is set in the hash"
This reverts commit 06a504c088e31c60aca7c7550aa24a0f32edba6c.
* set color scheme for scrollbars
* hard to see toggle in database info
* Embedding and other fixed
* fix blue brand
* Uses canonical dark mode for dashboard night mode and static embedding's dark mode
* Fixes issue where Static Embedding preview pane doesn't show checkerboard background when "Dashboard background" is turned off
* Updates find-never-defined-css-variables.ts so it looks for defined variables in colors.ts. Removes references to now-removed base colors.
* Fixes some TS errors
* happy-ish static viz
* only resolve to color var if name is known
* type corrections, removing auto color scheme
* Passes storybook theme arg to ThemeProvider
* add konami code shortcut for Vamsi
* Fix dashboard context TS errors
* Fix runtime warning
* Prevents whitelabel colors from being used in colors.ts when token lacks whitelabel feature. Updates `filter` and `summarize` colors to use whitelabel value if present.
* re-enable updateColors
* happy types
* Updates storybook renderer to work with stories that set the theme via theme: "dark"
* Fix issue where DatesRangeSdk story doesn't pick up brand color
* green unit tests?
* Reverts unnecessary change carried over from original `dark-mode` POC which changed some loki/storybook backgrounds
* Fix issue where theme switching themes in Question embed previews doesn't appear to do anything
* handfull of e2e suites
* Revives some `theme` infrastructure needed to support `theme=transparent`
* Restores SdkError colors on dark mode (#64306)
* happy unit and e2e tests?
* Fix lint errors
* feat(sdk-bundle): use existing tooltip configuration for dark mode (#64325)
* fix card shadow crash
* backdrop color fix
* Refines ColorSchemeToggle. Color scheme is "auto" by default. When "auto", color scheme is automatically updated when browser/device settings is changed. Switching to the theme that's defined as the browser/device preference will set the color scheme to "auto".
* Adds clarifying "(system preference)" to color scheme toggle tooltip
* embedding e2e, unit tests
* Fix TS error
* update colorConfig for sdkThemeProvider
* force e2e to run in light mode
* Fix embedding-sdk:docs:generate error
* Updates ThemeProvider to ignore from hash if we're outside of static embeds. This prevents old night mode dashboard urls from messing with the new dark mode.
* Fix issue where dark mode shortcut isn't pulling in the latest values (not toggling right)
* Replace hardcoded value with already-defined constant
* fix quotes in css
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* use firefox compatible scale
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* fix css quotes
* fix color scheme toggle
* fix test
* fix conflict
* update test
* PR Feedback
* fix embedding homepage flicker
* e2e adjustment
* adding text-hover, fixing checkbox border
* setup.cy green plz
* e2e test for toggling color scheme
* e2e plz
* type check
* e2e adjustment
* Update Loki Snapshots
* test colors in RGB
* OS check for shortcut
---------
Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
Co-authored-by: AlessioLaiso <7041012+AlessioLaiso@users.noreply.github.com>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
Instead of hard-coding a "metabase-ai" as the only add-on,
we're now parametrizing this endpoint to accept different
product types, which translates into buying different add-ons.
* Alternative fix for internal queries
reenable the admin screen for http://localhost:3000/admin/tools/errors
I know we aren't supposed to look at any piece of a query, including
type here, but there are a few reasons i'm doing so.
1. i don't know of any predicates in mbql lib for this
metabase.lib.core doesn't have a `native?` predicate, nor an `mbql?`
predicate. It does seem have predicates about stages but that doesn't
seem applicable here
2. even if it _did_, the internal query is not recognized by lib, so we
then have to teach it internal queries which means the other PR (#64375)
has to be implemented either way, defeating the purpose of this very
simple PR.
```clojure
user=> (metabase.lib.core/any-native-stage? {:limit 1,
:type :internal,
:fn "metabase-enterprise.audit-app.pages.queries/bad-table",
:args [nil nil nil "last_run_at" "desc"],
:offset 0,
:parameters []})
Execution error (ExceptionInfo) at metabase.lib.walk.util/fn$fn (util.cljc:72).
Invalid input: {:lib/type ["missing required key, got: nil"], :stages ["missing required key, got: nil"]}
```
Why aren't there tests?
🤠
Want to contrast the two approaches first. Happy to backfill tests once
the approach is agreeable. This approach here is _very_ simple and lets
the working qp approach continue working without disturbing
metabase.lib. This seems pretty nice because ultimately these internal
queries should/will be replaced. But in the meantime, do we want to
teach lib about them, or just skirt it altogether?
* test that api works for these queries
* enable feature in test
The python code is executed by the runner but its output is not saved back. The endpoint blocks
until the output is received.
Any objects in S3 should be deleted before the request returns (or will otherwise be collected via retention)
Limits:
- Run timeout is set to 60 seconds
- Samples up to 100 rows from each input table.
- Outputs up to 100 rows from the python output.
Fixes#63245.
Add `:reversed? true` option to `lib.walk/walk-stages` that reverses the order.
Then use that option for `qp.middleware.add-implicit-joins/second-pass`, since that `second-pass`
is about making sure if stage N needs an implicitly joined column from the previous stage, that the
previous stage actually returns it. #63245 happens when the join clause and usage are 2+ stages apart.
Flipping the iteration order will push the need for the implicitly joined column through as many stages
as necessary.
* use local datetime instead of zoned datetime when creating exclusion filters from parameters
* use local datetime instead of zoned datetime when creating exclusion filters from parameters
* Configure ESLint to prevent test files going into SDK build
* Fix SDK build to not include test files
* Fix the config to allow __support__/metadata
* Revert a file I thought was a test file
* Make rules consistent
* Clean up tsconfig pattern
* Make the error message less repeatable
* Fix incorrect separator on FE and add guard to setting
* Reproduction
* when-some
* Add FE test
* naming
* Update frontend/src/metabase/admin/settings/components/widgets/FormattingWidget.unit.spec.tsx
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
---------
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
* WRK-905: Allow commenting on an unsaved document
* Fix e2e tests
* Remove 'disabled' prop from CommentsMenu. Remove force click in comments test
* Allow editing document when comments sidebar is opened
* Fix linting
* Fix e2e tests
* Address PR comments. Allow charts editing when comments sidebar is open
* store transform revisions
* Add tests
* remove unneeded arity
* fix whitespace
* include impl.transform in revisions.init
* move transform test to enterprise folder
* use =? and check unneeded keys were removed
* revert =? use
* dissoc source from transform comparison
* Allow token without exp, but raise a warning
* Fix typing
* Fix wrong doc link anchor
* Fix doc link accessible label
* Add a test
* Fix sso endpoint calling repeating when jwt doesn't contain `exp`
* Fix unit tests
* Fix test for real!
* Fix test name typo
Co-authored-by: Nicolò Pretto <info@npretto.com>
* Use correct terminology "session"
Co-authored-by: Nicolò Pretto <info@npretto.com>
* Fix showing no EXP claim warning when the token is being fetched
Co-authored-by: Nicolò Pretto <info@npretto.com>
---------
Co-authored-by: Nicolò Pretto <info@npretto.com>
Fixes https://github.com/metabase/metabase/issues/62179
Before (and bad) (wordwrap introduced for clarity):
```
2025-08-14 16:17:36,662 WARN app-db.liquibase :: The following
changesets were not rolled back. Likely because they are not in the
changelog file: v56.2025-06-05T16:48:48, v56.2025-06-06T20:11:53,
v56.2025-06-06T20:11:54, v56.2025-06-06T20:11:55,
v56.2025-06-06T20:11:56, v56.2025-06-06T20:11:58,
v56.2025-06-13T15:00:00, v56.2025-07-07T08:02:43,
v56.2025-07-17T20:11:55, v56.2025-07-17T20:11:56 2025-08-14 16:17:36,662
INFO liquibase.logging :: Successfully released change log lock ```
```
And now:
```
2025-10-01 16:00:19,326 INFO app-db.liquibase :: Rolling back app database schema to version 55
2025-10-01 16:00:19,326 INFO app-db.liquibase :: Going to roll back changeset v56.2025-07-17T20:11:56
Rolling Back Changeset: migrations/056_update_migrations.yaml::v56.2025-07-17T20:11:56::edpaget
2025-10-01 16:00:19,328 ERROR app-db.liquibase :: Error rolling back migration v56.2025-07-17T20:11:56
liquibase.exception.RollbackFailedException: liquibase.exception.DatabaseException: ERROR: column "jwt_attributes" does not exist
Position: 41 [Failed SQL: (0) UPDATE core_user SET login_attributes = jwt_attributes WHERE sso_source = 'jwt']
at liquibase.changelog.ChangeSet.rollback(ChangeSet.java:1041)
...
Caused by: liquibase.exception.DatabaseException: ERROR: column "jwt_attributes" does not exist
Position: 41 [Failed SQL: (0) UPDATE core_user SET login_attributes = jwt_attributes WHERE sso_source = 'jwt']
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:520)
... omitted
... 65 more
Caused by: org.postgresql.util.PSQLException: ERROR: column "jwt_attributes" does not exist
Position: 41
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2734)
... 70 more
2025-10-01 16:00:19,330 WARN app-db.liquibase :: The following
changesets were not rolled back. Likely because there were errors in
rollback (v56.2025-07-17T20:11:56): v56.2025-06-06T20:11:53,
v56.2025-06-06T20:11:54, v56.2025-06-06T20:11:55,
v56.2025-06-06T20:11:56, v56.2025-06-06T20:11:58,
v56.2025-06-13T15:00:00, v56.2025-07-07T08:02:43,
v56.2025-07-17T20:11:55, v56.2025-07-17T20:11:56 2025-10-01 16:00:19,330
INFO liquibase.logging :: Successfully released change log lock
```
How i recreated:
connected to a jar:
```
MB_DB_CONNECTION_URI="postgres://dan:password@localhost:5432/downgrade-checks" MB_JETTY_PORT=2999 java "$(socket-repl 6000)" -jar $JARS/1.56.6.2.jar
```
```sql
downgrade-checks=# alter table core_user drop column jwt_attributes;
ALTER TABLE
```
this will make a downgrade fail:
```yaml
- changeSet:
id: v56.2025-07-17T20:11:56
author: edpaget
comment: |
Add sync login_attributes with jwt_attributes, we need to replace jwt_attributes
with login attributes for users with sso_source jwt so that they will get the new
behavior where login_attributes can override jwt_attributes
changes:
- sql: >-
UPDATE core_user
SET jwt_attributes = login_attributes, login_attributes = '{}'
WHERE sso_source = 'jwt';
rollback:
- sql: >-
UPDATE core_user
SET login_attributes = jwt_attributes
WHERE sso_source = 'jwt';
```
This will fail as the `jwt_attributes` column has been removed.
```
Error rolling back migration v56.2025-07-17T20:11:56
liquibase.exception.RollbackFailedException: liquibase.exception.DatabaseException: ERROR: column "jwt_attributes" does not exist
Position: 41 [Failed SQL: (0) UPDATE core_user SET login_attributes = jwt_attributes WHERE sso_source = 'jwt']
```
And then connect to the jar again, redefine the changes here, and run
```clojure
(let [data-source (metabase.app-db.core/data-source)]
(with-open [conn (.getConnection ^javax.sql.DataSource data-source)]
(with-liquibase [liquibase conn]
(rollback-major-version! conn liquibase false))))
```
* Fix `u/slugify` function's max-length option
`u/slugify` url-encoded non-ASCII characters, then took `max-length`
chars off the result.
Both make sense in isolation - but if we're slugifying, e.g., the string
勇士, with max-length 10, this results in:
- first, url encode non-ASCII characters => "%E5%8B%87%E5%A3%AB"
- then, take 10 characters => "%E5%8B%87%"
But a bare `%` character, as in the trailing character above, is not
valid URI syntax.
Discovered in [UXW-666: Users can't download results for questions with
long cyrillic names, error "URL
malformed"](https://linear.app/metabase/issue/UXW-666/users-cant-download-results-for-questions-with-long-cyrillic-names)
but there are probably more cases where this has caused mischief.
* fix test
These log lines will now be debug level warnings rather warning level warnings.
```
<lib.normalize> Error normalizing MBQL 5
<lib.field.resolution> We tried every trick we could think
<lib.join> Failed to find matching column in join
```
Intrepid readers will also notice that moved "Resolved field %s to an
expression. ..." to debug as well.
* Fix downloading tables grouped by datetime->int
The Linear task has a slightly more involved setup. I found that I could
replicate the issue with a slightly simpler setup:
- set up a simple query:
- select COUNT from ORDERS
- group by the day of the month
- log in as the sandboxed user
- try to download the card results (as CSV, XLSX, etc)
- see the error
Why does this happen? I found that, for a sandboxed user, the query
results show the "day of the month" column as having
```
:base_type :type/DateTime,
:database_type "TIMESTAMP",
:effective_type :type/Integer,
```
while an admin user sees the same column as having
```
:base_type :type/Integer,
:database_type "INTEGER",
:effective_type :type/Integer,
```
This seems bizarre and worth looking more into, but honestly shouldn't
really matter - if the effective type is an integer, we certainly
shouldn't be formatting it as a datetime.
`field-is-type?` is only used for checking whether a field is temporal
for formatting purposes, so I think this is a relatively low risk
change, and note that `metabase.lib.types.isa/temporal?` (the
replacement suggested by the deprecation notice for
`metabase.types.core/temporal-field?`) returns `false` for both
cases.
[UXW-660: Pivot tables with integer breakout columns fail to download as formatted XLSX for sandboxed tables](https://linear.app/metabase/issue/UXW-660/pivot-tables-with-integer-breakout-columns-fail-to-download-as)
* Write a test
* add python runner timeout as setting
* set timeout status
* add timeout status test
* appease kondo
* proper script
* Fix if: expr in upload runner logs
* Fix python runner log name
* Remove setting qualifier
* Add python-runner-timeout-seconds to FE settings type
* Ensure premium feature enabled so setting can be changed
---------
Co-authored-by: Dan Stone <wotbrew@gmail.com>
* Add context to Save verb
* Add key
* Extract button from nested t
* Find other instances of nested c(...).jt`...${<x>...</x>}...` calls and unnest them
* Remove extra interval tick when there is only one interval
* Add repro for metabase#63671
* Update Loki Snapshots
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
* Fix can't drill SQL questions in embedding SDK
* Add tests
* Fix the audit DB should not be able to see SQL
* Fix every CI check failing from updating from master
* Address code feedback, make it more clean
* Fix transducer order
* pin shape
* Update docs/questions/visualizations/map.md
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* wording
Clarified limitations on data points for maps and added details about pin types.
* image
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
Very silly bug, we were just populating the ID with the wrong
thing (`(:database-id table)` instead of `(:db_id table)`), so the FE
couldn't build links correctly.
There was a mismatch between `recent_views` and `popular_items`
endpoints. They have different queries, but are using the same
postprocessing function. So I needed to unify them: both now use
`:db_id`.
* Fix ssh tunneling for clickhouse
* Remove questionmark
* Use kebab case keys
* Fix kondo;
This is also fixed in https://github.com/metabase/metabase/pull/63645,
so there may be a conflict.
* Don't squash exceptions.
* remove some tests, fix some tests
I removed some tests. Let's be very clear why this is happening. Push
back if you disagree:
```clojure
(deftest clickhouse-connection-fails-test
(mt/test-driver :clickhouse
(mt/with-temp [:model/Database db {:details (assoc (:details (mt/db)) :password "wrongpassword") :engine :clickhouse}]
(testing "`driver/database-supports? :uploads` does not throw even if the connection fails."
(is (false? (driver/database-supports? :clickhouse :uploads db)))
(is (false? (driver/database-supports? :clickhouse :uploads nil))))
(testing "`driver/database-supports? :connection-impersonation` does not throw even if the connection fails."
(is (false? (driver/database-supports? :clickhouse :connection-impersonation db)))
(is (false? (driver/database-supports? :clickhouse :connection-impersonation nil))))
(testing (str "`sql-jdbc.conn/connection-details->spec` does not throw even if the connection fails, "
"and doesn't include the `select_sequential_consistency` parameter.")
(is (nil? (:select_sequential_consistency (sql-jdbc.conn/connection-details->spec :clickhouse db))))
(is (nil? (:select_sequential_consistency (sql-jdbc.conn/connection-details->spec :clickhouse nil))))))))
```
This test is _GONE_ because it's insane that we are testing that
`conneciton-details->spec` and `database-supports?` is resilient to
opening a connection to a server. That's nuts. We don't do that any
more. Should be the same as if checking `(+ 1 1)` doesn't open a network
connection. We get version information in
```clojure
(def ^:private ^{:arglists '([database])} get-clickhouse-version
(memoize/ttl
^{:clojure.core.memoize/args-fn (fn [[database]] (:details database))}
(fn [database]
(sql-jdbc.execute/do-with-connection-with-options
:clickhouse
(sql-jdbc.conn/db->pooled-connection-spec database)
nil
(fn [^java.sql.Connection conn]
(with-open [ver-stmt (.createStatement conn)
ver-rset (.executeQuery ver-stmt clickhouse-version-query)
cloud-stmt (.createStatement conn)
cloud-rset (.executeQuery cloud-stmt "SELECT value='1' FROM system.settings WHERE name='cloud_mode'")]
(cond-> nil
(.next ver-rset)
(assoc :version (.getString ver-rset 1)
:semantic-version {:major (.getInt ver-rset 2)
:minor (.getInt ver-rset 3)})
(.next cloud-rset)
(assoc :cloud (.getBoolean cloud-rset 1)))))))
:ttl/threshold default-cache-ttl))
(defmethod driver/dbms-version :clickhouse
[_driver db]
(get-clickhouse-version db))
```
We don't need to run this query every time you get a connection spec or
ask if the database supports something. We have the version and if it's
cloud and that's sufficient. The only reason it was opening a connection
was to run the cloud check (`select value=1 from system.settings where
name=cloud_mode`) above.
Also removed:
```clojure
(deftest impersonation-support-check-over-ssh-tunnel-test
(testing "driver-supports? :connection-impersonation should work through an SSH tunnel (#62377)"
;; Use an in-memory SSH server that forwards to the correct port through localhost.
;; Since the real database is still reachable locally, it's possible for the driver to ignore the SSH tunnel and
;; still connect to the DB. So this test runs twice, once with all correct and once with an incorrect SSH
;; password. The latter check should fail (returning false for `driver-supports?`) if the SSH tunnel is being
;; respected.
(mt/test-driver :clickhouse
(let [username "username", password "password"]
(with-open [ssh-server (driver.tu/basic-auth-ssh-server username password)]
(doseq [[correct-password? ssh-password] [[true password] [false "wrong-password"]]]
(memoize/memo-clear! @#'clickhouse.version/get-clickhouse-version)
(let [ssh-port (.getPort ssh-server)]
(with-ssh-tunnel! {:tunnel-enabled true
:tunnel-host "localhost"
:tunnel-auth-option "password"
:tunnel-port ssh-port
:tunnel-user username
:tunnel-pass ssh-password}
(testing (str "using " ssh-password)
(is (= correct-password?
(driver/database-supports? :clickhouse :connection-impersonation (mt/id)))))))))))))
```
Again, this is verifying connection resiliency in a call
to `(driver/database-supports? :clickhouse
:connection-impersonation (mt/id))` and ensuring that it uses the ssh
tunnel. This entire concern is gone, and a red flag that it ever
existed.
Changes:
a few tests used the `db` from `with-temp` to do stuff, but now that we
require them to have dbms_version i populated that
in the version check i thought i saw one in test going through with
`dbms-version` and not `dbms_version` so i'm checking both just to be
sure. it's a bit sloppy
* small changes and add back test
* handle dbms-version vs. dbms_version
* fix kondo
---------
Co-authored-by: Riley Thompson <riley@metabase.com>
Co-authored-by: dan sutton <dan@dpsutton.com>
Co-authored-by: Riley Thompson <rileythompson99@gmail.com>
* Factor out setup/log actions for python runner, use in driver tests
* Remove redundant cd
Co-authored-by: Nicolò Maria Mezzopera <nicolo.mezzopera@metabase.com>
---------
Co-authored-by: Nicolò Maria Mezzopera <nicolo.mezzopera@metabase.com>
* Pass className to native editor
* Add missing border on top of native editor
* Set minimal editor height so the results panel is always visible
* Move initial height calculation to hook
* Add missing import
* Use late-binding for handlers so they can change without having to recreate markers
* Allow isEditing props to re-render Map component
* Allow disabling zoom control on maps
* Allow clicking the Map action buttons
* Disable zoom and hover when in editing mode
* Add repro for metabase#64138
* Fix e2e tests
* UXW-1766 Fixes issue where getDashboardHeaderParameters looks at all cached dashcards rather than just the ones from the currently viewed dashboard
* UXW-1766 Adds/updates unit tests
We're introducing a new endpoint in metabase/metabase. It sends the feedback to the backend which then (1) fetches the premium token and (2) constructs the correct store api URL with the same feedback as the payload. Our backend acts as a proxy because the api url contains the token and we can't send it from the FE.
* Extract native query content for search indexing rather than the entire dataset_query structure
* remove inline def
* Fix doc string
* Update search spec field-fields logic to support the :fn syntax to fix test
* Remvoe query_type from expected card spec fields as we're no longer using it to detect native query changes
* Address feedback on :fn semantics, and add a more detailed docstring to define-spec macro
* feat: use new detail view in metadata preview
* drop relationships
* fix e2e helper
* use correct '
* make table responsive
* update helper
* adjust values in tests
* use useSampleData
* rework approach
* update helper
* oops, lost changes
* restore test
* let's add table just in case
* another attempt
* responsive
* restore indexes
* rename index -> rowNumber
* show details group in more cases
* remove force: true
* fix index
* When deleting DB, hide cards from search
We have a current issue with search: deleting items does not actually
remove them from search.
This is a particularly nasty version of this, because while usually a
delete follows an update (that marks the card as archived,
which *does* remove it from search), in this case we're just deleting
the items directly as part of an `ON DELETE CASCADE`.
This is a bit hacky, but for now we can just mark them as `archived`
before we delete them to hide them from search.
[UXW-602: Search API returns inexisting cards](https://linear.app/metabase/issue/UXW-602/search-api-returns-inexisting-cards)
* Add i18n / formatting to existing log calls
* Cleanup log conveyance to failure :message
* Improve error feedback capability
- Ensure exception messages do not leak to user logs by default 'Something went wrong'
- Exceptions can carry a `transform-message` key to provide a custom failure message (with i18n)
- Defined messaging for:
- Error during table copy
- Error during execution
- Error during writeback
I would like to follow up with additional context in the form of message log entries for further progress / context of any failure.
Logs can be correlated to metabase logs for stack traces or further debugging. Python output remains presented as-is (traceback etc).
* [match] Prevent match-lite from extracting common result that depends on uncommon bindings
* [match] Fail if match-lite's :guard is provided with incorrect predicate syntax
Also fix its treatment of named functions passed as predicates.
* Inline AdminPaneLayout
* Do not show invite button on deactivated tab
* Simplify
* Use modern button
* Add tabs in People page
* Move mb
* Fix typo
* Make people search input full width
* Move tabs to the top
* UXW-333 Prevents `updateDashboardAndCards` from being called when discarding changes (still called when clicking "Save changes")
* UXW-333 Adds e2e test
* for fetching tiles encode field refs as safe base64
* clojure implementation
* update public api
* pass lat and lon fields in query params
* specs
* fix specs
* update preview endpoints and tests
* clean up previous url safe base64 implementation
* fix specs
* UXW-709 When drilling into a dashboard card that had a filter applied, the resulting query can now be saved outside of the original dashboard. "New Question"/"New SQL query" via dashboard edit screen behavior is unaffected (still forces you to save to that dashboard).
* UXW-709 Updates unit tests
* Allow redirect url from password reset page
* Add await when inviting user so that errors will be displayed
* Allow for different email content when inviting user from setup / Set returnUrl param
* Code refinements
* Add backend tests
* Add frontend tests
* Run formatter
* handle email content when invitor's first name is empty/unset
* Allow running dev on custom MB_FRONTEND_DEV_PORT
Signed-off-by: Jakub Chodorowicz <jakub@chodorowicz.com>
* Unify port env var naming between JS and Clojure
* Add dev server port info
* Update devenv docs
Co-authored-by: Sébastien <sebastien@metabase.com>
* update docs
---------
Signed-off-by: Jakub Chodorowicz <jakub@chodorowicz.com>
Co-authored-by: Sébastien <sebastien@metabase.com>
* Add working table with 2 columns
* Table layout and dnd polishing
* ResizeNode
* Refactor to use grid container
* Add Card node title ellipsification
* cleanup, add min height
* Fix FlexContainer to work with ResizeNode
* Fix empty ResizeNode after card dnd
* Document layout no dnd kit (#63363)
* using tiptap drag and drop
* Fix some issues with dnd
* Add support for resize node, fix styles
* Remove comments
---------
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
* Fixes after merge comments
* Fix issues with dnd logic
* Fix issue where rearranging columns within a flexContainer didn't respect which side of a cardEmbed we dropped; it always inserted dragged column to the left.
* Fix issue where moving a cardEmbed out of a flexContainer and placing it right after doesn't wrap the card in a resizer
* Fix issues with dropzones and card id
* Fix issue with column resize handlers
* Fix issues with cards previews on dnd
* Feat: UXW-717 Reconcile comments with document layout (#63593)
* UXW-717 Add comment option to cardEmbed menu
* UXW-717 Wires up comment option in cardEmbed menu
* UXW-717 Stubs out CommentsMenu reorganization so logic can be reused inside cardEmbeds (button and menu item)
* UXW-717 Design tweaks per design feedback (and fixes ts error)
* UXW-717 Updates hover state of cardEmbed ellipsis menu trigger per design feedback
* Fix issues with funnel chart and resizer
* Fix issues with column rearrange
* Fix adding third column position
* UXW-739 Adds ResizeNode wrapper to charts added by metabot
* UXW-749 [1/2] Fix: Cutting/copying a chart from a group then pasting it (cmd+v) results in a chart without a resizeNode
* UXW-749 [2/2] Fix: Copying and pasting from one chart to another doesn't preserve the structure correctly
* Refactor dnd logic - consolidate all use cases in HandleEditorDrop
* remove redundant message and add_message icons
* actually remove redundant message icons
* replace references to old icons with new icons
* Fix issue with dropping a card into existing flexContainer
* Fix issue with moving a card from one flexContainer into another
* UXW-748 - Fix broken document when typing with a card selected
* Handle dropping cards onto paragraphs (#63754)
* Handle dropping cards onto paragraphs
* PR Feedback
* cleanup flex containers
---------
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
* small feedbacks
* breaking up document drop handler
* UXW-689 - add basic e2e tests
* type fix
* loki diff
* Add more e2e tests
* Fix typecheck
* happy types
* passing document.cy.spec
* Fix e2e tests
* e2e test for card resizing
* flex container column resize tests
* Add node deletion e2e tests
* Fix review issues
* Try to fix typecheck
* Refactor useCommentsButtonProps to a react component
* final PR feedback
* fix removing a card via menu
---------
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
Co-authored-by: Maz Ameli <maz@metabase.com>
Co-authored-by: Nick Fitzpatrick <nick@metabase.com>
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Previously `extract-query "NativeQuerySnippet"` would use standard method for exporting entities, which checks for
collection_id in entity and prevents its export if it's outside requested collections.
While that makes sense for Cards (and we do escape analysis for those), snippets live in their own separate collection
namespace and this logic is not relevant to them. So now we export either those in requested collections _or_
dependencies of cards that are being exported.
* cherry pick driver code (#63628)
* cherry pick driver code
* update changelog
* add type->database-type unit tests
* kondo
* create/insert table
* insert-from-jsonl test
* missing rename-tables for snowflake
* extend rename-tables-test to more drivers
* line breaks
* add driver python transform feature
* handle review comments
* kondo
* feat: replace string->val with a more generic insert-col->val
* remove non transactional impls
* chore: docsstrings
* TODO
* extra test
* fix extra test
* test all base-types
* fix sqls
* setup ci properly (#63693)
* S3 transport layer for python-runner (#63697)
* Add s3 dependencies (#63706)
* port prometheus/instrumentation (#63631)
* port prometheus metrics
* port instrumentation
* instrument existing transform paths
* wider buckets
* remove nil handling
* warn on nil bytes/rows
* add stage-type mapping
* typo
* split CI into separate jobs (#63746)
* Add python_runner.clj (#63747)
* Add python runner
* Kondo
* Traceback fix
* Remove dead code
* start the runner by default
* Cancellation not used yet
* Remove unused keys from fields-metadata
* cherry pick driver fixes
* start for postgres and mysql as well
* clickhouse fixes
* relax for snowflake
* typo
* exclude transform-python-test from appdb
* exclude transforms-python-test as well
* try exclude-tag here too
---------
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
* execute.clj (#63755)
* execute.clj
* with drivers test and execute test
* with wait tables
* missing utils
* /s/open/start
* fix failing tests due to getting the wrong source and target
* kondo
* move cancel-python-code-http-call to python-runner
* Dan's feedback
* we have 2 implementstation of cancel
* and 2 db-routing-enabled?
---------
Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
* Transforms python APIs (#63762)
* transforms python api
* new tests pass locally
* clean up the db id utils
* move to util
* fix: missing refer
* chore: missing tests/kondo
* kondo
* more kondo
* fix: make function resilient
* eh, validate on old
* on new
* Add python transform support for jobs (#63764)
* Add python transforms job support
* Fix whitespace in when
* Avoid churn due to new local
* Add feature test
* Add ignore for logs (there might be away to avoid this)
* Use new target-database-id util
* Remove duplicated fn
---------
Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
Co-authored-by: Dan Stone <wotbrew@gmail.com>
* Move transform ordering tests to the python module (#63827)
* Add transform ordering tests to the python module
- Consistent with api tests for python transforms being in the python
module
- In practice transforms module 'knows' about python, so this is
organizational only
- Copied test helpers for now, not sure if functions strong enough to be
shared
* Check :transforms/python
* Proj python/table name len (#63842)
* feat: ensure temp-table-name respects max length
* add unit test
* add limit for missing drivers
* depend on it
* fix: use db instead of db-id
* Proj ptyhon/table swap (#63878)
* add rename feature, rename-table! multimethod
* add table swap with atomic or rename or fallback
* changelog
* drop requirement
* ensure we're testing replace flow
* wait for completion, table already exists
* wip
* add rename-table-test
* fix for snowflake
* fix: support bigints (#63898)
* fix: support bigints
* merge meta
* Frontend for Python Transforms (#63699)
* cherry pick driver code (#63628)
* cherry pick driver code
* update changelog
* add type->database-type unit tests
* kondo
* create/insert table
* insert-from-jsonl test
* missing rename-tables for snowflake
* extend rename-tables-test to more drivers
* line breaks
* add driver python transform feature
* handle review comments
* kondo
* feat: replace string->val with a more generic insert-col->val
* remove non transactional impls
* chore: docsstrings
* TODO
* extra test
* fix extra test
* test all base-types
* fix sqls
* setup ci properly (#63693)
* feat: add Python transform frontend pages
* Integerate with FE
* Fix wrong source field name used for showing script in transform view
* Revert "Fix wrong source field name used for showing script in transform view"
This reverts commit c7dfb541f3.
* Fix edit button not doing anything for python scripts
Closes QUE-2300
* call api proxy instead of internal call, also have settings page for transform
* python transforms now properly being scheduled
* FE select table when creating python transform
* multiple tables
* ensure tables are unique in tables selector
* source alignments
* run test
* dead code
* Better default schema, better docstring
* fixex test run
* add cancel button
* better endpoint name
* add cancel button to test python endpoint
* working button
* Auto-update Python transform function signature when table aliases change
- Automatically updates def transform(...) signature when aliases are modified
- Updates docstring Args section with aligned descriptions and table names
- Adds reset button to restore default slugified aliases
- Validates alias input to only allow valid Python identifiers
- Handles multi-line signatures for many parameters (>80 chars)
- Shows visual distinction between custom and auto-generated aliases
- Fixes code editor layout to prevent overlap with Run button
* feat: settings page with s3 configs
* feat: split settings
* remove placeholders
* eh, rename to appease the munging
* Logs are viewable inline during execution of python transforms
* Some minor fixes around docstring rewriting
* solve more fe lints
* fix type errors
* more type check fixes - including some smelly optional override stuff
* fix delete transform + table
* fix: don't remove indentation before """
* chore: allow empty schemas
* Critical fix: docstring indentation
* Separate file / s3 lifetimes / writes / reads from http calls (#63294)
- python-runner no longer simulates a single http api that does
everything (incl s3 interaction)
- Separates file lifetimes (shared storage) from execution
- Easier to see how to avoid reading into strings (e.g. for piping into
tmp files, follow up)
Earlier on we had a service that managed much of the I/O, metabase now
coordinates it so it makes little sense pretending there is still
an overall http api.
# Conflicts:
# enterprise/backend/src/metabase_enterprise/transforms/api.clj
# enterprise/backend/src/metabase_enterprise/transforms/execute.clj
# enterprise/backend/src/metabase_enterprise/transforms/python_runner.clj
# enterprise/backend/test/metabase_enterprise/transforms/python_runner_test.clj
* Add first-class PythonTransformSource type
# Conflicts:
# enterprise/frontend/src/metabase-enterprise/transforms/components/QueryEditor/EditorBody/EditorBody.tsx
* Lay python editor out in two columns
* Make python editor resizable
* Move parseCSV to utils
* Split off results into separate component
* Add empty and loading state components
* Split up ExecutionResult component
* Move python execution to separate hook
* Remove color in editor gutter
* Increase indentUnit for python
* Allow extension to be passed to CodeEditor
* Add pandas completions
* Use DataGrid for displaying results
* Python library APIs (#63378)
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
# Conflicts:
# enterprise/backend/src/metabase_enterprise/api/routes.clj
# enterprise/backend/src/metabase_enterprise/transforms/python_runner.clj
# enterprise/backend/test/metabase_enterprise/transforms/python_runner_test.clj
# enterprise/frontend/src/metabase-enterprise/api/tags.ts
# resources/migrations/057_update_migrations.yaml
* transforms python module (#63503)
# Conflicts:
# enterprise/backend/src/metabase_enterprise/transforms/api.clj
# enterprise/backend/src/metabase_enterprise/transforms/execute.clj
# enterprise/backend/src/metabase_enterprise/transforms/jobs.clj
# enterprise/backend/src/metabase_enterprise/transforms/util.clj
# enterprise/backend/src/metabase_enterprise/transforms_python/python_runner.clj
# enterprise/backend/test/metabase_enterprise/transforms_python/api_test.clj
# enterprise/backend/test/metabase_enterprise/transforms_python/e2e_test.clj
# enterprise/backend/test/metabase_enterprise/transforms_python/python_runner_test.clj
* Use normal title case
* Handle json-line output
* Remove unused props
* Rename PythonEditor to PythonQueryEditor
* Move script rewriter to utils
* Flatten Python transform page
* Rename shared to common
* Remove dead code
* Reduce specialization in Transform editor
* Remove unused props
* Move PythonQueryEditor to top-level components
* Nest Python editor components in PythonTransformEditor
* Restructure Python transform editor
* Split up component more
* Add helpers for python editor
* Disable default schema
* Add test ids
* Fix import path
* Reuse transform save modal
* Fix parameter
* Add e2e tests for python common lib
* Move python transform api to general transforms folder
* Move type to metabase-api/types
* Disable debugger for python transforms for now, allow to open it with query param
* Disable debugger hotkey for python transforms
* Add syntax highlighting to Python script on Transform page
* Remove cancelation code for now
# Conflicts:
# enterprise/frontend/src/metabase-enterprise/transforms/components/RunButton/RunButton.tsx
# enterprise/frontend/src/metabase-enterprise/transforms/pages/TransformPage/RunSection/RunSection.tsx
* Add more generic RunInfo
* Remove unused LogOutput
* Set up python runner in CI (#63566)
* Check out with submodules in CI
* Include python-runner in docker compose for tests
* Set up python runner in CI
* Fix import
* Update python-runner
# Conflicts:
# python-runner
* Fix font sizes
* Fix table layout
* Revert "Remove unused LogOutput"
This reverts commit 90c0704344.
* Add LogOutput back to runsection
* Remove duplicate schema field
* Use css instead of styled components
* Fix LogOutput styling
* Add transforms/python feature
* Do not allow picking unsupported databases
* Use slugify from metabase/lib/formatting
* Add type for transform alias map
* Fix some type imports
* Refactor PythonDataPicker
# Conflicts:
# enterprise/frontend/src/metabase-enterprise/transforms/components/PythonTransformEditor/PythonDataPicker/PythonDataPicker.tsx
* Further refactors
* Use data selector for database picker
* Use data picker to pick tables
* Remove unused var
* Improve tests for python transform
* Fix duplicate imports
* Use DatabaseId in python transform
* Remove source/draft ambiguity in types
* Move library types to metabase-types/api
* Remove api transforms
* Remove vibe-comment
* Remove unused component
* Validate source more
* Move TableInput to separate file
* Remove TableOption type
* Simplify props
* Move AliasInput to separate file
* Remove unused props
* Add border to empty results
* Fix import
* Remove extension
* Move draft back to new python transform page
* Fix new python transform page nesting
* Simpify new transform page structure
* Add analytics to history revision and data reference (#63587)
* Transform run cancellation (#62387)
* Add cancellation to transform api
* Use effect to set polling state
* Add cancellation button to run button
* Set up cancellation on transform page
* Use confirmation modal to cancel transform
* Add run cancel button to run list
* Make api endpoint take transform id instead of run id.
* Fix cancelation api
* Add canceled state to TransformRunStatus
* Add canceled state to transform page
* Add polling to RunListPage
* Remove comment in code
* Set status to canceling when you click cancel
* Add canceling status
* Poll when the transform is canceling
* Add copy for runs that are being canceled
* Manually track fetching status for running and canceling
* Handle canceling status in utils
* Avoid wrapping cancel button in run list
* Add test for canceling run on transform page
* Add e2e for canceling test from runs page
* Fix prop type
* Change copy to Canceling
* Add custom color to canceled state
* Remove mock code
* Increase cancelation tiemout
* Fix copy in text
* Fix snowplow event
* Remove void specifier and close modal in handler directyle
* Add optimistic update for run cancelation
* Avoid manually tracking cancelation status
* Avoid useEffect when changing isPolling
* Add in missing helper
* Remove another useEffect
* Add placeholder run when starting
---------
Co-authored-by: Eric Normand <ericwnormand@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
* Fix command z not working in connection string input (#63689)
- Stop preventing default event handling onPaste.
- Improve Cypress paste emulation to be compatible with React way of handling paste events.
* Transforms prepare for python (#63698)
* pull out transform run utils to prepare for python transforms
* fix: check running-run on transform-id, not run-id
* chore: put on a new line
* Fix#63629: Filter on cards causes an unnecessary horizontal scroll bar for public/static embedding (#63650)
* Closes EMB-50 tabs dimmed out on iOS (#63690)
* S3 transport layer for python-runner (#63697)
* Add s3 dependencies (#63706)
* port prometheus/instrumentation (#63631)
* port prometheus metrics
* port instrumentation
* instrument existing transform paths
* wider buckets
* remove nil handling
* warn on nil bytes/rows
* add stage-type mapping
* typo
* Implement data picker according to designs
* Further adjust to design file
* Fix some e2e tests
* Clone python runner when running CI
* Avoid starting the container in e2e tests twice
* Hide python runner admin route when user does not have the feature for it
* Remove unused variables
* Move Python runner amdin page to transforms plugin
* Do not show Python library link when the user does not have python transforms support
* Hide Python transforms features when the user does not have transforms-python token
* Use useHasTokenFeature hook where possible
* Add transforms-python feature
* Fix e2e tests
* Do not include python-runner in test docker-compose yet
* Tag tests for python transforms with @transforms-python
* Add helper to update Python library
* Add check for python output
* Fix Revert on python library when it does not exist
* Fix e2e test helper
* Add python runner settings in CI
* WIP
* Translate pandas definitions
* Add AnsiLogs component
* Use AnsiLogs in Logs components
* Use AnsiLogs in LogOutput component
* Remove token feature gate in enterprise folder
* Return alias instead of throwing
* Check type in isPythonTransform assertion
* Use isResourceNotFoundError
* Make transforms-python it's own plugin
* /s/localhost/localstack
* Add test for editing Python transform
* Verify that running the transform with the library works
* Add missing transforms-python feature to mocks
* Simplify source layout
* Change setting type of python runner token
* Fix tests
* Use ConcreteTableIds in python transforms only
* Deduplicate codemirror helpers
* Ignore errors in non-parseable JSON lines
* Use useLocation hook to enable debugger
* Use useErrorMessage helper
* Move SourceSection to transforms-python plugin
* Fix codemirror helpers
* Remove undefined color
* Fix types
* Fix codemirror helpers more
* Move transform ordering tests to the python module (#63827)
* Add transform ordering tests to the python module
- Consistent with api tests for python transforms being in the python
module
- In practice transforms module 'knows' about python, so this is
organizational only
- Copied test helpers for now, not sure if functions strong enough to be
shared
* Check :transforms/python
* Proj python/table name len (#63842)
* feat: ensure temp-table-name respects max length
* add unit test
* add limit for missing drivers
* depend on it
* fix: use db instead of db-id
* Proj ptyhon/table swap (#63878)
* add rename feature, rename-table! multimethod
* add table swap with atomic or rename or fallback
* changelog
* drop requirement
* ensure we're testing replace flow
* wait for completion, table already exists
* wip
* add rename-table-test
* fix for snowflake
* Extract sourceDatabaseId helper
* Fix e2e helpers
* Fix error in table picker
* Add missing test-id
* Fix transform tests
* Validate python source
* Fix issues after merge
* Fix tag test
* Fix other tag test
---------
Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
Co-authored-by: Nicolo-Maria <nicolo.mezzopera@metabase.com>
Co-authored-by: Dan Stone <wotbrew@gmail.com>
Co-authored-by: Chris Truter <chris@metabase.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Eric Normand <ericwnormand@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Jakub Chodorowicz <jakub.chodorowicz@metabase.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
Co-authored-by: Sébastien <sebastien@metabase.com>
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
* Proj python fix tests (#63970)
* add premium feature
* fix tests that didn't run previously
* exclude from vertica
* remove internal id from mongo table-rows
* fix: require transforms/python db feature for python transforms
* missing in stats
* fix for mongo
* whitespaces to appease the linter
* more more whitespace for the linter gods
* disambiguate for the e2e tests
* Some small type fixes for Python transforms (#64021)
* Remove duplicate helper
* Add updateEnterpriseSetting helper for type-correctness
* Add missing python runner settings
* Use correct setting name
---------
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
Co-authored-by: Chris Truter <crisptrutski@users.noreply.github.com>
Co-authored-by: Dan Stone <wotbrew@gmail.com>
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
Co-authored-by: Nicolo-Maria <nicolo.mezzopera@metabase.com>
Co-authored-by: Chris Truter <chris@metabase.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Eric Normand <ericwnormand@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Jakub Chodorowicz <jakub.chodorowicz@metabase.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
Co-authored-by: Sébastien <sebastien@metabase.com>
* Allow passing language as a plugin to CodeEditor
* Pull out NativeQueryPreview
* Render NativeQueryPreview in the native transform editor
* Relax prop types
* Add e2e test for query preview in transforms
* Fix e2e tests
* Pass query instead of question
* Use CopyButton instead of bespoke component
* Fix unit test
Attempting to use a snippet template-tag with a trailing space in the snippet name (e.g., `{{snippet: foobar }}`) caused an exception to be thrown when running the native query (missing required parameter).
The regex used for identifying snippet tags will now strip trailing spaces appropriately.
* Misc Lib improvements
* Restore deleted function... for now
* Test fix 🔧
* Mark more stuff in Legacy MBQL utils as deprecated
* Use Lib for query->source-card
* Update modules config
* Update tests 🔧
* Fix the X-Rays
* Druid test fix 🔧
* Appease Kondo
* docs: db routing with static embedding
Clarified limitations of database routing in Metabase.
* Update docs/permissions/database-routing.md
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* [perf] Suggest drop-in replacements for clojure.core functions from metabase.util.performance
* Fix walk for nil
* [perf] Make metabase.util.performance/reduce compatible with non-iterables (like strings)
Changes to any user attribute for sso users were failing preventing them
from being to set their user locale. This was due to us not checking if
`email` is present in the body of the update request before failing a
`check-403` call if the user has an sso source.
rather than 4.2.4.Final, they will now be "io.netty/netty-buffer
4.1.118.Final" which puts it the same as that in 3.5.0.
The issue is that both the bigquery-cloud-sdk driver and athena driver
get put onto the classpath and it depends on which order the drivers are
added for resolving which version of this netty buffer dep you get.
```clojure
user=> (metabase.classloader.core/the-classloader)
user=> (enumeration-seq (.. (Thread/currentThread) getContextClassLoader (getResources "io/netty/buffer/ByteBufAllocator.class")))
(#object[java.net.URL 0x3bb34fe "jar:file:/private/tmp/fixed-athena/plugins/bigquery-cloud-sdk.metabase-driver.jar!/io/netty/buffer/ByteBufAllocator.class"]
#object[java.net.URL 0x4ac1867d "jar:file:/private/tmp/fixed-athena/plugins/athena.metabase-driver.jar!/io/netty/buffer/ByteBufAllocator.class"])
```
One annoying bit to keep track of this is that bigquery uses a regular
jar that specifies its dependencies, so you can you regular tooling:
```
clj -X:deps tree :aliases '[:drivers]' > /tmp/deps.with.netty.downgrade
```
And then see those deps:
```
. metabase/bigquery-cloud-sdk /Users/dan/projects/work/metabase/modules/drivers/bigquery-cloud-sdk
. com.google.cloud/google-cloud-bigquery 2.54.2
. com.google.cloud/google-cloud-core 2.60.0
. ... [lots omitted]
. org.apache.arrow/arrow-memory-netty 17.0.0
X org.apache.arrow/arrow-memory-core 17.0.0 :older-version
. org.apache.arrow/arrow-memory-netty-buffer-patch 17.0.0
X org.apache.arrow/arrow-memory-core 17.0.0 :older-version
. io.netty/netty-buffer 4.1.110.Final
```
This version was created without any pinning of netty. Checking the
athena version is a bit more tricky. We use a fat jar. But you can
download the source from amazon as a jar with deps:
```
athena-jdbc-3.5.0-lean-jar-and-separate-dependencies-jars
```
https://docs.aws.amazon.com/athena/latest/ug/jdbc-v3-driver-previous-versions.html
This zip includes `runtime-dependencies` which includes
`netty-buffer-4.1.jar`
The pom inside of this jar specifies
```xml
<parent>
<groupId>io.netty</groupId>
<artifactId>netty-parent</artifactId>
<version>4.1.118.Final</version>
</parent>
```
And `META-INF/maven/io.netty/netty-buffer/pom.properties` specifies
```
artifactId=netty-buffer
groupId=io.netty
version=4.1.118.Final
```
So i am confident now that with the pinning in bigquery and this version
here that regardless of class resolution from
"jar:file:/private/tmp/fixed-athena/plugins/bigquery-cloud-sdk.metabase-driver.jar!/io/netty/buffer/ByteBufAllocator.class"
or
"jar:file:/private/tmp/fixed-athena/plugins/athena.metabase-driver.jar!/io/netty/buffer/ByteBufAllocator.class"
you will get the same class and athena shall work again.
* ensure type/* for base-type if otherwise not known
Using the follow query that returns pg arrays:
```sql
SELECT *
FROM (
VALUES
(1, ARRAY['https://example.com', 'https://example.org']),
(2, ARRAY['https://test.com']),
(3, ARRAY['https://foo.com', 'https://bar.com', 'https://baz.com'])
) AS adhoc_table (id, urls);
```
In 55 this returned a nil base-type
```clojure
user=> (metabase.query-processor.metadata/legacy-result-metadata
{:database 2
:type :native,
:native {:template-tags {},
:query "SELECT *\nFROM (\n VALUES\n (1, ARRAY['https://example.com', 'https://example.org']),\n (2, ARRAY['https://test.com']),\n (3, ARRAY['https://foo.com', 'https://bar.com', 'https://baz.com'])\n) AS adhoc_table (id, urls);"}}
1)
[{:display_name "id",
:source :native,
:field_ref [:field "id" {:base-type :type/Integer}],
:ident "native[]__id",
:name "id",
:database_type "int4",
:base_type :type/Integer,
:semantic_type :type/PK}
{:display_name "urls",
:source :native,
:field_ref [:field "urls" {:base-type nil}],
:ident "native[]__urls",
:name "urls",
:database_type "_text",
:base_type nil}]
```
In master, this just fails. If you remove the type checking in places,
it will eventually return similar.
This base-type is computed in sql-jdbc/metadata
```clojure
(mu/defn query-result-metadata :- [:sequential driver-api/schema.metadata.column]
"Default implementation of [[metabase.driver/query-result-metadata]] for JDBC-based drivers. Gets metadata without
actually running a query."
([driver :- :keyword
query :- :map]
(driver-api/with-qp-setup [query query]
(let [database (driver-api/database (driver-api/metadata-provider))
{:keys [query params]} (driver-api/compile query)]
(query-result-metadata driver database query params))))
([driver :- :keyword
database :- driver-api/schema.metadata.database
^String sql :- :string
params :- [:maybe [:sequential :any]]]
(sql-jdbc.execute/do-with-connection-with-options
driver
database
nil
(fn [^java.sql.Connection conn]
(with-open [stmt (sql-jdbc.execute/prepared-statement driver conn sql params)]
(let [rsmeta (.getMetaData stmt)]
(mapv (fn [i]
(let [database-type (.getColumnTypeName rsmeta i)]
{:lib/type :metadata/column
:name (.getColumnLabel rsmeta i)
:database-type database-type
:base-type (or (sql-jdbc.sync.interface/database-type->base-type driver (keyword database-type))
:type/*)}))
(range 1 (inc (.getColumnCount rsmeta))))))))))
```
Before this change, there was no `or` and
`sql-jdbc.sync.interface/database-type->base-type` would just return
nil.
```clojure
user=> (metabase.driver.sql-jdbc.sync/database-type->base-type :postgres (keyword "_text"))
nil
```
Unfortunately this is a multimethod so we can't easily update it in one
spot to fall back to type/*. Each implementation must take care to do
this. A few do (clickhouse does) but a few dont (snowflake does not). So
we update this call site to ensure we have something from the
multimethod or add our own type/*
Why did this start happening now?
> I think it's because I added :metadata/model-metadata to :metabase.lib.schema.info/info at some point
Query info stashes the model metadata which is
```clojure
[:metadata/model-metadata {:optional true} [:maybe [:sequential ::lib.schema.metadata/lib-or-legacy-column]]]
```
We had been throwing errors asynchronously when trying to save metadata,
but now we have on-thread type mismatch for model metadata, which is
what is in the ticket.
* add test to ensure we can handle existing base_type nil's
this got annoying because legacy metadata from the app-db comes from a
different location. I was adding a card schema migration but this is
better here.
The previous commit makes sure we don't put out more bad data, but this
commit here ensures that we can update the card.
* Move cron info up into cron section
* Move schedule explanation logic to utils
* Allow ReactNode as explain message
* Render explain message in cron component
* Add status to transform job page
* Add e2e tests for job error message
* Add assertion to lookup
* Add extract shared logic for run status
* Add missing test-ids
* Select correct section
* Don't send new user login for SDK or Embedded Analytics JS
* Update tests
* Stop using hard-coded string to detect modular embedding headers
* Conform to spacing rule
* add isClosed impls to proxys
* use mt/id in test
* test all drivers
* check if statements are supported, refactor statement-supported? multimethod to drive feature
* add namespace to statements feature
* Only report analytics when not in the preview
This would avoid confusing preview usage with the actual usage
* Ensure analytics would be report even if iframe isn't ready
* Add E2E test
* Make the test pass
* Stop relying on redux store to fetch `site-url`
* Clarify test with comment
* Add tests
* Fix linter
I was naming a file wrong, so it doesn't match unit test spec. This rule
apparently doesn't take tests into account, which is great.
* Add search endpoint for Metabot and adjusted metadata
* More tests and better split out of logic into separate files
* dedupe search terms and description if they happen to be the same
* fix bad merge conflict
* Answer blending sql querying via search tables (#62415)
* Only put tables used in SQL into context
* Change format of injected database content by reusing existing models
* Create separate function for new schema enchancement
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
* Add table reference for implicitly joinable fields in context injection (#62753)
* Update Metabot profile IDs (#62864)
* [Answer blending] Updates to the metabot admin configs (#62551)
* remove ability to configure the selected collection for default metabot
* add verified toggle
* add migrations for metabot collection configuration changes
* add metabot PUT endpoint, rip out metabot entities endpoints and usages, convert FE over to new FE, fix tests
* remove metabot_entity table, model, usage and refactor code to use updated metabot and metabot_prompts schemas
* enforce verification and regenerate prompts on verification + collection id change
* fix bad references
* fix bad regexp for fetch-mock collections by id endpoints breaking unit tests
* fix kondo
* fix + increase tests for enterprise/backend/test/metabase_enterprise/metabot_v3/tools/api_test.clj
* fix migration boolean default value syntax
* maybe fix be tests
* fix some tests
* enforce verified filter on the search endpoint
* factor in verified check into find-metric
* hide verification setting behind token feature check, fix migration lint, do not migrate collection id for default metabot, fix kondo errors
* fix core tests
* fix kondo
* fix most of the failing serialization tests
* fix migration lints
* fix one test file
* maybe fix migration failures
* move test resource file
* prevent default metabot from getting a collection id configured
* yolo
* add cascade delete to entity drop table migration
* increase unit tests for verification config UI
* remove extra add column
* fix migration... i think for real this time
* for real for real fix migrations
* no really
* tests fixes and add preventing verification toggle if the instance does not have the content_verification feature
* fix failing feature tests in ci
* fix one more
* fix cljfmt issue
---------
Co-authored-by: Tyler Plude <tsplude@gmail.com>
* [Metabot] Quick slash command + dynamic profile ui (#62909)
* quick slash command + dyanmic profile ui
* add back code i did not mean to remove
* fix failing test
* Revert "fix failing test"
This reverts commit b1c7e9efb9.
* [BOT-284] BE for notebook query tool table support (#62710)
* init
* moved query-table endpoint to query-datasource; add support for both model and table ids
* unit test fixes
* use existing card-query and table-query utils
* adding unit tests
* [Answer blending] Respect collection id in search (#63150)
* remove find metric tool
* adjustments to search endpoint
* add tests
* fix failing test in ci
* add way to override the metabot id
* add way to override metabot request id
* fix whitespace lint
* missing paren...
* fix failing test
* New BE `/search` endpoint for ai-service `SearchTool` (#63154)
* new metabot search tool BE endpoint
* remove debug prints
* parallel searches; incomplete effort to return more fields for results
* Simplify result transforming & response schemas
* unit tests
* kondo fixes; pr feedback
* fallback search model list
* remove references to MetabotEntity model which got re-added incorrectly in rebase
* Make internal metabot use verified content by default (#63529)
Update linter for usage of task in metabot-v3
Move suggested-prompts to separate namespace
Add collection condition only when current-user-id
Add startup task
migration
Update tests
Verified cards only
Test
Docstrings
Limit number of entities
Review feedback
* [METABOT] Default use_verified_content to false; tweak prompts (#63843)
* default use_verified_content false; limit amount of prompts
* reworked unit test to not depend on ai-service or appdb contents
* PR feedback
* remove mock of get metrics and models in favor of mt/with-empty-h2-app-db
* Small refactors & simplifications to metabot PUT endpoint and suggested
prompts job
* small simplification, use m/distinct-by for deduping tables
* rm deprecated search_data_sources
* Cleanup and prioritize verified content (#63877)
* Remove now redundant content verification guard
* Prioritize verified content
* Redundant merge
* Test
* ensure field IDs in user_is_viewing context are snake_cased
* Use proper source column alias as name for the model / table fields (#63826)
* Use proper source column alias as name for the model / table fields
* Add name as fallback
* test fix
* switch to using :lib/desired-column-alias, revert test fix
---------
Co-authored-by: Tyler Plude <tsplude@gmail.com>
Co-authored-by: Noah Moss <noahbmoss@gmail.com>
* Fix some tests: consistent use of snake_case, and a :lib/source-column-alias fallback for model field :name
* fix more field_id snake_case issues
* fix another snake case issue - revert result_columns back to result-columns
---------
Co-authored-by: Thomas Schmidt <thomas.heinz.schmidt@gmail.com>
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
Co-authored-by: Thomas Schmidt <thomas@metabase.com>
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Noah Moss <noahbmoss@gmail.com>
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
* fix: jetty stats handler tests flake
These tests could hang indefinitely on the `(.join server)` statement
because the core.async/go block handling async requests was incorrectly
doing a blocking take `<!!`. This also updates our :dev alias to enable
core.async to print warnings when using blocking operations in `go` blocks.
* fixup! oncomplete dispatch in go block
* fixup! using alts!! in go block
* WRK-893: Update API to store comment html content
* WRK-891: Add HTML content sending in comments. Add proper SmartLink serialization to HTML.
* WRK-891: Update comment email template to display comment content
* WRK-891: Fixes for comment email template. Add space insertion after smartLink
* trigger comment notification by id
* put old api behavior back and cleanup comment notification context
* whitespace
* fix tests
* Fix changeset author
* WRK-891: Fix smart links serialization. Add parent comment display in email
* Add style payload for comments email template
* fix types
* 🙄
* test email changes
* test email again
* make email formatting looking perfect
* cleanup
* require html content to be provided when posting a comment
* fix e2e test
* fix another e2e test
* pass 0 as tiptap placeholder when no label available
---------
Co-authored-by: Oleksandr Solovyov <o@solovyov.net>
Co-authored-by: Uladzimir Havenchyk <uladzimir@metabase.com>
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
* Adjust DB form page width and form fields spacing
* Extract layout field settings to one file
* Use lg spacing between form fields
* Conditionally add labelProps property
* Fix typo
* Refactor deprecated default export
* Simplify responsive max width
* Simplify DB page responsive styles
* Add card background to add db form
having issues with classpath. I _think_ that athena is finding the
bigquery provided version of a netty class and that is failing. but it's
a bit difficult to follow.
downgrading now until we can take time to understand and sort it.
* Remove the +New option for creating new models
* Bring back the from-scratch approach
Based on Alex's requested change, but also realized that you can use the command palette
* Move note about models getting pinned back into the new model section
* Format UI terms using bold instead of italics
* docs: send only attachements
* Apply suggestions from code review
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* update test and implementation
* update models query to make more sense
* flake fix: try adding timeouts to Done
* remove cy.wait from tests
* wait for model creation
* modify create model tests
* Don't force reindex on serialization load to be async
* Allow reindex to be controlled when calling load
* Keep load reindex sync for now
* Make reindex async again
* Add a controlled version of NotebookNativePreview
* Use ReactNode instead of JSX.Element
* Add a button to toggle native sql
* Add sql preview to transform query editor
* Pull out resizehandle component
* Add e2e test for converting an MBQL transform to a native transform
* Move native query toggle out of header
* Move Native editor sidebar to separate component
* Fix overflow in native sidebar
* Fix copy on button
* Move connected NotebookNativePreview to query_builder
* Remove canConvertToNative prop
* Rename prop
* Move styles to css
* Closes EMB-816 misleading text for number of rows
* updated e2e tests
* marked a test as flaky until we figure out what is up with it
* addressed legit comment
* Update Loki Snapshots
* loki
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
* Add Embedded Analytics JS usage snowplow schema
* Add analytics
* Clarify code with comments
* Fix analytics logic + fix typing
* Add unit tests
* Make E2E embedded analytics JS util supports multiple elements
* Fix code not working in Cypress for some reason
* Add E2E test suite
* Fix import order
* Remove extra line
* Fix E2E from util API change
* Update snowplow/iglu-client-embedded/schemas/com.metabase/embedded_analytics_js/jsonschema/1-0-0
Co-authored-by: Phoomparin Mano <poom@metabase.com>
* Update e2e/test/scenarios/embedding/sdk-iframe-embedding/sdk-iframe-embedding.cy.spec.ts
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* Update e2e/support/helpers/e2e-embedding-iframe-sdk-helpers.ts
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* Fix E2E by updating a function API
* Pass snowplow schema lint
---------
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* Add cancellation to transform api
* Use effect to set polling state
* Add cancellation button to run button
* Set up cancellation on transform page
* Use confirmation modal to cancel transform
* Add run cancel button to run list
* Make api endpoint take transform id instead of run id.
* Fix cancelation api
* Add canceled state to TransformRunStatus
* Add canceled state to transform page
* Add polling to RunListPage
* Remove comment in code
* Set status to canceling when you click cancel
* Add canceling status
* Poll when the transform is canceling
* Add copy for runs that are being canceled
* Manually track fetching status for running and canceling
* Handle canceling status in utils
* Avoid wrapping cancel button in run list
* Add test for canceling run on transform page
* Add e2e for canceling test from runs page
* Fix prop type
* Change copy to Canceling
* Add custom color to canceled state
* Remove mock code
* Increase cancelation tiemout
* Fix copy in text
* Fix snowplow event
* Remove void specifier and close modal in handler directyle
* Add optimistic update for run cancelation
* Avoid manually tracking cancelation status
* Avoid useEffect when changing isPolling
* Add in missing helper
* Remove another useEffect
* Add placeholder run when starting
---------
Co-authored-by: Eric Normand <ericwnormand@gmail.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
* use iframe for changelog
* add query params and tabs
* always show update info
it's useful even if you're on the latest version
* remove metabase as configurable host
* always allow changelog/releases in iframes
* fix tests
* fix tests
* update tests
* use root metabase domains
* fix test
---------
Co-authored-by: John Swanson <john.d.swanson@gmail.com>
* Send parse connection string parsing events only on blur
* Use synchronous last parsing result for monitoring
* Improve test assertions for connection string events
* Make sure we don' track the same parsing event again
* Refactor ts-match to simple if conditions
* Make lastStatus have the same success value depending on non undefined values
* Improve the snowplow Cypress test setup for connection string
* [Admin settings] Show help documentation to connect DB in a side panel
* Add unit tests
* Add more tests / tweaks
* Add e2e tests
* Make sure help content is not rendered if not available
* Self-review tweaks
* Use useDocsUrl in DatabaseHelpSidePanel.tsx
* Use aside element for the side panel
* Use await findBy when possible
* Use JSDoc / Remove unnecessary comment
* Add some style to blockquote
* Add test file for useHelpLink
* Fix failing test
* Add analytics event
* Document password handling for special characters
* Add section on special character passwords in MariaDB
Added information about handling passwords with special characters in MariaDB connection strings.
* Apply suggestions from code review
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* Update docs/databases/connections/mysql.md
---------
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* Fix vertical legend position for cartesian charts
* Set dashcard title font size to 14px
* Decrease legend dot size
* Decrease value labels density for cartesian charts
* Use normal font weight for axis names, labels, etc
* Make y axis split lines solid vs dashed
* Show scalar card title in dashcard header
* Always show pie chart total
* Hide axis names on small dashcards
* Update screenshots
* Fix tests
* Fix number cards font size
* Fix hiding cartesian chart axis
* Fix font styles in other legend components
* Fix e2e tests
* Hide cartesian chart axes independently
* Use different legend style only in dashboards
* Apply min spacing to labels per series
* Fix legend dot size in edit mode
* Update label sizes for funnels and sankey charts
* Use bold font for data labels
* Update screenshots
* prettier
* Update Loki Snapshots
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
* Trivial preprocessing middleware => Lib
* Handle already-native MBQL 5 queries
* substitute-persisted-query => Lib
* A bunch of post-processing middleware is actually MBQL-5 ready
* Fixx 🔧
* Test fixes 🔧
* More fixes 🔧
* Fix more stuff
* Wow even more test fixes =(
* (Hopefully) final round of test fixes
* Kondo
* More test fixes 🔧
* Fixes 🔧
* Swap cancel and save button
* Render sidebar in native query editor for transforms
* use toggleSnippetSidebar from props
* Fix snippets sidebar
* Export SelectionRange
* Add aria label for data reference button
* Open database on mount
* Add aria-label to snippets button
* Add e2e tests for sidebar in SQL transforms
* Rename prop for clarity
* Return instead of throwing
* Use Lib.rawNativeQuery
* Pass selected text to native editor
* Fix types
* Move longer handlers to hooks in utils
* Handle empty text and reshuffle code
* add-implicit-clauses middleware => Lib
* Test fixes 🔧
* Some lib.convert fixes from #61398
* Test fixes 🔧
* More test fixes
* Test fixes 🔧
* Handful of test fixes 🔧
* Discourage use of legacy MBQL utils in QP
* Integrate the platinum metadata provider
* Only one failing test left
* Test fix 🔧
* Kondo
* Test fixes 🔧
* Test fix 🔧
* Test fixes 🔧
* Handle legacy pivot viz settings where `base-type` might not be present
* Handle legacy pivot viz settings where `base-type` might not be present
* Handle legacy pivot viz settings where `base-type` might not be present
* Handle legacy pivot viz settings where `base-type` might not be present
* Handle legacy pivot viz settings where `base-type` might not be present
* Handle legacy pivot viz settings where `base-type` might not be present
* Handle legacy pivot viz settings where `base-type` might not be present
* Handle legacy pivot viz settings where `base-type` might not be present
* Handle legacy pivot viz settings where `base-type` might not be present
* Test fix 🔧
* Test fix 🔧
* Kondo
* Test fix
* Test fix 🔧
* Skip failing transforms tests
* Mark failing tests flaky
* Setup sidebar and onboarding page for embedding hub (#62517)
* Add the add data and new dashboard modals to embedding hub (#62528)
* mark sandboxed step as done (#62758)
* Auto-mark 'secure your embeds' step as done when either JWT or SAML is configured (#62736)
Co-authored-by: Nicolò Pretto <info@npretto.com>
* Add UTM tags to documentation links in the embedding hub (#62747)
* Add a wizard to select a table to x-ray in embedding hub (#62715)
* Mark the create embed steps in embedding hub as done from embed flow (#62759)
* Add a dropdown to switch embedding solutions in embedding hub (#62870)
* fix(embed-hub): adds key prop to component passed to jt (#63060)
* feat(embed-hub): checklist endpoint (#62875)
* feat(embed-hub): EMB-770 and EMB-742, add checklist endpoint with
'create-dashboard'
* feat(embed-hub): EMB-740 auto mark "Add data" as done
* Revert "mark sandboxed step as done (#62758)"
This reverts commit be775aceed.
* feat(embed-hub): EMB-768 move sandbox check to the BE
* EMB-772: move all "done" checks on the be, move endpoints to ee
* cleanup
fmt
configure enterprise module to make linting pass
test: activate license to make e2e tests pass again
remove fe unit test now that all the logic is on the be
add doc to the endpoint to maybe the tests will pass?
whitespace?
fixes
idk anymore how to make all the linters be happy
last try
refactor has-configured-sso to a function
revert visibility to see if tests pass
sort config.edn
* tests: remove cy.wait from embed hub tests (#63066)
* Bit of cleanup
- remove warn-on-reflection; there is no interop
- clean up a bit of duplication in sql clause generation
- remove unncessary try/catch around t2 access
- remove a few boolean calls on boolean functions
---------
Co-authored-by: dan sutton <dan@dpsutton.com>
* fix(embed-js): disable the next button when embedded js is disabled (#63134)
* Replace the accordion in embedding hub with steppers (#63271)
* Move embedding settings into its own top-level menu (#63339)
* Add related setting cards to modular embedding and setup guide (#63340)
* Remove the Embed menu from the New menu (#63385)
* Completing later steps on embedding hub should not tick off the former steps (#63393)
* Modular embedding toggle label should depend on toggle states (#63391)
* Add the interactive embedding upsell to the settings page (#63399)
* Lock embed in production step in embedding hub checklist until sso configured (#63449)
* Use ee plugins to check if embedding is enabled in nav (#63446)
* Check for CSV uploads in embedding-hub checklist endpoint (#63501)
* update embedded-analytics-js.md to have consistent quickstart pages
---------
Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: dan sutton <dan@dpsutton.com>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Fixes issue where undo history is deleted on save. Also fixes issue where CommentsSidesheet stays open (big unclosable grey box) when navigating to a different document when it was open.
* Move sqlserver description to extra info tooltip
* Fix mongo additional-options not appearing in advanced-options section
# Conflicts:
# e2e/test/scenarios/admin/databases.cy.spec.js
* Add new DB engine icons, add icon to regular add DB flow
* Refactor old export style
* update h2 icon
* Fix layout of browse databases cards
* Adjust padding of browse databases cards
* Remove empty comment
* Render default db icon in case of empty engine key
* Fall back to DESCRIBE if Athena JDBC reports duplicate column names
* Make test fail another way
* Fix test
* Verify that the hijacked function gets called
* Metadata Provider Platinum Edition
* Revert some formatting changes
* Revert changes to QP tests
* Revert NOCOMMIT changes
* Fix missing ns alias
* Pull in missing changes from other branches
* Misc fixes and changes
* Fixes
* Fix bugs in JVM metadatas
* Fix composed provider not propagating inactive
* JS fixes 🔧
* Test fix 🔧
* Test fixes 🔧
* Test fixes 🔧
* Another JS test fix 🔧
* More FE fixes 🔧
* Don't be too strict
* Set database
* Fix merge conflict
* Fix kondo
---------
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
* Sandboxing middleware => Lib
* Test fix 🔧
* Remove some unused stuff
* rename `row-level-restricitions` middleware => `sandboxing`
* Remove TODO
* :model/GroupTableAccessPolicy => :model/Sandbox
* Test fixes 🔧
* Test fix and mark more stuff deprecated
* Test and Kondo fixes 🔧
* "Fix" sandboxes with extra columns because I don't want to update e2e tests
* cljfmt
* docs - add modular embedding
Also adjust headers a bit because ToC is difficult to scan
* Update docs/embedding/securing-embeds.md
* Update docs/embedding/securing-embeds.md
* Implement new DatabaseFormError component & break DatabaseForm component down
* Implement scrolling actions / Avoid 'div in p' console error
* Fix typing check issues / Add 'Read the docs' link url
* Define 'invite teammate' and 'contact support' urls
* add more tests / further refactoring
* css tweaks
* Simplify tests a bit
* Remove comment / Fix translation cases
* Refactor tests
* Adjust 'Check Host and Port settings' button / Fix css lint
* Fix test
* Add target=_blank to doc links / Use existing color for the error container border
* Use cloud-gateway-ips setting when showing IPs to whitelist / Move some helpers to a local utils.tsx
* Use 'be.visible' over 'exist' in cypress test
* Use useDisclosure
* Make Alert title have dark text color by default / Add storybook case to show warning color variant
Trino's Hive plugin shows the tables in question in its metadata, but if you try to get a handle on these tables, it will always throw an exception with error code `UNSUPPORTED_TABLE_TYPE`. The Iceberg plugin has a similar exception for such circumstances.
For us, there doesn't seem to be much difference between not being able to query a table because it's an unsupported type and not being able to query because we don't have permissions, so`have-select-privilege?` is modified to return false in these cases. We can examine the vendor-specific error code on the SQLException to detect them.
* Update Start new thread UI
* Refactor
* Lint migrations
* Lint migrations
* Lint
* Fix comments count
* Thread submit input improvements
* Align 'Start new thread' button
* mention metabase entities
* Stupid link copying
* Deep linking to comments
* fix: sidebar style improvements
* Fix line breaking bug on submit
* Maz Comments styling tweaks (#62964)
* add tabs hiding/showing logic
* only show persistent button for open comments
* move comment buttons to the right
* attempt to fix tests
* always display the add-a-comment input in the sidebar
* Remove unused attr
* Placeholders without flags
* Refactor comments' tabs markup
* Refactor CommentsMenu
---------
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Stas Gavrylov <stasgavrylov@gmail.com>
* Fix incorrect counter for unresolved comments
* Fix warning
* Fix key warning in Discussions
* Make document read-only when comments sidebar is open
* Refactor URL generation
* Automatically open correct tab for the comment targeted by URL hash
* Clean up
* Use createPortal instead of Portal from metabase/ui to fix CommentsMenu appearing above CommentsSidesheet when visiting a specific comment via URL
* Remove more/less feature
* Set max-height when editing comments, fix scrolling area
* Extra padding
* Make it possible to mention yourself
* Add ability to resolve deleted threads
* Remove ability to comment on resolved threads
* Remove ability to add new comments on Resolved tab
* allow using @ character without showing mention list
* Fix type errors
* Fix types
* Resolve/unresolve deleted comments
* Remove DocumentContext
* Fix inserting mentions on Enter press
* Minor styling fixes for mentions
* Remove unused endpoint
* Clean up
* Remove unused component
* Remove stories
* Fix storybook
* Remove TODO
* Remove unused file
* Remove outdated comment
* Avoid cast
* Remove redundant code
* Deal with any
* Don't trim empty nodes
* Simplify Discussions component
* Align avatar, submit button and code editor
* Do not show last divider if not necessary
* Get rid of currentIndex
* Fix typo
* Remove hack
* Check only unresolved comments when deciding whether to autofocus comment editor when sidebar opens
* Enable inline_code styling in comments
* Rename css file
* Fix cast
* Use top instead of transform
* Use a flag
* Remove commented-out code
* Move getCommentsUrl to utils
* Use Menu
* Add Avatar to metabase/ui
* Bring back accidentally removed code
* Resolve CSS duplication
* Use void
* Add comment
* Add all comments sidebar
* Use createSelector
* Fix no results styling
* Autofocus editor when editing comments
* Disable menu when editing is disabled
* Add a toast when copying the link
* Prevent deleting and editing someone else's comments
* Fix types
* Update copy
* Cleanup all comments sidebar
* Extract isMetabotBlock
* Use CustomStarterKit
* Copy
* feat: add Emoji picker (#62991)
* feat: add Emoji picker
* fix: styles
* fix: class for loading label
* Add ability to inline emojis in CommentEditor
* fix: keyboard events for emoji picker
* fix: focus visible for emoji picker viewport
* Implement proper keyboard support for inline emojis
* Temporarily hide emoji reaction button
* Improve UX around selecting first emoji
---------
Co-authored-by: Stas Gavrylov <stasgavrylov@gmail.com>
* Pass editable
* Use mentions plugin
* Fix z-index
* Add reactions BE
* Improve list paddings
* Add users support to SmartLink and MentionExtension
* Remove old mentions
* use semantic colors for Avatar
similar logic to what do for users in admin
* show add comment input when we switch from resolved tab
* Limit number of user results
* feat: add comment reactions (#63072)
* feat: add comment reactions
* fix: typescript
* fix: click to react
* fix: styling
* tweak spacing between replies (#63100)
* fix: reply styles
* Update submit shortcut to Cmd-Enter. Fix emoji picking behavior
* fix: do not close discussion sidesheet on some escape events
* fix: cancel editing on escape press
* Make DocumentPage 400px narrower when comments modal is opened
* Extract shared tiptap-related code
* Move EmojiPicker to common/components
* Fix DiscussionComment error when creator is null
* Fix missing formatting menu in CommentEditor
* Add tests boilerplate
* Allow many reactions on a comment
* Hydrate creator info on deleted comments
* Add first test and helpers
* Add tests for more types of nodes
* Add comment
* Improve test name
* Test highlighting
* Add test for splitting paragraphs
* fix: blur comment editor on submit
* Add schema upgrade test
* Add test for creating comments and threads
* Add tests for deleting comments
* Editing a comment
* Test for Esc
* fix: limit editable functionality and add comment styles (#63161)
* Fix test
* Update test
* Fix flaky test
* Fix tooltip
* fix: do not react on deleted comments
* fix: show resolved threads
* fix duplicate replies display
* Add mentions tests
* Make suggestions taller to accommodate users search results without a vertical scrollbar
* don't count deleted comments for the comment badge
* don't show threads if all comments deleted
* Add emoji tests
* fix: can react true by default
* Fix floating menu positioning in CommentEditor
* fix document / menu selected item styling
* Sort comment reactions by created_at ASC
* Make Esc close emoji popup
* first pass at comments api
* Fix reactions ascending order
* WIP
* fix linting
* model resolution
* update test setup to include _id, so equality check works correctly
* replace is_deleted with deleted_at to detect deleted comments
* fix types
* remove ?new=true from url after adding a new comment
* Fix tests
* Improve arrow navigation when emoji popup is opened. Allow selecting with Tab
* Add test
* Refactor
* Update test
* Fix emoji popup Esc handler removal
* Add formatting tests
* Rename test
* Add e2e API helpers to create and delete comments
* Update test name
* Refactor
* Fix types
* update is not deleted eh
* Add test for the comment button
* Add test
* Add a test
* Add test
* test: basic resolve/unresolve tests (#63243)
* test: add resolve other person thread test
* Add test for disabling document editing when comments are open
* Add test for unsaved document changes
* Add test for show all comments button and fix the issue
* Add tests for deleting/editing other people's comments
* Add e2e tests for comment links
* add e2e tests for all comments
* way better/less verbose permission checks
* test: cannot reply to resolved threads
* ESLint
* Update assertion
* Fix unresolved comments count
* e2e tests for comments reactions
* first iteration of notifications
* fix migration lint errors
* fix module tests
* Add label attribute for SmartLinks to simplify server-side notifications rendering
* add e2e test for removing ?new=true after creating a comment
* Fix
* fix clj syntax
* Remove commented-out code
* Use H.readClipboard()
* Refactor
* Update reaction icon
* Move util
* Lint
* Fix
* Lift conditional rendering, move Reaction component to a separate file
* Refactor
* Do not render invalid links
* Refactor
* Update new comment notification template
* add e2e test for top blocks
* fix: comment date to respect browser locale
* Update reactions icon
* Add 1st test for email subscriptions
* Update email template to match figma, remove the comment content
* Add document icon to email template
* Update test
* Remove protocol from the link
* Extract verifyEmail helper
* fix migrations because mysql is majorly unhappy about those rollbacks
* correct urls for comments, notifications on mentions
* Update assertion
* Insert both comment URL and document URL into the email template
* Fix url
* fix copy tests
* Add a setup for next test
* Implement assertions
* 2nd email variant
* Add another test
* Add an assertion
* add more tests for email template
* Ignore whitespace
* Error handling for mutations - toasts
* add more tests
* feedback: drop blue border from paragraph
* feedback: placeholder
* fix e2e test to pass
* Update setup
* Comments design polish (#63352)
* use new Send icon instead of up_arrow
* remove extra space below a Discussion
* restyle Discussions
* fix CommentEditor spacing
* restyle current user reaction
* only show No Comments message on the All Comments sheet
* add on-hover highlighting for All Comments section
* fix for fe-type-check
* fix test
* Cleanup
---------
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
* put user permissions check back and new api for mentions
* pagination
* Use new GET /api/ee/comment/mentions in frontend
* Use new GET /api/ee/comment/mentions in smart link node
* paid feature in tests
* seed notifications
* oh
* clj-kondo 🤦
* port numbers
* Try to fix flaky test
* attempt to fix flaky e2e
* disable returning users for mentions
* disable mention related tests
---------
Co-authored-by: Stas Gavrylov <stasgavrylov@gmail.com>
Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>
Co-authored-by: Konstantin Darutkin <spalt08@mail.ru>
Co-authored-by: Maz Ameli <maz@metabase.com>
Co-authored-by: Uladzimir Havenchyk <uladzimir@metabase.com>
Co-authored-by: Oleksandr Solovyov <o@solovyov.net>
Fixes#62492.
A literal UUID was reaching the driver as
`[:value "uuid-string" {:base_type :type/UUID}]`
but this was not recognized as a UUID-valued field because `:value`
clauses have `:base_type` and not `:base-type` like `:field` clauses.
Therefore the `:sql` core driver was rewriting this clause to cast the
UUID field to a string and compare that against the literal string.
With that logic now correctly recognizing such a `:value` clause, the
UUID fields are compared directly. This is much better for indexing,
but also works with *nullable* UUID columns, where the
`CAST(my_uuid AS text)` would cause SQL compilation errors.
* Make with-index! use new, clean, separate database per test
* Add with-test-db! setup modes
* Comment
* Adjust with-test-db! and related
* Drop with-index! in favor of modal with-test-db! in first test
* semantic.tu/db removal
* Drop use of semantic.tu/db in favor of get-pgvector-datasource!
* Drop semantic.tu/db from tu
* Remove once-fixture
* Remove ensure-no-migration-table-fixture
* Comment
* Comment
* Cleanup
* Make the rest of the query-test ns use with-test-db!
* Remove redundant test
* Remove remaining usage of with-index!
* Drop remnants of with-index! and make linter happy
* Cleanup
* Comment
* Remove with-mock-index-metadata! in favor of with-temp-db!
* Adjust with-index-contents!
* Fixture to avoid running app-db tests
* Fixture
* Require
* whitespace
Problem: Perf tests were failing because they couldn't find the uberjar artifact.
The wait_for_uberjar mechanism was trying to wait for a job named 'build (ee)'
but the actual job name is 'Build MB ee'. Additionally, this wait mechanism was
unnecessary complexity.
Solution: Align with pr-env-labeled.yml pattern:
1. Build uberjar first when 'Run-perf' label is added
2. Run perf test after uberjar is built
3. Remove unnecessary wait_for_uberjar mechanism
Changes:
- perf-test-labeled.yml: Add uberjar build job before running perf test
- perf-test.yml: Remove wait_for_uberjar parameter and 56-line wait mechanism
This simplifies the workflow and ensures the uberjar artifact exists before
the perf test tries to fetch it, following the same proven pattern used by
pr-env-labeled.yml.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude <noreply@anthropic.com>
* Make dataset-query->dimensions more robust
* *disable-updates*
* Add macro impls for easier debugging
* Make dataset-query->dimensions more resilient
* Whitespace
* fix: don't ignore db sync/rescan promise
When the call returns non-200, the button still says it's fine instead of showing a failure.
You can test this by trying to sync "Metabase Cloud Storage" DWH.
See https://metaboat.slack.com/archives/CKZEMT1MJ/p1749830993738189
* add unit tests
* fix mocks
---------
Co-authored-by: Ryan Laurie <iethree@gmail.com>
* Ensure results are realized when falling back to in-place results in semantic search
Unlike the semantic and appdb backends, the in-place backend returns a reducible result set from
search.engine/results. Make sure we realize the results before attempting to pass them to `m/indexed-by` to dedup
them. This avoid a "Don't know how to convert reducible to ISeq" exception when falling back to in-place results.
* Add comment
want to check that the new table exists before adding it into the
app-db. The old way worked for all databases but is pretty dumb: it
enumerates all tables in the db (as it would for regular sync) and then
checks if the new table is in there.
We can be better with the `driver/table-exists?` function.
The shape of data coming back from describe-data is the following:
```clojure
notify=> (let [database (toucan2.core/select-one :model/Database :id 1)]
(driver/describe-database :h2 database))
{:tables #{{:name "ORDERS",
:schema "PUBLIC",
:description nil,
:is_writable true}
{:name "PEOPLE",
:schema "PUBLIC",
:description nil,
:is_writable true}
{:name "FEEDBACK",
:schema "PUBLIC",
:description nil,
:is_writable true}
...
```
So we can create the same shape (i omit description and is_writable to
seemingly no deleterious effect).
reports that a customer has around 200k tables spread across 300
schemas. the fields query by default would just get a single cursor into
these fields, passing all schema into the query.
This can take quite a long time. Our own horror show schema would take
~45 minutes to sync. But holding a cursor open this long just seems to
invite bad times.
I've taken the logic and just called it multiple times, once per schema.
* WRK-874: Populate preview for List View customization with sample values
* WRK-874: Set default and min size for list view on dashboard
* WRK-874: Fix List view card size on the dashboard
* WRK-874: Add e2e test for empty column placeholder
* Fix lint errors
* Add horizontal padding for List view
* Refactor generatePreviewSample
* Stretch join data sections when needed
* Tweak padding to avoid jump
* Center 'on' in join condition
* Make gap consistent
* Tighten margins to avoid jump
* Tweak padding to make all wells the same height
* BOT-310 lower the weight on the :rrf score for semantic search results
This seems to give a better blend between the :rrf score coming from the semantic search hybrid query and the other
post-search metadata scorers.
* Add with-weights and with-only-semantic-weights test util macros
* Use semantic.tu/with-weights in scoring tests
* Update query tests to use semantic.tu/with-only-semantic-weights
This prevents other metadata scorers from overriding the expected rankings for these tests. The query tests are
largely focused on making sure the basic machinery of semantic queries are working. Tests exercising individual
scorers are in scoring_test.clj
* Add tests for :official_collection and :verified "premium" scorers
Fixes#35561
We currently don't allow filtering on null foreign key values, but that is a reasonable thing to want to do. This extends the foreign key drill to support null values.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-authored-by: Claude Code[bot] <noreply@anthropic.com>
Co-authored-by: William Zimrin <william@metabase.com>
* Unpolished WIP hackathon code for additional driver support
* fix kondo
* add transforms/table featuer for supported drivers
* fix transforms for dbs with no schema
* rename transform datasets to prevent foreign key overlap
* Add clickhouse support
* fix clickhouse tests
* fix redshift tests
* fix bigquery failures
* kondo and filter tests by feature
* fix transform dataset for bigquery
* fix sqlserver transforms with joins
* fix clickhouse order by when no non nullable field is available
* add more complex test with join, filter, aggregation and ordering
* use different metadata provider
* filter for left join feature in test
* improve sqlserver compile-transform
* done use legacy mbql in test, refactor normalize-name
* clean up
* add sqlserver error test
* Squashed commit of the following:
commit a11b602e19
Author: Romeo Van Snick <romeo@romeovansnick.be>
Date: Thu Aug 21 17:44:13 2025 +1000
Add message when a new transform will be created
commit 2cfdbfaba3
Author: Romeo Van Snick <romeo@romeovansnick.be>
Date: Thu Aug 21 17:37:36 2025 +1000
Allow creating values in schema form select
commit 17ff4dcb3f
Author: Romeo Van Snick <romeo@romeovansnick.be>
Date: Thu Aug 21 16:51:13 2025 +1000
Allow selecting schemas always, not only when there are schemas
* create schemas
* fix redshift
* add snowflake
* add sqlserver
* add clickhouse
* add bigquery
* Add test
* add default impl
* fix redshift tests
* Move SchemaFormSelect to components folder
* Allow creating schemas in the target update modal
* Allow initial value in SchemaFormSelect
* Only render schema field when the database supports :schemas
* Do not render new schema item if value is empty
* Add unit tests for SchemaFormSelect
* Add e2e tests for schema creation
* check schema exists first
* fix sql jdbc schema exists and add create schema permissions test
* update changelog
* parse query and add into for sqlserver
* add type hints for linter
* Address comments
* realize bigquery execute-raw-queries
* Disable target schema link if it does not exists (yet)
* Add tooltip when schema is new
* Use hydrated table from transform
* Add e2e tests
* Allow existing schema link to render as enabled even when table does not exist yet
* Do not add default to databaseId
* Add tests for existing schema with new table
* Fix e2e test
* address comments
* rename connection-details to conn-spec
* Compare against null not empty string
* use find first
* Await request to avoid flakiness in hover
---------
Co-authored-by: Timothy Dean <timothy@timothydean.dev>
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
* Add last_run, next_run and tag id filters
Closes QUE-2156
* Placate kondo
* Test with scheduled jobs and filtering by tags
* Fix next_run_start_time test
* Return run timestamps as timezone localized strings
* Handle Zulu
* Prepare job list table for next_run and transforms
* Add JobListParams type and use it in getJobListUrl
* Add new parameters to listTransformJobs handler
* Parse params and pass them down on job list page
* Add filters to job list page
* Add tooltipPosition prop to Icon
* Add TimezoneIndicator component
* Allow rendering React nodes in table headers
* Add timezone indicators to job list and transform list
* Add timezoneToUTCOffset helper
* Add timezone to cron explanation
* Format timestamps as ISO-8601 strings with timezone
* Add next run timestamp
* Hide transform count in list for now
* Add next_run to TransformJob
* Add timezone indicators to run list
* Avoid wrapping timestamps in run list
* Move shared widgets to transforms/components
* Allow passing available shortcuts to filter picker
* Disable shortcuts that are in the past for Next run, which is always in the future
* Add e2e test for filters
* Add UTC offset in tests
* Report run timestamps in UTC and expose system timezone
The system timezone is exposed in /api/session/properties as "system-timezone".
* Expose system-timezone to admins only
* Fix setting docstring
* Fix serdes baseline-comparison-test
* Make transform_job API return run timestamps in UTC
* Placate kondo
* Timezone
* Use system-timezone instead of report-timezone
* Add tests
* Fix test string
---------
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
The Store API's OpenAPI description (OAD) can change over time, but
Metabase's Store client would not notice. For example, the client
would fail a HTTP request, not because the server rejected it, but
because the client "believes" it needs to send a field that the server
no longer requires.
Instead of caching the client, and thus OAD, for the whole lifetime of
the Metabase instance, cache it only for 5min.
Fixes: 1dd56e5f14
References: https://metaboat.slack.com/archives/C010ZSXQY87/p1757002462314229
* add base color rule to stylelint
* allow in colors file
* lint in CI
* better highlighting
* css fixes
* fix all improper color use
* Update frontend/lint/stylelint-rules/no-base-colors.js
Co-authored-by: Phoomparin Mano <poom@metabase.com>
* Update Loki Snapshots
* fix color name
* Update Loki Snapshots
---------
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
* Add transform dependencies and job transforms endpoints
* Add API handler for /api/ee/transform/:id/dependencies
* Add API handler for /api/ee/transform-job/:id/transforms
* Add description to TitleSection
* Add Dependencies section to transform page
* Add transform order to job page
* Invalidate transform jobs when adding tags to transforms
* Add empty state for job transforms
* Add e2e test for transform and job dependencies
* Fix type for job dependencies component
* transform ordering is well defined
* don't sort whole list when we just need the first element
* make new function private
* Use neg?
* Remove unused require
* use a sorted map instead of scanning for the earliest transform each time
* extend docstring
* use ->
* update docstring again
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
---------
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
Co-authored-by: William Zimrin <william@metabase.com>
* Update embedded analytics JS docs to include browser
* small update
* new appearance setting
* Update docs/embedding/embedded-analytics-js.md
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* Apply suggestion from @jeff-bruemmer
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* Apply suggestion from @jeff-bruemmer
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* update on the browser
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* Update pgvector to pg17 in semantic search docker-compose.yml
This matches the version that will be used in prod and staging deployments.
* Update to pg17 in semantic-search.yml CI workflow
* Remove enable-ssl-tests env var from semantic-search.yml workflow
* Move validate.js to ts and remove unused validators
* Remove any and unknown for typing parameter values
* Use ParameterValuesMap where possible
* Fix parameter-parsing
* Fix tests
* Fix cast to empty string
metabase.session.models.session-test/send-email-on-first-login-from-new-device-test
test is failing because sometimes there's an extra email in there.
metabase-enterprise.impersonation.driver-test/nested-do-with-connection-with-options-test
is failing because it deadlocks all the app-db connections
* Also skip the :bookmarked scorer on mysql
MySQL does not like the CASTs in the search-index-query
* Fix appdb-available-with-semantic test for mysql appdb
When the appdb is :mysql, we should fallback to the in-place engine rather than appdb
* Move body of search.engine/results :search.engine/in-place into a func for easy mocking
* Fix api-engine-switching-test for mysql appdb
* Fix test-semantic-search-fallback-supplementation and test-semantic-search-max-combined-results-limit for mysql appdb
* Update semantic-search CI job to run against all supported appdbs
* Implement last_run_... filters for transform runs
* Change filters to start_time, end_time, run_method
* Use timestamp literals instead of strings in test
* Add start_time, end_time and run_method to transform run query params in api
* Parse start_time, end_time and run_method params on run list page
* Allow custom react elements in displayValue prop
* Add filters for start_time and end_time to run list page
* Allow filtering on multiple run methods
* Add run method filter widget
* Close time filter when changing value
* Add e2e test for start at, end at and run method filters
* Allow multiple values for run_method filter
* Add test with start_time=2025-08-22~2025-08-23
* Fix e2e test
* Rename the run_method parameter to run_methods
* Remove "local" timestamps
* Return transform run timestamps in the system timezone
* Stop expecting a last_run with a nil value
* Rename run_method to run_methods to match api
---------
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
* Create standalone add DB page
* Use full page view for editing db connection
* Fix title on edit database page
* fix dataspec cypress test
* fix missing formLocation prop
* fix add initial data cypress test
* Fix add db test not waiting for db connected
* Fix default schedule cypress test
* Remove unnecessary nullish coalescing and route
* Extract common logic to use-database-connection hook
* Adjust Add DB page width
* Adjust padding for smaller devices
* Use FormLocation type in prop
* Add repair-index! API with temp table mechanism for detecting deletions
* Fix up tests, bug fixes
* Explicitly disable reindex! and reset-tracking
* Add repair index task, and cleanup job in case there are orphans
* fix tests
* Test - comment out new tests to see if it fixes CI failures
* switch with-index! macro to use init! instead of reindex
* try again to fix with-index
* fix kondo
* ensure drop table table names get quoted
* switch to using gate table for the anti-join
* add missing assertion in test
* add more error handling in find-lost-deletes, reorganize a function
* make sure index cleanup task is initialized
* make sure index repair task is initialized
* Fix time-interval filters
Reported on stats that the examples dashboard was breaking when you used
some relative timestamps. There it was a bit cryptic with
```
class java.lang.Integer cannot be cast to class
clojure.lang.IPersistentMap (java.lang.Integer is in module java.base of
loader 'bootstrap'; clojure.lang.IPersistentMap is in unnamed module of
loader 'app')
```
Locally in dev, we get:
```
Error processing query: Invalid output: ["invalid tuple size 4, expected 5, got: [:time-interval [:field {:base-type :type/DateTime, :lib/uuid \"69655229-95a0-4bfb-9d3a-7675b1111ec4\"} 13] :current :day]"]
```
And it's a failure to have the time-interval options
before:
`[:time-interval field-clause :last (keyword unit)]`
after:
`[:time-interval interval-options field-clause :last (keyword unit)]`
spec:
```
(mbql-clause/define-mbql-clause :time-interval :- :type/Boolean
;; TODO -- we should probably further constrain this so you can't do weird stuff like
;;
;; [:time-interval {} <time> :current :year]
;;
;; using units that don't agree with the expr type
[:tuple
[:= {:decode/normalize common/normalize-keyword} :time-interval]
[:merge ::common/options ::time-interval-options] ;; <---- missing bits
#_expr [:ref ::expression/temporal]
#_n [:multi
{:dispatch (some-fn keyword? string?)}
[true [:enum {:decode/normalize common/normalize-keyword} :current :last :next]]
;; I guess there's no reason you shouldn't be able to do something like 1 + 2 in here
[false [:ref ::expression/integer]]]
#_unit [:ref ::temporal-bucketing/unit.date-time.interval]])
```
Switching them to lib calls and then i noticed there were no tests.
With fix:
```clojure
dates=> (date-string->filter
"lastmonth"
[:field {:lib/uuid "00000000-0000-0000-0000-000000000000", :base-type :type/DateTime} "field"])
[:time-interval
{:lib/uuid "bbca7a83-feb9-4259-a4db-bbb79687eb4e"}
[:field
{:lib/uuid "00000000-0000-0000-0000-000000000000",
:base-type :type/DateTime}
"field"]
:last
:month]
```
In a 56.3.4 repl:
```
user=> (metabase.driver.common.parameters.dates/date-string->filter "lastmonth" [:field {:lib/uuid "00000000-0000-0000-0000-000000000000", :base-type :type/DateTime} "field"])
[:time-interval [:field {:lib/uuid "00000000-0000-0000-0000-000000000000", :base-type :type/DateTime} "field"] :last :month]
user=> (pp)
[:time-interval
[:field {:lib/uuid "00000000-0000-0000-0000-000000000000", :base-type :type/DateTime} "field"]
:last
:month]
nil
```
Note the missing options in the second position
* test e2e dashboard filters
takes a sampling of a few different parameter types and different
parsers. At one point i was doing something like:
```clojure
(concat (for [unit [:day :week :month :quarter :year]
relative [:this :last]]
(str (name relative) (name unit)))
(for [unit '[days weeks months quarters years]
include? [true false]
relative '[past next]]
(str relative "3" (name unit) (when include? "~"))))
```
But that seems overkill. This test is kinda seeing if the query
processor throws an error (or at least that's where most errors
happen). So those checks can be more exhaustive and against some
in-memory metadata providers
* two fixes, compaction and when to run
Test logs are super, duper awesome. We upload them on failure since we
don't presumably need to see healthy logs.
There are two issues:
1. We upload them on `failure()`, but timeouts don't seem to trigger
this condition. So now upload on `always() && !success()` Why not just
`!success()`? An LLM suggests that timeouts are a bit special and go
into another mode. The always() will run and then we qualify it. Let's
see.
2. The logs are all on a single line.
We have a few axes here: compact and eventEol.
I have three files with these. If you want to grep for logs during a
particular test, here's what you get:
Compact: (current behavior)
```
❯ ag "metabase.util.queue-test/result-listener-test" logs/test-log.json.compact
<not reproducing here, because it's the whole file>
```
compact false
```
❯ ag "metabase.util.queue-test/result-listener-test" logs/test-log.json.not-compact
251: "mb-test" : "metabase.util.queue-test/result-listener-test"
268: "mb-test" : "metabase.util.queue-test/result-listener-test"
414: "mb-test" : "metabase.util.queue-test/result-listener-test"
```
It's _too_ expanded.
```
{
"instant" : {
"epochSecond" : 1756844736,
"nanoOfSecond" : 357005000
},
"thread" : "main",
"level" : "INFO",
"loggerName" : "metabase.util",
"message" : "Maximum memory available to JVM: 8.0 GB",
"contextMap" : { },
"endOfBatch" : false,
"loggerFqcn" : "org.apache.logging.log4j.spi.AbstractLogger",
"threadId" : 1,
"threadPriority" : 5
}
{
"instant" : {
"epochSecond" : 1756844739,
"nanoOfSecond" : 802772000
},
```
Compact true, eventEol (this PR sets this)
```
❯ ag "metabase.util.queue-test/result-listener-test" logs/test-log.json
17:{"instant":{"epochSecond":1756844991,"nanoOfSecond":537601000},"thread":"main","level":"INFO","loggerName":"metabase.util.queue","message":"Starting listener \u001B[32mtest-result-listener\u001B[0m with 1 threads 🎧","contextMap":{"mb-test":"metabase.util.queue-test/result-listener-test"},"endOfBatch":false,"loggerFqcn":"org.apache.logging.log4j.spi.AbstractLogger","threadId":1,"threadPriority":5}
18:{"instant":{"epochSecond":1756844991,"nanoOfSecond":572361000},"thread":"main","level":"INFO","loggerName":"metabase.util.queue","message":"Stopping listener test-result-listener...","contextMap":{"mb-test":"metabase.util.queue-test/result-listener-test"},"endOfBatch":false,"loggerFqcn":"org.apache.logging.log4j.spi.AbstractLogger","threadId":1,"threadPriority":5}
20:{"instant":{"epochSecond":1756844991,"nanoOfSecond":585407000},"thread":"main","level":"INFO","loggerName":"metabase.util.queue","message":"Stopping listener test-result-listener...done","contextMap":{"mb-test":"metabase.util.queue-test/result-listener-test"},"endOfBatch":false,"loggerFqcn":"org.apache.logging.log4j.spi.AbstractLogger","threadId":1,"threadPriority":5}
```
You get the whole log lines. super helpful. pipe these through a
processing pipeline, use jq, etc.
Also, these files are ~817MB when running in a test suite. I'm doing these with a single namespace
```
❯ clj -X:dev:test :only metabase.util.queue-test
❯ ls -lh logs
13K Sep 2 15:29 test-log.json
13K Sep 2 15:24 test-log.json.compact
16K Sep 2 15:26 test-log.json.not-compact
```
* stacktraces when we don't get returned connections
* use new hawk version. waiting on release
* quick checkin on CI stuff
* load file to ignore vars
```clojure
;; json file with a list of vars
test-runner=> (println (slurp "/tmp/config.json"))
{
"ignored": {
"vars": [
"metabase.util.queue-test/bounded-transfer-queue-test",
"metabase.util.queue-test/take-batch-test"
]
}
}
nil
test-runner=> (find-tests (build-final-options {:ci-config-file "/tmp/config.json"
:only 'metabase.util.queue-test}))
Running tests with options {:namespace-pattern #"^(?:(?:metabase.*)|(?:hooks\..*))", :exclude-directories [".clj-kondo/src" "classes" "dev" "enterprise/backend/src" "local" "resources" "resources-ee" "src" "target" "test_config" "test_resources"], :test-warn-time 3000, :ignored {:vars #{"metabase.util.queue-test/bounded-transfer-queue-test" "metabase.util.queue-test/take-batch-test"}}, :ci-config-file "/tmp/config.json", :only metabase.util.queue-test}
Running tests in metabase.util.queue-test
Finding tests took 1000.0 µs.
Running 4 tests
(#'metabase.util.queue-test/non-delayed-take-batch-test
#'metabase.util.queue-test/result-listener-test
#'metabase.util.queue-test/listener-handler-test
#'metabase.util.queue-test/multithreaded-listener-test)
;; only found 4 tests
;; no ignored vars
test-runner=> (println (slurp "/tmp/empty-config.json"))
{
"ignored": {
"vars": []
}
}
nil
;; finds 6 tests
test-runner=> (find-tests (build-final-options {:ci-config-file "/tmp/empty-config.json"
:only 'metabase.util.queue-test}))
Running tests with options {:namespace-pattern #"^(?:(?:metabase.*)|(?:hooks\..*))", :exclude-directories [".clj-kondo/src" "classes" "dev" "enterprise/backend/src" "local" "resources" "resources-ee" "src" "target" "test_config" "test_resources"], :test-warn-time 3000, :ignored {}, :ci-config-file "/tmp/empty-config.json", :only metabase.util.queue-test}
Running tests in metabase.util.queue-test
Finding tests took 0.0 ns.
Running 6 tests
(#'metabase.util.queue-test/non-delayed-take-batch-test
#'metabase.util.queue-test/take-batch-test
#'metabase.util.queue-test/result-listener-test
#'metabase.util.queue-test/listener-handler-test
#'metabase.util.queue-test/bounded-transfer-queue-test
#'metabase.util.queue-test/multithreaded-listener-test)
```
* Fetch ci-test-config.json from master on each test run
This affects all BE tests, driver and app-db. Don't pass an explicit arg
and just let the default pick it up.
```bash
❯ clj -X:dev:test :only metabase.util.queue-test
Running tests with options {:mode :cli/local, :namespace-pattern #"^(?:(?:metabase.*)|(?:hooks\..*))", :exclude-directories [".clj-kondo/src" "classes" "dev" "enterprise/backend/src" "local" "resources" "resources-ee" "src" "target" "test_config" "test_resources"], :test-warn-time 3000, :ignored {}, :exclude-tags [:metabot-v3/e2e], :only metabase.util.queue-test}
Running tests in metabase.util.queue-test
Finding tests took 7.5 s.
Running 6 tests
Running before-run hooks...
LONG TEST in metabase.util.queue-test/take-batch-test
Test took 4.720 seconds seconds to run
LONG TEST in metabase.util.queue-test/bounded-transfer-queue-test
Test took 7.518 seconds seconds to run
6/6 100% [==================================================] ETA: 00:00
Ran 6 tests in 12.421 seconds
53 assertions, 0 failures, 0 errors.
{:test 6, :pass 53, :fail 0, :error 0, :type :summary, :duration 12421.435583, :single-threaded 6}
Ran 0 tests in parallel, 6 single-threaded.
Finding and running tests took 20.0 s.
All tests passed.
Running after-run hooks...
Running QP tests against these drivers: #{:h2}
metabase on quick-CI-test-disabling [$!?] via ☕ v21.0.2 on ☁️ metabase-query took 48s
❯ clj -X:dev:test :only metabase.util.queue-test :ci-config-file '"/tmp/config.json"'
Loading CI config file from /tmp/config.json # <------ new output
Running tests with options {:mode :cli/local, :namespace-pattern #"^(?:(?:metabase.*)|(?:hooks\..*))", :exclude-directories [".clj-kondo/src" "classes" "dev" "enterprise/backend/src" "local" "resources" "resources-ee" "src" "target" "test_config" "test_resources"], :test-warn-time 3000, :ignored {:vars #{"metabase.util.queue-test/bounded-transfer-queue-test" "metabase.util.queue-test/take-batch-test"}}, :exclude-tags [:metabot-v3/e2e], :only metabase.util.queue-test, :ci-config-file "/tmp/config.json"}
Running tests in metabase.util.queue-test
Finding tests took 6.9 s.
Running 4 tests
Running before-run hooks...
4/4 100% [==================================================] ETA: 00:00
Ran 4 tests in 0.133 seconds
42 assertions, 0 failures, 0 errors.
{:test 4, :pass 42, :fail 0, :error 0, :type :summary, :duration 133.16525, :single-threaded 4}
Ran 0 tests in parallel, 4 single-threaded.
Finding and running tests took 7.1 s.
All tests passed.
Running after-run hooks...
Running QP tests against these drivers: #{:h2}
```
Note that it runs 4 tests instead of 6. The config passed here was:
``javascript
{
"version": "1.0.0",
"ignored": {
"vars": [
"metabase.util.queue-test/bounded-transfer-queue-test",
"metabase.util.queue-test/take-batch-test"
]
},
"metadata": {
"last_updated": "2025-08-02",
"updated_by": "engineering-team",
"reason": "Testing CI config implementation"
}
}
```
* empty ci-test-config
this will be the file when this merges
* print config when it has vars that we are ignoring
* PR review feedback
typo in example json
set continue-on-error: true. if network fails, let's not fail our
build. it's just a little file. carry on soldier. worst case scenario a
test known to flake might flake. might not.
* Add repro for metabase#52872
* Wrap long titles without spaces in saved questions
* Add repro for metabase#52872 for dashboards
* Fix width of dashboard with long name
* Use max-width instead of width
* etc: kickoff comments
* get quotas statuses from token-check (#61560)
* get quotas statuses from token-check
* Check quota and estimated-row-count of dbs before replication
* Evict token-check cache to get updated quotas
* Turn the MB pg replication button into a modal (#61701)
Closes: https://linear.app/metabase/issue/CLO-4308/turn-the-mb-pg-replication-button-into-a-modal
* Fix schema-filters-patterns split
* split token-check row estimates counts (#61783)
* Split token-check row estimates counts
* add preview endpoint
* Align replication schema-filters with HM
Fixes: 805f4cafcf
Depends-on: https://github.com/metabase/harbormaster/pull/6445
* preview endpoint changed
* temp frontend modal
* After pairing with Raimon
* Fix lint and fmt errors
* pg replication modal (#61913)
* Success modal on starting replication
* Visual improvement to DatabaseReplicationForm
* made non-pk-tables list prettier
---------
Co-authored-by: Dennis Schridde <dennis@metabase.com>
* Run prettier and linter on DatabaseReplicationForm
* Turn DatabaseReplicationModal into a multi step thing and add backend API to support this
* Workaround broken dirty bit
* Call setFieldValue("schemaFields", "") when schemaSelect=all
* fix enabling of the replication button
* UI updates
* UI updates
* removed package-lock file
* Don't wait for replication to become "active" in "setting up" modal
The progression from "initializing" to "active" can take arbitrary
amounts of time. Instead we should show the "setting up" modal while
creating the replication, which is synchronous and has an upper bound
of 40s.
Fixes: 6f2ba1852e
References: https://metaboat.slack.com/archives/C079ZS06ERJ/p1754940482733049
* Loading for preview method
* Error handling
* Modal padding and title updates
* Remove info about future email from form
* Misc
* Misc
* DatabaseReplicationStatusInfoProps cleanup
* Misc
* Status modal content padding
* Modal properties
* fix: throw harbormaster call error body in ex-data
* Show which tables are excluded from replication because of owner mismatch
Closes: https://linear.app/metabase/issue/CLO-4346/preview-should-also-include-schemas-that-cant-be-synced-due-to-owner
* Align text of replication modal more with Figma
* UI updates 1
* Replication stats spacing updates
* Misc
* Tables listing icons
* Alignment updates
* Layout updates for tables listing
* Misc
* Colours updates
* List updates
* Misc
* Misc text alignment
* Misc
* Scrollable tables list
* Fix tables listing
* Comma separated DB WIP
* Misc
* Fix margins
* Ui updates
* More on setting up and success layout
* Test for spinner
* More on spinner
* Colour update
* Box shadow for spinner
* Spinner size updated
* Spinner padding updated
* Spinner added to setting up step
* Misc
* Sizes updated
* Fix for unit tests
* Debounce for schema filters
* Schema filters onChange
* Remove loading in button is no schema filters
* Loader for preview
* Misc
* feat: check replication table ownership
Same as how HM does it.
* Moved laoder next to the submit button
* Make DatabaseReplicationForm look more "loading..." during preview
* Remove setFieldValue hack
Was obsoleted by 9cdbeaec7a
* Also show skeletons when data is not fresh (i.e. when loading)
* Fix linter: Change set IDs are not in order
* Build uberjar container also when pushing a PR branch
Before it would only build when the `build-docker-uberjar` label was
added. So to build the latest branch head you'd have to remove and
re-add the label.
Fixes: 22507a963a
* Link to postgres docs
* SUrface "incorrect" errors from HM response to connection creation
* Misc
* Modal layout
* Error modal UI updates
* Misc
* More on layout + alignment fixed
* More on error layout
* Fix for modal closing
* rfct: use pg conn preview
* revert owner sync
* rfct: use existing schema filter format
* lint: fix fe
* feat: also show tables that will be replicated
* test: update be tests
* rfct: minor renames for consistency
* fix: cannot replicate 0 tables
* style: fix
* fix: copy
* test: update body prop
* test: add form tests
* fix: progress indicator on bottom
* fix: card styles
* fix: error message when no tables to replicate
* fix: easy stuff from jakub's review
* fix: error state for preview too
* claude: fast FE unit tests
* rfct: use fetchMock in FE test
* fix: remove small error step text
* fix: mocal close should reset setup step
* fix: translate noSyncReason
* fix: catch invalid schema pattern as 400
* rfct: use plain fn for onSubmit
* rfct: raise inline fn
* rfct: use correct token-check alias
* rfct: remove unused preview fields
* rfct: raise free-quota fn
* fix: throw on tunnel or certs
* rfct: remove silly when
* rfct: testable preview-replication and errors map
* test: granular fe error tests
* test: fix BE tests
* test: preview-replication unit tests
* fix: test redef name
* rfct: style and db as dbname
---------
Co-authored-by: Raimon Grau <raimon@metabase.com>
Co-authored-by: Dennis Schridde <63082+devurandom@users.noreply.github.com>
Co-authored-by: Dennis Schridde <dennis@metabase.com>
Co-authored-by: Raimon Grau <raimonster@gmail.com>
Co-authored-by: Arkadi Yaroslavtsev <arkadi@metabase.com>
Co-authored-by: losrebellos <ben@benoitvinay.com>
* Fix question download filenames to use question name instead of generic 'query_result'
Resolves: https://github.com/metabase/metabase/issues/61708
Previously, when downloading questions from the SDK (and public links), files were
named with a generic "query_result_{timestamp}.{format}" pattern even when the
question had a meaningful name.
This fix ensures that:
- Questions with valid names use the slugified question name as filename
- Questions with nil/empty/blank names fall back to "question" instead of "query_result"
- Both regular card downloads (/api/card/:id/query/:format) and public link downloads are fixed
Changes:
- Modified process-query-for-card-default-run-fn in query_processor/card.clj
- Modified process-query-for-card-with-id-run-fn in public_sharing/api.clj
- Added proper fallback logic using str/blank? to handle edge cases
Expected behavior:
- "My Awesome Question" → my_awesome_question_{timestamp}.csv
- nil/empty name → question_{timestamp}.csv
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Cleanup and added tests
* Make whitespace linter happy
* Fix silly oversight
* Set warn-on-reflection
* Fix issues
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Timothy Dean <timothy@timothydean.dev>
* Hide CSV panel with no meaningful uploadable dbs
* Hide add data when no meaningful actions can be performed
* Simplify conditional for shouldShowUploadPanel test
Co-authored-by: Anderson <ands.alves.nunes@gmail.com>
* Show CSV tab also when user can upload data
User with upload permissions, but without admin rights, cannot see uploadable dbs in the api response
* Add e2e test for hidden add data for regular users without upload permissions
---------
Co-authored-by: Anderson <ands.alves.nunes@gmail.com>
* Show a special error screen when you don't have permissions to run the query
* Show a special error screen when you don't have permissions to run the query
* Fix tests
* Unpolished WIP hackathon code for additional driver support
* fix kondo
* add transforms/table featuer for supported drivers
* fix transforms for dbs with no schema
* rename transform datasets to prevent foreign key overlap
* Add clickhouse support
* fix clickhouse tests
* fix redshift tests
* fix bigquery failures
* kondo and filter tests by feature
* fix transform dataset for bigquery
* fix sqlserver transforms with joins
* fix clickhouse order by when no non nullable field is available
* add more complex test with join, filter, aggregation and ordering
* use different metadata provider
* filter for left join feature in test
* improve sqlserver compile-transform
* done use legacy mbql in test, refactor normalize-name
* clean up
* add sqlserver error test
* parse query and add into for sqlserver
* add type hints for linter
* Address comments
---------
Co-authored-by: Timothy Dean <timothy@timothydean.dev>
Previously, if you had city, state, latitude, and longitude breakouts, you'd get zoom in (city), zoom in (state), zoom in (lat/lon for lat), zoom in (default binning for lat), zoom in (lat/lon for lon), and zoom in (default binning for lon). Those would all be called "zoom in", so you'd just see half a dozen drills with the same title. This hides the default binning drills if we are showing lat/lon, and gives the assorted geographic zoom-ins different titles.
* `wrap-value-literals` => Lib
* Mostly working nicely
* Clean up other middleware + test fix
* Finish it up
* Code cleanup
* Kondo
* Fix test 🔧
* Work around https://github.com/clj-kondo/clj-kondo/issues/2610
* Test fixes; PR feedback
* Fix walk recursion into `:case` and `:if`
* code cleanup
* Oracle test fix 🔧
* Another test fix 🔧
Fixes#62377.
Correctly get a connection to the database while checking the ClickHouse version
(used to check if it supports `:connection-impersonation`). The driver was using the
internal, raw form of getting a connection, which didn't apply the SSH tunnel properly.
* Boilerplate
* Add list view toggle control to ViewFooter
* Remove processRemappedColumns, add layout
* Navigation
* Back button,breadcrumbs
* TODO
* Layout
* Layout
* Refactor
* Column detection logic
* Inline
* Fix
* Extract Breadcrumb
* Fix
* Entity name in nav
* Condition
* Fix
* Header
* Style
* Remove
* Do not render header if no column can be used there
* Body
* Add empty list viz
* Update VizStyleToggle to use list display type
* Sidebar
* Style
* Add simple list view
* Add virtualization for ListViz view. Optimize rendering
* Copy
* Hover style
* Add object detail modal opening on list item click
* Remove back button
* Overflows
* a11y
* Redundant css
* Fix
* Fix rendering
* Style links
* Cleanup
* FK pill
* Render images
* Prevent showing old images while new are loading
* Take currency_in_header into account
* Extract `ColumnHeader`
* Cleanup
* Fix spacing, colors
* Refactor relationships
* Update PK drill
* PK drill
* Fix
* Fix
* Improve layout of list items
* Center cells content
* Add sorting
* Fix virtualized behavior
* Fix copy if row name is not available
* Max height for values
* Update ViewStyleToggle rendering rule to fix incorrect list view icon
* Styling fixes
* Make whole list view scrollable
* Hide truncated data warning for list view
* Fix PK drilll
* Don't memo formatted rows
* Fix virtualization
* Use drills for sorting
* Fix virtualization flickering
* Fix drills
* Disable viz settings for list view
* List view visual enhancements (#62124)
* spaecing and font styling
* add entity_type icons to listitems
* display 4 columns instead of 5
* change icon for transaction tables
* add circle for boolean fields
* add badge style to category columns
* add colors to badges, incl Score cols
* Save list questions as tables
* Footer
* Padding and scrolling
* Styling
* Styling
* Remove icon
* Fix useObjectDetail call for ListView
* Fix list view columns alignment
* Move detail view breadcrumbs to AppBar
* Style breadcrumbs
* Fix scrolling
* Show icon if avatar is missing
* Fix react key warning
* Align breadcrumbs with detail view page
* Remove arrow navigation and footer
* Styling
* Error handling
* Styling
* Make Detail View breadcrumbs preserve card settings
* Make DetailView breadcrumbs return to previous ListView state
* Add company, currency, and receipt icons (#62196)
* add company currency and receipt icons
* add new icons to IconName and Icons obj
* Remove duplicate 'currency' icon declaration
---------
Co-authored-by: Stas Gavrylov <stasgavrylov@gmail.com>
* Update icons for TransactionTable and CompanyTable
* Make titleColumn always present. Update categoryValue styling
* ListView: Extract rendering logic to ColumnValue component
* Add tooltips for large column values
* Make list item grid always have at list 1 column
* Refactor DatasetEditorInner to typescript
* Rename DatasetEditor 'metadata' mode to 'columns'. Add new 'Metadata' tab for list view
* List view customization styling fixes (#62546)
* fix font sizes and spacing
* styling on ReorderableTagsInput
* make the viewsidebar 400px
* Make ReorderableTagsInput dropdown behave like multi-select
* Fix saving. Remove ViewStyleToggle
* Refactor List view to proper viz settings. Fix bugs. Remove TabHint popup
* Remove TabHintToast completely
* Fix container highlight when dragging between inputs
* Fix column settings in ListViz. Fix eslint
* Remove legacy DetailView code
* PR Cleanup
* Fix settings in list item preview
* Fix sorting. Replace custom column items with ColumnItem
* Fix saving models with list display type
* Fix incorrect condition to save list view models as tables
* Fix incorrect columns param in ListViewColumnsSidebar
* Fix list entity icon hover
* Tests – Models List View (#62836)
* Add storybook for ReorderableTagsInput
* wip
* Unit tests for ReorderableTagsInput
* Fix models-metadata related e2e tests
* e2e tests for List View
* Fix eslint
* Unit tests fixes
---------
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Anton Kulyk <kuliks.anton@gmail.com>
Co-authored-by: Maz Ameli <maz@metabase.com>
* Populate provider_name field on startup health check
* Serve provider patterns from BE side
* cleanup tests and expand clojure host provider detection
* Fix provider detection test
* Fix regexes for supabase and timescale
* adjust module api exports to standards
* mark private function ins provider-detection namespace
* extend provider values to null and empty, skip backfilling on empty provider_name
* Don't hardcode postgres in health check provider detection
* Make providers api dynamic and ready to support more engines
* Sort lines providers and engines
* Move hostname field tests to a test folder
* memoize detected provider
* Fix for tests for private functions
* Fix import of DatabaseProviderName type
* Use update function for setting provider_name on health check
* Fix typo in test case
* Remove duplicate entry
* simplify detect-provider-from-database call
* Move postgres extra-info to postgres driver module
* Simplify provider update check on startup, use null value for unidentified
* match provider also using engine
* bit of cleanup
- just move the regexes into the postgres driver namespace
- remove regexes and turn them into strings since most databases will put
them in yaml
- just test the public api
- simplify all the host and details checks. Database is a very standard
shape on the backend
* allowing setting null to provider match is null, cleanup unused imports
* move postgres tests to postgres driver; add a few tests for yaml
# Conflicts:
# test/metabase/driver/postgres_test.clj
---------
Co-authored-by: dan sutton <dan@dpsutton.com>
* Potential fix for code scanning alert no. 512: Insecure randomness
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Handle max = 1 case
---------
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* Do not apply update-keys to state
* Add comment documenting the intentional order
* remove recursive snake case update
* apply fix to both streaming and non streaming
* adding kebab->snake helpers that ignore camelcase
* Fix kondo
---------
Co-authored-by: Thomas Schmidt <thomas@metabase.com>
This is based on this discussion with Marcos: https://metaboat.slack.com/archives/C01R1JY03J4/p1756173436062039
It appears that we do set a reporting time zone for SQL queries, but it did not have an effect in my own testing on my local MariaDB. However, it works just fine when running the "official" Docker version of MariaDB.
* allow specifying athena hostname
* use hostname
* fix params
* add test and clarify hostname field
* update helper text
* Apply suggestion from @jeff-bruemmer
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* update hostname field
* apply suggestion
* improve test
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* Add dead letter queue for the semantic search indexer
The DLQ system handles failed semantic search indexing operations if they are causing the indexer to stall.
- Applies back-off policies for retries (hard coded for now).
- Prevents batch poisoning from blocking indexer progress.
* Add the jitter factor I mistakenly deleted
* Doc fixes
* Slightly better stall recovery log
* Kondo
* Index attempt_at on DLQ table
* Add some more logging
* Init includes DLQ creation
* Fix some rebase collisions
* Formatting
* Add some asserts to show dlq creation during init
* Name test fixed with hashing
* Inline table-name-prefix
* Bump index meta version
* Prefer hex to b64 for table/index names they remain usable unescaped.
* Fix next-dlq-run test in on-indexing-idle
The test was backwards, so the loop only idled when `next-dlq-run` was due, rather than avoiding idle in that case.
* Ensure exit-early-due-to-cold-data? even if we have no last-seen-change
Ensure we still yield back to quartz if more than exit-early-cold-duration seconds have elapsed since the loop start
and we have no last-seen-change. This can happen in cases where no docs were updated since the loop start if our
watermark is already at the end of the gate table.
* Reduce log level to :trace for "nothing to do" case in indexing-step
* Whitespace cleanup
* Reduce ee-search-indexer-exit-early-cold-duration from 30s to 5s
30s is longer than the quartz interval for the indexer job, so we'll just get rescheduled immediately after yielding
control.
* Increase the run-frequency for the SemanticSearchIndexer job from every 10s to every 20s
* Move table-exists? into shared util ns and reuse
* Simplify honeysql qualified col reference in add-entries!
* Fix comment typo: s/indexes/indexer/
* Add missing seq in try-batch!
* Change ee-search-indexer-exit-early-cold-duration back to 30s
This value needs to be higher than the dlq-frequency, otherwise the dlq never runs.
---------
Co-authored-by: Mike Appleby <86076+appleby@users.noreply.github.com>
in dev, the default value was the staging store. When not in dev, the
default value of this url was "false"
```
❯ http get http://localhost:3056/api/session/properties Cookie:"metabase.SESSION=d10a4524-837e-4aaf-84a3-b2f99bc9ecb2" | jq '."store-url"'
"false"
```
In javascript, most of the store url stuff is through
```javascript
export function useStoreUrl(storePath: StorePaths = "") {
return useSelector((state) => getStoreUrl(state, storePath));
}
```
which is based on `getStoreUrl` which is
```
const DEFAULT_STORE_URL = "https://store.metabase.com/";
...
export function getStoreUrl(state: State, path: StorePaths = "") {
try {
const storeUrl = getSetting(state, "store-url");
const url = new URL(path, storeUrl);
return url.toString();
} catch {
return DEFAULT_STORE_URL;
}
}
```
So what happens normally is:
1. in dev, we usually have no setting set for this, so the `when-some`
hits nil. If you do have something there, it is honored.
2. In prod, we read false for the config/is-dev and we use that as the
setting value
```clojure
settings=> (with-redefs [config/is-dev? false]
(store-url-default))
"false"
```
3. There are lots of usages of this on the frontend. But they are all
protected by the try/catch and returning the default store. This is LOAD
BEARING in production.
```javascript
new URL("false", null)
Uncaught TypeError: Failed to construct 'URL': Invalid base URL
```
4. Cloud migration does something slightly different and so fails to get
this load bearing try/catch. It takes a `checkoutUrl` in its props:
```javascript
export const MigrationSuccess = ({
migration,
restartMigration,
isRestarting,
checkoutUrl,
}: MigrationSuccessProps) => {
```
This manually constructs a url:
```javascript
const checkoutUrl = useMemo(() => {
return migration
? `${storeUrl}/checkout?migration-id=${migration.external_id}`
: `${storeUrl}/checkout`;
}, [migration, storeUrl]);
```
And now we don't have the benefit of the `URL(base, extension)` which
would have (dumbly) failed closed. So now we end up with
`false/checkout?...` and then get a "We're a bit lost" locally
So to recap:
we do the right thing in dev, and then production is broken. Most
pathways were just catching this error, one way constructed a url
fragment and therefore was susceptible.
```clojure
settings=> (with-redefs [config/is-dev? false]
(store-url-default))
"false"
settings=> (store-url-default)
"https://store.staging.metabase.com"
```
* Do not pass Sortable attributes when element is not sortable
* Render parameter value trigger as button
* Add repro for metabase#52674
* Use UnstyledButton
* Do not render parameter widget as button when it does not have a popover
* Update Loki Snapshots
* Use UnstyledButton and Box
* Fix syntax error
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
This was working for `:base_type`s but not `:effective_type`s.
The `:result_metadata` for a native Mongo query always had
`:effective_type :type/*` even when we correctly inferred the
`:base_type`.
Fixes#62397.
* initial commit
* enable multi db by default for tests
* multi db as default, set inclusion filters for tests
* update introspection tests
* enable routing
* set enable multi db true as default
* use redef for spec
* clean up
* add more generic test
* update tests
* remove unused code
* clean up
* handle encrypted migration
* fix test and migration id
* move created and updated at fields
* more tests
* mark tests parallel
* fix whitespace
* fix athena test
* Update Debian/systemd docs
* Remove references to Debian
* Use H2 database in .env file by default
* Add journalctl command to follow logs
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* Refactor appdb-based scorers in the semantic search backend
Refactor the appdb-based scorers in the semantic search backend in preparation for adding the bookmarked scorer in
BOT-312. This refactor has several benefits: (1) makes the appdb-based scorers work more like the existing index-based
scorers; (2) allows sharing the exact same honeysql expressions for the user-recency-expr and model-rank-expr between
the appdb and semantic backends, reducing code dup; (3) makes it easier to add the bookmarked scorer since it will be
able to reuse the appdb backend's honeysql expr for bookmarked scores as well.
* Move user-recency-expr into search.scoring and use it in appdb and semantic backends
* Move model-rank-expr into search.scoring and use it in appdb and semantic backends
* Move mysql check from with-appdb-scores into appdb-scorers
Again in preprartion for adding the appdb-based bookmarked scorer later.
* Fix whitespace
I noticed that
https://github.com/metabase/metabase/pull/62513/files?file-filters%5B%5D=.clj&show-viewed-files=true
that the third tier drivers were running. Checking the action output
https://github.com/metabase/metabase/actions/runs/17220604727/job/48854867380?pr=62513
i see :
```
Is master or release: false
Has '.Team/Drivers' or '.Team/Querying' or '.Team/SemanticLayer' label: false
Checking for changes in relevant folders...
Changes detected in the following folders: src/metabase/lib src/metabase/query_processor.
Tier 3 driver tests will run.
```
So it thinks that something changed in src/metabase/lib/* and
src/metabase/query_processor/*
This branch
ds/clo-4370-button-in-metabase-admin-section-to-purchase-metabot-ai-add
targets master. And the diff is checking the diff of files between the
state of master and the PR. Which means if any changes have landed in
master affecting those areas this diff will report positive.
At the time of this writing this is:
```
❯ git diff --name-only c6a9193bff462d83c5c2 | wc -l
1259
```
Where c6a9 is master and 462 is the branch.
A better option is to find where the branch and the merge target share a
common ancestor and then check for changes from there.
```
❯ git diff --name-only $(git merge-base c6a9193bff462d83c5c2) 462d83c5c2 | wc -l
32
```
So we use `git merge-base <master> <branch>` and then diff that sha
against the branch.
```
git diff --name-only (git merge-base <base> <pr-branch>) <pr-branch>
```
And we get:
```
❯ git merge-base c6a9193bff462d83c5c237e6eee311
❯ git show 37e6eee311
commit 37e6eee311
Author: Phoomparin Mano <poom@metabase.com>
Date: Wed Aug 20 01:40:19 2025 +0700
Add the metabase-browser custom element to Embed JS (#60828)
Co-authored-by: cubic-dev-ai[bot]
<191113872+cubic-dev-ai[bot]@users.noreply.github.com>
```
Which is the common root. Then the diff from there:
```
❯ git diff --name-only $(git merge-base c6a9193bff462d83c5c2) 462d83c5c2
.clj-kondo/config/modules/config.edn
enterprise/backend/src/metabase_enterprise/api/routes.clj
enterprise/backend/src/metabase_enterprise/cloud_add_ons/api.clj
enterprise/backend/src/metabase_enterprise/harbormaster/client.clj
enterprise/backend/test/metabase_enterprise/api/session_test.clj
enterprise/backend/test/metabase_enterprise/cloud_add_ons/api_test.clj
enterprise/frontend/src/metabase-enterprise/metabot/components/MetabotAdmin/MetabotPurchasePage.tsx
enterprise/frontend/src/metabase-enterprise/metabot/components/MetabotAdmin/MetabotPurchasePage.unit.spec.tsx
enterprise/frontend/src/metabase-enterprise/metabot/components/MetabotAdmin/MetabotPurchaseSettingUpModal.tsx
enterprise/frontend/src/metabase-enterprise/metabot/index.tsx
frontend/src/metabase-types/api/metabot.ts
frontend/src/metabase-types/api/mocks/settings.ts
frontend/src/metabase-types/api/settings.ts
frontend/src/metabase/admin/app/reducers.ts
frontend/src/metabase/admin/routes.jsx
frontend/src/metabase/api/metabot.ts
frontend/src/metabase/api/utils/use-token-refresh.ts
frontend/src/metabase/common/components/AdminLayout/AdminSettingsLayout.tsx
frontend/src/metabase/plugins/index.ts
resources/frontend_client/app/assets/img/metabot-cloud-96x96.svg
src/metabase/cloud_migration/core.clj
src/metabase/cloud_migration/models/cloud_migration.clj
src/metabase/cloud_migration/settings.clj
src/metabase/core/init.clj
src/metabase/premium_features/core.clj
src/metabase/premium_features/settings.clj
src/metabase/premium_features/token_check.clj
src/metabase/server/middleware/security.clj
src/metabase/store_api/core.clj
src/metabase/store_api/init.clj
src/metabase/store_api/settings.clj
test/metabase/analytics/stats_test.clj
```
And now we have a correct list of files changed in that PR, not just
files different between current master and current PR.
* Convert revision usage
* convert pivot test + metabot usages
* convert more tests
* migrate final clj-time usage in logger.core
* switch quartzite to a git sha to get most recent commit w/o clj-time
* Revert "switch quartzite to a git sha to get most recent commit w/o clj-time"
This reverts commit 393bc56aad.
* Make readOnly notebook completely non-interactive
* Add readOnly prop to PopoverBackButton
* Add readOnly to FilterPickerHeader
* Add readOnly prop to FilterPickers
* Allow making filter body readOnly
* Pass readOnly to FilterPicker from FilterStep
* Add disabled prop to ClausePopover
* Disable step popovers when readOnly (except for filters)
* Do not disable pointer-events for notebook preview
* Disable popover when button is disabled
* Render readOnly expression popover in readOnly mode
* Make limit step readOnly when readOnly is set
* Add test for readonly notebook
* Disable tooltip on join picker when read-only
* Disable join picker popover when read-only
* Hide back button on date picker
* Simplify backbutton props
* Do not allow going back in readOnly ExpressionWidget
* Allow readOnly AggregationPicker
* Allow opening aggregation popover when it is an expression
* Render aggregation popover when it is a custom expression
* Fix types
* Remove renderPopoverWhenReadOnly flag
* Fix cursor logic on SortStep
* Do not render pointer cursor when step does not have popover
* Render custom expression popover for non-custom aggregations in read-only mode
== Goal ==
In case the Metabase instance does not have the Metabot AI add-on, we
want to show a page in the admin section to purchase it.
== How to test ==
1. Pick a valid token from staging with the `offer-metabase-ai` feature, but without the `metabot-v3` feature (`metabase-ai` add-on)
2. Pick the token's instance's Metabase API key
3. Pick an email address that matches a store user of the token's organization
4. Spin up a Metabase instance with that API key, token and user
5. Navigate to the admin section, AI tab
6. See the new page to purchase the add-on and click the button
Closes: https://linear.app/metabase/issue/CLO-4370/button-in-metabase-admin-section-to-purchase-metabot-ai-add-on
* UXW-503 Triggers error state when underlying card has been deleted
* UXW-503 Makes CardEmbed error state selectable, bordered
* UXW-503 Updates error state per design feedback (less of a jump between loading and error state, fewer different error visuals)
* UXW-503 Adds e2e test
* UXW-503 Removes useMemo per PR feedback
* UXW-503 Simplifies an e2e test, makes it less prone to flakiness
* Add gate table tombstone cleanup to index cleanup job
* add partial index on gated_at for just the tombstone rows
* fix up index creation syntax
* WIP - adding check that indexer ran within last 24 hours
* fix tests
* fix whitespace, adjust log/docstring
* kondo
* fix build, maybe broken from bad rebase?
* fix: handle more header names in translation csv
Handle the locale being specified as 'locale', 'locale code', 'language'
also make the check for header a little looser so we can report errors
in the header row more accurately.
* fixup! have sample CSV match copy
* Call createUser action when inviting new user on the /setup page
* Add e2e test case
* Add invite_sent event / Check user went to next step in e2e test
* Let the backend handle the invite_sent snowplow event
* Change approach to set source value
* Fix unit tests
* Add unwrap() to createUser dispatch
* Remove unused invite param from the /setup endpoint
* Remove unneeded frontend code
* Fix kondo issues
* track search_engine
* track request id
* record request id on search_query event
* fix bug with search_click position not factoring in pagination
* report offset on search_query
* report on the entity model
* move changes into new schema file and update referenced schema
* add back view_more event
* track hashed + salted search term on search_click + search_query events
* refactor trackSearchClick to accept object param instead of long list of args
* report search term for internal purposes only
* pr feedback
* add test coverage for new search reporting attributes
* maybe fix e2e in ci
* fix failing e2e
* Localize rows of initial tags and initial jobs in db on setup or startup
* Also translate job descriptions.
* Use fewer hits to the db on startup
* Use site locale
* kick ci
* Remove extraneous arg
* Remove extraneous strs
* Different translation model (on select)
* setup no longer needed from transforms
* Fix
* Test transform tag translation
* Test transform job initial translations
* Fix runtime crash on field visibility change with preview open
* Update Loki Snapshots
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
* Query builder breadcrumbs can link back to archived models
* Update Loki Snapshots
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
Closes#62099
When a Field has a coercion strategy (say, `UnixSeconds->DateTime`) set in the `Table Metadata`,
and then that field is **joined**, it will get double-coerced. The first time in the inner query for the join,
the second at the top level `SELECT`.
Since after the first coercion it will be a `TIMESTAMP` instead of and `INTEGER`, the second coercion is a SQL error.
The solution is to add `:qp/ignore-coercion true` in the `resolve-joins` middleware, when the `:fields` of the outer
query are being populated with joined fields. That prevents the QP from re-applying type coercions and date truncations.
* Add user-recency scorer to the semantic search backend
* Only query the recent_views table for models it knows about
* Replace group-by with m/index-by in user-recency scorer
* Cleanup comments
* Improve prometheus metrics for user-recency and add tests
Permission filtering is already recorded in :metabase-search/permission-filtering-ms so no need for a new metric that
records it + collection filtering. Instead, add a new metric :metabase-search/semantic-collection-filter-ms so there
is no overlap.
Also remove embedding label from the collection filter and appdb scorer metrics, as these don't currently depend on
the embedding model in any meaningful way.
* Rename :metabase-search/permission-filtering-ms to :metabase-search/semantic-permission-filter-ms
To match the naming convention of other metrics exposed by the semantic search backend.
Fixes a regression where making sure the autocommit was correctly set to
enable reading streaming result sets disallowed ddl and other
non-readonly changes in postgresql due to the interaction of the
'readOnly', 'readOnlyMode', and 'autoCommit' jdbc driver settings.
* UXW-502 Makes sql error scrollable. Also makes it vertically centered when not scrollable.
* UXW-506 Hides some UI from Download as PDF
* UXW-506 Prevents metabot blocks from getting split across pages in generated PDF
* UXW-506 Adds print-only Metabot icon to Metabot blocks in documents
solves https://github.com/metabase/metabase/security/code-scanning/493
but this is actually not an issue at all. When we build the driver jars
we remove deps provided by metabase itself. Metabase itself relies on
```
org.apache.commons/commons-lang3 {:mvn/version "3.18.0"}
```
```clojure
(defn- remove-provided-libs [basis driver edition]
(let [provided-lib->provider (into {}
(filter (fn [[lib]]
(get-in basis [:libs lib])))
(provided-libs driver edition))]
;; log which libs we're including and excluding.
(doseq [lib (sort (keys (:libs basis)))]
(u/announce (if-let [provider (get provided-lib->provider lib)]
(format "SKIP %%s (provided by %s)" provider)
"INCLUDE %s")
(colorize/yellow lib)))
;; now remove the provide libs from `:classpath`, `:classpath-roots`, and `:libs`
(let [provided-libs-set (into #{} (keys provided-lib->provider))
provided-paths-set (into #{} (mapcat #(get-in basis [:libs % :paths])) provided-libs-set)]
(-> basis
(update :classpath-roots #(vec (remove provided-paths-set %)))
(update :libs #(into {} (remove (fn [[lib]] (provided-libs-set lib))) %))
(update :classpath #(into {} (remove (fn [[path]] (provided-paths-set path))) %))))))
```
That output looks like:
```
Write :clickhouse :ee uberjar -> /home/runner/work/metabase/metabase/resources/modules/clickhouse.metabase-driver.jar
SKIP org.clojure/clojure (provided by metabase-core)
SKIP org.clojure/core.specs.alpha (provided by metabase-core)
SKIP org.clojure/spec.alpha (provided by metabase-core)
INCLUDE com.clickhouse/clickhouse-client
INCLUDE com.clickhouse/clickhouse-data
INCLUDE com.clickhouse/clickhouse-http-client
INCLUDE com.clickhouse/clickhouse-jdbc
INCLUDE com.clickhouse/client-v2
INCLUDE com.clickhouse/jdbc-v2
SKIP com.fasterxml.jackson.core/jackson-core (provided by metabase-core)
SKIP com.google.errorprone/error_prone_annotations (provided by metabase-core)
SKIP com.google.guava/failureaccess (provided by metabase-core)
SKIP com.google.guava/guava (provided by metabase-core)
SKIP com.google.guava/listenablefuture (provided by metabase-core)
SKIP com.google.j2objc/j2objc-annotations (provided by metabase-core)
SKIP commons-codec/commons-codec (provided by metabase-core)
SKIP commons-io/commons-io (provided by metabase-core)
SKIP org.apache.commons/commons-compress (provided by metabase-core)
SKIP org.apache.commons/commons-lang3 (provided by metabase-core) <------------------
SKIP org.apache.httpcomponents.client5/httpclient5 (provided by metabase-core)
SKIP org.apache.httpcomponents.core5/httpcore5 (provided by metabase-core)
SKIP org.apache.httpcomponents.core5/httpcore5-h2 (provided by metabase-core)
SKIP org.clojure/clojure (provided by metabase-core)
SKIP org.clojure/core.specs.alpha (provided by metabase-core)
SKIP org.clojure/spec.alpha (provided by metabase-core)
SKIP org.jspecify/jspecify (provided by metabase-core)
INCLUDE org.lz4/lz4-java
SKIP org.ow2.asm/asm (provided by metabase-core)
INCLUDE org.roaringbitmap/RoaringBitmap
INCLUDE org.roaringbitmap/shims
SKIP org.slf4j/slf4j-api (provided by metabase-core)
```
But this is included here in the hopes that it appeases snyk
* Correctly invalidate transform tags
* Remove Undo button from toast when undoing a tag
* Avoid wrapping in certain columns for transform lists
* Add test for tag removal invalidation
* Fix unit tests
* Use helpers in test
* Prove #27521 is fixed
* Fix the test from #60583
* Code cleanup
* I have fixed#39033
* Enable e2e test
* Add ref for #62383
* Ok so I guess I have fixed#47734 now too
* Test update 🔧
* Update the test again
* Test fix 🔧
* Test fix 🔧
* QP limit middleware => Lib
* Preprocess returns MBQL 5
* Split off changes to limit middleware
* Fix Kondo warnings
* Revert changes from Limit PR
* Code cleanup
* Preprocess returns MBQL 5
* Kondo cleanup
* Rework some tests in `wrap-value-literals-test` to use mock metadata providers
* Update more tests to use mock metadata providers
* Use even less with-temp
* Remove with-temp in QP middleware viz settings tests
* Rework metrics-test to never use with-temp
* Remove more with-temps
* Update case-test to use mock metadata providers
* Even more with-temps
* Update even more tests
* Fix two more
* Nice
* Revert stricter schema for query-hash
* Finish rewriting tests to use Mock MPs instead of with-temp or add ignores
* cljfmt
* Test fix 🔧
* Fix permissions
* Split off malli improvements into #62523
* PR cleanup
* PR feedback
* PR feedback
`{:status 500}` is rendered as a response with status 200 and a body of
`{"status": 500}`, wheras `{:status 500 :body ""}` is rendered as a
response with status 500 with empty body.
Fixes: b7253af4f2
* chore: don't run migrations on reindex!, just ensure index is initialised
* feat: support :force-reset?, to support `/re-init` endpoint
* fix test
* chore: check for index-created? in test
* undo
* feat: include index-created-at
* feat: support lazy gating + stale index behavior
* fix tests
* fix
* fix test
* return new index from record-new-index-table!
* chore: don't pipe opts to create-index-table
* feat: randomize index name
* force new index
* shorter name
* suffix as part of qualify
* re-init test
* rename find-best-index to find-compatible-index
* introduce create-new-index-spec, split out of find-compatible-index
* pick last index
* docstring
* add test
* split into determine-target-index/switch-to-index
* remove index-created? opt
* ensure table always exists
* back out including id/index_created_at in index
* move model-table-suffix out of qualify-index
* fix kondo warnings
* Add PostgreSQL provider icons to db form
fix types and opacity
# Conflicts:
# frontend/src/metabase/databases/components/DatabaseDetailField/DatabaseDetailField.tsx
* Store provider name field in form context and send it to the db create endpoint
* store provider name in the app db
* Use the non-deprecated form field for DB provider field
* Allow setting null value to provider name field
* Fix db tests
fix test
fix test
* Add db submit integration test
fix type error
* Rename mock file name
* Simplify postgesql json form mock
* Set provider_name in the same db update as rest of the fields
* Use select-keys-when for DB put update handler
* wip
* fix unit test and fix utm tags on link
* update docs link
* Update frontend/src/metabase/home/components/EmbedHomepage/tests/EmbedHomepage.unit.spec.tsx
Co-authored-by: Phoomparin Mano <poom@metabase.com>
* Update frontend/src/metabase/home/components/EmbedHomepage/EmbedJsContent.tsx
Co-authored-by: Phoomparin Mano <poom@metabase.com>
* address feedback
* swap static and sdk as per feedback in the pr
---------
Co-authored-by: Phoomparin Mano <poom@metabase.com>
* Fix duplicated table column viz settings
* Add BE logic
* Fix
* Review fixes
* Review fixes
* fixup! use linear time deduplication
---------
Co-authored-by: Edward Paget <ed.paget@gmail.com>
* Updates page title to be document's name
* Memoizes SetTitle so it doesn't perform a bunch of calculations on every render when the title hasn't changed
* fix: adjust schemas for inactive tables too
When toggling the multi-catalog setting for a database, we rename
existing schemas to match. For example, if you turn multi-catalog on and
have the existing schema `foo`, we'll rename it to `mycatalog.foo`.
Similarly, if you have the existing schema `mycatalog.foo` and turn
multi-catalog *off*, we'll rename it to `foo`.
We were ignoring inactive schemas here, which meant that if you turned
on multi-catalog and some of your tables became inactive (quite possibly
because you didn't update the schema filter to match, a major footgun
for the user), we would:
- update the tables going one way (`foo` to `mycatalog.foo`) and
deactivate for not matching the schema filter, then
- never update the tables again, because now they're inactive
Instead we should update the schemas for inactive tables as well.
Related to [UXW-375: Databricks multiple catalogs - Table
"database.catalog.schema.table" is
inactive](https://linear.app/metabase/issue/UXW-375/databricks-multiple-catalogs-table-databasecatalogschematable-is) / https://github.com/metabase/metabase/issues/61492
I don't think this is a complete fix though - we may need to rethink the
feature, and possibly just not allow you to change the setting for
existing databases.
* Add a test
* Allow rendering databases as disabled in DataSelector
* Allow rendering databases as disabled in DataSourceSelectors
* Allow rendering databases as disabled in NativeQueryEditor
* Add features for transforms/* to type
* Disable unsupported source tables in the native queyr transform builder
* Allow disabling databases in DataPicker
* Allow passing shouldDisableItem from Notebook to DataStep
* Disable unsupported databases in datapicker for transforms
* Remove type error in filter
* Pass shouldDisableItem to more pickers
* Add missing database to item
* Filter out unsupported questions too
* Remove database property again from DataPickerItem
* Fix item type
* Rename db_id to database_id
* Pass database_id in collection picker
* Disable unsupported tables, metrics and dashboards
* Hide recent items that have been disabled
* Padd shouldDisableItem to more sub-pickers
* Add database metadata to table
* Add shouldDisableItem to TablePickers
* Rename helper
* Simplify types
* Add hook to avoid using metadata
* Disable questions based on unsupported databases in question picker
* Allow disambiguating RecentItem from TableItem
* Disallow transforms on audit databases
* Add tests for unsupported databases
* Add unit tests for disabling items
* Disable dashboards in Question picker
* Use plain ORDERS_ID
* Move database support helper to utils and pull data fetching out of hook
* Pull out helper into separate definiton
* Add test about creating transforms from metrics
* Remove transforms/view and transforms/materialized-view from api types
* Use Loader from metabase/ui
* Fix types
* fix: handle pivot-grouping as a BigDecimal
Some database drivers (Oracle) seem to convert the pivot-grouping
integer into a BigDecimal; this attempts to safely convert it back to an
integer we can perform bitwise operations on, using .longValueExtract
which will throw an exception if the number is not losslessly
convertible to a long.
* fixup! throw if conversion fails
In `enforced-sandboxes-for-tables` we were only checking the
permission in the `data_permissions` table, without special-casing
administrators like we do elsewhere.
So when checking to see if an administrator in `All Users` (sandboxed)
and `Administrators` had an enforced sandbox for a table, we were
checking to see whether there were rows in `data_permissions` providing
`Administrators` with `:unrestricted` data access to the table - which
will never be the case, because Administrators is special and never gets
any rows there.
Instead, special-case the super user case like we do elsewhere. Don't
bother getting the groups they're a part of - we know the set of tables
they're sandboxed on is empty.
* fix: handle whitespaces in the connection string, decode username and password
* Trim the connection URI at first step
* Add safe uri decode, edge case test and remove redundant trim
* wait up to 10 seconds for worker to stop
in CI getting lots of flakes. Here's reproduction locally:
```
queue-test=> (dotimes [_ 20] (listener-handler-test))
FAIL in (listener-handler-test) (queue_test.clj:178) ;; 1
Standard behavior with a handler
expected: (not (thread-name-running? thread-name))
actual: (not (not true))
FAIL in (listener-handler-test) (queue_test.clj:178) ;; 2
Standard behavior with a handler
expected: (not (thread-name-running? thread-name))
actual: (not (not true))
,,,
FAIL in (listener-handler-test) (queue_test.clj:178) ;; 18
Standard behavior with a handler
expected: (not (thread-name-running? thread-name))
actual: (not (not true))
nil
```
and after:
```
queue-test=> (dotimes [_ 20] (listener-handler-test))
nil
```
* eastwood doesn't like new qualified method stuff
* Attempt to fix flaky tests
emails can end up in here from other tests as well. So this takes two
tracks:
first, i want to just check all emails in the box for this
user. Sometimes there are multiple emails in here and the one we want
isn't first. and second, better error messages. This will show us all
email message subjects. Hopefully that lets us identify what else might
be going wrong.
Next step if this is still failing it to attach which test sent the
message using clojure.test/*testing-vars*.
Adds a simple function and a macro to `metabase.util.log` to allow
propagation of ThreadContext across thread boundaries.
`(with-context-meta some-map)` adds the `mb-` prefixed items in the
`ThreadContext` to the metadata of that map.
`(with-restored-context-from-meta some-map)` takes a map presumably
resulting from calling `with-context-meta`, and sets the current
`ThreadContext` accordingly.
I changed the dispatch-fn and the worker consumption functions in
`metabase.notification.send` to use these to propagate the ThreadContext
to the worker thread.
Sending a notification like
```
(log/with-context {:aoooooook "hey"} (dispatch! {:flippity "ofosidjffoo"}))
```
now results in:
```
2025-08-18 14:42:45,716 ERROR notification.send :: Error in notification worker {mb-aoooooook=hey}
clojure.lang.ExceptionInfo: Invalid input: {:payload_type ["invalid dispatch value, got: {:flippity \"ofosidjffoo\"}"]}
```
* Improve log context for exceptions
This adds a feature to our log context that I've used and loved in the
past.
For illustration, let's say I do this:
```
(defn my-fn []
(log/with-context {:user 123 :database 5}
(/ 1 0)))
(try (my-fn)
(catch Exception e (log/error e)))
```
With the current code, we'll run `my-fn`, throw an exception,
then *exit* the `log/with-context` block. When we eventually log the
exception, the context will be empty.
This is annoying, because when the exception was thrown, we had context
that a developer thought would be useful. But just when it would
be *most* useful to have that information - an uncaught exception we
didn't think about bubbles up to the HTTP request logging middleware or
whatever - it's thrown away.
This change essentially wraps `with-context` calls with a `try/catch`
that catches any exceptions and re-throws them, annotated with the
original context.
This way, when we actually log the exception, we can swap back the
original context. In the above example, `{:user 123 :database 5}` would
be logged with the exception.
* Move log context ex-data to special key
When the exception middleware catches an exception it does some fancy
logic about whether to just let the body be the exception message (like
"Not found") or a blob of data with the message, stacktrace, data, etc.
Including the log context in the ex-data itself caused this to get
confused (because some additional data was present in the `ex-data`) and
spit out the blob where previously we'd just presented a user-friendly
error message.
To avoid doing this accidentally in the future, I just stuck all the log
context data under a special key, `:metabase.util.log/context`, in the
ex-data, which we can explicitly ignore when deciding whether to include
the whole exception in the error response.
* Fix failing test
* Fix conversion of joins with a native source query to legacy
* Don't do nasty stuff to parameters when converting from legacy
* Move parameters to correct location when converting joins
* Fix conversion of joins with filters
* Splice join parameters together
* QP params => Lib
* Fix Kondo warnings
* Simplify PR [ci skip]
* Beautiful QP middleware
* Beautiful QP middleware.
* Add notez
* Test fixes 🔧
* JVM metadata provider fix 🔧
* Kondo & cljfmt
* Test fixes 🔧
* kondo
* Delete the Lib-style rewrites of the parameters code, I decided I didn't like them
* Fix the schema
* Revert unneeded changes
* Fix busted tests 🔧
* Fix two more busted tests.
* Fix even more broken tests
* Fix broken tests 🔧
* Improved normalization for :value clauses
* Test fix 🔧
* Test fix 🔧
* Fix resolution of field name refs in first stage
* Test fixes 🔧
* Another round of test fixes 🔧
* Fix :expression ref parameters
* Maybe fix flakes
* Test fixes 🔧
* cljfmt/kondo
* Reduce coupling between semantic.index and semantic.scoring
Previously ->col-expr was defined in the scoring namespace and had to "know" about hybrid search query table aliases, which is gross.
Instead, define a hybrid-coalesce func in the semantic.index namespace and pass it into the semantic-scorers function. Also use it in hybrid-search-query, to ensure hybrid column references are constructed in the same way in both places.
* Add semantic-scorers->col-expr-is-respected-test
* Remove ->col-expr and just re-project cols from hybrid query with well-known names
* Add an API endpoint to delete collections
This permanently deletes a collection and anything contained inside it.
One "exception" that's not really an exception: say you have A > B > C > D,
you trash C, then trash A.
Now you have:
```
Trash > A > B
Trash > C > D
```
(because C was trashed directly).
But internally, we still represent D's location as `/A/B/C/`.
Now you permanently delete A. We need to make sure D's and C's locations
get fixed. Therefore, before deleting A, we go through all
the *directly*-archived children of A, and move *them* to A's parent.
Moving a collection also moves its children, so we'll move the whole
`C > D` structure out of `B` into the root collction.
Then we'll delete `A > B`, leaving `C > D` behind.
* Don't get the parent for no reason
the children-location of my parent is... my location. :doh:
* Ensure we cleanup the index metadata tables as well as the index table in with-index!
Otherwise, we wind up with many "duplicate" docs in the gate table which results in duplicates in the index. These are
not true duplicates; they have fresh model ids from the with-temp'ed mock docs we create, but they have identical
content, so they have identical embeddings and tsvectors. Those documents then wind up with identical text and
semantic scores when querying the index, and since we ORDER BY the scores (with no tie breaker secondary ordering),
this creates non-determinism in the semantic and keyword rankings, making test assertions wonky.
* Tighten up test assertions in native-query-test
These were relaxed to top-three? in #62101, but since the query results are no longer non-deterministic, it should be
safe to switch back to requiring the match to be the first result.
* feat(mage): add port option to mage nrepl
Adds an option to the mage nrepl command to customize the port mage's
nrepl starts on. This is mostly so I don't need to modify my clojure-mcp
configuration to point to a different port when working on mage stuff.
* feat(mage): add port option to mage nrepl
Adds an option to the mage nrepl command to customize the port mage's
nrepl starts on. This is mostly so I don't need to modify my clojure-mcp
configuration to point to a different port when working on mage stuff.
* feat(mage): print better argument usage help
* make semantic search resilient to errors on fallback engine
* sort active-engines by default-engine first
* more logging around appdb init
* add test
* update the dashboard form to use mantine components
* committing forgotten files
* e2e adjustments and fixes
* test adjustments
* remove shameful hardcoded font sizes
* fix font size on switches
* adjusting unit test
* Fix OSS/EE artifact conflict in uberjar workflow
Problem: When fetching both OSS and EE artifacts in check-existing-artifacts job,
unzip was prompting for confirmation to replace COMMIT-ID file, causing the
workflow to fail with 'EOF or read error, treating as [N]one' error.
Solution: Use different extract paths for OSS and EE artifacts to avoid conflicts:
- EE artifact extracts to 'ee-artifact/' directory
- OSS artifact extracts to 'oss-artifact/' directory
This allows both artifacts to coexist without file conflicts, fixing the
artifact recycling issue for both OSS and EE versions.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(ci): resolve OSS/EE artifact conflicts by extracting to separate paths
Fixes COMMIT-ID file conflicts when fetching both OSS and EE uberjar artifacts
by extracting each artifact directly to its designated directory path instead
of the current directory. Simplifies fetch-artifact action logic while
maintaining full backwards compatibility.
Changes:
- Extract artifacts directly to specified extract-path
- Eliminate file conflicts between OSS and EE artifacts
- Simplify processing logic by unifying unzip and rename steps
- Maintain backwards compatibility for all existing workflow usages
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(action): correct error message for missing artifacts to use input name
* fix(ci): optimize uberjar concurrency to prevent duplicate builds per commit
Changes concurrency grouping from branch-based to commit-based to allow
multiple workflows to call uberjar for the same commit while preventing
duplicate builds. The existing artifact checking logic handles deduplication.
- Group by commit SHA instead of branch ref
- Disable cancel-in-progress to avoid wasting build work
- Allow concurrent calls from different workflows (pr-env, perf-test, etc.)
- First caller builds, subsequent callers reuse existing artifacts
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(action): use temp directory to avoid file conflicts during artifact extraction
The fetch-artifact action was failing when multiple artifacts were extracted
to the same directory due to file conflicts (e.g., COMMIT-ID files). The unzip
command would prompt to replace existing files, causing CI failures.
This change extracts artifacts to unique temporary directories first, then
moves only the JAR file to the final location, eliminating conflicts while
maintaining full backwards compatibility.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix(workflow): remove source_changed input and simplify build conditions
* fix(action): remove unnecessary blank line in fetch-artifact action
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Fix regression - small cta for large upsell banner and big card
* Extract upsell styles to per component css modules
* Regression - bring back margins to cta in large upsellbigcard
* Add upsell components to loki visual tests
* Fix too big margin in upsell large variant
* Align storybook story with the real usage
* Update Loki Snapshots
* Allow custom button styling on UpsellCard, move custom styles card instance
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
* Update writing-sql.md
Adds a section below "How Metabase executes SQL queries" noting that we don't officially support multi-statement queries or DDL (and recommend against use of procedures and functions).
* Apply suggestions from code review
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* Make Lib schemas better about catching MBQL-only keys in native stages or joins
* Replacing a field ref in join :fields should set the correct join alias
* Add view_count scorer to semantic search backend
* Get pgvector db from global env in semantic.scoring/view-count-percentiles*
Get the db data-source directly rather than passing it in as an argument to this function to side-step potential
issues with using the db as a cache key for the memoized version.
https://github.com/metabase/metabase/pull/62086#discussion_r2272790618
Adds an option to the mage nrepl command to customize the port mage's
nrepl starts on. This is mostly so I don't need to modify my clojure-mcp
configuration to point to a different port when working on mage stuff.
* remove references to static questions
* Ditch overall sidebar for now (#61523)
* Remove list of cards sidebar
* Some type fixes
* Review fixes
* feat: associate in_report cards w/ report_document
* feat: associate cards with reports in create
* better markdown serde
* switch to prosemirror ast
* chore: add enterprise card test
* remove snapshots
* less redux
* send used card ids
* drop flushSync error
* remove replace question, drop refresh question
* fix backend not starting
* saving new report should not show LeaveRouteConfirmModal
* polish
* Insert into reports from metabot (#61642)
* insert from metabot
* Metabot plugin and hook
* make stuff nicer
* cleanup
* no more snapshots
* run build and docker uberjar on push
* remove trigger for uberjar
* Print Report
* cleanup
* always create a card clone when embedding
* always clone non in_report cards
* disable metabot sidebar on mob+b
* stop header bouncing
* jumping layout when loading
* why scroll to bottom when opened
* gross emojis
* cleaning up emoji ui a bit
* icons
* fe: reports -> documents
* update metabot question creation parsing
* keep report cards and collections in sync (#61686)
* do not leak prosemirror styles into charts
* chore: rename everything to document (#61743)
strip out snapshotting code
* fix FE usage of documents api
* fix embedding dashboard-only cards to documents
* uxw-366: Navigation back to the report from a drill through can be difficult - can we add the back button like for dashboards
* mention all entities
* split mention vs command, allow mentioning other entities
* paste smartlinks
* missing import
* fix links to tables
* fix layout
* auto focus on title on new documents
* UXW-404 Improves image formatting
* Tweaks metabot block styling, wires up "stop generating" functionality
* Fix issues with multiple in-flight requests
* Adds subtle animation to "Working on it..." message
* Document Metadata
* Fix some CI issues
* Persist cards when saving document (#61818)
* chore: remove document version model
* persist cards only when saving documents
* chore: remove in_document type
* feat: return document creator
* feat: save cards with parameters pass in as cards
in POST and PUT requests to documents
* chore: exclude doc cards from where shouldn't be
search, recents, collection items
* chore: fixup search and card tests
* contract
* feat: update document ast with new card ids
* fix: report -> document in collection api
* fix: ws
* feat: clone cards not associated with document
* chore: add tests for document permissions
* fix contract
* fetch root collection
* update message
* must be working now
* fix sidebar
---------
Co-authored-by: Edward Paget <ed.paget@gmail.com>
* wip but working sql query editor in documents
* feat: revision history for documents
* feat: include revision info in collection tree res
* document entity
* Fix issue where temporary implementation of metabot block can't create questions
* feat: allow documents to be archived
* Document Collection Item Caching
* Fix issue where submitting empty metabot prompt (by hitting "Run" or cmd+enter) makes it spin forever
* fix UXW-412 again
* feat: allow documents to be bookmarked
* fix: hide documents in collection items if not EE
* fix: add perms info to documents in collections
* fix: always add documents to bookmark lookup
* feat: add document delete endpoint
* fix: require non-blank string for name
* App Bar Breadcrumbs for documents
* fix: tests and lints
* fix: ordering of migrations for mysql
* fix: for OSS tests
* fix: tests and kondos
* fix: module sort
* New metabot documents API
* UXW-400: formatting floating menu
* UXW-416: replace question should replace only 1 question
* swap icon
* l10n
* fix: bad var reference in tests
* undo moves should work once archived is boolean
* Show tooltip with precise time in document metadata
* Updates MetabotEmbed to work with upcoming BE changes
* Updates MetabotEmbed to always use draft cards
* Updates MetabotEmbed "stop generating" functionality to work with regular (non-streaming) api call
* Updates MetabotEmbed to use most up-to-date api contract
* Stubs out the necessary updates to make MetabotEmbed work with an UnsavedCard from the BE rather than a full Card
* Updates MetabotEmbed to use most up-to-date api contract
* fixed drills & query editing for metabot cards
* fix: foreign key indexes
* Replaces hard-coded metabot-generated card title with title from the /generate-content response (or translates a default title if none provided)
* fix: add entity id column to documents
* add title to untitled docs
* UXW-453 Fix 404 when clicking draft card title
* Handle URL slugs, remove version code from document page, handle 404 and 403
* UXW-459 Fix issue where creating a new document when starting from another document overwrites the existing document (and shows previous document's metadata in new document)
* hide object detail row in document tables
* UXW-459 Fix issues with LeaveRouteConfirmModal and new documents
* UXW-461 Prevents jump when Save button appears/disappears. Also adds subtle fade-in transition when it appears.
* UXW-461 Save button always shows up for new documents (and user has necessary permissions)
* improved mention and command
* clean
* fix replace question
* do not show bubble menu on disallowed nodes
* MetabotEmbed polish:
* Prevents prompt from highlighting when you hit "Run" (potentially bringing up the editor bubble menu).
* Prevents useEffect hook from running way more than it needs to.
* Adds margin below MetabotEmbed.
* Hitting escape with nothing in the textarea will now remove the MetabotEmbed block.
* Makes layout less janky when Metabot responds with a long error message.
* Localizes "Created with Metabot" text
* drop emojis
* no emojis and markdown downloading
* fix metadata fetching
* initial e2e tests
* fix: set null on collection cascade for documents
mirrors behavior for dashboards and cards
* fix: remove documents token hack
* feat: documents in search
Also supports view_counts and last_viewed_at for documents
* fix: emit documentment read on api get
* fix: in_place search fixes and test fixes
* fix: migration order
* fix: set type to :question dashboard_id to nil
* fix: more in-place search fixes for documents
* fix: final in-place search test fixes
* fix: handle inadvertent documents in oss tests
* mention + command feedback
* placeholder
* fix command search
* Fix issue where charts sometimes don't get added via metabot when inserted in the middle of a document
* fix command
* feat: support pinning documents
* fixup! pinning reconcilation with documents
* feat: support serdes on documents (#62032)
* fix: kondo warning on unused var
* updated styles
* bump padding
* Markdown Loki Test
* UXW-462 Adds database picker in metabot block
* UXW-462 Fix issue where sometimes custom tiptap node tries to re-render too quickly resulting in an error
* refactor
* feedback on the command
* UXW-462 Fix issue where you can write markdown in metabot blocks
* improve state management UXW-463 UXW-450
* Updates "Created by Metabot" line based on design/user feedback
* feat: add documents to recents
* fix: whitespace and round-trip serdes test
* fix: whitespace exclusion path
* fix: token features in recent views test
* Able to generate sql charts
* fix: casing in tests
* Changes how mention text is referenced in the documents metabot prompt serializer. It uses a cache in the documents slice now. It was using a node attribute before but that was hacky and it messed with the "is dirty" calculation.
* more e2e tests
* Fix issue where metabot nodes sometimes yield a false positive in hasUnsavedChanges because they updated their own attributes
* Update menu items (#62072)
* Update commands and remove descriptions
* Removes unused code
---------
Co-authored-by: Brad Anderson <brad@metabase.com>
* feat: return can_restore, can_delete for docs
* Updates Document type with newly added properties
* Fix issue where "Delete permanently" errors out instead of deleting
* Move, Archive, and Bookmark in documents page
* bury shame
* UXW-472 Adds ArchivedEntityBanner for documents
* fix: remove extraneous precondition migration
* UXW-451 Adds some light dataset error handling
* Reverts probably-accidental change
* feat: check for name length
* Reports fix fe ci (#62046)
* Fix some CI issues
* Fix some CI issues
* Fix typecheck issues
* Fix lint
* Fix unit tests
* Fix e2e tests
* fix pivot query editing in documents
* better command popover positioning
* UXW-473 fix layout
* fix z-index
* only include tables you can use for native query builder
* Fix typecheck
* Light documents metabot cleanup
* Fix issue where browsers spell check areas that shouldn't be spellchecked (e.g. "Ask Metabot ...")
* Removes package-lock.json that was accidentally added in 63a94c8788 and should've been removed in 68366d7d37
* cleanup
* attempting to get a card embed in storybook
* Fix documents stories
* fix: bookmarks fail if token exists but ee doesn't
* fix: bookmark inside a collection error
* Removes now-unused extensions
* chore: tests for metabot tools
* Add token check on the FE
* fix: remove unused ns from test
* Review fixes
* Revert token check
* Add token check on the FE
* fix: correctly serialize token status to FE
* Fix e2e tests (#62113)
* Fix e2e tests
* Fix e2e
* fix: use adhoc metadata if card id is negative
* chore: add tests for isSavedCard guard
* UXW-489: replace shows entity picker, UXW-507: don't highlight chart after insertion
* Fix typecheck
* fix: token feature tests
* fix: add docs to stats ping
* Fix typecheck
* Fix e2e
* Reverts now-unnecessary changes
* Reverts more now-unnecessary changes
* Address cubic PR feedback (type guards)
* Fix issue where landscape-orientation images larger than the max-width get stretched
* Fix e2e
* PR feedback (code cleanliness)
* PR feedback (simplify custom node definition)
* adding loki references
* delete loki reference files
* adding missing loki reference files
* auto-fix generated sql (#62167)
---------
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
* PR feedback (unit test + remove unused classes)
* addressing some minor feedback
* chore: add table utils tests
* review
* Cleans up types
* Removes /documents/redux-utils. Uses plain useDispatch/useSelector hooks instead.
* review
* cleanup documents selectors
* remove unnecessary type cast in visualizationUtils.ts
* remove versioning mention in comments
* use _.isEqual instead of json serialization and string compare
* Code review fixes
* remove inline styles from FormatButton
* fix bubble menu does not immediately show what formatting is applied
* remove inline styles
* drop unused suggestion styles
* consistent hook names
* drop unused dep
* remove any from DocumentPage
* clean up change callbacks of the editor component
* drop unused onClode prop in EmbedQuestionSettingsSidebar
* provide correct reportTimezone to ModifyQuestionModal
* make runQuestionQuery optional
* NativeQueryModal cleanup
* clean up NativeQueryModal
* drop unused code in useDocumentState
* unnecessary casting
* reset error state
* drop unused prop
* bubble menu disallowed nodes
* dedupe similar hooks
* review
* fix: kondos
* Update e2e/support/helpers/api/createDocument.ts
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* fix: PR comments
* fix: remove schema ns
* Potential fix for e2e test failing on CI only
---------
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
Co-authored-by: Edward Paget <ed.paget@gmail.com>
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: Luiz Arakaki <luiz.arakaki@metabase.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
Co-authored-by: Nathan Voxland <nathan@metabase.com>
Co-authored-by: eliotmetabase <eliot@metabase.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* Remove feature-visualizer and nm-semantic-search-in-metabase from the Build Uberjar workflow
The feature-visualizer branch was removed in 3e605c6d87, but came back in (presumably due to bad merge conflict
resolution) from the semantic search branch.
* Fix typo in gate test: documen -> document
* Make cause third arg to ex-info in semantic-search /status endpoint
* Create HeaderLinkGroup with new links and add to ExistingDatabaseHeader.tsx
* Don't show database added popup when database is created
* Ensure 'Browse data' button link does nothing when disabled
* Fix e2e tests
* Fix e2e tests part 2
* Adjust 'Browse data' link to be an actual button when disabled
* Fix padding (keep button padding & adjust flex gap)
* copy over relevant code from semantic search service
* copy docker compose, add defenterprise integration
* WIP getting the integration working
* fix up reindex! call
* fix whitespace
* kick ci
* remove ^:const to try to fix compilation errorin tests
* Adds mi/can-read? checks to search results (#61060)
* Add a couple of helpful comments for manual testing
* Add ability to change db-url at the repl
* Add can-read? checks for search results
* Semantic search engine should not be used if the db is not setup
* sort kondo modules
* fix up syntax in metabase.search.impl and whitespace
* remove a blank line
* fix remaining clj-kondo issues
* Add semantic search test workflow (#61065)
* Add new workflow for semantic search
* Add a quick example test to see if things work
* Have the new tests only run if db-url is defined
* Sparks of joy
* Add a delay to appease the kondo gods
Not sure this rule should apply to once-fixture, but for now lets fix
it.
* Semantic search filtering, basic querying tests, connection pooling, etc (#61098)
* fix results postprocessing, add verified field to search index
* scaffold a basic query test
* index filtering tests
* quicky and dirty implementation of the requested ui changes
* Add basic connection pooling + tests
* Fix test indentation
* add test for verified content, refactor tests a bit
* address comments
---------
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
* Add nm-semantic-search-in-metabase to uberjar workflow and remove metabot-v3-main (#61142)
In preparation to deploy the nm-semantic-search-in-metabase branch to stats.
* Use EE feature for semantic search defenterprises (#61139)
* switch defenterprise features from :none to :semantic-search
* update tests
* Register semantic-search premium feature
* FE - default to app db search, enable semantic in command palette and search page, add disable semantic search on search page
* Test collection based permission checks apply to search results (#61152)
* Fix t2-instance derivation from search docs
Lookup in database as the search document model is lossy
* Test collection based permission checks apply to search results
* Swappable embedding models + semantic search kill switch (#61176)
* first stab at swappable embedding models + setting to disable semantic search globally
* fixups
* fixups
* fix up error in tests
* add semantic-search to stats ping to quiet test
* quiet another test
* fix whitespace
* fix kondo warnings
* fix up and simplify embedding tests
* fix core init test
* fix more tests
* tweak setting defaults + comments, remove debugging code
* fix compilation
* change oss version of supported? to return false instead of throwing
* fix lint issues
* Batched index updates for semantic search (#61117)
* kick ci
* Add comment to trigger reindex job
* Fix docstring typo
* Batch index updates for semantic search
* Wrap {create,drop}-index-table! in mt/as-admin in with-temp-index-table!
* Move binding for *vector-dimensions* into with-mock-embeddings
* Create metabase-enterprise.semantic-search.test-util and move once-fixture there
* Move other test helpes and macros into the semantic.test-util ns
* Factor out with-indexable-documents! from with-index!
* Move binding of search.ingestion/*force-sync* into with-temp-index-table!
Questionable, but realistically can't see tests wanting to use a temp index table without forcing sync reindex.
* Add table-exists-in-db?! to semantic.test-util
* Add some basic tests for funcs in the semantic.index namespace
* Add tests for batched index updates
* Disable flaky tests
* Fix up issues post-rebase
---------
Co-authored-by: Noah Moss <noahbmoss@gmail.com>
* Fix accidental blocking search index init (#61200)
* kick ci
* Fix accidental eager index initialisation
---------
Co-authored-by: Noah Moss <noahbmoss@gmail.com>
* Batched requests to OpenAI for fetching vector embeddings (#61217)
* Batch calls to openai according to token counts
* refactor
* mock the new batch embedding function
* mock both batched and unbatched embedding functions in tests
* a little code consolidation
* address comments
* Init db connection in reindex! if needed
* Add more DB existance checks for safety
* fix fe tests
* Lower batch size, improve logging, and make it configurable via env var (#61274)
* Lower batch size, improve logging, and make it configurable via env var
* fix whitespace
* Remove transaction from batched semantic search index updates (#61229)
* Drop uneccessary ! from table-exists-in-db?!
* Don't wrap batched index updates in a transaction
https://github.com/metabase/metabase/pull/61117#discussion_r2214828302
* Filter indexed entities from semantic search index
* Create HNSW index on semantic search embeddings column (#61238)
* Create HNSW index on semantic search embeddings column
* Add test for HNSW index creation
* Ensure identifiers are quoted when formatting honey sql in semantic search index
The nano-ids used in temp table names when testing (and various other places) might contain uppercase chars or hyphens which need to be quoted.
* Fix batch-delete! log message
* alter create-index-table! to not wipe the index if it already exists, and use the upsert API during index population (stop-gap changes to try to get the staging instance working)
* fix document filtering
* Only create HNSW embeddings index :if-not-exists (#61305)
Since init! no longer wipes the index table if it already exists, we also need to only create the embeddings HNSW
index if it does not exist.
* Better batching for semantic search (#61299)
* streaming embedding results to the index-updating code
* rework
* suppress kondo
* Parameterization refactor (#61328)
Adds the `index` and `embedding-model` parameters to functions in `index` and `embedding` respectively. This allows a degree more flexibility and less coupling to global variables which restrict how indexing functions can be used.
The goal is this PR supports changes regarding active/pending and the embedding model being something you can play with at runtime.
* Add embedding-model parameter
* Restore previous top-level transaction behaviour on init/reindex
* Reduced redundancy
* Embedding test fixes
* Fixup comments
* Fix rebase goofs
* Fix tests again
* Joy
* Add `index` parameter, composed of table-name and embedding model
* Keep index name in the index structure
* English is a hard language
* Remove `:redef` we no longer want
* Another merge goof fix
* Fix bug in associating batched embeddings with original documents (#61347)
* Fix bug in associating batched embeddings with original documents
* tweak
* add log
* Quick follow-up optimization to prior PR: don't iterate over all of filtered-documents in each batch
* [Metabot] Hybrid search w/ RRF (#61353)
* rrf based hybrid search implemented
* keyword results weighted more heavily by name, corrected some issues with the rrf calc
* fix final result ranking
* move tsvector-related util functions into search.util and expose in the search interface to fix kondo errors
* Taking a stab at fixing SQL injection risks following existing postgres tsvector querying pattern
* Move postgres tsvector util tests
* gracefully handle nil names
* switch back to raw embedding literals but validate their contents
* add back perm checks (whoops)
* add back str/replace for ts-search-expr, bump up cosine distance cutoff
* tweak cutoff again, fix create index test
* remove str/replace usage bc it seems unneeded
* fix rrf calc
---------
Co-authored-by: Noah Moss <noahbmoss@gmail.com>
* Remove indexed-entities from the semantic search model-set and documents reducible (#61304)
* Remove indexed-entities from the semantic search model-set
* Add comment about filter-read-permitted and indexed-entity docs
* Add prometheus metrics for semantic search backend (#61309)
* Add :metabase-search/semantic-index-size prometheus metric
And update it on upsert-index! / delete-from-index!
This metric mirrors the corresponding :metabase-search/appdb-index-size
* Add :metabase-search/semantic-embedding-tokens prometheus metric
* Make log levels / messages more consistent
* Remove vestigial populate! reference
* Record actual token usage as reported by OpenAI API response
* BOT-255 Index metadata system (#61379)
* Add index-metadata system
Adds the necessary indirection to support more advanced index table
management.
- Allows multiple indexes to exist
- Indexes are tracked by a new index_metadata table
- A single active pointer determines which index to use for the current
search engine backend
- It is assumed table == logical index and there is no other
partitioning, hence the unique constraint
- Some small simplifications to index.clj (drop index-name, assume names
are prefixed with the table name)
- The top level orchestration code happens in a new pgvector-api
namespace to avoid bloating the enterprise hooks (which assume a global
environment), and allow the api level to be properly parameterized.
* Kondo
* Appease kondo with require for next.jdbc in comment block
---------
Co-authored-by: Mike Appleby <86076+appleby@users.noreply.github.com>
* Enable fts on native query contents in the semantic search backend (#61576)
* Enable fts on native query contents in the semantic search backend
Update the semantic search backend to handle fts of native query contents in exactly the same way as the appdb
backend, namely: all keyword search content gets indexed into two separate columns, one with and one without native
query contents. At runtime, we decide which column to query against based on the user's search setting.
For now, this only modifies the keyword search side of the hybrid search result. The semantic search on the vector
embeddings still does not include native query contents, but any keyword matches can still get blended into the result
set by the RRF ranking.
* Ensure index names do not exceed postgres max of 63 characters
* Allow to toggle NativeQuery independent of DisableSemanticSearch in SearchSidebar.tsx
* Cleanup whitespace
* Add native-query-test
* Add :native_query to semnatic.tu/mock-documents
* Add upsert-index!-tsvectors-test
* Remove unecessary :raw wrapper from column names
* Remove unused =? alias
* [Semantic Search] Embedding generation support for OpenAI compatible APIs (#61641)
* make open base url configurable, add arctic-embed support, sanitize index table name for models with slashes + commas + periods
* make table names slightly shorter
* Update enterprise/backend/src/metabase_enterprise/llm/settings.clj
Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
* Update enterprise/backend/src/metabase_enterprise/semantic_search/index.clj
Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
* Update enterprise/backend/src/metabase_enterprise/semantic_search/index.clj
Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
* split off provider name to make index shorter
* Fix tests failing due to removing text-embedding-3-large model
* Abbreviate model names to ensure we do not exceed postgres identifier name limit
---------
Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
* Ensure that semantic search entrypoints are safe to call without init! (#61438)
* Ensure that semantic search entrypoints are safe to call without init!
* Move more helpers into semantic.test-util namespace
* Add tests for calling semantic search entrypoints prior to calling init!
* Adjust fix and tests to work better with new index-metadata apis
And also log a warning and return nil if anyone calls into update-index! or delete-from-index! prior to calling init!
* set default for ee-openai-api-base-url setting
* BOT-258 semantic indexed entities (#61527)
* kick ci
* Semantic search filtering, basic querying tests, connection pooling, etc (#61098)
* fix results postprocessing, add verified field to search index
* scaffold a basic query test
* index filtering tests
* quicky and dirty implementation of the requested ui changes
* Add basic connection pooling + tests
* Fix test indentation
* add test for verified content, refactor tests a bit
* address comments
---------
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
* FE - default to app db search, enable semantic in command palette and search page, add disable semantic search on search page
* Init permission support for indexed entities
* fix kondo
* Fix rebase errors
* Fix rebase errors
* pr feedback
* unit test index entity perm filter
---------
Co-authored-by: Noah Moss <noahbmoss@gmail.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
* BOT-259 Semantic search filter parity (#61396)
* kick ci
* Semantic search filtering, basic querying tests, connection pooling, etc (#61098)
* fix results postprocessing, add verified field to search index
* scaffold a basic query test
* index filtering tests
* quicky and dirty implementation of the requested ui changes
* Add basic connection pooling + tests
* Fix test indentation
* add test for verified content, refactor tests a bit
* address comments
---------
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
* FE - default to app db search, enable semantic in command palette and search page, add disable semantic search on search page
* Remaining search filter support minus has_temporal_dimensions
* ignore public API warning about metabase.search.filter
* Fix collection filter impl
* fix kondo
* [no ci] remove comments
* More efficient querying
* Fix rebase errors
* fix merge
---------
Co-authored-by: Noah Moss <noahbmoss@gmail.com>
Co-authored-by: Noah Moss <32746338+noahmoss@users.noreply.github.com>
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
* try something else
* Remove semantic HNSW index breaking where clause (#61765)
* Adjust semantic search query to favor HNSW index over seq scans (#61768)
* Adjust semantic search query to favor HNSW index over seq scans
* remove limit and SET random_page_cost
---------
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
* [SEMANTIC] base64 embeddings and better logging (#61809)
* Improved logging; base64 embedding
* trim double
* Use parse-double over parseDouble
* fix search.engine/init! return (#61825)
* fix: return model frequencies from search.engine/init!
* fix: document return type of init!, like per delete! and update!
* fix: calc for batches
* semantic search instrumentation (#61790)
* intrument semantic search
* test for analytics
* typo
* fix: id is numeric
* move test next to metrics one
* Support switching between :semantic and :appdb engines (#61826)
* add test
* lift util
* feat: add full api test
* fix: appdb available when search-engine is semantic
* Fallback to appdb search if semantic search doesn't return enough results (#61815)
* Fallback to appdb or in-place search if not enough results are returned from semantic search
* Dedupe combined results
* Bump up hybrid search query limit + make it configurable
* tweak setting doc, fix reflection warning in test code
* clean up tests
* move fallback implementation into the EE namespace, add a new setting for min results threshold
* fix lint issues
* ensure tests set semantic-search feature
* Do not realise document reducibles (#61860)
* wip
* batched streaming upsert-index!
* fix: actually dedupe searchable_text
* Revert "try something else"
This reverts commit eec29881c5.
* can still inner seq
* push indexed-entities last
* fix: semsearch delete
* lift delete-from-index-batch-sql
* test
* dedupe test
* style
* comment
* indexed entities last in search
* Semantic search test fixes (#61884)
* Fix api-engine-switching-test
* Test - switch test fixture to :each to see if it removes a race condition
* Revert "Test - switch test fixture to :each to see if it removes a race condition"
This reverts commit 33386c602b.
* another test - ensure init-delay is derefed before getting datasource
* remove compose-fixtures
* Revert "remove compose-fixtures"
This reverts commit 16c882a599.
* another test
* test
* add back some of core-test
* comment out all code but leave in ns
* add back fixtures
* add back one test
* replace with stub test
* remove compose-fixtures
* fix tests with a try/finally in db_test.clj
* oops, add back :once
* also revert back fixture order
* more cleanup
* use with-index! in appdb-available-with-semantic-test rather than trying to generate real embeddings
* Fix db test
* Only fetch embeddings when needed (#61918)
* chore: use appropriate builder-fn instead of unqualify-keys
* feat: cache on already seen embeddings
* add test
* distinct-on content
* better logging
* reuse test impl
* note
* repl utils
* we have if-not-exists semantics, so no point in not invoking it on init.
We need to invoke it else the new index won't get picked up.
This will change anyway once we have proper migrations with #BOT-278
* fix tests
* Incorporate metadata into semantic search result ranking (#61906)
* Move common code into search.scoring and add search.engine/scorers for backend-specific scorers
* Refactor to remove search.engine/scorers
* Add new index columns required by scoring expressions
* Add metadata score to semantic search backend
* Give up on reusing scorer expressions between appdb and semantic search
* Add :all-scores stats to semantic search query results
* Fix failing pgvector query test
* Adjust rrf weight to fix failing query tests
* Add premium scorers for verified and official_collection
* Get rid of single-use test helper dog-training-native-query-json
* Add scoring tests
* Fix for permissions issue in test
* Remove extra whitespace in bindings
* [Semantic Search] Add AI Service as an embeddings providers (#61850)
* wip
* clean up and better abbrev logic
* fix provider references
* remove magic int
* do not munge model name if not needed
* add / fix tests
* make mock index have a shorter name
* shorten nanoid
* math was not mathing
* fix kondo error
* death by lints
* [BOT-260] sem search consistency, gating and indexer loops (#61602)
* Add document gating
Adds a document gating mechanism and async indexing job.
- Allows indexing to recover if it encounters a transient error.
- Avoids data loss during indexing due to process death
- Provides an ordering which is more closely related to logical record
validity times rather than write time into the index.
* Fix some test docstrings
* Fix some loop tests
* Schedule indexer only if the instance has the :semantic-search feature
* Avoid redundant replay of the very last gate entry when the quartz job fires
* Add a quick candidate-filter byte equality test
* Refine loop interrupt/error test (get rid of old gunk)
* Use shared `tu/spy` instead of copy-pasta
* Replace candidate filter with simple set of last seen
Use TEXT for hash for eq convenience.
* Avoid future foot guns with a (letfn) refactor of indexing-step
Avoids issues that might later be introduced by the 'accidental' closure of (actual) variables that might later be changed during this side-effecting operation. In particular the move-to-next-watermark local function.
^:once was suggested but a hoisted letfn that can only close over args (which keeps the mutable indexing-state at the forefront of ones mind) keeps us honest.
* Check if engine enabled and supported during indexer task
Previously was only checking if the db was configured.
* Be more careful about Instant and timestamp representation.
Preferred is sql.Timestamp for now due to the default setup of postgres / JDBC.
* Fix up some asserts that still reflected byte hashes
* Add a quick e2e index everything test.
Find horrific pagination bug. Fix that.
We did not account for having enough ties that our buffer was full. This was likely in tests even with the high precision of the pg clock because:
- we coerced stuff to Instant which lost precision
- we generally did not account for tie breaks in pagination (bad form)
So we are paginating properly using the secondary id as a tie break. Within the confidence time only, as otherwise this would be dangerous (it is right to stall if you see too much until the lag time has elapsed). This stops stalls if lots of documents share a buffer.
Will follow up with another test that forces time collisions to assert this tie break behaviour independently.
* Test fixes
* Joy
* Add indexer docstring
* Thread pool for semantic search index batch updates (#61947)
* parallel batch processing for index updates
* tweak setting docs
* switch back to transducing version
* Revert "switch back to transducing version"
This reverts commit 4a99c3c6869e28f56d794d8057f006700cfc8432.
* fix setting name
* revamp approach - use a ThreadPoolExecutor with a custom rejection policy
* fix tests
* add concurrency test
* Fix up tests by adding a serial mode that disables thread pool usage
* Fix final test -- ensure we spy on & call only on the 4-arity version of upsert-documents
* Switch to custom retry handler
* Still wrap executor in a delay for lazy initialization
* Fix upt ests
* Fix final tests
* [Semantic Search] Remove disable semantic search filter (#61973)
* remove disable semantic search filter
* fix failing test
* Collapse indexed-entity ids in semantic search results (#61952)
* Collapse indexed-entity ids in semantic search results
The indexed-entity results have composite ids like model-index-id:model-pk. We need to extract the model-pk and attach
that as the :id on the results. Otherwise, the links generated by the frontend are invalid like
/model/12345-blah/1234:62681
* Add indexed-entity-id->model-{index-id,pk} to search.util
And use indexed-entity-id->model-index-id in filter-can-read-indexed-entity
* Fix test failure due to overly long index name
* Use dimensions param in OpenAI api calls (#62010)
* Use dimensions param in OpenAI api calls
* Use starts-with?
* Improved fallback logic & prometheus metrics for semantic search (#62024)
* Add prometheus metrics to track appdb search fallback logic
* undo broken function call
* Update logic to not fallback if no results were filtered out
* fix more tests
* Tweaks
* Try again to fix tests
* Address comments
* update docstring
* Fix non-batched get-embedding for openai and ai-service providers (#62050)
* Fix non-batched get-embedding for openai and ai-service providers
We were passing a single text string rather than a seq of texts, resulting in an error when we tried to get the token
count.
ERROR semantic-search.embedding :: Failed to generate OpenAI embedding for text of length: 8
java.lang.ClassCastException: class java.lang.Character cannot be cast to class java.lang.String
* Add test for extract-base64-response-embeddings
* Add test-get-embedding
* Semantic search indexing status endpoint (#62082)
* add search-items-count function
* Add endpoint for reporting indexed count + total estimate
* try to fix test
* Temp commit to debug CI failure
* Add honeysql classpath to debug output
* Revert "Add honeysql classpath to debug output"
This reverts commit 4395f420f7.
* Revert "Temp commit to debug CI failure"
This reverts commit 36fbf047d6.
* Fix honeysql create-index :raw forms (#62144)
Something changed with honeysql 2.7.1340 and :raw forms in the tail of a create-index now get unwrapped and need to be
nested in another vector.
For example, in earliers versions
(sql/format
(sql.helpers/create-index
[:foo-idx :if-not-exists]
[:foo-table :using-hnsw [:raw "embedding vector_cosine_ops"]]))
produced an sql string like
CREATE INDEX IF NOT EXISTS foo_idx ON foo_table USING HNSW (embedding vector_cosine_ops)
but on 2.7.1340 you get
CREATE INDEX IF NOT EXISTS foo_idx ON foo_table USING HNSW (raw EMBEDDING VECTOR_COSINE_OPS)
Unclear if this is a honeysql bug or we're doing something unsupported, but fix it with a workaround for now by
wrapping the :raw in an extra vector like [[:raw "foo"]], in order to get CI green.
* Move reindex/index to gate the documents (#62101)
* switch init/reindex to gated updates
* nil stats
* sync index in test
* non deterministic search result
* Semantic search migration (#62043)
* Migration
* Rebase follow-up
* [Semantic Search] Add admin setting to enable semantic search (#61622)
* add basic setting switch for enabling semantic search, upsell component, logic for falling back to default search in settings, and basic e2e test
* fix type issue
* Fix serialization baseline test
* finished
* small fixes
* do not animate progress bar when progress === 100
* impl PR feedback
---------
Co-authored-by: Tyler Plude <tsplude@gmail.com>
* revert e2e diffs (#62173)
* Re-order semantic search index columns to test schema migration (#62172)
* Re-order semantic search index columns
Mostly to test schema migration, but this also makes the table contents easier to scan in PgAdmin / psql imho by
putting ids next to ids, timestamps next to timestamps, etc.
* migration 1
* cleanup
---------
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
* fix reflection warnings in tests (#62151)
* fix reflection warnings in test
* just use bound-fn*
---------
Co-authored-by: Dan Stone <wotbrew@gmail.com>
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
Co-authored-by: appleby <86076+appleby@users.noreply.github.com>
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Tyler Plude <tsplude@gmail.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
Co-authored-by: Mihael Konjević <konjevic@gmail.com>
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
* API Keys module cleanup
* Test fixes 🔧
* Fix Kondo errors
* Unmark these tests as `^:parallel` for now because I do not have the energy for dealing with MySQL
* I don't have time to fight MySQL
* Test fix 🔧
* add-alias-info => MLv2
* Restore deleted test
* WIP
* WIP [ci skip]
* Ensure we're actually using a cached metadata provider in tests
* Remove profiling code
* Restore accidentally-deleted `native-query-snippet` fn
* Fix accidental edits
* Make `visible-columns` stage-only
* More minor caching improvements
* cljfmt & kondo
* More minor caching improvements
* Fix#35252
* cljfmt & kondo
* Another round of test fixes and lint fixes 🔧
* Test fixes 🔧
* Test fix 🔧
* PR feedback
* Test & Lint fixes 🔧
* Test fix 🔧
* Kondo/cljfmt
* Appease Eastwood
* cljfmt run against everything
* Revert changes to deps.edn
* Did I fixx??
* cljfmt/kondo
* Fix Oracle test failure
* Fix nested fields (MongoDB)
* cljfmt
* Nested column name fixes
* Fix Mongo for reals
* Revert BigQuery breaking stuff
* Fix equality for binned columns
* Test fix 🔧
* Remove dead :ident keys
* Fix is_verified field refs
* Fix is_verified field refs
* Some sanity checking
* Fix typo
* Fixx
* Ok, don't be super fussy about bad code using :type/Text as a parameter
* Fix validation of legacy expression refs inside stage parameters
* Fix aggregation names not being deduplicated
* :as-alias
* replace saigon with bangkok
* use ho chi minh as equivalent replacement
* use bangkok for sqlserver
* update us/pacific to america/los_angeles
* Test debugging
* Fix debugging
* Test fixes 🔧
* Fix busted hardcoded e2e query and add disallowed-keys helper
* cljfmt
* Update deprecation notices 56 => 57
* Kick the can down the road
* Fix another busted test 🔧
* Improve field resolution even more 😒
* cljfmt
* Fix sandboxing with bad field refs.
* Ok I give up I guess I just accidentally fixed sandboxing with custom columns
* cljfmt
* I fixed it
* Appease the linter
* Test fixes 🔧
* OOOPS
* Fix test
* prettier
---------
Co-authored-by: Riley Thompson <rileythompson99@gmail.com>
* UI for metabot feedback
* copy and spacing tweaks (#62049)
* switch to download based approach
* test
---------
Co-authored-by: Maz Ameli <maz@metabase.com>
* BOT-285: ensure field statistics are populated
* chore: test
* extend field-values treatment to dummy tools
* no more need for ensure-field-values!
* chore: use get-or-create
* style
* remove unused require
* fix
* nil safety
* extract
* wip
* wip2
* fix and wip
* wip
* fiiiix
* use the component name inside the iframe
* fix tests
* use custom elements attributes in the preview
* clean up
* clean up
* merge question with new question in the iframe code
* remove SdkIframeEmbedTagSettings
* styles -> S
* restore defaultTheme functionality that was merged on master
* fix test, now the iframe is not reset and we don't need to select the table again
* Fix containerize job to only run when uberjar succeeds
The containerize job now properly checks that the uberjar job succeeded
before attempting to containerize. This prevents containerization from
being triggered on documentation-only changes where the uberjar job
is skipped.
Added: needs.uberjar.result == 'success' condition
* Set default output name for fetched artifacts to "metabase.jar"
- Add :database-feature to SettingDefinition schema to specify required driver features
- Update validate-settable-for-db\! to check database driver feature support
- Add validation to ensure :database-feature is only used with database-local settings
- Fix validation logic to throw when driver does NOT support required feature
- Add comprehensive tests for database feature validation
- Update defsetting macro documentation with :database-feature option
This allows database-local settings like database-enable-actions and
database-enable-table-editing to require specific driver features
(e.g. :actions, :actions/data-editing) before they can be enabled.
* Fix uberjar containerization and implement flexible fetch-artifact action
Resolves issues where uberjars weren't getting containerized when adding the
build-docker-uberjar label to PRs or when manually dispatching workflows.
Major changes:
- Create containerize-uberjar.yml workflow for centralized containerization logic
- Create uberjar-containerize-labeled.yml for PR label-triggered builds
- Extract containerization from uberjar.yml to avoid 3-level workflow nesting
- Add containerization to run-tests.yml for master branch pushes
- Implement flexible extract-path parameter in fetch-artifact action
- Replace preserve-structure boolean with string-based path specification
- Update all workflows to use appropriate extract-path values
The fetch-artifact action now supports:
- extract-path: "." (current directory with custom output-name)
- extract-path: "target/uberjar" (maintains original structure)
- extract-path: "custom/path" (any directory structure)
Containerization now works in all scenarios:
- Master push/merge → run-tests.yml → containerize-uberjar.yml
- PR with build-docker-uberjar label → uberjar-containerize-labeled.yml
- Manual dispatch → containerize-uberjar.yml
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix fetch-artifact action to avoid moving file to itself
Prevents "mv: source and destination are the same file" error when
extract-path matches the existing jar location (e.g. target/uberjar).
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Refactor fetch-artifact action to be more DRY
- Consolidate JAR path logic into a single function
- Export JAR_PATH to GITHUB_ENV for use in subsequent steps
- Remove repetitive path determination code
- Reduce lines of code from 113 to 108
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Add Docker Hub link and pull command to PR comment
Enhanced the PR comment after containerization to include:
- Docker tag name (branch with slashes replaced by dashes)
- Direct link to Docker Hub repository tag page
- Ready-to-use docker pull command
This makes it easier for developers to find and pull the built image.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Add get-docker-info action and update workflows to utilize it for Docker image retrieval
* Refactor post-comment job to streamline Docker info retrieval and PR comment posting in containerize workflow
* Remove unnecessary blank lines in fetch-artifact and get-docker-info actions for cleaner code
* Update containerize job conditions to trigger on pull request labels for Docker builds
* revert using fetch-artifact for release artifacts
* add migration
* add table before update to correctly set deactivated_at
* no need for schema
* archive tables
* tests
* note
* include active to index
* guard against nil changes
* doc
* guard against archival
* note
* prper count
* serdes/test
* extra safety guard
* more accurate logging
* use epocSecond
* more error validation
* change suffix
* add rollback mig
* move migrations to v56
* safer
* test(embed-js): migrate tests to use custom element api
* use CreateApiKeyResponse
* Update e2e/test/scenarios/embedding/sdk-iframe-embedding/sdk-iframe-embedding.cy.spec.ts
Co-authored-by: Phoomparin Mano <poom@metabase.com>
---------
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Cards created before v0.55 lack the `:card_schema` field in their revision history. When loading these old revisions, the system throws "Cannot SELECT a Card without including :card_schema" because the Card model's `after-select` expects this field to always be present.
Existing code adds the legacy default `card_schema` value (20) in `revert-to-revision!`. This PR adds the value (20) to old revisions in `revision.clj`'s `after-select`.
This allows users to view revision history and revert cards that were created before the v0.55 upgrade.
* Updates the info and info_filled icons
* use currentcolor fill instead
* remove fixed width and height and rely on viewBox
* tweak svg paths slightly
* fix y position
---------
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
Co-authored-by: Maz Ameli <maz@metabase.com>
* Ensure we're actually using a cached metadata provider in tests
* Remove profiling code
* Restore accidentally-deleted `native-query-snippet` fn
* Fix accidental edits
* Fix metadata calculation for joins that contain joins
* All Lib tests are passing
* The PR that fixes everything [WIP] [ci skip]
* Test fix 🔧
* Sort namespaces
* Docstring formatting
* [Lib tests] 100 failures, 33 errors.
* [Lib] 98 failures, 24 errors.
* [Lib] 76 failures, 17 errors.
* [Lib] 49 failures, 4 errors
* [Lib] 46 failures, 2 errors.
* [Lib] 15 failures, 0 errors.
* [Lib] 13 failures, 0 errors.
* All Lib tests passing
* [QP tests] 2 failures, 1 error.
* Revert :encode/cache-key
* Minor caching performance improvements
* Fix nest breakouts/cumulative aggregations
* Add some more stuff to lib.core
* Test fixes/cljfmt/kondo
* Test fix 🔧
* Test fixes and fix some busted tests
* OMG CACHE SO MUCH FASTER!!!!!
* Fix MongoDB
* Fix tests and support mock segments
* Code cleanup and test fixes 🔧
* Test fix 🔧
* Fix set versus map
* PR feedback
* cljfmt
* More PR feedback and tighten up the field resolution code a bit
* Some schema cleanup
* PR feedback
* PR feedback
* Add TODO
* PR feedback
* Remove implementation of join `visible-columns` which is the same as :default
* Remove unused Card visible columns
* Restore the Card implementation of visible columns in THIS PR.
Missed this from the big remerge, where login attributes were being
reset to an empty value on jwt login. Also fixed not including the
jwt-group-sync on the initial formik state.
* Added to_session endpoint
* Added to_session endpoint
* Added to_session endpoint
* Added to_session endpoint
* Added to_session endpoint
* Some small cleanup
- remove unnecessary try/catch clauses
- rename/rework unnecessary public wrapper fn
- make `jwt` required for the endpoint
- only return session token, not any JWT data
* Test fixes
---------
Co-authored-by: John Swanson <john.swanson@metabase.com>
* wip: add connection string form prefill feature;
add tests
* Refactor deprecated export format
* Skip jdbc:prefix when parsing
* Add snowflake support
* Add success message
* Add a feedback message when pasting a connection string
* Refactor field mapping
* wip use regexes to parse connection strings
* make port optional
* Add snowflake
* Add bigquery and clickhouse
* Add Athena support
* Add Amazon Redshift
* Improve clickhouse
* Add failure message
* Add databricks and druid
* Add MySQL
* Add presto
* Adapt snowflake, create objectToString helper
* Add Apache Spark
* Add SQL server
* Add Oracle
* Add Starburst
* Add vertica
* Reset connection string input on change of key
* Map only when select db and protocol matches
* Fix and refactor semicolon params parsing
* Add tracking to database string uri parsing
* create mapping config with placeholders
use placeholders also in tests
* Create engineKeys types
* Create Cypress paste command using synthetic react events
* Use fade transition for feedback animation
* Add e2e tests for connection strings form filling
* fill in display name from connection string
* Add succes failure text test
* Validate form after filling in fields
* Use more standard fallback for paste
* Remove unused regex parsing implementation
* use mass setFields for fomik setting values
* Add test case for clearing existing values, including engine select field
* Fix form fields being overwritten when pasting connection string
* Add onPaste behavior and use simpler paste mechanism in Cypress
* Fix typo
* Extract and use engineKey type and isEngineKey guard
* Make connection string field controlled by formik
Fix submit values
Fix type error
* Remove unneeded prop justify
* Run regex just for currently selected db
* Fix naming of the test file
* Add e2e db connection test
* Fix missing path in th rspack emedding setup
* Explain why connection string is not sent to BE
* use pojo instead of map for db engines config
* Revert to * export to maintain consistency
* fix connection string test
* create a more meaningful type name
* Add result_metadata perms check to qp
* Check result metadata view data on card put
* Throw the exception
* Test
* Add perm check for ad-hoc referencing cards
* Docstrings
* Use seq
* Order of checks
* Apply suggestions from code review
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
* Simplify into
---------
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
* add table link to metadata page
* Table
* Add a e2e test
* Add a e2e test
---------
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
When streaming data for a query, we were only including columns if a)
the viz settings for the column were completely empty, or if b) the viz
settings for the columns included specifically enabling that column.
The problem occurs most clearly for things like native SQL queries.
If you construct a query like
```
SELECT id FROM venues;
```
and then set the column viz settings to *something* non-empty (most easy
way: just hide the `id` column and then show it again), and then save
the card, then change the query to:
```
SELECT id, name FROM venues;
```
then if you download the CSV for this card (even after saving it!)
you'll get a result that only contains `id` and not `name`.
A few tests needed to change here because they were implicitly assuming
the old behavior, but I don't think that's entirely intentional. This
behavior was different than the behavior in the Metabase application
proper, where UI results would show all the columns (in the above
example, they'd immediately show `id` *and* `name`).
* jwt edits
* Optimized 2 images, saved 188.8 KB (46.0% smaller)
* why are y'all 'waiting for the status to be reported'
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
* Create Upsell CTA component
* Replace pro labe with gem in embed upsell
* Create and use UpsellCta in Embedding Upsell
* Rebuiltd the logic for showing links and upsells in embedding modal
* Add UpsellCta tests
* Remove unneeded hook
Fix test and URL rendering for hosted
* Remove unneeded hook useInteractiveEmbeddingCta
* Fix test not running in target build (OSS)
* Fix embedded modal ee end premium cloud tests
* Add missing translation tag
* Use single upsellcta styling
* feat: promote uberjar as the single uberjar creation workflow
* chore: remove useless reuse-existing-artifacts
* refactor: streamline PR environment workflow by removing wait_for_uberjar input and simplifying uberjar retrieval
* fix: ensure default editions are used if container info retrieval fails
* chore: don't build uberjar outside of run-tests
* fix: update uberjar artifact name to use the current SHA instead of PR head SHA
* fix: update uberjar artifact names to use PR head SHA when available
* fix: update uberjar workflow to simplify input parameters and improve conditional checks
* fix: add concurrency settings to uberjar workflow
* fix: update documentation condition in run-tests workflow
* fix: add default node version
* fix: update conditions for container info retrieval and containerization steps
* fix: update default node version to 22 in uberjar workflow
* Update .github/workflows/uberjar.yml
* Update .github/workflows/uberjar.yml
---------
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
was blocking on startup
stacktrace below is representative. has a few other things like reveal
but shows that we get into a huge loop over all cards and you end up
waiting for the instance to be ready for a long time
```
at metabase.lib.card$fn__77290$fn__77297.invoke(card.cljc:71)
at metabase.lib.card$fn__77302$__GT_card_metadata_columns77301__77303$fn__77304.invoke(card.cljc:141)
at clojure.core$mapv$fn__8569.invoke(core.clj:7059)
at clojure.lang.PersistentVector.reduce(PersistentVector.java:418)
at clojure.core$reduce.invokeStatic(core.clj:6964)
at clojure.core$mapv.invokeStatic(core.clj:7050)
at clojure.core$mapv.invoke(core.clj:7050)
at metabase.lib.card$fn__77302$__GT_card_metadata_columns77301__77303.invoke(card.cljc:141)
at metabase.lib.card$fn__77302$fn__77308.invoke(card.cljc:120)
at metabase.lib.card$fn__77316$card_cols_STAR_77315__77317.invoke(card.cljc:163)
at metabase.lib.card$fn__77316$fn__77322.invoke(card.cljc:157)
at metabase.lib.card$fn__77350$card_metadata_columns77349__77351.invoke(card.cljc:223)
at metabase.lib.card$fn__77350$fn__77354.invoke(card.cljc:217)
at metabase.lib.card$eval77367$_AMPERSAND_f__77368.invoke(card.cljc:257)
at metabase.lib.card$eval77367$fn__77372.invoke(card.cljc:242)
at clojure.lang.MultiFn.invoke(MultiFn.java:244)
at metabase.lib.metadata.calculation$fn__74776$returned_columns74775__74777$fn__74778.invoke(calculation.cljc:524)
at metabase.lib.metadata.cache$fn__74548$do_with_cached_value74547__74549.invoke(cache.cljc:104)
at metabase.lib.metadata.cache$fn__74548$fn__74555.invoke(cache.cljc:92)
at metabase.lib.metadata.calculation$fn__74776$returned_columns74775__74777.invoke(calculation.cljc:523)
at metabase.lib.metadata.calculation$fn__74776$fn__74781.invoke(calculation.cljc:503)
at metabase.lib.metadata.calculation$fn__74776$returned_columns74775__74777.invoke(calculation.cljc:516)
at metabase.lib.metadata.calculation$fn__74776$fn__74781.invoke(calculation.cljc:503)
at metabase.lib.field.resolution$fn__80775$resolve_in_card_returned_columns80774__80776.invoke(resolution.cljc:352)
at metabase.lib.field.resolution$fn__80775$fn__80784.invoke(resolution.cljc:346)
at metabase.lib.field.resolution$fn__80788$resolve_in_card_or_stage_metadata80787__80789.invoke(resolution.cljc:365)
at metabase.lib.field.resolution$fn__80788$fn__80801.invoke(resolution.cljc:358)
at metabase.lib.field.resolution$resolve_from_previous_stage_or_source_STAR_.invokeStatic(resolution.cljc:410)
at metabase.lib.field.resolution$resolve_from_previous_stage_or_source_STAR_.invoke(resolution.cljc:390)
at metabase.lib.field.resolution$fn__80844$resolve_from_previous_stage_or_source80843__80845.invoke(resolution.cljc:440)
at metabase.lib.field.resolution$fn__80844$fn__80861.invoke(resolution.cljc:434)
at metabase.lib.field.resolution$fn__80865$resolve_field_ref80864__80867.invoke(resolution.cljc:471)
at metabase.lib.field.resolution$fn__80865$fn__80878.invoke(resolution.cljc:457)
at metabase.lib.field$eval80922$_AMPERSAND_f__80923.invoke(field.cljc:62)
at metabase.lib.field$eval80922$fn__80925.invoke(field.cljc:60)
at clojure.lang.MultiFn.invoke(MultiFn.java:239)
at metabase.lib.metadata.calculation$fn__74679$metadata74678__74680$fn__74681.invoke(calculation.cljc:287)
at metabase.lib.metadata.cache$fn__74548$do_with_cached_value74547__74549.invoke(cache.cljc:104)
at metabase.lib.metadata.cache$fn__74548$fn__74555.invoke(cache.cljc:92)
at metabase.lib.metadata.calculation$fn__74679$metadata74678__74680.invoke(calculation.cljc:286)
at metabase.lib.metadata.calculation$fn__74679$fn__74684.invoke(calculation.cljc:275)
at metabase.lib.breakout$fn__80328$breakouts_metadata80327__80329$fn__80331.invoke(breakout.cljc:43)
at clojure.core$mapv$fn__8569.invoke(core.clj:7059)
at clojure.lang.PersistentVector.reduce(PersistentVector.java:418)
at clojure.core$reduce.invokeStatic(core.clj:6964)
at clojure.core$mapv.invokeStatic(core.clj:7050)
at clojure.core$mapv.invoke(core.clj:7050)
at metabase.lib.breakout$fn__80328$breakouts_metadata80327__80329.invoke(breakout.cljc:42)
at metabase.lib.breakout$fn__80328$fn__80334.invoke(breakout.cljc:35)
at metabase.lib.stage$fn__81784$breakouts_columns81783__81785.invoke(stage.cljc:59)
at metabase.lib.stage$fn__81784$fn__81787.invoke(stage.cljc:55)
at metabase.lib.stage$fn__81843$summary_columns81842__81844.invoke(stage.cljc:92)
at metabase.lib.stage$fn__81843$fn__81846.invoke(stage.cljc:86)
at metabase.lib.stage$eval81986$_AMPERSAND_f__81988.invoke(stage.cljc:290)
at metabase.lib.stage$eval81986$fn__81996.invoke(stage.cljc:283)
at clojure.lang.MultiFn.invoke(MultiFn.java:244)
at metabase.lib.metadata.calculation$fn__74776$returned_columns74775__74777$fn__74778.invoke(calculation.cljc:524)
at metabase.lib.metadata.cache$fn__74548$do_with_cached_value74547__74549.invoke(cache.cljc:104)
at metabase.lib.metadata.cache$fn__74548$fn__74555.invoke(cache.cljc:92)
at metabase.lib.metadata.calculation$fn__74776$returned_columns74775__74777.invoke(calculation.cljc:523)
at metabase.lib.metadata.calculation$fn__74776$fn__74781.invoke(calculation.cljc:503)
at metabase.lib.metadata.calculation$fn__74776$returned_columns74775__74777.invoke(calculation.cljc:516)
at metabase.lib.metadata.calculation$fn__74776$fn__74781.invoke(calculation.cljc:503)
at metabase.lib.metadata.calculation$fn__74776$returned_columns74775__74777.invoke(calculation.cljc:513)
at metabase.lib.metadata.calculation$fn__74776$fn__74781.invoke(calculation.cljc:503)
at metabase.lib.metadata.calculation$fn__74776$returned_columns74775__74777.invoke(calculation.cljc:510)
at metabase.lib.metadata.calculation$fn__74776$fn__74781.invoke(calculation.cljc:503)
at metabase.queries.models.card$dataset_query__GT_dimensions.invokeStatic(card.clj:1270)
at metabase.queries.models.card$dataset_query__GT_dimensions.invoke(card.clj:1262)
at metabase.queries.models.card$extract_non_temporal_dimension_ids.invokeStatic(card.clj:1277)
at metabase.queries.models.card$extract_non_temporal_dimension_ids.invoke(card.clj:1274)
at metabase.search.ingestion$execute_function_attr.invokeStatic(ingestion.clj:68)
at metabase.search.ingestion$execute_function_attr.invoke(ingestion.clj:63)
at metabase.search.ingestion$execute_all_function_attrs$fn__131886.invoke(ingestion.clj:80)
at clojure.lang.PersistentHashMap$NodeSeq.kvreduce(PersistentHashMap.java:1309)
at clojure.lang.PersistentHashMap$BitmapIndexedNode.kvreduce(PersistentHashMap.java:804)
at clojure.lang.PersistentHashMap$NodeSeq.kvreduce(PersistentHashMap.java:1314)
at clojure.lang.PersistentHashMap$BitmapIndexedNode.kvreduce(PersistentHashMap.java:804)
at clojure.lang.PersistentHashMap.kvreduce(PersistentHashMap.java:238)
at clojure.core$fn__8559.invokeStatic(core.clj:6987)
at clojure.core$fn__8559.invoke(core.clj:6967)
at clojure.core.protocols$fn__8287$G__8282__8296.invoke(protocols.clj:174)
at clojure.core$reduce_kv.invokeStatic(core.clj:6998)
at clojure.core$reduce_kv.invoke(core.clj:6989)
at metabase.search.ingestion$execute_all_function_attrs.invokeStatic(ingestion.clj:76)
at metabase.search.ingestion$execute_all_function_attrs.invoke(ingestion.clj:73)
at metabase.search.ingestion$__GT_document.invokeStatic(ingestion.clj:87)
at metabase.search.ingestion$__GT_document.invoke(ingestion.clj:85)
at clojure.core$map$fn__5952$fn__5953.invoke(core.clj:2759)
at medley.core$distinct_by$fn__15232$fn__15233.invoke(core.cljc:290)
at clojure.core$map$fn__5952$fn__5953.invoke(core.clj:2759)
at clojure.core$completing$fn__8562.invoke(core.clj:7010)
at clojure.core$map$fn__5952$fn__5953.invoke(core.clj:2759)
at toucan2.pipeline$with_init$fn__51829.invoke(pipeline.clj:327)
at clojure.core$completing$fn__8562.invoke(core.clj:7010)
at toucan2.jdbc.result_set$reduce_result_set.invokeStatic(result_set.clj:156)
at toucan2.jdbc.result_set$reduce_result_set.invoke(result_set.clj:125)
at toucan2.jdbc.query$reduce_jdbc_query.invokeStatic(query.clj:51)
at toucan2.jdbc.query$reduce_jdbc_query.invoke(query.clj:22)
at toucan2.jdbc.pipeline$transduce_execute_with_connection_primary_method_java_sql_Connection_default_default.invokeStatic(pipeline.clj:19)
at toucan2.jdbc.pipeline$transduce_execute_with_connection_primary_method_java_sql_Connection_default_default.invoke(pipeline.clj:9)
at methodical.impl.combo.common$partial_STAR_$fn__22829.invoke(common.clj:15)
at methodical.impl.combo.threaded$combine_methods_thread_last$fn__23165$combined_method_thread_last__23166.invoke(threaded.clj:64)
at methodical.util.FnWithMeta.invoke(util.clj:46)
at methodical.impl.standard$invoke_multifn.invokeStatic(standard.clj:65)
at methodical.impl.standard$invoke_multifn.invoke(standard.clj:47)
at methodical.impl.standard.StandardMultiFn.invoke(standard.clj:216)
at toucan2.pipeline$transduce_execute$with_connection_STAR___51727.invoke(pipeline.clj:78)
at toucan2.connection$bind_current_connectable_fn$fn__51305.invoke(connection.clj:104)
at toucan2.connection$bind_current_connectable_fn$fn__51305.invoke(connection.clj:104)
at toucan2.jdbc.connection$do_with_connection_primary_method_java_sql_Connection.invokeStatic(connection.clj:13)
at toucan2.jdbc.connection$do_with_connection_primary_method_java_sql_Connection.invoke(connection.clj:11)
at methodical.impl.combo.common$partial_STAR_$fn__22829.invoke(common.clj:12)
at methodical.util.FnWithMeta.invoke(util.clj:46)
at toucan2.connection$do_with_connection_around_method_toucan2_connection_default.invokeStatic(connection.clj:118)
at toucan2.connection$do_with_connection_around_method_toucan2_connection_default.invoke(connection.clj:106)
at methodical.impl.combo.common$partial_STAR_$fn__22829.invoke(common.clj:12)
at methodical.util.FnWithMeta.invoke(util.clj:46)
at methodical.impl.standard$invoke_multifn.invokeStatic(standard.clj:55)
at methodical.impl.standard$invoke_multifn.invoke(standard.clj:47)
at methodical.impl.standard.StandardMultiFn.invoke(standard.clj:210)
at toucan2.connection$do_with_connection_primary_method_.invokeStatic(connection.clj:204)
at toucan2.connection$do_with_connection_primary_method_.invoke(connection.clj:194)
at methodical.impl.combo.common$partial_STAR_$fn__22829.invoke(common.clj:12)
at methodical.util.FnWithMeta.invoke(util.clj:46)
at toucan2.connection$do_with_connection_around_method_toucan2_connection_default.invokeStatic(connection.clj:118)
at toucan2.connection$do_with_connection_around_method_toucan2_connection_default.invoke(connection.clj:106)
at methodical.impl.combo.common$partial_STAR_$fn__22829.invoke(common.clj:12)
at methodical.util.FnWithMeta.invoke(util.clj:46)
at methodical.impl.standard$invoke_multifn.invokeStatic(standard.clj:55)
at methodical.impl.standard$invoke_multifn.invoke(standard.clj:47)
at methodical.impl.standard.StandardMultiFn.invoke(standard.clj:210)
at toucan2.pipeline$transduce_execute.invokeStatic(pipeline.clj:77)
at toucan2.pipeline$transduce_execute.invoke(pipeline.clj:64)
at clojure.lang.Var.invoke(Var.java:401)
at toucan2.pipeline$transduce_compiled_query.invokeStatic(pipeline.clj:244)
at toucan2.pipeline$transduce_compiled_query.invoke(pipeline.clj:240)
at toucan2.pipeline$transduce_built_query.invokeStatic(pipeline.clj:252)
at toucan2.pipeline$transduce_built_query.invoke(pipeline.clj:246)
at toucan2.pipeline$transduce_query_primary_method_default.invokeStatic(pipeline.clj:272)
at toucan2.pipeline$transduce_query_primary_method_default.invoke(pipeline.clj:269)
at methodical.impl.combo.common$partial_STAR_$fn__22829.invoke(common.clj:15)
at methodical.impl.combo.threaded$combine_methods_thread_last$fn__23165$combined_method_thread_last__23166.invoke(threaded.clj:64)
at methodical.util.FnWithMeta.invoke(util.clj:46)
at methodical.impl.standard$invoke_multifn.invokeStatic(standard.clj:65)
at methodical.impl.standard$invoke_multifn.invoke(standard.clj:47)
at methodical.impl.standard.StandardMultiFn.invoke(standard.clj:216)
at toucan2.pipeline$transduce_query_STAR_.invokeStatic(pipeline.clj:278)
at toucan2.pipeline$transduce_query_STAR_.invoke(pipeline.clj:274)
at toucan2.pipeline$transduce_with_model.invokeStatic(pipeline.clj:293)
at toucan2.pipeline$transduce_with_model.invoke(pipeline.clj:280)
at toucan2.pipeline$transduce_parsed.invokeStatic(pipeline.clj:309)
at toucan2.pipeline$transduce_parsed.invoke(pipeline.clj:295)
at clojure.lang.AFn.applyToHelper(AFn.java:160)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:669)
at clojure.core$apply.invoke(core.clj:662)
at toucan2.pipeline$reducible_fn$reify__51862.reduce(pipeline.clj:404)
at clojure.core$transduce.invokeStatic(core.clj:7025)
at clojure.core.Eduction.reduce(core.clj:7874)
at clojure.core$reduce.invokeStatic(core.clj:6964)
at clojure.core$reduce.invoke(core.clj:6947)
at metabase.util$rconcat$reify__16182.coll_reduce(util.cljc:1188)
at clojure.core$transduce.invokeStatic(core.clj:7026)
at clojure.core.Eduction.reduce(core.clj:7874)
at clojure.core$transduce.invokeStatic(core.clj:7025)
at clojure.core$transduce.invokeStatic(core.clj:7021)
at clojure.core$transduce.invoke(core.clj:7012)
at metabase.search.appdb.index$index_docs_BANG_.invokeStatic(index.clj:279)
at metabase.search.appdb.index$index_docs_BANG_.invoke(index.clj:275)
at metabase.search.appdb.core$populate_index_BANG_.invokeStatic(core.clj:169)
at metabase.search.appdb.core$populate_index_BANG_.invoke(core.clj:168)
at metabase.search.appdb.core$eval132669$fn__132671.invoke(core.clj:182)
at clojure.lang.MultiFn.invoke(MultiFn.java:234)
at metabase.search.core$init_index_BANG_$iter__133794__133798$fn__133799.invoke(core.clj:91)
at clojure.lang.LazySeq.force(LazySeq.java:50)
at clojure.lang.LazySeq.realize(LazySeq.java:89)
at clojure.lang.LazySeq.seq(LazySeq.java:106)
at clojure.lang.RT.seq(RT.java:555)
at clojure.core$seq__5488.invokeStatic(core.clj:139)
at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:24)
at clojure.core.protocols$fn__8266.invokeStatic(protocols.clj:74)
at clojure.core.protocols$fn__8266.invoke(protocols.clj:74)
at clojure.core.protocols$fn__8207$G__8202__8220.invoke(protocols.clj:13)
at clojure.core$reduce.invokeStatic(core.clj:6965)
at clojure.core$reduce.invoke(core.clj:6947)
at metabase.search.core$init_index_BANG_.invokeStatic(core.clj:88)
at metabase.search.core$init_index_BANG_.doInvoke(core.clj:80)
at clojure.lang.RestFn.invoke(RestFn.java:411)
at metabase.search.task.search_index$init_BANG_$fn__173098.invoke(search_index.clj:38)
at metabase.app_db.cluster_lock$do_with_cluster_lock_STAR_$with_connection_STAR___126394$with_transaction_STAR___126395.invoke(cluster_lock.clj:61)
at toucan2.connection$bind_current_connectable_fn$fn__51305.invoke(connection.clj:104)
at metabase.app_db.connection$do_transaction$thunk__61025.invoke(connection.clj:145)
at metabase.app_db.connection$do_transaction.invokeStatic(connection.clj:164)
at metabase.app_db.connection$do_transaction.invoke(connection.clj:141)
at metabase.app_db.connection$do_with_transaction_primary_method_java_sql_Connection.invokeStatic(connection.clj:201)
at metabase.app_db.connection$do_with_transaction_primary_method_java_sql_Connection.invoke(connection.clj:174)
at methodical.impl.combo.common$partial_STAR_$fn__22829.invoke(common.clj:13)
at methodical.util.FnWithMeta.invoke(util.clj:46)
at toucan2.connection$do_with_transaction_around_method_toucan2_connection_default.invokeStatic(connection.clj:249)
at toucan2.connection$do_with_transaction_around_method_toucan2_connection_default.invoke(connection.clj:245)
at methodical.impl.combo.common$partial_STAR_$fn__22829.invoke(common.clj:13)
at methodical.util.FnWithMeta.invoke(util.clj:46)
at methodical.impl.standard$invoke_multifn.invokeStatic(standard.clj:58)
at methodical.impl.standard$invoke_multifn.invoke(standard.clj:47)
at methodical.impl.standard.StandardMultiFn.invoke(standard.clj:212)
at metabase.app_db.cluster_lock$do_with_cluster_lock_STAR_$with_connection_STAR___126394.invoke(cluster_lock.clj:53)
at toucan2.connection$bind_current_connectable_fn$fn__51305.invoke(connection.clj:104)
at toucan2.connection$bind_current_connectable_fn$fn__51305.invoke(connection.clj:104)
at toucan2.connection$bind_current_connectable_fn$fn__51305.invoke(connection.clj:104)
at toucan2.jdbc.connection$do_with_connection_primary_method_javax_sql_DataSource.invokeStatic(connection.clj:18)
at toucan2.jdbc.connection$do_with_connection_primary_method_javax_sql_DataSource.invoke(connection.clj:15)
at methodical.impl.combo.common$partial_STAR_$fn__22829.invoke(common.clj:12)
at methodical.util.FnWithMeta.invoke(util.clj:46)
at toucan2.connection$do_with_connection_around_method_toucan2_connection_default.invokeStatic(connection.clj:118)
at toucan2.connection$do_with_connection_around_method_toucan2_connection_default.invoke(connection.clj:106)
at methodical.impl.combo.common$partial_STAR_$fn__22829.invoke(common.clj:12)
at methodical.util.FnWithMeta.invoke(util.clj:46)
at methodical.impl.standard$invoke_multifn.invokeStatic(standard.clj:55)
at methodical.impl.standard$invoke_multifn.invoke(standard.clj:47)
at methodical.impl.standard.StandardMultiFn.invoke(standard.clj:210)
at metabase.app_db.connection$do_with_connection_primary_method_default.invokeStatic(connection.clj:132)
at metabase.app_db.connection$do_with_connection_primary_method_default.invoke(connection.clj:130)
at methodical.impl.combo.common$partial_STAR_$fn__22829.invoke(common.clj:12)
at methodical.util.FnWithMeta.invoke(util.clj:46)
at toucan2.connection$do_with_connection_around_method_toucan2_connection_default.invokeStatic(connection.clj:118)
at toucan2.connection$do_with_connection_around_method_toucan2_connection_default.invoke(connection.clj:106)
at methodical.impl.combo.common$partial_STAR_$fn__22829.invoke(common.clj:12)
at methodical.util.FnWithMeta.invoke(util.clj:46)
at methodical.impl.standard$invoke_multifn.invokeStatic(standard.clj:55)
at methodical.impl.standard$invoke_multifn.invoke(standard.clj:47)
at methodical.impl.standard.StandardMultiFn.invoke(standard.clj:210)
at toucan2.connection$do_with_connection_primary_method_.invokeStatic(connection.clj:204)
at toucan2.connection$do_with_connection_primary_method_.invoke(connection.clj:194)
at methodical.impl.combo.common$partial_STAR_$fn__22829.invoke(common.clj:12)
at methodical.util.FnWithMeta.invoke(util.clj:46)
at toucan2.connection$do_with_connection_around_method_toucan2_connection_default.invokeStatic(connection.clj:118)
at toucan2.connection$do_with_connection_around_method_toucan2_connection_default.invoke(connection.clj:106)
at methodical.impl.combo.common$partial_STAR_$fn__22829.invoke(common.clj:12)
at methodical.util.FnWithMeta.invoke(util.clj:46)
at methodical.impl.standard$invoke_multifn.invokeStatic(standard.clj:55)
at methodical.impl.standard$invoke_multifn.invoke(standard.clj:47)
at methodical.impl.standard.StandardMultiFn.invoke(standard.clj:210)
at metabase.app_db.cluster_lock$do_with_cluster_lock_STAR_.invokeStatic(cluster_lock.clj:53)
at metabase.app_db.cluster_lock$do_with_cluster_lock_STAR_.invoke(cluster_lock.clj:51)
at metabase.app_db.cluster_lock$fn__126406$do_with_cluster_lock126405__126407$do_with_cluster_lock_STAR__STAR___126409.invoke(cluster_lock.clj:78)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$apply.invoke(core.clj:662)
at metabase.util.retry$decorate$fn$reify__126370.call(retry.clj:110)
at io.github.resilience4j.retry.Retry.lambda$decorateCallable$5(Retry.java:306)
at metabase.util.retry$decorate$fn__126369.doInvoke(retry.clj:111)
at clojure.lang.RestFn.invoke(RestFn.java:400)
at metabase.util.retry$fn__126375$make126374__126376$fn__126377.invoke(retry.clj:120)
at metabase.app_db.cluster_lock$fn__126406$do_with_cluster_lock126405__126407.invoke(cluster_lock.clj:82)
at metabase.app_db.cluster_lock$fn__126406$fn__126412.invoke(cluster_lock.clj:63)
at metabase.app_db.cluster_lock$fn__126406$do_with_cluster_lock126405__126407.invoke(cluster_lock.clj:75)
at metabase.app_db.cluster_lock$fn__126406$fn__126412.invoke(cluster_lock.clj:63)
at metabase.search.task.search_index$init_BANG_.invokeStatic(search_index.clj:37)
at metabase.search.task.search_index$init_BANG_.invoke(search_index.clj:33)
at metabase.search.task.search_index$eval173156$fn__173157.invoke(search_index.clj:46)
at metabase.startup.core$run_startup_logic_BANG_$fn__173079.invoke(core.clj:30)
at metabase.startup.core$run_startup_logic_BANG_.invokeStatic(core.clj:28)
at metabase.startup.core$run_startup_logic_BANG_.invoke(core.clj:24)
at metabase.core.core$init_BANG__STAR_.invokeStatic(core.clj:181)
at metabase.core.core$init_BANG__STAR_.invoke(core.clj:117)
at metabase.core.core$init_BANG_.invokeStatic(core.clj:194)
at metabase.core.core$init_BANG_.invoke(core.clj:189)
at dev$init_BANG_.invokeStatic(dev.clj:143)
at dev$init_BANG_.invoke(dev.clj:139)
at dev$start_BANG_.invokeStatic(dev.clj:180)
at dev$start_BANG_.invoke(dev.clj:176)
at dev$eval206099.invokeStatic(NO_SOURCE_FILE:1)
at dev$eval206099.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:7739)
at clojure.lang.Compiler.eval(Compiler.java:7729)
at clojure.lang.Compiler.eval(Compiler.java:7694)
at clojure.core$eval.invokeStatic(core.clj:3232)
at clojure.core$eval.invoke(core.clj:3228)
at vlaaad.reveal.repl$wrap_eval$fn__37945.invoke(repl.clj:90)
at clojure.main$repl$read_eval_print__9248$fn__9251.invoke(main.clj:437)
at clojure.main$repl$read_eval_print__9248.invoke(main.clj:437)
at clojure.main$repl$fn__9257.invoke(main.clj:459)
at clojure.main$repl.invokeStatic(main.clj:459)
at clojure.main$repl.doInvoke(main.clj:368)
at clojure.lang.RestFn.applyTo(RestFn.java:140)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$apply.invoke(core.clj:662)
```
Previously we were treating all currency formatting as if we were in a
table, and only adding the currency symbol if `currency-in-header` were
explicitly set to `false` for the column.
When formatting a scalar value, though, we want to always add the
currency symbol inline (since there is no header in this case).
I found that `metabase.channel.render.body/format-cell` and
`metabase.formatter.core/format-number` were actually only used to
format *scalar* cells and *scalar* numbers (as opposed to cells in a
table), so I renamed them for a bit more clarity and added a new
optional argument, `scalar?`, to
`metabase.formatter.core/number-formatter`. When passed (and truthy) the
currency symbol will be splatted into the formatted number even if
`:currency-in-header` is not `false`.
* minor edits
* Update docs/permissions/row-and-column-security.md
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
---------
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
instead just pass `(not-empty q)` to the search subsystem, which will
convert it to `nil` if it's empty and pass it unchanged if it's not.
I still don't think this is probably the ideal user experience when you
navigate to `/search` but it's not an error at least.
* UXW-382 Updates "Public link" menu item for admins when public links aren't enabled so it doesn't look obviously broken
* UXW-382 Updates tests
* UXW-382 Updates "enable public links" menu item to be disabled per PR feedback
* UXW-382 Swaps core styles for mantine props per PR feedback
* fix: issues generating valid urls for map tiles
Fixes to issues generating map tiles, one is on x-ray dashboards we need
to check that we're not in a real dashboard and send an ad hoc tile
request.
Second if the field ref sent in the request has options we need to
remove the 'base-type' option because the type will be encoded as
something like test%2FFloat and the way Jetty decodes URLs before
parsing turns it into a '/' in a position a path separator cannot be:
https://github.com/jetty/jetty.project/issues/7713
* fixup! typeguard dashbaord id
* Update maps.cy.spec.js
* fixup! better handle null field opts
* Re-implementation of `metabase.driver.common.parameters.*` that uses Lib
* Fix Kondo warnings
* Move tests that have nothing to do with drivers to QP
* Test fixes 🔧
* Test fixes 🔧
* Try simplifying the PR
* db routing for redshift
* simplify test
* dataset name multimethod
* small change
* use delayed defs
* add redshift ci routing env var
* small fix
* update dataset definitions
* change back to original data
* feat: driver/do-with-resilient-connection
* feat: :keep-open? option to do-with-connection-with-options
* feat: attempt describe-database with resilient connection
* feat: execute jdbc query with retry conn
* test
* avoid recursive issues
* simplify
* changelog
* type hint
* force local conn, so the connection being closed won't close outer unrealized result sets
* working test
* more test
* opts
* style
* add test for connection options
* notes
* fix test
* docstring
* Update src/metabase/driver/sql_jdbc/execute.clj
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
* logs
* better logs
* try to close conn when it's no longer valid
* pull out logic to is-conn-open
* is-conn-open? test
* clarify
* Update docs/developers-guide/driver-changelog.md
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
* update version
* chore: move tests to right namespace
* retry have select privilege on error
* add test
* improve test
* remove let
* separate connection for each test
* clean up test
* try druid jdbc ci fix
* close connection during test
* use do with resilient connection in test for druid
* formatting
* always set role if supported
* Fix clickhouse and sqlserver
* impersonation test
* use normal-driver-select
* address comments
* kondo
* remove debug
---------
Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
* UXW-28 Adds confirmation modal when deleting a tab that contains dashboard-only cards
* UXW-28 Makes confirmation modal smarter; uses short version if all questions on a tab are dashboard questions, lists affected questions if it's a mix
* UXW-28 Adds tests
* feat: driver/do-with-resilient-connection
* feat: :keep-open? option to do-with-connection-with-options
* feat: attempt describe-database with resilient connection
* feat: execute jdbc query with retry conn
* test
* avoid recursive issues
* simplify
* changelog
* type hint
* force local conn, so the connection being closed won't close outer unrealized result sets
* working test
* more test
* opts
* style
* add test for connection options
* notes
* fix test
* docstring
* Update src/metabase/driver/sql_jdbc/execute.clj
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
* logs
* better logs
* try to close conn when it's no longer valid
* pull out logic to is-conn-open
* is-conn-open? test
* clarify
* Update docs/developers-guide/driver-changelog.md
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
* update version
* chore: move tests to right namespace
* impersonation test
* use normal-driver-select
* trigger CI
---------
Co-authored-by: lbrdnk <lbrdnk@users.noreply.github.com>
* feat(simple-embed): parse attributes with json5 to be more permissive with quotes
* Update package.json
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
* fix tests
* Apply suggestion from @heypoom
Co-authored-by: Phoomparin Mano <poom@metabase.com>
---------
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
* Remove debugging stuff
* 14 failures, 1 error.
* 10 failures, 1 error.
* 10 failures, 0 errors.
* Better log messages
* Faster field ref resolution
* Test fixes 🔧
* Some test fixes 🔧
* Remove resolve-joined-fields middleware
* Fix lib.underlying calculation of fields with join aliases
* Fix busted pivot tests
* Remove unused fn
* More resolution fixes
* drill-thru use vars so we can get updated fns in the REPL
* Consolidate the lib metadata => legacy metadata functions
* Add a pile of additional tests
* Migrate the `resolve-joined-fields` middleware (#39884)
* Support automatically removing duplicate refs in `:fields` and `:breakouts` during normalization
* More cleanup and extra tests 🔧
* Add ::mbql.s/OrderBys
* Mess with logging in resolution even more
* Order bys should be distinct ignoring keys like :base-type or namespaced keys
* I have fixed#60587
* One last round of test fixes??
* Test fix
* Code cleanup
* Fix test failures 🔧
* MongoDB test fix
* Fix Oracle test 🔧
* MongoDB test fix 🔧
* cljfmt
* e2e test fix?
* Test fix 🔧
* Less noisy logging
* Improve field resolution for implicit joins; PR feedback (part 1)
* PR feedback (part 2) and extra dox
* Run tests if files in lib/drivers/qp are changes
check src/metabase/lib, src/metabase/query_processor, modules/drivers
we key off of team label but this is hopefully close enough to what we
really want
* run an action linter
```
❯ actionlint /Users/dan/projects/work/metabase/.github/workflows/drivers.yml
.github/workflows/drivers.yml:440:71: property "exclude-tag" is not defined in object type {name: string; test-args: string} [expression]
.github/workflows/drivers.yml:537:15: description is required in metadata of "Wait for localhost port to be ready" action at "/Users/dan/projects/work/metabase/.github/actions/await-port/action.yml" [action]
|
537 | - uses: ./.github/actions/await-port
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
.github/workflows/drivers.yml:587:13: description is required in metadata of "Test database driver" action at "/Users/dan/projects/work/metabase/.github/actions/test-driver/action.yml" [action]
|
587 | uses: ./.github/actions/test-driver
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.github/workflows/drivers.yml:743:71: property "exclude-tag" is not defined in object type {name: string; test-args: string} [expression]
```
acitonlint seems pretty nice
not fixing the exclude-tag since that seems to work just fine
* fix syntax
* fetch base branch for file checks
to see if we changed files, need the base
* indentation is fun. super fast iteration
* resequence if before run
* run third tier on devex team label
* empty to poke CI
* make prepare-statement private
probably good for this to be private either way, but this is done now to
kick CI and run tests that aren't running in CI
* close single quote
We're using a setting as a half-baked way to track whether we've ever
created a non-table chart. We do this regardless of whether you're an
admin or not, but the endpoint responds with a 403 if you're not an
admin.
Honestly motivation here was fixing [UXW-152: 403 thrown for non-admins
when viewing question re:
non-table-chart-generated](https://linear.app/metabase/issue/UXW-152/403-thrown-for-non-admins-when-viewing-question-re-non-table-chart)
but it feels a little silly. But... it's not *completely* unreasonable.
* dev: add the ability to run native ddl as part of dataset definitions
* Fixing tests
* Fix kondo
* Fix tests and kondo
* Fix clickhouse tests
* Fix another clickhouse test
* Fix bigquery test
* Fix bigquery test
* Trigger Build
* fix: filter-out non-string attributes
We expected login_attributes to only be strings. When they are created
through SAML or JWT logins we don't actually enforce this, so this
filters out non-string attributes printing a warning message if they are
passed for these login types.
* feat: auto assign jwt users to groups by name
When group sync is turned on and there are no group mappings defined for
the jwt integration.
* fixup! remove tenant user group
* fixup! correct bad merge
* fixup! remove some tenant_ids in tests
* fixup! more test fixes
* feat: make jwt group attribute admin configurable
* feat: update group mapping text for jwt behavior
* feat(new-embed): log an error when the parsing of a json attribute fails
* Update enterprise/frontend/src/metabase-enterprise/embedding_iframe_sdk/webcomponents.ts
Co-authored-by: Phoomparin Mano <poom@metabase.com>
---------
Co-authored-by: Phoomparin Mano <poom@metabase.com>
* fix: allow scalar user-attributes
Only drop collections which cannot be converted to strings when
generating database queries.
* fixup! remove unused namespace
* fixup! use keep to retain false booleans
* fix: filter-out non-string attributes
We expected login_attributes to only be strings. When they are created
through SAML or JWT logins we don't actually enforce this, so this
filters out non-string attributes printing a warning message if they are
passed for these login types.
* feat: auto assign jwt users to groups by name
When group sync is turned on and there are no group mappings defined for
the jwt integration.
* fixup! remove tenant user group
* fixup! correct bad merge
* fixup! remove some tenant_ids in tests
* fixup! more test fixes
* feat: make jwt group attribute admin configurable
The workflow in the `metabase-ee-extra` repository could run before the
container image tags were created by the workflow in the `metabase`
repository, causing the former to fail. Fix by making the image push
an explicit dependency of the ee-extra trigger.
This works by just totally removing the permission grants created by
sandboxes. Instead we use the `gtapped-table` flag added by the
sandboxing middleware to add just the gtapped-table itself to set of
necessary table create-query permissions and exclude any joined tables
from being added to this set.
If those tables are included elsewhere in the query (not the part
created by the sandbox), they will be added to the set of tables to
check normally and the query will be blocked if the user doesn't have
query-builder perms.
Child collections are automatically created with the same namespace as
their parent collection. Since we enforce a validation that this must be
true it seems simpler for api clients to have this value set for them
rather than requiring them to supply the namespace attribute (though it
still remains optional to pass one.)
* fix: filter-out non-string attributes
We expected login_attributes to only be strings. When they are created
through SAML or JWT logins we don't actually enforce this, so this
filters out non-string attributes printing a warning message if they are
passed for these login types.
* feat: auto assign jwt users to groups by name
When group sync is turned on and there are no group mappings defined for
the jwt integration.
* fixup! remove tenant user group
* fixup! correct bad merge
* fixup! remove some tenant_ids in tests
* fixup! more test fixes
* Update common.clj
* wip
* experiment of callback to see if it works on vue with .callback={}
* basic e2e test for dashboard
* more tests and cleanup
* remove my-app playground
* rm unused file
* use custom elements for the preview
* support for async and defer, defaulting to defer
* clean up custom elements code
* rename drills props
* Revert "experiment of callback to see if it works on vue with .callback={}"
This reverts commit 89a38dca47.
* fix theme not being restored from persisted settings
* fix: load script for preview from instance url, make iframe loaded data
attribute work
* change the snippet to use new defer syntax
* support for exploration with question-id=new
* cleanup
* fix types
* Revert "fix types"
This reverts commit bbc8eb8b59.
* Revert "support for exploration with question-id=new"
This reverts commit 4c3f041629.
* reimplement support for exploration
* fix parameters conditional rendering
* fix linting issues
* fix embed code snippet
* fix(new-embed): allow multiple questions/dashboards on the same page
* test for multiple questions
* add note about theme
* feat(sdk): expose the title prop in StaticQuestion (#61001)
* attempot to make tests more stable
* fix types
* maybe fix tests?
* test for ci
* put back support for is-save-enabled
* H.getIframeBody -> H.getSimpleEmbedIframeContent as it should be less flaky
* restore logic
* fix exploration not working in test
* moved comment to the correct place
* potential fix for handleMessage, ignore messages from other iframes
* use question for exploration templates
* fix type errors
* skip flaky "persists default and hidden parameters"
* fix template: exploration in embed flow
* always enable embedding-simple on embed flow tests
* refactor the custom elements tests to use the generic helpers
* fix tests :fingercrossed:
* default title to true
* update helper to grab the first 37.65
* default drills to true
* we're now showing the title by default
---------
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
* Do not add new extra empty stages when converting a join from legacy
* Update gitignore
* Simplified fix for #60444
* Fix QUE-1607
* Test fix 🔧
* Fix QUE-1621
* Additional tests.
* Test fix 🔧
* Remove dead code -- schemas for idents in legacy MBQL schema
* Test fix 🔧
* Fix QUE-1623
* Test fix 🔧
* Fix failing tests
* Test fixes 🔧
* Make sure join metadata goes in the right place
* Additional tests
* Make sure join metadata goes in the right place
* Less verbose logging
* Test fixes 🔧
* Some extra tests 🔧
* Another test fix 🔧
* Remove unused export
* Cleanup
* Code cleanup
* Update tests 🔧
* test fixes
* Improve/fix metadata calculation
* Test fixes 🔧
* Update tests
* Test fix 🔧
* Test fixes 🔧
* Test fix 🔧
* Test fixes 🔧
* PR feedback
* Test fix 🔧
* allow tenant attributes CRUD (#60347)
wip merge user and tenant attributes
WIP use new api
Split Mapping Editor
types fixed
so much unit testing
handle null cases
update tests
update a couple more e2e tests
less silly test
make things nicer
invalidate user cache on tenant update
* feat: separate jwt-set attributes from manual-set
* fixup! typescript stuff
* feat: restore structrue-attributes merging
Co-Authored-by: Dan Sutton <dan@metabase.com>
* feat: use merged attributes in routing/sandbox/etc
Co-Authored-By: John Swanson <john.swanson@metabase.com>
* fixup! move group manager test to ee
* fixup! kondo
* fixup! modal spec
* fixup! cypress tests
* fixup! migration timestamp
* fixup! one more cherry pick oopsie
* fixup! sandboxing cypress helper fixes
* fixup! more cypress updates
* fixup! remove eslint directive
* fixup! remove 2-arity router-dbor-id->destination-db-id
All the places it was called with 2-arity were explicitly passing in
@api/current-user anyway
---------
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
Co-authored-by: Dan Sutton <dan@metabase.com>
Co-authored-by: John Swanson <john.swanson@metabase.com>
* fix: handle headerless translations csv
* fixup! PR feedback
Also fixes an issue with error line number reporting without headers
* feat: allow csv headers to be in any order
* fixup! error reporting test
* fix: remove categories on push
* fix: run each project individually
* fix: run jobs in parallel with pom caching
* fixup! dry it up
* Update snyk.yml
* chore: test deeply nested cards with mixed perms
* chore: test custom expressions and aggregations
* chore: add more tests for blocks and joins
* fixup! whitespace
* fixup! remove confusing comments
Fixes#61253.
Here's the breakdown of the issue, since it's subtle:
- These objects can contain some vanilla JS objects which in embedding
contexts can be `Object.preventExtensions()`'d.
- Eg. the `:visualization-settings` on a card or metric.
- `lib.metadata.cache` uses these objects as part of the cache key.
- Those become the keys of a CLJS map, which uses `cljs.core/hash`
- JS objects and arrays have pointer equality (`identical?` or `===`)
semantics.
- The default `cljs.core.IHash/-hash` uses `goog.getUid(obj)`.
- That subtly mutates objects, adding a non-`enumerable`
`closure_uid_123456789` property with an arbitrary sequence number.
- That's adding a property, which is a violation if
`Object.preventExtensions()` (or `Object.freeze()`) has been used.
- That silently does nothing by default, but throws in strict mode.
This PR modifies the cache key logic (which already has special handling
for `:lib/metadata`) to replace `:lib/type :metadata/card` and
`:metadata/metric` maps with a stub like `[:metric/card 123]`.
* drop unused redux functions
* drop time parsing in event cards
* replace moment types with dayjs
* use dayjs for tz guessing
* drop moment from a hook
* drop unused time functions
* Do not add new extra empty stages when converting a join from legacy
* Update gitignore
* Fix QUE-1607
* Test fix 🔧
* Fix QUE-1621
* Additional tests.
* Test fix 🔧
* Remove dead code -- schemas for idents in legacy MBQL schema
* Test fix 🔧
* Fix QUE-1623
* Test fix 🔧
The test gives a bit of false confidence, as it passed before we added the forced re-indexing at the end of the import.
We probably want a way to keep the transaction open until after the ingestor has processed the messages from the toucan hooks... but that sounds quite invasive and brittle to pull off.
If a locale is not defined for metabase we should not allow
content-translation dictionaries to uploaded with it. Since these
locales can't be used anyway it results in a confusing user experience.
* Populate search index col of non temporal dimension ids using clojure fn
* Add non_temporal_dim_ids filter param to search request
* fix kondo
* Add stub impl of new filter to in-place
* Add metadata provider cache
* Adding has-temporal-dim filter; fix tests
* fix lint
* Fix merge
* Hookup frontend to proper BE search filters; remove deprecated impl of has-temporal-dimensions
* Fix kondo
* Fix lingering refs to has-temporal-dimensions
* Fix lingering refs to has-temporal-dimensions
* fix test
* Fix test
* Remove FE compatibility code that was ported to BE; fix typing of partition helper
* Add helper for parsing non-temporal-dim-ids endpoint param; fix the conditional in FE
* remove debug let
* Add pr ref to comment
* Include dimension filter params in request only if cartesian
* remove specs that depended on checkDimensionCompatibilityForCartesianCharts
* PR feedback
* use existing dataset query transform
* Optimized 1 images, saved 76.0 KB (48.2% smaller)
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
* Prg-81-implement-logic-for-opening-store-and-receiving-messages (#60702)
* Add new self hosted upsell flow path
* Add upsell flow hook
* Add company name to params passed to store
* Update url parameters to snake case
* Remove redundant ampersand
* Clean up useEffect dependencies
* Add store origin to token activation message
* Improve put token mock
* Snake case return_url param
* Update messages' types
* Add source check on event
* Use dynamic store value (#60865)
* Create selector for store url
* Use dynamic store value in use upsell flow
* Improve store url selector
* Create useStoreUrl hook and deprecate getStoreUrl selector
* Increase the timeout of toast messages (#60966)
* increase the timeout of toast messages
* Send notification even if reference to store window was lost
* Add metabase window name (#60964)
* Prg-91-migrate-upsell-components-to-support-ee-upsell-flow (#60850)
* Enhance upsell functionality by adding onClick support to UpsellBanner and integrating useUpsellFlow in admin settings
Fix function name
* Use match pattern in UpsellBanner
* Add Upsell baner with click stories and tests
* Add upsell flow to dev instances banner
* Integrate upsell flow into UpsellBanner components
* Fix unrelated tests
* Improve the test assertion
* Prg-95-migrate-upsellcard-to-the-new-upsell-flow (#60989)
* Add onClock to UpsellCard component
* Migrate UpsellCard components to use self hosted upsell flow
* Disable new flow in dev instances upsell (#61048)
* Allow overriding store-url in dev env (#60967)
* Fix upsell flow with undefined store variable (#61056)
* Show failure toast even if connection with store was lost
* Add store-url to e2e default db setup
* Allow undefined store-url value in use upsell flow
* Fix failing unit tests
* Prg 96 migrate upsellbigcard to the new upsell flow (#61063)
* Migrace BigCard to use onClick
* Migrate BigCard upsells
* Add onClick to UpsellPill (#61076)
* Prg-104-run-the-new-upsell-flow-only-for-self-hosted-mb-instances (#61122)
* Disable new upsell flow on hosted instances
* Fix wrong match on UpsellBigCard
* Use getIsHosted selector
add test
* Fix e2e test - selecting upsell button
* Fix extra toast triggered with new upsells
* Add upsell flow to embedding ugprade link, remove binary notice from EE self serve (#61207)
* Fix typos
* Use existing link styles
* Fix tags invalidation for bulk tables update
* Add MassTableVisibilityToggle
* Render mass toggle for schemas
* Add the button for dbs
- fix not-currently-selected branches in the tree not updating
* Fix types
* Align icon
* Align chevron icon
* Always show the toggle button for hidden tables
* Change color of hidden tables
* Only use ids of relevant tables
* Add tests
* Add test
* Take all visibility options into account
* Rename MassTableVisibilityToggle to BulkTableVisibilityToggle
* Fix color
* Render table picker items as anchors
* Remove measuring elements as elements have constant size
* Fix types and tests
* Add test
* [Lib] Finish removing idents
* Fix Kondo warnings
* cljfmt
* Another pass at fixing Kondo warnings
* Test fix 🔧
* Test fix 🔧
* Test fixes 🔧
* A few more fixes 🔧
* Another pass
* Test fix 🔧
* Test fixes 🔧
* Test fix 🔧
* Test fixes 🔧
Suspecting that instances OOM due to loading these into
memory. Increasing context and logging to help diagnose this:
When running tests:
```
clj -X:dev:test :only '["test/metabase/notification" "test/metabase/pulse"]'
...
DEBUG metabase.notification.payload.temp-storage - stored data in temp file {:length 57167}
[main] DEBUG metabase.notification.payload.temp-storage - stored data in temp file {:length 718167}
[main] INFO metabase.notification.payload.temp-storage - reading temp storage file of size: 55.8 kb
[main] INFO metabase.notification.payload.temp-storage - reading file with preamble: {:dashboard_tab_id nil, :card_id 198, :dashboard_id 77}
[main] INFO metabase.notification.payload.temp-storage - reading temp storage file of size: 55.8 kb
[main] INFO metabase.notification.payload.temp-storage - reading file with preamble: {:dashboard_tab_id nil, :card_id 198, :dashboard_id 77}
[main] INFO metabase.notification.payload.temp-storage - reading temp storage file of size: 701.3 kb
[main] INFO metabase.notification.payload.temp-storage - reading file with preamble: {:dashboard_tab_id nil, :card_id 199, :dashboard_id 77}
[main] INFO metabase.notification.payload.temp-storage - reading temp storage file of size: 701.3 kb
[main] INFO metabase.notification.payload.temp-storage - reading file with preamble: {:dashboard_tab_id nil, :card_id 199, :dashboard_id 77}
```
Adding an optional preamble that is just `pr-str`'d and logging a human
readable size of the file that is saved
* add-dimension-projections middleware => Lib (#39877)
* Ban mt/with-column-remappings inside QP tests
* Update pivot QP code to not convert to legacy
* Rename middleware
* Use the remap metadata provider in sandboxing tests
* Overhaul add-implicit-joins middleware
* Restore the wacko metadata updating code
* Ok, joins ARE allowed to have :fields.
* Fix JS tests 🔧
* Fix QUE-1563
* Test fixes 🔧
* Fix 100 more broken things
* Test fixes
* Use same distinct-ref logic as lib
* More test fixes 🔧
* Make add-alias-info better at matching things
* Consolidate the legacy result metadata schemas
* cljfmt
* Use `:decode/normalize` in the REST API for boring things like metadata
* Another round of test fixes 🔧
* Restore kondo ignore
* Another round of test fixes 🔧
* cljfmt
* PR feedback 🔧
* chore: remove wait in favour of waiting for modal to disappear
* feat: wait for query to be completed to possibly avoid DB race condition
* feat: wait for the table name to be shown in the ui before clicking it
* chore: removed un-needed waits
* Update e2e/test/scenarios/admin/admin-reproductions.cy.spec.js
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
---------
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
* Move expression widget into subfolder
* Import expression components from top-level
* Move expression helpers to metabase/querying/expressions
* Fix fuzzing paths
* Fix comment
* Add missing exports from expressions
* Remove unused exports
* Sort exports
* Add helper to get supported clauses
* Rename complete to suggestions for consistency
* Move tokenAtPos to position module
* Move assertion helpers to utils
* Split up pratt/types
* Use token text instead of slicing source
* Remove superflouous from and to on token
* Remove superflouous from, to and len on token
* Remove content helper
* Remove superflous fields on Token
* Rename compiler to compile-expression
* Fix imports
* Fix exports
* Remove eslint directives
* Move FK_SYMBOL to formatting/constants
* Use () => undefined instead of jest.fn
* Fix tags invalidation for bulk tables update
* Add MassTableVisibilityToggle
* Render mass toggle for schemas
* Add the button for dbs
- fix not-currently-selected branches in the tree not updating
* Fix types
* Align icon
* Align chevron icon
* Always show the toggle button for hidden tables
* Change color of hidden tables
* Only use ids of relevant tables
* Add tests
* Add test
* Take all visibility options into account
* Rename MassTableVisibilityToggle to BulkTableVisibilityToggle
* Allow supression of case and coalesce arg typechecks
* Add test for ignored type-check
* Configure *suppress-expression-type-check?* in tests
* Fix formatting
As is, field filters and time groupings assume that they can just refer to the field normally. In queries where aliases are
used/required, this doesn't work so well. Letting users specify the alias to use in place of the normal field
reference handles this case.
---------
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
* improve loading experience logic and fix bug where there are tool calls without messages causing messages to get cramed together with no space
* add a unit test
* Add `extraAction` prop to `undo` object
* Make `setEditingParameter` switch tab if needed
* Put a dashboard filter in the viewport
* Fix toast text appearance
* Hide "Show filter" button when moving to top nav
* Add e2e test
* Fix tests
* Ensure postgres downloads don't OOM
Fixes https://github.com/metabase/metabase/issues/60733
For performance reasons we set autocommit to true. this has an
unfortunate consequence that the postgres driver does not honor batch
sizes. We go through a lot of trouble to hook the streaming results of a
query to the output stream of the download, but the postgres jdbc driver
will realize all rows in memory.
A fast way forward is to set autocommit to false only when
`write?` (previous condition) or when executing a postgres download, as
reported in https://github.com/metabase/metabase/issues/60733.
How to test:
this is difficult. In CI we use
```clojure
:ci
{:jvm-opts ["-Xmx12g"
"-Xms12g"
```
So hitting a query that would deterministically OOM the instance
requires a lot more muscle than we realistically want to use.
I'm running the following tests locally:
```
:small-ram
{:jvm-opts ["-Xmx400m"
"-Xms400m"
"-Dci=TRUE"]}
```
```clojure
(defn- readable [bytes]
(cond (nil? bytes) "0 bytes"
(zero? bytes) "0 bytes"
:else
(let [units ["b" "kb" "mb" "gb" "tb"]
magnitude 1024.0]
(loop [[unit & remaining] units
current (double bytes)]
(if (and (seq remaining) (> current magnitude))
(recur remaining (/ current magnitude))
(format "%.1f %s" current unit))))))
(defn- consume
[^java.io.InputStream is]
(let [arr (byte-array 8024)]
(loop [c 0, gas 5000000]
(let [r (java.io.InputStream/.read is arr 0 (alength arr))]
(cond (zero? gas)
(throw (ex-info "Ran out of gas" {}))
(neg? r) c
:else (recur (+ c r) (dec gas)))))))
(deftest large-csv-test
(mt/test-driver :postgres
(testing "Postgres can download csvs without holding the entire results in memory #(#60733)"
(let [large-query "SELECT repeat('x', 2048) FROM generate_series(1, 1000000)"
result (mt/user-real-request :crowberto :post 200 "dataset/csv"
{:request-options {:as :stream}}
{:query (mt/native-query
{:query large-query})
:format_rows true})
size (consume result)]
(is (> size 2000000000)
(format "Only consumed %s but expected ~2gb" (readable size)))))))
```
and then
```
❯ time source pg.env && DRIVERS=postgres clojure -X:dev:test:small-ram :only metabase.driver.postgres-test/large-csv-test
Running QP tests against these drivers: #{:postgres}
LONG TEST in metabase.driver.postgres-test/large-csv-test
Test took 23.358 seconds seconds to run
Ran 1 tests in 32.825 seconds
2 assertions, 0 failures, 0 errors.
{:test 1, :pass 2, :fail 0, :error 0, :type :summary, :duration 32825.099875, :single-threaded 1}
Ran 0 tests in parallel, 1 single-threaded.
Finding and running tests took 40.7 s.
All tests passed.
Running after-run hooks...
```
Why not add these tests now?
We probably should write a full memory regression suite. This is a great
candidate for a first one. But it seems silly to run a new CI job with
just this one job. Push back if you think i'm wrong.
Another area of pushback:
I took the lazy way when determining if a driver should have autocommit
set to false or not: i hardcoded it.
```clojure
(and (-> options :download?) (= driver :postgres))
```
The alternative is some method of a new driver multimethod or
driver-supports?. The former feels a bit heavy-weight, the latter feels
not quite right since this is almost a non-support and all other jdbc
drivers do support it, presumably?
I'm quite open to pushback here and invite comments if you see a better way.
* Can't use an if for write?
You'd think you can use an if here but the previous code used a when and
is silent on write?. Lots of tests fail relating to datasets in test
setup and uploads. Don't want to debug that in this bug fix context so
leaving a todo
* remove old arity metadata. thanks eastwood!
* Don't set autoCommit for all postgres and descendant drivers
```clojure
(ns ^:mb/memory metabase.memory.csv-test
(:require
[clojure.test :refer :all]
[metabase.test :as mt]
[metabase.driver :as driver]))
(set! *warn-on-reflection* true)
(defn- readable [bytes]
(cond (nil? bytes) "0 bytes"
(zero? bytes) "0 bytes"
:else
(let [units ["b" "kb" "mb" "gb" "tb"]
magnitude 1024.0]
(loop [[unit & remaining] units
current (double bytes)]
(if (and (seq remaining) (> current magnitude))
(recur remaining (/ current magnitude))
(format "%.1f %s" current unit))))))
(defn- consume
[^java.io.InputStream is]
(let [arr (byte-array 8024)]
(loop [c 0, gas 5000000]
(let [r (java.io.InputStream/.read is arr 0 (alength arr))]
(cond (zero? gas)
(throw (ex-info "Ran out of gas" {}))
(neg? r) c
:else (recur (+ c r) (dec gas)))))))
(def driver->query
{:sqlite "WITH RECURSIVE generate_series(value) AS (
SELECT 1
UNION ALL
SELECT value + 1 FROM generate_series WHERE value + 1 <= 1000000
)
SELECT replace(hex(zeroblob(1024)), '00', 'xx') FROM generate_series;"
:postgres "SELECT repeat('x', 2048) FROM generate_series(1, 1000000)"
:clickhouse "SELECT repeat('x', 2048)
FROM system.numbers
LIMIT 1000000;"
:redshift "WITH series AS (
SELECT ROW_NUMBER() OVER () as i
FROM stl_scan s1, stl_scan s2
LIMIT 1000000
)
SELECT REPEAT('x', 2048) FROM series;"})
(deftest large-csv-test
(mt/test-drivers #{:postgres :sqlite :clickhouse :redshift}
(testing "Postgres can download csvs without holding the entire results in memory #(#60733)"
(let [large-query (or (driver->query driver/*driver*)
(throw (ex-info "Driver doesn't implement big query"
{:driver driver/*driver*
:available (keys driver->query)})))
result (mt/user-real-request :crowberto :post 200 "dataset/csv"
{:request-options {:as :stream}}
{:query (mt/native-query
{:query large-query})
:format_rows true})
size (consume result)]
(is (> size 2000000000)
(format "Only consumed %s but expected ~2gb" (readable size)))))))
(comment
(mt/set-test-drivers! #{:postgres})
(mt/set-test-drivers! #{:sqlite})
(mt/set-test-drivers! #{:clickhouse})
(mt/set-test-drivers! #{:redshift})
(mt/test-drivers #{:redshift}
(mt/db))
)
```
Verify this with
```
:small-ram
{:jvm-opts ["-Xmx400m"
"-Xms400m"
"-Dci=TRUE"]}
```
and then
```
;; driver.env:
;; local clickhouse
export MB_CLICKHOUSE_TEST_password="password"
export MB_CLICKHOUSE_TEST_username="default"
;; local postgres
export MB_POSTGRESQL_TEST_USER=dan
export MB_REDSHIFT_TEST_PASSWORD=<value>
export MB_REDSHIFT_TEST_USER=<value>
export MB_REDSHIFT_TEST_DB=<value>
export MB_REDSHIFT_TEST_HOST=<value>
```
and then running:
```
❯ source driver.env && DRIVERS=redshift clojure -X:dev:test:drivers:drivers-dev:ee:ee-dev:small-ram :only metabase.memory.csv-test/large-csv-test
...
Running tests in metabase.memory.csv-test/large-csv-test
Finding tests took 8.3 s.
Running 1 tests
Running before-run hooks...
Running QP tests against these drivers: #{:redshift}
..
LONG TEST in metabase.memory.csv-test/large-csv-test
Test took 188.320 seconds seconds to run
Ran 1 tests in 188.338 seconds
2 assertions, 0 failures, 0 errors.
{:test 1, :pass 2, :fail 0, :error 0, :type :summary, :duration 188337.678584, :single-threaded 1}
Ran 0 tests in parallel, 1 single-threaded.
Finding and running tests took 3.3 mins.
All tests passed.
Running after-run hooks...
```
redshift takes a while.
contrast with
```
❯ source driver.env && DRIVERS=clickhouse,postgres clojure -X:dev:test:drivers:drivers-dev:ee:ee-dev:small-ram :only metabase.memory.csv-test/large-csv-test
...
Running QP tests against these drivers: #{:postgres :clickhouse}
...
LONG TEST in metabase.memory.csv-test/large-csv-test
Test took 46.638 seconds seconds to run
Ran 1 tests in 46.655 seconds
4 assertions, 0 failures, 0 errors.
{:test 1, :pass 4, :fail 0, :error 0, :type :summary, :duration 46655.436333, :single-threaded 1}
Ran 0 tests in parallel, 1 single-threaded.
Finding and running tests took 56.5 s.
All tests passed.
Running after-run hooks...
```
both running locally happen in ~1 minute compared to 3 minutes for redshift
* Remove commented out old arity
this funciton used to have two arities for clarity. But it wasn't
another entrypoint, it was just trying to keep things a bit cleaner. But
the result is that at the point where we used the string sql query we
didn't have the `info` map in lexical scope. Fixing this across arities
would have pushed us into 7 positional args, so you might want to switch
to a map, but honestly, it's just the same function.
* Add ResponsiveButton component
* Prevent focus state being cut off
* Make the buttons responsive in the table section
* Make the buttons responsive in field section
* Extract useResponsiveButtons
* Add comments
* Extract useResponsiveButtons in FieldSection
* Add aria-label to the button
* Add tests
* Test tooltips
* Fix indent
* Add "move filter" menu
* Add undo
* Handle single tab dashboards
* Update text color for checked items
* Fix collapsed menu appearance
* Add tests
* Fix error when a tab doesn't have any dashcards
* Fix "Top of page" option selected color
* Use "card.title" viz setting
* Truncate long card titles
* Update "Disconnect from cards" button appearance
* Fix type error
* Make the select searchable, touch up on appearance
* Fix e2e test
* Add `moveDashboardFilter` helper
* Fix e2e test name
* Remove subtitles
* Update icon color
* Update icon color
* SEM-503 Add blue border to selected field
* SEM-504 Border radius of table/field name and description boxes should match that of setting cards
* SEM-509 Improve microcopy for table and field editing instructions
* SEM-510 Field descriptions could use "paragraph" text style with greater line height
* save
* revert redshift changes
* kondo
* add ci routing var
* redshift rough work
* cleanup bigquery changes
* remove bigquery specific redefs and bindings
* add separate var for dataset
* custom routing info per driver
* update changelog
* cljfmt
* fix fe lint
* use deferred-tru
* dissoc db_routing_info for tests
* fix other tests
* fix kondo and lint
* use yaml
* fix whitespace
* change log
* kondo and eastwood
* use markdown for routing info
* remove unneeded driver method
* cleanup
* fix tests
* fix remaining test
* add fe test
* add extra info in register-lazy-loaded-driver
* address pr comment
* improve doc string
* add text-secondary color to database info markdown
* update markdown
* alphabetical order
* move db routing info from db to session properties
* FE adjustments
* dont parse extra info
---------
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
* poc
* timing logs
* Only render compatible datasets
* Build uberjar to be able to test in cloud with more data
* search index support for display
* search index support for exclude-display and has-temporal-dimensions
* fix weird filter vs index column bug
* fix temporal filter
* required ids search index filter
* fix build by removing :display from search render-terms
* adding h2 compatibility
* fixing alignment
* whitespace
* all clicks are add clicks now
* reverted labels change
* whitespace
* whitespace
* mutation -> query, load compatibles at startup
* using viz icons in dataset list
* remove exclude_display
* consolidate search endpoint
* rename display param to display_type
* allignment
* fix filter tests
* test fixes
* Closes VIZ-1185: revert "using viz icons in dataset list"
This reverts commit 7f4d177e977643f90250a5add2f946d6f35ad2a0.
* closes VIZ-1184 copy for "no results"
* closes VIZ-1183 spacing between input and results
* removed log statement
* fixed type
* fixed basics.cy.spec.ts
* fixed dashboard-questions.cy.spec.js
* fixed sharing-reproductions.cy.spec.js
* fixed snowplow-tracking.cy.spec.ts
* fixed funnels.cy.spec.ts
* fixed others
* fix import
* return new fields in results for in-place engine
* test fix
* test fix attempt
* rm backup file
* fixed more e2e tests
* fixup
* more stabilization of e2e tests
* tweak whitespace
* first attempt to fix failing postgres tests
* try a simpler approach
* closes VIZ-1227 search not triggered when no datasource is selected
* new attempt to parameterize the define-spec macro with app-db
* removing non-temporal-dimension-ids filter
* fix cljkondo
* fix test
* fixed e2e (snowplow)
* fixed e2e (funnels)
* fixed e2e (basics)
* better loading state, better typing
* reverted type change
* uncomment e2e cartesian; remove unused search param; fix bg color
* Fix query to resolve to false instead of nil
---------
Co-authored-by: Eliot Daigneault-Mestre <eliot@metabase.com>
Co-authored-by: Noah Moss <noahbmoss@gmail.com>
Co-authored-by: Sébastien <sebastien@metabase.com>
* Stop offering expressions and aggregation being edited as columns
Fixes#61010
* Add repro for metabase#61010
* Add test for custom columns too
* Update expected error message in e2e test
* Detect cycles in resolver too
* Revert "Detect cycles in resolver too"
* Add e2e test for referencing custom expressions that are just wrappers
---------
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
Fixes#44077. Fixes#35840.
Previously this used some custom legacy MBQL manipulation. It was
incorrect and led to a handful of bugs. Now it's a straightforward
edit of the query powered by MBQL lib.
* clear secret file memoization on db update
* add rsa env vars
* improve test
* add more narrow test
* improve test
* refactor snowflake private key test to create and drop user per test
* use accountadmin role
* try granting sysadmin
* try using accountadmin role
* use correct details
* throw exceptions for unimplemented methods
* clean up test code
* use different login and user names for sqlserver impersonation setup
* Require role
* fix sqlserver test
* move feature supported def
* remove outdated test
* feat: swap span for flex in Trigger component with chevron
* chore: use span in flex component
* feat: add small left padding to native editor action buttons
* chore: fix typo on data-testid file
* chore: force viewport to be big enough in cy test
* feat: force the test to small window and execute the drag vertically
* "I'll do this later" doesn't exit the flow (#59993)
* parallelize requests and make them use rtk query (#59563)
* parallelize requests and make them use rtk query
* fix multiple "Automatically Generated Dashboards" collections created +
update types
* add test
* EMB-459: remove 3 tables limit (#59997)
* Tweak welcome step content display (#60083)
* tweak welcome step content display
* update test after copy update
---------
Co-authored-by: Nicolò Pretto <info@npretto.com>
* remove useForceLocaleRefresh as the context is now enough (#60145)
* adds `embedding_setup_click` event (#60315)
* embedding setup: remove last fetch call and speed up e2e (#60392)
* close EMB-487, remove last remaining fetch call
* closes EMB-534, speed up e2e
* createdDashboard -> createdDashboards
* embedding setup: use cloud token in e2e and hide appbar and database status (#60335)
* EMB-533: make the e2e test use the CLOUD pro token
* EMB-532: hide the database sync and the app bars in setup/embedding
* Update e2e/test/scenarios/onboarding/setup/setup-embedding.cy.spec.ts
* fix typo
---------
Co-authored-by: Kyle Doherty <5248953+kdoh@users.noreply.github.com>
* Empty
* No need for intersection in test
* Correct modestring casing
* Test datetime(number, mode) for s, ms, us, ns
* Allow uppercase and hyphens but normalize them.
* Don't allow hyphens in frontend.
* Implement unix casts for mongo
* Convert floats to long
* Use hyphenated keywords internally
* expand docstring
* Try other implementation of nanoseconds for BigQuery
* Handle sqlserver unix timestamps with multimethod
* More flexible date type handling
* Use integer division with bigquery
* datetime(number) frontend tests
* Undo change to package.json
* Empty
* Wrap code-like stuff in ``
* Add expressions/today feature
* Add legacy + lib for today()
* Basic test for today() (WIP)
* Add expressions/today feature to sql + implementation
* Finalize today() test
* Implement today() on mongo
* Better comment
* use m/find-first
* Frontend implementation
* Add today() fe test
* Improve fe test for today()
* Add a line to changelog
* Add line to changelog about expressions/today
* Handle different types better in lib schema
* Add special case for mode in formatter
* Add mode to expression options
* Add special case for mode in parser
* Error message
* Schema with options
* Add options map to legacy schema for datetime
* Remove comment
* Add unit test for mode option in compiler
* Add test for formatting the mode option in datetime
* Better round-tripping for :datetime function
* Add :mode to allowed keys for options marshalling
* Fix expression to add mode to options map
* Test datetime() legacy/lib roundtripping
* Fix normalization
* Remove println
* Mongo datetime() with options map
* Move test to custom-column spec
* Remove duplicate check
---------
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
* In main nav, don't show 'Other users' personal collections' if there are no other users
---------
Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Fraser <fraser@metabase.com>
This PR fixes a bug where dashboard filters linked to multiple fields would show entity keys instead of remapped entity names when viewed by users with grouped (limited) permissions.
The solution in this PR is to add support for explicit remapping field specification.
Also resolved a separate permissions caching bug in data_permissions.clj where the use-cache? logic was inverted.
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
* Empty
* No need for intersection in test
* Correct modestring casing
* Test datetime(number, mode) for s, ms, us, ns
* Allow uppercase and hyphens but normalize them.
* Don't allow hyphens in frontend.
* Implement unix casts for mongo
* Convert floats to long
* Use hyphenated keywords internally
* expand docstring
* Try other implementation of nanoseconds for BigQuery
* Handle sqlserver unix timestamps with multimethod
* More flexible date type handling
* Use integer division with bigquery
* datetime(number) frontend tests
* Undo change to package.json
* Wrap code-like stuff in ``
* Better comment
* use m/find-first
* Add a line to changelog
* Handle different types better in lib schema
* Add special case for mode in formatter
* Add mode to expression options
* Add special case for mode in parser
* Error message
* Schema with options
* Add options map to legacy schema for datetime
* Remove comment
* Add unit test for mode option in compiler
* Add test for formatting the mode option in datetime
* Better round-tripping for :datetime function
* Add :mode to allowed keys for options marshalling
* Fix expression to add mode to options map
* Test datetime() legacy/lib roundtripping
* Fix normalization
* Remove println
* Mongo datetime() with options map
* Remove duplicate check
* Add simple bytes to compiler
---------
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
* Add aggregation columns
* Pass expressionIndex to Expression editor in AggregationPicker
* Add expression-parts-method for aggregation references
* Add support in the query processor
* Add more tests
* Hack FE to call aggregablecolumns
* Add missing expressionMode option
* Add columnsForExpressionMode helper
* Update error message from resolver
* Add query with aggregation for tests
* Add tests for resolving aggregations
* Fix tests
* Fix CLJS tests
* Fix more tests
* Add missing docstring
* Add more unit tests
* Add unit test for aggregation completions
* Fix error message in test
* Add tests for second stage resolver
* Add tests for referencing aggregations
* Add test for resolving aggregation in next stage
* Disambiguate test name
* Fix column names returned by QP for aliased aggregations
* Fix merge issues
* Fix final test
* Address review comments
* Move aggregation tests
* Add test for detecting cycles in aggregations
* Add test about disallowing duplicate aggregation names
* Add sort helper
* Add tests for using nested aggregations as question source
* Add e2e test for nested aggregations in follow up stage
* Add tests for using nested aggregations in follow up stage with breakout
* Allow duplicate aggregation names
* Add test for changing aggregation order in underlying question
* Remove nonsensical test
* Fix test descriptions
* Fix test
---------
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
* Add BE repro test for #58314
* Add repro test for #35252
* Add repro test for #39033
* Add repro test for #27521
* Add repro test for #47734
* Add repro test for QUE-1378
* Add repro test for QUE-1374
* Add repro test for #58314
* Add repro test for #44767Closes#44767
* Add repro test for #60498
* Add repro test for #60444
* Make test for #60444 more general
* run embedding-sdk.yml from run-tests.yml
* remove e2e-tests-skipped-stub
* try to put back some structure
* fix name of build
* / -> › because github doesn't uses only the part after the last slash
* use > instead of chevron to make linter happy
* breaking changeS
* remove code to trigger ci
* Fix flaky test by adding aria-hidden on elements rendered only to perform measurements
* Revert "Fix flaky test by adding aria-hidden on elements rendered only to perform measurements"
This reverts commit 5575d6b43b.
* Fix flaky test by adding aria-hidden on elements rendered only to perform measurements
* Use hidden instead of aria-hidden
* Filter out invisible elements
* Revert adding hidden attribute
* moving pickers into same folder, consolidate getInitialContainer hooks
* getCollectionIdPath consolidation
* getStateFromIdPath
* comitting sins to get tests passing
Fixes getting source tables in multistage aggregations. The check for
when we were in the scope of the parent card was in the wrong place in
the match which resulted in us failing to make a source-query block
immediately inside a stage with a source card.
Two changes required to allow this:
- first, for the setting itself, allow setting it if the database is
writable OR an attached DWH.
- second, a similar change to make sure `syncable_schemas` is fetchable
for the attached DWH.
* SEM-239 Data model - Layout boilerplate (#57174)
* Add route and link
* Convert DataModelApp to TypeScript
* Use DataModelApp in DataModel
* Keep all routes
* Extract section components
* Add empty states
* Use ts-pattern
* Drop ts-pattern
* Disable preview
* Rename
* Add border
* Move page components to their own dirs
* SEM-240 Data model - Table section (#57248)
* Add route and link
* Convert DataModelApp to TypeScript
* Use DataModelApp in DataModel
* Keep all routes
* Extract section components
* Add empty states
* Use ts-pattern
* Drop ts-pattern
* Disable preview
* Rename
* Add border
* Move page components to their own dirs
* Add table fetching
* Add NameDescriptionInput boilerplate
* Update table on blur
* Fix focus state and prevent empty names
* Add Hide this table switch
- Label from https://www.loom.com/share/45ce00aaac3f4141adf3f52dec79048f?highlightComment=80327135&t=271
* Style the Switch
* Move FieldOrderPicker
* Move SortableField
* Move NameDescriptionInput
* Make NameDescriptionInput more generic
* Use FieldOrderPicker
* Rename
* Move label into TableVisibilityInput
* Add missing return
* Add FieldOrder
* Get rid of entity framework workarounds
* Add TODO comment
* Make header sticky
* Sort
* Add field scanning section
* Discard + rescan
* Remove todo
* Remove TableVisibilityInput
* Rename FieldOrder to SortableFieldList and move it to metadata/components
* Implement getFieldIcon boilerplate
* Do not use metabase-lib/v1
* Extract tableFieldToColumnMetadata
* Fix focus state being cut off
* Extract RescanFieldsButton, add error and success states
* Extract DiscardFieldValuesButton
* Rename
* Move to metadata/components
* Style name/description input
* Add missing ttag
* Add NameDescriptionInput tests
* Add more tests
* Organize tests
* Add tests
* Add DiscardTableFieldValuesButton tests
* Add test
* Add RescanTableFieldsButton tests
* Lint colors
* Add tests for getItems
* Add tests for getFieldIcon
* Update comment
* Update test names
* Add missing effect
* Add missing effect
* Fix flaky unit tests
* Remove getFieldIcon
* Extract TextInputBlurChange
* Update comment
* SEM-241 Data model - Field - Data section (#57420)
* Add route and link
* Convert DataModelApp to TypeScript
* Use DataModelApp in DataModel
* Keep all routes
* Extract section components
* Add empty states
* Use ts-pattern
* Drop ts-pattern
* Disable preview
* Rename
* Add border
* Move page components to their own dirs
* Add table fetching
* Add NameDescriptionInput boilerplate
* Update table on blur
* Fix focus state and prevent empty names
* Add Hide this table switch
- Label from https://www.loom.com/share/45ce00aaac3f4141adf3f52dec79048f?highlightComment=80327135&t=271
* Style the Switch
* Move FieldOrderPicker
* Move SortableField
* Move NameDescriptionInput
* Make NameDescriptionInput more generic
* Use FieldOrderPicker
* Rename
* Move label into TableVisibilityInput
* Add missing return
* Add FieldOrder
* Get rid of entity framework workarounds
* Add TODO comment
* Make header sticky
* Sort
* Add field scanning section
* Discard + rescan
* Remove todo
* Remove TableVisibilityInput
* Rename FieldOrder to SortableFieldList and move it to metadata/components
* Implement getFieldIcon boilerplate
* Do not use metabase-lib/v1
* Extract tableFieldToColumnMetadata
* Fix focus state being cut off
* Extract RescanFieldsButton, add error and success states
* Extract DiscardFieldValuesButton
* Rename
* Move to metadata/components
* Style name/description input
* Add missing ttag
* Add NameDescriptionInput tests
* Add more tests
* Organize tests
* Add tests
* Add DiscardTableFieldValuesButton tests
* Add test
* Add RescanTableFieldsButton tests
* Lint colors
* Add tests for getItems
* Add tests for getFieldIcon
* Update comment
* Update test names
* Add missing effect
* Add missing effect
* Navigation onClick
* Fix flaky unit tests
* Use a link
* Explain cast
* Improve url generation
* Style active link
* Load field, display name
* Sticky header
* Add SectionPill
* Add field name and data type
* Add cast toggle
* Add CoercionStrategyPicker
* Remove getFieldIcon
* Extract TextInputBlurChange
* Update comment
* Casting toggle state sync
* CoercionStrategyPicker error state
* Extract FieldDataSection
* Reuse existing TextInputBlurChange
* Further cleanup
* Use key for FieldSection
* Lift data fetching
* Add decoration
* Use key for table as well
* Add unit tests
* Add unit tests
* Add unit tests
* Add comments
* Simplify color
* Use type instead of interface
* SEM-297 Drop entity framework usage in `SemanticTypePicker` (#57531)
* Add route and link
* Convert DataModelApp to TypeScript
* Use DataModelApp in DataModel
* Keep all routes
* Extract section components
* Add empty states
* Use ts-pattern
* Drop ts-pattern
* Disable preview
* Rename
* Add border
* Move page components to their own dirs
* Add table fetching
* Add NameDescriptionInput boilerplate
* Update table on blur
* Fix focus state and prevent empty names
* Add Hide this table switch
- Label from https://www.loom.com/share/45ce00aaac3f4141adf3f52dec79048f?highlightComment=80327135&t=271
* Style the Switch
* Move FieldOrderPicker
* Move SortableField
* Move NameDescriptionInput
* Make NameDescriptionInput more generic
* Use FieldOrderPicker
* Rename
* Move label into TableVisibilityInput
* Add missing return
* Add FieldOrder
* Get rid of entity framework workarounds
* Add TODO comment
* Make header sticky
* Sort
* Add field scanning section
* Discard + rescan
* Remove todo
* Remove TableVisibilityInput
* Rename FieldOrder to SortableFieldList and move it to metadata/components
* Implement getFieldIcon boilerplate
* Do not use metabase-lib/v1
* Extract tableFieldToColumnMetadata
* Fix focus state being cut off
* Extract RescanFieldsButton, add error and success states
* Extract DiscardFieldValuesButton
* Rename
* Move to metadata/components
* Style name/description input
* Add missing ttag
* Add NameDescriptionInput tests
* Add more tests
* Organize tests
* Add tests
* Add DiscardTableFieldValuesButton tests
* Add test
* Add RescanTableFieldsButton tests
* Lint colors
* Add tests for getItems
* Add tests for getFieldIcon
* Update comment
* Update test names
* Add missing effect
* Add missing effect
* Navigation onClick
* Fix flaky unit tests
* Use a link
* Explain cast
* Improve url generation
* Style active link
* Load field, display name
* Sticky header
* Add SectionPill
* Add field name and data type
* Add cast toggle
* Add CoercionStrategyPicker
* Remove getFieldIcon
* Extract TextInputBlurChange
* Update comment
* Casting toggle state sync
* CoercionStrategyPicker error state
* Extract FieldDataSection
* Reuse existing TextInputBlurChange
* Further cleanup
* Use key for FieldSection
* Lift data fetching
* Add decoration
* Use key for table as well
* Add unit tests
* Add unit tests
* Add unit tests
* Add comments
* Drop entity framework in FkTargetPicker
* Make table names show up
* Clean up
* Fix types
* Fix table names
* Add tests
* Add tests
* Add tests
* Restrict imports
* Improve config
* Restrict entity framework imports
* Simplify color
* Use type instead of interface
* Lint
* SEM-267 Data model - Field - Metadata section (#57527)
* Add route and link
* Convert DataModelApp to TypeScript
* Use DataModelApp in DataModel
* Keep all routes
* Extract section components
* Add empty states
* Use ts-pattern
* Drop ts-pattern
* Disable preview
* Rename
* Add border
* Move page components to their own dirs
* Add table fetching
* Add NameDescriptionInput boilerplate
* Update table on blur
* Fix focus state and prevent empty names
* Add Hide this table switch
- Label from https://www.loom.com/share/45ce00aaac3f4141adf3f52dec79048f?highlightComment=80327135&t=271
* Style the Switch
* Move FieldOrderPicker
* Move SortableField
* Move NameDescriptionInput
* Make NameDescriptionInput more generic
* Use FieldOrderPicker
* Rename
* Move label into TableVisibilityInput
* Add missing return
* Add FieldOrder
* Get rid of entity framework workarounds
* Add TODO comment
* Make header sticky
* Sort
* Add field scanning section
* Discard + rescan
* Remove todo
* Remove TableVisibilityInput
* Rename FieldOrder to SortableFieldList and move it to metadata/components
* Implement getFieldIcon boilerplate
* Do not use metabase-lib/v1
* Extract tableFieldToColumnMetadata
* Fix focus state being cut off
* Extract RescanFieldsButton, add error and success states
* Extract DiscardFieldValuesButton
* Rename
* Move to metadata/components
* Style name/description input
* Add missing ttag
* Add NameDescriptionInput tests
* Add more tests
* Organize tests
* Add tests
* Add DiscardTableFieldValuesButton tests
* Add test
* Add RescanTableFieldsButton tests
* Lint colors
* Add tests for getItems
* Add tests for getFieldIcon
* Update comment
* Update test names
* Add missing effect
* Add missing effect
* Navigation onClick
* Fix flaky unit tests
* Use a link
* Explain cast
* Improve url generation
* Style active link
* Load field, display name
* Sticky header
* Add SectionPill
* Add field name and data type
* Add cast toggle
* Add CoercionStrategyPicker
* Remove getFieldIcon
* Extract TextInputBlurChange
* Update comment
* Casting toggle state sync
* CoercionStrategyPicker error state
* Extract FieldDataSection
* Reuse existing TextInputBlurChange
* Further cleanup
* Use key for FieldSection
* Lift data fetching
* Add decoration
* Use key for table as well
* Add unit tests
* Add unit tests
* Add unit tests
* Add comments
* Add Metadata section with display name input
* Pass table through components
* Drop entity framework in FkTargetPicker
* Revert "Pass table through components"
This reverts commit 2eb3e3a256.
* Make table names show up
* Clean up
* Fix types
* Fix table names
* Add tests
* Add tests
* Add tests
* Restrict imports
* Improve config
* Restrict entity framework imports
* Simplify color
* Use type instead of interface
* Use SemanticTypeAndTargetPicker in FieldSection
* Sort
* Lint
* Typing
* Do not use v1/metadata wrapper
* Add TextareaBlurChange
* Add description input
* Update comments
* Update icon
* Add plugin query props
* Remove redundant prop
* Remove redundant _.omit
* Fix textarea crashing due to min height on input
* Set minRows
* Fix styling
* Remove PLUGIN_FEATURE_LEVEL_PERMISSIONS plugin usage from DatasetFieldMetadataFkTargetPicker
- because that's not how it works in master
* Drop -v2 suffix for new routes, use -v1 suffix for old routes (#57637)
* SEM-242 Data model - Field - Behavior section (#57638)
* Drop -v2 suffix for new routes, use -v1 suffix for old routes
* Move FieldVisibilityPicker
* Make FieldVisibilityPicker work with api Field
* Use FieldVisibilityType
* Fix gap
* Update tests
* Add label and description
* Add FieldValuesTypePicker
* Add canUnfoldJson and hasDatabaseFeature
* Rename
* Add UnfoldJsonPicker
* Fix typing
* Add RescanFieldButton
* Add DiscardFieldValuesButton
* Style the connector
* Fix scrolling
* Update spacing
* Add tests for FieldValuesTypePicker
* Add tests
* Add UnfoldJsonPicker tests
* Add tests
* Add tests
* Clean up timeouts on unmount
* Improve typing
* SEM-269 Data model - Field - Formatting section (#57682)
* Drop -v2 suffix for new routes, use -v1 suffix for old routes
* Move FieldVisibilityPicker
* Make FieldVisibilityPicker work with api Field
* Use FieldVisibilityType
* Fix gap
* Update tests
* Add label and description
* Add FieldValuesTypePicker
* Add canUnfoldJson and hasDatabaseFeature
* Rename
* Add UnfoldJsonPicker
* Fix typing
* Add RescanFieldButton
* Add DiscardFieldValuesButton
* Style the connector
* Fix scrolling
* Update spacing
* Add tests for FieldValuesTypePicker
* Add tests
* Add UnfoldJsonPicker tests
* Add tests
* Add tests
* Add FormattingSection
* Sort
* Make formatting form full width
* Use style prop instead of maxWidth
* Clean up timeouts on unmount
* Improve typing
* Metadata preview boilerplate (#58015)
* Render preview
* Add preview type selector
* Fix flex layout
* Lift preview type to top component to keep the state
* Move helpers to utils
* Add unit tests for preview picker
* Add feedback to metadata editor when saving config (#58038)
* Add feedback to all table and field settings
* Add missing prop
* Metadata table and detail preview (#57887)
* Handle undefined metadata
* Render Table preview
* Add custom error component
* Add helper for error message
* Add detail preview
* Make comment more clear
* Fix type
* Fix missing props
* Metadata table picker (#57648)
* Set up TablePicker component
* Fix type in api
* Add initial TablePicker implementation
* Add schema icon
* Update url for datapicker
* Move data loading to utils
* Add loading node types
* Derive icon from type
* Try building the treepicker state asynchronously
* Build custom tree
* Add loading state
* Push url state in picker
* Sync open state with url
* Use helper to manage expanded state
* Split Node into separate file
* Expose prefetch hook
* Prefetch data to avoid showing loading states
* Add search to table picker
* Move search-related stuff into Search module
* Use Link for navigation
* Add renderLoading helper
* Remove unused prop
* Make search input sticky
* Add separate sidebar for field picker
* Render single schema but open it by default
* Translate errors
* Defer search value
* Export lazy loaders for database info
* Use top-level data fetching
* Enable virtualization
* Move loader utils into utils
* Remove Node implementation
* Simplify styles
* Pull out some logic
* Reuse results in search
* Reuse tree helpers when handling search results
* Avoid passing down isExpanded
* Memoize
* Fix initial expanded state
* Automatically expand single-schema databases
* Pass tableId to DataPicker
* Add styling for active item
* Add getUrl helper for tree nodes
* Move types to separate file
* Simplify item
* Rename Item to Results
* Simplify
* Allow wrapping everywhere
* Add loading state
* Render tracks
* Remove unused colors
* Scroll active item into view
* Fix paths
* Add missing keys
* Handle browser navigation in table picker
* Handle browser navigation in table picker
* Add more documentation
* Debounce search
* Render track even when no parent was found
* Allow rendering urls to schema's with no name
* Add value to loading nodes
* Add delay to track too
* Add explicit level to FlatItem
* Add explicit parent refence to FlatItem
* Hide nameless schemas in the tree
* Refactor
* Move key to top-level item
* Make TablePicker not depend on router
* Disable smooth scroll
* Add unit tests for TablePicker
* Unnest unnamed schemas directly
* Also fetch tables when only one schema exists
* Remeasure items when they change
* Use more precise typeing for items
* Allow clicking table nodes in search results
* Remove unused classes
* Remove unused useDispatch hook
* Remove delay on loading items
* Add custom empty state
* Typo
* Add keyboard navigation to table picker
* Use test helpers in all tests
* Add keyboard navigation to search results too
* Add custom focus state for search items
* Add unit tests for search
* Jump to parent when pressing left arrow
* Add more cases to keyboard test
* Add hover state to table picker
* Use table display name in table picker
* Flatten single schema in to database
* Rename onChange_ to handleChange
* Use folder for schema
* Make the hover and active colors the same
* Rename Data tab to Data Model
* Remove title
* Fix layout
* Field description editor (#58280)
* Use NameDescriptionInput for the field section too
* Use TextArea for description editor
* Post-merge fixes
* Metadata editing UI tweaks (#58297)
* Add background to fields
* Tweak colors for disabled inputs
* Remove icons in SectionPill
* Remove icon from one more SectionPill
* Remove lint
* Move segments to table picker (#58422)
* Add link to segments in the datamodel sidebar
* Add local state to RouterTablePicker
* Nest segments under DataModel
* Add wrapper classes to revision routes
* Fix spacing for empty state
* Add active state to segments link
* Remove DataModelApp in DataModel routes
* Fix overflow in segment form
* Merge translation strings
* Add background color to segments components
* SEM-363 Data model - Field and table name/description inputs should be sticky and have icons (#58703)
* Remove hover/focus effect and break components down into files
* Update comment
* Consolidate toasts
* Remove unused styles
* Remove redundant card
* Extract SegmentsLink
* Make name/description input sticky
* Add icons
* Remove leftovers
* Fix TS error
* Move visibility toggles to the table picker (#58284)
* Fetch hidden tables
* Fetch hidden schemas
* Add visibility toggles to the table picker
* Remove table visibility toggle in table section
* Simplify visibility toggler
* Move visibility toggle to separate file
* Add unit tests for visibility toggle
* Show table as hidden whenever there is any visibility
* Use ActionIcon
* Break up onClick handler
* Use plan Icon
* Remove data from nodes that don't need it
* Add tooltips to table visibility togglers
* Wrap icons in ActionIcon
---------
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
* Cleanup
* SEM-361 Data model - Field metadata/formatting settings do not affect the preview (#58841)
* Fix SEM-361
* Fix types
* SEM-311 Table preview - no impact when changing time formatting for seconds and ms (#58927)
* Avoid using a breakout for date-time columns
* Use the same logic for every type of field
* SEM-246 Data model - Filtering preview (#58854)
* Fix SEM-361
* Fix types
* Add FilteringPreview boilerplate
* Use FilterPickerBody
* Another attempt
* Make it work for all types of filters
* Memoize query
* Clear filter input on field change
* Account for prop changes
* Fix TS error
* SEM-268 Data model - Field - Behavior section - Display values (#57684)
* Drop -v2 suffix for new routes, use -v1 suffix for old routes
* Move FieldVisibilityPicker
* Make FieldVisibilityPicker work with api Field
* Use FieldVisibilityType
* Fix gap
* Update tests
* Add label and description
* Add FieldValuesTypePicker
* Add canUnfoldJson and hasDatabaseFeature
* Rename
* Add UnfoldJsonPicker
* Fix typing
* Add RescanFieldButton
* Add DiscardFieldValuesButton
* Style the connector
* Fix scrolling
* Update spacing
* Add tests for FieldValuesTypePicker
* Add tests
* Add UnfoldJsonPicker tests
* Add tests
* Add tests
* Add placeholder
* Add RemappingPicker boilerplate
* Clean up timeouts on unmount
* Improve typing
* Add onChange logic boilerplate
* Extract DisplayValuesPicker
* Remove redundant code
* Format code
* Add fk input boilerplate
* Disable options instead of hiding them
* Rename
* Fetch required data
* Use full data
* Implement fk remapping onChange
* Implement naming tip
* Fix state
* Extract utils
* Fix schema step errors
* Add remappings boilerplate
* Fetch remappings
* Add more modal boilerplate
* Add modal props
* Handle modal state
* Add explicit edit button
* Implement modal form
* Limit amount of Boxes
* Bring all safety checks back in
* Refactor CustomMappingModal
* Style CustomMappingModal
* Extract getHasEmptyValues
* Remove todo
* Prevent flicker
* Fix initial state of fk picker
* Use is touched
* Add CustomMappingModal unit tests
* Add DisplayValuesPicker unit tests
* Move DisplayValuesPicker
* Remove redundant tags
* Fix uncontrolled/controller input react warning
* Add explanatory tooltips for disabled options
* Fix 1px of background leaking into view
* Add missing memoization
* Reset state when cancelling
* Sync single table via UI (#58342)
* add table-manual-sync event
* add table/sync_schema endpoint
* add table sync test
* Add api helper for the sync table schema endpoint
* Add SyncTableSchemaButton component
* Add SyncTableSchemaButton to table section
* Add unit tests for SyncTableSchemaButton
* Also invalidate field-values and parameter-values
* Simplify SyncTableSchemaButton hooks
* Move useTemporaryState into a separate hook
* Apply same pattern in all buttons
* address PR review comments: use `get-database`, `with-database-routing-off`
* Pass argument to useTemporaryState
* update test
---------
Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
* Fix SEM-370 (#59051)
* Post-merge conflict fix
* SEM-329 Data model - Table section - Update fields sorting interaction (#59316)
* Add support for size="sm" in SegmentedControl
* Add field sorting interaction boilerplate
* Update FieldOrderPicker to use SegmentedControl
* Extract Label component
* Update tooltips
* Update sortable field
* Rename SortableField to SortableFieldItem
* Render field list
* Align styling
* Use rem, remove Link from SortableFieldItem
* Styling
* Use field prop
* Background styling
* Fix TS error
* Editable name and description
* Watch out for error
* Allow overriding default props in EditableText
* Fix a11y
* A11y
* Prevent overflow
* Styling
* Cleanup
* Update comment
* Fixes
* Update label and hide it in sorting mode
* Update spacing
* Avoid CLS when entering sorting mode
* Pixel-perfect
* Use ellipsis on overflow
* Fix colors
* Fix name input size
* Fix description patching
* Style selected state
* Do not use EditableText for description input, add resetOnEsc prop
* Use flushSync instead of setTimeout
* Try to prevent event propagation
* Fix interactivity in inputs
* SEM-376 Data model - Resizable columns layout (#59100)
* Format code
* Prevent updates when nothing changes
* Use new colors
* Make nav resizable
* Fix nav width
* Remove unused styles
* Prevent CLS in SortableList
* Add comment
* Get rid of second page component
* Make table column resizable
* Add padding and min width for the empty state
* Optimize
* Extract ResizableColumn
* Toggle preview
* Add preview and field resizing
* Extract getTableMetadataQuery
* Preview positioning and shadow
* Show scrollbar on preview overflow
* Fix resizing bounds
* Remove redundant props
* Handle Escape key
* Add comment
* Update default constraints
* Make preview non-resizable
* Fix valid Escape press detection
* Fix types
* Add support for size="sm" in SegmentedControl
* Add field sorting interaction boilerplate
* Update FieldOrderPicker to use SegmentedControl
* Extract Label component
* Update tooltips
* Update sortable field
* Rename SortableField to SortableFieldItem
* Render field list
* Align styling
* Use rem, remove Link from SortableFieldItem
* Styling
* Use field prop
* Background styling
* Fix TS error
* Editable name and description
* Watch out for error
* Allow overriding default props in EditableText
* Fix a11y
* A11y
* Prevent overflow
* Styling
* Cleanup
* Update comment
* Fixes
* Update label and hide it in sorting mode
* Update spacing
* Avoid CLS when entering sorting mode
* Auto-grow table column when possible
* Auto-magic layout
* Fix sign
* Optimize
* Optimize
* Pixel-perfect
* Use ellipsis on overflow
* Fix colors
* Fix name input size
* Fix description patching
* Style selected state
* Do not use EditableText for description input, add resetOnEsc prop
* Use flushSync instead of setTimeout
* Try to prevent event propagation
* Fix interactivity in inputs
* Fix interactivity in inputs
* Move memoization closer to component definition
* SEM-327 Data model - Move the re-scan / discard options away from the bottom of the fields list (#59474)
* Format code
* Prevent updates when nothing changes
* Use new colors
* Make nav resizable
* Fix nav width
* Remove unused styles
* Prevent CLS in SortableList
* Add comment
* Get rid of second page component
* Make table column resizable
* Add padding and min width for the empty state
* Optimize
* Extract ResizableColumn
* Toggle preview
* Add preview and field resizing
* Extract getTableMetadataQuery
* Preview positioning and shadow
* Show scrollbar on preview overflow
* Fix resizing bounds
* Remove redundant props
* Handle Escape key
* Add comment
* Update default constraints
* Make preview non-resizable
* Fix valid Escape press detection
* Fix types
* Add support for size="sm" in SegmentedControl
* Add field sorting interaction boilerplate
* Update FieldOrderPicker to use SegmentedControl
* Extract Label component
* Update tooltips
* Update sortable field
* Rename SortableField to SortableFieldItem
* Render field list
* Align styling
* Use rem, remove Link from SortableFieldItem
* Styling
* Use field prop
* Background styling
* Fix TS error
* Editable name and description
* Watch out for error
* Allow overriding default props in EditableText
* Fix a11y
* A11y
* Prevent overflow
* Styling
* Cleanup
* Update comment
* Fixes
* Update label and hide it in sorting mode
* Update spacing
* Avoid CLS when entering sorting mode
* Auto-grow table column when possible
* Auto-magic layout
* Fix sign
* Optimize
* Optimize
* Pixel-perfect
* SyncOptionsModal
* Move
* Field values modal
* Responsiveness
* Use ellipsis on overflow
* Fix colors
* Fix name input size
* Fix description patching
* Style selected state
* Do not use EditableText for description input, add resetOnEsc prop
* Use flushSync instead of setTimeout
* Try to prevent event propagation
* Fix interactivity in inputs
* Fix interactivity in inputs
* Move memoization closer to component definition
* Tmp
* Revert "Tmp"
This reverts commit 6e561c0de7.
* SEM-424 Tests parity - datamodel.cy.spec.js (#59548)
* Format code
* Prevent updates when nothing changes
* Use new colors
* Make nav resizable
* Fix nav width
* Remove unused styles
* Prevent CLS in SortableList
* Add comment
* Get rid of second page component
* Make table column resizable
* Add padding and min width for the empty state
* Optimize
* Extract ResizableColumn
* Toggle preview
* Add preview and field resizing
* Extract getTableMetadataQuery
* Preview positioning and shadow
* Show scrollbar on preview overflow
* Fix resizing bounds
* Remove redundant props
* Handle Escape key
* Add comment
* Update default constraints
* Make preview non-resizable
* Fix valid Escape press detection
* Fix types
* Add support for size="sm" in SegmentedControl
* Add field sorting interaction boilerplate
* Update FieldOrderPicker to use SegmentedControl
* Extract Label component
* Update tooltips
* Update sortable field
* Rename SortableField to SortableFieldItem
* Render field list
* Align styling
* Use rem, remove Link from SortableFieldItem
* Styling
* Use field prop
* Background styling
* Fix TS error
* Editable name and description
* Watch out for error
* Allow overriding default props in EditableText
* Fix a11y
* A11y
* Prevent overflow
* Styling
* Cleanup
* Update comment
* Fixes
* Update label and hide it in sorting mode
* Update spacing
* Avoid CLS when entering sorting mode
* Auto-grow table column when possible
* Auto-magic layout
* Fix sign
* Optimize
* Optimize
* Pixel-perfect
* SyncOptionsModal
* Move
* Field values modal
* Responsiveness
* Use ellipsis on overflow
* Fix colors
* Fix name input size
* Fix description patching
* Style selected state
* Do not use EditableText for description input, add resetOnEsc prop
* Port test
* Fix typing
* Port test
* Port tests
* Format code, add data-testid
* Port more tests
* Refactor withDatabase to TypeScript
* Await
* Fix prop handling
* Port test
* Memoize textarea for performance
* Port test
* Port tests
* Remove unlawful getFieldDisplayName usages
* ESLint
* Add JSDoc
* Port tests
* Port tests
* Format code
* Use flushSync instead of setTimeout
* Try to prevent event propagation
* Fix interactivity in inputs
* Fix interactivity in inputs
* Move memoization closer to component definition
* Tmp
* Revert "Tmp"
This reverts commit 6e561c0de7.
* Fix circular dependency
* Post-merge fix
* SEM-425 Tests parity - editor.cy.spec.js (#59838)
* Add DataModel helpers
* Update test
* Add waits
* Use schemaId in test helper
* Port tests
* Fix ids
* Add more helpers
* Use helpers
* Auto-open coercion picker, humanize coercion picker labels
* Update test
* Fix typing
* Fix data fetching
* Update tests
* Refactor
* Update tests
* Update helpers
* Simplify assertion
* SEM-426 Tests parity - reproductions.cy.spec.ts (#59970)
* Add DataModel helpers
* Update test
* Add waits
* Use schemaId in test helper
* Port tests
* Fix ids
* Add more helpers
* Use helpers
* Auto-open coercion picker, humanize coercion picker labels
* Update test
* Fix typing
* Fix data fetching
* Update tests
* Refactor
* Update tests
* Update helpers
* Update reproductions.cy.spec.ts
* Fix test
* Simplify assertion
* SEM-427 Tests parity - remaining e2e suites (#59980)
* Add DataModel helpers
* Update test
* Add waits
* Use schemaId in test helper
* Port tests
* Fix ids
* Add more helpers
* Use helpers
* Auto-open coercion picker, humanize coercion picker labels
* Update test
* Fix typing
* Fix data fetching
* Update tests
* Refactor
* Update tests
* Update helpers
* Update reproductions.cy.spec.ts
* Fix test
* Update test
* Update test
* Update test
* Update tests
* Update test
* Update test
* Update test
* Update test
* Update tests
* Update tests
* Typo
* Update unit tests
* Remove encodeURIComponent
* Make it clear what is schemaName and schemaId
* Rename schemaId to schemaName in table picker
* Update unit tests
* Update unit tests
* Skip soon-to-be-ported unit tests
* Attempt to fix a test
* Update test
* Update unit test
* Update test
* Revert refetching
* Data model - Simple flex layout (#59995)
* Add DataModel helpers
* Update test
* Add waits
* Use schemaId in test helper
* Port tests
* Fix ids
* Add more helpers
* Use helpers
* Auto-open coercion picker, humanize coercion picker labels
* Update test
* Fix typing
* Fix data fetching
* Update tests
* Refactor
* Update tests
* Update helpers
* Update reproductions.cy.spec.ts
* Fix test
* Update test
* Update test
* Update test
* Update tests
* Update test
* Update test
* Update test
* Update test
* Update tests
* Update tests
* Typo
* Update unit tests
* Remove encodeURIComponent
* Make it clear what is schemaName and schemaId
* Rename schemaId to schemaName in table picker
* Update unit tests
* Update unit tests
* Skip soon-to-be-ported unit tests
* Attempt to fix a test
* Update test
* Update unit test
* Update test
* Revert refetching
* Try simple flex layout
* Update proportions
* Remove redundant elements
* Clean up
* Use ellipsis instead of wrapping
* Pixel perfect
* Tweak constants
* SEM-448 Tests parity - unit tests (#60042)
* Add DataModel helpers
* Update test
* Add waits
* Use schemaId in test helper
* Port tests
* Fix ids
* Add more helpers
* Use helpers
* Auto-open coercion picker, humanize coercion picker labels
* Update test
* Fix typing
* Fix data fetching
* Update tests
* Refactor
* Update tests
* Update helpers
* Update reproductions.cy.spec.ts
* Fix test
* Update test
* Update test
* Update test
* Update tests
* Update test
* Update test
* Update test
* Update test
* Update tests
* Update tests
* Typo
* Update unit tests
* Remove encodeURIComponent
* Make it clear what is schemaName and schemaId
* Rename schemaId to schemaName in table picker
* Update unit tests
* Update unit tests
* Skip soon-to-be-ported unit tests
* Attempt to fix a test
* Update test
* Update unit test
* Update test
* Revert refetching
* Try simple flex layout
* Update proportions
* Remove redundant elements
* Clean up
* Use ellipsis instead of wrapping
* Pixel perfect
* Tweak constants
* Add data model unit tests boilerplate
* Optimistically remove TODOs
* Use router
* Fix element rendering in tests
* Add tests + fixes
* Port tests
* Port a test, fix a util
* Port test
* Port tests
* Port tests
* Remove old tests
* Port tests
* Remove old tests
* Port tests
* Remove old tests
* Fix disabling tables in search results
* Fix flakes
* Update tests
* Remove redundant check
* SEM-434 Missing metadata in FieldDataSelector (#60262)
* Manually override tables prop and add missing properties to Field objects
- Fixes SEM-434
* Format code
* Use field.display_name
* Memoize tables
* SEM-462 Small tweaks (#60187)
* SEM-436 Make field description input auto-grow indefinitely
* SEM-438 Update icons for tables and fields
* SEM-439 Remove the first column with dashes from the field values preview
* SEM-441 Align color scheme for left navbar and right-side panes
* SEM-440 Have a loader for the Detail view preview
* SEM-437 Sorting mode tweaks
* SEM-446 Chips as section headers feel off
* SEM-445 Revisit the read-only version of field ID and DB name
* Make shadows exactly like in figma
* SEM-457 Top-align text with icon for tables with long names
* Remove redundant selector
* Pixel perfect padding
* Fix 'draggable' prop not kicking in
* Fix tests
* Fix flakes
* Update tests
* Add spinner when toggling table visibility and using predefined sorting order
* Fix events
* Use prop instead of CSS
* Revert "Use prop instead of CSS"
This reverts commit 74f76d1b99.
* Add comments
* SEM-460 Show prefix for JSON-unfolded columns (#60328)
* SEM-436 Make field description input auto-grow indefinitely
* SEM-438 Update icons for tables and fields
* SEM-439 Remove the first column with dashes from the field values preview
* SEM-441 Align color scheme for left navbar and right-side panes
* SEM-440 Have a loader for the Detail view preview
* SEM-437 Sorting mode tweaks
* SEM-446 Chips as section headers feel off
* SEM-445 Revisit the read-only version of field ID and DB name
* Make shadows exactly like in figma
* SEM-457 Top-align text with icon for tables with long names
* Remove redundant selector
* Pixel perfect padding
* Fix 'draggable' prop not kicking in
* Fix tests
* Fix flakes
* Update tests
* Add spinner when toggling table visibility and using predefined sorting order
* Show prefix in FieldItem
* Show prefix in SortableFieldItem
* Fix events
* Handle ellipsis
* Show prefix in NameDescriptionInput
* Update tests
* Update types
* Use prop instead of CSS
* Improve responsiveness
* Revert "Use prop instead of CSS"
This reverts commit 74f76d1b99.
* Add comments
* SEM-420 Organize e2e tests (#60379)
* SEM-436 Make field description input auto-grow indefinitely
* SEM-438 Update icons for tables and fields
* SEM-439 Remove the first column with dashes from the field values preview
* SEM-441 Align color scheme for left navbar and right-side panes
* SEM-440 Have a loader for the Detail view preview
* SEM-437 Sorting mode tweaks
* SEM-446 Chips as section headers feel off
* SEM-445 Revisit the read-only version of field ID and DB name
* Make shadows exactly like in figma
* SEM-457 Top-align text with icon for tables with long names
* Remove redundant selector
* Pixel perfect padding
* Fix 'draggable' prop not kicking in
* Fix tests
* Fix flakes
* Update tests
* Add spinner when toggling table visibility and using predefined sorting order
* Show prefix in FieldItem
* Show prefix in SortableFieldItem
* Fix events
* Handle ellipsis
* Show prefix in NameDescriptionInput
* Update tests
* Update types
* Use prop instead of CSS
* Improve responsiveness
* Revert "Use prop instead of CSS"
This reverts commit 74f76d1b99.
* Move segments to a separate spec
* Organize tests
* Add comments
* SEM-420 Organize e2e tests (part 2) (#60388)
* SEM-436 Make field description input auto-grow indefinitely
* SEM-438 Update icons for tables and fields
* SEM-439 Remove the first column with dashes from the field values preview
* SEM-441 Align color scheme for left navbar and right-side panes
* SEM-440 Have a loader for the Detail view preview
* SEM-437 Sorting mode tweaks
* SEM-446 Chips as section headers feel off
* SEM-445 Revisit the read-only version of field ID and DB name
* Make shadows exactly like in figma
* SEM-457 Top-align text with icon for tables with long names
* Remove redundant selector
* Pixel perfect padding
* Fix 'draggable' prop not kicking in
* Fix tests
* Fix flakes
* Update tests
* Add spinner when toggling table visibility and using predefined sorting order
* Show prefix in FieldItem
* Show prefix in SortableFieldItem
* Fix events
* Handle ellipsis
* Show prefix in NameDescriptionInput
* Update tests
* Update types
* Use prop instead of CSS
* Improve responsiveness
* Revert "Use prop instead of CSS"
This reverts commit 74f76d1b99.
* Move segments to a separate spec
* Organize tests
* Move tests
* Move tests
* Add comments
* Merge tests
* Move tests
* Use modern selectors
* Move tests
* Move tests
* Reorder tests
* SEM-420 Test new features (e2e) (#60439)
* Add new tests, simplify toasts, remove long prefix from utils
* Test toasts
* Reuse utils
* Add table picker test for no schemas
* Fix schemaless tables not shown in search
* Add sync options test
* Fix & test prefixes
* Add logs
* Format code
* Coercion strategy test
* Add tests for visibility
* Update assertions
* Add test for tooltips
* Field values tests
* Add tests for filtering
* Add preview assertion
* Refactor preview verification
* Fix showing 403 error in preview
* Add preview tests
* Add preview assertions
* Add preview assertions
* Add preview assertions
* Add preview tests
* Move modals and state handling, add tests for Esc key
* Update unit tests
* Use useDisclosure
* Add extra error status check
* Revert unnecessary changes in cross-version tests
* SEM-419 Increase test coverage (unit tests) (#60491)
* Add new tests, simplify toasts, remove long prefix from utils
* Test toasts
* Reuse utils
* Add table picker test for no schemas
* Fix schemaless tables not shown in search
* Add sync options test
* Fix & test prefixes
* Add logs
* Format code
* Coercion strategy test
* Add tests for visibility
* Update assertions
* Add test for tooltips
* Field values tests
* Add tests for filtering
* Add preview assertion
* Refactor preview verification
* Fix showing 403 error in preview
* Add preview tests
* Add preview assertions
* Add preview assertions
* Add preview assertions
* Add preview tests
* Move modals and state handling, add tests for Esc key
* Update unit tests
* Add FieldOrderPicker unit tests
* Add CurrencyPicker unit tests
* Add FkTargetPicker unit tests
* Add more tests
* Add SemanticTypeAndTargetPicker unit tests
* Remove redundant code
* Move RemappingPicker
* Use useDisclosure
* Add extra error status check
* SEM-247 Clean up old Table Metadata page code (#60557)
* Remove old metadata page
* Move humanizeCoercionStrategy
* Remove unused functions
* Fix SEM-484 (#60600)
* Add tests
* Center field error
* Do not navigate if there's an explicit param
* Show field error
* Fix schemas loading, add tests
* Revert unnecessary change
* Fix data fetching
* Improve comments
* Remove invalid test for schemas
* Optimize conditions
* When table is not found, show the empty state as if table was not selected yet
---------
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
* Use displayName for error
* Fix error position for node
* Move padding to cm-content to avoid whitespace above gutter
* Add border radius to editor to avoid overflowing container
* Fix displayname in unit test
* Fix type for position
* Add test for error position
* Add unit test for position helper
* Add warning_triangle_filled icon
* Use warning_triangle_filled icon for error toasts in buttons
* Show error toasts consistently
* Fix error handling in table preview
* Fix error handling in object detail preview
* Update message
* Add toasts for sorting
* Add test for errors
* Add missing tests
* Update test
* Add iconColor prop to Undo and use it instead of hardcoding color in warning_triangle_filled icon
* Ensure that we keep the selected table even when collapsing the tree
- Fixes SEM-435
* Update tests
* Always highlight selected table
* Use aria-selected
* Add validation for case/if clause types
* Add e2e repro for metabase#57674
* Avoid passing nil default into expressions
* Check for type compatibility, not equality
* Allow unknoen types
* Make e2e test more refined
* Fix e2e test
* Fix clj test
* Fix e2e test
* Handle set arguments to compatible?
* Fix docstring
* Use assignable? instead of most-common-ancestor
* Allow Date/DateTime/... to mix
* Use best-return-type to determine if all types are compatible
* Handle falsy default
* Add missing map
* Update comment to clarify compatibility omission
* Unwrap schema
* Add test for malformed case expressions
* Add type check to coalaesce too
* Add check to coalesce too
* Add tests for :default false
* Add tests for temporal types
* Move combination tests to BE test
* Use separate deftests for valid and invalid case and coalesce tests
* Fold repetitive parts into are expression
* Formatting of test
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
* Formatting of test
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
* Formatting of test
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
* Split up more tests
* Formatting in tests
---------
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
* Add option to use instance settings for number formatting
* Format row count in datagrid Footer with instance settings
* Format row count in datagrid Footer using instance settings
* Format row in question row count using instance settings
* Add unit test for number formatting with instance settings
* Fix unit tests
* Fix e2e tests
* Update Loki Snapshots
* Add useNumberFormatter hook
* Use useNumberFormatter hook
* Add test for useNumberFormatter
* Fix types
* Update Loki Snapshots
* Move useNumberFormatter to metase/common/hooks
* Add redux to DataGrid stories
* Add missing loki references
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
We check for query cycles when saving cards, but the checker only understands mbql queries. If we have a native query
that depends on another query, the cycle checker won't go through the native query to see if it is causing a cycle.
Now, the checker understands native queries and can find cycles involving them.
Co-authored-by: Alexander Polyankin <alexander.polyankin@metabase.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
* [Lib] Stop passing `:unique-name-fn` as an option
* Add extra test
* Fix column order
* Test fixes and PR feedback
* Fix output schema
* Test fixes!!!
* Test fix?? 🔧
* Fix file order
* Test fix
* Revert accidental e2e changes
* typo
* infer only one column per table to be entity name
* tests
* fix: test
* note
* fix: don't lose other classification results!
* regr test
* use count
* more tests
* fix: only consider active fields!
* also consider visibility_type
* perf: select only if needed
* style: reduce without atom
* style: cleaner
* SEM-239 Data model - Layout boilerplate (#57174)
* Add route and link
* Convert DataModelApp to TypeScript
* Use DataModelApp in DataModel
* Keep all routes
* Extract section components
* Add empty states
* Use ts-pattern
* Drop ts-pattern
* Disable preview
* Rename
* Add border
* Move page components to their own dirs
* SEM-240 Data model - Table section (#57248)
* Add route and link
* Convert DataModelApp to TypeScript
* Use DataModelApp in DataModel
* Keep all routes
* Extract section components
* Add empty states
* Use ts-pattern
* Drop ts-pattern
* Disable preview
* Rename
* Add border
* Move page components to their own dirs
* Add table fetching
* Add NameDescriptionInput boilerplate
* Update table on blur
* Fix focus state and prevent empty names
* Add Hide this table switch
- Label from https://www.loom.com/share/45ce00aaac3f4141adf3f52dec79048f?highlightComment=80327135&t=271
* Style the Switch
* Move FieldOrderPicker
* Move SortableField
* Move NameDescriptionInput
* Make NameDescriptionInput more generic
* Use FieldOrderPicker
* Rename
* Move label into TableVisibilityInput
* Add missing return
* Add FieldOrder
* Get rid of entity framework workarounds
* Add TODO comment
* Make header sticky
* Sort
* Add field scanning section
* Discard + rescan
* Remove todo
* Remove TableVisibilityInput
* Rename FieldOrder to SortableFieldList and move it to metadata/components
* Implement getFieldIcon boilerplate
* Do not use metabase-lib/v1
* Extract tableFieldToColumnMetadata
* Fix focus state being cut off
* Extract RescanFieldsButton, add error and success states
* Extract DiscardFieldValuesButton
* Rename
* Move to metadata/components
* Style name/description input
* Add missing ttag
* Add NameDescriptionInput tests
* Add more tests
* Organize tests
* Add tests
* Add DiscardTableFieldValuesButton tests
* Add test
* Add RescanTableFieldsButton tests
* Lint colors
* Add tests for getItems
* Add tests for getFieldIcon
* Update comment
* Update test names
* Add missing effect
* Add missing effect
* Fix flaky unit tests
* Remove getFieldIcon
* Extract TextInputBlurChange
* Update comment
* SEM-241 Data model - Field - Data section (#57420)
* Add route and link
* Convert DataModelApp to TypeScript
* Use DataModelApp in DataModel
* Keep all routes
* Extract section components
* Add empty states
* Use ts-pattern
* Drop ts-pattern
* Disable preview
* Rename
* Add border
* Move page components to their own dirs
* Add table fetching
* Add NameDescriptionInput boilerplate
* Update table on blur
* Fix focus state and prevent empty names
* Add Hide this table switch
- Label from https://www.loom.com/share/45ce00aaac3f4141adf3f52dec79048f?highlightComment=80327135&t=271
* Style the Switch
* Move FieldOrderPicker
* Move SortableField
* Move NameDescriptionInput
* Make NameDescriptionInput more generic
* Use FieldOrderPicker
* Rename
* Move label into TableVisibilityInput
* Add missing return
* Add FieldOrder
* Get rid of entity framework workarounds
* Add TODO comment
* Make header sticky
* Sort
* Add field scanning section
* Discard + rescan
* Remove todo
* Remove TableVisibilityInput
* Rename FieldOrder to SortableFieldList and move it to metadata/components
* Implement getFieldIcon boilerplate
* Do not use metabase-lib/v1
* Extract tableFieldToColumnMetadata
* Fix focus state being cut off
* Extract RescanFieldsButton, add error and success states
* Extract DiscardFieldValuesButton
* Rename
* Move to metadata/components
* Style name/description input
* Add missing ttag
* Add NameDescriptionInput tests
* Add more tests
* Organize tests
* Add tests
* Add DiscardTableFieldValuesButton tests
* Add test
* Add RescanTableFieldsButton tests
* Lint colors
* Add tests for getItems
* Add tests for getFieldIcon
* Update comment
* Update test names
* Add missing effect
* Add missing effect
* Navigation onClick
* Fix flaky unit tests
* Use a link
* Explain cast
* Improve url generation
* Style active link
* Load field, display name
* Sticky header
* Add SectionPill
* Add field name and data type
* Add cast toggle
* Add CoercionStrategyPicker
* Remove getFieldIcon
* Extract TextInputBlurChange
* Update comment
* Casting toggle state sync
* CoercionStrategyPicker error state
* Extract FieldDataSection
* Reuse existing TextInputBlurChange
* Further cleanup
* Use key for FieldSection
* Lift data fetching
* Add decoration
* Use key for table as well
* Add unit tests
* Add unit tests
* Add unit tests
* Add comments
* Simplify color
* Use type instead of interface
* SEM-297 Drop entity framework usage in `SemanticTypePicker` (#57531)
* Add route and link
* Convert DataModelApp to TypeScript
* Use DataModelApp in DataModel
* Keep all routes
* Extract section components
* Add empty states
* Use ts-pattern
* Drop ts-pattern
* Disable preview
* Rename
* Add border
* Move page components to their own dirs
* Add table fetching
* Add NameDescriptionInput boilerplate
* Update table on blur
* Fix focus state and prevent empty names
* Add Hide this table switch
- Label from https://www.loom.com/share/45ce00aaac3f4141adf3f52dec79048f?highlightComment=80327135&t=271
* Style the Switch
* Move FieldOrderPicker
* Move SortableField
* Move NameDescriptionInput
* Make NameDescriptionInput more generic
* Use FieldOrderPicker
* Rename
* Move label into TableVisibilityInput
* Add missing return
* Add FieldOrder
* Get rid of entity framework workarounds
* Add TODO comment
* Make header sticky
* Sort
* Add field scanning section
* Discard + rescan
* Remove todo
* Remove TableVisibilityInput
* Rename FieldOrder to SortableFieldList and move it to metadata/components
* Implement getFieldIcon boilerplate
* Do not use metabase-lib/v1
* Extract tableFieldToColumnMetadata
* Fix focus state being cut off
* Extract RescanFieldsButton, add error and success states
* Extract DiscardFieldValuesButton
* Rename
* Move to metadata/components
* Style name/description input
* Add missing ttag
* Add NameDescriptionInput tests
* Add more tests
* Organize tests
* Add tests
* Add DiscardTableFieldValuesButton tests
* Add test
* Add RescanTableFieldsButton tests
* Lint colors
* Add tests for getItems
* Add tests for getFieldIcon
* Update comment
* Update test names
* Add missing effect
* Add missing effect
* Navigation onClick
* Fix flaky unit tests
* Use a link
* Explain cast
* Improve url generation
* Style active link
* Load field, display name
* Sticky header
* Add SectionPill
* Add field name and data type
* Add cast toggle
* Add CoercionStrategyPicker
* Remove getFieldIcon
* Extract TextInputBlurChange
* Update comment
* Casting toggle state sync
* CoercionStrategyPicker error state
* Extract FieldDataSection
* Reuse existing TextInputBlurChange
* Further cleanup
* Use key for FieldSection
* Lift data fetching
* Add decoration
* Use key for table as well
* Add unit tests
* Add unit tests
* Add unit tests
* Add comments
* Drop entity framework in FkTargetPicker
* Make table names show up
* Clean up
* Fix types
* Fix table names
* Add tests
* Add tests
* Add tests
* Restrict imports
* Improve config
* Restrict entity framework imports
* Simplify color
* Use type instead of interface
* Lint
* SEM-267 Data model - Field - Metadata section (#57527)
* Add route and link
* Convert DataModelApp to TypeScript
* Use DataModelApp in DataModel
* Keep all routes
* Extract section components
* Add empty states
* Use ts-pattern
* Drop ts-pattern
* Disable preview
* Rename
* Add border
* Move page components to their own dirs
* Add table fetching
* Add NameDescriptionInput boilerplate
* Update table on blur
* Fix focus state and prevent empty names
* Add Hide this table switch
- Label from https://www.loom.com/share/45ce00aaac3f4141adf3f52dec79048f?highlightComment=80327135&t=271
* Style the Switch
* Move FieldOrderPicker
* Move SortableField
* Move NameDescriptionInput
* Make NameDescriptionInput more generic
* Use FieldOrderPicker
* Rename
* Move label into TableVisibilityInput
* Add missing return
* Add FieldOrder
* Get rid of entity framework workarounds
* Add TODO comment
* Make header sticky
* Sort
* Add field scanning section
* Discard + rescan
* Remove todo
* Remove TableVisibilityInput
* Rename FieldOrder to SortableFieldList and move it to metadata/components
* Implement getFieldIcon boilerplate
* Do not use metabase-lib/v1
* Extract tableFieldToColumnMetadata
* Fix focus state being cut off
* Extract RescanFieldsButton, add error and success states
* Extract DiscardFieldValuesButton
* Rename
* Move to metadata/components
* Style name/description input
* Add missing ttag
* Add NameDescriptionInput tests
* Add more tests
* Organize tests
* Add tests
* Add DiscardTableFieldValuesButton tests
* Add test
* Add RescanTableFieldsButton tests
* Lint colors
* Add tests for getItems
* Add tests for getFieldIcon
* Update comment
* Update test names
* Add missing effect
* Add missing effect
* Navigation onClick
* Fix flaky unit tests
* Use a link
* Explain cast
* Improve url generation
* Style active link
* Load field, display name
* Sticky header
* Add SectionPill
* Add field name and data type
* Add cast toggle
* Add CoercionStrategyPicker
* Remove getFieldIcon
* Extract TextInputBlurChange
* Update comment
* Casting toggle state sync
* CoercionStrategyPicker error state
* Extract FieldDataSection
* Reuse existing TextInputBlurChange
* Further cleanup
* Use key for FieldSection
* Lift data fetching
* Add decoration
* Use key for table as well
* Add unit tests
* Add unit tests
* Add unit tests
* Add comments
* Add Metadata section with display name input
* Pass table through components
* Drop entity framework in FkTargetPicker
* Revert "Pass table through components"
This reverts commit 2eb3e3a256.
* Make table names show up
* Clean up
* Fix types
* Fix table names
* Add tests
* Add tests
* Add tests
* Restrict imports
* Improve config
* Restrict entity framework imports
* Simplify color
* Use type instead of interface
* Use SemanticTypeAndTargetPicker in FieldSection
* Sort
* Lint
* Typing
* Do not use v1/metadata wrapper
* Add TextareaBlurChange
* Add description input
* Update comments
* Update icon
* Add plugin query props
* Remove redundant prop
* Remove redundant _.omit
* Fix textarea crashing due to min height on input
* Set minRows
* Fix styling
* Remove PLUGIN_FEATURE_LEVEL_PERMISSIONS plugin usage from DatasetFieldMetadataFkTargetPicker
- because that's not how it works in master
* Drop -v2 suffix for new routes, use -v1 suffix for old routes (#57637)
* SEM-242 Data model - Field - Behavior section (#57638)
* Drop -v2 suffix for new routes, use -v1 suffix for old routes
* Move FieldVisibilityPicker
* Make FieldVisibilityPicker work with api Field
* Use FieldVisibilityType
* Fix gap
* Update tests
* Add label and description
* Add FieldValuesTypePicker
* Add canUnfoldJson and hasDatabaseFeature
* Rename
* Add UnfoldJsonPicker
* Fix typing
* Add RescanFieldButton
* Add DiscardFieldValuesButton
* Style the connector
* Fix scrolling
* Update spacing
* Add tests for FieldValuesTypePicker
* Add tests
* Add UnfoldJsonPicker tests
* Add tests
* Add tests
* Clean up timeouts on unmount
* Improve typing
* SEM-269 Data model - Field - Formatting section (#57682)
* Drop -v2 suffix for new routes, use -v1 suffix for old routes
* Move FieldVisibilityPicker
* Make FieldVisibilityPicker work with api Field
* Use FieldVisibilityType
* Fix gap
* Update tests
* Add label and description
* Add FieldValuesTypePicker
* Add canUnfoldJson and hasDatabaseFeature
* Rename
* Add UnfoldJsonPicker
* Fix typing
* Add RescanFieldButton
* Add DiscardFieldValuesButton
* Style the connector
* Fix scrolling
* Update spacing
* Add tests for FieldValuesTypePicker
* Add tests
* Add UnfoldJsonPicker tests
* Add tests
* Add tests
* Add FormattingSection
* Sort
* Make formatting form full width
* Use style prop instead of maxWidth
* Clean up timeouts on unmount
* Improve typing
* Metadata preview boilerplate (#58015)
* Render preview
* Add preview type selector
* Fix flex layout
* Lift preview type to top component to keep the state
* Move helpers to utils
* Add unit tests for preview picker
* Add feedback to metadata editor when saving config (#58038)
* Add feedback to all table and field settings
* Add missing prop
* Metadata table and detail preview (#57887)
* Handle undefined metadata
* Render Table preview
* Add custom error component
* Add helper for error message
* Add detail preview
* Make comment more clear
* Fix type
* Fix missing props
* Metadata table picker (#57648)
* Set up TablePicker component
* Fix type in api
* Add initial TablePicker implementation
* Add schema icon
* Update url for datapicker
* Move data loading to utils
* Add loading node types
* Derive icon from type
* Try building the treepicker state asynchronously
* Build custom tree
* Add loading state
* Push url state in picker
* Sync open state with url
* Use helper to manage expanded state
* Split Node into separate file
* Expose prefetch hook
* Prefetch data to avoid showing loading states
* Add search to table picker
* Move search-related stuff into Search module
* Use Link for navigation
* Add renderLoading helper
* Remove unused prop
* Make search input sticky
* Add separate sidebar for field picker
* Render single schema but open it by default
* Translate errors
* Defer search value
* Export lazy loaders for database info
* Use top-level data fetching
* Enable virtualization
* Move loader utils into utils
* Remove Node implementation
* Simplify styles
* Pull out some logic
* Reuse results in search
* Reuse tree helpers when handling search results
* Avoid passing down isExpanded
* Memoize
* Fix initial expanded state
* Automatically expand single-schema databases
* Pass tableId to DataPicker
* Add styling for active item
* Add getUrl helper for tree nodes
* Move types to separate file
* Simplify item
* Rename Item to Results
* Simplify
* Allow wrapping everywhere
* Add loading state
* Render tracks
* Remove unused colors
* Scroll active item into view
* Fix paths
* Add missing keys
* Handle browser navigation in table picker
* Handle browser navigation in table picker
* Add more documentation
* Debounce search
* Render track even when no parent was found
* Allow rendering urls to schema's with no name
* Add value to loading nodes
* Add delay to track too
* Add explicit level to FlatItem
* Add explicit parent refence to FlatItem
* Hide nameless schemas in the tree
* Refactor
* Move key to top-level item
* Make TablePicker not depend on router
* Disable smooth scroll
* Add unit tests for TablePicker
* Unnest unnamed schemas directly
* Also fetch tables when only one schema exists
* Remeasure items when they change
* Use more precise typeing for items
* Allow clicking table nodes in search results
* Remove unused classes
* Remove unused useDispatch hook
* Remove delay on loading items
* Add custom empty state
* Typo
* Add keyboard navigation to table picker
* Use test helpers in all tests
* Add keyboard navigation to search results too
* Add custom focus state for search items
* Add unit tests for search
* Jump to parent when pressing left arrow
* Add more cases to keyboard test
* Add hover state to table picker
* Use table display name in table picker
* Flatten single schema in to database
* Rename onChange_ to handleChange
* Use folder for schema
* Make the hover and active colors the same
* Rename Data tab to Data Model
* Remove title
* Fix layout
* Field description editor (#58280)
* Use NameDescriptionInput for the field section too
* Use TextArea for description editor
* Post-merge fixes
* Metadata editing UI tweaks (#58297)
* Add background to fields
* Tweak colors for disabled inputs
* Remove icons in SectionPill
* Remove icon from one more SectionPill
* Remove lint
* Move segments to table picker (#58422)
* Add link to segments in the datamodel sidebar
* Add local state to RouterTablePicker
* Nest segments under DataModel
* Add wrapper classes to revision routes
* Fix spacing for empty state
* Add active state to segments link
* Remove DataModelApp in DataModel routes
* Fix overflow in segment form
* Merge translation strings
* Add background color to segments components
* SEM-363 Data model - Field and table name/description inputs should be sticky and have icons (#58703)
* Remove hover/focus effect and break components down into files
* Update comment
* Consolidate toasts
* Remove unused styles
* Remove redundant card
* Extract SegmentsLink
* Make name/description input sticky
* Add icons
* Remove leftovers
* Fix TS error
* Move visibility toggles to the table picker (#58284)
* Fetch hidden tables
* Fetch hidden schemas
* Add visibility toggles to the table picker
* Remove table visibility toggle in table section
* Simplify visibility toggler
* Move visibility toggle to separate file
* Add unit tests for visibility toggle
* Show table as hidden whenever there is any visibility
* Use ActionIcon
* Break up onClick handler
* Use plan Icon
* Remove data from nodes that don't need it
* Add tooltips to table visibility togglers
* Wrap icons in ActionIcon
---------
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
* Cleanup
* SEM-361 Data model - Field metadata/formatting settings do not affect the preview (#58841)
* Fix SEM-361
* Fix types
* SEM-311 Table preview - no impact when changing time formatting for seconds and ms (#58927)
* Avoid using a breakout for date-time columns
* Use the same logic for every type of field
* SEM-246 Data model - Filtering preview (#58854)
* Fix SEM-361
* Fix types
* Add FilteringPreview boilerplate
* Use FilterPickerBody
* Another attempt
* Make it work for all types of filters
* Memoize query
* Clear filter input on field change
* Account for prop changes
* Fix TS error
* SEM-268 Data model - Field - Behavior section - Display values (#57684)
* Drop -v2 suffix for new routes, use -v1 suffix for old routes
* Move FieldVisibilityPicker
* Make FieldVisibilityPicker work with api Field
* Use FieldVisibilityType
* Fix gap
* Update tests
* Add label and description
* Add FieldValuesTypePicker
* Add canUnfoldJson and hasDatabaseFeature
* Rename
* Add UnfoldJsonPicker
* Fix typing
* Add RescanFieldButton
* Add DiscardFieldValuesButton
* Style the connector
* Fix scrolling
* Update spacing
* Add tests for FieldValuesTypePicker
* Add tests
* Add UnfoldJsonPicker tests
* Add tests
* Add tests
* Add placeholder
* Add RemappingPicker boilerplate
* Clean up timeouts on unmount
* Improve typing
* Add onChange logic boilerplate
* Extract DisplayValuesPicker
* Remove redundant code
* Format code
* Add fk input boilerplate
* Disable options instead of hiding them
* Rename
* Fetch required data
* Use full data
* Implement fk remapping onChange
* Implement naming tip
* Fix state
* Extract utils
* Fix schema step errors
* Add remappings boilerplate
* Fetch remappings
* Add more modal boilerplate
* Add modal props
* Handle modal state
* Add explicit edit button
* Implement modal form
* Limit amount of Boxes
* Bring all safety checks back in
* Refactor CustomMappingModal
* Style CustomMappingModal
* Extract getHasEmptyValues
* Remove todo
* Prevent flicker
* Fix initial state of fk picker
* Use is touched
* Add CustomMappingModal unit tests
* Add DisplayValuesPicker unit tests
* Move DisplayValuesPicker
* Remove redundant tags
* Fix uncontrolled/controller input react warning
* Add explanatory tooltips for disabled options
* Fix 1px of background leaking into view
* Add missing memoization
* Reset state when cancelling
* Sync single table via UI (#58342)
* add table-manual-sync event
* add table/sync_schema endpoint
* add table sync test
* Add api helper for the sync table schema endpoint
* Add SyncTableSchemaButton component
* Add SyncTableSchemaButton to table section
* Add unit tests for SyncTableSchemaButton
* Also invalidate field-values and parameter-values
* Simplify SyncTableSchemaButton hooks
* Move useTemporaryState into a separate hook
* Apply same pattern in all buttons
* address PR review comments: use `get-database`, `with-database-routing-off`
* Pass argument to useTemporaryState
* update test
---------
Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
* Fix SEM-370 (#59051)
* Post-merge conflict fix
* SEM-329 Data model - Table section - Update fields sorting interaction (#59316)
* Add support for size="sm" in SegmentedControl
* Add field sorting interaction boilerplate
* Update FieldOrderPicker to use SegmentedControl
* Extract Label component
* Update tooltips
* Update sortable field
* Rename SortableField to SortableFieldItem
* Render field list
* Align styling
* Use rem, remove Link from SortableFieldItem
* Styling
* Use field prop
* Background styling
* Fix TS error
* Editable name and description
* Watch out for error
* Allow overriding default props in EditableText
* Fix a11y
* A11y
* Prevent overflow
* Styling
* Cleanup
* Update comment
* Fixes
* Update label and hide it in sorting mode
* Update spacing
* Avoid CLS when entering sorting mode
* Pixel-perfect
* Use ellipsis on overflow
* Fix colors
* Fix name input size
* Fix description patching
* Style selected state
* Do not use EditableText for description input, add resetOnEsc prop
* Use flushSync instead of setTimeout
* Try to prevent event propagation
* Fix interactivity in inputs
* SEM-376 Data model - Resizable columns layout (#59100)
* Format code
* Prevent updates when nothing changes
* Use new colors
* Make nav resizable
* Fix nav width
* Remove unused styles
* Prevent CLS in SortableList
* Add comment
* Get rid of second page component
* Make table column resizable
* Add padding and min width for the empty state
* Optimize
* Extract ResizableColumn
* Toggle preview
* Add preview and field resizing
* Extract getTableMetadataQuery
* Preview positioning and shadow
* Show scrollbar on preview overflow
* Fix resizing bounds
* Remove redundant props
* Handle Escape key
* Add comment
* Update default constraints
* Make preview non-resizable
* Fix valid Escape press detection
* Fix types
* Add support for size="sm" in SegmentedControl
* Add field sorting interaction boilerplate
* Update FieldOrderPicker to use SegmentedControl
* Extract Label component
* Update tooltips
* Update sortable field
* Rename SortableField to SortableFieldItem
* Render field list
* Align styling
* Use rem, remove Link from SortableFieldItem
* Styling
* Use field prop
* Background styling
* Fix TS error
* Editable name and description
* Watch out for error
* Allow overriding default props in EditableText
* Fix a11y
* A11y
* Prevent overflow
* Styling
* Cleanup
* Update comment
* Fixes
* Update label and hide it in sorting mode
* Update spacing
* Avoid CLS when entering sorting mode
* Auto-grow table column when possible
* Auto-magic layout
* Fix sign
* Optimize
* Optimize
* Pixel-perfect
* Use ellipsis on overflow
* Fix colors
* Fix name input size
* Fix description patching
* Style selected state
* Do not use EditableText for description input, add resetOnEsc prop
* Use flushSync instead of setTimeout
* Try to prevent event propagation
* Fix interactivity in inputs
* Fix interactivity in inputs
* Move memoization closer to component definition
* SEM-327 Data model - Move the re-scan / discard options away from the bottom of the fields list (#59474)
* Format code
* Prevent updates when nothing changes
* Use new colors
* Make nav resizable
* Fix nav width
* Remove unused styles
* Prevent CLS in SortableList
* Add comment
* Get rid of second page component
* Make table column resizable
* Add padding and min width for the empty state
* Optimize
* Extract ResizableColumn
* Toggle preview
* Add preview and field resizing
* Extract getTableMetadataQuery
* Preview positioning and shadow
* Show scrollbar on preview overflow
* Fix resizing bounds
* Remove redundant props
* Handle Escape key
* Add comment
* Update default constraints
* Make preview non-resizable
* Fix valid Escape press detection
* Fix types
* Add support for size="sm" in SegmentedControl
* Add field sorting interaction boilerplate
* Update FieldOrderPicker to use SegmentedControl
* Extract Label component
* Update tooltips
* Update sortable field
* Rename SortableField to SortableFieldItem
* Render field list
* Align styling
* Use rem, remove Link from SortableFieldItem
* Styling
* Use field prop
* Background styling
* Fix TS error
* Editable name and description
* Watch out for error
* Allow overriding default props in EditableText
* Fix a11y
* A11y
* Prevent overflow
* Styling
* Cleanup
* Update comment
* Fixes
* Update label and hide it in sorting mode
* Update spacing
* Avoid CLS when entering sorting mode
* Auto-grow table column when possible
* Auto-magic layout
* Fix sign
* Optimize
* Optimize
* Pixel-perfect
* SyncOptionsModal
* Move
* Field values modal
* Responsiveness
* Use ellipsis on overflow
* Fix colors
* Fix name input size
* Fix description patching
* Style selected state
* Do not use EditableText for description input, add resetOnEsc prop
* Use flushSync instead of setTimeout
* Try to prevent event propagation
* Fix interactivity in inputs
* Fix interactivity in inputs
* Move memoization closer to component definition
* Tmp
* Revert "Tmp"
This reverts commit 6e561c0de7.
* SEM-424 Tests parity - datamodel.cy.spec.js (#59548)
* Format code
* Prevent updates when nothing changes
* Use new colors
* Make nav resizable
* Fix nav width
* Remove unused styles
* Prevent CLS in SortableList
* Add comment
* Get rid of second page component
* Make table column resizable
* Add padding and min width for the empty state
* Optimize
* Extract ResizableColumn
* Toggle preview
* Add preview and field resizing
* Extract getTableMetadataQuery
* Preview positioning and shadow
* Show scrollbar on preview overflow
* Fix resizing bounds
* Remove redundant props
* Handle Escape key
* Add comment
* Update default constraints
* Make preview non-resizable
* Fix valid Escape press detection
* Fix types
* Add support for size="sm" in SegmentedControl
* Add field sorting interaction boilerplate
* Update FieldOrderPicker to use SegmentedControl
* Extract Label component
* Update tooltips
* Update sortable field
* Rename SortableField to SortableFieldItem
* Render field list
* Align styling
* Use rem, remove Link from SortableFieldItem
* Styling
* Use field prop
* Background styling
* Fix TS error
* Editable name and description
* Watch out for error
* Allow overriding default props in EditableText
* Fix a11y
* A11y
* Prevent overflow
* Styling
* Cleanup
* Update comment
* Fixes
* Update label and hide it in sorting mode
* Update spacing
* Avoid CLS when entering sorting mode
* Auto-grow table column when possible
* Auto-magic layout
* Fix sign
* Optimize
* Optimize
* Pixel-perfect
* SyncOptionsModal
* Move
* Field values modal
* Responsiveness
* Use ellipsis on overflow
* Fix colors
* Fix name input size
* Fix description patching
* Style selected state
* Do not use EditableText for description input, add resetOnEsc prop
* Port test
* Fix typing
* Port test
* Port tests
* Format code, add data-testid
* Port more tests
* Refactor withDatabase to TypeScript
* Await
* Fix prop handling
* Port test
* Memoize textarea for performance
* Port test
* Port tests
* Remove unlawful getFieldDisplayName usages
* ESLint
* Add JSDoc
* Port tests
* Port tests
* Format code
* Use flushSync instead of setTimeout
* Try to prevent event propagation
* Fix interactivity in inputs
* Fix interactivity in inputs
* Move memoization closer to component definition
* Tmp
* Revert "Tmp"
This reverts commit 6e561c0de7.
* Fix circular dependency
* Post-merge fix
* SEM-425 Tests parity - editor.cy.spec.js (#59838)
* Add DataModel helpers
* Update test
* Add waits
* Use schemaId in test helper
* Port tests
* Fix ids
* Add more helpers
* Use helpers
* Auto-open coercion picker, humanize coercion picker labels
* Update test
* Fix typing
* Fix data fetching
* Update tests
* Refactor
* Update tests
* Update helpers
* Simplify assertion
* SEM-426 Tests parity - reproductions.cy.spec.ts (#59970)
* Add DataModel helpers
* Update test
* Add waits
* Use schemaId in test helper
* Port tests
* Fix ids
* Add more helpers
* Use helpers
* Auto-open coercion picker, humanize coercion picker labels
* Update test
* Fix typing
* Fix data fetching
* Update tests
* Refactor
* Update tests
* Update helpers
* Update reproductions.cy.spec.ts
* Fix test
* Simplify assertion
* SEM-427 Tests parity - remaining e2e suites (#59980)
* Add DataModel helpers
* Update test
* Add waits
* Use schemaId in test helper
* Port tests
* Fix ids
* Add more helpers
* Use helpers
* Auto-open coercion picker, humanize coercion picker labels
* Update test
* Fix typing
* Fix data fetching
* Update tests
* Refactor
* Update tests
* Update helpers
* Update reproductions.cy.spec.ts
* Fix test
* Update test
* Update test
* Update test
* Update tests
* Update test
* Update test
* Update test
* Update test
* Update tests
* Update tests
* Typo
* Update unit tests
* Remove encodeURIComponent
* Make it clear what is schemaName and schemaId
* Rename schemaId to schemaName in table picker
* Update unit tests
* Update unit tests
* Skip soon-to-be-ported unit tests
* Attempt to fix a test
* Update test
* Update unit test
* Update test
* Revert refetching
* Data model - Simple flex layout (#59995)
* Add DataModel helpers
* Update test
* Add waits
* Use schemaId in test helper
* Port tests
* Fix ids
* Add more helpers
* Use helpers
* Auto-open coercion picker, humanize coercion picker labels
* Update test
* Fix typing
* Fix data fetching
* Update tests
* Refactor
* Update tests
* Update helpers
* Update reproductions.cy.spec.ts
* Fix test
* Update test
* Update test
* Update test
* Update tests
* Update test
* Update test
* Update test
* Update test
* Update tests
* Update tests
* Typo
* Update unit tests
* Remove encodeURIComponent
* Make it clear what is schemaName and schemaId
* Rename schemaId to schemaName in table picker
* Update unit tests
* Update unit tests
* Skip soon-to-be-ported unit tests
* Attempt to fix a test
* Update test
* Update unit test
* Update test
* Revert refetching
* Try simple flex layout
* Update proportions
* Remove redundant elements
* Clean up
* Use ellipsis instead of wrapping
* Pixel perfect
* Tweak constants
* SEM-448 Tests parity - unit tests (#60042)
* Add DataModel helpers
* Update test
* Add waits
* Use schemaId in test helper
* Port tests
* Fix ids
* Add more helpers
* Use helpers
* Auto-open coercion picker, humanize coercion picker labels
* Update test
* Fix typing
* Fix data fetching
* Update tests
* Refactor
* Update tests
* Update helpers
* Update reproductions.cy.spec.ts
* Fix test
* Update test
* Update test
* Update test
* Update tests
* Update test
* Update test
* Update test
* Update test
* Update tests
* Update tests
* Typo
* Update unit tests
* Remove encodeURIComponent
* Make it clear what is schemaName and schemaId
* Rename schemaId to schemaName in table picker
* Update unit tests
* Update unit tests
* Skip soon-to-be-ported unit tests
* Attempt to fix a test
* Update test
* Update unit test
* Update test
* Revert refetching
* Try simple flex layout
* Update proportions
* Remove redundant elements
* Clean up
* Use ellipsis instead of wrapping
* Pixel perfect
* Tweak constants
* Add data model unit tests boilerplate
* Optimistically remove TODOs
* Use router
* Fix element rendering in tests
* Add tests + fixes
* Port tests
* Port a test, fix a util
* Port test
* Port tests
* Port tests
* Remove old tests
* Port tests
* Remove old tests
* Port tests
* Remove old tests
* Fix disabling tables in search results
* Fix flakes
* Update tests
* Remove redundant check
* SEM-434 Missing metadata in FieldDataSelector (#60262)
* Manually override tables prop and add missing properties to Field objects
- Fixes SEM-434
* Format code
* Use field.display_name
* Memoize tables
* SEM-462 Small tweaks (#60187)
* SEM-436 Make field description input auto-grow indefinitely
* SEM-438 Update icons for tables and fields
* SEM-439 Remove the first column with dashes from the field values preview
* SEM-441 Align color scheme for left navbar and right-side panes
* SEM-440 Have a loader for the Detail view preview
* SEM-437 Sorting mode tweaks
* SEM-446 Chips as section headers feel off
* SEM-445 Revisit the read-only version of field ID and DB name
* Make shadows exactly like in figma
* SEM-457 Top-align text with icon for tables with long names
* Remove redundant selector
* Pixel perfect padding
* Fix 'draggable' prop not kicking in
* Fix tests
* Fix flakes
* Update tests
* Add spinner when toggling table visibility and using predefined sorting order
* Fix events
* Use prop instead of CSS
* Revert "Use prop instead of CSS"
This reverts commit 74f76d1b99.
* Add comments
* SEM-460 Show prefix for JSON-unfolded columns (#60328)
* SEM-436 Make field description input auto-grow indefinitely
* SEM-438 Update icons for tables and fields
* SEM-439 Remove the first column with dashes from the field values preview
* SEM-441 Align color scheme for left navbar and right-side panes
* SEM-440 Have a loader for the Detail view preview
* SEM-437 Sorting mode tweaks
* SEM-446 Chips as section headers feel off
* SEM-445 Revisit the read-only version of field ID and DB name
* Make shadows exactly like in figma
* SEM-457 Top-align text with icon for tables with long names
* Remove redundant selector
* Pixel perfect padding
* Fix 'draggable' prop not kicking in
* Fix tests
* Fix flakes
* Update tests
* Add spinner when toggling table visibility and using predefined sorting order
* Show prefix in FieldItem
* Show prefix in SortableFieldItem
* Fix events
* Handle ellipsis
* Show prefix in NameDescriptionInput
* Update tests
* Update types
* Use prop instead of CSS
* Improve responsiveness
* Revert "Use prop instead of CSS"
This reverts commit 74f76d1b99.
* Add comments
* SEM-420 Organize e2e tests (#60379)
* SEM-436 Make field description input auto-grow indefinitely
* SEM-438 Update icons for tables and fields
* SEM-439 Remove the first column with dashes from the field values preview
* SEM-441 Align color scheme for left navbar and right-side panes
* SEM-440 Have a loader for the Detail view preview
* SEM-437 Sorting mode tweaks
* SEM-446 Chips as section headers feel off
* SEM-445 Revisit the read-only version of field ID and DB name
* Make shadows exactly like in figma
* SEM-457 Top-align text with icon for tables with long names
* Remove redundant selector
* Pixel perfect padding
* Fix 'draggable' prop not kicking in
* Fix tests
* Fix flakes
* Update tests
* Add spinner when toggling table visibility and using predefined sorting order
* Show prefix in FieldItem
* Show prefix in SortableFieldItem
* Fix events
* Handle ellipsis
* Show prefix in NameDescriptionInput
* Update tests
* Update types
* Use prop instead of CSS
* Improve responsiveness
* Revert "Use prop instead of CSS"
This reverts commit 74f76d1b99.
* Move segments to a separate spec
* Organize tests
* Add comments
* SEM-420 Organize e2e tests (part 2) (#60388)
* SEM-436 Make field description input auto-grow indefinitely
* SEM-438 Update icons for tables and fields
* SEM-439 Remove the first column with dashes from the field values preview
* SEM-441 Align color scheme for left navbar and right-side panes
* SEM-440 Have a loader for the Detail view preview
* SEM-437 Sorting mode tweaks
* SEM-446 Chips as section headers feel off
* SEM-445 Revisit the read-only version of field ID and DB name
* Make shadows exactly like in figma
* SEM-457 Top-align text with icon for tables with long names
* Remove redundant selector
* Pixel perfect padding
* Fix 'draggable' prop not kicking in
* Fix tests
* Fix flakes
* Update tests
* Add spinner when toggling table visibility and using predefined sorting order
* Show prefix in FieldItem
* Show prefix in SortableFieldItem
* Fix events
* Handle ellipsis
* Show prefix in NameDescriptionInput
* Update tests
* Update types
* Use prop instead of CSS
* Improve responsiveness
* Revert "Use prop instead of CSS"
This reverts commit 74f76d1b99.
* Move segments to a separate spec
* Organize tests
* Move tests
* Move tests
* Add comments
* Merge tests
* Move tests
* Use modern selectors
* Move tests
* Move tests
* Reorder tests
* SEM-420 Test new features (e2e) (#60439)
* Add new tests, simplify toasts, remove long prefix from utils
* Test toasts
* Reuse utils
* Add table picker test for no schemas
* Fix schemaless tables not shown in search
* Add sync options test
* Fix & test prefixes
* Add logs
* Format code
* Coercion strategy test
* Add tests for visibility
* Update assertions
* Add test for tooltips
* Field values tests
* Add tests for filtering
* Add preview assertion
* Refactor preview verification
* Fix showing 403 error in preview
* Add preview tests
* Add preview assertions
* Add preview assertions
* Add preview assertions
* Add preview tests
* Move modals and state handling, add tests for Esc key
* Update unit tests
* Use useDisclosure
* Add extra error status check
* Revert unnecessary changes in cross-version tests
* SEM-419 Increase test coverage (unit tests) (#60491)
* Add new tests, simplify toasts, remove long prefix from utils
* Test toasts
* Reuse utils
* Add table picker test for no schemas
* Fix schemaless tables not shown in search
* Add sync options test
* Fix & test prefixes
* Add logs
* Format code
* Coercion strategy test
* Add tests for visibility
* Update assertions
* Add test for tooltips
* Field values tests
* Add tests for filtering
* Add preview assertion
* Refactor preview verification
* Fix showing 403 error in preview
* Add preview tests
* Add preview assertions
* Add preview assertions
* Add preview assertions
* Add preview tests
* Move modals and state handling, add tests for Esc key
* Update unit tests
* Add FieldOrderPicker unit tests
* Add CurrencyPicker unit tests
* Add FkTargetPicker unit tests
* Add more tests
* Add SemanticTypeAndTargetPicker unit tests
* Remove redundant code
* Move RemappingPicker
* Use useDisclosure
* Add extra error status check
* SEM-247 Clean up old Table Metadata page code (#60557)
* Remove old metadata page
* Move humanizeCoercionStrategy
* Remove unused functions
* Fix SEM-484 (#60600)
* Revert unnecessary change
---------
Co-authored-by: Romeo Van Snick <romeo@romeovansnick.be>
Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
* Closes VIZ-1224 - Make dashcards use chart-specific skeletons (#60090)
* Updates Dashboard cards' loading state to use already-made chart-specific loading skeletons
* Adds SankeySkeleton
* Tweaks MapSkeleton so its fill color can be overridden
* Fixes double name issue in loading skeletons in pinned questions on collections page
* Closes VIZ-1230 - Trigger spinner state when card takes longer to load (#60359)
* Closes VIZ-1218 reset button on data sources
* resets to default only for single datasources cards
* e2e
* e2e
* removed TODO
* simpler
* disable reset btn when already pristine
* revert unnecessary changes to addDataSource
* QUE-1370: Convert AccordionList to TypeScript (#59463)
* Convert AccordionList components to typescript
* Fix types for Select
* Fix types for FilterColumnPicker
* Fix types for QueryColumnPicker
* Fix types for FormSelect
* Fix types for DataSelector
* Fix types for data-picker
* Fix types for AggregationPicker
* Move types into types module
* Simplify searchProp
* Use default export
* Fix info icons always showing
* Remove unused --accordion-list-width
* Rename T for clarity
* Parametrise Section type too
* Fix default label renderer
* Fix missing props
* Avoid calling in on non-object items
* Simplify maxHeight prop
* Move fallbacks into AccordionListCell
* Move shared props to shared type
* Sort props
* Remove styled component for AccordionList
* Rename _list
* Fix itemIsSelected signature
* Simplify callback
* Fix searchFuzzy prop default
* Fix schema picker callback
* Fix aria-selected for tests
* Omit filter description
* Fix loading state
* Remove unused searchFuzzy prop
* Remove unused searchCaseInsensitive prop
* Remove unused hideEmptySectionsInSearch prop
* Reduce this.props usage
* Do not pass aria-expanded to non-expandable items
* Rename AccordionList.unit.spec to tsx
* Remove get and use type guards
* Remove unused cast
* Rename ListItem to Item
* Avoid silly x variable name
* Fix incorrect base type for Item
* Define Item type
* QUE-1359: Add highlight when item has cursor (#59622)
* Add highlight when item has cursor
* Add repro
* Use _.times
* Test using computed style
* Use Cypress._
* QUE-1360: scroll selected item into view (#59617)
* Scroll items into view when selected
* Add e2e test for scrolling items into view
* QUE-1361: Allow using table in search and add fuzzy search (#59693)
* Flatten getRowsCached into getRows
* Use method directly in checkSectionHasItemsMatchingSearch
* Build search index when props change
* Memoize the fuse index
* Add fuzzySearch props to AccordionList
* Enable fuzzy search in Filter and Aggregation picker
* Add unit tests for fuzzy search
* Add fallback for searchProp
* Remove unused variable
* Use shallow equality for memoization
* Remove this.state
* Add tableName and tableDisplayName to filter picker search props
* Strictly type searchProp
* Fix type of default search prop
* Do not include results with bad score
* Search by custom property
* Avoid O(n²) search
* Lower the score
* Fix types in test
* Memoize search
* Pull out isSearching
* Sort results by score
* Export SearchProp types
* Coerce default search props
* Use SearchProp types in Select
* Move itemScore and sectionScore to utils
* Remove search state from state
* Simplify initial cursor method
* Fix cursor logic for sorted items
* Add comment on why a custom memoize function is needed
* Fix unit tests
* Add forwardRef back to AccordionListCell
* Make ref dependency explicit
* Fix broken merge
* Correctly move cursor through rows
* Move searchFilter into getRows
* Fix missing rows
* Lower the search threshold
* Always show section when it has a type
* Move searchThreshold to constant
* Use includes
* Remove unused type fields
* Rename index.js to index.ts
* Refactor search
* Fix types
* Simplify ItemScores
* Allow customizing threshold in strategy
* Enable fuzzy search for query column picker
* Fix substring search
* QUE-1363: Custom expression fallback (#59992)
* Add clausesForMode helper
* Add custom expressions to filter picker
* Do not require helpText for snippets
* Remove helpText arguments from expression completions
* Export expressionClauseSnippet helper
* Allow opening expression editor with custom clause snippet
* Pass expression clause to custom expression editor
* Fix types
* Add onSearchTextChange to Accordionlist
* Select expression clause when typing (
* Only show expression clauses while searching
* Always sort expression clauses last
* Remove reportTimezone arg where no longer needed
* Add expression functions to aggregation picker
* Import underscore as _
* Rename filter
* QUE-1414: Fuzzy search tests (#60257)
* Add test for fuzzy matching in filter popover
* Add tests for picking custom expression in the filter picker
* Add test for selecting expression in aggregation picker
* Add test for selecting items in AccordionList while searching
* Verify that typing non-existing clause does nothing
* Typo
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
---------
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
* QUE-1468: Sticky search in AccordionList (#60190)
* Make the search bar floating
* Remove overflow override
* Correctly set width
* Pass width as direct prop
* Use sticky modifier
* Make search sticky in virtualized list
* Add scroll padding for search bar
* Do not scroll searchbar into view
* Use scrollIntoView vs scrollTo
* Pass maxHeight to scroll container directly
* Remove scrollTo in tests
* Use correct scrolling container
* Remove duplicate sticky style
* Unwrap accordionpicker
* QUE-1413: Colum completion prefix (#59921)
* Allow searching by table name in custom expression completions
* More strictly filter results
* Fix unit tests
* Also disable filter on functions
* Fix unit tests
* Add lower weight to displayLabelWithTable
* Fix e2e tests
* Fix e2e test
* Use display value from longest match
* Copy indices to avoid readonly error
* Fix e2e test
* Preserve option identity
* Use first match to render
* Undo e2e test changes
* Fix e2e test
* Allow matching columns names via long display name too
* Use displayLabel
* Increase score threshold
* Fix unit tests
* Remove missing key error
* Memoize fuzzyMatcher
* Fix e2e test
* QUE-1518: join picker custom search (#60493)
* Allow searching by table name in QueryColumnPicker
* Fix scroll on QueryColumnPicker
* Add custom expressions to join column picker
* Allow selecting expression with ( in QueryColumnPicker
---------
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
* fix: optionally add can_run_adhoc_query in items
Allow the can_run_adhoc_query parameter to be optionally included in the
collection items response, so that targets that are not valid for ad hoc
queries can be removed from the picker in the UI.
* split up large test
* Do not show error when snippet is active
* Add test for hiding errors while snippet is visible
* Also suppress error underline when snippet is active
* vertical cartesian well -> ok
* put the logic in a hook and handled hortizontal well
* added unit tests and handled other types of wells
* reorg and style
* css tweak
* Closes VIZ-1244 Wells light up upon dragging on them, even if the column won't map
* no outline
* Closes VIZ-1216 bubble size well style (#60380)
* fixes wrong drag overlay
* much better fix for draggig overlay
* tpyo
* removed useless cast
* removed comment
* refactored test
* Closes VIZ-1208: smarter detection of selected columns
* no breakout when more than one metric
* no breakdown when more than 1 metric if new col is not date
* combo _is_ cartesian
* [m.lib.fe-util] Introduce match-lite to reduce CLJS bundle size
* [m.lib.filter] Replace match-one with match-lite
* [m.lib.remove-replace] Replace match-one with match-lite
* Replace match-one with match-lite on all CLJC files
* Introduce the option to add data from the sidebar via "Add data" modal (#58408)
* Add CSV panel to the "Add data" modal (#59008)
* Add Metabase storage upsell to upload CSV panel (#59901)
* Add unit test coverage for the missing collection utils (#59902)
* Consolidate analytics around databases, CSV uploads and Google Sheets (#59996)
* Add Google Sheets management tab to the _Add data_ modal (#59905)
* remove stray `t2/debug`
* fix flaky notification send test
another thread was responsible for popping off the queue so there was a
race condition here.
* fix flaky test for not calling DB
i feel bad about this but this seems to be a reasonable solution given
the situation.
Any endpoint that gets some setting inside it might emit an extra SQL
query or two. So we can't reliably check to see whether hitting a given
endpoint hits the DB.
What we can do is hit it a few times and make sure one of those times
didn't hit the DB. Which is silly... but yeah.
Tests fail in CI which try to set timezones in mysql to "alias" types:
'US/Pacific', etc
```
❯ grep "Failed to set timezone" test-log_formatted.json | jq -r '.message'
Failed to set timezone 'US/Pacific' for :mysql database
Failed to set timezone 'US/Pacific' for :mysql database
Failed to set timezone 'US/Pacific' for :mysql database
Failed to set timezone 'US/Eastern' for :mysql database
Failed to set timezone 'US/Hawaii' for :mysql database
Failed to set timezone 'US/Pacific' for :mysql database
Failed to set timezone 'US/Pacific' for :mysql database
Failed to set timezone 'US/Eastern' for :mysql database
```
on mysql image from circle CI:
```
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2025-07-03 02:00:48 |
+---------------------+
1 row in set (0.01 sec)
mysql> SET @@session.time_zone = "US/Pacific";
ERROR 1298 (HY000): Unknown or incorrect time zone: 'US/Pacific'
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2025-07-03 02:10:25 |
+---------------------+
1 row in set (0.01 sec)
```
on mysql's official image for 8.0:
```
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2025-07-03 13:51:36 |
+---------------------+
1 row in set (0.00 sec)
mysql> SET @@session.time_zone = "US/Pacific";
Query OK, 0 rows affected (0.00 sec)
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2025-07-03 06:51:41 |
+---------------------+
1 row in set (0.01 sec)
```
This happened because circle ci bumped the base image to ubuntu 22 in
511bd63787
and this has different timezone information.
Here's timezone data in their 8.0.32 image
```
ls -l /usr/share/zoneinfo/US/Pacific
lrwxrwxrwx 1 root root 22 Feb 14 21:25 /usr/share/zoneinfo/US/Pacific -> ../America/Los_Angeles
```
and in 8.0.42 (alias to latest 8.0 at time of writing)
```
ls -l /usr/share/zoneinfo/US/Pacific
/usr/bin/ls: cannot access '/usr/share/zoneinfo/US/Pacific': No such file or directory
```
Mysql's official images still have these legacy timezone aliases
The mu/fn macro produces instrumented code, whose tail catches java.lang.Exception to clean up their stacktraces. This is obviously not possible in clojurescript. This adjusts the code to detect whether or not it's compiling for Clojurescript or Clojure and tweak the expansion appropriately.
{clojure.core/print{:message"Use metabase.util.log instead of clojure.core/print"}
@@ -271,6 +274,7 @@
clojure.java.jdbc/with-db-connection{:message"Use sql-jdbc.execute/do-with-connection-with-options (for drivers) or t2/with-connection (for the app DB) instead of jdbc/with-db-connection"}
clojure.java.jdbc/with-db-metadata{:message"Use sql-jdbc.execute/do-with-connection-with-options + .getMetaData instead of jdbc/with-db-metadata"}
clojure.pprint/pprint{:message"Use metabase.util.log instead of clojure.pprint/pprint"}
clojure.pprint/print-table{:message"Use metabase.util.log instead of printing directly to the console"}
clojure.string/lower-case{:message"Use metabase.util/lower-case-en instead of clojure.string/lower-case"}
clojure.string/upper-case{:message"Use metabase.util/upper-case-en instead of clojure.string/upper-case"}
compojure.core/context{:message"Use metabase.api.util.handlers/route-map-handler instead of compojure.core/context, it is much faster and supports OpenAPI spec generation"}
@@ -289,6 +293,8 @@
me.flowthing.pp/pprint{:message"Use metabase.util.log instead of me.flowthing.pp/pprint"}
medley.core/random-uuid{:message"Use clojure.core/random-uuid instead of medley.core/random-uuid"}
metabase.driver/database-supports?{:message"Use metabase.driver.util/supports? instead of metabase.driver/database-supports?"}
metabase.lib.convert/->legacy-MBQL{:message"Conversion to legacy MBQL is discouraged, please use Lib to manipulate MBQL queries"}
metabase.lib.core/->legacy-MBQL{:message"Conversion to legacy MBQL is discouraged, please use Lib to manipulate MBQL queries"}
metabase.lib.equality/find-column-indexes-for-refs{:message"Use lib.equality/closest-matches-in-metadata or lib.equality/find-closest-matches-for-refs instead of lib.equality/find-column-indexes-for-refs"}
next.jdbc/active-tx?{:message"Use metabase.app-db.core/in-transaction? to see if we are in a transaction"}
toucan2.core/debug{:message"Don't commit code using t2/debug"}
@@ -297,6 +303,7 @@
:discouraged-namespace
{camel-snake-kebab.core{:message"CSK is not Turkish-safe, use the versions in metabase.util instead."}
cheshire.core{:message"Use metabase.util.json instead of cheshire.core directly."}
clj-time.core{:message"Use java-time.api or metabase.util.date-2 instead of clj-time"}
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+."}
{clojure.core/with-redefs{:message"Don't use with-redefs outside of tests"}
clojure.core/eval{:message"Don't use eval outside of tests"}}}}
clojure.core/eval{:message"Don't use eval outside of tests"}}
:discouraged-namespace
{metabase.legacy-mbql.jvm-util{:message"Avoid legacy MBQL utils, use Lib instead"}
metabase.legacy-mbql.normalize{:message"Avoid legacy MBQL normalization, use MBQL 5 + lib/normalize instead"}
metabase.legacy-mbql.predicates{:message"Avoid legacy MBQL utils, use Lib instead"}
metabase.legacy-mbql.schema{:message"Avoid the legacy MBQL schema, use MBQL 5 + lib.schema instead"}
metabase.legacy-mbql.schema.helpers{:message"Avoid the legacy MBQL schema, use MBQL 5 + lib.schema instead"}
metabase.legacy-mbql.schema.macros{:message"Avoid the legacy MBQL schema, use MBQL 5 + lib.schema instead"}
metabase.legacy-mbql.util{:message"Avoid legacy MBQL utils, use Lib instead"}
metabase.query-processor.store{:message"Please do not use the QP Store outside of legacy QP or driver code. Use MBQL 5/Lib or lib.metadata.jvm/applicaton-database-metadata-provider instead."}}}}
{metabase.test/with-column-remappings{:message"Use lib.tu/remap-metadata-provider instead of with-column-remappings in QP tests"}
metabase.test.util/with-column-remappings{:message"Use lib.tu/remap-metadata-provider instead of with-column-remappings in QP tests"}
metabase.test/with-temp{:message"Use lib.tu/mock-metadata-provider in QP tests. Exceptions: tests for code that doesn't use MPs or models not supported by MPs"}
toucan2.tools.with-temp/with-temp{:message"Use lib.tu/mock-metadata-provider in QP tests. Exceptions: tests for code that doesn't use MPs or models not supported by MPs"}}
> If that is your first contribution to Metabase, please sign the [Contributor License Agreement](https://docs.google.com/a/metabase.com/forms/d/1oV38o7b9ONFSwuzwmERRMi9SYrhYeOrkbmNaq9pOJ_E/viewform) (unless it's a tiny documentation change). Also, if you're attempting to fix a translation issue, please submit your changes to our [Crowdin project](https://crowdin.com/project/metabase-i18n) instead of opening a PR.
> If that is your first contribution to Metabase, please sign the [Contributor License Agreement](https://docs.google.com/a/metabase.com/forms/d/1oV38o7b9ONFSwuzwmERRMi9SYrhYeOrkbmNaq9pOJ_E/viewform). Also, if you're attempting to fix a translation issue, please submit your changes to our [Crowdin project](https://crowdin.com/project/metabase-i18n) instead of opening a PR.
- **UI**: `metabase/ui` components built with Mantine v8
- **Build**: Rspack (primary), Webpack (legacy)
- **Testing**: Jest + React Testing Library, Cypress
### Coding Standards
#### Component Preferences
- Prefer `metabase/ui`components over `metabase/common/components`
- Use `.tsx` for components, `.ts` for utilities
#### Styling
ALWAYS prefer Mantine style props,then CSS modules. DO NOT suggest styled components, they are deprecated.
#### TypeScript Migration
When heavily editing `.js`/`.jsx` files, create a separate PR to convert to TypeScript first, then implement changes.
#### Enterprise Features
Enterprise functionality MUST use the plugin system. It is very important to not expose enterprise code in the OSS version.
#### Testing Requirements
All PRs should include tests. Prefer Unit tests over E2E tests.
#### Localization
All user-facing strings MUST be localized using the ttag library. Localized strings should be complete phrases, do not concatenate a few separately localized strings. You should add context to strings where the meaning of the string might not be obvious in isolation: e.g. "Home" might have different words in some languages depending on whether you're talking about a dwelling or the landing page for a website.
@${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:
constcomment=`${CONVENTIONAL_COMMENT_IDENTIFIER}
@${githubUsername} You have modified embedding 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:
- \`feat\`
- \`fix\`
- \`perf\`
- \`docs\`
- \`style\`
- \`refactor\`
- \`test\`
- \`build\`
- \`ci\`
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.
message:"⚠️ Changes were made to the <b>Embedding SDK Package</b>. Review this PR and apply one of the following labels.<br><br>- <code>release-notes</code> — select if this PR must be included in the main Metabase changelog release notes.<br>- <code>no-release-notes</code> — select if this PR should not be included in the main Metabase changelog release notes."
# Remove the matchers to not report false positives on every PR
# unrelated to embedding (EMB-765)
echo "::remove-matcher owner=tsc::"
yarn build-embedding-sdk-package
- name:Prepare Embedding SDK artifact
uses:actions/upload-artifact@v4
with:
@@ -129,7 +126,7 @@ jobs:
with:
remove-previous-comment:true
add-new-comment:${{ steps.docs-generation.outcome == 'failure' && contains(steps.docs-generation.outputs.output, 'not included in the documentation') }}
message:"📝 Some exported from `@metabase/embedding-sdk-react` types reference other types that are not exported, i.e. internal types.<br><br>The internal type reference breaks API documentation generation for the SDK and also may unexpectedly increase the output size of the type declaration file.<br><br>Please check the CI logs to find the name of such type.<br><br>- If a type should be publicly available in the SDK, add a description to it or a TypeDoc annotation and export it from SDK.<br>- If a type is internal and should _not_ be publicly exposed, refactor types to prevent referencing other types that are not exported from SDK.<br><br>You can run `yarn embedding-sdk:docs:generate` locally to verify that the issue has been resolved."
message:"📝 Some exported types from `@metabase/embedding-sdk-react` reference other types that are not exported, i.e. internal types.<br><br>The internal type reference breaks API documentation generation for the SDK and also may unexpectedly increase the output size of the type declaration file.<br><br>Please check the CI logs to find the name of such type.<br><br>- If a type should be publicly available in the SDK, add a description to it or a TypeDoc annotation and export it from SDK.<br>- If a type is internal and should _not_ be publicly exposed, refactor types to prevent referencing other types that are not exported from SDK.<br><br>You can run `yarn embedding-sdk:docs:generate` locally to verify that the issue has been resolved."
include-log:true
- name:Comment on PR if 'Failed to resolve link' error happens
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.