Different teams work with Pipelines in a variety of ways, particularly when it comes to releasing changes into Production. Some teams push changes through feature by feature all the way to Production, releasing on demand, while others release on a set cadence (e.g. every one or two weeks) or bundle features together to release in blocks. For cadence-based releases, we now provide the ability to merge multiple features into a release branch, which can be checked for merge conflicts, validated and then promoted into Production. This article describes how this process works.
Release Branch creation
Release branches can only be created on the last environment in a pipeline. In the Pipelines UI, this environment differs from other environments in two ways:
There is one additional tab in the view, called Releases, which will show any release branches created.
Users have the option, after selecting open PR features, to either promote them directly to the branch as with any other environment, or to create a release with these features included.
To create a release, select at least one open feature from the Open pull request tab and click “Create Release”.
On the subsequent pop-up window, choose a release branch name to create and select “Merge into release”.
Gearset will create a new release branch from the base branch configured for the pipeline, usually the main or master branch, with the name selected. We will then merge the selected pull requests into this new branch, close them and open a new pull request from the release branch to the target environment branch (also usually master). This will only complete if all branches can be merged into the release branch successfully - if this doesn't happen, you will need to create a release with a subset of the features and add to them using the "add to release" functionality (see below).
Clicking the view release button will close this dialog and show the Releases tab. This includes details of all the changes included in the release and the combination of components ready to deploy. Merge conflict checks and validation is also run on the PR to ensure it’s good to merge when ready. A release can be executed by selecting it and clicking “Deploy Release”.
Note: once changes have been merged into a release, no additional changes to the base feature branches will be brought into the release automatically. To include these changes in a release, you will need to abandon and recreate the release branch (see “Closing a release without promoting it” section below).
The pull request for the release branch is shown in VCS with all of the included features referenced for auditability.
Abandoning a release without promoting it
If a user wants to close a release without promoting it, select the release, and click the cog icon - “Abandon Release”. This will close the release branch and re-open any feature branch pull requests which were included in the release.
Adding features to a Release
After a release has been created, users can add more features by selecting an open pull request and choosing “Add to Release” from the promotion dialog. This opens up the release pop-up in the Pipelines UI.
Select which release to add the features to, and select "merge into release" to add them into the open release branch PR.
Once complete, you can select more features to add from the list of open pull requests, or view the release in the main Pipelines UI.
The additional features will then be shown as included in the release.
If it is desired to remove a feature from a release, you will need to abandon the release and reopen it using the new set of desired features.
Problems merging features into a Release
Sometimes, multiple features being added to a release will conflict with each other or the release branch. If this occurs, we will attempt to merge as many features into the release as possible, marking the other features as failing to merge. Users can then attempt to resolve the conflicts outside Gearset and then attempt to merge them into the release branch.
Note: interactive merge conflict resolution for these features against the release branch within the Gearset UI is currently not supported - this will be included in the next slice of this feature.
If a feature has an identified conflict against the master branch so cannot be merged directly, but could still be required as part of a release (e.g. it is dependent on another feature in the release), this feature may be added to a release directly from the Releases panel.
As seen below, the feature cannot be merged or added to a release from the Open pull requests panel, but you can attempt to add it to the release from the Releases panel.