Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# Every pull request target, including immutable stack branches, receives the
# same exact-head, synthetic-merge, and buyer-readiness acceptance evidence.
pull_request: {}

permissions:
contents: read
Expand Down
33 changes: 33 additions & 0 deletions scripts/test_ci_workflow_stack_coverage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""Verify that stacked pull requests retain the complete CI acceptance contract."""

from pathlib import Path
Comment thread
seonghobae marked this conversation as resolved.
import unittest


REPOSITORY_ROOT = Path(__file__).resolve().parents[1]
CI_WORKFLOW = REPOSITORY_ROOT / ".github" / "workflows" / "ci.yml"


class CiWorkflowStackCoverageTest(unittest.TestCase):
"""Exercises the stacked-pull-request workflow contract with standard discovery."""

def test_ci_runs_for_every_pull_request_base(self) -> None:
"""Stacked pull requests must receive the same exact-head CI as main-bound PRs."""
workflow = CI_WORKFLOW.read_text(encoding="utf-8")

self.assertIn(" pull_request: {}", workflow)
self.assertNotIn(" pull_request:\n branches: [main]", workflow)

def test_ci_preserves_exact_head_and_synthetic_merge_evidence(self) -> None:
"""Broadening PR coverage must not weaken exact-head or merge verification."""
workflow = CI_WORKFLOW.read_text(encoding="utf-8")

exact_head_expression = "github.event.pull_request.head.sha || github.sha"
self.assertGreaterEqual(workflow.count(exact_head_expression), 4)
self.assertIn('test "$(git rev-parse HEAD)" = "$EXPECTED_SHA"', workflow)
self.assertIn("name: Maven merge compatibility", workflow)
self.assertIn("name: Buyer-readiness script tests", workflow)


if __name__ == "__main__":
unittest.main()
Loading