Repository navigation
ci(main): run the PR gate suite on every push to main (S28) - #4595
Merged
Merged
Conversation
Main went red on Lifecycle Smoke shard 4 for about 90 minutes unseen: ci.yml and merge-gate.yml run only on pull_request and merge_group. Add .github/workflows/main-push-gate.yml (push to main, workflow_dispatch). A base job resolves the lint base (the push's `before`, else HEAD^1), tier1 calls ci.yml unchanged through workflow_call, and the main-push-gate aggregate (if: always()) fails the run when any Tier 1 job fails, every Lifecycle Smoke shard included. Runs group by run_id and are never cancelled; it is not a required check. No new default-branch cache saves: every setup-uv step in ci.yml sets save-cache to 'auto' only on pull_request and merge_group and 'false' otherwise (PR and merge_group behaviour unchanged), and setup-node sets package-manager-cache: false. main-architecture-ratchets.yml mirrors the contract job's setup-uv input so the two stay identical. tests/quality/test_ci_topology.py pins the triggers, full ci.yml coverage (derived), the aggregate, no cancellation and the no-cache-save rule over every step reachable from a main push, with mutation cases. Document it in the cicd instructions source (redeployed with the tree apm) and the contributing integration-testing page. Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 21, 2026 10:47
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Static topology tests cannot verify the new workflow graph’s event propagation, execution, failure aggregation, or cache behavior, and hosted Actions validation on the integrated SHA remains pending with prerequisite #4582 still open.
No open issues 🎉
What changed in this PR
Closes the post-merge monitoring gap by running the full Tier 1 CI suite on every push to main, including all Lifecycle Smoke shards. It builds on #4582's reusable workflows without changing required checks.
Changes:
- Adds a non-cancelling main-push workflow with base-SHA resolution and an aggregate failure check.
- Prevents new default-branch cache saves while preserving existing PR and merge-group cache behavior.
- Includes the stacked merge-train and shared lint-chain infrastructure, with topology contracts and documentation.
| File | Description |
|---|---|
tests/workflow_contracts.py |
Adds composite-action loading and step expansion helpers. |
tests/unit/test_windows_native_symlink_workflow.py |
Checks lint coverage through the shared composite action. |
tests/quality/test_ci_topology.py |
Adds main-push, merge-train, cache, and lint ownership contracts. |
scripts/check_complexity_ratchet.py |
Updates a comment identifying the lint scope's owner. |
docs/src/content/docs/contributing/integration-testing.md |
Documents main-push validation and merge-train usage. |
apm.lock.yaml |
Refreshes deployed CI/CD instruction hashes. |
.github/workflows/merge-train.yml |
Adds exact-SHA train validation from the stacked prerequisite. |
.github/workflows/main-push-gate.yml |
Runs Tier 1 on main and aggregates failures. |
.github/workflows/main-architecture-ratchets.yml |
Disables cache saves for the main-push ratchet job. |
.github/workflows/ci.yml |
Enables reuse, shares lint steps, and restricts cache saves. |
.github/workflows/ci-integration.yml |
Enables Tier 2 reuse by merge trains. |
.github/instructions/cicd.instructions.md |
Updates deployed pipeline guidance. |
.github/actions/lint-chain/action.yml |
Centralizes lint checks for CI and merge trains. |
.apm/instructions/cicd.instructions.md |
Updates the source pipeline guidance. |
Review effort: Balanced
7 of 11 tasks
# Conflicts: # apm.lock.yaml
# Conflicts: # apm.lock.yaml # tests/quality/test_ci_topology.py
Main went red twice in the Integration suite, which ran on merge_group and dispatch only. main-push-gate.yml now also calls ci-integration.yml (every shard, secrets: inherit) as tier2, and the aggregate reads its result. ci-integration.yml adds no default-branch cache save on push: setup-uv saves only on pull_request and merge_group, setup-node caching is off, and the APM fetch cache is restored, then saved on no push. The topology tests pin coverage and the no-save rule, with mutation cases. Co-authored-by: Copilot App <[email protected]>
…in-watch # Conflicts: # apm.lock.yaml
…in-watch # Conflicts: # apm.lock.yaml
…atch # Conflicts: # .apm/instructions/cicd.instructions.md # .github/instructions/cicd.instructions.md # apm.lock.yaml
…atch # Conflicts: # .apm/instructions/cicd.instructions.md # .github/instructions/cicd.instructions.md # apm.lock.yaml
Merged
3 of 10 tasks
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.
Description
Regent order S28 ("watch gap"). Main was red on Lifecycle Smoke shard 4 for about 90 minutes and nobody saw it. ci.yml and merge-gate.yml trigger only on
pull_requestandmerge_group, and the push workflows on main stayed green.This PR runs the whole PR tier-1 suite on main's head after every merge:
.github/workflows/main-push-gate.yml, with triggerspush: branches: [main]andworkflow_dispatch(no inputs). Jobs:base: the push'sbeforeSHA, orHEAD^1when it is all zeros. It refuses any ref that is not main.tier1:uses: ./.github/workflows/ci.yml(theworkflow_calltrigger from ci(merge-train): exact-SHA train proof with train-gate (merge-queue v2 step 1) #4582) withbase_sha. That means EVERY ci.yml job, including all four Lifecycle Smoke shards, derived from ci.yml rather than duplicated. Onlycontents: read, and no secrets (ci.yml uses none).main-push-gate:if: always(). It needsbaseandtier1and fails on any non-success, so main goes visibly red.main-push-gate-<run_id>withcancel-in-progress: false. The callee group becomesci-<caller run_id>, which never collides with PR runs (ci-pr-N) or merge-train runs, and push runs are never cancelled.Caches: no new default-branch saves
Every setup-uv step in ci.yml gains
save-cache: ${{ (github.event_name == 'pull_request' || github.event_name == 'merge_group') && 'auto' || 'false' }}. pull_request and merge_group behave exactly as today. Every other event is restore-only: push, dispatch, and calls from this workflow or from merge-train. The pinned setup-uv68559e9...(v10.3.3) supportssave-cache. setup-node steps getpackage-manager-cache: false; there is no root package.json, so this is a no-op today. ci.yml has no setup-pythoncache:and noactions/cache.main-architecture-ratchets.yml:44mirrors the same line, so the existing exact-match ratchet contract holds. On push it now saves FEWER main-scope caches than before.Main-scope saves that already exist today, unchanged by this PR:
Contracts (tests/quality/test_ci_topology.py, 19 new tests)
always(), checked across result combinations.pull_request_target;always();lifecycle-smoke-shard-4to pull_request;if:on tier1;save-cache;actions/cache;setup-python cache: pip;package-manager-cache.Docs:
.apm/instructions/cicd.instructions.md(source) plus its deployed copy and the lock hash, andcontributing/integration-testing.md.Stacked on #4582, which adds the ci.yml
workflow_calltrigger. Until #4582 lands, the diff vs main includes it. Land #4582 first.Issue and approved scope
Issue: Refs #4574 (the merge-queue v2 CI topology; S28 depends on its workflow_call trigger)
Human scope-approval comment: Regent order S28 for Daniel, relayed by [OPS] Lead, Delivery on 2026-11-21. It asks to run the PR merge-gate suite on main's head after every merge, reusing jobs via workflow_call, with push runs never cancelled and no new default-branch cache saves.
Does this PR complete the issue, or what remains? It completes S28. #4574 completes with #4582.
Type of change
Testing
test_ci_topology.py -k "main_push or ratchet or merge_train or train or lint_chain or uv_environments or shared_cache or merge_group or merge_time or full_integration or quality_module or heavy_pr": 122 passed;-k main_push: 19 passed;apm audit --ci(tree apm): 15/15;--changedok; complexity ratchet clean.Changelog
## [Unreleased]inCHANGELOG.mdSpec conformance (OpenAPM v0.1)
Scope add (de55c11): Tier 2 on every push to main
Main went red twice on 2026-11-21 in the Integration suite, which ran only on merge_group and dispatch.
main-push-gate.ymlnow also callsci-integration.yml(every shard,secrets: inherit) astier2, andmain-push-gatereads its result. The push path adds no new default-branch cache saves:push.tests/quality/test_ci_topology.pypins the tier2 coverage and the no-save rule, with mutation cases (drop-tier2, integration-save-on-push, integration-uv-save).