Skip to content

Commit f089fb7

Browse files
dkayiwaclaude
andauthored
(feat) Port O3 release orchestration from Bamboo to GitHub Actions (#1045)
See PR #1045 for details. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017s7xqiMT8HZAC7MnhAY6mt
1 parent 4acf27c commit f089fb7

6 files changed

Lines changed: 1031 additions & 1 deletion

File tree

.github/RELEASING.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Releasing the O3 Reference Application
2+
3+
Releases are driven by two GitHub Actions workflows (Actions tab → run with
4+
**Run workflow**), which replace the former Bamboo plans:
5+
6+
| Step | Workflow | Replaces (Bamboo) |
7+
|---|---|---|
8+
| Cut an RC + publish QA images | **Release: Cut QA (RC)** (`release-qa.yml`) | O3-CQR, O3-CUQR, O3-PQR (image-publish half) |
9+
| Finalize + publish production images | **Release: Promote to Production** (`release-promote.yml`) | "Deploy Reference Application 3.x" (build half) |
10+
11+
The *server deployment* halves of those Bamboo jobs (refreshing
12+
test3/o3.openmrs.org) are **not** ported — see below.
13+
14+
## Release runbook
15+
16+
1. **Announce** the upcoming release in `#openmrs3`.
17+
2. **Release modules first.** No `-SNAPSHOT` (or timestamp-locked snapshot)
18+
versions may remain in `distro/pom.xml` — the RC workflow refuses to run
19+
otherwise. Frontend modules are picked up automatically via their `latest`
20+
npm dist-tags.
21+
3. **Run "Release: Cut QA (RC)"** with:
22+
- `release_version`: e.g. `3.7.1`
23+
- `core_version`: the [latest esm-core release](https://github.com/openmrs/openmrs-esm-core/releases),
24+
e.g. `10.0.0`. Required for the first RC; leave empty on later RCs to
25+
keep the app shell QA has been testing (pass it again only to deliberately
26+
change the shell mid-release).
27+
- `base_ref`: `main` (default), or a tag like `3.7.0` for a surgical patch release
28+
- Tip: run once with `dry_run` checked and review the diff in the run summary first.
29+
30+
First run for a version: cuts `releases/<version>` off `base_ref`, commits
31+
the version pins (`next``latest` for frontend modules, the app shell
32+
version, the poms), tags `<version>-rc.1`, and dispatches the image builds
33+
which publish `:<version>-rc.1` and `:qa` Docker images, plus the E2E test
34+
workflow against the release branch. Re-running for the same version cuts
35+
`rc.2`, `rc.3`, … from the release branch (commit fixes to the branch in
36+
between).
37+
38+
**Recovery:** a re-run after a failure *before the RC tag was pushed*
39+
resumes safely (completed steps are skipped). After the tag is pushed,
40+
re-running cuts the next RC instead — so if only an image-build or E2E
41+
dispatch failed, dispatch those workflows directly against the RC tag
42+
(the exact commands are printed in the run summary; using the tag, not
43+
the branch, guarantees the images match the tagged commit even if the
44+
branch has moved on). Note that re-dispatching the backend re-deploys
45+
the same release version to the Maven repository; if the repository
46+
rejects re-deployment, cut the next RC instead.
47+
4. **QA on test3.openmrs.org** once it runs the new `qa` images. The
48+
container refresh is not yet ported: trigger it via the Bamboo
49+
[Publish QA Release](https://ci.openmrs.org/browse/O3-PQR) deploy step,
50+
or ask in `#infrastructure` on the OpenMRS Slack. Then work through the
51+
[QA checklist](https://om.rs/o3qasheet).
52+
5. **Run "Release: Promote to Production"** with the `release_version`.
53+
It pins the frontend to the *exact* module versions QA tested (from the
54+
resolved-version manifest baked into the RC image by
55+
`openmrs assemble --manifest`), tags the final version, and publishes
56+
`:<version>` and `:demo` images. It refuses to promote if commits landed
57+
on the release branch after the last RC, and re-running it after a partial
58+
failure resumes safely (including re-dispatching the image builds).
59+
6. **Announce** the release in `#openmrs3` and on OpenMRS Talk.
60+
61+
`main` is never pushed to by these workflows. When a (minor) release makes the
62+
development version on main stale, the RC workflow opens a version-bump PR —
63+
review and merge it like any other PR.
64+
65+
## Not (yet) ported
66+
67+
- **Server container refreshes**: test3.openmrs.org (`qa` images) and
68+
o3.openmrs.org (`demo` images) are still refreshed by the OpenMRS
69+
infrastructure — via the [Publish QA Release](https://ci.openmrs.org/browse/O3-PQR)
70+
deploy step and the
71+
[Deploy Reference Application 3.x](https://ci.openmrs.org/deploy/viewDeploymentProjectEnvironments.action?id=222593025)
72+
deployment project, or by asking in `#infrastructure`. The
73+
`deploy-dev3.yml` scoped-SSH pattern can be extended to them once
74+
infrastructure provisions deploy keys.
75+
- Bamboo remains available as a fallback; these workflows use the same
76+
branch/tag/commit conventions it did.
77+
78+
## Testing changes to these workflows
79+
80+
`tests/release-workflows/run-suite.sh` executes the workflows' actual `run:`
81+
blocks against an isolated local clone — the full release state machine plus
82+
every guard, including negative fixtures seeded with the real content that
83+
broke 3.7.0. It runs automatically on PRs touching the release workflows
84+
(`release-workflow-tests.yml`) and locally on Linux with
85+
`bash tests/release-workflows/run-suite.sh` (on macOS, run it inside a Linux
86+
container).
87+
88+
## Known gaps and caveats
89+
90+
- **Backend rebuild at promote is not fully hermetic** (same as the Bamboo
91+
flow was): the root pom uses SNAPSHOT versions of the
92+
openmrs-sdk/packager Maven plugins and the Docker build starts from
93+
floating `openmrs/openmrs-core:2.8.x-*` base images, all re-resolved at
94+
build time. Promote soon after QA sign-off to keep that window small; a
95+
retag-based promote (shipping the QA-tested image bits unchanged) is the
96+
eventual fix. The *frontend module* versions are exact-pinned and immune
97+
to this.
98+
- **E2E signal is advisory**: the dispatched E2E workflow checks out the
99+
esm test suites at `main`, so suites may test unreleased (`next`) behavior
100+
against the `latest`-pinned RC. This matches the coverage the old
101+
push-to-main flow had. Version-matched suites
102+
(`tests/e2e/extract_tag_numbers.sh`, used by the manually-disabled
103+
`e2e-on-release.yml`) are a follow-up.
104+
- **Old-tag base refs**: cutting a patch from a tag older than the current
105+
workflow set runs the *build/E2E workflow files as of that tag* — they may
106+
lack dispatch inputs or cosign signing. Cherry-pick the current workflow
107+
files onto the release branch first if needed.
108+
- **CI on the dev-version bump PR** starts automatically only when the
109+
`OMRS_BOT_GH_TOKEN` secret is available (it normally is — the dependency
110+
update workflow uses it too). If checks are missing, close and reopen
111+
the PR.

.github/workflows/build-backend.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ jobs:
105105

106106
build-and-publish-no-demo:
107107
name: Build and Publish the Backend Image Without Demo Content
108-
if: github.repository_owner == 'openmrs'
108+
# Skip for release-candidate dispatches: nothing consumes an rc-no-demo
109+
# image, and this job repeats the full multi-arch distro build.
110+
if: github.repository_owner == 'openmrs' && !contains(github.event.inputs.docker_image_tag || 'nightly', '-rc.')
109111
runs-on: ubuntu-latest
110112
permissions:
111113
contents: read

0 commit comments

Comments
 (0)