Repository navigation
ci: make PR preflight deterministic and observable - #9410
Merged
Merged
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
This branch was successfully deployed
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.
What changed and why
Closes #9408.
Adds one fast PR-contract engine shared by local development and GitHub Hygiene. It selects checks from the exact base/head diff, validates current PR metadata, and reports per-phase timings and remediation. Hygiene now fetches the current PR body through the GitHub API, including on body edits and reruns.
Pre-push execution is now single-flight per worktree and exact input fingerprint. Identical concurrent pushes join one run; different input fails with the active PID, phase, and stable log path. Hook-owned child process groups and locks are cleaned up without touching unrelated Git or app processes.
The fast contract path remains separate from expensive builds and tests. On this 11-file PR it completed in 0.43 seconds.
Product invariants affected
none
How it was verified
python3 .github/scripts/test_pr_preflight.py— 6 tests passed, including a PR fix(desktop): keep managed agents on cloud routing #9402-equivalent missing-invariant/missing-flow fixture and two-process single-flight coverage.python3 .github/scripts/test_check_product_invariants.py— 14 tests passed.python3 .github/scripts/test_check_brand_ui.py— 6 tests passed.actionlint -shellcheck '' .github/workflows/repo-checks.yml— passed.scripts/pr-preflight --pr-body-file .github/PULL_REQUEST_TEMPLATE.md— 4 selected contract checks passed in 0.43 seconds after the final rebase.updated_at, then passed the selected contract checks in 0.99 seconds..github/scripts/run-pre-push.shand the realgit pushhook — passed workflow contracts, OpenAPI generation, backend type checking, Swift debug build, Rustcargo check, ratchets, and formatting checks. Stable phase/status/log artifacts were inspected during the run.Tests
Regression coverage lives in
.github/scripts/test_pr_preflight.py. It covers current-body parsing/provenance, deterministic check selection, the original #9402 failure modes, identical-run joining, different-input rejection, result propagation, and observable state/log files.Scoped cleanups (optional)
None.