Skip to content
Snippets Groups Projects
  • Cam Saul's avatar
    b1ad9a1a
    Switch to Java 21 (#48854) · b1ad9a1a
    Cam Saul authored
    
    * Try snowflake 3.19.0
    
    * Deafault to java 21 for drivers
    
    * Trigger CI
    
    * Try running things with --add-opens to see if it solves our problems
    
    * Fix `update-view-dashboard-timestamp-test`
    
    * Try snowflake 3.19.0
    
    * Deafault to java 21 for drivers
    
    * Try running things with --add-opens to see if it solves our problems
    
    * Fix `update-view-dashboard-timestamp-test`
    
    * Update deps.edn
    
    * Switch to Java 21
    
    * Docker image needs to use --add-opens option
    
    * Add note about change to Java 21 to driver changelog
    
    ---------
    
    Co-authored-by: default avatarNemanja <31325167+nemanjaglumac@users.noreply.github.com>
    Co-authored-by: default avatarLuis Paolini <paoliniluis@gmail.com>
    Switch to Java 21 (#48854)
    Cam Saul authored
    
    * Try snowflake 3.19.0
    
    * Deafault to java 21 for drivers
    
    * Trigger CI
    
    * Try running things with --add-opens to see if it solves our problems
    
    * Fix `update-view-dashboard-timestamp-test`
    
    * Try snowflake 3.19.0
    
    * Deafault to java 21 for drivers
    
    * Try running things with --add-opens to see if it solves our problems
    
    * Fix `update-view-dashboard-timestamp-test`
    
    * Update deps.edn
    
    * Switch to Java 21
    
    * Docker image needs to use --add-opens option
    
    * Add note about change to Java 21 to driver changelog
    
    ---------
    
    Co-authored-by: default avatarNemanja <31325167+nemanjaglumac@users.noreply.github.com>
    Co-authored-by: default avatarLuis Paolini <paoliniluis@gmail.com>
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
build-for-test 1.35 KiB
#!/usr/bin/env bash

set -eu

VERSION_PROPERTY_NAME="src_hash"

source-hash() {
  # hash all the files that might change a backend-only uberjar build (for integration tests)
  (
    find src deps.edn resources/sample-database.db.mv.db -type f -print0 | xargs -0 shasum ;
    find resources -type f \( -iname \*.clj -o -iname \*.edn -o -iname \*.yaml -o -iname \*.properties -o -iname \*.html \) -not -name "version.properties" -print0 | xargs -0 shasum ;
  ) | shasum | awk '{ print $1 }'
}

uberjar-hash() {
  # java --add-opens java.base/java.nio=ALL-UNNAMED -jar target/uberjar/metabase.jar version | grep -oE 'source_hash [a-f0-9]+' | awk '{ print $2 }'
  # pulling the version.properties directly from the jar is much faster
  unzip -c target/uberjar/metabase.jar version.properties | grep "$VERSION_PROPERTY_NAME" | cut -f2 -d=
}

check-uberjar-hash() {
  expected_hash=$(source-hash)
  actual_hash=$(uberjar-hash)
  if [ "$expected_hash" == "$actual_hash" ]; then
    return 0
  else
    return 1
  fi
}

build-uberjar-for-test() {
  ./bin/build.sh :steps [:version]
  echo -e "\n$VERSION_PROPERTY_NAME=$(source-hash)" >> resources/version.properties
  ./bin/build.sh :steps [:uberjar]
}

if [ ! -f "target/uberjar/metabase.jar" ] || ! check-uberjar-hash; then
  echo "Building uberjar for testing"
  build-uberjar-for-test
else
  echo "Uberjar already up to date for testing"
fi