npm-release: Bump @oxide/api to a new omicron release
This skill handles the full release cycle for the @oxide/api npm package when
a new omicron release tag appears (e.g., rel/v19/rc0).
Inputs
Ask the user for:
- Omicron release tag (e.g.,
rel/v19/rc0). If not provided, look up the latestrel/tag on oxidecomputer/omicron viagh-api-read repos/oxidecomputer/omicron/tags --jq '.[].name'and pick the newest one. Confirm with the user before proceeding. - New
@oxide/apiversion: Always a minor bump. Read the current version fromoxide-api/package.jsonand bump minor (e.g.,0.5.1→0.6.0).
Steps
Phase 1: Prepare the bump
Resolve the omicron tag to a commit SHA. Omicron release tags are annotated tags, so you need to dereference to the underlying commit:
gh-api-read repos/oxidecomputer/omicron/git/ref/tags/<tag> --jq '.object.sha'That gives you the tag object SHA. Then:
gh-api-read repos/oxidecomputer/omicron/git/tags/<tag-object-sha> --jq '.object.sha'That gives you the commit SHA. Write it to
OMICRON_VERSION.Update
OMICRON_VERSIONwith the commit SHA (just the SHA, one line, trailing newline).Bump version in
oxide-api/package.jsonto the agreed version. Then runcd oxide-api && npm install --package-lock-onlysopackage-lock.jsonis updated to match.Update the versions table in
oxide-api/README.md. Add a row for the new release at the top of the table with the system version,@oxide/apiversion, and npm dist-tag.Regenerate the API client by running
./tools/gen.sh. This downloads the OpenAPI spec from the omicron commit and regeneratesoxide-api/src/.Update test snapshots. In
oxide-openapi-gen-ts/, run:npm ci && npm test run -- --updateThis regenerates the snapshots in
oxide-openapi-gen-ts/src/__snapshots__/.Run CI checks locally to make sure everything passes:
cd oxide-api && npm ci && npm run tsccd oxide-openapi-gen-ts && npm run tsc && npm run lint && npm run fmt:check
Phase 2: Hand off (do not push)
Describe the commit and stop. Set the commit description with
jj desc -m 'Bump API to <tag> (<version>)'and leave the change in the working copy for the user to review.Do not push a branch, and do not open a PR. No
jj git push, nogh pr create. The user pushes and opens the PR themselves. Report what changed (the files touched and any notable spec changes) and stop there.Note for when the PR does exist: the
update-api-specworkflow runs on push to non-main branches and may create an "Autogenerate config update" commit — that is expected. Thevalidateworkflow must pass. The user reviews and merges; never merge the PR yourself.
Phase 3: Publish (automatic) and dist-tag (manual)
Approve and wait for the automatic publish. Merging the PR triggers the
Releaseworkflow on main, which runs validation and then waits for a required reviewer to approve thereleaseenvironment deployment. Tell the user to approve it (or ask another required reviewer to approve it) in the Actions run UI. The workflow then publishes any package version not already on the registry via npm trusted publishing — no manualnpm publish. Watch it withgh run watch $(gh run list --workflow=release.yml --limit 1 --json databaseId --jq '.[0].databaseId')and confirm withnpm view @oxide/api version, which should show the new version.Add npm dist-tag. Tag the published version with the release name so consumers can pin to it:
npm dist-tag add @oxide/api@<version> rel<N>where
<N>is the system release number (e.g.,19forrel/v19/rc0). Note: bare version numbers likev10are not allowed by npm because they parse as semver — use therelprefix.Do not run this yourself. It requires interactive npm auth (a browser one-time-password flow) that won't work from an automated tool call, and CI can't do it either — the trusted-publishing OIDC credential only works for
npm publish, notdist-tag. Present the exact command with<version>and<N>already substituted and let the user run it.
Notes
- The
@oxide/openapi-gen-tspackage version is bumped separately and less frequently — do not bump it as part of this flow unless the user asks. - The version scheme for
@oxide/apiroughly follows omicron releases with minor bumps for new releases and patch bumps for fixes. See issue #245 for ongoing discussion. - If the gen script fails to download the spec, verify the commit SHA is
correct and that
openapi/nexus/nexus-latest.jsonexists at that commit.