-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Update the reviewer bot to notify based on draft reopen time in addition to event time #12428
Open
ScottSuarez
wants to merge
3
commits into
GoogleCloudPlatform:main
Choose a base branch
from
ScottSuarez:bot-updoot
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 the logic here isn't quite right - for example,
earliestChangesRequested
could end up holding a change request from before the PR was reopened, which would cause the func to return early - potentially missing anearliestApproved
that comes after the PR was reopened.I think that the reviews need additional filtering to skip these events instead.
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.
We only consider the most recent review from a core reviewer. See the case:switch on line 340.
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.
The behavior I described does theoretically exist - here's a test case that demonstrates it:
However, after thinking it over, I think the behavior you have here makes sense... if a change was requested, and then the PR was closed, left for a long time, and then reopened (somehow without a review being requested) we'd want to keep it in "Changes requested" but just reset the clock. (But actually ready_for_review requests a new review, so the only case that can actually happen here is that a review was requested and we reset the clock for when the review should have started.)
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.
hmm I think there actually is an issue here with dismissed reviews not clearing an earlier changes_requested.
Theoretically the new reviewer should dismiss the old reviewer if their feedback is no-longer applicable and/or they can no longer approve.
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.
Is there an issue with dismissed reviews that was not already present? I don't remember exactly why I implemented this as is; I'm happy to change the behavior around dismissed reviews but I'd rather hold it for a separate PR unless there's a specific impact to dismissed reviews from this work, since it may have additional implications.