|
1 | 1 | # Repository maintenance and release |
2 | 2 |
|
3 | 3 | ## How to release |
4 | | -* manually run [Bump version & trigger release](.github/workflows/bump-version.yaml) workflow |
5 | | -* after the previous workflow finishes, dispatch the GitHub workflow [Netlify Deploy](.github/workflows/netlify-deploy.yaml) on the `master` branch (takes ~15 minutes) |
6 | | - * The styling of the documentation is taken from the `master` branch. For more details see [generate.sh](scripts/generate.sh). |
7 | | -* after the previous workflow finishes, push tag |
8 | | - * the version should be the same as the one in [Bump version & trigger release](.github/workflows/bump-version.yaml) workflow log |
9 | | - * checkout latest master branch and tag it `vX.Y.Z` |
10 | | - * push the tag to the gooddata/gooddata-python-sdk repository (e.g. `git push <remote> vX.Y.Z`) |
| 4 | +Manually run the [Bump version & trigger release](.github/workflows/bump-version.yaml) workflow and pick the |
| 5 | +bump type. That is the whole release. |
11 | 6 |
|
| 7 | +The workflow bumps the version, creates the `rel/X.Y.Z` branch, merges it to `master`, and pushes the tag |
| 8 | +`vX.Y.Z`. That tag push triggers two workflows in parallel: |
| 9 | + |
| 10 | +* [Build Python Package and Create Release](.github/workflows/build-release.yaml) — builds every component, |
| 11 | + creates the GitHub release, publishes to PyPI, and posts to `#releases`. |
| 12 | +* [Netlify Deploy](.github/workflows/netlify-deploy.yaml) — builds and publishes the documentation |
| 13 | + (takes ~15 minutes, so the packages reach PyPI well before the docs go live). |
| 14 | + |
| 15 | +The styling of the documentation is taken from the `master` branch. For more details see |
| 16 | +[generate.sh](scripts/generate.sh). |
| 17 | + |
| 18 | +### Recovering a stuck release |
| 19 | +Both downstream workflows key off the tag, so a release that stalled can be resumed by hand: |
| 20 | + |
| 21 | +* if the tag was never pushed, check out the `Release X.Y.Z` commit on `master`, tag it `vX.Y.Z`, and push the |
| 22 | + tag to the gooddata/gooddata-python-sdk repository (e.g. `git push <remote> vX.Y.Z`) |
| 23 | +* if only the documentation failed, dispatch [Netlify Deploy](.github/workflows/netlify-deploy.yaml) manually; |
| 24 | + it does not need the tag |
| 25 | + |
| 26 | +The tag has to be pushed with a personal access token. GitHub does not trigger workflows from pushes made with |
| 27 | +the default `GITHUB_TOKEN`, so a tag pushed by a workflow using it would silently start nothing. |
| 28 | + |
| 29 | +## How to patch an already released version |
| 30 | +Use this whenever a release must contain a specific fix and *not* everything currently on `master` — whether |
| 31 | +that is an old line (1.60 while `master` is at 1.73) or the newest one. |
| 32 | + |
| 33 | +Do **not** use the [Bump version & trigger release](.github/workflows/bump-version.yaml) workflow for this. Its |
| 34 | +last step is `git checkout master && git merge`, which would drag the old code and version numbers onto |
| 35 | +`master`. Its `patch` bump type means "release master as a patch", not "patch the released line". |
| 36 | + |
| 37 | +Only the tagging is automated; the rest is manual by nature. |
| 38 | + |
| 39 | +**Prerequisite:** the fix is already merged to `master`. The patch branch is never merged back, so this is what |
| 40 | +keeps the fix from being lost in the next release. |
| 41 | + |
| 42 | +1. **Pick the base and the new version.** List what the line already has with |
| 43 | + `git branch -rl '<remote>/rel/1.60.*'`. The base is the newest of them, and the new version increments the |
| 44 | + patch component **of that base** — so `rel/1.60.0` gives `1.60.1`, but if the line was already patched to |
| 45 | + `rel/1.60.2` the next one is `1.60.3`. The steps below use `1.60.1`; substitute your version throughout. |
| 46 | + |
| 47 | +2. **Create the release branch first**, so the fix has somewhere to be reviewed into: |
| 48 | + ```bash |
| 49 | + git fetch <remote> |
| 50 | + # Branch from the base chosen in step 1, not blindly from X.Y.0 -- on an already-patched |
| 51 | + # line that would be rel/1.60.2, and starting from 1.60.0 would drop the earlier fixes. |
| 52 | + git checkout -b rel/1.60.1 <remote>/rel/1.60.0 |
| 53 | + git push <remote> rel/1.60.1 |
| 54 | + ``` |
| 55 | + |
| 56 | +3. **Cherry-pick the fix through a pull request:** |
| 57 | + ```bash |
| 58 | + git checkout -b fix/backport-1.60 rel/1.60.1 |
| 59 | + git cherry-pick <sha-on-master> |
| 60 | + git push <remote> fix/backport-1.60 |
| 61 | + ``` |
| 62 | + Open the PR against `rel/1.60.1`. The [pre-merge pipeline](.github/workflows/pre-merge.yaml) runs because it |
| 63 | + triggers on `rel/**`. Merge once it is green. |
| 64 | + |
| 65 | +4. **Bump the version on the release branch.** These commands mirror the *Install dependencies* through |
| 66 | + *Bump version in codebase* steps of [bump-version.yaml](.github/workflows/bump-version.yaml) — if that |
| 67 | + workflow gains or reorders a step, update this block with it: |
| 68 | + ```bash |
| 69 | + git checkout rel/1.60.1 && git pull |
| 70 | + uv sync --only-group release --locked |
| 71 | + uv run python ./scripts/bump_doc_dependencies.py 1.60.1 |
| 72 | + make release-ci VERSION=1.60.1 |
| 73 | + git add -A && git commit -m "Release 1.60.1" |
| 74 | + git push <remote> rel/1.60.1 |
| 75 | + ``` |
| 76 | + `git add -A` rather than `commit -am`, matching the workflow, so a newly created file is not dropped. On an |
| 77 | + older line `uv sync --locked` can fail if the lock file predates the current uv; re-lock if so. |
| 78 | + |
| 79 | +5. **Tag it.** This is the only trigger; everything after it is automatic: |
| 80 | + ```bash |
| 81 | + git tag v1.60.1 |
| 82 | + git push <remote> v1.60.1 |
| 83 | + ``` |
| 84 | + |
| 85 | +The release is then built and published exactly like any other. Two things differ, and |
| 86 | +[release-tag-checks](.github/actions/release-tag-checks/action.yaml) handles both: the GitHub release does not |
| 87 | +take the "Latest" badge from the newest version, and the documentation is not rebuilt — the docs build checks |
| 88 | +out the triggering tag, so publishing from one would put an outdated site live. |
| 89 | + |
| 90 | +> **A tag runs the workflows as they exist *at that tag*, not on master.** Release lines branched before the |
| 91 | +> release automation was added therefore run their own older copies, in which `make_latest` is hardcoded to |
| 92 | +> `true`. Before tagging such a line, cherry-pick `.github/workflows/build-release.yaml` and |
| 93 | +> `.github/actions/release-tag-checks/` onto `rel/X.Y.Z` — otherwise the patch takes the "Latest" badge, which |
| 94 | +> also changes what `GET /releases/latest` returns. If you only notice afterwards, untick "Set as the latest |
| 95 | +> release" on the GitHub release by hand. Those older copies have no tag trigger on the docs workflow, so the |
| 96 | +> documentation is safe either way. |
| 97 | +
|
| 98 | +### What the documentation will show |
| 99 | +The docs site keeps the four newest release branches, sorted by `major.minor`, and a section is named after the |
| 100 | +`major.minor` only. Consequences worth knowing before someone goes looking: |
| 101 | + |
| 102 | +* A patch never publishes its own documentation — the deploy is gated on the tag being on master. `rel/1.72.1` |
| 103 | + does take over the `1.72` section from `rel/1.72.0`, but only at the next deploy from master: the following |
| 104 | + release, or a manual dispatch of [Netlify Deploy](.github/workflows/netlify-deploy.yaml) if you need it |
| 105 | + sooner. |
| 106 | +* Both branches still occupy a slot of the four, so one patch inside the window drops the site from four |
| 107 | + displayed versions to three. |
| 108 | +* Patching an old line (`rel/1.60.1` while `master` is at 1.73) falls outside the window entirely and never |
| 109 | + appears in the docs. |
12 | 110 |
|
13 | 111 | ### How-to dev release |
14 | 112 | To publish current master as a dev release version, use [Dev release from master](.github/workflows/dev-release.yaml) GitHub workflow. |
|
0 commit comments