* fix: remote-sync origin url errors
Fixes issues where the tmp directory for the remote-sync repo can get
into a bad state where it doesn't have an origin URL. This calls a
function that explicitly sets our desired origin URL and updates all
calls to use the more specific :remote-url keyword rather than
inconsistently using :url vs :remote-url.
* Update git_test.clj
* Extract cycle detection algo and fix available-measures
* Rremove duplicated code.
* Add more serialization tests
* Fix CLJS
* Remove MBQL4 support for measures at the model level
We can't hydrate unbounded collections of cards with the
can_run_adhoc_query hydration since it linearly adds db queries to the
request. Users with > 10000k can have severe CPU/memory issues
processing this.
* Fix heading level for multi-tenant strategy section
* Correct 'Admin setting' to 'Admin settings'
Updated references from 'Admin setting' to 'Admin settings' for consistency throughout the document.
* more edits
* typos
* feat: include query type on dependencies api response
* feat: show icons based on query type
* test: add unit spec for dependency graph utils
* refactor: restore changes after merge conflict
Fixes#67667.
`lib.equality` has logic to do "fuzzy" matching of field refs with
the corresponding columns. This logic exists to support somewhat
malformed older queries with impoverished field refs. Refs in healthy
recent queries are fully specified and there's nothing ambiguous to
required the fuzzy matching.
The bug #67667 caught a case where this fuzzy matching could find a
column with the same name on the RHS of a join, if the original target
column has disappeared from an upstream query.
This change causes the QP to fail in exactly this case: when a would-be
LHS ref in a join condition ends up pointing at the RHS of the same
join. That would produce a strange join condition like
`LEFT JOIN Orders ON Orders.ID = Orders.PRODUCT_ID`
which produces incoherent results, and could result in a very costly
Cartesian join.
This is a user-level error, since the query is broken and needs repair.
Basically, the issue is that trying to implicit join using the instance analytics content model's made_public_by_user field made qp throw an error. The underlying problem is that the field in question wasn't defined as a foreign key, even though the model's result metadata claimed it was a foreign key. Updating the field to actually be a foreign key fixed the problem. This also applies to the content model's question_database_id field, which was also fixed.
* use source alias if we have a fk-field-id
* try only on single stages
* try to identify implicit joins
* try fix
* Clean up
* move test and test all drivers
* move test
* only test drivers with left join feature
* adjust length for certain drivers
* smaller for mysql
* fix starts-with filter
* improve test
* case insensitive filter for h2
* move let bindings up
* Use instance settings for date filters in parameters
* Fix test instance to use default time format
* Add unit tests for date paramater formatting with custom settings
* let users with data model permission access data studio
* respect manage table metadata permission in data studio
* fix ci
* fix flaky specs
* review
* review
* Add e2e test for missing field mapping
* Make validateTemplateTags public
* Render errors in run button tooltip
* Pass errors to run button
* Fix selector in test
* Simplify test
* Try with realClick
* Add Lib implementation of validateTemplateTags
* Also validate display-name
* Use Lib implementation of validateTemplateTags
* Localize error messages
* fixup! Add Lib implementation of validateTemplateTags
* Add Lib.ValidationError type
* Remove unused code
* Also validate temporal-units dimension
* Use validate-template-tags in can-run
* Add tag-name to template tag errors
* Fix malli types
* Add tests for validate-template-tags
* Add tooltip to save button too
* Also test time grouping and save button
* Remove more unused code
* Remove simple wrapper
* Use cond-> pattern instead of filter identity
* Also test coerced datetime column
* Add e2e reproduction for opening the datetime filter for coerced fields
* Also check :effective-type in original-isa
* Fix test
* init pass at adding an error boundary to metabot
* update the illustration used for error boundary and remove simulated error ui
* add unit tests
* split up the mega metabot.unit.spec.tsx unit test file
* fix lint
Previously if you had:
```
A (curate)
B (curate)
C (no permissions)
D (curate)
```
Then if C was archived, you would be unable to move or archive A or
B.
* Fix `text-secondary` not working on dark theme on charts
* Support all colors so it's easier to reason about
* Add tests
* Fix type error
* Revert part of the code that's not used anymore
* Add test snapshots
* Make overriding font more consistency across environments
e.g. From storybook to SDK to the main app.
* Fix formatting
* Skips cloud driver tests on PRs unless files changed
Cloud drivers (Athena, BigQuery, Databricks, Redshift, Snowflake) now
only run on PRs when their files changed or 'ci:all-cloud-drivers' label
is present. Full coverage maintained on master/release branches.
* [do not merge] add failing databricks test
* Revert "[do not merge] add failing databricks test"
This reverts commit de5b6fa602.
* empty commit
* Fix cloud driver skip logic to respect ci:all-cloud-drivers label
The previous condition had three checks that could block cloud drivers:
1. !inputs.skip - false when no backend files changed
2. skip != 'true' - from mage can-skip-driver-tests
3. X-should-run == 'true' - the per-driver decision
The problem: checks 1 and 2 would override check 3, so the label had no
effect. Even with ci:all-cloud-drivers, cloud drivers were skipped.
We don't need inputs.skip or can-skip-driver-tests for cloud drivers
because the X-should-run output already encapsulates the full decision:
- master/release branch → run
- ci:all-cloud-drivers label → run
- driver files changed → run
- otherwise → skip
The label is an explicit override, so it should work even on PRs with no
backend changes. Removing the redundant checks lets the label work.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* mage -driver-decisions + roll in module analysis
* Remove quarantine check from test-driver action
Quarantine logic is now consolidated in mage -driver-decisions.
The check happens earlier in determine-driver-skips, so quarantined
drivers get should-run=false and their jobs never start at all.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fail CI if quarantined driver has file changes without break-quarantine label
If you change files in a quarantined driver's module (e.g., modules/drivers/snowflake/)
but don't add the break-quarantine-<driver> label, a new check-quarantine-conflicts
job will fail with a clear error message.
This prevents accidentally merging changes to quarantined drivers without running
their tests.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add --github-output-only flag to mage driver-decisions
Instead of using grep to filter mage output, the task now supports two modes:
- Default: prints human-readable analysis + GITHUB_OUTPUT preview
- --github-output-only: prints only clean key=value lines for CI
The workflow now calls mage twice: once for debugging visibility,
once with --github-output-only redirected to $GITHUB_OUTPUT.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add quarantine conflict checks to all driver jobs
Extends the quarantine conflict detection to ALL drivers, not just cloud
drivers. When a driver is quarantined but has file changes in
modules/drivers/<driver>/, the job will run but immediately fail with
a clear error message explaining how to add the break-quarantine label.
Changes:
- Add quarantine conflict check steps to presto-jdbc, sparksql, sqlite,
sqlserver, and vertica jobs
- Update login-to-ecr job condition for vertica quarantine conflicts
- Fix verbose output suppression in --github-output-only mode by adding
verbose? parameter to changes-important-file-for-drivers?
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add driver decision priority documentation and tests
Adds comprehensive documentation to driver-decision function showing the
priority order as a table, plus explanations of what triggers "driver
module affected" and the difference between cloud vs self-hosted drivers.
Adds mage.modules-test with 14 tests (78 assertions) covering:
- Quarantine logic and break-quarantine labels
- Global skip behavior
- H2 always-runs behavior
- Master/release branch behavior
- Driver module affected behavior
- Cloud driver special rules (labels, file changes)
- Self-hosted driver skip logic
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Comment out starburst from driver-directory mapping
Starburst tests are currently disabled in drivers.yml, so the mapping
entry was inconsistent with all-drivers list. Commented out with a note
explaining why, so it can be easily re-enabled when starburst tests
come back.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* silence messages when in github-output-only mode
* remove redundant cloud-driver change detection
- this happens inside the script instead
* get rid of redundant rules definitions
- now only print how we make decisions in help for the task
* make a temporary redshift change
* Revert "make a temporary redshift change"
This reverts commit 3d93c60368.
* format usage fn code
* light refactor
* Rename driver decision variables for clarity and flatten decision tree
- driver-module-affected? → driver-deps-affected? (module dependency graph)
- drivers-changed → particular-driver-changed? (specific driver's files)
- Reorder priority: skip/H2/master now before quarantine
- Flatten nested cond for cloud driver rules
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Quarantine now respected on master/release branches
- Move quarantine check before master/release in driver-decision priority
- Quarantined drivers are now skipped even on master/release (unless break-quarantine label)
- Update tests and priority table documentation to reflect new order
- Cloud drivers don't benefit from driver-deps-affected (only label or file changes)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Fix parsing of :ERROR chunks in metabase-enterprise.metabot-v3.util/aisdk->messages
There was a typo in the case expr where :ERROR chunks were being handled like :DATA chunks, but in fact should be
handled like :TEXT chunks. This was resulting in an error like
1. Unhandled java.lang.ClassCastException
class java.lang.String cannot be cast to class
clojure.lang.Associative (java.lang.String is in module java.base
of loader 'bootstrap'; clojure.lang.Associative is in unnamed
module of loader 'app')
RT.java: 847 clojure.lang.RT/assoc
core.clj: 193 clojure.core/assoc
core.clj: 192 clojure.core/assoc
util.clj: 56 metabase-enterprise.metabot-v3.util/aisdk->messages/fn/fn
...
whenever an :ERROR chunk was encountered as we tried to ASSOC a string where we were expecting a map.
https://v4.ai-sdk.dev/docs/ai-sdk-ui/stream-protocol#text-parthttps://v4.ai-sdk.dev/docs/ai-sdk-ui/stream-protocol#error-part059d904d6e/ai_service/ai_sdk.py (L50)059d904d6e/ai_service/ai_sdk.py (L203)059d904d6e/ai_service/ai_sdk.py (L324)
* Add some error chunk parsing tests to aisdk-line-parse-test
* Mark aisdk-line-parse-test as ^:parallel
This does io to read some files, but should be threadsafe as no other tests read or modify those files.
* Add make-mock-error-stream-response test util
And rename make-mock-stream-response to make-mock-text-stream-response
* Add client-error-test to test streaming-request with error chunks in response
We have a grace periods and circuit breakers for token checks. But one
issue is that if the token check doesn't throw an error we can't catch
it.
An easy way to see this is to use a local network address that won't
respond like 192.168.random.random (i used 192.168.40.40) then see the
behavior. Without the timeouts, the threads all just get stuck here and
the page never loads. With timeouts, you'll see a few stutters until the
circuit breaker steps in, at which point you have a non-enterprise
version.
https://www.loom.com/share/6ae056dc126b48c9abe8a7ad9366fd05
* remove api "uses" dependency on api-routes
api-routes can use all modules to expose their routes. ie it uses
timeline module, etc. It has `:uses :any`.
```clojure
mage.modules=> (let [deps (dependencies)
all-deps (keys deps)]
(reduce (fn [c module]
(update c (if (skip-driver-tests? deps [module])
:skip :run) inc))
{:skip 0 :run 0}
all-deps))
{:skip 0, :run 153}
```
This is shown in this path here:
```clojure
mage.modules=> (let [ds (dependencies)
ds (into {}
(map (fn [[k v]] (if (= v :any)
[k (-> ds keys set)]
[k v])))
ds)]
(letfn [(driver-path [to]
(loop [q '[[driver]]
seen #{}]
(let [p (first q)]
(when-let [node (peek p)]
(if (= node to)
p
(recur (into (vec (rest q))
(for [adjacent (remove seen (ds node))]
(conj p adjacent)))
(conj seen node)))))))]
(driver-path 'enterprise/remote-sync)))
[driver warehouse-schema api api-routes enterprise/remote-sync]
```
driver uses arehouse-schema uses api uses api-routes which uses
any. Therefore all changes will trigger driver tests.
So after these changes we observe:
- the path above is empty (drivers don't transitively use remote-sync
module) and therefore would not trigger driver tests
- only 76 modules trigger driver tests
```clojure
mage.modules=> (let [deps (dependencies)
all-deps (keys deps)]
(reduce (fn [c module]
(update c (if (skip-driver-tests? deps [module])
:skip :run) inc))
{:skip 0 :run 0}
all-deps))
{:skip 77, :run 76}
```
What else did i try?
1. add a `#_{:clj-kondo/ignore [:metabase/modules]}` to the ns
I didn't love this because it felt a bit like cheating. All of this is
kinda annoying because it's fundamentally about changes during dev time.
2. remove the ns require and add a requiring-resolve
This actually doesn't break the module usage analysis. It's smart enough
to see this so this just makes it more tenuous and easy to miss if we
change anything while also still leaving in place the module
entanglement.
So I just fire the event from the api module when rebuilding routes and
handle the event from the api-routes module. The trick is that the api
module sends along the function to rebuild the docs
* handle cycling ref
* remove reference to deleted file
* our linter is scared of an extra line
* use an events namespace
not doing an init namespace as that's similar but not the same. Those
are for settings and models. It's fine to just require the event
namespace in the core namespace. it's a bit of ceremony but the pattern
is useful
* include random event correctly
used to be just `(first (descendants :metabase/event))`. This was
fragile and just now started to fail:
```clojure
models-test=> (first (descendants :metabase/event))
:metabase.api-routes.events/api-events
```
because of course do we things like `(derive ::api-events
:metabase/event)`.
```clojure
models-test=> (filter (comp (complement #{"event"}) namespace)
(descendants :metabase/event))
(:metabase.api-routes.events/api-events
:metabase.audit-app.events.audit-log/card-event
:metabase.audit-app.events.audit-log/cloud-add-on-event
:metabase-enterprise.dependencies.events/transform-delete
:metabase.activity-feed.events.recent-views/legacy-card-event
:metabase.view-log.events.view-log/collection-read-event
:metabase.audit-app.events.audit-log/notification-handler-event
:metabase.audit-app.events.audit-log/user-update-event
:metabase-enterprise.dependencies.events/transform-run
:metabase.revisions.events/transform-event
...
)
```
This has been lucky for a long time
* Update Remote Sync branch picker to match new designs
* Move git sync controls next data studio logo
* Fix unit test
* Fix e2e test
* Address Claude's review
* Remove console.error
* Use css modules for the chevron icon transition
* Use popover instead of findByRole('presentation')
* disable progress bar in whitespace linter github actions workflow
* add extra whitespace to demonstrate failure
* Revert "add extra whitespace to demonstrate failure"
This reverts commit ba34650efd.
* feat: add git settings modal to data studio
* Refactor GitSettingsModal to reuse existing settings form / Adjust some styles
* Fix and improve unit tests
* Adjust font size according to variant
* fix unit test
* fixup! mock API not other plugins in this layout
* Split unit test files and improve endpoints setup
* Implement PLUGIN_REMOTE_SYNC.GitSyncSetupMenuItem with internal rendering condition
---------
Co-authored-by: Anderson <anderson@metabase.com>
Fixes#65838.
This issue was about dashboard filters showing the wrong value when
the filter was bound to an FK field from a table with multiple FKs to
the same foreign table. The dashboard parameters logic on the BE was
choosing which FK to use for the filter values arbitrarily, meaning that
binding the filter to one of them would work fine, but the other would
give incoherent results.
The fix is to be deliberate about selecting the parameter's column. That
doesn't solve all ambiguous cases, but we really can't help if there's
a multi-hop join that has parallel edges in the middle!
* Add field grouping of host and port
* Add host and port settings to postgres, mysql
* Add host and port grouping to db drivers
* Add database story with host and port group
* Add groupFields unit tests
* Fix typo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fix missing tunnel parameter value
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Refactor and simplify field grouping function
* feat: add nested fields support for db format
* feat: remove id field, adapt new format foy postgres, mongo, mysql, remove leftovers
* feat: support nested fields, add backdrop component
* fix: group inputs loosing focus on type/render
* refactor: simplify custom containers logic
* style: adjust backdrop container style
* refactor: field mappers for db forms
* refactor: move host and port config to the new format
* refactor: cleanup old grouping approach
* refactor: remove unneeded property
* fix: typo in the html prop name
* internal: validate container style comping from BE
this value can be set be external drivers so it's better to validate it
Signed-off-by: Jakub Chodorowicz <jakub.chodorowicz@metabase.com>
* fix: type errors
* fix: driver translation test
* refator: use existing getFlattenedFields function
* fix: flatten properties for connection property uniquness
* backtrack from ssl grouping for mongo
---------
Signed-off-by: Jakub Chodorowicz <jakub.chodorowicz@metabase.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Acquire locks before changing data permissions
Data permission have a read-modify-write cycle:
- we read the existing permissions to see what's currently set
- then we decide what to do (e.g. delete the existing DB level
permissions to write a granular table-level permission)
- then we do the write
This has a race condition if multiple Metabase instances are modifying
permissions at the same time.
For example, say we have:
Initial state: `{:db_id 1 :table_id nil :perm_value :unrestricted}`
Instance A: set table 1 to :blocked
Instance B: set database to :blocked
T1: A reads state, sees db-level permission, plans to expand to table-level
T2: B reads state, sees db-level permission, plans to replace it
T3: A deletes db-level, inserts table-level rows for all tables
T4: B deletes db-level (no-op), inserts new db-level :blocked
Result (CORRUPT):
```
{:db_id 1 :table_id 1 :perm_value :blocked} ;; from A
{:db_id 1 :table_id 2 :perm_value :unrestricted} ;; from A
{:db_id 1 :table_id nil :perm_value :blocked} ;; from B
```
Both db-level AND table-level permissions now exist.
For the permissions API, we take a cluster lock, but sync operations
bypassed this cluster lock. This PR creates a lower-level cluster lock
per `[database, group, perm-type]` so only one instance/thread can do
the read/decide/write cycle for a particular db/group/perm at a time.
* Add a test for race conditions setting data perms
This took a while before I was able to track down the fact that using
`(mt/with-temp )` caused both threads to share the same connection, so
they could obtain the lock simultaneously 🤦
* Use a slightly coarser lock
I realized that if an instance has a huge number of groups, we'll obtain
a lock and ask Postgres to maintain an active savepoint for each group,
which might be untenable.
I think the best solution here is to use slightly coarser locks. This
might increase contention slightly, since we won't be able to change
permissions for `db 1, group 1, perm type view-data` at the same time
that we change permissions for `db 1, group 2, perm type view-data`. But
I think the tradeoff here is necessary.
* Prevent unnecessary height calculation
* Prioritize local layout from `react-grid-layout` for height calculation
* Refix the issue for real
* Add tests
* fix: hide untested and unsupported db engines in table editing section
* move allowed engines to constants file
* test: add hidden editing toggle test case
* fix: avoid persisting settings that are hidden from dashboard UI
* test: add `sanitizeDashcardSettings` unit spec
* refactor: use `_.pick` for sanitizing dashcard settings
* Fix pie chart flickering on toggling legend / Convert ChartWithLegend to ts
* Convert test to ts
* Resolve flickering when toggling visualization config sidebar
* Fix regression with map chart (only apply svg centralization to pie charts)
* Apply PieChartContainer classname to inner component
* Default to base-type when it differs from effective type
* Make 'er parallel
* Does this clause make it better?
* Remove parallel.
* New test and fix for two literals
* Use y-type for effective type
* Update test to try number
* Don't expose `question` in SDK's `entityTypes`
Because it's only applicable to staged picker
* Fix type
* Clarify the use of `question` in SDK's `entityTypes`
* Fix SDK not building
* Prevent test email from including Metabase links (#67068)
* Send a new flag from FE if testing subscription from modular embedding
* Pass :disable_links to dashboard subscription email template
* Remove links from dashboard subscription email template
* Remove link from pulse cards
* Remove dangling divider line
* Add test
* Fix tests
* Use the same logic as in the actual subscription tasks
* Prepare to use a new column name from pulse table
* Remove embedding subscriptions email links (#67181)
* Add a column to pulse to save when a subscription is created on embedding
* Save disable_links to "pulse" table
* Fix tests
* Fix more tests
* Update column name
* Add tests
* Make code less confusing after embedding name change
* Fix liquibase boolean type
* Fix tests
* Fix more tests
* Fix formatting
* Fix wrong test names
* Make function comment styles consistent
* Make the test more solid
* Add modular embedding SDK tests
* Don't render the dashboard subscription button when there's no data cards (#67501)
* fix: respect time format in exlude date picker filter QUE-2611
* rework: move constant out of function body
* test: fix failing tests due to lack of redux provider
* fix: add missing redux provider in story
* test: improve testing logic for ExcludeDatePicker
* internal: use specialized useSetting hook
* test: adjust looping with async action
The root cause of the flakiness was that the save modal sometimes picks the root collection, while at other times it picks the current user's personal collection. The selector was trying to find "Our analytics" in the breadcrumbs, which is why it was failing every time the actual collection is personal collection.
The second issue was that trying to (1) clear and then (2) type the metric name was extremely unreliable.
* Add failing test for #63822, DEV-1190
* Add new feature flag
* Update FE config
* Fix tests 🔧
* Disable for 7 more drivers
* Fix MySQL + MariaDB
* Fix TypeScript
* Check that the number was parsed correctly
* Don't parse int columns that are remapped
* oops, remove old change
* Better fix and specific test
* kick ci
* kick ci
* Make sure it still hits the bigint branch
* Move check into parseNumber()
* Move check back to value.tsx
* Single describe in tests
* Add blank lines (fe-lint)
Log each entity (card) as its dependencies get backfilled by the job. This is to be able to see if there is a particular entity that's causing the OOM.
* prototype
* open chat sidebar on navigate
* update copy for new route
* use nlq profile and make sticky, redirect to empty query builder if no navigate_to is recieved
* responsiveness
* move code to enterprise folder
* imple error states, better loading state
* handle user leaving the page while a response is being loaded
* lint fix, change inline sql shortcut key, disable prompt suggestions and fade out once a prompt has been sent
* fix e2e test
* add test coverage, update copy
* fix failing e2e tests
* attempt to fix e2e flake
* UXW-2449 fix pasting mixed content containing cardEmbed
* Fix issue with cardEmbed loading forever
* Fix issues with smartLink and caedEmbed paste to a list
* Fix typecheck
* Remove openapi.json from repo and disable CI check
The committed openapi.json was causing friction:
- Cascade CI failures when master got out of sync
- Merge conflicts on a 36k line generated file
- Phantom local changes when switching branches
The OpenAPI generation still works - run `yarn generate-openapi` when needed.
We're just not committing the artifact for now.
* Check for Node.js 22+ before generating OpenAPI types
The previous check for `yarn` wasn't sufficient - the system may have
yarn installed with an older Node.js version. Now we explicitly check
that Node.js 22+ is available before running the generation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Revert client-side OpenAPI types generation
* Remove types generation from postinstall
* Restore package.json newline
* Restore prepare-backend action
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Stas Gavrylov <stasgavrylov@gmail.com>
Co-authored-by: Stas Gavrylov <stas@metabase.com>
* Allow clicking dates with hour and minutes granularity to set parameter
* Add repro for metabase#58556
* Fix unit tests
* Add repro for metabase#66277
* Allow selecting date ranges with hours and minutes
* accept optional profile-id in search tool request and use it to determine collection filtering
* cleanup
* try to fix tests
* fix build
* kondo
* fix toucan syntax
* address comment
* oops, fix build
* remove some more use_case code on the FE that slipped through the revert via messy rebase
* set network timeout in connection options
* add test
* kondo
* fix test
* Add try catch
* use network timeout setting
* use exception chain util
* use cached thread pool, and timeout to call connection.close
* just do setnetworktimeout
* address comments
* Fix: Cannot add filters on boolean MySQL columns when the data source is a model
Fixes#65826🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Introduce multimethod
* Improve docstring
* Add db-type-name to changelog
* Make tests work
* improve changelog entry
---------
Co-authored-by: Claude Code[bot] <noreply@anthropic.com>
Co-authored-by: Eric Normand <ericwnormand@gmail.com>
* Fix: Redshift external tables have unknown types for string/enum columns on sync
Fixes#63025🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Add more Iceberg types to Redshift external table types
---------
Co-authored-by: Claude Code[bot] <noreply@anthropic.com>
Co-authored-by: Eric Normand <ericwnormand@gmail.com>
- when a spec is registered, store the raw form in an atom. This is so
things like `search.spec/explode-raw-case` can be stored as raw symbols
rather than functions. (Do note that this is technically a bug in a rare
edge case, where the definition of `search.spec/explode-raw-case`
changes and the search index should technically be invalidated - but I
think this is rare and low-impact enough that we can just not care.)
- when we access the current search index version, canonicalize the
stored specs, plus default attributes and attribute types, and sha256
hash the result
* UXW-2576 show tenant collections in the trash
I also deleted the `audit-namespace-clause` function. It felt like it
didn't do enough to justify its existence - every caller needed to
modify the list of namespaces. Could probably DRY things up a bit still,
but think we should change the approach.
* Check `use-tenants` before returning tenant colls
* s/audit-namespace-clause/namespace-clause helper
`namespace-clause` takes the ns column, ns value, and an optional
argument for whether *this* particular result should include the tenant
collections in the response (since sometimes we want 'em, sometimes we
don't.)
* kondo
* Prevent updating tenant specific root collections
* Localize the name of dedicated tenant collections
* rename dedicated tenant collections 'Our Data'
When displayed on the FE for an admin, they can be renamed to something
like "Foobar's tenant collection"
* Internal users see different names
* prevent tenant users to edit their dedicated tenant collection
* Revert "prevent tenant users to edit their dedicated tenant collection"
This reverts commit 08d2d722be.
* Rename `Our Data` to `Our data`
Co-authored-by: Nicolò Pretto <info@npretto.com>
---------
Co-authored-by: Nicolò Pretto <info@npretto.com>
* Demo of only importing the relevant plugin in unit test
* Optimize enterprise plugin unit tests with targeted setupEnterpriseOnlyPlugin calls
* fixed tests
* fixup
* .
* fixed test
* removed hasEnterprisePlugin
* fixup
* removed remaining hasEnterprisePlugins and unnecessary setupEnterprise fn
* specificPlugins -> enterprisePlugins
* .
* fixed type
* docs
* Add effective type to expression when resolving from ref
* Add repro for QUE-2567
* Fallback to base type when checking effective types
* Avoid shadowing var
* Add tests for effective-type fallback
* Fix normalization of MBQL 4 `:aggregation-options` with a `nil` options map
* Update tests
* Fix normalization of Template Tag :options
* Allow raw values as expression definitions
* Automatically remove :ident from joins
* Properly handle aggregations expressions that contain `:if` (alias for `:case`)
* Allow `:coalesce`, `:if`, and `:case` as datetime exprs in MBQL 4
* Test & Kondo fixes 🔧
* WIP
* Working test! (it reproduces)
* Fhew! I found it!
* Remove printlns
* Also remove sensitive fks in calculation
* Remove stray marker comment
* Move tests to fields-test
* Exclude :retired too
* Move tests and add one for retired
* Add another retired
* Better tests
* Appease the kondo
* Fix broken test
### Description
We want to communicate per-billing-period quantities with customer, instead of always communicate monthly quantities. Invoiced totals will stay the same.
### How to verify
Describe the steps to verify that the changes are working as expected.
1. Ensure you have a token with the `offer-metabase-ai-tiered` feature, but without the `metabot-v3` feature.
2. Navigate to `/admin/metabot` and see the quantities as per billing period, and not per month.
### Checklist
- [x] Tests have been added/updated to cover changes in this PR
Fixes: 2b76c38e1f
Closes: https://metaboat.slack.com/archives/C07RMUQ0GE5/p1765907134400039
* Update default value locations in comments
* Update snowplow schema for modular embedding analytics
* Add more type safety
* fix 'dashboard.drills' and 'question.drills' default values for guest embeds
* Fix auth type
* Test guest embed authentication
* Log `with-subscriptions`
* Strengthen the type
* Hide external collections sidebar for internal users without tenant collection accesses (#67033)
* show the add button if user can write to root
* update unit tests for shared collections nav
* simplify test mocks
* getIsTenantUser selector
* flatten navbar for tenant users
* move up state and use plugin, keep "Collections" name when the external
collection section is not shown
* polish
* throw new error
* fix unit test
---------
Co-authored-by: Phoomparin Mano <poom@metabase.com>
* add openapi-typescript schema generation
* chore: add live type generation
* Temp fix for self ref schema
* nemanja wants avaible locales schema
* generate openapi.json file on dev or when updating the apis
* now it e2e. you update an api schema => generate openapi.json => hook to update d.ts
* add hey api
* update user profiles
* proper types now
* fix: remove leftover folders and adjust imports
* chore: Claude guide to generate MALI schemas
* feature: add schema for users API
* wip add user type to profile
* remove the ref of the old lib. all hey-api now
* WIP
* Update FE unit mock
* fetch openapi.json from file system instead of the api
* Add in-browser overlay with errors
* disable error overlay
* feat: script to generate openapi spec
* experiments
* do not clean cwd
* Enable pretty-printing for OpenAPI json
* Add OpenAPI spec keys sorting
* Move generated openapi.json to resources/openapi
* Commit generated typings with sorted keys. Add types.get.ts to eslintignore because it has incorrectly linted typing
* wip
* Fix nullable types
* test fixes
* revert hack for self ref schemas as the new lib cna generate it
* Move TS generated types to gitignore. Cleanup.
* revert uncessary schema changes and also fix indentation
* Add types generation to TS CI job
* Update CI to generate and cache TS types
* Fix CI types generation
* Cleanup FE
* reorganized the modules and remove the requiring-resolve
* Fix unit test
* fix: wrong function call to regenerate api spec
* chore: upgrade hey-api (fixes self referencing hey_api type)
* feat: disable type generation for MetabaseLegacyMbqlSchema
* chore: regenerate openapi definition
* chore: regenerate openapi.json
* feat: add generate-openapi-spec command
* build: use generate-openapi-spec in yarn scripts
* build: add script that verifies the that openapi spec is uptodate
* build: add CI check for openapi schema being uptodate
* build: fix wrong filename of api check script
* internal: use yarn script for schema generation
* internal: generate version in the api schema generation step
* internal: install node 22 in the api generation job
* internal: fix hey api running twice on build hot
* internal: debounce ts api types generation
* bring back debounce logic
* revert changes in users schema
* internal: add malli docs instructions in skills format
* internal: add details to defendpoint+malli skill
* Fix incorrect types:watch initialization in build-hot script
* Remove version field from generated OpenAPI JSON to allow proper versions comparison on CI
* Update OpenAPI JSON schema
* a nice solution for the dynamic timezone enum
* update openapi json
* test fixes
* update openapi json with latest apis
* resolve tips when this happens again
* fix kondo test and revert the locale type in properties api
* update spec to remove locales
* Revert enum usage on UI
* build: types as part of postinstall
* types: replace hardcoded log type values
* build: format types with prettier - compatible with embedding type transforms
* Update OpenAPI schema
* Update OpenAPI schema
* Revert types cache generation
* Address PR comments
* Reset spec format
* Reset spec again
* Merge master and update OpenAPI spec
* Update package.json
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
* feedback
* resolve comments
* Update OpenAPI spec
* Update OpenAPI spec
* Update OpenAPI spec
* Update OpenAPI spec
* follow derive conventions
* Remove deprecated rspack type check deps
* Add eslint rule to restrict imports from metabase-types/openapi
* Update OpenAPI schema
---------
Co-authored-by: Nicolo-Maria <nicolo.mezzopera@metabase.com>
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
Co-authored-by: Nemanja <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Stas Gavrylov <stasgavrylov@gmail.com>
Co-authored-by: Uladzimir Havenchyk <uladzimir@metabase.com>
Co-authored-by: Oleksandr Solovyov <o@solovyov.net>
Co-authored-by: Stas Gavrylov <stas@metabase.com>
Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
The savingModel prop allow "collections" to be written to the
shared-tenant-collection namespace root while other model types are disallowed.
Fixes how this prop is calculated because the original implementation
left off other types of cards. This prop is now just "collection" | null
since collection is the only model type that matters here.
* Change url from checkout to login
* Use store login url when pro-self-hosted plan
* Unit test WIP
* source_plan query param added
* Cleanups
* Move useGetStoreUrl to hooks file
* Unit tests added
* Misc
* Misc
* Remove hooks
* Removed login path page
* Param renamed to `migration-source-plan`
* Unit tests updated
This pull request removes the user setting that persisted the open/closed state of the native query preview sidebar in the notebook editor. The sidebar's visibility is now managed entirely in the UI state (not persisted per user), simplifying the logic for showing or hiding the sidebar and cleaning up related code and tests.
1. opening a notebook editor will *always* start from a closed native preview sidebar
2. state is now managed exclusively by Redux (sidebar state might be preserved until the page reload, but it is not persisted on the backend)
3. We're changing a previous behavior where, if a native preview sidebar was open and we're resizing the window to something small, the sidebar was automatically closed. This PR changes that behavior. i.e. There is no special resize handling anymore. Whatever the (Redux) state of the sidebar is, it will stay like that no matter the window size.
The catch block in startContainers was swallowing errors - it would
log and tear down containers but never re-throw. This meant when
health checks failed, the script would print "All done!" and exit 0,
then Cypress would run and fail with a confusing "could not verify
server is running" error.
Now we re-throw after cleanup so the actual failure is surfaced.
* .
* .
* .
* .
* .
* trying without one timeout
* trying without another timeout
* trying without another other timeout
* trying without yet another timeout
* .
* Do not allow picking unsupported databases in Python data picker
* Do not auto-select disabled items
* Add e2e test for empty data selector
* Simplify ugly if condition
* Fix e2e test
* Do not open datapicker wen going to next step
* broad strokes
* clean up snippets and metrics pages
* tons of PR feedback
* Hi Dan
* test adjustments
* more adjustments
* fix card issue
* removing text on runs list page
* fixing glossary tests
* PR Feedback
* remove header prop
* page spacing adjustmnets
* Center Viz Empty State, fix python library page
* fix python transform page
* scrolling behavior on Job and Transform list pages
* last bits of shame
* fix: druid breakout and agg names must be unique
Fixes#10670
* Fix CI
* cljfmt
* format
* format rows
* make it work with druid jdbc
* address comments
* use seq over some?
---------
Co-authored-by: Riley Thompson <riley@metabase.com>
Co-authored-by: Riley Thompson <rileythompson99@gmail.com>
* WIP UXW-2451 Fixes issue where changing light/dark mode messes up color variables by removing nested providers in useBodyCellMeasure which probably breaks other things
* Update Loki Snapshots
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
This generally indicates an MBQL 4 -> 5 conversion issue, and we need
the signal in the 57 rollout.
Also improves the detail of the logging for when `:dataset_query {}`.
* Add Australia (Sydney) to available regions
Added Australia (Sydney) to the list of regions.
* Add Asia Pacific (Sydney) IP addresses to whitelist
Added IP addresses for the Asia Pacific (Sydney) region.
* Reorder South America IP addresses section
* Update cloud region list in change-region.md
Removed duplicate entry for Australia (Sydney) and updated Asia Pacific region.
* Filter Popover close on click outside
* scroll on mount for field and preview panels, tests
* ci bandaid
* UXW-2510 Fix background color mismatch in table metadata panels
* PR Feedback
* shameful fix
---------
Co-authored-by: Brad Anderson <brad@metabase.com>
* Fix check for card changes
The query coming from the FE looks like:
```
{:aggregation [["count"]],
:breakout [["field"
42
{:base-type "type/DateTime",
:temporal-unit "month"}]],
:source-table 7}
```
(note strings like `"count"` and `"month"` and, most importantly, `"type/DateTime"`.)
The card from the DB looked like:
```
{:aggregation [[:count]],
:breakout [[:field
42
{:base-type :type/DateTime,
:temporal-unit :month}]],
:source-table 7}
```
When we compare the query to the old version to see if it's changed (and
thus, we should invalidate the verified status) we walk it first,
converting all keywords to strings:
```
(let [prepare (fn prepare [card] (walk/prewalk (fn [x] (if (keyword? x)
(name x)
x))
```
... but this is not the correct way to do this conversion, because
`:type/DateTime` becomes `"DateTime"`. We need to include the namespace
if it's present.
* Compare normalized queries
* Modify `changed?` to only compare updated keys
In the end we're doing a `t2/update!` with the updates passed in. If a
key isn't in the updates, it's not going to be updated.
Simplify `changed?` to just take two arguments, `before` and `after`,
and compare the keys in `after` (after doing the necessary
normalization).
If a key is in `after` but *not* before we can't compare it and should
throw an exception. For example, if we passed a card like
`(t2/select-one [:model/Card :id :name])`, we should throw.
* More sane way to check if a card has changed
Instead of ad-hoc updating keys, use the toucan transforms to just
canonicalize all the values before we compare.
* kondo
We currently have the "revision number", but:
- the intent there is slightly different; we want to prohibit one user
from making changes to the permissions graph before they *see* changes
another user might have made concurrently, not just sequence the
concurrent changes, and
- we allow API users to pass the `force` parameter to skip the revision
check entirely
Note that the reason we have `force` available is to allow people to
change permissions without first making a request to *GET* the
permissions graph (which can in some cases be extremely large). It is
not intended to allow concurrent updates to permissions.
https://github.com/metabase/metabase/actions/runs/20267445215/job/58194458921 failed because snapshots were running for QA databases, and we don't have those Docker containers up for this job.
Since we don't need them, I have adjusted the snapshot step to only run the default snapshots. There's a comment what to do if we change our mind and want to run external database checks in the future.
The summary: we are offering drill-throughs on custom columns defined after aggregation, but those custom columns don't exist in the base query. The error presented in such a way that `lib.underlying/top-level-column` for a dimension was returning `nil`, and we were happily putting that `nil` into the query we constructed.
I created a utility to filter dimensions by whether or not the top-level-column can be resolved, and used this for the underlying-records drill-through (from the original issue) as well as the pivot drill-through (which behaved similarly). If no dimensions have a top-level column, the drill-through is not available. If some do, we offer the partial drill-through.
`source` is a legacy key on the frontend that gets translated to `lib/source`. Some maps are using both `source` and `lib/source`, and the translation layer translates keys and values in completely separate steps. When the time comes to translate the legacy value of `source` into a valid value for `lib/source`, the code can't tell what the key was originally named. So already-valid values were going through the translation process, producing invalid values (e.g., `:source/source/aggregations`).
This adds a step to object parsing to detect that both keys are present; when they are, it sets an option to simply skip `source` during the parsing; secondly, it adds a step in the value parsing to check whether the value is already a keyword namespaced by `source/`.
Theoretically the BE could provide the email if you send in an expired
token, but it seems slightly less controversial to just provide a link
like `/auth/reset_password/the-very-long-token?email=some%40email.com`.
This way having the expired token itself can't reveal any information,
but if you click on an expired link, then it's just 2 clicks to send
yourself a fresh token instead of click -> type email -> click.
Fixes [UXW-658: New user invites expire quickly, adds friction to new user experience](https://linear.app/metabase/issue/UXW-658/new-user-invites-expire-quickly-adds-friction-to-new-user-experience)
`util.perf/mapv` checks the `count` of all its collection args, so it's
not safe to call with an infinite `seq`.
`lib.metadata.result-metadata/merge-cols` was doing exactly that in the
case where there was a mismatch between the column counts from lib and
driver. It was passing `(concat short-list (repeat nil))` to `mapv` and
causing an infinite loop!
* Correctly handle non-string `@tenants` in JWTs
Previously we threw exceptions if we received an invalid non-string
`@tenant`, like `123` or `false` or `{:foo "bar"}`.
Now we:
- convert integers to strings,
- take strings as-is, and
- throw a meaningful exception for anything else
`:dataset_query {}` should not happen, and indicates a bug in the
MBQL 4 normalization. On reading any card, if its `:dataset_query`
is `{}`, add the ID to an in-memory set and update a Prometheus
metric.
This reverts commit 9191713854.
used to do this in-house but now we use trunk for this. Old way has
ultimate flexibility. But trunk has some really nice workflows built
in (reporting, creating issues in linear, etc).
* rename to full app and modular embedding
* Update docs/embedding/sdk/quickstart-with-sample-app.md
* Update docs/embedding/full-app-ui-components.md
* Apply suggestions from code review
---------
Co-authored-by: Jeff Bruemmer <jeffbruemmer@gmail.com>
* Add DB infra for metabot use cases
* add enabled? use case setting and hook it up end to end for transforms
* remove transforms use case toggle
* add back migrations, number of tests
* add more missing migrations; lint
* some simplification
* fix some tests
* pull use-case out of tool call request header & fix last test
* more test fixes
* add back commits, move use_case->profile mapping to the appdb
* clean ns
* bump ci
* just store use case names in metabot_message instead of fks
* update test
* serialization fix; refactor
* lint
* restore migrations, address code review
* add back migrations again
* Tenants, External Users, and tenant based JWT with Audit Events
Allow the creation of tenant users
While working on this, I realized that my approach to the "All External
Users" group and renaming the "All Users" group was untenable.
I had been planning to just update these things in the database (create
AEU, rename AU to AIU) in the setter function for the `:use-tenants`
setting. The issue here is caching: we don't want to need to actually
reach out to the database every time we need to fetch the All Users or
All External Users, but it would also be quite unfortunate if one
Metabase instance in a cluster had an outdated view of, e.g. the ID of
"All External Users".
(Although - I'm not really sure how much we use the *name* of "All
Users" when we fetch `(all-users)`, so that might be worth a look.)
For now, I've modified things to just update things dynamically in the
`GET /api/permissions/group` and `GET /api/permissions/group/:id`
endpoints: we show/hide the "All External Users" group, and rename the
"All Users" group, based on whether Tenants are enabled.
Allow the creation of tenants
Listing tenants / tenant members will be a followup PR
lint
doh missing require
fix tests
add a test for enabling tenants changing groups
fix tests, slight change to tenant creation API
kick ci
fix another test
give minimum permissions to ext groups
fix more tests
impl user stategy setting ui
more API endpoints
add more tests, fix a very silly migration
slug validation
fix mariadb/mysql
lint migrations file
kondo
fix test
replace tenant members API with `/user?tenant_id=`
also realized that the `/user/recipients` endpoint needed to be modified
for tenants: tenant users should not see recipients that are not part of
the same tenant. (reminder for later: we will need to add safeguards
around actually creating those pulses, not just assume the API won't
send bad recipients!!)
IF you are an admin, `/api/user` respects a `tenant_id` query param and returns:
- "normal" (non-tenant) users if it's `nil`
- specific-tenant users if not
If you are *not* an admin, `/api/user` ignores the `tenant_id` passed
and only returns users in the same tenant.
`/api/user/recipients` will:
- return ALL users if you are a superuser (both tenant and non-tenant)
- return only users in the SAME tenant as you if not
doh
tenant crud wip
integrate endpoints, fix type errors
Allow getting all external users
previously you could do only
```
GET /api/user => internal users
GET /api/user?tenant_id=null => internal users
GET /api/user?tenant_id=123 => users in tenant 123
```
now you can do
```
GET /api/user => internal users
GET /api/user?tenant_id=null => internal users
GET /api/user?tenant_id=123 => users in tenant 123
GET /api/user?tenancy=all => internal + external users
GET /api/user?tenancy=internal => internal users
GET /api/user?tenancy=external => external users (in all tenants)
```
If you specify both `tenancy` and `tenant_id` (regardless of the values
passed) you'll get a 400.
fix my bad rebase
fix bad rebase more
remove #p
mark tenants as `is_active` or not
initial external users management
remove permissions check on the trash endpoint
I don't know why this was added in the first place (I mean, I think I
added it, but I don't know why I did).
The trash is always accessible to everyone. We gate the visibility of
things *in* the trash, but the trash itself is always readable.
no personal collection for tenant users
remove tenant query inside oss
tenant user routes
make it so that you cannot remove users from the external users group
do not send email to tenant users
no login for inactive tenants
disable collection permissions, don't show sent email modal on user success with SMTP
remove all users group has higher permissions warnings for external users group
moving is external checks behind plugins
unit test cleanup, add simple test
read only application permissions for external users
set tenant on login with JWT
incredibly hacky tenant attribute
separate `:attributes` from `:login_attributes`
thinking here is that `login_attributes` are the things you set on the
user, where `attributes` are all the attributes of the user including
things like tenant slug or maybe someday locale etc.
fix build
fix token check
create a tenant collection in a migration
this works, but the tenant collection is always visible to admins, even
if the setting is off.
hide tenant collection from normal users
fixing build and FE rebase
Delete stray "howdy"
Lol, sorry about that.
fix tests
throw instead of silent failure on no tenant
superuser can't be tenant
fix up tenant collections
tenant collection now includes subcollections.
Tenant collections are hidden if the feature isn't enabled.
tenant collections marked in API
bugfix and current user can write any coll
don't add `attributes` key to all users
just the current user on login
invalidate groups when changing user strategy
read only user
{{ tenant_slug }} user attribute
fix be test
rip out tenant collection stuff on BE
fix BE tests
lint
fix magic string
no tenantifying existing users for now
also clean up a complicated, confusing fn.
starting e2e
fixing e2e, adjusting @tenant user attribute
fix permissions editor, add tenant.name e2e test
allow more than one user per tenant
🤦
allow getting only active tenants
*actually* don't replace existing values with nil
getting e2e ready for tenant user provisioning
tenants management ux
e2e coverage on sandboxing, deactivating tenants
replace {{tenant_slug}} with `@tenant.slug`
filter out other-tenant users from pulse creation
rename any existing `@.+` user attributes
prohibit new user attributes starting with `@`
fix migration
ugh, forgot to actually commit this file
add more tests
kondo
use the `tenants` feature
fix a test - missed one `:advanced-permissions`
e2e test coverage, updating tenant attribute to @tenant.slug
Partial Type Fixes
types green
unit tests
adding groups to e2e test, maybe fixing tenant feature check?
Add tenants to tracked snowplow features
Fixing Admin ui
Modernizing tenants page
separate external group in permissions sidebar
permissions editor updates
hardcode that *everyone* has trash access
shame... bad imports
adjusting Main Navbar. using globe icon
CR response
fix tests
fix attributes when tenants are disabled
lock up the 'all external users' collection
tenants route guard
add tests for missing feature and oss
fixing some unit tests, and type errors
set token features in default.cy.snap
unit and e2e test adjustment
another pass on e2e
fix e2e and build
fix a bad merge
Green CI?
reset token after restoring DB
move a test to fix the test
kondo
Move `/api/ee/tenants` to `/api/ee/tenant`
PR Feedback, part 1
move route functions into ee
ADM-1105 permissions editor adjustments for external users
ADM 1104 do not show invite button on external users when there is no tenant
adjusting unit tests
fix no results message for deactivated users page
center no results message
Fix migrations IDs / related tests
adjusting no results message for tehants
fixing unit tests, adding e2e test for permissions
chore: add timestamp columns to tenants (#60575)
* chore: add timestamp columns to tenants
* fixup! add hooks
* kick ci
Auto provision tenants, respect tenants feature (#60571)
deactivate tenant users along with their tenants (#60552)
* deactivate tenant users along with their tenants
Tenant users from deactivated tenants were already prevented from
logging in (we checked the activation status of their tenant) but for
bookkeeping it's probably best to actually deactivate the users
themselves along with their tenants, and reactivate them if the tenant
is reactivated.
* invalidate users when updating a tenant, adjust external users list screen
* e2e test
---------
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
audit events for tenants (#60647)
* Revert "Delete unused string util from metabase lib (#64389)"
This reverts commit 0af38ef8f0.
* fix the build
* fix tests
* fix rebase error in invite button
* fix more tests
* fix more tests
* fix more tests
* fix more tests
* fix more tests
* fix more tests
* fix another test
* Fix another couple tests
* and more
* and more
* Close the modal to create shared tenant collection after it is created (#66049)
* Fix more tests, nearly all e2e tests passing
* a couple more tests
* couple more tests
* last (???) few tests
* Remove edit permissions in ellipsis menu when viewing shared tenant collection (#66042)
* Suggest external users only when adding tenant group members (#66046)
* feat: separate namespace for tenant collections (#66102)
* fixup! FE build
* feat: add remote-sync support for tenant collections (#66272)
* feat: add remote-sync support for tenant collections
* Update permissions.clj
* fixup! tests
* fixup! enterprise tests
* fixup! mysql/h2
* EMB-1011: add default read perms for namespace
* Fix tests (#66403)
* Fix tests
Not exactly sure how these got merged, I think maybe they were hidden by
GH issues.
* Fix kondo
* fix apparent rebase error
* fixup! EMB-1065 fix namespace filtering
* fixup! some bad perms tests
* fixup! remote sync dep checking across collections
* fixup! remove blank test
* fixup! missing tenant setting
* fixup! add premium feature declaration
* fixup! get test working with h2
* fixup! revert h2 fix
* fixup! revert h2 fix
* fixup! real h2 fix
* Dedicated Tenant Collections
* More fixes
* Tests and more fixes
* Fix rebase error
* rename
* Fix query for shared tenant collections
* fixup! UXW-2386 don't pass `tables` model into tenant root
* fixup! UXW-2436 build correct path for namespaced collections
* Remove test of non-existent fn
* Fix failing frontend unit and e2e tests in tenants feature branch (#66243)
Co-authored-by: John Swanson <john.d.swanson@gmail.com>
* fix failing frontend ESLint errors
* Prefix users and groups as "Internal" in admin settings when tenants are active (#66169)
* Update design of the user strategy modal for tenants (#66182)
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
* Add multi-tenancy setup guide to embedding hub (#66113)
* Update design of the tenants listing and internal user page (#66193)
* Give tenant users a personal collection
* Fix BE tests
* another be test
* Add specific error messages for JWT tenant claim errors (#66172)
* kondo/fmt
* fix running jwt tests standalone
* feat: per collection setting (#66475)
* feat: per collection setting
* feat: remove unsynced collections
* fixup! tests
* fixup! lints
* fixup! test
* Remove duplicated tenant permissions
* handle disabling feature more cleanly
when tenants is turned off:
- disable all tenant users
- reject any logins from tenant users
- reject any JWTs that specify a tenant
* Add tenant entity picker e2e tests. Fix one bug surfaced
* uxw-2456: remove drop shadows from dedicated tenant collection cards
* Hide tenant collections permissions tab when tenants are disabled (#66537)
* Hide create shared tenant collection button on sidebar for non-admin users (#66538)
* Hide tenant collections sidebar section when no collections exist for non-admins (#66539)
* Fix dedicated tenant collection root in collection picker as tenant user (#66549)
* fix frontend type-check: only set namespace if it is defined
* EMB-1093: Fix not passing a tenant attribute
Fixes [EMB-1093: If you enable multi-tenants and don't add JWT
attribute, it will
break](https://linear.app/metabase/issue/EMB-1093/if-you-enable-multi-tenants-and-dont-add-jwt-attribute-it-will-break)
* EMB-2459: Fix restrict where collections can be moved to
* Fixup working e2e entity picker tests
* fixup! mysql namespace tests
* fixup! tenant group mapping tests
* fixup! ws
* tree endpoint allows specifying multiple nses
* fix broken test
* Show dedicated tenant collections in collection pickers for admins (#66583)
* feat(sdk-bundle): add tenants ee plugin (#66586)
* fixup! bad ns clause audit feature is off
* fixup! UXW-2473 support non-string attributes
* Hide tenant collections section when there are no visible shared collections (#66597)
* Add tenant cards to search
* fixup! tenant collection cleanup
* EMB-1082 rename strings in the ui (#66603)
* make tenant field required (#66516)
* change `tenant` key to `@tenant`
- if the feature is off, you can still log in if you have the `@tenant`
key set. It will be silently ignored, but a warning will be logged.
- if the feature is on, `@tenant` is a drop-in replacement for `tenant`.
- we'd previously prevented setting user attributes that start with `@`.
This updates `remove-invalid-attributes` to do the same with JWT/SAML
attributes.
* add SAML tests
* Expose SAML attribute for tenant
* External users can't use MB if feature disabled
Plus add tests for:
- tenant user, feature disabled
- tenant user, feature unavailable
* Add missing test files
* Multi-stage embedding data picker should query models and questions from tenant collections (#66598)
* Fix external group tooltip referencing All Internal Users (#66654)
* Allow conversion of tenant <-> internal users
Upon conversion, all previous group memberships are destroyed and the
user is added to either the "All External Users" or "All Users" groups
accordingly.
* feat: implementing new tenant/remote-sync designs (#66567)
* fix missing dep in test file
and a tiny removal of an unnecessary `dissoc`
* fixup!: broken embedding page due to bad rebase conflict resolution
* fixup!: fix type errors
* fixup!: fix frontend jest unit test errors
* fixup! Move search tests requiring EE to EE code
* Fix copy test
* add confirmation warning when disabling tenants (#66697)
* fix test
* more renaming
* fixup!: failing tenants.cy.spec.js test and rename "All tenant users" migration
* fixup! whitespace fixes
* Remove serialization for dropped column
* fixup! missing migration
* fix other wrongly ordered migration
* fixup! Ordering more migrations
* fixup! other tests
* fix test
* fix another test
* api response schemas for tenant endpoints
* kondo
* one more kondo
* fixup! bad test query
* fixup! popover to use the right way of passing args
* Fix push changes modal
* fixup! correct token for entity picker tests
* Fix tenants e2e test with correct attribute
* fixup! tenants tests
* fixup! remove test for old behavior
* fix type on events, removed unused string union values
* update MainNavSharedCollections.unit.spec.tsx to use the new name
* fix linting issue unused import
* remove test file not on master anymore
* fix permissions select
* fix dashboard filters autowiring e2e test
* fix formating of module.edn
* remove useless test file
* add enum for namespaces
* fixup! remove toggle
* Update EntityPickerModal.tsx
* Remove commented tests
* Update e2e test based on feedback
* Split add-attributes-test
* Update test/metabase/collections_rest/api_test.clj
* Fix copy cmd model list
* Remove :put handling code for is_remote_synced
* Update src/metabase/premium_features/settings.clj
* Update resources/migrations/056_update_migrations.yaml
* Remove extraneous regex in api def
* Update frontend/src/metabase-types/analytics/event.ts
* UXW-2536 popup remote-sync modal after request
* Remove the "sidebar" event type
* Improve some backend tests
* Fix remote-sync e2e tests
* refactor: remove useAdminSetting and use settings already in the
component
* same for the jwt form
* move error message to Messages
* variant filled for apply button
* convert attributes to strings on read/write
In practice there is no difference between the value `true` and the
value `"true"`, so let's keep things simple by making all attributes
maps of string->string.
Fixes [UXW-2550: Cannot edit tenant users with non-string attributes](https://linear.app/metabase/issue/UXW-2550/cannot-edit-tenant-users-with-non-string-attributes)
* fw={500} => medium
* add c() to t`Sync {collection.name}`
* useSetting("use-tenants") in MainNavSharedCollections
* fixup extra dialog on permspagelayout
* fix broken tests
* fix the other broken test
* Remove tenant collection app permission
* Fix embedding sdk collection type
* Convert tenants e2e test to typescript
* move setupRemoteSyncEndpoints to server-mocks folder
* actually remove it from test-utils
* Small BE fixes
* use usePrevious from react-use
* Remove custom root tenant collection hook
* Change group detail to use text
* fix sdk type
* Redid git controls with button.group
* fixup! bad test
* fixup! tenant logic and components into plugins
* Update frontend/src/metabase/lib/string.js
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
* fixup! bad merge
* Rearrange last unit test for CollectionPicker
* fixup! PR feedback
* fixup! handle nils and seqs in attributes
* fixup! kondos
* fixup! better stringify
* Add missing maybe to login attributes schema
* fixup! yaml tests
* fixup! sequential check
* fixup! Stringify ldap attributes
* Fix ldap tests
---------
Co-authored-by: John Swanson <john.swanson@metabase.com>
Co-authored-by: John Swanson <john.d.swanson@gmail.com>
Co-authored-by: Phoomparin Mano <phoomparin@gmail.com>
Co-authored-by: Phoomparin Mano <poom@metabase.com>
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
Co-authored-by: Nicolò Pretto <info@npretto.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Ryan Laurie <30528226+iethree@users.noreply.github.com>
OOMs in cloud are linked to this weak map retaining too much. The
exported heap dump reports are suggestive but not conclusive, and I
can't reproduce locally.
Adds `:metabase-query-processor/computed-weak-map-queries` to measure
the size of the weak map. That should sawtooth with GCs as it
accumulates queries and then discards them, but we'll see if it rises
forever on the problem instances.
This also adjusts the caching for a `MetadataProvider`-level entity
(`:metadata/card`) from the weak map to the `MetadataProvider`'s
internal cache. That's speculative, since there's no evidence to link
it to the issue, but it should be at least as effective a cache and
there's less risk of accidentally retaining too much.
* Closes EMB-990 add description to columns in CollectionBrowser
* keep the existing behavior with tooltip unless description is explicitely set to be visible
* .
* addressed comments
* cleaned up unit tests
* Ignore collection for unpublished tables
Unpublished tables have no collection and the `collection_id` means
nothing, and should be ignored.
* Add a test
* Fix legacy search permissions
Legacy search ignored the collection permissions for published tables,
so it was possible to get a table back from search even though you
didn't have permission to see it because it was published to a table.
* segments: published table segment list, revision history, dependency graph, breadcrumbs, move preview to the menu
* specs
* fix specs
* dedupe tests of segments pages
* fix avatars
* fix rebase
* visuals
* update specs
* final refactoring
* polish
* review
* drop react context although it adds a bit of dupe
For those of us who use clojure-mcp (https://github.com/bhauman/clojure-mcp), our Claude configuration directly contradicts instructions we're giving it. This PR only adds to our `CLAUDE.md` and our skills a note that **if** clojure-mcp is available, it should prefer it over shell-based methods (like `./bin/mage -repl`).
docs scoop up all settings and has ways to avoid. In
`metabase.cmd.env-var-dox/avoid?` This had a docstring and then an extra
docstring. We can just copy the nice docstring to the docstring slot and
put `:doc false`.
```clojure
(defn- avoid?
"Used to filter out environment variables with high foot-gun indices."
[env-var]
(or (false? (:doc env-var))
(false? (:can-read-from-env? env-var))
;; Ideally, we'd move off of this list completely,
;; but not all environment variables are defsettings.
(contains? env-vars-not-to-mess-with (format-prefix env-var))))
```
* Show breadcrumbs on published table page (Library > Data > <table>)
* UXW-2524 Makes table breadcrumbs dynamic
* Adjust e2e test
---------
Co-authored-by: Brad Anderson <brad@metabase.com>
* UXW-2527 Disallows Library as an option in the snippet collection modal
* UXW-2534 Renames root sql snippet folder from "Top folder" to "SQL snippets" globally
this file got removed during a master->uxw-394-sub-collections-permissions-toggle merge on the PR #65928
the file had some changes, and removing it was not intended.
the version restored is this one, extracted from the same PR:
ab62f89a2c
motivating example:
we ran the redshift tests, and had three failures: redshift 1, redshift
2, and redshift transforms.
redshifts 1 and 2 timedout at 60 minutes. But the log upload failed
because the python transform tests failed in 24 minutes and then
uploaded:
from the transform failure run:
```
Run actions/upload-artifact@v4
with:
name: test-logs-be-tests-redshift-ee
path: logs/test-log.json
retention-days: 1
if-no-files-found: warn
compression-level: 6
overwrite: false
include-hidden-files: false
env:
CI: true
...
With the provided path, there will be 1 file uploaded
Artifact name is valid!
Root directory input is valid!
Beginning upload of artifact content to blob storage
Uploaded bytes 1072768
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact zip is 267d4b085d49ca4d682fedca97832fecb603bbb5a52c0e1d99bd4daa49984ba3
Finalizing artifact upload
Artifact test-logs-be-tests-redshift-ee.zip successfully finalized. Artifact ID 4816135520
Artifact test-logs-be-tests-redshift-ee has been successfully uploaded! Final size is 1072768 bytes. Artifact ID is 4816135520
```
And then from the redshift tests:
```
Run actions/upload-artifact@v4
with:
name: test-logs-be-tests-redshift-ee
path: logs/test-log.json
retention-days: 1
if-no-files-found: warn
compression-level: 6
overwrite: false
include-hidden-files: false
env:
CI: true
...
With the provided path, there will be 1 file uploaded
Artifact name is valid!
Root directory input is valid!
Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run
```
The same happens on redshift part 1.
```
Error: Failed to CreateArtifact: Received non-retryable error: Failed
request: (409) Conflict: an artifact with this name already exists on
the workflow run
```
This just introduces on the driver action to look for a
logs-artifact-suffix and use it if present. And on driver jobs that use
a matrix include the matrix.job.name (or matrix.version.name depending
on the exact structure).
* Fix query normalization issues in v57
* Remain strict when saving a query
* replace bad dataset_query with legacy_query
* Test fixes 🔧
* Test/Kondo fix 🔧
---------
Co-authored-by: dan sutton <dan@dpsutton.com>
### Description
In https://github.com/metabase/metabase/pull/65343 we added a page to purchase Metabase AI (Metabot). Now we are improving the text to:
* Show information about trial only if Metabot was not already trialed
* Improve wording regarding multiple questions / messages in chat
### How to verify
1. Ensure you have a token with the `offer-metabase-ai-tiered` feature, but without the `metabot-v3` feature.
2. Check that the subscription associated with the token had either with (test case 1) or without (test case 2) the `metabase-ai` or the `metabase-ai-tiered` add-on.
3. Navigate to `/admin/metabot` and see the page look like in the mock ups.
### Checklist
- [x] Tests have been added/updated to cover changes in this PR
Closes: https://linear.app/metabase/issue/CLO-4673/show-different-copy-on-metabot-ai-purchase-page-after-trial
Closes: https://linear.app/metabase/issue/CLO-4688/copy-correction-in-the-admin-panel
* #66585 Updates static embeds to omit color-scheme settings to preserve legacy transparent iframe behavior
* support public embed too (#66693)
* support public embed too
* Imports isPublicEmbedding to prevent app crash
---------
Co-authored-by: Brad Anderson <brad@metabase.com>
---------
Co-authored-by: Nicolò Pretto <info@npretto.com>
If you have a query like "WITH query_a AS (...), query_b AS (select ... from query_a) SELECT ... from query_b",
native query parsing understood that query_b in the final query referred to query_b in the WITH, but it didn't realize
that query_a in query_b referred to query_a in the WITH. Now, it should understand these sorts of depedent ctes.
* Move documents feature to OSS
* Remove plugin
* Move comments, remove public sharing plugin
* Fix some CI issues
* Move documents BE to OSS
* Move documents BE to OSS
* Move documents BE to OSS
* Move documents BE to OSS
* Move documents BE to OSS
* Fix bug with state
* Move rest enterprise imports
* Remove token checks from apis related to documents
* Fix CI
* Fix CI
* Fix CI
* Fix CI
* Fix BE tests
* Fix CI
* Fix CI
* Fix bookmarking a document
* Add branding footer for public document
* Add e2e tests
* Fix CI
* Fix CI
* Fix CI
* Fix CI
* BE fixes for documents to oss (#66511)
* reinstate sandbox test
* refactor circular deps
* fix: copy documents/comments
* fix path
* remote-sync tests are ee only
* ee only
* documents are not just ee
* kondo
* missing mapping
* set site-url
* fix broken tests
* Fix metabot plugin
* Fix issue where having a metabot block inside a document prevents it from loading when publicly shared (#66564)
* Prevents public document view from crashing when document contains a metabot node. Uses fallback similar to print version.
* Omits SupportingText drag handle when in read-only mode
* Adds e2e test to verify metabot blocks don't crash public documents and aren't editable within them
* Fix accidental spacing change
* Fix unit tests, cleanup e2e test
* fix after merge
---------
Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
* add events when making cards/dash pubic or retracting
https://github.com/metabase/metabase/issues/64417
When we make a card public, we put a uuid on it and include
`made_public_by_id`. But when you retract the public link, we remove
both bits of information. This is a nice invariant but it removes
information about who publicized a card.
Imagine a card is discovered by have been public. Of course you want to
immediately remove it. But this erases the audit trail (so to speak) of
who made it public. It is not a great idea to delay remediation during
the investigation. Now you can just consult the audit log
* make events
* formatting
* clean up tests a bit
tests were a bit wack. We should have utility functions to get audit
events. Also noticed we are going off of the object id and ignoring the
object. Could lead to gross issues if there's dashboard with id 4 in
there and also card with id 4. so require model on new one
* fmt
* Remove models
* Remove models
* Move
* Move
* Drop columns for model publishing
* Drop columns for model publishing
* Drop columns for model publishing
* Drop columns for model publishing
* Rename library-models to library-data
* Rename library-models to library-data
* Rename library-models to library-data
* Rename library-models to library-data
* Fix tests
* Fix table URLs
Comment out MB_PREMIUM_EMBEDDING_TOKEN in .env.example to prevent
conflicts with Cypress tests that need to start from a clean state, and
set tokens programmatically.
Fixes#66464.
This was a corner case in `lib.field.resolution` and `qp.util.add-alias-info`
that regressed in 57. It made the QP less smart about repairing a certain
class of broken queries, which regrettably exist in the wild.
The breakage in question was a `:field` ref in later stage, which had a
numeric field ID and a `:join-alias`. If that field ID was not actually
returned as part of the join anymore, fallback metadata would be
generated by looking up the field by ID. That "works" for non-joined
fields but for an explicitly joined field it would use
`source."SOME_FIELD"` rather than `"The Join Alias"."SOME_FIELD"`, which
causes SQL compilation to fail.
### Description
In https://github.com/metabase/metabase/pull/65343 we added a page to purchase Metabase AI (Metabot). Now we are improving the layout and content to better present the product.
### How to verify
1. Ensure you have a token with the `offer-metabase-ai-tiered` feature, but without the `metabot-v3` and `offer-metabase-ai` features.
2. Navigate to `/admin/metabot` and see the page look like in the mock ups.
### Checklist
- [x] Tests have been added/updated to cover changes in this PR
Closes: https://linear.app/metabase/issue/CLO-4669/make-small-changes-to-ai-page-in-admin
* Combine metabot search queries using OR
* Fix zero-terms edge case
* Point out a critical defect
* Urgent typo
* Add docstring to join-results-by-rrf function
Co-authored-by: crisptrutski <881351+crisptrutski@users.noreply.github.com>
* Use non-semantic fallback engine for term-queries
* Group experimental options together
* Small fixes and testing
* Workaround for semantic search matching unwatned stuff
* Renaming and wiring
* Remove unused import
* Remove sharp edge around 0 queries
* Fix bug in disjunction for legacy search. Test coverage for it.
* Complete comment
* Whitespace lint
* Try to fix new tests - run in semantic search test group, simplify test configuration
* More test fixes
* More test fixes
* Whitespace lint
* Make appdb search check more explicit
* don't run metabot semantic search tests on h2 because they rely on the appdb backend being available
* address test comments
* remove experimental flags; make this the normal behavior
* fix test
* fix disjunction on h2
* try again to fix search-test
* move search-test to metabase-enterprise.metabot-v3.tools.semantic-search-test since it now requires semantic search to be available
---------
Co-authored-by: Chris Truter <chris@metabase.com>
Co-authored-by: crisptrutski <881351+crisptrutski@users.noreply.github.com>
* Add a subscription button for modular embeddings (#65704)
* Add an entry to the dashboard subscriptions on modular embeddings
* Hide the subscription when email hasn't been set up
* Add tests
* Add subscription button to interactive and editable dashboard components
* Make dashboard button styles consistent + expose subscriptions button
* Fix types
* Fix wrong default `aria-label` for `ToolbarButton`
* Support `withSubscriptions` prop
* Add tests
* Make it so that modifying tests would be easier
* clarify missing assertions with a comment
* Fix types
* Update Loki Snapshots
* Add `withSubscriptions` to storybook
* Remove duplicate test
* Fix comment date format
* Tighthen ToolbarButton prop type
* Avoiding cramping all test combinations into a single test
* Move shared tests to the correct directory
* Make the function parameter order makes more sense
* Simplify SDK dashboard button visibility logic
* Make shared tests more structured
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
* Avoid showing other subscription channels (#66126)
* Make text search easier on an enum
* Prepare state for upcoming change
* Avoid showing the NEW_PULSE screen on SDK
* Add tests
* Fix tests
* Make mocking module more idiomatic
* Update subscription sidebar email edit view content (#66258)
* Update subscription sidebar email edit view content
* Add tests
* Improve test related variable name
* Properly memoize parent callback
* Add dashboard subscriptions option to EAJS dashboards (#66309)
* Expose `withSubscriptions` to EAJS dashboards
* Close subscription sidebar when unchecking `withSubscriptions` checkbox on EAJS
* Add `withSubscriptions` to EAJS dashboards
* Add tests + adjust no email setup tooltip condition
* Add missing unit tests mock
* Only closes sidebar when subscriptions sidebar is open
* Make guest embed warning tooltip aligned with its label
* Fix a test after merging guest embeds
* Update tooltip design from using hovercard to tooltip
* Close the subscription sidebar when the last pulse is archived (#66496)
* close the subscription sidebar when the last pulse is archived
* Ensure we only close the sidebar on the last subscription deletion
* Remove unused code
* simplify mocking
---------
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
* Added one happy path e2e test (#66506)
* Added one happy path e2e test
* .
* .
* Pass tests on CI with SMTP server
* Remove unused interceptions
* Use explicit assertions
---------
Co-authored-by: Mahatthana (Kelvin) Nomsawadi <me@bboykelvin.dev>
* Run maildev in CI
* Fix admins aren't shown subscription list page after creating first subscription (#66372)
* Run maildev in CI
* Fix admins aren't shown subscription list page after creating first one
* Fix test name typo
* Apply suggestions from code review
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
* Fix tests after merging another PR
---------
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
* Make subscriptions on SDK/EAJS a Pro feature (#66392)
* Make subscriptions on SDK a Pro feature
* Add subscription only to EAJS on pro plan
* Correct directory name
* Fix InteractiveDashboard unit tests to use EE token
* Fix StaticDashboard tests to use EE token feature
* Fix EditableDashboard tests to use EE token feature
* Remove OSS tests because there's no SDK on OSS version
* Update Eajs related terms
* Allow subscriptions SDK plugin to be reinitialized
* Standardize plugin enabled property name for EAJS plugins
* Add embed wizard tests
* Add EAJS tests
* Fix OSS test
* Add missing assertions on Enterprise tests
* Optimize API calls on SDK/EAJS
* Clarify comments
* Use initialize plugin pattern for EAJS
* Fix test name
* Fix assertion because upstream content change
* Auto update EAJS subscriptions options after configure email
* Update no email setup tooltip
* Remove debugging code
* Try to fix 1 nasty E2E test
* Fix the samn test again
* Fix the E2E again™️
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
Co-authored-by: Sébastien <sebastien@metabase.com>
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
* When setting settings, include 5 minute cookie of updated timestamp
if other instances have outdated settings cache, this cookie will let
them know what the requestor has seen. The instance can then know it is
out of date. This won't help for instances that aren't hit by the person
setting the setting.
Motivating example is someone who is doing an embedding onboarding
checklist. And then hits a new instance that hasn't yet loaded the "show
embedding homepage" setting so it flips back to the regular
homepage. The hope here is the person doing this checklist will let the
other instance know it is out of date, reload the settings cache and
then see the embedding setting.
* Interesting strategy here for cookies.
I hated that the route would would set a cookie at a particular key, do
timestamp stuff, etc. I know ring is a map and abstraction, but i added
a new paradigm:
```clojure
(defn- add-settings-last-updated-cookie
"Add a cookie with the current settings-last-updated timestamp to the response."
[response]
(assoc-in response [:mb/cookies :cookie/settings-cache-timestamp] true))
```
This means that just the middleware is responsible for checking and
setting this key. This was largely driven by two different namespaces
having a private def of:
```clojure
(def ^:private settings-last-updated-cookie-name "metabase.SETTINGS_LAST_UPDATED")
```
And it's nice if the ring map can indicate to this middleware to handle
all the key and timestamp stuff and it just has to indicate to set this
with `cookie/settings-cache-timestamp`.
So the request looks like this:
```clojure
{:status 204
:headers {"X-Frame-Options" "DENY"
"X-XSS-Protection" "1; mode=block"
"Last-Modified" "Mon, 1 Dec 2025 17:09:59 GMT"
"Strict-Transport-Security" "max-age=31536000"
"X-Permitted-Cross-Domain-Policies" "none"
"Cache-Control" "max-age=0, no-cache, must-revalidate, proxy-revalidate"
"X-Content-Type-Options" "nosniff"
"Content-Security-Policy" "...<lots of junk>..."
"Expires" "Tue, 03 Jul 2001 06:00:00 GMT"}
:body nil
:mb/cookies {:cookie/settings-cache-timestamp true} ;; <---- our new addition
:cookies {"metabase.DEVICE" {:value "60ac9454-9dd1-439a-afa1-921ff029686d"
:http-only true
:path "/"
:expires "Fri, 1 Dec 2045 17:09:59 GMT"
:same-site :lax}}}
```
And then in practice, it looks like this:
Set the setting and get a cookie with the timestamp in response:
```
❯ http put :3000/api/setting/site-name value=foo x-api-key:$KEY
HTTP/1.1 204 No Content
...
Set-Cookie: metabase.SETTINGS_LAST_UPDATED=2025-12-01+17%3A28%3A15.450873%2B00; Path=/; Max-Age=300; SameSite=Lax
...
```
Simulate sending to another instance with a timestamp that exceeds the
currently know timestamp (i'll increment the hour based sent back in
this response)
```
❯ http get :3000/api/user/current x-api-key:$KEY Cookie:metabase.SETTINGS_LAST_UPDATED="2025-12-01+18%3A23%3A51.059155%2B00" | jq '.date_joined'
"2025-12-01T16:51:08.137822Z"
```
(note the 18 vs the 17)
And the logs are this:
```
INFO middleware.settings-cache :: Settings cookie indicates cache is out of date. Refreshing...
DEBUG middleware.log :: GET /api/user/current 200 19ms (11 DB calls) App DB connections: 0/4 Jetty threads: 5/50 (5 idle, 0 queued) (245 total active threads) Queries in flight: 0 (0 queued) {:metabase-user-id 346}
```
* fixes:
- logged known timestamp not weird cookie value
- timestamp is optional, so handle that
- typo in log konwn -> known
* Add tests, add functionality
tests:
ensure it (a) sets the cookie, (b) honors the cookie, and when it
restores the cache, to set the cookie so it doesn't keep thrashing. But
presumably it won't since it's up to date. My "in the future" version is
a bit synthetic.
Functionality wise, updating the cache now returns and this will saet
the header with the most recent cache setting
* fix: show confirmation on escape, clickoutside and browser's back actions for SidebarCacheForm (#53825)
additional: refactor useConfirmOnRouteLeave hook, add an ability to get router across application without property drilling using hook instead
# Conflicts:
# frontend/src/metabase/plugins/index.ts
* fix: small adjustment
* fix: small adjustment
* fix: tests
* fix: tests
* fix: created useStackedSidesheets hook to help control stacked sidesheets
* adds a test for useStackedSidesheets that covers #53825 issue
* adds tests for useConfirmOnRouteLeave that cover #53825 issue
* rename useStackedSidesheets to useStackedModals. Add backward compatibility prop opened
* fix: add history provider as well for the future purposes.
* fix typings
* fix code based on comments from PR
* fix tests
* fix tests
* fix tests
* remove useStackedModals. Write e2e for all "closing" actions
* remove useStackedModals. Write e2e for all "closing" actions
* adjusted code according to PR comments
* fix tests
* make tests that asserts the confirmation modal showing if there are dirty form explicit in order to see which of them is broken in CI
* fix tests
* remove "forward" browser's button testing on trying to close a dirty form
* fix tests
* fix tests
* Fix sub-collections toggle to stick when permission seletor is closed / Handle dirty state gracefully
* Add e2e tests
* Fix outstanding e2e tests
* Remove e2e test that was expecting the previous undesired behavior
* Update test that accounts for issue #30494
* Add clarifying comment
* data studio app permission
* actually transforms are for admins
* check permission for open in data studio
* Auto-set library permissions on data studio permission changes
* Fixed module references
* initial library collection perms
* Fixed module references
* Fixed module references
* Fixed lint errors
* perms
* specs, fixes
* ci
* data studio permission
* Added data-studio permission check to glossary
---------
Co-authored-by: Nathan Voxland <nathan@metabase.com>
* IAM auth note on postgresql
* move to rds
* rds
* mysql note on verify-ca
* Update docs/databases/connections/aws-rds.md
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
---------
Co-authored-by: Alex Yarosh <alexandra@metabase.com>
* Add display_name filtering to table list
* Re-introduce mixed case LIKE for mysql/maria
Must have been lost in a merge conflict
* Escaping rules
* Kondo
* Add Metabase Sample Database to editable tables support
Updated the list of databases that support editable tables to include Metabase Sample Database.
* Update docs/data-modeling/editable-tables.md
* Update docs/data-modeling/editable-tables.md
- If you decide to build the backend, you should run it
- There are no more derived options - everything is explicit
- Running Docker containers is a non-negotiable
- Tests need these supporting services to run
- If you really insist on not running them, either comment out those lines temporarily or do not use this script to set up the e2e environment
- Because of this, there are no more custom envs `QA_DB_ENABLED` and `CYPRESS_QA_DB_MONGO`
- Alternative location (directory) for the e2e copy of the sample-application.db is now set to be `e2e/tmp` since it's already gitignored
* UXW-2209 Updates datamodel tracking triggered_from to be either "data_studio" or "admin" depending on where the metadata is being edited
* Updates e2e tests
* UXW-2352 Fix issue where CopyCardForm resets when the destination collection is changed
* Unskips now-passing e2e tests
* Fix issue where Duplicate modal doesn't close on success
The previous version of the build script (`build-for-test`) had a weird quirk that could be both confusing and dangerous. It was building a backend-only JAR in the same location and under same name as the full-blown, all-in-one Metabase JAR. This means that, by running Cypress locally, one could easily override the previously built healthy JAR. It's not catastrophic but it was confusing.
This PR makes it perfectly clear what we're doing, and there should be no conflicts between the JARs any longer.
* library collection search
* Fix e2e tests from group-16
* Fix a couple tests from group 42
* Fix e2e tests from group-17
* Fix e2e tests from group-18
* tests: add bulk publishing scenario
fix wrong collection link in case of root collection
* UXW-2315, UXW-2314
* UXW-2294
* more UXW-2315, UXW-2314
* more UXW-2315, UXW-2314
* correct collection types
* Remove Browsing Memory Feature
* Revert "Revert "Don't return library collections by default from APIs""
This reverts commit 814c49473b.
* Revert "Revert "Fixed null type filtering""
This reverts commit 25e0d78408.
* fetch full tree to have library collections visible
* show library in permissions
* Fixing tests
* fix infinite re-render in tree
* rewrite unit tests and fix max depth problem
* fix: publish property not validated in the tree view after table publishing
* Move bulk editing apis to enterprise (#65968)
* Make sidebar sticky
* test: bulk attribute actions for tables, schemas and dbs
* fix more unit tests
* Copy preview section tests
* Copy error handling tests
* Copy undos tests
* Update test
* test: update new ee endpoints paths
* Make new bulk table APIs ee-only (fe)
- Closes GDGT-1251
* Fix global H.DataModel.visit overrides
* Remove redundant cy.reload
* Remove redundant cy.reload
* add select/deselect tests
* use helper
* data picker using proper library endpoint. Fixing types I broke. Endless Shame
* Fix Tree skeleton resizing multiple times during loading
- Closes GDGT-1253
* Improve icon
* Fill content
* don't call getCollectionItems on database collection
* add search tests and support shift click in search
* default table publish collection
* fox: reset bulk form values when selection changes
* Fix e2e tests from group-19
* fix: fix missing dependencies in useEffect gdgt-1245
* test: refactor test setup action order
* Fix e2e tests from group-20
* Fix e2e tests from group-22
* Fix e2e tests from group-23
* test: restore default db as the first step
* Kondo the kondo config
* default collections for metrics and models outside of data studio
* Move edit test to ee
* Fix list filtering now default is bronze
* Move bulk-edit-test to ee
* Fix table metadata for test
* Revert "Added `collection` argument to search"
This reverts commits:
- 21999e01
- b0f71c03ea
- 4fa0c3b422
* Fixed OSS loading of tables
* Fixed OSS loading of tables
* add tests for filtering
* Fix e2e tests from group 41 / joins-repros
* more tests
* Fix e2e tests from group-20
* Fix e2e tests from group-23
* Fix e2e tests from group-24
* Fix e2e tests from group-26
* Fix e2e tests from group-27
* Fix e2e tests from group-28
* Fix e2e tests from group-30
* constuct initial paths from library collections
* segments editor, hasEnabledNestedQueries
* Fix a couple more (something between groups 40 and 43)
* Fixed module config
* keyboard navigation
* Added library/tree API
* Fix some e2e tests from groups 40 and 42
* Fixing tests
* disable scoped search on the 'database collection', models.cy.spec should be passing now
* Fix e2e tests from group-33
* Minor cleanup
* Fix e2e tests from group-34
* Fixing tests
* Fix e2e tests from group 37 (except one depending on Recents tab)
* Starts fixing e2e tests from oss group
* cleanup
* wait to focus
* hide our analytics in the data studio
* Added library/tree API
* merge library and data studio
* change backend library flag validation to data-studio
* tidy things up
* Make bulk edit inputs non-clearable
- This prevents sending "empty" requests when clearing values
- And clearing does not really make sense here
* fix: test: table rescan and discard mocks are wrong
* fix: test: wrong mock in oss sync table schema
* Remove ^:parallel from bulk edit tests
They can contend and cause deadlocks
* fix: test: failure due to repeated mocking of same route
* test: refactor: cypress table tests
* Update e2e test
* Update e2e test
* Update e2e test
* fix browse nav section test
* Add missing token
* add check icon for published tables
* Removed unused import
* Updates some e2e tests from oss group, removes some now-invalid tests
* test: use default external db, skip transform test
* Starts fixing e2e tests from mongo group
* remove background from not active table in search
* specs
* Fix e2e tests from group-15
* hack fix ci while i'm on meetings
* scoped search is back
* Fix some e2e tests from group-32
* table picker fixes
* Fixed merge
* Fix e2e test from group-42
* merge fixes
* re-enable the recents tab on the data picker modal
* Avoid race condition on list-table-filtering-test
* fix embedding types
* mini picker unit tests
* Fixing tests
* ci, fixes
* fix library collection bugs
* cleanup data studio plugin
* fix lots of unit tests
* fix import
* fix
* Fixed unused import
* Fixed accidental #p
* ci
* revert util
* specs
* specs
* specs
* fix bug / bad type in SchemaFormSelect (#65995)
* Use actual anti join in GET /table query
* Remove old comments
* Activate token after restore
* test: unskip table metadata transform test
* test: fix search tables e2e test
* fix: test: selection in table picker
* Fix Source input disabled when filtering by Metabase transform
- Closes GDGT-1259
* test: fix: filter unused table
* Fix e2e test
* fix: test: datamodel toasts and errors
* Fix e2e test
* Fix e2e tests from group-9
* Fix flaky tests
* GDGT-1244: Fix DB tree virtualization (#66125)
* GDGT-1244: Fix tree virtualization. Replace top with translateY to improve performance
* GDGT-1244: Fix scroll bug. Refactor border styling
* bring back modeling empty state
* test: adjust publishing test
* Fix e2e test from group-22
* Fix e2e test from group-25
* fix allowing cross DB joins
* properly disable invalid items in MiniPicker
* Fix e2e test from group-26
* Fix straggler from oss group
* Starts fixing e2e tests from group-32
* unit test adjustments
* Fix remaining issue with e2e group 37
* fix item filtering
* Update Loki Snapshots
* add recent views to mini picker
* test recents and backparsing
* additional filtering test
* fix minipicker shows items it should not show
* Fixed :here in library API
* Fixed :here in library API
* UXW-2358 publishing outside of the data studio
* Fixed :here in library API
* snapshot
* Fix most e2e tests from group-32
* Lint fixes
* Fixed failing test
* revert fix
* Reapply "Added `collection` argument to search"
This reverts commit f28d9d5af9.
* Quick fix in CollectionPicker/utils.ts
* Fix flaky Remote Sync test (#65862)
* Clean up backend-test matrix (#66158)
* Fix timeseries value detection (#66161)
* Prevent driver tests (#66156)
Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
* Fetch uberjar using a proper action (#66165)
* fix embedding column picking
* Trying CI with search_index.verified
* Fixed failing test
* Translate label
* Fixed failing test
* fix: published info not updated in the tree picker after deleting model
* fix: refactor: publish collection link tests
* Fixed failing test
* Fix remaining e2e tests from group-32
* FileUploadStatus unit test, quesiton reproductions
* create data studio plugin file
* fix hidden items some more
* Fix issue where confirmation modal closes then reopens again then closes again when you archive a dashboard
* fix dark mode
* UXW-2367
* UXW-2378
* Fixed merge issues
* this element is not visible because you can't even open incompatible sample database db
* Fix e2e test from group-14
* fix embedding data picker clicks
* filtering fixes for transforms
* UXW-2372
* update mini picker specs after a fix
* fix flaky join test
* Fixing in-place support for collections
* fix: cannot scroll search results
* ui: tweak search results checkbox spacing to match tree results
* fix: scroll position jump when entering field sort mode gdgt-1269
* Revert "fix: scroll position jump when entering field sort mode gdgt-1269"
This reverts commit bfecdec661.
* UXW-2279 Changes Data Studio's Glossary page background color to background-secondary
* Fix linters
* Fix e2e tests
* fixes for sqlserver
* fix driver changelog
* fix
* more fix
* fix: support params in bigq
* fix: inline params for sqlserver
* fix test
* fix: we do want the unique key
* fix: missing nil in test
* fix clickhouse
---------
Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
Co-authored-by: Anderson <anderson@metabase.com>
Co-authored-by: Jakub Chodorowicz <jakub@chodorowicz.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
Co-authored-by: Nathan Voxland <nathan@metabase.com>
Co-authored-by: Uladzimir Havenchyk <uladzimir@metabase.com>
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Dan Stone <wotbrew@gmail.com>
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
Co-authored-by: John Swanson <john.swanson@metabase.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
Co-authored-by: dpsutton <dan@dpsutton.com>
Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
This pull request refactors and streamlines the configuration for CI workflows and file path groupings in .github/file-paths.yaml and updates related workflow logic in .github/workflows/run-tests.yml. The changes focus on consolidating shared configuration, improving maintainability, and removing redundant or unused path groups.
* Add :database_type to metabot tools that return column metadata
Add :database_type to metabot tools that return column metadata in order to give metabot information about the real
database type when generating SQL.
Examples of places the :database_type now appears:
- :used_tables in :user_is_viewing context
- {table,card,metric}-details
- get-query-details
- enhanced-database-tables
* Fix test after rebase onto #66271
Fix get-table-details-database-type-test after rebase (1) use new field-id formatting (2) get-table-details no longer returns implicitly-joinable fields
in the top-level `:fields`.
* More flexible approach to resolving columns from metabot field_ids
* fix one field-stats-test
* fix field-stats-test
* support nano-ids in field ids (?)
* remove some dead code
* Exclude implicitly joinable fields when fetching cols for table
* try switching field format to use dash
* fix field IDs in a number of tests
* Kondo
* add some unit tests for new field parsing & column lookup helper fns
* Fix more tests
* Fix more tests
* fix regex
* New approach -- use wide field IDs in related_tables and add a related_by field for each table
* Fix some tests
* remove unneeded table
* cleanup, new test
* Revert to passing in & matching on expected prefix
* Address tyler's comments
* accept a regex for the prefix as well
* add back small malli group-by fix from the last PR - removed unintentionally during revision
* Make uberjar (artifact) file name configurable via env var
Add the ability to customize the output filename for the uberjar build
via the MB_JAR_FILENAME environment variable. This allows backend-only
test builds to use a separate filename (e.g., metabase-backend.jar)
to avoid overwriting the regular all-in-one metabase.jar.
* fix: add missing channels to copy & rendering logic
Mentioned webhooks and Slack where necessary to stay consistent with the
admin UI
* fix: standardize lowercase 'admin' & prefer 'email' over 'SMTP'
* fix: remove extra comma on wording
* test: adjust e2e test assertions
* test: add `DashboardSubscriptionMenuItem.unit.spec.tsx`
* test: extract single case from `describe` block
* test: fix subscriptions e2e case & text lookup on alert spec
Fixes#66199.
`metabase.legacy-mbql.schema`, now used for normalizing MBQL 4 in
place of the old bespoke normalization in earlier versions, regressed in
this weird but legitimate use case: Writing a custom aggregation like
`MAX("String Literal")`.
That's an odd thing to do, but it can be useful to provide a label in an
aggregated query. This is the MBQL equivalent of
`(SELECT ..., 'A' as label FROM ...) UNION ALL (SELECT ..., 'B' as label ...)`
This pull request refactors the Cypress runner utility to simplify error handling and improve consistency in how test failures are reported. The main change is that runCypress now throws errors on test failures instead of relying on an external exit or cleanup function, which streamlines its usage across different scripts.
This ensures consistent error propagation and simplifies the control flow for callers.
These tools already included :database_id in the results; we now include the :database_engine as well, to give metabot
a reminder about which SQL dialect it should generate.
* Bump org.apache.arrow/arrow-memory-netty from 17.0.0 to 18.3.0
Inspect dependency changes here:
* Upgrade arrow-memory-core to version 18.3.0
Updated the version of arrow-memory-core from 17.0.0 to 18.3.0.
* Consolidate changes
* Fix formatting
---------
Co-authored-by: bryan <bryan.maass@gmail.com>
Co-authored-by: Luis Paolini <paoliniluis@gmail.com>
Co-authored-by: Cam Saul <github@camsaul.com>
Co-authored-by: Cam Saul <1455846+camsaul@users.noreply.github.com>
* Fix some e2e tests from group-9
* test: add bulk sync action e2e test
* fix column selection
* Fixed module config
* Fix a few e2e tests from oss group
* Fix e2e tests from groups 46 and 47
* Fix e2e tests from groups 44 and 45
* Fix group-3 straggler, some of group-8
* Potentially disastrous change (increases item-picker-level of SchemaList and TableList) to fix test in group-8
* Fix group-6 straggler, some more of group-8
* Updates some more e2e tests from group-9 (some actual failures left)
* Fix e2e tests from group-14
* do enterprise code correctly
* library collection search
* Fix e2e tests from group-16
* Fix a couple tests from group 42
* Fix e2e tests from group-17
* Fix e2e tests from group-18
* tests: add bulk publishing scenario
fix wrong collection link in case of root collection
* UXW-2315, UXW-2314
* UXW-2294
* more UXW-2315, UXW-2314
* more UXW-2315, UXW-2314
* correct collection types
* Remove Browsing Memory Feature
* Revert "Revert "Don't return library collections by default from APIs""
This reverts commit 814c49473b.
* Revert "Revert "Fixed null type filtering""
This reverts commit 25e0d78408.
* fetch full tree to have library collections visible
* show library in permissions
* Fixing tests
* fix infinite re-render in tree
* rewrite unit tests and fix max depth problem
* fix: publish property not validated in the tree view after table publishing
* Move bulk editing apis to enterprise (#65968)
* Make sidebar sticky
* test: bulk attribute actions for tables, schemas and dbs
* fix more unit tests
* Copy preview section tests
* Copy error handling tests
* Copy undos tests
* Update test
* test: update new ee endpoints paths
* Make new bulk table APIs ee-only (fe)
- Closes GDGT-1251
* Fix global H.DataModel.visit overrides
* Remove redundant cy.reload
* Remove redundant cy.reload
* add select/deselect tests
* use helper
* data picker using proper library endpoint. Fixing types I broke. Endless Shame
* Fix Tree skeleton resizing multiple times during loading
- Closes GDGT-1253
* Improve icon
* Fill content
* don't call getCollectionItems on database collection
* add search tests and support shift click in search
* default table publish collection
* fox: reset bulk form values when selection changes
* Fix e2e tests from group-19
* fix: fix missing dependencies in useEffect gdgt-1245
* test: refactor test setup action order
* Fix e2e tests from group-20
* Fix e2e tests from group-22
* Fix e2e tests from group-23
* test: restore default db as the first step
* Kondo the kondo config
* default collections for metrics and models outside of data studio
* Move edit test to ee
* Fix list filtering now default is bronze
* Move bulk-edit-test to ee
* Fix table metadata for test
* Revert "Added `collection` argument to search"
This reverts commits:
- 21999e01
- b0f71c03ea
- 4fa0c3b422
* Fixed OSS loading of tables
* Fixed OSS loading of tables
* add tests for filtering
* Fix e2e tests from group 41 / joins-repros
* more tests
* Fix e2e tests from group-20
* Fix e2e tests from group-23
* Fix e2e tests from group-24
* Fix e2e tests from group-26
* Fix e2e tests from group-27
* Fix e2e tests from group-28
* Fix e2e tests from group-30
* constuct initial paths from library collections
* segments editor, hasEnabledNestedQueries
* Fix a couple more (something between groups 40 and 43)
* Fixed module config
* keyboard navigation
* Added library/tree API
* Fix some e2e tests from groups 40 and 42
* Fixing tests
* disable scoped search on the 'database collection', models.cy.spec should be passing now
* Fix e2e tests from group-33
* Minor cleanup
* Fix e2e tests from group-34
* Fixing tests
* Fix e2e tests from group 37 (except one depending on Recents tab)
* Starts fixing e2e tests from oss group
* cleanup
* wait to focus
* hide our analytics in the data studio
* Added library/tree API
* merge library and data studio
* change backend library flag validation to data-studio
* tidy things up
* Make bulk edit inputs non-clearable
- This prevents sending "empty" requests when clearing values
- And clearing does not really make sense here
* fix: test: table rescan and discard mocks are wrong
* fix: test: wrong mock in oss sync table schema
* Remove ^:parallel from bulk edit tests
They can contend and cause deadlocks
* fix: test: failure due to repeated mocking of same route
* test: refactor: cypress table tests
* Update e2e test
* Update e2e test
* Update e2e test
* fix browse nav section test
* Add missing token
* add check icon for published tables
* Removed unused import
* Updates some e2e tests from oss group, removes some now-invalid tests
* test: use default external db, skip transform test
* Starts fixing e2e tests from mongo group
* remove background from not active table in search
* specs
* Fix e2e tests from group-15
* hack fix ci while i'm on meetings
* scoped search is back
* Fix some e2e tests from group-32
* table picker fixes
* Fixed merge
* Fix e2e test from group-42
* merge fixes
* re-enable the recents tab on the data picker modal
* Avoid race condition on list-table-filtering-test
* fix embedding types
* mini picker unit tests
* Fixing tests
* ci, fixes
* fix library collection bugs
* cleanup data studio plugin
* fix lots of unit tests
* fix import
* fix
* Fixed unused import
* Fixed accidental #p
* ci
* revert util
* specs
* specs
* specs
* fix bug / bad type in SchemaFormSelect (#65995)
* Use actual anti join in GET /table query
* Remove old comments
* Activate token after restore
* test: unskip table metadata transform test
* test: fix search tables e2e test
* fix: test: selection in table picker
* Fix Source input disabled when filtering by Metabase transform
- Closes GDGT-1259
* test: fix: filter unused table
* Fix e2e test
* fix: test: datamodel toasts and errors
* Fix e2e test
* Fix e2e tests from group-9
* Fix flaky tests
* GDGT-1244: Fix DB tree virtualization (#66125)
* GDGT-1244: Fix tree virtualization. Replace top with translateY to improve performance
* GDGT-1244: Fix scroll bug. Refactor border styling
* bring back modeling empty state
* test: adjust publishing test
* Fix e2e test from group-22
* Fix e2e test from group-25
* fix allowing cross DB joins
* properly disable invalid items in MiniPicker
* Fix e2e test from group-26
* Fix straggler from oss group
* Starts fixing e2e tests from group-32
* unit test adjustments
* Fix remaining issue with e2e group 37
* fix item filtering
* Update Loki Snapshots
* add recent views to mini picker
* test recents and backparsing
* additional filtering test
* fix minipicker shows items it should not show
* Fixed :here in library API
* Fixed :here in library API
* UXW-2358 publishing outside of the data studio
* Fixed :here in library API
* snapshot
* Fix most e2e tests from group-32
* Lint fixes
* Fixed failing test
* revert fix
* Reapply "Added `collection` argument to search"
This reverts commit f28d9d5af9.
* Quick fix in CollectionPicker/utils.ts
* Fix flaky Remote Sync test (#65862)
* Clean up backend-test matrix (#66158)
* Fix timeseries value detection (#66161)
* Prevent driver tests (#66156)
Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
* Fetch uberjar using a proper action (#66165)
* fix embedding column picking
* Trying CI with search_index.verified
* Fixed failing test
* Translate label
* Fixed failing test
* fix: published info not updated in the tree picker after deleting model
* fix: refactor: publish collection link tests
* Fixed failing test
* Fix remaining e2e tests from group-32
* FileUploadStatus unit test, quesiton reproductions
* create data studio plugin file
* fix hidden items some more
* Fix issue where confirmation modal closes then reopens again then closes again when you archive a dashboard
* fix dark mode
* UXW-2367
* UXW-2378
* Fixed merge issues
* this element is not visible because you can't even open incompatible sample database db
* Fix e2e test from group-14
* fix embedding data picker clicks
* filtering fixes for transforms
* UXW-2372
* update mini picker specs after a fix
* fix flaky join test
* Fixing in-place support for collections
* fix: cannot scroll search results
* ui: tweak search results checkbox spacing to match tree results
* fix: scroll position jump when entering field sort mode gdgt-1269
* Revert "fix: scroll position jump when entering field sort mode gdgt-1269"
This reverts commit bfecdec661.
* UXW-2279 Changes Data Studio's Glossary page background color to background-secondary
---------
Co-authored-by: Nathan Voxland <nathan@metabase.com>
Co-authored-by: Brad Anderson <brad@metabase.com>
Co-authored-by: Jakub Chodorowicz <jakub@chodorowicz.com>
Co-authored-by: Ryan Laurie <iethree@gmail.com>
Co-authored-by: Anderson <anderson@metabase.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
Co-authored-by: Uladzimir Havenchyk <uladzimir@metabase.com>
Co-authored-by: Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
Co-authored-by: Ngoc Khuat <qn.khuat@gmail.com>
Co-authored-by: Kamil Mielnik <kamil@kamilmielnik.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
Co-authored-by: Dan Stone <wotbrew@gmail.com>
Co-authored-by: Sloan Sparger <sloansparger@users.noreply.github.com>
Co-authored-by: Stas Gavrylov <stas@metabase.com>
Co-authored-by: Aleksandr Lesnenko <alxnddr@users.noreply.github.com>
Co-authored-by: Metabase Automation <github-automation@metabase.com>
Co-authored-by: John Swanson <john.swanson@metabase.com>
Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Co-authored-by: Denis Berezin <denis.berezin@metabase.com>
Co-authored-by: dpsutton <dan@dpsutton.com>
Co-authored-by: Bryan Maass <bryan.maass@gmail.com>
* GDGT-1252: Make list view consider mini-bar-chart setting
* GDGT-1252: Fix incorrect model settings update when changing columns settings
* GDGT-1252: e2e test
* GDGT-1252: Fix unit test for ListViewItem
* GDGT-1252: Address PR comments. Minor refactoring
* GDGT-1252: Refactor DatasetEditor to get rid of modelSettings hack
* GDGT-1252: Update e2e test to cover settings persistence
* Update Loki Snapshots
* Revert Loki update
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
### Description
Missing billing information is treated as an error for purposes of
displaying the purchase page with prices. Non-store users cannot
retrieve billing information. Thus, previously, they would always see
an error page: "Error fetching information about available add-ons."
With this change, they see the "Please ask a Metabase Store Admin" page
as intended.
We achieve this by splitting the page content for store users from that
of non-store users. Only the former needs to load data (billing and
add-on information), so only that page needs `LoadingAndErrorWrapper`.
For store users we show no dynamic content that could fail to load
(apart from a store user's email address, which we gracefully omit if
it is missing).
### How to verify
1. Ensure you have a token with the `offer-metabase-ai-tiered`
feature, but without the `metabot-v3` and `offer-metabase-ai`
features.
2. As a Metabase user with an email address that *does not* match any
of the token's organization's store user email addresses, navigate
to `/admin/metabot` and see "Please ask a Metabase Store Admin".
3. As a Metabase user with an email address that *does* match any
of the token's organization's store user email addresses, navigate
to `/admin/metabot` and see the purchase page with tier selector.
### Checklist
- [x] Tests have been added/updated to cover changes in this PR
Fixes: 2b76c38e1f
Closes: https://metaboat.slack.com/archives/C07RMUQ0GE5/p1763644357893079
This PR adds a non-destructive dev script whose only job is to detect and report on your local development environment setup.
## What it does
**`./bin/dev-requirements`** detects:
- Version managers:
- nvm, fnm, n (Node.js version managers)
- volta, asdf, mise (multi-language support)
- jenv, sdkman (Java version managers)
- Installed development tools and their versions
- Whether your setup meets Metabase's requirements
It cross-references detected versions against project configuration files:
- Node.js version from `.nvmrc`
- Clojure version from `deps.edn`
- Java 21 Temurin distribution requirement
## What it doesn't do
- No installations
- No modifications
- No assumptions about your preferences
The script is purely informational - it shows you what you have, what's required, and recommends mise for version management. Perfect for new contributors or when troubleshooting setup issues.
* feat: use boolean flag for remote-sync status
It turns out type is too overloaded to have a 'remote-synced' collection
type. This is behavior that we might want to share around other typed
collections, so this migrates us to use a boolean column for this value instead.
* fixup! e2e test find synced collection
* fixup! e2e collection fixture has correct values
* fixup! make sure flag is set on insert/update
* bump databricks
This moves over to a thin jar (or regular jar) which provides jdbc
classes and lists its dependencies. We can now bump or pin as we
like. The previous versions were uberjars that had their dependencies
packaged inside.
```clojure
clj -Sdeps '{:deps {com.databricks/databricks-jdbc-thin {:mvn/version "3.0.5"}}}'
Clojure 1.12.1
user=> (Class/forName "com.databricks.client.jdbc.Driver")
com.databricks.client.jdbc.Driver
```
```clojure
clj -Xdeps tree :extra '{:deps {com.databricks/databricks-jdbc-thin {:mvn/version "3.0.5"}}}'
org.clojure/clojure 1.12.1
. org.clojure/spec.alpha 0.5.238
. org.clojure/core.specs.alpha 0.4.74
com.databricks/databricks-jdbc-thin 3.0.5
. com.databricks/databricks-sdk-java 0.69.0
X org.slf4j/slf4j-api 2.0.9 :older-version
. org.apache.commons/commons-configuration2 2.11.0 :newer-version
X org.apache.commons/commons-lang3 3.14.0 :older-version
. org.apache.commons/commons-text 1.12.0
X org.apache.commons/commons-lang3 3.14.0 :older-version
. commons-logging/commons-logging 1.3.2 :newer-version
X com.fasterxml.jackson.core/jackson-databind 2.15.2 :older-version
...
```
contrasted with
```clojure
❯ clj -Xdeps tree :extra '{:deps {com.databricks/databricks-jdbc {:mvn/version "3.0.1"}}}'
org.clojure/clojure 1.12.1
. org.clojure/spec.alpha 0.5.238
. org.clojure/core.specs.alpha 0.4.74
com.databricks/databricks-jdbc 3.0.1
```
* bump to run drivers
* include test namespace change to trigger driver tests
* reorg
* added reinit fns to oss plugins
* ಠ_ಠ
* Added doc and eslint to prevent import of individual reinitialize functions
* added short doc to reinitialize functions to indicate they're internal
* Try to fix model references in transforms generated by metabot
* Add an e2e test
* move test later in file
* simplify implementation
* address bot comments
* add comment
...migrations.
Handles cases where emails were set to longer than the valid length of
254 bytes. Those emails would fail on this migration previously. We're
not currently using auth-identity to lookup email addresses so this
won't cause any incorrect behavior, but also if any emails like this
exist they weren't valid anyway.
Also sets the validCheckSum to ANY like some other SQL migrations to
handle cases where this migration has already been run successfully, as
on stats.
* feat: add api for manage support access grants
* Setup frontend endpoint logic and start work on UI
* Implement create access grant; revoke; UI clean up
* Move section to tools > help / Adjust main UI
* feat: migration to new auth-identity module
* Fix schema migration tests
* Adjust backend fields structure on the backend / Update types and table in the UI
* Implement invitation mechanism and auth provider
* Create a route for the access grant modal
* Fix fe types / Fix clj spaces
* Add some test placeholders
* Remove stray #p
* Add missing index
* refix broken migration
* Change the way we temporarily make the new feature always enabled
* Add email sending on grant creation
* Add login and tests
* Make auths expirable
* Remove extraneous test
* Fix bad syntax in test
* Split two column migration into two migrations
* Fix test syntax issue
* Better expires at test
* Create e2e tests / Split troubleshooting.cy.spec and move to ts
* Add fe unit tests
* Add fe unit tests
* Fix kondo
* Fix config file and settings require
* Revert added disallowed exported namespaces
* Correctly test expiration
* Add tests for revoked at behavior
* Better better expires_at test
* Fix help.cy.spec.ts / Self review updates
* Fixup last issues with module config
* Make password reset is disabled for support users
Improve some email copy
* Real token check
* Move test relying on EE-code out of OSS code
* Send invitation notification after sso user creations
* Fix module config
* fixup! BE feedback
* fixup! altered not found msg
* Use user email as fallack when name is not set on support grants table
---------
Co-authored-by: Edward Paget <ed.paget@gmail.com>
Co-authored-by: Edward Paget <edpaget@users.noreply.github.com>
* fix cut not removing text from input
* ensure we fetch all data for all possible models for smart links
* remove unused comment
* fixes smart links in metabot input sometimes degrading into their text representation and fixes some cases where wrong model name ("model" instead of "dataset") was used for metabot links
* fix unit tests
* ui for cancelling a request, handles state updates for canceled requests
* press esc to cancel metabot request, fix state being incorrect on requests after an aborted request
* add test coverage for ui, update test utils to enable aborting requests in unit tests, small bits of clean up
* add tests to processStream function
* update snapshot
Fixes#65714.
These are sent as `:number/<=` or `:number/>=` and the validation was
too strict from 57 onward. Added a test for none, min, max, and both
ends of a Between filter.
* Metabot tool endpoitns should support MBQL5
* Update filter tool to work with MBQL 5
* Fix find-outliers-wrong-query-test
Was attempting to assoc-in/dissoc-in MBQL4 query keys on an MBQL5 query.
---------
Co-authored-by: Mike Appleby <86076+appleby@users.noreply.github.com>
Running Cypress tests doesn't have to be hard.
This PR is moving us in a direction where (1) there's some logic that sets up the environment for e2e testing, and then (2) there's a simple command to invoke cypress (aka "decoupling" or "separation of concerns")
Cypress only needs to know which config to look at. It contains all the information it needs to run.
There are two ways to invoke Cypress:
1. Cypress cli
2. Cypress Module API (programmatic entry point)
They should be compatible and interchangeable. Anything you pass to the node module as options can be passed as individual flags to the cli.
```
npx cypress run --config-file path/to/some/config --spec path/to/spec.cy.spec.ts
```
is equivalent to
```
cypress.run({ configFile: "path/to/some/config", spec: "path/to/spec.cy.spec.ts" });
```
This PR removes all abstractions from the actual node module runner.
* Turn off db routing for clickhouse and it's trick.
DB routing needs a "degree of freedom" to run the exact same query
against a different schema/db/instance whatever. Clickhouse only has
database.table. so to db route on the same clickhouse instance you have
to omit the database and let it resolve during query time.
`select * from db.table` can't work. Have to do `select * from table`
and let the connection dictate db1 or db2.
In 56, tables look like this:
```clojure
{:name "upload_records_10k_20251118164620", :schema "db_eafc4346850f435e"}
```
In 57, now they look like this for single db clickhouse things:
```clojure
{:name "upload_records_10k_20251118164620", :schema nil}
```
There are two critical problems here:
1. When uploading, it's not aware to omit the schema. So a table is
created with that schema. During the next sync that table is archived
and a new one with a nil'd schema is created. So the model created for
the uploaded CSV would break as it points to an inactive table. This has
a further compounding issue because now there "appear" to be two schema:
the faked nil one and also a new one like `db_eafc...`.
2. But _all_ tables will be archived in the same manner which were
initially found in 56 or below. These tables will be marked as inactive
and new ones created. Meaning all mbql queries based on clickhouse will
fail.
I wanted to revert this change but there's actually a bit more in the PR
and some conflicts. It also does more than just enabling db-routing so I
think we can perhaps undo the damage in this way more easily.
* remove outdated test
* fix: allow analytics collection perms to be set
In #65098, we did not fully replicate the behavior of the old graph
endpoint where collection namespacing rules aren't applied to the
"analytics" namespace. Collections in this namespace can be modified as
though they are part of the root `nil` namespace. The bug was in
removing collections not part of the targetted namespace of the
`update-graph!` funciton from the graph to update.
This restores the old behavior by not excluding collection permissions
updates for collections in the "analytics" namespace in the
`remove-collections-from-other-namespaces` function.
it also updates our tests for the collection graph to make sure mock
analytics collections have the right namespace set rather than a `nil` namespace.
* fixup! reset revisions
* fixup! tests to EE module fix tests in EE module
* Update Table Editing e2e tests to use Postgres instead of SampleDB
* Update table editing e2e tests to include different column types
* Address PR comments
* move the actual sdk folders
* update rspack config and eslint config
* fix relative import in CommonSdkStoryWrapper
* allow default exports in preview.tsx
* update eslint config to allow imports from frontend/src/embedding-sdk-shared
* remove legacy eslint disable directive
* temporarily 'disable' eslint-disable-next-line no-external-references-for-sdk-package-code that has not been ported yet
* update rspack config to use new paths
* update jest config to use new paths
* add `embedding-sdk-package` to restricted imports
* copy eslint files to apply to the new sdk folders
* add eslint-disable-next-line no-restricted-imports to some places where we need emotion
* fix jest setup
* add and use setupEmbeddingSdkEnterprisePlugins
* use `useSetting` instead of `getApplicationColors` to remove enterprise import
* move defineMetabaseAuthConfig to embedding-sdk-shared
* move MetabotProvider to embedding-sdk-bundle
* fix docs generation issue about types
* fix prettier ignore file
* move back tests to ee folder
* remove ../../../ from imports
* fix eslint issues
* fix, again, jest config :sad:
* Split warehouses and warehouses-rest
* Split warehouse-schema and warehouse-schema-rest
* Split actions and actions-rest
* Split collections and collections-rest
* Split `dashboards` and `dashboards-rest`
* Split public-sharing and public-sharing-rest
* Split embedding and embedding-rest; eliminated driver deps: xrays segments sample-data tiles
* Split users and users-rest
* Split setup and setup-rest
* Some more dev functions
* Update Kondo modules config
* Fix test namespace name
* Fix test failure 🔧
* MAGE modules
* Trivial change
* Trivial change 2
* Add note
* Let's try this
* Don't rely on team label
* Update GH Action
* Fix shell script syntax
* Use same runner type for all jobs in drivers workflow
* We can skip Postgres tests too
* Fix Mage command??
* debug github output
* Test ignoring tests in Lib
* Can we skip fetching the base ref??
* Fix test-ignoring logic
* Ok so maybe we do need to fetch the base ref
* Try git-fetch --depth=1
* Fix drivers not waiting for job
* Remove TODO
* Cache Babashka dependencies
* Update step name
* Make sure Babashka deps are actually saved
* Flip the status codes around
* PR feedback and cleanup
Fixes#64135.
Previously this code would throw if multiple dashboard and/or card
params were bound to the same SQL variable. Now multiple links are
allowed, provided that only one is actually given a value.
Actually, this logic de-duplicates the values, so if multiple filters
all set the same value, that also works.
* feat: migration to new auth-identity module
* Fix schema migration tests
* Make auths expirable
* Remove extraneous test
* Fix bad syntax in test
* Split two column migration into two migrations
* Fix test syntax issue
* Better expires at test
* Better better expires_at test
* Send invitation notification after sso user creations
* Fix module config
* UXW-1866: Make MultiAutocomplete dropdown preserve open state when selecting options
* UXW-1866: Fix e2e test
* Add note on running e2e tests for translation functionality
* Fix e2e test
* Fix e2e test
Removed multiple tests related to info popovers for field picker options and saved questions.
This behavior is already covered with a unit test at:
`frontend/src/metabase/common/components/MetadataInfo/ColumnInfoIcon/ColumnInfoIcon.unit.spec.tsx`
* Fix the update keys for postgres search idx upsert
The upsert keys were calculated by looking at the first entry we were
inserting and removing `:id`, `:model`, and `:model_id`.
But the entries are not necessarily homogeneous. In this case, the first
entry is a dashboard (has no `:dashboard_id`) and the second entry is a
card (yes `:dashboard_id`).
This meant we never actually updated the dashboard_id when updating a card.
I attempted to add a test for this:
```
(deftest updates-work-properly
(mt/with-test-user :rasta
(mt/with-temp [:model/Dashboard {dash-id :id} {}]
(let [card-name (str (random-uuid))
card-id-1 (:id (mt/user-http-request :rasta :post 200 "card/" {:name card-name
:collection_id nil
:database_id 1
:display "table"
:creator_id (mt/user->id :rasta)
:visualization_settings {}
:dataset_query {:type "native" :native {:query "select 123"}
:database 1}}))
card-id-2 (:id (mt/user-http-request :rasta :post 200 "card/" {:name card-name
:collection_id nil
:database_id 1
:display "table"
:creator_id (mt/user->id :rasta)
:visualization_settings {}
:dataset_query {:type "native" :native {:query "select 123"}
:database 1}}))]
(mt/user-http-request :rasta :put 200 (str "card/" card-id-1) {:dashboard_id dash-id})
(is (= [card-name]
(map :name (:data (mt/user-http-request :rasta :get 200 "search" :q card-name)))))))))
```
The good news is that this test passes after my change. The bad news is
that it also passes without my change. I think what's going on is that
the behavior is different with `*force-sync*` on/off: in async mode, we
get the full batch that contains the updates for `[dashboard, card]`.
In synchronous mode, we get separate batches for `[dashboard]` and then
`[card]`.
I think we might want to rework tests somehow - it would be quite nice
to be able to still run things asynchronously but drain the queue before
making assertions, so the behavior wouldn't be different between
tests/prod.
* add a test
* replace password with key pair auth
* re enable snowflake tests
* add private key env var
* update private key details for temp dbs
* small changes
* fix describe database test
* fix multi method params
* update test
* update test
* try fix
* check CI
i noticed that this tests pass if we don't put a connection-uri in
there. I'm not sure what the original intent was, but the following
works just fine:
```
{:url "jdbc❄️//<account>.snowflakecomputing.com/?schema=INFORMATION_SCHEMA",
:properties {"use-password" "false",
"connection-uri" "jdbc❄️//<account>.snowflakecomputing.com/?user=<user>CI&private_key_file=%2Fprivate%2Fvar%2Ffolders%2F1d%2F3ns5s1gs7xjgb09bh1yb6wpc0000gn%2FT%2Fmetabase-secret_8808579641027884666.tmp&schema=INFORMATION_SCHEMA",
"client_session_keep_alive" "true",
"timezone" "UTC",
"warehouse" "<warehouse>",
"user" "<user>",
"ssl" "true",
"private_key_file" "/var/folders/1d/3ns5s1gs7xjgb09bh1yb6wpc0000gn/T/metabase-secret_8808579641027884666.tmp",
"week_start" "7",
"application" "Metabase_Metabase",
"account" "<account>",
"db" "\"<db>\"",
"time_output_format" "HH24:MI:SS.FF3",
"client_metadata_request_use_connection_ctx" "true"}}
```
When it goes through clojure.java.jdbc. Somehow we are getting a
connection string that doesn't play nice. I _think_ it may just be an
issue with snowflake but i'm not positive.
* remove parallel test markers
* remove parallel marker
when running tests locally with these removed:
```clojure
(run/find-and-run-tests-repl {:only 'metabase.driver.snowflake-test})
...
Ran 49 tests in 116.525 seconds
502 assertions, 1 failure, 0 errors.
{:test 49, :pass 501, :fail 1, :error 0, :type :summary, :duration 116525.006833, :single-threaded 32, :parallel 17}
```
yields only one expected error. Previously using regular stuff also
worked
```clojure
snowflake-test=> (run-tests)
Testing metabase.driver.snowflake-test
Ran 49 tests containing 502 assertions.
1 failures, 0 errors.
{:test 49, :pass 501, :fail 1, :error 0, :type :summary}
```
(again the single test that failed). but using the CLI tool i would get
errors when running them in parallel.
* fixup stupid snowflake
1. i don't know why we are running into multithreading issues now. But
i've removed those tags and the issues are gone.
2.
```clojure
snowflake-test=> (let [spec {:connection-uri "jdbc❄️//account.snowflakecomputing.com/?schema=INFORMATION_SCHEMA&user=<user>&password=<password>&db=%22v5_airports%22"}]
[(jdbc/query spec ["select CURRENT_DATABASE() db"])
(jdbc/query spec ["select CURRENT_SCHEMA() db"])])
[({:db "v5_airports"}) ({:db "INFORMATION_SCHEMA"})]
snowflake-test=> (let [spec {:connection-uri "jdbc❄️//account.snowflakecomputing.com/?schema=INFORMATION_SCHEMA&user=<user>&password=<password>&db=v5_airports"}]
[(jdbc/query spec ["select CURRENT_DATABASE() db"])
(jdbc/query spec ["select CURRENT_SCHEMA() db"])])
[({:db nil}) ({:db nil})]
```
In the above, note that putting the db in the connection string _and
url-encoding it_ (it's already quoted) is necessary.
* conditionally add db
in tests there's not a database so just be smart about it:
```clojure
{:warehouse "<warehouse>",
:additional-options nil,
:timezone "UTC",
:db nil,
:account "<account>",
:use-password false,
:time_output_format "HH24:MI:SS.FF3",
:user "<user>",
:subname "//<account>.snowflakecomputing.com/"}
```
* address pr comments
* remove outdated comment
pretty freaky comment eh? I added this when i commented out the
`handle-conn-uri` call underneath it and it caused tests to pass. That
was helpful in identifying the mechanism, but not a good solution. Put a
comment here so that that was not a final state, forgot to remove
comment when we got to a proper final state and `handle-conn-uri` was
fixed.
---------
Co-authored-by: dan sutton <dan@dpsutton.com>
Fixes#65726.
If you implicitly joined a field that happened to be the target of a
remapping, the QP was labeling it as `:remapped_from` the FK even
though (a) it wasn't really remapped and (b) there was no
corresponding FK column marked as `:remapped_to` the target column.
(Eg. `Orders.PRODUCT_ID` is remapped to `Products.TITLE`. Then I
implicitly join `Products.TITLE` directly and the QP marks it as
remapped from `Orders.PRODUCT_ID` even though it wasn't.)
That caused the FE to do odd things like drop and relabel columns.
This change adjusts the QP so it will ignore plausible remappings that
don't actually get returned from the last stage.
We get a bunch of this useless stuff in CI:
```
Placeholder until other changesets
UPDATE SUMMARY
Run: 641
Previously run: 0
Filtered out: 69
-------------------------------
Total change sets: 710
FILTERED CHANGE SETS SUMMARY
DBMS mismatch: 69
```
Looking for this in liquibase this is not logged but printed to the
console :(.
It goes through this:
```java
private static void writeMessage(String message, UpdateSummaryOutputEnum showSummaryOutput, OutputStream outputStream) throws LiquibaseException {
switch (showSummaryOutput) {
case CONSOLE:
writeToOutput(outputStream, message);
break;
case LOG:
writeToLog(message);
break;
default:
writeToOutput(outputStream, message);
writeToLog(message);
}
}
```
So we want that enum to be LOG.
```clojure
liquibase=> (clojure.reflect/reflect liquibase.Liquibase)
{:bases #{java.lang.Object java.lang.AutoCloseable},
:flags #{:public},
:members #{ ,,,
#clojure.reflect.Method{:name setShowSummaryOutput,
:return-type void,
:declaring-class liquibase.Liquibase,
:parameter-types [liquibase.UpdateSummaryOutputEnum],
:exception-types [],
:flags #{:public}}
,,,}}
```
So easy fix. Set this enum and hopefully it shuts up.
* claude fix
* simplify
* handle nested fields for athena
* nfc have position 0
* set non leafs as details only
* clean up parser and add tests
* whitespace
* disable nested fields
* kondo
* kondo
* disable nested schema test
* implement plugins for auth
* move some stuff to the oss folder as those file create issues later on
* make embedding-sdk:docs:generate pass
* move metabot to use plugins
* remove imports from package from other folders
* Revert "Adjust cards-with-filters to work with action cards (#65805)"
This reverts commit d6b857a2c6.
* Revert "Fix mapping of params to later query stages (#65651)"
This reverts commit c98e640426.
* Revert "Compute param values from card results (#64318)"
This reverts commit 2693173e7f.
* Fix SDK save dashboard question to not show collection/dashboard picker
* Fix EditableDashboard sometimes doesn't show the correct tab on first render
* Add an assertion
* left some breadcrumbs
* Update unit tests to be async
* Fix code that populates :used_tables in metabot context
This was causing :used_tables to be absent in the :user_is_viewing
context, limiting metabot's ability to get sql fixing right without
information about the available tables and their fields.
Call lib-be/normalize-query and lib/native-only-query? in
metabase-enterprise.metabot-v3.context/query-for-sql-parsing and
likewise use lib funcs to get template-tags in
metabase-enterprise.metabot-v3.query-analyzer.parameter-substitution/replace-tags
* Update ai-sql-fixer and tests to work with MBQL5 queries
* Fix metabot-v3.table-utils-test to use MBQL5 queries
* Add click behavior setup information to introduction
* Update docs/embedding/sdk/introduction.md
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* Update screen reader description to match the new menu copy
* Update frontend/src/metabase/embedding/components/ArchiveButton.tsx
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
---------
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
When we introduced a new e2e run mode, we didn't realize this piece of code needs to be updated as well.
For people who were running the backend from source (but using e2e mode) some drivers might not have worked. Example:
```
"message": "No method in multimethod 'connection-properties' for dispatch value: :sqlite"
```
This commit fixes that.
Cloud never used this to pre-fill the user on MB setup.
We have the same functionality with way less code available today, either way.
Instead of:
```
/setup/user_defaults#123456
```
do this:
```
/setup?first_name=John&last_name=Doe
```
### Description
In #62513 we added a page to offer a Metabase AI (Metabot) trial. Now
we want to offer to purchase the paid Metabot add-on.
### How to verify
1. Ensure you have a token with the `offer-metabase-ai-tiered`
feature, but without the `metabot-v3` and `offer-metabase-ai`
features.
2. Ensure you have a Metabase API key linked to that same token.
3. Navigate to `/admin/metabot` and see a page offering you to purchase
different quantities of Metabot queries.
4. Select a quantity (or go with the default of 500), check "I agree",
then click "confirm purchase".
5. Confirm that your token now has the `metabot-v3` feature and the
associated subscription has an appropriate Metabase AI product.
### Checklist
- [x] Tests have been added/updated to cover changes in this PR
### Notes
* Rename MetabotPurchasePage to MetabotTrialPage
- and add the page for the purchase of the paid add-on as
`MetabotPurchasePage`, to make the name more clearly represent the
purpose (paid vs. trial).
* Move frontend client for /api/ee/cloud-add-ons into metabase-enterprise/api
* Use ts-pattern instead of hand-crafted type guards in Metabot trial page
* Don't swallow errors when submitting Metabot purchase form
* Create Redux selector to derive isStoreUser
* Test failures to purchase Metabot trial
* Adjust implementation of POST /api/ee/cloud-add-ons/:product-type to dashes instead of underscores
* Require accepting terms of service for Metabot trial
* Move RTK and Formik error handling for Metabot into utils.ts
* Avoid use of any type in Metabot Formik error handling
* Improve control flow with side effects
* Fix typo in log message
Closes: https://linear.app/metabase/issue/CLO-4423/allow-to-buy-metabase-ai-from-the-admin-under-a-token-feature
References: https://github.com/metabase/metabase/pull/62513
Co-authored-by: Benoit Vinay <ben@metabase.com>
* Update the delete button copy for better UX
* Apply suggestions from code review
Co-authored-by: Phoomparin Mano <poom@metabase.com>
---------
Co-authored-by: Phoomparin Mano <poom@metabase.com>
* Convert plugin system to deferred initialization with undo capability
* fixed wrong rebase
* better initialization
* .
* fixed unit tests
* .
* duh
* added back whitelabel overrides for SDK
* fixup
* fixed unit test
* cleanup
* UXW-2235 Prevents 403s from SmartLinks from preventing the whole document from showing (SmartLink renders with "No access" version instead)
* UXW-2235 Adds e2e tests
* Add /livez and /readyz endpoints
* nit comment
* Update tests with new endpoints
* Update src/metabase/server/routes.clj
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
* bad bot
* fix tests
* fix license test failure
https://github.com/metabase/metabase/pull/65034 bumped some jetty deps
from 12.0.24 to 12.1.3. Along for the ride came a new org:
```
org.eclipse.jetty.ee9.websocket/jetty-ee9-websocket-jetty-server 12.1.3
X org.eclipse.jetty.ee9/jetty-ee9-servlet 12.1.3 :use-top
. org.eclipse.jetty.ee9/jetty-ee9-webapp 12.1.3
. org.eclipse.jetty/jetty-xml 12.1.3
. org.eclipse.jetty/jetty-util 12.1.3
X org.slf4j/slf4j-api 2.0.17 :use-top
. org.eclipse.jetty.ee/jetty-ee-webapp 12.1.3 <--- new
```
This has a new org of `org.eclipse.jetty.ee` and no discernable license
in the pom or the jar.
Refresher we look in the pom for things like
```
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
```
or in the jar for some common names of licenses, like in this mysql
connector jar:
```
-rw-r--r-- 134 18-Sep-2023 19:11:56 INFO_SRC
-rw-r--r-- 71049 18-Sep-2023 19:11:56 LICENSE
-rw-r--r-- 1624 18-Sep-2023 19:11:56 README
-rw-r--r-- 846 18-Sep-2023 19:12:04 META-INF/INDEX.LIST
```
I didn't see a license at either of these spots, but consulted
https://mvnrepository.com/artifact/org.eclipse.jetty.ee/jetty-ee-webapp
to see it listed as Apache 2.0 and EPL 2.0
---------
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
Co-authored-by: dan sutton <dan@dpsutton.com>
Part of #64774.
Replaces quadratic (refs * columns) search in `add-alias-info` with map lookups
by ID and `:lib/source-column-alias`. They don't always succeed, but I ran the tests with a fallback case
that checked the old quadratic way too - in no case does the new match fail but the old way succeed.
- Speeds up the basic query of wide tables (see `qp.perf-test`) about 7x, from 8825ms to 1435ms.
- Reduces the big user query from #64774 from 205ms to 145ms on my machine.
Transfer-Encoding: chunked will cause Apache HttpClient to wrap body in ContentLengthInputStream,
which, in turn, quote: "NEVER closes the underlying stream".
So 'with-open' closing the stream was never propagated. And the new test with transfer-encoding
header captures that.
Part of #64774.
Now that most of the query processor machinery has been ported to use MBQL 5 and the `metabase.lib.core`
functionality, there were several needless round trips between MBQL 4 and 5.
The `driver.sql.qp/preprocess` function was converting queries from MBQL 5 to 4 up front,
and then each of three inner operations (now implemented in MBQL 5) were wrapped to convert 4 to 5 and back.
Removing this wasted effort reduced the time on my machine for the big user query from #64774 from 205ms to 145ms.
* fix cut not removing text from input
* ensure we fetch all data for all possible models for smart links
* remove unused comment
* fixes smart links in metabot input sometimes degrading into their text representation and fixes some cases where wrong model name ("model" instead of "dataset") was used for metabot links
* fix unit tests
* fix phantom selection when cutting value from input (context: https://github.com/metabase/metabase/pull/65255\#pullrequestreview-3436250849)
* ditch our manual batches of rows for bufferedwriter
Q: Why did we use a manual batch at first?
A: i noticed it was super slow and worked around this. Then realized i
was gzipping it so that was the actual slowdown. The batching was
already done and it didn't hurt anything.
Q: Why get rid of it then?
A: want to move to "cell" based counting. Rows are fine until they get
really wide and then 300 columns * 5,000 rows = 1,500,000 cells in
memory at once. Put some strings in there and we blow up. So lets switch
to cell counting rather than row counting. This is way easier if we only
care about number of rows or cells when holding them in memory. Don't
have to count the batch ourself when streaming. So if that goes row by
row, we just watch for the number of cells as the trigger to switch to
streaming and we are done.
```clojure
temp-storage-test=> (time
(mt/test-driver :postgres
(select-keys (mt/process-query (mt/native-query {:query "SELECT
row_num AS id,
-- Random Integer between 1 and 100000
floor(random() * 100000 + 1)::INTEGER AS random_int,
-- Random Float
(random() * 1000)::NUMERIC(10, 4) AS random_float,
-- Random Date within the last 5 years
(current_date - (random() * 5 * 365)::INTEGER)::DATE AS random_date,
-- Random Timestamp within the last 30 days
(NOW() - (random() * 30 * '1 day'::interval)) AS random_timestamp,
-- Random String: Generates a random alphanumeric string about 1000 characters long
(
SELECT string_agg(
chr(
(CASE WHEN random() < 0.5 THEN 65 ELSE 97 END) + (random() * 25)::INTEGER
),
''
)
FROM generate_series(1, 1000)
) AS random_string
FROM
generate_series(1, 500000) AS row_num;"})
(temp-storage/notification-rff 2000 :testing))
[:row_count :status :data.rows-file-size :notification/truncated?])))
"Elapsed time: 1457.921083 msecs"
{:row_count 15184,
:status :completed,
:data.rows-file-size 16369108,
:notification/truncated? true}
```
* Switch to cell based counts, not rows
We found in practice some people might have queries with 300
columns. When we keep 5,000 of those in memory, we end up having
1,500,000 cells in memory at once. We then are open again to OOM
issues. So this swaps over to a cell basec count rather than rows to be
a bit more granular.
* Change from 2,000 rows to 20,000 cells
the thinking here is 2,000 rows with 10 values. It's pretty arbitrary though
* rename var for cells to disk threshold
* i have to delete this test because i used `time` in a comment block
* formatting fix
If you have an empty first stage followed by "real" later stages, the frontend produces duplicate buttons in the query
builder. Cleaning those stages up removes those buttons.
* BE modularization: decouple `server` from `core`
* Split up enterprise/api and enterprise/api-routes
* Split up `settings` and `settings-rest`
* Dox for new util
* Add another util function
* Split `permissions` and `permissions-rest`
* Code fixes and additional utils
* Improved deps graph dox
When a join's conditions came from multiple tables, we used the first table as the table name, even though some of the cols came from a different table. We now display "Previous results" to denote that the lhs columns are from different tables.
* fix: update harbormaster API use
The Harbormaster API was updated to use snake_case in all params
and returns in https://github.com/metabase/harbormaster/pull/6663.
There's an backwards compatible interim period where it will support both kebab-case and snake_case in params, and keep existing returns.
The changes in this PR will make Metabase forwards and backwards compatible with the Harbormaster API changes.
After the interim period, the Harbormaster API will only take and return snake_case data.
* feat: support missing api key on hm.client/call
The OpenAPI spec is now public and the api key is not mandatory.
* new click and link behavior
* Apply suggestions from code review
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* handle handlelink
* fix typo
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
This has been a very valuable benchmark for processing complex queries,
especially large `:case` statements and nested aggregations.
Adding it with some REPL-able benchmarks in `query-processor.perf-test`.
* reverts the color-scheme meta tag
* adds the color scheme meta tag if entry point is not embed-sdk
* add backend tests for color-scheme meta tags
* add a cypress test for color-scheme
- catalog metadata is not transactional in redshift
- calls like pg_catalog.has_schema_privilege when using a string argument will resolve the oid of the schema/table etc
- if the oid cannot be resolved (e.g. table/schema does not exist) an error is thrown
We occasionally see sync failed due to relation does not exist, one cause might be concurrent test runs / cleanup deleting tables/schemas while running.
I have fixed the first half of the union to use the oid form of these calls which will result in NULL instead of an error while racing with DDL in other runs.
Need to research on external tables before changing the external table sub-query: probably want to join to svv_external_schemas and use the oid there, but not 100% yet.
* Fix docs
it throws an error in the js console about webassembly not having the
right permissions
Two ways to fix: give permissions, or rollback to a version that works.
I'm pinning to a version that works since we are close to a release.
39.2 breaks, 39.1 works.
I'm also including the recommended stylesheets
In the meantime, i'm going to investigate
resources/openapi/index_external.html.mustache as i'm not sure what uses
this and if it needs to be updated or deleted. Perhaps used by `clojure
-M:ee:doc api-documentation`?
* switch template to pinned 39.1 version
* Add breaking changes detection information
Added section on checking for breaking changes when saving questions, models, or metrics.
* Add breaking changes check to model editing documentation
Added section on checking for breaking changes when saving a model.
* Apply suggestions from code review
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* add aws jdbc wrapper
* add aws-iam option to auth-provider-options
* WIP: hook ssl iam in postgres
* wip
* working
* style
* postgres appdb aws iam support
* auth-provider-options-only-aws
* aws iam for mysql
* ssl
* warnings
* as error
* support appdb uri
* add unit tests
* warning
* don't automatically include useSSL
* support ssl-cert configs for mysql appdb
* more unit tests
* refactor
* integration test
* fix: always set useSSL for aws-iam in mysql appdb
* fix mysql uri
* chore
* style
* fix
* connection tests
* setup for CI
* temporarily disable until secrets are setup
* chore: set
* add warning
* Revert "temporarily disable until secrets are setup"
This reverts commit 4ca6eb4607.
* show new library icon
* UXW-2115 Address PR feedback - makes it so only the Library uses the synced collection icon, not the nested subdirectories
* UXW-2115 Fix getCollectionType condition
* UXW-2115 Removes unnecessary type changes
* UXW-2115 Reverts changes for synced collection icon
---------
Co-authored-by: Brad Anderson <brad@metabase.com>
* refactor HomeGreeting and convert to use css module over styled components
* update colors for metabot illustration
* bad ai
* rename
* pr feedback
* small adjustments
* spark failure fix
I cannot run spark locally so from CI:
```
FAIL in metabase.driver.sparksql-test/friendly-inline-strings-in-convert-to-sql-test (sparksql_test.clj:67)
:sparksql
The native query returned in query results should use user-friendly splicing
expected: "SELECT COUNT(*) AS `count` FROM `test_data`.`venues` AS `t1` WHERE `t1`.`name` = 'wow'"
actual: "SELECT COUNT(*) AS `count` FROM `test_data`.`venues` AS `t1` WHERE `t1`.`name` = 'wow'"
diff:
expected: "SELECT COUNT(*) AS `count` FROM `test_data`.`venues` AS `t1` WHERE `t1`.`name` = 'wow'"
actual: "SELECT COUNT(*) AS `count` FROM `test_data`.`venues` AS `t1` WHERE `t1`.`name` = decode(unhex('776f77'), 'utf-8')"
```
Locally hit this on an m1 mac:
```
impl.get-or-create :: create-database! failed; destroying :sparksql database “test-data” {mb-test=metabase.driver.sparksql-test/friendly-inline-strings-in-convert-to-sql-test}
java.util.concurrent.TimeoutException: Timed out after 30.0 mins
```
* fix license test failure
https://github.com/metabase/metabase/pull/65034 bumped some jetty deps
from 12.0.24 to 12.1.3. Along for the ride came a new org:
```
org.eclipse.jetty.ee9.websocket/jetty-ee9-websocket-jetty-server 12.1.3
X org.eclipse.jetty.ee9/jetty-ee9-servlet 12.1.3 :use-top
. org.eclipse.jetty.ee9/jetty-ee9-webapp 12.1.3
. org.eclipse.jetty/jetty-xml 12.1.3
. org.eclipse.jetty/jetty-util 12.1.3
X org.slf4j/slf4j-api 2.0.17 :use-top
. org.eclipse.jetty.ee/jetty-ee-webapp 12.1.3 <--- new
```
This has a new org of `org.eclipse.jetty.ee` and no discernable license
in the pom or the jar.
Refresher we look in the pom for things like
```
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
```
or in the jar for some common names of licenses, like in this mysql
connector jar:
```
-rw-r--r-- 134 18-Sep-2023 19:11:56 INFO_SRC
-rw-r--r-- 71049 18-Sep-2023 19:11:56 LICENSE
-rw-r--r-- 1624 18-Sep-2023 19:11:56 README
-rw-r--r-- 846 18-Sep-2023 19:12:04 META-INF/INDEX.LIST
```
I didn't see a license at either of these spots, but consulted
https://mvnrepository.com/artifact/org.eclipse.jetty.ee/jetty-ee-webapp
to see it listed as Apache 2.0 and EPL 2.0
* Make Trunk analytics always run
This prevents false positives because Trunk analytics actio will now
always analyze test results, and compare them with their own test
quarantine list. It uses this information to know if it should fail the
job or let it pass.
* Introduce dry-run
When a PR is in a draft mode, we don't want to upload results but still
have to quarantine tests.
* Update wording for subscriptions and alerts section
* Update docs/permissions/application.md
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* toggle dark mode from command palette
* I'm sorry I built this in a dumb way Ryan
---------
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
* upgrade to echarts v6
* Update Loki Snapshots
* Fix BE test
* update gridlines helper function
* adjust test
---------
Co-authored-by: Metabase Automation <github-automation@metabase.com>
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
* Make sure /dirty is called when moving an entity out of the library
* Untouch embedding code / Clean up / Add some tests
* Check cache from both entities and RTK / Undo unnecessary changes
* Make sure getCollectionFromCollectionsTree gets collection from latest query
* ci: allow running stress tests on sdk tests
* type choice
* yeah this should work 🤞
* ok we should also build the sdk
* maybe this time
* do we need to setup the BE?
* Revert "do we need to setup the BE?"
This reverts commit 7e9092e2c3.
* trying the auto infer thing out
* refactor and move the logic up to dedup it
* rename output
* move up env?
* Revert "move up env?"
This reverts commit f78f72e396.
* increase timeout to make stress test with throttling pass
* increase the timeout even more :shrugs:
Part of #64774.
Hopefully this is sufficient to unblock users seeing the high CPU times
like in #64774. I discovered other, less significant performance issues
during this investigation that I'll be addressing in follow-up PRs.
### Investigation Notes
The problem query and relevant table metadata from a helpful customer
was taking 950ms to preprocess and compile on my 2022 M1 Max, running
Metabase in dev mode but with Malli schema enforcement disabled.
The query is pretty big! It uses 3 tables with 200-300 columns each,
has several stages including some from a joined card, and ends up with
several stages doing two levels of aggregation. It also includes
several *huge* `:case` expressions.
The optimizations below have reduce the time required from 950ms to 310ms
on my machine. A 3x improvement, but I think there's more to be gained in
the follow-up PRs I mentioned.
### Optimizations
Main optimizations:
- `lib.util/find-stage-index-and-clause-by-uuid` pre-computed and cached
on each stage, saved 120ms on the above query.
- `lib.metadata.cached-provider/fields` attempts to pre-load the cache
of individual `lib.metadata/field` calls, having just fetched them
all, but it used the wrong key and they were all misses instead!
- `expression-metadata` and `aggregation-metadata` are recomputed over
and over again by their stage and later stages; cache them by value
- `returned-columns` was cached at the top level and frequently missed
because of dumb details like explicit stage 1 vs. -1 for last stage.
- Switched it to caching on individual `returned-columns-method`s
with more precise cache keys.
#### New Caching Approach
Both of the latter two are using a new caching approach: a weak map
using queries as keys. Since CLJ(S) maps are immutable, any change to
the query means a new pointer.
That's still far more eviction than optimal! Most edits to a query
don't actually invalidate most of the cached values! But it's a lot
better than what we had before, and because the map's keys are weak
references, the queries and their cached data are not retained any
longer than the query itself.
### New Benchmarking Tools
I also added a `qp.perf-test` namespace with some metadata providers
with 10-, 100-, 1000- and 10,000-column tables for testing.
So far the tests it performs are quite basic, though. I'll be adapting
the user-provided query into a test case in the future, since it's an
excellent real-world example of a complex but not pathological query.
```
Updating table metadata for Table 5465 ''properati_ar.properties_rent_201607'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5465 ''properati_ar.properties_rent_201607'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5485 ''properati_ar.properties_sell_201706'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5485 ''properati_ar.properties_sell_201706'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5468 ''properati_ar.properties_rent_201602'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5468 ''properati_ar.properties_rent_201602'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5511 ''properati_ar.properties_rent_201612'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5511 ''properati_ar.properties_rent_201612'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5431 ''properati_ar.properties_sell_201802'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5431 ''properati_ar.properties_sell_201802'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5441 ''properati_ar.properties_sell_201707'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5441 ''properati_ar.properties_sell_201707'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5467 ''personal_bq_repro.events_20230519'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5467 ''personal_bq_repro.events_20230519'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5484 ''properati_ar.properties_sell_201708'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5484 ''properati_ar.properties_sell_201708'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5434 ''properati_ar.resultados_apto_credito'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5434 ''properati_ar.resultados_apto_credito'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5501 ''properati_ar.properties_sell_201704'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5501 ''properati_ar.properties_sell_201704'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5433 ''properati_ar.properties_rent_201604'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5433 ''properati_ar.properties_rent_201604'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5478 ''properati_ar.properties_sell_201702'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5478 ''properati_ar.properties_sell_201702'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5498 ''properati_ar.properties_sell_201512'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5498 ''properati_ar.properties_sell_201512'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5447 ''properati_ar.properties_rent_201709'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5447 ''properati_ar.properties_rent_201709'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5463 ''properati_ar.properties_rent_201609'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5463 ''properati_ar.properties_rent_201609'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
Updating table metadata for Table 5448 ''properati_ar.properties_rent_201509'' {mb-quartz-job-type=SyncAndAnalyzeDatabase}
:is_writable of Table 5448 ''properati_ar.properties_rent_201509'' changed from null to null {mb-quartz-job-type=SyncAndAnalyzeDatabase}
```
We unconditionally say we are updating table metadata, but then when we
actually change anything we of course include the table name.
Note here there is some kind of bug that we are changing the
table (which property??) from null to null.
* Updates 35 SVG illustrations
The same asset now works well for both light and dark mode.
* branding OnboardingIllustration, adding cloug and bug metabot to metabot logo
* PR Feedback
---------
Co-authored-by: Nick Fitzpatrick <nickfitz.582@gmail.com>
* Annotate draft transforms in user_is_viewing context with source type when possible
* add unit tests
* Move transform-source-type helper to transform utils; some refactor
* switch to use lib/native-only-query; change default transform query in tests to use mbql5
* switch batch to using lib.query/native?
* switch back to native-only-query?
* clean ns
* Compute param values from card results
seq for bool
Tests, multi-stage queries
Compute values also for params on nested stages
whitespace
Unused ns
Last stage check first
Docstring
Drop base query's last stage clauses
Address review remarks
Apply suggestions from code review
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
Remove redundant ops
Adjust for test
Search for col also in aggregated result columns
Look for breakoutable column only if source-uuid is present
* symb
* Rebase fix
* fix rebase, remove unused module
* post rebase, fix getting database id
* kondo
* Revamp
* limit
* Adjust the solution for impl joins
* Fix e2e
* Comment
* Cleanup
* Cleanup
* comment
* comment
* Update src/metabase/parameters/dashboard.clj
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
* indent
---------
Co-authored-by: metamben <103100869+metamben@users.noreply.github.com>
* UXW-1991 Fixes various issues both new and old with the Branding page like the colors not updating until refresh and swatches not updating when setting colors back to their defaults
* UXW-1991 Uses hex format for brand colors placeholders
* UXW-1991 Fix persistence issues with setting/unsetting accent colors
we want to not hammer the network when things are down. But during
startup we don't need to circuit break these errors that we throw before
the app-db is read
* Enhance glossary section with context for definitions
This is a smaller change than I expected, since glossary terms don't show up in searches yet. Might just cut this if it doesn't add anything useful. I also wasn't sure if we should mention Metabot here.
* Add dark mode options
Adds the available options and explains that you don't have to reload the page
* Add a little clarification to the computed goal example
This confused me, so I'm adding this little clarification
* Jeff's suggested change
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* Remove the bit about LLMs again
---------
Co-authored-by: Jeff Bruemmer <jeff.bruemmer@gmail.com>
* fix: allow stacktraces to be suppressed in API
Allows administrators to configure their metabase instance using
MB_HIDE_STACKTRACES to prevent stacktraces from appearing in API
response. For standard responses it replaces unhandled exceptiosn with a
generic message and 500 response. For streaming responses it leaves the
error message and strips out the trace/via keys to prevent exception
info from leaking.
* fixup! dissoc traces from map errors
* Prevent trashed documents from being edited
* Add test
* Soften the test name tone
* Disallow even updating document when archived via API
* Add BE test
* Fix Cypress test issue reference
* Update tests after merging master
* Only check for archived when not unarchiving
* Don't check archived documents when archiving or unarchiving them
* Add missing condition from merging
* Fix logs upload for drivers
When we introduced `continue-on-error` to the "test" step, we had to
update the conditionals for the test report steps as well. I've
introduced a bug by checking for a failure, instead of saying - upload
test reports whenever the job is not successful.
Hint: test.outcome means "step status BEFORE continue-on-error overrides
the exit code"
Collected timing data from 7 days of test runs.
All specs with timing data were included (simple averages).
🤖 Generated automatically by update-e2e-timings workflow
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <actions@github.com>
* add debug message type for tool calls
* rename toolCalls -> activeToolCalls
* Basic debug mode slash command to hide/show tool calls
* ToolCallDetailsModal + better formatting
* Fix type
* Fix types, some simplification
* Address minor bot comments
* small changes
* move AgentToolCallMessage into its own file and add copy buttons + tool call id to modal
* fix copied value
* add unit tests
* move failure case further downstream to mitigate any possible customer issue
* ci fixes
---------
Co-authored-by: Sloan Sparger <sloansparger@gmail.com>
* fix: improve collections graph performance
Fixes performance generating and updating a collection graph by avoiding
the cross join of all negative permissions (blocks) between groups and
collections. Instead it builds sparse graph where missing entries for
group/collection paris can be assumed to be :none permissions.
In practice this drops a collection permission update on a graph of 5K
groups and 5K collections from a greater than 10min operation on my
local machine against MySQL to a .5s operation.
* fixup! explicilty disj :root in other places
* fixup! improve some docs
* fixup! improve more docs
* fixup! seq checks
* fixup! blank lines
* fixup! convert raw sql concat into honeysql
* fixup! e2e test
* Update error message for remote sync dep checking
Try to make these error messages less jargony because they are presented
by the user interface when dependency checking content fails.
Closes UXW-2142 and UXW-1879.
* Update some missed tests
* Add a grace period to token checks
There's more work on this namespace to be done i think, but this is a
first cut at it. There's a lot of control flow by exceptions which is
how we jump around in here. Fundamentally this should be far
simpler. Will take a crack at that shortly. I also don't love that this
just hammers the `fetch-token-status` function and then memoizes inside
of that. Would prefer simpler layout of `token-features` function and
that can be aware of population issues.
Adds a simple protocol: GracePeriod, which has two functions: save! and
retrieve. On successful token check, we `save!` the response. On errors,
we `retrieve` previous responses. This obviously can be nil in the case
we have never had a successful response, and will become nil once the
grace period's internal notion of time expires.
This implementation is based on guava's cache which has a nifty
expireafterwrite functionality.
```
(*token-features*) ;; call this function to simulate the check of features
Checking with the MetaStore to see whether token 'f325...d01a' is valid...
Reporting Metabase stats: {... user counts etc}
-> #{"features come back"}
;; meanwhile clear cache to simulate elapsing of 12 hours
(*token-features*) ;; call function again to simulate check of features
2025-10-22 21:30:26,620 INFO premium-features.token-check :: Checking with the MetaStore to see whether token 'f325...d01a' is valid...
2025-10-22 21:30:26,622 ERROR premium-features.token-check :: Error fetching token status from https://token-check.metabase.com:
clojure.lang.ExceptionInfo: network issues ;; hit network issue
2025-10-22 21:30:26,632 INFO premium-features.token-check :: Using token from grace period
->> #{graceperiod network features}
...
;; here after 5 seconds (in real life will be 36 hours)
2025-10-22 21:31:00,064 WARN premium-features.token-check :: Removing token: f325...d01a from grace period cache {mb-quartz-job-type=Cache}
```
* tests that updating value populates grace period cache
* couple changes
protect against storing nil value. guava cache doesn't like it so gone
it is.
added some tests:
```clojure
(testing "Setting a new value populates the grace period cache"
(let [new-token (tu/random-token)]
(binding [http/request (fn [& _] {:status 200
:body "{\"valid\":true,\"status\":\"fake\",\"features\":[\"fake\",\"features\"]}"})]
(mt/discard-setting-changes [premium-embedding-token]
(premium-features.settings/premium-embedding-token! new-token)
(is (= #{"fake" "features"} (token-check/*token-features*)))
(is (= {:valid true :status "fake" :features ["fake" "features"]}
(token-check/retrieve token-check/grace-period new-token)))))))
```
But this ended up leaving a setting table value for this value. i don't
feel like looking into discard setting changes so i'm gonna just remove it
* attempt to simplify the api a bit
the thee important functions are now `token-information`, `harness` and
`decode-token`.
Everyone should use token-information. Harness hooks up the grace period
and retry strategies, and `decode-token` only cares about decoding a
token. It should return the token-status map {:valid true ...} or throw.
* fixup test
* clean up tests and rename a bit
* remove comment block
* remove commented out grace period
* bit of cleanup
* fix with-random-premium-token! macro
* function composes them instead of caller
rather than a caller needing to know all of the layers, i thread them
for you and let you provide all arugments in one function call.
dynamic var for needing to customize layers in tests. largely for
removing the circuit-breaker which is stateful and hard to restart if
you want to simulate errors in tests
* rename test
* Add documents to content view
* add document to audit_log
* added comment events to the audit log, publish events
* wip: transform events
* glossary
* reversion the content migrations
* include transforms in content
* remote sync audit events
* wip: action v2 event
* kondo
* fix action tests
* transform run event
* add tests for new events
* bump
* tests
* task data
* let's not change the old migration in case we might break the hashsum
* typo
* more typos
* fix bugs in h2/mysql
* add :previous-object
* fix tests
* move branch into details
* fix test
* fix: run tests only on ee
---------
Co-authored-by: Nicola Mometto <nicola.mometto@metabase.com>
* Normalize parameter type category/= to category
Stats had exactly one dashboard with one such parameter and that dashboard was immutable because the
before-update hook failed before any update could happen.
* - Improve remote-sync error messages
- Do a fetch when checking git settings to ensure the current version can be read and is being checked
* Validate git url
* Validate branch name in production mode
* Validate branch name in production mode
* Removed unneeded assoc
* Fixed formatting
* Code improvements
* Code improvements
* Allow direct path URLs
* Allow direct path URLs
* E2e Fixes
* E2e Fixes
* Allow empty branch to be passed
* Legacy MBQL normalization overhaul
* Kondo + test fixes 🔧
* Cleanup and test fixes 🔧
* Code cleanup
* Test fixes 🔧
* Extra test 🔧
* Some test fixes 🔧
* Test fixes 🔧
* Test fixes 🔧
* Test fixes 🔧
* Fix SerDes test failure
* cljfmt
* Code cleanup
* Fix normalizing :datetime with bytes modes
* Fix legacy MBQL normalization of :datetime
* Handle broken case clauses
* Set Card metadata to nil when invalid
* Fixx
* Fix Kondo
* Fix/unskip some tests / try to make flaky FE test to pass in CI
* adding branching tests, unskipping admin tests
* PR Feedback
* PR Feedback
---------
Co-authored-by: Anderson <anderson@metabase.com>
* Add type field to transforms with temporary backfill job
* add a default value for tests
* add some new tests, fix serdes
* lint
* remove debugging defs
* revert serdes spec change
* Revert "remove transforms from serdes baseline (?)"
This reverts commit e8fc8fe80bfe15e00eb031b4050877f271b8081f.
* try again to fix serialization tests
* address bot comments
* Revert "try again to fix serialization tests"
This reverts commit 13d78664b79b7f13406d89e1f8f910610ea2cce9.
* Fix search ingestion functions to use :type field + some cleanup
* Update baseline to fix serialization test
* Revert "Update baseline to fix serialization test"
This reverts commit 60cb7909e5a73d04c42d36c915a32bb28d684e37.
* fix up comment
* reset serialization_baseline to version on master
* let's try this again: manually update baseline to add type field
* fix search tests by adding correct types to transfomrs
* update metabot tool apis
* fix revision test
* simplify test
* address feedback - move type setting to the model layer
* simplify tests
* Fix up transform serdes tests: remove top-level type fields and updated_at from being serialized, and fix shape of transforms in extraction tests
* set :type after select just in case; fix serdes tests again
* guard against empty source on select
* remove redundant search spec for transforms (introduced via a previous merge)
* switch from type to source_type to avoid conflict with type field on the frontend
* add better error handling
Basically, the same case found two unrelated bugs. For one, we don't support table functions like `select * from
my_function()`. For another, `select orders from orders` is also unsupported but apparently legal (at least in
postgres). This updates sql parsing/validation to support both things.
This pull request updates the configuration and environment handling for E2E and compatibility tests, mainly to support running tests against a staging license/token server and to improve test reliability. The changes affect GitHub Actions workflows, environment variables, and some test and backend logic.
*Backend Logic for E2E Mode*
Added `is-e2e?` flag in core.clj to distinguish E2E test runs from dev/prod/test modes, allowing for custom behavior in E2E scenarios.
Modified token check logic in token_check.clj to allow E2E tests to use a staging server for license validation.
Changed store API settings in settings.clj to use staging endpoints when in dev or E2E mode, ensuring tests interact with the correct backend.
* poc of handleLink
* safer implementation
* make it return a boolean to prevent default
* fix types?
* fix static viz build
* adds tests
* make tests more consistents with fns
* test return value undefined
* Update enterprise/frontend/src/embedding-sdk-shared/lib/sdk-global-plugins.ts
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
* refactor plugin call
* fix types
* removed reduntant test
* change the api to use `{handled: boolean}`
* support links rendered as anchor tags, refactor the logic and tests
* add story
---------
Co-authored-by: metabase-bot[bot] <109303359+metabase-bot[bot]@users.noreply.github.com>
This guide covers Clojure and ClojureScript coding conventions for Metabase. See also: `CLOJURE_STYLE_GUIDE.adoc` for the Community Clojure Style Guide.
Write like you're talking to a colleague. Be conversational, not formal. Get people what they need quickly. Know your audience and match the complexity.
## Tone and Voice
**Do:**
- Use contractions ("can't" not "cannot")
- Say "people" or "companies" instead of "users"
- Be friendly but not peppy
- Acknowledge limitations honestly ("that's on us, not them")
- Jokes and Easter eggs are okay (permit them, don't suggest them)
**Don't:**
- Use exclamation points excessively
- Rely on tired tropes about nerdiness
- Use corporate jargon ("utilize", "offerings", "actionable insights")
- Tell people something is cool (show them instead)
## Structure and Clarity
**Lead with the important stuff:**
- Most important information first
- Lead with the ask, then provide context
- Cut text that adds little value (when in doubt, cut it)
- Each paragraph should have one clear purpose
**Make headings do the work:**
- Convey your actual point, not just the topic
- "Use headings to highlight key points" not "How to write a good heading"
- Use sentence case, no punctuation except question marks
- No links in headings unless entire heading is a link
## Instructions and Examples
**Tell people what to do:**
- Give the action before explaining why
- Put commands in execution order
- Provide context, steps, and reasoning
- Don't describe tasks as "easy" or "simple"
**Answer unasked questions:**
- Include answers to "dumb" questions you had when learning
- Don't literally include the question, just give the answer
## Formatting
**Code vs. UI elements:**
- Backticks for code, variable names, parameters only
- **Bold** for UI elements and labels (e.g., "Click the **Save** button")
- Don't use backticks or quotes for UI elements
## Writing Mechanics
- Limit pronouns when introducing new terms (repeat the term to reinforce it)
- Ampersands only in proper nouns, never as substitute for "and"
## Terminology Preferences
Use familiar terms from tools people already know:
- "Summarize" (like Excel) instead of "aggregate"
- "Take a look at" instead of "reference"
- "Filter" instead of technical database terms when appropriate
### Don't: Use `ms/TemporalString` for Java Time objects in response schemas
```clojure
;; WRONG - Java Time objects aren't strings yet
[:date_joinedms/TemporalString]
;; RIGHT - schemas validate BEFORE JSON serialization
[:date_joined:any];; Java Time object, serialized to string by middleware
[:last_login[:maybe:any]];; Java Time object or nil
```
**Why:** Response schemas validate the internal Clojure data structures BEFORE they are serialized to JSON. Java Time objects like `OffsetDateTime` get converted to ISO-8601 strings by the JSON middleware, so the schema needs to accept the raw Java objects.
### Don't: Use `[:sequential X]` when the data is actually a set
```clojure
;; WRONG - group_ids is actually a set
[:group_ids{:optionaltrue}[:sequentialpos-int?]]
;; RIGHT - matches the actual data structure
[:group_ids{:optionaltrue}[:maybe[:setpos-int?]]]
```
**Why:** Toucan hydration methods often return sets. The JSON middleware will serialize sets to arrays, but the schema validates before serialization.
### Don't: Create anonymous schemas for reused structures
Use `mr/def` for schemas used in multiple places:
```clojure
(mr/def::User
[:map
[:idpos-int?]
[:emailstring?]
[:namestring?]])
```
## Finding Return Types
1.**Look at the function being called**
```clojure
(api.macros/defendpoint:get"/:id"
[{:keys[id]}]
(t2/select-one:model/Field:idid));; Returns a Field instance
```
2.**Check Toucan models for structure**
Look in `src/metabase/*/models/*.clj` for model definitions.
description: Review Clojure and ClojureScript code changes for compliance with Metabase coding standards, style violations, and code quality issues. Use when reviewing pull requests or diffs containing Clojure/ClojureScript code.
allowed-tools: Read, Grep, Bash, Glob
---
# Clojure Code Review Skill
@./../_shared/clojure-style-guide.md
@./../_shared/clojure-commands.md
## Review guidelines
**What to flag:**
- Check compliance with the Metabase Clojure style guide (included above)
- If `CLOJURE_STYLE_GUIDE.adoc` exists in the working directory, also check compliance with the community Clojure style guide
- Flag all style guide violations
**What NOT to post:**
- Do not post comments congratulating someone for trivial changes or for following style guidelines
- Do not post comments confirming things "look good" or telling them they did something correctly
- Only post comments about style violations or potential issues
Example bad code review comments to avoid:
> This TODO comment is properly formatted with author and date - nice work!
> Good addition of limit 1 to the query - this makes the test more efficient without changing its behavior.
> The kondo ignore comment is appropriately placed here
> Test name properly ends with -test as required by the style guide.
**Special cases:**
- Do not post comments about missing parentheses (these will be caught by the linter)
## Quick review checklist
Use this to scan through changes efficiently:
### Naming
- [ ] Descriptive names (no `tbl`, `zs'`)
- [ ] Pure functions named as nouns describing their return value
- [ ]`kebab-case` for all variables and functions
- [ ] Side-effect functions end with `!`
- [ ] No namespace-alias repetition in function names
### Documentation
- [ ] Public vars in `src` or `enterprise/backend/src` have useful docstrings
- [ ] Docstrings use Markdown conventions
- [ ] References use `[[other-var]]` not backticks
- [ ]`TODO` comments include author and date: `;; TODO (Name 1/1/25) -- description`
### Code Organization
- [ ] Everything `^:private` unless used elsewhere
- [ ] No `declare` when avoidable (public functions near end)
- [ ] Functions under 20 lines when possible
- [ ] No blank lines within definition forms (except pairwise constructs in `let`/`cond`)
- [ ] Lines ≤ 120 characters
### Tests
- [ ] Separate `deftest` forms for distinct test cases
- [ ] Pure tests marked `^:parallel`
- [ ] Test names end in `-test` or `-test-<number>`
description: Guide Clojure and ClojureScript development using REPL-driven workflow, coding conventions, and best practices. Use when writing, developing, or refactoring Clojure/ClojureScript code.
---
# Clojure Development Skill
## Tool Preference
When `clojure-mcp` tools are available (e.g., `clojure_eval`, `clojure_edit`), **always use them**
instead of shell commands like `./bin/mage -repl`. The MCP tools provide:
- Direct REPL integration without shell escaping issues
- Better error messages and feedback
- Structural Clojure editing that prevents syntax errors
Only fall back to `./bin/mage` commands when clojure-mcp is not available.
@./../_shared/development-workflow.md
@./../_shared/clojure-style-guide.md
@./../_shared/clojure-commands.md
## REPL-Driven Development Workflow
- Start with small, fundamental functions:
- Identify the core features or functionalities required for your task.
- Break each feature down into the smallest, most basic functions that can be developed and tested independently.
- Write and test in the REPL:
- Write the code for each small function directly in the REPL (Read-Eval-Print Loop).
- Test it thoroughly with a variety of inputs, including typical use cases and relevant edge cases, to ensure it
behaves as expected.
- Integrate into source code:
- Once a function works correctly in the REPL, move it from the REPL environment into your source code files (e.g.,
within appropriate namespaces).
- Gradually increase complexity:
- Build upon tested, basic functions to create more complex functions or components.
- Compose smaller functions together, testing each new composition in the REPL to verify correctness step by step.
- Ensure dependency testing:
- Make sure every function is fully tested in the REPL before it is depended upon by other functions.
- This ensures that each layer of your application is reliable before you build on it.
- Use the REPL fully:
- Use the REPL as your primary tool to experiment with different approaches, iterate quickly, and get immediate
feedback on your code.
- Follow functional programming principles:
- Keep functions small, focused, and composable.
- Use Clojure's functional programming features—like immutability, higher-order functions, and the standard
library—to write concise, effective code.
## How to Evaluate Code
### Bottom-up Dev Loop
1. Write code into a file.
2. Evaluate the file's namespace and make sure it loads correctly with:
description: Review documentation changes for compliance with the Metabase writing style guide. Use when reviewing pull requests, files, or diffs containing documentation markdown files.
allowed-tools: Read, Grep, Bash, Glob
---
# Documentation Review Skill
@./../_shared/metabase-style-guide.md
## Review mode detection
**IMPORTANT: Before starting the review, determine which mode to use:**
1.**PR review mode**: If the `mcp__github__create_pending_pull_request_review` tool is available, you are reviewing a GitHub PR
- Use the pending review workflow to post all issues as one cohesive review
- Follow the workflow steps in "PR review mode format" below
2.**Local review mode**: If the MCP tool is NOT available, output issues in the conversation
- Format all issues in a numbered markdown list (as described in "Feedback format" below)
## Review process
1.**Detect review mode** - Check if `mcp__github__create_pending_pull_request_review` is available
2. Read the changes through once to understand intent
3. Check all issues that violate style guide or significantly impact readability
4. Only flag issues worth mentioning - if it won't make a material difference to the reader, skip it
5.**REQUIRED: Number ALL feedback sequentially** - Start from Issue 1 and increment for each issue found
## Review checklist
Run through the diff looking for these issues:
**Tone and voice:**
- [ ] Formal/corporate language ("utilize" not "use", "offerings", etc.)
- [ ] "Users" instead of "people" or "companies"
- [ ] Excessive exclamation points or overly peppy tone
- [ ] Telling readers something is cool instead of showing them
**Structure and clarity:**
- [ ] Important information buried instead of leading
- [ ] Verbose text that adds little value
- [ ] Paragraphs without clear purpose
- [ ] Vague headings that don't convey the point
- [ ] Instructions explain "why" before telling "what to do"
- [ ] Tasks described as "easy" or "simple"
**Links and references:**
- [ ] Linking the word "here" instead of descriptive text
- [ ] Links in headings (unless entire heading is a link)
**Formatting:**
- [ ] Ampersands as "and" substitute (except proper nouns)
- [ ] Inconsistent list formatting
**Code and examples:**
- [ ] Code examples that don't work or would error
- [ ] Commands not in execution order
- [ ] Full-width screenshots instead of scoped UI elements
- [ ] Excessive or unnecessary images
**Sentence construction:**
- [ ] Overuse of pronouns when introducing new terms
| we can do X, our feature | Should be "Metabase" or "it" |
| click here, read more here | Need descriptive link text |
| easy, simple, just | Remove condescending qualifiers |
| users | Should be "people" or "companies" if possible |
## Feedback format
**MANDATORY REQUIREMENT: Every single issue MUST be numbered sequentially starting from Issue 1.**
This numbered format is NON-NEGOTIABLE. It allows users to efficiently reference specific issues (e.g., "fix issues 1, 3, and 5") and track which feedback has been addressed.
### Local review mode format
When outputting issues in the conversation (local mode), use this format:
```markdown
## Issues
**Issue 1: [Brief title]**
Line X: Succinct description of the issue
[code or example]
Suggested fix or succinct explanation
**Issue 2: [Brief title]**
Line Y: Description of the issue
Suggested fix or explanation
**Issue 3: [Brief title]**
...
```
**Examples:**
> **Issue 1: Formal tone**
> Line 15: This could be more conversational. Consider: "You can't..." instead of "You cannot..."
> **Issue 2: Vague heading**
> Line 8: The heading could be more specific. Try stating the point directly: "Run migrations before upgrading" vs "Upgrade process"
### PR review mode format
When posting to GitHub (PR mode), use the **pending review workflow**:
**Workflow steps:**
1.**Start a review**: Use `mcp__github__create_pending_pull_request_review` to begin a pending review
- This creates a draft review that won't be visible until submitted
2.**Get diff information**: Use `mcp__github__get_pull_request_diff` to understand the code changes and line numbers
- This helps you determine the correct file paths and line numbers for comments
3.**Identify ALL issues**: Read through all changes and identify every issue worth mentioning
- Collect all issues before posting any comments
- Number them sequentially (Issue 1, Issue 2, Issue 3, etc.)
4.**Add review comments**: Use `mcp__github__add_pull_request_review_comment_to_pending_review` for each issue
- **CRITICAL**: Post ALL comments in a SINGLE response using multiple tool calls in parallel
- Each comment should reference a specific file path and line number from the diff
- Start each comment body with `**Issue N: [Brief title]**`
- Include the description and suggested fix
5.**Submit the review**: Use `mcp__github__submit_pending_pull_request_review` to publish all comments at once
- Use event type `"COMMENT"` (NOT "REQUEST_CHANGES") to make it non-blocking
- **Do NOT include a body message** - Leave the body empty or omit it entirely
- All comments will appear together as one cohesive review
**Comment format example:**
```
**Issue 1: Formal tone**
This could be more conversational. Consider: "You can't..." instead of "You cannot..."
```
**IMPORTANT**:
- Each issue gets its own review comment attached to the pending review
- Number ALL comments sequentially (Issue 1, Issue 2, Issue 3, etc.)
- Always start the comment body with `**Issue N: [Brief title]**`
- **MUST add all comments in parallel in a single response** - Do NOT add them one after another in separate responses
- Do NOT output a summary message to the conversation - only post GitHub review comments
- When submitting the review, do NOT include a body parameter (or leave it empty) to avoid cluttering the PR with summary text
- The review will appear as a single review with multiple comments when submitted
## Final check
1. Remove any issues from your assessment that won't make a material difference to the reader if addressed. Only flag issues worth the author's time to fix.
2.**Verify all issues are numbered sequentially** starting from Issue 1 with no gaps in numbering.
3. Confirm the format exactly matches: `**Issue N: [Brief title]**` where N is the issue number.
4.**In PR mode**: Verify each issue was posted as a separate GitHub comment (not output to conversation).
description: Write documentation following Metabase's conversational, clear, and user-focused style. Use when creating or editing documentation files (markdown, MDX, etc.).
allowed-tools: Read, Write, Grep, Bash, Glob
---
# Documentation Writing Skill
@./../_shared/metabase-style-guide.md
## When writing documentation
### Start here
1.**Who is this for?** Match complexity to audience. Don't oversimplify hard things or overcomplicate simple ones.
2.**What do they need?** Get them to the answer fast. Nobody wants to be in docs longer than necessary.
3.**What did you struggle with?** Those common questions you had when learning? Answer them (without literally including the question).
### Writing process
**Draft:**
- Write out the steps/explanation as you'd tell a colleague
- Lead with what to do, then explain why
- Use headings that state your point: "Set SAML before adding users" not "SAML configuration timing"
**Edit:**
- Read aloud. Does it sound like you talking? If it's too formal, simplify.
- Cut anything that doesn't directly help the reader
- Check each paragraph has one clear purpose
- Verify examples actually work (don't give examples that error)
**Polish:**
- Make links descriptive (never "here")
- Backticks only for code/variables, **bold** for UI elements
- American spelling, serial commas
- Keep images minimal and scoped tight
**Format:**
- Run prettier on the file after making edits: `yarn prettier --write <file-path>`
- This ensures consistent formatting across all documentation
### Common patterns
**Instructions:**
```markdown
Run:
\`\`\`
command-to-run
\`\`\`
Then:
\`\`\`
next-command
\`\`\`
This ensures you're getting the latest changes.
```
Not: "(remember to run X before Y...)" buried in a paragraph.
**Headings:**
- "Use environment variables for configuration" ✅
- "Environment variables" ❌ (too vague)
- "How to use environment variables for configuration" ❌ (too wordy)
**Links:**
- "Check out the [SAML documentation](link)" ✅
- "Read the docs [here](link)" ❌
### Watch out for
- Describing tasks as "easy" (you don't know the reader's context)
- Using "we" when talking about Metabase features (use "Metabase" or "it")
description: Review TypeScript and JavaScript code changes for compliance with Metabase coding standards, style violations, and code quality issues. Use when reviewing pull requests or diffs containing TypeScript/JavaScript code.
allowed-tools: Read, Grep, Bash, Glob
---
# TypeScript/JavaScript Code Review Skill
@./../_shared/typescript-commands.md
## Code Review Guidelines
Review pull requests with a focus on:
- Compliance with project coding standards and conventions
description: Write TypeScript and JavaScript code following Metabase coding standards and best practices. Use when developing or refactoring TypeScript/JavaScript code.
metabase.lib.convert/->legacy-MBQL{:message"Conversion to legacy MBQL is discouraged, please use Lib to manipulate MBQL queries"}
metabase.lib.core/->legacy-MBQL{:message"Conversion to legacy MBQL is discouraged, please use Lib to manipulate MBQL queries"}
metabase.lib.equality/find-column-indexes-for-refs{:message"Use lib.equality/closest-matches-in-metadata or lib.equality/find-closest-matches-for-refs instead of lib.equality/find-column-indexes-for-refs"}
metabase-enterprise.transforms.interface/execute!{:message"Use metabase-enterprise.transforms.execute/execute! instead of metabase-enterprise.transforms.interface/execute!"}
next.jdbc/active-tx?{:message"Use metabase.app-db.core/in-transaction? to see if we are in a transaction"}
toucan2.core/debug{:message"Don't commit code using t2/debug"}
toucan2.tools.debug/debug{:message"Don't commit code using t2/debug"}}
toucan2.tools.with-temp/with-temp{:message"Use lib.tu/mock-metadata-provider in QP tests. Exceptions: tests for code that doesn't use MPs or models not supported by MPs"}}
> Watch out for these deprecated props and gotchas for Metabase 57 onwards, for modular embedding:
>
> 1. \`config\` prop on MetabaseProvider no longer exist - it is replaced by \`authConfig\`.
> 2. \`authProviderUri\` field no longer exist.
> 3. \`jwtProviderUri\` optional field only exists in v58+. This is used to make JWT auth faster by skipping the \`GET /auth/sso\` discovery request. Not needed for initial implementation.
> 4. \`fetchRequestToken\` is not needed by default. This is only used to customize how the SDK fetches the request token.
> 5. Numeric IDs must be integers not strings, e.g. \`dashboardId={1}\`. When the ID is retrieved from the URL and it is numeric, convert it to an integer via \`parseInt\` before passing it to the SDK. IDs can also be strings for entity ids, so you should not parse all IDs as numbers if entity ids are also to be expected.
`;
}
/**
* Generate llms-full.txt file for a specific section
* @param {string} branch - The branch name
* @param {Object} config - Section config object with section name and optional getPreamble function
* @param {Array} files - Array of all markdown file objects
* @param {string} baseUrl - Base URL for raw GitHub links
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.