Skip to content

ci: allow manual dispatch of full integration - #4177

Merged
Daniel Meppiel (danielmeppiel) merged 2 commits into
mainfrom
p-ci-integration-dispatch
Nov 20, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 2 commits into
mainfrom
p-ci-integration-dispatch

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

Adds two opt-in ways to run the full merge-time integration suite (ci-integration.yml) before the merge queue is enforced:

  • workflow_dispatch on any branch of this repository (write access).
  • PR label full-integration: pull_request with types [labeled, synchronize, reopened]. Every job has if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'full-integration'), so unlabeled PRs skip the whole workflow.

merge-gate.yml: EXPECTED_CHECKS now branches on merge_group, then on the label. Labeled PRs also require Build, Smoke Test, Integration Tests and Release Validation (Linux). Unlabeled PRs never wait for them. The gate itself does not trigger on labeled: a skipped gate run for an unrelated label would count as passing. So: add the label, then push. The synchronize run then starts the suite, and the gate requires it.

Both modes run the same jobs as merge_group: full suite, integration coverage floor. The global 80% floor stays in ci.yml Coverage Combine (Linux), unchanged.

Sizing: the current 4-shard layout at -n 2 with a 20-minute cap would time out. Shard 1 hit the cap even with the 8-shard planner in #4149's rehearsal. So shards now use -n 4 with a 50-minute cap, and the gate's poll budget rises to 80 min (job timeout 90). The planner retune stays in #4149.

Security: pull_request never gives fork PRs repository secrets, so a labeled fork PR runs without them. pull_request_target and push stay forbidden, and a topology test fails if either appears. A newer push or label event cancels the older PR run (concurrency keyed on the PR number). merge_group and dispatch runs are never cancelled.

Issue and approved scope

Issue: Part of #4116

Human scope-approval comment: #4116 (comment) (the workflow_dispatch trigger is in scope; the label trigger was requested by the Stream P lead for the 0.37 landing train)

Does this PR complete the issue, or what remains? No. The rest of #4116 (build-release planner, closed-world topology guard, freshness alarm) is in #4149, which rebases on this.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally

  • All existing tests pass

  • Added tests for new functionality (if applicable)

  • New in tests/quality/test_ci_topology.py:

    • test_ci_integration_can_be_dispatched
    • test_full_integration_label_runs_and_gates_only_labeled_prs: exact trigger set and PR types; every job label-gated; unlabeled gate excludes the four checks; labeled gate equals unlabeled plus the four.
    • test_full_integration_opt_in_drift_fails (3 mutations: an ungated job, a pull_request_target trigger, and an unlabeled gate that requires the checks).
    • On main, the first two fail (no dispatch or label trigger).
  • uv run pytest -n 4 tests/quality/test_ci_topology.py tests/unit/test_windows_compat_gate_workflow.py tests/unit/test_security_workflow_contracts.py: pass

  • Lint chain (ruff check, ruff format --check, lint-architecture-boundaries.sh, check_test_assertions.py) and apm audit --ci (11/11): pass

Changelog

  • One line in one section under ## [Unreleased] in CHANGELOG.md:
    user-visible effect first, 25 words or fewer, ending with (#PR);
    breaking changes only under upgrade notes; no Highlights; see
    .github/instructions/changelog.instructions.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
    (new/changed <a id="req-XXX"></a> anchor + prose + Appendix C
    row).
  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml
    updated.
  • Test edit: a @pytest.mark.req("req-XXX") test under
    tests/spec_conformance/ added or extended.
  • CONFORMANCE.{md,json} regenerated via
    uv run --extra dev python -m tests.spec_conformance.gen_statement
    and committed.
  • N/A -- this PR does not change OpenAPM-observable behaviour.

ci-integration.yml runs on workflow_dispatch and on PRs labeled full-integration (every job label-gated); merge-gate.yml requires its four checks at PR time only on labeled PRs. Shards use -n 4 with a 50 min cap; gate poll budget 80 min.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The merge gate can pass on stale skipped checks before full integration completes, while unrelated label events can cancel required runs and leave the gate permanently failed.

2 open issues
What changed in this PR

Adds opt-in full integration runs before merge-queue enforcement, supporting the broader CI reliability work in #4116 while leaving planner changes to #4149.

Changes:

  • Enables manual dispatch and label-gated PR integration runs.
  • Requires integration checks for labeled PRs and increases worker counts and timeout budgets.
  • Adds topology regression tests and updates CI instructions and deployment hashes.
File Description
tests/​quality/​test_ci_topology.py Adds trigger, label-gating, and mutation checks.
apm.lock.yaml Updates hashes for deployed CI instructions.
.github/​workflows/​merge-gate.yml Adds label-dependent required checks and extends polling time.
.github/​workflows/​ci-integration.yml Adds opt-in triggers, PR concurrency, and increased execution capacity.
.github/​instructions/​cicd.instructions.md Documents opt-in integration paths and trigger restrictions.
.apm/​instructions/​cicd.instructions.md Updates the source CI instructions to match.

Review effort: Balanced

Comment thread .github/workflows/merge-gate.yml Resolved
Comment thread .github/workflows/ci-integration.yml Resolved
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
… shards

- ci-integration.yml: label-gated pull_request trigger on every job (from #4177); planner weights the in-process architecture suites 3x for --cov and plans up to 12 shards (target 300 s); shard cap 25 min.
- merge-gate.yml: three-context EXPECTED_CHECKS; poll budget 80 min.
- test_ci_topology.py and the merge-time-topology rule accept the label-gated pull_request trigger, still reject pull_request_target and push.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit a70686d into main Nov 20, 2026
35 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the p-ci-integration-dispatch branch November 20, 2026 10:06
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
…gate additions)

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants