From 84e5faf9418a3184a47abcc4d25f48e799737679 Mon Sep 17 00:00:00 2001 From: Jada Lilleboe <82007190+jadalilleboe@users.noreply.github.com> Date: Wed, 20 May 2026 11:25:07 -0400 Subject: [PATCH] SERVER-126777 Add linting to ASPIO directory (#53861) GitOrigin-RevId: 699992b81f3a4d43472610f255677198015bcef0 --- evergreen/streams_aspio_lint.sh | 39 +++++++++++++++++++ evergreen/streams_build_aspio.sh | 8 ++++ evergreen/streams_image_build_and_push.sh | 3 ++ .../streams_image_build_and_push_sanitizer.sh | 3 ++ 4 files changed, 53 insertions(+) create mode 100755 evergreen/streams_aspio_lint.sh diff --git a/evergreen/streams_aspio_lint.sh b/evergreen/streams_aspio_lint.sh new file mode 100755 index 00000000000..ceb38825473 --- /dev/null +++ b/evergreen/streams_aspio_lint.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# Runs spotless:check on the ASPIO Maven project to verify Java formatting. +# Fails if any file is not formatted according to Google Java Format. +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +SRC_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" + +ASPIO_DIR="${ASPIO_DIR:-$SRC_DIR/src/mongo/db/modules/enterprise/src/streams/aspio}" +TOOLS_DIR="${TOOLS_DIR:-$SRC_DIR/streams_build_tools}" + +# If you update this Java version, also update in aspio/pom.xml and +# java-17-amazon-corretto-devel in evergreen/streams_image_build_and_push.sh and +# evergreen/streams_image_build_and_push_sanitizer.sh +sudo dnf -y install java-17-amazon-corretto-devel wget unzip + +mkdir -p "$TOOLS_DIR" + +# If you update this Maven version, also update it in evergreen/streams_build_aspio.sh +# (and update MAVEN_SHA512 below to match the new release's checksum from Apache) +if [ ! -d "$TOOLS_DIR/apache-maven-3.9.14" ]; then + echo "Downloading Maven 3.9.14..." + wget -q https://archive.apache.org/dist/maven/maven-3/3.9.14/binaries/apache-maven-3.9.14-bin.zip -O "$TOOLS_DIR/maven.zip" + MAVEN_SHA512="4122c5e7a8794260539dd8fcd78480549511babff2f85e2b1258c8d4cf33c50af90f65d323f43c88d4959f35a8f37ced3eca802983caa6eb7cc81b16af936ab0" + echo "$MAVEN_SHA512 $TOOLS_DIR/maven.zip" | sha512sum --check --quiet || { + echo "Maven download checksum mismatch — aborting" >&2 + rm -f "$TOOLS_DIR/maven.zip" + exit 1 + } + unzip -q "$TOOLS_DIR/maven.zip" -d "$TOOLS_DIR" + rm "$TOOLS_DIR/maven.zip" +fi +export MAVEN_HOME="$TOOLS_DIR/apache-maven-3.9.14" +export PATH="$MAVEN_HOME/bin:$PATH" + +export LANG=C.UTF-8 +cd "$ASPIO_DIR" +echo "Running spotless check in $ASPIO_DIR..." +mvn spotless:check diff --git a/evergreen/streams_build_aspio.sh b/evergreen/streams_build_aspio.sh index 5afcc4a15f8..1b1aab15a3d 100644 --- a/evergreen/streams_build_aspio.sh +++ b/evergreen/streams_build_aspio.sh @@ -96,9 +96,17 @@ log "OUTPUT_DIR: $OUTPUT_DIR" mkdir -p "$TOOLS_DIR" +# If you update this Maven version, also update it in evergreen/streams_aspio_lint.sh +# (and update MAVEN_SHA512 below to match the new release's checksum from Apache) if [ ! -d "$TOOLS_DIR/apache-maven-3.9.14" ]; then log "Downloading Maven 3.9.14..." wget -q https://archive.apache.org/dist/maven/maven-3/3.9.14/binaries/apache-maven-3.9.14-bin.zip -O "$TOOLS_DIR/maven.zip" + MAVEN_SHA512="4122c5e7a8794260539dd8fcd78480549511babff2f85e2b1258c8d4cf33c50af90f65d323f43c88d4959f35a8f37ced3eca802983caa6eb7cc81b16af936ab0" + echo "$MAVEN_SHA512 $TOOLS_DIR/maven.zip" | sha512sum --check --quiet || { + echo "Maven download checksum mismatch — aborting" >&2 + rm -f "$TOOLS_DIR/maven.zip" + exit 1 + } unzip -q "$TOOLS_DIR/maven.zip" -d "$TOOLS_DIR" rm "$TOOLS_DIR/maven.zip" fi diff --git a/evergreen/streams_image_build_and_push.sh b/evergreen/streams_image_build_and_push.sh index dcc43e5078c..0f2509bd555 100644 --- a/evergreen/streams_image_build_and_push.sh +++ b/evergreen/streams_image_build_and_push.sh @@ -83,6 +83,9 @@ VENV_PID=$! cd "$SRC_DIR" # Install system deps for maven/js engine (runs in parallel with bazel/venv). +# If you update this Java version, also update in aspio/pom.xml and +# java-17-amazon-corretto-devel in evergreen/streams_aspio_lint.sh and +# evergreen/streams_image_build_and_push_sanitizer.sh if ! command -v javac >/dev/null 2>&1; then sudo dnf -y install java-17-amazon-corretto-devel wget unzip fi diff --git a/evergreen/streams_image_build_and_push_sanitizer.sh b/evergreen/streams_image_build_and_push_sanitizer.sh index e423f885a0d..60f6c799d3d 100755 --- a/evergreen/streams_image_build_and_push_sanitizer.sh +++ b/evergreen/streams_image_build_and_push_sanitizer.sh @@ -72,6 +72,9 @@ FORCE_CREATE=true bash "$DIR/functions/venv_setup.sh" >"$LOGS_DIR/venv.log" 2>&1 VENV_PID=$! cd "$SRC_DIR" +# If you update this Java version, also update in aspio/pom.xml and +# java-17-amazon-corretto-devel in evergreen/streams_aspio_lint.sh and +# evergreen/streams_image_build_and_push.sh if ! command -v javac >/dev/null 2>&1; then sudo dnf -y install java-17-amazon-corretto-devel wget unzip fi