Skip to content

fix(OMN-20482): auto-merge concurrency group carries the event class - #1878

Merged
jonahgabriel merged 1 commit into
devfrom
omn-20482-automerge-event-class-group
Oct 4, 2026
Merged

jonahgabriel merged 1 commit into
devfrom
omn-20482-automerge-event-class-group

Conversation

@jonahgabriel

@jonahgabriel jonahgabriel commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR fixes a concurrency race in the Auto-Merge workflow where check_suite runs were incorrectly cancelling pull_request runs for the same PR. This change updates the concurrency group to include the event name, ensuring that runs of different event classes do not cancel each other. Ticket: OMN-20482.

Lab: host=h201 (hostname omninode-pc) lane=automerge-cancel-race command=uv run --frozen pytest tests/unit/validation/test_auto_merge_concurrency_event_class_omn20482.py tests/unit/validation/test_auto_merge_workflow_shape.py tests/unit/scripts/ci/test_auto_merge_hold_omn18179.py -o addopts="" observed 73 passed; before the change the new test file failed 8 of its 12 tests, after it all 12 pass.

Cause

A check_suite run and a pull_request run for the same PR shared the concurrency group auto-merge-<pr>. Because cancel-in-progress was set to true, the check_suite run would cancel the pull_request run.

Evidence:

  • Annotation: The cancelled job contained the annotation: "Canceling since a higher priority waiting request for auto-merge-1869 exists".
  • Job Log: The cancelling check_suite run's job log explicitly named the same PR ("PR: 1869").
  • SHA Mismatch: The check_suite run executes at the default branch SHA, meaning its "Enable Auto-Merge" check-run lands on dev's SHA, never on the PR head. Consequently, the PR head retains only the cancelled copy of the check.
  • Verified Pairs: The following four pairs of runs (cancelled pull_request run / cancelling check_suite run) were identified for specific PRs:
    • 37125245233 / 37125283147 (PR 1869)
    • 37146734119 / 37146916402 (PR 1871)
    • 37162122992 / 37162433626 (PR 1876)
    • 37121651763 / 37121711512 (PR 1866)

Fix

The concurrency group in .github/workflows/auto-merge.yml is updated from auto-merge-${{ <pr number chain> }} to auto-merge-${{ github.event_name }}-${{ <same chain> }}. The cancel-in-progress setting remains true.

A new test file, tests/unit/validation/test_auto_merge_concurrency_event_class_omn20482.py, is added. This test renders the group expression and replays four real run pairs through GitHub's concurrency rules (one running and one pending run per group) to verify that no event class cancels another.

Behavior after fix:

  • A newer push still cancels the older pull_request run.
  • A newer check_suite completion still cancels the older check_suite run for that PR.
  • No event class cancels another.

Measurement

Between 2026-10-03T00:40Z and 2026-10-04T01:30Z, 12 pull_request runs were cancelled in this repo's Auto-Merge workflow. 10 of these cancellations occurred on heads with no successful Auto-Merge run. No head had CI Summary failing only on the cancelled copy in that window; every sampled head also carried other non-green check-runs.

The deferred test-passes gate in this repo already treats an annotated concurrency cancellation as superseded (OMN-17427). This change removes the source of the cancellations.

Not runtime-affecting

This change is limited to the CI workflow and tests. The .201 compose lanes are untouched. The surfaces exercised are the workflow concurrency expression, the pytest files listed in the Lab section, and the pre-commit hooks that run at commit.

Evidence-Ticket: OMN-20482
Evidence-Source: OCC#12707

The auto-merge concurrency group in .github/workflows/auto-merge.yml was auto-merge-${{ <pr number chain> }} with cancel-in-progress true. A check_suite run for a PR shared the group auto-merge-<pr> with that PR's pull_request run and cancelled it (annotation: "Canceling since a higher priority waiting request for auto-merge-1869 exists"). The check_suite run executes at the default branch sha, so its Enable Auto-Merge check-run lands on dev's sha, not the PR head; the head keeps only the cancelled copy. The real pair was pull_request run 37125245233 cancelled by check_suite run 37125283147 for PR 1869.

The group is now auto-merge-${{ github.event_name }}-${{ <same chain> }}; cancel-in-progress stays true.

New test: tests/unit/validation/test_auto_merge_concurrency_event_class_omn20482.py renders the group expression and replays four real run pairs through GitHub's concurrency rules; it failed 8 of 12 before the change and passes after.

Not runtime-affecting; CI workflow change only.
@jonahgabriel
jonahgabriel requested a review from a team as a code owner October 4, 2026 01:31
@jonahgabriel
jonahgabriel enabled auto-merge (squash) October 4, 2026 01:35
jonahgabriel pushed a commit to OmniNode-ai/onex_change_control that referenced this pull request Oct 4, 2026
…12707)

* evidence(OMN-20482): author OCC companion for OmniNode-ai/omnibase_core#1878

OCC companion by node_pr_lifecycle_fix_effect (OMN-13317 F1 / OMN-13990 / OMN-14285). Product PR head 94771aec8e9507d638597142c8bc8328998a47b6.

* evidence(OMN-20482): self-bind OCC#12707 + rebind contract_sha256

---------

Co-authored-by: omnimarket-bot <bot@omninode.ai>
@jonahgabriel
jonahgabriel merged commit 94bc357 into dev Oct 4, 2026
227 of 239 checks passed
@jonahgabriel
jonahgabriel deleted the omn-20482-automerge-event-class-group branch October 4, 2026 01:58
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