Repository navigation
ci: skip the full validation on pull requests that change only the changelog and the version - #272
Merged
Merged
Conversation
…angelog and the version bin/release's version pull requests change only CHANGELOG.md, package.json's "version" and src/version.ts, and ran the full validation anyway: #243 took 146 s, of it 93 s in test:coverage, and #240 439 s with the installed-platform matrix. pr.yml now fingerprints the pull request's tree with the changelog left out and both versions set to 0.0.0 (scripts/ci-fingerprint.sh). When that matches main, and main's own pull request passed standards and the three validation checks on the same tree (scripts/release-reuse.sh with EXTRA_CONTEXTS, because main's ruleset requires only standards), it runs version:check and docs:check and reports the validation checks as passed, saying why (scripts/ci-pass-checks.sh). Any doubt runs the full validation. main.yml still runs it after the merge. The same change as tg-cli#733, ported from WireCatLabs/cli-core#2022. Before: version PR #243 146 s wall (#240 439 s), feature PR #269 161 s. Expected after: a version PR about 35 s (standards is the slowest check left); 9 of the last 10 version PRs would have skipped. Other pull requests wait about 10 s more for the decision job. Co-Authored-By: Claude Opus 5.5 (1M context) <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.
Task
PERF-5 from the CI speed-up handoff: skip the heavy jobs on a pull request that changes only the version. The same change as WireCatLabs/tg-cli#733, ported from cli-core's WireCatLabs/cli-core#2022.
Why
bin/release's version pull requests change onlyCHANGELOG.md, the"version"inpackage.jsonandsrc/version.ts, and ran the full validation anyway. #243 took 146 s, 93 s of it intest:coverage; #240 took 439 s with the installed-platform matrix. zoom-cli has several of these a day.What
pr.ymlgets aversion-onlyjob first. It runsscripts/ci-unchanged.sh, which:CHANGELOG.mdleft out and both versions set to0.0.0(scripts/ci-fingerprint.sh);scripts/release-reuse.shwhether main's own pull request passedstandardsand the threevalidation / ci / …checks on the same tree. main's ruleset requires onlystandards, so the validation checks are passed asEXTRA_CONTEXTS.changelog-onlyrunspnpm version:checkandpnpm docs:check, then reports the threevalidation / ci / …checks as passed (so the next version pull request finds them) with a summary of the evidence (scripts/ci-pass-checks.sh). On "no", or when the decision fails, the full validation runs as before.main.ymlstill runs the full validation after the merge.src/version.tsis in the fingerprint (exactly oneVERSIONline, or the script fails and the full validation runs).version:checkruns on the skip path, because the fingerprint hides a mismatch between the two versions.release.ymlhas no tree reuse, so a release is unaffected.Testing
scripts/ci-fingerprint.test.ts: 6 cases, includingsrc/version.ts. Passing locally.release-reuse.shin pull-request mode, with the validation checks asEXTRA_CONTEXTS, givesreuse=truefor 9 of them. The tenth (chore: prepare Zoom 0.48.0 #268) followed perf(bin): a bare --version answers before the program loads #266, which merged behind main.🤖 Generated with Claude Code