Skip to content
Snippets Groups Projects
This project is mirrored from https://github.com/metabase/metabase. Pull mirroring updated .
  1. Aug 05, 2021
  2. Aug 04, 2021
  3. Aug 03, 2021
  4. Jul 30, 2021
    • Cam Saul's avatar
      Switch to tools.deps (#16749) · 0eef2252
      Cam Saul authored
      0eef2252
    • Jeff Evans's avatar
      Only build currently active drivers (#17262) · 313f0979
      Jeff Evans authored
      Only build currently active drivers
      
      Update `all-drivers` fn so that it only "finds" drivers that have either a `project.clj` or `deps.edn` file (i.e. some build file), and ignores the directory otherwise. This is to deal with cached artifacts hanging around between builds in a shared executor type environment (ex: CircleCI), where even though the checkout won't bring in some driver directory that doesn't exist on the target branch, some other files (such as `pom.xml` or a `target` directory), might still be hanging around
      313f0979
    • Dalton's avatar
      Upgrade babel to 7.x.x and jest to 27.x.x (#17137) · 3a7c3987
      Dalton authored
      * Update babel dependencies to latest
      
      * Remove some old babel dependencies
      
      The dependencies in this commit include dependencies that have been
      renamed, such as babel-cli which is now @babel/cli. It also includes
      dependencies that have been replaced, such as babel-preset-stage-0 and
      its ilk, which have been replaced with @babel/preset-env.
      
      * Remove babel-register dependency
      
      This is referenced in our webpack.config.js file. I don't think we need
      Babel in our Node envionment, but I could be wrong, so leaving this as a
      separate commit.
      
      * Remove @babel/standalone and dependent code
      
      We're using @babel/standalone to support the writing of JSX in our
      internal-only ScratchApp editor. Unfortunately, this dependency is
      large--1.5mb not gzipped--and our current build does not intelligently
      split bundles, meaning our users our burdened by the size of this
      dependency whenever they must redownload the Metabase JS bundle.
      
      I'm removing it. We should still be able to write JS in the ScratchApp,
      but JSX no longer.
      
      * Add @babel/node to dev deps
      
      Needed by a cypress command
      
      * Add browserslist config
      
      Babel's preset-env dep needs this config to determine how to transform
      our JavaScript. By default I believe it ends up defaulting to
      "defaults."
      
      "defaults" is equivalent to the following rules:
      > 0.5%, last 2 versions, Firefox ESR, not dead
      
      A comma between rules represents a UNION operator.
      
      Per
      https://www.metabase.com/docs/latest/faq/general/supported-browsers.html
      
      
      we have deprecated IE 11 so I am including that explicitly in our
      browserslist.
      
      * Update babelrc plugins and presets
      
      - Replaced presets with preset-env and preset-react
      - Updated the names of some plugins, like transform-decorators-legacy,
        which is now @babel/plugin-proposal-decorators with an explicit
        "legacy: true" passed in the config.
      - Removed add-react-displayname because it is included in preset-react
      - Removed transform-builtin-extend because it is included in preset-env*
      - Removed syntax-trailing-function-commas because it is supported by
        all browsers we support
      
      * note: There is a "loose" config option for handling the extension of builtin
      classes. We may need it, but I am not sure.
      
      * Update babel cli args
      
      Replace -q with --quiet because -q no longer exists
      
      * Fix circular dep in auth.js by making it async
      
      Our app unfortunately contains MANY circular dependencies. Some, like
      this one, caused problems when the app instantiates because the
      "refreshCurrentUser" method is undefined when auth.js is initially run.
      
      While we should in the future avoid having circular deps in the first
      place, making them run async by requiring the dep and function run-time
      fixes this particular issue.
      
      * Fix circular dependency in metabase/redux/requests.js
      
      The handleActions and createAction methods imported from
      "metabase/lib/redux" are actually just methods from the "redux-actions"
      dependency... so importing those methods directly from that dep fixes
      this circular dependency problem.
      
      * Remove references to global.services and exports in metabase/services
      
      This line breaks the build. Git blame says the line is 5 years old, and
      I wouldn't expect such code to be used with how our app now requires
      deps.
      
      * Fix MBQLArrayClause problem caused by Array extension
      
      * Explicitly pass args from flatMap to function via anonymous cb
      
      I think the old Array.prototype.flatMap prototype must've had different
      args. They are now "currentValue, index, array" so when we passed it
      "enumeratePaths" as a callback, the second arg of enumeratePaths gets
      set to a number. This breaks the logic of enumeratePaths because it is a
      recursive function that depends on that second arg getting initialized
      as an empty array by default.
      
      * Remove code that spreads non-iterable value in array
      
      New Babel is stricter about handling this sort of code that doesn't
      match the JS spec. You can't spread an undefined value inside of an
      iterator.
      
      * Update jest and babel-jest to latest
      
      Updating Babel breaks our unit tests. Updating nothing causes every test
      to fail due to a Babel version mismatch. Updating only babel-jest causes
      the following error:
      
      TypeError: Jest: a transform must export a `process` function
      
      There may be a way around updating Jest, but updating it does not appear
      to be too difficult.
      
      * Set the testEnvironment to jsdom
      
      This was the default testEnvironment in our old version of jest. At some
      point the default was changed to node.
      
      * Remove unfinished "pending" unit tests
      
      I'm unfamiliar with this pending function, but the function no longer
      exists, causing the tests to fail.
      
      * don't pass async callback to describe
      
      * Update name of runTimersToTime to advanceTimersByTime
      
      * Fix incorrectly nested unit test
      
      * mock SVGElement.prototype.getBBox method
      
      * Don't return values in describe callback
      
      * Move variable declaration to above usage
      
      * Fix prettier error
      
      * Upgrade `documentation` library to the latest version (13.x.x)
      
      This library was the only one left that was still using Babel 6.
      
      * Return an MBQLClause instance after using Array methods
      
      * remove 'not IE 11' from browserslist
      
      * Remove mock that breaks unit test
      
      Co-authored-by: default avatarNemanja <31325167+nemanjaglumac@users.noreply.github.com>
      3a7c3987
  5. Jul 29, 2021
    • Cam Saul's avatar
      Run Eastwood linter against test namespaces. Remove reflection-warning script (#17193) · 89382bae
      Cam Saul authored
      * Fix some Eastwood failures
      
      * Fix a lot of Eastwood errors now that it runs against test namespaces [ci skip]
      
      * Run Eastwood against test namespaces [WIP]
      
      * Bump Eastwood version to fix some errors in Eastwood itself
      
      * Fix another lint warning
      
      * Fix test failure
      
      * More test fixes :wrench:
      
      * Fix all the warnings!
      
      * Test fix :wrench:
      
      * Bump Eastwood GH action timeout to 20 minutes (!)
      89382bae
  6. Jul 22, 2021
    • Ariya Hidayat's avatar
      Bundle static viz charting code (#17157) · 7ec6f154
      Ariya Hidayat authored
      * yarn add @visx/axis@1.8.0 @visx/grid@1.16.0 @visx/group@1.7.0 @visx/scale@1.7.0 @visx/shape@1.8.0
      
      * Import static viz charting code
      
      * Format code with yarn prettier
      
      * Silence linting violations
      
      * Build static-viz bundle
      7ec6f154
  7. Jul 21, 2021
  8. Jul 12, 2021
  9. Jun 29, 2021
    • dpsutton's avatar
      Correct static interop (#16804) · c9a844ba
      dpsutton authored
      on java 16 there's a handy (newFilesystem path) but i don't think we
      want to require java 16 yet. On previous versions we can use
      (newFileSystem Path ClassLoader) which is what it was before. Really
      just need to typehint the nil, but nils don't carry
      metadata (sensibly) so would have to introduce a local binding
      
      ```clojure
      (let [^ClassLoader cl nil]
        (FileSystems/newFileSystem jar-path cl))
      ```
      
      feels a bit weird, so just send the proper classloader through.
      c9a844ba
  10. Jun 23, 2021
    • dpsutton's avatar
      Licenses file (#16554) · 60617977
      dpsutton authored
      * wip for licenses
      
      * Lots of changes
      
      - bump clojure.data.xml to prevent illegal access
      - had to change navigators because of this
      - switch to full text of license
      - algo is now:
        1. check for a license file in jar
        2. check for an override pointing to a license file locally in
           resources
        3. Check pom file for license information and just use that
      
      can be invoked as:
      ```bash
      % clj -X mb.licenses/process :classpath \"$(cd ../.. && lein classpath)\" :backfill "\"overrides.edn\"" :output-filename "\"backend-licenses.txt\""
      License information written to  backend-licenses.txt
      /Users/dan/.m2/repository/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar  : No license information found.
      org.clojars.brenton:google-diff-match-patch  : No license information found.
      
      % wc backend-licenses.txt
         33638  299118 2092948 backend-licenses.txt
      ```
      
      * xml/parse without the strings
      
      * Add tests
      
      * remove comment form
      
      * namespace comments
      
      * readme
      
      * instructions to create backend license files
      
      * Add version information to the build script
      
      need to either yank it out of the separate project or just use it as a
      local root. not sure which
      
      todos: move to s3 once i get access and figure out the proper bucket
             copy to a place so it ends up in the jar
             generate frontend versions as well
      
      * Build frontend and backend license files
      
      put them in the jar at
      META-INF/leiningen/metabase-core/metabase-core/license-frontend-third-party
      META-INF/leiningen/metabase-core/metabase-core/license-backend-third-party
      
      need to be named ^license.* for lein uberjar to pick them up
      
      * Rename and reformat
      
      * remove old stuff
      
      * combine with a newline
      
      * Tests ensure all jars have an identifiable license
      
      * Extra information if backfill is malformed or missing
      
      * correct name for apache2_0 backfill
      
      * print out classpaths in CI
      
      * print
      
      * see whole classpath. it's empty on ee for some reason
      
      * assert they are there
      
      * Get deps before attempting classpath
      
      for some reason the first one fails. but subsequent re-runs work.
      
      * loop on deps until satisfied
      
      * Include message if cannot satisfy
      
      * include all drivers when getting deps
      
      * rearrange ns docstring
      
      * Hoist functions on pom inside of `with-open` on the input streams
      
      * Update to inversion of pom parsing
      
      * Move to nio from java.io
      60617977
  11. May 21, 2021
  12. May 13, 2021
  13. May 11, 2021
  14. May 07, 2021
  15. Apr 30, 2021
  16. Apr 26, 2021
  17. Apr 19, 2021
  18. Apr 15, 2021
  19. Apr 13, 2021
  20. Apr 12, 2021
    • Jeff Evans's avatar
      Various improvements to version update checks (#15517) · 9392ddd7
      Jeff Evans authored
      * Various improvements to version update checks
      
      ***************************
      * Release project changes *
      ***************************
      
      Updating version_info.clj code to build version-info-ee.json file for Enterprise Edition build
      
      Adding test for both oss and ee version info file generation logic
      
      Decoupling GitHub milestone from version and setting it to be the OSS value for :ee release build
      
      Adding nREPL alias for release deps.edn project and usage note
      
      ************************
      * Core product changes *
      ************************
      
      Adding new :ee version of :mb-version-info-url (:mb-version-info-ee-url) with default value to match the file name generated by the release code
      
      Making enterprise-edition? public from core.clj, since it's now needed from the upgrade check code to switch between the URLs
      
      Adding new setting to store when updates were last checked (since it's on a 12-hour interval)
      
      Changing update check code to both set this new timestamp setting (always) to the current time, and set version-info itself to nil if the update check fails (so that users won't see "latest and greatest" if the update check succeeded at some point in the past, but then started failing
      
      Frontend changes:
      
      Showing the "last checked" timestamp (in user's browser timezone) when we show the "Sorry" text because of being unable to check for updates, so they know when the last check was made
      
      Removing custom implementation of MetabaseSettings.versionInfo from EE frontend code since it's no longer needed (and never worked), because the EE backend will now be hitting a different URL with the version info specifically for EE releases
      
      Linking to https://www.metabase.com/docs/<newVersion>/operations-guide/upgrading-metabase.html URL instead of simply /start
      9392ddd7
  21. Mar 29, 2021
  22. Mar 23, 2021
    • Cam Saul's avatar
      Shared MBQL lib (#15267) · 58cfa2e5
      Cam Saul authored
      Port the metabase.mbql utility namespaces to ./shared/ so they can be used on both the frontend and backend.
      58cfa2e5
  23. Mar 17, 2021
  24. Mar 12, 2021
  25. Mar 10, 2021
  26. Mar 05, 2021
  27. Feb 26, 2021
    • Robert Roland's avatar
      Replace ExitOnOutOfMemoryError with CrashOnOutOfMemoryError (#14972) · 430d2683
      Robert Roland authored
      This will make the JVM output more details as it crashes for running out of memory.
      
      New output:
      
      ```text
      rroland@tardis:~/src/metabase/target/uberjar$ java -Xmx50m -XX:+CrashOnOutOfMemoryError -jar metabase.jar
      WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
      2021-02-25 11:38:31,689 INFO metabase.util :: Maximum memory available to JVM: 50.0 MB
      Aborting due to java.lang.OutOfMemoryError: Java heap space
      \#
      \# A fatal error has been detected by the Java Runtime Environment:
      \#
      \#  Internal Error (debug.cpp:338), pid=40255, tid=40256
      \#  fatal error: OutOfMemory encountered: Java heap space
      \#
      \# JRE version: OpenJDK Runtime Environment (11.0.10+9) (build 11.0.10+9-post-Debian-1)
      \# Java VM: OpenJDK 64-Bit Server VM (11.0.10+9-post-Debian-1, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
      \# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
      \#
      \# An error report file with more information is saved as:
      \# /home/rroland/src/metabase/target/uberjar/hs_err_pid40255.log
      \#
      \# If you would like to submit a bug report, please visit:
      \#   https://bugs.debian.org/openjdk-11
      \#
      Aborted
      ```
      
      Previous output:
      
      ```text
      rroland@tardis:~/src/metabase/target/uberjar$ java -Xmx50m -XX:+ExitOnOutOfMemoryError -jar metabase.jar
      WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
      2021-02-25 11:38:46,898 INFO metabase.util :: Maximum memory available to JVM: 50.0 MB
      Terminating due to java.lang.OutOfMemoryError: Java heap space
      ```
      430d2683
  28. Feb 25, 2021
    • Cam Saul's avatar
      Optimize relative datetime filters (#14835) · 538e5e38
      Cam Saul authored
      1. Rename optimize-datetime-filters middleware -> optimize-temporal-filters (it's more accurate, because this also
      optimizes date or time filter clauses)
      
      2. optimize-temporal-filters middleware now optimizes relative-datetime clauses (which represent a moment in time
      relative to when the query is ran, e.g. "last month") in addition to absolute-datetime clauses (which represent an
      absolute moment in time, e.g. 2021-02-15T14:40:00-08:00) . This middleware rewrites queries so we filter against
      specific temporal ranges without casting the column itself, meaning we can leverage indexes on that column. See #11837
      for more details
      
      3. Added new validate-temporal-bucketing middleware that throws an Exception if you try to do something that makes no
      sense, e.g. bucket a DATE field by :time or a TIME field by :month. This is a better situation then running the query
      and waiting for the DB to complain. (In practice, I don't think the FE client would let you generate a query like this
      in the first place)
      
      4. Fix random test failures for MySQL in task-history-cleanup-test
      538e5e38
  29. Feb 16, 2021
  30. Feb 10, 2021
  31. Feb 02, 2021
Loading