buildpacks / lifecycle

Reference implementation of the Cloud Native Buildpacks lifecycle
https://buildpacks.io
Apache License 2.0
186 stars 105 forks source link

Auto-merge release branches into main #429

Open yaelharel opened 3 years ago

yaelharel commented 3 years ago

Now, after we moved the release process to Github Actions (see #415), we would like to add a Github Actions workflow for auto-merging release branches into main after the releases are published on every commit to the release branch.

yaelharel commented 3 years ago

See https://github.com/buildpacks/pack/pull/645 and https://github.com/buildpacks/pack/blob/main/.github/workflows/release-merge.yml for reference on how pack is doing that.

natalieparellano commented 3 years ago

Do we want to do this when the release is published or on new pushes to the release branch?

yaelharel commented 3 years ago

@natalieparellano, it is an interesting question! I thought about doing it once the release is published since, at that point, we'll be sure that everything works as expected, but there are also advantages of doing so on every commit to the release branch. Maybe the answer relates to a different question - when are we planning to create the release branch. If we plan to do so at the beginning of the development for this release, then it might take time to publish it and then it's probably better to run the merge on every commit so main will be up to date. But if we plan to create the release branch close to cutting the release, then I think it's better to auto merge only after publishing the release from the reason I wrote above and because the branch won't exist for a long time. What do you think?

dfreilich commented 3 years ago

Pack does this whenever there is a new push to the release branch. It helps make sure that the two branches (main and release) don't end up out of sync, so it doesn't hold off on development that isn't making it into this release.

yaelharel commented 3 years ago

@dfreilich, thanks for your input! Can you please share when do we create a release branch for pack, and for how long does it usually exist?

dfreilich commented 3 years ago

Typically a release branch exists for 5 business days. The process is detailed here. Ideally releases should only happen every 6 weeks, with our cadence, but with hotfixes (etc), they tend to happen a bit more frequently... 😅

yaelharel commented 3 years ago

@dfreilich, thanks again! So @natalieparellano, back to your question - assuming that we'll work similar to pack, and assuming that there won't be too many commits to the release branch, I guess we can run the auto-merge on every commit. I'll change the description of this issue. Thanks!