Skip to content

πŸ› Hive-authored draft PRs carrying prow's do-not-merge/work-in-progress label bypass the stale-draft rule (deadlock with covered_by_open_pr)Β #16246

Closed

Description

@clubanderson

Symptom

Hive-authored draft PRs deadlock: the scanner parks a PR as draft ("DEFER β€” stacked on #N"), prow's wip plugin mirrors the draft state with do-not-merge/work-in-progress, and from then on no lane ever revisits the PR or its issue.

Observed on #15890 / #15540 (sat in "PR in progress" for 2 days):

Mechanism

src/pkg/github/client.go fetchPRsWithDetails:

  1. if c.isExempt(labels) { … "Exempt label"; continue } runs before
  2. if pr.GetDraft() { … staleDrafts = append(...) } (app-authored, CreatedAt > staleDraftAfter = 48h).

PermanentExemptLabels = []string{"do-not-merge"} is a prefix match, so do-not-merge/work-in-progress exempts the PR at step 1 and step 2 never runs. Since prow adds that label to every draft, every hive-authored draft is shielded from the hive's own stale-draft rule, and the "YOUR STALE DRAFT PRs" kick section (pkg/scheduler/lane_messages.go) is never populated.

Meanwhile the linked issue is suppressed as covered_by_open_pr, so the issue lane won't re-dispatch either β†’ deadlock until a human notices.

Secondary: the "DEFER β€” stacked on #N" convention is free text; nothing re-kicks when #N merges. The stale-draft nag is the only backstop, and it is the one being bypassed.

Fix

Let a draft whose only exempt label is the prow WIP mirror fall through to the draft branch (so stale-draft surfacing works), while a real do-not-merge/hold etc. on a draft still exempts it. Small change in fetchPRsWithDetails + tests in stale_draft_test.go. PR to follow.

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

    bugSomething isn't workinghelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.hive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions