Skip to content

Cancel superseded PHPUnit runs per pull request - #751

Merged
rmcdaniel merged 5 commits into
mainfrom
ci/phpunit-superseded-runs
Oct 24, 2026
Merged

rmcdaniel merged 5 commits into
mainfrom
ci/phpunit-superseded-runs

Conversation

@rmcdaniel

@rmcdaniel rmcdaniel commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Updating or reopening a PR could leave duplicate PHPUnit cycles consuming runners. Job-level always() also kept an older job alive after cancellation was requested. Give each PR one native concurrency group and allow its feature/final qualification jobs to stop when cancelled, while continuing to report dependency failures.

Main and manual qualifications have independent run IDs. All test, coverage, action-policy and cleanup commands are preserved; cleanup steps still run unconditionally. Actionlint1.7.7 and the current central action policy pass locally. Hosted cancellation and full current-head qualification are in progress; the earlier policy-contract failure is preserved as failed, with its fail-closed behavior verified.

Refs #750. GitHub documents why a bare job-level always() resists cancellation. The temporary base probe did not trigger PHPUnit and is removed; the PR is back on main. Native fixture execution/source and publisher workflows are unchanged.

@rmcdaniel
rmcdaniel changed the base branch from main to ci/750-concurrency-probe-base-20261024t2214 October 24, 2026 22:14
@rmcdaniel
rmcdaniel changed the base branch from ci/750-concurrency-probe-base-20261024t2214 to main October 24, 2026 22:14
@rmcdaniel
rmcdaniel marked this pull request as ready for review October 24, 2026 22:28
@rmcdaniel

Copy link
Copy Markdown
Member Author

Security review of exact head d5bf1d0 (tree e9ffdf4ba73542970616743b97f8b3f833da6d6e): no blocking finding. The change is limited to phpunit-feature.yml. Its concurrency key uses event plus PR number so only a newer cycle for the same pull request is superseded; main and manual runs use unique run IDs, and cancel-in-progress is false outside pull_request. Both feature and final qualification retain always() failure reporting while adding !cancelled(), so policy/test failures remain visible and a superseded run can terminate. Workflow permissions, action pins, test/coverage commands, policy gates and cleanup steps are unchanged. Hosted predecessor 40138507216 proves automatic cancellation of the live feature job while cleanup completed; its final-gate failure is preserved evidence for the qualification guard added by this exact head. Central policy, actionlint and repository contracts pass. Merge remains gated on terminal checks for this exact head. The shared maintainer account cannot formally approve its own pull request, so this comment records the independent Security review.

@sonarqubecloud

Copy link
Copy Markdown

@rmcdaniel

Copy link
Copy Markdown
Member Author

Hosted cancellation proof for current d5bf1d0addb07cab002ce58398376ca5e86bc84b:

  • The new cycle40138591249 was created22:26:49UTC. Its live predecessor 40138507216 automatically cancelled the running feature job at22:27:24: 35seconds, then completed cancellation at22:27:29. No cancel API or UI action was used on that predecessor.
  • This reproduces and corrects the job-level always() problem seen in the earlier probe. Cleanup completed during cancellation; the old final qualification's failure is retained as evidence for the cancellation-aware final guard now in this exact head.
  • Current action-policy and repository-contract checks pass. Actionlint1.7.7 and the existing central policy also pass locally. The earlier plain !cancelled() policy-contract failure remains failed; both downstream required gates correctly refused that failed policy result.
  • Independent Security review accepted this exact head. The final full feature/CodeQL checks are still live; merge waits for their terminal result.

The source commands, checks and cleanup remain intact, and main/manual cycles use independent run identities. The temporary same-commit base probe did not trigger PHPUnit and was removed; the PR targetsmain. Retargeting alone was not the #745 duplicate trigger: its owner confirmed that a close/reopen after retargeting created the extra run.

@rmcdaniel
rmcdaniel merged commit dcb2d71 into main Oct 24, 2026
22 checks passed
@rmcdaniel
rmcdaniel deleted the ci/phpunit-superseded-runs branch October 24, 2026 22:41
@rmcdaniel

Copy link
Copy Markdown
Member Author

PR #751 merged normally at dcb2d718085b8ae91ce7e58a0cf5e2b9a5daa176, preserving the exact reviewed/qualified tree e9ffdf4ba73542970616743b97f8b3f833da6d6e. All final-head PR checks passed, including full PHP qualification and CodeQL. Security review accepted the same head, and the merged remote branch is verified absent.

Automatic cancellation is measured: the superseded live feature job stopped35seconds after its successor was created; no manual cancel was used for that proof. All test/coverage/policy and cleanup commands remain intact. Main and manual runs have independent run IDs.

Independent main verification is now running at this exact merge: PHP qualification, CodeQL, Sonar, and the public-boundary workflow (already passed). Keep #750 open until this final verification is terminal; do not reinterpret the earlier failed policy-contract probe or cancelled predecessors as passing runs.

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.

1 participant