build(ci): report the required check when only .claude/ changed - #1849
Merged
Conversation
#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>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



#1846 stopped
.claude-only changes from triggering full builds, and deliberately avoidedpaths-ignoreonpull_requestbecause a workflow skipped by path filtering never reports its checks. It gated thebuildjob with a job-levelif:instead, on the reasoning that a job skipped that way does report — asskipped— and required checks acceptsuccessful, 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:
while
.asf.yamlrequires the contextBuild and Test (JDK 17). That context never appeared at all, so it stayed Pending and the PR landed onmergeStateStatus: 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 reportsuccessunder 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 Summarykeepsalways()so it still runs after a failed build, combined asalways() && needs.changes.outputs.code == 'true'.Jenkins is unaffected: stage-level
whenhas 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-xcarries neither #1846 nor this.🤖 Generated with Claude Code