Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Fix weekly Eastwood linting and failure reporting (#86099)

Chris Truter5247312daec6
diff --git a/.github/scripts/run-backend-test-jvms.sh b/.github/scripts/run-backend-test-jvms.sh
index a89bd63a44b..1d63fd7bae5 100755
--- a/.github/scripts/run-backend-test-jvms.sh
+++ b/.github/scripts/run-backend-test-jvms.sh
@@ -155,10 +155,9 @@ for idx in "${INDEXES[@]}"; do
prepare_jvm_dir "$JVM_DIRS_ROOT/partition-$idx"
done
-# run_partition below can have a race where two `clojure` launchers both check if a file exists
-# and try to copy it at the same time, and one fails and exits before the tests start. We avoid
-# that by running this to ensure that the file exists.
-clojure -Sdescribe >/dev/null || die "clojure -Sdescribe failed"
+# Prepare dependencies before concurrent JVMs can race to clone or check out the same Git library.
+# This also initializes the Clojure launcher before the partitions start.
+clojure -P -X:"$CLOJURE_ALIASES" >/dev/null || die "preparing Clojure dependencies failed"
for idx in "${INDEXES[@]}"; do
run_partition "$idx" "$JVM_DIRS_ROOT/partition-$idx" &
diff --git a/.github/workflows/eastwood.yml b/.github/workflows/eastwood.yml
index 87530661088..eb0193f8d7d 100644
--- a/.github/workflows/eastwood.yml
+++ b/.github/workflows/eastwood.yml
@@ -36,7 +36,6 @@ jobs:
- name: Prepare back-end environment
uses: ./.github/actions/prepare-backend
- name: Run Eastwood
- id: lint
continue-on-error: true
run: ${{ matrix.command }} :out '"warnings.txt"' 2>&1 | tee lint.log
# Eastwood stops at the first exception, so only its closing summary shows it linted every namespace.
@@ -55,6 +54,17 @@ jobs:
path: |
outcome.txt
warnings.txt
+ lint.log
+ - name: Fail on incomplete linting or findings
+ run: |
+ if [ "$(cat outcome.txt)" != complete ]; then
+ echo "::error::Eastwood didn't finish linting ${{ matrix.target }}. See the Run Eastwood step."
+ exit 1
+ fi
+ if [ -s warnings.txt ]; then
+ echo "::error::Eastwood found warnings in ${{ matrix.target }}. See warnings.txt in the artifact."
+ exit 1
+ fi
report:
name: Report Eastwood findings
@@ -171,6 +181,7 @@ jobs:
retention-days: 90
- name: Open, update, or close the Eastwood issue
+ id: sync
if: github.ref == 'refs/heads/master'
env:
LINEAR_API_KEY: ${{ secrets.LINEAR_API_KEY }}
@@ -180,11 +191,13 @@ jobs:
run: bun .github/scripts/eastwood-report.ts sync report.md report/findings.json
- name: Alert when Eastwood can't run
- if: failure() && github.ref == 'refs/heads/master'
+ # failure() includes lint jobs that failed on warnings after completing successfully.
+ if: failure() && steps.sync.outcome != 'success' && github.ref == 'refs/heads/master'
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
run: |
- jq -n --arg channel "$SLACK_CHANNEL" --arg text ":x: The weekly Eastwood run on metabase/metabase failed to run: $RUN_URL" \
+ jq -n --arg channel "$SLACK_CHANNEL" \
+ --arg text ":x: The weekly Eastwood run on metabase/metabase failed to run: $RUN_URL" \
'{channel: $channel, text: $text}' |
curl -sSf https://slack.com/api/chat.postMessage \
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
diff --git a/deps.edn b/deps.edn
index 0108410d9c7..6936863c297 100644
--- a/deps.edn
+++ b/deps.edn
@@ -298,9 +298,9 @@
io.zonky.test.postgres/embedded-postgres-binaries-linux-amd64 {:mvn/version "18.3.0"} ; Linux x86_64 (covers ubuntu-latest GH Actions runner)
io.zonky.test.postgres/embedded-postgres-binaries-linux-arm64v8 {:mvn/version "18.3.0"} ; Linux arm64
io.zonky.test.postgres/embedded-postgres-binaries-windows-amd64 {:mvn/version "18.3.0"} ; Windows x86_64
- jonase/eastwood {:mvn/version "1.4.3" ; inspects namespaces and reports possible problems using tools.analyzer
- :exclusions
- [org.ow2.asm/asm-all]}
+ ;; Clojure 1.12 method values and parameter tags require the fork.
+ jonase/eastwood {:git/url "https://github.com/crisptrutski/eastwood.git"
+ :git/sha "7b2d94e47a3149e28927db197b9c113c81ed6084"}
lambdaisland/deep-diff2 {:mvn/version "2.12.219"} ; way better diffs
net.solovyov/hashp {:mvn/version "0.4.0-1"} ; debugging/spying utility
nrepl/nrepl {:mvn/version "1.5.1"} ; nREPL server
@@ -706,11 +706,7 @@
{:exec-fn metabase.linters.eastwood/eastwood-tests
:exec-args {:exclude-linters [:wrong-arity [:suspicious-test :second-arg-is-not-string]]
:exclude-namespaces
- [;; byte/1 dispatch value trips up Eastwood's reader
- metabase.test.http-client
- ;; Cookie/.getName qualified method trips up Eastwood's analyzer
- metabase.server.middleware.settings-cache-test
- ;; .cljc syntax error during Eastwood's analyze+eval phase
+ [;; .cljc syntax error during Eastwood's analyze+eval phase
metabase.lib.query-test
;; "count not supported on this type: Symbol" in Eastwood's analyzer
metabase.query-processor.parameters.temporal-units-test