From 8aab2bd3b8dad669f95c9a4bafad10671d05dcc9 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 16:36:25 +0530 Subject: [PATCH 01/40] A release tags only a commit whose image scan passed, and no step deletes a tag docker-smoke treats the runs a release relies on alike: the release pull request, its merge commit, a release/X.Y line, weekly and dispatched runs build uncached and fail their scans on a finding, named by scripts/gates/docker_smoke_gate.sh. The release skill pushes the final tag itself, once that run passed on the exact commit. check_tag, make_latest and the release process no longer say to delete a tag, which the tag rules refuse: a tag whose run published nothing stays, goes in UNRELEASED, and the next patch ships. prepare.py bump moves every install command in the docs (Pin.every). Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 13 ++--- .github/workflows/docker-smoke.yml | 33 +++++++----- docs/development/release-process.md | 57 +++++++++++--------- docs/guides/issue-code-pointers.md | 2 +- docs/reference/environment.md | 8 +-- scripts/gates/docker_smoke_gate.sh | 20 ++++++++ scripts/release/make_latest.py | 3 +- scripts/release/prepare.py | 60 +++++++++++++++------- tests/unit/test_docker_quickstart_smoke.py | 54 +++++++++++++++++++ tests/unit/test_release_prepare.py | 19 +++---- 10 files changed, 193 insertions(+), 76 deletions(-) create mode 100755 scripts/gates/docker_smoke_gate.sh diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 39cfc7fa36a..860d79e9297 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -8,28 +8,29 @@ metadata: # Releasing Loom -"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. Keep GitHub's review, CI and environment rules. The owner's release request authorizes routine publication and verification for that version. Ask separately before a rollback, a public announcement or a deployment. The repository's settings keep tag pushes and `release.yml` dispatches with the owner: print the exact command and wait for the owner to run it. +"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. Keep GitHub's review, CI and environment rules. The owner's release request authorizes routine publication and verification for that version. Ask separately before a rollback, a public announcement or a deployment. The request covers the release's tag and `release/X.Y` pushes: run each `git push` as its own command, never inside a script, so the repository's command rules see it. The rules keep `release.yml` dispatches (a dry run, a recovery) with the owner: print the exact command. ## Prepare the release - Read [release process](../../../docs/development/release-process.md) and [supported versions](../../../docs/operations/supported-versions.md). Check remote tags and open PRs for this version. Resume existing work when its target and version match. - Start a major or minor from `origin/main`. Start a patch from `origin/release/X.Y`; backport any selected fixes to that line through PRs first. Use `prep/release-X.Y.Z` for the release PR unless the owner specifies a name. A repository rule that refuses a branch or tag update needs a resolution under that rule. -- Check the latest CI on the target and a passing container scan from the past week. Have the owner start a dry build (`gh workflow run release.yml -R ClickHouse/loom --ref -f dry_run=true`) in parallel with preparing the PR. On a patch line, dispatch `docker-smoke.yml` on that line, and have the owner start the dry build there. Read the dry run's prerequisite warnings. +- Check the latest CI on the target and a passing container scan from the past week. Print the dry build (`gh workflow run release.yml -R ClickHouse/loom --ref -f dry_run=true`) for the owner to start in parallel with preparing the PR, and read its prerequisite warnings when it runs; it is not a gate. - Use `.venv/bin/python scripts/release/prepare.py bump X.Y.Z` in the release worktree. The tool bumps the server, images, dashboard, Python SDK, npm SDK, Helm chart and root skills and writes `release-notes.md`. If the Rust SDK has changes since its last published version, bump its independent SemVer in `sdk/rust/Cargo.toml` and check it with `scripts/release/rust_sdk.py check-version`. A final release publishes that crate version if it is absent from crates.io. - Check the release notes with [loom-writing](../loom-writing/SKILL.md#release-notes-and-announcements). Resolve uncategorized entries and remove items that name no operator action. Surface upgrade steps and client breaks before details. Check whether any shipped plugin changes require raising `MIN_SERVER_VERSION` and bumping the plugin versions. - Open `Release X.Y.Z` using [loom-ship-pr](../loom-ship-pr/SKILL.md). Include the reviewed notes in the PR body, from the `## Release notes for vX.Y.Z` heading to the `` line `prepare.py` writes; a final's run fails without them. Other PRs enter the release by merging into its target branch before the release PR. Refresh the notes if the base moves. Merge on green when the required reviews and threads are settled. ## Tag and monitor -- **Default**. As soon as the checks pass, the owner pushes the final `vX.Y.Z` tag on the release PR's merge commit (`git tag vX.Y.Z && git push origin vX.Y.Z`). If a candidate tag already exists, the final must use the highest candidate's commit. -- **Release with a soak**. The owner pushes `vX.Y.Z-rc.1` on the release PR's merge commit; watch its run and soak it for at least two days. The owner tags any fix as the next candidate after it merges to the release target, and the soak restarts. The final goes on the highest candidate's commit. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. +- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event`): that push builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. If a candidate tag already exists, the final must use the highest candidate's commit. +- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit once its docker-smoke run passed; watch its run and soak it for at least two days. Tag any fix as the next candidate after it merges to the release target, and the soak restarts. The final goes on the highest candidate's commit. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. - When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. -- When the line's maintenance branch `release/X.Y` does not exist, its first final creates it: print `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"` for the owner to run. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. +- When the line's maintenance branch `release/X.Y` does not exist, its first final creates it: `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. +- A tag run that fails before `docker-tag` published nothing, and its tag stays: release the fix as the next patch and add the tag to `UNRELEASED`, as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. ## Verify the release -Read the published GitHub Release and confirm the reviewed opening, then the package and image versions from the tagged run and the registries. Check both image version tags and their moving tags, PyPI provenance, the npm dist-tag and signatures, the Rust version, and the MCP Registry listing: +Read the published GitHub Release and confirm the reviewed opening, then the package and image versions from the tagged run and the registries. Check both image version tags and their moving tags, PyPI provenance, the npm dist-tag and signatures, the Rust version, the n8n nodes package (`n8n-publish.yml` on the tag), and the MCP Registry listing: ```bash curl -fsS "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.ClickHouse/loom" | jq '.servers[].server.version' # lists X.Y.Z diff --git a/.github/workflows/docker-smoke.yml b/.github/workflows/docker-smoke.yml index 64eb9dee225..eb84e0268be 100644 --- a/.github/workflows/docker-smoke.yml +++ b/.github/workflows/docker-smoke.yml @@ -107,10 +107,20 @@ jobs: timeout-minutes: 10 outputs: image: ${{ steps.resolve.outputs.image }} + release: ${{ steps.gate.outputs.release }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false + # Whether this run gates a release: then it builds uncached and its scans fail on a + # finding, as the release's do (the script names the runs). + - id: gate + env: + EVENT: ${{ github.event_name }} + REF: ${{ github.ref }} + BASE: ${{ github.base_ref }} + TITLE: ${{ github.event.pull_request.title || github.event.head_commit.message }} + run: sh scripts/gates/docker_smoke_gate.sh >> "$GITHUB_OUTPUT" # Both architectures install the release `latest` names now. - id: resolve run: | @@ -129,9 +139,9 @@ jobs: - arch: arm64 runner: ubuntu-24.04-arm runs-on: ${{ matrix.runner }} - # An uncached build (weekly, dispatched) about doubles the build; the + # An uncached build (a run that gates a release) about doubles the build; the # installer rehearsal adds about a quarter of an hour. - timeout-minutes: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 75 || 45 }} + timeout-minutes: ${{ needs.clickhouse.outputs.release == 'true' && 75 || 45 }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -154,8 +164,8 @@ jobs: context: . load: true tags: loom:docker-smoke - # The weekly or dispatched scan sees the packages the archives serve today. - no-cache: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + # A run that gates a release sees the packages the archives serve today, as the release does. + no-cache: ${{ needs.clickhouse.outputs.release == 'true' }} platforms: linux/${{ matrix.arch }} cache-from: type=gha,scope=docker-smoke-${{ matrix.arch }} cache-to: type=gha,mode=max,scope=docker-smoke-${{ matrix.arch }} @@ -167,8 +177,8 @@ jobs: file: extractor/Dockerfile load: true tags: loom-extractor:docker-smoke - # The weekly or dispatched scan sees the packages the archives serve today. - no-cache: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + # A run that gates a release sees the packages the archives serve today, as the release does. + no-cache: ${{ needs.clickhouse.outputs.release == 'true' }} platforms: linux/${{ matrix.arch }} cache-from: type=gha,scope=docker-smoke-extractor-${{ matrix.arch }} cache-to: type=gha,mode=max,scope=docker-smoke-extractor-${{ matrix.arch }} @@ -208,14 +218,13 @@ jobs: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL docker buildx prune -af >/dev/null df -h / - # The release refuses a fixed critical CVE, so a pull request whose title starts - # with "Release " (the release pull request's), one into a release/X.Y line, a push - # there, and a weekly or dispatched run fail on one; elsewhere a CVE new to the - # scan's database only warns. + # The release refuses a fixed critical CVE, so a run that gates a release fails on + # one (scripts/gates/docker_smoke_gate.sh); elsewhere a CVE new to the scan's + # database only warns. - name: Scan the server image with the release's scan settings if: ${{ !cancelled() && steps.server.outcome == 'success' }} uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 - continue-on-error: ${{ !(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.base_ref, 'release/') || startsWith(github.event.pull_request.title, 'Release ')) }} + continue-on-error: ${{ needs.clickhouse.outputs.release != 'true' }} env: TRIVY_PLATFORM: linux/${{ matrix.arch }} with: @@ -226,7 +235,7 @@ jobs: - name: Scan the extractor image with the release's scan settings if: ${{ !cancelled() && steps.extractor.outcome == 'success' }} uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 - continue-on-error: ${{ !(github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.base_ref, 'release/') || startsWith(github.event.pull_request.title, 'Release ')) }} + continue-on-error: ${{ needs.clickhouse.outputs.release != 'true' }} env: TRIVY_PLATFORM: linux/${{ matrix.arch }} with: diff --git a/docs/development/release-process.md b/docs/development/release-process.md index 3ac6ded510c..a4c1a37339e 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -14,6 +14,7 @@ Loom follows SemVer: the server, the Python and TypeScript SDKs, the web app, th | Web app | `frontend/package.json` and `frontend/package-lock.json` | | Root skills | `.claude-plugin/plugin.json`, `.cursor-plugin/plugin.json`, `plugin.json` and the `metadata.version` of `skills/loom/SKILL.md`, `skills/loom-memory/SKILL.md`, `skills/loom-code/SKILL.md` and `skills/loom-status/SKILL.md`; the last three also state it under the title | | Gemini CLI extension | `gemini-extension.json` | +| Install commands in the docs | every `clickhouse-loom==` and `@clickhouse/loom@` install in `docs/features/integrations/frameworks.md`, and the `--ref vX.Y.Z` in `docs/features/integrations/mcp-clients.md` | | Helm chart | `deploy/helm/loom/Chart.yaml`: `appVersion` (the default tag of the server and extractor images, and the chart's `app.kubernetes.io/version` label) and the chart's own `version`: a minor for a major or minor release, a patch for a patch release | | Rust SDK | `sdk/rust/Cargo.toml` (its own version; bump it by hand when `sdk/rust/` has changed since the last published crate, and check it with `scripts/release/rust_sdk.py check-version`) | | Claude Code and Codex plugins | `integrations/claude-code-plugin/.claude-plugin/plugin.json`, `integrations/codex-plugin/.codex-plugin/plugin.json` (their own version; bump it on a behaviour change to any file the plugin ships: `hooks/`, `lib/`, `bin/`, `skills/`, `.mcp.json`, the Codex `plugin-defaults.json`) | @@ -48,7 +49,8 @@ Reserve `release/` for maintained `release/X.Y` lines. Check the repository's br creating a preparation branch. A refused update requires resolution under those rules; renaming a branch or changing its target does not resolve the refusal. -Create the maintained line after publishing its first final release. Preparation branches carry +Create the maintained line after publishing its first final release, or from a final tag whose run +published nothing ([what the release workflow does](#what-the-release-workflow-does)). Preparation branches carry the version bump and notes through their pull request; they do not become maintained lines. Keep published tags fixed. Select backports according to the [supported release lines](../operations/supported-versions.md#release-lines). @@ -108,9 +110,10 @@ final's run reads it there. Or start a fresh one with `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref main` and read it with `--event workflow_dispatch` in place of `--event schedule`. It scans both images as the release does, and a scheduled run's failure notifies only the last editor of its schedule. The - scan also fails a pull request whose title starts with `Release ` (as the release pull request's - does), a pull request into a `release/X.Y` line and a push there; on other pull requests and on - `main` it warns. A red + runs that gate a release build both images uncached and fail on a scan finding: a weekly or + dispatched run, the release pull request (titled exactly `Release X.Y.Z`), its merge commit + (subject `Release X.Y.Z (#N)`), a pull request into a `release/X.Y` line and a push there + (`scripts/gates/docker_smoke_gate.sh`). On other pull requests and pushes the scan warns. A red scan names the package: move the pin that brings it in (a `Dockerfile` `ARG` or base-image digest, or a lock file) on `main` first. The base image's own packages move only with a new base-image digest; a package an `apt-get install` layer adds moves with any uncached build. @@ -123,11 +126,13 @@ final's run reads it there. pull request raises `MIN_SERVER_VERSION` in `integrations/claude-code-plugin/lib/server-version.mjs` to this version, syncs it into the Codex plugin and bumps both plugin versions: clients get it only through a new plugin version. -3. After the release pull request merges, push the final tag once the checks pass. For a requested - candidate soak, push `vX.Y.Z-rc.1` first and publish the final on the highest candidate's - commit after the soak. +3. After the release pull request merges, wait for docker-smoke on its merge commit: that run builds + and scans the commit the tag will name, as the tag run does, and a pushed `vX.Y.Z` tag is never + moved or deleted. Push the final tag only once it passed. For a requested candidate soak, push + `vX.Y.Z-rc.1` first and publish the final on the highest candidate's commit after the soak. ```bash + gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event # a push run, success git tag vX.Y.Z git push origin vX.Y.Z ``` @@ -148,14 +153,14 @@ candidate on that commit with a published bundle; its images are built again fro commit, uncached, so an OS package may be newer than in the soaked image. A run of a candidate tag after its final is refused. One on the final's commit is told to run the final. One numbered below the highest-numbered candidate on the final's commit has nothing to run, and its -tag stays. Any other is a stray: it -also fails the final's later runs until it is deleted. The chart's `appVersion` names `X.Y.Z` too, +tag stays. Any other is a stray: its tag stays too, as every `v*` tag does, and it fails the +final's later runs. The chart's `appVersion` names `X.Y.Z` too, so a soak on Kubernetes sets `image.tag` and `extractor.image.tag` to `X.Y.Z-rc.N`. Only the highest final version becomes the repository's Latest release (`releases/latest` serves the installer) and moves `:latest`: a prerelease or a patch to an older line leaves both where they are. -The versions are read from the repository's tags, so delete a final tag that will not ship, or -Latest stays below it. +The versions are read from the repository's tags: a final tag whose run published nothing stays, +and holds Latest below it until the next patch of its line ships. ## Rehearsing a release @@ -342,10 +347,12 @@ Never move a published `X.Y.Z` tag: `published_images.sh` fails when a published from another commit than the run's, and a fix needs a new version. A tag run that fails before `docker-tag` (a scan, a build) publishes nothing, and its `vX.Y.Z` tag -stays, since the repository's tag rules refuse moving or deleting one. Release the fix as the next -patch from the line's `release/X.Y` branch, cut from that tag, and add the tag to `UNRELEASED` in -`scripts/release/prepare.py`, so that no release's notes start from it and no upgrade rehearsal -installs it. +stays, since the repository's tag rules refuse moving or deleting one. Create `release/X.Y` from +that tag when the line has none, release the fix as the next patch there, and add the tag to +`UNRELEASED` in `scripts/release/prepare.py`, so that no release's notes start from it and no +upgrade rehearsal installs it. Then merge `release/X.Y`'s head into `main` with a merge commit, +not a squash: `main` gets the fix and the patch's tag is in its history, so the next release's +notes start from it. A re-run after a partial publish is safe: each publish job skips what already exists. The one exception is a tag run whose file signing failed, which [a failed tag or @@ -432,18 +439,18 @@ A run that stopped in `clickhouse` published nothing. - **The release does not dump the tag's `schemas/schema.sql`**: regenerate it on that release (the [schema dump](./migrations.md#schema-dump-and-check) commands with `LOOM_CLICKHOUSE_IMAGE=clickhouse/clickhouse-server:A.B.C.D`) and commit it. For a candidate, tag - the next `-rc.N` on the fix's commit. For a final (one with no candidate on its commit that - published a bundle, as only that one resolves `latest`), delete its tag - (`git push origin :refs/tags/vX.Y.Z`, and `git tag -d vX.Y.Z` in every clone that fetched it, as a - fetch never removes a tag), then tag a new candidate on the fix's commit. Either way dispatch the - new candidate with the same `-f clickhouse_image=...`, as its tag push resolves `latest` again; - soak it, and tag the final there, which keeps that release. + the next `-rc.N` on the fix's commit, dispatch it with the same `-f clickhouse_image=...`, as its + tag push resolves `latest` again, soak it, and tag the final there, which keeps that release. A + final (one with no candidate on its commit that published a bundle, as only that one resolves + `latest`) published nothing and its tag stays: release the fix as the next patch, with the same + `-f clickhouse_image=...` on its dispatch, and add the final's tag to `UNRELEASED`, as for + [a tag run that published nothing](#what-the-release-workflow-does). - **A downgrade during the soak**: a final carrying its candidate's release is checked too, so a patch to an older line published during the soak with a newer release stops it. Two ways out: - - delete the final's tag as above (it published nothing), tag a new candidate on that commit, - soak it, and tag the final there again. The candidate's tag push resolves `latest`; when that - is older than the release the error names, dispatch the candidate with that release: - `gh workflow run release.yml --ref vX.Y.Z-rc.N -f clickhouse_image=clickhouse/clickhouse-server:A.B.C.D`; + - the final published nothing and its tag stays: release that commit as the next patch, adding + the final's tag to `UNRELEASED` as above. Its tag push resolves `latest`; when that is older + than the release the error names, dispatch the patch with that release: + `gh workflow run release.yml --ref vX.Y. -f clickhouse_image=clickhouse/clickhouse-server:A.B.C.D`; - or dispatch the final with `-f allow_clickhouse_downgrade=true` and accept the downgrade for that patch's installs. diff --git a/docs/guides/issue-code-pointers.md b/docs/guides/issue-code-pointers.md index 1eb38940fab..5f94f7d8fe8 100644 --- a/docs/guides/issue-code-pointers.md +++ b/docs/guides/issue-code-pointers.md @@ -39,7 +39,7 @@ The pipeline's token needs the `viewer` role on the code namespace ## Build the block -These SDK methods and the `loom pointers` command need Loom 1.4.0 or later: install the +These SDK methods and the `loom pointers` command need Loom 1.4.1 or later: install the [Python SDK](../reference/python-sdk.md#install) (`python -m loom pointers`) or the [TypeScript SDK](../reference/typescript-sdk.md#install). diff --git a/docs/reference/environment.md b/docs/reference/environment.md index ea9d32cf67a..6993820ca1e 100644 --- a/docs/reference/environment.md +++ b/docs/reference/environment.md @@ -62,10 +62,10 @@ Build argument: `LOOM_BUILD_COMMIT` (baked into the image as `LOOM_BUILD_COMMIT` reported as `build_commit`). The image always carries the local CPU embedder and its default model, and sets `LOOM_LOCAL_EMBEDDING_MODEL_DIR=/app/models`. The remaining `ARG`s pin toolchain versions and checksums for the compiler-tier indexers -(`GO_VERSION`, `NODE_VERSION`, `SCIP_GO_VERSION`, `SCIP_CLANG_VERSION`, their -`*_SHA256*` values and `LLVM_SIGNER_FPR`, the LLVM signing key's fingerprint); -`scripts/install-code-toolchains.sh` pins the tools it installs with npm -(scip-typescript, scip-python and the package managers). +(`GO_VERSION`, `NODE_VERSION`, `NPM_VERSION`, `SCIP_GO_VERSION`, `SCIP_CLANG_VERSION`, +their `*_SHA256*` values and `LLVM_SIGNER_FPR`, the LLVM signing key's fingerprint); +`NPM_VERSION` replaces the npm Node bundles. `scripts/install-code-toolchains.sh` pins the +tools it installs with that npm (scip-typescript, scip-python and the package managers). ## Compose files diff --git a/scripts/gates/docker_smoke_gate.sh b/scripts/gates/docker_smoke_gate.sh new file mode 100755 index 00000000000..f58186c94f7 --- /dev/null +++ b/scripts/gates/docker_smoke_gate.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# Prints `release=true` when this docker-smoke run gates a release, else `release=false`. +# Such a run builds both images without the cache and fails on a scan finding, as the +# release's own scan does, since a pushed vX.Y.Z tag is never moved: a weekly or +# dispatched run, a pull request into a release/X.Y line or a push there, the release +# pull request (titled exactly `Release X.Y.Z`) and its merge commit (`Release X.Y.Z (#N)`). +# +# EVENT=push REF=refs/heads/main TITLE="Release 1.5.0 (#2100)" sh scripts/gates/docker_smoke_gate.sh +set -eu + +release=false +case "${EVENT:-}" in schedule | workflow_dispatch) release=true ;; esac +case "${REF:-}" in refs/heads/release/*) release=true ;; esac +case "${BASE:-}" in release/*) release=true ;; esac +# A pull request's title, or a pushed commit's subject: its message's first line. +subject=$(printf '%s\n' "${TITLE:-}" | head -n 1) +if printf '%s\n' "$subject" | grep -Eq '^Release [0-9]+\.[0-9]+\.[0-9]+( \(#[0-9]+\))?$'; then + release=true +fi +echo "release=$release" diff --git a/scripts/release/make_latest.py b/scripts/release/make_latest.py index dd94e9cce21..17c5ef312f2 100755 --- a/scripts/release/make_latest.py +++ b/scripts/release/make_latest.py @@ -8,7 +8,8 @@ prerelease, leaves Latest where it is. It reads the repository's tags with `gh`: a tag exists from its push on, before its release run publishes anything, so two releases running at once agree. Prerelease tags never count; a final -tag that will not ship holds Latest below it until it is deleted. A failed +tag whose run published nothing stays (a `v*` tag is never deleted) and holds +Latest below it until the next patch of its line ships. A failed listing fails the script, never reads as "no tags". """ diff --git a/scripts/release/prepare.py b/scripts/release/prepare.py index 8c7ff6125c7..ee8bbb50313 100755 --- a/scripts/release/prepare.py +++ b/scripts/release/prepare.py @@ -42,10 +42,12 @@ class Pin(NamedTuple): - """One place a file carries the version: `pattern`'s group `v`, found exactly once.""" + """One place a file carries the version: `pattern`'s group `v`, found exactly once, + or with `every` at least once and naming one version wherever it is found.""" path: str pattern: str + every: bool = False _TOP_JSON = r'^ "version": "(?P[^"]+)",$' @@ -61,6 +63,8 @@ class Pin(NamedTuple): for pattern in (_SKILL, r"^Loom version of this copy: (?P\S+)$") ] +_FRAMEWORKS = "docs/features/integrations/frameworks.md" + # The version every other pin follows. SERVER = Pin("server/__init__.py", r'^__version__ = "(?P[^"]+)"$') FOLLOWERS = [ @@ -83,6 +87,11 @@ class Pin(NamedTuple): Pin("skills/loom/SKILL.md", _SKILL), *_BUNDLES, Pin("deploy/helm/loom/Chart.yaml", r'^appVersion: "(?P[^"]+)"$'), + # Install commands in the docs name the release, which the image serves through + # `help.search`: a version PyPI or npm does not have fails the command. + Pin(_FRAMEWORKS, r"clickhouse-loom(?:\[[a-z0-9-]+\])?==(?P\d+\.\d+\.\d+)", every=True), + Pin(_FRAMEWORKS, r"@clickhouse/loom@(?P\d+\.\d+\.\d+)", every=True), + Pin("docs/features/integrations/mcp-clients.md", r"--ref v(?P\d+\.\d+\.\d+)$", every=True), ] PINS = [SERVER, *FOLLOWERS] CHART = Pin("deploy/helm/loom/Chart.yaml", r"^version: (?P\S+)$") @@ -111,11 +120,17 @@ def __init__(self, path: str, reason: str) -> None: self.reason = reason -def _match(pin: Pin, text: str) -> re.Match[str]: +def _matches(pin: Pin, text: str) -> list[re.Match[str]]: found = list(re.finditer(pin.pattern, text, re.MULTILINE)) - if len(found) != 1: - raise PinError(pin.path, f"{pin.pattern!r} matches {len(found)} times, not once") - return found[0] + if len(found) != 1 and not (pin.every and found): + wanted = "at least once" if pin.every else "once" + raise PinError(pin.path, f"{pin.pattern!r} matches {len(found)} times, not {wanted}") + return found + + +def _match(pin: Pin, text: str) -> re.Match[str]: + """The one place `pin` names the version, or its first for an `every` pin.""" + return _matches(pin, text)[0] def _text(path: str, root: Path) -> str: @@ -126,7 +141,10 @@ def _text(path: str, root: Path) -> str: def read(pin: Pin, root: Path = ROOT) -> str: - return _match(pin, _text(pin.path, root)).group("v") + named = sorted({m.group("v") for m in _matches(pin, _text(pin.path, root))}) + if len(named) != 1: + raise PinError(pin.path, f"{pin.pattern!r} names {', '.join(named)}, not one version") + return named[0] def check(tag_version: str | None = None, root: Path = ROOT) -> list[tuple[str, str]]: @@ -176,8 +194,10 @@ def bump(version: str, chart: str, root: Path = ROOT) -> None: if pin.path not in texts: texts[pin.path] = _text(pin.path, root) text = texts[pin.path] - start, end = _match(pin, text).span("v") - texts[pin.path] = text[:start] + value + text[end:] + for found in reversed(_matches(pin, text)): # from the end, so earlier spans hold + start, end = found.span("v") + text = text[:start] + value + text[end:] + texts[pin.path] = text for path, text in texts.items(): (root / path).write_text(text, encoding="utf-8") @@ -263,8 +283,9 @@ def check_tag(tag_version: str, root: Path = ROOT) -> str | None: Once `vX.Y.Z` is out, a candidate of it is refused three ways: on the final's commit (run the final), numbered below the highest-numbered candidate on that commit (nothing to run, and its tag stays), or any other - (a stray, to delete). A final `vX.Y.Z` is refused on another commit than its - highest-numbered candidate.""" + (a stray). A final `vX.Y.Z` is refused on another commit than its + highest-numbered candidate. A `v*` tag is never moved or deleted, so a + refused tag stays, and a fix ships as the next version.""" final = final_of(tag_version) if tag_version != final: # a candidate, X.Y.Z-rc.N final_sha = _tag_sha(root, f"v{final}") @@ -284,22 +305,25 @@ def check_tag(tag_version: str, root: Path = ROOT) -> str | None: f" on v{final}'s commit: nothing to run" ) return ( - f"v{final} is already tagged: a candidate for it would publish after it;" - f" delete this tag (git push origin :refs/tags/v{tag_version}), or, when" - f" v{final}'s run published nothing, delete v{final} instead" - f" (git push origin :refs/tags/v{final})" + f"v{final} is already tagged: a candidate for it would publish after it, so" + f" v{tag_version} is not run and its tag stays. {_NEXT_PATCH.format(final=final)}" ) tags = candidates(final, root) if tags and _tag_sha(root, tags[-1]) != _sha(root, "HEAD"): return ( - f"v{final} is not on {tags[-1]}'s commit: delete {tags[-1]}" - f" (git push origin :refs/tags/{tags[-1]}) if it is a stray;" - f" if v{final}'s run published nothing, delete v{final}" - f" (git push origin :refs/tags/v{final}) and tag it on {tags[-1]}'s commit" + f"v{final} is not on {tags[-1]}'s commit, the highest-numbered candidate's, so" + f" it is not run. {_NEXT_PATCH.format(final=final)}" ) return None +# A `v*` tag is never moved or deleted (the repository's tag rules refuse it). +_NEXT_PATCH = ( + "When v{final}'s run published nothing, add v{final} to UNRELEASED in" + " scripts/release/prepare.py and release the next patch on the commit that should ship" +) + + def released_chart(tag: str, root: Path = ROOT) -> str: """The chart's own version at a release tag.""" shown = _git(root, "show", f"{tag}:{CHART.path}") diff --git a/tests/unit/test_docker_quickstart_smoke.py b/tests/unit/test_docker_quickstart_smoke.py index c1d63b8c342..2c89d71dc1b 100644 --- a/tests/unit/test_docker_quickstart_smoke.py +++ b/tests/unit/test_docker_quickstart_smoke.py @@ -278,3 +278,57 @@ def run() -> subprocess.CompletedProcess[str]: and "expected the server's and the extractor's scans" in failed.stdout ) assert not (tmp_path / "calls").exists() # nothing tagged + + +@pytest.mark.parametrize( + ("env", "gates"), + [ + ({"EVENT": "schedule"}, True), + ({"EVENT": "workflow_dispatch", "REF": "refs/heads/main"}, True), + ({"EVENT": "push", "REF": "refs/heads/release/1.4"}, True), + ({"EVENT": "pull_request", "BASE": "release/1.4", "TITLE": "Fix a thing"}, True), + ({"EVENT": "pull_request", "BASE": "main", "TITLE": "Release 1.5.0"}, True), + # The release pull request's squash commit on main: the commit the tag names. + ( + {"EVENT": "push", "REF": "refs/heads/main", "TITLE": "Release 1.5.0 (#2100)\n\nnotes"}, + True, + ), + ({"EVENT": "push", "REF": "refs/heads/main", "TITLE": "Fix a thing (#2101)"}, False), + ( + {"EVENT": "pull_request", "BASE": "main", "TITLE": "Release notes keep their order"}, + False, + ), + ({"EVENT": "pull_request", "BASE": "main", "TITLE": "release 1.5.0"}, False), + ], +) +def test_a_run_that_gates_a_release_is_named_by_one_script( + env: dict[str, str], gates: bool +) -> None: + """Only the runs whose result a release relies on fail their scans and build uncached.""" + root = Path(__file__).resolve().parents[2] + found = subprocess.run( + ["sh", str(root / "scripts/gates/docker_smoke_gate.sh")], + env={"PATH": os.environ["PATH"], **env}, + capture_output=True, + text=True, + check=True, + ) + assert found.stdout == f"release={'true' if gates else 'false'}\n" + + +def test_docker_smoke_reads_the_gate_for_its_cache_timeout_and_scans() -> None: + root = Path(__file__).resolve().parents[2] + jobs = yaml.safe_load((root / ".github/workflows/docker-smoke.yml").read_text())["jobs"] + (gate,) = [s for s in jobs["clickhouse"]["steps"] if s.get("id") == "gate"] + assert gate["run"] == 'sh scripts/gates/docker_smoke_gate.sh >> "$GITHUB_OUTPUT"' + assert jobs["clickhouse"]["outputs"]["release"] == "${{ steps.gate.outputs.release }}" + quickstart = jobs["quickstart"] + gated = "needs.clickhouse.outputs.release == 'true'" + assert gated in str(quickstart["timeout-minutes"]) + steps = quickstart["steps"] + builds = [s for s in steps if s.get("id") in ("server", "extractor")] + assert [s["with"]["no-cache"] for s in builds] == ["${{ " + gated + " }}"] * 2 + scans = [s for s in steps if str(s.get("name", "")).startswith("Scan the ")] + assert [s["continue-on-error"] for s in scans] == [ + "${{ needs.clickhouse.outputs.release != 'true' }}" + ] * 2 diff --git a/tests/unit/test_release_prepare.py b/tests/unit/test_release_prepare.py index 5bff3783791..8f6a90e4d1b 100644 --- a/tests/unit/test_release_prepare.py +++ b/tests/unit/test_release_prepare.py @@ -729,8 +729,10 @@ def test_a_candidate_comes_before_its_final_and_the_final_goes_where_it_was_soak git_repo.git(tmp_path, "tag", "v1.2.0") error = prepare.check_tag("1.2.0", tmp_path) assert error and "v1.2.0 is not on v1.2.0-rc.1's commit" in error - assert ":refs/tags/v1.2.0) and tag it on v1.2.0-rc.1's commit" in error - assert "delete v1.2.0-rc.1 (git push origin :refs/tags/v1.2.0-rc.1) if it is a stray" in error + assert error.endswith( + "add v1.2.0 to UNRELEASED in scripts/release/prepare.py and release the next patch on the commit that should ship" + ) + assert "refs/tags" not in error # a v* tag is never deleted git_repo.git(tmp_path, "tag", "v1.2.0-rc.2") # the fix soaked as rc.2: its commit is HEAD assert prepare.check_tag("1.2.0", tmp_path) is None @@ -1174,7 +1176,7 @@ def test_a_candidate_below_the_finals_is_not_told_to_delete_itself( assert prepare.check_tag("1.2.0", tmp_path) is None # the final's runs still pass -def test_every_stray_above_the_finals_candidate_is_told_to_go(tmp_path: Path) -> None: +def test_every_stray_above_the_finals_candidate_is_refused_and_stays(tmp_path: Path) -> None: """rc.3 and rc.4 pushed after the final on rc.2: rc.3 is not an older candidate.""" git_repo.git(tmp_path, "init", "-q") _commit(tmp_path, "rc.2") @@ -1186,10 +1188,11 @@ def test_every_stray_above_the_finals_candidate_is_told_to_go(tmp_path: Path) -> for n in (3, 4): git_repo.git(tmp_path, "checkout", "-q", f"v1.2.0-rc.{n}") error = prepare.check_tag(f"1.2.0-rc.{n}", tmp_path) - assert error and f":refs/tags/v1.2.0-rc.{n}" in error # the stray tag to delete + assert error and f"v1.2.0-rc.{n} is not run and its tag stays" in error + assert "refs/tags" not in error git_repo.git(tmp_path, "checkout", "-q", "v1.2.0") error = prepare.check_tag("1.2.0", tmp_path) - assert error and "v1.2.0 is not on v1.2.0-rc.4's commit" in error # until it is deleted + assert error and "v1.2.0 is not on v1.2.0-rc.4's commit" in error # the strays' tags stay def test_a_candidate_is_compared_with_the_highest_on_the_finals_commit(tmp_path: Path) -> None: @@ -1239,7 +1242,5 @@ def test_a_soaked_candidate_run_again_after_its_final_is_not_told_to_delete_itse git_repo.git(tmp_path, "tag", "v1.2.0-rc.3") # a stray, on another commit than the final error = prepare.check_tag("1.2.0-rc.3", tmp_path) assert error and "v1.2.0 is already tagged" in error - assert ":refs/tags/v1.2.0-rc.3" in error # the stray tag to delete - assert error.endswith( - "when v1.2.0's run published nothing, delete v1.2.0 instead (git push origin :refs/tags/v1.2.0)" - ) + assert "v1.2.0-rc.3 is not run and its tag stays" in error + assert "When v1.2.0's run published nothing, add v1.2.0 to UNRELEASED" in error From ae8b0c5e1e77df6df10e8afdf31cd18549ae7e34 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 16:56:31 +0530 Subject: [PATCH 02/40] Release tooling: a scan fix is tagged after a gating run, and the scan gate fails closed Only a gating docker-smoke run counts before a tag; after a scan fix the target is dispatched and that run's commit tagged. A missing gate output keeps the scans strict. The skill prints a push the command rules refuse for the owner. A stray candidate after a partly published final ships the rest as the next patch. Tests cover a doc pin naming two versions or none. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-investigate-ci/SKILL.md | 2 +- .claude/skills/loom-release/SKILL.md | 8 +++--- .github/workflows/docker-smoke.yml | 4 +-- docs/development/release-process.md | 30 ++++++++++++--------- docs/reference/environment.md | 5 ++-- scripts/release/prepare.py | 10 +++---- tests/unit/test_docker_quickstart_smoke.py | 3 ++- tests/unit/test_release_prepare.py | 26 +++++++++++++++++- 8 files changed, 60 insertions(+), 28 deletions(-) diff --git a/.claude/skills/loom-investigate-ci/SKILL.md b/.claude/skills/loom-investigate-ci/SKILL.md index 00b12a6e6d0..270088bb4e1 100644 --- a/.claude/skills/loom-investigate-ci/SKILL.md +++ b/.claude/skills/loom-investigate-ci/SKILL.md @@ -31,7 +31,7 @@ gh run list --workflow ci.yml --branch main -L 5 --json conclusion,headSha,creat | Job | Usual cause | Reproduce / fix | | --- | --- | --- | | `the ClickHouse release this run tests` (`ci.yml`, `docker-smoke.yml`) | the release lookup in `dev/clickhouse_release.sh` or the registry it reads | rerun once; if it fails again, run the script locally and read its error | -| `Quickstart ()` (`docker-smoke.yml`, on PRs and pushes to `main` or a `release/X.Y` line touching its `paths:`, weekly and on dispatch) | the image or its bundle, the quickstart stack, then the one-line installer in clean containers (`scripts/gates/installer_rehearsal.py`; its FAIL lines name the distribution they ran on); on a weekly or dispatched run, a scan step: a critical CVE with a fixed release in the image | the dashboard test dependencies CI installs first (`npm --prefix frontend ci && npx --prefix frontend playwright install chromium`, after `loom-dev-setup` §6's link check), `docker build -t "loom:smoke-$(basename "$PWD")" .`, then `python3 scripts/gates/docker_quickstart_smoke.py --image "loom:smoke-$(basename "$PWD")" --clickhouse-image ` (a tag per worktree: two sessions share the image store; `docker rmi` it afterwards), with the image from `bash dev/clickhouse_release.sh`. The rehearsal, with the tags fetched and Docker on `/var/run/docker.sock`: `python3 scripts/release/build_stack_bundle.py build --version --clickhouse-image --output-dir `, then `python3 scripts/gates/installer_rehearsal.py --release-dir --upgrade --image --extractor-image `. A scan: build with `docker build --no-cache` (a cached apt layer keeps a fixed package), then `trivy image --severity CRITICAL --ignore-unfixed` on it names the package; move the pin that brings it in (a `Dockerfile` `ARG`, the base-image digest for a package the base image carries, or a lock file) | +| `Quickstart ()` (`docker-smoke.yml`, on PRs and pushes to `main` or a `release/X.Y` line touching its `paths:`, weekly and on dispatch) | the image or its bundle, the quickstart stack, then the one-line installer in clean containers (`scripts/gates/installer_rehearsal.py`; its FAIL lines name the distribution they ran on); on a run `scripts/gates/docker_smoke_gate.sh` gates (weekly, dispatched, a `Release X.Y.Z` PR or its merge commit, a `release/X.Y` line), a scan step: a critical CVE with a fixed release in the image | the dashboard test dependencies CI installs first (`npm --prefix frontend ci && npx --prefix frontend playwright install chromium`, after `loom-dev-setup` §6's link check), `docker build -t "loom:smoke-$(basename "$PWD")" .`, then `python3 scripts/gates/docker_quickstart_smoke.py --image "loom:smoke-$(basename "$PWD")" --clickhouse-image ` (a tag per worktree: two sessions share the image store; `docker rmi` it afterwards), with the image from `bash dev/clickhouse_release.sh`. The rehearsal, with the tags fetched and Docker on `/var/run/docker.sock`: `python3 scripts/release/build_stack_bundle.py build --version --clickhouse-image --output-dir `, then `python3 scripts/gates/installer_rehearsal.py --release-dir --upgrade --image --extractor-image `. A scan: build with `docker build --no-cache` (a cached apt layer keeps a fixed package), then `trivy image --severity CRITICAL --ignore-unfixed` on it names the package; move the pin that brings it in (a `Dockerfile` `ARG`, the base-image digest for a package the base image carries, or a lock file) | | `Repository-job sandbox under the shipped profiles` (`docker-smoke.yml`) | the AppArmor or seccomp profile, or a sandbox change the profile blocks | the profiles row of `loom-pre-push` §3 | | `ruff + mypy-gate` (lint) | a generator `--check` is stale (the plugin sync also compares executable bits); ruff; function-length or mypy ratchet | `make lint`, `make typecheck`; run the named generator without `--check` and commit its output; split the long function | | `pytest unit part k` | order dependence; two tests sharing a file or port while they run side by side; a fake that drifted; a snapshot; a migration number `main` took since your base (renumber per the `migrations` rule) | the reproduction in [`tests/README.md`](../../../tests/README.md), with the part's `LOOM_TEST_SHARD=k/6` on the commands that name `tests/unit`; update a snapshot only for an intended change | diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 860d79e9297..2c53d5837d0 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -8,7 +8,7 @@ metadata: # Releasing Loom -"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. Keep GitHub's review, CI and environment rules. The owner's release request authorizes routine publication and verification for that version. Ask separately before a rollback, a public announcement or a deployment. The request covers the release's tag and `release/X.Y` pushes: run each `git push` as its own command, never inside a script, so the repository's command rules see it. The rules keep `release.yml` dispatches (a dry run, a recovery) with the owner: print the exact command. +"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. Keep GitHub's review, CI and environment rules. The owner's release request authorizes routine publication and verification for that version. Ask separately before a rollback, a public announcement or a deployment. The request covers the release's tag and `release/X.Y` pushes: run each `git push` as its own command, never inside a script, so the repository's command rules see it. Print a push those rules refuse, and every `release.yml` dispatch (a dry run, a recovery), for the owner to run. ## Prepare the release @@ -21,11 +21,11 @@ metadata: ## Tag and monitor -- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event`): that push builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. If a candidate tag already exists, the final must use the highest candidate's commit. -- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit once its docker-smoke run passed; watch its run and soak it for at least two days. Tag any fix as the next candidate after it merges to the release target, and the soak restarts. The final goes on the highest candidate's commit. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. +- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event`): that push builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. Only a gating run counts (`scripts/gates/docker_smoke_gate.sh`: the release PR, its merge commit, a `release/X.Y` push, a dispatch); another commit's push run passes with a scan finding. When the scan fails, merge the fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, and tag that run's `headSha` once it passed. If a candidate tag already exists, the final must use the highest candidate's commit. +- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit once its docker-smoke run passed; watch its run and soak it for at least two days. Tag any fix as the next candidate once it merged to the release target and a gating run passed on its commit, and the soak restarts. The final goes on the highest candidate's commit. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. - When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. -- When the line's maintenance branch `release/X.Y` does not exist, its first final creates it: `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. +- When the line's maintenance branch `release/X.Y` does not exist, its first final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`, which the command rules leave to the owner. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. - A tag run that fails before `docker-tag` published nothing, and its tag stays: release the fix as the next patch and add the tag to `UNRELEASED`, as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. ## Verify the release diff --git a/.github/workflows/docker-smoke.yml b/.github/workflows/docker-smoke.yml index eb84e0268be..e44e040083f 100644 --- a/.github/workflows/docker-smoke.yml +++ b/.github/workflows/docker-smoke.yml @@ -224,7 +224,7 @@ jobs: - name: Scan the server image with the release's scan settings if: ${{ !cancelled() && steps.server.outcome == 'success' }} uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 - continue-on-error: ${{ needs.clickhouse.outputs.release != 'true' }} + continue-on-error: ${{ needs.clickhouse.outputs.release == 'false' }} env: TRIVY_PLATFORM: linux/${{ matrix.arch }} with: @@ -235,7 +235,7 @@ jobs: - name: Scan the extractor image with the release's scan settings if: ${{ !cancelled() && steps.extractor.outcome == 'success' }} uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0 - continue-on-error: ${{ needs.clickhouse.outputs.release != 'true' }} + continue-on-error: ${{ needs.clickhouse.outputs.release == 'false' }} env: TRIVY_PLATFORM: linux/${{ matrix.arch }} with: diff --git a/docs/development/release-process.md b/docs/development/release-process.md index a4c1a37339e..53d6d889ebc 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -36,14 +36,14 @@ Two plugin pull requests that bump to the same number merge without a conflict, Use `prep/release-X.Y.Z` for the preparation pull request unless the release owner specifies a branch name. Keep all three version components in the branch name. The pull request's base depends on the release: -| Purpose | Branch or tag | Starts from | Pull request base | -| ---------------------------------- | ----------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------- | -| Major or minor release preparation | `prep/release-X.Y.Z` | `origin/main` | `main` | -| Patch release preparation | `prep/release-X.Y.Z` | `origin/release/X.Y` | `release/X.Y` | -| Backport of a fix merged on `main` | `fix/X.Y-` | `origin/release/X.Y` | `release/X.Y` | -| Maintained release line | `release/X.Y` | Final `vX.Y.0` commit | Receives backport and patch preparation pull requests | -| Release candidate tag | `vX.Y.Z-rc.N` | Release pull request's merge commit, or a subsequent candidate fix | — | -| Final release tag | `vX.Y.Z` | Release pull request's merge commit, or the highest candidate's soaked commit | — | +| Purpose | Branch or tag | Starts from | Pull request base | +| ---------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | +| Major or minor release preparation | `prep/release-X.Y.Z` | `origin/main` | `main` | +| Patch release preparation | `prep/release-X.Y.Z` | `origin/release/X.Y` | `release/X.Y` | +| Backport of a fix merged on `main` | `fix/X.Y-` | `origin/release/X.Y` | `release/X.Y` | +| Maintained release line | `release/X.Y` | Final `vX.Y.0` commit | Receives backport and patch preparation pull requests | +| Release candidate tag | `vX.Y.Z-rc.N` | Release pull request's merge commit, or a subsequent candidate fix | — | +| Final release tag | `vX.Y.Z` | Release pull request's merge commit, a scan fix after it, or the highest candidate's soaked commit | — | Reserve `release/` for maintained `release/X.Y` lines. Check the repository's branch rules before creating a preparation branch. A refused update requires resolution under those rules; renaming a @@ -128,11 +128,16 @@ final's run reads it there. Codex plugin and bumps both plugin versions: clients get it only through a new plugin version. 3. After the release pull request merges, wait for docker-smoke on its merge commit: that run builds and scans the commit the tag will name, as the tag run does, and a pushed `vX.Y.Z` tag is never - moved or deleted. Push the final tag only once it passed. For a requested candidate soak, push + moved or deleted. Push the final tag only once it passed. Only a gating run counts + (`scripts/gates/docker_smoke_gate.sh`: the release pull request, its merge commit, a push to + `release/X.Y`, a dispatch): another commit's push run passes with a scan finding. When the scan + fails, merge the fix to the target, dispatch `docker-smoke.yml` on it and tag that run's + `headSha` once it passed. For a requested candidate soak, push `vX.Y.Z-rc.1` first and publish the final on the highest candidate's commit after the soak. ```bash gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event # a push run, success + gh workflow run docker-smoke.yml -R ClickHouse/loom --ref # after a scan fix: tag its headSha git tag vX.Y.Z git push origin vX.Y.Z ``` @@ -154,8 +159,9 @@ commit, uncached, so an OS package may be newer than in the soaked image. A run candidate tag after its final is refused. One on the final's commit is told to run the final. One numbered below the highest-numbered candidate on the final's commit has nothing to run, and its tag stays. Any other is a stray: its tag stays too, as every `v*` tag does, and it fails the -final's later runs. The chart's `appVersion` names `X.Y.Z` too, -so a soak on Kubernetes sets `image.tag` and `extractor.image.tag` to `X.Y.Z-rc.N`. +final's later runs, so what the final did not publish ships as the next patch. The chart's +`appVersion` names `X.Y.Z` too, so a soak on Kubernetes sets `image.tag` and +`extractor.image.tag` to `X.Y.Z-rc.N`. Only the highest final version becomes the repository's Latest release (`releases/latest` serves the installer) and moves `:latest`: a prerelease or a patch to an older line leaves both where they are. @@ -447,7 +453,7 @@ A run that stopped in `clickhouse` published nothing. [a tag run that published nothing](#what-the-release-workflow-does). - **A downgrade during the soak**: a final carrying its candidate's release is checked too, so a patch to an older line published during the soak with a newer release stops it. Two ways out: - - the final published nothing and its tag stays: release that commit as the next patch, adding + - the final published nothing and its tag stays: release the next patch from that tag, adding the final's tag to `UNRELEASED` as above. Its tag push resolves `latest`; when that is older than the release the error names, dispatch the patch with that release: `gh workflow run release.yml --ref vX.Y. -f clickhouse_image=clickhouse/clickhouse-server:A.B.C.D`; diff --git a/docs/reference/environment.md b/docs/reference/environment.md index 6993820ca1e..c4e5db04789 100644 --- a/docs/reference/environment.md +++ b/docs/reference/environment.md @@ -64,8 +64,9 @@ default model, and sets `LOOM_LOCAL_EMBEDDING_MODEL_DIR=/app/models`. The remain `ARG`s pin toolchain versions and checksums for the compiler-tier indexers (`GO_VERSION`, `NODE_VERSION`, `NPM_VERSION`, `SCIP_GO_VERSION`, `SCIP_CLANG_VERSION`, their `*_SHA256*` values and `LLVM_SIGNER_FPR`, the LLVM signing key's fingerprint); -`NPM_VERSION` replaces the npm Node bundles. `scripts/install-code-toolchains.sh` pins the -tools it installs with that npm (scip-typescript, scip-python and the package managers). +`NPM_VERSION` replaces the npm that the Node tarball bundles. +`scripts/install-code-toolchains.sh` pins the tools it installs with that npm +(scip-typescript, scip-python and the package managers). ## Compose files diff --git a/scripts/release/prepare.py b/scripts/release/prepare.py index ee8bbb50313..7c042d5e3ed 100755 --- a/scripts/release/prepare.py +++ b/scripts/release/prepare.py @@ -129,7 +129,7 @@ def _matches(pin: Pin, text: str) -> list[re.Match[str]]: def _match(pin: Pin, text: str) -> re.Match[str]: - """The one place `pin` names the version, or its first for an `every` pin.""" + """The one place `pin` names the version.""" return _matches(pin, text)[0] @@ -171,8 +171,8 @@ def check(tag_version: str | None = None, root: Path = ROOT) -> list[tuple[str, def validate(version: str, root: Path = ROOT) -> None: """Refuse a final version the files cannot take, before any `gh` call or - write: every pin is found once, the chart's own version parses, and the version - is not below the current one.""" + write: every pin is found as `Pin` says and names one version, the chart's own + version parses, and the version is not below the current one.""" for pin in FOLLOWERS: read(pin, root) chart = read(CHART, root) @@ -292,7 +292,6 @@ def check_tag(tag_version: str, root: Path = ROOT) -> str | None: if not final_sha: return None if final_sha == _sha(root, "HEAD"): - # No deletion advice: the final's runs may read this tag as the one soaked. return ( f"v{tag_version} is on v{final}'s commit, which is released: run v{final} instead" ) @@ -320,7 +319,8 @@ def check_tag(tag_version: str, root: Path = ROOT) -> str | None: # A `v*` tag is never moved or deleted (the repository's tag rules refuse it). _NEXT_PATCH = ( "When v{final}'s run published nothing, add v{final} to UNRELEASED in" - " scripts/release/prepare.py and release the next patch on the commit that should ship" + " scripts/release/prepare.py and release the next patch on the commit that should ship;" + " when it published part, the next patch ships the rest" ) diff --git a/tests/unit/test_docker_quickstart_smoke.py b/tests/unit/test_docker_quickstart_smoke.py index 2c89d71dc1b..f770687a2f8 100644 --- a/tests/unit/test_docker_quickstart_smoke.py +++ b/tests/unit/test_docker_quickstart_smoke.py @@ -329,6 +329,7 @@ def test_docker_smoke_reads_the_gate_for_its_cache_timeout_and_scans() -> None: builds = [s for s in steps if s.get("id") in ("server", "extractor")] assert [s["with"]["no-cache"] for s in builds] == ["${{ " + gated + " }}"] * 2 scans = [s for s in steps if str(s.get("name", "")).startswith("Scan the ")] + # Only an explicit "false" relaxes a scan: a missing gate output keeps it strict. assert [s["continue-on-error"] for s in scans] == [ - "${{ needs.clickhouse.outputs.release != 'true' }}" + "${{ needs.clickhouse.outputs.release == 'false' }}" ] * 2 diff --git a/tests/unit/test_release_prepare.py b/tests/unit/test_release_prepare.py index 8f6a90e4d1b..7521f66c76c 100644 --- a/tests/unit/test_release_prepare.py +++ b/tests/unit/test_release_prepare.py @@ -126,6 +126,29 @@ def test_a_bump_moves_every_version_and_nothing_else(tmp_path: Path) -> None: assert data["version"] == data["packages"][""]["version"] == target +def test_a_pin_found_everywhere_names_one_version_at_least_once(tmp_path: Path) -> None: + pin = prepare.Pin("doc.md", r"pkg==(?P\d+\.\d+\.\d+)", every=True) + (tmp_path / "doc.md").write_text("pkg==1.4.1\npkg==1.4.1\n") + assert prepare.read(pin, tmp_path) == "1.4.1" + (tmp_path / "doc.md").write_text("pkg==1.4.0\npkg==1.4.1\n") + with pytest.raises(prepare.PinError, match="names 1.4.0, 1.4.1, not one version"): + prepare.read(pin, tmp_path) + (tmp_path / "doc.md").write_text("no install line\n") + with pytest.raises(prepare.PinError, match="matches 0 times, not at least once"): + prepare.read(pin, tmp_path) + + +def test_a_doc_pin_on_another_version_stops_the_bump_before_it_writes(tmp_path: Path) -> None: + root = _copy(tmp_path) + docs = root / prepare._FRAMEWORKS + current = prepare.read(prepare.SERVER, root) + docs.write_text(docs.read_text() + "\npip install clickhouse-loom==0.0.1\n") + with pytest.raises( + prepare.PinError, match=f"names 0.0.1, {re.escape(current)}, not one version" + ): + prepare.validate(current, root) + + def test_a_version_already_tagged_is_refused(tmp_path: Path) -> None: root = _copy(tmp_path) git_repo.git(root, "init", "-q") @@ -730,7 +753,8 @@ def test_a_candidate_comes_before_its_final_and_the_final_goes_where_it_was_soak error = prepare.check_tag("1.2.0", tmp_path) assert error and "v1.2.0 is not on v1.2.0-rc.1's commit" in error assert error.endswith( - "add v1.2.0 to UNRELEASED in scripts/release/prepare.py and release the next patch on the commit that should ship" + "add v1.2.0 to UNRELEASED in scripts/release/prepare.py and release the next patch on the commit that should ship;" + " when it published part, the next patch ships the rest" ) assert "refs/tags" not in error # a v* tag is never deleted git_repo.git(tmp_path, "tag", "v1.2.0-rc.2") # the fix soaked as rc.2: its commit is HEAD From 59f8dac7a403d0902a8e4e6a498a041d31f2881b Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 17:18:05 +0530 Subject: [PATCH 03/40] Release tooling: the tag check reads the run's title, and a later tag refreshes the notes The squash title is the commit's subject for a one-commit pull request, so the merge commit's push run gates only when its title reads Release X.Y.Z (#N); the check reads displayTitle and dispatches otherwise. A tag past the release pull request refreshes its notes. The release line merges into main with a merge commit, named in the skill as the exception to squash-merging. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 8 ++++---- docs/development/release-process.md | 13 +++++++------ scripts/release/prepare.py | 15 +++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 2c53d5837d0..697b7dd3094 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -21,12 +21,12 @@ metadata: ## Tag and monitor -- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event`): that push builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. Only a gating run counts (`scripts/gates/docker_smoke_gate.sh`: the release PR, its merge commit, a `release/X.Y` push, a dispatch); another commit's push run passes with a scan finding. When the scan fails, merge the fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, and tag that run's `headSha` once it passed. If a candidate tag already exists, the final must use the highest candidate's commit. -- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit once its docker-smoke run passed; watch its run and soak it for at least two days. Tag any fix as the next candidate once it merged to the release target and a gating run passed on its commit, and the soak restarts. The final goes on the highest candidate's commit. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. +- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`): that push builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. Only a gating run on that commit counts (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to `release/X.Y`, or a dispatch; any other push run passes with a scan finding. With another title, or after a scan fix merged to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref ` and tag that run's `headSha` once it passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes. If a candidate tag already exists, the final must use the highest candidate's commit. +- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit once its docker-smoke run passed; watch its run and soak it for at least two days. Tag any fix as the next candidate once it merged to the release target and a gating run passed on its commit (dispatched on `main`, as above), and the soak restarts. The final goes on the highest candidate's commit. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. - When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. -- When the line's maintenance branch `release/X.Y` does not exist, its first final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`, which the command rules leave to the owner. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. -- A tag run that fails before `docker-tag` published nothing, and its tag stays: release the fix as the next patch and add the tag to `UNRELEASED`, as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. +- When the line's maintenance branch `release/X.Y` does not exist, its first final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. +- A tag run that fails before `docker-tag` published nothing, and its tag stays: release the fix as the next patch, add the tag to `UNRELEASED`, and merge `release/X.Y` into `main` with a merge commit (the one exception to squash-merging), as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. ## Verify the release diff --git a/docs/development/release-process.md b/docs/development/release-process.md index 53d6d889ebc..578c8630e08 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -128,15 +128,16 @@ final's run reads it there. Codex plugin and bumps both plugin versions: clients get it only through a new plugin version. 3. After the release pull request merges, wait for docker-smoke on its merge commit: that run builds and scans the commit the tag will name, as the tag run does, and a pushed `vX.Y.Z` tag is never - moved or deleted. Push the final tag only once it passed. Only a gating run counts - (`scripts/gates/docker_smoke_gate.sh`: the release pull request, its merge commit, a push to - `release/X.Y`, a dispatch): another commit's push run passes with a scan finding. When the scan - fails, merge the fix to the target, dispatch `docker-smoke.yml` on it and tag that run's - `headSha` once it passed. For a requested candidate soak, push + moved or deleted. Push the final tag only once it passed. Only a gating run on that commit + counts (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to + `release/X.Y`, or a dispatch; any other push run passes with a scan finding. With another + title, or after a scan fix merged to the target, dispatch `docker-smoke.yml` on the target and + tag that run's `headSha` once it passed; when that commit is past the release pull request, + refresh the [release notes](#release-notes) there first. For a requested candidate soak, push `vX.Y.Z-rc.1` first and publish the final on the highest candidate's commit after the soak. ```bash - gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event # a push run, success + gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle # push, Release X.Y.Z (#N), success gh workflow run docker-smoke.yml -R ClickHouse/loom --ref # after a scan fix: tag its headSha git tag vX.Y.Z git push origin vX.Y.Z diff --git a/scripts/release/prepare.py b/scripts/release/prepare.py index 7c042d5e3ed..fdee225790b 100755 --- a/scripts/release/prepare.py +++ b/scripts/release/prepare.py @@ -277,6 +277,13 @@ def refuse_tagged(version: str, root: Path = ROOT) -> None: raise ValueError(f"v{version} is already tagged: prepare the next version") +_NEXT_PATCH = ( + "When v{final}'s run published nothing, add v{final} to UNRELEASED in" + " scripts/release/prepare.py and release the next patch on the commit that should ship;" + " when it published part, the next patch ships the rest" +) + + def check_tag(tag_version: str, root: Path = ROOT) -> str | None: """An error for a tag that breaks the candidate order, or None. @@ -316,14 +323,6 @@ def check_tag(tag_version: str, root: Path = ROOT) -> str | None: return None -# A `v*` tag is never moved or deleted (the repository's tag rules refuse it). -_NEXT_PATCH = ( - "When v{final}'s run published nothing, add v{final} to UNRELEASED in" - " scripts/release/prepare.py and release the next patch on the commit that should ship;" - " when it published part, the next patch ships the rest" -) - - def released_chart(tag: str, root: Path = ROOT) -> str: """The chart's own version at a release tag.""" shown = _git(root, "show", f"{tag}:{CHART.path}") From 9ac6c5c862df7e7290f329e5a774be123982b626 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 18:15:02 +0530 Subject: [PATCH 04/40] Release tooling: the release PR merges with its gating subject, and the merge-back reason is stated The skill merges the release PR with --subject "Release X.Y.Z (#N)", so the merge commit's push run always gates; a dispatch is left for a scan fix or another title. The gate qualifier comes before the tag commands. loom-ship-pr names the release-line merge into main as its one exception to squashing, and the release process gives the merge's real effect and cuts the line from the commit that should ship, including a final check-tag refused. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 12 ++++++------ .claude/skills/loom-ship-pr/SKILL.md | 2 +- docs/development/release-process.md | 16 +++++++++------- scripts/release/prepare.py | 7 +------ tests/unit/test_release_prepare.py | 2 +- 5 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 697b7dd3094..6e4a41e2915 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -8,21 +8,21 @@ metadata: # Releasing Loom -"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. Keep GitHub's review, CI and environment rules. The owner's release request authorizes routine publication and verification for that version. Ask separately before a rollback, a public announcement or a deployment. The request covers the release's tag and `release/X.Y` pushes: run each `git push` as its own command, never inside a script, so the repository's command rules see it. Print a push those rules refuse, and every `release.yml` dispatch (a dry run, a recovery), for the owner to run. +"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. Keep GitHub's review, CI and environment rules. The owner's release request authorizes routine publication and verification for that version. Ask separately before a rollback, a public announcement or a deployment. The request covers the release's tag and `release/X.Y` pushes. The committed command rules refuse both to an agent, and a checkout's own settings may allow them: run each `git push` as its own command, never inside a script, so the rules see it, and print one they refuse, and every `release.yml` dispatch (a dry run, a recovery), for the owner to run. ## Prepare the release - Read [release process](../../../docs/development/release-process.md) and [supported versions](../../../docs/operations/supported-versions.md). Check remote tags and open PRs for this version. Resume existing work when its target and version match. - Start a major or minor from `origin/main`. Start a patch from `origin/release/X.Y`; backport any selected fixes to that line through PRs first. Use `prep/release-X.Y.Z` for the release PR unless the owner specifies a name. A repository rule that refuses a branch or tag update needs a resolution under that rule. - Check the latest CI on the target and a passing container scan from the past week. Print the dry build (`gh workflow run release.yml -R ClickHouse/loom --ref -f dry_run=true`) for the owner to start in parallel with preparing the PR, and read its prerequisite warnings when it runs; it is not a gate. -- Use `.venv/bin/python scripts/release/prepare.py bump X.Y.Z` in the release worktree. The tool bumps the server, images, dashboard, Python SDK, npm SDK, Helm chart and root skills and writes `release-notes.md`. If the Rust SDK has changes since its last published version, bump its independent SemVer in `sdk/rust/Cargo.toml` and check it with `scripts/release/rust_sdk.py check-version`. A final release publishes that crate version if it is absent from crates.io. +- Use `.venv/bin/python scripts/release/prepare.py bump X.Y.Z` in the release worktree. The tool bumps the server, images, dashboard, Python SDK, npm SDK, Helm chart, root skills and the install commands in the docs, and writes `release-notes.md`. If the Rust SDK has changes since its last published version, bump its independent SemVer in `sdk/rust/Cargo.toml` and check it with `scripts/release/rust_sdk.py check-version`. A final release publishes that crate version if it is absent from crates.io. - Check the release notes with [loom-writing](../loom-writing/SKILL.md#release-notes-and-announcements). Resolve uncategorized entries and remove items that name no operator action. Surface upgrade steps and client breaks before details. Check whether any shipped plugin changes require raising `MIN_SERVER_VERSION` and bumping the plugin versions. -- Open `Release X.Y.Z` using [loom-ship-pr](../loom-ship-pr/SKILL.md). Include the reviewed notes in the PR body, from the `## Release notes for vX.Y.Z` heading to the `` line `prepare.py` writes; a final's run fails without them. Other PRs enter the release by merging into its target branch before the release PR. Refresh the notes if the base moves. Merge on green when the required reviews and threads are settled. +- Open `Release X.Y.Z` using [loom-ship-pr](../loom-ship-pr/SKILL.md). Include the reviewed notes in the PR body, from the `## Release notes for vX.Y.Z` heading to the `` line `prepare.py` writes; a final's run fails without them. Other PRs enter the release by merging into its target branch before the release PR. Refresh the notes if the base moves. Merge on green when the required reviews and threads are settled, with `gh pr merge --squash --subject "Release X.Y.Z (#)"`: a one-commit pull request's squash title is otherwise its commit's subject, and only that subject makes the merge commit's docker-smoke run gate. ## Tag and monitor -- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`): that push builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. Only a gating run on that commit counts (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to `release/X.Y`, or a dispatch; any other push run passes with a scan finding. With another title, or after a scan fix merged to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref ` and tag that run's `headSha` once it passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes. If a candidate tag already exists, the final must use the highest candidate's commit. -- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit once its docker-smoke run passed; watch its run and soak it for at least two days. Tag any fix as the next candidate once it merged to the release target and a gating run passed on its commit (dispatched on `main`, as above), and the soak restarts. The final goes on the highest candidate's commit. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. +- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`): that push builds and scans the exact commit as the tag run does. Only a gating run on that commit counts (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to `release/X.Y`, or a dispatch; any other push run passes with a scan finding. Once a gating run passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failed scan, merge the fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref ` (on `release/X.Y` the fix's push gates already), and tag that run's commit once it passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes. A merge commit with another title takes the same dispatch. If a candidate tag already exists, the final must use the highest candidate's commit. +- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit once a gating docker-smoke run passed on it; watch its run and soak it for at least two days. Tag any fix as the next candidate once it merged to the release target and a gating run passed on its commit (a dispatch on `main`, the fix's push on `release/X.Y`), and the soak restarts. The final goes on the highest candidate's commit. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. - When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. - When the line's maintenance branch `release/X.Y` does not exist, its first final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. @@ -30,7 +30,7 @@ metadata: ## Verify the release -Read the published GitHub Release and confirm the reviewed opening, then the package and image versions from the tagged run and the registries. Check both image version tags and their moving tags, PyPI provenance, the npm dist-tag and signatures, the Rust version, the n8n nodes package (`n8n-publish.yml` on the tag), and the MCP Registry listing: +Read the published GitHub Release and confirm the reviewed opening, then the package and image versions from the tagged run and the registries. Check both image version tags and their moving tags, PyPI provenance, the npm dist-tag and signatures, the Rust version, for a final the n8n nodes package (`n8n-publish.yml` on the tag), and the MCP Registry listing: ```bash curl -fsS "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.ClickHouse/loom" | jq '.servers[].server.version' # lists X.Y.Z diff --git a/.claude/skills/loom-ship-pr/SKILL.md b/.claude/skills/loom-ship-pr/SKILL.md index 753c4ba785a..8fd0de41859 100644 --- a/.claude/skills/loom-ship-pr/SKILL.md +++ b/.claude/skills/loom-ship-pr/SKILL.md @@ -77,7 +77,7 @@ git push origin --delete # the repository keeps merged branches `--delete-branch` would check out and pull `main` in this linked worktree, which `main`'s shared ref forbids, and fails after the merge when `main` is checked out elsewhere. -- Squash-merge always. Never merge another author's PR for them. +- Squash-merge always, except a `release/X.Y` line merged into `main` after a patch (`gh pr merge --merge`, as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says). Never merge another author's PR for them. - If another PR merged after your last green run and yours adds files the whole-tree gates scan (any `.py`, `.md`, test or doc), rebase on it (`git fetch origin main && git rebase origin/main && git push --force-with-lease`, which asks for approval; `--force`, `-f` and `+ref` are denied) and wait for green again: two PRs green alone can be red together. - Two open PRs that bump the plugin to the same version: the second ships nothing. Re-bump before merging. diff --git a/docs/development/release-process.md b/docs/development/release-process.md index 578c8630e08..97aaf2b5691 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -112,7 +112,7 @@ final's run reads it there. release does, and a scheduled run's failure notifies only the last editor of its schedule. The runs that gate a release build both images uncached and fail on a scan finding: a weekly or dispatched run, the release pull request (titled exactly `Release X.Y.Z`), its merge commit - (subject `Release X.Y.Z (#N)`), a pull request into a `release/X.Y` line and a push there + when merged with the subject `Release X.Y.Z (#N)`, a pull request into a `release/X.Y` line and a push there (`scripts/gates/docker_smoke_gate.sh`). On other pull requests and pushes the scan warns. A red scan names the package: move the pin that brings it in (a `Dockerfile` `ARG` or base-image digest, or a lock file) on `main` first. The base image's own packages move only with a new base-image @@ -354,12 +354,14 @@ Never move a published `X.Y.Z` tag: `published_images.sh` fails when a published from another commit than the run's, and a fix needs a new version. A tag run that fails before `docker-tag` (a scan, a build) publishes nothing, and its `vX.Y.Z` tag -stays, since the repository's tag rules refuse moving or deleting one. Create `release/X.Y` from -that tag when the line has none, release the fix as the next patch there, and add the tag to -`UNRELEASED` in `scripts/release/prepare.py`, so that no release's notes start from it and no -upgrade rehearsal installs it. Then merge `release/X.Y`'s head into `main` with a merge commit, -not a squash: `main` gets the fix and the patch's tag is in its history, so the next release's -notes start from it. +stays, since the repository's tag rules refuse moving or deleting one; so does a final that +`check-tag` refused for standing off its highest candidate's commit. Create `release/X.Y` from +the commit that should ship when the line has none (the tag's commit after a failed scan or +build, the highest candidate's for a misplaced final), release the fix as the next patch there, +and add the tag to `UNRELEASED` in `scripts/release/prepare.py`, so that no release's notes start +from it and no upgrade rehearsal installs it. Then merge `release/X.Y`'s head into `main` with a +merge commit, not a squash: `main` gets the fix, the `UNRELEASED` entry and the version files +naming the published patch, and a later merge of the line starts from this one. A re-run after a partial publish is safe: each publish job skips what already exists. The one exception is a tag run whose file signing failed, which [a failed tag or diff --git a/scripts/release/prepare.py b/scripts/release/prepare.py index fdee225790b..d843dcfae0a 100755 --- a/scripts/release/prepare.py +++ b/scripts/release/prepare.py @@ -128,11 +128,6 @@ def _matches(pin: Pin, text: str) -> list[re.Match[str]]: return found -def _match(pin: Pin, text: str) -> re.Match[str]: - """The one place `pin` names the version.""" - return _matches(pin, text)[0] - - def _text(path: str, root: Path) -> str: try: return (root / path).read_text(encoding="utf-8") @@ -327,7 +322,7 @@ def released_chart(tag: str, root: Path = ROOT) -> str: """The chart's own version at a release tag.""" shown = _git(root, "show", f"{tag}:{CHART.path}") try: - version = _match(CHART, shown.stdout).group("v") + version = _matches(CHART, shown.stdout)[0].group("v") parse(version) except PinError as e: raise PinError(CHART.path, f"{e.reason} (at {tag})") from None diff --git a/tests/unit/test_release_prepare.py b/tests/unit/test_release_prepare.py index 7521f66c76c..741b135c7f9 100644 --- a/tests/unit/test_release_prepare.py +++ b/tests/unit/test_release_prepare.py @@ -138,7 +138,7 @@ def test_a_pin_found_everywhere_names_one_version_at_least_once(tmp_path: Path) prepare.read(pin, tmp_path) -def test_a_doc_pin_on_another_version_stops_the_bump_before_it_writes(tmp_path: Path) -> None: +def test_a_doc_pin_on_another_version_is_refused_by_validate(tmp_path: Path) -> None: root = _copy(tmp_path) docs = root / prepare._FRAMEWORKS current = prepare.read(prepare.SERVER, root) From 4980e28a79ad7556527ac2e854fd04869ee22ab6 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 18:30:37 +0530 Subject: [PATCH 05/40] The standalone-skills bump test reads a pin through _matches Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- tests/unit/test_standalone_skills.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_standalone_skills.py b/tests/unit/test_standalone_skills.py index a51b9d98b89..aeb9c1090b4 100644 --- a/tests/unit/test_standalone_skills.py +++ b/tests/unit/test_standalone_skills.py @@ -178,7 +178,7 @@ def test_the_release_bump_moves_a_bundles_version_as_the_generator_writes_it() - for path in sorted({p.path for p in pins}): text = (ROOT / path).read_text() for pin in [p for p in pins if p.path == path]: - start, end = prepare._match(pin, text).span("v") + start, end = prepare._matches(pin, text)[0].span("v") text = text[:start] + target + text[end:] assert text == want[str(Path(path).relative_to(mod.TARGET.relative_to(ROOT)))], path From 1e08a8f19cf5ebb98384a1b0b67db92ebc3151f1 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 18:33:12 +0530 Subject: [PATCH 06/40] Release tooling: the final after a soak takes a fresh gating run, and the merge-back is for main's own line A dispatch on the highest candidate's tag gates the final, whose images are built again, uncached. The release line merges into main only when main still names the dead version; an older line's dead tag needs nothing there. The line starts from the commit that should ship in every place that says so. A unit test fails on an install pin in the docs that the bump does not move, and the extras class takes a comma. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 10 +++++----- .claude/skills/loom-ship-pr/SKILL.md | 2 +- docs/development/release-process.md | 18 +++++++++++------- scripts/release/prepare.py | 2 +- tests/unit/test_release_prepare.py | 20 ++++++++++++++++++++ 5 files changed, 38 insertions(+), 14 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 6e4a41e2915..40c64c7ab1f 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -8,7 +8,7 @@ metadata: # Releasing Loom -"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. Keep GitHub's review, CI and environment rules. The owner's release request authorizes routine publication and verification for that version. Ask separately before a rollback, a public announcement or a deployment. The request covers the release's tag and `release/X.Y` pushes. The committed command rules refuse both to an agent, and a checkout's own settings may allow them: run each `git push` as its own command, never inside a script, so the rules see it, and print one they refuse, and every `release.yml` dispatch (a dry run, a recovery), for the owner to run. +"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. Keep GitHub's review, CI and environment rules. The owner's release request authorizes routine publication and verification for that version. Ask separately before a rollback, a public announcement or a deployment. The request covers the release's tag and `release/X.Y` pushes. The committed command rules refuse both to an agent, and a checkout's own settings may allow them: Run each `git push` as its own command, never inside a script, so the rules see it. Print a push they refuse, and every `release.yml` dispatch (a dry run, a recovery), for the owner to run. ## Prepare the release @@ -21,12 +21,12 @@ metadata: ## Tag and monitor -- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`): that push builds and scans the exact commit as the tag run does. Only a gating run on that commit counts (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to `release/X.Y`, or a dispatch; any other push run passes with a scan finding. Once a gating run passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failed scan, merge the fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref ` (on `release/X.Y` the fix's push gates already), and tag that run's commit once it passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes. A merge commit with another title takes the same dispatch. If a candidate tag already exists, the final must use the highest candidate's commit. -- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit once a gating docker-smoke run passed on it; watch its run and soak it for at least two days. Tag any fix as the next candidate once it merged to the release target and a gating run passed on its commit (a dispatch on `main`, the fix's push on `release/X.Y`), and the soak restarts. The final goes on the highest candidate's commit. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. +- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`): that push builds and scans the exact commit as the tag run does. Only a gating run on that commit counts (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to `release/X.Y`, or a dispatch; any other push run passes with a scan finding. Once a gating run passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failed scan, merge the fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref ` (on `release/X.Y` the fix's push gates already), and tag that run's commit once it passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes. A merge commit with another title takes the same dispatch. If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). +- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit once a gating docker-smoke run passed on it; watch its run and soak it for at least two days. Tag any fix as the next candidate once it merged to the release target and a gating run passed on its commit (a dispatch on `main`, the fix's push on `release/X.Y`), and the soak restarts. The final goes on the highest candidate's commit once `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N` passed: the final's images are built again, uncached, so a CVE fixed during the soak fails the final's scan. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. - When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. -- When the line's maintenance branch `release/X.Y` does not exist, its first final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. -- A tag run that fails before `docker-tag` published nothing, and its tag stays: release the fix as the next patch, add the tag to `UNRELEASED`, and merge `release/X.Y` into `main` with a merge commit (the one exception to squash-merging), as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. +- When the line's maintenance branch `release/X.Y` does not exist, its first published final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`; after a final that published nothing, push the commit that should ship instead (`:refs/heads/release/X.Y`). Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. +- A tag run that fails before `docker-tag` published nothing, and its tag stays: create `release/X.Y` from the commit that should ship if the line has none, release the fix as the next patch there, and add the tag to `UNRELEASED`. When `main` still names that version, merge `release/X.Y` into `main` with a merge commit (the one exception to squash-merging); an older line's dead tag needs nothing on `main`. All as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. ## Verify the release diff --git a/.claude/skills/loom-ship-pr/SKILL.md b/.claude/skills/loom-ship-pr/SKILL.md index 8fd0de41859..6565e2ac3ec 100644 --- a/.claude/skills/loom-ship-pr/SKILL.md +++ b/.claude/skills/loom-ship-pr/SKILL.md @@ -77,7 +77,7 @@ git push origin --delete # the repository keeps merged branches `--delete-branch` would check out and pull `main` in this linked worktree, which `main`'s shared ref forbids, and fails after the merge when `main` is checked out elsewhere. -- Squash-merge always, except a `release/X.Y` line merged into `main` after a patch (`gh pr merge --merge`, as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says). Never merge another author's PR for them. +- Squash-merge always, except a `release/X.Y` line merged into `main` after a dead tag `main` still names (`gh pr merge --merge`, as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says). Never merge another author's PR for them. - If another PR merged after your last green run and yours adds files the whole-tree gates scan (any `.py`, `.md`, test or doc), rebase on it (`git fetch origin main && git rebase origin/main && git push --force-with-lease`, which asks for approval; `--force`, `-f` and `+ref` are denied) and wait for green again: two PRs green alone can be red together. - Two open PRs that bump the plugin to the same version: the second ships nothing. Re-bump before merging. diff --git a/docs/development/release-process.md b/docs/development/release-process.md index 97aaf2b5691..c2731b47540 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -41,7 +41,7 @@ branch name. Keep all three version components in the branch name. The pull requ | Major or minor release preparation | `prep/release-X.Y.Z` | `origin/main` | `main` | | Patch release preparation | `prep/release-X.Y.Z` | `origin/release/X.Y` | `release/X.Y` | | Backport of a fix merged on `main` | `fix/X.Y-` | `origin/release/X.Y` | `release/X.Y` | -| Maintained release line | `release/X.Y` | Final `vX.Y.0` commit | Receives backport and patch preparation pull requests | +| Maintained release line | `release/X.Y` | Final `vX.Y.0` commit, or the commit that should ship after a dead `vX.Y.0` | Receives backport and patch preparation pull requests | | Release candidate tag | `vX.Y.Z-rc.N` | Release pull request's merge commit, or a subsequent candidate fix | — | | Final release tag | `vX.Y.Z` | Release pull request's merge commit, a scan fix after it, or the highest candidate's soaked commit | — | @@ -49,8 +49,8 @@ Reserve `release/` for maintained `release/X.Y` lines. Check the repository's br creating a preparation branch. A refused update requires resolution under those rules; renaming a branch or changing its target does not resolve the refusal. -Create the maintained line after publishing its first final release, or from a final tag whose run -published nothing ([what the release workflow does](#what-the-release-workflow-does)). Preparation branches carry +Create the maintained line after publishing its first final release, or, after a final tag whose run +published nothing, from the commit that should ship ([what the release workflow does](#what-the-release-workflow-does)). Preparation branches carry the version bump and notes through their pull request; they do not become maintained lines. Keep published tags fixed. Select backports according to the [supported release lines](../operations/supported-versions.md#release-lines). @@ -134,7 +134,9 @@ final's run reads it there. title, or after a scan fix merged to the target, dispatch `docker-smoke.yml` on the target and tag that run's `headSha` once it passed; when that commit is past the release pull request, refresh the [release notes](#release-notes) there first. For a requested candidate soak, push - `vX.Y.Z-rc.1` first and publish the final on the highest candidate's commit after the soak. + `vX.Y.Z-rc.1` first and publish the final on the highest candidate's commit after the soak, once + a dispatch on that candidate's tag passed (`gh workflow run docker-smoke.yml --ref vX.Y.Z-rc.N`): + the final's images are built again, uncached, so a CVE fixed during the soak fails its scan. ```bash gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle # push, Release X.Y.Z (#N), success @@ -359,9 +361,11 @@ stays, since the repository's tag rules refuse moving or deleting one; so does a the commit that should ship when the line has none (the tag's commit after a failed scan or build, the highest candidate's for a misplaced final), release the fix as the next patch there, and add the tag to `UNRELEASED` in `scripts/release/prepare.py`, so that no release's notes start -from it and no upgrade rehearsal installs it. Then merge `release/X.Y`'s head into `main` with a -merge commit, not a squash: `main` gets the fix, the `UNRELEASED` entry and the version files -naming the published patch, and a later merge of the line starts from this one. +from it and no upgrade rehearsal installs it. When `main` still names the dead version, merge +`release/X.Y`'s head into `main` with a merge commit, not a squash: `main` gets the `UNRELEASED` +entry and the version files naming the published patch, and a later merge of the line starts +from this one. An older line's dead tag needs nothing on `main`, whose version is already +higher. A re-run after a partial publish is safe: each publish job skips what already exists. The one exception is a tag run whose file signing failed, which [a failed tag or diff --git a/scripts/release/prepare.py b/scripts/release/prepare.py index d843dcfae0a..488aa5680fc 100755 --- a/scripts/release/prepare.py +++ b/scripts/release/prepare.py @@ -89,7 +89,7 @@ class Pin(NamedTuple): Pin("deploy/helm/loom/Chart.yaml", r'^appVersion: "(?P[^"]+)"$'), # Install commands in the docs name the release, which the image serves through # `help.search`: a version PyPI or npm does not have fails the command. - Pin(_FRAMEWORKS, r"clickhouse-loom(?:\[[a-z0-9-]+\])?==(?P\d+\.\d+\.\d+)", every=True), + Pin(_FRAMEWORKS, r"clickhouse-loom(?:\[[a-z0-9,-]+\])?==(?P\d+\.\d+\.\d+)", every=True), Pin(_FRAMEWORKS, r"@clickhouse/loom@(?P\d+\.\d+\.\d+)", every=True), Pin("docs/features/integrations/mcp-clients.md", r"--ref v(?P\d+\.\d+\.\d+)$", every=True), ] diff --git a/tests/unit/test_release_prepare.py b/tests/unit/test_release_prepare.py index 741b135c7f9..841f55111ab 100644 --- a/tests/unit/test_release_prepare.py +++ b/tests/unit/test_release_prepare.py @@ -149,6 +149,26 @@ def test_a_doc_pin_on_another_version_is_refused_by_validate(tmp_path: Path) -> prepare.validate(current, root) +def test_every_install_pin_in_the_docs_is_one_the_bump_moves() -> None: + """An install command naming a version outside `PINS` would stay on the old one.""" + install = re.compile(r"clickhouse-loom(?:\[[^\]]*\])?==\d|@clickhouse/loom@\d|--ref v\d") + moved: dict[str, set[int]] = {} + for pin in prepare.PINS: + text = (ROOT / pin.path).read_text() + found = re.finditer(pin.pattern, text, re.MULTILINE) + moved.setdefault(pin.path, set()).update(m.start("v") for m in found) + pages = [ROOT / "README.md", *(ROOT / "docs").rglob("*.md")] + stray = [] + for page in pages: + if "node_modules" in page.parts: + continue + path, text = page.relative_to(ROOT).as_posix(), page.read_text() + for m in install.finditer(text): + if m.end() - 1 not in moved.get(path, set()): # the version's first digit + stray.append(f"{path}:{text.count(chr(10), 0, m.start()) + 1}") + assert not stray + + def test_a_version_already_tagged_is_refused(tmp_path: Path) -> None: root = _copy(tmp_path) git_repo.git(root, "init", "-q") From da7ff5a45e7cd679e319e466e133a953983961eb Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 19:03:18 +0530 Subject: [PATCH 07/40] Release docs: a dead tag's UNRELEASED entry always reaches main, and a soaked final's patch soaks main's next release reads main's UNRELEASED, so a dead patch on its own line that only the line lists would start the notes and the upgrade rehearsal. The merge-back comes from a branch at release/X.Y's head and never deletes the line. The soak steps match between the skill and the page, the next patch goes from the commit that should ship, and the checks table names the install-pin guard. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 8 ++++---- .claude/skills/loom-ship-pr/SKILL.md | 2 +- docs/development/release-process.md | 30 ++++++++++++++++------------ scripts/release/prepare.py | 2 +- tests/unit/test_release_prepare.py | 2 +- 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 40c64c7ab1f..f0c4d297632 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -8,7 +8,7 @@ metadata: # Releasing Loom -"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. Keep GitHub's review, CI and environment rules. The owner's release request authorizes routine publication and verification for that version. Ask separately before a rollback, a public announcement or a deployment. The request covers the release's tag and `release/X.Y` pushes. The committed command rules refuse both to an agent, and a checkout's own settings may allow them: Run each `git push` as its own command, never inside a script, so the rules see it. Print a push they refuse, and every `release.yml` dispatch (a dry run, a recovery), for the owner to run. +"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. Keep GitHub's review, CI and environment rules. The owner's release request authorizes routine publication and verification for that version. Ask separately before a rollback, a public announcement or a deployment. The request covers the release's tag and `release/X.Y` pushes. The committed command rules refuse the tag push, and a line push spelled from the tag, to an agent, and a checkout's own settings may allow them: run each `git push` as its own command, never inside a script, so the rules see it. Print a push they refuse, and every `release.yml` dispatch (a dry run, a recovery), for the owner to run. ## Prepare the release @@ -17,16 +17,16 @@ metadata: - Check the latest CI on the target and a passing container scan from the past week. Print the dry build (`gh workflow run release.yml -R ClickHouse/loom --ref -f dry_run=true`) for the owner to start in parallel with preparing the PR, and read its prerequisite warnings when it runs; it is not a gate. - Use `.venv/bin/python scripts/release/prepare.py bump X.Y.Z` in the release worktree. The tool bumps the server, images, dashboard, Python SDK, npm SDK, Helm chart, root skills and the install commands in the docs, and writes `release-notes.md`. If the Rust SDK has changes since its last published version, bump its independent SemVer in `sdk/rust/Cargo.toml` and check it with `scripts/release/rust_sdk.py check-version`. A final release publishes that crate version if it is absent from crates.io. - Check the release notes with [loom-writing](../loom-writing/SKILL.md#release-notes-and-announcements). Resolve uncategorized entries and remove items that name no operator action. Surface upgrade steps and client breaks before details. Check whether any shipped plugin changes require raising `MIN_SERVER_VERSION` and bumping the plugin versions. -- Open `Release X.Y.Z` using [loom-ship-pr](../loom-ship-pr/SKILL.md). Include the reviewed notes in the PR body, from the `## Release notes for vX.Y.Z` heading to the `` line `prepare.py` writes; a final's run fails without them. Other PRs enter the release by merging into its target branch before the release PR. Refresh the notes if the base moves. Merge on green when the required reviews and threads are settled, with `gh pr merge --squash --subject "Release X.Y.Z (#)"`: a one-commit pull request's squash title is otherwise its commit's subject, and only that subject makes the merge commit's docker-smoke run gate. +- Open `Release X.Y.Z` using [loom-ship-pr](../loom-ship-pr/SKILL.md). Include the reviewed notes in the PR body, from the `## Release notes for vX.Y.Z` heading to the `` line `prepare.py` writes; a final's run fails without them. Other PRs enter the release by merging into its target branch before the release PR. Refresh the notes if the base moves. Merge on green when the required reviews and threads are settled, with `gh pr merge --squash --subject "Release X.Y.Z (#)"`: a one-commit pull request's squash title is otherwise its commit's subject, and only the title `Release X.Y.Z (#)` makes the merge commit's docker-smoke run gate. ## Tag and monitor - **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`): that push builds and scans the exact commit as the tag run does. Only a gating run on that commit counts (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to `release/X.Y`, or a dispatch; any other push run passes with a scan finding. Once a gating run passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failed scan, merge the fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref ` (on `release/X.Y` the fix's push gates already), and tag that run's commit once it passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes. A merge commit with another title takes the same dispatch. If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). -- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit once a gating docker-smoke run passed on it; watch its run and soak it for at least two days. Tag any fix as the next candidate once it merged to the release target and a gating run passed on its commit (a dispatch on `main`, the fix's push on `release/X.Y`), and the soak restarts. The final goes on the highest candidate's commit once `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N` passed: the final's images are built again, uncached, so a CVE fixed during the soak fails the final's scan. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. +- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit once a gating docker-smoke run passed on it; watch its run and soak it for at least two days. Tag any fix as the next candidate once it merged to the release target and a gating run passed (a dispatch on `main`, the fix's push on `release/X.Y`), on that run's commit, and the soak restarts. The final goes on the highest candidate's commit once `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N` passed: the final's images are built again, uncached, so a CVE fixed during the soak fails the final's scan. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. - When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. - When the line's maintenance branch `release/X.Y` does not exist, its first published final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`; after a final that published nothing, push the commit that should ship instead (`:refs/heads/release/X.Y`). Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. -- A tag run that fails before `docker-tag` published nothing, and its tag stays: create `release/X.Y` from the commit that should ship if the line has none, release the fix as the next patch there, and add the tag to `UNRELEASED`. When `main` still names that version, merge `release/X.Y` into `main` with a merge commit (the one exception to squash-merging); an older line's dead tag needs nothing on `main`. All as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. +- A tag run that fails before `docker-tag` published nothing, and its tag stays: create `release/X.Y` from the commit that should ship if the line has none, release the fix as the next patch there, and add the tag to `UNRELEASED` there and on `main`. When `main` still names that version, merge a branch at `release/X.Y`'s head into `main` with a merge commit (the one exception to squash-merging); otherwise add the entry in a one-line PR. Never delete `release/X.Y`. All as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. ## Verify the release diff --git a/.claude/skills/loom-ship-pr/SKILL.md b/.claude/skills/loom-ship-pr/SKILL.md index 6565e2ac3ec..38488e966f5 100644 --- a/.claude/skills/loom-ship-pr/SKILL.md +++ b/.claude/skills/loom-ship-pr/SKILL.md @@ -77,7 +77,7 @@ git push origin --delete # the repository keeps merged branches `--delete-branch` would check out and pull `main` in this linked worktree, which `main`'s shared ref forbids, and fails after the merge when `main` is checked out elsewhere. -- Squash-merge always, except a `release/X.Y` line merged into `main` after a dead tag `main` still names (`gh pr merge --merge`, as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says). Never merge another author's PR for them. +- Squash-merge always, except a `release/X.Y` line merged into `main` after a dead tag `main` still names: open it from a branch at `release/X.Y`'s head, merge it with `gh pr merge --merge`, and delete only that branch, never `release/X.Y` (as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says). Never merge another author's PR for them. - If another PR merged after your last green run and yours adds files the whole-tree gates scan (any `.py`, `.md`, test or doc), rebase on it (`git fetch origin main && git rebase origin/main && git push --force-with-lease`, which asks for approval; `--force`, `-f` and `+ref` are denied) and wait for green again: two PRs green alone can be red together. - Two open PRs that bump the plugin to the same version: the second ships nothing. Re-bump before merging. diff --git a/docs/development/release-process.md b/docs/development/release-process.md index c2731b47540..0826d0457f2 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -26,7 +26,7 @@ The server reads its version from `server/__init__.py` only; the OpenAPI documen | `tests/unit/test_release_version.py` | every surface reports the server's version, and `server.json` keeps the registry listing's shape | | `npm run check:version` (TypeScript SDK) | its four version sources agree | | `tests/unit/test_codex_plugin.py` | both plugin manifests carry one version, and `MIN_SERVER_VERSION` is no newer than the server's version | -| `tests/unit/test_release_prepare.py` | every file `prepare.py` bumps names the server's version | +| `tests/unit/test_release_prepare.py` | every file `prepare.py` bumps names the server's version, and every install command in `docs/` and `README.md` is one the bump moves | | `prepare.py check`, `check-tag`, `check-chart` | the release's `version` job ([step 1](#what-the-release-workflow-does)): one version everywhere, the candidate order, the chart moved | Two plugin pull requests that bump to the same number merge without a conflict, and the second ships nothing to clients the first already updated. Check the plugin version on `main` before bumping. @@ -134,9 +134,11 @@ final's run reads it there. title, or after a scan fix merged to the target, dispatch `docker-smoke.yml` on the target and tag that run's `headSha` once it passed; when that commit is past the release pull request, refresh the [release notes](#release-notes) there first. For a requested candidate soak, push - `vX.Y.Z-rc.1` first and publish the final on the highest candidate's commit after the soak, once - a dispatch on that candidate's tag passed (`gh workflow run docker-smoke.yml --ref vX.Y.Z-rc.N`): - the final's images are built again, uncached, so a CVE fixed during the soak fails its scan. + `vX.Y.Z-rc.1` there instead, once that gating run passed, and tag a candidate fix on a gating + run's commit the same way. Publish the final on the highest candidate's commit after the soak, + once a dispatch on that candidate's tag passed + (`gh workflow run docker-smoke.yml --ref vX.Y.Z-rc.N`): the final's images are built again, + uncached, so a CVE fixed during the soak fails its scan. ```bash gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle # push, Release X.Y.Z (#N), success @@ -361,11 +363,11 @@ stays, since the repository's tag rules refuse moving or deleting one; so does a the commit that should ship when the line has none (the tag's commit after a failed scan or build, the highest candidate's for a misplaced final), release the fix as the next patch there, and add the tag to `UNRELEASED` in `scripts/release/prepare.py`, so that no release's notes start -from it and no upgrade rehearsal installs it. When `main` still names the dead version, merge -`release/X.Y`'s head into `main` with a merge commit, not a squash: `main` gets the `UNRELEASED` -entry and the version files naming the published patch, and a later merge of the line starts -from this one. An older line's dead tag needs nothing on `main`, whose version is already -higher. +from it and no upgrade rehearsal installs it. The entry reaches `main` too, whose next release +would otherwise start from the dead tag. When `main` still names the dead version, merge a branch +at `release/X.Y`'s head into `main` with a merge commit, not a squash: `main` gets the entry and +the version files naming the published patch, and a later merge of the line starts from this +one. Otherwise a one-line pull request adds the entry. `release/X.Y` itself is never deleted. A re-run after a partial publish is safe: each publish job skips what already exists. The one exception is a tag run whose file signing failed, which [a failed tag or @@ -460,10 +462,12 @@ A run that stopped in `clickhouse` published nothing. [a tag run that published nothing](#what-the-release-workflow-does). - **A downgrade during the soak**: a final carrying its candidate's release is checked too, so a patch to an older line published during the soak with a newer release stops it. Two ways out: - - the final published nothing and its tag stays: release the next patch from that tag, adding - the final's tag to `UNRELEASED` as above. Its tag push resolves `latest`; when that is older - than the release the error names, dispatch the patch with that release: - `gh workflow run release.yml --ref vX.Y. -f clickhouse_image=clickhouse/clickhouse-server:A.B.C.D`; + - the final published nothing and its tag stays: release the next patch from that tag's commit, + adding the final's tag to `UNRELEASED` as above, and soak its `vX.Y.-rc.1` first, as the + dead final was soaked. The candidate's tag push resolves `latest`; when that is older than the + release the error names, dispatch the candidate with that release: + `gh workflow run release.yml --ref vX.Y.-rc.1 -f clickhouse_image=clickhouse/clickhouse-server:A.B.C.D`, + and the patch's final keeps it; - or dispatch the final with `-f allow_clickhouse_downgrade=true` and accept the downgrade for that patch's installs. diff --git a/scripts/release/prepare.py b/scripts/release/prepare.py index 488aa5680fc..95ca3653a4c 100755 --- a/scripts/release/prepare.py +++ b/scripts/release/prepare.py @@ -274,7 +274,7 @@ def refuse_tagged(version: str, root: Path = ROOT) -> None: _NEXT_PATCH = ( "When v{final}'s run published nothing, add v{final} to UNRELEASED in" - " scripts/release/prepare.py and release the next patch on the commit that should ship;" + " scripts/release/prepare.py and release the next patch from the commit that should ship;" " when it published part, the next patch ships the rest" ) diff --git a/tests/unit/test_release_prepare.py b/tests/unit/test_release_prepare.py index 841f55111ab..e7d679d5e41 100644 --- a/tests/unit/test_release_prepare.py +++ b/tests/unit/test_release_prepare.py @@ -773,7 +773,7 @@ def test_a_candidate_comes_before_its_final_and_the_final_goes_where_it_was_soak error = prepare.check_tag("1.2.0", tmp_path) assert error and "v1.2.0 is not on v1.2.0-rc.1's commit" in error assert error.endswith( - "add v1.2.0 to UNRELEASED in scripts/release/prepare.py and release the next patch on the commit that should ship;" + "add v1.2.0 to UNRELEASED in scripts/release/prepare.py and release the next patch from the commit that should ship;" " when it published part, the next patch ships the rest" ) assert "refs/tags" not in error # a v* tag is never deleted From c72b3094634431567d9a6a965b37510e35f1533a Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 19:17:52 +0530 Subject: [PATCH 08/40] Release docs: only the final waits for a gating scan, and every line push is spelled from a tag A candidate whose scan fails publishes nothing and costs only its number, so it is tagged on its merge commit without a gating run; the final keeps the fresh dispatch on the highest candidate's tag. The line's first push after a dead final is spelled from the tag of the commit that should ship, as after a published one. On main only the release title gates a merge commit's scan; every push to the line does. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 10 +++++----- docs/development/release-process.md | 9 +++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index f0c4d297632..76583686d3a 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -8,7 +8,7 @@ metadata: # Releasing Loom -"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. Keep GitHub's review, CI and environment rules. The owner's release request authorizes routine publication and verification for that version. Ask separately before a rollback, a public announcement or a deployment. The request covers the release's tag and `release/X.Y` pushes. The committed command rules refuse the tag push, and a line push spelled from the tag, to an agent, and a checkout's own settings may allow them: run each `git push` as its own command, never inside a script, so the rules see it. Print a push they refuse, and every `release.yml` dispatch (a dry run, a recovery), for the owner to run. +"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. Keep GitHub's review, CI and environment rules. The owner's release request authorizes routine publication and verification for that version. Ask separately before a rollback, a public announcement or a deployment. The request covers the release's tag and `release/X.Y` pushes. The committed command rules refuse both to an agent, each spelled from a tag as below, and a checkout's own settings may allow them: run each `git push` as its own command, never inside a script, so the rules see it. Print a push they refuse, and every `release.yml` dispatch (a dry run, a recovery), for the owner to run. ## Prepare the release @@ -17,15 +17,15 @@ metadata: - Check the latest CI on the target and a passing container scan from the past week. Print the dry build (`gh workflow run release.yml -R ClickHouse/loom --ref -f dry_run=true`) for the owner to start in parallel with preparing the PR, and read its prerequisite warnings when it runs; it is not a gate. - Use `.venv/bin/python scripts/release/prepare.py bump X.Y.Z` in the release worktree. The tool bumps the server, images, dashboard, Python SDK, npm SDK, Helm chart, root skills and the install commands in the docs, and writes `release-notes.md`. If the Rust SDK has changes since its last published version, bump its independent SemVer in `sdk/rust/Cargo.toml` and check it with `scripts/release/rust_sdk.py check-version`. A final release publishes that crate version if it is absent from crates.io. - Check the release notes with [loom-writing](../loom-writing/SKILL.md#release-notes-and-announcements). Resolve uncategorized entries and remove items that name no operator action. Surface upgrade steps and client breaks before details. Check whether any shipped plugin changes require raising `MIN_SERVER_VERSION` and bumping the plugin versions. -- Open `Release X.Y.Z` using [loom-ship-pr](../loom-ship-pr/SKILL.md). Include the reviewed notes in the PR body, from the `## Release notes for vX.Y.Z` heading to the `` line `prepare.py` writes; a final's run fails without them. Other PRs enter the release by merging into its target branch before the release PR. Refresh the notes if the base moves. Merge on green when the required reviews and threads are settled, with `gh pr merge --squash --subject "Release X.Y.Z (#)"`: a one-commit pull request's squash title is otherwise its commit's subject, and only the title `Release X.Y.Z (#)` makes the merge commit's docker-smoke run gate. +- Open `Release X.Y.Z` using [loom-ship-pr](../loom-ship-pr/SKILL.md). Include the reviewed notes in the PR body, from the `## Release notes for vX.Y.Z` heading to the `` line `prepare.py` writes; a final's run fails without them. Other PRs enter the release by merging into its target branch before the release PR. Refresh the notes if the base moves. Merge on green when the required reviews and threads are settled, with `gh pr merge --squash --subject "Release X.Y.Z (#)"`: a one-commit pull request's squash title is otherwise its commit's subject, and on `main` only the title `Release X.Y.Z (#)` makes the merge commit's docker-smoke run gate (every push to `release/X.Y` gates). ## Tag and monitor -- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`): that push builds and scans the exact commit as the tag run does. Only a gating run on that commit counts (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to `release/X.Y`, or a dispatch; any other push run passes with a scan finding. Once a gating run passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failed scan, merge the fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref ` (on `release/X.Y` the fix's push gates already), and tag that run's commit once it passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes. A merge commit with another title takes the same dispatch. If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). -- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit once a gating docker-smoke run passed on it; watch its run and soak it for at least two days. Tag any fix as the next candidate once it merged to the release target and a gating run passed (a dispatch on `main`, the fix's push on `release/X.Y`), on that run's commit, and the soak restarts. The final goes on the highest candidate's commit once `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N` passed: the final's images are built again, uncached, so a CVE fixed during the soak fails the final's scan. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. +- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`): that push builds and scans the exact commit as the tag run does. Only a gating run on that commit counts (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to `release/X.Y`, or a dispatch; any other push run passes with a scan finding. Once a gating run passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failed scan, merge the fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref ` (on `release/X.Y` the fix's own push run gates, where `gh run list --commit` lists one), and tag that run's commit once it passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes. A merge commit with another title takes the same dispatch. If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). +- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit with no gating run first: a candidate whose scan fails publishes nothing and costs only its number. Watch its run and soak it for at least two days. Tag any fix as the next candidate on its merge commit on the release target, and the soak restarts. The final goes on the highest candidate's commit once `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N` passed: the final's images are built again, uncached, so a CVE fixed during the soak fails the final's scan. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. - When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. -- When the line's maintenance branch `release/X.Y` does not exist, its first published final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`; after a final that published nothing, push the commit that should ship instead (`:refs/heads/release/X.Y`). Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. +- When the line's maintenance branch `release/X.Y` does not exist, its first published final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`; after a final that published nothing, push the same way from the tag of the commit that should ship: the dead final's after a failed scan or build, the highest candidate's (`"vX.Y.Z-rc.N^{commit}:refs/heads/release/X.Y"`) for a misplaced final. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. - A tag run that fails before `docker-tag` published nothing, and its tag stays: create `release/X.Y` from the commit that should ship if the line has none, release the fix as the next patch there, and add the tag to `UNRELEASED` there and on `main`. When `main` still names that version, merge a branch at `release/X.Y`'s head into `main` with a merge commit (the one exception to squash-merging); otherwise add the entry in a one-line PR. Never delete `release/X.Y`. All as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. ## Verify the release diff --git a/docs/development/release-process.md b/docs/development/release-process.md index 0826d0457f2..e1b6d307241 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -134,8 +134,9 @@ final's run reads it there. title, or after a scan fix merged to the target, dispatch `docker-smoke.yml` on the target and tag that run's `headSha` once it passed; when that commit is past the release pull request, refresh the [release notes](#release-notes) there first. For a requested candidate soak, push - `vX.Y.Z-rc.1` there instead, once that gating run passed, and tag a candidate fix on a gating - run's commit the same way. Publish the final on the highest candidate's commit after the soak, + `vX.Y.Z-rc.1` on the merge commit instead, without waiting: a candidate whose scan fails + publishes nothing and costs only its number, and a candidate fix is tagged on its merge commit + the same way. Publish the final on the highest candidate's commit after the soak, once a dispatch on that candidate's tag passed (`gh workflow run docker-smoke.yml --ref vX.Y.Z-rc.N`): the final's images are built again, uncached, so a CVE fixed during the soak fails its scan. @@ -157,7 +158,7 @@ final's run reads it there. A release candidate is a `vX.Y.Z-rc.N` tag, and makes a GitHub pre-release; the release refuses any other prerelease tag. The first candidate goes on the release pull request's merge commit, whose files name `X.Y.Z`, so the candidate's server already reports `X.Y.Z`; a later one, after a fix, -goes on a later commit of `main`. The final `vX.Y.Z` tag goes on the highest-numbered candidate's +goes on the fix's merge commit on the release target. The final `vX.Y.Z` tag goes on the highest-numbered candidate's commit after the soak. The final's bundle keeps the ClickHouse release of the highest-numbered candidate on that commit with a published bundle; its images are built again from the same commit, uncached, so an OS package may be newer than in the soaked image. A run of a @@ -364,7 +365,7 @@ the commit that should ship when the line has none (the tag's commit after a fai build, the highest candidate's for a misplaced final), release the fix as the next patch there, and add the tag to `UNRELEASED` in `scripts/release/prepare.py`, so that no release's notes start from it and no upgrade rehearsal installs it. The entry reaches `main` too, whose next release -would otherwise start from the dead tag. When `main` still names the dead version, merge a branch +could otherwise start from the dead tag. When `main` still names the dead version, merge a branch at `release/X.Y`'s head into `main` with a merge commit, not a squash: `main` gets the entry and the version files naming the published patch, and a later merge of the line starts from this one. Otherwise a one-line pull request adds the entry. `release/X.Y` itself is never deleted. From 70610ab4e156257415e1d5c495fe68827da17a3a Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 19:31:13 +0530 Subject: [PATCH 09/40] Release docs: a dead tag enters UNRELEASED before the patch's bump, and only the tag push is refused prepare.py bump and the tag run's version job read UNRELEASED from the checkout, so the patch's release PR adds the dead tag before the bump. The committed rules refuse the tag push; the release/X.Y push the request covers is not matched by them. After a scan fix the skill dispatches docker-smoke on the target, as the page does. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 6 +++--- docs/development/release-process.md | 15 ++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 76583686d3a..d1c92ca91f2 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -8,7 +8,7 @@ metadata: # Releasing Loom -"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. Keep GitHub's review, CI and environment rules. The owner's release request authorizes routine publication and verification for that version. Ask separately before a rollback, a public announcement or a deployment. The request covers the release's tag and `release/X.Y` pushes. The committed command rules refuse both to an agent, each spelled from a tag as below, and a checkout's own settings may allow them: run each `git push` as its own command, never inside a script, so the rules see it. Print a push they refuse, and every `release.yml` dispatch (a dry run, a recovery), for the owner to run. +"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. Keep GitHub's review, CI and environment rules. The owner's release request authorizes routine publication and verification for that version. Ask separately before a rollback, a public announcement or a deployment. The request covers the release's tag and `release/X.Y` pushes. The committed command rules refuse the tag push to an agent, and a checkout's own settings may allow it: run each `git push` as its own command, never inside a script, so the rules see it. Print a push they refuse, and every `release.yml` dispatch (a dry run, a recovery), for the owner to run. ## Prepare the release @@ -21,12 +21,12 @@ metadata: ## Tag and monitor -- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`): that push builds and scans the exact commit as the tag run does. Only a gating run on that commit counts (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to `release/X.Y`, or a dispatch; any other push run passes with a scan finding. Once a gating run passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failed scan, merge the fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref ` (on `release/X.Y` the fix's own push run gates, where `gh run list --commit` lists one), and tag that run's commit once it passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes. A merge commit with another title takes the same dispatch. If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). +- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`): that push builds and scans the exact commit as the tag run does. Only a gating run on that commit counts (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to `release/X.Y`, or a dispatch; any other push run passes with a scan finding. Once a gating run passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failed scan, merge the fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, and tag that run's commit once it passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes. A merge commit with another title takes the same dispatch. If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). - **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit with no gating run first: a candidate whose scan fails publishes nothing and costs only its number. Watch its run and soak it for at least two days. Tag any fix as the next candidate on its merge commit on the release target, and the soak restarts. The final goes on the highest candidate's commit once `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N` passed: the final's images are built again, uncached, so a CVE fixed during the soak fails the final's scan. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. - When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. - When the line's maintenance branch `release/X.Y` does not exist, its first published final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`; after a final that published nothing, push the same way from the tag of the commit that should ship: the dead final's after a failed scan or build, the highest candidate's (`"vX.Y.Z-rc.N^{commit}:refs/heads/release/X.Y"`) for a misplaced final. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. -- A tag run that fails before `docker-tag` published nothing, and its tag stays: create `release/X.Y` from the commit that should ship if the line has none, release the fix as the next patch there, and add the tag to `UNRELEASED` there and on `main`. When `main` still names that version, merge a branch at `release/X.Y`'s head into `main` with a merge commit (the one exception to squash-merging); otherwise add the entry in a one-line PR. Never delete `release/X.Y`. All as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. +- A tag run that fails before `docker-tag` published nothing, and its tag stays: create `release/X.Y` from the commit that should ship if the line has none, and release the fix as the next patch there, adding the tag to `UNRELEASED` in that patch's release PR before `prepare.py bump`, so its notes and upgrade rehearsal skip it; the entry also reaches `main`. When `main` still names that version, merge a branch at `release/X.Y`'s head into `main` with a merge commit (the one exception to squash-merging); otherwise add the entry in a one-line PR. Never delete `release/X.Y`. All as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. ## Verify the release diff --git a/docs/development/release-process.md b/docs/development/release-process.md index e1b6d307241..6ada552eea8 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -136,10 +136,10 @@ final's run reads it there. refresh the [release notes](#release-notes) there first. For a requested candidate soak, push `vX.Y.Z-rc.1` on the merge commit instead, without waiting: a candidate whose scan fails publishes nothing and costs only its number, and a candidate fix is tagged on its merge commit - the same way. Publish the final on the highest candidate's commit after the soak, - once a dispatch on that candidate's tag passed - (`gh workflow run docker-smoke.yml --ref vX.Y.Z-rc.N`): the final's images are built again, - uncached, so a CVE fixed during the soak fails its scan. + the same way. Publish the final on the highest candidate's commit after the soak, once a + dispatch on that candidate's tag passed + (`gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N`): the final's images + are built again, uncached, so a CVE fixed during the soak fails its scan. ```bash gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle # push, Release X.Y.Z (#N), success @@ -362,9 +362,10 @@ A tag run that fails before `docker-tag` (a scan, a build) publishes nothing, an stays, since the repository's tag rules refuse moving or deleting one; so does a final that `check-tag` refused for standing off its highest candidate's commit. Create `release/X.Y` from the commit that should ship when the line has none (the tag's commit after a failed scan or -build, the highest candidate's for a misplaced final), release the fix as the next patch there, -and add the tag to `UNRELEASED` in `scripts/release/prepare.py`, so that no release's notes start -from it and no upgrade rehearsal installs it. The entry reaches `main` too, whose next release +build, the highest candidate's for a misplaced final), and release the fix as the next patch +there. That patch's release pull request adds the tag to `UNRELEASED` in +`scripts/release/prepare.py` before `prepare.py bump` runs, so that no release's notes start from +it and no upgrade rehearsal installs it. The entry reaches `main` too, whose next release could otherwise start from the dead tag. When `main` still names the dead version, merge a branch at `release/X.Y`'s head into `main` with a merge commit, not a squash: `main` gets the entry and the version files naming the published patch, and a later merge of the line starts from this From d3b0f71e6138fc85e584247975c1a5691e1c36aa Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 19:55:57 +0530 Subject: [PATCH 10/40] Release docs: the notes refresh before a tag past the release PR, and a weekly scan run gates Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 4 ++-- docs/development/release-process.md | 34 ++++++++++++++-------------- tests/unit/test_release_prepare.py | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index d1c92ca91f2..fc675a772e1 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -21,8 +21,8 @@ metadata: ## Tag and monitor -- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`): that push builds and scans the exact commit as the tag run does. Only a gating run on that commit counts (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to `release/X.Y`, or a dispatch; any other push run passes with a scan finding. Once a gating run passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failed scan, merge the fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, and tag that run's commit once it passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes. A merge commit with another title takes the same dispatch. If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). -- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit with no gating run first: a candidate whose scan fails publishes nothing and costs only its number. Watch its run and soak it for at least two days. Tag any fix as the next candidate on its merge commit on the release target, and the soak restarts. The final goes on the highest candidate's commit once `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N` passed: the final's images are built again, uncached, so a CVE fixed during the soak fails the final's scan. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. +- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`): that push builds and scans the exact commit as the tag run does. Only a gating run on that commit counts (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to `release/X.Y`, a weekly run or a dispatch; any other push run passes with a scan finding. Once a gating run passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failed scan, merge the fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, and tag that run's commit once it passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. A merge commit with another title takes the same dispatch. If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). +- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit with no gating run first: a candidate whose scan fails publishes nothing and costs only its number. Watch its run and soak it for at least two days. Tag any fix as the next candidate on its merge commit on the release target, and the soak restarts. The final goes on the highest candidate's commit once `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N` passed, and, when that commit is past the release PR, after `prepare.py notes X.Y.Z` there and the release PR's notes are updated: the final's images are built again, uncached, so a CVE fixed during the soak fails the final's scan. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. - When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. - When the line's maintenance branch `release/X.Y` does not exist, its first published final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`; after a final that published nothing, push the same way from the tag of the commit that should ship: the dead final's after a failed scan or build, the highest candidate's (`"vX.Y.Z-rc.N^{commit}:refs/heads/release/X.Y"`) for a misplaced final. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. diff --git a/docs/development/release-process.md b/docs/development/release-process.md index 6ada552eea8..8a34f67cd5b 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -71,12 +71,12 @@ section fails there, and a candidate only warns. Add the section to the merged p description, then use "Re-run failed jobs" on that run. A dispatch on the tag skips the check, and `github-release` reads the section again as it creates the GitHub Release. The section is written from `release-notes.md` (not committed), which `prepare.py` writes from the -squash merges since the highest final tag below the release, and holds every operator step (new -settings, backfills, table rebuilds) and client-visible wire change, including every removed request -field and retired flag. No registry of removed fields exists, so the release notes are where a -client learns of one. A pull request's description holds at most 65,536 characters, so where -`release-notes.md` is longer the changelog entries are condensed into highlights; the operator -steps and client breaks stay whole. `release-notes.md` holds: +squash merges since the highest released final tag below the release (`prepare.py previous`), and +holds every operator step (new settings, backfills, table rebuilds) and client-visible wire change, +including every removed request field and retired flag. No registry of removed fields exists, so the +release notes are where a client learns of one. A pull request's description holds at most 65,536 +characters, so where `release-notes.md` is longer the changelog entries are condensed into +highlights; the operator steps and client breaks stay whole. `release-notes.md` holds: - each pull request's changelog entry under its category, in the template's order, or its title when the entry is empty; one whose description names no single category is listed under "Unclassified" @@ -128,18 +128,18 @@ final's run reads it there. Codex plugin and bumps both plugin versions: clients get it only through a new plugin version. 3. After the release pull request merges, wait for docker-smoke on its merge commit: that run builds and scans the commit the tag will name, as the tag run does, and a pushed `vX.Y.Z` tag is never - moved or deleted. Push the final tag only once it passed. Only a gating run on that commit - counts (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to - `release/X.Y`, or a dispatch; any other push run passes with a scan finding. With another - title, or after a scan fix merged to the target, dispatch `docker-smoke.yml` on the target and - tag that run's `headSha` once it passed; when that commit is past the release pull request, - refresh the [release notes](#release-notes) there first. For a requested candidate soak, push - `vX.Y.Z-rc.1` on the merge commit instead, without waiting: a candidate whose scan fails + moved or deleted. Push the final tag only once it passed. Only a gating run on that commit counts + (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to + `release/X.Y`, a weekly run or a dispatch; any other push run passes with a scan finding. With + another title, or after a scan fix merged to the target, dispatch `docker-smoke.yml` on the + target and tag that run's `headSha` once it passed; when that commit is past the release pull + request, refresh the [release notes](#release-notes) there first. For a requested candidate soak, + push `vX.Y.Z-rc.1` on the merge commit instead, without waiting: a candidate whose scan fails publishes nothing and costs only its number, and a candidate fix is tagged on its merge commit - the same way. Publish the final on the highest candidate's commit after the soak, once a - dispatch on that candidate's tag passed - (`gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N`): the final's images - are built again, uncached, so a CVE fixed during the soak fails its scan. + the same way. Publish the final on the highest candidate's commit after the soak, once a dispatch + on that candidate's tag passed + (`gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N`): the final's images are + built again, uncached, so a CVE fixed during the soak fails its scan. ```bash gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle # push, Release X.Y.Z (#N), success diff --git a/tests/unit/test_release_prepare.py b/tests/unit/test_release_prepare.py index e7d679d5e41..db024b0a5c8 100644 --- a/tests/unit/test_release_prepare.py +++ b/tests/unit/test_release_prepare.py @@ -165,7 +165,7 @@ def test_every_install_pin_in_the_docs_is_one_the_bump_moves() -> None: path, text = page.relative_to(ROOT).as_posix(), page.read_text() for m in install.finditer(text): if m.end() - 1 not in moved.get(path, set()): # the version's first digit - stray.append(f"{path}:{text.count(chr(10), 0, m.start()) + 1}") + stray.append(f"{path}:{text.count("\n", 0, m.start()) + 1}") assert not stray From e252c607095dd223a5da0af3f2826ef41cb737a9 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 19:56:54 +0530 Subject: [PATCH 11/40] Format the install-pin test's line count Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- tests/unit/test_release_prepare.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/test_release_prepare.py b/tests/unit/test_release_prepare.py index db024b0a5c8..5d62a5e4403 100644 --- a/tests/unit/test_release_prepare.py +++ b/tests/unit/test_release_prepare.py @@ -165,7 +165,7 @@ def test_every_install_pin_in_the_docs_is_one_the_bump_moves() -> None: path, text = page.relative_to(ROOT).as_posix(), page.read_text() for m in install.finditer(text): if m.end() - 1 not in moved.get(path, set()): # the version's first digit - stray.append(f"{path}:{text.count("\n", 0, m.start()) + 1}") + stray.append(f"{path}:{text.count('\n', 0, m.start()) + 1}") assert not stray From 8316c09509c759f89f3013bf1c0ffebb20f023e2 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 20:15:10 +0530 Subject: [PATCH 12/40] A test bumps to a longer version, and the dead-tag and final-tag rows name what they mean The bump rewrites a file's pins from its end; a test now bumps to a version of another length and fails without that order. The dead-tag bullet is a final's, and the final tag's row names a later commit a gating run passed on. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 2 +- docs/development/release-process.md | 16 ++++++++-------- tests/unit/test_release_prepare.py | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index fc675a772e1..a8ccd28f89d 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -26,7 +26,7 @@ metadata: - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. - When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. - When the line's maintenance branch `release/X.Y` does not exist, its first published final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`; after a final that published nothing, push the same way from the tag of the commit that should ship: the dead final's after a failed scan or build, the highest candidate's (`"vX.Y.Z-rc.N^{commit}:refs/heads/release/X.Y"`) for a misplaced final. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. -- A tag run that fails before `docker-tag` published nothing, and its tag stays: create `release/X.Y` from the commit that should ship if the line has none, and release the fix as the next patch there, adding the tag to `UNRELEASED` in that patch's release PR before `prepare.py bump`, so its notes and upgrade rehearsal skip it; the entry also reaches `main`. When `main` still names that version, merge a branch at `release/X.Y`'s head into `main` with a merge commit (the one exception to squash-merging); otherwise add the entry in a one-line PR. Never delete `release/X.Y`. All as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. +- A final's tag run that fails before `docker-tag` published nothing, and its tag stays: create `release/X.Y` from the commit that should ship if the line has none, and release the fix as the next patch there, adding the tag to `UNRELEASED` in that patch's release PR before `prepare.py bump`, so its notes and upgrade rehearsal skip it; the entry also reaches `main`. When `main` still names that version, merge a branch at `release/X.Y`'s head into `main` with a merge commit (the one exception to squash-merging); otherwise add the entry in a one-line PR. Never delete `release/X.Y`. All as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. ## Verify the release diff --git a/docs/development/release-process.md b/docs/development/release-process.md index 8a34f67cd5b..a47daa4d898 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -36,14 +36,14 @@ Two plugin pull requests that bump to the same number merge without a conflict, Use `prep/release-X.Y.Z` for the preparation pull request unless the release owner specifies a branch name. Keep all three version components in the branch name. The pull request's base depends on the release: -| Purpose | Branch or tag | Starts from | Pull request base | -| ---------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | -| Major or minor release preparation | `prep/release-X.Y.Z` | `origin/main` | `main` | -| Patch release preparation | `prep/release-X.Y.Z` | `origin/release/X.Y` | `release/X.Y` | -| Backport of a fix merged on `main` | `fix/X.Y-` | `origin/release/X.Y` | `release/X.Y` | -| Maintained release line | `release/X.Y` | Final `vX.Y.0` commit, or the commit that should ship after a dead `vX.Y.0` | Receives backport and patch preparation pull requests | -| Release candidate tag | `vX.Y.Z-rc.N` | Release pull request's merge commit, or a subsequent candidate fix | — | -| Final release tag | `vX.Y.Z` | Release pull request's merge commit, a scan fix after it, or the highest candidate's soaked commit | — | +| Purpose | Branch or tag | Starts from | Pull request base | +| ---------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- | +| Major or minor release preparation | `prep/release-X.Y.Z` | `origin/main` | `main` | +| Patch release preparation | `prep/release-X.Y.Z` | `origin/release/X.Y` | `release/X.Y` | +| Backport of a fix merged on `main` | `fix/X.Y-` | `origin/release/X.Y` | `release/X.Y` | +| Maintained release line | `release/X.Y` | Final `vX.Y.0` commit, or the commit that should ship after a dead `vX.Y.0` | Receives backport and patch preparation pull requests | +| Release candidate tag | `vX.Y.Z-rc.N` | Release pull request's merge commit, or a subsequent candidate fix | — | +| Final release tag | `vX.Y.Z` | Release pull request's merge commit, a later commit of its target a gating run passed on, or the highest candidate's soaked commit | — | Reserve `release/` for maintained `release/X.Y` lines. Check the repository's branch rules before creating a preparation branch. A refused update requires resolution under those rules; renaming a diff --git a/tests/unit/test_release_prepare.py b/tests/unit/test_release_prepare.py index 5d62a5e4403..7b3404a694a 100644 --- a/tests/unit/test_release_prepare.py +++ b/tests/unit/test_release_prepare.py @@ -126,6 +126,25 @@ def test_a_bump_moves_every_version_and_nothing_else(tmp_path: Path) -> None: assert data["version"] == data["packages"][""]["version"] == target +def test_a_bump_to_a_longer_version_keeps_every_later_pin_whole(tmp_path: Path) -> None: + """A file's pins are rewritten from its end, so a version of another length leaves the + spans after each one where they were.""" + root = _copy(tmp_path) + current = prepare.read(prepare.SERVER) + major, minor, _ = prepare.parse(current) + target = f"{major}.{minor + 100}.0" + chart = prepare.read(prepare.CHART) + prepare.bump(target, prepare.planned_chart(target, current, chart, root), root) + counts = [] + for pin in (pin for pin in prepare.PINS if pin.every): + before = prepare._matches(pin, (ROOT / pin.path).read_text()) + after = prepare._matches(pin, (root / pin.path).read_text()) + assert len(after) == len(before), pin.path + assert {m["v"] for m in after} == {target}, pin.path + counts.append(len(after)) + assert max(counts) > 1 # a file with several pins, where a shifted span would show + + def test_a_pin_found_everywhere_names_one_version_at_least_once(tmp_path: Path) -> None: pin = prepare.Pin("doc.md", r"pkg==(?P\d+\.\d+\.\d+)", every=True) (tmp_path / "doc.md").write_text("pkg==1.4.1\npkg==1.4.1\n") From e2fa06d785e48ce7be8a19fbfe12cb38f0c409a4 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 20:37:00 +0530 Subject: [PATCH 13/40] The doc pin scan reads tracked pages, and three comments say what the code does Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 2 +- scripts/gates/docker_smoke_gate.sh | 10 +++++----- tests/unit/test_release_prepare.py | 9 ++++----- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index a8ccd28f89d..27eab0144e9 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -26,7 +26,7 @@ metadata: - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. - When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. - When the line's maintenance branch `release/X.Y` does not exist, its first published final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`; after a final that published nothing, push the same way from the tag of the commit that should ship: the dead final's after a failed scan or build, the highest candidate's (`"vX.Y.Z-rc.N^{commit}:refs/heads/release/X.Y"`) for a misplaced final. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. -- A final's tag run that fails before `docker-tag` published nothing, and its tag stays: create `release/X.Y` from the commit that should ship if the line has none, and release the fix as the next patch there, adding the tag to `UNRELEASED` in that patch's release PR before `prepare.py bump`, so its notes and upgrade rehearsal skip it; the entry also reaches `main`. When `main` still names that version, merge a branch at `release/X.Y`'s head into `main` with a merge commit (the one exception to squash-merging); otherwise add the entry in a one-line PR. Never delete `release/X.Y`. All as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. +- A final's tag run that fails before `docker-tag` publishes nothing, and its tag stays: create `release/X.Y` from the commit that should ship if the line has none, and release the fix as the next patch there, adding the tag to `UNRELEASED` in that patch's release PR before `prepare.py bump`, so its notes and upgrade rehearsal skip it; the entry also reaches `main`. When `main` still names that version, merge a branch at `release/X.Y`'s head into `main` with a merge commit (the one exception to squash-merging); otherwise add the entry in a one-line PR. Never delete `release/X.Y`. All as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. ## Verify the release diff --git a/scripts/gates/docker_smoke_gate.sh b/scripts/gates/docker_smoke_gate.sh index f58186c94f7..5460c3617ff 100755 --- a/scripts/gates/docker_smoke_gate.sh +++ b/scripts/gates/docker_smoke_gate.sh @@ -1,9 +1,9 @@ #!/bin/sh -# Prints `release=true` when this docker-smoke run gates a release, else `release=false`. -# Such a run builds both images without the cache and fails on a scan finding, as the -# release's own scan does, since a pushed vX.Y.Z tag is never moved: a weekly or -# dispatched run, a pull request into a release/X.Y line or a push there, the release -# pull request (titled exactly `Release X.Y.Z`) and its merge commit (`Release X.Y.Z (#N)`). +# Prints `release=true` when this docker-smoke run gates a release, else `release=false`: +# a weekly or dispatched run, a pull request into a release/X.Y line or a push there, the +# release pull request (titled exactly `Release X.Y.Z`) and its merge commit +# (`Release X.Y.Z (#N)`). Such a run builds both images without the cache and fails on a +# scan finding, as the release's own scan does, since a pushed vX.Y.Z tag is never moved. # # EVENT=push REF=refs/heads/main TITLE="Release 1.5.0 (#2100)" sh scripts/gates/docker_smoke_gate.sh set -eu diff --git a/tests/unit/test_release_prepare.py b/tests/unit/test_release_prepare.py index 7b3404a694a..d296a257da3 100644 --- a/tests/unit/test_release_prepare.py +++ b/tests/unit/test_release_prepare.py @@ -18,6 +18,7 @@ import yaml from tests.unit import git_repo +from tests.unit.tracked_files import tracked ROOT = Path(__file__).resolve().parents[2] @@ -127,8 +128,8 @@ def test_a_bump_moves_every_version_and_nothing_else(tmp_path: Path) -> None: def test_a_bump_to_a_longer_version_keeps_every_later_pin_whole(tmp_path: Path) -> None: - """A file's pins are rewritten from its end, so a version of another length leaves the - spans after each one where they were.""" + """A file's pins are rewritten from its end, so a version of another length never moves + a span still to be rewritten.""" root = _copy(tmp_path) current = prepare.read(prepare.SERVER) major, minor, _ = prepare.parse(current) @@ -176,11 +177,9 @@ def test_every_install_pin_in_the_docs_is_one_the_bump_moves() -> None: text = (ROOT / pin.path).read_text() found = re.finditer(pin.pattern, text, re.MULTILINE) moved.setdefault(pin.path, set()).update(m.start("v") for m in found) - pages = [ROOT / "README.md", *(ROOT / "docs").rglob("*.md")] + pages = [ROOT / "README.md", *(ROOT / p for p in tracked("docs") if p.endswith(".md"))] stray = [] for page in pages: - if "node_modules" in page.parts: - continue path, text = page.relative_to(ROOT).as_posix(), page.read_text() for m in install.finditer(text): if m.end() - 1 not in moved.get(path, set()): # the version's first digit From ab0dd55339c302f97b56538f3e2bcc0c35713ee3 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 21:02:20 +0530 Subject: [PATCH 14/40] The pin test's target is always longer, and the smoke test pins the gate's inputs Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- tests/unit/test_docker_quickstart_smoke.py | 7 +++++++ tests/unit/test_release_prepare.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/unit/test_docker_quickstart_smoke.py b/tests/unit/test_docker_quickstart_smoke.py index f770687a2f8..a8a32c63e6d 100644 --- a/tests/unit/test_docker_quickstart_smoke.py +++ b/tests/unit/test_docker_quickstart_smoke.py @@ -321,6 +321,13 @@ def test_docker_smoke_reads_the_gate_for_its_cache_timeout_and_scans() -> None: jobs = yaml.safe_load((root / ".github/workflows/docker-smoke.yml").read_text())["jobs"] (gate,) = [s for s in jobs["clickhouse"]["steps"] if s.get("id") == "gate"] assert gate["run"] == 'sh scripts/gates/docker_smoke_gate.sh >> "$GITHUB_OUTPUT"' + # The release pull request and its merge commit gate by their title alone. + assert gate["env"] == { + "EVENT": "${{ github.event_name }}", + "REF": "${{ github.ref }}", + "BASE": "${{ github.base_ref }}", + "TITLE": "${{ github.event.pull_request.title || github.event.head_commit.message }}", + } assert jobs["clickhouse"]["outputs"]["release"] == "${{ steps.gate.outputs.release }}" quickstart = jobs["quickstart"] gated = "needs.clickhouse.outputs.release == 'true'" diff --git a/tests/unit/test_release_prepare.py b/tests/unit/test_release_prepare.py index d296a257da3..da7dd653505 100644 --- a/tests/unit/test_release_prepare.py +++ b/tests/unit/test_release_prepare.py @@ -132,8 +132,8 @@ def test_a_bump_to_a_longer_version_keeps_every_later_pin_whole(tmp_path: Path) a span still to be rewritten.""" root = _copy(tmp_path) current = prepare.read(prepare.SERVER) - major, minor, _ = prepare.parse(current) - target = f"{major}.{minor + 100}.0" + major, minor, patch = prepare.parse(current) + target = f"{major}.{minor}.1{patch}" # above the current version, and one digit longer chart = prepare.read(prepare.CHART) prepare.bump(target, prepare.planned_chart(target, current, chart, root), root) counts = [] From bdb4f93096346a2f96bcacf9c38712ece45e7cdd Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 21:45:36 +0530 Subject: [PATCH 15/40] A stray candidate leaves the final's failed jobs re-runnable, and the gate's titles are named as it matches them Step 3 and the skill's default give one bullet per path. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 7 ++-- docs/development/release-process.md | 39 ++++++++++++---------- scripts/gates/docker_smoke_gate.sh | 6 ++-- scripts/release/prepare.py | 3 +- tests/unit/test_docker_quickstart_smoke.py | 3 ++ tests/unit/test_release_prepare.py | 3 +- 6 files changed, 36 insertions(+), 25 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 27eab0144e9..7f0032d375c 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -17,11 +17,14 @@ metadata: - Check the latest CI on the target and a passing container scan from the past week. Print the dry build (`gh workflow run release.yml -R ClickHouse/loom --ref -f dry_run=true`) for the owner to start in parallel with preparing the PR, and read its prerequisite warnings when it runs; it is not a gate. - Use `.venv/bin/python scripts/release/prepare.py bump X.Y.Z` in the release worktree. The tool bumps the server, images, dashboard, Python SDK, npm SDK, Helm chart, root skills and the install commands in the docs, and writes `release-notes.md`. If the Rust SDK has changes since its last published version, bump its independent SemVer in `sdk/rust/Cargo.toml` and check it with `scripts/release/rust_sdk.py check-version`. A final release publishes that crate version if it is absent from crates.io. - Check the release notes with [loom-writing](../loom-writing/SKILL.md#release-notes-and-announcements). Resolve uncategorized entries and remove items that name no operator action. Surface upgrade steps and client breaks before details. Check whether any shipped plugin changes require raising `MIN_SERVER_VERSION` and bumping the plugin versions. -- Open `Release X.Y.Z` using [loom-ship-pr](../loom-ship-pr/SKILL.md). Include the reviewed notes in the PR body, from the `## Release notes for vX.Y.Z` heading to the `` line `prepare.py` writes; a final's run fails without them. Other PRs enter the release by merging into its target branch before the release PR. Refresh the notes if the base moves. Merge on green when the required reviews and threads are settled, with `gh pr merge --squash --subject "Release X.Y.Z (#)"`: a one-commit pull request's squash title is otherwise its commit's subject, and on `main` only the title `Release X.Y.Z (#)` makes the merge commit's docker-smoke run gate (every push to `release/X.Y` gates). +- Open `Release X.Y.Z` using [loom-ship-pr](../loom-ship-pr/SKILL.md). Include the reviewed notes in the PR body, from the `## Release notes for vX.Y.Z` heading to the `` line `prepare.py` writes; a final's run fails without them. Other PRs enter the release by merging into its target branch before the release PR. Refresh the notes if the base moves. Merge on green when the required reviews and threads are settled, with `gh pr merge --squash --subject "Release X.Y.Z (#)"`: a one-commit pull request's squash title is otherwise its commit's subject, and on `main` only a title `Release X.Y.Z`, with or without ` (#)`, makes the merge commit's docker-smoke run gate (every push to `release/X.Y` gates). ## Tag and monitor -- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit whose scan passed. Wait for docker-smoke on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`): that push builds and scans the exact commit as the tag run does. Only a gating run on that commit counts (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to `release/X.Y`, a weekly run or a dispatch; any other push run passes with a scan finding. Once a gating run passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failed scan, merge the fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, and tag that run's commit once it passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. A merge commit with another title takes the same dispatch. If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). +- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit a gating docker-smoke run passed on (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z`, with or without ` (#N)`, a push to `release/X.Y`, a weekly run or a dispatch; any other push run passes with a scan finding. + - Wait for the push run on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`), which builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. + - After a failed scan, or for a merge commit with another title, merge any fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, and tag that run's commit once it passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. + - If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). - **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit with no gating run first: a candidate whose scan fails publishes nothing and costs only its number. Watch its run and soak it for at least two days. Tag any fix as the next candidate on its merge commit on the release target, and the soak restarts. The final goes on the highest candidate's commit once `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N` passed, and, when that commit is past the release PR, after `prepare.py notes X.Y.Z` there and the release PR's notes are updated: the final's images are built again, uncached, so a CVE fixed during the soak fails the final's scan. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. - When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. diff --git a/docs/development/release-process.md b/docs/development/release-process.md index a47daa4d898..32bfa0106e0 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -111,9 +111,9 @@ final's run reads it there. it with `--event workflow_dispatch` in place of `--event schedule`. It scans both images as the release does, and a scheduled run's failure notifies only the last editor of its schedule. The runs that gate a release build both images uncached and fail on a scan finding: a weekly or - dispatched run, the release pull request (titled exactly `Release X.Y.Z`), its merge commit - when merged with the subject `Release X.Y.Z (#N)`, a pull request into a `release/X.Y` line and a push there - (`scripts/gates/docker_smoke_gate.sh`). On other pull requests and pushes the scan warns. A red + dispatched run, a pull request or pushed commit titled `Release X.Y.Z`, with or without + ` (#N)` (the release pull request and its merge commit), and a pull request into a + `release/X.Y` line and a push there (`scripts/gates/docker_smoke_gate.sh`). On other pull requests and pushes the scan warns. A red scan names the package: move the pin that brings it in (a `Dockerfile` `ARG` or base-image digest, or a lock file) on `main` first. The base image's own packages move only with a new base-image digest; a package an `apt-get install` layer adds moves with any uncached build. @@ -126,20 +126,21 @@ final's run reads it there. pull request raises `MIN_SERVER_VERSION` in `integrations/claude-code-plugin/lib/server-version.mjs` to this version, syncs it into the Codex plugin and bumps both plugin versions: clients get it only through a new plugin version. -3. After the release pull request merges, wait for docker-smoke on its merge commit: that run builds - and scans the commit the tag will name, as the tag run does, and a pushed `vX.Y.Z` tag is never - moved or deleted. Push the final tag only once it passed. Only a gating run on that commit counts - (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z (#N)`, a push to - `release/X.Y`, a weekly run or a dispatch; any other push run passes with a scan finding. With - another title, or after a scan fix merged to the target, dispatch `docker-smoke.yml` on the - target and tag that run's `headSha` once it passed; when that commit is past the release pull - request, refresh the [release notes](#release-notes) there first. For a requested candidate soak, - push `vX.Y.Z-rc.1` on the merge commit instead, without waiting: a candidate whose scan fails - publishes nothing and costs only its number, and a candidate fix is tagged on its merge commit - the same way. Publish the final on the highest candidate's commit after the soak, once a dispatch - on that candidate's tag passed - (`gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N`): the final's images are - built again, uncached, so a CVE fixed during the soak fails its scan. +3. After the release pull request merges, tag only a commit a gating docker-smoke run passed on: + that run builds and scans the commit the tag will name, as the tag run does, and a pushed + `vX.Y.Z` tag is never moved or deleted. A gating run (`scripts/gates/docker_smoke_gate.sh`) is a + push titled `Release X.Y.Z`, with or without ` (#N)`, a push to `release/X.Y`, a weekly run or + a dispatch; any other push run passes with a scan finding. + - By default, wait for the push run on the merge commit and push the final tag once it passed. + - With another title, or after a scan fix merged to the target, dispatch `docker-smoke.yml` on + the target and tag that run's `headSha` once it passed; when that commit is past the release + pull request, refresh the [release notes](#release-notes) there first. + - For a requested candidate soak, push `vX.Y.Z-rc.1` on the merge commit instead, without + waiting: a candidate whose scan fails publishes nothing and costs only its number, and a + candidate fix is tagged on its merge commit the same way. + - After the soak, publish the final on the highest candidate's commit once a dispatch on that + candidate's tag passed (`gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N`): + the final's images are built again, uncached, so a CVE fixed during the soak fails its scan. ```bash gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle # push, Release X.Y.Z (#N), success @@ -165,7 +166,9 @@ commit, uncached, so an OS package may be newer than in the soaked image. A run candidate tag after its final is refused. One on the final's commit is told to run the final. One numbered below the highest-numbered candidate on the final's commit has nothing to run, and its tag stays. Any other is a stray: its tag stays too, as every `v*` tag does, and it fails the -final's later runs, so what the final did not publish ships as the next patch. The chart's +final's later dispatches and pushes. "Re-run failed jobs" on the final's own run does not repeat +that check and still finishes it; once that run can no longer be re-run (30 days after it, or +after "Re-run all jobs"), what the final did not publish ships as the next patch. The chart's `appVersion` names `X.Y.Z` too, so a soak on Kubernetes sets `image.tag` and `extractor.image.tag` to `X.Y.Z-rc.N`. diff --git a/scripts/gates/docker_smoke_gate.sh b/scripts/gates/docker_smoke_gate.sh index 5460c3617ff..bcae2c2cebd 100755 --- a/scripts/gates/docker_smoke_gate.sh +++ b/scripts/gates/docker_smoke_gate.sh @@ -1,8 +1,8 @@ #!/bin/sh # Prints `release=true` when this docker-smoke run gates a release, else `release=false`: -# a weekly or dispatched run, a pull request into a release/X.Y line or a push there, the -# release pull request (titled exactly `Release X.Y.Z`) and its merge commit -# (`Release X.Y.Z (#N)`). Such a run builds both images without the cache and fails on a +# a weekly or dispatched run, a pull request into a release/X.Y line or a push there, and a +# pull request or pushed commit titled `Release X.Y.Z`, with or without ` (#N)` (the release +# pull request and its merge commit). Such a run builds both images without the cache and fails on a # scan finding, as the release's own scan does, since a pushed vX.Y.Z tag is never moved. # # EVENT=push REF=refs/heads/main TITLE="Release 1.5.0 (#2100)" sh scripts/gates/docker_smoke_gate.sh diff --git a/scripts/release/prepare.py b/scripts/release/prepare.py index 95ca3653a4c..2eeeb04f4ff 100755 --- a/scripts/release/prepare.py +++ b/scripts/release/prepare.py @@ -275,7 +275,8 @@ def refuse_tagged(version: str, root: Path = ROOT) -> None: _NEXT_PATCH = ( "When v{final}'s run published nothing, add v{final} to UNRELEASED in" " scripts/release/prepare.py and release the next patch from the commit that should ship;" - " when it published part, the next patch ships the rest" + ' when it published part, "Re-run failed jobs" on that run finishes it without this check,' + " and once the run can no longer be re-run the next patch ships the rest" ) diff --git a/tests/unit/test_docker_quickstart_smoke.py b/tests/unit/test_docker_quickstart_smoke.py index a8a32c63e6d..64caed034f0 100644 --- a/tests/unit/test_docker_quickstart_smoke.py +++ b/tests/unit/test_docker_quickstart_smoke.py @@ -288,6 +288,9 @@ def run() -> subprocess.CompletedProcess[str]: ({"EVENT": "push", "REF": "refs/heads/release/1.4"}, True), ({"EVENT": "pull_request", "BASE": "release/1.4", "TITLE": "Fix a thing"}, True), ({"EVENT": "pull_request", "BASE": "main", "TITLE": "Release 1.5.0"}, True), + # Either form on either event: the number GitHub adds is optional. + ({"EVENT": "pull_request", "BASE": "main", "TITLE": "Release 1.5.0 (#2100)"}, True), + ({"EVENT": "push", "REF": "refs/heads/main", "TITLE": "Release 1.5.0"}, True), # The release pull request's squash commit on main: the commit the tag names. ( {"EVENT": "push", "REF": "refs/heads/main", "TITLE": "Release 1.5.0 (#2100)\n\nnotes"}, diff --git a/tests/unit/test_release_prepare.py b/tests/unit/test_release_prepare.py index da7dd653505..ed975fa8630 100644 --- a/tests/unit/test_release_prepare.py +++ b/tests/unit/test_release_prepare.py @@ -792,7 +792,8 @@ def test_a_candidate_comes_before_its_final_and_the_final_goes_where_it_was_soak assert error and "v1.2.0 is not on v1.2.0-rc.1's commit" in error assert error.endswith( "add v1.2.0 to UNRELEASED in scripts/release/prepare.py and release the next patch from the commit that should ship;" - " when it published part, the next patch ships the rest" + ' when it published part, "Re-run failed jobs" on that run finishes it without this check,' + " and once the run can no longer be re-run the next patch ships the rest" ) assert "refs/tags" not in error # a v* tag is never deleted git_repo.git(tmp_path, "tag", "v1.2.0-rc.2") # the fix soaked as rc.2: its commit is HEAD From af129f4d7d84e3bb6509f9cb0f0c4da514a6806a Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 22:06:29 +0530 Subject: [PATCH 16/40] check_tag names the final's run that published part as the one to re-run Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- scripts/release/prepare.py | 5 +++-- tests/unit/test_release_prepare.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/release/prepare.py b/scripts/release/prepare.py index 2eeeb04f4ff..cc72b6d964d 100755 --- a/scripts/release/prepare.py +++ b/scripts/release/prepare.py @@ -275,8 +275,9 @@ def refuse_tagged(version: str, root: Path = ROOT) -> None: _NEXT_PATCH = ( "When v{final}'s run published nothing, add v{final} to UNRELEASED in" " scripts/release/prepare.py and release the next patch from the commit that should ship;" - ' when it published part, "Re-run failed jobs" on that run finishes it without this check,' - " and once the run can no longer be re-run the next patch ships the rest" + ' when it published part, "Re-run failed jobs" on the v{final} run that published part' + " finishes it without this check, and once that run can no longer be re-run the next patch" + " ships the rest" ) diff --git a/tests/unit/test_release_prepare.py b/tests/unit/test_release_prepare.py index ed975fa8630..d1995d53b32 100644 --- a/tests/unit/test_release_prepare.py +++ b/tests/unit/test_release_prepare.py @@ -792,8 +792,9 @@ def test_a_candidate_comes_before_its_final_and_the_final_goes_where_it_was_soak assert error and "v1.2.0 is not on v1.2.0-rc.1's commit" in error assert error.endswith( "add v1.2.0 to UNRELEASED in scripts/release/prepare.py and release the next patch from the commit that should ship;" - ' when it published part, "Re-run failed jobs" on that run finishes it without this check,' - " and once the run can no longer be re-run the next patch ships the rest" + ' when it published part, "Re-run failed jobs" on the v1.2.0 run that published part' + " finishes it without this check, and once that run can no longer be re-run the next patch" + " ships the rest" ) assert "refs/tags" not in error # a v* tag is never deleted git_repo.git(tmp_path, "tag", "v1.2.0-rc.2") # the fix soaked as rc.2: its commit is HEAD From 8d3171482f7fb196f24b4403b0088fd490a9fb51 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 22:29:47 +0530 Subject: [PATCH 17/40] The tag commands read the dispatched run's commit, and a patch's scan is its release pull request's Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 4 ++-- docs/development/release-process.md | 11 ++++++----- scripts/gates/docker_smoke_gate.sh | 5 +++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 7f0032d375c..971697fe0e6 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -14,7 +14,7 @@ metadata: - Read [release process](../../../docs/development/release-process.md) and [supported versions](../../../docs/operations/supported-versions.md). Check remote tags and open PRs for this version. Resume existing work when its target and version match. - Start a major or minor from `origin/main`. Start a patch from `origin/release/X.Y`; backport any selected fixes to that line through PRs first. Use `prep/release-X.Y.Z` for the release PR unless the owner specifies a name. A repository rule that refuses a branch or tag update needs a resolution under that rule. -- Check the latest CI on the target and a passing container scan from the past week. Print the dry build (`gh workflow run release.yml -R ClickHouse/loom --ref -f dry_run=true`) for the owner to start in parallel with preparing the PR, and read its prerequisite warnings when it runs; it is not a gate. +- Check the latest CI on the target and a passing container scan: on `main`, a weekly or dispatched docker-smoke run from the past week; for a patch, the release PR's own docker-smoke run, which gates as a pull request into `release/X.Y`. Print the dry build (`gh workflow run release.yml -R ClickHouse/loom --ref -f dry_run=true`) for the owner to start in parallel with preparing the PR, and read its prerequisite warnings when it runs; it is not a gate. - Use `.venv/bin/python scripts/release/prepare.py bump X.Y.Z` in the release worktree. The tool bumps the server, images, dashboard, Python SDK, npm SDK, Helm chart, root skills and the install commands in the docs, and writes `release-notes.md`. If the Rust SDK has changes since its last published version, bump its independent SemVer in `sdk/rust/Cargo.toml` and check it with `scripts/release/rust_sdk.py check-version`. A final release publishes that crate version if it is absent from crates.io. - Check the release notes with [loom-writing](../loom-writing/SKILL.md#release-notes-and-announcements). Resolve uncategorized entries and remove items that name no operator action. Surface upgrade steps and client breaks before details. Check whether any shipped plugin changes require raising `MIN_SERVER_VERSION` and bumping the plugin versions. - Open `Release X.Y.Z` using [loom-ship-pr](../loom-ship-pr/SKILL.md). Include the reviewed notes in the PR body, from the `## Release notes for vX.Y.Z` heading to the `` line `prepare.py` writes; a final's run fails without them. Other PRs enter the release by merging into its target branch before the release PR. Refresh the notes if the base moves. Merge on green when the required reviews and threads are settled, with `gh pr merge --squash --subject "Release X.Y.Z (#)"`: a one-commit pull request's squash title is otherwise its commit's subject, and on `main` only a title `Release X.Y.Z`, with or without ` (#)`, makes the merge commit's docker-smoke run gate (every push to `release/X.Y` gates). @@ -23,7 +23,7 @@ metadata: - **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit a gating docker-smoke run passed on (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z`, with or without ` (#N)`, a push to `release/X.Y`, a weekly run or a dispatch; any other push run passes with a scan finding. - Wait for the push run on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`), which builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. - - After a failed scan, or for a merge commit with another title, merge any fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, and tag that run's commit once it passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. + - After a failed scan, or for a merge commit with another title, merge any fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, read its commit with `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --branch -L 1 --json conclusion,headSha`, and tag that `headSha` once the run passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. - If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). - **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit with no gating run first: a candidate whose scan fails publishes nothing and costs only its number. Watch its run and soak it for at least two days. Tag any fix as the next candidate on its merge commit on the release target, and the soak restarts. The final goes on the highest candidate's commit once `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N` passed, and, when that commit is past the release PR, after `prepare.py notes X.Y.Z` there and the release PR's notes are updated: the final's images are built again, uncached, so a CVE fixed during the soak fails the final's scan. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. diff --git a/docs/development/release-process.md b/docs/development/release-process.md index 32bfa0106e0..ff537b7de11 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -144,8 +144,9 @@ final's run reads it there. ```bash gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle # push, Release X.Y.Z (#N), success - gh workflow run docker-smoke.yml -R ClickHouse/loom --ref # after a scan fix: tag its headSha - git tag vX.Y.Z + gh workflow run docker-smoke.yml -R ClickHouse/loom --ref # another title, or after a scan fix + gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --branch -L 1 --json conclusion,headSha # success: tag its headSha + git tag vX.Y.Z git push origin vX.Y.Z ``` @@ -165,10 +166,10 @@ candidate on that commit with a published bundle; its images are built again fro commit, uncached, so an OS package may be newer than in the soaked image. A run of a candidate tag after its final is refused. One on the final's commit is told to run the final. One numbered below the highest-numbered candidate on the final's commit has nothing to run, and its -tag stays. Any other is a stray: its tag stays too, as every `v*` tag does, and it fails the -final's later dispatches and pushes. "Re-run failed jobs" on the final's own run does not repeat +tag stays. Any other is a stray: its tag stays too, as every `v*` tag does, and it fails a +later dispatch of the final or a "Re-run all jobs" on its run. "Re-run failed jobs" on the final's own run does not repeat that check and still finishes it; once that run can no longer be re-run (30 days after it, or -after "Re-run all jobs"), what the final did not publish ships as the next patch. The chart's +after a "Re-run all jobs"), what the final did not publish ships as the next patch. The chart's `appVersion` names `X.Y.Z` too, so a soak on Kubernetes sets `image.tag` and `extractor.image.tag` to `X.Y.Z-rc.N`. diff --git a/scripts/gates/docker_smoke_gate.sh b/scripts/gates/docker_smoke_gate.sh index bcae2c2cebd..0a06911c76f 100755 --- a/scripts/gates/docker_smoke_gate.sh +++ b/scripts/gates/docker_smoke_gate.sh @@ -2,8 +2,9 @@ # Prints `release=true` when this docker-smoke run gates a release, else `release=false`: # a weekly or dispatched run, a pull request into a release/X.Y line or a push there, and a # pull request or pushed commit titled `Release X.Y.Z`, with or without ` (#N)` (the release -# pull request and its merge commit). Such a run builds both images without the cache and fails on a -# scan finding, as the release's own scan does, since a pushed vX.Y.Z tag is never moved. +# pull request and its merge commit). Such a run builds both images without the cache and +# fails on a scan finding, as the release's own scan does, since a pushed vX.Y.Z tag is never +# moved. # # EVENT=push REF=refs/heads/main TITLE="Release 1.5.0 (#2100)" sh scripts/gates/docker_smoke_gate.sh set -eu From 535ad20254acec2dd12a9cbcdf8f4230d6a66780 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 22:44:30 +0530 Subject: [PATCH 18/40] A dispatched scan is read by the commit named before the dispatch, and the page merges the release pull request with its title gh workflow run returns before the run exists, so a listing by branch could show an older dispatch whose commit names the previous version. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 2 +- docs/development/release-process.md | 34 +++++++++++++++++++--------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 971697fe0e6..2a0b250c76f 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -23,7 +23,7 @@ metadata: - **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit a gating docker-smoke run passed on (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z`, with or without ` (#N)`, a push to `release/X.Y`, a weekly run or a dispatch; any other push run passes with a scan finding. - Wait for the push run on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`), which builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. - - After a failed scan, or for a merge commit with another title, merge any fix to the target, run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, read its commit with `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --branch -L 1 --json conclusion,headSha`, and tag that `headSha` once the run passed; when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. + - After a failed scan, or for a merge commit with another title, merge any fix to the target, name its commit (`git fetch origin `, then `git rev-parse origin/`), run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, and tag that commit once `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit --json status,conclusion` shows a completed, successful run on it (`gh workflow run` returns before the run exists, so a listing by branch can show an older dispatch); when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. - If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). - **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit with no gating run first: a candidate whose scan fails publishes nothing and costs only its number. Watch its run and soak it for at least two days. Tag any fix as the next candidate on its merge commit on the release target, and the soak restarts. The final goes on the highest candidate's commit once `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N` passed, and, when that commit is past the release PR, after `prepare.py notes X.Y.Z` there and the release PR's notes are updated: the final's images are built again, uncached, so a CVE fixed during the soak fails the final's scan. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. diff --git a/docs/development/release-process.md b/docs/development/release-process.md index ff537b7de11..df937030877 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -50,7 +50,8 @@ creating a preparation branch. A refused update requires resolution under those branch or changing its target does not resolve the refusal. Create the maintained line after publishing its first final release, or, after a final tag whose run -published nothing, from the commit that should ship ([what the release workflow does](#what-the-release-workflow-does)). Preparation branches carry +published nothing, from the commit that should ship +([what the release workflow does](#what-the-release-workflow-does)). Preparation branches carry the version bump and notes through their pull request; they do not become maintained lines. Keep published tags fixed. Select backports according to the [supported release lines](../operations/supported-versions.md#release-lines). @@ -113,7 +114,8 @@ final's run reads it there. runs that gate a release build both images uncached and fail on a scan finding: a weekly or dispatched run, a pull request or pushed commit titled `Release X.Y.Z`, with or without ` (#N)` (the release pull request and its merge commit), and a pull request into a - `release/X.Y` line and a push there (`scripts/gates/docker_smoke_gate.sh`). On other pull requests and pushes the scan warns. A red + `release/X.Y` line and a push there (`scripts/gates/docker_smoke_gate.sh`). On other pull + requests and pushes the scan warns. A red scan names the package: move the pin that brings it in (a `Dockerfile` `ARG` or base-image digest, or a lock file) on `main` first. The base image's own packages move only with a new base-image digest; a package an `apt-get install` layer adds moves with any uncached build. @@ -126,15 +128,21 @@ final's run reads it there. pull request raises `MIN_SERVER_VERSION` in `integrations/claude-code-plugin/lib/server-version.mjs` to this version, syncs it into the Codex plugin and bumps both plugin versions: clients get it only through a new plugin version. + Merge it with `gh pr merge -R ClickHouse/loom --squash --subject "Release X.Y.Z (#)"`: + a one-commit pull request's squash title is otherwise its commit's subject, and only the + release title makes the merge commit's docker-smoke run gate. 3. After the release pull request merges, tag only a commit a gating docker-smoke run passed on: that run builds and scans the commit the tag will name, as the tag run does, and a pushed `vX.Y.Z` tag is never moved or deleted. A gating run (`scripts/gates/docker_smoke_gate.sh`) is a push titled `Release X.Y.Z`, with or without ` (#N)`, a push to `release/X.Y`, a weekly run or a dispatch; any other push run passes with a scan finding. - - By default, wait for the push run on the merge commit and push the final tag once it passed. - - With another title, or after a scan fix merged to the target, dispatch `docker-smoke.yml` on - the target and tag that run's `headSha` once it passed; when that commit is past the release - pull request, refresh the [release notes](#release-notes) there first. + - By default, wait for the push run titled `Release X.Y.Z (#N)` on the merge commit and push + the final tag once it passed. + - With another title, or after a scan fix merged to the target, name the target's commit + first, dispatch `docker-smoke.yml` on the target, and tag that commit once a dispatched run + on it passed: `gh workflow run` returns before the run exists, so a listing by branch can + show an older dispatch. When that commit is past the release pull request, refresh the + [release notes](#release-notes) there first. - For a requested candidate soak, push `vX.Y.Z-rc.1` on the merge commit instead, without waiting: a candidate whose scan fails publishes nothing and costs only its number, and a candidate fix is tagged on its merge commit the same way. @@ -144,9 +152,11 @@ final's run reads it there. ```bash gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle # push, Release X.Y.Z (#N), success - gh workflow run docker-smoke.yml -R ClickHouse/loom --ref # another title, or after a scan fix - gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --branch -L 1 --json conclusion,headSha # success: tag its headSha - git tag vX.Y.Z + # Another title, or after a scan fix: name the commit, then dispatch. + git fetch origin && sha=$(git rev-parse origin/) + gh workflow run docker-smoke.yml -R ClickHouse/loom --ref + gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit "$sha" --json status,conclusion,createdAt # completed, success: tag $sha + git tag vX.Y.Z # the merge commit, or $sha git push origin vX.Y.Z ``` @@ -160,14 +170,16 @@ final's run reads it there. A release candidate is a `vX.Y.Z-rc.N` tag, and makes a GitHub pre-release; the release refuses any other prerelease tag. The first candidate goes on the release pull request's merge commit, whose files name `X.Y.Z`, so the candidate's server already reports `X.Y.Z`; a later one, after a fix, -goes on the fix's merge commit on the release target. The final `vX.Y.Z` tag goes on the highest-numbered candidate's +goes on the fix's merge commit on the release target. The final `vX.Y.Z` tag goes on the +highest-numbered candidate's commit after the soak. The final's bundle keeps the ClickHouse release of the highest-numbered candidate on that commit with a published bundle; its images are built again from the same commit, uncached, so an OS package may be newer than in the soaked image. A run of a candidate tag after its final is refused. One on the final's commit is told to run the final. One numbered below the highest-numbered candidate on the final's commit has nothing to run, and its tag stays. Any other is a stray: its tag stays too, as every `v*` tag does, and it fails a -later dispatch of the final or a "Re-run all jobs" on its run. "Re-run failed jobs" on the final's own run does not repeat +later dispatch of the final or a "Re-run all jobs" on its run. "Re-run failed jobs" on the final's +own run does not repeat that check and still finishes it; once that run can no longer be re-run (30 days after it, or after a "Re-run all jobs"), what the final did not publish ships as the next patch. The chart's `appVersion` names `X.Y.Z` too, so a soak on Kubernetes sets `image.tag` and From f16678f09939c8b3cbea121ac3157392c150165d Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 22:56:06 +0530 Subject: [PATCH 19/40] docs(release): read the soak dispatch by the candidate's commit, reflow the release paragraphs Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 2 +- docs/development/release-process.md | 62 ++++++++++++++-------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 2a0b250c76f..99097d81d5c 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -25,7 +25,7 @@ metadata: - Wait for the push run on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`), which builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. - After a failed scan, or for a merge commit with another title, merge any fix to the target, name its commit (`git fetch origin `, then `git rev-parse origin/`), run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, and tag that commit once `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit --json status,conclusion` shows a completed, successful run on it (`gh workflow run` returns before the run exists, so a listing by branch can show an older dispatch); when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. - If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). -- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit with no gating run first: a candidate whose scan fails publishes nothing and costs only its number. Watch its run and soak it for at least two days. Tag any fix as the next candidate on its merge commit on the release target, and the soak restarts. The final goes on the highest candidate's commit once `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N` passed, and, when that commit is past the release PR, after `prepare.py notes X.Y.Z` there and the release PR's notes are updated: the final's images are built again, uncached, so a CVE fixed during the soak fails the final's scan. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. +- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit with no gating run first: a candidate whose scan fails publishes nothing and costs only its number. Watch its run and soak it for at least two days. Tag any fix as the next candidate on its merge commit on the release target, and the soak restarts. The final goes on the highest candidate's commit once a dispatch there passed: run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N`, then read it by the tag's commit, `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit "$(git rev-parse 'vX.Y.Z-rc.N^{commit}')" --json status,conclusion`, until a completed, successful run shows (a listing without `--commit` can show an older dispatch). Tag it then, and, when that commit is past the release PR, after `prepare.py notes X.Y.Z` there and the release PR's notes are updated: the final's images are built again, uncached, so a CVE fixed during the soak fails the final's scan. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. - When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. - When the line's maintenance branch `release/X.Y` does not exist, its first published final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`; after a final that published nothing, push the same way from the tag of the commit that should ship: the dead final's after a failed scan or build, the highest candidate's (`"vX.Y.Z-rc.N^{commit}:refs/heads/release/X.Y"`) for a misplaced final. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. diff --git a/docs/development/release-process.md b/docs/development/release-process.md index df937030877..63bf10b804b 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -50,10 +50,11 @@ creating a preparation branch. A refused update requires resolution under those branch or changing its target does not resolve the refusal. Create the maintained line after publishing its first final release, or, after a final tag whose run -published nothing, from the commit that should ship -([what the release workflow does](#what-the-release-workflow-does)). Preparation branches carry -the version bump and notes through their pull request; they do not become maintained lines. Keep -published tags fixed. Select backports according to the [supported release lines](../operations/supported-versions.md#release-lines). +published nothing, from the commit that should ship ([what the release workflow +does](#what-the-release-workflow-does)). Preparation branches carry the version bump and notes +through their pull request; they do not become maintained lines. Keep published tags fixed. Select +backports according to the [supported release +lines](../operations/supported-versions.md#release-lines). ## Release notes @@ -108,17 +109,16 @@ final's run reads it there. gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event schedule --branch main -L 1 --json conclusion,createdAt,headSha ``` - Or start a fresh one with `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref main` and read - it with `--event workflow_dispatch` in place of `--event schedule`. It scans both images as the - release does, and a scheduled run's failure notifies only the last editor of its schedule. The - runs that gate a release build both images uncached and fail on a scan finding: a weekly or - dispatched run, a pull request or pushed commit titled `Release X.Y.Z`, with or without - ` (#N)` (the release pull request and its merge commit), and a pull request into a - `release/X.Y` line and a push there (`scripts/gates/docker_smoke_gate.sh`). On other pull - requests and pushes the scan warns. A red - scan names the package: move the pin that brings it in (a `Dockerfile` `ARG` or base-image digest, - or a lock file) on `main` first. The base image's own packages move only with a new base-image - digest; a package an `apt-get install` layer adds moves with any uncached build. + Or start a fresh one with `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref main` and + read it with `--event workflow_dispatch` in place of `--event schedule`. It scans both images as + the release does, and a scheduled run's failure notifies only the last editor of its schedule. + The runs that gate a release build both images uncached and fail on a scan finding: a weekly or + dispatched run, a pull request or pushed commit titled `Release X.Y.Z`, with or without ` (#N)` + (the release pull request and its merge commit), and a pull request into a `release/X.Y` line and + a push there (`scripts/gates/docker_smoke_gate.sh`). On other pull requests and pushes the scan + warns. A red scan names the package: move the pin that brings it in (a `Dockerfile` `ARG` or + base-image digest, or a lock file) on `main` first. The base image's own packages move only with + a new base-image digest; a package an `apt-get install` layer adds moves with any uncached build. 2. On `prep/release-X.Y.Z` from `origin/main`, run `.venv/bin/python scripts/release/prepare.py bump X.Y.Z`, and open a pull request with its changes and the [release notes](#release-notes) section, written from @@ -147,14 +147,16 @@ final's run reads it there. waiting: a candidate whose scan fails publishes nothing and costs only its number, and a candidate fix is tagged on its merge commit the same way. - After the soak, publish the final on the highest candidate's commit once a dispatch on that - candidate's tag passed (`gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N`): - the final's images are built again, uncached, so a CVE fixed during the soak fails its scan. + candidate's tag passed, listed by the tag's commit as the code block does: the final's images + are built again, uncached, so a CVE fixed during the soak fails its scan. ```bash gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle # push, Release X.Y.Z (#N), success - # Another title, or after a scan fix: name the commit, then dispatch. - git fetch origin && sha=$(git rev-parse origin/) - gh workflow run docker-smoke.yml -R ClickHouse/loom --ref + # Name the commit, then dispatch. Another title, or after a scan fix: the target. + git fetch origin && sha=$(git rev-parse origin/) && ref= + # After a soak: the highest candidate's tag. + git fetch origin --tags && sha=$(git rev-parse 'vX.Y.Z-rc.N^{commit}') && ref=vX.Y.Z-rc.N + gh workflow run docker-smoke.yml -R ClickHouse/loom --ref "$ref" gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit "$sha" --json status,conclusion,createdAt # completed, success: tag $sha git tag vX.Y.Z # the merge commit, or $sha git push origin vX.Y.Z @@ -171,18 +173,16 @@ A release candidate is a `vX.Y.Z-rc.N` tag, and makes a GitHub pre-release; the other prerelease tag. The first candidate goes on the release pull request's merge commit, whose files name `X.Y.Z`, so the candidate's server already reports `X.Y.Z`; a later one, after a fix, goes on the fix's merge commit on the release target. The final `vX.Y.Z` tag goes on the -highest-numbered candidate's -commit after the soak. The final's bundle keeps the ClickHouse release of the highest-numbered -candidate on that commit with a published bundle; its images are built again from the same -commit, uncached, so an OS package may be newer than in the soaked image. A run of a +highest-numbered candidate's commit after the soak. The final's bundle keeps the ClickHouse release +of the highest-numbered candidate on that commit with a published bundle; its images are built again +from the same commit, uncached, so an OS package may be newer than in the soaked image. A run of a candidate tag after its final is refused. One on the final's commit is told to run the final. One -numbered below the highest-numbered candidate on the final's commit has nothing to run, and its -tag stays. Any other is a stray: its tag stays too, as every `v*` tag does, and it fails a -later dispatch of the final or a "Re-run all jobs" on its run. "Re-run failed jobs" on the final's -own run does not repeat -that check and still finishes it; once that run can no longer be re-run (30 days after it, or -after a "Re-run all jobs"), what the final did not publish ships as the next patch. The chart's -`appVersion` names `X.Y.Z` too, so a soak on Kubernetes sets `image.tag` and +numbered below the highest-numbered candidate on the final's commit has nothing to run, and its tag +stays. Any other is a stray: its tag stays too, as every `v*` tag does, and it fails a later +dispatch of the final or a "Re-run all jobs" on its run. "Re-run failed jobs" on the final's own run +does not repeat that check and still finishes it; once that run can no longer be re-run (30 days +after it, or after a "Re-run all jobs"), what the final did not publish ships as the next patch. The +chart's `appVersion` names `X.Y.Z` too, so a soak on Kubernetes sets `image.tag` and `extractor.image.tag` to `X.Y.Z-rc.N`. Only the highest final version becomes the repository's Latest release (`releases/latest` serves the From fc81f1d9ffdcc4fdde392ad02d73164a067ea077 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 23:10:44 +0530 Subject: [PATCH 20/40] docs(release): fetch the candidate tag before the soak read, say what a failed or missing dispatch means Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 4 ++-- docs/development/release-process.md | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 99097d81d5c..8100db2d5b4 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -23,9 +23,9 @@ metadata: - **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit a gating docker-smoke run passed on (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z`, with or without ` (#N)`, a push to `release/X.Y`, a weekly run or a dispatch; any other push run passes with a scan finding. - Wait for the push run on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`), which builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. - - After a failed scan, or for a merge commit with another title, merge any fix to the target, name its commit (`git fetch origin `, then `git rev-parse origin/`), run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, and tag that commit once `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit --json status,conclusion` shows a completed, successful run on it (`gh workflow run` returns before the run exists, so a listing by branch can show an older dispatch); when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. + - After a failed scan, or for a merge commit with another title, merge any fix to the target, name its commit (`git fetch origin `, then `git rev-parse origin/`), run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, and tag that commit once `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit --json status,conclusion` shows a completed, successful run on it (`gh workflow run` returns before the run exists, so a listing by branch can show an older dispatch; when no dispatched run appears on that commit, the target moved: name its new head and dispatch again); when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. - If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). -- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit with no gating run first: a candidate whose scan fails publishes nothing and costs only its number. Watch its run and soak it for at least two days. Tag any fix as the next candidate on its merge commit on the release target, and the soak restarts. The final goes on the highest candidate's commit once a dispatch there passed: run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N`, then read it by the tag's commit, `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit "$(git rev-parse 'vX.Y.Z-rc.N^{commit}')" --json status,conclusion`, until a completed, successful run shows (a listing without `--commit` can show an older dispatch). Tag it then, and, when that commit is past the release PR, after `prepare.py notes X.Y.Z` there and the release PR's notes are updated: the final's images are built again, uncached, so a CVE fixed during the soak fails the final's scan. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. +- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit with no gating run first: a candidate whose scan fails publishes nothing and costs only its number. Watch its run and soak it for at least two days. Tag any fix as the next candidate on its merge commit on the release target, and the soak restarts. The final goes on the highest candidate's commit once a dispatch there passed, because the final's images are built again, uncached, and a CVE fixed during the soak can fail the final's scan: run `git fetch origin --tags`, then `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N`, then read it by the tag's commit, `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit "$(git rev-parse 'vX.Y.Z-rc.N^{commit}')" --json status,conclusion`, until a completed run shows (a listing without `--commit` can show an older dispatch). A successful one: tag that commit. A failed one: tag its fix as the next candidate, and the soak restarts. When the highest candidate's commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. - When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. - When the line's maintenance branch `release/X.Y` does not exist, its first published final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`; after a final that published nothing, push the same way from the tag of the commit that should ship: the dead final's after a failed scan or build, the highest candidate's (`"vX.Y.Z-rc.N^{commit}:refs/heads/release/X.Y"`) for a misplaced final. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. diff --git a/docs/development/release-process.md b/docs/development/release-process.md index 63bf10b804b..51b4c03ed36 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -141,14 +141,18 @@ final's run reads it there. - With another title, or after a scan fix merged to the target, name the target's commit first, dispatch `docker-smoke.yml` on the target, and tag that commit once a dispatched run on it passed: `gh workflow run` returns before the run exists, so a listing by branch can - show an older dispatch. When that commit is past the release pull request, refresh the - [release notes](#release-notes) there first. + show an older dispatch. When no dispatched run appears on that commit, the target moved: name + its new head and dispatch again. When that commit is past the release pull request, refresh + the [release notes](#release-notes) there first. - For a requested candidate soak, push `vX.Y.Z-rc.1` on the merge commit instead, without waiting: a candidate whose scan fails publishes nothing and costs only its number, and a candidate fix is tagged on its merge commit the same way. - After the soak, publish the final on the highest candidate's commit once a dispatch on that candidate's tag passed, listed by the tag's commit as the code block does: the final's images - are built again, uncached, so a CVE fixed during the soak fails its scan. + are built again, uncached, so a CVE fixed during the soak can fail its scan. After a failed + dispatch, tag its fix as the next candidate, and the soak restarts. When the highest + candidate's commit is past the release pull request, refresh the + [release notes](#release-notes) there first. ```bash gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle # push, Release X.Y.Z (#N), success @@ -157,7 +161,7 @@ final's run reads it there. # After a soak: the highest candidate's tag. git fetch origin --tags && sha=$(git rev-parse 'vX.Y.Z-rc.N^{commit}') && ref=vX.Y.Z-rc.N gh workflow run docker-smoke.yml -R ClickHouse/loom --ref "$ref" - gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit "$sha" --json status,conclusion,createdAt # completed, success: tag $sha + gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit "$sha" --json status,conclusion,createdAt # completed, success: tag $sha; none after a minute: the target moved git tag vX.Y.Z # the merge commit, or $sha git push origin vX.Y.Z ``` From 648228f369af6ad6c7b41470040b814161148afc Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 23:31:59 +0530 Subject: [PATCH 21/40] fix(release): read a dispatch by commit and time, say what a re-run cannot finish Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 10 ++++++--- docs/development/release-process.md | 26 ++++++++++++---------- scripts/release/prepare.py | 4 ++-- tests/unit/test_docker_quickstart_smoke.py | 9 ++++++++ tests/unit/test_release_prepare.py | 4 ++-- 5 files changed, 34 insertions(+), 19 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 8100db2d5b4..8803143848a 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -21,11 +21,15 @@ metadata: ## Tag and monitor -- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit a gating docker-smoke run passed on (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z`, with or without ` (#N)`, a push to `release/X.Y`, a weekly run or a dispatch; any other push run passes with a scan finding. +- **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit a gating docker-smoke run passed on (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z`, with or without ` (#N)`, a push to `release/X.Y`, a weekly run or a dispatch; any other push run only warns on a scan finding. - Wait for the push run on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`), which builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. - - After a failed scan, or for a merge commit with another title, merge any fix to the target, name its commit (`git fetch origin `, then `git rev-parse origin/`), run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, and tag that commit once `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit --json status,conclusion` shows a completed, successful run on it (`gh workflow run` returns before the run exists, so a listing by branch can show an older dispatch; when no dispatched run appears on that commit, the target moved: name its new head and dispatch again); when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. + - After a failed scan, or for a merge commit with another title, merge any fix to the target, name its commit (`git fetch origin `, then `git rev-parse origin/`) and the time (`since=$(date -u +%Y-%m-%dT%H:%M:%SZ)`), run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, and tag that commit once `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit --created ">=$since" --json status,conclusion` shows a completed, successful run (`gh workflow run` returns before the run exists, so a listing without both filters can show an older dispatch; when none appears, the target moved: name its new head and dispatch again; after a failed job other than the scan, dispatch again); when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. - If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). -- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit with no gating run first: a candidate whose scan fails publishes nothing and costs only its number. Watch its run and soak it for at least two days. Tag any fix as the next candidate on its merge commit on the release target, and the soak restarts. The final goes on the highest candidate's commit once a dispatch there passed, because the final's images are built again, uncached, and a CVE fixed during the soak can fail the final's scan: run `git fetch origin --tags`, then `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N`, then read it by the tag's commit, `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit "$(git rev-parse 'vX.Y.Z-rc.N^{commit}')" --json status,conclusion`, until a completed run shows (a listing without `--commit` can show an older dispatch). A successful one: tag that commit. A failed one: tag its fix as the next candidate, and the soak restarts. When the highest candidate's commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. +- **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit with no gating run first: a candidate whose scan fails publishes nothing and costs only its number. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. + - Watch its run and soak it for at least two days. Tag any fix as the next candidate on its merge commit on the release target, and the soak restarts. + - The final goes on the highest candidate's commit once a dispatch there passed: the final's images are built again, uncached, and a CVE fixed during the soak can fail the final's scan. Run `git fetch origin --tags` and `since=$(date -u +%Y-%m-%dT%H:%M:%SZ)`, then `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref vX.Y.Z-rc.N`, then `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit "$(git rev-parse 'vX.Y.Z-rc.N^{commit}')" --created ">=$since" --json status,conclusion` until the run is completed (an earlier dispatch on that commit is older than `since`). + - A successful run: tag that commit. A failed scan: tag its fix as the next candidate, and the soak restarts. Another failed job: dispatch again. + - When the highest candidate's commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. - When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. - When the line's maintenance branch `release/X.Y` does not exist, its first published final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`; after a final that published nothing, push the same way from the tag of the commit that should ship: the dead final's after a failed scan or build, the highest candidate's (`"vX.Y.Z-rc.N^{commit}:refs/heads/release/X.Y"`) for a misplaced final. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. diff --git a/docs/development/release-process.md b/docs/development/release-process.md index 51b4c03ed36..b3769a65f87 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -135,14 +135,15 @@ final's run reads it there. that run builds and scans the commit the tag will name, as the tag run does, and a pushed `vX.Y.Z` tag is never moved or deleted. A gating run (`scripts/gates/docker_smoke_gate.sh`) is a push titled `Release X.Y.Z`, with or without ` (#N)`, a push to `release/X.Y`, a weekly run or - a dispatch; any other push run passes with a scan finding. + a dispatch; any other push run only warns on a scan finding. - By default, wait for the push run titled `Release X.Y.Z (#N)` on the merge commit and push the final tag once it passed. - - With another title, or after a scan fix merged to the target, name the target's commit - first, dispatch `docker-smoke.yml` on the target, and tag that commit once a dispatched run - on it passed: `gh workflow run` returns before the run exists, so a listing by branch can - show an older dispatch. When no dispatched run appears on that commit, the target moved: name - its new head and dispatch again. When that commit is past the release pull request, refresh + - With another title, or after a scan fix merged to the target, name the target's commit and + the time first, dispatch `docker-smoke.yml` on the target, and tag that commit once a run + dispatched on it since then passed: `gh workflow run` returns before the run exists, so a + listing without both filters can show an older dispatch. When no such run appears, the + target moved: name its new head and dispatch again. After a failed job other than the scan, + dispatch again. When that commit is past the release pull request, refresh the [release notes](#release-notes) there first. - For a requested candidate soak, push `vX.Y.Z-rc.1` on the merge commit instead, without waiting: a candidate whose scan fails publishes nothing and costs only its number, and a @@ -150,7 +151,8 @@ final's run reads it there. - After the soak, publish the final on the highest candidate's commit once a dispatch on that candidate's tag passed, listed by the tag's commit as the code block does: the final's images are built again, uncached, so a CVE fixed during the soak can fail its scan. After a failed - dispatch, tag its fix as the next candidate, and the soak restarts. When the highest + scan, tag its fix as the next candidate, and the soak restarts; after another failed job, + dispatch again. When the highest candidate's commit is past the release pull request, refresh the [release notes](#release-notes) there first. @@ -160,8 +162,8 @@ final's run reads it there. git fetch origin && sha=$(git rev-parse origin/) && ref= # After a soak: the highest candidate's tag. git fetch origin --tags && sha=$(git rev-parse 'vX.Y.Z-rc.N^{commit}') && ref=vX.Y.Z-rc.N - gh workflow run docker-smoke.yml -R ClickHouse/loom --ref "$ref" - gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit "$sha" --json status,conclusion,createdAt # completed, success: tag $sha; none after a minute: the target moved + since=$(date -u +%Y-%m-%dT%H:%M:%SZ) && gh workflow run docker-smoke.yml -R ClickHouse/loom --ref "$ref" + gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit "$sha" --created ">=$since" --json status,conclusion # completed, success: tag $sha; none after a minute: the target moved git tag vX.Y.Z # the merge commit, or $sha git push origin vX.Y.Z ``` @@ -184,9 +186,9 @@ candidate tag after its final is refused. One on the final's commit is told to r numbered below the highest-numbered candidate on the final's commit has nothing to run, and its tag stays. Any other is a stray: its tag stays too, as every `v*` tag does, and it fails a later dispatch of the final or a "Re-run all jobs" on its run. "Re-run failed jobs" on the final's own run -does not repeat that check and still finishes it; once that run can no longer be re-run (30 days -after it, or after a "Re-run all jobs"), what the final did not publish ships as the next patch. The -chart's `appVersion` names `X.Y.Z` too, so a soak on Kubernetes sets `image.tag` and +does not repeat that check; what such a re-run cannot publish ships as the next patch: a refused +ClickHouse downgrade fails it again, and after 30 days or a "Re-run all jobs" the run can no longer +be re-run. The chart's `appVersion` names `X.Y.Z` too, so a soak on Kubernetes sets `image.tag` and `extractor.image.tag` to `X.Y.Z-rc.N`. Only the highest final version becomes the repository's Latest release (`releases/latest` serves the diff --git a/scripts/release/prepare.py b/scripts/release/prepare.py index cc72b6d964d..9f00cde8cfb 100755 --- a/scripts/release/prepare.py +++ b/scripts/release/prepare.py @@ -276,8 +276,8 @@ def refuse_tagged(version: str, root: Path = ROOT) -> None: "When v{final}'s run published nothing, add v{final} to UNRELEASED in" " scripts/release/prepare.py and release the next patch from the commit that should ship;" ' when it published part, "Re-run failed jobs" on the v{final} run that published part' - " finishes it without this check, and once that run can no longer be re-run the next patch" - " ships the rest" + " skips this check, and the next patch ships what that re-run cannot publish (a refused" + ' ClickHouse downgrade fails it again; after 30 days or a "Re-run all jobs" it cannot run)' ) diff --git a/tests/unit/test_docker_quickstart_smoke.py b/tests/unit/test_docker_quickstart_smoke.py index 64caed034f0..acfb2b4f9bf 100644 --- a/tests/unit/test_docker_quickstart_smoke.py +++ b/tests/unit/test_docker_quickstart_smoke.py @@ -297,6 +297,15 @@ def run() -> subprocess.CompletedProcess[str]: True, ), ({"EVENT": "push", "REF": "refs/heads/main", "TITLE": "Fix a thing (#2101)"}, False), + # Only the subject counts: a later line of the message is not the title. + ( + { + "EVENT": "push", + "REF": "refs/heads/main", + "TITLE": "Fix a thing (#2101)\n\nRelease 1.5.0", + }, + False, + ), ( {"EVENT": "pull_request", "BASE": "main", "TITLE": "Release notes keep their order"}, False, diff --git a/tests/unit/test_release_prepare.py b/tests/unit/test_release_prepare.py index d1995d53b32..434b191ea90 100644 --- a/tests/unit/test_release_prepare.py +++ b/tests/unit/test_release_prepare.py @@ -793,8 +793,8 @@ def test_a_candidate_comes_before_its_final_and_the_final_goes_where_it_was_soak assert error.endswith( "add v1.2.0 to UNRELEASED in scripts/release/prepare.py and release the next patch from the commit that should ship;" ' when it published part, "Re-run failed jobs" on the v1.2.0 run that published part' - " finishes it without this check, and once that run can no longer be re-run the next patch" - " ships the rest" + " skips this check, and the next patch ships what that re-run cannot publish (a refused" + ' ClickHouse downgrade fails it again; after 30 days or a "Re-run all jobs" it cannot run)' ) assert "refs/tags" not in error # a v* tag is never deleted git_repo.git(tmp_path, "tag", "v1.2.0-rc.2") # the fix soaked as rc.2: its commit is HEAD From 14e63203f38d0e7e6f2de0006aadfd049a87d94d Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Thu, 3 Dec 2026 23:58:57 +0530 Subject: [PATCH 22/40] docs(release): re-run a flaky job on the merge commit's run, split the scan-fix steps, word the re-run limits exactly Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 8 ++++++-- docs/development/release-process.md | 11 ++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 8803143848a..fa89094b32a 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -22,8 +22,12 @@ metadata: ## Tag and monitor - **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit a gating docker-smoke run passed on (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z`, with or without ` (#N)`, a push to `release/X.Y`, a weekly run or a dispatch; any other push run only warns on a scan finding. - - Wait for the push run on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`), which builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. - - After a failed scan, or for a merge commit with another title, merge any fix to the target, name its commit (`git fetch origin `, then `git rev-parse origin/`) and the time (`since=$(date -u +%Y-%m-%dT%H:%M:%SZ)`), run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `, and tag that commit once `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit --created ">=$since" --json status,conclusion` shows a completed, successful run (`gh workflow run` returns before the run exists, so a listing without both filters can show an older dispatch; when none appears, the target moved: name its new head and dispatch again; after a failed job other than the scan, dispatch again); when that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. + - Wait for the push run on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`), which builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failed job other than the scan, `gh run rerun -R ClickHouse/loom --failed`: the gate job passed and is not run again, so the run still gates. + - After a failed scan, or for a merge commit with another title: + - Merge any fix to the target. Name its commit (`git fetch origin `, then `git rev-parse origin/`) and the time (`since=$(date -u +%Y-%m-%dT%H:%M:%SZ)`), then run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `. + - Tag that commit once `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit --created ">=$since" --json status,conclusion` shows a completed, successful run. `gh workflow run` returns before the run exists, so a listing without both filters can show an older dispatch. + - When no run appears, the target moved: name its new head and dispatch again. After a failed job other than the scan, dispatch again. + - When that commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. - If a candidate tag already exists, the final must use the highest candidate's commit, after a fresh gating run there (below). - **Release with a soak**. Push `vX.Y.Z-rc.1` on the release PR's merge commit with no gating run first: a candidate whose scan fails publishes nothing and costs only its number. During a Kubernetes soak, set both `image.tag` and `extractor.image.tag` to the candidate. - Watch its run and soak it for at least two days. Tag any fix as the next candidate on its merge commit on the release target, and the soak restarts. diff --git a/docs/development/release-process.md b/docs/development/release-process.md index b3769a65f87..cdca5675e90 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -137,7 +137,8 @@ final's run reads it there. push titled `Release X.Y.Z`, with or without ` (#N)`, a push to `release/X.Y`, a weekly run or a dispatch; any other push run only warns on a scan finding. - By default, wait for the push run titled `Release X.Y.Z (#N)` on the merge commit and push - the final tag once it passed. + the final tag once it passed. After a failed job other than the scan, use "Re-run failed jobs" + on that run: its gate job passed and is not run again, so the run still gates. - With another title, or after a scan fix merged to the target, name the target's commit and the time first, dispatch `docker-smoke.yml` on the target, and tag that commit once a run dispatched on it since then passed: `gh workflow run` returns before the run exists, so a @@ -163,7 +164,7 @@ final's run reads it there. # After a soak: the highest candidate's tag. git fetch origin --tags && sha=$(git rev-parse 'vX.Y.Z-rc.N^{commit}') && ref=vX.Y.Z-rc.N since=$(date -u +%Y-%m-%dT%H:%M:%SZ) && gh workflow run docker-smoke.yml -R ClickHouse/loom --ref "$ref" - gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit "$sha" --created ">=$since" --json status,conclusion # completed, success: tag $sha; none after a minute: the target moved + gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit "$sha" --created ">=$since" --json status,conclusion # completed, success: tag $sha; none after a minute on : it moved git tag vX.Y.Z # the merge commit, or $sha git push origin vX.Y.Z ``` @@ -187,9 +188,9 @@ numbered below the highest-numbered candidate on the final's commit has nothing stays. Any other is a stray: its tag stays too, as every `v*` tag does, and it fails a later dispatch of the final or a "Re-run all jobs" on its run. "Re-run failed jobs" on the final's own run does not repeat that check; what such a re-run cannot publish ships as the next patch: a refused -ClickHouse downgrade fails it again, and after 30 days or a "Re-run all jobs" the run can no longer -be re-run. The chart's `appVersion` names `X.Y.Z` too, so a soak on Kubernetes sets `image.tag` and -`extractor.image.tag` to `X.Y.Z-rc.N`. +ClickHouse downgrade fails it again, a run older than 30 days cannot be re-run, and once a "Re-run +all jobs" has run that check again no later re-run gets past it. The chart's `appVersion` names +`X.Y.Z` too, so a soak on Kubernetes sets `image.tag` and `extractor.image.tag` to `X.Y.Z-rc.N`. Only the highest final version becomes the repository's Latest release (`releases/latest` serves the installer) and moves `:latest`: a prerelease or a patch to an older line leaves both where they are. From d102c93573b32a65a0d2a1b806e5ed9114ff5a1f Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Fri, 4 Dec 2026 00:10:52 +0530 Subject: [PATCH 23/40] chore(release): let the release skill tag and dispatch the release itself The committed rules no longer deny an agent the version tag, the release dispatch or gh release create; the skill drops the owner hand-off. Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/settings.json | 3 --- .claude/skills/loom-release/SKILL.md | 2 +- docs/development/release-process.md | 4 ++-- tests/unit/test_agent_instructions.py | 8 +++++--- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.claude/settings.json b/.claude/settings.json index 0e8f7d13119..42bcbfcf359 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -86,8 +86,6 @@ "Bash(git push * *:refs/heads/main)", "Bash(git push --tags*)", "Bash(git push * --tags*)", - "Bash(gh workflow run release*)", - "Bash(gh release create*)", "Bash(docker * loom-blue*)", "Bash(docker * loom-green*)", "Bash(docker * loom-proxy*)", @@ -114,7 +112,6 @@ "Bash(git push * --mirror*)", "Bash(git push --all*)", "Bash(git push * --all*)", - "Bash(git push * v*.*)", "Bash(git -C * push*)", "Bash(git -c * push*)", "Bash(git * --output*)", diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index fa89094b32a..4a4967f1e8b 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -8,7 +8,7 @@ metadata: # Releasing Loom -"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. Keep GitHub's review, CI and environment rules. The owner's release request authorizes routine publication and verification for that version. Ask separately before a rollback, a public announcement or a deployment. The request covers the release's tag and `release/X.Y` pushes. The committed command rules refuse the tag push to an agent, and a checkout's own settings may allow it: run each `git push` as its own command, never inside a script, so the rules see it. Print a push they refuse, and every `release.yml` dispatch (a dry run, a recovery), for the owner to run. +"Release X.Y.Z" is the entry point. Publish the final as soon as the required checks pass. Use a candidate soak only when the owner asks for one. The owner's release request authorizes routine publication and verification for that version: the release's tag and `release/X.Y` pushes, its `release.yml` dispatches (a dry run, a recovery) and the registry jobs. Ask separately before a rollback, a public announcement or a deployment. Run each `git push` as its own command, never inside a script, so the command rules see it; print a push they refuse for the owner to run. ## Prepare the release diff --git a/docs/development/release-process.md b/docs/development/release-process.md index cdca5675e90..b4d63af4000 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -496,8 +496,8 @@ A run that stopped in `clickhouse` published nothing. - or dispatch the final with `-f allow_clickhouse_downgrade=true` and accept the downgrade for that patch's installs. -A recovery dispatch reaches the same registry jobs after the outside checks pass. GitHub -environment approvals govern each registry upload. +A recovery dispatch reaches the same registry jobs after the outside checks pass, under the same +environment rules as the tag run. ### A bad SDK diff --git a/tests/unit/test_agent_instructions.py b/tests/unit/test_agent_instructions.py index e0967dbf0d1..751ee8c4f93 100644 --- a/tests/unit/test_agent_instructions.py +++ b/tests/unit/test_agent_instructions.py @@ -257,7 +257,6 @@ def _matches(rule: str, command: str, strip_env: bool = True) -> bool: "git push origin HEAD:heads/main", "git push --mirror origin", "git push origin --all", - "git push origin v1.2.3", "git push --tags", "git push origin refs/tags/v1.2.3", "git push origin HEAD --follow-tags", @@ -283,8 +282,6 @@ def _matches(rule: str, command: str, strip_env: bool = True) -> bool: "git checkout main", "git switch main", ".venv/bin/python -m pytest tests/unit --basetemp=/home", - "gh workflow run release.yml --ref v1.2.3", - "gh release create v1.2.3", "./redeploy.sh", "bash redeploy.sh --rollback", "./redeploy.sh --force", @@ -315,6 +312,11 @@ def _matches(rule: str, command: str, strip_env: bool = True) -> bool: "python3 /w/bench/locomo_qa.py --repeats 3", ) NOT_DENIED = ( + # The release skill pushes the tag and dispatches the release itself. + "git push origin v1.2.3", + "git push origin 'v1.2.3^{commit}:refs/heads/release/1.2'", + "gh workflow run release.yml --ref v1.2.3", + "gh release create v1.2.3", "git push -u origin HEAD", "git push --force-with-lease", "git push -u origin v2-search-floor", From 5fd09828fe61ca5bd71cf98692ec8777211dddef Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Fri, 4 Dec 2026 00:25:44 +0530 Subject: [PATCH 24/40] docs(release): drop the approval and owner hand-off text, give the right reason a re-run still gates Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 6 +++--- AGENTS.md | 2 +- docs/development/release-process.md | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 4a4967f1e8b..f4a364d52d9 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -14,7 +14,7 @@ metadata: - Read [release process](../../../docs/development/release-process.md) and [supported versions](../../../docs/operations/supported-versions.md). Check remote tags and open PRs for this version. Resume existing work when its target and version match. - Start a major or minor from `origin/main`. Start a patch from `origin/release/X.Y`; backport any selected fixes to that line through PRs first. Use `prep/release-X.Y.Z` for the release PR unless the owner specifies a name. A repository rule that refuses a branch or tag update needs a resolution under that rule. -- Check the latest CI on the target and a passing container scan: on `main`, a weekly or dispatched docker-smoke run from the past week; for a patch, the release PR's own docker-smoke run, which gates as a pull request into `release/X.Y`. Print the dry build (`gh workflow run release.yml -R ClickHouse/loom --ref -f dry_run=true`) for the owner to start in parallel with preparing the PR, and read its prerequisite warnings when it runs; it is not a gate. +- Check the latest CI on the target and a passing container scan: on `main`, a weekly or dispatched docker-smoke run from the past week; for a patch, the release PR's own docker-smoke run, which gates as a pull request into `release/X.Y`. Start the dry build (`gh workflow run release.yml -R ClickHouse/loom --ref -f dry_run=true`) in parallel with preparing the PR, and read its prerequisite warnings when it runs; it is not a gate. - Use `.venv/bin/python scripts/release/prepare.py bump X.Y.Z` in the release worktree. The tool bumps the server, images, dashboard, Python SDK, npm SDK, Helm chart, root skills and the install commands in the docs, and writes `release-notes.md`. If the Rust SDK has changes since its last published version, bump its independent SemVer in `sdk/rust/Cargo.toml` and check it with `scripts/release/rust_sdk.py check-version`. A final release publishes that crate version if it is absent from crates.io. - Check the release notes with [loom-writing](../loom-writing/SKILL.md#release-notes-and-announcements). Resolve uncategorized entries and remove items that name no operator action. Surface upgrade steps and client breaks before details. Check whether any shipped plugin changes require raising `MIN_SERVER_VERSION` and bumping the plugin versions. - Open `Release X.Y.Z` using [loom-ship-pr](../loom-ship-pr/SKILL.md). Include the reviewed notes in the PR body, from the `## Release notes for vX.Y.Z` heading to the `` line `prepare.py` writes; a final's run fails without them. Other PRs enter the release by merging into its target branch before the release PR. Refresh the notes if the base moves. Merge on green when the required reviews and threads are settled, with `gh pr merge --squash --subject "Release X.Y.Z (#)"`: a one-commit pull request's squash title is otherwise its commit's subject, and on `main` only a title `Release X.Y.Z`, with or without ` (#)`, makes the merge commit's docker-smoke run gate (every push to `release/X.Y` gates). @@ -22,7 +22,7 @@ metadata: ## Tag and monitor - **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit a gating docker-smoke run passed on (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z`, with or without ` (#N)`, a push to `release/X.Y`, a weekly run or a dispatch; any other push run only warns on a scan finding. - - Wait for the push run on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`), which builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failed job other than the scan, `gh run rerun -R ClickHouse/loom --failed`: the gate job passed and is not run again, so the run still gates. + - Wait for the push run on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`), which builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failed job other than the scan, `gh run rerun -R ClickHouse/loom --failed`: a re-run reads the same event and title, so the run still gates. - After a failed scan, or for a merge commit with another title: - Merge any fix to the target. Name its commit (`git fetch origin `, then `git rev-parse origin/`) and the time (`since=$(date -u +%Y-%m-%dT%H:%M:%SZ)`), then run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `. - Tag that commit once `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit --created ">=$since" --json status,conclusion` shows a completed, successful run. `gh workflow run` returns before the run exists, so a listing without both filters can show an older dispatch. @@ -35,7 +35,7 @@ metadata: - A successful run: tag that commit. A failed scan: tag its fix as the next candidate, and the soak restarts. Another failed job: dispatch again. - When the highest candidate's commit is past the release PR, run `prepare.py notes X.Y.Z` there and update the release PR's notes before the tag. - Watch the exact tag's release run through the [registry and external checks](../../../docs/development/release-process.md#what-the-release-workflow-does). The tag starts publication to GHCR, GitHub Releases, PyPI, npm, crates.io and the MCP Registry. Candidates publish to PyPI and npm, and leave moving image tags and the MCP Registry listing alone. -- When the run waits on environments, query `repos/ClickHouse/loom/actions/runs//pending_deployments`. Approve the release's pending environments with the active account when `current_user_can_approve` is true. GitHub's required reviewers take over any environments this account cannot approve. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. +- The registry environments deploy only from a `v*` tag and need no approval; a run waiting on one means someone added a protection rule, which goes to the owner. Use `gh run view` to track every job and [loom-investigate-ci](../loom-investigate-ci/SKILL.md) for failures. Rerun failed jobs where the [recovery rules](../../../docs/development/release-process.md#a-failed-tag-or-signature) allow it. - When the line's maintenance branch `release/X.Y` does not exist, its first published final creates it with `git push origin "vX.Y.Z^{commit}:refs/heads/release/X.Y"`; after a final that published nothing, push the same way from the tag of the commit that should ship: the dead final's after a failed scan or build, the highest candidate's (`"vX.Y.Z-rc.N^{commit}:refs/heads/release/X.Y"`) for a misplaced final. Wait for its required commit checks and honor its branch rules. Keep tags fixed once pushed. - A final's tag run that fails before `docker-tag` publishes nothing, and its tag stays: create `release/X.Y` from the commit that should ship if the line has none, and release the fix as the next patch there, adding the tag to `UNRELEASED` in that patch's release PR before `prepare.py bump`, so its notes and upgrade rehearsal skip it; the entry also reaches `main`. When `main` still names that version, merge a branch at `release/X.Y`'s head into `main` with a merge commit (the one exception to squash-merging); otherwise add the entry in a one-line PR. Never delete `release/X.Y`. All as the [release process](../../../docs/development/release-process.md#what-the-release-workflow-does) says. diff --git a/AGENTS.md b/AGENTS.md index 3a88b73019d..8b3c8aab954 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -65,7 +65,7 @@ Each line is a rule; the skill named after it is the procedure (`.claude/skills/ - **Shared machine**: stop every server, container and background run you started before you report, and remove only what you created, by exact name, never by a prefix filter. - **Run local format, lint, type checks and focused tests before the push**, fixing failures at the source. The full unit suite and other heavy checks run in CI; they are not mandatory local push gates (`loom-pre-push`; what else a change must touch: `loom-change`). - **A pull request** is one concern with a title that says what is now true, a public body from the template, signed-off commits, a fresh review at every push and a squash merge on green (`loom-ship-pr`, `loom-review`, `loom-address-review`). Issues: `loom-file-issue`. -- **A release** starts at the owner's request, which covers merging its pull request and approving its registry environments; it publishes the final after the required reviews and checks, and verifies it from outside. Soak a candidate when requested (`loom-release`). +- **A release** starts at the owner's request, which covers merging its pull request, the tag and the registry publication; it publishes the final once a gating image scan passed, and verifies it from outside. Soak a candidate when requested (`loom-release`). - **Benchmarks run only on request**: they spend provider money and hours (`loom-bench`). - **Committed and posted text** is plain technical English: the fact first, short comments that say why, no history, dates, people, hosts, internal namespaces or other products' names (`loom-writing`; `tests/unit/test_public_copy.py`). diff --git a/docs/development/release-process.md b/docs/development/release-process.md index b4d63af4000..ac3117e03dd 100644 --- a/docs/development/release-process.md +++ b/docs/development/release-process.md @@ -138,7 +138,7 @@ final's run reads it there. a dispatch; any other push run only warns on a scan finding. - By default, wait for the push run titled `Release X.Y.Z (#N)` on the merge commit and push the final tag once it passed. After a failed job other than the scan, use "Re-run failed jobs" - on that run: its gate job passed and is not run again, so the run still gates. + on that run: a re-run reads the same event and title, so the run still gates. - With another title, or after a scan fix merged to the target, name the target's commit and the time first, dispatch `docker-smoke.yml` on the target, and tag that commit once a run dispatched on it since then passed: `gh workflow run` returns before the run exists, so a @@ -171,8 +171,9 @@ final's run reads it there. 4. Follow the tag run. It publishes both images and the signed GitHub Release with the notes from the merged release pull request. After the outside installer and signature checks - pass, the same run publishes PyPI, npm, crates.io and the MCP Registry. Approve pending - deployments under the configured environments and watch the SDK install checks finish. + pass, the same run publishes PyPI, npm, crates.io and the MCP Registry, with no approval + step: each registry environment deploys only from a `v*` tag. Watch the SDK install checks + finish. The crate uses the independent version in `sdk/rust/Cargo.toml`. Change that version in the release pull request when the source has changed since the last published crate. From 984e819e7a554d5da70d4ac533c82e84085f1838 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Fri, 4 Dec 2026 00:41:18 +0530 Subject: [PATCH 25/40] docs(release): write the dispatch time in, wait a minute before a re-dispatch, name the scan steps Co-Authored-By: Claude Opus 5.5 Signed-off-by: Lareb Zafar --- .claude/skills/loom-release/SKILL.md | 12 +++++------ docs/development/release-process.md | 31 ++++++++++++++-------------- scripts/release/prepare.py | 5 ++--- tests/unit/test_release_prepare.py | 4 ++-- 4 files changed, 25 insertions(+), 27 deletions(-) diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index f4a364d52d9..e4885fcab24 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -22,17 +22,17 @@ metadata: ## Tag and monitor - **Default**. A pushed `vX.Y.Z` tag is never moved or deleted, so tag only a commit a gating docker-smoke run passed on (`scripts/gates/docker_smoke_gate.sh`): a push titled `Release X.Y.Z`, with or without ` (#N)`, a push to `release/X.Y`, a weekly run or a dispatch; any other push run only warns on a scan finding. - - Wait for the push run on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`), which builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failed job other than the scan, `gh run rerun -R ClickHouse/loom --failed`: a re-run reads the same event and title, so the run still gates. + - Wait for the push run on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json conclusion,event,displayTitle`), which builds and scans the exact commit as the tag run does. Once it passed, `git tag vX.Y.Z `, then `git push origin vX.Y.Z`. After a failure in a step other than the two scans, `gh run rerun -R ClickHouse/loom --failed`: a re-run reads the same event and title, so the run still gates. - After a failed scan, or for a merge commit with another title: - - Merge any fix to the target. Name its commit (`git fetch origin `, then `git rev-parse origin/`) and the time (`since=$(date -u +%Y-%m-%dT%H:%M:%SZ)`), then run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `. - - Tag that commit once `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit --created ">=$since" --json status,conclusion` shows a completed, successful run. `gh workflow run` returns before the run exists, so a listing without both filters can show an older dispatch. - - When no run appears, the target moved: name its new head and dispatch again. After a failed job other than the scan, dispatch again. + - Merge any fix to the target. Name its commit (`git fetch origin `, then `git rev-parse origin/`) and the time (`date -u +%Y-%m-%dT%H:%M:%SZ`), then run `gh workflow run docker-smoke.yml -R ClickHouse/loom --ref `. + - Tag that commit once `gh run list -R ClickHouse/loom --workflow docker-smoke.yml --event workflow_dispatch --commit --created ">=