Skip to content

ci: mirror linked issues' priority label on PRs - #13127

Merged
julian-risch merged 5 commits into
mainfrom
ci/sync-priority-labels
Oct 7, 2026
Merged

julian-risch merged 5 commits into
mainfrom
ci/sync-priority-labels

Conversation

@julian-risch

@julian-risch julian-risch commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Related Issues

  • None. I suggest to copy the priority label (P0–P3) from the issues a PR links onto the PR so that we sort PRs we need to review by priority.

Proposed Changes:

New workflow priority_label_sync.yml that copies the priority label (P0–P3) from the issues a PR links onto the PR:

  • PR opened, reopened, or description edited (pull_request_target): labels the PR from its linked issues. This covers Fixes #123 in the description at open time, and issues linked later by editing the description.
  • Priority label added to or removed from an issue (issues: labeled/unlabeled, filtered to P0–P3): re-syncs every open PR that links that issue. An issue that gets its priority after the PR was opened, or whose priority changes, updates the PR.
  • Daily sweep at 05:00 UTC plus workflow_dispatch: re-syncs all open PRs. This catches issues linked through the "Development" sidebar, because GitHub sends no event for those links.

Rules for edge cases:

  • If the linked issues have different priorities, the PR gets the highest one, and any other P* label on the PR is removed.
  • Once no linked issue has a priority, or the PR no longer links an issue, the workflow removes the P* labels it added itself. It knows which ones those are from the PR's labeled events (actor github-actions). Priority labels set by hand stay.
  • Every run compares the PR's labels with its linked issues' current labels instead of relying on the event payload. So the daily sweep also catches up on runs that were dropped or failed.
  • Only issues in deepset-ai/haystack count, as in linked_issue_review.yml. Community members couldn't link private issues anyway.

How did you test it?

  • Ran the sweep query read-only against the repo with gh api graphql successfully
  • Ran the script on mocked synthetic PRs locally:
    • labels the workflow added are removed when the issue's priority is removed or the issue is unlinked
    • labels set by hand stay, including one re-added by hand after the workflow had added it
    • an issue's priority replaces a different label set by hand
    • a 404 on removeLabel is ignored
    • an error on one PR fails the run at the end without stopping the others

Notes for the reviewer

  • Of 57 open PRs, 32 link an issue. The first run will add a label to 17 of them. We could consider enforcing that community PRs need to be linked to an issue but I see that as independent of this PR.
  • pull_request_target gives the workflow write access on fork PRs too. This is safe because the workflow never checks out or runs PR code.

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes. — n/a, no related issue
  • I have added unit tests and updated the docstrings. — n/a, CI workflow
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines. — n/a, CI-only change
  • I have run pre-commit hooks and fixed any issue. — n/a, no Python files changed; ran actionlint instead

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
haystack-docs Ignored Ignored Preview Oct 7, 2026 5:50am UTC

Request Review

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread .github/workflows/priority_label_sync.yml Outdated
@julian-risch
julian-risch marked this pull request as ready for review October 6, 2026 08:14
@julian-risch
julian-risch requested a review from a team as a code owner October 6, 2026 08:14
@julian-risch
julian-risch requested review from sjrl and removed request for a team October 6, 2026 08:14
Comment thread .github/workflows/priority_label_sync.yml
Comment thread .github/workflows/priority_label_sync.yml Outdated
Comment thread .github/workflows/priority_label_sync.yml Outdated
Comment thread .github/workflows/priority_label_sync.yml Outdated
Comment thread .github/workflows/priority_label_sync.yml Outdated
Track which priority labels the workflow added via the PR's labeled
events, so the sweep and unlinked issues also clean them up. Isolate
non-priority issue events in their own concurrency group, tolerate 404s
on removeLabel, and keep the sweep going when one PR fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread .github/workflows/priority_label_sync.yml Outdated
Comment thread .github/workflows/priority_label_sync.yml Outdated
Co-authored-by: Julian Risch <julianrisch@gmx.de>
@julian-risch
julian-risch requested a review from sjrl October 7, 2026 05:50

@sjrl sjrl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@julian-risch
julian-risch merged commit 39748fd into main Oct 7, 2026
20 checks passed
@julian-risch
julian-risch deleted the ci/sync-priority-labels branch October 7, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants