|
| 1 | +# RHOBS Scripts |
| 2 | + |
| 3 | +This directory hosts scripts that helps with creation of forked Prometheus |
| 4 | +Operator with only differs from the [upstream |
| 5 | +repository](https://github.com/prometheus-operator/prometheus-operator) by the |
| 6 | +API Group being `monitoring.rhobs` instead of `monitoring.coreos.com`. |
| 7 | + |
| 8 | +## Making a Release |
| 9 | + |
| 10 | +In this example we have our local Git repository setup with 3 remotes. Note |
| 11 | +that the `make-release-commit.sh` script assumes the following remote names to |
| 12 | +be present. |
| 13 | + |
| 14 | + 1. `upstream` -> `github.com/prometheus-operator/prometheus-operator` |
| 15 | + 2. `downstream` -> `github.com/rhobs/obo-prometheus-operator` |
| 16 | + 3. `origin `-> `github.com/<your-fork-of>/obo-prometheus-operator` |
| 17 | + |
| 18 | +### Create New Release Branch |
| 19 | + |
| 20 | +We start by pushing an already released version of upstream prometheus-operator |
| 21 | +to our `downstream` fork (under the [rhobs](https://github.com/rhobs) |
| 22 | +organization). Note that the downstream release branches follow a nomenclature |
| 23 | +which is different to upstream so that the upstream github worflows don't |
| 24 | +trigger accidently. |
| 25 | + |
| 26 | +The naming convention used is `rhobs-rel-<upstream-release>-rhobs<patch>` |
| 27 | + |
| 28 | +In this example, we are making a downstream release of `v0.60.0`. Start by |
| 29 | +creating a release branch as follows: |
| 30 | + |
| 31 | +```bash |
| 32 | +export UPSTREAM_VERSION=0.60.0 |
| 33 | +export CURRENT_DOWNSTREAM_VERSION=0.59.2-rhobs1 |
| 34 | +git fetch upstream --tags |
| 35 | +git push downstream "+v${UPSTREAM_VERSION}^{commit}:refs/heads/rhobs-rel-${UPSTREAM_VERSION}-rhobs1" |
| 36 | +``` |
| 37 | + |
| 38 | +### Make Release Commit |
| 39 | + |
| 40 | +Start by creating a local branch for the release (e.g. `pr-for-release`) and reseting it to |
| 41 | +the upstream release version/tag. |
| 42 | + |
| 43 | +```bash |
| 44 | +git checkout -b pr-for-release |
| 45 | +git reset --hard "v${UPSTREAM_VERSION}" |
| 46 | +``` |
| 47 | + |
| 48 | +Merge the `rhobs-scripts` branch, squashing all its commits into one. |
| 49 | + |
| 50 | +```bash |
| 51 | +git merge --squash --allow-unrelated-histories downstream/rhobs-scripts |
| 52 | +git commit -m "git: merge rhobs-scripts" |
| 53 | +``` |
| 54 | + |
| 55 | +Run the `make-release-commit.sh` script which creates a Git commit that |
| 56 | +contains all changes required to create the forked prometheus operator for |
| 57 | +Observabilty Operator (ObO). The `make-release-commit.sh` takes a mandatory |
| 58 | +argument `--previous-version` which should point to the last stable release of |
| 59 | +the fork. This stable version is used in `e2e` tests that are run in CI which |
| 60 | +validates if the newer version is upgradable from the `previous-version` |
| 61 | + |
| 62 | +```bash |
| 63 | +./rhobs/make-release-commit.sh --previous-version ${CURRENT_DOWNSTREAM_VERSION} |
| 64 | +git push -u origin HEAD |
| 65 | +``` |
| 66 | + |
| 67 | +### Create Pull Request |
| 68 | + |
| 69 | +Create a pull request against the `rhobs-rel-0.60.0-rhobs1` branch and ensure |
| 70 | +that the title says `chore(release): v${UPSTREAM_VERSION}-rhobs1`. This is |
| 71 | +important since the rhobs-release (GitHub) workflow makes release if and only |
| 72 | +if the commit message starts with `chore(release)`. |
| 73 | + |
| 74 | +### Automatic release once the PR merges |
| 75 | + |
| 76 | +Check `.github/workflows/rhobs-release.yaml` for details of how the release is |
| 77 | +made. |
0 commit comments