Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't add "reviewed" label to "trivial" PRs #38

Closed

Conversation

davidpdrsn
Copy link
Member

Checklist

  • I have read the Contributor Guide
  • I have read and agree to the Code of Conduct
  • I have added a description of my changes and why I'd like them included in the section below

Description of Changes

Fixes #37

The biggest change is that pr_approved now always checks whether the PR is actually approved or not. It doesn't consider trivial PRs to always be approved. This gives us more control over when to add the "reviewed" label since that previously was always added if a PR was approved.

pub enum Approval {
Required,
#[allow(dead_code)]
Copy link
Member Author

Choose a reason for hiding this comment

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

Could probably remove this enum altogether. I can look into that in a follow-up PR.

Copy link
Contributor

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

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

This is breaking a previous feature: absence of a review label didn't block a review, before.

Also, the presence of skip-review basically means that you've auto-reviewed and accepted your changes, so it's kind of a self-approval, thus a review? 😛 I don't really care, since this is really about label aesthetics at this point, but the code in the main loop becomes rather messy because of this change.


if reviews.approved(review_required) {
if reviews.approved(Approval::Required) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is another subtle breaking change: the bool fed to that function before was depending on the presence of the skip review label, if it existed, AND the existence of a review label. At the very least, this parameter should be depending on the presence of the review label: Required if present, Optional if not. (It was the previous behavior before my patch, fwiw)

@davidpdrsn
Copy link
Member Author

Think I'll just close this for now. If this is still something we want we can always revisit it.

@davidpdrsn davidpdrsn closed this Mar 6, 2023
@davidpdrsn davidpdrsn deleted the david/dont-add-reviewed-label-to-trivial-prs branch March 6, 2023 12:56
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.

Don't add "reviewed" label if using "skip review"
3 participants