Skip to content

ci: automatically assign new reviewers#620

Open
sdiazlor wants to merge 4 commits intomainfrom
feat/utomatically-assign-reviewers
Open

ci: automatically assign new reviewers#620
sdiazlor wants to merge 4 commits intomainfrom
feat/utomatically-assign-reviewers

Conversation

@sdiazlor
Copy link
Copy Markdown
Collaborator

@sdiazlor sdiazlor commented Apr 7, 2026

Description

New workflow to automatically assign the PRs based on the latest update and codeowners. If no updates, I or Minette will dispatch the reviewsers.

Related Issue

Fixes #(issue number)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactor (no functional change)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Testing

  • I added or updated tests covering my changes
  • Existing tests pass locally (uv run pytest -m "cpu and not slow")

For full setup and testing instructions, see the Contributing Guide.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code, especially for agent-assisted changes
  • I updated the documentation where necessary

Thanks for contributing to Pruna! We're excited to review your work.

New to contributing? Check out our Contributing Guide for everything you need to get started.

Note:

  • Draft PRs or PRs without a clear and detailed overview may be delayed.
  • Please mark your PR as Ready for Review and ensure the sections above are filled out.
  • Contributions that are entirely AI-generated without meaningful human review are discouraged.

First Prune (1-year OSS anniversary)

First Prune marks one year of Pruna’s open-source work. During the initiative window, qualifying merged contributions count toward First Prune. You can earn credits for our performance models via our API.

If you’d like your contribution to count toward First Prune, here’s how it works:

  • Initiative window: First Prune starts on March 31.
  • Issue assignment: For your PR to count toward First Prune, the related issue must be assigned to the contributor opening the PR. Issues are labeled with first-prune.
  • Open for review: Please open your PR and mark it ready for review by April 30 (end of April).
  • Review priority: We’ll make our best effort to review quickly any PR that is open and has a review request before April 30.
  • Credits: Each qualifying merged PR earns 30 credits. We’ll be in touch after all qualifying PRs for First Prune have been merged.
  • To get started: Have a look at all models. You’ll need to sign up on the dashboard before you can redeem your credits.

@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 7, 2026

Not up to standards ⛔

🔴 Issues 1 critical · 1 minor

Alerts:
⚠ 2 issues (≤ 0 issues of at least minor severity)

Results:
2 new issues

Category Results
UnusedCode 1 minor
Complexity 1 critical

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@sdiazlor sdiazlor marked this pull request as ready for review April 8, 2026 22:46
Copy link
Copy Markdown
Collaborator

@gsprochette gsprochette left a comment

Choose a reason for hiding this comment

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

Super good PR, thanks for taking care of it. I left a few comments, nothing blocking just questions to make sure the behavior is intentional, I trust you with your final decision :)

/.github/PULL_REQUEST_TEMPLATE/ @minettekaum @sdiazlor

# Dependencies and packaging
/pyproject.toml @gsprochette @begumcig
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I guess we can also add the pre-commit-hook file, or do you want to dispatch this one manually?


parts = line.split()
pattern = parts[0]
owners = [owner.removeprefix("@") for owner in parts[1:]]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should there be if owner.startswith("@") here?


users_requested, teams_requested = pr.get_review_requests()
users_requested = list(users_requested)
if users_requested:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should we check that there are at least 2 reviewers? In the case where there is a single one we could automatically assign a second one.
I don't think so, 1 seems enough, just making sure this is on purpose.

login = commit.author.login
if login in owners:
latest_owner_matches[login] += file.changes
break
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

so we're breaking after finding only the single most common author, but we're also looking for 2 reviewers. It seems to me that we would like to get at least the last two commits from each file, which might do +1 to two people or +2 to a single one. Maybe even the last 4 commits?

Copy link
Copy Markdown
Contributor

@minettekaum minettekaum left a comment

Choose a reason for hiding this comment

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

Thanks for creating the PR :D I don't have anything to add to Gaspar's comments

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