Skip to content

build(ci): report the required check when only .claude/ changed - #1849

Merged
lukaszlenart merged 1 commit into
mainfrom
build/ci-matrix-skip-required-check
Aug 14, 2026
Merged

build(ci): report the required check when only .claude/ changed#1849
lukaszlenart merged 1 commit into
mainfrom
build/ci-matrix-skip-required-check

Conversation

@lukaszlenart

Copy link
Copy Markdown
Member

#1846 stopped .claude-only changes from triggering full builds, and deliberately avoided paths-ignore on pull_request because a workflow skipped by path filtering never reports its checks. It gated the build job with a job-level if: instead, on the reasoning that a job skipped that way does report — as skipped — and required checks accept successful, skipped, or neutral.

That holds for a plain job. It does not hold for a matrix job.

What actually happens

A matrix job whose condition is false is skipped before the matrix expands, so it emits a single check run named after the raw name template rather than one per matrix entry. On #1848 the reported check was literally:

Build and Test (JDK ${{ matrix.java }})${{ (((matrix.profile == '-Pjakartaee11') && ' (Jakarta EE 11 + Spring 7)') || matrix.profile) }}   skipped

while .asf.yaml requires the context Build and Test (JDK 17). That context never appeared at all, so it stayed Pending and the PR landed on mergeStateStatus: BLOCKED — the exact failure #1846 set out to avoid, reached by a different route.

The fix

Drop the job-level if: and gate the four steps instead. The matrix expands, all five checks report success under their expanded names, and no Maven build runs. A .claude-only PR now costs five idle runners for a few seconds rather than five full builds — still the point of #1846, just paid for honestly.

Test Summary keeps always() so it still runs after a failed build, combined as always() && needs.changes.outputs.code == 'true'.

Jenkins is unaffected: stage-level when has no matrix to expand.

Once this merges, #1848 needs a rebase or an empty commit to pick up the corrected workflow.

Only the 7.x line is changed here; support/struts-6-x-x carries neither #1846 nor this.

🤖 Generated with Claude Code

#1846 gated the maven.yml build job with a job-level `if:` on the
`changes` output, on the reasoning that a job skipped that way still
reports its check as "skipped", which required status checks accept.

That holds for a plain job, but not for a matrix one. A matrix job whose
condition is false is skipped before the matrix expands, so it emits a
single check run named after the raw name template rather than one per
matrix entry. On #1848 the reported name was literally

  Build and Test (JDK ${{ matrix.java }})${{ ... }}

while .asf.yaml requires the context "Build and Test (JDK 17)". That
context never appeared, so it stayed Pending and the pull request could
not be merged - exactly the failure mode #1846 set out to avoid.

Drop the job-level condition and gate the four steps instead. The matrix
expands, all five checks report success under their expanded names, and
no Maven build runs: a .claude-only pull request costs five idle runners
for a few seconds instead of five full builds.

Jenkins is unaffected - stage-level `when` has no matrix to expand.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@lukaszlenart
lukaszlenart merged commit 7411024 into main Aug 14, 2026
13 checks passed
@lukaszlenart
lukaszlenart deleted the build/ci-matrix-skip-required-check branch August 14, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant