-
Notifications
You must be signed in to change notification settings - Fork 110
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
Option to merge the latest config from $CIRRUS_BRANCH_BASE for PRs #662
Comments
I'm not sure if other CI do use configs from the base branch. I only know that GitHub Actions are always using workflows defined in the default branch. IMO this will make impossible to test changes to Will a simple rebase work for your case? |
Other cis use the config not of the base branch, but the base branch merged with the pull request. So changes to You can try it with git fetch origin 'refs/pull/$PULL_ID/head'
# vs
git fetch origin 'refs/pull/$PULL_ID/merge'
In theory yes. In practise, probably no. We'd have to ask everyone to rebase every pull request when a (breaking) change to the |
You'll have the same issue for the existing PRs, you'll need to re-trigger them. Only new PRs will get the rebased config. Also if a PR is based of a very old branch shouldn't you want the author to rebase regardless? I think some functionality about automating having an a pretty recent branch can be add to the Rebase Action or the Submit Queue App. 🤔 |
Unfortunately we couldn't use GitHub actions due to the permissions they required: bitcoin/bitcoin#18031
"on top of a historic commit" was a bit unclear wording from me, it should have probably said "prior to the latest commit that changed |
Btw, for the source code we use a workaround (fetch and merge |
Another example we are facing right now is that the memory of one container had to be bumped (OOM). Automatic rebase only works when the author has given permission, not to mention that we try to avoid rebase in some circumstances due to our process. Asking everyone to manually rebase on each push of the roughly 400 pull requests would also be tedious work. |
Adjusted the title from "use" to "merge" because we really want the union of the config in the base branch, plus the config changes in the pull (if there are any). |
Will an option to choose where to load the config from work for you? Without the mergin part. I'm thinking of a repository setting liek this:
It's not clear here how to merge the configs in case of conflicts. 🤔 A problem with such settings is that it won't be possible to test the config that easily from a fork. |
If the config doesn't merge with master, CI could skip [1] or fail [2] the build because merging the pull isn't possible anyway without solving conflicts manually. (Alternatively, it could fallback to building The config really needs to be merged because otherwise it won't be possible to test changes to the config that are made in a pull request. [1]: I think travis does this. |
Just verified this behaviour and indeed Travis merges the changes on PR builds but not branch builds. This really surprises me! IMO more intuitive will be for a PR build to pick the config file from the target branch but if the PR contains changes to the config file itself then to use it without merging target branch files. Merging two files from different SHAs to get a unique config that doesn't exist in Git history feels too magical to me. Will |
They don't exist in git history, but they exist on GitHub ;) [yaml]$ git fetch origin refs/pull/655/merge && git log -1 FETCH_HEAD
From https://github.com/go-yaml/yaml
* branch refs/pull/655/merge -> FETCH_HEAD
commit 1e6516e75521ff7c5d0ffd5b7516e0fd68783fdf
Merge: eeeca48 2a631ff
Author: Feresey <[email protected]>
Date: Fri Aug 28 19:47:13 2020 +0000
Merge 2a631ff564589e5af714c7dde95c773af81349b8 into eeeca48fe7764f320e4870d231902bf9c1be2c08 which is go-yaml/yaml@1e6516e
Sure, this would work as well. |
Currently, the exact commit of the branch of the pull request is used. This is problematic for several reasons:
This should be fixed by fetching the config (and the code) from the pull+base_branch merged together. (Btw, GitHub already offers these merged commits).
This would also bring the behaviour in line with other ci providers such as travis/appveyor/etc.
The text was updated successfully, but these errors were encountered: