|
| 1 | +# Runbook to backport changes to previous versions of `addonfactory-workflow-addon-release` |
| 2 | +`addonfactory-workflow-addon-release` is utilized by all supported TAs. While it is strongly recommended to use the latest minor version of the reusable action, not all TAs consistently follow this guideline. As a result, there are cases when crucial updates introduced in the latest reusable workflow version need to be backported to its older versions that are still in use. |
| 3 | + |
| 4 | +This runbook shows a real example of backporting changes correlated to `ta-automation-k8s-manifests`. In the example: |
| 5 | +- current version of `addonfactory-workflow-addon-release` is `v4.17.0` |
| 6 | +- there was a bug in `ta-automation-k8s-manifests` affecting all TAs |
| 7 | + - there is a need to make a fix and release `v4.17.1` containing fixed `ta-automation-k8s-manifests` version ([PR](https://github.com/splunk/addonfactory-workflow-addon-release/pull/329)) |
| 8 | + - there is need to backport it to `v4.16` (the old version which is still in use by some TAs) |
| 9 | + - the latest patch release of `v4.16` is `v4.16.14` |
| 10 | +### Steps |
| 11 | +- make release `v4.17.1` with necessary changes |
| 12 | +- fetch all existing tags from `addonfactory-workflow-addon-release`: |
| 13 | + ``` |
| 14 | + git checkout main |
| 15 | + git pull |
| 16 | + git fetch --tags |
| 17 | + ``` |
| 18 | +- checkout to the latest tag of the minor release you want to backport the changes to |
| 19 | + ``` |
| 20 | + git checkout v4.16.14 |
| 21 | + ``` |
| 22 | +- create a new branch based on the tag you are currently checked out to |
| 23 | + ``` |
| 24 | + git checkout -b fix/bump-k8s-manifest-version |
| 25 | + ``` |
| 26 | +- changes made in `ta-automation-k8s-manifests` were correlated with changes in `addonfactory-workflow-addon-release`, so there is a need to backport **only necessary** changes to `v4.16`. There are two ways to do that: by cherrypicking specific commits (and resolving the conflicts if they exist) or by commiting necessary changes manually. |
| 27 | + - for example make necessary changes and commit them: |
| 28 | + ``` |
| 29 | + git add .github/workflows/reusable-build-test-release.yml |
| 30 | + git commit -m "fix: bump k8s-manifest version" |
| 31 | + ``` |
| 32 | +- push newly created branch to the remote repository |
| 33 | + - ```git push -u origin fix/bump-k8s-manifest-version``` |
| 34 | +- in GitHub UI: |
| 35 | + - navigate to releases |
| 36 | + - draft a new release |
| 37 | + - `Choose a tag`: type the tag that will be created, i.e. `v4.16.15` |
| 38 | + - `Target` - newly created branch `fix/bump-k8s-manifest-version` |
| 39 | + - click on `Generate release notes` |
| 40 | + - `Title of release` should be `v4.16.15 backport` |
| 41 | + - write description of the changes |
| 42 | + - uncheck `Set as the latest release` box |
| 43 | + - click `Publish release` |
| 44 | + - check if the release is available, and it points at the proper version - https://github.com/splunk/addonfactory-workflow-addon-release/tags tag `v4.16` should point to the same commit as tag `v4.16.15` |
| 45 | + <img src="images/backporting/compare-tags.png" alt="tags"/> |
| 46 | +- run the workflow for some TA using v4.16 to verify if the pipeline works as expected. |
0 commit comments