Skip to content

Cherry pick #115169 to 26.7: Provide signed macOS artifacts - #115312

Merged
robot-ch-test-poll merged 15 commits into
backport/26.7/115169from
cherrypick/26.7/115169
Aug 18, 2026
Merged

robot-ch-test-poll merged 15 commits into
backport/26.7/115169from
cherrypick/26.7/115169

Conversation

@robot-clickhouse-ci-2

Copy link
Copy Markdown
Contributor

Original pull-request #115169

Do not merge this PR manually

This pull-request is a first step of an automated backporting.
It contains changes similar to calling git cherry-pick locally.
If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.

The check results does not matter at this step - you can safely ignore them.

Troubleshooting

If the conflicts were resolved in a wrong way

If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

thevar1able and others added 14 commits August 17, 2026 23:59
The image provides tooling to sign and notarize macOS binaries from Linux:
`rcodesign` built with the `pkcs11` feature, the `aws-kms-pkcs11` module
pinned by release tag and `sha256`, and `p11-kit`. The signing key stays in
AWS KMS.

It derives from `clickhouse/fasttest`, like `clickhouse/binary-builder` and
`clickhouse/cctools`. AMD only. No job uses the image yet.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`clickhouse/macos-signer` does not exist on Docker Hub and the CI robot lacks the
scope to create it on push, so the manifest merge failed with:

    ERROR: pull access denied, repository does not exist or may require
           authorization: server message: insufficient_scope: authorization failed

`clickhouse/utils` already exists and is empty, so it needs no new repository. A
general-purpose name also suits an image that carries standalone tooling rather
than only the signing tools.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The published macOS binaries are unsigned, so a browser download is quarantined and Gatekeeper refuses to run it. The Homebrew cask disables itself on 2026-09-01 for exactly this reason.

The darwin builds now also provide the plain (not self-extracting) Mach-O, because a self-extracting archive cannot carry a signature - signing it would discard the payload. A job then signs that binary with `rcodesign`, using a Developer ID certificate whose key lives in AWS KMS and is used for one RSA operation, so no key material ever reaches the runner, and submits the result to Apple's Notary API from Linux - no macOS runner is involved anywhere.

The hardened runtime is mandatory for notarization and kills unsigned executable memory, which ClickHouse's regexp JIT allocates, hence `com.apple.security.cs.allow-unsigned-executable-memory` in the entitlements.

Signing runs on `amd-release-maker` in `ReleaseBranchCI` only: that pool's identity is the only one that can reach the key, and a release asset is the sole consumer of a signature.

Nothing is published yet - the signed zip is a CI artifact.

Co-Authored-By: Claude Opus 5 <[email protected]>
`CreateRelease` now also downloads the signed, notarized zip each sign job uploads and attaches it to the GitHub release as `clickhouse-macos.zip` and `clickhouse-macos-aarch64.zip`, alongside the existing self-extracting binaries rather than replacing them.

Two knock-on changes. The sign jobs lose `allow_failure`, because a release now needs their output. And their cache digest gains the build digest paths: it previously hashed only the signing script and certificate, so on a release branch every commit after the first would hit the cache, upload nothing under its own SHA, and leave every commit unreleasable - `release_build_artifacts_ready` requires the exact object key per commit.

Co-Authored-By: Claude Opus 5 <[email protected]>
One consumer, and `ci/workflows/create_release.py` already writes the label list literally.

Co-Authored-By: Claude Opus 5 <[email protected]>
Tools, then committed inputs, then working files, then KMS, then the Apple identity, then the notary credentials. Pure reordering.

Co-Authored-By: Claude Opus 5 <[email protected]>
Job assets live in `ci/jobs/scripts/<area>/` - `clickbench/create.sql`, `fuzzer/fuzz-server-settings.xml`, `docker_server/config.sh`. `ci/signing` was the only asset directory at the top of `ci/`, where everything else is infrastructure.

Co-Authored-By: Claude Opus 5 <[email protected]>
Access is settled, and the `sign` step reports the same permission error on its own. The probe also issued a real `kms:Sign` of a dummy message on every run, doubling the signature count in CloudTrail.

Co-Authored-By: Claude Opus 5 <[email protected]>
`ReleaseBranchCI` is a `push` workflow, so a release branch runs its own workflow definition, while `AutoReleases` and `CreateRelease` run from `master`. Release branches cut before signing existed never upload the zips, so demanding them unconditionally would reject every candidate commit on 25.8, 26.3, 26.5, 26.6 and 26.7 and block their patch releases.

Read the requirement off the release commit instead: `commit_has_macos_signing` asks git whether that commit's tree carries the signing job. It raises when the commit is not present locally rather than assuming no signing, which would silently publish a release without its signed assets.

Co-Authored-By: Claude Opus 5 <[email protected]>
`ci/tests/` runs where the workspace is not a usable git repository - `git rev-parse HEAD` exits 128 - so the test cannot read a real commit's tree. Patch `commit_has_macos_signing` instead and drive both shapes, with and without the signed zips.

Co-Authored-By: Claude Opus 5 <[email protected]>
Every unprefixed amd pool assumes `ec2_admin` and completed a real `kms:Sign`: `amd-small`, `amd-medium`, `amd-large` and `style-checker`. Only pull request pools carry `untrusted_runner`, which is why yesterday's `pr-amd-small` probe reported no access.

https://github.com/ClickHouse/ClickHouse/actions/runs/32141517638

Signing is light - fetch an artifact, one KMS signature, then wait on Apple - so it belongs on the cheapest pool, and the release pool stays clear for releases.

Co-Authored-By: Claude Opus 5 <[email protected]>
@robot-clickhouse-ci-2 robot-clickhouse-ci-2 added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request labels Aug 18, 2026
Keep only the producing side: the sign jobs, the plain darwin artifact, the `clickhouse/utils` image and the signing assets. 26.7 has none of the release tooling this PR also touched - `release_packages.py`, `auto_release_job.py` and its test do not exist there - and `CreateRelease` runs from `master` anyway, so publishing needs nothing on this branch. Left `create_release.py` at the 26.7 version too: the auto-merge had inserted calls to `release_packages`, which would have raised `NameError` on every 26.7 release.

Co-Authored-By: Claude Opus 5 <[email protected]>
@robot-ch-test-poll
robot-ch-test-poll merged commit b6d285d into backport/26.7/115169 Aug 18, 2026
1 check passed
@robot-ch-test-poll
robot-ch-test-poll deleted the cherrypick/26.7/115169 branch August 18, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants