Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Nov 15, 2021
  2. Nov 12, 2021
  3. Nov 11, 2021
    • Jeff Evans's avatar
      Change query_cache.results column to correct blob type (#18848) · 6a40ee38
      Jeff Evans authored
      * Change query_cache.results column to correct blob type
      
      Add Liquibase changeSet to modifyDataType of query_cache.results to ${blob.type} (an idempotent operation on most DBs)
      
      Add schema migrations test to confirm, which simulates the broken app DB state, then runs the migration, then confirms the fixed type
      6a40ee38
    • dpsutton's avatar
      Nest qbnewb under /modal to allow for other modals (#18926) · 11d9bd55
      dpsutton authored
      * Nest qbnewb under /modal to allow for other modals
      
      move the api from api/user/:id/qbnewb -> api/user/:id/modal/qbnewb to
      allow for the upcoming new dismissable modal
      
      * Add additional datasetnewb route
      
      staying with the same naming scheme as qbnewb. the db field is
      is_datasetnewb, the route just takes datasetnewb.
      
      I'm not wild about the default is true, set to false, and the naming
      scheme. But will be easier to migrate and easier for FE to use if we
      continue the defaults/logic etc.
      
      * Remark on db change in migration file
      11d9bd55
  4. 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>
      b4610877
  5. Nov 03, 2021
    • Cam Saul's avatar
      Add NOT NULL constraint to Card.database_id; attempt to set database_id if possible (#18472) · 83de3e86
      Cam Saul authored
      * Drop long-unused Table.entity_name column
      
      * Add NOT NULL constraint to Card.database_id
      
      * Test fix :wrench:
      
      * Test fix :wrench:
      
      * Fix migration
      
      * Add note about H2 shell to deps.edn
      
      * Add new SQL migration to attempt to set database_id when unset
      
      * Remove data migration that is now done in Liquibase land
      
      * Oops, '$.database', not '$.database_id'
      
      * Parse ints as signed rather than unsigned just to be safe (they *might* be -1337 if they're really broken)
      
      * Don't run for H2
      
      * Update comment
      
      * Fix migration indentation
      
      * Clean namespace
      
      * Use new migration number.
      
      * Use the new migration numbers
      
      * 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:
      
      * Fix merge
      
      * Simplify precondition
      83de3e86
    • 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:
      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:
      2fee04b7
  6. Nov 02, 2021
  7. Oct 26, 2021
    • dpsutton's avatar
      Dataset schema (#18629) · 977a1765
      dpsutton authored
      * Add dataset flag to Card
      
      * Set dataset viz type to table
      
      * Include datasets in collection children
      
      * Ensure can write as dataset, include more tests
      977a1765
  8. Oct 22, 2021
  9. Oct 21, 2021
    • Jeff Evans's avatar
      Secrets :closed_lock_with_key: PR 2 - Add secret model (#17649) · 0d7786a1
      Jeff Evans authored
      Add secret model
      
      Add Liquibase migration for secret table
      
      Implement bare bones model namespace for secret
      
      Add simple test to ensure secret values are stored and retrieved under an encryption key (or not)
      
      Add :creator_id to secret model to capture the user who created this secret instance/version
      
      Support updating secret values as part of encryption key rotation
      
      Add test assertions for secret values in the `rotate-encryption-key!-test`
      0d7786a1
  10. Oct 20, 2021
  11. 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>
      2d88ae48
  12. Oct 06, 2021
  13. Sep 28, 2021
    • Howon Lee's avatar
      Audit cache controls 2 (#18046) · d7898af8
      Howon Lee authored
      Cache controls all landed but is lacking in the audit capacity wanted for in the notion doc. This PR adds that audit capability and by the by changes the ViewLog model in order to be able to deliver on the question of whether ViewLogs were cache hits or not.
      d7898af8
  14. Sep 09, 2021
  15. Sep 08, 2021
    • dpsutton's avatar
      Static viz send viz settings (#17736) · 6aba6f1e
      dpsutton authored
      * Pass along date formatting
      
      * extract and rename some things
      
      * Number formatting
      
      * Update tests
      
      * Improve test validation of svg labels
      
      * Clean up tests
      
      * Move static-viz interface file to custom file
      6aba6f1e
  16. Aug 26, 2021
    • Cam Saul's avatar
      Support building and hacking on third-party drivers with our new Clojure CLI setup (#17606) · da3a3f58
      Cam Saul authored
      * Determine MB project root directory relative to source directory of build scripts
      
      * Support calling build-driver! as a -X fn, and support dirs outside of modules/drivers
      
      * Support loading 3rd-party driver manifest files at (dev) launch
      
      * Fix log4j not working on latest version of CIDER (unrelated)
      
      * Fix dissoc
      
      * project-root-directory is supposed to be a string
      da3a3f58
  17. Aug 25, 2021
  18. Aug 24, 2021
  19. 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
      06c0017b
  20. Aug 03, 2021
    • Dalton's avatar
      Add the ability to verify/unverify questions (#17030) · b7fa2f34
      Dalton authored
      * rmv old bucm icons and remove verified fill color
      
      * add moderation action section to sidebar
      
      * add moderation review icon to the saved question header button
      
      * hide moderation section when is not a moderator
      
      * add UI for ModerationReviewBanner
      
      * Backend for moderation-review
      
      - create table moderation_review. Same as before but also has a
        "most_recent" boolean flag for the most recent moderation for easy
        lookup
      - POST /moderation-review/ . Status can be "verified" or nil
      - must be an admin to post
      - No PUT or edit route yet. Not sure if this is even
        necessary. _MAYBE_ to edit the text, but certainly not for the
        status, ids, etc. If there's to be history, let's build some history
      - Ensure we never have more than 10 reviews. Adding a new review will
        delete the older ones, mark all old ones as not `most_recent`, and
        add the newest one as `most_recent true`
      - Ensure the card actually exists before creating the mod review
      - Since admin only at this time, don't need to check moderate
        permission or view permission
      - When hydrating ensure reviews are ordered by id desc. Should mimic
        the created_at desc
      
      * fix moderation review banner tooltip offset
      
      * disable verification button when already verified
      
      * rmv iconOnly prop because it seems to do nothing
      
      * update getLatestModerationReview to rely on most_recent boolean
      
      * Return 400 on invalid status to post /moderation-review
      
      the schema was using keywords on the left hand side rather than the
      symbols. Required a change to the docstring generator, when it made a
      docstring for enums, it would call (sort (:vs enum)) and need to
      string em.
      
      * Add ModerationReview model to models.clj and copy infra
      
      * hydrate moderation reviews on cards
      
      * clean up + wire up to BE + ensure mod buttons don't show for normal users
      
      * rmv unused moderation redux logic from QuestionDetailsSidebarPanel
      
      * finish writing unit tests for FE
      
      * ensure getIconForReview returns an object
      
      * enable/disable verify button tooltip when unverified/verified
      
      * add e2e tests
      
      * fix tests
      
      * styling tweaks
      
      * more styling on moderationReviewBanner
      
      * add function for abbreviated timestamp
      
      * increase fontsize of timestamp back to 12
      
      * fix tooltip offset
      
      * ensure custom locale is separate from 'en' and not used for other languages
      
      * Deletion moderation reviews when deleting cards
      
      i had actually thought this was a much larger problem. But it turns
      out we almost never delete cards (thanks comment!). And so we won't
      really generate a lot of garbage.
      
      I was worried that since we aren't using actual foreign keys but just
      `moderated_item_type "card"` and `moderated_item_id 2` we would have
      deleted cards with these moderation reviews but that is not the case
      as the cards aren't deleted.
      
      * hide verify disabled button when a question is verified
      
      * update test to use queryByTestId
      
      * Hydrate moderation reviews on cards on ordered cards
      
      * Handle mysql's lack of offset functionality
      
      mysql cannot handle just a `offset` clause, it also needs a limit
      
      clause grammar from
      https://dev.mysql.com/doc/refman/8.0/en/select.html:
      
      [LIMIT {[offset,] row_count | row_count OFFSET offset}]
      
      select id, name from metabase_field offset 5;         -- errors
      select id, name from metabase_field limit 2 offset 5; -- works
      
      Since our numbers are so small here there is no worry and just do the
      offset in memory rather than jump through hoops for different dbs.
      
      * Batch hydrate moderation reviews
      
      * Don't let /api/user/:userId failure conceal moderation banner
      
      * fix moderation cy tests
      
      * work around possible bug in toucan hydration
      
      dashboards hydrate ordered cards
      (hydrate [:ordered_cards [:card :moderation_reviews] :series])
      
      Ordered_cards are dashboard_cards which have an optional card_id. But
      toucan hydration doesn't filter out the nils as they go down. It seems
      toucan returns a nil card, and then when hydrating the
      moderation_review, passes the collection of all "cards" including the
      nil ones into the hydration function for moderation_reviews
      
      This feels like a bug to me
      
      * Cleanup moderation warnings
      
      * Docstring in moderation review
      
      * include hoisted moderated_status on cards in collections api
      
      * Expect unverified in test :wrench:
      
      
      
      Co-authored-by: default avatardan sutton <dan@dpsutton.com>
      Co-authored-by: default avatarMaz Ameli <maz@metabase.com>
      Co-authored-by: default avataralxnddr <alxnddr@gmail.com>
      b7fa2f34
  21. Jul 12, 2021
  22. Jun 08, 2021
    • Howon Lee's avatar
      Friendly names bugfix 2 (#16482) · c00ffb45
      Howon Lee authored
      Friendly names bugfix 1 was a noop because of a typo in the WHERE clause of the DB migration. This one has been manually tested to go and sync on all 4 supported MB db's.
      c00ffb45
  23. Jun 07, 2021
  24. Jun 03, 2021
  25. Jun 02, 2021
    • dpsutton's avatar
      Authority Level on collections (formerly Typed collections) (#16191) · ad753b18
      dpsutton authored
      * Add type on collection
      
      * Search with collection type
      
      * Cleanup bounded heap accumulator
      
      * Make search conditionally bump official collection items
      
      * collection api and tests
      
      * Put collection type onto hydrated cards on dashboards
      
      * Move official collection type scoring into ee codebase
      
      * ensure ee and oss agree when not official collection
      
      * Mark Collections tree with type
      
      * Remove unnecessary `and`s when no check for enhancements
      
      * Tests for setting collection tree type
      
      * Include hydration for collection type on dashboards
      
      * Make sure created test collections are cleaned up
      
      * Cleanup tests, don't search on collection_type
      
      looks for all text fields and searches the term against that. official
      would bring back all official types. no bueno
      
      * Docstring on protocol and don't shadow comparator
      
      * update to new ee impl var passing style
      
      * Collection model ensures no type change on personal collection
      
      * Check for personal collection when updating type
      
      model checks for personal collection and rejects in the update but
      doesn't check for children of personal collection.
      
      * Update checking for unchangeable properties of a personal collection
      
      * Cleanup: type collection tree, batched hydration, combine error checks
      
      * Cleanup
      
      * move bounded-heap accumulator to utils
      
      * switch to test.check testing
      
      * Bad test just to see what our CI will report
      
      * remove purposeful failing test (was for CI)
      
      * collection.type -> collection.authority_level
      
      * Test the actual ee scoring impl, not the wrapped one
      
      locally i had enhancements enabled so the tests were passing, but in
      CI it was failing as it did not have enhancements enabled
      ad753b18
  26. May 13, 2021
  27. May 10, 2021
    • Cam Saul's avatar
      Port legacy data type migrations -> Liquibase (#15990) · 53aa2e66
      Cam Saul authored
      * Port legacy data type migrations -> Liquibase
      
      * Fix migration IDs
      
      * Fix migrations
      53aa2e66
    • Noah Moss's avatar
      Add deny list of common passwords (#15912) · dea50930
      Noah Moss authored
      * Add deny list of common passwords
      
      * replace filtered pw list with full list
      
      * switch to using a FileReader to check password line-by-line
      
      * bypass deny list if complexity is set to easy
      
      * fix tests
      
      * more test fixes and remove unneeded ns
      
      * fix typos
      
      * fix reflection warning
      
      * needed to import File
      
      * fix final tests, and update docs to reflect change
      
      * address initial review comments
      
      * fix build after removing import statement
      
      * address more review comments
      
      * use InputStreamReader to read password file in JARs
      dea50930
  28. Apr 26, 2021
  29. Apr 22, 2021
    • dpsutton's avatar
      Rename collection revision (#15616) · a88351d7
      dpsutton authored
      * Table collection_revision -> collection_permission_graph_revision
      
      in anticipation of getting collection revisions in, need the table
      name as the previous table named this was tracking changes to the
      permission graph
      
      * rename collection permission graph revision alias
      
      * Remove unnecessary or for precondition
      
      * Rename sequence in sql
      
      liquibase has a renameSequence changeset but it doesn't work for h2
      obviously. However, it doesn't allow this constraint to be honored
      with a precondition. Just having this changeset on h2 blows up
      a88351d7
  30. Apr 19, 2021
  31. Apr 15, 2021
  32. Apr 13, 2021
    • dpsutton's avatar
      Remove unixtimestamp type (#15533) · 4910a3e2
      dpsutton authored
      * Remove type/UNIX* and type/ISO8601* from frontend
      
      * Set effective-type and coercion strategy when syncing
      
      these values will most likely only be available when using tests, as
      metadata is very unlikely to have this. As far as I can tell the
      toucannery apparatus is the only bit that has this. Its quite
      artificial. I'm not sure if this is a good idea.
      
      * :type/UNIXTimestampSeconds and type/ISO8601DateTimeString out of type
      
      remove the coercions from the type hierarchy. This brought up a
      strange issue that has been present for a while: all liquidbase
      migrations run and then all data migrations run. They are not
      interleaved. This allows for the following scenario:
      
      - data migration migrates all X values to Y in version 26
      - liquibase migration migrates all Y values to Z in version 28
      
      But these are not run in version order, but all liquibase migrations
      are run and then all data migrations are run. If you were on an old
      version for a while, you could end up with Y values even though the
      liquibase migration which comes "after" the data migration turns all Y
      values into Z values.
      
      This impacts this change because a data migration in this way:
      - liquibase changesets 287, 288, 289, and 290 remove all 'type/UNIX*'
      and 'type/ISO8601*' semantic types. These were in 0.39
      - data migration `migrate-field-types` added in 0.20.0 was looking for
      special_type's of "timestamp_milliseconds" and migrating them to
      "type/UNIXTimestampMilliseconds".
      
      Since the liquibase runs before the migrate-field-types, it's possible
      for a 'type/UNIX*' semantic type to reappear. And since these were
      removed from the type system it would fail validation and blow up. In
      this case it actually can't happen since the field its attempting to
      migrate (special_type) no longer exists. But since the migrations are
      not interleaved this problem still exists.
      
      * whatever prettier
      
      * Appease the machines
      
      * Restore the unix and iso semantic types to hierarchy
      
      migration tests still use these
      `(impl/test-migrations [283 296] [migrate!] ...)`
      
      A few things in tension: the field requires valid semantic_types,
      these _were_ valid semantic_types until v39.
      
      * Remove old "coercion" semantic types
      
      * Migrate the v20 version semantic types for unix epoch
      
      * Time travelling migrations
      
      these target v20 and v29 which at the time they existed had a column
      special type not semantic type. But these run after all of the schema
      migrations, not interleaved, so they will have a semantic_type not
      special_type when they actually run even though they target v20 or v29
      data. strange world
      
      * add migration's new checksum
      4910a3e2
  33. Apr 09, 2021
  34. Apr 06, 2021
    • Tim Macdonald's avatar
      Dashboard Subscription Filtering (#15404) · ce41deaf
      Tim Macdonald authored
      
      * Backend for dashboard sub filters, including EE implementation
      
      * Fix pulse/update-notification! to respect parameters
      
      * Add some tests
      
      * add FE EE parameter section to dashboard subscriptions
      
      * fix improper filter counting for label
      
      * hide parameters section when dashboard has none
      
      * fix thrown errorin pulses list sidebar
      
      * fix linting error
      
      * add cypress tests
      
      * rmv describe.only from test
      
      * refactor FE code a little
      
      * Merge pulse/dashboard parameters correctly for dashboard subs
      
      * fix issues with getting list of active pulse parameters
      
      * update formatting of multi value parameters
      
      * fix cypress test
      
      * tweak pulse details styling
      
      * move ParametersSection to enterprise tree
      
      Co-authored-by: default avatarDalton Johnson <daltojohnso@users.noreply.github.com>
      ce41deaf
  35. Apr 01, 2021
Loading