diff --git a/.claude/settings.json b/.claude/settings.json index 0e8f7d13119..cb80a3eb9ca 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -86,14 +86,15 @@ "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*)", "Bash(docker * loom-server*)", "Bash(docker * loom-workers*)", "Bash(git push *refs/tags/*)", + "Bash(git push *-d* v*.*)", + "Bash(git push * v*.* *-d*)", + "Bash(git push *:v*.*)", "Bash(git push *--follow-tags*)", "Bash(git push * main *)", "Bash(git push *refs/heads/main*)", @@ -114,7 +115,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-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-pre-push/SKILL.md b/.claude/skills/loom-pre-push/SKILL.md index ebde0bedbb0..08f39c077a7 100644 --- a/.claude/skills/loom-pre-push/SKILL.md +++ b/.claude/skills/loom-pre-push/SKILL.md @@ -52,7 +52,7 @@ Use this map to select local checks and inspect the matching CI jobs. Full integ | `sdk/python/` | CI's "python sdk wheel" steps (job `sdk-python-package` in `.github/workflows/ci.yml`): `uv build sdk/python --out-dir dist`, a fresh Python 3.11 virtualenv with the wheel and its `Requires-Dist` installed at `--resolution lowest-direct`, then `scripts/gates/sdk_wheel_smoke.py dist/*.whl` in it; the server's 3.12 venv hides an undeclared dependency or a 3.12-only API | | the files the hostile sandbox suite runs: `server/code/app/index/` `sandbox.py`, `egress.py`, `egress_relay.py`, `compiler_tier.py`, `gitrepo.py`, `server/core/hosts.py`, and `tests/unit/test_repo_job_sandbox*.py` | `LOOM_TEST_REQUIRE_SANDBOX=1 .venv/bin/python -m pytest tests/unit/test_repo_job_sandbox.py tests/unit/test_repo_job_sandbox_hostile.py -q` on a host where bubblewrap can create namespaces; without it the test fails here, as in CI. On a host where it cannot, push and read CI's `repository-job sandbox (real bubblewrap)` job; never install bubblewrap or change the user-namespace sysctl on a shared host | | `deploy/apparmor/`, `dev/seccomp/`, `dev/docker-compose.colour.yml` | push and read `docker-smoke.yml`'s "Repository-job sandbox under the shipped profiles" job, which builds the image, loads the profile and runs the two sandbox suites in the container; the host test above never applies a profile. Reproduce that job only on a disposable VM: `apparmor_parser -r` replaces the profile host-wide, under any deployment's running repository jobs, and its sysctl changes every session's sandbox on that host | -| `docs/`, any `.md` | `.venv/bin/python -m pytest tests/unit/test_doc_links.py tests/unit/test_public_copy.py` | +| `docs/`, any `.md` | `.venv/bin/python -m pytest tests/unit/test_doc_links.py tests/unit/test_public_copy.py`, with `tests/unit/test_release_prepare.py` for a page with an install command that names a version (`clickhouse-loom==`, `clickhouse-loom[]==`, `@clickhouse/loom@`, `--ref v`) | ## 4. Read the regenerated diff diff --git a/.claude/skills/loom-release/SKILL.md b/.claude/skills/loom-release/SKILL.md index 39cfc7fa36a..eb4aeedc2d9 100644 --- a/.claude/skills/loom-release/SKILL.md +++ b/.claude/skills/loom-release/SKILL.md @@ -8,28 +8,41 @@ 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 its gating image scan passes. 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 - 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. -- 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 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. +- 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**. 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. -- 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. +A pushed `vX.Y.Z` tag is never moved or deleted, so a final goes only on a commit a gating docker-smoke run (`scripts/gates/docker_smoke_gate.sh`) passed on, created within the six hours before the tag (`createdAt`, which a re-run keeps): the tag run's scan reads a newer vulnerability database. A gating run 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 only warns on a scan finding. + +- **Default**. Wait for the push run on the release PR's merge commit (`gh run list -R ClickHouse/loom --workflow docker-smoke.yml --commit --json status,conclusion,event,displayTitle,createdAt`), 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`; for a run too old, dispatch as below. After any failure other than a scan finding (a CVE the log names), `gh run rerun -R ClickHouse/loom --failed`: a re-run reads the same event and title, so the run still gates. + - After a scan finding, for a merge commit with another title, or for a run too old: + - 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 ">=