Skip to content

Add review_submitted handler which changes labels after a review #1379

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

Merged
merged 3 commits into from
Jun 23, 2021

Conversation

mibac138
Copy link
Contributor

@mibac138 mibac138 commented Jun 6, 2021

Fixes #1373
cc @nikomatsakis

mibac138 added 2 commits June 6, 2021 17:48
When an assigned reviewer submits a review to a PR, automatically
remove waiting-on-review and add waiting-on-author label
@bjorn3
Copy link
Member

bjorn3 commented Jun 6, 2021

I think an approving review shouldn't mark the PR as waiting on author.

@mibac138
Copy link
Contributor Author

mibac138 commented Jun 6, 2021

Didn't consider that case, thanks. I've added it now

src/github.rs Outdated
Comment on lines 295 to 306
#[serde(rename = "state")]
pub pr_review_state: PullRequestReviewState,
}

#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[derive(Debug, serde::Deserialize)]
pub enum PullRequestReviewState {
Approved,
ChangesRequested,
Commented,
Dismissed,
Pending,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is correct, but I'd appreciate if this was double checked before merging

@nikomatsakis
Copy link
Contributor

Oooh, nice!

@nikomatsakis nikomatsakis self-assigned this Jun 8, 2021
return Ok(());
}

if event.issue.assignees.contains(&event.comment.user) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should only do this for "Request Changes". I'm not sure how to interpret a simple "comment" review that has no "inclination".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, changed it

@nikomatsakis nikomatsakis merged commit 327d583 into rust-lang:master Jun 23, 2021
@@ -292,6 +292,18 @@ pub struct Comment {
pub user: User,
#[serde(alias = "submitted_at")] // for pull request reviews
pub updated_at: chrono::DateTime<Utc>,
#[serde(rename = "state")]
pub pr_review_state: PullRequestReviewState,
Copy link
Member

Choose a reason for hiding this comment

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

I believe this may have broken deserialization of issue comments -- I'm filing a fix now.

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.

change PR to "waiting on author" after "changes requested" review
4 participants