This project is mirrored from https://github.com/metabase/metabase.
Pull mirroring updated .
- Sep 03, 2024
-
-
John Swanson authored
Backports: - https://github.com/metabase/metabase/pull/47398 - https://github.com/metabase/metabase/pull/47251 (which was a backport of https://github.com/metabase/metabase/pull/46942) - removed all support for getting the trash collection, getting things that were `archived_directly`, or getting collections by `archive_operation_id`. None of these exist in this branch. - in this branch, functions like `permissions-set->visible-collection-ids` did not check for archived status or anything other than permissions. On `master`, they do. So, the new function that replaced them, `collection/visible-collection-filter-clause`, also checks for archived status as well as permissions. To resolve this, I chose to just default `collection/visible-collection-filter-clause` to ignore archived status and return both archived and unarchived collections. On to the original commit message: There are a few separate changes here: - Migrations: add and populate indexed columns perm_value, perm_type, and collection_id to permissions These fields allows us to efficiently run queries based on collection permissions in the DB without string manipulation. Keeping the table as permissions allows us to do this migration in-place. Note that in some cases collections may have been deleted from the database without deleting the associated permissions row (since there was no foreign key before). We need to be defensive here: if we have a permissions row without a corresponding collection, delete the row before running the rest of the migration. - Write perm_value, perm_type, and collection_id for new collection permissions A very simple before-insert method sets these fields before a collection permission is written to the DB. - Replace collection/permissions-set->visible-collection-ids and collection/visible-collection-ids->honeysql-filter-clause with collection/honeysql-filter-clause Previously, just about everywhere we used permissions-set->visible-collection-ids, what we were essentially doing was an in-app join: select all the collection IDs you have permission on, then convert it to a SQL clause like WHERE collection_id IN ( all of those collection IDs). Replace both of these with honeysql-filter-clause, which uses the new fields we added to permissions above to construct a honeysql filter representing "all the collections I have permissions on", without needing to round-trip them to the application and back to the DB. Of course, we can then write a function visible-collection-ids, which uses honeysql-filter-clause, for those cases where we do actually need the whole bunch in the application (we use this, for example, when constructing the effective-location for a collection). I also added one more toggle to the VisibilityConfig that's passed into the honeysql-filter-clause (and used to be passed to permissions-set->visible-collection-ids), allowing you to select only the effective children of some collection. * Backport: Speed up calculation of effective_ancestors https://github.com/metabase/metabase/pull/47324 Previously, `visible-collection-ids` was effectively "free" in that we'd cached `collection-id->collection` for *all* collections, within a single request, and then locally filtered it for permissions without needing to hit the database again. To be honest, there is probably a better fix for this - we're repeatedly calling `visible-collection-ids` when we probably could just save a single copy of it and use it when calculating the effective location of every collection. However, this is a very quick and low-risk fix, and I want to prioritize getting this done, and then we can improve it later. Locally, I copied down the database from stats and timed the `/api/search?model_ancestors=true` endpoint. Before my "speedup" PR (https://github.com/metabase/metabase/pull/46942) it took ~7 seconds to return results. After my "speedup" PR, it took ~15s to return results. :grimace: With this change, it takes 818ms to return results.
---------
-
- Aug 30, 2024
-
-
metamben authored
Fixes #40355. The query processor expects the columns resulting from metric aggregations to be named based on the aggregation in the metric definition, not by the name of the metric. This change brings metabase lib in sync with the query processor.
-
- Aug 27, 2024
-
-
metamben authored
Fixes #44940.
-
adam-james authored
Fixes #47263 In backporting the MB_DOWNLOAD_ROWS_LIMIT to 49, one necesssary change was missed and the default constraints were being applied to subscription downloads. This PR fixes that oversight and also adds a test to verify correctly applied limits in subscription attachments.
-
- Aug 19, 2024
-
-
bryan authored
[O*] Single Log Out saml-slo-enabled defsetting (#44794) - backport: - use `client/client-real-response`, instead of `client-full-response` * stop using strings for enum values (prefer kw) * only do SLO when saml-slo-enabled is true * make defsetting docstring formatting consistent * log-direction is a string * add test for enabling / disabling saml slo - also return a 403 when the client tries, but it's disabled * use client-full-response, which won't add '/api'. * fix typo in deftest name ---------
-
- Aug 16, 2024
-
-
Ngoc Khuat authored
-
- Aug 13, 2024
-
-
adam-james authored
* Dowload Row Limit Env Var (#46401) * Dowload Row Limit Env Var Adds `MB_DOWNLOAD_ROW_LIMIT` to enable changing the row limit on downloads and alert/subscription attachments (not the rendered tables, but the .csv, etc.). Based on: #44982 (Thanks, @r-kot) Partially implements: #28144 The difference in this PR compared to #44982 is that the download limit applies to all downloads, the only exception being when the limit is above `qp.i/absolute-max-results` (1048575, based on Excel's limitation); in such a case, the user supplied limit is only used if the download is csv or json, and `qp.i/absolute-max-results` is used for xlsx. This PR also fixes alert/subscription attachment limits; prior to this, they were set to the in-app limit of 2000 rows, but now they will follow the user supplied download-row-limit. This PR also adds a test to the downloads-and-exports test namespace, confirming that they follow the supplied limit, or the max limit if none is supplied. * add test confirming the default limit works * fix test to use the download-row-limit * address review feedback * Update src/metabase/public_settings.clj Co-authored-by:
Cal Herries <39073188+calherries@users.noreply.github.com> * add test covering case where download-row-limit is unset --------- Co-authored-by:
Cal Herries <39073188+calherries@users.noreply.github.com> * pulse should execute without the max results constraints * Update test/metabase/query_processor/middleware/limit_test.clj Co-authored-by:
metamben <103100869+metamben@users.noreply.github.com> * Update src/metabase/query_processor/middleware/limit.clj Co-authored-by:
metamben <103100869+metamben@users.noreply.github.com> * change docstring to mention correct function --------- Co-authored-by:
Cal Herries <39073188+calherries@users.noreply.github.com> Co-authored-by:
metamben <103100869+metamben@users.noreply.github.com>
-
- Aug 08, 2024
-
-
metabase-bot[bot] authored
Co-authored-by:
Uladzimir Havenchyk <125459446+uladzimirdev@users.noreply.github.com>
-
- Aug 06, 2024
-
-
lbrdnk authored
* expose MB_DB_QUERY_TIMEOUT_MINUTES setting (#44759) * Resolve cyclic dependency --------- Co-authored-by:
Radosław Kotkiewicz <37927890+r-kot@users.noreply.github.com>
-
- Aug 05, 2024
-
-
metabase-bot[bot] authored
Co-authored-by:
Ngoc Khuat <qn.khuat@gmail.com>
-
- Jul 31, 2024
-
-
Ryan Laurie authored
* ci: Run without Replay (#45799) * Uninstall ReplayIO * Remove Replay config * Install and use custom Chrome v111 * Simplify comment * Set a specific Chrome version commit * Skip repro for #22517 # Conflicts: # .github/actions/prepare-cypress/action.yml # .github/workflows/e2e-stress-test-flake-fix.yml # .github/workflows/e2e-tests.yml # .github/workflows/pre-release.yml # e2e/support/config.js # e2e/support/cypress.js # e2e/test/scenarios/models/reproductions.cy.spec.js # package.json # yarn.lock * sort out download utils * fix another import
-
Ngoc Khuat authored
[Manual backport 49] Fix sync indexes mark all fields with same name as indexed if one of them is (#46316) * Fix sync indexes mark all fields with same name as indexed if one of them is (#46313) * not the lib.match
-
- Jul 30, 2024
-
-
Cal Herries authored
-
Cal Herries authored
-
- Jul 29, 2024
-
-
Cal Herries authored
-
Cal Herries authored
Co-authored-by:
Cam Saul <1455846+camsaul@users.noreply.github.com>
-
- Jul 24, 2024
-
-
Ryan Laurie authored
* don't show audit db in permissions # Conflicts: # enterprise/frontend/src/metabase-enterprise/audit_app/index.js # frontend/src/metabase-types/api/database.ts # frontend/src/metabase/admin/permissions/selectors/data-permissions/data-sidebar.ts # frontend/src/metabase/plugins/index.ts * special v49 treatment * fix test for v49 * add e2e tests for 45831 # Conflicts: # e2e/test/scenarios/collections/instance-analytics.cy.spec.js
-
- Jul 15, 2024
-
-
Cal Herries authored
-
- Jul 11, 2024
-
-
John Swanson authored
This introduces a new metadata on commands, `:requires-init`. If set, we'll run `metabase.core/init!` before running the command. `init!` will initialize the database and run our normal startup, though it won't actually start the Metabase server. This allows you to use ``` env MB_CONFIG_FILE_PATH=... java -jar metabase.jar import /my/metabase/export ``` We'll run the normal init process (creating the internal user, loading from the config file, etc), then run the command. On my machine this adds about 2-3 seconds to the time it takes to run an `import`.
-
- Jul 10, 2024
-
-
Alexander Solovyov authored
-
metabase-bot[bot] authored
Co-authored-by:
Cal Herries <39073188+calherries@users.noreply.github.com>
-
- Jul 09, 2024
-
-
Cal Herries authored
[49 backport] Skip fingerprinting or scanning field values for fields with base-type=type/Collection (#45160) (#45242)
-
Cal Herries authored
Co-authored-by:
Cal Herries <calherries@gmail.com>
-
- Jul 04, 2024
-
-
Cal Herries authored
[49 Backport] Catch exceptions from driver/database-supports? outside driver code and Memoize driver.u/supports? (#44719) (#44804) (#44851)
-
- Jun 28, 2024
-
-
John Swanson authored
I was thinking about the potential options here. On one hand, we could initialize the app db ourselves. This is a little problematic, because: - our `init!` function is in `metabase.core` and calling it yields a painful cyclical dependency. It's also pretty tied to outputting things to the user that they might not expect during an import, e.g. "Looks like this is a new installation ... preparing setup wizard", and starts up jobs, etc. - if we choose to *only* initialize the database ourselves (only the bits that we actually *need* initialized), I'm a little nervous about maybe missing something. Right now we need to create the internal user and create users from the config file before running the import. If we added a third thing, would we remember to update this? - we could refactor to put all of the above in one spot, but this is a P1 and it feels important to close this out as quickly as possible. We also don't claim to support initializing the app DB from an import in the first place. So: just throw an exception if the app db hasn't been set up yet. Our heuristic here is whether a single non-internal user has been created. So if you want to use your config, you can run: ``` MB_CONFIG_FILE_PATH=dev/config.yml java -jar metabase.jar java -jar metabase.jar import /my/exported/dump ``` If you try to run `java -jar metabase.jar import ...` on a fresh DB, it'll now fail with the error message: ``` You cannot `import` into an empty database. Please set up Metabase normally, then retry. ```
-
- Jun 25, 2024
-
-
metabase-bot[bot] authored
Co-authored-by:
Cal Herries <39073188+calherries@users.noreply.github.com>
-
Ryan Laurie authored
# Conflicts: # release/package.json
-
lbrdnk authored
This PR removes `:role` removal from spec, even if it was added in `:connection-uri`. It seems that `:connection-uri` is ignored on `do-with-connection-options` code path. Hence use of non-default roles is again available on Snowflake.
-
lbrdnk authored
-
- Jun 21, 2024
-
-
metabase-bot[bot] authored
Co-authored-by:
Ngoc Khuat <qn.khuat@gmail.com>
-
- Jun 20, 2024
-
-
Ryan Laurie authored
* ci: Automatically add milestones to prs and issues (#44357) * automatically add milestones to prs and issues * test code * test code * test commit (#3138) * test commit (#43320) * test commit (#44357) * remove test code * add newlines * prefer older version milestones # Conflicts: # .github/workflows/check-milestone.yml # release/src/index.ts # release/src/linked-issues.ts # release/src/linked-issues.unit.spec.ts * type fix * backport another function
-
- Jun 15, 2024
-
-
Cal Herries authored
[backport for 49] Fix fields from Amazon Athena Tables failing to sync if there is not an underscore in the Table Name (#44032) (#44245)
-
- Jun 14, 2024
-
-
Jesse Devaney authored
* prevent waterfall chart negative values for having column value scaling double applied * add unit test
-
Cal Herries authored
* Change MySQL ENUM columns to have base_type=type/TextLike (#43533) * ~ fix for actions test * ~ use dataset
-
Aleksandr Lesnenko authored
-
metabase-bot[bot] authored
-
- Jun 13, 2024
-
-
Alexander Polyankin authored
* Fix remapping with models in a dashboard * Fix parameter field matching in MLv1 * Add e2e test * Add e2e test * Add e2e test
-
- Jun 11, 2024
-
-
metabase-bot[bot] authored
* Add connection string parsing * Add test case with role suffixed key Co-authored-by:
lbrdnk <lbrdnk@users.noreply.github.com>
-
- Jun 07, 2024
-
-
metabase-bot[bot] authored
* Move role to url parameters from connection properties * Fix test Co-authored-by:
lbrdnk <lbrdnk@users.noreply.github.com>
-
metabase-bot[bot] authored
Co-authored-by:
Alexander Solovyov <alexander@solovyov.net>
-