Repository navigation
test(release): qualify signed published artifacts on clean installs and upgrades #906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ValgulNecron
merged 22 commits into
fix/882-offline-helm
from
test/877-published-release-consumer
Nov 13, 2026
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
6e614c5
test(release): qualify published charts and images as an anonymous co…
Baylem 6379f22
test(release): share populated upgrade checks across qualification lanes
Baylem f26b759
test(release): integrate the populated GitOps upgrade fixture
Baylem d131d44
test(release): follow the verified GitOps and RBAC stack
Baylem d990818
test(release): verify signed images on every deployed replica
Baylem 5ce837c
chore(release): refresh the populated GitOps upgrade base
Baylem da9eef2
test(release): qualify an already published tag from a review branch
Baylem 30bc957
merge: sync offline Helm parent into release qualification
Baylem 51c4a3e
merge: inherit Argo CD registration fix in release verification
Baylem 3988488
merge: sync reachable Git source into published release validation
Baylem 7e74512
fix(release): bind signed images to the tag and isolate consumer clus…
Baylem 1504f07
fix(release): verify signed repository identities and the upgrade bas…
Baylem 4f158da
merge: adopt GitOps and browser CI base for release qualification
Baylem 685603d
fix(ci): run only the consumer for a named published release
Baylem 48887be
merge: qualify the published release on the final browser CI base
Baylem fd02628
docs(changelog): record published release verification
Baylem 66d0f11
chore(stack): reconcile published-release checks with current CI parents
Baylem ddba490
chore(stack): align release qualification with the merged browser pre…
Baylem cfabff2
chore(stack): follow the current Argo CD upgrade prerequisite
Baylem d3b6854
chore(stack): refresh release qualification against the re-rooted Git…
Baylem ed6fe94
fix(ci): verify arm64 layers and wait for the upgraded game pod
Baylem d105ed2
fix(e2e): pass the upgrade context to the marker read
Baylem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: published release qualification | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| release_tag: | ||
| description: Published Gameplane version tag | ||
| required: true | ||
| type: string | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| consumer: | ||
| name: verify published chart and images | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 50 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: ./.github/actions/go-cache | ||
| with: | ||
| key-suffix: e2e | ||
| - uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1 | ||
| - uses: helm/kind-action@ea822c7bf1874f08e5a491df991c228edffc3376 # v1.15.2 | ||
| with: | ||
| install_only: true | ||
| - uses: oras-project/setup-oras@5e2f2482b30b0cb3e14e67f89a80c88c659a7c63 # v2.0.3 | ||
| - uses: sigstore/cosign-installer@756fe2d284c7292c4e9b62c8a28f1e5629c59532 # v4.1.3 | ||
| with: | ||
| cosign-release: 'v3.1.2' | ||
| - name: verify, install and upgrade using published chart and images | ||
| env: | ||
| RELEASE_TAG: ${{ inputs.release_tag }} | ||
| run: bash deploy/kind/qualify-published-release.sh "$RELEASE_TAG" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Published release verification | ||
|
|
||
| Release qualification now verifies the signed Helm chart and component image digests as an | ||
| anonymous consumer. It exercises a clean install and a populated upgrade from the previous | ||
| supported release. [PR #906](https://github.com/GameplanePanel/Gameplane/pull/906) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| #!/usr/bin/env bash | ||
| # Release CI runs this on a fresh amd64 runner without a registry login. | ||
| set -euo pipefail | ||
| source deploy/kind/release-consumer-lib.sh | ||
| tag=${1:?pass the published release tag} | ||
| [[ $tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z]+([.-][0-9A-Za-z]+)*)?$ ]] || { | ||
| echo "expected a published vMAJOR.MINOR.PATCH tag, optionally with a prerelease suffix" >&2 | ||
| exit 2 | ||
| } | ||
| version=${tag#v} | ||
| owner="${GITHUB_REPOSITORY_OWNER,,}" | ||
| registry="ghcr.io/$owner" | ||
| scratch="$(mktemp -d)" | ||
| export DOCKER_CONFIG="$scratch/docker" HELM_REGISTRY_CONFIG="$scratch/helm.json" | ||
| export KUBECONFIG="$scratch/kubeconfig" KIND_EXPERIMENTAL_PROVIDER=docker | ||
| owned_node='' | ||
| cleanup() { | ||
| local status=$? | ||
| delete_consumer_cluster || status=1 | ||
| rm -rf -- "$scratch" | ||
| exit "$status" | ||
| } | ||
| trap cleanup EXIT | ||
| export GAMEPLANE_PUBLISHED_CHART="$scratch/gameplane" GAMEPLANE_RELEASE_DIGESTS="$scratch/images.tsv" | ||
| export GAMEPLANE_PREVIOUS_RELEASE_DIGESTS="$scratch/previous-images.tsv" | ||
| mkdir -p "$DOCKER_CONFIG" | ||
| cosign initialize | ||
|
|
||
| chart="$registry/charts/gameplane" | ||
| digest="$(oras resolve "$chart:$version")" | ||
| verify_release_signature "$chart" "$digest" | ||
| helm pull "oci://$chart@$digest" --untar --untardir "$scratch" | ||
| test "$(yq -r '.version' "$GAMEPLANE_PUBLISHED_CHART/Chart.yaml")" = "$version" | ||
| test "$(yq -r '.appVersion' "$GAMEPLANE_PUBLISHED_CHART/Chart.yaml")" = "$version" | ||
| printf 'Verified chart `%s@%s`\n' "$chart" "$digest" >> "${GITHUB_STEP_SUMMARY:-/dev/null}" | ||
|
|
||
| # Read the publisher's complete matrix, including optional images. Keep the | ||
| # signed index and its amd64 manifest/config IDs for containerd comparisons. | ||
| git fetch --quiet --no-tags --depth=1 origin "refs/tags/$tag" | ||
| revision=$(git rev-parse --verify 'FETCH_HEAD^{commit}') | ||
| git show "$revision:.github/workflows/release.yaml" > "$scratch/published-release.yaml" | ||
| printf 'Release `%s` at Git commit `%s`\n' "$tag" "$revision" >> "${GITHUB_STEP_SUMMARY:-/dev/null}" | ||
| components="$(yq -r '.jobs.images.strategy.matrix.include[].component' "$scratch/published-release.yaml")" | ||
| test -n "$components" | ||
| while read -r component; do | ||
| verify_release_image "$registry/gameplane/$component" "$version" "$revision" "$GAMEPLANE_RELEASE_DIGESTS" | ||
| done <<< "$components" | ||
|
|
||
| run_id=$(cat /proc/sys/kernel/random/uuid) | ||
| fresh="gp-fresh-$run_id" | ||
| create_consumer_cluster "$fresh" | ||
| helm install gameplane "$GAMEPLANE_PUBLISHED_CHART" --kube-context "kind-$fresh" \ | ||
| --namespace gameplane-system --create-namespace --set ingress.enabled=false \ | ||
| --set defaultModuleSource.enabled=false --wait --timeout 6m | ||
| bash deploy/kind/verify-release-runtime.sh "kind-$fresh" "$GAMEPLANE_RELEASE_DIGESTS" api operator web | ||
| delete_consumer_cluster | ||
|
|
||
| # The regular upgrade fixture seeds the old API database and game PVC, | ||
| # exercises the CRD hooks, and checks their contents after the upgrade. | ||
| export GAMEPLANE_E2E_CLUSTER="gp-upgrade-$run_id" GAMEPLANE_E2E_REUSE_CLUSTER=1 | ||
| export GAMEPLANE_E2E_CONTEXT="kind-$GAMEPLANE_E2E_CLUSTER" | ||
| create_consumer_cluster "$GAMEPLANE_E2E_CLUSTER" | ||
| deploy/kind/upgrade.sh install "$GAMEPLANE_E2E_CLUSTER" | ||
| (cd test/e2e && go test -tags=e2e -timeout 25m -v -run '^TestUpgrade_FromPreviousRelease$' .) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| #!/usr/bin/env bash | ||
| # Classic keyed cosign verification checks the digest. Also check the | ||
| # repository named in the signed payload before trusting a component. | ||
| verify_release_signature() { | ||
| local repository=$1 digest=$2 | ||
| if ! cosign verify --key signing/cosign.pub --new-bundle-format=false "$repository@$digest" | | ||
| jq -e --arg repo "$repository" --arg digest "$digest" 'any(.[]; | ||
| .critical.identity["docker-reference"] == $repo and | ||
| .critical.image["docker-manifest-digest"] == $digest)' >/dev/null; then | ||
| echo "Missing valid release signature for $repository@$digest" >&2 | ||
| return 1 | ||
| fi | ||
| } | ||
|
|
||
| # The config blob is addressed through the verified release index. | ||
| verify_release_config() { | ||
| jq -e --arg arch "$1" --arg revision "$2" --arg version "$3" ' | ||
| .os == "linux" and .architecture == $arch and | ||
| .config.Labels["org.opencontainers.image.revision"] == $revision and | ||
| .config.Labels["org.opencontainers.image.version"] == $version' >/dev/null | ||
| } | ||
|
|
||
| verify_release_image() { | ||
| local image=$1 version=$2 revision=$3 digest_file=$4 | ||
| local index ref index_json arch manifest manifest_json config layers layer | ||
| index=$(oras resolve "$image:$version") | ||
| ref="$image@$index" | ||
| verify_release_signature "$image" "$index" | ||
| docker pull --platform linux/amd64 "$ref" | ||
| printf '\n- `%s`\n' "$ref" >> "${GITHUB_STEP_SUMMARY:-/dev/null}" | ||
| index_json=$(oras manifest fetch "$ref") | ||
| for arch in amd64 arm64; do | ||
| manifest=$(jq -er --arg arch "$arch" ' | ||
| [.manifests[] | select(.platform.os == "linux" and .platform.architecture == $arch) | .digest] | ||
| | if length == 1 then .[0] else error("expected one linux/" + $arch + " manifest") end' <<< "$index_json") | ||
| manifest_json=$(oras manifest fetch "$image@$manifest") | ||
| config=$(jq -er '.config.digest' <<< "$manifest_json") | ||
| if ! oras blob fetch --output - "$image@$config" | verify_release_config "$arch" "$revision" "$version"; then | ||
| echo "$image@$config must identify linux/$arch, version $version and Git commit $revision" >&2 | ||
| return 1 | ||
| fi | ||
| printf ' - linux/%s manifest `%s`, config `%s`\n' "$arch" "$manifest" "$config" >> "${GITHUB_STEP_SUMMARY:-/dev/null}" | ||
| if [[ $arch == amd64 ]]; then | ||
| printf '%s\t%s\t%s\t%s\t%s\n' "${image##*/}" "$image:$version" "$index" "$manifest" "$config" >> "$digest_file" | ||
| else | ||
| # Docker pulled amd64 above. Read the other platform's blobs without | ||
| # replacing that image in the runner's Docker store. | ||
| layers=$(jq -er '.layers[].digest' <<< "$manifest_json") || return 1 | ||
| while IFS= read -r layer; do | ||
| oras blob fetch --output - "$image@$layer" >/dev/null || return 1 | ||
| done <<< "$layers" | ||
| fi | ||
| done | ||
| } | ||
|
|
||
| # Each consumer cluster has one Docker control-plane node. Capture its | ||
| # immutable container ID only after its CA matches the private kubeconfig | ||
| # written by this creation. A concurrent name replacement stays untouched. | ||
| create_consumer_cluster() { | ||
| local name=$1 existing id node_ca kube_ca | ||
| [[ -z $owned_node ]] || return 1 | ||
| existing=$(kind get clusters) || return 1 | ||
| if grep -Fxq -- "$name" <<< "$existing"; then | ||
| echo "Kind cluster $name already exists" >&2 | ||
| return 1 | ||
| fi | ||
| kind create cluster --name "$name" --kubeconfig "$KUBECONFIG" --wait 90s || return 1 | ||
| id=$(docker inspect --type container --format '{{.Id}}' "$name-control-plane") || return 1 | ||
| [[ $id =~ ^[a-f0-9]{64}$ ]] || return 1 | ||
| node_ca=$(docker exec "$id" cat /etc/kubernetes/pki/ca.crt | base64 -w0) || return 1 | ||
| kube_ca=$(kubectl config view --kubeconfig "$KUBECONFIG" --context "kind-$name" \ | ||
| --minify --raw -o jsonpath='{.clusters[0].cluster.certificate-authority-data}') || return 1 | ||
| if [[ -z $node_ca || $node_ca != "$kube_ca" ]]; then | ||
| echo "Control-plane container for $name does not match its kubeconfig" >&2 | ||
| return 1 | ||
| fi | ||
| owned_node=$id | ||
| } | ||
|
|
||
| delete_consumer_cluster() { | ||
| if [[ -n $owned_node ]]; then | ||
| docker rm --force --volumes "$owned_node" >/dev/null || return 1 | ||
| owned_node='' | ||
| fi | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.