Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Jan 19, 2023
    • dpsutton's avatar
      Make `parameter_card.parameter_id` long enough for a uuid (#27770) · d3837c21
      dpsutton authored
      * Make `parameter_card.parameter_id` long enough for a uuid
      
      was char(32). This is a common type for identifiers in our migrations
      file, but unfortunately not great for ids.
      
      ```clojure
      user=> (count (str (random-uuid)))
      36
      ```
      
      It seems like dashboards use shorter ids but cards use uuids.
      
      * make it varying
      
      from a test failure:
      
      ```
      expected: [{:card_id 813,
                  :parameter_id "_CATEGORY_NAME_",
                  :parameterized_object_id 815,
                  :parameterized_object_type :card}]
        actual: [#metabase.models.parameter_card.ParameterCardInstance
                 {:card_id 813,
                  :created_at #<java.time.OffsetDateTime@702e9037 2023-01-19T15:09:39.355894Z>,
                  :id 36,
                  :parameter_id "_CATEGORY_NAME_                     ",
                  :parameterized_object_id 815,
                  :parameterized_object_type :card,
                  :updated_at #<java.time.OffsetDateTime@5db7ac60 2023-01-19T15:09:39.355894Z>}]
      ```
      
      "_CATEGORY_NAME_" vs "_CATEGORY_NAME_                     "
      Unverified
      d3837c21
  2. Jan 18, 2023
  3. Jan 11, 2023
  4. Jan 10, 2023
  5. Jan 04, 2023
    • metamben's avatar
      Cherry pick be data apps minus apps and pages (#27413) · 3b8f0d88
      metamben authored
      * Implicit action pre-fetch values (#25940)
      
      * [Apps] Implicit action pre-fetch values
      
      WIP To return a parameter-id: value map in order to prefill ui.
      
      * Use jsonstring encoded parameters
      
      * Change parameters exposed by implicit actions
      
      Previously, we would look at a model's source-table to determine which
      parameters were valid for implicit actions. So if an implicit action is
      on a User model that hides the user.password column, you could still
      update or insert the password.
      
      With this commit, if the model doesn't expose a source table column, it
      is not a valid parameter. In the example user.password could not be
      inserted/updated or fetched for prefilling.
      
      * Fixing tests
      
      * Show data app page ID params in editing mode (#25943)
      
      * Data apps layout updates (#25930)
      
      * play with grid sizes to make apps feel appier [ci skip]
      
      * move app nav to bar inside app
      
      * only hide other header buttons outside of edit mode
      
      * tweak ...
      Unverified
      3b8f0d88
  6. Dec 29, 2022
  7. Dec 20, 2022
  8. Dec 15, 2022
  9. Dec 13, 2022
  10. 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
  11. 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
  12. 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
  13. 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
  14. Nov 28, 2022
  15. Nov 15, 2022
  16. Nov 08, 2022
  17. Oct 24, 2022
  18. 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
  19. 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
  20. 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
  21. 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
  22. Sep 29, 2022
  23. 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
  24. Sep 16, 2022
  25. Sep 06, 2022
  26. 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
  27. Aug 23, 2022
  28. Aug 22, 2022
  29. 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
  30. 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
  31. 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
  32. Aug 04, 2022
  33. Jul 27, 2022
Loading