Repository navigation
CI: one local pre-push gate that runs CI's own steps, enforced for agents - #6369
Merged
Merged
Conversation
…ents Most failed PR runs were checks any machine can run (Vale/LanguageTool counts, inline guide snippets, comma-cut alt text, copyright headers, Playground snippets, Initializr rules). Agents ran hand-copied commands that judged differently from CI. - scripts/pre-push-gates.sh picks gates with CI's selector and runs the workflow steps themselves through scripts/ci/run-workflow-steps.py. - A clean pass records HEAD; .claude/settings.json wires scripts/ci/claude-pre-push-hook.py to block agent pushes of unrecorded commits (Java changes need --full). - check-workflows.yml runs --validate-steps so renaming a step the gate names fails the PR that renames it. - validate-guide-snippets.py honours CN1_MAVEN_REPO_LOCAL and CN1_GUIDE_SNIPPETS_NO_COMPILE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ns; stricter stamp
…cs; setup-java with unresolvable versions fails
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.
Most failed PR runs over the last five weeks were checks any machine can run: Vale and LanguageTool counts, inline guide source blocks, image alt text cut short by a comma, Playground snippets (including core javadoc), copyright headers, PMD/SpotBugs, Initializr fixture rules and launcher drift. Agents ran hand-copied versions of those checks that judge differently from CI: plain
valeexits 0 on findings CI counts, and a barecheck-copyright-headers.shonly sees the working tree.What this adds
scripts/pre-push-gates.sh: CI's own selector (select-ci-members.py) picks the gates. Nothing is copied: the workflow steps themselves run throughscripts/ci/run-workflow-steps.py, with a realGITHUB_ENV, so the step that records a Vale count feeds the step that fails on it.source-gates.ymlandcheck-workflows.ymlin full, the developer guide lint and quality steps, blog prose, website unit checks, Playground snippets and Initializr launchers.--fulladds SpotBugs/PMD/Checkstyle via the quality report, the build hint catalog, cast semantics, Mermaid rendering, the Hugo build and the guide's Java snippet compile.NOT RUN.setup-javaversion, and fails rather than run on the wrong JDK.if:and always runs withpipefail.<git common dir>/cn1-pre-push-gates. The Claude Code hook in.claude/settings.json(scripts/ci/claude-pre-push-hook.py) blocks an agent'sgit pushorgh pr createof a commit that isn't recorded there, or of a Java-changing commit recorded without--full. Humans pushing from a terminal are not affected.check-workflows.ymlrunspre-push-gates.sh --validate-steps, so renaming a step the gate names fails the PR that renames it. It also runs the hook's unit tests.validate-guide-snippets.pyhonoursCN1_MAVEN_REPO_LOCAL, so it never reads~/.m2, andCN1_GUIDE_SNIPPETS_NO_COMPILE.Verification
scripts/pre-push-gates.sh --fullpasses every gate. Only the guide figure comparison is NOT RUN, and it is CI-only.The local Vale (3.14.1) and Hugo (0.151.2) differ from the CI pins (3.13.0 and 0.171.0). The script warns about that. Hugo 0.151 cannot build master's site at all.
🤖 Generated with Claude Code