-
Notifications
You must be signed in to change notification settings - Fork 68
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: update tests to run on pull requests #787
Conversation
ci: update tests to run on pull requests
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 should discuss this as a standup/retro topic to make sure everyone's on the same page. There are pros and cons to both push
and pull_request
triggers, it's not a case where one is clearly better (@stephenmathieson and I were discussing this a few weeks ago):
push
triggers as soon as a commit is pushed to the remote, wherepull_request
doesn't trigger until a PR is opened/pushed to. In practice, this means that if it takes you a few minutes to write a decent PR description, apush
triggered test run will have already finished by the time you're submitting the PR (so you can see more quickly whether there are issues to fix), where apull_request
one won't be finished until you've context switched.push
runs against the commit as it was pushed to the repo.pull_request
instead runs against a commit that is the result of GitHub simulating a merge of the PR into its target branch, which may not be the same as the PR branch's head commit if other PRs have been merged since creating the PR branch.push
will run against merge commits into develop, wherepull_request
will not. This is less necessary forpull_request
because of point 2, but still a good idea; even with apull_request
trigger running tests against merge commits, it's still technically possible for 2 PRs (A and B) to have a logical merge conflict (eg, git doesn't detect a conflict, but a test added by A fails because of a change in B), and for apull_request
trigger to never catch it if B merges in between the last push toA
and mergingA
.
I think the tradeoff between 1 and 2 leave me on the fence about using push
vs pull_request
for PR content - I'm happy to stick with whichever the team prefers. However, I think the possibility of 3 causing test failures to leak to production warrants always keeping a push
trigger at least on develop/master/release branches, even if we use a pull_request
trigger for PR branches.
I know for certain we must have |
Good point; at least for public repos where we need to handle contributions from forks, we should probably do at least pull_request + push for develop/master/release branches. We could just do pull_request + push (regardless of branch) for them since we don't pay for actions minutes in public repos, but it'd create a lot of redundant build work for not a lot of value imo. |
No description provided.