-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[ews] merge-queue fails to find reviewer on GitHub PRs with lots of review activity #6355
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
|
EWS run on previous version of this PR (hash ee5993a) |
Tools/CISupport/ews-build/steps.py
Outdated
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.
Let's make this 10 as a parameter as well, so that it's explicit and easy to modify later on if we need to change it.
Tools/CISupport/ews-build/steps.py
Outdated
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.
Can change it to something like: for page in range(1, LIMIT_NUM_PAGES + 1)
Tools/CISupport/ews-build/steps.py
Outdated
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.
Nit: can rename to something like: LIMIT_REVIEWS_PER_PAGE
Tools/CISupport/ews-build/steps.py
Outdated
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.
why do we need this check?
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're asking for 100 on the page. If the page has less than 100, we can safely assume this is the last page. Most of the time, we won't even make a second request.
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.
Seems like the comparison need to be inverted than. Should be if len(response_content) < self.LIMIT:
Tools/CISupport/ews-build/steps.py
Outdated
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.
would be good to add self._addToLog here to help in debugging such failures.
Tools/CISupport/ews-build/steps.py
Outdated
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.
what are we doing here?
Tools/CISupport/ews-build/steps.py
Outdated
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.
Ditto
Tools/CISupport/ews-build/steps.py
Outdated
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.
what's the logic being implemented here? what's id_val? maybe rename id_val to something more readable.
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're trying to make sure that someone can override an r+ with an r- in the future. id_val comes from GitHub, it's the review "id" (according to GitHub's API). Larger numbers are newer. We could use timestamp, expect I didn't really want to decode the GitHub timestamp.
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.
ok.
Also, id_val is a local variable in this line, maybe we can call it _id.
Also, since this is important logic, probably having a explicit for loop with a comment explaining what we are doing is better (instead of using list comprehension).
ee5993a to
2107c05
Compare
|
EWS run on previous version of this PR (hash 2107c05) |
Tools/CISupport/ews-build/steps.py
Outdated
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.
This still seems inverse. Maybe I am missing something.
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.
Nope, my brain just wasn't working...updating
2107c05 to
6d27bff
Compare
|
EWS run on previous version of this PR (hash 6d27bff) |
Tools/CISupport/ews-build/steps.py
Outdated
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.
should it be continue or break. Seems like continue will result in an infinite loop.
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.
would be good to add some unit-tests.
Can override/mock GitHubMixin.fetch_data_from_url_with_authentication_github() in unit-tests to avoid network request.
6d27bff to
ff5809f
Compare
|
EWS run on previous version of this PR (hash ff5809f) |
ff5809f to
8b9cc8b
Compare
|
EWS run on previous version of this PR (hash 8b9cc8b)
|
Tools/CISupport/ews-build/steps.py
Outdated
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.
Nit: this range would be one less than self.NUM_PAGE_LIMIT
Tools/CISupport/ews-build/steps.py
Outdated
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.
do we need to construct this variable here, it's used only to construct the url variable. We can directly construct url in one go inside the for loop.
e.g.: url = f'{api_url}/pulls/{pr_number}/reviews?per_page={self.PER_PAGE_LIMIT}&page={page}
8b9cc8b to
84ed6b2
Compare
|
EWS run on current version of this PR (hash 84ed6b2)
|
…eview activity https://bugs.webkit.org/show_bug.cgi?id=243548 rdar://98129710 Reviewed by Aakash Jain. * Tools/CISupport/ews-build/steps.py: (GitHubMixin): (GitHubMixin.get_reviewers): Handle pagination when retrieving reviews. Approval and rejection should override older approval or rejection. * Tools/CISupport/ews-build/steps_unittest.py: (TestGitHubMixin): (TestGitHubMixin.Response): Mock of request's response class. (TestGitHubMixin.test_no_reviewers): (TestGitHubMixin.test_single_review): (TestGitHubMixin.test_multipe_reviews): (TestGitHubMixin.test_retracted_review): (TestGitHubMixin.test_pagination): (TestGitHubMixin.test_reviewers_invalid_response): (TestGitHubMixin.test_reviewers_error): Canonical link: https://commits.webkit.org/256752@main
84ed6b2 to
42fd020
Compare
|
Committed 256752@main (42fd020): https://commits.webkit.org/256752@main Reviewed commits have been landed. Closing PR #6355 and removing active labels. |
42fd020
84ed6b2
🛠 mac🛠 🧪 win🛠 mac-debug🛠 wincairo🧪 ios-wk2🛠 mac-AS-debug🧪 gtk-wk2🧪 api-ios🧪 api-mac🧪 api-gtk🧪 mac-wk1🧪 mac-wk2🧪 mac-AS-debug-wk2🛠 watch-sim🧪 mac-wk2-stress