Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,34 @@ jobs:

- name: Tests
run: go test -race ./...

release-check:
name: Release packaging (unsigned)
runs-on: ubuntu-latest
timeout-minutes: 15
# No OIDC or publishing permissions: PRs build and inspect snapshots only.
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-go@v7
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- uses: anchore/sbom-action/download-syft@fffec3d851af758d56fee099cf3fbf8aa8779843 # v0.24.3
with:
syft-version: v1.57.2
- uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: v2.20.2
install-only: true
- name: Build archives and SBOMs without publishing or signing
run: |
goreleaser check
goreleaser release --snapshot --clean --skip=publish,sign,docker
- name: Validate snapshot and reject damaged evidence
run: |
python3 scripts/check-release-artifacts.py dist --unsigned \
--version "$(jq -r .version dist/metadata.json)"
python3 -m unittest discover -s scripts -p 'test_*.py' -v
58 changes: 55 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,32 @@ jobs:
name: GoReleaser
needs: [release-please]
# always(): still run on workflow_dispatch when release-please is skipped.
if: ${{ always() && !cancelled() && (needs.release-please.outputs.release_created == 'true' || (github.event_name == 'workflow_dispatch' && inputs.publish_tag != '')) }}
if: ${{ always() && !cancelled() && github.repository == 'tracewick/agent' && github.ref == 'refs/heads/main' && (needs.release-please.outputs.release_created == 'true' || (github.event_name == 'workflow_dispatch' && inputs.publish_tag != '')) }}
runs-on: ubuntu-latest
timeout-minutes: 45
permissions:
contents: write
packages: write
id-token: write
env:
RELEASE_TAG: ${{ needs.release-please.outputs.tag_name || inputs.publish_tag }}
steps:
- name: Validate the release tag input
shell: bash
run: |
[[ "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]] || exit 1

- uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ inputs.publish_tag || github.sha }}
ref: ${{ env.RELEASE_TAG }}

- name: Require a tag from main with signed-release support
shell: bash
run: |
test "$(git rev-parse HEAD)" = "$(git rev-parse "refs/tags/$RELEASE_TAG^{commit}")"
git merge-base --is-ancestor HEAD origin/main
test -f scripts/check-release-artifacts.py

- uses: actions/setup-go@v7
with:
Expand All @@ -93,6 +108,14 @@ jobs:
- uses: docker/setup-qemu-action@v4
- uses: docker/setup-buildx-action@v4

- uses: sigstore/cosign-installer@756fe2d284c7292c4e9b62c8a28f1e5629c59532 # v4.1.3
with:
cosign-release: v3.1.4

- uses: anchore/sbom-action/download-syft@fffec3d851af758d56fee099cf3fbf8aa8779843 # v0.24.3
with:
syft-version: v1.57.2

- name: Login to GHCR
uses: docker/login-action@v4
with:
Expand All @@ -103,12 +126,41 @@ jobs:
- uses: goreleaser/goreleaser-action@v7
with:
distribution: goreleaser
version: "~> v2"
version: v2.20.2
args: release --clean
env:
# App token uploads assets to the App-created release; GHCR uses docker login above.
GITHUB_TOKEN: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}

- name: Verify published release artifacts
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release download "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" \
--dir "$RUNNER_TEMP/release-verification"
python3 scripts/check-release-artifacts.py "$RUNNER_TEMP/release-verification" \
--version "${RELEASE_TAG#v}"

- name: Verify published image signature, revision and SBOMs
shell: bash
run: |
IMAGE=ghcr.io/tracewick/agent
DIGEST=$(docker buildx imagetools inspect "$IMAGE:${RELEASE_TAG#v}" --format '{{.Manifest.Digest}}')
[[ "$DIGEST" =~ ^sha256:[a-f0-9]{64}$ ]] || exit 1
cosign verify \
--certificate-identity 'https://github.com/tracewick/agent/.github/workflows/release.yml@refs/heads/main' \
--certificate-oidc-issuer 'https://token.actions.githubusercontent.com' "$IMAGE@$DIGEST"
docker buildx imagetools inspect "$IMAGE@$DIGEST" --raw | \
jq -e --arg ver "${RELEASE_TAG#v}" --arg rev "$(git rev-parse HEAD)" \
'.annotations["org.opencontainers.image.version"] == $ver and
.annotations["org.opencontainers.image.revision"] == $rev'
docker buildx imagetools inspect "$IMAGE@$DIGEST" --format '{{json .SBOM}}' > "$RUNNER_TEMP/image-sboms.json"
jq -e '. as $sboms | ["linux/amd64", "linux/arm64"] | all(.[];
$sboms[.].SPDX | (.spdxVersion | startswith("SPDX-")) and
([.packages[].name] | index("base-files") != null and
index("stdlib") != null and index("github.com/tracewick/agent") != null))' \
"$RUNNER_TEMP/image-sboms.json"

back-merge:
name: Merge main back into develop
needs: release-please
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/build/
.golangci.cache/
.cache/
__pycache__/

# IDE / OS
.idea/
Expand Down
46 changes: 42 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Multi-arch binaries + GHCR images. Cosign / SBOM intentionally deferred;
# release footer states unsigned until they land.
# Multi-arch binaries and GHCR images, with SBOMs and keyless signatures.
version: 2

project_name: tracewick-agent
Expand All @@ -26,6 +25,29 @@ checksum:
name_template: checksums.txt
algorithm: sha256

# These SBOMs describe the actual archives, not the source checkout.
sboms:
- artifacts: archive
documents:
- "{{ .ArtifactName }}.sbom.json"
args:
- "$artifact"
- "--output"
- "cyclonedx-json=$document"
- "--source-name={{ .ProjectName }}"
- "--source-version={{ .Version }}"

# The checksum manifest covers both archives and their SBOMs.
signs:
- cmd: cosign
artifacts: checksum
signature: "${artifact}.sigstore.json"
args:
- sign-blob
- "--bundle=${signature}"
- "${artifact}"
- "--yes"

dockers_v2:
- id: tracewick-agent
ids: [tracewick-agent]
Expand All @@ -39,6 +61,11 @@ dockers_v2:
platforms:
- linux/amd64
- linux/arm64
# BuildKit attaches per-platform SPDX SBOMs to the OCI index.
sbom: true
annotations:
"index:org.opencontainers.image.version": "{{ .Version }}"
"index:org.opencontainers.image.revision": "{{ .FullCommit }}"
labels:
"org.opencontainers.image.title": "tracewick-agent"
"org.opencontainers.image.description": "Tracewick spool sidecar for Pyroscope"
Expand All @@ -47,13 +74,24 @@ dockers_v2:
"org.opencontainers.image.version": "{{ .Version }}"
"org.opencontainers.image.revision": "{{ .FullCommit }}"

# Sign the index by digest, binding its platform manifests and SBOM attestations.
docker_signs:
- artifacts: ""
args:
- sign
- "${artifact}@${digest}"
- "--yes"

changelog:
disable: true

release:
draft: false
# release-please already wrote the changelog body; append the unsigned note.
# release-please already wrote the changelog body.
mode: append
footer: |
---
**Unsigned release:** no cosign signatures or SBOM yet. Prefer `checksums.txt` (SHA-256) and pinned image digests from `ghcr.io/tracewick/agent`. Cosign/SBOM land later.
Archive SBOMs and a Sigstore bundle for `checksums.txt` accompany this release.
GHCR image indexes are signed by digest and include per-platform SPDX SBOMs.
Verify the release workflow completed successfully and follow the
[verification instructions](https://github.com/tracewick/agent/blob/main/deploy/verify-release.md).
18 changes: 13 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ library and `tracewick-drain` remain the spool writers / reference drain.

> **Beta (`0.2.x`).** Capacity evidence (agent as reader) lives in
> [`tracewick/benchmarks`](https://github.com/tracewick/benchmarks). Do not claim
> production / highload readiness. Cosign/SBOM, broader env parity, and socket
> hand-off remain RC / later.
> production / highload readiness. Operational env parity is in develop; socket
> hand-off remains v1.1+. Signed-release configuration is described below.

## Path to release

Expand All @@ -23,7 +23,7 @@ Alpha cut is done (`v0.1.0`). Keep the floor green while advancing RC work:
| --- | --- |
| Delivery proof | Stand + Toxiproxy chaos + Querier live + Go ↔ PHP-drain (see `test/e2e/`) |
| Test proof | Coverage gates **and** fuzz / `go tool pprof` / mutation (Gremlins) on core |
| Release machine | release-please + GoReleaser: binaries + `ghcr.io/tracewick/agent`; unsigned until cosign |
| Release machine | release-please + GoReleaser: binaries, archive SBOMs, signed checksums and SBOM-bearing signed GHCR indexes |
| Load truth | Soak/load via [`tracewick/benchmarks`](https://github.com/tracewick/benchmarks), not a weak mini-soak here |

httptest is fine for unit and claim-smoke only — not a substitute for Toxiproxy chaos.
Expand Down Expand Up @@ -110,14 +110,22 @@ Releases follow git flow and are automated with
request into `main`.
3. Merging it tags `v<version>` and runs GoReleaser: linux amd64/arm64
`tar.gz` + `checksums.txt`, multi-arch `ghcr.io/tracewick/agent`, and an
**unsigned** footer on the GitHub Release body (no cosign/SBOM yet).
footer linking [SBOM/signature verification](deploy/verify-release.md).
Archive SBOMs are generated with Syft, checksums are signed with keyless
Cosign, and BuildKit SBOM-bearing image indexes are signed by digest.
4. The workflow opens a pull request merging `main` back into `develop`.

Tags `v*` are protected by a ruleset. The workflow uses a dedicated GitHub App
(`RELEASE_APP_ID` / `RELEASE_APP_PRIVATE_KEY`, on the tag ruleset bypass list —
same pattern as `tracewick/tracewick`). Do not force-push tags by hand.

Releases stay **unsigned** until cosign/SBOM land. Pin the next tag with
Existing 0.2.x releases remain **unsigned**. The first signed release must pass
the publishing job and verification steps; a local snapshot is not an OIDC test.
The Release workflow must run from main, including manual recovery, so its exact
certificate identity ends in `release.yml@refs/heads/main`. Only the publishing
job has OIDC permission; no persistent signing key is required. Tool versions are
pinned in the release and unsigned-packaging CI jobs; update them together.
See [verification and recovery](deploy/verify-release.md). Pin the next tag with
`release-as` in `release-please-config.json` when forcing a version (then remove
it after the release PR merges). Do not invent tags outside that flow.

Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,18 @@ encodes **pprof**, and pushes via the Pyroscope Push API.

| In beta | Later (RC / 1.0+) |
| --- | --- |
| Spool claim → aggregate → pprof → Push → ack (`run` / `--once`) | Signed releases (cosign) / SBOM |
| Spool claim → aggregate → pprof → Push → ack (`run` / `--once`) | |
| Same claim protocol as PHP `tracewick-drain` (at-least-once) | Unix socket hand-off (v1.1+) |
| Stand + Toxiproxy + live Querier + Go↔PHP-drain E2E | Broader CLI/env parity with drain |
| Stand + Toxiproxy + live Querier + Go↔PHP-drain E2E | |
| Operational CLI/env settings (develop; not in published 0.2.1) | |
| linux amd64/arm64 binaries + `ghcr.io/tracewick/agent` | |
| Codecov / mutation / fuzz / `go tool pprof` CI gates | |
| Soak / RPS / chaos / spool-pressure goldens (agent reader) | |

GitHub Releases are **unsigned** until cosign is wired. Prefer `checksums.txt`
(SHA-256) and pinned GHCR digests.
The release workflow generates archive SBOMs, signs their checksum manifest with
keyless Cosign, and signs SBOM-bearing GHCR image indexes. Existing 0.2.x releases
remain **unsigned**; the first signed publication still needs a successful release
run. See [verification and recovery](deploy/verify-release.md).

### Ops assumptions

Expand Down Expand Up @@ -112,7 +115,7 @@ Wire format and delivery decisions live in
## Install

Pin a release tag (see [Releases](https://github.com/tracewick/agent/releases)).
Artifacts are **unsigned** — verify `checksums.txt` (and prefer an image digest
Existing 0.2.x artifacts are **unsigned** — verify `checksums.txt` (and prefer an image digest
for containers).

### Binary (linux amd64 / arm64)
Expand Down
4 changes: 3 additions & 1 deletion deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ docker run --rm --user "$(id -u):$(id -g)" \
tracewick-agent:local run --once
```

Published tags are **unsigned** until cosign lands; pin by digest when possible.
Existing 0.2.x releases are **unsigned**. For releases made by the signed-release
workflow, verify the checksum bundle or GHCR index signature before use, then pin
the image digest. See [SBOM/signature verification](verify-release.md).
Loading
Loading