Repository navigation
ci: gate master on required checks and validate PR titles - #360
Merged
Merged
Conversation
A release PR merged after master moves fails release validation, because its squash parent is no longer the recorded base, and every later Prepare release run then refuses to plan. Strict status checks block that merge until the bot refreshes the PR.
Deploying podnotes with
|
| Latest commit: |
76ce75f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2f5d2dae.podnotes.pages.dev |
| Branch Preview URL: | https://ci-gates-and-governance.podnotes.pages.dev |
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.
Why
Nothing stops a red PR from merging into
mastertoday, and the squash title that the release planner reads is never checked. This PR adds the workflows and a ruleset definition so thatmasteronly takes squash-merged PRs that passed every required check, with a title the planner reads correctly.What changed
PR Titleworkflow (Validate PR title) andDependency Reviewworkflow.Docsnow runs on every PR.Testcancels superseded PR runs, checks out without persisted credentials, and drops the deadtargetShainput and the duplicate type check (npm run buildalready runs it)..github/rulesets/protect-master.jsonblocks deletion and force push, allows only squash merges of up-to-date PRs, and requiresTest,Docs,Validate PR title,Dependency Review, andCodeQL, each pinned to the app that reports it.Scope
pull_request_targetrunspr-title.ymlfrommaster, soValidate PR titlecannot report on this PR.code_scanningalert rule, and a guard ruleset onrelease/**branches. Both are follow-ups.Tradeoffs
amannn/action-semantic-pull-request. That action's parser matchesfeat!:with a built-in breaking-header pattern that no input can override. The planner then plans no release for that title. The script rejects!and needs no third-party code in apull_request_targetjob.mastermoves, and every laterPrepare releaserun then refuses to plan. Strict checks block that merge until the bot refreshes the PR.Blast Radius
Every future PR needs the five checks, and must be up to date before it merges. The release flow cannot deadlock. The bot App opens the release PR, so it gets the normal
pull_requestandpull_request_targetruns. Each push tomasterforce-refreshes the PR onto the new head. Nothing in the pipeline pushes tomaster, so no bypass actor is needed.CodeQLreportsneutralon docs-only PRs, which counts as passing for a required check.Verification
actionlint1.7.12 on all workflows, then lint, format, typecheck, build, test (78 files, 1152 tests), and docs build pass locally on Node 22.23.2.pr-title.ymlscript under bash on 18 titles, with a mockghthat answers only the exact API call. It compares each title with the planner's commit analyzer. The script accepts every title the planner reads correctly and rejectsfeat!:, which QuickAdd's action config lets through. A realghread passes PR build(deps-dev): bump the npm-development-minor-patch group across 1 directory with 9 updates #343 and fails PR Feat/improvements #156.Testjob median over 10 dispatched runs each: 102s before, 87s after. About 8s of that is the removed type check (16s to 8s for the two steps). The rest is runner variance in the test step. This PR's own two runs took 94s, against 105.5s for the previous 10 PR runs.Test,Docs,Dependency Review, andCodeQLreport from the apps the ruleset pins (15368 and 57789).Validate PR titlestarts reporting oncepr-title.ymlis onmaster.Apply after merge:
Release impact: none. No
src/, settings, API, or URI change.