Skip to content

Restore main when a merge-group deploy succeeds after its PR was evicted #4176

Closed

Description

@devantler

🤖 Generated by the Agentic Engineer

Part of #3091.

Problem

The heal job restores main only after a merge-group deploy fails or is cancelled. A deploy can also succeed after the merge queue has already dropped its PR, either because the queue's 60-minute check timeout expired while the deploy waited on the prod-deploy lock, or because the PR was dequeued by hand. The first occurrence on #3091 is exactly this case: the evicted PR's deploy succeeded 17 minutes after its eviction. Prod is then left running an artifact that never reaches main, and nothing restores it until some later merge overwrites it.

Expected behaviour

When a merge-group deploy succeeds but its PR is no longer queued and has not merged, the heal restores main, exactly as it does after a failed deploy.

Acceptance criteria

  • After a successful merge-group deploy, the workflow reads whether the PR is still queued or already merged.
  • The heal fires when the PR left the queue without merging. It does not fire when the PR is still queued or merged.
  • If that read fails, the check fails visibly and the heal does not run on a guess.
  • The heal-contract validator pins the new job and the widened condition, with ablations.

Size: small. This is one workflow job, one script with its test, and validator updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    None yet

    Effort

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions