Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Nov 17, 2021
    • dpsutton's avatar
      Add fixture warning to rebuild static viz on failures (#18995) · 0a83bd3c
      dpsutton authored
      Had wanted to make a heuristic that would look at timestamp of the
      bundle and timestamps of the sources and compare. But this could fail
      when switching branches. Simpler and easier to just throw a warning on
      all failures
      
      ```clojure
      js-svg-test=> (binding [*test-out* *out*] (run-tests))
      
      Testing metabase.pulse.render.js-svg-test
      
      FAIL in (foo) (js_svg_test.clj:28)
      [PRO TIP] If this test fails, you may need to rebuild the bundle with `yarn build-static-viz`
      
      expected: 1
        actual: 2
          diff: - 1
                + 2
      
      Ran 8 tests containing 29 assertions.
      1 failures, 0 errors.
      {:test 8, :pass 28, :fail 1, :error 0, :type :summary}
      ```
      
      For posterity, attempt using timestamps was
      
      ```clojure
      (deftest bundle-up-to-date-test
        (let [js-bundle (io/file (io/resource js-svg/bundle-path))
              to-date   (fn [epoch] (java.time.Instant/ofEpochMilli epoch))]
          (is (.exists js-bundle) bundle-recreate-warning)
          (when (.exists js-bundle)
            (let [source-files       (file-seq (io/file "frontend/src/metabase/static-viz"))
                  most-recent-source (apply max-key #(.lastModified %) source-files)]
              (is (.isAfter (to-date (.lastModified js-bundle))
                            (to-date (.lastModified most-recent-source)))
                  bundle-recreate-warning)))))
      ```
      Unverified
      0a83bd3c
    • dpsutton's avatar
      Fix flaky email tests (#19023) · b51d1788
      dpsutton authored
      Docstring for `regex-email-bodies` states:
      
      > "Return messages in the fake inbox whose body matches the
      regex(es). The body will be replaced by a map with the stringified regex
      as it's key and a boolean indicated that the regex returned results."
      
      But it does ont return messages in the fake inbox whose body matches any
      of the regex. It returns them all regardless, with information if they
      match or not. Simply correct this behavior to match the docstring
      
      ```clojure
      {"rasta@metabase.com"
       ({:from "notifications@metabase.com",
         :to #{"rasta@metabase.com"},
         :subject "We've Noticed a New Metabase Login, Rasta",
         :body {"https://metabase.com/testmb" false, "has any results" false, "My question" false}}
        {:from "notifications@metabase.com",
         :to #{"rasta@metabase.com"},
         :subject "We've Noticed a New Metabase Login, Rasta",
         :body {"https://metabase.com/testmb" false, "has any results" false, "My question" false}}
        {:from "notifications@metabase.com",
         :to #{"rasta@metabase.com"},
         :subject "You set up an alert",
         :body {"https://metabase.com/testmb" true, "has any results" true, "My question" true}})}
      ```
      Unverified
      b51d1788
    • Jeff Evans's avatar
      Secrets :closed_lock_with_key: PR 6 - Update Oracle properties (#18320) · 0480c2cc
      Jeff Evans authored
      
      * Add SSL keystore and truststore secret properties to Oracle driver YAML files
      
      
      Update Oracle driver to set keystore and truststore connection options from secret values
      
      Adding new `select-keys-sequentially` helper function for dealing with assertions on transformed conn props
      
      Add new function to the secret namespace to return a lighter weight "secret map", and remove that functionality from the `handle-db-details-secret-prop!`, so that it can be reused from connection testing
      
      Modifying CircleCI to set the corresponding truststore secret conn prop vars instead of JVM-level truststore settings, as the test had been doing previously
      
      Expand Oracle test connection details to incorporate all SSL related properties, and also make it a function instead of delayed def (so changes can be picked up later)
      
      Misc. fixes in Oracle driver YAML files
      
      Update `exception-classes-not-to-retry` to include SSLHandshakeException
      
      Fix misc issues in secret and database model code
      
      Update CircleCI config to use correct secret based env var keys and values
      
      Add *database-name-override* dynamic var in `metabase.test.data.interface` to allow for DB name overriding
      
      Fix up ssl connectivity test so all parts pass successfully
      
      Get rid of crazy with-redefs to swap in the existing test-data's schema, and instead, just dropping the DB if it was created under a different schema (similar to what H2 does)
      
      Co-authored-by: default avatarGustavo Saiani <gustavo@poe.ma>
      Unverified
      0480c2cc
    • frannietrempe's avatar
      Docs – jar install page and getCallerClass error (#19018) · fa7b5ffc
      frannietrempe authored
      
      * added links and edited headings
      
      * documented getCallerClass error
      
      * Added create directory section
      
      * Wording and spacing edits per Jeff feedback
      
      * Fixing error in ToC from last commit
      
      * punctuation and spacing
      
      Co-authored-by: default avatarft-metabase <ft-metabase@ft-metabases-MacBook-Pro.local>
      Co-authored-by: default avatarJeff Bruemmer <jeff@metabase.com>
      Unverified
      fa7b5ffc
    • Alexander Polyankin's avatar
      Unverified
      afb9a039
  2. Nov 16, 2021
  3. Nov 15, 2021
  4. Nov 12, 2021
  5. 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
      Unverified
      6a40ee38
    • Dalton's avatar
      update postcss deps (#18860) · 11cf75d7
      Dalton authored
      * update postcss deps
      
      * update the postcss config
      
      * replace color fn with color-mod fn
      
      * remove webpack-postcss-tools
      
      * fix postcss config
      
      * fix negated vars
      Unverified
      11cf75d7
    • dpsutton's avatar
      Map tiles improvements (#18912) · 1c70882b
      dpsutton authored
      * Speed up interger or string recognition
      
      jeff helpfully pointed this out. I did some repl benchmarks
      
      ```clojure
      (comment
        (doseq [x ["3" "bob"]]
          (dotimes [_ 3] (time (dotimes [_ 10000] (try (Integer/parseInt x)
                                                        (catch NumberFormatException _ x))))))
        (doseq [x ["3" "bob"]]
          (dotimes [_ 3] (time (dotimes [_ 10000] (if (re-matches #"\d+" x)
                                                    (Integer/parseInt x)
                                                    x))))))
      
      tiles-test=> (doseq [x ["3" "bob"]]
                     (dotimes [_ 3] (time (dotimes [_ 10000] (try (Integer/parseInt x)
                                                                  (catch NumberFormatException _ x))))))
      "Elapsed time: 5.72825 msecs"
      "Elapsed time: 1.531042 msecs"
      "Elapsed time: 0.797041 msecs"
      "Elapsed time: 32.120875 msecs"
      "Elapsed time: 27.848375 msecs"
      "Elapsed time: 23.820542 msecs"
      nil
      tiles-test=> (doseq [x ["3" "bob"]]
                     (dotimes [_ 3] (time (dotimes [_ 10000] (if (re-matches #"\d+" x)
                                                               (Integer/parseInt x)
                                                               x)))))
      "Elapsed time: 5.356417 msecs"
      "Elapsed time: 1.97225 msecs"
      "Elapsed time: 1.868708 msecs"
      "Elapsed time: 1.214666 msecs"
      "Elapsed time: 1.185625 msecs"
      "Elapsed time: 1.19025 msecs"
      nil
      tiles-test=>
      ```
      
      * Only select lat/lon fields in api/tiles
      
      We required the index of lat and long columns, ran the whole query, and
      then just grabbed those columns in a `(for [row rows] [(nth row
      lat-idx)..])`. But of course we can just update the fields we want to
      select in the query.
      
      MBQL and native queries flow through this codepath depending on the
      source of the query of the card being mapped. For mbql queries, it is
      straightforward, add a filter on the lat long and replace the fields
      with just lat and long fields. For native, we nest the native query as a
      nested query and then proceed on the resulting mbql query. The only
      difference is requiring the type annotation for the field type.
      
      mbql field: [:field 32 nil] vs [:field "latitude" {:base-type :type/Float}]
      
      This addresses memory concerns. The query is not limited and we don't
      need to select an entire row for these purposes. Dropping lots of text
      fields, id fields, etc could save quite a bit of memory when resolving
      the entire result set in memory.
      
      * Add limit to number of coordinates per tile
      
      these queries were unbounded in getting coordinates for each tile. But
      in a visualization, can there really be more information provided? We
      were leaving them unbounded and getting back millions of rows (reported
      on #4844). So we were adding unnecessary detail at the price of OOM
      errors.
      
      Note tests have been changed to show that the limit of the original mbql
      query is clobbered and the limit of the original native query is only
      present in the nested query whereas the outer query selects its own
      limit.
      
      As always, should this number be exposed as a setting? Configurable in
      the UI? Leaving as a hardcoded and documented number for the moment.
      
      * docstring
      
      * Remove col indices from api/tiles
      
      since we just select the actual columns we want, we no longer need the
      index in the results of those cols. they are always the first and second
      columns
      
      * Trim final slash on url
      Unverified
      1c70882b
    • 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
      Unverified
      11d9bd55
    • Alexander Polyankin's avatar
  6. Nov 10, 2021
Loading