Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Oct 13, 2020
  2. Oct 12, 2020
  3. Oct 10, 2020
    • dpsutton's avatar
      Only get substrings in fingerprinting when supported [ci drivers] (#13432) · f7b3ad6a
      dpsutton authored
      * Only get substrings in fingerprinting when supported [ci drivers]
      
      failing tests in bigquery and mongo as they don't support
      expressions.
      
      * Corrects ns form and gets driver from table def [ci drivers]
      
      getting driver from dynamic var was not reliable at this place
      
      * Move expression check into `metadata-queries/table-row-sample`
      
      debated whether caller should know that whether to pass in truncation
      options or they might "silently" be ignored. Probably best this way
      and added that information to docstring.
      Unverified
      f7b3ad6a
  4. Oct 09, 2020
    • Cam Saul's avatar
      Fix BigQuery tests [ci bigquery] (#13429) · 16ed6bbc
      Cam Saul authored
      Unverified
      16ed6bbc
    • Nemanja Glumac's avatar
      Fix Cypress flakes (#13421) · fa7db317
      Nemanja Glumac authored
      * Fix `public.cy.spec.js` flake
      
      Note in the comment clearly says that the tests are sequential. If the first one fails, it affects the others.
      That's why we were seeing 9 failed tests in this file alone.
      
      * Fix `snippet.cy.spec.js` flake
      
      In very rare occasions it happened that test runner doesn't clear the input field before it starts typing new name.
      That's how we end up with `stuff-snippetMath` instead of just `Math`.
      
      * Wait for a dashboard to update
      
      NOTE:
      - In the latest CI run click on "Category" happened before this XHR
      - due to congestion or a slow network, popover couldn't be found within 4s (Cypress started searching for it immediately after the previous click)
      
      * Fix `modal()` + "Not now" related set of flakes
      
      * Quarantine `public.cy.spec.js`
      Unverified
      fa7db317
  5. Oct 08, 2020
  6. Oct 07, 2020
    • Cam Saul's avatar
    • Cam Saul's avatar
      use new release script · c30d1475
      Cam Saul authored
      c30d1475
    • Cam Saul's avatar
      Merge pull request #13402 from metabase/merge-release-0.36.x · e3f6fa24
      Cam Saul authored
      Merge release 0.36.x
      Unverified
      e3f6fa24
    • Cam Saul's avatar
      Embedded chain filtering API endpoints (#13392) · b16e923e
      Cam Saul authored
      
      * Clean up embedding tests
      
      * Embedded versions of chain filter API endpoints
      
      * reenable chained filter endpoints on public/embedded dashboards
      
      * update params value/search endpoint for public/embed
      
      * chain filter embed endpoints need to convert between slugs <-> IDs
      
      * For public/embed endpoints, ignore current user permissions if request is authenticated
      
      Co-authored-by: default avatarPaul Rosenzweig <paul.a.rosenzweig@gmail.com>
      Unverified
      b16e923e
    • Cam Saul's avatar
      3d53845a
    • Nemanja Glumac's avatar
      Revert Cypress upgrade (v5.3.0. -> v3.8.2) (#13398) · 5ec73072
      Nemanja Glumac authored
      * Revert Cypress upgrade (v5.3.0. -> v3.8.2)
      
      Additionally needed to make all tests pass:
      * Fix Cypress flakes (cannot find "Not now" string within a modal)
      Unverified
      5ec73072
    • dpsutton's avatar
      Fixes #8396 "Postgres sync not respecting SSH tunneling" (#13391) · 8111d584
      dpsutton authored
      * Use db pool connection rather than raw details
      
      connection pool is correctly setup with ssh tunneling information (if
      any)
      
      * Don't error when getting postgres enum types
      
      this was throwing errors when we allowed our pooled connections to
      close underneath us. But this particular step just isn't important
      enough for that. If we don't have a connection available to us, let
      the more robust query stuff fail it rather than this one off
      
      * Set idleConnectionTestPeriod to 120 when ssh tunneling
      
      The ssh tunnelling apparatus needs some work. The tunnels are created
      and put in the spec details map but then this is tossed away when we
      create the pool.
      
      ```clojure
      (defn- create-pool!
        "Create a new C3P0 `ComboPooledDataSource` for connecting to the given `database`."
        [{:keys [id details], driver :engine, :as database}]
        {:pre [(map? database)]}
        (log/debug (u/format-color 'cyan (trs "Creating new connection pool for {0} database {1} ..." driver id)))
        (let [details-with-tunnel (ssh/include-ssh-tunnel details) ;; If the tunnel is disabled this returned unchanged
              spec                (connection-details->spec driver details-with-tunnel)
              properties          (data-warehouse-connection-pool-properties driver)]
          (connection-pool/connection-pool-spec spec (merge properties
                                                            (when (ssh/use-ssh-tunnel? details)
                                                              {"idleConnectionTestPeriod" 120})))))
      
      ```
      
      this is swapped into an atom of {db_id -> pooleddatasource} but this
      means we don't have the :tunnel-session and :tunnel-tracker info from
      `start-ssh-tunnel`.
      
      * Remove connection pool keys when set to nil
      
      our connection pool would end up with {db_id nil ...} for no
      reason. Add tests to ensure.
      
      This change is largely driven by the codox testing
      requirement. There's no good way to test that the ssh tunneling
      options includes
      
      (when (ssh/use-ssh-tunnel? details) {"idleConnectionTestPeriod" 120})
      
      and the test coverage checker was unhappy
      
      * Correct ns form in test file
      
      * Remove try/catch around enum types
      
      there's already error handling around this sync step so let it
      happen. The issue was that this check didn't use the correct
      connection to respect tunnelling and therefore would throw an error in
      getting enum types and fail the database sync step. That is now done
      correctly so if this step fails the other steps would as well and we
      no longer need to handle an error here specifically
      
      * Move ssh heartbeat into ssh.clj and not use jdbc
      
      jdbc had a way to test idle connections but other non-jdbc datasources
      obviously wouldn't benefit. Luckily our ssh connection can handle this
      on its own
      Unverified
      8111d584
    • Simon Belak's avatar
      SQL: sync only tables for which we have SELECT privilege (#10892) · 7e52885e
      Simon Belak authored
      
      * SQL: sync only tables for which we have SELECT privilege
      
      * More elegant tests [ci drivers]
      
      * Turn `get-tables` and `has-select-privilege?` into multimethods
      
      * Rename `get-tables` → `db-tables`
      
      * Remove debug import
      
      * Align multimethod's signature with method's
      
      * Very minor style changes
      
      [ci drivers] - drivers will fail as of now, want CI to fail this PR
      
      * Add postgres, vertica, oracle, redshift [ci drivers]
      
      * Minor refactor [ci drivers]
      
      * Fix tests: add grants to ad-hoc tables & views [ci drivers]
      
      * We don't need DatabaseMetadata any more [ci drivers]
      
      * Fix args [ci drivers]
      
      * Fix redshift result transform function [ci drivers]
      
      * Add debug data [ci all]
      
      * Don't run tests for default (always true) implementation [ci drivers]
      
      * Refactro [ci drivers]
      
      * Pass driver explicitly [ci drivers]
      
      * Pass db explicitly [ci drivers]
      
      * Add fallback if no privileges are defined [ci drivers]
      
      * Ignore errors when checking privileges [ci drivers]
      
      * Fix format [ci drivers]
      
      * Add logging [ci drivers]
      
      * Remove cruft [ci drivers]
      
      * Fix format [ci drivers]
      
      * Use sql-jdbc.conn/db->pooled-connection-spec [ci drivers]
      
      * We don't need full Database object [ci drivers]
      
      * Refactor [ci drivers]
      
      * cleanup [ci drivers]
      
      * Batched metadata queries [ci drivers]
      
      * Update tests [ci drivers]
      
      * Make linter happy [ci drivers]
      
      * Update test [ci drivers]
      
      * Quote table name to make Oracle happy [ci drivers]
      
      * Use sql.qp to generate probe query [ci drivers]
      
      * make linter happy [ci drivers]
      
      * Alias dummy in select [ci drivers]
      
      * Add MySQL, Presto, MSSQL, Snowflake [ci drivers]
      
      * Make linter happy [ci drivers]
      
      * Don't use JDBC in Presto [ci drivers]
      
      * Make probe select work in snowflake [ci drivers]
      
      * Don't needlessly use `:default` [ci drivers]
      
      * Nicer code grouping [ci drivers]
      
      * Dispatch to correct (parent) method [ci drivers]
      
      * Don't be too clever [ci drivers]
      
      * Pass driver along [ci drivers]
      
      * Better error msg [ci snowflake]
      
      * snowflake weirdness [ci snowflake]
      
      * Snowflake: pass along db name [ci snowflake]
      
      * Snowflake: more debug data [ci snowflake]
      
      * Cleanup [ci drivers]
      
      * Implement code review suggestions [ci drivers]
      
      * Test fallback path [ci drivers]
      
      * Add missing refer [ci drivers]
      
      * Move tests to individual drivers [ci drivers]
      
      * Make linter happy [ci drivers]
      
      * Fix test [ci drivers]
      
      * Fix tests [ci drivers]
      
      * Fix tests [ci drivers]
      
      * Fix tests [ci drivers]
      
      * Add vertica tests [ci drivers]
      
      * Fix tests [ci drivers]
      
      * Fix tests [ci drivers]
      
      * Fix oracle tests [ci drivers]
      
      * Fix tests [ci drivers]
      
      * Fix Presto [ci drivers]
      
      * snowflake: reuse db user [ci drivers]
      
      * Fix tests [ci drivers]
      
      * Add some doc strings [ci drivers]
      
      * Redshift: don't mess around with passwords [ci drivers]
      
      * Snowflake: reuse PUBLIC role [ci drivers]
      
      * Fix tests [ci drivers]
      
      * Further simplify [ci drivers]
      
      * [ci drivers]
      
      * Typo [ci drivers]
      
      * Reuse user [ci drivers]
      
      * Cleanup SQL [ci drivers]
      
      * Use more sql utils [ci drivers]
      
      * Presto is a lost cause [ci drivers]
      
      * Oracle: drop semicolons [ci drivers]
      
      * Oracle: use 2 users [ci oracle]
      
      * Add debug data [ci oracle]
      
      * add require [ci oracle]
      
      * Oralce: get all perms [ci oracle]
      
      * Oracle: don't setup nested users [ci oracle]
      
      * Oracle: use system user [ci drivers]
      
      * Oracle: proper cleanup [ci drivers]
      
      * Oracle is case sensitive :( [ci drivers]
      
      * snowflake: create a dummy user [ci snowflake]
      
      * Test for privilege inheritance [ci drivers]
      
      * Fix tests [ci drivers]
      
      * Fix tests [ci drivers]
      
      * Use the correct driver flag [ci drivers]
      
      * Postgres: correctly handle foreign tables [ci drivers]
      
      * Use probing [ci drivers]
      
      * Fix presto
      
      * Bring presto api in line with the rest [ci drivers]
      
      * Make linter happy [ci drivers]
      
      * Create user and give ownership [ci drivers]
      
      * Don't pollute state [ci postgres]
      
      * Remove db-specific tests [ci drivers]
      
      * Fix requires [ci drivers]
      
      * Fix indentation [ci drivers]
      
      * Refactor [ci drivers]
      
      * Fix test [ci drivers]
      
      * Make linter happy [ci drivers]
      
      * Fix presto tests [ci drivers]
      
      * Snowflake: reorder fns [ci drivers]
      
      * Typo [ci drivers]
      
      * Cleanup [ci drivers]
      
      * Account for excluded-schemas being nil [ci drivers]
      
      * Refactor [ci drivers]
      
      * Snowflake: grant select on view [ci drivers]
      
      * Fix snowflake regression [ci drivers]
      
      * Add test for `fast-active-tables` [ci drivers]
      
      Co-authored-by: default avatarWalter Leibbrandt <23798+walterl@users.noreply.github.com>
      Co-authored-by: default avatarRobert Roland <rob@metabase.com>
      Unverified
      7e52885e
    • Paul Rosenzweig's avatar
    • Robert Roland's avatar
      When a user specifies SSL explicitly, never try without it (#13304) · 9fda7f73
      Robert Roland authored
      Previously, when adding a database, we would try to connect to the
      database once with SSL, and once without. If connecting without SSL
      works, but connecting with did not, we save the database as not needing
      SSL. This ignored the SSL setting the user specified.
      
      This makes the user's setting take precedence in only allowing SSL
      connections.
      
      Resolves #13295
      Unverified
      9fda7f73
    • Cam Saul's avatar
      Fix noisy logs in tests (#13394) · 62c164e9
      Cam Saul authored
      * Fix noisy logs in tests
      
      * Fix lint error
      Unverified
      62c164e9
    • Nemanja Glumac's avatar
    • dpsutton's avatar
      Half of fix for OOM in sync (#13288) (2.1) (#13325) · 2e056031
      dpsutton authored
      * Half of fix for OOM in sync (#13288) (2.1)
      
      * truncate type/Text fields to 1234 (a distinct number we can use as a
      heuristic for longer fields if desired)
      
      * test truncation in metadata-queries-test
      
      * test that fingerprints reflect these truncations in fingerprint-test
      
      * Check database_type of text for substring of summaries #13288
      
      in pg, many types go to :type/Text which cannot have substring on
      them, such as xml, json, jsonb, etc.
      
      * Skip fingerprinting "structured" fields, take substring of text fields
      
      * "Sniff" JSON results when truncated in fingerprinting
      
      - had to move the truncation-size var due to circularity, but it most
      logically belongs in the fingerprinting namespace as that's the only
      mechanism that really should be aware of it anyways
      
      - get rid of :refer :all in a test ns
      
      - fingerprinting doesn't happen on base_type :type/Structured so add
      that to the query for fields to fingerprint
      
      * Move `table-rows-sample` truncation option into options map
      
      * Switch json fingerprinting entirely to heuristic rather than parsing
      
      - faster in all cases and accuracy is not a particular goal
      - doesn't rely on the truncation size for switching to heuristic
      
      * Derive SerializedJson and XML from :type/Structured
      
      * Fixes metadata queries test when no truncation-size provided
      
      * JSON heuristic for array of booleans
      
      - want to validate as JSON [true, false] but not [random tag]
      
      * Removes two unused deps from fingerprinters
      
      we no longer actually parse json so don't need cheshire and don't use
      clojure.string/starts-with in favor of a little descent parser
      
      * CamelCases schema name and move truncation-size to appropriate ns
      
      truncation size used to be used in the fingerprinting analysis when
      checking text for JSON (using a heuristic if it was truncated) and
      passed into the query to get table summaries. Now its only passed into
      the summaries query and the JSON recognizer in the text fingerprinter
      always uses heuristics
      
      * Fix test now that its not relying on truncation limit for heuristics
      
      previously was making a string that was the `truncation-limit` length
      to trigger the heuristics of json parsing. now we always use heuristic
      so no need to construct such a precise length string.
      Unverified
      2e056031
    • Simon Belak's avatar
      User-definable start of week implementation proposal (#13090) · d477106e
      Simon Belak authored
      
      * Add `db-start-of-week` multimethod
      
      * Update drivers & settings [ci drivers]
      
      * Use tru in setting def [ci drivers]
      
      * Remove reflections [ci drivers]
      
      * Fix migration [ci drivers]
      
      * Update adjust
      
      * Punt on adjust for now
      
      * Fix tests [ci drivers]
      
      * Fix tests [ci drivers]
      
      * Add missing args [ci drivers]
      
      * Fix tests [ci all]
      
      * Short-circuit if offset = 0 [ci drivers]
      
      * Fix week of year test [ci drivers]
      
      * h2: use iso-week [ci drivers]
      
      * Typo [ci drivers]
      
      * Add UI for setting
      
      * fix FE assumptions
      
      * Unified week-of-year [ci drivers]
      
      * Make h2 work regardless of locale [ci drivers]
      
      * h2: make `add-interval-honeysql-form` work with expression amounts [ci drivers]
      
      * Fix h2 tests [ci all]
      
      * Don't rely on int division [ci drivers]
      
      * Better week-of-year [ci drivers]
      
      * Make linter happy [ci drivers]
      
      * More celanup [ci drivers]
      
      * Typo [ci drivers]
      
      * Fix hive & snowflake [ci drivers]
      
      * Add missing require [ci drivers]
      
      * Bump hive [ci drivers]
      
      * Mongo: add week-of-year [ci all]
      
      * Druid: week-of-year [ci drivers]
      
      * Fix Mongo [ci drivers]
      
      * More fixes [ci drivers]
      
      * Fix oracle [ci drivers]
      
      * tweak copy and move the setting up
      
      * Oracle: use to_char [ci drivers]
      
      * More tests [ci drivers]
      
      * Remove unneeded migration [ci drivers]
      
      * Druid: don't be fancy with woy [ci drivers]
      
      * Remove references to `start_of_week` from tests [ci drivers]
      
      * Druid: use correct values in test [ci drivers]
      
      * More tests [ci drivers]
      
      * Typo [ci drivers]
      
      * Fix Google driver [ci drivers]
      
      Co-authored-by: default avatarPaul Rosenzweig <paul.a.rosenzweig@gmail.com>
      Co-authored-by: default avatarMaz Ameli <maz@metabase.com>
      Co-authored-by: default avatarCam Saul <github@camsaul.com>
      Unverified
      d477106e
    • Sameer Al-Sakran's avatar
      Remove Danger Zone (#13389) · 11e0a008
      Sameer Al-Sakran authored
      We haven't been using this operationally for years. It's just taking up space and adding a button to the readme.
      Unverified
      11e0a008
  7. Oct 06, 2020
  8. Oct 05, 2020
    • Paul Rosenzweig's avatar
      Dashboard interactivity: custom drill through and chained filters (#13354) · c4353a1f
      Paul Rosenzweig authored
      
      * dashboard interactivity: custom drill through and chained filters
      
      (cherry picked from commit f3ea3099da981c967fcffd5c7e318c88064c0a96)
      
      * add missing param
      
      * Better error message & test for cases where you don't have Field perms
      
      (cherry picked from commit 2ae8174c388a105170bb316b6266b900f8844c62)
      
      * Fix lint error
      
      (cherry picked from commit aa967359ecf9705f28dded2b5b30eb42ebec156e)
      
      * type another letter to avoid ordering issue
      
      (cherry picked from commit 5f285219c07eeff41b3d1fbfc091092a6ce60ed4)
      
      * fix failing cy tests
      
      (cherry picked from commit 8dbb9561a21f853a550d4ab1385fbdf142ea36e6)
      
      * update test
      
      * Fix merge
      
      * sort correctly
      
      * Fix namespace decl sorting
      
      * use another within block for the "add to dash" modal
      
      Co-authored-by: default avatarCam Saul <github@camsaul.com>
      Unverified
      c4353a1f
    • Cam Saul's avatar
      Merge release-0.36.x back into master (#13355) · 83c53e8a
      Cam Saul authored
      * Fix footer on release-0.36.x (#13287)
      
      * Repro for issue #13241 (#13252)
      
      * Add custom "hack" for cypress' broken `.type()` functionality
      (This is most likely the cause of many flakes we're experiencing in CI.
      More info can be found here: https://github.com/cypress-io/cypress/issues/5480
      
      )
      
      * Add repro for #13241 (already fixed)
      * Split and distinguish repro test from functionality validation
      
      * Add repro for #12762
      
      Enable when underlying issue is fixed and the test should pass.
      
      * Add repro for #13289 (#13300)
      
      Co-authored-by: default avatarflamber <1447303+flamber@users.noreply.github.com>
      Co-authored-by: default avatarNemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
      Unverified
      83c53e8a
    • Nemanja Glumac's avatar
      Upgrade Cypress to v5.3.0 (#13343) · d9eb1b01
      Nemanja Glumac authored
      * Upgrade Cypress to v5.3.0
      * Add Cypress test retries to the config (2 for the "run" mode and 0 for the "open" mode)
      
      Notes:
      - upgrading `@testing-library/cypress` was not possible at this point. It would almost certainly require upgrading webpack, and maybe adjusting babel settings.
      - `yarn resolutions` will not be needed once we properly upgrade weback and all libraries that have "Cypress" as a dependency
      Unverified
      d9eb1b01
    • Nemanja Glumac's avatar
      Add repro for #13069 (#13363) · 4d95d0f0
      Nemanja Glumac authored
      Tests are in stored in two separate files:
      - frontend/test/metabase/scenarios/admin/datamodel/segments.cy.spec.js and
      - frontend/test/metabase/scenarios/admin/datamodel/metrics.cy.spec.js
      Unverified
      4d95d0f0
Loading