Skip to content

Fix AI labeler no-op relabeling noise#179

Merged
jeremy merged 1 commit intomainfrom
redundant-labeling
Mar 3, 2026
Merged

Fix AI labeler no-op relabeling noise#179
jeremy merged 1 commit intomainfrom
redundant-labeling

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 3, 2026

Summary

  • AI labeler was unconditionally removing and re-adding classification labels on every synchronize event, even when the label hadn't changed — producing timeline noise like "added bug and removed bug"
  • Now checks current labels first: only removes labels that differ from the chosen one and are actually present, only adds if not already there

Test plan

  • Push to a PR already labeled bug where the model still picks bug — verify no label events in timeline
  • Push to a PR labeled bug where the model now picks enhancement — verify bug removed and enhancement added
  • Open a new PR with no classification label — verify label is added normally

Check current labels before modifying. Only remove classification labels
that differ from the chosen one and are actually present; only add the
chosen label if it's not already there. Eliminates no-op label churn on
synchronize events.
Copilot AI review requested due to automatic review settings March 3, 2026 08:26
@github-actions github-actions bot added ci CI/CD workflows bug Something isn't working labels Mar 3, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes noisy PR timeline events caused by the AI labeler unconditionally removing and re-adding classification labels on every synchronize event, even when the label hadn't changed. It adds a check of the PR's current labels before making any gh pr edit calls.

Changes:

  • Fetch current labels before modifying them, and only remove a classification label if it's currently present and differs from the newly chosen one.
  • Only add the newly chosen label if it isn't already applied to the PR.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jeremy jeremy merged commit 6b9ef89 into main Mar 3, 2026
25 checks passed
@jeremy jeremy deleted the redundant-labeling branch March 3, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci CI/CD workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants