-
Notifications
You must be signed in to change notification settings - Fork 1
ci: validate stacked pull request bases #1562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
seonghobae
wants to merge
37
commits into
chore/stacked-pr-governance-gate-support
Choose a base branch
from
codex/stacked-pr-workflow-triggers
base: chore/stacked-pr-governance-gate-support
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 8 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
4f8daef
fix: create workspace_entities/workspace_documents and provision Work…
claude 31b400c
fix(data): serialize workspace provisioning
seonghobae 37bcd6e
fix(data): bind documents to organization scope
seonghobae bfe347e
test: cover the workspace/organization collision in the quality surface
claude 317c721
fix: guard 0016 against a genuinely missing workspace_documents table
claude e05f1b3
test(data): reproduce legacy document organization scope regression
seonghobae 5054a8e
fix: trust legacy NULL-organization documents only for the owning org
claude 6fe1de1
fix: reconcile emails/email_records fix with PR #1502
claude 053c066
fix: guard 0011_email_read_state on column, not just table, existence
claude d3020ca
fix: make 0011_email_read_state's downgrade non-destructive
claude da2d7fe
fix: add forward migration repairing already-stamped is_read gap
claude 2beaf0e
fix: preserve document scope migration data
seonghobae 9c4e5ed
fix: create legacy index through SQLAlchemy
seonghobae 9c18513
fix: explain intentional best-effort DB teardown swallow
claude b4cb934
ci: validate stacked pull request bases
seonghobae 804b5e7
docs(governance): define stacked validation gate
seonghobae 1ac1f82
fix(actions): activate locked pnpm before cache
seonghobae f209170
merge(stack): build trigger repair on governance owner
seonghobae 9990a99
fix(test): install Starlette TestClient dependency
seonghobae 3a4ec58
test(deps): verify Starlette client pin hashes
seonghobae 948f1e3
test(actions): preserve Bandit rerun isolation in successor
seonghobae bfc87a3
fix(actions): preserve Bandit rerun isolation in stacked-base repair
seonghobae ac46035
test(actions): compose stacked-base and rerun concurrency contracts
seonghobae bc91b36
fix(actions): compose stacked-base and rerun concurrency identities
seonghobae 52dfc86
test(deps): verify Starlette httpx2 runtime
seonghobae 19d5860
fix(migrations): inherit locked TestClient prerequisite
seonghobae ef85817
fix: run migrated PostgreSQL evidence in Application CI
seonghobae e30aa0d
fix(deps): integrate patched js-yaml prerequisite
seonghobae 4d2e4ab
Merge branch 'codex/js-yaml-4-3-1' of https://github.com/ContextualWi…
seonghobae 30d8476
fix(ci): preserve isolation in migration subprocesses
seonghobae b2e98a5
fix(ci): separate signal probe startup observation
seonghobae 1f538b1
fix(ci): retain cancellation during process registration
seonghobae b0d1bb6
merge: inherit multiline governance owner repair
seonghobae 0648eac
fix(ci): inherit complete stale-notice governance repair
seonghobae 938d4b1
merge: inherit complete review publisher and warning repair
seonghobae 0ec1cf9
merge(ci): inherit clean-summary governance repair
seonghobae cdef603
merge(ci): inherit complete security prerequisite stack
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| """Regression tests for GitHub Actions concurrency boundaries.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| import yaml | ||
|
|
||
|
|
||
| REPO_ROOT = Path(__file__).resolve().parents[2] | ||
|
|
||
|
|
||
| def _load_workflow(workflow_name: str) -> dict[str, object]: | ||
| path = REPO_ROOT / ".github" / "workflows" / workflow_name | ||
| assert path.exists(), f"workflow is missing: {workflow_name}" | ||
| parsed = yaml.safe_load(path.read_text(encoding="utf-8")) | ||
| assert isinstance(parsed, dict), ( | ||
| f"workflow must parse as a mapping: {workflow_name}" | ||
| ) | ||
| return parsed | ||
|
|
||
|
|
||
| def test_bandit_cancels_only_superseded_pull_request_runs() -> None: | ||
| """Keep manual, push, and rerun scans independent while deduplicating first PR scans.""" | ||
| concurrency = _load_workflow("bandit.yml").get("concurrency") | ||
|
|
||
| assert isinstance(concurrency, dict) | ||
| assert concurrency == { | ||
| "group": "${{ github.workflow }}-${{ github.repository }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event_name == 'pull_request' && github.run_attempt == 1 && github.event.pull_request.number || github.run_id }}", | ||
| "cancel-in-progress": "${{ github.event_name == 'pull_request' && github.run_attempt == 1 }}", | ||
| } |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a maintainer reruns this workflow from an older PR head while current-head image validation is running, both attempts share this PR-only group and the stale rerun cancels the required current-head run. Tag runs for the same ref also share one group, so
cancel-in-progress: falsestill permits GitHub concurrency to replace an older pending publication, contrary to the documented non-cancellation contract. Mirror Bandit's first-attempt PR cancellation plusrun_idisolation and cover Docker inbackend/tests/test_workflow_concurrency.py.AGENTS.md reference: AGENTS.md:L192-L192
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current head 1f538b1: the finding is valid, but copying Bandit's run_id suffix is not a complete repair.
Repair must separate trusted current-head admission and PR validation cancellation from a shared-target release/deployment lock, exact-revision/idempotency checks and retained/recoverable release intent. Matrix components must not cancel sibling validations. Reuse the canonical .github owner contract rather than copying a local scheduler or appending arbitrary group suffixes. Do not waive this finding based on prior backend tests.
Reference: GitHub. (n.d.). Control the concurrency of workflows and jobs. https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/control-workflow-concurrency (accessed2026-09-06). No workflow, release, ruleset or PR-state mutation made by this diagnosis.