Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Feb 11, 2021
    • Cam Saul's avatar
      Merge pull request from GHSA-jw8j-qp56-25m2 · 9c27c786
      Cam Saul authored
      
      * "regex-match-first" and "replace" operators aren't safe against SQL injection
      
      DRIVER SPECIFIC CHANGES:
      Updating Redshift driver code to use parameterized search/replace patterns for :replace, and the result of running the QUOTE_LITERAL function on the raw string for :regex-match-first
      
      Updating Redshift driver version to latest
      
      Parameterizing pattern in Postgres version of :regex-match-first implementation
      
      TESTS:
      Adding new tests to string_extracts_test.clj for ensuring :replace and :regex-match-first work with single quotes in expressions, across all DB drivers supporting those features
      
      Adding ability to pass filter into test-string-extract helper, using that from new tests
      
      Fixing typo in name of test-replace
      
      * Fixing import order in namespace declaration
      
      Adding explicit group number param of 0 for Hive-like driver (since the default is 1), when calling regexp_extract
      
      * Remove trace logging in the new test
      
      Co-authored-by: default avatarJeff Evans <jeff.evans@metabase.com>
  2. Jan 21, 2021
  3. Jan 20, 2021
  4. Oct 26, 2020
  5. Oct 23, 2020
  6. Oct 22, 2020
  7. Oct 21, 2020
  8. Oct 19, 2020
    • Cam Saul's avatar
    • dpsutton's avatar
      Smarter state fields (#13512) · d419043e
      dpsutton authored
      * Mark state fields by fingerprint fixes #2735 [ci drivers]
      
      * fix tests for pg, ns sort, and docstring lint
      
      * Expectations -> clojure.test
      
      * minor alignment in test
      
      * Allow fingerprint classifiers to override prev classifier special_type
      
      if another classifier threw on a special type due to name or the
      number of items in the collection, this should override it as it is
      introspecting values.
      
      States previously were marked ":type/State" based on the column
      name. Now use a fingerprinter looking for state names. Owing to the
      fact that there might be more things in the state column (US
      territory, canadian states, Washington DC, etc) lowered the threshold
      for recognizing a state column from 95% of values down to 70% of
      values.
      
      * Cleanup [ci drivers]
      
      - remark about original field in metadata
      - docstring on `can-edit-special-field?`
      - cleanup and check for string in `state?`
      - add tests that nils and other types don't break `state?`
      
      * Include test file
    • Robert Roland's avatar
      CI reliability improvement (#13524) · 20edf384
      Robert Roland authored
      Reduce maxWorkers count for jest, which should reduce how often we get
      ENOMEM errors in the frontend tests
    • Robert Roland's avatar
      Fix mysql build breakage (#13523) · 2c1b4305
      Robert Roland authored
      When your app db is H2, this test will fail with a NumberFormatException
      trying to parse the "not-an-integer" but the MySQL JDBC driver does not
      behave the same. It is sufficient to test exception conditions return a
      {} query description only under the H2 app-db, since it's a catch-all
      handler.
  9. Oct 16, 2020
  10. Oct 15, 2020
    • Robert Roland's avatar
      Obfuscate database details in the APIs (#13440) · 44b23fe8
      Robert Roland authored
      * Obfuscate database details in the APIs
      
      This will stop us from sending sensitive info (passwords, keys) via the
      API for authenticated administrators. Note that non-administrator users
      were never privvy to these fields.
      
      * Use cleaner form suggested by Cam
      
      * make sensitive field list a const
    • Kyle Doherty's avatar
      Tooltip constrained width (#13478) · 802dde1a
      Kyle Doherty authored
      * Fix tooltip sizing + document component (#555)
      
      * document Tooltip component
      
      * move styling to css, drop conditional based on w/c
      
      * set noSnapShotTest true since tooltips use popovers
      
      * remove max-width to fix issue with chart popover scrolling
      
      * add constrained prop to tooltip, turn off for charts
      
      * clearer prop name
      
      * only use smaller font on constrainedWidth tooltips
    • dpsutton's avatar
      Fix tests for mariadb and mysqldb [ci drivers] (#13485) · 9a6843e6
      dpsutton authored
      following template too closely with the `(parent-thunk)` call and
      forgot it was wrapped in its own thunk so i was calling it before we
      were using the result set.
  11. Oct 14, 2020
  12. Oct 13, 2020
    • Cam Saul's avatar
      Add QP middleware to auto-parse string values to correct type (backported from master) (#13443) · 6227418c
      Cam Saul authored
      * Feature/postgres cypress tests (#13311)
      
      Add Postgress tests to Cypress test suite
      
      This commit is introducing a new feature by adding a possibility to test Postgress related issues. It adds an updated CI configuration that plays nice with [Docker QA database](https://github.com/metabase/metabase-qa
      
      ) (postgress-12).
      It also adds a few repros, listed below:
      
      * Add repro for #12762
      * Add repro for #13263 (#13303)
      ---
      * Add an example for how to run metabase-qa postgres in CI
      * Add e2e test for adding/connecting PostgreSQL database (#13296)
      
      Co-authored-by: @dacort
      
      * Enable test for #13263
      
      * Better error handling for API database list endpoint for invalid drivers
      
      * Backport auto-parse-filter-values middleware [ci all]
      
      * Parse integers to Longs [ci postgres]
      
      Co-authored-by: default avatarNemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
    • dpsutton's avatar
      Handle mysql YEAR column types (Fixes #13203) [ci drivers] (#13448) · f91be1bb
      dpsutton authored
      * Handle mysql YEAR column types (Fixes #13203) [ci drivers]
      
      - year columns are very small in the db. The tricky part is how the
      driver hands them back: either as shorts or as java.sql.Dates. Our
      standard trick of reading them right into the java.time.LocalDate
      doesn't work and we instead get the java.sql.Date (which the driver
      converts from the short internal representation) or the short if
      `yearIsDateType` is configured to false.
      
      It seems to be an open question if Metabase should always consume this
      as a Date. That seems most likely but I have no idea how often this
      comes up in practice.
      
      * Add typehints [ci drivers]
      
      * Consume metadata immediately when checking for YEAR mysql column
      
      don't want to access the metadata outside of a `jdbc/with-db-metadata`
      
      * Clean up logic for YEAR column types [ci drivers]
      
      the `:else` is actually bad syntax. And handle explicitly the nil case
      and the two types it can be from getObject
      
      * Mark YEAR as :type/Date, make tests more reliable
      
      column ordering was messing up testing, so ignore the PK and just
      select the YEAR column
      
      * Use `when-let` when checking YEAR column [ci drivers]
      
      * Add tests for `table-rows-sample`
      
      really just to appease the Book of Cam® for test coverage
Loading