$npx -y skills add redhat-developer/rhdh-skill --skill konflux-release-data-rpaBumps RHDH ReleasePlanAdmission tag versions in konflux-release-data for a stream release (e.g. 1.9.7), opens a GitLab merge request, and launches it in the browser. Use when updating RPA tags, konflux-release-data, ReleasePlanAdmission, rhdh-1-9-*.yaml, rhdh-plugin-catalog-1-9-*
| 1 | # Konflux release-data RPA updates |
| 2 | |
| 3 | ## Goal |
| 4 | |
| 5 | Given a target RHDH version (for example `1.9.7`), update the matching stream |
| 6 | ReleasePlanAdmission files under |
| 7 | `config/stone-prod-p02.hjvn.p1/product/ReleasePlanAdmission/rhdh/` so tag values |
| 8 | use the new patch version, then push a branch and open a GitLab merge request. |
| 9 | |
| 10 | ## Prerequisites |
| 11 | |
| 12 | - Local clone of [konflux-release-data](https://gitlab.cee.redhat.com/releng/konflux-release-data) |
| 13 | - `git`, `glab` (GitLab CLI authenticated to `gitlab.cee.redhat.com`) |
| 14 | - Push access to `origin` (`git@gitlab.cee.redhat.com:releng/konflux-release-data.git`) |
| 15 | - Optional: `tox` when using `--validate` |
| 16 | |
| 17 | Run from the user's konflux-release-data checkout — **never assume a fixed path**. |
| 18 | Pass `--repo-dir` or `cd` into the target folder before invoking the script. |
| 19 | |
| 20 | Working directory resolution (in order): |
| 21 | |
| 22 | 1. `--repo-dir PATH` when provided |
| 23 | 2. `KONFLUX_RELEASE_DATA_REPO` when set |
| 24 | 3. Current working directory (`$PWD`) |
| 25 | |
| 26 | `PATH` may be the **repository root**, or the **rhdh ReleasePlanAdmission folder** (the script resolves the standard path |
| 27 | `config/stone-prod-p02.hjvn.p1/product/ReleasePlanAdmission/rhdh/` from there). |
| 28 | |
| 29 | ## Run the bundled script |
| 30 | |
| 31 | **Execute** [scripts/update-rpa-tags.sh](scripts/update-rpa-tags.sh); do not |
| 32 | reimplement the workflow inline. Always run it against the folder the user |
| 33 | specified. |
| 34 | |
| 35 | ```bash |
| 36 | SKILL=skills/konflux-release-data-rpa # under 1-rhdh-skill checkout |
| 37 | chmod +x "${SKILL}/scripts/update-rpa-tags.sh" |
| 38 | REPO=/path/to/konflux-release-data # user-provided checkout |
| 39 | |
| 40 | # From repo root |
| 41 | cd "${REPO}" && "${SKILL}/scripts/update-rpa-tags.sh" 1.9.7 |
| 42 | |
| 43 | # Or pass the checkout explicitly |
| 44 | "${SKILL}/scripts/update-rpa-tags.sh" 1.9.7 --repo-dir "${REPO}" |
| 45 | |
| 46 | # Preview only |
| 47 | "${SKILL}/scripts/update-rpa-tags.sh" 1.9.7 --repo-dir "${REPO}" --dry-run |
| 48 | ``` |
| 49 | |
| 50 | ## Which files change |
| 51 | |
| 52 | For version `MAJOR.MINOR.PATCH`, the script updates the `MAJOR-MINOR` stream only: |
| 53 | |
| 54 | | Version example | Stream | Files updated | |
| 55 | |-----------------|--------|---------------| |
| 56 | | `1.9.7` | `1.9` | `rhdh-1-9-prod.yaml`, `rhdh-1-9-stage.yaml`, `rhdh-plugin-catalog-1-9-prod.yaml`, `rhdh-plugin-catalog-1-9-stage.yaml` | |
| 57 | | `1.10.2` | `1.10` | `rhdh-1-10-*.yaml`, `rhdh-plugin-catalog-1-10-*.yaml` (prod + stage) | |
| 58 | |
| 59 | **Not** updated by this script: `-fbc-` RPAs, `1.next` / `1-stage` catalog files, |
| 60 | builder RPAs, or other streams. |
| 61 | |
| 62 | ## Tag replacement rules |
| 63 | |
| 64 | 1. Auto-detect stale patch versions from tag strings in the target files |
| 65 | (for example `1.9.6` when bumping to `1.9.7`). |
| 66 | 2. Replace every occurrence of each stale patch with the target version. |
| 67 | 3. Keep the stream tag unchanged (`"1.9"` stays `"1.9"`). |
| 68 | 4. Composite plugin catalog tags are updated in the RHDH prefix only |
| 69 | (`1.9.6--1.20.2` → `1.9.7--1.20.2`); upstream plugin semver suffixes are |
| 70 | preserved unless a separate plugin-catalog bump MR is needed. |
| 71 | |
| 72 | Hub/operator RPAs (`rhdh-1-9-*.yaml`) only carry tags under `defaults.tags`. |
| 73 | Plugin catalog RPAs also update per-component `tags` lists. |
| 74 | |
| 75 | ## Merge request workflow |
| 76 | |
| 77 | On success the script: |
| 78 | |
| 79 | 1. Fetches and checks out `main` |
| 80 | 2. Creates branch `chore/rhdh-update-rpa-<VERSION>` |
| 81 | 3. Commits with signed-off message: |
| 82 | `chore: update rhdh-<stream>-*.yaml RPAs for upcoming release <VERSION>` |
| 83 | 4. Pushes to `origin` (`releng/konflux-release-data`) |
| 84 | 5. Creates a GitLab MR in **`releng/konflux-release-data`** via `glab api` on the upstream project (not `glab mr create`, which may route through the `rhdh-bot` fork and produce an empty diff) |
| 85 | 6. MR description starts with **`Generated-by: cursor`** |
| 86 | 7. Verifies the MR includes file changes before opening the browser |
| 87 | 8. Opens the MR URL in the first available browser: **Brave → Chrome → Firefox** |
| 88 | |
| 89 | Use `--dry-run` to preview tag changes without modifying files or opening an MR. |
| 90 | |
| 91 | ## Validation |
| 92 | |
| 93 | Run schema tests after editing when CI credentials are available: |
| 94 | |
| 95 | ```bash |
| 96 | "${SKILL}/scripts/update-rpa-tags.sh" 1.9.7 --repo-dir "${REPO}" --validate |
| 97 | ``` |
| 98 | |
| 99 | Or from the repo root: `tox -e test`. |
| 100 | |
| 101 | ## Related manual steps |
| 102 | |
| 103 | This script handles **RHDH patch tag bumps** in konflux-release-data only. It |
| 104 | does **not**: |
| 105 | |
| 106 | - Bump upstream plugin semver suffixes in composite tags (see historical MRs |
| 107 | titled `chore(rhdh): update plugin catalog … RPAs to … tags`) |
| 108 | - Update Konflux tenant snapshots or components in `tenants-config/` |
| 109 | - Trigger releases in Konflux |
| 110 | |
| 111 | See also [konflux-tekton-updates](../konflux-tekton-updates/SKILL.md) for |
| 112 | Tekton digest bumps in midstream repos. |
| 113 | |
| 114 | ## Anti-patterns |
| 115 | |
| 116 | - Assuming a hardcoded checkout path; always use the user's folder via `--repo-dir` or `cd`. |
| 117 | - Pushing to `rhdh-bot` or any fork remote; push i |