-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[ci] Filter GitHub pull request events #13552
[ci] Filter GitHub pull request events #13552
Conversation
The complete list of event "actions" emitted by GitHub (and recognized by Taskcluster) is [1]: > - assigned > - unassigned > - labeled > - unlabeled > - opened > - edited > - closed > - reopened > - synchronize > - review_requested > - review_request_removed Most of these have no bearing on the code under review, so they should not trigger validation. Do not validate commits in response to irrelevant events. [1] https://docs.taskcluster.net/docs/reference/integrations/taskcluster-github/references/events
echo "Command exited with code $result (failures are allowed while this task is being vetted)." | ||
# Taskcluster responds to a number of events issued by the GitHub API | ||
# which should not trigger re-validation. | ||
$if: event.action in ['opened', 'reopened', 'synchronize'] |
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 is the 'synchronize' event? Just a branch update?
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 couldn't find documentation for it, but that's been my experience
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.
That is when there is a push to the branch that the PR is tracking
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.
Alright, thanks @owlishDeveloper!
@jugglinmike, any reason we want to react to any even other than just 'synchronize'? When a PR is first created, is there not both an 'opened' and a 'synchronize' event?
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.
Not in my experience or in the statuses shared above. I chose to include "reopened" to help with a rare case where a pull request is revisited. Re-validating might be desired for nightly releases
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 don't think there is a synchronize event when you open a PR, but I cannot confirm that at the moment
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.
More anecdotal evidence: none of the 515 WPT pull request commits that have been validated by Taskcluster since 2018-09-13 (the day after we enabled pull request validation) have triggered both "opened" and "synchronize"
Ah, this explains something we were seeing with the wpt sync in gecko where we would get a TC notification after the branch merged. Thanks for investigating! |
Sure thing! |
LGTM. Thanks, @jugglinmike ! |
We've been validating pull requests on Taskcluster far more often than we need to. This dummy pull request submitted to Bocoup's fork of WPT demonstrates the various events. The GitHub UI only displays the latest status, so it's necessary to query the HTTP API to see the complete status history:
output
Validating commits in response to many of these events is inefficient. The response to the "closed" event is particularly concerning. Many people (and all scripts) delete the base branch immediately after merging a pull request. The subsequent validation attempt cannot run in this state, so it always fails. Because the GitHub UI only displays the latest commit status, this gives a false impression of the status at the moment the patch was accepted (for a real-world example of this, see gh-13045).
This dummy pull request demonstrates the behavior after this patch is applied.
output