-
Notifications
You must be signed in to change notification settings - Fork 85
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
Conversation
When an assigned reviewer submits a review to a PR, automatically remove waiting-on-review and add waiting-on-author label
I think an approving review shouldn't mark the PR as waiting on author. |
Didn't consider that case, thanks. I've added it now |
src/github.rs
Outdated
#[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, |
There was a problem hiding this comment.
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
Oooh, nice! |
return Ok(()); | ||
} | ||
|
||
if event.issue.assignees.contains(&event.comment.user) { |
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, changed it
@@ -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, |
There was a problem hiding this comment.
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.
Fixes #1373
cc @nikomatsakis