Skip to content

Restore error guards on AI labeler edit calls#180

Merged
jeremy merged 1 commit intomainfrom
labeler-error-guards
Mar 3, 2026
Merged

Restore error guards on AI labeler edit calls#180
jeremy merged 1 commit intomainfrom
labeler-error-guards

Conversation

@jeremy
Copy link
Member

@jeremy jeremy commented Mar 3, 2026

Summary

  • Fix AI labeler no-op relabeling noise #179 removed the 2>/dev/null || true guards when it made labeling conditional
  • The label snapshot from gh pr view can go stale if another workflow or human changes labels between the read and the edit — without guards, that race fails the job
  • Restores 2>/dev/null || true on both remove and add calls

Test plan

  • Concurrent label change between snapshot and edit doesn't fail the workflow

The label snapshot can go stale between gh pr view and the subsequent
edits if another workflow or human changes labels concurrently. Keep
the 2>/dev/null || true guards so a race doesn't fail the job.
Copilot AI review requested due to automatic review settings March 3, 2026 08:40
@github-actions github-actions bot added ci CI/CD workflows bug Something isn't working labels Mar 3, 2026
Copy link

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 restores 2>/dev/null || true error guards on the two gh pr edit calls inside the classify job's "Apply label" step, which were inadvertently removed in #179. Without these guards, a race condition between the label snapshot (gh pr view) and the subsequent edit can cause the workflow to fail if labels change in between. The fix is minimal and surgical.

Changes:

  • Restore 2>/dev/null || true on gh pr edit --remove-label to tolerate stale-snapshot races
  • Restore 2>/dev/null || true on gh pr edit --add-label for the same reason

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

@jeremy jeremy merged commit f5f188f into main Mar 3, 2026
25 checks passed
@jeremy jeremy deleted the labeler-error-guards branch March 3, 2026 18:08
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