Skip to content

fix: route team slugs to team_reviewers API parameter and reflect failures in progress comment#423

Merged
captainsafia merged 2 commits intomainfrom
oz-agent/fix-team-reviewer-request
May 1, 2026
Merged

fix: route team slugs to team_reviewers API parameter and reflect failures in progress comment#423
captainsafia merged 2 commits intomainfrom
oz-agent/fix-team-reviewer-request

Conversation

@captainsafia
Copy link
Copy Markdown
Collaborator

Problem

The review workflow in oz-for-oss fails to actually request team reviews when a .github/STAKEHOLDERS entry references a GitHub team (e.g. @warpdotdev/oss-maintainers). The bot's progress comment claims the review was requested, but the GitHub API call silently fails because:

  1. Team slugs (containing /) are passed to the reviewers parameter, which only accepts individual user logins. Teams must go through team_reviewers.
  2. The GithubException is caught and logged, but the progress comment is updated unconditionally — always claiming success.

Observed on warpdotdev/warp#9691.

Changes

core/workflows/review_pr.py

  • Add _is_team_slug() — detects org/team format (presence of /)
  • Add _team_slug_only() — strips the org/ prefix for the GitHub API
  • Add _split_reviewers() — partitions a reviewer list into (user_logins, team_slugs)
  • Update apply_review_result to:
    • Split recommended reviewers into users and teams
    • Pass them to the correct API parameters (reviewers vs team_reviewers)
    • Only report successfully requested reviewers in the progress comment

tests/test_review_pr_reviewer_sampling.py

  • 12 new tests: team slug detection, slug stripping, reviewer splitting, API routing for team vs user, progress comment accuracy on success and on API failure

Testing

All 328 tests pass (including 12 new ones).


Conversation: https://staging.warp.dev/conversation/ef40de82-ea29-4fa3-aeab-b5ec896017d9
Run: https://oz.staging.warp.dev/runs/019de41d-84ed-77b8-930a-88afee1cc598

This PR was generated with Oz.

…lures in progress comment

STAKEHOLDERS entries like `warpdotdev/oss-maintainers` are GitHub
teams, not individual users. The review workflow was passing them to
the `reviewers` parameter of `create_review_request`, which only
accepts user logins. This caused a silent GithubException, and the
progress comment still claimed the review was requested.

Changes:
- Add `_is_team_slug()`, `_team_slug_only()`, and `_split_reviewers()`
  helpers to detect and partition team slugs from user logins
- Update `apply_review_result` to pass teams via `team_reviewers`
  and users via `reviewers`
- Only report successfully requested reviewers in the progress comment
- Add 12 new tests covering team slug detection, splitting, API
  routing, and progress comment accuracy on failure

Fixes the bug observed on warpdotdev/warp#9691 where
`@warpdotdev/oss-maintainers` was never actually requested.

Co-Authored-By: Oz <oz-agent@warp.dev>
@captainsafia captainsafia marked this pull request as ready for review May 1, 2026 15:32
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 1, 2026

@captainsafia

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR routes team stakeholder entries through GitHub's team_reviewers request parameter and avoids claiming reviewer-request success after GithubException failures.

Concerns

  • The new failure path still uses the generic no-reviewer completion copy, which can claim feedback was posted even when the reviewer request failed before any review body or inline comments were created.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread core/workflows/review_pr.py
Co-Authored-By: Safia Abdalla <captainsafia@users.noreply.github.com>

Co-Authored-By: Oz <oz-agent@warp.dev>
@captainsafia
Copy link
Copy Markdown
Collaborator Author

/oz-review

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 1, 2026

@captainsafia

I'm re-reviewing this pull request in response to a review request.

You can view the conversation on Warp.

I completed the review and posted feedback on this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR updates the review workflow to route GitHub team references through team_reviewers, preserve user logins in reviewers, and make the progress comment reflect whether the reviewer-request API call actually succeeded. The added tests cover slug parsing, request routing, and success/failure progress messaging.

Concerns

  • No blocking correctness or security concerns found in the changed lines.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR updates the review workflow to route GitHub team references through team_reviewers, preserve user logins in reviewers, and make the progress comment reflect whether the reviewer-request API call actually succeeded. The added tests cover slug parsing, request routing, and success/failure progress messaging.

Concerns

  • No blocking correctness or security concerns found in the changed lines.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown

@kevinchevalier kevinchevalier left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Copy Markdown
Collaborator Author

captainsafia commented May 1, 2026

Merge activity

  • May 1, 4:28 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 1, 4:29 PM UTC: @captainsafia merged this pull request with Graphite.

@captainsafia captainsafia merged commit cd6db9a into main May 1, 2026
4 checks passed
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