Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Mar 12, 2021
    • Robert Roland's avatar
      Clean up sync scheduling (#15043) · 6668b4ee
      Robert Roland authored
      It's possible for the scheduler to get in a weird state if the sync
      fails while it executes.
      
      This change makes it *only* recreate a job/task if the schedule has
      changed or if it is missing. Previously, clearing the state at every
      start had bad effects if the JVM had terminated during the sync.
      
      Adds a vector of Exception classes that signal a "fatal" exception
      during sync for a specific database. If these exceptions occur, the sync
      for that database stops and will pick up next time.
      
      This will have to be expanded per driver, but I don't see a way around
      that, as each driver will have its own, unique way of failing.
      
      metabase/metabase#14817
      6668b4ee
  2. Mar 10, 2021
    • Nemanja Glumac's avatar
      Consolidate users in Cypress tests (#15058) · ef824613
      Nemanja Glumac authored
      
      * Move user groups above users
      
      * Use `email` in a user object instead of `username`
      
      * Add `createUser` function
      
      - Get rid of `makeUserObject` and store users' group membership directly within the user object
      
      * Improve `createUser` function
      
      * Add sandboxed user to the main `USERS` object
      
      * Use newly constructed `sandboxed` user in tests
      
      * Export `signInAsSandboxedUser()`
      
      * Fix function name
      
      Co-authored-by: default avatarPaul Rosenzweig <paulrosenzweig@users.noreply.github.com>
      
      * Fix linter errors
      
      * Simplify `createUser()` function
      
      * Use user attributes directly in tests
      
      * Fix broken tests
      
      * Destructure users in tests
      
      * Use double quotes
      
      * Extract Cypress user data (#15103)
      
      * Extract user data in a separate file
      
      * Convert `createUser` function to a Cypress custom command
      
      * Convert `signIn` function to a Cypress custom command
      
      * Convert `signInAsAdmin` function to a Cypress custom command
      
      * Convert `signInAsNormalUser` function to a Cypress custom command
      
      * Convert `signInAsSandboxedUser` function to a Cypress custom command
      
      * Convert `signOut` function to a Cypress custom command
      
      * Guard against user groups data falling out of sync
      
      Co-authored-by: default avatarPaul Rosenzweig <paulrosenzweig@users.noreply.github.com>
      ef824613
    • Cam Saul's avatar
    • dpsutton's avatar
      Click through migration (#15050) · dae904d6
      dpsutton authored
      * Fix click through behavior (#15014)
      
      * formatting
      
      * Safer get's, author metadata and correct added
      
      * Don't return anything if we didn't modify it
      
      * Make private and add a docstring
      
      * Generate json strings rather than long in-line versions
      
      * Docstrings and prevent migrating ones that may already be migrated
      
      * Noisier as it now merges click_behavior on top of existing
      
      * update docstring with new nesting
      
      * always keep column settings
      
      previously the script was only looking for column settings which
      included view_as or link_template. Now we always keep those columns
      and merge in the new click_behavior when those keys are present
      
      * linkTemplateText -> linkTextTemplate
      
      * Ensure dashcard goes on top of card viz settings
      
      * Update expected now that dash merges on top of card
      
      * drop columns that don't have view_as
      
      so we don't overwrite the top level stuff if there is already a
      click_behavior. That signifies that either this migration has run, or
      perhaps already has had manual intervention. An open question is if we
      extend this to the columns: if there's manual intervention do we
      really want to be mucking about in here?
      
      Also, go back to the dropping columns style.
      
      ```clojure
      (if (and ...)
          (assoc m col (merge field-settings click-behavior))
          m) ;; here we omit the column again in our reduce-kv
      ```
      
      * Fundamentally: scour card for click and merge them into dashcard
      
      reshape all click behaviors in both and merge them in.
      
      Still some broken tests at the moment
      
      * Remove old style click behavior no longer expected
      
      * fixed
      
      * Some more comments and remove some silly select keys and when-lets
      
      just compute both keys and then u/select-non-nil-keys and be done with
      it
      
      * Docstrinc additions about nil
      
      * Remove niles, test scenario #5 from flamber
      
      * Handle empties and nil _AFTER_ merging
      
      previously had taken care to punt things down to nil, collapse empty
      maps, etc. but this is a value that will merge on top of a map rather
      than with the map
      
      ```clojure
      (m/deep-merge {:a {:b :c}} {:a nil})
      {:a nil}
      ;; vs
      (m/deep-merge {:a {:b :c}} {:a {}})
      {:a {:b :c}}
      ```
      
      so let the postwalk after the merge clean up empty collections and nil
      values and let them blend as normal
      
      * Deep merge and prioritize new shape in card and dashcard
      
      ```clojure
      (m/deep-merge fixed-card
                    fixed-dashcard
                    (existing-fixed card)
                    (existing-fixed dashcard))
      ```
      
      This is the change here essentially. Fix the card and dashcard, look
      for existing new shapes on the card and dashcard as well
      
      * Don't merge existing fix from card. can't happen
      
      this change though did help out. we want to resolve when there are old
      style and new style on the same dashcard. In this case, the new style
      should persist:
      
      ```clojure
      (testing "If there is migration eligible on dash but also new style on dash, new style wins"
        (let [dash {"column_settings"
                    {"[\"ref\",[\"field-id\",4]]"
                     {"view_as"       "link"
                      "link_template" "http://old" ;; this stuff could be migrated
                      "link_text"     "old"
                      "column_title"  "column title"
                      "click_behavior"
                      {"type" "link",
                       "linkType" "url", ;; but there is already a new style and it wins
                       "linkTemplate" "http://new",
                       "linkTextTemplate" "new"}}}}]
          (is (= {"column_settings"
                  {"[\"ref\",[\"field-id\",4]]"
                   {"click_behavior"
                    {"type" "link",
                     "linkType" "url",
                     "linkTemplate" "http://new",
                     "linkTextTemplate" "new"},
                    "column_title" "column title"}}}
                 (migrate nil dash)))))
      ```
      
      note the column settings for field-id 4 have the old style and the new
      style but the result is that the new style survives. This happens from
      the `(m/deep-merge fixed-card fixed-dashcard (existing-fixed
      dashcard))` as the existing is put on top
      
      * Don't strip original values
      
      * propagate old info in migration test
      dae904d6
  3. Mar 08, 2021
  4. Mar 05, 2021
  5. Mar 03, 2021
  6. Mar 02, 2021
  7. Mar 01, 2021
  8. Feb 27, 2021
  9. Feb 26, 2021
    • Robert Roland's avatar
      Replace ExitOnOutOfMemoryError with CrashOnOutOfMemoryError (#14972) · 430d2683
      Robert Roland authored
      This will make the JVM output more details as it crashes for running out of memory.
      
      New output:
      
      ```text
      rroland@tardis:~/src/metabase/target/uberjar$ java -Xmx50m -XX:+CrashOnOutOfMemoryError -jar metabase.jar
      WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
      2021-02-25 11:38:31,689 INFO metabase.util :: Maximum memory available to JVM: 50.0 MB
      Aborting due to java.lang.OutOfMemoryError: Java heap space
      \#
      \# A fatal error has been detected by the Java Runtime Environment:
      \#
      \#  Internal Error (debug.cpp:338), pid=40255, tid=40256
      \#  fatal error: OutOfMemory encountered: Java heap space
      \#
      \# JRE version: OpenJDK Runtime Environment (11.0.10+9) (build 11.0.10+9-post-Debian-1)
      \# Java VM: OpenJDK 64-Bit Server VM (11.0.10+9-post-Debian-1, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
      \# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      \#
      \# An error report file with more information is saved as:
      \# /home/rroland/src/metabase/target/uberjar/hs_err_pid40255.log
      \#
      \# If you would like to submit a bug report, please visit:
      \#   https://bugs.debian.org/openjdk-11
      \#
      Aborted
      ```
      
      Previous output:
      
      ```text
      rroland@tardis:~/src/metabase/target/uberjar$ java -Xmx50m -XX:+ExitOnOutOfMemoryError -jar metabase.jar
      WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
      2021-02-25 11:38:46,898 INFO metabase.util :: Maximum memory available to JVM: 50.0 MB
      Terminating due to java.lang.OutOfMemoryError: Java heap space
      ```
      430d2683
    • Jeff Evans's avatar
      Fix redshift test failures (#14988) · 5bfe9c05
      Jeff Evans authored
      * Change string-operations-from-subquery to use test-data instead of sample-data, because the latter currently is incompatible with Redshift (see #14784)
      
      * Add MSSQL_MEMORY_LIMIT_MB: 1024 to CircleCI config (cherry pick of https://github.com/metabase/metabase/commit/4a714f3e21fb06fdb73b11fa7812f417b38a069e)
      5bfe9c05
    • Nemanja Glumac's avatar
    • Jeff Evans's avatar
      Fix regex-match-first operator for Postgres to work properly when run against subqueries (#14924) · cc50929e
      Jeff Evans authored
      * Fix regex-match-first operator for Postgres to work properly when run against subqueries
      
      Capture col-name at beginning of fn for :regex-match-first operator in Postgres driver to work around laziness problem (see PR #14858)
      
      Adding test
      
      * Unskip Cypress test for #14873
      cc50929e
    • Nemanja Glumac's avatar
      Add set of Cypress custom commands related to permissions API (#14948) · 8a7e54e6
      Nemanja Glumac authored
      * Add `updatePermissionsGraph` custom command
      
      * Add `updatePermissionsSchema` custom command
      
      * Add `updateCollectionGraph` custom command
      
      * Update `updatePermissionsSchemas` command
      
      This accounts for a different case sensitivity that different DBs have.
      8a7e54e6
  10. Feb 25, 2021
Loading