Skip to content

Bug Report: Automated PR triage system incorrectly labeling all PRs with status/need-issue #8522

@hoteye

Description

@hoteye

What happened?

Bug Description

The automated PR triage system is incorrectly applying the status/need-issue label to all open PRs, even when they have valid issue references in their descriptions.

Current Behavior

  • All PRs in the repository currently have the status/need-issue label
  • PRs with clear issue references (like "Addresses: Add internationalization (i18n) support to Gemini CLI #6525") are still being labeled as needing issues
  • The triage system runs every 15 minutes and continuously misapplies these labels

What did you expect to happen?

Expected Behavior

PRs that reference valid GitHub issues should not have the status/need-issue label applied.

Client information

Root Cause

The triage script in .github/scripts/pr-triage.sh only checks GitHub's closingIssuesReferences API field:

gh pr view "${PR_NUMBER}" --json closingIssuesReferences -q '.closingIssuesReferences.nodes[0].number'

This API field only populates when PRs use specific GitHub closing keywords:

But it ignores other valid reference formats:

Examples of Incorrectly Labeled PRs

Suggested Solutions

Short-term fix:

Update the triage script to also parse PR descriptions for issue number patterns (#\d+)

Long-term fix:

  1. Update PR templates to require "Closes #XXXX" format
  2. Add documentation about proper issue linking syntax
  3. Consider using regex parsing as fallback when closingIssuesReferences is empty

Login information

No response

Anything else we need to know?

Immediate action:

Consider manually removing incorrect status/need-issue labels from PRs that have valid issue references

Impact

  • Blocks legitimate PRs from proper workflow
  • Confuses contributors about whether their PRs are properly linked
  • Makes it difficult to identify PRs that actually need issue links
  • Potentially delays reviews and merges

Additional Context

This affects the entire contributor workflow and creates friction for both new and experienced contributors who are following reasonable issue-linking practices.

Labels

  • kind/bug
  • area/automation
  • priority/p1 (affects all contributors)

Metadata

Metadata

Assignees

Labels

Stalepriority/p2Important but can be addressed in a future release.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions