From 1048e1e6a764809e6817e2e7364955119fe1a557 Mon Sep 17 00:00:00 2001 From: Alex Abashev Date: Fri, 2 Oct 2026 23:32:30 +0300 Subject: [PATCH] Annotate javac warnings from the build job only setup-java's problem matcher turns javac's warnings, Error Prone's among them, into annotations on the diff, and it is on by default. It was on in every job that compiles the same sources: build, the three newer JDKs, the five native platforms and both CodeQL analyses. Windows never annotated, because the matcher's pattern takes no path with a colon in it. GitHub keeps only the first ten warnings of a step. The build prints 188, and as it runs in parallel, each job prints them in its own order and keeps its own ten. So on #98 one warning showed up to ten times, the one next to it once, and most not at all. build keeps the matcher, now explicitly and with a comment saying why; every other setup-java step on a pull request passes problem-matcher: false. Each warning shows at most once, though still only the first ten the build prints. --- .github/workflows/ci.yml | 12 +++++++++++- .github/workflows/codeql-analysis.yml | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b2cfdd72..d0f60378e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,11 +22,16 @@ jobs: with: persist-credentials: false + # setup-java's problem matcher turns javac's warnings, Error Prone's among them, into annotations on + # the diff. This is the one job that keeps it: every other job compiles the same sources, and with + # the matcher on there too each warning showed once per job. GitHub keeps only the first ten + # warnings of a step, so the annotations are the first ten warnings the parallel build prints. - name: Install JDK 21 uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 with: distribution: temurin java-version: '21' + problem-matcher: true - name: Build run: ./gradlew test @@ -68,12 +73,14 @@ jobs: with: persist-credentials: false + # No problem matcher in this job: `build` annotates the warnings. - name: Install JDK ${{ matrix.jdk }} for the tests id: test-jdk uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 with: distribution: temurin java-version: ${{ matrix.jdk }} + problem-matcher: false # Installed last, so that it is the JAVA_HOME Gradle runs and compiles on. - name: Install JDK 21 @@ -81,6 +88,7 @@ jobs: with: distribution: temurin java-version: '21' + problem-matcher: false - name: Explain the extra Gradle arguments if: ${{ matrix.gradle_args != '' }} @@ -138,13 +146,15 @@ jobs: # The jars compile with a Java 21 toolchain, which gradle.properties looks up in JDK21_HOME. On # Linux and macOS Gradle also finds the runner's own JDK 21 by its location, on Windows it does not. - # Installed before GraalVM, so that Gradle itself still runs on GraalVM. + # Installed before GraalVM, so that Gradle itself still runs on GraalVM. No problem matcher: `build` + # annotates the warnings. - name: Install JDK 21 for the jars id: jdk21 uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 with: distribution: temurin java-version: '21' + problem-matcher: false - name: Install GraalVM 25 for the image uses: graalvm/setup-graalvm@0426e2e191540e8514dff98dc52a5f5146a2a276 # v1.6.6 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index e4807befe..8164aa2f7 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -30,11 +30,13 @@ jobs: with: persist-credentials: false + # No problem matcher: the javac warnings are annotated by CI's `build` job. - name: Set up JDK 21 uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # v6.0.1 with: distribution: temurin java-version: '21' + problem-matcher: false - name: Initialize CodeQL uses: github/codeql-action/init@1c5b675653bb5c22dbe9b12b556ec555138e09fd # v4.38.1