Skip to content

unassign-inactive-assignees never detects linked PRs, so assignees with open PRs get unassigned #30092

Open

Description

@abhiramshaji-cyber

What happened?

It looks like unassign-inactive-assignees never recognizes a linked PR, so contributors with an open, ready PR are getting unassigned after 7 days anyway.

First, thank you for all the work getting this workflow running again (#29298, #29326, #29609, #29770). It's been running cleanly since Oct 17, which is how I noticed this.

What the workflow is for: per the file header, it frees up "help wanted" issues whose assignee has no non draft PR (open and ready, or merged) linked within 7 days.

Current behavior:

  1. The workflow loads the issue timeline and looks at cross-referenced events.
  2. Line 184 skips any event where event.source.type !== 'pull_request'.
  3. As far as I can tell, the REST timeline API reports cross referenced PRs as source.type: "issue", with source.issue.pull_request set instead.
  4. So every event is skipped, and the readiness check (pulls.get, then isReady) never runs.
  5. linkedPRAuthorSet stays empty, and every non privileged assignee past 7 days is removed, even with an open, ready PR that closes the issue.

Minimal repro:

gh api repos/google-gemini/gemini-cli/issues/28052/timeline --paginate \
  --jq '.[]|select(.event=="cross-referenced")|{t:.source.type, pr:(.source.issue.pull_request!=null), n:.source.issue.number}'

Every PR (28054, 28069, 28200, ...) comes back as "t": "issue", "pr": true.

The run logs seem to agree: the PR ... state= line never prints in runs 41291334509, 41186944793, 41030516312, 40478041559 or 39019643178. A couple of examples:

Where the PR check stops today:

flowchart TD
  A[cross-referenced event] --> B{source.type === 'pull_request'?}
  B -- "no (API sends 'issue')" --> X[skip event]
  B -- yes --> C[pulls.get]
  C --> D{isReady?}
  D -- yes --> E[keep assignee]
  D -- no --> F[may unassign]
  X --> F
Loading

Suggested fix (one line):

-                  event.source.type !== 'pull_request' ||
+                  !event.source.issue?.pull_request ||

I also noticed #28798 was closed on Oct 28 on the idea that open PRs keep assignments indefinitely. From the logs it seems to be the reverse right now, so it might be worth a second look once this is sorted.

What did you expect to happen?

An assignee with an open, non draft PR linked to the issue (or a merged one) should stay assigned, as the file header describes. The PR ... state= log line should show up for each linked PR.

Client information

Client Information

Not applicable, this is the .github/workflows/unassign-inactive-assignees.yml GitHub Actions workflow on main (6814e00).

Login information

Not applicable.

Anything else we need to know?

One question I wasn't sure about: which policy would you prefer here? The smallest fix above counts any cross referencing non draft PR. A stricter option would be to only count PRs that actually close the issue (closingIssuesReferences via GraphQL), so a passing mention can't keep an assignment alive. Happy to open a PR for whichever you think fits best, and of course I may be missing some context.

Activity

  1. added
    status/need-triageIssues that need to be triaged by the triage automation.
    area/platformIssues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmt
    on Nov 2, 2026
  2. yuvrajangadsingh commented on Nov 2, 2026

    @yuvrajangadsingh
    Contributor

    another real case from today: the bot unassigned me from #29945 even though #29977 (open, not a draft, Fixes #29945) has been up since Oct 27.

    the #29945 timeline shows both linked PRs (#29948 and #29977) as source.type: "issue" with source.issue.pull_request set, same as your repro.

  3. ANUBprad commented on Nov 2, 2026

    @ANUBprad

    Hi! I'd like to work on this issue as a community contribution.

    I've inspected .github/workflows/unassign-inactive-assignees.yml and the reported source.type mismatch appears to be the root cause. I can work on a focused fix to correctly identify cross-referenced PRs, along with validation for open, draft, and merged PR cases.

    Could a maintainer confirm the intended handling and mark this help wanted if it's suitable for community contribution?

  4. abhiramshaji-cyber commented on Nov 2, 2026

    @abhiramshaji-cyber
    Author

    Hey @yuvrajangadsingh, thanks so much for adding this, and sorry the bot caught you too. I checked the #29945 timeline and it lines up exactly: #29948 and #29977 both show up as source.type: "issue" with source.issue.pull_request set, and #29977 is yours, open and not a draft. So it looks like the same root cause, and a really helpful second data point.

    Hi @ANUBprad, thank you for offering to pick this up, that's really kind! In case it saves you some digging: the filter is in the cross-referenced loop in .github/workflows/unassign-inactive-assignees.yml, around lines 180 to 189 on current main, where linkedPRAuthorSet gets filled. The #29945 timeline might be handy for checking the fix, since it has two real PRs plus a cross reference from this issue (pull_request not set) that should still be skipped.

    I'm very happy for you to take it, I'll just leave the call to the maintainers. The open question from the original post still stands too: should any linked non draft PR count, or only PRs that actually close the issue (closingIssuesReferences)? I'd love to hear what everyone thinks.

  5. abhiramshaji-cyber commented on Nov 7, 2026

    @abhiramshaji-cyber
    Author

    Hi maintainers, hope you're doing well! I know the triage queue is busy right now, so no rush at all. Would a small reproduction or any more detail from the timelines help here? Whenever someone gets a chance, it'd be great to know whether @ANUBprad is good to go ahead, and whether any linked non draft PR should count or only ones that close the issue.

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

    area/platformIssues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmtstatus/need-triageIssues that need to be triaged by the triage automation.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions