* 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
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"}
;; Perf-sensitive namespaces are currently the union of metabase.lib.*, driver namespaces, and QP (without tests).
@@ -767,7 +781,14 @@
clojure.core/eval{:message"Don't use eval outside of tests"}}
:discouraged-namespace
{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.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."}}}}
printable-namespaces
{:linters
@@ -779,7 +800,7 @@
clojure.string/lower-case{:level:off}
clojure.string/upper-case{:level:off}}}}
;; enable all the extra linters we haven't enabled in the core app yet in MLv2. It's all new code so we can adhere
;; enable all the extra linters we haven't enabled in the core app yet in Lib. It's all new code so we can adhere
;; to the new stricter rules from day 1
metabase-lib
{:linters
@@ -799,48 +820,116 @@
metabase.test/with-temp{:message"Don't use application database inside Lib code"}}
:discouraged-namespace
{metabase.driver{:message"MLv2 code should be independent of driver code/methods"}
metabase.test{:message"MLv2 tests should only use MLv2 test helpers"}
metabase.test.data{:message"MLv2 tests should only use MLv2 test helpers"}
metabase.util.malli.schema{:message"Prefer metabase.lib.schema schemas in MLv2 code"}
toucan.db{:message"Don't use application database inside MLv2 code"}
toucan.models{:message"Don't use application database inside MLv2 code"}
toucan.util.test{:message"Don't use application database inside MLv2 code"}
toucan2.core{:message"Don't use application database inside MLv2 code"}}}}
{metabase.driver{:message"Lib code should be independent of driver code/methods"}
metabase.test{:message"Lib tests should only use Lib test helpers"}
metabase.test.data{:message"Lib tests should only use Lib test helpers"}
metabase.util.malli.schema{:message"Prefer metabase.lib.schema schemas in Lib code"}
toucan.db{:message"Don't use application database inside Lib code"}
toucan.models{:message"Don't use application database inside Lib code"}
toucan.util.test{:message"Don't use application database inside Lib code"}
toucan2.core{:message"Don't use application database inside Lib code"}}}}
metabase-lib-excluding-legacy-mbql
{}
legacy-mbql-namespaces
{:linters
{:discouraged-var
{metabase.legacy-mbql.util/unique-name-generator{:message"Use metabase.lib.util/unique-name-generator or non-truncating-unique-name-generator"}}}}
{:discouraged-namespace
{metabase.legacy-mbql.jvm-util{:level:off}
metabase.legacy-mbql.normalize{:level:off}
metabase.legacy-mbql.predicates{:level:off}
metabase.legacy-mbql.schema{:level:off}
metabase.legacy-mbql.schema.helpers{:level:off}
metabase.legacy-mbql.schema.macros{:level:off}
metabase.legacy-mbql.util{:level:off}
metabase.query-processor.store{:level:off}}
;; the `metabase.legacy-mbql` stuff is all deprecated, so we don't need to warn inside the module about other stuff
;; in the module being marked deprecated or discouraged.
> 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.
@${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."
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.