Compare commits

...

704 Commits

Author SHA1 Message Date
Diogo Mendes
a403e51022 Lint 2022-04-04 12:29:08 -03:00
Diogo Mendes
3263ca1f66 Remove delay to not trigger autocomplete 2022-04-04 12:06:48 -03:00
Nemanja Glumac
450abef662 Run E2E tests using Chrome instead of Electron (#21438)
* Run E2E tests using Chrome

* Create snapshots using Chrome

* Test in GHA once again

* Set browser in the base Cypress config

* Change branch back to `master` for E2E workflow
2022-04-04 11:00:05 +02:00
Nemanja Glumac
1b3c9cda7b Fix subscription flakes related to "Email sent" string (#21441) 2022-04-04 09:55:18 +02:00
Nemanja Glumac
a6078be4fb [E2E] Fix admin datetime flakes (#21440)
* Fix flakes

* Reinforce localization test
2022-04-03 22:52:15 +02:00
Nemanja Glumac
52194cc957 Fix binning click-related flakes (#21436) 2022-04-02 22:36:36 +02:00
Diogo Mendes
ae3c76b216 Fix small typo (#21432) 2022-04-02 15:09:06 -03:00
Nemanja Glumac
3a7779b08c [E2E] Optimize native filters tests (#21427)
* Extract repro for #16756

* Optimize looping through sql date field fitlers

* Optimize looping through sql number field fitlers

* Optimize looping through sql string field fitlers

* Extract common helper

* Run only native filters in the current branch

* Reduce flakiness in `type`

* Merge field filters together

* Run tests on `master` again
2022-04-02 20:07:29 +02:00
Nemanja Glumac
1f0c6d8a97 Upgrade Cypress to the v9.5.3 (#21433) 2022-04-02 20:03:27 +02:00
Alexander Lesnenko
1da02e27a8 FE: Download permission users UI (#20931)
* download permission UI with specs

* permission editor UI tweaks

* reset download permission on blocked data sources

* update specs

* update copy

* update specs
2022-04-01 22:38:00 -04:00
Noah Moss
04473fc5ee QP middleware for download perms (#21021) 2022-04-01 21:34:15 -04:00
Alexander Lesnenko
eb50aafab7 FE: Subscriptions management permission (#21307)
* subscriptions management permission

* specs

* update contract

* specs
2022-04-01 19:08:00 -04:00
Alexander Polyankin
aa0878e372 The skeleton of the new homepage (#21355) 2022-04-01 21:00:25 +03:00
Nemanja Glumac
96aa2f358c [E2E] Fix flake in repro 17514 for good (#21423) 2022-04-01 18:45:44 +02:00
Diogo Mendes
e2a166e3aa Fix name [skip ci] (#21424) 2022-04-01 13:43:19 -03:00
Ngoc Khuat
e36304ec82 Grant Subscription permission by default (#21179)
* add API to fetch general permisisons graph

* add API to update general permissionns

* change author of migration

* update documents

* misc fixes to applease the CIs

* Add tests for general permission APIs and models

* linting and fix a failed test case

* fix some failed tests

* update docs and change /subscription/ to /general/subscription/ for consistency

* Hook and migration to make sure subscription are created for new groups by default

* add schema migrations tests

* set for the win

* address noah's comments

* Parse number as is in http-client for tests

* address Cam's comments

* revert the last commit about parsing API response in tests

* change fk name

* delete a comment

* Changes:
- Rename `changes` column to `after` to keep things consistent
- If a group  has no General Permisions, it'll not be included in the graph
- Update tests and some docs

* fix failing tests in ee

* add some tests and make docstring completes

* polishing comments

* namespaces

* fix namespaces

* Add general permisison flags to `GET /api/user/current` (#21250)

* return general permisison flags for /api/current

* namespaces

* move permission flags to under

* Enforce Subscription permissions (#21285)

* return general permisison flags for /api/current

* namespaces

* enforce general permissions for subscription and tests

* update check-has-general-permisison to add option to require superuser

* adding arity

* add tests for permissions helper function

* Move advanced permissions check funcs to ee namespace

* unpushed changes

* namespaces

* ignore exception when load namespaces

* change helper fn name

* Enforce Monitoring Permissions (#21321)

* return general permisison flags for /api/current

* namespaces

* enforce general permissions for subscription and tests

* update check-has-general-permisison to add option to require superuser

* adding arity

* enforce permissions to call /api/dataset for internal queries

* enforce monitoring permissions for api/task and api/util

* add tests for OSS

* add tests for db-connection-info endpoint

* change test schema

* update name func and fix ns

* whydon't CI run ?

* Enforce Setting Permissions (#21386)

* return general permisison flags for /api/current

* namespaces

* enforce general permissions for subscription and tests

* update check-has-general-permisison to add option to require superuser

* adding arity

* enforce permissions to call /api/dataset for internal queries

* enforce monitoring permissions for api/task and api/util

* add tests for OSS

* add tests for db-connection-info endpoint

* change test schema

* update name func and fix ns

* whydon't CI run ?

* Enforce Setting permissions

* fix failing test

* make sure we could run slack test twice

* make the mock consistent

* address Noah's comments

* shorter permissions check
2022-04-01 23:11:20 +07:00
Gustavo Saiani
29c957c0e6 Cover more entities (#21406) 2022-04-01 16:10:40 +01:00
Noah Moss
01092b5cf5 DB details permissions reads & writes (#21327) 2022-04-01 10:59:17 -04:00
Noah Moss
2d81ec5859 Data model permission writes & reads (#21168) 2022-04-01 09:44:11 -04:00
Diogo Mendes
e2d2e6fea8 Ignore running E2E workflow when not needed (#21384)
* Ignore running E2E workflow when not needed

* Adding - ".**" as suggested

* Playing safe for now
2022-04-01 10:34:11 -03:00
Nemanja Glumac
7dd93f61dc Fix flaking collection tests [ci skip] (#21417) 2022-04-01 09:23:31 -03:00
Nemanja Glumac
c4e96ce099 Fix flaking Percy table snapshot in CCI [ci skip] (#21416) 2022-04-01 08:37:39 -03:00
Anton Kulyk
71d057ed12 Don't autoexpand sidebar on mobile (#21415) 2022-04-01 14:11:08 +03:00
Benoit Vinay
e68fdb16c8 15876 fix time random casting with without timezone (#21340)
* Misc

* parseTime method updated to remove timezone

* parseTime tests added

* formatTime tests added

* Unskip 15876 cypress test
2022-04-01 12:15:11 +02:00
Anton Kulyk
e0dc20a689 Clean up EditBar component (#21395) 2022-04-01 09:35:04 +01:00
Anton Kulyk
7b1fb36f8e Remove getPlainNativeQuery (#21401) 2022-04-01 09:34:51 +01:00
Anton Kulyk
0a1f9f5cbc Remove collection sidebar code (#21400) 2022-04-01 09:34:32 +01:00
Nick Fitzpatrick
82256fe0f1 Updating page title as dashboard loads (#21259)
Updating Page Title and Favicon as Dashboards load
2022-04-01 00:01:02 -03:00
Gustavo Saiani
1e89a2d40b Update bookmark list when archiving Questions in Collection page (#21390) 2022-03-31 20:30:53 -03:00
Anton Kulyk
5c563556bf [E2E] Fix flaky collections sidebar tests (#21397) 2022-03-31 23:07:06 +02:00
Anton Kulyk
64d2f1bc18 Browsing | Automatically close navbar in certain scenarios (#21358) 2022-03-31 21:50:13 +01:00
Anton Kulyk
f18b48f54d Browsing | Show sidebar on collection pages when embedding (#21352) 2022-03-31 21:49:54 +01:00
Dalton
2a5a77d1cd Set visualization mode via QB state when we are zoomed in on a specific row (#21371)
* Set visualization mode via QB state

* Unskip repro
2022-03-31 13:45:49 -07:00
Cam Saul
7272cc940b Skip filter-by-current-quarter-test for :oracle because of #10072 (#21396) [ci skip] 2022-03-31 16:42:19 -03:00
Nemanja Glumac
1f7e12f5d3 [E2E] Reinforce repro for #17514 (#21394)
* Reinforce the repro for 17514

* Fix typos
2022-03-31 16:22:39 -03:00
Anton Kulyk
43997d6357 Browsing | Improve mobile sidebar (#21347) 2022-03-31 19:32:06 +01:00
Nemanja Glumac
b058edd0b5 Set modifyObstructiveCode to false in Cypress config (#21376) 2022-03-31 19:57:08 +02:00
Dalton
e2a0a6190e @sugengsuprayogi's "Fix download question data on embedded dashboard" (#21231)
* Fix download question data on embedded dashboard

* run prettier

Co-authored-by: Sugeng Suprayogi <sugengsuprayogi@users.noreply.github.com>
2022-03-31 10:32:29 -07:00
Diogo Mendes
eb63d0729a Downgrade buildJet instance of Percy (#21391)
* Moving to a 4vCPU

* New tests

* Test Finish
2022-03-31 14:23:55 -03:00
Anton Kulyk
98fc2412bd Browsing | Refactor navigation sidebar (#21298)
* Create sidebar and add collections tree

* Fix dragged collection item's z-index

* Add links (data, archive, users' collections)

* Add ProfileLink

* Add bookmarks

* Use the new sidebar at Navbar

* Fix official collection icon opacity

* Add sidebar width to navigation constants

* Cut long item names

* Fix sidebar's horizontal scroll

* Fix remove bookmark icon position

* Fix bookmark URLs

* Fix how selected item is determined

* Jump to a collection opened from a bookmark

* Fix selected element highlighting edge cases

* Don't check for "users" collection

* Fix collapsing tree nodes

* Fix remove bookmark icon show on hover

* Fix removing a bookmark

* Fix archived collections are disabled in the tree

* Expand collection's parents after move

* Fix UI element lookups in tests

* Accept `icon` object as a SidebarLink prop

* Use "tree" a11y role for collections tree

* Always show the archive link

* Fix "other users' collections" link icon

* Fix e2e test

* Fix e2e tests

* Remove not used prop

* Make bookmarks collapsible

* Fix post-rebase issues

* Fix can't click expanded tree node to collapse

* Fix e2e test

* Remove not used code

* Use bookmark entities icon helper

* Extract renderBookmark function

* Allow custom `icon` element prop on SidebarLink

* Fix bookmarked official collection icon colors

* Fix `personal_owner_id` type

* Move Collections entity file to collections dir

* Reorganize collection entity file
2022-03-31 20:18:49 +03:00
Nemanja Glumac
d921877f73 [E2E] Fix xrays flake (#21389) 2022-03-31 18:49:58 +02:00
Anton Kulyk
947f38e683 Browsing | Fix collection type & move tree utility (#21288)
* Extend `Collection` type definition

* Use correct types

* Move `buildCollectionTree` to collection utils
2022-03-31 19:27:58 +03:00
Anton Kulyk
521cf7589e Fix mobile layout for questions and dashboards (#21349) 2022-03-31 16:39:14 +01:00
Nemanja Glumac
2bf4f9434c Fix flakes in native filters spec [ci skip] (#21387) 2022-03-31 12:29:42 -03:00
Anton Kulyk
522d6d33f0 Clean up SearchBar component (#21369)
* Give methods some space

* Extract `active` state setter methods

* Clean up styled components

* Extract more styled-components

* Extract methods

* Turn SearchBar into functional component

* Convert SearchBar to TypeScript
2022-03-31 17:16:49 +03:00
Luis Paolini
c25bfb2ffb Reverting the unifying Percy+Build PR (#21383) 2022-03-31 11:14:58 -03:00
Nemanja Glumac
6d76b38b54 Fix a flake in repro for #15655 [ci skip] (#21379) 2022-03-31 09:00:42 -03:00
Diogo Mendes
ec61fd9be4 Reverting cache (#21378) 2022-03-31 08:56:54 -03:00
Diogo Mendes
b449a87860 Reverting #21346 (#21375) 2022-03-31 08:10:06 -03:00
Anton Kulyk
7b98a1712b Fix error and new question pages layout (#21329)
* Fix error pages content centering

* Fix `/question/new` route content centering
2022-03-31 13:20:44 +03:00
Nemanja Glumac
520954d0ba Revert "Bump executor (#21036)" (#21373)
This reverts commit 160c3c7231cb1340ee19b98b16937d90828a8b94.
2022-03-31 05:58:03 -03:00
Gustavo Saiani
eabf3cc134 Bookmark Model from Collection page (#21367) 2022-03-30 20:52:53 -03:00
Anton Kulyk
9e49a3708c Browsing | Refactor Tree component (#21287) 2022-03-30 22:32:58 +01:00
Nemanja Glumac
0e8d45700f Fix a flake in models (#21368) 2022-03-30 23:09:26 +02:00
Anton Kulyk
8b341b1ac3 Add global navigation sidebar (#21069)
* Prototype new nav skeleton (#20875)

* yarn

* begin basic layout flip

* rough in collections list

* position query builder

* remove fitViewport from QB to fix layout quirks

* extract search

* clean up props

* position search / style

* fix dashboard layout

* fix search icon

* move ProfileLink

* tweak spacing

* fix burger

* add basic toggle

* tweak layout for sidebar toggle

* tweak style

* tweak sidebar sizing

* Quick fix to prototype starting points init (#20922)

* fix scroll overflow on sidebar

Co-authored-by: Gustavo Saiani <gustavo@poe.ma>

* add currentUser to profile link

* move footer items out of collection sidebar

* tweak footer style

* fix hover style

* clean up footer

* fixup

* remove un-needed overflow hidden

* hide app bar when in admin mode

* merge sidebar header into new color scheme / nav layout

* clean up headers

* fix root collection spacing

* smaller font size for nav items

* provide flex context, fixes metadata editing

* fix login page

* Remove console logs

* Put user's personal collection under Our analytics (#21061)

* Browsing | Handle long item names in the sidebar (#21063)

* Handle long names in the nav sidebar

* Show tooltip with a full item name if its cut

* Browsing | Fix data reference & admin permissions layout (#21101)

* Remove admin navbar CSS fix

* Handle admin navbar in root App component

* Extract styled components

* Fix data reference layout

* Fix main container height

* Browsing | Hide sidebar for questions, models and dashboards on page open (#21064)

* Manage default sidebar visibility

* Handle ad-hoc questions better

* Move nav elements based on feedback (#21190)

* scoot buttons around

* move logo to appbar, scoot search

* remove user footer, home link [ci skip]

* review feedback [ci skip]

* fix accidental removal of links (minimalism was a fad anyway) (#21192)

* add button classes to new button (#21213)

* Nav visual changes (#21223)

* switch nav bg + move styling to NavRoot

* readable text

* increase contrast

* selected icon color

* remove bottom padding

* search bar color

* restructure sidebar position

* fix sidebar header color

* move to fixed when small

* fix multiple scrollbars

* fix sidebar width

* home as own item, gear below

* fix admin nav

* extract nav constant, fix types

* remove unused constant [ci skip]

* New nav - get base colors in order (#21262)

* new sidebar button

* nav bg to bg-light

* fix link track, remove extra home link

* color tweaks

* swap colors

* Fix E2E tests for new navigation UI (#21196)

* Use `main` HTML tag for main page content

* Add extra UI helpers for Cypress

* Fix tests failing due to nav UI changes

* Remove not needed NavBar code

* Fix loading databases list

* Use `navigationSidebar` helper for collections

* Use `navigationSidebar` for collection tests

* Close sidebar in SQL filters tests

* Extract AppBar component to `metabase/nav`

* Fix test

* Fix test

* Skip sidebar visibility control test

* Fix JSON engine DB check

* Fix DatasetEditor edit bar colors

* Fix global containers heights

* Fix tests scrolling target

* Fix styles

* Fix navbar cypress helpers

* [ci nocache]

* Fix scroll in e2e test

* Browsing | Manage sidebar state with redux (#21226)

* Move navbar state to redux

* Hide sidbebar using CSS

* Fix native E2E test

* Fix native e2e test

* Fix model tests

* Use more accurate element getters

* Fix e2e tests

* Browsing | Fix dashboard UI (#21233)

* Fix parameter widgets event listeners

* Attach scroll events to "main" instead of window

* Resize filters panel when navigation sidebar open

* Reorder imports at App

* Hide AppBar and NavBar when editing dashboard

* Fix navbar & appbar visibility

* Fix filter positions

* Extract `getMainElement` helper

* Update unit tests

* Fix test

* Browse fix bulk actions (#21320)

* make bulk action bar aware of sidebar, remove extraneous layout components

* clean up styling

* convert BulkActionBar to tsx

* Fix types

Co-authored-by: Kyle Doherty <5248953+kdoh@users.noreply.github.com>
Co-authored-by: Gustavo Saiani <gustavo@poe.ma>
Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2022-03-30 22:29:50 +03:00
Diogo Mendes
c6aff0bfe8 Downgrade Github actions to version 2 (#21364)
* Downgrade download action version

* Revert upload action
2022-03-30 16:09:56 -03:00
adam-james
3ff3a3e716 Bookmarks remove favorites (#21353)
* Remove errant :bookmarked hydration key

This was left over from an incorrect implementation of :bookmarked status. No :bookmarked hydration function exists
anyway, the key does nothing.

* Remove old favorites models that are superceded by bookmarks

* Remove dashboard favorite require
2022-03-30 11:58:28 -07:00
heckendorfc
3d6858b31c Docs - point Models link to the right directory (#21331) 2022-03-30 15:27:29 -03:00
Nemanja Glumac
72c19e2673 [E2E] Log output to file (#21360) 2022-03-30 20:21:43 +02:00
Gustavo Saiani
6e75652dd5 Use whitelabelable color (#21351) 2022-03-30 15:20:46 -03:00
Jeff Bruemmer
4800159c75 update links (#21356) 2022-03-30 14:16:31 -04:00
Nemanja Glumac
dc9e586df3 Remove unsupported flag from the open mode in Cypress [ci skip] (#21357) 2022-03-30 14:52:33 -03:00
Luis Paolini
d3cd961c38 Unify build + Percy processes (#21104)
* Rebase

* Adding maildev version

copying Pawit's commit on this specific file
2022-03-30 14:50:01 -03:00
Alexander Polyankin
a2ee011bd1 Fix a race condition when creating default timelines (#21354) 2022-03-30 20:06:02 +03:00
adam-james
27c7954760 Added bookmarked-score to enable boosting of bookmarked items (#21171)
* Added bookmarked-score to enable boosting of bookmarked items

* Collection Search Query doesn't error with bookmark left join

* adjust collection id AS in base query

* Set proper bookmark status in collection for search tests

* Actually score bookmarks when bookmarked

* Added a bookmark scoring test

* Remove old todo since it does work. (yay)
2022-03-30 09:29:00 -07:00
Diogo Mendes
a878a169fd Increasing Buildjet machines on Uberjar and E2E for better performance (#21346)
* Test 8vCPU

* Run just uberjar for metrics

* Testing with 8

* Reverting commented code
2022-03-30 12:49:05 -03:00
Ariya Hidayat
02a627e6ee Remove flicker in SQL editing autocomplete (#21302) 2022-03-30 07:20:22 -07:00
Mahatthana (Kelvin) Nomsawadi
61ac7789fc Make it easier to get help (#21212) 2022-03-30 21:19:41 +07:00
Ryan Laurie
617eaffcb4 Fix Time Series Fill When Grouping by Minute (#21323)
* fix minute index

* test specific timeseries intervals
2022-03-30 06:23:57 -06:00
Alexander Polyankin
7cc543f374 Show the events time range in the sidebar (#21293) 2022-03-30 13:32:49 +03:00
Nemanja Glumac
444d16c81b [E2E] Add embedding group to GitHub Actions (#21295) 2022-03-30 11:17:00 +02:00
Howon Lee
3013b5151e JSON column API change and fixes (#21175)
All under the grand path to #708.

Changes field API to be compatible with nfc-paths. Allows joining of nested field columns by shoving the full identifier into the postgres function call. Also fixes arcane macro test bug by not using the macro.
2022-03-29 23:12:30 -07:00
Ariya Hidayat
218f702700 [E2E] Explicitly point to the running Snowplow micro (#21335) 2022-03-29 22:04:40 -07:00
Mahatthana (Kelvin) Nomsawadi
9f9a359391 Make "Invite someone" button not overlapping with other elements (#21279) 2022-03-30 11:47:45 +07:00
Pawit Pornkitprasan
10dec2458f [e2e] use maildev version 1.1.0 (#21333)
New releases of maildev were recently made which has UI changes
as well as changing the default port from 25 to 1025, causing tests
to fail.

While we may want to upgrade maildev in the future, let's stick to
the old version first to unbreak all the tests.
2022-03-30 10:19:40 +07:00
Pawit Pornkitprasan
0a394e37ac Don't log stack trace when opportunistically trying out SSL (#21280)
* Revert "Log database connection error before humanizing it (#10695)"

This reverts commit 426df1631d.

This is no longer needed. The original exception message is kept
in the inner exception and everywhere this is used, the whole
stack trace is logged anyway.

* Don't log exception when opportunistically trying SSL
2022-03-29 22:18:51 -03:00
Alexander Polyankin
c59a1756c1 Merge events by pixel coordinates (#21282) 2022-03-30 00:02:00 +03:00
Ariya Hidayat
f613e81a20 Repro #21034: Autocomplete flicker in SQL Editor (#21301) 2022-03-29 13:11:29 -07:00
Gustavo Saiani
b669bd7cbc Bookmarks: render official icons for collections (#21240) 2022-03-29 17:08:05 -03:00
Nemanja Glumac
c48a2ea1d9 Separate auditing related tests from sharing E2E group (#21324) 2022-03-29 16:41:54 -03:00
Bryan Maass
dc3b6078a7 Fix Loading the SSL root certificate into a TrustManager (#21304)
To be usable in the postgres driver, the _uploaded_ root cert needs to:

  - have its prefix stripped
  - and be base64 decoded

(note: this was not an issue when pointing to a local file)
2022-03-29 12:19:37 -07:00
Ariya Hidayat
435e88ff1a [E2E] Run the tests with Snowplow (Micro) (#21319) 2022-03-29 12:08:13 -07:00
Nemanja Glumac
34dec3c034 [E2E] Refactor parameters-embedded spec into embedding-dashboard (#21292)
* Remove unneeded requests

* Remove tests not related to embedding

* Remove embedded question test

Covered in `embedding-native.cy.spec.js`

* Extract question details

* Extract dashboard details

* Fix question details

* Refactor an anti-pattern

Do not assign return values to previously defained variables.

* Do not use hard coded JWT signed token

* Simplify and merge dashboard tests into one

* Divide context into UI and API

* Extract common code into `beforeEeach` for UI context

* Merge UI tests into one

* Rename spec to `embedding-dashboard`

* Remove unnecessary `beforeEach` block

* Extract data and functions into a separate file

* Make sure we can disable previously set parameters
2022-03-29 20:12:19 +02:00
Alexander Polyankin
1c9b7af74c Add markdown label for events (#21254) 2022-03-29 20:53:11 +03:00
Alexander Polyankin
d373bf308c Scroll to selected event when opening the sidebar (#21317) 2022-03-29 19:50:36 +03:00
Noah Moss
702f2933a7 Misc bug fixes for download permissions (#21275) 2022-03-29 12:15:21 -04:00
Nemanja Glumac
51968bd684 Repro #15876: Incorrect casting to TIME (#21316)
* Add repro for #15876 [ci skip]

* Store database id in a variable [ci skip]
2022-03-29 11:02:17 -03:00
Diogo Mendes
01ceda53bd Changing currents group from folder to edition (#21314)
* Changing group to edition

* Update .github/workflows/e2e-tests.yml

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>

* Update .github/workflows/e2e-tests.yml

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2022-03-29 11:01:59 -03:00
Noah Moss
abea0e31a8 Allow non-admins to read and write user-local settings via the API (#21235) 2022-03-29 09:55:50 -04:00
Ngoc Khuat
57d0ff0ac7 Add General Permissions graph APIs (#21124)
* add API to fetch general permisisons graph

* add API to update general permissionns

* change author of migration

* update documents

* misc fixes to applease the CIs

* Add tests for general permission APIs and models

* linting and fix a failed test case

* fix some failed tests

* update docs and change /subscription/ to /general/subscription/ for consistency

* address noah's comments

* Parse number as is in http-client for tests

* revert the last commit about parsing API response in tests

* change fk name

* Changes:
- Rename `changes` column to `after` to keep things consistent
- If a group  has no General Permisions, it'll not be included in the graph
- Update tests and some docs

* fix failing tests in ee

* add some tests and make docstring completes

* fix namespaces
2022-03-29 17:42:48 +07:00
Pawit Pornkitprasan
cca7c1701c Speed up cypress start time (#21310)
* Set integrationFolder to avoid cypress globbing all folders

* cypress snapshot: don't upload compress video on pass
2022-03-29 15:59:45 +07:00
Alexander Polyankin
e70de4b5ac Decrease the margin between the event title and author (#21294) 2022-03-29 10:30:49 +03:00
Alexander Polyankin
5024b7a441 Select timeline events from the sidebar (#21289) 2022-03-29 10:30:17 +03:00
Noah Moss
93ea70f02e Add new valid-path-format? predicate for schema validation to fix downgrading issues generically (#21255) 2022-03-28 19:36:44 -04:00
Ryan Laurie
fc23c19ff2 Fix precision error in chart domain pad (#21263) 2022-03-28 15:38:29 -06:00
Ryan Laurie
2affdea94d Fix Padding on Single Database Names (#21283)
* use block elements to pad single database name

* fix readonly proptype console error
2022-03-28 13:06:55 -06:00
Noah Moss
a6ab6f9019 Better key parsing for json in test HTTP responses, and new test for data perms graph GET endpoint (#21216) 2022-03-28 14:07:08 -04:00
Diogo Mendes
1590598243 Fix space (#21284) 2022-03-28 13:48:38 -03:00
Diogo Mendes
02b116d967 Merge branch 'master' into master 2022-03-28 13:41:19 -03:00
Alexander Polyankin
24c7832edf Add a way to unarchive timelines and delete them permanently (#21177) 2022-03-28 18:01:50 +03:00
Ryan Laurie
0e9569788a fix overflowing long schema names (#21252) 2022-03-28 08:46:35 -06:00
Alexander Lesnenko
88afb0c966 Improve backports (#21148)
* extract actions

* check metabase membership
2022-03-28 10:05:29 -04:00
adam-james
37642aaa10 Add :dataset key to card bookmarks (#21261)
* Add :dataset key to card bookmarks

The :dataset key is boolean and indicates when a card (question) has been turned into a model.
The frontend will use this key to determine which icon is used to display the bookmark in the sidebar.

* Reduce some duplication in this test
2022-03-28 06:35:44 -07:00
Mahatthana (Kelvin) Nomsawadi
376f6a3114 Fix Cypress tests not passing on backporting PR (#21281) 2022-03-28 19:43:22 +07:00
Ariya Hidayat
f90692d3d5 Enable subdimensions on time column (type/Time) (#20902) 2022-03-27 22:15:18 -07:00
Ariya Hidayat
23517953fe Resolve node-forge to v1.3.0 (#21273) 2022-03-27 11:59:53 -07:00
Ariya Hidayat
edbd23d026 [E2E] Add sharing test group to GitHub Actions (#21274)
* [E2E] Add sharing test group to GitHub Actions

* Test in branch

* Back to master
2022-03-27 15:18:13 -03:00
Ariya Hidayat
0f46993b89 [E2E] Add models test group to GitHub Actions (#21272)
* [E2E] Add models test group to GitHub Actions

* Test in branch

* Back to master
2022-03-27 07:43:05 -03:00
Diogo Mendes
64508900a5 Moving Currents.dev from CCI to GHA (#21258)
* Removing from CCI

* Adding Currents to GHA

* Let there be run

* Returning to master

* Adding new key to new project on Currents

* Adding --ci-build-id to support GHA Re-Runs

* Returning to branch to test it more

* Removing not needed info (repo)

* Returning to master
2022-03-26 10:24:14 -03:00
Ariya Hidayat
9161ae3bb9 [E2E] Fix accidental branch switch (#21268) 2022-03-26 07:32:06 -03:00
Ariya Hidayat
884cd76dc6 [E2E] Add admin test group to GitHub Actions (#21266) 2022-03-25 20:07:49 -07:00
Ariya Hidayat
03f3269e20 Bump minimist to v1.2.6 (#21256) 2022-03-25 14:12:33 -07:00
Alexander Polyankin
ebf1dec478 Make clicking on the event title open the edit form (#21193) 2022-03-25 20:58:09 +03:00
Diogo Mendes
08f9ea6938 Rollback on version (#21257) 2022-03-25 14:43:53 -03:00
Diogo Mendes
336fe2de17 Updating Github actions to latest ones and making Ubuntu 20.04 LTS default (#21249)
* Updating actions

* [ci noskip] Changing ubuntu to latest lts as default

* [ci noskip] Fix typo
2022-03-25 14:30:23 -03:00
Ariya Hidayat
081f2e840b [E2E] Add native and native-filter test groups to GitHub Actions (#21251) 2022-03-25 10:14:29 -07:00
Luis Paolini
24d600c0d3 Add distro (#21253) 2022-03-25 13:45:51 -03:00
Alexander Polyankin
e6c0cbfdd4 Add timeline permissions (#21126) 2022-03-25 18:57:53 +03:00
Luis Paolini
8b0f2c1368 Fallback cache keys & upgrade caching actions (#21234)
* First commit

* Reverting input deletion
2022-03-25 11:40:59 -03:00
Ariya Hidayat
9c1b22577c Admin E2E tests: guard assertions with element visibility check (#21197) 2022-03-25 06:43:18 -07:00
Gustavo Saiani
b792eedab5 Toggle bookmarks list visibility (#21203) 2022-03-25 10:42:48 -03:00
Gustavo Saiani
5fce46b3ff Bookmarks: render more specific icons when bookmarked item is a question (#21170) 2022-03-25 09:32:26 -03:00
Mahatthana (Kelvin) Nomsawadi
b9602db06c Fix moved model's collection isn't displayed until page refresh (#21178) 2022-03-25 16:04:59 +07:00
Alexander Polyankin
1e445900c6 Add basic markdown support to events (#21214) 2022-03-25 11:57:37 +03:00
Nemanja Glumac
f844381337 Upgrade @types/webpack-dev-server to the latest version 4.7.2 (#21232) 2022-03-25 09:56:29 +01:00
Mahatthana (Kelvin) Nomsawadi
e81a1a31a1 Fix cannot convert questions with snippets to models (#21210)
* Add repro for #20963

* Fix cannot convert question with snippets to models
2022-03-25 15:54:38 +07:00
adam-james
200d4d815c Add :can_write to the :collection hydration for timelines (#21236) 2022-03-25 11:36:51 +03:00
Mahatthana (Kelvin) Nomsawadi
1061477bc7 Fix display values options not updated after the field is updated (#21217) 2022-03-25 11:55:30 +07:00
Ariya Hidayat
769cbef7ae Robustify timeline E2E tests (#21219) 2022-03-24 18:58:59 -07:00
Dalton
781b63d2b6 show loading wrapper until all data is available (#21172) 2022-03-24 16:24:46 -07:00
Cam Saul
9fdb17986b Fix :postgres filtering by current quarter; remove a few unneeded casts in PG SQL output (#21204)
* Fix Postgres filter by quarter

* Fix test for MongoDB to work around #5419

* Spark SQL doesn't allow quarters in intervals either
2022-03-24 16:12:22 -07:00
Ariya Hidayat
68b83a6858 Dashboard filters E2E: sync assertions with important API calls (#21200) 2022-03-24 16:02:00 -07:00
Ryan Laurie
72eaf39606 Ignore Empty Conditional Formatting Queries (#21224)
* ignore empty substrings in conditional formatting filters

* handle not-equal formatter
2022-03-24 17:01:37 -06:00
Ariya Hidayat
ac18cbf836 Remove ScratchApp (#21220) 2022-03-24 15:06:11 -07:00
Ryan Laurie
98761e7ee1 Display Custom Parameter Fields on Mobile (#21189)
* allow question paramater fields on mobile

* hide editor bar on mobile when there are no params

* show editor controls when already open

* add parameter mobile visibility test

* add visibilityToggler unit tests
2022-03-24 14:56:00 -06:00
Alexander Polyankin
20dea3249f Clip voronoi by X axis (#21186) 2022-03-24 23:27:30 +03:00
Nemanja Glumac
9e534c8dab [E2E] Introduce visitDashboard helper (#21218)
* Create `visitDashboard` E2E helper

* Apply helper to the related tests

* Fix waiting for redundant xhrs

* Make helper work for users without permission to access dashboard

* Do not use helper when asserting on individual dashcard queries

* Refactor repro for 18454

* Improve dashboard permissions test
2022-03-24 21:19:42 +01:00
adam-james
c29951e0fa Hydrate Collections on Timelines for card/collection endpoints (#21227)
* Hydrate Collections on Timelines for card/collection endpoints

* Add tests to check that collection is hydrated

* Add missing docstring
2022-03-24 13:08:31 -07:00
Anton Kulyk
4f88e2db71 Attempt to fix SummarizeSidebar flakiness (#21130)
* Refactor SummarizeSidebar

* Fix E2E test
2022-03-24 22:07:53 +02:00
Diogo Mendes
f3432569e8 Remove concurrency (#21225) 2022-03-24 16:16:45 -03:00
Gustavo Saiani
d5b9920b92 Test bookmarking from a Question page (#21164) 2022-03-24 14:33:33 -03:00
Alexander Polyankin
e45ab2b976 Resize mail icon to fix the standard viewbox (#21211) 2022-03-24 20:32:17 +03:00
Cam Saul
7f9aa58ae1 Make mt/with-everything-store parallel capable and mark more tests as ^:parallel (#21207) 2022-03-24 09:29:46 -07:00
Cam Saul
d98fbcf96e Fix expressions with duplicate column names (#21208) 2022-03-24 09:28:44 -07:00
Cam Saul
2eb6139556 Support quarters in Dashboard filters (#21205)
* Support quarters in Dashboard filters

* Mark test as ^:parallel

* 🔧
2022-03-24 09:28:23 -07:00
Ariya Hidayat
309c4058ec E2E repro 17514: another element visibility check before assert (#21199) 2022-03-24 08:31:52 -07:00
Nemanja Glumac
9f33ac3fb6 [E2E] Expand embedding native tests (#21185)
* Remove remapping as it does not have any effect on native questions

* Name filter in sync with the documentation reccommendation

* Enable sharing via UI

* Publish changes via UI

* Set the token expiration in the helper function itself

* Expand the helper to work for both questions and dashboards

* Expand helper to include filter values and hidden filters

* Asert on the `embedding_params` upon publishing embedding changes

* Expand tests with API context

* Properly fix FK filter

* Fix typo and expand helper example

* Add API test for locked parameters

* Separate UI and API tests
2022-03-24 16:13:46 +01:00
Ariya Hidayat
f91bbd0683 Mongo E2E test: fix race condition between typing and dataset (#21123) 2022-03-24 07:53:25 -07:00
adam-james
fca980fb27 Default Icon for Timelines / Events and Root Collection Hydration (#21201)
* Timeline has default icon, Timeline Event default icon from Timeline

* Move the icon schema to Timeline model.

The 'default icon' of a Timeline is concretely 'star', whereas the default icon for an event is taken from the
Timeline it's part of, which could be any of the icons.

Since the default should be one of the icons listed in the Schema, it makes sense for readability that the icon schema
is in the same namespace.

* When timeline's collection_id is nil, build the root collection

Timeline's always have :collection_id, and when the ID is a proper ID, :collection hydration works properrly. When the
ID is nil, we don't pass the necessary data to the frontend. So, match the behaviour for the `GET
/api/collection/root` endpoint and use that data on the :collection key

* Add root collection hydration to GET /api/timeline

* Add tests for collection hydration and timeline default icons
2022-03-24 07:39:18 -07:00
Noah Moss
3eb0d2c256 Fix test for inclusion of global viz settings in viz settings middleware (#21188) 2022-03-24 08:29:16 -04:00
Alexander Polyankin
9d6d560973 Increase the click area for the back button in event modals (#21187) 2022-03-24 10:57:56 +03:00
Cam Saul
38ea154a26 Replace remaining references to qp/query->preprocessed with qp/preprocess (#21047)
* Remove references to qp/query->preprocessed

* Fix Oracle
2022-03-23 19:47:59 -07:00
Ariya Hidayat
a3222b7e4b [E2E] Add collections test group to GitHub Actions (#21159) 2022-03-23 18:54:38 -07:00
adam-james
3d3b507ae1 Escaping quotation marks in a tru string to pass the linter (#21202) 2022-03-23 17:25:06 -07:00
Nemanja Glumac
df44d332ab Unskip repro for #18729 (#21194) 2022-03-23 21:15:23 +01:00
Nemanja Glumac
4a0f335f14 Unskip repro for #20845 (#21195) 2022-03-23 21:15:06 +01:00
Alexander Polyankin
1e51c88ced Add snowplow events for timelines (#21008)
* Add a json schema

* Pass required data for snowplow events

* Pass required data for snowplow events

* Add snowplow event tracking for Timeline event creation

This changes the timeline_event API endpoint to send snowplow tracking when an event is created.
The FE now sends additional information for this purpose:

- source: collections or question. This is null if the event is added via API
- question_id: added if the source is from a question. null if the question is unsaved.

These are dissoc-ed from the body before the db/insert because the backend does not store this information, it's just
from the FE and only relevant for this tracking data.

* Fix json error

* Add ::new-event-created entry to the snowplow test

* Fix json error

* Fix json error

* Fix snowplow test

Co-authored-by: Adam James <adam.vermeer2@gmail.com>
Co-authored-by: adam-james <21064735+adam-james-v@users.noreply.github.com>
2022-03-23 13:02:03 -07:00
Luis Paolini
dd2b8fa2fc Typo on DashboardSubscriptions (#21013)
* Typo on DashboardSubscriptions

* Update enterprise/backend/src/metabase_enterprise/advanced_config/models/pulse_channel.clj

Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>

* Update enterprise/backend/src/metabase_enterprise/advanced_config/models/pulse_channel.clj

Co-authored-by: Jeff Bruemmer <jeff@metabase.com>

Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>
Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
2022-03-23 12:42:04 -07:00
Ariya Hidayat
4028bcbd23 Exclude /_internals from production build (#21162) 2022-03-23 11:52:30 -07:00
Gustavo Saiani
bf958b678c Add e2e tests to bookmarking in dashboard page (#21059) 2022-03-23 15:04:00 -03:00
adam-james
f80bce03ef Events BE fixes - Hydrate :collection on timelines and default icon "star" (#21169) 2022-03-23 18:55:51 +03:00
Diogo Mendes
8869361ec5 Running Currents only on Master (#21161)
* Running Currents only on Master

* [ci noskip] Ident

* [ci noskip] ident comment

* [ci noskip] Fixing yaml

* [ci noskip] creating forlders

* [ci noskip] space
2022-03-23 12:47:17 -03:00
Ariya Hidayat
62329a4344 Models E2E tests: ensure query and table view before assertions (#21151) 2022-03-23 08:11:28 -07:00
Ryan Laurie
c950e50294 remove explicit z-index on DateOperatorSelector (#21146) 2022-03-23 08:49:34 -06:00
Gustavo Saiani
86d2c72ae0 Add e2e tests on bookmarking in a Collection page (#21058) 2022-03-23 11:39:42 -03:00
Diogo Mendes
615c0436bd Making sure directory is there to restore cache (#21181) 2022-03-23 09:38:44 -03:00
Howon Lee
10a527db60 Postgres JSON nested field columns (#21007)
This is the first vertical slice of #708. There is a material ways to go, including mysql implementation, plinking away at the data model stuff, and frontend. There are also big putative sync speed gains I think I should chip away at.
2022-03-23 01:11:06 -07:00
Benoit Vinay
ef256e3108 Various fixes for errors seen in the console while browsing (#21060)
* shouldNotForwardTransientProp method created for emotion

* BadgeIcon html attributes clean up

* Usage of transient property $hasMargin in Badge for BadgeIcon

* HTML attribute cleanup for LinkRoot

* React key added to ButtonBar child if not defined

* Properties for TableInfoPopover properly typed

* Misc

* analyticsContext property set as non required as non of the parents enforce it or pass a value

* Clean up attributes for SVG in Icon

* CSS fix for share icon special case in Icon

* Checkbox controlled component default value fix

* Misc clean up

* index file for collection side bar

* Collections collectionID type fix

* collection type in NewCollectionItemMenu fix

* Misc

* TokenField fix for value

* noPopover passed properly to WidgetStatusIcon

* Updates to controlled input/checkbox

* VS Code workspace file added to gitignore

* shouldNotForwardTransientProp renamed to shouldForwardNonTransientProp

* AddAggregationButton defaultProps updates

* propTypes for TableInfoPopover added back
2022-03-22 20:56:19 +01:00
Alexander Polyankin
5958d0ff39 Fix incorrect event icon collapsing (#21158) 2022-03-22 22:26:36 +03:00
Alexander Polyankin
650e2a90a7 Fix snowplow test (#21157) 2022-03-22 22:24:57 +03:00
Ariya Hidayat
794cf3ed1b Fix string quoting in custom expression (#21049)
Custom expression does not follow JSON standard (RFC 4627) and therefore
it's not possible to use JSON.stringify to correctly quote a string literal.
2022-03-22 11:04:28 -07:00
Dalton
6ea0489290 parse canonical collection id when saving question (#21145) 2022-03-22 09:57:55 -07:00
Alexander Polyankin
f890cec80d Use option icon in case it exists for selected items (#21152) 2022-03-22 15:59:53 +03:00
Alexander Polyankin
50ba9b3207 Fix text overflow issues in events (#21154) 2022-03-22 15:39:27 +03:00
Alexander Polyankin
0e63aa00c0 Make event icons responsible (#21141) 2022-03-22 15:07:33 +03:00
Benoit Vinay
c80c90ca9f Line chart value replacement for Mongo DB (#21012)
* Tick range fix for timeseries scale

* Revert ticksForRange in timeseries

* Resetting the timestamp parsing based on the unit

* Move startOf reset to getDatas only

* Misc

* Misc

* Cater for null xValue

* Completely rewrite repro for #16170

Co-authored-by: Nemanja <31325167+nemanjaglumac@users.noreply.github.com>
2022-03-22 11:05:31 +01:00
Nemanja Glumac
829bf85ae0 Add initial test coverage for native questions embedding (#20909)
* Add inital test coverage for native questions embedding

* Update frontend/test/metabase/scenarios/embedding/embedding-native.cy.spec.js

Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>

Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>
2022-03-22 08:52:18 +01:00
Dalton
2fe8ac3f36 use relative urls in app template (#20710) 2022-03-21 17:07:47 -07:00
Dalton
d25d6c4e97 Use TippyPopover in the AddMemberTypeahead component (#21097)
* Use TippyPopover in AddMemberRow component

* Add/fix propTypes
2022-03-21 17:07:34 -07:00
Nemanja Glumac
7dade51afa Repro #21135: CC with the same names as the existing columns causes confusion in the expression editor (#21139)
* Add repro for #21135

* Address feedback and reinforce test
2022-03-22 00:18:51 +01:00
adam-james
69d3d9be24 Bookmark display and authority keys (#21142)
* Add :display to the bookmark query (card specific).

Bookmark results can now optionally show a 'display' key, which is relevant only to cards.

This does not change the db in any way, it just pulls additional data from the left-join in the query already.

This particular key :display is used on the frontend to change the icon that the bookmark renders with in the
sidebar.

* Add a test that confirms `:display` key exists on card bookmarks

* Bookmarks on official collections now have `authority_level` key
2022-03-21 13:54:23 -07:00
Jeff Bruemmer
c322fc0287 docs - link maintenance (#21143) 2022-03-21 16:52:47 -04:00
Alexander Polyankin
fad0a18037 Change event icon sizes in chart (#21128) 2022-03-21 22:40:21 +03:00
Diogo Mendes
801990374c Test 2022-03-21 15:29:42 -03:00
Diogo Mendes
79871528e1 Mix 2022-03-21 15:27:23 -03:00
Diogo Mendes
afe7e39871 Remove 2022-03-21 15:12:34 -03:00
Diogo Mendes
157b24fa42 Revert "Test"
This reverts commit 46fcefc678.
2022-03-21 14:23:05 -03:00
Diogo Mendes
46fcefc678 Test 2022-03-21 14:22:52 -03:00
Diogo Mendes
88c10259c6 Force conflict 2022-03-21 14:14:09 -03:00
Noah Moss
dd8549703d Remove permission path validation from specific functions to preserve downgradability (#21040) 2022-03-21 12:37:35 -04:00
Ariya Hidayat
2f822f059c [E2E] Add a few more query-related CI groups to GitHub Actions (#21122) 2022-03-21 09:29:44 -07:00
Cam Saul
76d5a06d3a Don't format non-temporal columns as datetimes in XLSX exports (#21048)
* Don't format non-temporal columns as datetimes in XLSX exports

* Test fixes 🔧

* Oops uncomment something
2022-03-21 09:22:44 -07:00
Nemanja Glumac
077a9f383c [E2E] Robustify visit question by applying visitQuestion helper (#21127)
* Apply `visitQuestion` helper

* Fix tests for models
2022-03-21 15:02:44 +01:00
Alexander Polyankin
17df467867 Filter timelines by question's dates (#21095) 2022-03-21 11:41:55 +03:00
Ariya Hidayat
1a771a64a6 E2E for repros: check dataset and table view before assertions (#21121) 2022-03-20 16:56:50 -07:00
Ariya Hidayat
6350342a41 MySQL E2E test: wait for dataset and table view before assertions (#21115) 2022-03-20 11:58:30 -07:00
Ariya Hidayat
5d100b0eb7 Binning E2E tests: ensure dataset and table view before assertions (#21118) 2022-03-20 11:42:00 -07:00
Ariya Hidayat
a20a7ef69b E2E tests on master: use Buildjet 4vCPU (#21119) 2022-03-20 15:40:52 -03:00
Ariya Hidayat
173464952f Search E2E test: ensure that the People table is really loaded (#21117) 2022-03-20 09:39:58 -07:00
Ariya Hidayat
3392437acd Dashboard drill E2E tests: ensure element visibility before assertions (#21114) 2022-03-19 21:08:48 -07:00
Ariya Hidayat
30bfb3d466 Smoketest admin E2E: guard assertions with element visibility check (#21110) 2022-03-19 10:53:12 -07:00
Ariya Hidayat
447c915e32 Resolve nanoid to v3.1.31 (#21113) 2022-03-19 10:13:33 -07:00
Nemanja Glumac
8d9924f60d [E2E] Add question CI group to GitHub Actions (#21099)
* Reinforce various `question` tests that were failing in GHA

* Add `question` E2E` group to the GitHub Actions on `master`
2022-03-18 22:36:09 -07:00
Ariya Hidayat
beff8a57e3 Auth E2E tests: wait for the dataset to load before assertions (#21107) 2022-03-18 17:55:55 -07:00
Ariya Hidayat
68e2595a8b Search E2E tests: ensure element visibility before assertions (#21106) 2022-03-18 17:33:56 -07:00
Alexander Lesnenko
2ffd324cd4 fix percy (#21103)
* update timeout and use buildjet

* return percy push job branch constraints

* revert timeouts

* use prepare-cypress
2022-03-18 19:34:53 -04:00
Nemanja Glumac
2e267a21a1 Upgrade percy to the latest version 3.1.1 (#21010)
* Upgrade `@percy/cypress` to the latest version `3.1.1`

* Upgrade `@percy/cli` to the latest version
2022-03-18 18:19:08 -03:00
Maz Ameli
6c92c9fe4c change sharing icon (#21096) 2022-03-18 11:49:32 -07:00
Diogo Mendes
9b252874aa Enabling Currents.dev on CircleCI (#21071)
* Adding currents

* Update .circleci/config.yml

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2022-03-18 14:13:49 -03:00
Dalton
5d5deac1da Add validation logic to TemplateTagDimension dimension tag handling (#20878)
* Add validation logic to TemplateTagDimension dimension tag handling

* Add basic error message to query builder

* Update error text

* Add unique error message for validation errors

* Update text of error state

Co-authored-by: Maz Ameli <maz@metabase.com>

* Fix types

* Fix NativeQuery unit test

* Add unit tests for new components

Co-authored-by: Maz Ameli <maz@metabase.com>
2022-03-18 09:25:38 -07:00
Nemanja Glumac
1ba80fd25a [E2E] Fix permissions flakes (#21092)
* Fix sandboxing test related to subscriptions

* Fix subscriptions test related to joins
2022-03-18 16:15:09 +01:00
Nemanja Glumac
107a2388a8 Skip repro for 8406 due to #21026 (#21094) 2022-03-18 12:01:36 -03:00
Jeff Bruemmer
0580c93ab2 docs - remove enterprise refs (#21091) 2022-03-18 10:29:17 -04:00
Nemanja Glumac
d2ce807293 Upgrade @cypress/webpack-preprocessor to the latest version (5.11.1) (#21067) 2022-03-18 13:43:48 +01:00
Nemanja Glumac
626f2ed7eb Fix question E2E flakes (#21085)
* Fix repro 12457 flake

* Fix repro 17397 flake

* Remove redundant tests
2022-03-18 13:42:57 +01:00
Mahatthana (Kelvin) Nomsawadi
ebdc3d2106 Make Models not embeddable #20815 (#21025) 2022-03-18 18:33:05 +07:00
Alexander Polyankin
8220d653e7 Highlight selected events in the query builder (#21038) 2022-03-18 12:47:07 +03:00
Mahatthana (Kelvin) Nomsawadi
329b540b7d Fix regression from fixing #20954 (#21051)
* Fix a regression from fixing #20228

* Reorder code order to make it easier to reason about.
2022-03-18 12:01:52 +07:00
Jeff Bruemmer
37f3ab430f docs - driver guide (#20567) 2022-03-17 20:47:53 -04:00
Noah Moss
b0b8288afc Add autolink support and better email link handling to backend Markdown parsing (#21039) 2022-03-17 20:02:32 -04:00
Luis Paolini
2513967529 Containerizing using the current release container process (#19885)
* Containerizing using the current release container process, as it's not only more representative, but also we use yarn and maven caching which should be faster

* rebasing

* Update uberjar.yml
2022-03-17 18:59:33 -03:00
Ariya Hidayat
c284ee1bc8 Robustify E2E model tests by waiting for the dataset to arrive first (#21068) 2022-03-17 14:43:07 -07:00
frannietrempe
ed2ee1da5d docs - update sql editor page (#21033)
* docs - update sql editor page

* change sql example to upper case

* Apply suggestions from code review

Co-authored-by: Jeff Bruemmer <jeff@metabase.com>

Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
2022-03-17 16:03:08 -04:00
Diogo Mendes
6d160a093d Adding cy2 to the project (#21070) 2022-03-17 16:59:27 -03:00
Dalton
ecebd2f2a6 Add tippy/popper replacement for PopoverWithTrigger (#20930)
* Add tippy/popper replacement for PopoverWithTrigger

* Refactor and fix types

* Move PopoverWithTrigger components to own folder

* Add tests

* rename children prop to popoverContent

* Fix direct ParameterTargetWidget.jsx reference
2022-03-17 11:48:20 -07:00
Nemanja Glumac
51e8edb625 Fix E2E binning sidebar flakes (#21066)
* Add a guard that reduces flakiness of binning tests
2022-03-17 19:02:54 +01:00
Noah Moss
f917849c19 Delete MetaBot permissions group (#20925) 2022-03-17 13:56:05 -04:00
Nemanja Glumac
8a4cd02a13 Upgrade eslint-plugin-cypress to the lastest version (2.12.1) (#21062) 2022-03-17 18:32:27 +01:00
Gustavo Saiani
3732886c74 Bookmark items in collection page (#21024) 2022-03-17 10:21:49 -03:00
Nemanja Glumac
15e925dd30 Upgrade @cypress/skip-test to the latest version 2.6.1 (#21053) 2022-03-17 14:08:15 +01:00
Nemanja Glumac
59857969b8 Upgrade cypress-grep to the latest version (2.13.1) (#21029) 2022-03-17 13:09:17 +01:00
Nemanja Glumac
048f1c6641 Increase E2E QA DBs timeout (#21052)
* Increase timeout for QA DB sync

* Delete DB after the snapshot was taken

This is a hack that seems to prevent race conditions when one DB's sync interferes with the subsequent DB's sync.
2022-03-17 11:56:56 +01:00
Diogo Mendes
f6d20f204b Increase no_output_timeout to DB tests (#21044) 2022-03-17 06:01:41 -03:00
Bryan Maass
73917b3118 Sharing dashboard subscriptions slack performance (#20570)
* Get slack users and conversations simulatenously

- instead of waiting for the channels, and then getting the users

* Add cache+timeout capability to conversations-list

* extend async approach to users-list

- return timeout+cache warning
- adds tests

* updating docstrings + adding more tests

* Add cache clear and seed slack token settings on-change

- add dox for :on-change for defsettings
- fixing tests

* Fixing tests

- cannot pass a declared (not def'd) value
- some cleanup

* remove unused function

* remove need for slack-configured from timeout fns

- update some docstrings

* pre-populate slack caches

- on app init

* introduce blocking (and cache resetting) endpoint

- this one does not timeout, meant to be called when a user hits a
  button like: "Refetch my slack channels"

* removes -timeout versions of users/channels fn

- the endpoint now returns the cached slack data
- removes tests

* fixes routing layer

* remove trailing whitespace

* add missing docstring

* move the cached slack data into a setting

* add missing docstring

* fix typo

* update form-input-test

* refresh cache in test

* remove un-needed anonymous fn wrapping

* refresh slack cache when user sets new valid token

* refresh the cache when reading from it

- the more its used the more up to date it will be

* code review responses + removes 2-arity refresh-cache!

- clear out cache when slack connection is broken or unset
- add to docstring for slack settings route
- wrap init refresh-cache! with a future
- re-spell parallel

* do not block when returning cached slack data

* rename cache defsetting

* Addressing code review issues

- Adds scheduled updates to the slack users and channels cache
  every 4 hours
- Removes `form_input_refresh` route
- Automatically refreshes cache when `form_input` route is hit,
  if 10 minutes have passed since the last cache fix
- Removes cache refresh on app startup
- Stores only user names, and channel names in the cache, not maps with
  irrelevant data
- Clears out some noisy linter warnings via `#_:clj-kondo/ignore`

* Adds slack task RefreshCache jobs

- Sets up startup-triggered and cron-triggered (every 4 hours at a
  random minute) slack channel/username cache refreshing

* Implements 2 jobs to update slack users/channels

- one on startup, one every 4 hours
- improve docstrings

* ns linter fixes

* more ns linter fixes

* refactor files-channel to look in the cache

- instead of making a tricky api call
- fixing tests

* update files-channel-test to test the cache

* fixup integrations.slack ns decl

* fixup test integrations.slack ns decl

* fix outdated mock of slack/files-channel

* fix a few more tests

* fix api slack-test

* adds locking to refresh-channels-and-usernames!

* re-order requires
2022-03-16 21:54:49 -07:00
Ariya Hidayat
14a421aee4 SQL editor: explicit trigger of autocomplete (#20970) 2022-03-16 17:40:57 -07:00
Cam Saul
6ee13aa266 Google Analytics: use service accounts for auth (#21004)
* Use Service Accounts for Google Analytics auth going forward

* Update GA dox

* Dox tweak

* Fix e2e test

* Remove dead googleanalytics form code

Co-authored-by: Dalton Johnson <daltojohnso@users.noreply.github.com>
2022-03-16 17:29:14 -07:00
Cam Saul
f129903c77 Fix [:relative-datetime :current] inside :between filter clause (#20975)
* Fix `[:relative-datetime :current]` inside `:between` filter clause

* Update shared/test/metabase/mbql/util_test.cljc

* Update shared/test/metabase/mbql/util_test.cljc
2022-03-16 17:28:49 -07:00
Alexander Lesnenko
bfa9914055 FE: Download permission management (#20883)
* download permission

* update specs

* remove console log

* fix types

* lint
2022-03-16 18:47:20 -04:00
Nemanja Glumac
98e13e4d89 Upgrade @testing-library/cypress to the latest version (8.0.2) (#21016)
* Upgrade Cypress testing library to the latest version

* Fix collection permissions failing tests

* Fix custom-column failing tests

* Fix `joins` failing test

* Fix visual notebook failing tests

* Fix models failing tests

* Fix `questions` failing tests

* Fix native ee failing test

* Fix onboarding failing tests

* Remove `@types/testing-library__cypress`

058daff38a
2022-03-16 18:06:11 -03:00
Gustavo Saiani
00a8626a6d Remove bookmarked items from list (#20977) 2022-03-16 17:27:32 -03:00
Cam Saul
f9f1bf414d Fix noisy backend tests (#20910)
* Change u/profile from println to log/info

* Change most test printlns to log/info

* Make u/profile message a fn rather than a delay

* Apparently clj-http errors aren't wrapped in :object anymore

* Add running commentary

* Log the amount of time it took to find and run tests

* Sort namespaces

* Update test

Co-authored-by: Diogo Mendes <diogo@metabase.com>
2022-03-16 13:05:23 -07:00
Dalton
9555a4c23d @wilsonpg's "Show download progress/indicator while exporting to avoid multiple clicks" (#21037)
* added status option for rendering widget icon

* mimicked default form behavior using the fetch API

* recreated default html form submit and download

* added GET request functionality to download form

* cleanup

* making requested changes

* onClose, fileName cleanup, blob(), GC link remove

Co-authored-by: Paul Wilson <54870992+wilsonpg@users.noreply.github.com>
2022-03-16 12:59:18 -07:00
Diogo Mendes
70e79af281 Bump executor (#21036) 2022-03-16 16:28:26 -03:00
Dalton
36361c43c8 Fix hook listeners (#20926) 2022-03-16 10:11:09 -07:00
Nemanja Glumac
0cb39acd8f Upgrade cypress-real-events to the latest version (#21011) 2022-03-16 15:31:32 +01:00
Nemanja Glumac
df85cfdbfd Upgrade Cypress to the version 9.5.2 (#21019) 2022-03-16 14:25:14 +01:00
Luis Paolini
492d3ff4b3 Try making the encryption clearer (#20661)
* Try making the encryption clearer

Got the question a few times, so I thought we had to make it more explicit

* Update docs/operations-guide/encrypting-database-details-at-rest.md

Co-authored-by: Jeff Bruemmer <jeff@metabase.com>

Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
2022-03-16 10:07:38 -03:00
Nemanja Glumac
da6d6f8747 Skip failing visual test caused by #21026 (#21027) 2022-03-16 13:45:53 +01:00
Alexander Lesnenko
2eb6bcd09e feature level permission based routing (#20979)
* permission based routing

* review
2022-03-16 01:52:19 -04:00
Ariya Hidayat
321476ad4b E2E on master: only a subset of selective test groups for now (#21023)
Due to Cypress upgrade, we observed failing and/or flakey E2E tests.
Rather than disabling this completely, let's narrow down to a few good
tests for now while robustifying the rest of them.
2022-03-15 20:28:43 -07:00
Cam Saul
2afa0e5a70 Fix error in send-abandonment-emails task (#20976) 2022-03-15 11:50:53 -07:00
Alexander Polyankin
31a0462944 Add event tooltips in charts (#20982) 2022-03-15 20:36:48 +03:00
Alexander Polyankin
9a036a3c8a Fix the issue with events test (#21009) 2022-03-15 19:25:01 +03:00
Noah Moss
817a548663 Migration to add default download perms for existing DBs (#20964) 2022-03-15 10:54:26 -04:00
Gustavo Saiani
8387da107e Bookmark Dashboards (#20971) 2022-03-15 11:44:59 -03:00
Noah Moss
9ea8dd3fde Backend changes to ensure download perms stay consistent (#20880) 2022-03-15 09:16:30 -04:00
Cam Saul
aaf1b60111 Upgrade Liquibase to latest version; remove final Java source file and need for clojure -X:deps prep (#20611)
* Upgrade Liquibase to latest version

* Try adjusting log

* Fix checksums for the TWO migrations with ID = 32

* FINALLY get Liquibase to use Log4j2

* Set Liquibase ConsoleUIService OutputStream to null OutputStream

* Manually define a package for our H2 proxy class so Java 8 works

* Fix package-name determination code

* Update migrations file spec

* `databasechangelog` shouldn't be upper-case

* Lower-case quartz table names

* More MySQL fixes 🔧

* Properties for all the Quartz tables 😢

* Formatting tweaks [ci skip]

* Revert a few more busted changes

* Fix more busted changes

* Bump Liquibase version to 4.8.0 to fix MySQL defaultValueBoolean bug

* OMG I think I finally fixed MySQL

* Remove Java source file and prep-deps code

* Remove two more references to bin/prep.sh

* Minor cleanup

* Revert unneeded changes

* Fix busted indentation

* Don't search inside java/ anymore since it's G-O-N-E

* Appease the namespace linter

* Update src/metabase/db/liquibase/h2.clj
2022-03-14 19:06:49 -07:00
Noah Moss
faf55fb6fd Write path for download permission graphs (#20759) 2022-03-14 18:02:10 -04:00
Gustavo Saiani
946978d867 Bookmark collections (#20950) 2022-03-14 18:03:32 -03:00
frannietrempe
5128affe21 docs - fix links (#20996)
thanks @qnkhuat for pointing these out! 🙏
2022-03-14 16:17:41 -04:00
Alexander Polyankin
2330ff5d8e Add event creation to the query builder (#20990) 2022-03-14 20:45:52 +03:00
adam-james
65c01bdd44 Adjust GET /api/timeline to allow include=events parameter (#20972)
This lets the Frontend get a list of timelines with the events included, useful in case of having an unsaved question
where timelines should still be showable.

> left comments but seems workable

I'm going to merge this to let FE continue events implementation. 

I will discuss the above concerns in Slack, and we can make adjustments as needed.
2022-03-14 10:19:33 -07:00
Nemanja Glumac
0e145152b0 Reinforce admin field-type E2E tests (#20987)
* Use appropriate query selector

* Wait for the table metadata to load

* Ensure popover contents loaded before we attempt to scroll
2022-03-14 16:53:57 +01:00
Benoit Vinay
f6085da31e Clean up static chart components accessors (#20968)
* accessors constants created

* accessors dependencies removed from all charts

* Removed accessors dependencies from BE JS for static viz

* Removed accessors references in chart editor

* accessors added to defaultProps

* Remove accessors in tests

* defaultProps removed form static viz components
2022-03-14 14:29:36 +01:00
Nemanja Glumac
8e174f0bdc Quarantine caching e2e tests (#20984)
Note: should be revisited and enabled once we fix https://github.com/metabase/metabase/issues/13262.
2022-03-14 12:59:05 +01:00
Mahatthana (Kelvin) Nomsawadi
883e5cd337 Fix sometimes table doesn't resize (#20954) 2022-03-14 13:15:53 +07:00
Mahatthana (Kelvin) Nomsawadi
80b6852c7f Fix no visual feedback when updating data model field details (#20915)
* Revert field update to only notify without allow undoing

* Add feedback when updating field details on datamodel
2022-03-14 13:15:30 +07:00
Cam Saul
b3c8ea8fca Make sure auto binning always has at least one bin (#20978) 2022-03-12 10:56:38 -08:00
Alexander Polyankin
569cdc4d19 Show timeline events in charts (#20899) 2022-03-12 11:54:54 +03:00
Alexander Polyankin
6824d4ada7 Fix date parsing in DateInput (#20967) 2022-03-12 10:42:36 +03:00
Ariya Hidayat
74f89c6f5c yarn upgrade xlsx@0.18.3 (#20894) 2022-03-11 15:17:58 -08:00
Benoit Vinay
cc289e608f Fix x-axis granularity for time series in static viz (#20896)
* TimeSeriesLineChart uses scaleBand instead of scaleTime for x-axis

Similar to TimeSeriesBarChart

* TimeSeriesAreaChart updated to match TimeSeriesLineChart
2022-03-11 08:52:36 -08:00
dpsutton
cdcfc9ecfd Cleanup and schema for bookmarks (#20942)
- sorting in query so don't have to sort in memory afterwards, and
leaves open spot on the api to sort with user preferences if
present (future work)
- adds schema so we know what these bookmarks look like, and return an
explicit structure instead of threading through dissoc and assoc
- combined the remove-nil-values into the normalize function since it
set up preconditions necessary for the normalize.
- use Models in query so we don't have to hardcode the underlying table
2022-03-11 10:18:51 -06:00
Ariya Hidayat
a28a038d1f Custom expression: stricter acceptance of aggregation function (#20949) 2022-03-11 07:53:00 -08:00
Ariya Hidayat
89ca84c7fb Custom expression: escape/unescape field name (#20927)
This way, if the field name contains [ or ], this character will be
handled properly (with escaping and unescaping at the right place).

Ensure escape vs unescape symmetry
2022-03-11 07:19:02 -08:00
Diogo Mendes
a44ea47497 Removing native since was running twice (#20961) 2022-03-11 10:42:42 -03:00
Alexander Polyankin
57909217d1 Add event sidebar to the query builder (#20944) 2022-03-11 10:57:05 +03:00
Noah Moss
572b8fa6c9 Allow user-local settings to be fetched and set via the API (#20736) 2022-03-10 22:53:35 -05:00
Dalton
323e0f5072 Add sizeToFit prop to TippyPopover (#20861) 2022-03-10 13:52:59 -08:00
frannietrempe
9907e01bc2 docs - remove GA version note; fix broken link (#20945) 2022-03-10 15:50:08 -05:00
Dalton
cb5da99c7f Add flip prop to TippyPopover (#20860)
* Match the z-index of old popovers

* Add flip prop to TippyPopover
2022-03-10 12:27:44 -08:00
Cam Saul
cc48450c0b Fix BigQuery incorrectly quoting datetime-truncated field literal forms (#20907)
* Improved error messages when query execution fails

* Pretty-print hx/identifier in a different way if it contains extra keys

* Fix #20806

* Rename key used to record that we should not qualify

* Fix line breaks

* Test fix 🔧
2022-03-10 12:15:36 -08:00
Dalton
75541436c8 use site-url setting when opening links via JS (#20568)
* use site-url when opening links via JS

* fix normalization of 0 value

* make dashboard click drill to same dashboard just update parameters

* fix race condition with location prop

* use Link instead of anchor tag
2022-03-10 12:07:32 -08:00
Ariya Hidayat
2e3ef4fd2e MBQL schema: allows :case for a string expression (#20913) 2022-03-10 11:56:11 -08:00
Diogo Mendes
702833f6aa Creating cypress action on CI (#20904)
* Creating cypress action

* Adding shell
2022-03-10 15:50:38 -03:00
Dalton
9e8b4fc743 Default TippyPopover's interactive prop to true (#20859) 2022-03-10 10:41:22 -08:00
Cam Saul
180175915a Pass H2 options as connection properties; add LOCK_TIMEOUT=60000 (fix flaky tests) (#20914) 2022-03-10 10:30:01 -08:00
Cam Saul
7667e3e702 Handle numeric values for :number parameters in JWTs (#20908) 2022-03-10 10:04:46 -08:00
Ngoc Khuat
363fe22132 Localize personal colections's name (#20884)
* Localize personal colections's name

* adding a macro to generate test data

* use precondition instead of assert

* fix per comment
2022-03-11 00:14:07 +07:00
Bryan Maass
74aa5467bc fix ssl-key name typo (#20855)
* Fix ssl-key connection prop name

* Adds unit test for ssl-key typo fix

* fix ns require ordering

Co-authored-by: Guillermo Ríos <grios@stratio.com>
2022-03-10 08:06:51 -08:00
Luis Paolini
50c2ccd90c Update env vars of SAML (#20653)
* Update env vars of SAML

Adding some very important comments

* Update docs/operations-guide/environment-variables.md

Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>

Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>
2022-03-10 10:46:10 -03:00
Gustavo Saiani
2e3e956e3f Convert Bookmarks component to TypeScript (#20924) 2022-03-10 10:41:14 -03:00
Gustavo Saiani
f5c1479e15 Bookmarks: clean up unnecessary code (#20920) 2022-03-10 06:54:19 -03:00
adam-james
dd1e0bedd9 Add the :archived status of card/dashboard/collection for filtering (#20921)
* Add the :archived status of card/dashboard/collection for filtering

If an item is bookmarked, we can follow the link to that item without issue. But, if we bookmark an item and then
archive that item, the bookmark shouldn't show up, as we don't want to link to an archived item.

The bookmark itself is not removed, it's just filtered away when :archived is true.

* Added test for bookmarked and archived items

The archived items that are still bookmarked should not be sent to the Frontend.
2022-03-09 16:26:25 -08:00
Gustavo Saiani
8ad9254d07 Bookmark questions and display them on sidebar (#20918) 2022-03-09 15:34:04 -03:00
Nemanja Glumac
036aadd5a2 Upgrade Cypress to the latest version (9.5.1) (#20483)
* Upgrade Cypress to the latest version (9.4.1)

* Fix collections tests failures after upgrade

* Fix binning tests failures after upgrade

* Fix dashboard test failures after upgrade

* Fix models test failures after upgrade

* Fix admin test failures after upgrade

* Fix visualizations test failures after upgrade

* Rewrite and fix repro for 17397

Added the missing issue reference.

* Fix question test failures after upgrade

* Fix interception handlers in metabase-visual tests

* Fix the rest of the binning tests after upgrade

* rewrite cypressWaitAll helper with a simple recursion

* Updating to 9.5.0

* Upgrade Cypress to v9.5.1

* Fix repro for 13332

* Fix pinned items `collections` test failures

* Speed `collection-pinned-overview` spec up using the API

* Fix failing localization test

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
Co-authored-by: Diogo Mendes <diogo@metabase.com>
2022-03-09 13:49:20 -03:00
Diogo Mendes
d77abc36d7 Create action for Uberjar (#20905)
* Create action for Uberjar

* Fixing name

* Adding shell bash to SHA

* Adding shell on proper place

* Adding one more shell
2022-03-09 13:22:08 -03:00
Noah Moss
3607b0708f Fix brackets and ordering for two dependencies in deps.edn (#20901) 2022-03-09 11:11:22 -05:00
Howon Lee
378b58fa6b Nested column enrichment for JSON nested columns (#20778)
Put in capability but not link it in for nested column enrichment for postgres JSON columns
2022-03-09 03:37:46 -08:00
Mahatthana (Kelvin) Nomsawadi
808cbf6c46 Fix no visual feedback when updating data model column properties (#20874) 2022-03-09 12:34:45 +07:00
Nemanja Glumac
8b7971b884 Disable auditing e2e CI group (#20897) 2022-03-08 19:40:45 +01:00
Dalton
688109e1ab Fix schemas not loading/showing immediately for a saved question (#20800)
* Fetch db schemas as dependencies of a query

* Update StructuredQuery unit tests
2022-03-08 10:04:34 -08:00
Dalton
74abd3ea02 fix navigation to new dashboard from collection view (#20709) 2022-03-08 10:01:53 -08:00
Nemanja Glumac
25325899b5 Update yarn.lock after upgrading Prism (#20889) 2022-03-08 18:03:06 +01:00
Jeff Bruemmer
b159c6829b Update bigquery-drive.md (#20890) 2022-03-08 12:02:01 -05:00
frannietrempe
3e4cecc4c7 docs - fixing glossary links (#20886) 2022-03-08 10:26:11 -05:00
Ngoc Khuat
3a257c23bd /api/user return only active users when include_deactivated=false (#20844)
* /api/user return only active users when include_deactivated=false

* revert changes in docs/api-documentation.md and fix trailing space for params section

* simplify tests and update api's doc
2022-03-08 14:41:21 +07:00
Ariya Hidayat
48f6f59cbb Enable subdimensions for aggregation (#20837) 2022-03-07 17:57:31 -08:00
Benoit Vinay
fb9e912d0b F/static viz/tester (#20842)
* Types and options constants added to all chart types

* Chart types and options added to StaticChart

* Static viz page refactored to include an editor

* Editing data added

* Error handling added

* Misc

* StaticChart converted to TypeScript

* Stories for StaticChart added to storybook

* Misc

* Updates from PR review
2022-03-07 12:13:22 +01:00
Benoit Vinay
598a126b72 Bugfix/various fixes from console error messages (#20829)
* FunnelChart missing key for React loop added

* BarSeries missing key for React loop added

* TickRendererProps formattedValue method removed from tag attributes

* React loop key added to internal routes

* Table head tagging fixed in internal

* BaseIcon uncheckedColor method removed from being added to SVG tag attributes

* Misc

* ColorPicker fix for maxHeight attribute

* Missing key for CollectionBadge in InfoText added
2022-03-07 11:24:02 +01:00
Mahatthana (Kelvin) Nomsawadi
8f2a077d4e Fix main page show indefinite loading spinner when any API failed (#20840) 2022-03-07 09:54:28 +07:00
Mahatthana (Kelvin) Nomsawadi
651da83c23 Fix "Show error details" keeps showing after clicked (#20824) 2022-03-07 09:54:20 +07:00
Mahatthana (Kelvin) Nomsawadi
68cff20c46 Fix empty state icon in activity page misalignment (#20820) 2022-03-07 09:53:49 +07:00
Nemanja Glumac
d7fe33dbfd Repro #20845: Embedding with Locked parameters does not allow numeric values (#20849)
* Add repro for #20845

* Use API to reproduce the issue

* Make sure this works for both strings and integers
2022-03-06 09:56:33 +01:00
Ariya Hidayat
3188b3d10e Upgrade to Prism v1.27.0 (#20794) 2022-03-04 14:19:28 -08:00
Nemanja Glumac
44040a1099 Add e2e embedding jwt helper (#20853) 2022-03-04 21:33:14 +01:00
Nemanja Glumac
5bffa46e44 Extract hard coded embedding key for e2e tests and store it as a variable (#20852) 2022-03-04 20:14:34 +01:00
Alexander Polyankin
e96d434f42 Fix bugs and add tests for timelines in collections (#20798) 2022-03-04 21:44:07 +03:00
Michiel Borkent
38ce2fd04d Consider modelInstance always a used var (#20847) 2022-03-04 15:21:18 -03:00
Ariya Hidayat
3e44112a15 Modify expression dimension to support subdimensions (#20645) 2022-03-04 08:02:55 -08:00
Gustavo Saiani
16d319400a Document entity api response requirements (#20802) 2022-03-04 11:59:18 -03:00
Pawit Pornkitprasan
136a1f64c5 migrations: remove duplicate comment (#20839) 2022-03-04 16:48:18 +07:00
Dalton
205baeed7a Fetch databases on schema step of DataSelector (#20771) 2022-03-03 11:36:30 -08:00
Nemanja Glumac
34a2641974 Bump buildjet timeout for Cypress tests to 30 minutes (#20826) 2022-03-03 18:25:26 +01:00
Nemanja Glumac
4fd373b376 Fix and reproduce #20499: The term "SQL query" used in DBs that don't support SQL (#20506)
* Use the term "Native query"

* Fix/update e2e tests

* Add repro for #20499

* make text conditional on engine and write permissions

* Revert "Fix/update e2e tests"

This reverts commit 3462cd113e.

Co-authored-by: Dalton Johnson <daltojohnso@users.noreply.github.com>
2022-03-03 18:24:08 +01:00
Nemanja Glumac
6dff2cf81c Embedding questions (#20812)
* Add test id to the mini-bar

* Add initial embedding test for the regular GUI question

* Update test with slighlty more complicated formatting

* Extract question details into a separate file

* Add a test for the quesiton with aggregation

* Assert while being signed out

* Add test for the nested question

* Add test for the joined question
2022-03-03 15:01:50 +01:00
Nemanja Glumac
a3de6c5438 Repro #20815: Models should not be embeddable (#20819) 2022-03-03 13:00:39 +01:00
Alexander Lesnenko
63d22fdbe2 split data permissions selectors (#20712)
* refactor data-permissions selectors

* pre refactor

* fix all typescript errors

* fixes

* fixes

* fixes

* use correct types
2022-03-02 21:45:19 -05:00
Alexander Lesnenko
cf505d4e1c Permissions sidebar refactoring (#20693)
* Permissions sidebar refactoring

* move utils specs with the file

* fix spec

* fix sidebar scroll

* fix ratio types
2022-03-02 14:51:57 -05:00
Dalton
05ff0aeffd Fix Help link for nested site users (#20740) 2022-03-02 09:30:48 -08:00
Dalton
fd3351fb09 make init health request a relative url (#20737) 2022-03-02 09:30:23 -08:00
Dalton
59d222b88e use correct urls when setting up on nested path (#20730) 2022-03-02 09:30:11 -08:00
Jeff Bruemmer
988f5647df update links (#20797) 2022-03-02 10:45:08 -05:00
Luis Paolini
0b06f46034 Update env var to disable geocoding (#20804) 2022-03-02 07:49:16 -03:00
Nemanja Glumac
bc98574d36 Increase "randomness" for caching e2e tests (#20801) 2022-03-01 21:43:05 +01:00
Nemanja Glumac
30a1d85f13 Separate "auditing" e2e group from the "admin" (#20793) 2022-03-01 20:56:21 +01:00
Dalton
4d177afb5f Fix 'Compare to the rest' action styling (#20767) 2022-03-01 10:47:23 -08:00
frannietrempe
8eda92eac1 docs - fix & update permissions links (#20788)
* docs - fix & update permissions links

* jeff edit

Co-authored-by: Jeff Bruemmer <jeff@metabase.com>

Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
2022-03-01 12:11:05 -05:00
frannietrempe
784a9268f5 docs - remove premium embedding, update screenshots (#20785)
* docs - remove premium embedding, update screenshots

* add learn track link
2022-03-01 11:23:03 -05:00
dpsutton
9a8ef14d45 Cleanup some lint errors (#20770)
mostly unused bindings. Had a few redundant lets. One common pattern was
a let binding for a read check but the resulting value was never used,
just checked that we could read or write it. Removed that from a binding
since it throws otherwise
2022-03-01 09:42:36 -06:00
Gustavo Saiani
8c9aeb67df Add basic documentation on entity creation (#20780) 2022-03-01 10:32:42 -03:00
Alexander Polyankin
c7573b2bce Polish timeline events in collections (#20708) 2022-03-01 15:01:18 +03:00
Nemanja Glumac
d8dd9d635b Make conditional describe blocks more readable (#20777) 2022-03-01 12:46:07 +01:00
Alexander Polyankin
1132cb3ba6 Add 12-hour clock support to events (#20704) 2022-03-01 13:57:35 +03:00
Nemanja Glumac
b1629f5b29 E2E oss/ee versions helpers cleanup (#20775)
* Use human readable names for vars

* Apply new version syntax to the related tests
2022-03-01 11:48:05 +01:00
Jeff Bruemmer
4cb7eaad53 update README (#20769) 2022-02-28 19:53:38 -05:00
Nemanja Glumac
9946598ecd Add embedding smoke tests when embedding is enabled (#20764) 2022-02-28 19:32:48 +01:00
Alexander Polyankin
b71676164a Add write checks (#20762) 2022-02-28 20:35:22 +03:00
Dalton
77af6de58d Revert to old template tag validation logic (#20750)
* Handle legacy Field filter parameters that did not specify `:widget-type`

* Fix indentation

* Test fix

* Revert to old template tag validation logic

* Update e2e test

Co-authored-by: Cam Saul <github@camsaul.com>
2022-02-28 09:03:50 -08:00
Cam Saul
26f671e5cd Handle legacy Field filter template tags that did not specify :widget-type (#20751)
* Handle legacy Field filter parameters that did not specify `:widget-type`

* Fix indentation

* Test fix
2022-02-28 09:02:21 -08:00
Nemanja Glumac
422f12b2f8 Add embedding smoke tests when embedding is disabled (#20761)
* Add embedding smoke tests when embedding is disabled

* Fix abstraction
2022-02-28 17:38:53 +01:00
Nemanja Glumac
737c251088 Embedding cleanup: Enable premium embedding token tests (#20753)
* Displace tests that are not related to embedding

* Rename and enable embedding snippets spec

* Add more assertions to the embedding code snippets spec

* Rewrite and enable premium ebmedding token tests

* Fix a timezone related issue in the validity date of the token
2022-02-26 21:43:42 +01:00
Ariya Hidayat
7b4de21ade Teach custom column's type inference about semantic_type (#20748) 2022-02-25 18:39:43 -08:00
JC Louis
bba210123b ScalarValue: display line break (#20652) 2022-02-25 15:52:37 -08:00
Dalton
5ce58dbab1 Make auth page scene img src relative (#20733) 2022-02-25 14:40:16 -08:00
Alexander Lesnenko
9bc8dc0de2 Convert Tree component to Typescript (#20692)
* Convert Tree component to Typescript

* fix types

* review
2022-02-25 13:42:37 -05:00
adam-james
88a4e178ca Events Backend Cleanup and Adding Start/End Range test (#20633)
* Adding tests in collections and card. Fixing some minor test things

* Added Test for timeline event range selection via card API

* Cleaned up a few TODO comments

* Made the timestamp required when POST-ing a timeline-event

* Remove unnecessary nesting of with-temp* forms

* Moved Icons schema into timeline-event model

This schema seems to be validating more than just the API, so we've moved it.

* Added start/end to GET /api/timeline/:id

Also cleaned up some unnecessary nesting in a card API test
Added timeline range test in timeline API test ns too.

* Parse timestamp when it exists in a timeline-event PUT

We saw the db error presented in the FE when updating timeline events. This should fix that problem.

* Add a test to ensure we can change timestamps via timeline-event PUT
2022-02-25 09:36:18 -08:00
Nemanja Glumac
023745459b Remove legacy EE hard coded version info (#20746) 2022-02-25 17:14:42 +01:00
Nemanja Glumac
fd2cfaa7fc Replace hard coded sample database id in ALL e2e tests (#20734) 2022-02-25 15:01:57 +01:00
Nemanja Glumac
7ac6e8c424 Global E2E Config: Solve circular dependency issue in helpers (#20741)
* Add `SAMPLE_DB_TABLES` reference

* Add notes to the cypress data references

* Ensure table ids are correct

Early warning mechanism.

* Use SAMPLE_DB_TABLES in e2e helpers and custom commands

* Use `SAMPLE_DB_ID` in the previously missed helper
2022-02-25 12:55:53 +01:00
Nemanja Glumac
4c44055413 Fix a flake where Cypress cannot click "Exit admin" (#20738) 2022-02-25 11:33:25 +01:00
Ariya Hidayat
5983a7742e Fix the icon for custom column (#20728) 2022-02-24 16:55:22 -08:00
Michiel Borkent
f40a16b58a Linting improvements for modules/drivers: zero errors (#20626)
* Refer all

* allow refer all in tests

* Add toucan test macro config

* wip

* Improve hooks

* Fix formatting issue

* Improve

* presto

* oracle

* mongo

* druid

* zero errors

* undo whitespace change

* ns linter satisfaction
2022-02-24 19:34:37 -03:00
Maz Ameli
4b05a518a4 Small cleanup for Events and Timelines (#20731)
* change paleozoic to mesozoic for accuracy

* switch kebab icons to ellipses
2022-02-24 13:34:40 -08:00
Ariya Hidayat
62ae6d5bab Upgrade MBQL of expression & aggregation dimension to include options (#20713) 2022-02-24 13:02:50 -08:00
Nemanja Glumac
de58c843f4 Replace hard coded ids in E2E custom commands and helpers (#20729)
* Replace hard coded ids in `question.js`

* Replace hard coded ids in ad hoc question helpers

* Replace hard coded ids in `sandboxTable` custom command

* Replace hard coded ids in `updatePermissions` custom command

* Avoid circular dependencies
2022-02-24 21:52:29 +01:00
Dalton
232be18a7e Run unadded additional dashcard series using card query endpoint (#20707)
* Run unadded additional dashcard series using card query endpoint

* add repro for #20637

* Update frontend/test/metabase/scenarios/dashboard/reproductions/20637-add-series-to-dashcard.cy.spec.js

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>

* wait on all dashboard save requests in e2e test

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2022-02-24 12:09:11 -08:00
Nemanja Glumac
a37a3a3ab7 Export and use SAMPLE_DB_ID for snapshot generation (#20726)
* Export `SAMPLE_DB_ID`

* Replace hard coded sample database id values in the default snapshot creator

* Replace hard coded values for the SQLite database

* Update function name

* Stop using hard coded values for questions and dashboards
2022-02-24 20:02:45 +01:00
Howon Lee
ea3e8b6ad6 Describe the JSON within tables for postgres (#20547)
Step 1 towards the long path towards whacking #708. We need an interface for describing the weird thing every RDBMS vendor did where they have their own special way of doing JSON columns, every single one of them
2022-02-24 10:33:34 -08:00
Dalton
e9178bb489 Handle missing dataset_query when trying to map parameter targets to fields (#20678)
* Return null when card.dataset_query is missing

* Add unit test for missing card.dataset_query

* Unskip repro

* use optional chaining
2022-02-24 08:59:16 -08:00
Nemanja Glumac
57c738fce3 Embedding e2e group (#20721)
* Copy over admin premium embedding settings to a new file

* Move embedding reproductions to a related folder

* Move over dashboard embedded parameters

* Move over embedding dashboard spec

* Move over repro for 20634

* Enable embedding in CI
2022-02-24 16:56:18 +01:00
Nemanja Glumac
ce5e64af87 Repro #19744: Custom Column after aggregation causes dashboard filtering to be very limited (#20696) 2022-02-24 11:28:48 +01:00
Ariya Hidayat
3eef27a36e E2E tests: add some more question-related test groups (#20706) 2022-02-23 17:53:07 -08:00
Dalton
c3f7bd5cfc Handle nulls in ListField filter (#20680)
* Handle nulls in ListField filter

* filter out nil options
2022-02-23 17:40:33 -08:00
Noah Moss
1e6bc80b08 Update permission path regex & parser to support download permissions (#20699) 2022-02-23 18:29:07 -05:00
Cam Saul
e4e2ec755c Replace add-migrated-collections with Liquibase migrations (#20407)
* Rewrite add-migrated-collections

* Add new tests for the new migrations

* Truncate tables (removing values added by Liquibase migrations) before copying

* Clean namespaces

* Use TRUNCATE TABLE ... CASCADE for Postgres copy

* Update test

* Sort namespaces

* Remove stray println

* Fix Postgres TRUNCATE TABLE behavior

* Disable DB constraints before truncating tables

* Fix fussy postgres
2022-02-23 21:40:13 +00:00
Ariya Hidayat
b64e8f3b4a Move options handling from FieldDimension to the parent class, Dimension (#20690) 2022-02-23 11:44:18 -08:00
Cam Saul
4c327e5593 Remove MetaBot Group (#20565)
* Remove MetaBot Group

* Fix missing :require

* More fixes

* Another fix 🔧

* change default sandboxed group_id

* update group_ids

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2022-02-23 18:09:29 +00:00
Dalton
cd9fd1b585 Always show database sync buttons (#20687)
* Always show sync buttons

* Update unit test
2022-02-23 10:04:37 -08:00
Nemanja Glumac
fd58eeb5da Apply visitQuestion helper to the related tests (#20671)
* Apply `visitQuestion` helper to the related tests

* Adjust interception to account for the pivot tables as well
2022-02-23 18:29:11 +01:00
Cam Saul
8b2877bdd9 Fix resolution of implicit joins inside explicit join conditions (#20697)
* Fix #20519

* Fix busted indentation
2022-02-23 17:18:56 +00:00
Ariya Hidayat
97e2b7d3fb Fix E2E admin l10n tests
Co-authored-by: Nemanja <31325167+nemanjaglumac@users.noreply.github.com>
2022-02-23 08:24:24 -08:00
Cam Saul
9378199ce9 Don't consider :field :join-alias when escaping aliases (#20684)
* Don't consider :field :join-alias when deduplicating aliases

* Unskip Cypress test
2022-02-23 15:55:19 +00:00
Alexander Polyankin
eb9ef86f68 Fix timestamp saving in events (#20679) 2022-02-23 18:49:10 +03:00
Ariya Hidayat
6fa976135d Increase H2 lock timeout for E2E tests (#20688)
The previously set 120-second timeout in PR #19412 is apparently
not sufficient, as admin-ee and sharing-ee still occasionally fail.
2022-02-23 07:31:58 -08:00
Nemanja Glumac
68c66f2bc0 Repro #20683: Error when filtering date by current quarter in Postgres (#20695) 2022-02-23 14:51:53 +01:00
Anton Kulyk
73c71c06b5 Clean up QB sidebar layout components (#20617)
* Convert `ViewButton` to TypeScript

* Convert SidebarContent to TypeScript

* Convert SidebarHeader to TypeScript

* Fix E2E tests

* Remove useMemo usage
2022-02-23 15:45:44 +02:00
Dalton
d9c51ec7df Fix locked parameters in embedded questions (#20635) 2022-02-22 09:07:34 -08:00
Nemanja Glumac
d91878c0ca Repro #20469: Main page loading spinner spins forever on API error (#20675) 2022-02-22 17:21:05 +01:00
Nemanja Glumac
f214d9031c Repro #20471: Ugly error state in Admin > Databases (#20676)
* Add repro for #20471

* Remove deprecated `cy.server()`
2022-02-22 17:20:24 +01:00
aljkor
4eedc1eb67 ì changed to i (#20578)
* ì changed to i

* ì changed to i
2022-02-22 12:34:41 -03:00
Alexander Polyankin
ebe3c275a0 Add time to event dates (#20668) 2022-02-22 17:19:06 +03:00
Nemanja Glumac
fd30233ab4 Add repro for #18814 (#20673) 2022-02-21 22:59:38 +01:00
Nemanja Glumac
fd802e1db3 Add repro for #15353 (#20672) 2022-02-21 22:24:50 +01:00
Nemanja Glumac
5bd243a7e2 Repro 20638: Creating a new dashboard from the New button in a collection should take me to that dashboard (#20667)
* Refactor the existing test for dashboard creation

* Add repro for #20638
2022-02-21 17:28:36 +01:00
Ariya Hidayat
ff6b980e7e yarn upgrade style-loader@0.23.1 (#20644) 2022-02-21 07:27:59 -08:00
Ariya Hidayat
aa2259969f yarn upgrade xlsx@0.18.2 (#20646) 2022-02-21 07:27:40 -08:00
Nemanja Glumac
5de3050a65 Repro #20624: Model metadata not overriding question column settings (#20663) 2022-02-21 15:57:06 +01:00
Nemanja Glumac
82ab3b207d Repro #20656: Dashboard with filter connected to a card that a user doesn't have permissions to view breaks (#20662) 2022-02-21 15:25:12 +01:00
Alexander Polyankin
92d10d4065 Add events search (#20629) 2022-02-21 13:53:26 +03:00
Anton Kulyk
381532504c Accept UnsavedCard type in Question class (#20595)
* Accept UnsavedCard type in Question class

* Fix type
2022-02-21 12:07:01 +02:00
Alexander Lesnenko
398d1adecd permissions table ui fixes (#20640) 2022-02-21 09:43:40 +00:00
Nemanja Glumac
333975a2e2 Repro #20627: Nested queries with long Data Model names causes failing query with incorrect aliasing (#20631) 2022-02-21 09:16:16 +01:00
Nemanja Glumac
f5062adfc8 E2E Helper visitQuestion: Ensure that the query loaded before moving forward with the test (#20630)
* Add `visitQuestion` helper function

* Apply `visitQuestion` to specs related to alerts
2022-02-19 19:15:14 +01:00
Alexander Polyankin
570e4a19e9 Add timeline empty states (#20585) 2022-02-18 11:38:03 +03:00
Nemanja Glumac
a9aee83eb4 Repro #20517: Removing or adding column descriptions to metadata of Models results in "failed save" (#20589) 2022-02-18 09:05:00 +01:00
Nemanja Glumac
b2df93e9ed Repro #20548: Changing Y-axis order can cause duplicate legends when modifying metrics after (#20587) 2022-02-18 09:04:21 +01:00
Anton Kulyk
9e1f03f230 Turn QueryBuilder container into a functional component (#20594)
* Turn QueryBuilder container into a func component

* Remove future code

* Extract hooks

* Fix location change handler
2022-02-18 08:07:43 +02:00
Anton Kulyk
c4a3572f91 Install @testing-library/react-hooks (#20593)
* Install @testing-library/react-hooks

* Return --silent flag to jest
2022-02-18 07:43:02 +02:00
Cam Saul
9b9fa910c2 Migrate clear-ldap-user-local-passwords migration to Liquibase (#20574) 2022-02-17 21:08:48 -08:00
Dalton
66a2cd27d7 Make date widget respect date/time format settings (#20509)
* Make single date widget respect date/time format settings

* handle undefined settings

* Add a repro
2022-02-17 17:54:04 -08:00
Noah Moss
bec20df7fd User-local settings (#20456) 2022-02-17 17:40:03 -05:00
frannietrempe
5caf280738 docs - elaborate on dashboard edit options (#20601) 2022-02-17 17:05:09 -05:00
Noah Moss
86c22ba70f New structure for data permission graphs (#20564)
Co-authored-by: Alexander Lesnenko <alxnddr@users.noreply.github.com>
2022-02-17 16:05:35 -05:00
adam-james
5a67efea0e Events migration (#20452)
* Migrations for the new 'Annotate Useful Events' project

Users will be able to create 'events' in timelines, which are accessible via collections.

Two migrations are introduced to facilitate the new feature: timeline table, and event table. The following columns
are presumed necessary based on the design document:

** TimeLine
    - id
    - name
    - description
    - collection_id
    - archived
    - creator_id
    - created_at
    - updated_by ??
    - updated_at

*** Event
    - id
    - timeline_id
    - name
    - description markdown (max length 255 for some reason)
    - date
    - time is optional
    - timezone (optional)
    - icon (set of 6)
    - archived status
    - created by
    - created at
    - created through: api or UI
    - modified by ??
    - modified at

* Changes to events schema

- add icon onto timeline
- make icon on event nullable
- just move to a single timestamp on event, no boolean or anything
- rename event table to `timeline_events` since "event" is so generic

* dir-locals indentation

* Timeline api and model

- patched up the migration to make collection_id nullable since that is
the root collection
- followed the layout of api/metric and did the generic model stuff

* Select keys with keywords, not destructured nils :(

also, can't return the boolean from the update, but select it again

* Enable the automatic updated_at

* Boolean for "time matters" and string timezone column on events

* clean up migration, rename modified_at -> updated_at

for benefit of `:timestamped? true` bits

* basic timeline event model namespace

* Timeline Events initial API

Just beginning the basics for the API for timeline events.

 - need to find a way to check permissions
 - have to still check if the endpoint is returning stuff properly

* Singularize timeline_event tablename

* Timeline events api hooked up

* Singularize timeline event api namespace

* unused comment

* indent spec maps on routes

* Make name optional on timeline PUT

* Update collection api for timelines endpoints

- add /root/timelines endpoint for when collection id is null
- add /:id/timelines endpoint

Created a hydration function to hydrate the timeline events when fetching timelines.

* TimelineEvent permissions

- crate a permissions objects set via the timeline's permissions

* Move to using new permissions setup

previously was explicitly checking permissions of the underlying
timeline from the event, but now we just do the standard read/write
check on the event, and the permissions set knows it is based on the
permission set of the underlying timeline (which is based on the
permissions set of the underlying collection)

* Items api includes timelines

* Strip of icon from other rows

* Indices on timeline and timeline_event

timeline access by collection_id
timeline_event by both timeline_id and (timeline_id, timestamp) for when
looking for events within a certain range. We will always have been
narrowed by timeline ids (per the collection containing the question, or
by manually enabling certain timelines) so we don't need a huge index on
the timestamp itself.

* Skeleton of range-based query

* Initial timeline API tests

Began with some simple Auth tests and basic GET tests, using a Collection with an id as well as the special root collection.

* Fix docstring on api timeline namespace

* Put timeline's events at `:events` not `timeline-events`

* Add api/card/:id/timelines

At the moment api/card/:id/timelines and api/collection/:id/timelines do
the same thing: they return all of the timelines in the collection or in
the collection belonging to the card. In the future this may drift so
they share an implementation at the moment.

* Put creator on timeline

on api endpoints for timeline by id and timelines by card and collection

* Hydrate creator on events

Bit tricky stuff here. The FE wants the events at "events" not
"timeline-events" i guess due to the hyphen that js can never quite be
sure isn't subtraction.

To use the magic of nested hydration

`(hydrate timelines [:events :creator])`,

the events have to be put at the declared hydration key. I had wanted
the hydration `:timeline-events` for clarity in the code but want
`:events` to be the key. But when you do this, the hydration thinks it
didn't do any work and cannot add the creator. So the layout of the
datastructure is tied to the name of the hydration key. Makes sense but
I wish I had more control since `:events` is so generic.

* Add include param check to allow timeline GET to hydrate w/ events.

The basic check is in place for include=events in the following ways:

GET /api/timeline/:id?include=events
GET /api/collection/root/timelines?include=events

If include param is omitted, timelines are hydrated only with the creator. Events are always hydrated with creator.

* fix hyphen typo in api doc

* Change schema for include=events to s/enum to enforce proper param

Had used just a s/Str validation, which allows the include parameter value to be anything, which isn't great. So,
switched it to an enum. Can always change this later to be a set of valid enums, similar to the `model` parameter on
collection items.

* Fixed card/:id/timelines failing w/ wrong arity

The `include` parameter is passed to `timeline/timelines-for-collection` to control hydration of the events for that
timeline. Since the card API currently calls this function too, it requires that parameter be passed along.

As well, I abstracted the `include-events-schema` and have it in metabase.api.timeline. Not married to it, but since
the schema was being used across timeline, collection, and card API, it seems like a good idea to define it in one
place only. Not sure if it should be metabase.api.timeline or metabase.models.timeline

* used proper migration numbers (claimed in migrations slack channel)

* Add archived=true functionality

There's one subtle issue remaining, and that is that when archived=true, :creator is not hydrated on the events.

I'll look into fixing that.

In the meantime, the following changes are made:

 - :events returs empty list `[]` instead of `null` when there are no events in a timeline
 - archived events can be fetched via `/api/timeline/:id?include=events&archived=true`
 - similarly, archived events can be fetched with:
   - `/api/collection/root|:id/timelines?include=events&archived=true`
   - `/api/card/:id/timelines?include=events&archived=true`

Just note the caveat for the time being (no creator hydrated on events when fetching archived) Fix pending.

* Altered the hydration so creator is always part of a hydrated event

Adjusted the hydration of timelines as follows:

- hydration always grabs all events
- at the endpoint's implementation function, the timeline(s) are altered by filtering on archived true or false

Not sure if this is the best approach, but for now it should work

* Create GET endpoint for /api/timeline and allow archived=true

Added a missed GET endpoint for fetching all the timelines (optionally fetch archived)

* reformat def with docstring

* Timeline api updated to properly filter archived/un-archived

Use archived=true pattern in the query params for the timeline endpoint to allow FE to get what they need.

Work in progress on the API tests too.

* Timeline-events API tests

Timeline Events API endpoint tests, at least the very basics.

* Timeline Hydration w/ Events tests

Added a test for Events hydration in the timeline API test namespace.

* TimelineEvent Model test NS

May be a bit unnecessary to test the hydrate function, but the namespace is there in case we need to add more tests
over time.

Also adjusted out a comment and added a library to timeline_test ns

* Added metabase.models.timeline-test NS

Once again, this may be a bit unnecessary as a test ns for now, but could be the right place to add tests if the
feature grows in the future.

* Clean up handling of archived

- we only want to show archived events when viewing a timeline by id and
specifically asking for archived events. Presumably this is some
administrative screen. We don't want to allow all these options when
viewing a viz as its just overload and they are archived for a
reason. If FE really want them they can go by id of the timeline. Note
it will return all events, not just the archived ones.
- use namespaced keywords in the options map. Getting timelines
necessarily requires getting their events sometimes. And to avoid
confusion about the archived state, we have options like
`:timeline/events?`, `:timeline/archived?`, `:events/start`,
`:events/end`, and `:events/all?` so they are all in one map and not
nested or ambiguous.

* Clean up some tests

noticable differences: timelines with archived=true return all events as
if it is "include archived" rather than only show archived.

* PUT /api/timeline/:id now archives all events when TL is archived

We can archive/un-archive timelines, and all timeline events associated with that timeline will follow suit.

This does lose state when, for example, there is a mix of archived/un-archived events, as there is no notion of
'archived-by' to check against. But, per discussion in the pod-discovery slack channel, this is ok for now. It is also
how we handle other archiving scenarios anyway, with items on collections being archived when a collection is archived.

* cleanup tests

* Include Timeline and TimelineEvent in models

* Add tt/WithTempDefaults impls for Timeline/TimelineEvent

lets us remove lots of the `(merge defaults {...})` that was in the code.

Defaults are

```clojure
   Timeline
   (fn [_]
     {:name       "Timeline of bird squawks"
      :creator_id (rasta-id)})

   TimelineEvent
   (fn [_]
     {:name         "default timeline event"
      :timestamp    (t/zoned-date-time)
      :timezone     "US/Pacific"
      :time_matters true
      :creator_id   (rasta-id)})
```

* Add timeline and timeline event to copy infra

* Timeline Test checking that archiving a Timeline archives its events

A Timeline can be archived and its events should also be archived.
A Timeline can also be unarchived, which should also unarchive the events.

* Docstring clarity on apis

* Remove commented out form

* Reorder migrations

* Clean ns

clj-kondo ignores those but our linter does not

* Correct casing on api schema for include

* Ensure cleanup of timeline from test

* DELETE for timeline and timeline-event

* Poison collection items timeline query when is_pinned

timelines have no notion of pinning and were coming back in both queries
for pinned and not pinned. This adds a poison clause 1=2 when searching
for pinned timelines since none are but they don't have a column saying
that.

* Clean up old comment and useless tests

comment still said to poison the query when getting pinned state and
that function had been added.

Tests were asserting count = 2 and also the set of names had two things
in them. Close enough since there are no duplicate names

* Use TemporalString schema on timeline event routes

Co-authored-by: dan sutton <dan@dpsutton.com>
2022-02-17 14:29:50 -06:00
Ariya Hidayat
a8dabd6ae3 Custom expression editor: do not always suggest an open parenthesis (#20533)
For functions which do not accept any arguments, i.e. COUNT and
CUMULATIVECOUNT, do not suggest the completion with the "(" character.
2022-02-17 10:51:42 -08:00
Cam Saul
2ebb5958a1 Replace add-databases-to-magic-permissions-groups with Liquibase migrations (#20401)
* Rewrite add-databases-to-magic-permissions-groups

* Add a test for v0.43.00-007

* Small test tweak.
2022-02-17 10:24:35 -08:00
Jeff Bruemmer
da771cead7 typo (#20590) 2022-02-17 11:59:19 -05:00
Alexander Lesnenko
5f193ef24c Upgrade webpack dev server (#20583) 2022-02-17 15:26:31 +00:00
Ariya Hidayat
12952daba4 E2E tests on master: add permissions and sharing test groups (#20566) 2022-02-17 07:23:32 -08:00
Ariya Hidayat
445868102d Make time-series filter work with expression dimension (#20510)
The widget to filter time-series dimension should not assume that the
dimension is from a field, as it can be also an expression, i.e. when
the breakout is originated from a custom column. Hence, generalize the
case to avoid any crashing.
2022-02-17 07:23:13 -08:00
Cam Saul
bf9485873c Dashboard Subscriptions *should* use :default param values. Dashboard QP should ignore them. (#20569) 2022-02-17 07:20:09 -08:00
Nemanja Glumac
357ecd76c2 Repro #20560: Shouldn't display filter action menu when clicking on a value in single-record view (#20579)
* Add repro for #20560

* Get only the popover element

* Avoid false positive assertion
2022-02-17 15:34:06 +01:00
Nemanja Glumac
f89b6939a3 Repro #20438: Embed dashboard Field Filter cannot work when choosing single option (#20536)
* Add repro for #20438

* Rewrite repro to use products category
2022-02-17 14:58:53 +01:00
Nemanja Glumac
4e1d406094 Repro #20551: Filter dropdown only allows filtering on "starts with" (#20581) 2022-02-17 14:31:50 +01:00
Dalton
8d2f07400a Use includes instead of startsWith to filter options in ListField (#20561)
* use includes instead of startsWith to filter in ListField

* add autoFocus to ListField input
2022-02-17 12:54:59 +01:00
Alexander Polyankin
8b6a662a7d Add date input for timeline event dates (#20562) 2022-02-17 14:37:59 +03:00
Cam Saul
8f0c6a62b3 Replace add-admin-group-root-entry with Liquibase migrations (#20400)
* Rework add-admin-group-root-entry migration

* Add test for the migration

* Dump/load should not copy the root perms entry for the admin group
2022-02-16 18:30:35 -08:00
Cam Saul
15f3732296 Replace add-users-to-default-permissions-groups with Liquibase migrations (#20399)
* Remove add-users-to-default-permissions-groups data migration

* Revert changes to Cypress tests

* Revert unneeded change
2022-02-16 14:18:56 -08:00
Cam Saul
224cbd0540 Add lots of exclusions to Spark SQL JDBC driver (#20563) 2022-02-16 14:00:16 -08:00
Cam Saul
f0251f09ff Bump SAML lib version (#20539)
* Bump SAML lib version

* Add entry to recognize metabase/saml20-clj as being released under EPL v2
2022-02-16 09:41:05 -08:00
frannietrempe
f1bb5be5e2 docs - expanding google drive instructions in bigquery docs (#20557)
* docs - expanding google drive section of bq docs

* jeff feedback
2022-02-16 11:23:40 -05:00
Luis Paolini
0e3950da9d Adding encryption algo's to docs (#20553)
We get this question a lot
2022-02-16 12:52:05 -03:00
Alexander Polyankin
ac9bbc5b4a Add timeline editing (#20455) 2022-02-16 18:32:27 +03:00
Ariya Hidayat
3010fe6a1d E2E tests on master: run for EE as well (#20542) 2022-02-16 06:40:23 -08:00
Cam Saul
4976869af4 Replace copy-site-url-setting-and-remove-trailing-slashes with a Liquibase migration (#20402)
* Replace metabase.db.migrations/copy-site-url-setting-and-remove-trailing-slashes with a Liquibase migration

* Tweak comment

* `setting`, not `settings`

* Clean namespace

* `key` has to be quoted for MySQL

* Add tests for migrations v0.43.00-008 and v0.43.00-009

* fix new migration for MySQL 5.7
2022-02-15 16:54:58 -08:00
Cam Saul
f6509034a7 Dashboard QP endpoints should ignore :default values and treat them as no value and compile Field filters to 1 = 1 (#20503)
* Fix

* More logging

* Fix unbalanced parens

* Tweak logging

* Add another test

* Tweak test to use :string/=

* More logging

* Updated fix for #20493

* Enable test

* Try disabling the #19494 tests to see what happens.

* Rework #19494 test
2022-02-15 14:50:43 -08:00
Noah Moss
094534e039 Ensure token_features and created_at are included in backend Snowplow events (#20523) 2022-02-15 17:28:25 -05:00
Cam Saul
718c1400fc Replace migrate-humanization-setting with Liquibase migrations (#20404)
* Replace metabase.db.migrations/migrate-humanization-setting with a Liquibase migration

* Apparently key has to be quoted these days in MySQL/MariaDB

* Need to quote key in the preCondition as well

* Fix merge conflicts
2022-02-15 10:36:41 -08:00
Cam Saul
6ae6b43353 Embed query endpoints should handle operator filters with a single arg (#20512)
* Embed query endpoints should handle operator filters with a single arg

* PR feedback
2022-02-15 10:16:17 -08:00
Nemanja Glumac
54c4fa9fa1 Repro #20519: Summarizing with implicit join does not allow subsequent joins and nested query (#20521)
* Add repro for #20519

* Update frontend/test/metabase/scenarios/joins/reproductions/20519-cannot-join-on-aggregation-with-implicit-joins-and-nested-query.cy.spec.js

Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>

* Update frontend/test/metabase/scenarios/joins/reproductions/20519-cannot-join-on-aggregation-with-implicit-joins-and-nested-query.cy.spec.js

Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>

Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>
2022-02-15 18:53:46 +01:00
Alexander Lesnenko
6e17955ce2 fix data picker another double scroll and add a visual test (#20524)
* fix data picker another double scroll and add a visual test

* review
2022-02-15 17:23:46 +00:00
Cam Saul
3bab2e445f Replace mark-category-fields-as-list with a Liquibase migrations (#20405)
* Replace metabase.db.migrations/mark-category-fields-as-list with a Liquibase migration

* Fix stray comma
2022-02-15 09:23:20 -08:00
Cam Saul
4dc16403ab Upgrade Hive JDBC driver version from 1.2.2 -> 3.1.2; Bump Spark SQL from 2.1.1 to 3.2.1 (#20353)
* Replace AOT Spark SQL deps with a `proxy` and a `DataSource`

* Support `connection-details->spec` returning a `DataSource`

* Remove target/classes

* Don't need to deps prep drivers anymore

* Fix duplicate `this` params in `proxy` methods; add `:test` alias for Eastwood to make it be a little quieter

* Make sure to call `pool/map->properties`

* Upgrade Hive JDBC driver version from 1.2.2 -> 3.1.2; Bump Spark SQL from 2.1.1 to 3.2.1

* Clean the namespaces

* Don't need to register the a proxy JDBC driver since we're not even using it anymore

* Fix Spark SQL :schema sync for newer versions

* Remove unneeded override

* Fix day-of-week extract for new :sparksql

* Hive/Spark SQL needs to escape question marks inside QUOTED identifiers now 😒

* Some minor SQL generation improvements to avoid duplicate casts

* Revert change to debug test
2022-02-15 09:19:29 -08:00
Cam Saul
f790d66993 Force clojure -X:h2 to use H2 (#20513) 2022-02-15 09:10:17 -08:00
Anton Kulyk
0ed8c0cf8b Fix nested query controls for no-data users (#20317) 2022-02-15 14:17:33 +02:00
Alexander Lesnenko
4a456d1058 fix double scroll bar in the data picker (#20507) 2022-02-15 11:59:36 +00:00
Anton Kulyk
33dd211533 Clean up QueryBuilder top container and view components (#20416)
* Extract methods

* Reorder imports

* Extract method to render left QB sidebar

* Extract method to render right sidebar

* Extract `NewQuestionView` component

* Extract `renderHeader`

* Extract popovers rendering

* Extract styled components

* Fix styled components

* Extract `renderMain` method

* Fix some prop drilling and access

* Minor QB container cleanup

* Reorder QB container imports
2022-02-15 11:59:09 +02:00
Anton Kulyk
55c483e16f Fix permission error when opening revision history (#20421) 2022-02-15 11:46:50 +02:00
Dalton
9f8f810cc7 Add hook which replaces OnClickOutsideWrapper behavior (#20431) 2022-02-14 17:14:45 -08:00
Dalton
d3466c9f2d Disable sample dataset engine form field (#20458)
* Disable sample dataset engine form field

* e2e test
2022-02-14 17:14:20 -08:00
Cam Saul
0a80b825f7 Add aliases for H2 and Liquibase CLIs (#20409)
* Add aliases for H2 and Liquibase CLIs

* Use reflection to invoke Liquibase method so it doesn't bust stuff
2022-02-14 16:56:33 -08:00
Bryan Maass
bab1a39fa4 Disallow engine change on sample db (#20447)
* for sample db do not allow certain updates
- namely to engine in the model layer

* only check for new schedules one time

* remove unnecessary *current-user-id* binding in test
- as per code review

* Use `thrown-with-message?` to check for exceptions
- Previously this would pass if db/update did _not_ throw an excetption,
  which is not what we want here.
2022-02-14 17:31:27 -06:00
Ariya Hidayat
e4eb3f99c3 Custom expression editor: don't suggest a unique matching function (#20485) 2022-02-14 15:06:59 -08:00
Cam Saul
db53127406 Restore version of test from #20434 (#20508) 2022-02-14 14:39:39 -08:00
Cam Saul
5cefe5171f Replace ensure-protocol-specified-in-site-url with a Liquibase migration (#20403)
* Replace metabase.db.migrations/ensure-protocol-specified-in-site-url with a Liquibase migration

* Quote `key` for MySQL/MariaDB
2022-02-14 14:37:36 -08:00
Nemanja Glumac
dcb98c3040 Repro #20436:Restricting and unrestricting access to a table results in the DB-level permission still being "Granular" #20504 2022-02-14 22:21:21 +01:00
Cam Saul
f94d5149e3 Add logic to truncate and uniquely-suffix column alias identifiers (#19659)
* Add failing test for #15978

* Improved test

* Add new metabase.driver.query-processor.escape-join-aliases QP middleware

* Test fix 🔧

* Add reference to #20307

* Add some extra dox

* Test fixes for BigQuery drivers

* revert unneeded change

* Fix :bigquery and :bigquery-cloud-sdk mixup

* Test fixes 🔧

* Test fix 🔧

* Remove comment I meant to remove
2022-02-14 12:46:13 -08:00
Nemanja Glumac
09ac611aef Repro #20493: Dashboard filter with defaults, doesn't work if values are removed, query fails (#20495) 2022-02-14 19:56:46 +01:00
Alexander Lesnenko
a0517d4113 Permissions UI groundwork (#20433)
* keep click

* safari fixes
2022-02-14 18:55:49 +00:00
Nemanja Glumac
0a54b7c30c Repro #20488: Trend visualization percentage rounding decimals (#20492)
* Add repro for #20488

* Update frontend/test/metabase/scenarios/visualizations/smartscalar-trend.cy.spec.js

Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>

* Update number formatting

Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>
2022-02-14 19:39:16 +01:00
Cam Saul
33502cc9a1 Include (new) site UUID in EE token check request (#20475)
* New site-uuid Setting for token checks

* Move Setting to public-settings; it has to be define afer we define ::uuid-nonce

* Test fix 🔧
2022-02-14 10:23:59 -08:00
Bryan Maass
ad4ded48cc add standard cookie policy to test http client (#20019)
- no longer prints log about invalid expires cookie in tests
2022-02-14 12:01:08 -06:00
Diogo Mendes
ea5aacdc01 Refactor Test to use API Call (#20491)
* Creating reproduction for 20442 + some refactor

* Skipping while waits for fix

* Remove skip

* Fix

* Resolving as requested

* Removing unneeded check

* Update frontend/test/metabase/scenarios/admin/settings/sso/google.cy.spec.js

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>

* Remove unneded reload

* Adding assertion

Co-authored-by: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
2022-02-14 14:59:33 -03:00
Ariya Hidayat
7d58b94645 Custom expression editor: use ace-builds instead of brace (#20480)
As documented, react-ace >=8 doesn't need brace anymore.

This reduces the bundle size,
resources/frontend_client/app/dist/vendor.bundle.js, by 218 KB, from
5286809 to 5063129 bytes.
2022-02-14 09:32:10 -08:00
Ariya Hidayat
5ddd3c68c4 Custom expression editor: Esc hides the suggestion list/help text (#20477) 2022-02-14 08:01:57 -08:00
Ariya Hidayat
4ae10228fd yarn upgrade react-motion@0.5.2 (#20481) 2022-02-14 06:39:24 -08:00
Diogo Mendes
aafc68ab11 Creating reproduction for 20442 + some refactor (#20453)
* Creating reproduction for 20442 + some refactor

* Skipping while waits for fix

* Remove skip

* Fix
2022-02-14 10:04:57 -03:00
Nemanja Glumac
0e419dc867 Simplify tests by improving custom cy.createQuestion command (#20441)
* Optionally wrap question id to make it available outside of the original scope

* Use `visitQuestion` to simpliy tests

* Fix pivot_table tests

* Fix repro 12568 for nested questions

* Fix repro for 10803

* No need to rely on UI elements any more
2022-02-13 23:17:11 +01:00
Cam Saul
1a521c41e4 Fix source aliases for Fields from joins not being properly escaped (#20474)
* Fix source aliases for Fields from joins not being properly escaped

* Tweak TODO comment

* Disable the flaky tests when running driver tests

* Rename the new macro

* Dox

* Remove unused :require
2022-02-13 12:30:00 -08:00
Ariya Hidayat
3f0ae2829e yarn upgrade icepick@2.4.0 (#20473) 2022-02-13 00:29:15 -08:00
Ariya Hidayat
537d3c5397 Upgrade type definitions, i.e. @types packages (#20479)
Basically:
```
yarn upgrade @types/eslint@7.29.0
yarn upgrade @types/prettier@1.19.1
yarn upgrade @types/react-motion@0.0.32
yarn upgrade @types/react-router@3.0.28
yarn upgrade @types/react-transition-group@1.1.8
```
2022-02-12 23:49:12 -08:00
Ariya Hidayat
a17a4ca3ca yarn upgrade xlsx@0.18.0 (#20478) 2022-02-12 23:07:47 -08:00
Ariya Hidayat
c8ab176656 yarn upgrade eslint@7.32.0 (#20472) 2022-02-12 08:31:37 -08:00
Cam Saul
cd7a4e4675 Support running Oracle tests with local Docker image (#20358) 2022-02-11 16:18:05 -08:00
Cam Saul
dad00648a7 BigQuery should qualify columns from source query with source in the SELECT clause (#20434)
* Fix BigQuery not qualifying source columns

* Don't fix on 42 for the deprecated BigQuery driver

* You know what I'll fix it after all. Why not.

* Oops I updated the wrong part of the test
2022-02-11 15:15:50 -08:00
Noah Moss
16dc860edc Clear google auth client ID setting if empty string is saved (#20462) 2022-02-11 17:03:26 -05:00
Noah Moss
e6087ad23c Ensure PNG cropping doesn't clip table content (#20448) 2022-02-11 15:41:40 -05:00
Dalton
308090f1a9 use column settings instead of display_name for pivot table value header (#20435) 2022-02-11 09:30:27 -08:00
Ariya Hidayat
4a76c4b053 Fix parsing of some aggregation functions with no args (#20432)
In an expression `COUNT/2`, `COUNT` there should be treated as a
function (i.e. `COUNT()`) instead of a field.
Another function is the same category is `CUMULATIVECOUNT`.
Both don't require any arguments, hence the parentheses are optional.
2022-02-11 08:49:15 -08:00
Diogo Mendes
e6649aff0b Creating regressions for 16621 (#20445) 2022-02-11 13:43:00 -03:00
Alexander Lesnenko
55a5fde20f fix accordion list keyboard nav (#20446) 2022-02-11 14:59:17 +00:00
Alexander Polyankin
01d50f5099 Add basic timeline & timeline events creation (#20344) 2022-02-11 16:36:35 +03:00
Anton Kulyk
5dcf1735c7 Fix object detail browsing (#20101)
* Group `Urls.question` args into object

* Use `Urls.serializedQuestion`

* Fix `tableRowsQuery` URL builder

* Add E2E tests

* Add routes with `/:objectId`

* Add `objectId` support to question URL builders

* Use `queryParams` from `location` in QB init

* Fix `useSyncedQueryString` drops other params

* Add `zoomInRow` action

* Add `resetRowZoom` action

* Add basic selectors

* Modify `getIsObjectDetail` selector

* Handle `objectId` during QB init

* Replace actions opening prev/next object detail

* Use zoomed row in object detail view

* Update `ObjectDetailDrill`

* Fix URLs update for detail views

* Handle browser "back" button in detail view

* Use question name as a fallback for object view title field

* Fix E2E tests

* Fix E2E test

* Fix routes order

* Fix opening a link to filtered out record

* Move tests for object details

* Fix regexp

* Fix link style

* Better routing handling
2022-02-11 10:14:11 +02:00
Michiel Borkent
8f119d6457 Linting improvements (#20424)
* honeysql var improvements

* Define routes

* Define routes

* define-routes improvement

* honeysql helpers

* honesql

* abs in clojure 1.11

* fix logic unresolved vars

* deprecated

* deprecated var warnings

* undo replace
2022-02-10 15:13:27 -08:00
Cam Saul
25f10ee175 Remove unused reducedf metadata param (#20311) 2022-02-10 11:36:03 -08:00
Nemanja Glumac
06f35d71e1 Remove duplicated binning repros (#20429)
* Remove superfluous isolated repro for 15648

* Remove superfluous isolated repro for 11183

* Remove superfluous isolated repro for 15574

* Remove superfluous isolated repro for 15446
2022-02-10 20:21:59 +01:00
Anton Kulyk
8a7e1021f5 Refactor question URL builder arguments (#20366)
* Group `Urls.question` args into object

* Use `Urls.serializedQuestion`

* Fix `tableRowsQuery` URL builder
2022-02-10 18:36:40 +02:00
Anton Kulyk
1c88f5f2c6 Fix revision history display (#20417)
* Fix nested arrays

* Add unit test

* Fallback to original revision message on error
2022-02-10 18:35:59 +02:00
Dalton
7fa377af4d Handle scenario where query props are undefined on a StructuredQuery (#20394)
* Handle scenario where query is undefined

* Add repro
2022-02-10 08:21:52 -08:00
Dalton
ecd65274f6 Pass metadata-populated parameters to the embedded dashboard modal (#20383)
* Fix dashboard embedding locked parameter scripting err

We were not passing the embedding components the correct parameter
objects; instead of dashboard.parameters we need to pass the components
parameters that have had metadata added to them such as the fields they
are mapped to, as child parameters components now expect this metadata
to exist.

* Add e2e tests for embedded parameters
2022-02-10 08:21:35 -08:00
Jeff Bruemmer
a4dec2f0be docs - questions (#20422) 2022-02-10 10:52:48 -05:00
Nemanja Glumac
f62f35250b Bi-basics e2e helpers (#20395)
* Add e2e helpers for bi-basics

* Apply `summarize` helper to the related tests

* Apply `filter` helper to the related tests
2022-02-10 15:02:20 +01:00
Anton Kulyk
b9fe0ff0e8 Remove some stuff from the window (#20415) 2022-02-10 15:20:00 +02:00
Ariya Hidayat
bd6049b6c0 Dashboard checkbox should honor reduced-motion (#20385) 2022-02-09 21:55:46 -08:00
Alexander Lesnenko
9a28255750 wait for all people page requests (#20370) 2022-02-09 19:51:49 +00:00
Cam Saul
9551093d69 Add org.quartz-scheduler/quartz as an explict dep and bump version from 2.1.7 -> 2.3.2 (#20343)
* Add org.quartz-scheduler/quartz as an explict dep and bump version from 2.17 -> 2.3.2

* Add no-op impl for `initialize` for our Quartz `ConnectionProvider`
2022-02-09 09:43:08 -08:00
Ariya Hidayat
b40c453b9e Collection permissions E2E: wait for the complete collection data (#20347) 2022-02-09 07:54:25 -08:00
Jeff Bruemmer
ee8a2b7fc6 update links (#20375) 2022-02-09 10:20:14 -05:00
Nemanja Glumac
fc0ec1f546 Replace BigQuery deprecation test with the Presto driver (#20373) 2022-02-09 16:15:19 +01:00
Jeff Bruemmer
53d220c19d remove mac app reference (#20351) 2022-02-09 09:30:36 -05:00
Alexander Lesnenko
458c06cce2 remove tsc-files (#20369) 2022-02-09 14:02:25 +00:00
Anton Kulyk
7720c2ab1f Remove not used isCardDirty helper (#20367) 2022-02-09 14:24:31 +02:00
Anton Kulyk
08e60aa0b3 Fix drill actions dispatching redux actions are broken (#20098)
* Make `performDefaultAction` usage more readable

* Connect `Visualization` to redux

* Fix visualization unit tests
2022-02-09 10:55:43 +02:00
Cam Saul
9c235d60cc Simplify QP cache middleware (#20310)
* Simplify QP cache middleware

* Fix hanging tests
2022-02-08 20:25:58 -08:00
Cam Saul
9cc38ac4b0 Remove unused dep on aleph (and thus unused transient dep on Netty) (#20342) 2022-02-08 17:50:50 -08:00
Ariya Hidayat
e643f1c4a3 Use Docker Hub credentials to avoid being rate-throttled (#20339) 2022-02-08 13:54:04 -08:00
Alexander Lesnenko
63c607fcb9 Migrate styled-components 3 to the latest emotion (#20275)
* replace attrs to defaultProps (#20260)

* replace attrs to defaultProps

* fix replaced attrs

* fix className in defaultProps

* use emotion (#20265)

* replace attrs to defaultProps

* fix replaced attrs

* use emotion

* fix typo in css

* eliminate innerRefs

* fixes

* fixes

* fixes

* fixes

* flakes

* specs

* specs

* docs

* specs

* fix last spec

* remove classNames from defaultProps
2022-02-08 21:51:29 +00:00
Luis Paolini
f0a01c9bd0 localStorage can't be used in Chrome Incognito (#20345)
* Update full-app-embedding.md

* Update docs/enterprise-guide/full-app-embedding.md

Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>

* Update docs/enterprise-guide/full-app-embedding.md

Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>

* Update full-app-embedding.md

Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>
2022-02-08 17:49:18 -03:00
Cam Saul
e273c6bf3b Fix QP remapping middleware not recursing into joins or source queries of source queries (#20154)
* Fix #9236 [WIP]

* Revert unneeded changes

* Only merge namespaced :options into result info

* Revert unneeded changes

* Everything is working 🙀

* Revert unneeded change

* Fix #15578 part 2

* Fix #15578 (second attempt)

* Test fixes

* Sort namespaces

* Clean namespaces

* Add `:test` profile to `namespace-checker` to suppress log messages.

* PR feedback

* Fix namespaces

* Fix docstring
2022-02-08 11:47:43 -08:00
Jeff Evans
22ebe102b4 Remove :bigquery driver (#20142)
* Remove :bigquery driver

Add "migration" to convert existing Database instances from :bigquery to :bigquery-cloud-sdk (with error log if using outdated OAuth mechanisms), by way of `normalize-db-details`

Removing references to :bigquery from various places in the code

* Remove from modules/drivers/deps.edn

* Remove stuff from CircleCI that is running the old driver

Remove `driver-switch-test` since there is no practical way to run this anymore (since we can't initialize the old driver)

Remove buggy redef of `isa?` from `semantic-type-migration-tests`

Co-authored-by: Cam Saul <github@camsaul.com>
2022-02-08 13:28:38 -06:00
Howon Lee
666ad2ced6 Set default waterfall colors static viz (#20334)
Pursuant to issue #20332 - it was blanking out without settings set before
2022-02-08 10:37:20 -08:00
Maz Ameli
998ea65f74 improve spacing above unpinned items table (#20336) 2022-02-08 09:56:18 -08:00
Dalton
9be2d8f280 Add hideOnEsc plugin to TippyPopover (#20299)
* Add hideOnEsc plugin & tweak lazy plugin

* full example

* rmv unused defaultValue
2022-02-08 08:26:57 -08:00
Alexander Lesnenko
8278110d04 fix visual tests command (#20330) 2022-02-08 15:49:55 +00:00
Luis Paolini
860ef3fa4b Fix locking in new Alpine release container (#20298)
* Fix locking in new Alpine release container
Seems like the new Alpine container (3.15) has some issue when doing apk upgrade first which ends up erroring out the process, so moving it to the last part of the process (after installing the packages) makes the trick.
You can test it out by using the current process (errors with a "Unable to lock database: temporary error (try again later)") and the one in this branch which will finish successfully
2022-02-08 12:36:04 -03:00
frannietrempe
a636c75a85 docs - mention prefers-reduced-motion setting (#20325)
* docs - mention prefers-reduced-motion setting

* Update docs/accessibility.md

Co-authored-by: Jeff Bruemmer <jeff@metabase.com>

Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
2022-02-08 10:00:39 -05:00
Nemanja Glumac
a99ea9d1c3 Remove accidental .debug() from a test (#20324) 2022-02-08 15:59:36 +01:00
Nemanja Glumac
d50f31f498 Rewrite open table helper (#20304)
* Expand the `visitQuestionAdhoc` helper with the selection of the `mode`

* Rewrite `openTable` helpers using the `visitQuestionAdhoc`

* Remove superfluous wait for the `dataset`

* Fix `nulls` test

* Rewrite and fix `trendline` test

* Fix `saved` question test
2022-02-08 15:03:21 +01:00
Anton Kulyk
69fdb2aff0 Add Event and EventTimeline entities (#20313)
* Fix User type

* Add mock user factory

* Add Event and EventTimeline types

* Add mock factories for Event and EventTimeline

* Add Events entity

* Add EventTimeline entity

* Fix exports

* Move new types to `types/api`
2022-02-08 14:45:49 +02:00
Anton Kulyk
c9b999d554 Fix model metadata propagation (#20273)
* Merge field `results_metadata` into field instance object

* Update unit tests

* Fix replacing result metadata on query completion

* Keep previous QB mode in redux

* Rerun model query after saving editor changes

* Ignore table column widths reset event after exiting model editor

* Reload query when entering model editor

* Remove commented out code

* Fix Dimension unit tests get stuck
2022-02-08 14:17:55 +02:00
Alexander Kiselev
f3bd959aac Visual Design Cleanup for Headers - Fix header secondary buttons (#20055)
* Make changes to header buttons as per designer feedback and remove secondary button style from core button

* removed last use of secondary

* fix active notebook button color

* fix View SQL button and modal
2022-02-08 03:23:08 -08:00
Nemanja Glumac
f00b1b03e1 Make Ad hoc question e2e helper automatically wait for the query results (#20295)
* Integrate waiting for the question dataset into the helper function itself

* Remove explicit waiting from visual tests

* Remove explicit waiting from most of the e2e tests

* Handle pivot tables dataset

* Handle assertion callback

* Simplify helper function

* Fix `bar_chart`

* Fix `line_chart`

* Fix `scatter` visualization tests
2022-02-08 12:01:54 +01:00
Anton Kulyk
c7801b8aba Disallow moving items to a collection it's already in via drag-n-drop (#20288)
* Disallow moving items to same collection via DND

* Fix typo
2022-02-08 11:32:02 +02:00
Cam Saul
e35ecacacd Rework how the remappings middleware matches remapped to/from columns for explicit external (FK) remaps (#20009)
* Fix #9236 [WIP]

* Revert unneeded changes

* Only merge namespaced :options into result info

* Revert unneeded changes

* Everything is working 🙀

* Revert unneeded change

* Clean namespaces

* Add `:test` profile to `namespace-checker` to suppress log messages.

* PR feedback

* Fix namespaces
2022-02-08 01:20:17 -08:00
Ariya Hidayat
0e7c7f1e20 E2E tests on master: add dashboard groups (#20302) 2022-02-08 00:58:52 -08:00
Alexander Lesnenko
b78c983267 Add Select and AccordionList keyboard navigation (#19858)
* Select and AccordionList a11y

* fixes

* fixes

* fix keyboard navigation when filtering

* fix missing search input autofocus

* optional chaining

* fix virtualization combined with autofocused input

* remove console warnings

* check ci

* flakes
2022-02-07 21:16:57 +00:00
Jeff Bruemmer
e03f63f4c4 docs - remove filtering on this field (#20294) 2022-02-07 16:09:06 -05:00
Jeff Bruemmer
0162083ec1 Docs - postgres, truststore, and keystore (#20118) 2022-02-07 13:34:56 -05:00
Anton Kulyk
250c46b5ab Clean up ObjectDetailDrill (#20099) 2022-02-07 17:20:07 +02:00
Anton Kulyk
64c6018efa Disable model editor's "Save changes" button when there are no changes (#20191)
* Don't offer to save model changes without changes

* Rename variable

* Assert save button is initially disabled

* Disable save button if model isn't dirty

* Fix prop type

* Clean up metadataDiff after saving changes
2022-02-07 15:23:44 +02:00
Anton Kulyk
45989d1d6a Remove has_field_values form field for models (#20271) 2022-02-07 14:59:37 +02:00
Nemanja Glumac
13cf15e251 Reinforce time-series binning e2e test (#20284) 2022-02-07 08:01:15 -03:00
Diogo Mendes
231186449a Changing circleCI resource (#20270) 2022-02-06 20:06:43 -03:00
Ariya Hidayat
1816509779 Run selected E2E groups with GitHub Actions (#20266) 2022-02-05 07:23:29 -08:00
Ariya Hidayat
195c42a7cc Migrate test-build-scripts CI to GitHub Actions (#20257) 2022-02-05 08:04:31 -03:00
dpsutton
b307a2888c Prevent flaky tests based on contents of TaskHistory (#20240)
* Prevent flaky tests based on contents of TaskHistory

Just check for subsets since we sometimes encounter fingerprint-fields
and analyze information

Output from CI:
```
task_history_cleanup_test.clj:35
Basic run of the cleanup task when it needs to remove rows. Should also add a TaskHistory row once complete
expected: #{"task-history-cleanup"
            "metabase.task.task-history-cleanup-test/task-3"
            "metabase.task.task-history-cleanup-test/task-2"}
  actual: #{"classify-fields"
            "analyze"
            "fingerprint-fields"
            "task-history-cleanup"
            "metabase.task.task-history-cleanup-test/task-3"
            "metabase.task.task-history-cleanup-test/task-2"}
    diff: + #{"classify-fields" "analyze" "fingerprint-fields"}
```

* fix ns
2022-02-04 18:12:05 -06:00
chπ
8565023a1c Add Exasol driver to list of community drivers (#19767) 2022-02-04 16:10:49 -08:00
Jeff Evans
23f78db489 Retain property file path when revisiting database edit page (#20199)
* Retain property file path when revisiting database edit page

Ensuring that the file path (if that is the secret type) is returned via the API response to the admin, so the UX on the form edit page is better

This involved a lot of refactoring to clean up some stuff:

* removed the population of inferred secret properties (ex: last updated timestamp and creator ID) from `handle-db-details-secret-prop!`, since that stores those values into the details blob, defeating some of the purpose of normalizing secrets into a separate table
* moved the logic for injecting such inferred values to a new function, `expand-inferred-secret-values`, which lives within the secret model namespace
* delegating existing calls that require such expansion to the new function
* adding a new helper function, `reduce-over-details-secret-values`, to handle some common logic that is now showing up in a few places (reducing over db-details on secret values and doing some kind of manipulation)

Adding new database API test to ensure that the file path value is, in fact, returned from the API
2022-02-04 17:16:31 -06:00
dpsutton
977841b09e Ignore hidden/archived tables cards and dashboards in recent list (#20238)
*** Code:
- ignore hidden tables and archived cards/dashboards
- correct docstring to indicate we are only getting 5 not 10 as
previously claimed
- in query, set limit to 8 in the case we get archived or non-existing
things and then take 5 in memory
- select extra properties from models that we need for this
determination

*** Tests:
- for mysql we were inserting views with a thread/sleep of one second
between each. Just compute timestamps seconds apart and do them all at
once. Should save 7 seconds off mysql test runs. verified temporal
spacing works with

```
 MB_DB_CONNECTION_URI="mysql://username:password@localhost:3306/cli" \
 clj -X:dev:test :only metabase.api.activity-test
```
- cleanup these activities we were creating with `mt/with-model-cleanup`
which introduces a big looking diff. But checking diff with whitespace
shows its just an indentation and then add the extra keys needed for
identifying which are archived (:archived and :visibility_type for cards
and tables respectively)
2022-02-04 15:56:42 -06:00
Dalton
f2ce41a065 Hide pin action button when user can't pin (#20272)
* Hide pin action button when user can't pin

* unskip repro

* add a new boolean
2022-02-04 13:24:39 -08:00
Dalton
84bc79dc93 disable leaflet pointer-events in collection visualizations (#20267) 2022-02-04 13:24:26 -08:00
Anton Kulyk
b0b8bc8052 Allow to unmap native model column from a real one (#20219)
* Add clear behavior to `SelectButton`

* Removed redundant type

* Allow unmapping model column from a real one
2022-02-04 20:59:32 +02:00
Anton Kulyk
89ae166d27 Remove metadata_checksum from the frontend (#20261) 2022-02-04 20:59:16 +02:00
Alexander Polyankin
bbb91a5666 Remove grid-styled (#20259) 2022-02-04 20:28:09 +03:00
Alexander Polyankin
9b01c526d9 Migrate admin from grid-styled (#20223) 2022-02-04 20:00:50 +03:00
Luis Paolini
b8d454fd20 Update serialization documentation (#19732)
* Update serialization documentation
* Removing archived items

Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
Co-authored-by: flamber <1447303+flamber@users.noreply.github.com>
2022-02-04 13:43:37 -03:00
Alexander Polyankin
1b520c8871 Migrate "enterprise" from grid-styled (#20256) 2022-02-04 19:36:07 +03:00
Alexander Polyankin
18d27b0998 Migrate "internal" from grid-styled (#20255) 2022-02-04 19:26:42 +03:00
Alexander Polyankin
09c15d37c3 Migrate Grid from grid-styled (#20258) 2022-02-04 19:17:35 +03:00
Ariya Hidayat
cc1abf2416 Move Liquibase migration tests to GitHub Actions (#20218) 2022-02-04 07:35:32 -08:00
Alexander Polyankin
16f5a9133f Migrate query-builder from grid-styled (#20220) 2022-02-04 17:47:37 +03:00
Anton Kulyk
7670630de0 Fix table column titles get cut-off when switching to model metadata editor (#20249)
* Remeasure table column when header changes

* Fix virtual measuring columns left in the DOM

* Fix table viz unit test
2022-02-04 16:44:13 +02:00
Alexander Polyankin
894ee55982 Migrate "visualizations" from grid-styled (#20215) 2022-02-04 16:55:06 +03:00
Alexander Lesnenko
1b0ad37919 fix deselecting columns hides custom fields (#20239) 2022-02-04 13:33:29 +00:00
Anton Kulyk
ed8e5907fa Fix Browse Data section items padding (#20224)
* Fix EntityItem padding

* Remove margin
2022-02-04 11:22:37 +02:00
Anton Kulyk
3bc379fa66 Fix timestamp color (#20225) 2022-02-04 10:39:00 +02:00
Nemanja Glumac
d748924066 Repro #20229: Custom columns not appearing in result set when selecting subset of fields (#20242) 2022-02-04 01:02:24 +01:00
Nemanja Glumac
e5ac259d6b Simplify time-series binning e2e test (#20237)
* Limit Orders table to 50 rows

* Export time options into a separate file

* Apply the same principle to longitude options
2022-02-04 00:08:55 +01:00
Gustavo Saiani
b3cdffa3e9 Update copy (#20123) 2022-02-03 19:45:15 -03:00
Cam Saul
9e327469b6 Fix ambiguous run-query-for-dashcard endpoints (#20139)
* Rework QP.dashboard to expect dashcard-id

* Update /api/dashboard endpoints

* Rework public endpoints for running queries for Dashcards

* Tweak parameter order for Dashboard endpoints for consistency

* Pulse should pass Dashcard ID

* Embed should pass Dashcard ID

* Unskip cypress test

* Update API documentation

* Update endpoints and pass dashcardId to endpoint fns

* Update cypress tests that reference previous endpoint

* Update placement of pivot in endpoint

* Update another endpoint + more e2e fixes

* update QB to hold onto dashcardId like it does with dashboardId

* Address PR feedback

Co-authored-by: Dalton Johnson <daltojohnso@users.noreply.github.com>
2022-02-03 13:29:34 -08:00
Noah Moss
f6a9f3fcd0 Update filename of sample DB (#20194) 2022-02-03 15:55:38 -05:00
Noah Moss
b44f1530b9 Fix pin map lat/lon column selection when query uses :breakout (#20227) 2022-02-03 15:05:38 -05:00
Cam Saul
cf247b6865 Bump backend dependencies (Feb 2022) (#19827)
* Bump backend dependencies (Jan 2022)

* Revert java-time version upgrade for now until https://github.com/dm3/clojure.java-time/issues/77 is fixed

* Add license overrides

* Bump a few more deps (again). Revert Google/BigQuery and Vertica version bumps

* Revert MariaDB and Redshift version changes
2022-02-03 10:57:44 -08:00
Alexander Polyankin
318529a4c5 Migrate parameters (#20211) 2022-02-03 21:08:50 +03:00
Alexander Polyankin
b48aa5f393 Migrate "nav" from grid-styled (#20210) 2022-02-03 21:08:39 +03:00
Alexander Polyankin
c52c6b9ef3 Migrate "home" from grid-styled (#20209) 2022-02-03 21:08:25 +03:00
Gustavo Saiani
3deafadeae Update style for code in dashboard dark mode (#20172) 2022-02-03 14:48:58 -03:00
Nemanja Glumac
d823f10a65 Repro #20043: Don't show pins or helper on view-only collections (#20217)
* Add repro for #20043

* Reinforce some of the existing tests to reduce flakiness
2022-02-03 18:36:15 +01:00
dpsutton
cbe7475eda When recording activity, indicate if dataset (#20202)
Right now, datasets are all cards. In the future this could change so
record the original model of the dataset as a card. In the future, maybe
we care about the underlying model and this allows us to at least query
and distinguish
2022-02-03 11:32:03 -06:00
Alexander Polyankin
3330b834a9 Migrate pulse from grid-styled (#20213) 2022-02-03 20:25:11 +03:00
Michiel Borkent
92e3b2fe16 Improve linting when third party libs have been linted (#20212)
* Turn defendpoint config macro into analyze-call hook for better linting

* Simplify hook

* Remove previous macro config

* Fix all errors concerning third party libs

* revert whitespace change:
2022-02-03 08:23:09 -08:00
Noah Moss
a2f6076856 Fix display of horizontal lines in dashboard text cards (#20177) 2022-02-03 09:37:30 -05:00
Nemanja Glumac
660a534d29 Repro #20044: "Explore results" shown for no-data users (#20197) 2022-02-03 15:17:26 +01:00
Anton Kulyk
a1c555553b Fix native model editor initial height (#20056)
* Extract native editor height utils into their own file

* Compute initial height for native model query editor

* Fix hook
2022-02-03 12:27:23 +02:00
Anton Kulyk
5a2aa72d6e Fix URL hash appended to model URLs (#20183)
* Enable repro

* Assert query hash after saving query changes

* Fix query hash appears on clean model
2022-02-03 12:26:50 +02:00
Nemanja Glumac
67ccfa09b1 Add repro for #20018 (#20198) 2022-02-03 11:23:21 +01:00
Alexander Polyankin
fbedfb9d2f Migrate from grid-styled in new-query (#20169) 2022-02-03 13:09:05 +03:00
Alexander Polyankin
42b628b093 Migrate "containers" from grid-styled (#20192) 2022-02-03 13:08:43 +03:00
Alexander Polyankin
f8b9105dd8 Migrate "components" from grid-styled (#20184) 2022-02-03 13:08:32 +03:00
Alexander Polyankin
4f428c5db6 Migrate from grid-styled in collections (#20178) 2022-02-03 13:08:20 +03:00
Alexander Polyankin
9322212f7d Migrate from grid-styled in browse (#20173) 2022-02-03 13:08:06 +03:00
Alexander Polyankin
72e1c8f66d Migrate from grid-styled in search (#20171) 2022-02-03 13:07:51 +03:00
Alexander Polyankin
1a93af0aac Migrate "dashboard" from grid-styled (#20193) 2022-02-03 13:07:33 +03:00
Ariya Hidayat
e7c5dd7f80 Use shareable, local actions to avoid workflow repetitions (#20187) 2022-02-02 21:13:29 -08:00
Ariya Hidayat
5196d0bf76 Circle CI: Build with Java 8 (#20156) 2022-02-02 13:08:40 -08:00
Ariya Hidayat
3b3c37cf1f Maps E2E test: ensure that the map data is received (#20195) 2022-02-02 13:07:40 -08:00
Cam Saul
b302a35b96 43 qp middleware overhaul part 6: convert post-processing middleware to new pattern (#20096) 2022-02-02 12:38:38 -08:00
Anton Kulyk
12786c9730 Fix no-data user can't open a model (#20161) 2022-02-02 20:11:31 +02:00
Nemanja Glumac
db9c5d425c Simplify models query e2e tests (#20175)
* Remove superfluous `beforeEach`

* Simplify `locks display to table` test

Cuts the test running time in half. It goes from 10s to 4-5s.

* Simplify `allows to edit GUI model query` test

Cuts the test running time in half. It goes from ~16s to ~8s.

* Group GUI models related tests into a separate `describe` block

* Simplify `allows to edit native model query` test

Cuts the test running time almost in half. It goes from ~12s to ~7s.

* Group native models related tests into a separate `describe` block
2022-02-02 18:21:45 +01:00
Nemanja Glumac
14dc53cade Handle NULL value for integer fingerprints (#20003)
* Handle NULL value for integer fingerprints

Fixes #19976.

* conditionally show some or none of component depending on if numbers are present in fingerprint

* Make jsdoc return type accurate

* add unit tests for this scenario

* rmv unused import

Co-authored-by: Dalton Johnson <daltojohnso@users.noreply.github.com>
2022-02-02 09:04:06 -08:00
Nemanja Glumac
f4d57e73d2 Add repro for #19737 [ci skip] (#20137) 2022-02-02 09:01:28 -08:00
Nemanja Glumac
c92f5ad366 Add repro for #20045 [ci skip] (#20164) 2022-02-02 09:01:13 -08:00
Noah Moss
297f2da576 Crop pngs to their content width after rendering to remove extra whitespace (#20032) 2022-02-02 11:48:29 -05:00
Dalton
d0bb85246d let user add missing options to ListField widget (#20136)
* let user add missing options to ListField widget

* let any value that is not an option be added

* remove test regarding search input
2022-02-02 07:40:47 -08:00
Dalton
af54d2ea45 increase font weight on selected AM/PM in filter (#20029) 2022-02-02 07:40:27 -08:00
Anton Kulyk
bcb7771403 Fix data selector crashes and closes after hiding a table (#20166)
* Reproduce #19742

* Filter out undefined tables

* Add a note about repro test
2022-02-02 17:35:14 +02:00
Noah Moss
929b7977af Remove trailing slash from /api/tiles call on frontend (#20091) 2022-02-02 10:23:01 -05:00
Jeff Evans
93cb66672d Fix "source cannot be null" error in MongoDB (#20145)
Break out separate util fn to return the given `authdb` or the canonical default ("admin")

Add invocation to new util fn from the `mcred/create` call
2022-02-02 09:00:49 -06:00
Alexander Polyankin
32b508213c Migrate from grid-styled in sharing (#20168) 2022-02-02 17:07:37 +03:00
Alexander Polyankin
293a3253e0 Migrate from grid-styled in account (#20167) 2022-02-02 17:00:10 +03:00
Alexander Polyankin
343abdb10f Add missing React keys (#20165) 2022-02-02 16:28:27 +03:00
Alexander Polyankin
00016a5145 Add homepage keyboard navigation (#20129) 2022-02-02 15:25:46 +03:00
Anton Kulyk
dd1f61b14d Fix native query editor resizing gets stuck (#20160)
* Fix can't resize native query editor

* Fix DataSelector's onClose prop handling
2022-02-02 13:54:05 +02:00
Alexander Polyankin
e3a48c4723 Make FileInput assessible (#20107) 2022-02-02 13:54:57 +03:00
Cam Saul
11f21375b5 Support MB_DB_USER and/or MB_DB_PASS in combination with MB_DB_CONNECTION_URI (#20135) 2022-02-01 20:45:24 -08:00
Cam Saul
00de179b55 43 QP Middleware Overhaul Part 5: new qp/compile fn and remove some s… (#20095) 2022-02-01 20:15:48 -08:00
Cam Saul
cdd94a6ef9 Metabase QP middleware overhaul part 4: use new-style preprocessing middleware directly (#19938) 2022-02-01 19:18:30 -08:00
Nemanja Glumac
e833d10388 Add repro for #20042 [ci skip] (#20149) 2022-02-01 19:15:24 -08:00
Cam Saul
35a1775829 Metabase 43 QP middleware overhaul part 3: convert all pre-processing middleware to the new pattern (#19937)
* Metabase 43 QP middleware overhaul (part 1)

* Make linter happy

* Test fix

* Fix merge

* Remove perms key after normalization

* Remove unused namespace

* Metabase 43 QP middleware overhaul part 2

* Sort namespaces

* Convert all pre-processing middleware to the new pattern

* Sort namespace

* Minor code cleanup

* Address PR feedback

* Sort namespaces

* Split QP middleware into different groups

* Sort namespaces

* Fix the helper `question` function

* Wait for the card query to load before typing

Co-authored-by: Nemanja <31325167+nemanjaglumac@users.noreply.github.com>
2022-02-01 18:30:40 -08:00
Cam Saul
3527d527e1 Fix regression in supporting user:port@host app db connection strings (#20131)
* Fix regression breaking support for user:password@host Postgres connection strings

* Actually we need to handle either Postgres OR MySQL

* Fix the helper `question` function

* Wait for the card query to load before typing

Co-authored-by: Nemanja <31325167+nemanjaglumac@users.noreply.github.com>
2022-02-01 17:49:03 -08:00
Nemanja Glumac
da58385e42 Repro #19776: New data picker shows blank after archiving a model (#20138) 2022-02-02 02:26:36 +01:00
Cam Saul
d3d681cb0b Disable remapping when syncing Field values. Handle human readable values in GET /api/field/:id/values (#19901)
* Disable remapping when syncing Field values. Handle human readable values in GET /api/field/:id/values

* Don't require `:has_field_values` to be list to actually return anything.

* Make sure GET /api/field/:id/values returns :field_id or it breaks the FE

* Fix add-dimension-projections middleware not respecting disable-remaps? key
2022-02-01 16:58:28 -08:00
Nemanja Glumac
abd8b475ee Fix models e2e typing flake pt2 (#20146)
* Fix the helper `question` function

* Wait for the card query to load before typing
2022-02-02 01:47:44 +01:00
Howon Lee
6e3cc188f1 BE for stacked area viz for #20004 (#18676) (#20013)
More stuff in #18676. Supposed to be the BE for #20004 Just continuing static viz work. Stacked graphs only have a simple viz-settings flag turned on so making sure that gets to FE bit.

No implementation of normalized stacks.
2022-02-01 16:36:19 -08:00
Ariya Hidayat
b9d69a3cec CI with GitHub Actions: focus on PR trigger (#20128)
To avoid double runs of various checks (linters, tests, etc) on feature
branch, we mainly run on pull_request trigger, i.e. the checks are
carried out once that feature branch appears in a PR, and not before.

We do however still run on push trigger for the important branches
(master, release-*).
2022-02-01 15:23:45 -08:00
Alexander Lesnenko
28d2927404 fix renovate config (#20134) 2022-02-01 22:31:43 +00:00
dpsutton
dd300077a8 Unused bindings part1 (#19995)
* Unused bindings cleanup

`clj-kondo --lint src:shared/src > lint` and then just work my way
through it. Note that there are warnings about deprecations that we will
need to get rid of as well. Most likely by turning off that warning
until we are ready to tackle the project.

* More unused and a sort ns

* Removing unused svg helpers that eastwood is complaining about

* Restore accidentally deleted `begin!` impl for xlsx

* clean ns

* clean ns

* Last few unused bindings

* kondo checks for empty docstrings

* Little more cleanup
2022-02-01 16:18:20 -06:00
Alexander Lesnenko
3ac3fed632 include type defs to tsc-files (#20126) 2022-02-01 19:59:44 +00:00
Alexander Polyankin
37f628bb5d Fix creation type (#20119) 2022-02-01 22:13:56 +03:00
Maz Ameli
6ffe7de573 0.42 translations: adds Indonesian, cleans up some strings, and updates our i18n build script (#20041)
* update translation build script to catch ts and tsx files

* add blank file for indonesian

* makes password resetting less awesome

* get rid of 'this item' text

* add updated translations

* Adjust E2E tests expectation of the strings (after the modification)

Co-authored-by: Ariya Hidayat <ariya@metabase.com>
2022-02-01 11:09:32 -08:00
frannietrempe
1107e0a3ba assorted UI screenshots and text updates for 42 (#20117) 2022-02-01 13:22:43 -05:00
Alexander Polyankin
dafdc6f993 Fix passing treat-before-posting on the FE (#20111) 2022-02-01 20:18:40 +03:00
Jeff Bruemmer
31e1444cf7 update new slack setup in docs (#20112) 2022-02-01 12:17:26 -05:00
Alexander Lesnenko
fbb59b82bb fix crowded ordinal ticks (#20006)
* handle crowded ordinal x ticks

* fix default x tick label offset

* fix weird horizontal padding on ordinal charts
2022-02-01 17:04:11 +00:00
frannietrempe
a30777cc49 docs - fix docker dev branch instructions (#20106) 2022-02-01 12:00:47 -05:00
Alexander Polyankin
92e721080f Simplify Slack setup (#20062) 2022-02-01 19:02:40 +03:00
Dalton
ddd1861721 Remove the empty pinned section banner (#20074)
* remove the empty pinned section banner

* make drop zone show up without any items

* Skip associated unit test
2022-02-01 07:40:08 -08:00
Alexander Lesnenko
cb8dfc63d7 fix datamodel borders (#20103) 2022-02-01 14:17:50 +00:00
Anton Kulyk
8819df06d3 Fix missing item descriptions in search results (#20100) 2022-02-01 15:56:06 +02:00
Alexander Polyankin
ef9a0acc08 Make custom setup buttons accessible (#20053) 2022-02-01 15:23:29 +03:00
Alexander Lesnenko
dbb1973f08 Run ESLint for staged files on pre-commit (#20040)
* upgrade packages, setup lint-staged

* add tsc-files
2022-02-01 12:03:28 +00:00
Anton Kulyk
692e7f44da Enable quick filter drills on aggregated, custom columns and native query results (#20014)
* Update QuickFilterDrill tests

* Extend QuickFilterDrill tests

* Extract `reference` method from `Field`

* Extend Column type

* Add mock column factory

* Extend QuickFilterDrill unit tests

* Extract `getFKFilter` function

* Allow drills on fields without ID

* Simplify condition for filters lookup

* Handle aggregate and expression fields

* Fix filter drills UI

* Add tests for drill availability checks

* Simplify drill availability check

* Remove not used import

* Fix test
2022-02-01 11:26:18 +02:00
Cam Saul
b8865f7622 Don't parse MB_DB_CONNECTION_URI; use javax.sql.DataSource everywhere for app DB connection sources (#19970)
* Use javax.sql.DataSource everywhere for app DB connection sources

* Sort namespaces

* Un-remove Kondo warning

* Minor tweaks to support 'postgres:' ...

* Remove ConnectionDataSource

* Add warning about PG without sslmode back

* PR feedback

* Sort namespaces

* Remove top-level calls to trs (not allowed because app DB isn't initialized yet anyway)

* Test fix 🔧 (MySQL)
2022-02-01 00:32:18 -08:00
Cam Saul
034345550f Split QP middleware into different groups (#19935) 2022-02-01 00:23:28 -08:00
Cam Saul
5d5b33a16b MBQL :expressions should use strings for keys (#19960)
* MBQL :expressions should use strings for keys

* Make some more tests ^:parallel

* Update dox

* Test fix

* Sort namespaces
2022-01-31 21:54:48 -08:00
Cam Saul
6d70af888b Metabase 43 QP middleware overhaul part 1: split pre+post middleware into separate fns (#19931) 2022-01-31 21:45:30 -08:00
Nemanja Glumac
f326f53aa6 Fix typing flake in models query editor test (#20086) 2022-02-01 02:02:28 +01:00
Ariya Hidayat
562b424aaa Joins E2E tests: ensure that the schema is completely loaded (#20067) 2022-01-31 16:58:14 -08:00
Ariya Hidayat
2e894d6f47 Models E2E tests: ensure that the Run button is visible first (#20059) 2022-01-31 16:58:03 -08:00
frannietrempe
f4b6b872c8 docs - updates to reflect new db advanced settings UI (#20076) 2022-01-31 16:18:49 -08:00
Noah Moss
f36b9efa8f Override IP address in Snowplow logging (#20082) 2022-01-31 18:50:53 -05:00
Howon Lee
d31fac77cd Static viz funnel fix (more #18676) (#19983)
Still pursuant to #18676

1. Funnel was previously not doing lato font for the bold bit because visx's text doesn't take weights, it takes styles
2. Columns can be nontrivial with respect to funnels, which was an oversight
3. For some reason the first try for fixing 2 also impinged upon values being strings for funnels, which breaks things at SVG level
4. And let's just shove in a nit for the display of trends if the previous value and current value are the same
2022-01-31 15:32:47 -08:00
Dalton
466f6a4de7 Remove most of the info popovers (#20070)
* Remove DataSelector info popovers

* Remove DimensionList info popover

* Remove expression editor suggestion list info popover

* Remove FieldPicker info popover

* Remove DimensionListItem info popover

* Remove info popover from data selector search results

* remove TableBrowser info popover

* Remove an e2e test
2022-01-31 13:45:41 -08:00
Alexander Lesnenko
ee88eaee4b fix license infinite loop (#20075) 2022-01-31 20:57:51 +00:00
Alexander Lesnenko
d0e1ccd88d fix select button look (#20077) 2022-01-31 20:57:39 +00:00
Muhammad Redho Ayassa
0e5ac72996 Fix empty result with suffix "%" shows "null%" in Gauge visualization (#19558)
* convert null value to 0 for gauge viz

* set null segment range to 0
2022-01-31 11:44:21 -08:00
Dalton
81f2bd1fc2 Hide explore results button for no-data users (#20065) 2022-01-31 10:44:51 -08:00
Howon Lee
385fa88f4f Card copy trs fix (#20063)
CI was broken inasmuch as it wasn't running, so master was broken without us knowing it. Thankfully, to the best of our knowledge, it was a couple of nits. Fixes master.

Co-authored-by: Aleksandr Lesnenko <alxnddr@gmail.com>
2022-01-31 09:35:42 -08:00
Dalton
65e72dc549 Add drag and drop reordering of pinned items (#19966)
* onDrop unneeded

* basic impl of reordering pinned items

* split cards and dashboards again

* Improve pin drop target styling

* Fix card drop target weirdness

* brand-light border --> brand

* pull out separate styled drop target component

* replace style prop usage

* reduce the z-index

* Remove prop that triggers drill functionality

* Fix clobbering of pinned list on update

* Fix card queries on every rerender

* Add pin drop zone & split drop target components

* lint fix

* fix & add a few tests

* update pin drop zone styling to match sorting
2022-01-31 09:15:15 -08:00
Alexander Polyankin
d7223dc05d Fix focus color (#20054) 2022-01-31 19:05:54 +03:00
Jeff Evans
a2f4563cab Fix NullPointerException in Postgres when using client SSL properties (#20034)
Only attempt to read values that were actually set on the client side

Add test to confirm specific combination from reported issue works
2022-01-31 10:04:55 -06:00
Ariya Hidayat
44a734d42e CI: setup-node@v2 also does yarn caching (#20035)
https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies
2022-01-31 07:32:19 -08:00
dpsutton
1b9270fd74 Metadata lifecycle improvements master (#19899)
* Improve lifecycle of metadata

Previously we have assumed that if valid metadata is passed into the
card create and udpate, that that is valid metadata for the query. There
are a few scenarios where this can fail, but they all boil down to
editing the query after running it. Examples:

- when creating a query, come up with a query, visualize, realize you
wanted to not select all columns, edit to not select those, possibly
select a few extra, and then save. The saved metadata might only have
the columns from when you ran the query and not after you saved it.
- edit an existing query and save without rerunning. Again, adding and
removing some columns.

How it affects:
- if you remove columns, the preserved metadata can cause us to attempt
to select columns that are no longer in that question, leading to errors
for nested queries
- if you add columns, the query builder won't show the new columns until
that information is populated in the metadata by running the query.

Lifecycle now:
- should be encapsulated in `api.card/result-metadata-async`. But we
only allow metadata to remain if is is valid metadata and the query has
not been edited. If the query has been edited (and new queries always
satisfy this since the previous query will be nil) we rerun the query to
get the metadata. No more drift. However, when dealing with datasets we
will attempt to blend the existing metadata into the newly computed
metadata so that metadata edits can persevere.

Other changes:

- removed an extra indirection in the card api that made it harder to
reason about when to recompute metadata
- moved the `combine-metadata` function into a util namespace and gave
some more generic parameter names
- deleted two tests that are no longer relevant after removing the
checksum on metadata. One had to do with how we hash floats vs ints
which is no longer relevant since we aren't hashing at all (RIP
checksum) and one checked that we accepted "valid" checksum-ed
metadata.
- new test that updating a card will update its metadata by rerunning
the query
- when validating the checksum, do not call s/validate since this WILL
THROW. Instead check `(nil? (s/check ...))`.

* Normalize query before comparing for changes

When comparing db vs api-sent query, need to normalize otherwise they
will always be different and our optimization will never kick in

* Fix ns

* Cleanup after ourselves

* Move `combine-metadata` util functions to a better namespace

* Allow for no query in api/card/:id patch

Cypress tests would do a

```javascript
  describe("simple mode", () => {
    beforeEach(() => {
      cy.request("PUT", "/api/card/1", {
        name: "Orders Model",
        dataset: true,
      });
    });
```

The metadata testing stuff would always use the query from the PUT to
check whether to dump or retain the metadata. In these instances, it
would dump the metadata and then i guess ask the qp for the metadata for
a nil query. Similar scenario if anyone uses the API to update
descriptions, etc.

The method is PUT not PATCH, but in the saving function we have

```clojure
(u/select-keys-when
 card-updates
 :present #{:collection_id :collection_position :description :cache_ttl :dataset}
 :non-nil #{:dataset_query :display :name :visualization_settings
            :archived :enable_embedding :embedding_params
            :result_metadata})
```

So we kinda have a PATCH anyways.

* Normalize metadata before blending

* Ensure api blends metadata correctly

When blending the metadata, need to update the field_ref to keyword the
original. Otherwise we are attempting to match up the field with ref
["field" "subtotal"] against [:field "subtotal"] and they don't match.

* Normalize metadata from api correctly

if you just call normalize/normalize it doesn't know not to change
`:field_ref` -> `:field-ref` so it gets out of whack. Need to pass it
the function appropriate for that level.

Also add a test that you can update _just_ the metadata. This actually
already worked for a subtle reason, and that is possibly buggy. The
reasoning is that the result_metadata is clobbered conditionally now
instead of unconditionally. If the async metadata stuff returns nil it
won't clobber and then whatever was sent over the wire goes in.

* Ensure previous metadata is there

When updating the query of a dataset, handle the case where just the
query is sent, and not the whole card. If the client didn't send the
previous metadata, we did not look it up in the database

* Card api always uses metadata from `result-metadata-async`

Originally this did

    (assoc card-data :result_metadata (a/<! result-metadata-chan))

But I changed that so it only optionally did so when that channel had
information. The problem with this is that if there was :result_metadata
on the original request but the channel returned nil for some reason,
whatever was in the request was going in the db. This includes invalid
metadata, non-json strings, what ever. Obviously bad.

But we need to handle PATCHs where clients don't send metadata or they
_ONLY_ send metadata and no query, etc. So this always uses the results
of `result-metadata-async` so it can go through that logic and we always
clobber.

And remember that if we only update the result_metadata when it is
non-nil (`update-card-async!`). The end result is that switching from a
PATCH model where you expect the full object to a PUT where things can
be optional has lots of footguns. Some examples:
- only updating the query
- updating the query along with edits to the metadata on a card (throw
the metadata away)
- updating the query along with edits on a dataset (save the metadata
but blend it into the fresh computation of the query's metadata)
- updating the query but not sending along the metadata. Need to grab
from the db and blend in.
- Sending invalid metadata, changing the description. We want to toss
away the metadata but save the description.
2022-01-31 09:23:11 -06:00
Alexander Lesnenko
ce4d4e6760 support stacked area static viz series (#20004)
* support stacked area static viz series

* fix x-ticks overflow

* fix types

* add specs, fix area static charts
2022-01-31 15:12:01 +00:00
Ariya Hidayat
bcec502385 Time-series chart E2E tests: ensure that the chart is ready first (#19969) 2022-01-31 06:25:47 -08:00
Alexander Lesnenko
f4388814df run eslint on typescript files (#20021)
* run eslint on typescript files

* fix errors

* bump timeout
2022-01-31 10:28:46 +00:00
Maz Ameli
0ebd2d2592 Change model icon from waffle to building block (#19852)
* change model icon from waffle to building block

* update models education illustration
2022-01-28 15:12:59 -08:00
Alexander Polyankin
b62009ced5 Hide custom GeoJson settings when they are set by the env var (#19621) 2022-01-29 01:50:59 +03:00
Alexander Polyankin
1bf4ae779a Fix rerender when locale changes (#20015) 2022-01-29 01:37:06 +03:00
Alexander Polyankin
bc5ee7362a Fix database created at check (#20031) 2022-01-29 00:43:57 +03:00
frannietrempe
944d914cc3 docs - instructions for running development branch (#19926)
* docs - running development branch instructions

* reorganized content into existing pages

* Jeff edits

Co-authored-by: Jeff Bruemmer <jeff@metabase.com>

* remove gh command, minor edits

* reorganizing step numbers

Co-authored-by: Jeff Bruemmer <jeff@metabase.com>
2022-01-28 15:06:46 -05:00
john-metabase
5918c954aa Updates stats job to run at a random time of day (#19828)
Thanks for the review/approvals.
2022-01-28 12:48:57 -05:00
frannietrempe
ac60949933 docs - collections changes screenshots and UI text (#19958) 2022-01-28 11:02:10 -05:00
Noah Moss
7deffeefa2 Fix clj-kondo warning introduced in #19963 (#20007) 2022-01-28 09:22:36 -05:00
Nemanja Glumac
f78231cf7a PoC: Restore from a custom snapshot in the before hook (#20001) 2022-01-28 11:40:11 +01:00
Howon Lee
002b8b995e Copy API endpoint (BE bit of #15255) (#19940)
Adds an endpoint to the cards which are basically materially like dashboard/:id/copy, only it's for card/:id/copy - POST to it, get a copy of that entity.
2022-01-28 02:19:44 -08:00
Alexander Polyankin
29fdddd15d Make engine widget accessible (#19988) 2022-01-28 13:02:07 +03:00
Alexander Polyankin
b99682b098 Postpone showing syncing modal on the home page (for 0.42) (#19925) 2022-01-28 13:01:46 +03:00
Alexander Kiselev
f09b4b1dc5 Visual Design Cleanup for Headers - Filters and header buttons (#19912)
Move filters over into a separate bar below the header and move the filter button over to the right side of the header
2022-01-27 23:49:12 -08:00
Maz Ameli
4585caf3b4 More collection overview styling (#19972)
* redo tweaks from 19853 that got clobbered in the rebase

* smaller text size for collections list items

* make unpinned items list more compact
2022-01-27 16:21:56 -08:00
Bryan Maass
0526d88f99 Check user exists for setup redirect (#19846)
* Add has-user-setup setting

- iff no user is setup aka has-user-setup == false, then redirect to /setup
- when set from the env variable the setup-token is completely
  immutable, so can remove clear-token!

* make /api/setup only setup accounts when not has-user-setup

- react router changes to respect 'has-user-setup' setting

- include docstring for print-setup-url

* allow tests to setup multiple users via POST /api/setup

* remove unused function hasSetupToken

* Adds a test to enforce a single creation only

- we now throw an ex-info with status-code 403 when has-user-setup and
  /api/setup route is hit (with error message mentioning the route)
- more code review responses

- fixup test to not delete users, (or set locale to spanish...)

* addressing code review concerns

- *disallow... -> *allow... for the dynamic var name
- has-user-settings test: do not assume the test db has users in it
- update test
2022-01-27 14:30:34 -06:00
Gustavo Saiani
4ce1569413 Dashboard Subscription overview: display useful piece of text, instead of null (#19992) 2022-01-27 16:12:35 -03:00
Alexander Polyankin
777667ca50 Fix activation snowplow events on FE (#19986) 2022-01-27 21:46:01 +03:00
Alexander Polyankin
3e73e5d70c Activation fixes for 0.42 (#19947) 2022-01-27 20:55:22 +03:00
Anton Kulyk
a08fc3ffe4 Fix model toast messages say "question" (#19980) 2022-01-27 19:50:34 +02:00
Anton Kulyk
d8bf9942c6 Revision history fixes (#19985)
* Make `getRevisionEvents` accept params object

* Use "You" for current user's revision events

* Fix "moved to" revision display

* Add extra bottom padding to events timeline

* Extract conditions into variables
2022-01-27 19:50:06 +02:00
Noah Moss
60ecd7d9f8 Ensure that XLSX temp files are cleared if output stream closes before export completes (#19963) 2022-01-27 11:42:34 -05:00
Dalton
ac8fcdeeb1 fix cut-off info popover text in Safari (#19887)
* fix cut-off text in Safari

* Actually fix cut-off text in Safari
2022-01-27 08:28:43 -08:00
Ariya Hidayat
c720293421 Binning E2E tests: ensure that the query result is available (#19967) 2022-01-27 07:07:51 -08:00
Alexander Lesnenko
17c5551dd3 always show permission help (#19957)
* always show permission help

* fix permission page layout
2022-01-27 13:45:58 +00:00
Anton Kulyk
f93c156e4a Show model metadata changes revisions (#19913)
* Remove saving changes from `setColumnType` helper

* Use single POST request to create a model in cypress

* Add E2E test

* Display metadata editing revision events

* Change message
2022-01-27 13:51:22 +02:00
Anton Kulyk
829a608bb3 Fix x-raying a nested question (#19922)
* Unksip x-ray test

* Handle nullish dashboard parameters
2022-01-27 11:33:46 +02:00
Anton Kulyk
7fa4675b8e Fix reordering model columns (#19952)
* Add `dataset` to Card type

* Fix "source-table" type

* Don't use original model query in ad-hoc mode

* Handle model using `/dataset` endpoint in Cypress

* Rerun query when entering model editor

* Make it possible to only close the details sidebar

* Close details sidebar when entering model ad-hoc mode

* Move `isAdHocModelQuestion` to data-modeling utils

* Handle TableInteracting column width reset event

* Fix old isAdHoc util usage
2022-01-27 11:31:18 +02:00
Gustavo Saiani
efc6173f04 Remove delete db button from db list (#19951) 2022-01-26 22:10:03 -03:00
adam-james
c8c90a783d Add question link to the 'stopped working' email template. (#19815)
* Add question link to the 'stopped working' email template.

* Adjusted copy from alert email to correctly indicate how to unsubscribe
2022-01-26 15:25:35 -08:00
Jeff Evans
9fb8159595 Trim whitespace around commas in schema filtering code (#19949)
* Trim whitespace around commas in schema filtering code

Change impl of `schema-pattern->re-pattern` so that strings are trimmed before being joined on `|`

Add test to confirm
2022-01-26 17:07:41 -06:00
Noah Moss
2911c4b95c Fix a couple of edge cases in column ordering for exports (#19882)
Co-authored-by: Nemanja <31325167+nemanjaglumac@users.noreply.github.com>
2022-01-26 17:13:14 -05:00
Alexander Lesnenko
75d2371842 License & billing page fixes (#19878)
* fix license and billing page

* fix imports cycle

* specs

* use no-upsell flag

* fix condition
2022-01-26 17:08:19 +00:00
Ariya Hidayat
68b0a87884 Release script: no need for git pull (#19835) 2022-01-26 09:07:39 -08:00
Ariya Hidayat
1cc0b379da Custom expression suggestions: honor database features (#19928) 2022-01-26 08:57:58 -08:00
Jeff Evans
802cc236a8 Support overriding ROWCOUNT for SQL Server (#19267)
* Support overriding ROWCOUNT for SQL Server

Add new "ROWCOUNT Override" connection property for `:sqlserver`, which will provide a DB-level mechanism to override the `ROWCOUNT` session level setting as needed for specific DBs

Change `max-results-bare-rows` from a hardcoded constant to a setting definition instead, which permits a DB level override, and move the former constant default to a new def instead (`default-max-results-bare-rows`)

For `:sqlserver`, set the DB-level setting override (if the connection property is set), via the `driver/normalize-db-details` impl

Add test to confirm the original scenario from #9940 works using this new override (set to `0`)

Move common computation function of overall row limit to the `metabase.query-processor.middleware.limit` namespace, and invoke it from execute now, called `determine-query-max-rows`

Add new clause to the `determine-query-max-rows` function that preferentially takes the value from `row-limit-override` (if defined)
2022-01-26 10:36:06 -06:00
Alexander Lesnenko
954b1c1143 allow enabling eslint (#19934)
* allow disabling eslint

* rename env var

* actually disable eslint by default

* update docs without autoformatting the document
2022-01-26 16:27:16 +00:00
Alexander Polyankin
ae70d15829 Sanitize tracking urls (#19907) 2022-01-26 18:29:00 +03:00
Anton Kulyk
de54fdd15f Add visual tests for model query and metadata editors (#19920)
* Fix metadata editor sidebar formatting UI

* Fix styling

* Add visual tests for model editors

* Add extra awaits
2022-01-26 17:22:10 +02:00
Gustavo Saiani
7d161bae49 Improve error message layout (#19795) 2022-01-26 12:01:30 -03:00
Jeff Bruemmer
e97b5b84a0 docs - update bigquery docs (#19919) 2022-01-26 09:07:04 -05:00
Alexander Lesnenko
199755f8c3 fix trend line on charts without all series visible (#19927) 2022-01-26 12:40:52 +00:00
Alexander Lesnenko
8ff19dc87e preserve colums order when a query changes (#19933) 2022-01-26 12:40:24 +00:00
Ariya Hidayat
e68f2592db Custom expression editor: explicit plain text mode (#19932) 2022-01-26 04:14:18 -08:00
Howon Lee
1f6ff4eb3e Finishing nits for waterfall static viz (#19868)
Waterfall can now have pretty colors and goals now. Y-axis positions reverted back to the way Dan liked less but is more congruent to the dynamic visualizations.
2022-01-26 02:50:35 -08:00
Nemanja Glumac
1b6c1b16a3 Unskip repro for #14178 (#19890) 2022-01-26 11:00:28 +01:00
Jeff Evans
56e0ad1556 Add program_name connectionAttribute for MySQL (#18707)
* Add program_name connectionAttribute for MySQL

Set the program_name connection attribute when creating a MySQL connection, to the same value that we do for other drivers - `config/mb-version-and-process-identifier`

Updating tests

Add test for mysql to ensure `:connectionAttributes` aren't emitted when they are given in `additional-options`

Set `:connectionAttributes` directly in the `jdbc-spec` map (which in turn becomes a property for the JDBC connection) instead of putting in `additional-options`

Fixing some bugs in `additional-options->map`

Relevant links:

* https://dev.mysql.com/doc/refman/8.0/en/performance-schema-connection-attribute-tables.html#performance-schema-connection-attributes-available
* https://mariadb.com/kb/en/performance-schema-session_connect_attrs-table/
* http://mysqlblog.fivefarmers.com/2013/03/26/connection-attributes-in-mysql-5-6/
2022-01-25 17:54:09 -06:00
Jeff Evans
b6d542f82b Apply schema inclusion/exclusion filtering to sql-jdbc drivers (#19651)
* Apply schema inclusion/exclusion filtering to sql-jdbc drivers

Update `sql-jdbc` namespaces to handle schema inclusion/exclusion patterns when filtering schemas

Add new generic schema inclusion/exclusion test for sql-jdbc drivers that define the property

Update Snowflake and Redshift driver manifests to include schema filtering property

Create `db-details->schema-filter-patterns` util fn to turn DB details into the inclusion/exclusion patterns

Move schema inclusion/exclusion filtering code to new namespace (since it's not strictly used by `:sql-jdbc` derived drivers)

Move existing tests accordingly

Add schema inclusion/exclusion check to the new `filtered-syncable-schemas` multimethod (and updating docstring)

Change `:redshift` impl of `filtered-syncable-schemas` to call the `:sql-jdbc` version instead

Use new multimethod instead for `filtered-syncable-schemas`, and have default impl of `syncable-schemas` call that

Mark `syncable-schemas` as deprecated and include notes on the new method (and update driver markdown file accordingly)
2022-01-25 17:52:39 -06:00
2326 changed files with 200519 additions and 92375 deletions

View File

@@ -1,6 +1,6 @@
{
"plugins": [
"babel-plugin-styled-components",
"@emotion",
"@babel/plugin-proposal-export-default-from",
["@babel/plugin-proposal-decorators", { "legacy": true }]
],

View File

@@ -11,13 +11,13 @@ executors:
builder:
working_directory: /home/circleci/metabase/metabase/
docker:
- image: metabase/ci:circleci-java-11-clj-1.10.3.929-07-27-2021-node-browsers
- image: metabase/ci:circleci-java-8-clj-1.10.3.929-07-27-2021-node-browsers
tester:
working_directory: /home/circleci/metabase/metabase/
docker:
- image: metabase/ci:circleci-java-11-clj-1.10.3.929-07-27-2021-node-browsers
- image: maildev/maildev
- image: metabase/ci:circleci-java-8-clj-1.10.3.929-07-27-2021-node-browsers
- image: maildev/maildev:1.1.0
- image: metabase/qa-databases:postgres-sample-12
- image: metabase/qa-databases:mongo-sample-4.0
- image: metabase/qa-databases:mysql-sample-8
@@ -177,7 +177,8 @@ executors:
working_directory: /home/circleci/metabase/metabase/
docker:
- image: metabase/ci:circleci-java-11-clj-1.10.3.929-07-27-2021-node-browsers
- image: metabase/spark:2.1.1
- image: metabase/spark:3.2.1
resource_class: large
vertica:
working_directory: /home/circleci/metabase/metabase/
@@ -607,25 +608,6 @@ jobs:
paths:
- metabase/metabase
check-migrations:
executor:
builder
steps:
- attach-workspace
- create-checksum-file:
filename: .MIGRATIONS-CHECKSUM
find-args: resources/migrations -type f -name '*.yaml'
- create-checksum-file:
filename: .MIGRATIONS-LINTER-CHECKSUMS
find-args: bin/lint-migrations-file -type f -name '*.clj' -or -name 'deps.edn'
- run-on-change:
checksum: '{{ checksum ".MIGRATIONS-CHECKSUM" }}-{{ checksum ".MIGRATIONS-LINTER-CHECKSUMS" }}'
steps:
- run:
name: Verify Liquibase Migrations
command: ./bin/lint-migrations-file.sh
no_output_timeout: 15m
########################################################################################################################
# BACKEND #
########################################################################################################################
@@ -644,9 +626,6 @@ jobs:
- run:
name: Compile Java source file(s)
command: clojure -X:deps prep
- run:
name: Compile driver AOT namespaces
command: cd modules/drivers && clojure -X:deps prep
- run:
name: Fetch dependencies
command: clojure -P -X:dev:ci:ee:ee-dev:drivers:drivers-dev
@@ -735,7 +714,7 @@ jobs:
type: string
timeout:
type: string
default: 15m
default: 20m
before-steps:
type: steps
default: []
@@ -775,45 +754,6 @@ jobs:
path: /home/circleci/metabase/metabase/target/junit
- steps: << parameters.after-steps >>
test-build-scripts:
executor: builder
steps:
- attach-workspace
- run-on-change:
checksum: '{{ checksum ".BACKEND-CHECKSUMS" }}'
steps:
- restore-be-deps-cache
- run:
name: Run metabuild-common build script tests
command: |
cd /home/circleci/metabase/metabase/bin/common && clojure -M:test
no_output_timeout: 15m
- run:
name: Run build-drivers build script tests
command: |
cd /home/circleci/metabase/metabase/bin/build-drivers && clojure -M:test
no_output_timeout: 15m
- run:
name: Run i18n script tests
command: |
cd /home/circleci/metabase/metabase/bin/i18n && clojure -M:test
no_output_timeout: 15m
- run:
name: Run build-mb build script tests
command: |
cd /home/circleci/metabase/metabase/bin/build-mb && clojure -M:test
no_output_timeout: 15m
- run:
name: Run release script tests
command: |
cd /home/circleci/metabase/metabase/bin/release && clojure -M:test
no_output_timeout: 15m
- run:
name: Run Liquibase migrations linter tests
command: |
cd /home/circleci/metabase/metabase/bin/lint-migrations-file && clojure -M:test
no_output_timeout: 15m
########################################################################################################################
# FRONTEND #
@@ -992,6 +932,10 @@ jobs:
MB_SNOWPLOW_AVAILABLE: << parameters.snowplow >>
steps:
- attach-workspace
- run:
command: |
mkdir -p /home/circleci/metabase/metabase/target/uberjar/
mkdir -p /home/circleci/metabase/metabase/resources/
- run-on-change:
checksum: '{{ checksum ".BACKEND-CHECKSUMS" }}-{{ checksum ".FRONTEND-CHECKSUMS" }}-{{ checksum ".E2E-TESTS-CHECKSUMS" }}'
steps:
@@ -1002,9 +946,11 @@ jobs:
name: Restore cached uberjar built in previous step
<<: *CacheKeyUberjar
- steps: << parameters.before-steps >>
# Make both `test-files` and `source-folder` parameters optional. Translates to: if `parameter` => run associated flag (`--spec` and `--folder`, respectively)
# Make both `test-files`, `source-folder` and `currents-record` parameters optional. Translates to: if `parameter` => run associated flag (`--spec`, `--folder` and `--key $CURRENTS_KEY --record` respectively)
command: |
run test-cypress-no-build <<# parameters.test-files >> --spec << parameters.test-files >> <</ parameters.test-files >> <<# parameters.source-folder >> --folder << parameters.source-folder >> <</ parameters.source-folder >>
run test-cypress-no-build \
<<# parameters.test-files >> --spec << parameters.test-files >> <</ parameters.test-files >> \
<<# parameters.source-folder >> --folder << parameters.source-folder >> <</ parameters.source-folder >>
after-steps:
- store_artifacts:
path: /home/circleci/metabase/metabase/cypress
@@ -1054,10 +1000,6 @@ workflows:
jobs:
- checkout
- check-migrations:
requires:
- checkout
- be-deps:
requires:
- checkout
@@ -1090,7 +1032,7 @@ workflows:
- test-driver:
matrix:
parameters:
driver: ["bigquery", "bigquery-cloud-sdk", "googleanalytics", "sqlite"]
driver: ["bigquery-cloud-sdk", "googleanalytics", "sqlite"]
name: be-tests-<< matrix.driver >>-ee
requires:
- be-tests-java-8-ee
@@ -1110,7 +1052,7 @@ workflows:
name: be-google-related-drivers-classpath-test
requires:
- be-tests-java-8-ee
driver: googleanalytics,bigquery,bigquery-cloud-sdk
driver: googleanalytics,bigquery-cloud-sdk
test-args: >-
:only "[metabase.query-processor-test.expressions-test metabase.driver.google-test
metabase.driver.googleanalytics-test]"
@@ -1280,10 +1222,6 @@ workflows:
dest: vertica-jdbc-7.1.2-0.jar
driver: vertica
- test-build-scripts:
requires:
- be-deps
- build-uberjar-drivers:
name: build-uberjar-drivers-<< matrix.edition >>
requires:
@@ -1321,6 +1259,7 @@ workflows:
"dashboard-filters",
"dashboard-filters-sql",
"downloads",
"embedding",
"joins",
"models",
"moderation",

View File

@@ -1,23 +1,83 @@
{:config-paths ["macros"]
:linters {:unresolved-symbol {:exclude [schema= re=
(metabase.util/prog1 [<>])
(metabase.mbql.util/match-one)
(metabase.mbql.util/match)
(metabase.mbql.util.match/match)
(metabase.mbql.util.match/match-one)
(metabase.mbql.util.match/replace)
(metabase.mbql.util/replace)
(metabase.mbql.util/replace-in)
(metabase.query-processor.middleware.cache-backend.interface/with-cached-results)
(metabase.util.regex/rx [opt])
(metabase.async.streaming-response/streaming-response)
(clojure.core.logic/fresh)
(clojure.core.logic/matcha)
(clojure.core.logic/run)]}
;; TODO: clj-kondo should have a way to disable this in certain macro calls like
;; metabase.mbql.util.match/replace
:linters {:unresolved-symbol
{:exclude [schema= re=
(metabase.util/prog1 [<>])
(metabase.mbql.util/match-one)
(metabase.mbql.util/match)
(metabase.mbql.util.match/match)
(metabase.mbql.util.match/match-one)
(metabase.mbql.util.match/replace)
(metabase.mbql.util/replace)
(metabase.mbql.util/replace-in)
(metabase.query-processor.middleware.cache-backend.interface/with-cached-results)
(metabase.util.regex/rx [opt])
(metabase.async.streaming-response/streaming-response)
(clojure.core.logic/fresh)
(clojure.core.logic/matcha)
(clojure.core.logic/run)
(metabase.test/with-temporary-setting-values)
(clojure.test/is [query= sql=])
(toucan.util.test/with-temp*)
(metabase.test/with-temp*)
(taoensso.nippy/extend-freeze)
(taoensso.nippy/extend-thaw)
(metabase.driver.druid.query-processor-test/druid-query-returning-rows)
(clojure.tools.macro/macrolet)]}
:refer-all {:exclude [clojure.test
monger.operators]}
:unexpected-recur {:level :off}
:unused-referred-var {:exclude {compojure.core [GET DELETE POST PUT]}}}
:unused-referred-var {:exclude {compojure.core [GET DELETE POST PUT]}}
:deprecated-var {:exclude {metabase.query-processor.util/normalize-token
{:namespaces ["metabase.*"]}
metabase.driver/supports?
{:namespaces ["metabase.*"]}
metabase.driver/current-db-time
{:namespaces ["metabase.*"]}
metabase.driver.common/current-db-time-native-query
{:namespaces ["metabase\\.driver.*"]}
metabase.driver.common/current-db-time-date-formatters
{:namespaces ["metabase\\.driver.*"]}
metabase.driver.sql-jdbc.execute.old-impl/read-column
{:namespaces ["metabase\\.driver.*"]}
metabase.driver.common/first-successful-parse
{:namespaces ["metabase\\.driver.*"]}
metabase.driver.common/ThreadSafeSimpleDateFormat
{:namespaces ["metabase\\.driver.*"]}
metabase.driver.common/create-db-time-formatters
{:namespaces ["metabase\\.driver.*"]}
metabase.driver.common/current-db-time
{:namespaces ["metabase.*"]}
metabase.driver.sql.query-processor.deprecated/*field-options*
{:namespaces ["metabase\\.driver.*"]}
metabase.driver.sql.query-processor.deprecated/*source-query*
{:namespaces ["metabase\\.driver.*"]}
metabase.driver.sql.query-processor.deprecated/field->identifier
{:namespaces ["metabase\\.driver.*"]}
metabase.driver.sql.query-processor.deprecated/field->alias
{:namespaces ["metabase\\.driver.*"]}
metabase.driver.sql.query-processor.deprecated/prefix-field-alias
{:namespaces ["metabase\\.driver.*"]}
metabase.query-processor.middleware.resolve-joins/maybe-resolve-source-table
{:namespaces ["metabase.*"]}
metabase.driver.sql-jdbc.execute.old-impl/set-timezone-sq
{:namespaces ["metabase\\.driver.*"]}
metabase.driver.sql-jdbc.execute.old-impl/set-timezone-sql
{:namespaces ["metabase\\.driver.*"]}
metabase.driver.sql.query-processor.deprecated/*table-alias*
{:namespaces ["metabase\\.driver.*"]}
metabase.public-settings.premium-features/enable-enhancements?
{:namespaces ["metabase\\.models.*"]}
metabase.driver.sql.query-processor.deprecated/escape-alias
{:namespaces ["metabase\\.driver.*"]}
metabase.driver.sql-jdbc.execute/set-time-zone-if-supported!
{:namespaces ["metabase\\.driver.*"]}
metabase.driver.sql-jdbc.sync.interface/syncable-schemas
{:namespaces ["metabase\\.driver.*"]}
schema.core/either
{:namespaces ["metabase.*"]}
schema.core/both
{:namespaces ["metabase.*"]}}}
:unresolved-var {:exclude [colorize.core]}}
:lint-as {metabase.api.common/let-404 clojure.core/let
metabase.db.data-migrations/defmigration clojure.core/def
metabase.query-processor.error-type/deferror clojure.core/def
@@ -28,9 +88,17 @@
metabase.sync.util/with-emoji-progress-bar clojure.core/let
metabase.driver.sql-jdbc.execute.diagnostic/capturing-diagnostic-info clojure.core/fn
metabase.util.files/with-open-path-to-resource clojure.core/let
metabase.util.ssh/with-ssh-tunnel clojure.core/let
metabase.db.liquibase/with-liquibase clojure.core/let
metabase.models.setting.multi-setting/define-multi-setting clojure.core/def
metabase.integrations.ldap/with-ldap-connection clojure.core/fn
metabase.test/defdataset clojure.core/def
metabase.test/with-temp-file clojure.core/let
metabase.test/with-open-channels clojure.core/let
metabase.test.data.interface/defdataset clojure.core/def
metabase.test.data.interface/defdataset-edn clojure.core/def
metabase.driver.mongo.util/with-mongo-connection clojure.core/let
metabase.driver.mongo.query-processor/mongo-let clojure.core/let
toucan.db/with-call-counting clojure.core/fn
potemkin.types/defprotocol+ clojure.core/defprotocol
@@ -39,21 +107,30 @@
potemkin/defrecord+ clojure.core/defrecord
potemkin.types/deftype+ clojure.core/deftype
potemkin/deftype+ clojure.core/deftype
clojurewerkz.quartzite.jobs/defjob clojure.core/defn}
clojurewerkz.quartzite.jobs/defjob clojure.core/defn
honeysql.util/defalias clojure.core/def
honeysql.helpers/defhelper clj-kondo.lint-as/def-catch-all
clojure.core.logic/defne clj-kondo.lint-as/def-catch-all
monger.operators/defoperator clojure.core/def}
:hooks {:analyze-call {metabase.test.data/dataset hooks.metabase.test.data/dataset
metabase.test/dataset hooks.metabase.test.data/dataset
metabase.test.data/$ids hooks.metabase.test.data/$ids
metabase.test/$ids hooks.metabase.test.data/$ids
metabase.test.data/mbql-query hooks.metabase.test.data/$ids
metabase.test/mbql-query hooks.metabase.test.data/$ids
metabase.test.data/run-mbql-query hooks.metabase.test.data/$ids
metabase.test/run-mbql-query hooks.metabase.test.data/$ids}
:macroexpand {metabase.api.common/defendpoint* metabase.api.common/defendpoint*
metabase.api.common/defendpoint metabase.api.common/defendpoint
metabase.api.common/defendpoint-async metabase.api.common/defendpoint
metabase.query-processor.streaming/streaming-response
metabase.query-processor.streaming/streaming-response
metabase.test/data-query hooks.metabase.test.data/$ids
metabase.test/query hooks.metabase.test.data/$ids
metabase.test/run-mbql-query hooks.metabase.test.data/$ids
metabase.test.data/run-mbql-query hooks.metabase.test.data/$ids
metabase.api.common/defendpoint hooks.metabase.api.common/defendpoint
metabase.api.common/defendpoint-async hooks.metabase.api.common/defendpoint
metabase.test/with-temp hooks.toucan.util.test/with-temp}
:macroexpand {metabase.query-processor.streaming/streaming-response
metabase.query-processor.streaming/streaming-response
metabase.api.common/define-routes macros.metabase.api.common/define-routes
toucan.models/defmodel toucan.models/defmodel
}}
clojurewerkz.quartzite.jobs/build macros.quartz/build-job
clojurewerkz.quartzite.triggers/build macros.quartz/build-trigger
clojurewerkz.quartzite.schedule.cron/schedule macros.quartz/schedule}}
:config-in-comment {:linters {:unresolved-symbol {:level :off}}}}

View File

@@ -0,0 +1,23 @@
(ns hooks.metabase.api.common
(:require
[clj-kondo.hooks-api :as api]
[clojure.string :as str]))
(defn route-fn-name
[method route]
(let [route (if (vector? route) (first route) route)]
(-> (str (name method) route)
(str/replace #"/" "_")
symbol)))
(defn defendpoint [{:keys [node]}]
(let [[method route & body] (rest (:children node))]
{:node
(api/list-node [(api/token-node 'do)
;; register usage of compojure core var
(api/token-node (symbol (str "compojure.core")
(str method)))
;; define function with route-fn-name
(api/list-node (list* (api/token-node 'clojure.core/defn)
(route-fn-name (api/sexpr method) (api/sexpr route))
body))])}))

View File

@@ -15,7 +15,8 @@
(meta dataset))}))
(defn $ids [{:keys [node]}]
(let [[table-name & body] (rest (:children node))
(let [args (rest (:children node))
[table-name & body] args
unused-node (hooks/token-node '_)
vars (atom #{})
_ (walk/postwalk (fn [node]
@@ -29,22 +30,26 @@
(swap! vars conj node))))
node)
body)
nil-bindings (vec (interpose nil @vars))
nil-bindings (vec (interpose (hooks/token-node nil) @vars))
unused-bindings (vec (interpose unused-node @vars))
final-bindings (concat [table-name nil
unused-node table-name]
(if (seq nil-bindings)
(conj nil-bindings nil)
[])
(if (seq unused-bindings)
(conj (next unused-bindings)
(first unused-bindings)
unused-node)
[]))]
final-bindings (concat
(when-not (= "nil" (str table-name))
[table-name (hooks/token-node nil)])
[unused-node table-name]
(if (seq nil-bindings)
(conj nil-bindings (hooks/token-node nil))
[])
(if (seq unused-bindings)
(conj (next unused-bindings)
(first unused-bindings)
unused-node)
[]))]
{:node (with-meta
(hooks/list-node
(list*
(hooks/token-node 'let)
(hooks/vector-node (vec final-bindings))
body))
(with-meta
(list*
(hooks/token-node 'let)
(hooks/vector-node (vec final-bindings))
body)
(meta body)))
(meta body))}))

View File

@@ -0,0 +1,11 @@
(ns hooks.toucan.util.test
(:require [clj-kondo.hooks-api :as api]))
(defn with-temp [{:keys [node]}]
(let [[_ db-ref binding+opts & body] (:children node)
[args opts] (:children binding+opts)]
{:node (api/vector-node [db-ref
opts
(api/list-node (list* (api/token-node 'fn)
(api/vector-node [args])
body))])}))

View File

@@ -1,102 +1,5 @@
(ns metabase.api.common
(:require [clojure.string :as str]))
(ns macros.metabase.api.common)
(defn optional
"Helper function for defining functions that accept optional arguments. If `pred?` is true of the first item in `args`,
a pair like `[first-arg other-args]` is returned; otherwise, a pair like `[default other-args]` is returned.
If `default` is not specified, `nil` will be returned when `pred?` is false.
(defn
^{:arglists ([key? numbers])}
wrap-nums [& args]
(let [[k nums] (optional keyword? args :nums)]
{k nums}))
(wrap-nums 1 2 3) -> {:nums [1 2 3]}
(wrap-nums :numbers 1 2 3) -> {:numbers [1 2 3]}"
{:arglists '([pred? args]
[pred? args default])}
[pred? args & [default]]
(if (pred? (first args)) [(first args) (next args)]
[default args]))
(defn add-route-param-regexes
"Expand a `route` string like \"/:id\" into a Compojure route form that uses regexes to match parameters whose name
matches a regex from `auto-parse-arg-name-patterns`.
(add-route-param-regexes \"/:id/card\") -> [\"/:id/card\" :id #\"[0-9]+\"]"
[route]
(if (vector? route)
route
(let [arg-types nil #_(typify-args (route-arg-keywords route))]
(if (empty? arg-types)
route
(apply vector route arg-types)))))
(defn route-fn-name
"Generate a symbol suitable for use as the name of an API endpoint fn. Name is just `method` + `route` with slashes
replaced by underscores.
(route-fn-name GET \"/:id\") ;-> GET_:id"
[method route]
;; if we were passed a vector like [":id" :id #"[0-9+]"] only use first part
(let [route (if (vector? route) (first route) route)]
(-> (str (name method) route)
(str/replace #"/" "_")
symbol)))
(defmacro defendpoint*
"Impl macro for `defendpoint`; don't use this directly."
[{:keys [method route fn-name docstr args body]}]
`(def ~(vary-meta fn-name
assoc
:doc docstr
:is-endpoint? true)
(~(symbol "compojure.core" (name method)) ~route ~args
~@body)))
(defn- parse-defendpoint-args [[method route & more]]
(let [fn-name (route-fn-name method route)
route (add-route-param-regexes route)
[docstr [args & more]] (optional string? more)
[arg->schema body] (optional (every-pred map? #(every? symbol? (keys %))) more)]
(when-not docstr
;; Don't i18n this, it's dev-facing only
:TODO/emit-clj-kondo-warning-for-missing-docstring
#_(log/warn (u/format-color 'red "Warning: endpoint %s/%s does not have a docstring. Go add one."
(ns-name *ns*) fn-name)))
{:method method
:route route
:fn-name fn-name
;; eval the vals in arg->schema to make sure the actual schemas are resolved so we can document
;; their API error messages
:docstr "foo"
:args args
:arg->schema arg->schema
:body body}))
(defmacro defendpoint
"Define an API function.
This automatically does several things:
- calls `auto-parse` to automatically parse certain args. e.g. `id` is converted from `String` to `Integer` via
`Integer/parseInt`
- converts `route` from a simple form like `\"/:id\"` to a typed one like `[\"/:id\" :id #\"[0-9]+\"]`
- sequentially applies specified annotation functions on args to validate them.
- automatically calls `wrap-response-if-needed` on the result of `body`
- tags function's metadata in a way that subsequent calls to `define-routes` (see below) will automatically include
the function in the generated `defroutes` form.
- Generates a super-sophisticated Markdown-formatted docstring"
;; {:arglists '([method route docstr? args schemas-map? & body])}
[& defendpoint-args]
(let [{:keys [args body arg->schema], :as defendpoint-args} (parse-defendpoint-args defendpoint-args)]
`(defendpoint* ~(assoc defendpoint-args
:body `(do ~args
~arg->schema
(do ~@body))))))
(defmacro define-routes [& args]
`(do (def ~'routes)
~@args))

View File

@@ -0,0 +1,16 @@
(ns macros.quartz)
(defmacro build-job
[& body]
`(let [jb# (org.quartz.JobBuilder/newJob)]
(clojurewerkz.quartzite.jobs/finalize (-> jb# ~@body))))
(defmacro build-trigger
[& body]
`(let [tb# (org.quartz.TriggerBuilder/newTrigger)]
(clojurewerkz.quartzite.triggers/finalize (-> tb# ~@body))))
(defmacro schedule
[& body]
`(let [s# ~(first body)]
(-> s# ~@(rest body))))

View File

@@ -4,4 +4,5 @@
`(do (clojure.core/defrecord ~model-name ~(vec (map (comp symbol name) ks)))
(clojure.core/defrecord
~(symbol (str model-name "Instance"))
~(vec (map (comp symbol name) ks)))))
~(vec (map (comp symbol name) ks)))
~(symbol (str model-name "Instance"))))

View File

@@ -35,6 +35,7 @@
;; instead of one call to `define-clojure-indent'
(eval . (put-clojure-indent 'c/step 1))
(eval . (put-clojure-indent 'db/insert-many! 1))
(eval . (put-clojure-indent 'db/update! 2))
(eval . (put-clojure-indent 'impl/test-migrations 2))
(eval . (put-clojure-indent 'let-404 0))
(eval . (put-clojure-indent 'macros/case 0))
@@ -49,6 +50,8 @@
(eval . (put-clojure-indent 'mt/test-drivers 1))
(eval . (put-clojure-indent 'prop/for-all 1))
(eval . (put-clojure-indent 'qp.streaming/streaming-response 1))
(eval . (put-clojure-indent 'u/select-keys-when 1))
(eval . (put-clojure-indent 'u/strict-extend 1))
;; these ones have to be done with `define-clojure-indent' for now because of upstream bug
;; https://github.com/clojure-emacs/clojure-mode/issues/600 once that's resolved we should use `put-clojure-indent'
;; instead. Please don't add new entries unless they don't work with `put-clojure-indent'

View File

@@ -30,12 +30,12 @@ If applicable, add screenshots to help explain your problem.
You can get this information by going to Admin -> Troubleshooting.
- Your browser and the version: (e.x. Chrome 52.1, Firefox 48.0, Safari 11.1, …)
- Your operating system: (e.x. OS X 10.10, Windows 10.1809, Ubuntu 16.04, …)
- Your databases: (e.x. MySQL, Postgres, MongoDB, …)
- Metabase version: (e.x. 0.19.3)
- Metabase hosting environment: (e.x. Mac app, Elastic Beanstalk, Docker, Heroku, Jar-file on Ubuntu, …)
- Metabase internal database: (e.x. H2 (default), Postgres or MySQL)
- Your browser and the version: (e.g., Chrome 52.1, Firefox 48.0, Safari 11.1, …)
- Your operating system: (e.g., OS X 10.10, Windows 10.1809, Ubuntu 16.04, …)
- Your databases: (e.g, MySQL, Postgres, MongoDB, …)
- Metabase version: (e.g., 0.19.3)
- Metabase hosting environment: (e.g., Elastic Beanstalk, Docker, Heroku, Jar-file on Ubuntu, …)
- Metabase internal database: (e.g., H2 (default), Postgres or MySQL)
**Severity**
How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Metabase entirely?

View File

@@ -0,0 +1,30 @@
name: Find squashed commit
description: Finds squashed commit in master by pull request name
inputs:
pull-request-number:
required: true
base-ref:
required: true
outputs:
commit:
value: ${{ steps.find-squashed-commit.outputs.commit }}
description: Found commit SHA
runs:
using: "composite"
steps:
- run: |
git checkout $BASE_REF
git fetch --all
echo "Looking for a commit that contains pull request number $PULL_REQUEST_NUMBER in $BASE_REF"
COMMIT=$(env -i git log $BASE_REF --grep="(#$PULL_REQUEST_NUMBER)" --format="%H")
echo "commit SHA $COMMIT"
echo "::set-output name=commit::$COMMIT"
id: find-squashed-commit
shell: bash
env:
PULL_REQUEST_NUMBER: ${{ inputs.pull-request-number }}
BASE_REF: ${{ inputs.base-ref }}

View File

@@ -0,0 +1,41 @@
name: Get latest release branch
outputs:
branch-name:
value: ${{ steps.get-latest-release-branch.outputs.result }}
runs:
using: "composite"
steps:
- uses: actions/github-script@v4
id: get-latest-release-branch
with:
result-encoding: string
script: |
const releaseBranches = await github.git.listMatchingRefs({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "heads/release-x.",
});
const getVersionFromBranch = branch => {
const match = branch.match(/release-x\.(.*?)\.x/);
return match && parseInt(match[1]);
};
const latestReleaseBranch = releaseBranches.data
.filter(branch => getVersionFromBranch(branch.ref) !== null)
.reduce(
(prev, current) =>
getVersionFromBranch(prev.ref) > getVersionFromBranch(current.ref)
? prev
: current,
{ ref: "" },
);
const latestReleaseBranchName = latestReleaseBranch.ref.replace(
/^refs\/heads\//,
"",
);
console.log(`Latest release branch: ${latestReleaseBranchName}`);
return latestReleaseBranchName;

View File

@@ -0,0 +1,34 @@
name: Notify Pull Request
inputs:
message:
required: true
include-log:
required: false
default: true
runs:
using: "composite"
steps:
- uses: actions/github-script@v4
id: get-latest-release-branch
with:
result-encoding: string
script: |
const message = "${{ inputs.message }}"
const shouldIncludeLog = ${{ inputs.include-log }}.toString() === "true";
const author = context.payload.sender.login;
let body = `@${author} ${message}`;
if (shouldIncludeLog) {
const { GITHUB_SERVER_URL, GITHUB_REPOSITORY, GITHUB_RUN_ID } = process.env;
const runUrl = `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}`;
body += ` [[Logs]](${runUrl})`;
}
github.issues.createComment({
issue_number: context.payload.number,
owner: context.repo.owner,
repo: context.repo.repo,
body,
});

View File

@@ -0,0 +1,35 @@
name: Prepare back-end environment
inputs:
java-version:
required: true
default: '11'
clojure-version:
required: true
default: '1.10.3.933'
m2-cache-key:
description: 'Key to cache M2 packages from Maven Central'
required: true
default: 'm2'
runs:
using: "composite"
steps:
- name: Prepare JDK ${{ inputs.java-version }}
uses: actions/setup-java@v3
with:
java-version: ${{ inputs.java-version }}
distribution: 'temurin'
- name: Install Clojure CLI
shell: bash
run: |
curl -O https://download.clojure.org/install/linux-install-${{ inputs.clojure-version }}.sh &&
sudo bash ./linux-install-${{ inputs.clojure-version }}.sh
- name: Get M2 cache
uses: actions/cache@v2
with:
path: |
~/.m2
~/.gitlibs
key: ${{ runner.os }}-${{ inputs.m2-cache-key }}-${{ hashFiles('**/deps.edn') }}
restore-keys: |
${{ runner.os }}-${{ inputs.m2-cache-key }}-

View File

@@ -0,0 +1,16 @@
name: Prepare cypress environment
runs:
using: "composite"
steps:
- name: Get Cypress cache
uses: actions/cache@v2
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-Cypress-${{ hashFiles('**/yarn.lock') }}
- name: Ensure that Cypress executable is ready
run: |
yarn cypress install
yarn cypress cache path
yarn cypress cache list
yarn cypress verify
shell: bash

View File

@@ -0,0 +1,21 @@
name: Prepare front-end environment
runs:
using: "composite"
steps:
- name: Prepare Node.js
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: 'yarn'
- name: Get M2 cache
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-cljs-${{ hashFiles('**/shadow-cljs.edn') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
shell: bash

View File

@@ -0,0 +1,18 @@
name: Prepare Uberjar Artifact
runs:
using: "composite"
steps:
- name: Mark with the commit hash
run: git rev-parse --short HEAD > COMMIT-ID
shell: bash
- name: Calculate SHA256 checksum
run: sha256sum ./target/uberjar/metabase.jar > SHA256.sum
shell: bash
- name: Upload JARs as artifact
uses: actions/upload-artifact@v2
with:
name: metabase-${{ matrix.edition }}-uberjar
path: |
./target/uberjar/metabase.jar
./COMMIT-ID
./SHA256.sum

View File

@@ -0,0 +1,13 @@
name: Run Snowplow micro
runs:
using: "composite"
steps:
- name: Download Snowplow micro JAR
run: curl -L -o snowplow-micro.jar https://github.com/snowplow-incubator/snowplow-micro/releases/download/micro-1.2.1/snowplow-micro-1.2.1.jar
shell: bash
- name: Launch Snowplow micro
run: java -cp snowplow-micro.jar:snowplow com.snowplowanalytics.snowplow.micro.Main --collector-config snowplow/micro.conf --iglu snowplow/iglu.json &
shell: bash
- name: Wait until Snowplow micro is ready
run: while ! curl -s 'http://localhost:9090' | grep '404'; do sleep 1; done
shell: bash

View File

@@ -48,10 +48,6 @@ keytool -noprompt -import -alias presto-kerberos -keystore $RESOURCES_DIR/cacert
ADDITIONAL_OPTS="SSLKeyStorePath=$RESOURCES_DIR/ssl_keystore.jks&SSLKeyStorePassword=presto\
&SSLTrustStorePath=$RESOURCES_DIR/cacerts-with-presto-ca.jks&SSLTrustStorePassword=changeit"
# Prepare dependencies
source "./bin/prep.sh"
prep_deps
# Set up the environment variables pointing to all of this, and run some tests
DRIVERS=presto-jdbc \
MB_ENABLE_PRESTO_JDBC_DRIVER=true \

View File

@@ -1,136 +1,70 @@
# Creates a pull request with the latest release branch as a target with a cherry-picked commit if an associated pull request has `backport` label
name: AutoBackport
name: Auto-backport
on:
push:
branches:
- master
pull_request:
types: [closed, labeled]
jobs:
pr_info:
name: Check if the commit should be backported
runs-on: ubuntu-latest
outputs:
title: ${{ fromJson(steps.collect_pr_info.outputs.result).title }}
number: ${{ fromJson(steps.collect_pr_info.outputs.result).pullRequestNumber }}
author: ${{ fromJson(steps.collect_pr_info.outputs.result).author }}
should_backport: ${{ fromJson(steps.collect_pr_info.outputs.result).hasBackportLabel }}
steps:
- uses: actions/github-script@v4
id: collect_pr_info
with:
script: |
const commitMessage = context.payload.commits[0].message;
const pullRequestNumbers = Array.from(commitMessage.matchAll(/\(#(.*?)\)/g))
if (pullRequestNumbers.length === 0) {
return {
author: "",
pullRequestNumber: 0,
title: "",
hasBackportLabel: false
};
}
if (pullRequestNumbers > 1) {
throw "Multiple PRs are associated with this commit";
}
const pullRequestNumber = pullRequestNumbers[0][1];
const { data } = await github.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: pullRequestNumber
});
const hasBackportLabel = data.labels.some((label) => label.name === 'backport');
const { title, user } = data
console.log(`PR #${pullRequestNumber}: "${title}" hasBackportLabel=${hasBackportLabel}`)
return {
author: user.login,
pullRequestNumber,
title: data.title,
hasBackportLabel
}
get_latest_release_branch:
name: Get latest release branch
runs-on: ubuntu-latest
outputs:
branch_name: ${{ steps.get_branch_name.outputs.result }}
steps:
- uses: actions/github-script@v4
id: get_branch_name
with:
result-encoding: string
script: |
const releaseBranches = await github.git.listMatchingRefs({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "heads/release-x.",
});
const getVersionFromBranch = branch => {
const match = branch.match(/release-x\.(.*?)\.x/);
return match && parseInt(match[1])
};
const latestReleaseBranch = releaseBranches.data
.filter(branch => getVersionFromBranch(branch.ref) !== null)
.reduce((prev, current) => getVersionFromBranch(prev.ref) > getVersionFromBranch(current.ref) ? prev : current, { ref: "" });
const latestReleaseBranchName = latestReleaseBranch.ref.replace(/^refs\/heads\//, "");
console.log(`Latest release branch: ${latestReleaseBranchName}`)
return latestReleaseBranchName;
create_backport_pull_request:
runs-on: ubuntu-latest
name: Create a backport PR with the commit
needs: [pr_info, get_latest_release_branch]
if: ${{ needs.pr_info.outputs.should_backport == 'true' }}
env:
TARGET_BRANCH: ${{ needs.get_latest_release_branch.outputs.branch_name }}
ORIGINAL_PULL_REQUEST_NUMBER: ${{ needs.pr_info.outputs.number }}
ORIGINAL_TITLE: ${{ needs.pr_info.outputs.title }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
create-backport:
if: github.event.pull_request.merged == true && (contains(github.event.pull_request.labels.*.name, 'backport') || github.event.label.name == 'backport')
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
name: Checkout
with:
fetch-depth: 0
- run: |
- uses: ./.github/actions/find-squashed-commit
name: Find commit
id: find_commit
with:
pull-request-number: ${{ github.event.pull_request.number }}
base-ref: ${{ github.event.pull_request.base.ref }}
- uses: ./.github/actions/get-latest-release-branch
name: Get latest release branch
id: get_latest_release_branch
- id: create_backport_pull_request
run: |
git config --global user.email "metabase-github-automation@metabase.com"
git config --global user.name "$GITHUB_ACTOR"
BACKPORT_BRANCH="backport-$GITHUB_SHA"
BACKPORT_BRANCH="backport-$COMMIT"
git checkout ${TARGET_BRANCH}
git fetch --all
git checkout -b "${BACKPORT_BRANCH}" origin/"${TARGET_BRANCH}"
git cherry-pick "${GITHUB_SHA}"
git push -u origin "${BACKPORT_BRANCH}"
git checkout -b ${BACKPORT_BRANCH}
git cherry-pick ${COMMIT} || true
CONFLICTS=$(git ls-files -u | wc -l)
if [ "$CONFLICTS" -gt 0 ]; then
echo "Could not cherry pick because of a conflict"
echo "::set-output name=has-conflicts::true"
git cherry-pick --abort
git checkout master
exit 0
fi
git checkout master
git push -u origin ${BACKPORT_BRANCH}
hub pull-request -b "${TARGET_BRANCH}" -h "${BACKPORT_BRANCH}" -l "auto-backported" -a "${GITHUB_ACTOR}" -F- <<<"🤖 backported \"${ORIGINAL_TITLE}\"
#${ORIGINAL_PULL_REQUEST_NUMBER}"
env:
TARGET_BRANCH: ${{ steps.get_latest_release_branch.outputs.branch-name }}
ORIGINAL_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
ORIGINAL_TITLE: ${{ github.event.pull_request.title }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT: ${{ steps.find_commit.outputs.commit }}
notify_when_failed:
runs-on: ubuntu-latest
name: Notify about failure
needs: [pr_info, create_backport_pull_request]
if: ${{ failure() }}
steps:
- uses: actions/github-script@v4
- uses: ./.github/actions/notify-pull-request
if: ${{ steps.create_backport_pull_request.outputs.has-conflicts == 'true' }}
with:
script: |
const { GITHUB_SERVER_URL, GITHUB_REPOSITORY, GITHUB_RUN_ID } = process.env;
const runUrl = `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}`
include-log: false
message: could not create a backport due to conflicts
github.issues.createComment({
issue_number: ${{ needs.pr_info.outputs.number }},
owner: context.repo.owner,
repo: context.repo.repo,
body: `@${{ needs.pr_info.outputs.author }} could not automatically create a backport PR 😩 [[Logs]](${runUrl})`
})
- uses: ./.github/actions/notify-pull-request
if: ${{ failure() }}
with:
include-log: true
message: something went wrong while creating a backport

View File

@@ -1,16 +1,11 @@
name: Backend
on:
pull_request:
push:
branches:
- '**'
paths:
- '**.clj*'
- '**.edn'
- '**.java'
- '**/metabase-plugin.yaml'
- '.github/workflows/**'
- 'master'
- 'release-**'
pull_request:
jobs:
@@ -18,7 +13,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run clj-kondo
run: docker run -v $PWD:/work --rm cljkondo/clj-kondo clj-kondo --config /work/lint-config.edn --lint /work/src /work/enterprise/backend/src /work/backend/mbql/src /work/shared/src
@@ -26,52 +21,22 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- name: Prepare JDK 11
uses: actions/setup-java@v2
- uses: actions/checkout@v3
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
java-version: 11
distribution: 'temurin'
- name: Install Clojure CLI
run: |
curl -O https://download.clojure.org/install/linux-install-1.10.3.933.sh &&
sudo bash ./linux-install-1.10.3.933.sh
- name: Get M2 cache
uses: actions/cache@v2
with:
path: |
~/.m2
~/.gitlibs
key: ${{ runner.os }}-eastwood-${{ hashFiles('**/deps.edn') }}
- name: Compile Java & AOT Sources
run: |
source ./bin/prep.sh && prep_deps
- run: clojure -X:dev:ee:ee-dev:drivers:drivers-dev:eastwood
m2-cache-key: 'eastwood'
- run: clojure -X:dev:ee:ee-dev:drivers:drivers-dev:test:eastwood
name: Run Eastwood linter
be-linter-namespace-decls:
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Prepare JDK 11
uses: actions/setup-java@v2
- uses: actions/checkout@v3
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
java-version: 11
distribution: 'temurin'
- name: Install Clojure CLI
run: |
curl -O https://download.clojure.org/install/linux-install-1.10.3.933.sh &&
sudo bash ./linux-install-1.10.3.933.sh
- name: Get M2 cache
uses: actions/cache@v2
with:
path: |
~/.m2
~/.gitlibs
key: ${{ runner.os }}-namespace-decls-${{ hashFiles('**/deps.edn') }}
- name: Compile Java & AOT Sources
run: |
source ./bin/prep.sh && prep_deps
- run: clojure -X:dev:ee:ee-dev:drivers:drivers-dev:namespace-checker
m2-cache-key: 'namespace-decls'
- run: clojure -X:dev:ee:ee-dev:drivers:drivers-dev:test:namespace-checker
name: Check ns forms

View File

@@ -9,8 +9,20 @@ jobs:
create_pull_request:
name: Creates a pull request
if: contains(github.event.comment.body, '@metabase-bot backport')
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- id: is_organization_member
uses: JamesSingleton/is-organization-member@1.0.0
with:
organization: metabase
username: ${{ github.event.issue.user.login }}
token: ${{ secrets.GITHUB_TOKEN }}
- run: |
result=${{ steps.is_organization_member.outputs.result }}
if [ $result == false ]; then
echo User ${{ github.event.comment.user.login }} is not a member of Metabase organization
exit 1
fi
- uses: actions/github-script@v4
id: branch_info
with:
@@ -63,7 +75,7 @@ jobs:
startSha: commits[0].sha,
endSha: commits[commits.length - 1].sha
}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
name: Cherry-pick commits and create PR
with:
fetch-depth: 0
@@ -111,21 +123,13 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
notify_when_failed:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
name: Notify about failure
needs: create_pull_request
if: ${{ failure() }}
steps:
- uses: actions/github-script@v4
- uses: actions/checkout@v2
- uses: ./.github/actions/notify-pull-request
with:
script: |
const { GITHUB_SERVER_URL, GITHUB_REPOSITORY, GITHUB_RUN_ID} = process.env;
const runUrl = `${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}`
const author = context.payload.comment.user.login;
github.issues.createComment({
issue_number: context.payload.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `@${author} could not automatically a backport PR 😩 [[Logs]](${runUrl})`
})
include-log: true
message: something went wrong while creating a backport

View File

@@ -1,43 +0,0 @@
name: Build and push to Dockerhub
on:
push:
branches:
- master
jobs:
build-and-push-oss-image:
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create container image
run: docker buildx build . -t metabase/metabase-head:latest --push --compress --no-cache
build-and-push-ee-image:
runs-on: ubuntu-20.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create container image
run: docker buildx build . --build-arg MB_EDITION=ee -t metabase/metabase-enterprise-head:latest --push --compress --no-cache

44
.github/workflows/build-scripts.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: Build scripts
on:
push:
branches:
- 'master'
- 'release-**'
pull_request:
jobs:
test-build-scripts:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
m2-cache-key: 'build-scripts'
- name: Run metabuild-common build script tests
run: clojure -M:test
working-directory: bin/common
timeout-minutes: 15
- name: Run build-drivers build script tests
run: clojure -M:test
working-directory: bin/build-drivers
timeout-minutes: 15
- name: Run i18n script tests
run: clojure -M:test
working-directory: bin/i18n
timeout-minutes: 15
- name: Run build-mb build script tests
run: clojure -M:test
working-directory: bin/build-mb
timeout-minutes: 15
- name: Run release script tests
run: clojure -M:test
working-directory: bin/release
timeout-minutes: 15
- name: Run Liquibase migrations linter tests
run: clojure -M:test
working-directory: bin/lint-migrations-file
timeout-minutes: 15

View File

@@ -3,12 +3,8 @@ name: CLJS
on:
push:
branches:
- '**'
paths:
- 'shared/src/'
- '**/package.json'
- '**/yarn.lock'
- '.github/workflows/**'
- 'master'
- 'release-**'
pull_request:
jobs:
@@ -17,28 +13,8 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get M2 cache
uses: actions/cache@v2
with:
path: |
~/.m2
~/.gitlibs
key: ${{ runner.os }}-cljs-${{ hashFiles('**/deps.edn') }}
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Run Cljs tests for shared/ code
run: yarn run test-cljs

View File

@@ -6,10 +6,10 @@ on:
jobs:
codenotify:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
name: Codenotify
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: sourcegraph/codenotify@v0.4

View File

@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:

View File

@@ -1,42 +0,0 @@
name: Docker
on:
push:
branches-ignore:
- 'master'
- 'release**'
- 'backport**'
paths-ignore:
- ".**"
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: buildjet-2vcpu-ubuntu-2004
timeout-minutes: 40
steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/} | sed 's/[^-._a-zA-Z0-9]/-/g')"
id: extract_branch
- uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build container image
run: docker buildx build . -t metabase/metabase-dev:${{ steps.extract_branch.outputs.branch }} --push --compress --no-cache --build-arg MB_EDITION=ee
- name: Launch container
run: docker run -dp 3000:3000 metabase/metabase-dev:${{ steps.extract_branch.outputs.branch }}
timeout-minutes: 5
- run: docker ps
- name: Wait for Metabase to start
run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
timeout-minutes: 1

View File

@@ -3,13 +3,8 @@ name: Docs
on:
push:
branches:
- '**'
paths:
- 'docs/**'
- './bin/verify-docs-links'
- '**/package.json'
- '**/yarn.lock'
- '.github/workflows/**'
- 'master'
- 'release-**'
pull_request:
jobs:
@@ -18,21 +13,8 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- run: yarn run lint-docs-links
name: Run docs links checker

138
.github/workflows/e2e-tests.yml vendored Normal file
View File

@@ -0,0 +1,138 @@
name: E2E Tests
on:
push:
branches:
- 'master'
paths-ignore:
- "docs/**"
- "**.md"
- ".circleci/**"
jobs:
build:
runs-on: buildjet-2vcpu-ubuntu-2004
timeout-minutes: 25
strategy:
matrix:
edition: [oss, ee]
env:
MB_EDITION: ${{ matrix.edition }}
INTERACTIVE: false
steps:
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
- run: ./bin/build version
- run: ./bin/build translations
- run: ./bin/build frontend
- run: ./bin/build licenses
- run: ./bin/build drivers
- run: ./bin/build uberjar
- name: Prepare uberjar artifact
uses: ./.github/actions/prepare-uberjar-artifact
e2e-tests:
runs-on: buildjet-4vcpu-ubuntu-2004
timeout-minutes: 30
needs: build
name: e2e-tests-${{ matrix.folder }}-${{ matrix.edition }}
env:
MB_EDITION: ${{ matrix.edition }}
DISPLAY: ""
QA_DB_ENABLED: true
ENTERPRISE_TOKEN: ${{ secrets.ENTERPRISE_TOKEN }}
MB_SNOWPLOW_AVAILABLE: true
MB_SNOWPLOW_URL: "http://localhost:9090" # Snowplow micro
strategy:
fail-fast: false
matrix:
edition: [oss, ee]
folder:
- "admin"
- "binning"
- "collections"
- "custom-column"
- "dashboard"
- "dashboard-filters"
- "dashboard-filters-sql"
- "downloads"
- "embedding"
- "joins"
- "models"
- "moderation"
- "native"
- "native-filters"
- "permissions"
- "question"
- "sharing"
- "visualizations"
services:
maildev:
image: maildev/maildev:1.1.0
ports:
- "80:80"
- "25:25"
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
postgres-sample:
image: metabase/qa-databases:postgres-sample-12
ports:
- "5432:5432"
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
mongo-sample:
image: metabase/qa-databases:mongo-sample-4.0
ports:
- 27017:27017
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
mysql-sample:
image: metabase/qa-databases:mysql-sample-8
ports:
- 3306:3306
credentials:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
- name: Prepare cypress environment
uses: ./.github/actions/prepare-cypress
- name: Run Snowplow micro
uses: ./.github/actions/run-snowplow-micro
- uses: actions/download-artifact@v2
name: Retrieve uberjar artifact for ${{ matrix.edition }}
with:
name: metabase-${{ matrix.edition }}-uberjar
- name: Get the version info
run: |
jar xf target/uberjar/metabase.jar version.properties
mv version.properties resources/
- name: Run Cypress tests on ${{ matrix.folder }}
run: yarn run test-cypress-no-build --folder ${{ matrix.folder }} --record --key ${{ secrets.CURRENTS_KEY }} --group ${{ matrix.folder }}-${{ matrix.edition }} --ci-build-id "${{ github.run_id }}-${{ github.run_attempt }}"
env:
TERM: xterm
- name: Upload Cypress recording upon failure
uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress-recording-${{ matrix.folder }}-${{ matrix.edition }}
path: |
./cypress
./logs/test.log
if-no-files-found: ignore

View File

@@ -1,69 +1,30 @@
name: Frontend
on:
pull_request:
push:
branches:
- '**'
paths:
- 'frontend/**'
- 'shared/**'
- 'enterprise/frontend/**'
- '**/package.json'
- '**/yarn.lock'
- '**/.eslintrc'
- '.github/workflows/**'
- 'master'
- 'release-**'
pull_request:
jobs:
fe-linter-prettier:
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- run: yarn run lint-prettier
name: Run Prettier formatting linter
fe-linter-eslint:
runs-on: ubuntu-20.04
timeout-minutes: 10
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get M2 cache
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-cljs-${{ hashFiles('**/shadow-cljs.edn') }}
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- run: yarn run lint-eslint
name: Run ESLint linter
@@ -71,22 +32,9 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- run: yarn type-check
name: Check types
@@ -94,27 +42,9 @@ jobs:
runs-on: buildjet-2vcpu-ubuntu-2004
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get M2 cache
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-cljs-${{ hashFiles('**/shadow-cljs.edn') }}
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- run: yarn run test-unit --coverage --silent
name: Run frontend unit tests
- name: Upload coverage to codecov.io
@@ -127,52 +57,21 @@ jobs:
runs-on: buildjet-2vcpu-ubuntu-2004
timeout-minutes: 14
steps:
- uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get M2 cache
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-cljs-${{ hashFiles('**/shadow-cljs.edn') }}
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- run: yarn run test-timezones
name: Run frontend timezones tests
fe-chromatic:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Publish to Chromatic
uses: chromaui/action@v1
env:

View File

@@ -3,15 +3,8 @@ name: Fuzzing
on:
push:
branches:
- '**'
paths:
- 'frontend/**'
- 'shared/**'
- 'enterprise/frontend/**'
- '**/package.json'
- '**/yarn.lock'
- '**/.eslintrc'
- '.github/workflows/**'
- 'master'
- 'release-**'
pull_request:
paths-ignore:
- 'docs/**'
@@ -22,27 +15,9 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get M2 cache
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-cljs-${{ hashFiles('**/shadow-cljs.edn') }}
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- run: yarn test-unit frontend/test/metabase/lib/expressions/fuzz.tokenizer.unit.spec.js
env:
MB_FUZZ: 1
@@ -52,27 +27,9 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get M2 cache
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-cljs-${{ hashFiles('**/shadow-cljs.edn') }}
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- run: yarn test-unit frontend/test/metabase/lib/expressions/fuzz.recursive-parser.unit.spec.js
env:
MB_FUZZ: 1

View File

@@ -1,18 +1,11 @@
name: i18n
on:
pull_request:
push:
branches:
- '**'
paths:
- '**.clj*'
- '**.js'
- '**.jsx'
- '**.ts'
- '**.tsx'
- '.github/workflows/**'
- 'bin/**'
- 'master'
- 'release-**'
pull_request:
jobs:
@@ -20,37 +13,15 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
node-version: 14.x
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-i18n-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
m2-cache-key: 'i18n'
- run: sudo apt install gettext
- name: Install Clojure CLI
run: |
curl -O https://download.clojure.org/install/linux-install-1.10.3.933.sh &&
sudo bash ./linux-install-1.10.3.933.sh
- name: Get M2 cache
uses: actions/cache@v2
with:
path: |
~/.m2
~/.gitlibs
key: ${{ runner.os }}-i18n-${{ hashFiles('**/deps.edn') }}
- run: ./bin/i18n/update-translation-template
name: Check i18n tags/make sure template can be built
- run: ./bin/i18n/build-translation-resources

20
.github/workflows/migrations.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: Migrations
on:
push:
branches:
- 'master'
- 'release-**'
pull_request:
jobs:
check-migrations:
runs-on: ubuntu-20.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
- name: Verify Liquibase Migrations
run: ./bin/lint-migrations-file.sh

View File

@@ -14,6 +14,18 @@ jobs:
branch_name: ${{ fromJson(steps.fetch_pr.outputs.data).head.ref }}
commit_sha: ${{ fromJson(steps.fetch_pr.outputs.data).head.sha }}
steps:
- id: is_organization_member
uses: JamesSingleton/is-organization-member@1.0.0
with:
organization: metabase
username: ${{ github.event.issue.user.login }}
token: ${{ secrets.GITHUB_TOKEN }}
- run: |
result=${{ steps.is_organization_member.outputs.result }}
if [ $result == false ]; then
echo User ${{ github.event.comment.user.login }} is not a member of Metabase organization
exit 1
fi
- name: Fetch issue
uses: octokit/request-action@v2.x
id: fetch_issue
@@ -32,7 +44,7 @@ jobs:
build:
runs-on: ubuntu-20.04
needs: pr_info
timeout-minutes: 60
timeout-minutes: 30
strategy:
matrix:
edition: [oss]
@@ -40,98 +52,40 @@ jobs:
MB_EDITION: ${{ matrix.edition }}
INTERACTIVE: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ needs.pr_info.outputs.branch_name }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Prepare JDK 8
uses: actions/setup-java@v2
with:
java-version: 8
distribution: "temurin"
- name: Install Clojure CLI
run: |
curl -O https://download.clojure.org/install/linux-install-1.10.3.933.sh &&
sudo bash ./linux-install-1.10.3.933.sh
- name: Check versions
run: |
echo "Node.js `node --version`"
echo "yarn `yarn --version`"
java -version
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- name: Get M2 cache
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/deps.edn') }}
- run: yarn install --frozen-lockfile --prefer-offline
- run: ./bin/build
- name: Mark with the commit hash
run: git rev-parse --short HEAD > COMMIT-ID
- name: Calculate SHA256 checksum
run: sha256sum ./target/uberjar/metabase.jar > SHA256.sum
- name: Upload JARs as artifact
uses: actions/upload-artifact@v2
with:
name: metabase-${{ matrix.edition }}-uberjar
path: |
./target/uberjar/metabase.jar
./COMMIT-ID
./SHA256.sum
- name: Prepare uberjar artifact
uses: ./.github/actions/prepare-uberjar-artifact
percy:
timeout-minutes: 30
runs-on: buildjet-4vcpu-ubuntu-2004
needs: [build, pr_info]
runs-on: ubuntu-20.04
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: ${{ needs.pr_info.outputs.branch_name }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Prepare JDK 8
uses: actions/setup-java@v2
with:
java-version: 8
distribution: "temurin"
- name: Install Clojure CLI
run: |
curl -O https://download.clojure.org/install/linux-install-1.10.3.933.sh &&
sudo bash ./linux-install-1.10.3.933.sh
- name: Check versions
run: |
echo "Node.js `node --version`"
echo "yarn `yarn --version`"
java -version
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
- name: Prepare cypress environment
uses: ./.github/actions/prepare-cypress
- uses: actions/download-artifact@v2
name: Retrieve uberjar artifact
with:
@@ -141,7 +95,7 @@ jobs:
jar xf target/uberjar/metabase.jar version.properties
mv version.properties resources/
- name: Run maildev
run: docker run -d -p 80:80 -p 25:25 maildev/maildev
run: docker run -d -p 80:80 -p 25:25 maildev/maildev:1.1.0
- name: Percy Test
run: yarn run test-visual-no-build
env:

View File

@@ -16,7 +16,7 @@ on:
jobs:
build:
runs-on: buildjet-2vcpu-ubuntu-2004
timeout-minutes: 60
timeout-minutes: 25
strategy:
matrix:
edition: [oss]
@@ -24,106 +24,29 @@ jobs:
MB_EDITION: ${{ matrix.edition }}
INTERACTIVE: false
steps:
- uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Prepare JDK 8
uses: actions/setup-java@v2
with:
java-version: 8
distribution: "temurin"
- name: Install Clojure CLI
run: |
curl -O https://download.clojure.org/install/linux-install-1.10.3.933.sh &&
sudo bash ./linux-install-1.10.3.933.sh
- name: Check versions
run: |
echo "Node.js `node --version`"
echo "yarn `yarn --version`"
java -version
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- name: Get M2 cache
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/deps.edn') }}
- run: yarn install --frozen-lockfile --prefer-offline
- run: ./bin/build
- name: Mark with the commit hash
run: git rev-parse --short HEAD > COMMIT-ID
- name: Calculate SHA256 checksum
run: sha256sum ./target/uberjar/metabase.jar > SHA256.sum
- name: Upload JARs as artifact
uses: actions/upload-artifact@v2
with:
name: metabase-${{ matrix.edition }}-uberjar
path: |
./target/uberjar/metabase.jar
./COMMIT-ID
./SHA256.sum
- name: Prepare uberjar artifact
uses: ./.github/actions/prepare-uberjar-artifact
percy:
runs-on: ubuntu-20.04
timeout-minutes: 30
runs-on: buildjet-4vcpu-ubuntu-2004
needs: build
steps:
- uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Prepare JDK 8
uses: actions/setup-java@v2
with:
java-version: 8
distribution: "temurin"
- name: Install Clojure CLI
run: |
curl -O https://download.clojure.org/install/linux-install-1.10.3.933.sh &&
sudo bash ./linux-install-1.10.3.933.sh
- name: Check versions
run: |
echo "Node.js `node --version`"
echo "yarn `yarn --version`"
java -version
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- name: Get Cypress cache
uses: actions/cache@v2
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-Cypress-${{ hashFiles('**/yarn.lock') }}
- name: Ensure that Cypress is ready
run: |
yarn cypress install
yarn cypress cache path
yarn cypress cache list
yarn cypress verify
- run: yarn install --frozen-lockfile --prefer-offline
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
- name: Prepare cypress environment
uses: ./.github/actions/prepare-cypress
- uses: actions/download-artifact@v2
name: Retrieve uberjar artifact
@@ -134,7 +57,7 @@ jobs:
jar xf target/uberjar/metabase.jar version.properties
mv version.properties resources/
- name: Run maildev
run: docker run -d -p 80:80 -p 25:25 maildev/maildev
run: docker run -d -p 80:80 -p 25:25 maildev/maildev:1.1.0
- name: Percy Test
run: yarn run test-visual-no-build
env:

View File

@@ -30,11 +30,11 @@ jobs:
&& sudo ./install \
&& cd -
- name: Checkout Metabase repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check out Presto Kerberos Docker Compose
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: metabase/presto-kerberos-docker
# use a custom branch if/until upstream (mik-laj/presto-kerberos-docker) can be fixed with PRs 23 and 24
@@ -54,7 +54,7 @@ jobs:
- name: Copy client.keytab file to resources
run: docker cp presto-kerberos:/home/presto/client.keytab resources
- name: Checkout mba
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: metabase/mba
ref: master

View File

@@ -10,10 +10,10 @@ on:
jobs:
lint:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
container: snowplow/igluctl:0.6.0
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Lint
run: igluctl lint snowplow

View File

@@ -1,19 +1,19 @@
name: Uberjar
name: Build + Docker Uberjar
on:
push:
branches:
- '**'
paths-ignore:
- 'docs/**'
- 'frontend/test/**'
- 'enterprise/frontend/test/**'
- ".**"
- "test*"
jobs:
build:
name: Build MB ${{ matrix.edition }}
runs-on: ubuntu-20.04
timeout-minutes: 60
timeout-minutes: 40
strategy:
matrix:
edition: [ee, oss]
@@ -21,63 +21,20 @@ jobs:
MB_EDITION: ${{ matrix.edition }}
INTERACTIVE: false
steps:
- uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Prepare JDK 8
uses: actions/setup-java@v2
with:
java-version: 8
distribution: 'temurin'
- name: Install Clojure CLI
run: |
curl -O https://download.clojure.org/install/linux-install-1.10.3.933.sh &&
sudo bash ./linux-install-1.10.3.933.sh
- name: Check versions
run: |
echo "Node.js `node --version`"
echo "yarn `yarn --version`"
java -version
- name: Check out the code
uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
- name: Build
run: ./bin/build
- name: Prepare uberjar artifact
uses: ./.github/actions/prepare-uberjar-artifact
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- name: Get M2 cache
uses: actions/cache@v2
with:
path: |
~/.m2
~/.gitlibs
key: ${{ runner.os }}-m2-${{ hashFiles('**/deps.edn') }}
- run: yarn install --frozen-lockfile --prefer-offline
- run: MB_EDITION=${{ matrix.edition }} ./bin/build
- name: Mark with the commit hash
run: git rev-parse --short HEAD > COMMIT-ID
- name: Calculate SHA256 checksum
run: sha256sum ./target/uberjar/metabase.jar > SHA256.sum
- name: Upload JARs as artifact
uses: actions/upload-artifact@v2
with:
name: metabase-${{ matrix.edition }}-uberjar
path: |
./target/uberjar/metabase.jar
./COMMIT-ID
./SHA256.sum
check:
check_jar_health:
runs-on: ubuntu-20.04
name: check ${{ matrix.edition }} (java ${{ matrix.java-version }})
name: Is ${{ matrix.edition }} (java ${{ matrix.java-version }}) healthy?
needs: build
timeout-minutes: 10
strategy:
@@ -86,22 +43,80 @@ jobs:
java-version: [8, 11, 17]
steps:
- name: Prepare JRE (Java Run-time Environment)
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-package: jre
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
- run: java -version
- uses: actions/download-artifact@v2
name: Retrieve uberjar artifact
with:
name: metabase-${{ matrix.edition }}-uberjar
- name: Launch uberjar
run: java -jar ./target/uberjar/metabase.jar &
- name: Wait for Metabase to start
run: while ! curl -s localhost:3000/api/health; do sleep 1; done
timeout-minutes: 5
run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
- name: Check API health
run: curl -s localhost:3000/api/health
containerize_test_and_push_container:
runs-on: ubuntu-20.04
name: Containerize ${{ matrix.edition }}
needs: check_jar_health
strategy:
matrix:
edition: [ee, oss]
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Extract and clean branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/} | sed 's/[^-._a-zA-Z0-9]/-/g')"
id: extract_branch
- name: Check out the code (Dockerfile needed)
uses: actions/checkout@v3
- name: Download uploaded artifacts to insert into container
uses: actions/download-artifact@v2
with:
name: metabase-${{ matrix.edition }}-uberjar
path: bin/docker/
- name: Move the ${{ matrix.edition }} uberjar to the context dir
run: mv bin/docker/target/uberjar/metabase.jar bin/docker/.
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host
- name: Build ${{ matrix.edition }} container
uses: docker/build-push-action@v2
with:
context: bin/docker/.
platforms: linux/amd64
network: host
tags: localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-${{ matrix.edition }}
no-cache: true
push: true
- name: Launch ${{ matrix.edition }} container
run: docker run --rm -dp 3000:3000 localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-${{ matrix.edition }}
timeout-minutes: 5
- name: Is Docker running?
run: docker ps
- name: Wait for Metabase to start and reach 100% health
run: while ! curl -s 'http://localhost:3000/api/health' | grep '{"status":"ok"}'; do sleep 1; done
timeout-minutes: 1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Retag and push images if master or main (ee)
if: ${{ (github.ref_name == 'master' || github.ref_name == 'main') && matrix.edition == 'ee' }}
run: docker tag localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-ee metabase/metabase-enterprise-head:latest && docker push metabase/metabase-enterprise-head:latest
- name: Retag and push images if master or main (oss)
if: ${{ (github.ref_name == 'master' || github.ref_name == 'main') && matrix.edition == 'oss' }}
run: docker tag localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-oss metabase/metabase-head:latest && docker push metabase/metabase-head:latest
- name: Retag and push images if branch
if: ${{ !(startsWith(github.ref_name,'master') || startsWith(github.ref_name,'main') || startsWith(github.ref_name,'backport')) && matrix.edition == 'ee' }}
run: docker tag localhost:5000/metabase-dev:${{ steps.extract_branch.outputs.branch }}-ee metabase/metabase-dev:${{ steps.extract_branch.outputs.branch }} && docker push metabase/metabase-dev:${{ steps.extract_branch.outputs.branch }}

View File

@@ -1,42 +1,21 @@
name: Whitespace
on:
pull_request:
push:
branches:
- '**'
paths:
- '**.yaml'
- '**.yml'
- '**.clj'
- '**.edn'
- '**.el'
- '**.html'
- '**.json'
- '**.js*'
- '**.sh'
- 'master'
- 'release-**'
pull_request:
jobs:
whitespace-linter:
runs-on: ubuntu-20.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- name: Prepare JDK 11
uses: actions/setup-java@v2
- uses: actions/checkout@v3
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
with:
java-version: 11
distribution: 'temurin'
- name: Install Clojure CLI
run: |
curl -O https://download.clojure.org/install/linux-install-1.10.3.933.sh &&
sudo bash ./linux-install-1.10.3.933.sh
- name: Get M2 cache
uses: actions/cache@v2
with:
path: |
~/.m2
~/.gitlibs
key: ${{ runner.os }}-whitespace-linter-${{ hashFiles('**/deps.edn') }}
m2-cache-key: 'whitespace-linter'
- run: clojure -T:whitespace-linter lint
name: Run Whitespace Linter

View File

@@ -1,14 +1,11 @@
name: YAML
on:
pull_request:
push:
branches:
- '**'
paths:
- '**.yml'
- '**.yaml'
- 'package.json'
- 'master'
- 'release-**'
pull_request:
jobs:
@@ -16,20 +13,7 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- name: Prepare Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get yarn cache
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Get node_modules cache
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile --prefer-offline
- uses: actions/checkout@v3
- name: Prepare front-end environment
uses: ./.github/actions/prepare-frontend
- run: yarn run lint-yaml

1
.gitignore vendored
View File

@@ -80,3 +80,4 @@ dev/src/dev/nocommit/
.lsp/*
!.lsp/config.edn
.clj-kondo/.cache
*.code-workspace

View File

@@ -1,4 +1,8 @@
{:keep-require-at-start? true
:show-docs-arity-on-same-line? true
:project-specs [{:project-path "deps.edn"
:classpath-cmd ["clojure" "-A:dev:ee:ee-dev:drivers:drivers-dev" "-Spath"]}]}
:classpath-cmd ["clojure" "-A:dev:ee:ee-dev:drivers:drivers-dev" "-Spath"]}]
:linters {:clojure-lsp/unused-public-var {:level :warning
:exclude-when-defined-by
#{metabase.api.common/defendpoint}}}}

View File

@@ -21,6 +21,7 @@ module.exports = {
resolve: {
...storybookConfig.resolve,
alias: appConfig.resolve.alias,
extensions: appConfig.resolve.extensions,
},
}),
};

View File

@@ -23,7 +23,9 @@ FROM eclipse-temurin:11-jre-alpine as runner
ENV FC_LANG en-US LC_CTYPE en_US.UTF-8
# dependencies
RUN apk upgrade && apk add --update-cache --no-cache bash ttf-dejavu fontconfig curl java-cacerts && \
RUN apk add -U bash ttf-dejavu fontconfig curl java-cacerts && \
apk upgrade && \
rm -rf /var/cache/apk/* && \
mkdir -p /app/certs && \
curl https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem -o /app/certs/rds-combined-ca-bundle.pem && \
/opt/java/openjdk/bin/keytool -noprompt -import -trustcacerts -alias aws-rds -file /app/certs/rds-combined-ca-bundle.pem -keystore /etc/ssl/certs/java/cacerts -keypass changeit -storepass changeit && \

View File

@@ -1,6 +1,6 @@
# Metabase
Metabase is the easy, open source way for everyone in your company to ask questions and learn from data.
[Metabase](https://www.metabase.com/) is the easy, open-source way for everyone in your company to ask questions and learn from data.
![Metabase Product Screenshot](docs/metabase-product-screenshot.png)
@@ -8,18 +8,19 @@ Metabase is the easy, open source way for everyone in your company to ask questi
[![Circle CI](https://circleci.com/gh/metabase/metabase.svg?style=svg&circle-token=3ccf0aa841028af027f2ac9e8df17ce603e90ef9)](https://circleci.com/gh/metabase/metabase)
[![codecov](https://codecov.io/gh/metabase/metabase/branch/master/graph/badge.svg)](https://codecov.io/gh/metabase/metabase)
# Features
## Features
- 5 minute [setup](https://metabase.com/docs/latest/setting-up-metabase.html) (We're not kidding)
- Let anyone on your team [ask questions](https://metabase.com/docs/latest/users-guide/04-asking-questions.html) without knowing SQL
- Rich beautiful [dashboards](https://metabase.com/docs/latest/users-guide/06-sharing-answers.html) with auto refresh and fullscreen
- [SQL Mode](https://www.metabase.com/docs/latest/users-guide/writing-sql.html) for analysts and data pros
- Create canonical [segments and metrics](https://metabase.com/docs/latest/administration-guide/07-segments-and-metrics.html) for your team to use
- Send data to Slack or email on a schedule with [dashboard subscriptions](https://www.metabase.com/docs/latest/users-guide/dashboard-subscriptions.html)
- [Humanize data](https://metabase.com/docs/latest/administration-guide/03-metadata-editing.html) for your team by renaming, annotating and hiding fields
- See changes in your data with [alerts](https://www.metabase.com/docs/latest/users-guide/15-alerts.html)
- [Set up in five minutes](https://metabase.com/docs/latest/setting-up-metabase.html) (we're not kidding).
- Let anyone on your team [ask questions](https://metabase.com/docs/latest/users-guide/04-asking-questions.html) without knowing SQL.
- Use the [SQL editor](https://www.metabase.com/docs/latest/users-guide/writing-sql.html) for more complex queries.
- Build handsome, interactive [dashboards](https://metabase.com/docs/latest/users-guide/06-sharing-answers.html) with filters, auto-refresh, fullscreen, and custom click behavior.
- Create [models](https://www.metabase.com/learn/getting-started/models) that clean up, annotate, and/or combine raw tables.
- Define canonical [segments and metrics](https://metabase.com/docs/latest/administration-guide/07-segments-and-metrics.html) for your team to use.
- Send data to Slack or email on a schedule with [dashboard subscriptions](https://www.metabase.com/docs/latest/users-guide/dashboard-subscriptions.html).
- Set up [alerts](https://www.metabase.com/docs/latest/users-guide/15-alerts.html) to have Metabase notify you when your data changes.
- [Embed charts and dashboards](https://www.metabase.com/docs/latest/administration-guide/13-embedding.html) in your app, or even [your entire Metabase](https://www.metabase.com/docs/latest/enterprise-guide/full-app-embedding.html).
For more information check out [metabase.com](https://metabase.com/)
Take a [tour of Metabase](https://www.metabase.com/learn/getting-started/tour-of-metabase).
## Supported databases
@@ -28,65 +29,33 @@ For more information check out [metabase.com](https://metabase.com/)
## Installation
Metabase can be run just about anywhere so checkout our [Installation Guides](https://www.metabase.com/docs/latest/operations-guide/installing-metabase.html) for detailed instructions for various deployments. Here's the TLDR:
Metabase can be run just about anywhere. Check out our [Installation Guides](https://www.metabase.com/docs/latest/operations-guide/installing-metabase.html).
### Docker
## Contributing
To run Metabase via Docker, just type
To get started with a development installation of the Metabase, check out our [Developers Guide](https://www.metabase.com/docs/latest/developers-guide/start).
```
docker run -d -p 3000:3000 --name metabase metabase/metabase
```
## Internationalization
### JAR file
We want Metabase to be available in as many languages as possible. See which translations are available and help contribute to internationalization using our project over at [POEditor](https://poeditor.com/join/project/ynjQmwSsGh). You can also check out our [policies on translations](https://www.metabase.com/docs/latest/administration-guide/localization.html).
To run Metabase via a JAR file, you will need to have a Java Runtime Environment installed on your system.
We recommend the latest LTS version of JRE from [Eclipse Temurin](https://adoptium.net/) with HotSpot JVM and x64 architecture, but other [Java versions](https://www.metabase.com/docs/latest/operations-guide/java-versions.html) might work too.
Go to the [Metabase download page](https://metabase.com/start/jar.html) and download the latest release. Place the downloaded JAR file into a newly created directory (as it will create some files when it is run), and run it with the following command:
```
java -jar metabase.jar
```
Now, open a browser and go to [http://localhost:3000](http://localhost:3000) , and you will be asked a set of questions that will set up a user account, and then you can add a database connection. For this to work you will need to get some information about which database you want to connect to, such as the Host Name and Port that it is running on, the Database Name and the User and Password that you will be using.
Once you have added this connection, you will be taken into the app and you'll be ready to ask your first question.
For a more detailed walkthrough, check out our [Getting Started](https://www.metabase.com/docs/latest/getting-started.html) guide.
# Frequently Asked Questions
Some questions come up over and over again. Check here first:
[FAQ](https://www.metabase.com/docs/latest/faq/start.html)
# Security Disclosure
See [SECURITY.md](./SECURITY.md) for details.
# Contributing
To get started with a development installation of the Metabase, follow the instructions at our [Developers Guide](https://www.metabase.com/docs/latest/developers-guide.html).
Then take a look at our [Contribution Guide](https://www.metabase.com/docs/latest/contributing.html) for information about our process and where you can fit in!
# Internationalization
We want Metabase to be available in as many languages as possible. See which translations are available and help contribute to internationalization using our project over at [POEditor](https://poeditor.com/join/project/ynjQmwSsGh). You can also check out our [policies on translations](https://www.metabase.com/docs/latest/faq/general/what-languages-can-be-used-with-metabase.html).
# Extending and Deep Integrations
## Extending Metabase
Metabase also allows you to hit our Query API directly from Javascript to integrate the simple analytics we provide with your own application or third party services to do things like:
- Build moderation interfaces
- Export subsets of your users to third party marketing automation software
- Provide a specialized customer lookup application for the people in your company
- Build moderation interfaces.
- Export subsets of your users to third party marketing automation software.
- Provide a specialized customer lookup application for the people in your company.
Check out our guide, [Working with the Metabase API](https://www.metabase.com/learn/administration/metabase-api).
# License
## Security Disclosure
This repository contains the source code for both the Open Source edition of Metabase, released under the AGPL, as well as the commercial edition of Metabase Enterprise, released under the Metabase Commercial Software License.
See [SECURITY.md](./SECURITY.md) for details.
## License
This repository contains the source code for both the Open Source edition of Metabase, released under the AGPL, as well as the [commercial editions of Metabase](https://www.metabase.com/pricing/), which are released under the Metabase Commercial Software License.
See [LICENSE.txt](./LICENSE.txt) for details.

View File

@@ -12,8 +12,5 @@ check_clojure_cli
source "./bin/clear-outdated-cpcaches.sh"
clear_outdated_cpcaches
source "./bin/prep.sh"
prep_deps
cd bin/build-mb
clojure -M -m build $@

View File

@@ -19,8 +19,5 @@ check_clojure_cli
source "./bin/clear-outdated-cpcaches.sh"
clear_outdated_cpcaches
source "./bin/prep.sh"
prep_deps
cd bin/build-drivers
clojure -M -m build-driver $@

View File

@@ -12,8 +12,5 @@ check_clojure_cli
source "./bin/clear-outdated-cpcaches.sh"
clear_outdated_cpcaches
source "./bin/prep.sh"
prep_deps
cd bin/build-drivers
clojure -M -m build-drivers $@

View File

@@ -51,7 +51,7 @@
;; log which libs we're including and excluding.
(doseq [lib (sort (keys (:libs basis)))]
(u/announce (if-let [provider (get provided-lib->provider lib)]
(format "SKIP %%45s (provided by %s)" provider)
(format "SKIP %%s (provided by %s)" provider)
"INCLUDE %s")
(colorize/yellow lib)))
;; now remove the provide libs from `:classpath`, `:classpath-roots`, and `:libs`

View File

@@ -28,7 +28,7 @@
(s/def ::parent (s/or :single-parent string? :multiple-parent (s/coll-of string?)))
(s/def ::required boolean?)
(s/def ::placeholder string?)
(s/def ::placeholder any?)
(s/def ::type #(contains? property-types %))
(s/def ::visible-if (s/map-of keyword? any?))

View File

@@ -7,7 +7,7 @@ VERSION_PROPERTY_NAME="src_hash"
source-hash() {
# hash all the files that might change a backend-only uberjar build (for integration tests)
(
find src deps.edn resources/sample-dataset.db.mv.db -type f -print0 | xargs -0 shasum ;
find src deps.edn resources/sample-database.db.mv.db -type f -print0 | xargs -0 shasum ;
find resources -type f \( -iname \*.clj -o -iname \*.edn -o -iname \*.yaml -o -iname \*.properties -o -iname \*.html \) -not -name "version.properties" -print0 | xargs -0 shasum ;
) | shasum | awk '{ print $1 }'
}

View File

@@ -4,14 +4,14 @@
{common/common {:local/root "../common"}
build-drivers/build-drivers {:local/root "../build-drivers"}
i18n/i18n {:local/root "../i18n"}
org.flatland/ordered {:mvn/version "1.5.7"}}
org.flatland/ordered {:mvn/version "1.15.10"}}
:aliases
{:test {:extra-paths ["test"]
:extra-deps {com.cognitect/test-runner {:git/url "https://github.com/cognitect-labs/test-runner.git"
:sha "209b64504cb3bd3b99ecfec7937b358a879f55c1"}
:sha "cc75980b43011773162b485f46f939dc5fba91e4"}
;; the following deps are to have jars on the classpath for testing
org.apache.commons/commons-math3 {:mvn/version "3.6.1"}
net.redhogs.cronparser/cron-parser-core {:mvn/version "3.4"}}
net.redhogs.cronparser/cron-parser-core {:mvn/version "3.5"}}
:main-opts ["-m" "cognitect.test-runner"]}}}

View File

@@ -0,0 +1,277 @@
Eclipse Public License - v 2.0
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
1. DEFINITIONS
"Contribution" means:
a) in the case of the initial Contributor, the initial content
Distributed under this Agreement, and
b) in the case of each subsequent Contributor:
i) changes to the Program, and
ii) additions to the Program;
where such changes and/or additions to the Program originate from
and are Distributed by that particular Contributor. A Contribution
"originates" from a Contributor if it was added to the Program by
such Contributor itself or anyone acting on such Contributor's behalf.
Contributions do not include changes or additions to the Program that
are not Modified Works.
"Contributor" means any person or entity that Distributes the Program.
"Licensed Patents" mean patent claims licensable by a Contributor which
are necessarily infringed by the use or sale of its Contribution alone
or when combined with the Program.
"Program" means the Contributions Distributed in accordance with this
Agreement.
"Recipient" means anyone who receives the Program under this Agreement
or any Secondary License (as applicable), including Contributors.
"Derivative Works" shall mean any work, whether in Source Code or other
form, that is based on (or derived from) the Program and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship.
"Modified Works" shall mean any work in Source Code or other form that
results from an addition to, deletion from, or modification of the
contents of the Program, including, for purposes of clarity any new file
in Source Code form that contains any contents of the Program. Modified
Works shall not include works that contain only declarations,
interfaces, types, classes, structures, or files of the Program solely
in each case in order to link to, bind by name, or subclass the Program
or Modified Works thereof.
"Distribute" means the acts of a) distributing or b) making available
in any manner that enables the transfer of a copy.
"Source Code" means the form of a Program preferred for making
modifications, including but not limited to software source code,
documentation source, and configuration files.
"Secondary License" means either the GNU General Public License,
Version 2.0, or any later versions of that license, including any
exceptions or additional permissions as identified by the initial
Contributor.
2. GRANT OF RIGHTS
a) Subject to the terms of this Agreement, each Contributor hereby
grants Recipient a non-exclusive, worldwide, royalty-free copyright
license to reproduce, prepare Derivative Works of, publicly display,
publicly perform, Distribute and sublicense the Contribution of such
Contributor, if any, and such Derivative Works.
b) Subject to the terms of this Agreement, each Contributor hereby
grants Recipient a non-exclusive, worldwide, royalty-free patent
license under Licensed Patents to make, use, sell, offer to sell,
import and otherwise transfer the Contribution of such Contributor,
if any, in Source Code or other form. This patent license shall
apply to the combination of the Contribution and the Program if, at
the time the Contribution is added by the Contributor, such addition
of the Contribution causes such combination to be covered by the
Licensed Patents. The patent license shall not apply to any other
combinations which include the Contribution. No hardware per se is
licensed hereunder.
c) Recipient understands that although each Contributor grants the
licenses to its Contributions set forth herein, no assurances are
provided by any Contributor that the Program does not infringe the
patent or other intellectual property rights of any other entity.
Each Contributor disclaims any liability to Recipient for claims
brought by any other entity based on infringement of intellectual
property rights or otherwise. As a condition to exercising the
rights and licenses granted hereunder, each Recipient hereby
assumes sole responsibility to secure any other intellectual
property rights needed, if any. For example, if a third party
patent license is required to allow Recipient to Distribute the
Program, it is Recipient's responsibility to acquire that license
before distributing the Program.
d) Each Contributor represents that to its knowledge it has
sufficient copyright rights in its Contribution, if any, to grant
the copyright license set forth in this Agreement.
e) Notwithstanding the terms of any Secondary License, no
Contributor makes additional grants to any Recipient (other than
those set forth in this Agreement) as a result of such Recipient's
receipt of the Program under the terms of a Secondary License
(if permitted under the terms of Section 3).
3. REQUIREMENTS
3.1 If a Contributor Distributes the Program in any form, then:
a) the Program must also be made available as Source Code, in
accordance with section 3.2, and the Contributor must accompany
the Program with a statement that the Source Code for the Program
is available under this Agreement, and informs Recipients how to
obtain it in a reasonable manner on or through a medium customarily
used for software exchange; and
b) the Contributor may Distribute the Program under a license
different than this Agreement, provided that such license:
i) effectively disclaims on behalf of all other Contributors all
warranties and conditions, express and implied, including
warranties or conditions of title and non-infringement, and
implied warranties or conditions of merchantability and fitness
for a particular purpose;
ii) effectively excludes on behalf of all other Contributors all
liability for damages, including direct, indirect, special,
incidental and consequential damages, such as lost profits;
iii) does not attempt to limit or alter the recipients' rights
in the Source Code under section 3.2; and
iv) requires any subsequent distribution of the Program by any
party to be under a license that satisfies the requirements
of this section 3.
3.2 When the Program is Distributed as Source Code:
a) it must be made available under this Agreement, or if the
Program (i) is combined with other material in a separate file or
files made available under a Secondary License, and (ii) the initial
Contributor attached to the Source Code the notice described in
Exhibit A of this Agreement, then the Program may be made available
under the terms of such Secondary Licenses, and
b) a copy of this Agreement must be included with each copy of
the Program.
3.3 Contributors may not remove or alter any copyright, patent,
trademark, attribution notices, disclaimers of warranty, or limitations
of liability ("notices") contained within the Program from any copy of
the Program which they Distribute, provided that Contributors may add
their own appropriate notices.
4. COMMERCIAL DISTRIBUTION
Commercial distributors of software may accept certain responsibilities
with respect to end users, business partners and the like. While this
license is intended to facilitate the commercial use of the Program,
the Contributor who includes the Program in a commercial product
offering should do so in a manner which does not create potential
liability for other Contributors. Therefore, if a Contributor includes
the Program in a commercial product offering, such Contributor
("Commercial Contributor") hereby agrees to defend and indemnify every
other Contributor ("Indemnified Contributor") against any losses,
damages and costs (collectively "Losses") arising from claims, lawsuits
and other legal actions brought by a third party against the Indemnified
Contributor to the extent caused by the acts or omissions of such
Commercial Contributor in connection with its distribution of the Program
in a commercial product offering. The obligations in this section do not
apply to any claims or Losses relating to any actual or alleged
intellectual property infringement. In order to qualify, an Indemnified
Contributor must: a) promptly notify the Commercial Contributor in
writing of such claim, and b) allow the Commercial Contributor to control,
and cooperate with the Commercial Contributor in, the defense and any
related settlement negotiations. The Indemnified Contributor may
participate in any such claim at its own expense.
For example, a Contributor might include the Program in a commercial
product offering, Product X. That Contributor is then a Commercial
Contributor. If that Commercial Contributor then makes performance
claims, or offers warranties related to Product X, those performance
claims and warranties are such Commercial Contributor's responsibility
alone. Under this section, the Commercial Contributor would have to
defend claims against the other Contributors related to those performance
claims and warranties, and if a court requires any other Contributor to
pay any damages as a result, the Commercial Contributor must pay
those damages.
5. NO WARRANTY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS"
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF
TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
PURPOSE. Each Recipient is solely responsible for determining the
appropriateness of using and distributing the Program and assumes all
risks associated with its exercise of rights under this Agreement,
including but not limited to the risks and costs of program errors,
compliance with applicable laws, damage to or loss of data, programs
or equipment, and unavailability or interruption of operations.
6. DISCLAIMER OF LIABILITY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS
SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
7. GENERAL
If any provision of this Agreement is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability of
the remainder of the terms of this Agreement, and without further
action by the parties hereto, such provision shall be reformed to the
minimum extent necessary to make such provision valid and enforceable.
If Recipient institutes patent litigation against any entity
(including a cross-claim or counterclaim in a lawsuit) alleging that the
Program itself (excluding combinations of the Program with other software
or hardware) infringes such Recipient's patent(s), then such Recipient's
rights granted under Section 2(b) shall terminate as of the date such
litigation is filed.
All Recipient's rights under this Agreement shall terminate if it
fails to comply with any of the material terms or conditions of this
Agreement and does not cure such failure in a reasonable period of
time after becoming aware of such noncompliance. If all Recipient's
rights under this Agreement terminate, Recipient agrees to cease use
and distribution of the Program as soon as reasonably practicable.
However, Recipient's obligations under this Agreement and any licenses
granted by Recipient relating to the Program shall continue and survive.
Everyone is permitted to copy and distribute copies of this Agreement,
but in order to avoid inconsistency the Agreement is copyrighted and
may only be modified in the following manner. The Agreement Steward
reserves the right to publish new versions (including revisions) of
this Agreement from time to time. No one other than the Agreement
Steward has the right to modify this Agreement. The Eclipse Foundation
is the initial Agreement Steward. The Eclipse Foundation may assign the
responsibility to serve as the Agreement Steward to a suitable separate
entity. Each new version of the Agreement will be given a distinguishing
version number. The Program (including Contributions) may always be
Distributed subject to the version of the Agreement under which it was
received. In addition, after a new version of the Agreement is published,
Contributor may elect to Distribute the Program (including its
Contributions) under the new version.
Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
receives no rights or licenses to the intellectual property of any
Contributor under this Agreement, whether expressly, by implication,
estoppel or otherwise. All rights in the Program not expressly granted
under this Agreement are reserved. Nothing in this Agreement is intended
to be enforceable by any entity that is not a Contributor or Recipient.
No third-party beneficiary rights are created under this Agreement.
Exhibit A - Form of Secondary Licenses Notice
"This Source Code may also be made available under the following
Secondary Licenses when the conditions for such availability set forth
in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
version(s), and exceptions or additional permissions here}."
Simply including a copy of this Agreement, including this Exhibit A
is not sufficient to license the Source Code under Secondary Licenses.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to
look for such a notice.
You may add additional accurate notices of copyright ownership.

View File

@@ -1,32 +1,31 @@
{:override/group
{"org.clojure" {:resource "EPL.txt"},
"io.netty" {:resource "apache2_0.txt"},
"org.opensaml" {:resource "apache2_0.txt"},
"com.google.guava" {:resource "apache2_0.txt"},
"com.fasterxml.jackson.dataformat" {:resource "apache2_0.txt"},
"com.onelogin" {:resource "MIT.txt"},
"com.vladsch.flexmark" {:resource "BSD.txt"},
"xalan" {:resource "apache2_0.txt"}
"org.apache.hadoop" {:resource "apache2_0.txt"}
"org.ow2.asm" {:resource "BSD.txt"}
"org.eclipse.jetty" {:resource "apache2_0.txt"}
;; see if we can remove these if/when https://github.com/googleapis/java-core/issues/488 is done
"com.google.cloud" {:resource "apache2_0.txt"}
{"com.fasterxml.jackson.dataformat" {:resource "apache2_0.txt"}
"com.google.auth" {:resource "apache2_0.txt"}
"com.google.cloud" {:resource "apache2_0.txt"}
"com.google.code.gson" {:resource "apache2_0.txt"}
"com.google.guava" {:resource "apache2_0.txt"}
"com.google.http-client" {:resource "apache2_0.txt"}
"com.google.protobuf" {:resource "apache2_0.txt"}
"com.google.http-client" {:resource "apache2_0.txt"}}
"com.onelogin" {:resource "MIT.txt"}
"com.vladsch.flexmark" {:resource "BSD.txt"}
"io.netty" {:resource "apache2_0.txt"}
"org.apache.hadoop" {:resource "apache2_0.txt"}
"org.clojure" {:resource "EPL.txt"}
"org.eclipse.jetty" {:resource "apache2_0.txt"}
"org.opensaml" {:resource "apache2_0.txt"}
"org.ow2.asm" {:resource "BSD.txt"}
"xalan" {:resource "apache2_0.txt"}}
"amalloy" {"ring-gzip-middleware" {:resource "MIT.txt"}}
"buddy" {"buddy-core" {:resource "apache2_0.txt"}}
"colorize" {"colorize" {:resource "EPL.txt"}}
"com.google.api-client" {"google-api-client" {:resource "apache2_0.txt"}}
"com.google.http-client" {"google-http-client" {:resource "apache2_0.txt"}
"google-http-client-jackson2" {:resource "apache2_0.txt"}}
"com.google.api-client" {"google-api-client" {:resource "apache2_0.txt"}}
"com.google.oauth-client" {"google-oauth-client" {:resource "apache2_0.txt"}}
"org.mortbay.jetty" {"jetty" {:resource "apache2_0.txt"}
"jetty-util" {:resource "apache2_0.txt"}
"jetty-security" {:resource "apache2_0.txt"}}
"com.jolbox" {"bonecp" {:resource "apache2_0.txt"}}
"org.eclipse.jetty" {"jetty-webapp" {:resource "EPL.txt"}}
"org.fusesource.leveldbjni" {"leveldbjni-all" {:resource "BSD.txt"}}
"com.sun.activation" {"jakarta.activation" {:resource "EDL.txt"}}
"com.sun.istack" {"istack-commons-runtime" {:resource "EDL.txt"}}
"com.sun.jersey" {"jersey-server" {:resource "apache2_0.txt"}
"jersey-core" {:resource "GPL1_1.txt"}
"jersey-json" {:resource "GPL1_1.txt"}
@@ -34,24 +33,27 @@
"jersey-servlet" {:resource "GPL1_1.txt"}}
"com.sun.jersey.contribs" {"jersey-guice" {:resource "GPL1_1.txt"}}
"com.thoughtworks.paranamer" {"paranamer" {:resource "BSD.txt"}}
"de.rototor.pdfbox" {"graphics2d" {:resource "apache2_0.txt"}}
"hiccup" {"hiccup" {:resource "EPL.txt"}}
"io.dropwizard.metrics" {"metrics-core" {:resource "apache2_0.txt"}}
"jakarta.activation" {"jakarta.activation-api" {:resource "EDL.txt"}}
"jakarta.xml.bind" {"jakarta.xml.bind-api" {:resource "EDL.txt"}}
"javax.servlet.jsp" {"jsp-api" {:resource "GPL2_0.txt"}}
"org.openid4java" {"openid4java-nodeps" {:resource "apache2_0.txt"}},
"net.redhogs.cronparser" {"cron-parser-core" {:resource "MIT.txt"}},
"org.slf4j" {"slf4j-api" {:resource "MIT.txt"}},
"amalloy" {"ring-gzip-middleware" {:resource "MIT.txt"}},
"jakarta.activation" {"jakarta.activation-api" {:resource "EDL.txt"}},
"com.sun.activation" {"jakarta.activation" {:resource "EDL.txt"}}
"net.jcip" {"jcip-annotations" {:resource "CC_2_5.txt"}},
"hiccup" {"hiccup" {:resource "EPL.txt"}},
"jakarta.xml.bind" {"jakarta.xml.bind-api" {:resource "EDL.txt"}},
"net.shibboleth.utilities"
{"java-support" {:resource "apache2_0.txt"}},
"io.dropwizard.metrics" {"metrics-core" {:resource "apache2_0.txt"}},
"stencil" {"stencil" {:resource "EPL.txt"}},
"org.antlr" {"antlr-runtime" {:resource "BSD.txt"}
"antlr4-runtime" {:resource "BSD.txt"}},
"de.rototor.pdfbox" {"graphics2d" {:resource "apache2_0.txt"}},
"colorize" {"colorize" {:resource "EPL.txt"}},
"org.liquibase" {"liquibase-core" {:resource "apache2_0.txt"}},
"org.quartz-scheduler" {"quartz" {:resource "apache2_0.txt"}}}
"metabase" {"saml20-clj" {:resource "EPL_2.txt"}}
"net.jcip" {"jcip-annotations" {:resource "CC_2_5.txt"}}
"net.redhogs.cronparser" {"cron-parser-core" {:resource "MIT.txt"}}
"net.shibboleth.utilities" {"java-support" {:resource "apache2_0.txt"}}
"org.antlr" {"antlr-runtime" {:resource "BSD.txt"}
"antlr4-runtime" {:resource "BSD.txt"}}
"org.eclipse.jetty" {"jetty-webapp" {:resource "EPL.txt"}}
"org.fusesource.leveldbjni" {"leveldbjni-all" {:resource "BSD.txt"}}
"org.glassfish.jaxb" {"jaxb-runtime" {:resource "EDL.txt"}
"txw2" {:resource "EDL.txt"}}
"org.liquibase" {"liquibase-core" {:resource "apache2_0.txt"}}
"org.mortbay.jetty" {"jetty" {:resource "apache2_0.txt"}
"jetty-util" {:resource "apache2_0.txt"}
"jetty-security" {:resource "apache2_0.txt"}}
"org.openid4java" {"openid4java-nodeps" {:resource "apache2_0.txt"}}
"org.quartz-scheduler" {"quartz" {:resource "apache2_0.txt"}}
"org.slf4j" {"slf4j-api" {:resource "MIT.txt"}}
"stencil" {"stencil" {:resource "EPL.txt"}}}

View File

@@ -90,9 +90,10 @@
:url "http://opensource.org/licenses/eclipse-1.0.php"
:distribution "repo"}
(lic/pom->licenses xml))))
(let [jar-filename (jar-filename-from-cp "org/clojure/clojure" classpath-urls)
jar-path (Paths/get jar-filename (into-array String []))]
(with-open [jar-fs (FileSystems/newFileSystem jar-path nil)]
(let [jar-filename (jar-filename-from-cp "org/clojure/clojure" classpath-urls)
jar-path (Paths/get jar-filename (into-array String []))
^ClassLoader classloader nil]
(with-open [jar-fs (FileSystems/newFileSystem jar-path classloader)]
(let [pom-path (lic/determine-pom jar-filename jar-fs)]
(is (= {:name "Eclipse Public License 1.0"
:url "http://opensource.org/licenses/eclipse-1.0.php"
@@ -208,17 +209,16 @@
(deftest all-deps-have-licenses
(testing "All deps on the classpath have licenses"
(loop-until-success #(u/sh {:dir u/project-root-directory} "clojure" "-A:ee" "-P") 3 "download deps")
(let [edition :ee
classpath (u/sh {:dir u/project-root-directory
:quiet? true}
"clojure"
"-A:ee"
"-Spath")
(let [classpath (u/sh {:dir u/project-root-directory
:quiet? true}
"clojure"
"-A:ee"
"-Spath")
classpath-entries (->> (str/split (last classpath) (re-pattern lic/classpath-separator))
(filter lic/jar-file?))]
(let [results (lic/process* {:classpath-entries classpath-entries
:backfill (edn/read-string
(slurp (io/resource "overrides.edn")))})]
:backfill (edn/read-string
(slurp (io/resource "overrides.edn")))})]
(is (nil? (:without-license results))
(str "Deps without license information:\n"
(str/join "\n" (map first (:without-license results)))))
@@ -226,8 +226,4 @@
(into #{} (->> results :with-license (map first))))))
(is (some? (:without-license
(lic/process* {:classpath-entries classpath-entries
:backfill {}})))))))
(comment
(run-tests)
(binding [clojure.test/*test-out* *out*] (run-tests))
)
:backfill {}})))))))

View File

@@ -12,7 +12,7 @@ clear_outdated_cpcaches() {
cd "$script_directory/.."
project_root=`pwd`
cpcaches=`find bin java modules -type d -name .cpcache`
cpcaches=`find bin modules -type d -name .cpcache`
if [ -d .cpcache ]; then
cpcaches=".cpcache $cpcaches"
fi
@@ -21,7 +21,7 @@ clear_outdated_cpcaches() {
return 0
fi
deps_edns="deps.edn $(find bin java modules -type f -name deps.edn)"
deps_edns="deps.edn $(find bin modules -type f -name deps.edn)"
# find the OLDEST cpcache and NEWEST deps.edn files.
oldest_cpcache=""

View File

@@ -1,13 +1,13 @@
{:paths ["src"]
:deps
{commons-io/commons-io {:mvn/version "2.6"}
{commons-io/commons-io {:mvn/version "2.11.0"}
colorize/colorize {:mvn/version "0.1.1"}
environ/environ {:mvn/version "1.1.0"}
environ/environ {:mvn/version "1.2.0"}
potemkin/potemkin {:mvn/version "0.4.5"}}
:aliases
{:test {:extra-paths ["test"]
:extra-deps {com.cognitect/test-runner {:git/url "https://github.com/cognitect-labs/test-runner.git"
:sha "209b64504cb3bd3b99ecfec7937b358a879f55c1"}}
:sha "cc75980b43011773162b485f46f939dc5fba91e4"}}
:main-opts ["-m" "cognitect.test-runner"]}}}

View File

@@ -3,7 +3,9 @@ FROM eclipse-temurin:11-jre-alpine
ENV FC_LANG en-US LC_CTYPE en_US.UTF-8
# dependencies
RUN apk upgrade & apk add --update-cache --no-cache bash ttf-dejavu fontconfig curl java-cacerts && \
RUN apk add -U bash ttf-dejavu fontconfig curl java-cacerts && \
apk upgrade && \
rm -rf /var/cache/apk/* && \
mkdir -p /app/certs && \
curl https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem -o /app/certs/rds-combined-ca-bundle.pem && \
/opt/java/openjdk/bin/keytool -noprompt -import -trustcacerts -alias aws-rds -file /app/certs/rds-combined-ca-bundle.pem -keystore /etc/ssl/certs/java/cacerts -keypass changeit -storepass changeit && \

View File

@@ -20,9 +20,6 @@ cd "$script_directory/../.."
source "./bin/check-clojure-cli.sh"
check_clojure_cli
source "./bin/prep.sh"
prep_deps
POT_NAME="locales/metabase.pot"
POT_BACKEND_NAME="locales/metabase-backend.pot"
# NOTE: hardcoded in .babelrc
@@ -37,7 +34,7 @@ mkdir -p "locales"
#######################
# NOTE: about twice as fast to call babel directly rather than a full webpack build
BABEL_ENV=extract ./node_modules/.bin/babel --quiet -x .js,.jsx -o /dev/null {enterprise/,}frontend/src
BABEL_ENV=extract ./node_modules/.bin/babel --quiet -x .js,.jsx,.ts,.tsx -o /dev/null {enterprise/,}frontend/src
# BABEL_ENV=extract BABEL_DISABLE_CACHE=1 yarn run build
# NOTE: replace ttag's "${ 0 }" style references with xgettext "{0}" style references for consistency

View File

@@ -2,9 +2,9 @@
set -euo pipefail
# switch to project root directory if we're not already there
script_directory=`dirname "${BASH_SOURCE[0]}"`
cd "$script_directory/.."
script_dir=`dirname "${BASH_SOURCE[0]}"`
cd "$script_dir/.."
root=
source "./bin/check-clojure-cli.sh"
check_clojure_cli
@@ -12,8 +12,5 @@ check_clojure_cli
source "./bin/clear-outdated-cpcaches.sh"
clear_outdated_cpcaches
source "./bin/prep.sh"
prep_deps
cd bin/lint-migrations-file
clojure -M -m lint-migrations-file $@

View File

@@ -106,13 +106,13 @@
(walk/postwalk walk-fn change-set))
(empty? @problem-cols)))
;; TODO -- change sets must be distinct by ID.
(s/def ::databaseChangeLog
(s/and distinct-change-set-ids?
change-set-ids-in-order?
no-bare-blob-or-text-types?
(s/+ (s/alt :property (s/keys :req-un [::property])
:changeSet (s/keys :req-un [::changeSet])))))
(s/+ (s/alt :property (s/keys :req-un [::property])
:objectQuotingStrategy (s/keys :req-un [::objectQuotingStrategy])
:changeSet (s/keys :req-un [::changeSet])))))
(def strict-change-set-cutoff
"All change sets with an ID >= this number will be validated with the strict spec."

View File

@@ -1,60 +0,0 @@
#! /usr/bin/env bash
# functions for running prep steps to compile Java and AOT source files, needed before running other stuff.
script_directory=`dirname "${BASH_SOURCE[0]}"`
cd "$script_directory/.."
project_root=`pwd`
clear_cpcaches() {
cd "$project_root"
for file in `find . -type d -name .cpcache`; do
rm -rf "$file"
done
}
compile_java_sources() {
cd "$project_root"
echo "Compile Java source files in $project_root/java if needed..."
if [ ! -d "$project_root/java/target/classes" ]; then
echo 'Compile Java source files'
cd "$project_root"
clojure -Sforce -X:deps prep
else
echo 'Java source files are already compiled'
fi
}
compile_spark_sql_aot_sources() {
cd "$project_root"
echo "Compile Spark SQL AOT source files in $project_root/modules/drivers/sparksql if needed..."
if [ ! -d "$project_root/modules/drivers/sparksql/target/classes" ]; then
echo 'Compile Spark SQL AOT source files'
cd "$project_root/modules/drivers"
clojure -Sforce -X:deps prep
else
echo 'Spark SQL AOT source files are already compiled'
fi
}
prep_deps() {
if compile_java_sources; then
echo "Java sources => OK"
else
echo 'Compilation failed (WHY?!); clearing classpath caches and trying again...'
clear_cpcaches
compile_java_sources
fi
if compile_spark_sql_aot_sources; then
echo "Spark SQL AOT sources => OK"
else
echo 'Compilation failed (WHY?!); clearing classpath caches and trying again...'
clear_cpcaches
compile_spark_sql_aot_sources
fi
cd "$project_root"
}

View File

@@ -12,8 +12,5 @@ check_clojure_cli
source "./bin/clear-outdated-cpcaches.sh"
clear_outdated_cpcaches
source "./bin/prep.sh"
prep_deps
cd bin/release
clojure -M -m release $@

View File

@@ -5,7 +5,6 @@
[metabuild-common.core :as u]
[release
[check-prereqs :as check-prereqs]
[checkout-latest :as checkout-latest]
[common :as c]
[docker :as docker]
[draft-release :as draft-release]
@@ -22,7 +21,6 @@
(def ^:private steps*
(ordered-map/ordered-map
:checkout-latest checkout-latest/checkout-latest!
:build-uberjar uberjar/build-uberjar!
:build-docker docker/build-docker-image!
:push-git-tags git-tags/push-tags!

View File

@@ -1,7 +0,0 @@
(ns release.checkout-latest
(:require [metabuild-common.core :as u]
[release.common :as c]))
(defn checkout-latest! []
(u/step (format "Checkout latest code for %s" (c/branch))
(u/sh {:dir u/project-root-directory} "git" "pull")))

View File

@@ -103,25 +103,7 @@
{"Manifest-Version" "1.0"
"Created-By" "Metabase build.clj"
"Build-Jdk-Spec" (System/getProperty "java.specification.version")
"Main-Class" "metabase.core"
"Liquibase-Package" (str/join ","
["liquibase.change"
"liquibase.changelog"
"liquibase.database"
"liquibase.datatype"
"liquibase.diff"
"liquibase.executor"
"liquibase.ext"
"liquibase.lockservice"
"liquibase.logging"
"liquibase.parser"
"liquibase.precondition"
"liquibase.sdk"
"liquibase.serializer"
"liquibase.snapshot"
"liquibase.sqlgenerator"
"liquibase.structure"
"liquibase.structurecompare"])})
"Main-Class" "metabase.core"})
(defn manifest ^Manifest []
(doto (Manifest.)

134
deps.edn
View File

@@ -4,28 +4,27 @@
;; !! PLEASE KEEP THESE ORGANIZED ALPHABETICALLY !!
;; !! AND ADD A COMMENT EXPLAINING THEIR PURPOSE !!
;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
{aleph/aleph {:mvn/version "0.4.6" ; Async HTTP library; WebSockets
:exclusions [org.clojure/tools.logging]}
amalloy/ring-buffer {:mvn/version "1.3.1" ; fixed length queue implementation, used in log buffering
{amalloy/ring-buffer {:mvn/version "1.3.1" ; fixed length queue implementation, used in log buffering
:exclusions [org.clojure/clojure
org.clojure/clojurescript]}
amalloy/ring-gzip-middleware {:mvn/version "0.1.4"} ; Ring middleware to GZIP responses if client can handle it
bigml/histogram {:mvn/version "4.1.3"} ; Histogram data structure
buddy/buddy-core {:mvn/version "1.10.1" ; various cryptograhpic functions
bigml/histogram {:mvn/version "4.1.4"} ; Histogram data structure
buddy/buddy-core {:mvn/version "1.10.413" ; various cryptographic functions
:exclusions [commons-codec/commons-codec
org.bouncycastle/bcpkix-jdk15on
org.bouncycastle/bcprov-jdk15on]}
buddy/buddy-sign {:mvn/version "3.4.1"} ; JSON Web Tokens; High-Level message signing library
cheshire/cheshire {:mvn/version "5.10.1"} ; fast JSON encoding (used by Ring JSON middleware)
buddy/buddy-sign {:mvn/version "3.4.333"} ; JSON Web Tokens; High-Level message signing library
cheshire/cheshire {:mvn/version "5.10.2"} ; fast JSON encoding (used by Ring JSON middleware)
clj-http/clj-http {:mvn/version "3.12.3" ; HTTP client
:exclusions [commons-codec/commons-codec
commons-io/commons-io
slingshot/slingshot]}
clojurewerkz/quartzite {:mvn/version "2.1.0" ; scheduling library
:exclusions [c3p0/c3p0]}
colorize/colorize {:mvn/version "0.1.1" ; string output with ANSI color codes (for logging)
clojurewerkz/quartzite {:mvn/version "2.1.0" ; scheduling library
:exclusions [c3p0/c3p0
org.quartz-scheduler/quartz]}
colorize/colorize {:mvn/version "0.1.1" ; string output with ANSI color codes (for logging)
:exclusions [org.clojure/clojure]}
com.cemerick/friend {:mvn/version "0.2.3" ; auth library
com.cemerick/friend {:mvn/version "0.2.3" ; auth library
:exclusions [commons-codec/commons-codec
net.sourceforge.nekohtml/nekohtml
org.apache.httpcomponents/httpclient
@@ -34,13 +33,15 @@
com.clearspring.analytics/stream {:mvn/version "2.9.8" ; Various sketching algorithms
:exclusions [it.unimi.dsi/fastutil
org.slf4j/slf4j-api]}
com.draines/postal {:mvn/version "2.0.4"} ; SMTP library
com.google.guava/guava {:mvn/version "30.1.1-jre"} ; dep for BigQuery, Spark, and GA. Require here rather than letting different dep versions stomp on each other — see comments on #9697
com.draines/postal {:mvn/version "2.0.5"} ; SMTP library
com.google.guava/guava {:mvn/version "31.0.1-jre"} ; dep for BigQuery, Spark, and GA. Require here rather than letting different dep versions stomp on each other — see comments on #9697
com.h2database/h2 {:mvn/version "1.4.197"} ; embedded SQL database
com.snowplowanalytics/snowplow-java-tracker
{:mvn/version "0.10.1"} ; Snowplow analytics
{:mvn/version "0.11.0"} ; Snowplow analytics
com.taoensso/nippy {:mvn/version "3.1.1"} ; Fast serialization (i.e., GZIP) library for Clojure
com.vladsch.flexmark/flexmark {:mvn/version "0.62.2"} ; Markdown parsing
com.vladsch.flexmark/flexmark-ext-autolink
{:mvn/version "0.62.2"} ; Flexmark extension for auto-linking bare URLs
commons-codec/commons-codec {:mvn/version "1.15"} ; Apache Commons -- useful codec util fns
commons-io/commons-io {:mvn/version "2.11.0"} ; Apache Commons -- useful IO util fns
commons-validator/commons-validator {:mvn/version "1.7" ; Apache Commons -- useful validation util fns
@@ -49,8 +50,8 @@
commons-logging/commons-logging]}
compojure/compojure {:mvn/version "1.6.2" ; HTTP Routing library built on Ring
:exclusions [ring/ring-codec]}
dk.ative/docjure {:mvn/version "1.16.0" ; excel export
crypto-random/crypto-random {:mvn/version "1.2.1"} ; library for generating cryptographically secure random bytes and strings
dk.ative/docjure {:mvn/version "1.17.0" ; excel export
:exclusions [org.apache.poi/poi
org.apache.poi/poi-ooxml]}
environ/environ {:mvn/version "1.2.0"} ; env vars/Java properties abstraction
@@ -58,19 +59,19 @@
honeysql/honeysql {:mvn/version "1.0.461" ; Transform Clojure data structures to SQL
:exclusions [org.clojure/clojurescript]}
instaparse/instaparse {:mvn/version "1.4.10"} ; Make your own parser
io.forward/yaml {:mvn/version "1.0.9" ; Clojure wrapper for YAML library SnakeYAML. Don't upgrade yet, new version doesn't support Java 8 (see https://github.com/owainlewis/yaml/issues/37)
io.forward/yaml {:mvn/version "1.0.11" ; Clojure wrapper for YAML library SnakeYAML. Don't upgrade yet, new version doesn't support Java 8 (see https://github.com/owainlewis/yaml/issues/37)
:exclusions [org.clojure/clojure
org.flatland/ordered
org.yaml/snakeyaml]}
javax.xml.bind/jaxb-api {:mvn/version "2.4.0-b180830.0359"} ; add the `javax.xml.bind` classes which we're still using but were removed in Java 11
joda-time/joda-time {:mvn/version "2.10.10"}
joda-time/joda-time {:mvn/version "2.10.13"}
kixi/stats {:mvn/version "0.4.4" ; Various statistic measures implemented as transducers
:exclusions [org.clojure/data.avl]}
me.raynes/fs {:mvn/version "1.4.6" ; Filesystem tools
:exclusions [org.apache.commons/commons-compress]}
medley/medley {:mvn/version "1.3.0"} ; lightweight lib of useful functions
metabase/connection-pool {:mvn/version "1.2.0"} ; simple wrapper around C3P0. JDBC connection pools
metabase/saml20-clj {:mvn/version "2.0.0"} ; EE SAML integration
metabase/saml20-clj {:mvn/version "2.0.1"} ; EE SAML integration
metabase/throttle {:mvn/version "1.0.2"} ; Tools for throttling access to API endpoints and other code pathways
net.cgrand/macrovich {:mvn/version "0.2.1"} ; utils for writing macros for both Clojure & ClojureScript
net.i2p.crypto/eddsa {:mvn/version "0.3.0"} ; ED25519 key support (optional dependency for org.apache.sshd/sshd-core)
@@ -85,66 +86,65 @@
org.apache.logging.log4j/log4j-api {:mvn/version "2.17.1"} ; add compatibility with log4j 1.2
org.apache.logging.log4j/log4j-core {:mvn/version "2.17.1"} ; apache logging framework
org.apache.logging.log4j/log4j-jcl {:mvn/version "2.17.1"} ; allows the commons-logging API to work with log4j 2
org.apache.logging.log4j/log4j-liquibase {:mvn/version "2.17.1"} ; liquibase logging via log4j 2
org.apache.logging.log4j/log4j-jul {:mvn/version "2.17.1"} ; java.util.logging (JUL) -> Log4j2 adapter
org.apache.logging.log4j/log4j-slf4j-impl {:mvn/version "2.17.1"} ; allows the slf4j API to work with log4j 2
org.apache.poi/poi {:mvn/version "5.0.0"} ; Work with Office documents (e.g. Excel spreadsheets) -- newer version than one specified by Docjure
org.apache.poi/poi-ooxml {:mvn/version "5.0.0"
org.apache.poi/poi {:mvn/version "5.2.0"} ; Work with Office documents (e.g. Excel spreadsheets) -- newer version than one specified by Docjure
org.apache.poi/poi-ooxml {:mvn/version "5.2.0"
:exclusions [org.bouncycastle/bcpkix-jdk15on
org.bouncycastle/bcprov-jdk15on]}
org.apache.sshd/sshd-core {:mvn/version "2.4.0"} ; ssh tunneling and test server -- do not use 2.6.0 to 2.7.0, see metabase#18316
org.apache.sshd/sshd-core {:mvn/version "2.8.0"} ; ssh tunneling and test server -- do not use 2.6.0 to 2.7.0, see metabase#18316
org.apache.xmlgraphics/batik-all {:mvn/version "1.14"} ; SVG -> image
org.clojars.pntblnk/clj-ldap {:mvn/version "0.0.17"} ; LDAP client
org.bouncycastle/bcpkix-jdk15on {:mvn/version "1.69"} ; Bouncy Castle crypto library -- explicit version of BC specified to resolve illegal reflective access errors
org.bouncycastle/bcprov-jdk15on {:mvn/version "1.69"}
org.bouncycastle/bcpkix-jdk15on {:mvn/version "1.70"} ; Bouncy Castle crypto library -- explicit version of BC specified to resolve illegal reflective access errors
org.bouncycastle/bcprov-jdk15on {:mvn/version "1.70"}
org.clojure/clojure {:mvn/version "1.10.3"}
org.clojure/core.async {:mvn/version "1.3.618"
org.clojure/core.async {:mvn/version "1.5.648"
:exclusions [org.clojure/tools.reader]}
org.clojure/core.logic {:mvn/version "1.0.0"} ; optimized pattern matching library for Clojure
org.clojure/core.match {:mvn/version "1.0.0"}
org.clojure/core.memoize {:mvn/version "1.0.250"} ; useful FIFO, LRU, etc. caching mechanisms
org.clojure/core.memoize {:mvn/version "1.0.253"} ; useful FIFO, LRU, etc. caching mechanisms
org.clojure/data.csv {:mvn/version "1.0.0"} ; CSV parsing / generation
org.clojure/java.classpath {:mvn/version "1.0.0"} ; examine the Java classpath from Clojure programs
org.clojure/java.jdbc {:mvn/version "0.7.12"} ; basic JDBC access from Clojure
org.clojure/java.jmx {:mvn/version "1.0.0"} ; JMX bean library, for exporting diagnostic info
org.clojure/math.combinatorics {:mvn/version "0.1.6"} ; combinatorics functions
org.clojure/math.numeric-tower {:mvn/version "0.0.4"} ; math functions like `ceil`
org.clojure/tools.logging {:mvn/version "1.1.0"} ; logging framework
org.clojure/tools.namespace {:mvn/version "1.1.0"}
org.clojure/math.numeric-tower {:mvn/version "0.0.5"} ; math functions like `ceil`
org.clojure/tools.logging {:mvn/version "1.2.4"} ; logging framework
org.clojure/tools.namespace {:mvn/version "1.2.0"}
org.clojure/tools.reader {:mvn/version "1.3.6"}
org.clojure/tools.trace {:mvn/version "0.7.11"} ; function tracing
org.eclipse.jetty/jetty-server {:mvn/version "9.4.43.v20210629"} ; web server
org.flatland/ordered {:mvn/version "1.5.9"} ; ordered maps & sets
org.graalvm.js/js {:mvn/version "21.2.0"} ; JavaScript engine
org.liquibase/liquibase-core {:mvn/version "3.6.3" ; migration management (Java lib)
org.eclipse.jetty/jetty-server {:mvn/version "9.4.44.v20210927"} ; web server
org.flatland/ordered {:mvn/version "1.15.10"} ; ordered maps & sets
org.graalvm.js/js {:mvn/version "22.0.0.2"} ; JavaScript engine
org.liquibase/liquibase-core {:mvn/version "4.8.0" ; migration management (Java lib)
:exclusions [ch.qos.logback/logback-classic]}
org.mariadb.jdbc/mariadb-java-client {:mvn/version "2.6.2"} ; MySQL/MariaDB driver
org.postgresql/postgresql {:mvn/version "42.2.23"} ; Postgres driver
org.slf4j/slf4j-api {:mvn/version "1.7.32"} ; abstraction for logging frameworks -- allows end user to plug in desired logging framework at deployment time
org.mariadb.jdbc/mariadb-java-client {:mvn/version "2.7.5"} ; MySQL/MariaDB driver
org.postgresql/postgresql {:mvn/version "42.3.2"} ; Postgres driver
org.quartz-scheduler/quartz {:mvn/version "2.3.2"} ; Quartz job scheduler, provided by quartzite but this is a newer version.
org.slf4j/slf4j-api {:mvn/version "1.7.35"} ; abstraction for logging frameworks -- allows end user to plug in desired logging framework at deployment time
org.tcrawley/dynapath {:mvn/version "1.1.0"} ; Dynamically add Jars (e.g. Oracle or Vertica) to classpath
org.threeten/threeten-extra {:mvn/version "1.7.0"} ; extra Java 8 java.time classes like DayOfMonth and Quarter
org.yaml/snakeyaml {:mvn/version "1.29"} ; YAML parser (required by liquibase)
org.yaml/snakeyaml {:mvn/version "1.30"} ; YAML parser
potemkin/potemkin {:mvn/version "0.4.5" ; utility macros & fns
:exclusions [riddley/riddley]}
pretty/pretty {:mvn/version "1.0.5"} ; protocol for defining how custom types should be pretty printed
prismatic/schema {:mvn/version "1.1.12"} ; Data schema declaration and validation library
prismatic/schema {:mvn/version "1.2.0"} ; Data schema declaration and validation library
redux/redux {:mvn/version "0.1.4"} ; Utility functions for building and composing transducers
riddley/riddley {:mvn/version "0.2.0"} ; code walking lib -- used interally by Potemkin, manifold, etc.
ring/ring-core {:mvn/version "1.9.4"} ; web server (Jetty wrapper)
ring/ring-jetty-adapter {:mvn/version "1.9.4"} ; Ring adapter using Jetty webserver
ring/ring-core {:mvn/version "1.9.5"} ; web server (Jetty wrapper)
ring/ring-jetty-adapter {:mvn/version "1.9.5"} ; Ring adapter using Jetty webserver
ring/ring-json {:mvn/version "0.5.1"} ; Ring middleware for reading/writing JSON automatically
robdaemon/clojure.java-time {:mvn/version "0.3.3-SNAPSHOT"} ; Java 8 java.time wrapper. Fork to address #13102 - see upstream PR: https://github.com/dm3/clojure.java-time/pull/60
robdaemon/clojure.java-time {:mvn/version "0.3.3-SNAPSHOT"} ; Java 8 java.time wrapper. Use this fork until https://github.com/dm3/clojure.java-time/issues/77 is fixed upstream
slingshot/slingshot {:mvn/version "0.12.2"} ; enhanced throw/catch, used by other deps
stencil/stencil {:mvn/version "0.5.0"} ; Mustache templates for Clojure
toucan/toucan {:mvn/version "1.15.4" ; Model layer, hydration, and DB utilities
toucan/toucan {:mvn/version "1.17.0" ; Model layer, hydration, and DB utilities
:exclusions [honeysql/honeysql
org.clojure/java.jdbc
org.clojure/tools.logging
org.clojure/tools.namespace]}
user-agent/user-agent {:mvn/version "0.1.0"} ; User-Agent string parser, for Login History page & elsewhere
weavejester/dependency {:mvn/version "0.2.1"} ; Dependency graphs and topological sorting
weavejester/dependency {:mvn/version "0.2.1"}} ; Dependency graphs and topological sorting
;; dummy dependency for the Java source file(s)
metabase/java-deps {:local/root "java"}}
;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
;; !! PLEASE KEEP NEW DEPENDENCIES ABOVE ALPHABETICALLY ORGANIZED AND ADD COMMENTS EXPLAINING THEM. !!
;; !! *PLEASE DO NOT* ADD NEW ONES TO THE BOTTOM OF THE LIST. !!
@@ -152,7 +152,7 @@
:paths
["src" "shared/src" "resources" "java/target/classes"]
["src" "shared/src" "resources"]
:aliases
{
@@ -174,12 +174,14 @@
:exclusions [slingshot/slingshot]}
cloverage/cloverage {:mvn/version "1.2.2"}
eftest/eftest {:mvn/version "0.5.9"}
jonase/eastwood {:mvn/version "0.9.6"}
jonase/eastwood {:mvn/version "1.2.2"}
lein-check-namespace-decls/lein-check-namespace-decls {:mvn/version "1.0.4"} ; misnomer since this works on Clojure CLI now too
pjstadig/humane-test-output {:mvn/version "0.11.0"}
reifyhealth/specmonstah {:mvn/version "2.0.0"}
reifyhealth/specmonstah {:mvn/version "2.0.0"
:exclusions [org.clojure/clojure
org.clojure/clojurescript]}
ring/ring-mock {:mvn/version "0.4.0"}
talltale/talltale {:mvn/version "0.5.4"}}
talltale/talltale {:mvn/version "0.5.8"}}
:extra-paths ["dev/src" "local/src" "test" "shared/test" "test_resources"]
:jvm-opts ["-Dmb.run.mode=dev"
@@ -274,7 +276,7 @@
;;; Linters
;; clojure -X:dev:ee:ee-dev:drivers:drivers-dev:namespace-checker
;; clojure -X:dev:ee:ee-dev:drivers:drivers-dev:test:namespace-checker
:namespace-checker
{:exec-fn metabase.linters.namespace-checker/check-namespace-decls
:exec-args {:prefix-rewriting false}}
@@ -285,7 +287,7 @@
:sha "518d5a1cbfcd7c952f548e6dbfcb9a4a5faf9062"}}
:main-opts ["-m" "clj-check.check"]}
;; clojure -X:dev:ee:ee-dev:drivers:drivers-dev:eastwood
;; clojure -X:dev:ee:ee-dev:drivers:drivers-dev:test:eastwood
:eastwood
{:exec-fn metabase.linters.eastwood/eastwood
:exec-args {;; manually specify the source paths for the time being (exclude test paths) until we fix Eastwood
@@ -332,7 +334,7 @@
;; clojure -T:whitespace-linter
:whitespace-linter
{:deps {com.github.camsaul/whitespace-linter {:sha "b25716745f5875194bc38364e498d0ddda51f4b0"}}
{:deps {com.github.camsaul/whitespace-linter {:sha "912644a2b9cc91edcce31a6fa997c46479341a1d"}}
:ns-default whitespace-linter
:exec-args {:paths ["./.dir-locals.el"
"./deps.edn"
@@ -399,8 +401,8 @@
;; clojure -T:build uberjar
;; clojure -T:build uberjar :edition :ee
:build
{:deps {io.github.clojure/tools.build {:git/tag "v0.7.4" :git/sha "ac442da"}
com.github.seancorfield/depstar {:mvn/version "2.1.278"}
{:deps {io.github.clojure/tools.build {:git/tag "v0.7.5" :git/sha "2526f58"}
com.github.seancorfield/depstar {:mvn/version "2.1.303"}
metabase/build.common {:local/root "bin/common"}
metabase/buid-mb {:local/root "bin/build-mb"}}
:ns-default build}
@@ -413,12 +415,11 @@
:jvm-opts ["-XX:+CITime" ; print time spent in JIT compiler
"-XX:+PrintGC"]}
;; get the H2 shell with clojure -M:h2
;; TODO -- this doesn't currently work correctly -- use this instead:
;;
;; java -cp `clojure -Spath` org.h2.tools.Shell
;; get the H2 shell with clojure -X:h2
:h2
{:jvm-opts ["org.h2.tools.Shell"]}
{:extra-paths ["dev/src"]
:exec-fn dev.h2-shell/shell
:java-opts ["-Dfile.encoding=UTF-8"]}
;; clojure -M:generate-automagic-dashboards-pot
:generate-automagic-dashboards-pot
@@ -428,9 +429,20 @@
;;
;; clojure -M:dev:nrepl (etc.)
:nrepl
{:extra-deps {nrepl/nrepl {:mvn/version "0.8.3"}}
{:extra-deps {nrepl/nrepl {:mvn/version "0.9.0"}}
:main-opts ["-m" "nrepl.cmdline"]}
;; Liquibase CLI:
;;
;; clojure -M:liquibase <command>
;;
;; e.g.
;;
;; clojure -M:liquibase dbDoc target/liquibase
:liquibase
{:extra-deps {ch.qos.logback/logback-classic {:mvn/version "1.2.10"}}
:extra-paths ["dev/src"]
:main-opts ["-m" "dev.liquibase"]}}}
;; TODO -- consider creating an alias that includes the `./bin` build-drivers & release code as well so we can work
;; on them all from a single REPL process.
}}

View File

@@ -136,4 +136,4 @@
(defn migrate!
"Run migrations for the Metabase application database."
[]
(mdb.setup/migrate! (mdb.connection/jdbc-spec) :up))
(mdb.setup/migrate! (mdb.connection/db-type) (mdb.connection/data-source) :up))

View File

@@ -171,15 +171,13 @@
(defn- print-diff [before after]
(assert (not= before after))
(let [before (format-output before)
after (format-output after)
[only-in-before only-in-after] (data/diff before after)]
(let [[only-in-before only-in-after] (data/diff before after)]
(when *print-full?*
(println (u/pprint-to-str 'cyan (format-output after))))
(when (seq only-in-before)
(println (u/colorize 'red (str "-\n" (u/pprint-to-str only-in-before)))))
(println (u/colorize 'red (str "-\n" (u/pprint-to-str (format-output only-in-before))))))
(when (seq only-in-after)
(println (u/colorize 'green (str "+\n" (u/pprint-to-str only-in-after)))))))
(println (u/colorize 'green (str "+\n" (u/pprint-to-str (format-output only-in-after))))))))
(defn- debug-query-changes [middleware-var middleware]
(fn [next-middleware]

18
dev/src/dev/h2_shell.clj Normal file
View File

@@ -0,0 +1,18 @@
(ns dev.h2-shell
(:require [environ.core :as env]
[metabase.db.data-source :as mdb.data-source]
[metabase.db.env :as mdb.env]))
(comment mdb.data-source/keep-me)
(defn shell
"Open an H2 shell with `clojure -X:h2`."
[& _args]
;; Force the DB to use h2 regardless of what's actually in the env vars for Java properties
(alter-var-root #'env/env assoc :mb-db-type "h2")
(require 'metabase.db.env :reload)
(org.h2.tools.Shell/main
(into-array
String
["-url" (let [^metabase.db.data_source.DataSource data-source mdb.env/data-source]
(.url data-source))])))

32
dev/src/dev/liquibase.clj Normal file
View File

@@ -0,0 +1,32 @@
(ns dev.liquibase
(:require [clojure.string :as str]
[colorize.core :as colorize]
[metabase.db.data-source :as mdb.data-source]
[metabase.db.env :as mdb.env]))
(comment mdb.data-source/keep-me)
(defn -main
"Use the Liquibase CLI with `clojure -M:liquibase <command>`."
[& args]
(let [args (if (empty? args)
["help"]
args)
args (into ["--changeLogFile=resources/migrations/000_migrations.yaml"]
(comp cat
(filter seq))
(let [^metabase.db.data_source.DataSource data-source mdb.env/data-source
^java.util.Properties properties (.properties data-source)]
[(when-let [user (some-> properties (.get "user"))]
["--username" user])
(when-let [password (some-> properties (.get "password"))]
["--password" password])
["--url" (.url data-source)]
(map str args)]))]
(println (colorize/green (str/join " " (cons "liquibase" (map pr-str args)))))
;; use reflection here instead of static method calls because `liquibase.integration.commandline.Main` fails to load
;; without having the `logback` dependency available. We add this as `:extra-deps` for the `:liquibase` profile. We
;; don't want other stuff like the linters to choke here tho.
(let [klass (Class/forName "liquibase.integration.commandline.Main")
method (.getMethod klass "main" (into-array Class [(Class/forName "[Ljava.lang.String;")]))]
(.invoke method klass ^"[Ljava.lang.Object" (into-array Object [(into-array String args)])))))

View File

@@ -114,7 +114,8 @@
"</body></html>"))
html (h/html (str/replace html #"\{\{chart\}\}" chart-html))]
(with-open [os (java.io.ByteArrayOutputStream.)]
(let [image-bytes (do (#'png/render-to-png! html os 1000)
(let [image-bytes (do (-> (#'png/render-to-png html 1000)
(#'png/write-image! "png" os))
(.toByteArray os))]
(open-png-bytes image-bytes)))))

View File

@@ -36,6 +36,7 @@
- [List of expressions: aggregations and functions](./users-guide/expressions-list.html)
- [Visualizing data](./users-guide/05-visualizing-results.html)
- [Using results to ask new questions](./users-guide/referencing-saved-questions-in-queries.html)
- [Joining data](./users-guide/join.md)
### SQL and native queries
@@ -78,7 +79,8 @@
## Permissions
- [Data permissions](./administration-guide/05-setting-permissions.html)
- [Permissions overview](./administration-guide/05-setting-permissions.html)
- [Data permissions](./administration-guide/data-permissions.html)
- [Collection permissions](./administration-guide/06-collections.html)
- [Sandboxing data based on user attributes](./enterprise-guide/data-sandboxes.html)
- [SQL snippets folder permissions](./enterprise-guide/sql-snippets.html)

View File

@@ -5,7 +5,7 @@ Metabase is not yet fully compliant with [the US federal government's Section 50
- Metabase doesn't have a method to allow screen readers to skip over repetitive navigation elements.
- Metabase is extremely close but not 100% compliant at providing text equivalents for all non-text elements.
- Most of our form elements are selectable by tabbing through elements.
- Metabase has minimal transition animations in it, but we have not yet tested whether the range of flickering is always between 2 and 55 Hertz.
- Metabase has minimal transition animations in it, but we have not yet tested whether the range of flickering is always between 2 and 55 Hertz. If you've opted for [Reduce Motion / Remove Animation](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion#user_preferences) settings in your OS to take advantage of the `prefers-reduced-motion` CSS media feature, Metabase will disable animations.
- Metabase's data tables do not have row and column headers identified in markup.
- We do not yet have a published description of our accessibility and compatibility features.
- Since Metabase is a React-based web application, it cannot function without scripting (i.e., JavaScript) turned on.
@@ -13,4 +13,4 @@ Metabase is not yet fully compliant with [the US federal government's Section 50
If you'd like to help us address these accessibility gaps, please see [our developers' guide][developers-guide].
[508-accessibility]: https://section508.gov/
[developers-guide]: /docs/latest/developers-guide.html
[developers-guide]: /docs/latest/developers-guide.html

View File

@@ -1,12 +1,14 @@
## Adding and managing databases
# Adding and managing databases
- [Adding a database connection](#adding-a-database-connection)
- [Officially supported databases](#officially-supported-databases)
- [Connecting to databases hosted by a cloud provider](#connecting-to-databases-hosted-by-a-cloud-provider)
- [Errors when connecting to your database](#errors-when-connecting-to-your-database)
- [Database connection options](#database-connection-options)
- [Re-scanning a single table or field](#re-scanning-a-single-table-or-field)
- [Deleting databases](#deleting-databases)
- [Adding a database connection](#adding-a-database-connection)
- [Officially supported databases](#officially-supported-databases)
- [Connecting to databases hosted by a cloud provider](#connecting-to-databases-hosted-by-a-cloud-provider)
- [Errors when connecting to your database](#errors-when-connecting-to-your-database)
- [Database connection options](#database-connection-options)
- [Re-scanning a single table or field](#re-scanning-a-single-table-or-field)
- [Deleting databases](#deleting-databases)
- [Troubleshooting](#troubleshooting)
- [Further reading](#further-reading)
## Adding a database connection
@@ -14,18 +16,18 @@ In the main navigation bar, click on the **gears** icon in the top right, and se
Once in the Admin section, select the **Databases** tab from the navigation bar at the top of the screen. You’ll see a list of your connected databases (if any). To connect a database to Metabase, click **Add database** and follow the connection instructions for your database.
Although connection details differ database to database, in general you'll need to get connection info from your database admin, usually some combination of hostname (sometimes called endpoint), port, database username and password, and the name of the database.
Although connection details differ database to database, in general you'll need to get connection info from your database admin, usually some combination of hostname (sometimes called endpoint), port, database username and password, and the name of the database.
### Officially supported databases
- [BigQuery](databases/bigquery.md) (Google Cloud Platform)
- Druid
- [Google Analytics](databases/google-analytics.md) (version 3; if you're interested in support for version 4, let us know by adding your [+1 to this issue (#12905)](https://github.com/metabase/metabase/issues/12905))
- [Google Analytics](databases/google-analytics.md)
- H2
- [MongoDB (version 3.6 or higher)](databases/mongodb.md) <!-- MongoDB supported version is from https://www.mongodb.com/support-policy -->
- [MySQL (version 5.7 or higher, as well as MariaDB version 10.2 or higher)](databases/mysql.md)
- [Oracle](databases/oracle.md)
- PostgreSQL
- [PostgreSQL](databases/postgresql.md)
- Presto
- Redshift (Amazon Web Services)
- [Snowflake](databases/snowflake.md)
@@ -51,8 +53,8 @@ Check our [troubleshooting guide](../troubleshooting-guide/datawarehouse.md).
Connection options differ depending on which database you're connecting to. Here's an overview:
- [Use a secure connection (SSL)](#use-a-secure-connection-ssl)
- [Use an SSH-tunnel for database connections](#use-an-ssh-tunnel-for-database-connections)
- [Choose when Metabase syncs and scans his](#choose-when-metabase-syncs-and-scans)
- [Use an SSH-tunnel for database connections](#use-an-ssh-tunnel-for-database-connections)
- [Choose when Metabase syncs and scans](#choose-when-metabase-syncs-and-scans)
- [Automatically run queries when doing simple filtering and summarizing](#automatically-run-queries-when-doing-simple-filtering-and-summarizing)
### Use a secure connection (SSL)
@@ -63,15 +65,11 @@ Metabase automatically tries to connect to databases with SSL first, then withou
See our [guide to SSH tunneling](ssh-tunnel-for-database-connections.md).
### Choose when Metabase syncs and scans
### Choose when Metabase syncs and scans
By default, Metabase does a lightweight hourly sync and an intensive daily scan of field values. If you have a large database, we recommend turning on the option "This is a large database, let me choose when Metabase syncs and scans". Once on, you can review when and how often the field value scans happen. (Note: this setting used to be called "Enable in-depth analysis.")
By default, Metabase does a lightweight hourly sync and an intensive daily scan of field values. If you have a large database, we recommend enabling the toggle **Choose when syncs and scans happen** found when you select **Show advanced options**. Once on, you can review when and how often the field value scans happen. (Note: this setting used to be called "Enable in-depth analysis.")
If you enable this and save your changes, you'll see a new tab at the top of the form called "Scheduling." Click on that, and you'll see options to change when and how often Metabase syncs and scans.
![Sync scheduling tab](images/sync-scheduling.png)
#### Database syncing
#### Database syncing
Metabase maintains its own information about the various tables and fields in each database to aid in querying. By default, Metabase performs this lightweight sync hourly to look for changes to the database such as new tables or fields. Metabase does _not_ copy any data from your database. It only maintains lists of the tables and columns.
@@ -95,13 +93,15 @@ By default, Metabase also performs a more intensive daily sampling of each field
If for some reason you need to flush out the cached field values for your database, click the button that says **Discard saved field values** in the top-right of the database's page.
### Automatically run queries when doing simple filtering and summarizing
### Automatically run queries when doing simple filtering and summarizing
By default, Metabase will auto-run queries when you use the Summarize and Filter buttons when viewing a table or chart. If your users are exploring data that is stored in a slow database, you may want to turn the auto-run off to avoid re-running the query every time your users change an option in the Summarize view. Turning this off presents the users with the option to re-run the query when they choose to.
By default, Metabase will auto-run queries when you use the Summarize and Filter buttons when viewing a table or chart. If your users are exploring data that is stored in a slow database, you may want to turn the auto-run off to avoid re-running the query every time your users change an option in the Summarize view. You can turn this option off in the **Show advanced options** section by deselecting the toggle next to **Rerun queries for simple explorations**. Turning this off presents the users with the option to re-run the query when they choose to.
### Periodically refingerprint tables
When syncing with this database, Metabase will scan a subset of values of fields to gather statistics that enable things like improved binning behavior in charts, and to generally make your Metabase instance smarter.
If this option is enabled, Metabase will scan a subset of values of fields when syncing with this database to gather statistics that enable things like improved binning behavior in charts, and to generally make your Metabase instance smarter.
You can turn this option on and off in the **Show advanced options** section.
### Additional JDBC connection string options
@@ -132,9 +132,19 @@ You can also delete a database from the database list: hover over the row with t
![deletedatabasebutton](images/DatabaseDeleteButton.png)
## Troubleshooting
If you're having trouble with your database connection, you can check out this [troubleshooting guide](https://www.metabase.com/docs/latest/troubleshooting-guide/datawarehouse.html), or visit [Metabase's discussion forum](https://discourse.metabase.com/) to see if someone has encountered and resolved a similar issue.
## Further reading
- [Managing databases](https://www.metabase.com/docs/latest/administration-guide/01-managing-databases.html).
- [Metadata editing](https://www.metabase.com/docs/latest/administration-guide/03-metadata-editing.html).
- [Models](../users-guide/models.md).
- [Setting data access permissions](https://www.metabase.com/docs/latest/administration-guide/05-setting-permissions.html).
---
## Next: enabling features that send email
Metabase can send emails for certain features, like email invites, but first you need to [set up an email account](02-setting-up-email.md).
Metabase can send emails for certain features, like email invites, but first you need to [set up an email account](02-setting-up-email.md).

View File

@@ -59,7 +59,8 @@ To remove a group, click the X icon to the right of a group in the list to remov
## Further reading
Checkout our track on [Permissions][permissions] in Learn Metabase.
- [Permissions guide][permissions] in Learn Metabase
- [Troubleshooting permissions][troubleshooting-permissions]
---
@@ -78,3 +79,4 @@ Metabase lets you [set permissions on databases and their tables][data-permissio
[slack-integration]: 09-setting-up-slack.md
[sql-snippet-folders]: ../enterprise-guide/sql-snippets.html
[table-permissions]: data-permissions.md#table-permissions
[troubleshooting-permissions]: ../troubleshooting-guide/permissions.html

View File

@@ -10,27 +10,27 @@ This page will teach you how to create and manage your collections. For more inf
### Creating and editing collections
If a user has Curate access for a collection, they can create new sub-collections inside it and edit the contents of the collection. From the detail view of any collection, click on the `Create a collection` button to make a new one. Give your collection a name, choose where it should live, and give it a description if you'd like.
If a user has Curate access for a collection, they can create new sub-collections inside it and edit the contents of the collection. From the detail view of any collection, click on the **+** button and select **Collection** to make a new one. Give your collection a name, choose where it should live, and give it a description if you'd like.
![Create collection](images/collections/create-collection.png)
By default, new collections will have the same permissions settings as the collection it was created in (its "parent" collection), but you can change those settings from the Edit menu.
By default, any new collection will have the same permissions settings as the collection it was created in (its "parent" collection), but you can change those settings from the Edit menu.
### Pinning things in collections
![Pins](images/collections/pinned-items.png)
One great feature in Metabase is that you can pin the most important couple of items in each of your collections to the top. Pinning an item in a collection turns it into a big, eye-catching card that will help make sure that folks who are browsing your Metabase instance will always know what's most important.
One great feature in Metabase is that you can pin the most important couple of items in each of your collections to the top. Pinning an item in a collection turns it into a big, eye-catching card that will help make sure that folks who are browsing your Metabase instance will always know what's most important. And if you pin a question, Metabase will display a preview of its visualization.
Any user with curate permissions for a collection can pin items in it, making it easy to delegate curation responsibilities to other members of your team. To pin something, you can either click and drag it to the top of the page, or click on its menu and choose the pin action. Note that collections themselves can't be pinned, but if you're running [Metabase Pro or Enterprise Edition](https://www.metabase.com/pricing), admins can designate [Offical Collections][offical-collections].
Any user with curate permissions for a collection can pin items in it, making it easy to delegate curation responsibilities to other members of your team. To pin something, select the **pin icon** next to the item's name. Note that collections themselves can't be pinned, but if you're running [a paid plan](https://www.metabase.com/pricing), admins can designate [Offical Collections][offical-collections].
### Setting permissions for collections
Collection permissions are similar to [data access permissions](05-setting-permissions.md). You can set permissions on collections by clicking on the lock icon in the top-right of the screen while viewing the collection and clicking on `Edit permissions`. Only Administrators can edit collection permissions. Each [user group](05-setting-permissions.md) can have either View, Curate, or No access to a collection:
Collection permissions are similar to [data access permissions](05-setting-permissions.md). You can set permissions on collections by clicking on the lock icon in the top-right of the screen while viewing the collection and clicking on **Edit permissions**. Only Administrators can edit collection permissions. Each [user group](05-setting-permissions.md) can have either View, Curate, or No access to a collection:
- **Curate access:** the user can edit, move, and archive items saved in this collection, and can save or move new items into it. They can also create new sub-collections within this collection. In order to archive a sub-collection within this collection, they'll need to have Curate access for it and any and all collections within it.
- **View access:** the user can see all the questions, dashboards, and pulses in the collection. If the user does not have permission to view some or all of the questions included in a given dashboard or pulse then those questions will not be visible to them; but any questions that are saved in this collection _will_ be visible to them, _even if the user doesn't have access to the underlying data used to in the question._
- **No access:** the user won't see this collection listed, and doesn't have access to any of the items saved within it.
- **Curate access**: the user can edit, move, and archive items saved in this collection, and can save or move new items into it. They can also create new sub-collections within this collection. In order to archive a sub-collection within this collection, they'll need to have Curate access for it and any and all collections within it.
- **View access**: the user can see all the questions, dashboards, and pulses in the collection. If the user does not have permission to view some or all of the questions included in a given dashboard or pulse then those questions will not be visible to them; but any questions that are saved in this collection _will_ be visible to them, _even if the user doesn't have access to the underlying data used to in the question._
- **No access**: the user won't see this collection listed, and doesn't have access to any of the items saved within it.
![Permissions](images/collections/collection-permissions.png)
@@ -48,15 +48,15 @@ To learn more, check out our Learn article on [working with collection permissio
### Personal collections
Each user has a personal collection where they're always allowed to save things, even if they don't have Curate permissions for any other collections. Administrators can see and edit the contents of every user's personal collection (even those belonging to other Administrators) by clicking on the "All personal collections" link from the "Our analytics" collection.
Each user has a personal collection where they're always allowed to save things, even if they don't have Curate permissions for any other collections. Administrators can see and edit the contents of every user's personal collection (even those belonging to other Administrators) by clicking on the **Other users' personal collections** link at the bottom of the sidebar when viewing "Our analytics".
A personal collection works just like any other collection except that its permissions can't be changed. If a sub-collection within a personal collection is moved to a different collection, it will inherit the permissions of that collection.
### Archiving collections
Users with curate permission for a collection can archive collections. Click the edit icon in the top-right of the collection screen and select `Archive this collection` to archive it. This will also archive all questions, dashboards, pulses, and all other sub-collections and their contents. Importantly, this will also remove any archived questions from all dashboards and Pulses that use them.
Users with curate permission for a collection can archive collections. Click the edit icon in the top-right of the collection screen and select **Archive this collection** to archive it. This will also archive all questions, dashboards, pulses, and all other sub-collections and their contents. Importantly, this will also remove any archived questions from all dashboards and Pulses that use them.
**Note:** the "Our analytics" collection and personal collections can't be archived.
**Note:** The "Our analytics" collection and personal collections can't be archived.
You can always _unarchive_ items. In the Collections list sidebar, at the bottom, click on __View archive__. Search for the item you'd like to unarchive (you'll either need to scroll down the page, or use the browser's find in page functionality, as archived items won't appear in Metabase's search results). Select the open box with an up arrow icon to "Unarchive this".

View File

@@ -6,9 +6,8 @@ Metabase allows you to create your own segments and metrics so you can quickly a
A segment is just a special named filter or set of filters. You can create these to make sure that there is an official definition of a subset of customers, users, or products that everyone on your team can refer to consistently. For example, you might create a segment called “Active Users” that contains all the filters that are needed to correctly select active users.
To start, select a table that you want to add a segment to. When you’re done, this segment will be accessible from the filter list in the query builder when viewing this table (the segment will not be automatically applied to the table).
To start, select the **Segments** tab, followed by the **New segment** button on the right side of the screen. Choose the appropriate table and filters for your new segment and add a title and description. When you’re done, this segment will be accessible from the filter list in the query builder when viewing this table (the segment will not be automatically applied to the table).
Click on the **Add a Segment** link on the right side of the screen.
![Add a segment](images/AddSegment.png)
Now you’ll be looking at the segment builder, which is a limited version of the query builder, with only the option to add filters. Add your filter(s) as you would in the query builder, and then give your segment a name and a description (these will be visible in the query builder filter dropdown after you’ve saved). If you want to test out your segment in the query builder before you save it, just click the Preview button, which will open a new query builder window with your segment applied.
@@ -24,11 +23,10 @@ If you exit the Admin Panel and try asking a new question, then click on the but
A custom metric is an easy way to refer to a computed number that you reference often. This could be something like **revenue**, which you could arrive at by viewing the Sum of your Order’s Subtotal column, and applying any required filters — but it’s a pain to have to do this every time you want to do something with revenue.
So, you create a custom metric in a very similar way to how you create segments: start by clicking on the **Add a Metric** link from a table’s detail view in the Admin Panel.
![Add metric](images/AddMetric.png)
You create a custom metric in a very similar way to how you create segments: start by clicking on the **Metrics** tab in the Data Model section of the Admin Panel, and select **New metric**.
Here you're presented with a slightly different version of the query builder, which only lets you select filters and aggregations. Filters are optional: a metric only requires an aggregation on a field. Note that you can use segments in the definition of metrics — pretty cool, right? Go ahead and select your filters, if any, and choose your aggregation. Give your metric a name and a description, and click **Save changes** when you’re done. Just like with segments, you can use the **Preview** button to see how your metric looks in the query builder before you save it.
![abc](images/CreateMetric.png)
![Create metric](images/CreateMetric.png)
Your new metric will now be available from the View dropdown in the query builder, under **Common Metrics**.
![Metric in dropdown](images/Metric.png)

View File

@@ -5,11 +5,10 @@ If you want to have your [Dashboard subscriptions][dashboard-subscriptions] sent
Here's an overview of the steps for setting up Slack:
1. [Create your Slack App](#create-your-slack-app)
2. [Give Slack your app manifest](#the-app-manifest)
3. [Install your app to your workspace](#install-your-app-to-your-workspace)
4. [Get the Bot User OAuth Token](#the-bot-user-oauth-token)
5. [Create a dedicated Metabase channel in your Slack](#create-a-dedicated-metabase-channel-in-your-slack)
6. [Save your changes](#save-your-changes-in-metabase)
2. [Install your app to your workspace](#install-your-app-to-your-workspace)
3. [Get the Bot User OAuth Token](#the-bot-user-oauth-token)
4. [Create a dedicated Metabase channel in your Slack](#create-a-dedicated-metabase-channel-in-your-slack)
5. [Save your changes](#save-your-changes-in-metabase)
## Create your Slack App
@@ -19,11 +18,48 @@ From any Metabase page, go to **Admin settings** > **Settings** > **Slack**.
Click on **Open Slack Apps**. Metabase will open a new browser tab and send you over to the Slack website to create the Slack app.
On the Slack website, click **Create an App**. Select **From an app manifest** and and select the Slack workspace you want Metabase to post to (you're not going to be developing an app, this is just telling Slack what workspace you want Metabase to post to).
On the Slack website, click **Create an App**.
## The app manifest
### Pick a workspace to develop your app
To get the app manifest, head back to Metabase and the Slack settings page, copy the manifest, and return to the Slack app creation page on the Slack website to paste in the manifest (the manifest is in YAML format). The manifest will take care of settings for your app and help speed things along. Once you've pasted the manifest, click the **Next** button. Then hit **Create** to set up your Slack app.
Select the workspace you want to create your app.
### The app manifest
When you click on **Open Slack App**, Metabase will pass along the app manifest, which Slack will use to set up your app.
You may get a warning that says:
**This app is created from a 3rd party manifest** Always verify URLs and permissions below.
This warning is expected (Metabase is the third party here). You can click on **Configure** to see the app manifest Metabase sent along in the URL. Here is the manifest in YAML format:
```
_metadata:
major_version: 1
minor_version: 1
display_information:
name: Metabase
description: Bringing the power of Metabase to your Slack #channels!
background_color: "#509EE3"
features:
bot_user:
display_name: Metabase
oauth_config:
scopes:
bot:
- users:read
- channels:read
- channels:join
- files:write
- chat:write
- chat:write.customize
- chat:write.public
```
The manifest just take cares of some settings for your app and helps speed things along.
Click the **Next** button. Then hit **Create** to set up your Slack app.
## Install your app to your workspace

View File

@@ -86,7 +86,7 @@ Metabase Pro and Enterprise Editions ship with more advanced LDAP features.
{% include plans-blockquote.html feature="LDAP user attribute syncing" %}
If you're running [Metabase Pro or Enterprise Edition](https://www.metabase.com/pricing) and using [data sandboxes](../enterprise-guide/data-sandboxes.md), you can use existing LDAP [user attributes](../enterprise-guide/data-sandboxes.html#getting-user-attributes) when granting sandboxed access.
If you're running a [paid version of Metabase](https://www.metabase.com/pricing) and using [data sandboxes](../enterprise-guide/data-sandboxes.md), you can use existing LDAP [user attributes](../enterprise-guide/data-sandboxes.html#getting-user-attributes) when granting sandboxed access.
### LDAP group membership filter

View File

@@ -1,18 +1,18 @@
## Embedding Metabase in other applications
# Embedding Metabase in other applications
Metabase includes a powerful application embedding feature that allows you to embed your saved questions or dashboards in your own web applications. You can even pass parameters to these embeds to customize them for different users.
### Key Concepts
## Key Concepts
#### Applications
### Applications
An important distinction to keep in mind is the difference between Metabase and the embedding application. The charts and dashboards you will be embedding live in the Metabase application, and will be embedded in your application (i.e. the embedding application).
#### Parameters
### Parameters
Some dashboards and questions have the ability to accept parameters. In dashboards, these are synonymous with dashboard filters. For example, if you have a dashboard with a filter on Publisher ID, this can be specified as a parameter when embedding, so that you could insert the dashboard filtered down to a specific Publisher ID.
Some dashboards and questions have the ability to accept [parameters](../users-guide/13-sql-parameters). In dashboards, these are synonymous with [dashboard filters](../users-guide/08-dashboard-filters). For example, if you have a dashboard with a filter on `Publisher ID`, this can be specified as a parameter when embedding, so that you could insert the dashboard filtered down to a specific `Publisher ID`.
SQL based questions with template variables can also accept parameters for each variable. So for a query like
SQL-based questions with template variables can also accept parameters for each variable. So for a query like:
```
SELECT count(*)
@@ -20,44 +20,44 @@ FROM orders
WHERE product_id = {% raw %}{{productID}}{% endraw %}
```
you could specify a specific productID when embedding the question.
you could specify a specific `productID` when embedding the question.
#### Signed parameters
### Signed parameters
In general, when embedding a chart or dashboard, the server of your embedding application will need to sign a request for that resource.
If you choose to sign a specific parameter value, that means the user can't modify that, nor is a filter widget displayed for that parameter. For example, if the "Publisher ID" is assigned a value and the request signed, that means the front-end client that renders that dashboard on behalf of a given logged-in user can only see information for that publisher ID.
If you choose to sign a specific parameter value, that means the user can't modify that value, nor is a filter widget displayed for that parameter. For example, if the `Publisher ID` is assigned a value and the request signed, that means the front-end client that renders that dashboard on behalf of a given logged-in user can only see information for that publisher ID.
### Enabling embedding
## Enabling embedding
To enable embedding, go to the Admin Panel and under Settings, go to the "Embedding in other applications" tab. From there, click "Enable." Here you will see a secret signing key you can use later to sign requests. If you ever need to invalidate that key and generate a new one, just click on "Regenerate Key".
To enable embedding, go to the **Admin Panel** and select **Embedding in other Applications** from the left sidebar. When you click **Enable**, you'll see an **Embedding secret key** you can use later to sign requests. If you ever need to invalidate that key and generate a new one, just click on **Regenerate key**.
![Enabling Embedding](images/embedding/01-enabling.png)
You can also see all questions and dashboards that have been marked as "Embeddable" here, as well as revoke any questions or dashboards that should no longer be embeddable in other applications.
You can also see all questions and dashboards that have been marked as embedded here, as well as revoke any questions or dashboards that should no longer be embeddable in other applications.
Once you've enabled the embedding feature on your Metabase instance, you should then go to the individual questions and dashboards you wish to embed to set them up for embedding.
Once you've enabled the embedding feature on your Metabase instance, next you'll want to set up individual questions and dashboards for embedding.
### Embedding charts and dashboards
## Embedding charts and dashboards
To make a question or dashboard embeddable, click the sharing icon on it:
To make a question or dashboard embeddable, click the **arrow icon** at the bottom right.
![Share icon](images/embedding/02-share-icon.png)
Then select "Embed this question in an application"
Then select **Embed this question in an application**.
![Enable sharing for a question](images/embedding/03-enable-question.png)
Here you will see a preview of the question or dashboard as it will appear in your application, as well as a panel that shows you the code you will need to insert in your application.
You'll see a preview of the question or dashboard as it will appear in your application, as well as a panel showing the code you'll need to insert in your application. You can alternate between the preview and code with the toggle near the top of the page.
![Preview](images/embedding/04-preview.png)
Importantly, you will need to hit "Publish" when you first set up a chart or dashboard for embedding and each time you change your embedding settings. Also, any changes you make to the resource might require you to update the code in your own application to the latest code sample in the "Code Pane".
Important: you'll need to hit **Publish** when you first set up a chart or dashboard for embedding *and* each time you change any embedding settings. Also, any changes you make to the resource may require you to update the code in your own application so that it matches the latest code sample in this panel.
![Code samples for embedding](images/embedding/05-code.png)
We provide code samples for common front end template languages as well as some common back-end web frameworks and languages. You may also use these as starting points for writing your own versions in other platforms.
Metabase provides code samples for common front-end template languages as well as some common back-end web frameworks and languages. You can also use these as starting points for writing your own versions in other platforms.
### Embedding charts and dashboards with locked parameters
## Embedding charts and dashboards with locked parameters
If you wish to have a parameter locked down to prevent your embedding application's end users from seeing other users' data, you can mark parameters as "Locked." This will prevent that parameter from being displayed as a filter widget, so its value must instead be set by the embedding application's server code.
@@ -73,7 +73,7 @@ params: {
...
```
### Hiding parameters
## Hiding parameters
If you have parameters that aren't required, but that you'd like to be hidden, instead of marking them as Locked you can use the `hide_parameters` URL option to hide one or more parameters (i.e., prevent it from showing up as a filter widget on screen). You'll want to add this option to the Metabase URL specified in your embedding iframe.
@@ -107,7 +107,7 @@ To specify multiple values for filters, though, you'll need to separate them wit
/dashboard/42?id=7&customer_name=janet
```
### Resizing dashboards to fit their content
## Resizing dashboards to fit their content
Dashboards are a fixed aspect ratio, so if you'd like to ensure they're automatically sized vertically to fit their contents you can use the [iFrame Resizer](https://github.com/davidjbradshaw/iframe-resizer) script. Metabase serves a copy for convenience:
@@ -116,7 +116,7 @@ Dashboards are a fixed aspect ratio, so if you'd like to ensure they're automati
<iframe src="http://metabase.example.com/embed/dashboard/TOKEN" onload="iFrameResize({}, this)"></iframe>
```
### Additional parameters
## Additional parameters
To change the look and feel of the embed, you can add additional parameters to the embedding URL:
@@ -124,18 +124,18 @@ To change the look and feel of the embed, you can add additional parameters to t
- **titled**: true or false. Adds or removes the title to the embedding.
- **theme**: null or night. Shows the embedded iframe in dark mode.
For example: http://yourmetabaseurl.com/embed/dashboard/a_very_huge_hashed_url#theme=night&hide_parameters=category&titled=true&bordered=false
For example:
### Reference applications
```
http://yourmetabaseurl.com/embed/dashboard/a_very_huge_hashed_url#theme=night&hide_parameters=category&titled=true&bordered=false
```
These settings can also be changed under **Style** when previewing the embedded question or dashboard and its code in Metabase.
## Reference applications
To see concrete examples of how to embed Metabase in applications under a number of common frameworks, check out our [reference implementations](https://github.com/metabase/embedding-reference-apps) on Github.
## Premium embedding
## Further reading
If you'd like to embed Metabase dashboards or charts in your application without the "Powered by Metabase" attribution, you can purchase premium embedding from the Metabase store. [Find out more here](https://store.metabase.com/product/embedding).
To learn more about embedding, check out these articles:
- [Embedding charts and dashboards](https://www.metabase.com/learn/developing-applications/advanced-metabase/embedding-charts-and-dashboards)
- [Four strategies for delivering customer-facing analytics with Metabase](https://www.metabase.com/learn/developing-applications/advanced-metabase/embedding-overview)
- [Embed Metabase in your app to deliver multi-tenant, self-service analytics](https://www.metabase.com/learn/developing-applications/advanced-metabase/multi-tenant-self-service-analytics.html)
Check out the [Embedding track](/learn/embedding) in Learn Metabase.

View File

@@ -1,26 +1,35 @@
## Caching query results in Metabase
# Caching query results
Metabase now gives you the ability to automatically cache the results of queries that take a long time to run.
### Enabling caching
## Enabling caching
To start caching your queries, head to the Settings section of the Admin Panel, and click on the `Caching` tab at the bottom of the side navigation. Then turn the caching toggle to `Enabled`.
![Caching](images/caching.png)
End-users will see a timestamp on cached questions in the top right of the question detail page showing the time when that question was last updated (i.e., the time when the current result was cached). Clicking on the `Refresh` button on a question page will manually rerun the query and override the cached result with the new result.
### Caching settings
## Caching settings
In Metabase, rather than setting cache settings manually on a per-query basis, we give you two parameters to set to automatically cache the results of long queries: the minimum average query duration, and the cache TTL multiplier.
#### Minimum query duration
### Minimum query duration
Your Metabase instance keeps track of the average query execution times of your queries, and it will cache the results of all saved questions with an average query execution time longer than the number you put in this box (in seconds).
#### Cache Time-to-live (TTL)
### Cache Time-to-live (TTL)
Instead of setting an absolute number of minutes or seconds for a cached result to persist, Metabase lets you put in a multiplier to determine the cache's TTL. Each query's cache TTL is computed by multiplying its average execution time by the number you put in this box. So if you put in `10`, a query that takes 5 seconds on average to execute will have its cache last for 50 seconds; and a query that takes 10 minutes will have a cached result lasting 100 minutes. This way, each query's cache is proportional to its execution time.
#### Max cache entry size
### Max cache entry size
Lastly, you can set the maximum size of each question's cache in kilobytes, to prevent them from taking up too much space on your server.
---
## Advanced caching controls
Paid plans ship with [additional caching options](../enterprise-guide/cache.md).
## Next: map customization
If you need to use a map tile server other than the one Metabase provides, you can find more information [on the next page](20-custom-maps.md).

View File

@@ -1,6 +1,6 @@
# Data permissions
This page covers permissions for databases and tables. If you haven't already, check out our [Permissions overview][permissons-overview].
This page covers permissions for databases and tables. If you haven't already, check out our [Permissions overview][permissions-overview].
## Permissions view
@@ -56,17 +56,16 @@ Only available in paid plans, Sandboxed access to a table can restrict access to
## Permissions and dashboard subscriptions
You don't explicitly set permissions on [dashboards subscriptions][dashboard-subscriptions], as the subscriptions are a feature of a dashboard. Which means that What you can do j
You don't explicitly set permissions on [dashboards subscriptions][dashboard-subscriptions], as the subscriptions are a feature of a dashboard. If a person is in a group that has __Curate access__ to the collection containing the dashboard, they can view and edit all subscriptions for the dashboard, including subscriptions created by other people.
If a person is in a group that has __Curate access__ to the collection containing the dashboard, they can view and edit all subscriptions for the dashboard, including subscriptions created by other people.
If a group has read-only access to a dashboard (based on its collection permissions), they can view all subscriptions for that dashboard. They can also create subscriptions and edit ones that they’ve created, but they can’t edit ones that other users created. (That last point is enforced by the BE only, the FE still needs to be updated to show the subscriptions as read-only.)
If a group has __read-only access__ to a dashboard (based on its collection permissions), they can view all subscriptions for that dashboard. They can also create subscriptions and edit ones that they’ve created, but they can’t edit ones that other users created. (That last point is enforced by the BE only, the FE still needs to be updated to show the subscriptions as read-only.)
If a group has no access to a dashboard, they can’t view any of its subscriptions, including ones that they may have created in the past, prior to having access revoked.
If you have read-only access to a dashboard, you can also unsubscribe yourself from a subscription that somebody else created via the new page in account settings.
## Further reading
- [Guide to data permissions](https://www.metabase.com/learn/organization/organization/data-permissions.html).
- [Guide to data permissions](https://www.metabase.com/learn/organization/organization/data-permissions.html)
- [Data sandboxing: setting row-level permissions][sandbox-rows]
- [Advanced data sandboxing: limiting access to columns][sandbox-columns]

View File

@@ -1,6 +1,13 @@
## Working with Google BigQuery in Metabase
# Working with Google BigQuery in Metabase
This page provides information on how to create and manage a connection to a Google [BigQuery](https://cloud.google.com/bigquery) dataset.
This page provides information on how to create and manage a connection to a Google [BigQuery](https://cloud.google.com/bigquery) dataset, including one that uses [files stored in Google Drive](https://cloud.google.com/bigquery/external-data-drive) as a data source, like Google Sheets (GSheets).
- [Prerequisites](#prerequisites)
- [Google Cloud Platform: creating a service account and JSON file](#google-cloud-platform-creating-a-service-account-and-json-file)
- [Metabase: Adding a BigQuery dataset](#metabase-adding-a-bigquery-dataset)
- [Connecting Metabase to Google Drive data sources](#connecting-metabase-to-google-drive-data-sources)
- [Using Legacy SQL](#using-legacy-sql)
## Prerequisites
@@ -22,7 +29,7 @@ To create the service account JSON file, follow Google's documentation on [setti
- BigQuery Metadata Viewer
- BigQuery Job User (distinct from BigQuery User)
For more information on **roles** in BigQuery, see [Google Cloud Platform's documentation](https://cloud.google.com/bigquery/docs/access-control).
For more information on **roles** in BigQuery, see [Google Cloud Platform's documentation](https://cloud.google.com/bigquery/docs/access-control).
4. **Create key**. Once you have assigned roles to the service account, click on the **Create Key** button, and select **JSON** for the **key type**. The JSON file will download to your computer.
@@ -34,52 +41,120 @@ Once you have created and downloaded your service account JSON file for your Big
On the **ADD DATABASE** page, select **BigQuery** from the **Database type** dropdown. Metabase will present you with the relevant configuration settings to fill out:
![images](../images/bigquery_add_database.png)
### Settings
#### Name
#### Display name
**Name** is the title of your database in Metabase.
#### Dataset ID
#### Project ID (override)
Each BigQuery dataset will have a **Dataset ID**. You can find this ID via the [Google Cloud Console](https://console.cloud.google.com/). If you're not sure where to find the **Dataset ID**, see Google's documentation on [getting information on datasets](https://cloud.google.com/bigquery/docs/dataset-metadata#getting_dataset_information).
Each BigQuery dataset will have a **Project ID**. You can find this ID via the [Google Cloud Console](https://console.cloud.google.com/). If you're not sure where to find the **Project ID**, see Google's documentation on [getting information on datasets](https://cloud.google.com/bigquery/docs/dataset-metadata#getting_dataset_information).
> When entering the **Dataset ID**, omit the Project ID prefix. For example, if your ID is `project_name:dataset_id`, only enter `dataset_id`.
> When entering the **Project ID**, omit the Project ID prefix. For example, if your ID is `project_name:project_id`, only enter `project_id`.
#### Service account JSON file
Upload the service account JSON file you created when following the [steps above](#google-cloud-platform-creating-a-service-account-and-json-file). The JSON file contains the credentials your Metabase application will need to read and query your dataset, as defined by the **roles** you added to the service account. If you need to add additional **roles**, you have to create another service account, download the JSON file, and upload the file to Metabase.
#### Datasets
Here you can specify which datasets you want to sync and scan. Options are:
- All
- Only these...
- All except...
For the Only these and All except options, you can input a comma-separated list of values to tell Metabase which datasets you want to include (or exclude). For example:
```
foo,bar,baz
```
You can use the `*` wildcard to match multiple datasets.
Let's say you have three datasets: foo, bar, and baz.
- If you have **Only these...** set, and enter the string `b*`, you'll sync with bar and baz.
- If you have **All except...** set, and enter the string `b*`, you'll just sync foo.
Note that only the `*` wildcard is supported; you can't use other special characters or regexes.
### Advanced settings
#### Use the Java Virtual Machine (JVM) timezone
_Default: Disabled_
_Default: Off_
We suggest you leave this off unless you're doing manual timezone casting in many or most of your queries with this data.
#### Automatically run queries when doing simple filtering and summarizing.
#### Include User ID and query hash in queries
_Default: Enabled_
_Default: On_
When this slider is on, Metabase will automatically run queries when users do simple explorations with the Summarize and Filter buttons when viewing a table or chart. You can turn this off if querying this database is slow. This setting doesn’t affect drill-throughs or SQL queries.
This can be useful for auditing and debugging, but prevents BigQuery from caching results and may increase your costs.
#### This is a large database, so let me choose when Metabase syncs and scans
#### Rerun queries for simple explorations
_Default: Disabled_
_Default: On_
By default, Metabase does a lightweight hourly sync and an intensive daily scan of field values. If you have a large database, we recommend turning this on and reviewing when and how often the field value scans happen.
We execute the underlying query when you explore data using Summarize or Filter. If performance is slow, you can try disabling this option to see if there's an improvement.
#### Choose when Metabase syncs and scans
_Default: Off_
Metabase does a lightweight hourly sync and an intensive daily scan of field values. If you have a large database, we recommend turning this on and reviewing when and how often the field value scans happen.
#### Periodically refingerprint tables
_Default: Off_
This enables Metabase to scan for additional field values during syncs allowing smarter behavior, like improved auto-binning on your bar charts.
#### Default reset cache duration
{% include plans-blockquote.html feature="Database-specific caching" %}
How long to keep question results. By default, Metabase will use the value you supply on the [cache settings page](../../administration-guide/14-caching.md), but if this database has other factors that influence the freshness of data, it could make sense to set a custom duration. You can also choose custom durations on individual questions or dashboards to help improve performance.
Options are:
- **Use instance default (TTL)**. TTL is time to live, meaning how long the cache remains valid before Metabase should run the query again.
- **Custom**.
If you are on a paid plan, you can also set cache duration per questions. See [Advanced caching controls](../../enterprise-guide/cache.md).
### Save your database configuration
When you're done, click the **Save** button. A modal should pop up, informing you that your database has been added.
![Database added](../images/database-added.png)
You can click on **Explore this data** to see some automatic explorations of your data, or click **I'm good thanks** to stay in the Admin Panel.
When you're done, click the **Save** button.
Give Metabase some time to sync with your BigQuery dataset, then exit Admin mode, click on **Browse Data**, find your database, and start exploring your data.
## Connecting Metabase to Google Drive data sources
To connect to a data source stored in Google Drive (like a Google Sheet) first make sure you've completed the steps above, including creating a project in Google Cloud Platform, adding a BigQuery dataset, and creating a [service account](#google-cloud-platform-creating-a-service-account-and-json-file). Then:
### Share your Google Drive source with the service account
While viewing your Drive file, (e.g., a Google Sheet), click the **Share** button in the top right. In the text box labeled **Add people or groups**, paste in the email of your service account, which you can find on the [Service Accounts page](https://console.cloud.google.com/projectselector2/iam-admin/serviceaccounts?supportedpurview=project) in the Google Cloud Console.
That email address will look something like `service-account-name@your-project-name.iam.gserviceaccount.com`, with the your service account and project names filled in accordingly.
Choose **Viewer** from the dropdown, uncheck the **Notify people** option, and click **Share**.
### Create an external table in BigQuery that points to your Google Drive source
If you don't already have a BigQuery dataset, [create one](https://cloud.google.com/bigquery/docs/datasets).
Next, using the Google Cloud Console, [create an external table](https://cloud.google.com/bigquery/external-data-drive?hl=en#creating_and_querying_a_permanent_external_table) within your BigQuery dataset that points to your Google Sheet.
Be sure to specify the correct **Drive URI** and file format.
If you haven't already [added your BigQuery dataset to Metabase](#metabase-adding-a-bigquery-dataset), go ahead and do that now.
Once you've completed these steps, you'll be able to ask questions and create dashboards in Metabase using a Google Drive source as your data.
## Using Legacy SQL
As of version 0.30.0, Metabase tells BigQuery to interpret SQL queries as [Standard SQL](https://cloud.google.com/bigquery/docs/reference/standard-sql/). If you prefer using [Legacy SQL](https://cloud.google.com/bigquery/docs/reference/legacy-sql) instead, you can tell Metabase to do so by including a `#legacySQL` directive at the beginning of your query, for example:
@@ -92,11 +167,11 @@ FROM [my_dataset.my_table]
## Troubleshooting
If you're having trouble with your BigQuery connection, you can check out this [troubleshooting guide](https://www.metabase.com/docs/latest/troubleshooting-guide/datawarehouse.html), or visit [Metabase's discussion forum](https://discourse.metabase.com/search?q=bigquery) to see if someone has encountered and resolved a similar issue.
If you're having trouble with your BigQuery connection, you can check out this [troubleshooting guide](../../troubleshooting-guide/bigquery-drive) that covers BigQuery issues, [this one](../../troubleshooting-guide/datawarehouse) on data warehouse connections, or visit [Metabase's discussion forum](https://discourse.metabase.com/search?q=bigquery) to see if someone has encountered and resolved a similar issue.
## Further reading
- [Managing databases](https://www.metabase.com/docs/latest/administration-guide/01-managing-databases.html).
- [Metadata editing](https://www.metabase.com/docs/latest/administration-guide/03-metadata-editing.html).
- [Creating segments and metrics](https://www.metabase.com/docs/latest/administration-guide/07-segments-and-metrics.html).
- [Setting data access permissions](https://www.metabase.com/docs/latest/administration-guide/05-setting-permissions.html).
- [Managing databases](https://www.metabase.com/docs/latest/administration-guide/01-managing-databases.html)
- [Metadata editing](https://www.metabase.com/docs/latest/administration-guide/03-metadata-editing.html)
- [Models](../../users-guide/models.md)
- [Setting data access permissions](https://www.metabase.com/docs/latest/administration-guide/05-setting-permissions.html)

View File

@@ -6,37 +6,76 @@ This page provides information on how to create and manage a connection to a [Go
You will need to have a [Google Cloud Platform][google-cloud] account and create the [project][google-cloud-create-project] you would like to use in Metabase. Consult the Google Cloud Platform documentation on how to [create and manage a project][google-cloud-management] if you do not have one.
## Google Cloud Platform: creating OAuth client ID
## Google Cloud Platform: creating a service account and JSON file
To get the Client ID and Client Secret you will need, follow Google's Cloud Platform Help on [how to create an OAuth client ID][google-cloud-oauth]. For application type, select "Desktop App" (this avoids a `redirect_uri_mismatch` when requesting Auth Codes).
You'll first need a [service account](https://cloud.google.com/iam/docs/service-accounts) JSON file that Metabase can
use to access your Google Analytics dataset. Service accounts are intended for non-human users (such as applications
like Metabase) to authenticate (who am I?) and authorize (what can I do?) their API calls.
To create the service account JSON file, follow Google's documentation on [setting up a service
account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) for your Google Analytics dataset.
Here's the basic flow:
1. **Create service account**. From your Google Cloud Platform project console, open the main sidebar menu on the
left, go to the **IAM & Admin** section, and select **Service account**. The console will list existing service
accounts, if any. At the top of the screen, click on **+ CREATE SERVICE ACCOUNT**.
2. **Fill out the service account details**. Name the service account, and add a description (the service account ID
will populate once you add a name). Then click the **Create** button.
3. The **Service account permissions (optional)** section is not required. Click **Continue**.
4. **Create key**. Once you have assigned roles to the service account, click on the **Create Key** button, and select
**JSON** for the **key type**. The JSON file will download to your computer.
> **You can only download the key once**. If you delete the key, you'll need to create another service account with
> the same roles.
### Adding the service account to your Google Analytics account
The newly created service account will have an email address that looks similar to:
```
my_service_account_name@my_project_id.iam.gserviceaccount.com
```
You must add this service account user to your Google Analytics account in order to use it. Add it by following the
instructions [here][google-analytics-add-user]. Only Read and Analyze permissions are needed for Metabase.
### Enabling Google Analytics API
To enable the Google Analytics API, go to <https://console.cloud.google.com/apis/api/analytics.googleapis.com/overview> in the Google Cloud Platform console. Double-check that the previously created project is selected and click on "Enable". For further documentation please refer to [Enable and disable APIs][google-enable-disable-apis].
##### Adding the API scopes
Refer to Google's Analytics API documentation to set up the required [scopes][google-oauth-scopes].
## Metabase: adding a Google Analytics Dataset
## Metabase: adding a Google Analytics dataset
In your Metabase, click on **Settings** and select "Admin" to bring up the **Admin Panel**. In the **Databases** section, click on the **Add database** button, then select "Google Analytics" from the "Database type" dropdown and fill in the configuration settings:
![images](../images/google_analytics_add_database.png)
### Settings
- **Name** is the title of your database in Metabase.
#### Display name
- To get the **Google Analytics Account ID**, go to [Google Analytics][google-analytics] and click the **Admin** cog. In the admin tab, go to the **Account Settings** section: you will find the account ID below the "Basic Settings" heading.
**Name** is the title of your database in Metabase.
- Paste the **Client ID** and **Client Secret** you created when setting up the OAuth client ID above. These credentials must be correctly associated to scopes allowing interaction with the Google Analytics API.
#### Account ID
- Once you've provided **Client ID** and **Client Secret** with valid scopes, a **Click here to get an auth code** link will appear over the **Auth Code** text box. Authorize the connection with your Google login credentials to see the Auth Code, then copy and paste the code into this box.
To get the **Google Analytics Account ID**, go to [Google Analytics][google-analytics] and click the **Admin** cog. In
the admin tab, go to the **Account Settings** section: you will find the account ID below the "Basic Settings"
heading.
- **Automatically run queries when doing simple filtering and summarizing:** When this setting is enabled (which it is by default), Metabase automatically runs queries when users do simple explorations with the Summarize and Filter buttons when viewing a table or chart. You can turn this off if you find performance is slow. This setting doesn’t affect drill-throughs or SQL queries.
#### Service account JSON file
- **This is a large database, so let me choose when Metabase syncs and scans:** When this setting is disabled (which it is by default), Metabase regularly checks the database to update its internal metadata. If you have a large database, we you can turn this on and control when and how often the field value scans happen.
Upload the service account JSON file you created when following the steps above. The JSON file contains the
credentials your Metabase application will need to read and query your dataset.
Please see the [database sync and analysis documentation][sync-docs] for more details about the two toggle settings.
### Advanced settings
- **Rerun queries for simple explorations**: When this setting is enabled (which it is by default), Metabase automatically runs queries when users do simple explorations with the Summarize and Filter buttons when viewing a table or chart. You can turn this off if you find performance is slow. This setting doesn’t affect drill-throughs or SQL queries.
- **Choose when syncs and scans happen**: When this setting is disabled (which it is by default), Metabase regularly checks the database to update its internal metadata. If you have a large database, we you can turn this on and control when and how often the field value scans happen.
- **Periodically refingerprint tables**: This setting — disabled by default — enables Metabase to scan for additional field values during syncs allowing smarter behavior, like improved auto-binning on your bar charts.
Please see the [database sync and analysis documentation][sync-docs] for more details about these toggle settings.
## Save your database configuration
@@ -45,6 +84,7 @@ When you're done, click the **Save** button. A modal dialog will inform you that
Give Metabase some time to sync with your Google Analytics dataset, then exit the **Admin Panel**, click on **Browse Data**, find your Google Analytics database, and start exploring. Once Metabase is finished syncing, you will see the names of your Properties & Apps in the data browser.
[google-analytics]: https://cloud.google.com/analytics
[google-analytics-add-user]: https://support.google.com/analytics/answer/1009702
[google-cloud]: https://cloud.google.com/
[google-cloud-create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects#creating_a_project
[google-cloud-management]: https://cloud.google.com/resource-manager/docs/creating-managing-projects

View File

@@ -14,7 +14,7 @@ Because MongoDB contains unstructured data, Metabase takes a different approach
## Connecting to MongoDB
Go to Admin -> Databases, and click the **Add database** button. Select MongoDB from the dropdown.
Go to Admin -> Databases, and click the **Add database** button. Select MongoDB from the dropdown, and enter your desired **Display name** for this database.
There are two ways to connect to MongoDB:
@@ -30,19 +30,18 @@ The default way to connect to MongoDB is to fill out your connection details in
- Port
- Username
- Password
- Authentication Database (optional database to use when authenticating)
- Authentication Database (optional)
- Additional connection string options (optional)
Additional settings:
You'll also have the option to **Use a secure connection (SSL)**. Enable SSL and paste the contents of the server's SSL certificate chain in the input text box. This option is available for this method of connection only (i.e. you cannot include a certificate when connecting with a connection string).
#### Advanced settings for direct connection
- **Use DNS SRV when connecting** Using this option requires that provided host is a FQDN. If connecting to an Atlas cluster, you might need to enable this option. If you don't know what this means, leave this disabled.
- **Use a secure connection (SSL)** Enable SSL and paste the contents of the server's SSL certificate chain in the input text box. This option is available for this method of connection only (i.e. you cannot include a certificate when connecting with a connection string).
### Using a connection string
If you'd prefer to connect to MongoDB using a [connection string](https://docs.mongodb.com/manual/reference/connection-string/),
click on **Paste a connection string**. The Metabase user interface will update with a field to paste your connection string.
If you'd prefer to connect to MongoDB using a [connection string](https://docs.mongodb.com/manual/reference/connection-string/), click on **Paste a connection string**. The Metabase user interface will update with a field to paste your connection string.
Metabase currently does NOT support the following connection string parameters:
@@ -54,9 +53,10 @@ If you need to use a certificate, connect via the [default method](#using-metaba
### Settings common to both connection options
- **Use an SSH tunnel for database connections.** Some database installations can only be accessed by connecting through an SSH bastion host. This option also provides an extra layer of security when a VPN is not available. Enabling this is usually slower than a direct connection.
- **Automatically run queries when doing simple filtering and summarizing.** When this is on, Metabase will automatically run queries when users do simple explorations with the Summarize and Filter buttons when viewing a table or chart. You can turn this off if querying this database is slow. This setting doesn’t affect drill-throughs or SQL queries.
- **This is a large database, so let me choose when Metabase syncs and scans.** By default, Metabase does a lightweight hourly sync and an intensive daily scan of field values. If you have a large database, we recommend turning this on and reviewing when and how often the field value scans happen.
- **Use an SSH tunnel**: Some database installations can only be accessed by connecting through an SSH bastion host. This option also provides an extra layer of security when a VPN is not available. Enabling this is usually slower than a direct connection.
- **Rerun queries for simple exploration**: When this is on, Metabase will automatically run queries when users do simple explorations with the Summarize and Filter buttons when viewing a table or chart. You can turn this off if querying this database is slow. This setting doesn’t affect drill-throughs or SQL queries.
- **Choose when syncs and scans happen**: By default, Metabase does a lightweight hourly sync and an intensive daily scan of field values. If you have a large database, we recommend turning this on and reviewing when and how often the field value scans happen.
- **Periodically refingerprint tables**: This setting — disabled by default — enables Metabase to scan for additional field values during syncs allowing smarter behavior, like improved auto-binning on your bar charts.
## Configuring SSL via the command line
@@ -111,4 +111,4 @@ One workaround is to include all possible keys in the first document of the coll
## Further reading
See our troubleshooting guide for [troubleshooting your connection](../../troubleshooting-guide/datawarehouse.md)
See our troubleshooting guide for [troubleshooting your connection](../../troubleshooting-guide/datawarehouse.md).

View File

@@ -1,16 +1,16 @@
## Working with MySQL in Metabase
# Working with MySQL in Metabase
This page includes some helpful info for connecting Metabase to your MySQL database.
- [Conneting to MySQL 8+ servers](#connecting-to-mysql-8-servers)
- [Unable to log in with correct credentials](#unable-to-log-in-with-correct-credentials)
- [Raising a MySQL Docker container of MySQL 8+](#raising-a-mysql-docker-container-of-mysql-8)
- [Connecting to MySQL 8+ servers](#connecting-to-mysql-8-servers)
- [Unable to log in with correct credentials](#unable-to-log-in-with-correct-credentials)
- [Raising a MySQL Docker container of MySQL 8+](#raising-a-mysql-docker-container-of-mysql-8)
### Connecting to MySQL 8+ servers
## Connecting to MySQL 8+ servers
Metabase uses the MariaDB connector to connect to MariaDB and MySQL servers. The MariaDB connector does not currently support MySQL 8's default authentication plugin, so in order to connect, you'll need to change the plugin used by the Metabase user to `mysql_native_password`: `ALTER USER 'metabase'@'%' IDENTIFIED WITH mysql_native_password BY 'thepassword';`
### Unable to log in with correct credentials
## Unable to log in with correct credentials
**How to detect this:** Metabase fails to connect to your MySQL server with the error message "Looks like the username or password is incorrect", but you're sure that the username and password is correct. You may have created the MySQL user with an allowed host other than the host you're connecting from.
@@ -31,7 +31,7 @@ FLUSH PRIVILEGES;
Remember to drop the old user: `DROP USER 'metabase'@'localhost';`.
### Raising a MySQL Docker container of MySQL 8+
## Raising a MySQL Docker container of MySQL 8+
If you are spinning up a new MySQL container, and:

View File

@@ -1,56 +1,40 @@
## Working with Oracle in Metabase
# Working with Oracle in Metabase
Starting in v0.20.0, Metabase provides a driver for connecting to Oracle databases. Under the hood, Metabase uses Oracle's JDBC driver; due to licensing restrictions, we can't
include it as part of Metabase. Luckily, downloading it yourself and making it available to Metabase is straightforward and only takes a few minutes.
## Downloading the Oracle JDBC Driver JAR
### Downloading the Oracle JDBC Driver JAR
You can download a JDBC driver from [Oracle's JDBC driver downloads page](https://www.oracle.com/technetwork/database/application-development/jdbc/downloads/index.html).
You can download the JDBC driver from [Oracle's JDBC driver downloads page](https://www.oracle.com/technetwork/database/application-development/jdbc/downloads/index.html).
Head to this page, accept the license agreement, and download `ojdbc8.jar`:
The minimum driver version should be 19c, regardless of which Java version or Oracle Database version you have.
![Oracle JDBC Download](../images/oracle_jdbc_download.png)
We recommend using the `ojdbc8.jar` JAR.
Before downloading this JAR you may need to sign up for a free account with Oracle. We have had success with the latest version at the time of this writing, 19.3 (even with older Oracle 12c databases), but any version _should_ work.
## Adding the Oracle JDBC Driver JAR to the Metabase plugins directory
### Adding the Oracle JDBC Driver JAR to the Metabase Plugins Directory
In your Metabase directory (the directory where you keep and run your metabase.jar), create a directory called `plugins` (if it doesn't already exist.
Metabase will automatically make the Oracle driver available if it finds the Oracle JDBC driver JAR in the Metabase plugins directory when it starts up.
All you need to do is create the directory, move the JAR you just downloaded into it, and restart Metabase.
Move the JAR you just downloaded (`ojdbc8.jar`) into the plugins directory, and restart Metabase. Metabase will automatically make the Oracle driver available when it starts back up.
### Connecting with SSL
## Connecting with SSL
To connect to Oracle via SSL and enable encryption, check the `Use a secure connection (SSL)` option on the connection
setup page. You can add other SSL features (including client and/or server authentication) as explained below. You can
To connect to Oracle via SSL and enable encryption, check the `Use a secure connection (SSL)` option on the connection setup page. You can add other SSL features (including client and/or server authentication) as explained below. You can
use both client and server authentication (known as mutual authentication).
#### Server authentication
### Server authentication with a truststore
To configure the client (Metabase) to authenticate the identity of the server (the Oracle server), you may need to
configure a truststore file that includes the server's root CA, so that the JVM running Metabase trusts its
certificate chain. Refer to the
[Oracle documentation](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html) on using `keytool` to
manage key and truststore files, importing certificates, etc. Once you have a truststore file ready, add the
following JVM options for Metabase:
```
-Djavax.net.ssl.trustStore=/path/to/truststore.jks
-Djavax.net.ssl.trustStoreType=JKS \
-Djavax.net.ssl.trustStorePassword=<trustStorePassword>
```
With this done, the SSL connection to Oracle will authenticate the server.
[Oracle documentation](https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html) on using `keytool` to manage key and truststore files, importing certificates, etc.
For more information on setting up a truststore for AWS RDS Oracle instances, see the
[instructions provided by Amazon](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.Options.SSL.html#Appendix.Oracle.Options.SSL.JDBC).
Note that if you require connecting to other databases using SSL, instead of creating a new truststore, as shown in
those examples, you'll probably want to add the RDS CA to your existing truststore file (likely called `cacerts`),
#### Client authentication
If you need to connect to other databases using SSL, instead of creating a new truststore, you'll probably want to add the RDS CA to your existing truststore file (likely called `cacerts`).
### Client authentication with a keystore
To configure the server (the Oracle server) to authenticate the identity of the client (Metabase), you need to
configure a keystore file that includes the client's private key. The steps are almost identical to those
above, except that you will import the client's private key into the keystore rather than a root CA into a truststore
file.
configure a keystore file that includes the client's private key. You'll import the client's private key into the keystore (rather than a root CA into a truststore file). Add the following JVM options for Metabase:
```
-Djavax.net.ssl.keyStore=/path/to/keystore.jks
@@ -58,10 +42,9 @@ file.
-Djavax.net.ssl.keyStorePassword=<keyStorePassword>
```
With this done, the Oracle server will authenticate Metabase using the private key when Metabase tries to connect over
SSL.
With this done, the Oracle server will authenticate Metabase using the private key when Metabase tries to connect over SSL.
#### When running from a JAR
## When running from a JAR
By default, the plugins directory is called `plugins`, and lives in the same directory as the Metabase JAR.
@@ -73,6 +56,6 @@ For example, if you're running Metabase from a directory called `/app/`, you sho
/app/plugins/ojdbc8.jar
```
#### When running from Docker
## When running from Docker
The process for adding plugins when running via Docker is similar, but you'll need to mount the `plugins` directory. Refer to instructions [here](../../operations-guide/running-metabase-on-docker.html#adding-external-dependencies-or-plugins) for more details.

View File

@@ -0,0 +1,62 @@
# Connecting to a PostgreSQL database
In addition to specifying the host, port, database name and user credentials for the database connection, you have the option of securing that connection.
## Use a secure connection (SSL)
### SSL Mode
PostgreSQL databases support different levels of security with their connections, with different levels of overhead.
SSL Mode options include:
- allow
- prefer
- require
- verify-ca
- verify-full
See the PostgreSQL docs for a table about the different [SSL Modes][ssl-modes], and select the option that works for you.
### SSL root certificate (PEM)
If you set the SSL Mode to either "verify-ca" or "verify-full", you'll need to specify a root certificate (PEM). You have the option of using a **Local file path** or an **Uploaded file path**. If you're on Metabase Cloud, you'll need to select **Uploaded file path** and upload your certificate.
### Authenticate client certificate
#### SSL Client Certificate (PEM)
You have the option of using a **Local file path** or an **Uploaded file path**. If you're on Metabase Cloud, you'll need to select **Uploaded file path** and upload your certificate.
#### SSL Client KEY (PKCS-8/DER or PKCS-12)
Again, you have the option of using a **Local file path** or an **Uploaded file path**. If you're on Metabase Cloud, you'll need to select **Uploaded file path** and upload your certificate.
You'll also need to input your **SSL Client Key Password**.
## Use an SSH tunnel
You can set up an SSH tunnel by supplying the tunnel host, port, tunnel username, and SSH authentication credentials, either using an SSH Key and passphrase, or a password.
For more, see [SSH tunneling in Metabase][ssh-tunnel].
## Advanced options
### Additional JDBC connection string options
Here you can add on to your connection string.
### Rerun queries for simple exploration
We execute the underlying query when you explore data using Summarize or Filter. This is on by default, but you can turn it off if performance is slow.
### Choose when syncs and scans happen
This is a lightweight process that checks for updates to this database’s schema. In most cases, you should be fine leaving this set to sync hourly.
### Periodically refingerprint tables
This enables Metabase to scan for additional field values during syncs allowing smarter behavior, like improved auto-binning on your bar charts.
[ssl-modes]: https://jdbc.postgresql.org/documentation/head/ssl-client.html
[ssh-tunnel]: ../ssh-tunnel-for-database-connections.html

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 69 KiB

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