-
Notifications
You must be signed in to change notification settings - Fork 109
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
Merge PR to its destination branch before parsing CI config and executing build #791
Comments
I believe this can be achieved by setting "Config resolution strategy" to "Merge for PRs". This is not documented yet, but #662 (comment) has an explanation of all the options. |
@yogurtearl the only caveat here is that Cirrus agent won't clone a merged version of the branch. I've been debating whether make the agent automatically clone merged version of the sources if resolution strategy set to Merge for PRs or introduce a new behavior environment variable that will control it. |
I think it is fine to clone the merged version of the branch when Otherwise this makes the dockerfile setup more brittle. A common workaround for this bug (and discussion #1110) is to add a explicit merge step to the cirrus yaml. However, this doesn't work for dockerfile builds, because the image is built before any steps are executed. |
I am happy to work on a fix for this, but I don't know how to extract the |
Looks like there were two merged pull requests, so I wonder if this was already fixed or if more work is needed? |
This is indeed already fixed, thanks for the nudge! Note that the changes only improve the workflow for the |
Thanks for the fixes. I'm not entire sure if it solves the problem entirely. For example here, the log message indicates that the checked out commit is b160ddd00f9ccc37696b0fdf268d76ad85146453, which is still on the PR branch. In other words, it's not the merge commit that is checked out. And we would still need our manual |
Thanks for noticing this! The The |
This is no longer necessary as of cirruslabs/cirrus-ci-docs#791 (comment) .
This is no longer necessary as of cirruslabs/cirrus-ci-docs#791 (comment) .
This is no longer necessary as of cirruslabs/cirrus-ci-docs#791 (comment) .
Description
Add a (default) option to checkout and merge a branch to its destination branch for PR builds before you parse the .cirrus.yml
After the PR has been merged to its destination branch, then you parse the .cirrus.yml and do whatever executions need to be done.
Context
The goal of a PR build is to make sure that merging the PR doesn't break anything.
Merging to the destination branch before parsing the
.cirrus.yml
makes the PR build closer to what the post merge build will be.Merging before you parse the
.cirrus.yml
because the unmerged.cirrus.yml
on a PR might reference things that are deleted or changed after the merge.Also, if the docker images are changed in the destination branch, you will want to make sure builds can still succeed inside the new images.
Anything Else
Ideally this would be the default with an option to opt out.
Many other CI systems have a default behavior similar to this:
The text was updated successfully, but these errors were encountered: