Skip to content

Don't retag people who have already approved the PR - #8

Merged
nathan-cairns merged 2 commits into
mainfrom
dont-retag-approvers
Aug 10, 2026
Merged

nathan-cairns merged 2 commits into
mainfrom
dont-retag-approvers

Conversation

@nathan-cairns

@nathan-cairns nathan-cairns commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Background 📜

There was an issue where approvers were getting retagged on release PRs, this was making it hard to track who has approved a release and who hasn't.

Changes 📝

Just added some code to filter out people who have already approved the PR.

Screenshots 📷

Checklist ✅

  • Documentation updated (if appropriate)
  • Feature switches / experiments correctly configured in Unleash
  • Queries updated on Notion

Copilot AI 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.

Pull request overview

This PR updates the release PR bot to avoid re-requesting reviews from users who have already approved an existing release PR, reducing notification noise and improving clarity on release approval status.

Changes:

  • Add a listReviews call when updating an existing release PR to detect previously submitted approvals.
  • Filter out already-approved users from the set of reviewers to (re)request.
  • Add a Jest test covering the “already approved” scenario.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/actions/release-pr-bot/manage-release-pr.js Fetches submitted PR reviews and filters out approvers when computing new reviewers to request.
.github/actions/release-pr-bot/manage-release-pr.test.js Extends GitHub mock with listReviews and adds a test ensuring approvals are not re-requested.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/actions/release-pr-bot/manage-release-pr.js Outdated

@ritchtea ritchtea left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we need to update the version number anywhere too?

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (1)

.github/actions/release-pr-bot/manage-release-pr.js:150

  • listReviews returns the full history of reviews; filtering on any state === 'APPROVED' will exclude a reviewer even if their approval was later dismissed or replaced by a non-approval review. Also, currentReviews is actually the requested-reviewers response (naming), and the current mapping can add undefined logins into the Set.

Consider deriving the latest review state per user (and filtering out missing logins), and request per_page: 100 to reduce the chance of missing approvals on PRs with many reviews.

  const excludedLogins = new Set([
    ...currentReviews.users.map((u) => u.login),
    ...submittedReviews
      .filter((review) => review.state === 'APPROVED')
      .map((review) => review.user?.login),

@nathan-cairns

Copy link
Copy Markdown
Contributor Author

Do we need to update the version number anywhere too?

This is done with release tags, have a little script to do this after stuff is merged into main

@nathan-cairns
nathan-cairns merged commit b90771b into main Aug 10, 2026
4 checks passed
@nathan-cairns
nathan-cairns deleted the dont-retag-approvers branch August 10, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants