Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Apr 07, 2022
  2. Mar 14, 2022
    • Cam Saul's avatar
      Upgrade Liquibase to latest version; remove final Java source file and need... · aaf1b601
      Cam Saul authored
      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 :wrench:
      
      * Properties for all the Quartz tables :cry:
      
      * 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
      Unverified
      aaf1b601
  3. Feb 16, 2022
  4. Feb 15, 2022
    • Cam Saul's avatar
      Upgrade Hive JDBC driver version from 1.2.2 -> 3.1.2; Bump Spark SQL from 2.1.1 to 3.2.1 (#20353) · 4dc16403
      Cam Saul authored
      * 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 :unamused:
      
      * Some minor SQL generation improvements to avoid duplicate casts
      
      * Revert change to debug test
      Unverified
      4dc16403
  5. Feb 08, 2022
    • Luis Paolini's avatar
      Fix locking in new Alpine release container (#20298) · 860ef3fa
      Luis Paolini authored
      * 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
      Unverified
      860ef3fa
  6. Feb 03, 2022
  7. Feb 01, 2022
  8. Jan 26, 2022
    • Ariya Hidayat's avatar
    • Jeff Evans's avatar
      Support overriding ROWCOUNT for SQL Server (#19267) · 802cc236
      Jeff Evans authored
      * 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)
      Unverified
      802cc236
  9. Jan 25, 2022
  10. Jan 21, 2022
  11. Jan 20, 2022
  12. Jan 12, 2022
    • Jeff Evans's avatar
      Sync multiple schemas for BigQuery (#19547) · 526594f4
      Jeff Evans authored
      Add functions to describe-database namespace for performing inclusive/exclusive schema filtering
      
      Add tests for these functions in isolation
      
      Update `:bigquery-cloud-sdk` driver and QP code to remove the single `dataset-id` conn-param
      
      Changing :bigquery-cloud-sdk` driver to use dataset inclusion/exclusion filters instead
      
      Updating `add.cy.spec.js` Cypress test to account for new structure
      
      Add data upgrade (via `driver/normalize-db-details` implementation) to change `dataset-id` property to inclusion filter
      
      Add test to confirm data upgrade
      
      Adding server side expansion of `:schema-filters` type connection property
      Unverified
      526594f4
  13. Jan 03, 2022
  14. Dec 30, 2021
  15. Dec 28, 2021
  16. Dec 26, 2021
  17. Dec 17, 2021
  18. Dec 07, 2021
    • Jeff Evans's avatar
      Add linter for metabase-plugin.yaml files (#19240) · 61828f4e
      Jeff Evans authored
      Add new deps for finding close misspellings of map keys (spell-spec) and printing more readable spec errors (expound)
      
      Adding spec definitions for driver YAML format
      
      Add call to driver YAML validation from verify.clj
      
      Fixing a couple issues in existing drivers found by the validation
      Unverified
      61828f4e
  19. Nov 23, 2021
  20. Nov 04, 2021
    • Jeff Evans's avatar
      Change all active TEXT columns in MySQL app DB to LONGTEXT (#18749) · b4610877
      Jeff Evans authored
      
      * Change all active TEXT columns in MySQL app DB to LONGTEXT
      
      Add new text.type Liquibase property to dynamically select the correct text type to use, per DB (which is LONGTEXT for MySQL), very similar to the existing blob.type one
      
      Adding new migrations that update all existing app DB TEXT columns to LONGTEXT columns, only for mariadb/mysql
      
      Update migrations linter to ensure no new text types get added, via a new predicate that searches for text types being added
      
      Do the same logic for "blob" now (should be "${blob.type}"), update rule and test
      
      Add test for migrations, that checks the new types, for all types in scope for this PR, to ensure that they have all been changed to their expected DB-specific type (either LONGTEXT for MySQL or TEXT/CLOB for others)
      
      Updating a couple migrations to remove special casing that was originally done only for MySQL to simply make them universally "${text.type}", in order to unify behavior and reduce surprises going forward
      
      Co-authored-by: default avatarCam Saul <github@camsaul.com>
      Unverified
      b4610877
  21. Nov 03, 2021
    • Cam Saul's avatar
      Add index to ModerationReview moderated_item_type + moderated_item_id (#18799) · 7d614623
      Cam Saul authored
      * Revert changes from Jeff's PR
      
      * Add index to ModerationReview moderated_item_type + moderated_item_id
      
      * Add to 0.41.2 instead
      
      * Require explicit index name for createIndex
      
      * Move 41.2 migrations to after the 41.0 migrations
      
      * Adopt new migration numbering scheme
      
      * Fix comments
      
      * Fix MySQL + MariaDB insanity
      
      * Fix ID range validation
      
      * Actually 382 is the last legacy ID
      
      * Improved validation and tests
      
      * Adopt the new-new migration ID format.
      
      * Test fixes :wrench:
      Unverified
      7d614623
    • Cam Saul's avatar
      Adopt new migration numbering scheme (#18821) · 2fee04b7
      Cam Saul authored
      * Adopt new migration numbering scheme
      
      * Fix comments
      
      * Fix MySQL + MariaDB insanity
      
      * Fix ID range validation
      
      * Actually 382 is the last legacy ID
      
      * Improved validation and tests
      
      * Adopt the new-new migration ID format.
      
      * Test fixes :wrench:
      Unverified
      2fee04b7
  22. Oct 19, 2021
    • Dennis Schridde's avatar
      Fix precondition of change set 97 (#16095) · 2d88ae48
      Dennis Schridde authored
      * Fix precondition of change set 97
      
      Without the `type` and with the space Liquibase is unable to parse this
      precondition.
      
      During `lein test` it outputs:
      ```
      [clojure-agent-send-off-pool-0] DEBUG liquibase.changelog - Running Changeset:migrations/000_migrations.yaml::97::senior
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - Changeset migrations/000_migrations.yaml::97::senior
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - Added 0.32.0
      [clojure-agent-send-off-pool-0] INFO  liquibase.changelog - Marking ChangeSet: migrations/000_migrations.yaml::97::senior ran despite precondition failure due to onFail='MARK_RAN':
                liquibase.yaml : DBMS Precondition failed: expected null, got h2
      
      [clojure-agent-send-off-pool-0] DEBUG liquibase.changelog - Skipping ChangeSet: migrations/000_migrations.yaml::97::senior
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - Executing with the 'jdbc' executor
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - 1 row(s) affected
      ```
      
      After this change the output changes to:
      ```
      [clojure-agent-send-off-pool-0] DEBUG liquibase.changelog - Running Changeset:migrations/000_migrations.yaml::97::senior
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - Changeset migrations/000_migrations.yaml::97::senior
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - Added 0.32.0
      [clojure-agent-send-off-pool-0] INFO  liquibase.changelog - Marking ChangeSet: migrations/000_migrations.yaml::97::senior ran despite precondition failure due to onFail='MARK_RAN':
                liquibase.yaml : DBMS Precondition failed: expected mysql,mariadb, got h2
      
      [clojure-agent-send-off-pool-0] DEBUG liquibase.changelog - Skipping ChangeSet: migrations/000_migrations.yaml::97::senior
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - Executing with the 'jdbc' executor
      [clojure-agent-send-off-pool-0] DEBUG liquibase.executor - 1 row(s) affected
      ```
      
      For documentation of the syntax cf.
       https://docs.liquibase.com/concepts/advanced/preconditions.html
      
      
      
      * Extend migration linter to check dbms preconditions
      
      * Also validate the `type` field of the `dbms` precondition
      
      Co-authored-by: default avatardpsutton <dan@dpsutton.com>
      Unverified
      2d88ae48
  23. Oct 04, 2021
    • Ariya Hidayat's avatar
      Rename NODE_ENV to WEBPACK_BUNDLE (#18087) · 3a67ddc1
      Ariya Hidayat authored
      NODE_ENV interferes with other tools (e.g. `yarn` won't pull
      devDependencies). Since what we need is only a flag indicating Webpack
      to bundle for production vs developement, invent our own env.
      
      This also solves the mystery of unable to call `yarn build` in the build
      script `bin/build-mb/src/build.clj`.
      Unverified
      3a67ddc1
  24. Sep 27, 2021
    • Pawit Pornkitprasan's avatar
      Fix {0} being shown when locale is "pt" (#17875) · 35651360
      Pawit Pornkitprasan authored
      This is a combination of 2 issues:
       1) pt got renamed to pt_BR in x.39.x but the old
          "pt" value may still be stored in the database
       2) when making a release, an unclean build
          directory may be used containing old "pt"
          resource which gets leaked into the release build
      
      1) is fixed by adding a function to treat "pt" as "pt_BR"
      to support users who were on "pt" since pre-x.39.
      (This is done by finding the closest fallback locale)
      
      2) is fixed by emptying the folder before generating locales
      so any old locales are deleted.
      
      Fixes #16690
      Unverified
      35651360
  25. Sep 14, 2021
    • pawit-metabase's avatar
      i18n: do not remove missing plural from translation (#17799) · b178e30e
      pawit-metabase authored
      The ttag library expect the plural array to be exactly the size as
      the number of plural forms defined in the header.
      
      If we remove empty plural, the array will have the wrong size and
      the library will crash when the trying to use the non-existent
      plural.
      
      By leaving the empty string there, the ttag library will correctly
      detect it and use the English version for the missing variant.
      
      This does not affect the backend because the backend does not
      support plurals.
      
      Fixes #16323
      Unverified
      b178e30e
  26. Sep 09, 2021
  27. Sep 01, 2021
    • Cam Saul's avatar
      Make sure built drivers do not contain clojure core classes. Handle either... · 4d4ca72f
      Cam Saul authored
      Make sure built drivers do not contain clojure core classes. Handle either string or keyword args to build scripts (#17608)
      
      * No Clojure core classes please
      
      * Don't try to make paths absolute twice. Build scripts should handle keyword args like ':driver'
      
      * parse-as-keyword should return keywords as is
      
      * Test fix :wrench:
      
      * Test fix :wrench:
      
      * Test fix part 2
      Unverified
      4d4ca72f
  28. Aug 31, 2021
  29. Aug 26, 2021
  30. Aug 25, 2021
  31. Aug 20, 2021
    • Jeff Evans's avatar
      New BigQuery Driver (#16746) · a980e085
      Jeff Evans authored
      New BigQuery Driver
      
      Create new :bigquery-cloud-sdk driver using the google-cloud-bigquery library instead, and whose source is adapted from the :bigquery driver
      
      https://cloud.google.com/bigquery/docs/reference/libraries
      
      Marking existing :bigquery driver as deprecated, and superseded-by the new one (bigquery-cloud-sdk)
      
      Update new driver and query processor code to use newer Google SDK
      
      Switch test data loading over to use new API
      
      Add project-id connection property to override the value from the service account JSON, and use it as part of qualified names in the query processor if set
      
      Updating google driver so its libraries are compatible with the newer ones used in BigQuery
      
      Update date bucketing tests to skip :bigquery-cloud-sdk (new driver) where :bigquery is skipped
      
      Update `with-bigquery-fks` to take in the driver, since there are now multiple ones
      
      Adding test to confirm that overriding project-id for a public BQ project works (sync and query)
      
      Fixing a bunch of whitespace alignment errors in tests
      Unverified
      a980e085
  32. Aug 17, 2021
    • Cam Saul's avatar
      Backend SVG rendering proof of concept [ci skip] (#15781) · bf00aa99
      Cam Saul authored
      * Backend SVG rendering proof of concept [ci skip]
      
      * Update cssbox to 5.0.0
      
      * Render bar, line, and pie charts in js to svg
      
      sparkline is now done in js, bar is now recognized and done in js, new
      :categorical/donut as well
      
      * Remove api route for render
      
      * pass along render-type, not hardcoded to :inline
      
      * Move bar chart above sparkline and remove line check
      
      In order to introduce the bar chart type need it above the sparkline
      check since it is otherwise the same except for display property of
      the card. But lots of tests assume that this will get hit with a nil
      display type set in testing so remove checking for `:line` allows all
      the testing cases to hit the right type
      
      * Fix tests now that bar graphs aren't html but images
      
      * Include attachments for bar charts
      
      * Move over to in-tree bundle
      
      * Force everything [ci noskip]
      
      trying to ensure that the built jar includes the newer
      "resources/frontend_client/app/dist/lib-static-viz.bundle.js"
      
      * Run `yarn build-static-viz` in backend-deps in CI
      
      this js file is now a hard dependency of the backend so it fits in
      this tsk. All such things that depend on the backend sources will need
      it. Makes me think perhaps we want a checked in version but i'm not
      sure yet.
      
      * Look on classpath not filesystem for js bundle [ci noskip]
      
      * Move yarn build-static-viz into the checkout step
      
      * License information for antlr4-runtime
      
      * create attachment for categorical donuts
      
      * add ordinal legend to donuts (#17177)
      
      * set widths of html image and svg image to 1200
      
      * Revert "add ordinal legend to donuts (#17177)"
      
      This reverts commit 1eb81d2e.
      
      * Helper functions to render html easily
      
      * readme in dev
      
      * readme ensure that static viz bundle exists
      
      * Cleanup ns after removing proxy
      
      * Donut chart colors and legend (#17251)
      
      * use external color map for fill per dimension
      
      * Add support new color legend for donut
      
      * Ensure text doesn't appear as link
      
      entire thing is actually the body of a link tag for emails but we want
      a decent text color rather than a default link color
      
      * use chart colors from https://stats.metabase.com/_internal/colors
      
      
      
      * Make checkers happy
      
      - remove unused imports
      - add a docstring
      - don't shadow fn with a local
      
      * cleanup ns import
      
      * Remove reflective call
      
      * Cleanup ns on correct branch
      
      Co-authored-by: default avatardan sutton <dan@dpsutton.com>
      
      * X-axis: just use (approx) 5 ticks to avoid overlapping labels (#17287)
      
      * increase gap between arcs (#17271)
      
      * Set rendering hints on html->image
      
      * ignore width for now and make them larger
      
      * Ns deprecation and some cleanup
      
      * make namespace checker happy
      
      * Simple tests for detecting chart type
      
      * Rename from poc
      
      * Tests for scalar/smartscalar
      
      * cleanup js svg namespace a bit
      
      * Tests of svg engine
      
      * ns sorting after renaming
      
      * Unify our two different js engine usages
      
      settled on the js context. Has typed returns `(.asString ^Value ...)`
      instead of perhaps capturing std out?
      https://www.graalvm.org/sdk/javadoc/org/graalvm/polyglot/Value.html
      
      
      
      Context is a bit more friendly for getting source into it. One
      downside is that the invocable bit isn't quite as nice. The old way
      would return a java.util.functionFunction but the difference is
      
      (.apply function (object-array args))
      
      vs
      
      (.execute fn-ref (object-array args))
      
      * Don't io/resource the io/resource
      
      * js engine tests
      
      * Ns cleanup in js-svg
      
      type hints in the js-engine ns mean we don't need as many classes from
      polyglot here
      
      * Cleanup of text, ns docstrings, alignment
      
      * Fix fill->fill-opacity with parsed doc, not regex
      
      * Make a single helper that loads a static viz bundle context
      
      * Docstrings and make private in js-svg
      
      * Sort imported classes in js-svg
      
      * Make width passed down through rendering aparatus
      
      - svgs are always rendered at 1200 for quality
      - slack images of html are rendered at 1200 so that they can be zoomed
        in in the ui but slack automatically scales down
      - email sends html and the full svg but includes img width tags so
        that is handled appropriately
      
      * docstring
      
      Co-authored-by: default avatardan sutton <dan@dpsutton.com>
      Co-authored-by: default avatarKyle Doherty <5248953+kdoh@users.noreply.github.com>
      Co-authored-by: default avatarAriya Hidayat <ariya@metabase.com>
      Unverified
      bf00aa99
  33. Aug 10, 2021
    • Cam Saul's avatar
      Whitespace linting (#17348) · 06c0017b
      Cam Saul authored
      * Add the whitespace linter
      
      * Fix whitespace linter errors [except for one file]
      
      * Add a line that will intentionally break stuff to verify the linter is working.
      
      * Ok, remove the line that caused the linter to fail.
      
      * Use latest version of the linter
      
      * Fix missing newline
      Unverified
      06c0017b
  34. Aug 05, 2021
  35. Aug 04, 2021
  36. Aug 03, 2021
Loading