This project is mirrored from https://github.com/metabase/metabase.
Pull mirroring updated .
- Feb 27, 2023
-
-
Mark Bastian authored
Added post-collection retrieval function `remove-other-users-personal-collections` that will filter out any personal collection that doesn't belong to the current user when the `exclude-other-user-collections=true` path param is used. Also added unit tests for both the `api/collection/` and `api/collection/tree` endpoint.
-
- Feb 23, 2023
-
-
Noah Moss authored
* new clojure migration for v1->v2 permissions * updates * fix rebase issue * fix reflection warning * fix final test and address comment about macro name * fix indentation * revert changes to defmigration macro to try to fix final test
-
- Feb 21, 2023
-
-
dpsutton authored
* Custom migrations Current syntax: specify the migration with ``` - changeSet: id: v46.00-080 author: dpsutton comment: Uppercases all Card names changes: - customChange: class: "metabase.db.custom_migrations.ReversibleUppercaseCards" ``` and in the new namespace metabase.db.custom-migrations: ```clojure (defmigration UppercaseCards (db/execute! {:update :report_card :set {:name :%upper.name}})) (def-reversible-migration ReversibleUppercaseCards (db/execute! {:update :report_card :set {:name :%upper.name}}) (db/execute! {:update :report_card :set {:name :%lower.name}})) ``` * Use db provided by liquibase * edit docstring * set *warn-on-reflection* to fix lint error & rebase --------- Co-authored-by:
Noah Moss <noahbmoss@gmail.com> Co-authored-by:
Noah Moss <32746338+noahmoss@users.noreply.github.com>
-
Nemanja Glumac authored
* Expand the glob to include TS(X) files * Use console error * Re-order imports * Print the missing files in red * Fix glob pattern * Add script to pre-commit hooks * Remove the check from CI
-
- Feb 20, 2023
-
-
Nemanja Glumac authored
-
- Feb 17, 2023
-
-
john-metabase authored
* Removes :presto driver and tests * Merges :presto-common into :presto-jdbc * Adds migration to update presto databases to presto-jdbc --------- Co-authored-by:
Cam Saul <github@camsaul.com>
-
Cam Saul authored
* Oracle Honey SQL 2 * Remove debugging function * Fix concat() * Oracle should use numbers for booleans when loading test data
-
- Feb 09, 2023
-
-
Mark Bastian authored
Upgrade to Jetty 11 via https://github.com/sunng87/ring-jetty9-adapter. Required updating from javax servlet packages to jakarta, since jakarta is newer.
-
- Feb 08, 2023
-
-
Cam Saul authored
-
- Jan 27, 2023
-
-
Case Nelson authored
* Script to copy athena jdbc jar to our maven repo Since amazon is still not putting their athena jdbc on to maven, the easiest thing for us to do is setup a maven-y s3 repo and copy their jar into it. This script allows you to run: `./bin/athena.bb <version> [--deploy]` For example: `./bin/athena.bb 2.0.35 --deploy` Will download the 2.0.35 jar from amazon's release bucket, create and update the necessary maven repo files, then upload all those files to our maven repo. It uses the jar build WITHOUT the AWS SDK. You must have `bb` (babashka), `aws` (awscli), and `shasum` commands available. You must have aws credentials available, e.g. through `aws configure` * Add comment explaining script to script * Use iterate instead of loop for find-pred Co-authored-by:
metamben <103100869+metamben@users.noreply.github.com> * Update bin/athena.bb Co-authored-by:
metamben <103100869+metamben@users.noreply.github.com> * Update bin/athena.bb Co-authored-by:
metamben <103100869+metamben@users.noreply.github.com> --------- Co-authored-by:
metamben <103100869+metamben@users.noreply.github.com>
-
- Jan 23, 2023
-
-
john-metabase authored
* Fixes MongoDB OrderedMap encoding with nippy * Removes flatland/ordered from build-drivers deps
-
- Dec 29, 2022
-
-
Noah Moss authored
* standardize ns formatting in all src/ namespaces * small fixes * test formatting * enterprise files * fix whitespace linter error * fix kondo error * bin files * reformat shared files * fix errors * fix another error * mostly fix import to use parenthesis and have it at a new line * fix wrong spacing Co-authored-by:
Ngoc Khuat <qn.khuat@gmail.com>
-
- Dec 21, 2022
-
-
john-metabase authored
* Start-of-cycle 46 basic dependency version bump Some dependencies with available major version bumps are only updated to the latest minor version of the current major version. Some additional dependencies will be updated in future PRs. * Removes commons-lang from sparksql deps exceptions * Fixes MongoDB SRV test for monger 3.6.0 * fixes SQLite datetime tests for new driver version 3.40
-
- Dec 15, 2022
-
-
john-metabase authored
-
- Dec 11, 2022
-
-
Ariya Hidayat authored
This step is taken care automatically (see `.github/workflow/release.yml`)
-
- Dec 09, 2022
-
-
Cam Saul authored
* Make Dimension unique on `field_id` and deduplicate * Fix rollback for new migrations * Don't require migration comments to contain 'added' anymore since it's part of the version ID now * Don't require 'Added <version>' in migration comments anymore * Fix SerDes test that created duplicate dimensions for one Field * Silly fix to fix MySQL 5.7
-
- Dec 08, 2022
-
-
Cam Saul authored
* ≈ [WIP] [ci skip] * Minor cleanup [ci skip] * Code cleanup. [ci skip] * Kondo in CI should fetch library configs * Bump Methodical version * Change name to `=?` * Add `#exactly` reader tag * Add `#schema` data reader * Fix dev deps indentation and add `algo.generic` * Add `approx=` * Improved version of `#approx` * Just check in third party Kondo config for now instead of fighting CI * Update test/metabase/test_runner/assert_exprs/approximately_equal_test.clj Co-authored-by:
Tim Macdonald <tim@metabase.com> * Address PR feedback and fix sequence comparison Co-authored-by:
Tim Macdonald <tim@metabase.com>
-
- Nov 30, 2022
-
-
Alexander Polyankin authored
-
- Nov 29, 2022
-
-
Cam Saul authored
* Include Amazon Athena support for dacort/metabase-athena-driver * Use Metabase Maven repo to fetch Athena driver * Copy test extensions from Damon's Athena driver repo * Some code cleanup. * Move namespaces => metabase.driver.athena * Clean up the test extensions namespace * 42 failures, 16 errors * Fix regex support; disable a few tests * Minor tweaks * Fix data-source-name * Fix :week and :day-of-week impls (mostly): 2 failures, 3 errors * Fix OFFSET, :week-of-year; skip test that has TIME column * Add Athena to CircleCI config. Don't wait for Java 11 tests to finish before driver tests. * ALL TESTS ARE PASSING! <3 * Copy fixes for https://github.com/dacort/metabase-athena-driver/issues/115; add test * We don't need to prep source files or fetch dependencies before running backend tests. * Fix Eastwood error. * Tweak CircleCI config. * Fix TIMESTAMP WITH TIME ZONE * Include the Athena/Redshift repos in the build-drivers deps.edn * Build and release scripts need to have the :mvn/repos as well * Revert change that enabled test for Presto * Un-enable failing test for Snowflake as well. * moves all is clauses into the test - previously only the first few tests were being run * Sort ns in `metabase.driver.athena-test` * Prevent athena's log4j2.properties file from becoming log config athena includes log4j2.properties top-level with the properties: ``` status = debug rootLogger.level=debug ``` And this kills our beautifully crafted logging. Set "log4j2.configurationFile" in bootstrap to our own log4j2.xml. Log4j2 looks in a few places for its logging config, the first of which is the properties file. So when the jar is loaded, log4j2 considers this a logging config change and we lose our logging. Co-authored-by:
Damon P. Cortesi <d.lifehacker@gmail.com> Co-authored-by:
Bryan Maass <bryan.maass@gmail.com> Co-authored-by:
dan sutton <dan@dpsutton.com>
-
Luis Paolini authored
-
- Nov 28, 2022
-
-
john-metabase authored
* Adds rollback where necessary to v45 migrations * Adds linter for migrations requiring rollback key * Removes unused writeback table migrations * Removes migrate down-one subcommand
-
- Nov 08, 2022
-
-
Ariya Hidayat authored
-
- Oct 20, 2022
-
-
Noah Moss authored
* fix detection of backend files when generation i18n edn * appease whitespace linter * tweak comment * fix cypress test * appease linter * Use eduction instead of threading * Update bin/i18n/test/i18n/create_artifacts/backend_test.clj Co-authored-by:
Tim Macdonald <tim@metabase.com> Co-authored-by:
Tim Macdonald <tim@metabase.com>
-
- Oct 17, 2022
-
-
Luis Paolini authored
* Replace `isomorphic-fetch` with plain `XMLHttpRequest` * Remove `isomorphic-fetch` Co-authored-by:
Nemanja <31325167+nemanjaglumac@users.noreply.github.com>
-
- Sep 27, 2022
-
-
Ariya Hidayat authored
-
- Sep 22, 2022
-
-
Cam Saul authored
* 347 errors, 34 warnings * 89 errors, 66 warnings * 63 errors, 39 warnings * 52 errors, 33 warnings * 23 errors, 22 warnings * 13 errors, 4 warnings * Fix the last few errors. * Sort Kondo config
-
- Aug 22, 2022
-
-
Cam Saul authored
* [Toucan 2 prep] Don't invoke Toucan models as functions * Some fixes * Test fixes
-
- Aug 03, 2022
-
-
Diogo Mendes authored
-
- Jul 29, 2022
-
-
Noah Moss authored
-
- Jul 22, 2022
-
-
dpsutton authored
* Readme for pot backend [ci skip] * empty commit to kick ci
-
- Jul 18, 2022
-
-
Luis Paolini authored
As the user in https://github.com/metabase/metabase/pull/14585#discussion_r922696696 quickly noticed, the key value syntax in Dockerfiles is legacy and also we shouldn't use it with more than 1 key. This didn't make any effect as the base image had our Env keys already there, but if there's a change at some point, we might end up with weird env settings
-
Jeff Bruemmer authored
-
- Jul 04, 2022
-
-
Alexander Polyankin authored
-
- Jun 29, 2022
-
-
Case Nelson authored
* WIP start of http-action execution * Some renames and safety additions while reviewing * Fixing tests and linters
-
Alexander Kiselev authored
* enable esbuild * update i8n script and unit testing babel config * split out babel loader for styled components
-
- Jun 16, 2022
-
-
jkeys089 authored
* improved support for Google Cloud SQL * upgrade `postgres-socket-factory` and add license overrides * fix license check Co-authored-by:
Cam Saul <1455846+camsaul@users.noreply.github.com>
-
dpsutton authored
Want to return non-zero on unrecognized forms so that CI can indicate when forms are added that cannot be parsed. And example of a completely valid form of `trs` that we cannot identify with this code is ```clojure ;; from driver/util.clj (-> "Cycle detected resolving dependent visible-if properties for driver {0}: {1}" (trs driver cyclic-props) (ex-info {:type qp.error-type/driver :driver driver :cyclic-visible-ifs cyclic-props}) throw) ``` The string literal is threaded into the `trs` macro, so it validates correctly but we cannot identify the literal in tooling while making the pot file. Now output of bin/i18n/update-translation-template would be the following: ```shell ❯ ./update-translation-template [BABEL] Note: The code generator has deoptimised the styling of /Users/dan/projects/work/metabase/frontend/src/cljs/cljs.pprint.js as it exceeds the max of 500KB. [BABEL] Note: The code generator has deoptimised the styling of /Users/dan/projects/work/metabase/frontend/src/cljs/cljs-runtime/cljs.core.js as it exceeds the max of 500KB. [BABEL] Note: The code generator has deoptimised the styling of /Users/dan/projects/work/metabase/frontend/src/cljs/cljs.core.js as it exceeds the max of 500KB. ~/projects/work/metabase/bin/i18n ~/projects/work/metabase Warning: environ value /Users/dan/.sdkman/candidates/java/current for key :java-home has been overwritten with /Users/dan/.sdkman/candidates/java/17.0.1-zulu/zulu-17.jdk/Contents/Home SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Created pot file at ../../locales/metabase-backend.pot Found 1396 forms for translations Grouped into 1313 distinct pot entries Found 1 forms that could not be analyzed {:file "metabase/driver/util.clj", :line 362, :original (trs driver cyclic-props), :message nil} ❯ echo $? 1 ``` and we have an exit code of 1 so that https://github.com/metabase/metabase/blob/master/.github/workflows/i18n.yml will fail in CI.
-
- Jun 10, 2022
-
-
Noah Moss authored
* allow str form as the first argument to deferred-tru * add tests and update doc strings * migrate more setting descriptions * Handle multiline translation sources ```clojure enumerate=> x (deferred-tru (str "Whether an introductory modal should be shown after the next database connection is added. " "Defaults to false if any non-default database has already finished syncing for this instance.")) enumerate=> (form->string-for-translation x) "Whether an introductory modal should be shown after the next database connection is added. Defaults to false if any non-default database has already finished syncing for this instance." ``` We get the form from `(g/grasp <file> ::translate)` which returns the `x`. And then simply pick through it for either a string literal or a call to `(str <literal>+)` Co-authored-by:
dan sutton <dan@dpsutton.com>
-
- Jun 08, 2022
-
-
dpsutton authored
* Create po template file (pot) from clojure Rather than use xgettext we can use grasp to look for translation sites. The reason to do this is twofold: Multiline Translated Strings ---------------------------- We can use multiline strings in source to aide in readability. This [PR](https://github.com/metabase/metabase/pull/22901) was abandoned because we xgettext cannot be expected to combine string literals into a single string for translation purposes. But we can certainly do that with clojure code. ```clojure (defn- form->string-for-translation "Function that turns a form into the translation string. At the moment it is just the second arg of the form. Afterwards it will need to concat string literals in a `(str \"foo\" \"bar\")` situation. " [form] (second form)) (defn- analyze-translations [roots] (map (fn [result] (let [{:keys [line _col uri]} (meta result)] {:file (strip-roots uri) :line line :message (form->string-for-translation result)})) (g/grasp roots ::translate))) ``` `form` is the literal form. So we can easily grab all of the string literals out of it and join them here in our script. The seam is already written. Then reviving the PR linked earlier would upgrade the macros to understand that string literals OR `(str <literal>+)` are acceptable clauses. Translation context ------------------- Allowing for context in our strings. The po format allows for context in the file format. ``` msgctxt "The update is about changing a record, not a timestamp" msgid "Failed to notify {0} Database {1} updated" msgstr "" ``` See [this issue](https://github.com/metabase/metabase/issues/22871#issuecomment-1146947441) for an example situation. This wouldn't help in this particular instance because it is on the Frontend though. But we could have a format like ```clojure (trs "We" (comment "This is an abbreviation for Wednesday, not the possessive 'We'")) ``` The macro strips out the `comment` form and we can use it when building our pot file. Note there is a difficulty with this though since all source strings must be unique. There can be multiple locations for each translated string. ``` ,#: /metabase/models/field_values.clj:89 ,#: /metabase/models/params/chain_filter.clj:588 msgid "Field {0} does not exist." msgstr "" ``` The leading commas are present to prevent commit message comments. But if one location has a context and the other doesn't, or even worse, if they have two different contexts, we have a quandry: we can only express one context. Probably easy to solve or warn on, but a consideration. Caught Errors ------------- The script blew up on the following form: ```clojure (-> "Cycle detected resolving dependent visible-if properties for driver {0}: {1}" (trs driver cyclic-props)) ``` No tooling could (easily) handle this properly. Our macro assertions don't see the thread. But xgettext never found this translation literal. I warn in the pot generation so we can fix this. We could also have a test running in CI checking that all translations are strings and not symbols. Fundamental Tool ---------------- The sky is the limit because of this fundamental grasp tool: ```clojure enumerate=> (first (g/grasp single-file ::translate)) (trs "Failed to notify {0} Database {1} updated" driver id) enumerate=> (meta *1) {:line 35, :column 22, :uri "file:/Users/dan/projects/work/metabase/src/metabase/driver.clj"} ``` We can find all usages of tru/trs and friends and get their entire form and location. We can easily do whatever we want after that. Verifying Translation scripts still work ---------------------------------------- You can check a single file is valid with `msgcat <input.pot> -o combined.pot`. This will throw if the file is invalid. The general script still works: ``` ❯ ./update-translation-template [BABEL] Note: The code generator has deoptimised the styling of /Users/dan/projects/work/metabase/frontend/src/cljs/cljs.pprint.js as it exceeds the max of 500KB. [BABEL] Note: The code generator has deoptimised the styling of /Users/dan/projects/work/metabase/frontend/src/cljs/cljs.core.js as it exceeds the max of 500KB. [BABEL] Note: The code generator has deoptimised the styling of /Users/dan/projects/work/metabase/frontend/src/cljs/cljs-runtime/cljs.core.js as it exceeds the max of 500KB. Warning: environ value /Users/dan/.sdkman/candidates/java/current for key :java-home has been overwritten with /Users/dan/.sdkman/candidates/java/17.0.1-zulu/zulu-17.jdk/Contents/Home SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Created pot file at ../../locales/metabase-backend.pot #<----- new line here Warning: environ value /Users/dan/.sdkman/candidates/java/current for key :java-home has been overwritten with /Users/dan/.sdkman/candidates/java/17.0.1-zulu/zulu-17.jdk/Contents/Home 2022-06-06 15:05:57,626 INFO metabase.util :: Maximum memory available to JVM: 8.0 GB Warning: protocol #'java-time.core/Amount is overwriting function abs WARNING: abs already refers to: #'clojure.core/abs in namespace: java-time.core, being replaced by: #'java-time.core/abs WARNING: abs already refers to: #'clojure.core/abs in namespace: java-time, being replaced by: #'java-time/abs 2022-06-06 15:06:01,368 WARN db.env :: WARNING: Using Metabase with an H2 application database is not recommended for production deployments. For production deployments, we highly recommend using Postgres, MySQL, or MariaDB instead. If you decide to continue to use H2, please be sure to back up the database file regularly. For more information, see https://metabase.com/docs/latest/operations-guide/migrating-from-h2.html 2022-06-06 15:06:03,594 INFO util.encryption :: Saved credentials encryption is DISABLED for this Metabase instance.
For more information, see https://metabase.com/docs/latest/operations-guide/encrypting-database-details-at-rest.html WARNING: abs already refers to: #'clojure.core/abs in namespace: taoensso.encore, being replaced by: #'taoensso.encore/abs WARNING: abs already refers to: #'clojure.core/abs in namespace: kixi.stats.math, being replaced by: #'kixi.stats.math/abs WARNING: abs already refers to: #'clojure.core/abs in namespace: kixi.stats.test, being replaced by: #'kixi.stats.math/abs WARNING: abs already refers to: #'clojure.core/abs in namespace: kixi.stats.distribution, being replaced by: #'kixi.stats.math/abs msgcat: msgid '{0} metric' is used without plural and with plural. msgcat: msgid '{0} table' is used without plural and with plural. ``` I'm not sure what the last two lines are about but I suspect they are preexisting conditions. their form from the final combined pot file (althrough again with leading commas on the filenames to prevent them from being omitted from the commit message) ``` ,#: frontend/src/metabase/admin/permissions/components/PermissionsConfirm.jsx:32 ,#: src/metabase/automagic_dashboards/core.clj ,#: target/classes/metabase/automagic_dashboards/core.clj ,#, fuzzy, javascript-format msgid "{0} table" msgid_plural "{0} tables" msgstr[0] "" "#-#-#-#-# metabase-frontend.pot #-#-#-#-#\n" "#-#-#-#-# metabase-backend.pot (metabase) #-#-#-#-#\n" msgstr[1] "#-#-#-#-# metabase-frontend.pot #-#-#-#-#\n" ... ,#: frontend/src/metabase/query_builder/components/view/QuestionDescription.jsx:24 ,#: src/metabase/automagic_dashboards/core.clj ,#: target/classes/metabase/automagic_dashboards/core.clj ,#, fuzzy, javascript-format msgid "{0} metric" msgid_plural "{0} metrics" msgstr[0] "" "#-#-#-#-# metabase-frontend.pot #-#-#-#-#\n" "#-#-#-#-# metabase-backend.pot (metabase) #-#-#-#-#\n" msgstr[1] "#-#-#-#-# metabase-frontend.pot #-#-#-#-#\n" ``` * Add drivers, one override, remove unused import import wasn't necessary forgot to check the driver sources for i18n for some reason grasp doesn't descend into ```clojure (defmacro ^:private deffingerprinter [field-type transducer] {:pre [(keyword? field-type)]} (let [field-type [field-type :Semantic/* :Relation/*]] `(defmethod fingerprinter ~field-type [field#] (with-error-handling (with-global-fingerprinter (redux/post-complete ~transducer (fn [fingerprint#] {:type {~(first field-type) fingerprint#}}))) (trs "Error generating fingerprint for {0}" (sync-util/name-for-logging field#)))))) ``` I've opened an issue on [grasp](https://github.com/borkdude/grasp/issues/28) * Use vars rather than name based matching -
metamben authored
We have already had support for server authentication based on custom certificates. This change adds support for authenticating the client based on custom client key and certificate.
-