Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Dec 09, 2022
    • Cam Saul's avatar
      Make Dimension unique on `field_id` and deduplicate (#27062) · 622558a1
      Cam Saul authored
      * Make Dimension unique on `field_id` and deduplicate
      
      * Fix rollback for new migrations
      
      * Don't require migration comments to contain 'added' anymore since it's part of the version ID now
      
      * Don't require 'Added <version>' in migration comments anymore
      
      * Fix SerDes test that created duplicate dimensions for one Field
      
      * Silly fix to fix MySQL 5.7
      Unverified
      622558a1
  2. Dec 08, 2022
    • Cam Saul's avatar
      Add `=?` test expression type (#23982) · 43236c0a
      Cam Saul authored
      
      * ≈ [WIP] [ci skip]
      
      * Minor cleanup [ci skip]
      
      * Code cleanup. [ci skip]
      
      * Kondo in CI should fetch library configs
      
      * Bump Methodical version
      
      * Change name to `=?`
      
      * Add `#exactly` reader tag
      
      * Add `#schema` data reader
      
      * Fix dev deps indentation and add `algo.generic`
      
      * Add `approx=`
      
      * Improved version of `#approx`
      
      * Just check in third party Kondo config for now instead of fighting CI
      
      * Update test/metabase/test_runner/assert_exprs/approximately_equal_test.clj
      
      Co-authored-by: default avatarTim Macdonald <tim@metabase.com>
      
      * Address PR feedback and fix sequence comparison
      
      Co-authored-by: default avatarTim Macdonald <tim@metabase.com>
      Unverified
      43236c0a
    • metamben's avatar
      Store DBMS version in Database (#26983) · f4901387
      metamben authored
      * Store DBMS version in Database
      * Add DBMS version to anonymous stats
      * Add dbms_version sync tests
      * Add test for DBMS versions in anonymous stats
      Unverified
      f4901387
  3. Dec 06, 2022
    • Case Nelson's avatar
      Disable field value scanning for inactive fields (#26974) · 7aff9014
      Case Nelson authored
      * Disable field value scanning for inactive fields
      
      Fixes #26863
      
      Adds `last-used-at` to `metabase_fieldvalues` table.
      
      This is used to track when full FieldValues are fetched,
      which should always happen through `get-or-create-full-field-values!`
      If an inactive FieldValues is queried, they will be updated immediately
       to be returned to the user and a new last-used-at will be set so that
       sync will start picking it up.
      
      During field values sync, if `last-used-at` occurred more than 14 days
      ago, then we will no longer query and synchronize this field until it is
      queried for again.
      
      * Fix flaky test by waiting half a second for last-used-at to change
      
      * Updates from review
      
      * Remove flakiness from test by checking sync
      Unverified
      7aff9014
  4. Nov 29, 2022
    • Mahatthana (Kelvin) Nomsawadi's avatar
      Match static combo chart colors and legends with app viz colors (#26211) · c6e41b75
      Mahatthana (Kelvin) Nomsawadi authored
      * Match static combo chart colors with app viz colors
      
      * Match colors when individual series color is set
      
      * Remove tests that test colors
      
      Since colors is now determined in FE
      
      * Fix static viz Series type
      
      * Match static progress bar colors with app viz colors
      
      * Simplify Clojure code, makes it more idiomatic
      
      * Fix certain combo charts don't respect whitelabel colors
      
      * Make Clojure code more idiomatic
      
      * Fix Series type
      
      * Add colors back to static internal page
      
      * Simplify type predicate
      
      * fix colors matching for multiple series with mulitple metrics or dimensions
      
      * Handle legends not formatted in static viz in some cases
      
      * Fix failed BE tests after BE API changed
      
      * Fix failed BE tests after BE API changed
      
      * Add multiple series dashcard test to `getSeriesWithColors` test
      
      * Add `getSeriesWithLegends` tests
      
      * Fix URL `/_internal/static-viz` not loading due to API change
      
      * Correctly render legend when having dashcard title set
      
      * Simplify combo-chart API
      
      don't really need `settings-seqs` yet
      
      * Make static combo chart component type easier to understand
      
      * Address review: refactor `render-multiple-lab-chart`
      
      * Make variable names easier to understand
      
      * Simplify color API
      
      * Address review on `body.clj`
      
      * Address review, make parameter name more consistent
      
      * Fix multiple scalars not rendering
      
      * Remove unused imports
      Unverified
      c6e41b75
  5. Nov 28, 2022
  6. Nov 15, 2022
  7. Nov 08, 2022
  8. Oct 24, 2022
  9. Oct 21, 2022
    • Cam Saul's avatar
      Add `created_at` to Collection (#25871) · 7af4f706
      Cam Saul authored
      * Add created_at to Collection
      
      * Simplified migrations [ci skip]
      
      * Add SQL for H2 and MySQL; add tests
      
      * Sort namespaces
      
      * Test fixes :wrench:
      
      * Test fixes
      
      * Test fixes :wrench:
      
      * Make sure MySQL/MariaDB Liquibase generator sets the current timestamp function for ADD COLUMN
      Unverified
      7af4f706
  10. Oct 19, 2022
    • Case Nelson's avatar
      [Apps] Remove emitters (#25999) · f5a9ea85
      Case Nelson authored
      * [Apps] Remove emitters
      
      Emitters were created when we thought that we would be adding actions to
      multiple places in metabase. Instead we've coalesced to actions being a
      core feature of data-apps and are executed from within them. Attaching
      actions to models, as a form of re-use rather than a form of execution,
      means that actions can still be executed directly from a model, if we
      want to allow that in the future.
      
      * Fix lint errors
      
      * Move perform-action! tests out of the api.
      
      Since we want to keep the implicit bulk functionality but remove those
      endpoints move the tests to the actions namespace.
      
      * Fix linter
      
      * Change driver test to use function instead of endpoint
      Unverified
      f5a9ea85
    • metamben's avatar
      Use "apps" collection namespace for app collections (#25963) · a1894202
      metamben authored
      * Create app collections in the "apps" collection namespace
      
      * Add test macro for setting global app permissions for "All Users"
      
      * Introduce app permission audit table
      Unverified
      a1894202
  11. Oct 11, 2022
    • Case Nelson's avatar
      [Apps] Actions on models (#25767) · f1eb2772
      Case Nelson authored
      
      * [Apps] Model Actions
      
      Adding migration and endpoints for model_action.
      
      * model action execution
      
      Changing the execution endpoints again, still working on implicit action
      execution tests. Need to also test the parameters fetch.
      
      * Re-add execution route for dashcard action_id until Front End catches up
      
      * Add name to model_action GET
      
      * Hydrate model-action on dashcards
      
      * Rename and combine hydration of model_action to action
      
      * Implicit action execution support. Use slug columns as parameter ids
      
      * Go through model-action when using GET /action
      
      * FE integration fixes
      
      * Move action execution to use new parameter shape
      
      Now, parameters should be a map of parameter-id to value
      Parameter-id should be mapped on the FE. So the action parameter-id not the unmapped
      dashboard parameter-id.
      
      * Bring ModelAction into copy code
      
      * Generate target of implicit actions to match http actions
      
      * Update action test to place action on model
      
      * Add unique constraint to model_action for (card_id, slug)
      
      * Add missing require
      
      * model_action.slug needs to be varchar for mysql constraint
      
      * Fix test from unique constraint
      
      * Consistent ordering for tests
      
      * Addressing Code Reviews and Scaffold changes
      
      * Add type: implicit to implicit model actions
      
      * Update src/metabase/api/model_action.clj
      
      Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
      
      * Allow changing card_id with PUT to dashcard for model-actions
      
      * Update tests after merge
      
      * Fix implicit delete and add better test coverage
      
      * Addressing review changes
      
      Add PUT test
      Add schema for dashboard-id and dashcard-id params
      Fix select ordering in test
      
      * Model Actions: Frontend (#25646)
      
      * save actions in models
      
      * list model actions on detail page (#25648)
      
      * Link Dashcards to model-based actions (#25770)
      
      * Link dashcards to model-based actions
      
      * address review comments
      
      * Data apps model actions implicit creator (#25807)
      
      * Link dashcards to model-based actions
      
      * address review comments
      
      * Link dashcards to model-based actions
      
      * Allow implicit actions to be used like explicit ones
      
      * address review comments
      
      Co-authored-by: default avatarAnton Kulyk <kuliks.anton@gmail.com>
      
      Co-authored-by: default avatarmetamben <103100869+metamben@users.noreply.github.com>
      Co-authored-by: default avatarRyan Laurie <30528226+iethree@users.noreply.github.com>
      Co-authored-by: default avatarAnton Kulyk <kuliks.anton@gmail.com>
      Co-authored-by: default avatarKyle Doherty <5248953+kdoh@users.noreply.github.com>
      Unverified
      f1eb2772
    • Aleksandr Lesnenko's avatar
      Static row chart (#25829) · 23837a6f
      Aleksandr Lesnenko authored
      * support static row chart on the backend
      
      * update and add types
      
      * update types
      
      * add chart columns helper, dataset grouping
      
      * add viz settings helpers
      
      * fix text measuring
      
      * add generic row chart component for static and dynamic rendering
      
      * update deps
      
      * fix jest config for d3
      
      * allow importing cljs in static viz
      
      * add a hook for getting chart columns and series
      
      * add a static row chart
      
      * build cljs before static viz
      
      * specs
      
      * add stories, moved isomorphic row chart component to the shared folder
      
      * update import
      
      * fix backend merge
      
      * remove an extra line
      
      * one more extra line
      
      * exclude unused props from the row chart
      
      * cleanup
      
      * review
      
      * fix types
      
      * fix log scale
      
      * add visual spec, fix goal label truncate
      
      * review
      
      * fix mock path
      
      * fix specs
      Unverified
      23837a6f
  12. Oct 07, 2022
    • Mahatthana (Kelvin) Nomsawadi's avatar
      Static gauge chart (#25651) · d4cb1e5a
      Mahatthana (Kelvin) Nomsawadi authored
      * Basic static gauge chart
      
      * Add gauge segment min max labels
      
      * Add gauge segment label
      
      * Cleanup code
      
      * Fix React list key error
      
      * Remove hard-coded colors
      
      * Make the everything calculates at the gauge center
      
      * Make gauge segment data easier to understand
      
      * Example scaling chart to avoid label overflow
      
      * Avoid long labels overflow by scaling the gauge chart down
      
      * Match gauge needle color with the design
      
      * Fix hard coded gauge segment label anchor calculation
      
      * Fix static gauge chart not rotate gauge needle correctly
      
      * Add E2E for static gauge chart
      
      * Fix `transform-origin: center` not working with BE static chart
      
      * Truncate long segment label so charts can never be too small
      
      * Fix gauge segment not connected to each other
      
      * Static chart refactor part 1
      
      * Final static gauge chart refactoring
      
      * Simplify clojure chart render function
      
      * Fix relative imports
      
      * Make overlapping gauge labels more legible
      
      * Make GaugeLabelData property orders consistent
      
      * Make a function easier to read
      
      * Make the calculation more correct
      
      though the behavior would still be the same
      
      * Separate presentational component out of the Gauge component
      
      * Remove unused tap>
      
      * Fix gauge chart not working on chart tester in internal static viz page
      
      * Fix gauge chart not rendered with Lato font
      
      * Improve internal page static chart tester option clarity
      
      * Support column settings in gauge charts
      
      * Add unit tests for static gauge chart utils
      
      * Address review
      
      * Fix unittest failure
      Unverified
      d4cb1e5a
  13. Sep 29, 2022
  14. Sep 27, 2022
    • Mahatthana (Kelvin) Nomsawadi's avatar
      Waterfall data point values (#25560) · fa7338e6
      Mahatthana (Kelvin) Nomsawadi authored
      
      * Refactor static waterfall chart to use a single entrypoint
      
      * Consolidate static watetrfall chart
      
      * Update waterfall chart text size to match combo-chart
      
      * Move `<Values />` from XYChart/ to be under components/
      
      Since it'll be used by waterfall chart
      
      * Fix `<Values />` key error (forgot to add key attribute)
      
      * Show data point values on waterfall chart
      
      * Fix failed BE tests
      
      * Fix test -> wrong `waterfall-type` used. And test both types
      
      The waterfall component was changed to take a type argument, instead of having 2 functions for nearly identical
      output. The failing test just passed the wrong string to the key argument.
      
      * Change waterfall keys from strings to Clojure keys
      
      * Remove redundant test. Categorical also handled in `waterfall-test`
      
      * Fix clj-kondo lint error
      
      * Cleanup conditional statements
      
      * Miscellaneous code cleanup
      
      * Update waterfall test to render data point values
      
      * Fix waterfall chart data point values not center in the bar
      
      * Make some API for static waterfall chart with total saner
      
      Co-authored-by: default avatarAdam James <adam.vermeer2@gmail.com>
      Unverified
      fa7338e6
  15. Sep 16, 2022
  16. Sep 06, 2022
  17. Aug 25, 2022
    • Case Nelson's avatar
      [App] Add action_id to dashcard and endpoint for execution (#25001) · fa6ee214
      Case Nelson authored
      * [App] Add action_id to dashcard and endpoint for execution
      
      With app forms, we will be inlining action execution. So this PR is in
      preparation for that inlining and removing the need for createing
      Emitters in order to execute actions.
      
      Mirrors card querying from dashcards. This expects parameter_mappings
      of the dashboardcard to hold the mappings for execution, in the same
      shape as other dashcards. Instead of referencing a card_id, we reference
      an action_id.
      
      Emitters may be removed entirely in a future PR.
      
      * Fix extra require lint
      
      * Add checks for superuser and feature enabled to execution route. Fix code review comments
      
      * Add missing comment to migration
      Unverified
      fa6ee214
    • metamben's avatar
      Unverified
      f98a8613
  18. Aug 23, 2022
  19. Aug 22, 2022
  20. Aug 18, 2022
    • Aleksandr Lesnenko's avatar
      fix static viz waterfall colors (#24852) · 8c225418
      Aleksandr Lesnenko authored
      
      * fix static viz waterfall colors
      
      * tests
      
      * Pass colors into StaticChart as third argument
      
      This might not be the best design, so changes are welcome, but I added this to properly consider the case where the
      application-colors are different, but the chart has no viz-settings: application-colors were being ignored (as they
      were passed into options, but not pulled out of options into the colors arg).
      
      * review
      
      Co-authored-by: default avatarAdam James <adam.vermeer2@gmail.com>
      Unverified
      8c225418
  21. Aug 10, 2022
    • Case Nelson's avatar
      [Actions] Simplify emitter schema model (#24570) · 98bbb001
      Case Nelson authored
      * Move writeback migrations to 45
      
      * Empty commit to trigger GitHub Actions
      
      * [Actions] Simplify emitter schema model
      
      emitter_action was dropped since emitters just have a singular action
      and the join table was unecessary.
      
      emitter_action.action_id columns moved onto emitter table.
      
      Dropped CardEmitter and DashboardEmitter pre-insert, pre-update,
      pre-delete since they were used in tests only and normal operation
      would see the emitter inserted first.
      
      Since previous code may have 'orphaned' emitters without an action, we
      delete emitters without action to be safe.
      
      * Handle flakiness with geojson java.net.UnknownHostException errors (#24523)
      
      * Handle flakiness with geojson java.net.UnknownHostException errors
      
      In CI seems like we are getting errant errors:
      
      ```clojure
      geojson.clj:62
      It validates URLs and files appropriately
      http://0xc0000200
      expected: (valid? geojson)
        actual: #error {
       :cause "Invalid IP address literal: 0xc0000200"
       :via
       [{:type clojure.lang.ExceptionInfo
         :message "Invalid GeoJSON file location: must either start with http:// or https:// or be a relative path to a file on the classpath. URLs referring to hosts that supply internal hosting metadata are prohibited."
         :data {:status-code 400, :url "http://0xc0000200"}
         :at [metabase.api.geojson$valid_url_QMARK_ invokeStatic "geojson.clj" 62]}
        {:type java.net.UnknownHostException
         :message "0xc0000200"
         :at [java.net.InetAddress getAllByName "InetAddress.java" 1340]}
        {:type java.lang.IllegalArgumentException
         :message "Invalid IP address literal: 0xc0000200"
         :at [sun.net.util.IPAddressUtil validateNumericFormatV4 "IPAddressUtil.java" 150]}]
      ```
      
      Not clear if this change has a hope of fixing it: if it doesn't resolve
      once its possible it is cached somewhere in the network stack, or it
      won't resolve if you ask again.
      
      But gonna give it a shot.
      
      Set the property `"networkaddress.cache.negative.ttl"` to `"0"`
      
      > networkaddress.cache.negative.ttl (default: 10)
      >    Indicates the caching policy for un-successful name lookups from the name service. The value is specified as an integer to indicate the number of seconds to cache the failure for un-successful lookups.
      
      >    A value of 0 indicates "never cache". A value of -1 indicates "cache forever".
      
      From
      https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/InetAddress.html
      
      
      in the hopes that we can try multiple times. Restores the original value
      after the test completes so we don't inadvertently change behavior
      elsewhere.
      
      If we get an error of java.net.UnknownHostException we try again if we
      have attempts remaining. If we get a boolean it means the ip resolution
      worked so we can rely on the response (checking if it resolves locally
      or not)
      
      * add a delay
      
      * comment out test
      
      Co-authored-by: default avatarCam Saul <github@camsaul.com>
      Co-authored-by: default avatardpsutton <dan@dpsutton.com>
      Unverified
      98bbb001
  22. Aug 05, 2022
    • Cam Saul's avatar
      Move writeback migrations to 45 (#24614) · 2fcfec07
      Cam Saul authored
      * Move writeback migrations to 45
      
      * Empty commit to trigger GitHub Actions
      
      * Handle flakiness with geojson java.net.UnknownHostException errors (#24523)
      
      * Handle flakiness with geojson java.net.UnknownHostException errors
      
      In CI seems like we are getting errant errors:
      
      ```clojure
      geojson.clj:62
      It validates URLs and files appropriately
      http://0xc0000200
      expected: (valid? geojson)
        actual: #error {
       :cause "Invalid IP address literal: 0xc0000200"
       :via
       [{:type clojure.lang.ExceptionInfo
         :message "Invalid GeoJSON file location: must either start with http:// or https:// or be a relative path to a file on the classpath. URLs referring to hosts that supply internal hosting metadata are prohibited."
         :data {:status-code 400, :url "http://0xc0000200"}
         :at [metabase.api.geojson$valid_url_QMARK_ invokeStatic "geojson.clj" 62]}
        {:type java.net.UnknownHostException
         :message "0xc0000200"
         :at [java.net.InetAddress getAllByName "InetAddress.java" 1340]}
        {:type java.lang.IllegalArgumentException
         :message "Invalid IP address literal: 0xc0000200"
         :at [sun.net.util.IPAddressUtil validateNumericFormatV4 "IPAddressUtil.java" 150]}]
      ```
      
      Not clear if this change has a hope of fixing it: if it doesn't resolve
      once its possible it is cached somewhere in the network stack, or it
      won't resolve if you ask again.
      
      But gonna give it a shot.
      
      Set the property `"networkaddress.cache.negative.ttl"` to `"0"`
      
      > networkaddress.cache.negative.ttl (default: 10)
      >    Indicates the caching policy for un-successful name lookups from the name service. The value is specified as an integer to indicate the number of seconds to cache the failure for un-successful lookups.
      
      >    A value of 0 indicates "never cache". A value of -1 indicates "cache forever".
      
      From
      https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/net/InetAddress.html
      
      
      in the hopes that we can try multiple times. Restores the original value
      after the test completes so we don't inadvertently change behavior
      elsewhere.
      
      If we get an error of java.net.UnknownHostException we try again if we
      have attempts remaining. If we get a boolean it means the ip resolution
      worked so we can rely on the response (checking if it resolves locally
      or not)
      
      * add a delay
      
      * comment out test
      
      Co-authored-by: default avatardpsutton <dan@dpsutton.com>
      Co-authored-by: default avatarCase Nelson <case@metabase.com>
      Unverified
      2fcfec07
  23. Aug 04, 2022
  24. Jul 27, 2022
  25. Jul 26, 2022
    • dpsutton's avatar
      Set a timeout for `isValidTimeout` (#24289) · 991a9bc5
      dpsutton authored
      * Set a timeout for `isValidTimeout`
      
      When using ssh with db connections:
      Our theory is that the db connection has no idea that it sits on top of
      an ssh connection. And if the ssh connection dies (ie, `show full
      processlist` and then `kill <id>` from that list in mysql) the db
      connection has no idea it is dead. "It" is valid but its ssh transport
      is dead.
      
      > It is possible to customize how c3p0's DefaultConnectionTester tests
      > when no preferredTestQuery or automaticTestTable are available. Please
      > see Configuring DefaultConnectionTester.isValidTimeout and Configuring
      > DefaultConnectionTester.QuerylessTestRunner.
      
      from https://www.mchange.com/projects/c3p0/#automaticTestTable
      
      > Configuring DefaultConnectionTester.isValidTimeout
      
      > Under circumstances when the JDBC 4+ isValid(...) test will be used by
      > c3p0's built in DefaultConnectionTester (see below), by default the test
      > will never time out. If you would the test to timeout and fail, set the
      > following key
      
      >    com.mchange.v2.c3p0.impl.DefaultConnectionTester.isValidTimeout
      
      > to the desired timeout, in seconds.
      
      https://www.mchange.com/projects/c3p0/#configuring_dctivt
      
      * Bump to 6 seconds. Worried 3 might be a bit too quick
      Unverified
      991a9bc5
  26. Jul 21, 2022
  27. Jul 14, 2022
  28. Jul 13, 2022
  29. Jul 12, 2022
    • Noah Moss's avatar
      First pass at parameters in Markdown cards (#23641) · e136f430
      Noah Moss authored
      * first pass at parameters in text cards on FE
      
      * trying to get translations working
      
      * relative datetime formatting
      
      * copy changes and 'Text card' header
      
      * default text when no params
      
      * hide header for text cards with height of 1 with params when in param mapping mode
      
      * show UI text in mobile mode
      
      * minor fixes
      
      * enforce that a text card variable can only be mapped to one parameter
      
      * more value formatting
      
      * noop
      
      * fix backend tests
      
      * add back a couple pieces of frontend logic commented out
      
      * misc cleanup
      
      * attempt at adding a FE unit test
      
      * revert unit test, doesn't work
      
      * add a couple of basic cypress tests and fix a couple of bugs
      
      * basic unit tests for cljc
      
      * fix error
      
      * expanded unit tests
      
      * simplify ns
      
      * add cypress test for instance language translation
      
      * basic handling for a couple cases of :date/all-options
      
      * trs docstring clarification
      
      * whitespace tweaks
      
      * fix cypress test
      
      * minor refactor of tag-names
      
      * move cljc file from utils to new parameters dir
      
      * reorder functions
      
      * fix lint
      
      * add test assertion that locale is correctly reset back to english, and add a comment
      
      * fix bug where existing parameter mapping target was not being found
      
      * clojure logic tweaks
      
      * move text card header text to the Text component config
      
      * simplify header logic, and pull out isLoading into a function to reduce complexity
      
      * address alex's css feedback
      
      * fix trs comment
      Unverified
      e136f430
  30. Jul 06, 2022
  31. Jul 05, 2022
    • Ngoc Khuat's avatar
      Store Sandboxed FieldValues (#23435) · dcf306e5
      Ngoc Khuat authored
      * Store Sandboxed FieldValues
      
      * locked-filter -> linked-filter
      
      * resolve Noah and Braden comments
      
      * Ensure current code does not confuse with the new added FieldValues type (#23601)
      
      * makes sure the old code returns the correct FieldValues after adding new FieldValues types
      
      * use threading macro to make at test easier to read
      
      * Job to clean expired advanced field values (#23437)
      
      * add a clean job
      
      * merge upstream
      
      * use java-time for max-age var
      
      * simplify a reduce function and update some tests to make it easier to understand
      Unverified
      dcf306e5
  32. Jun 29, 2022
Loading