Skip to content

fix: use short SHA for chart appVersion#2

Open
twallac10 wants to merge 15 commits into
mainfrom
feature/atomic-munching-donut
Open

fix: use short SHA for chart appVersion#2
twallac10 wants to merge 15 commits into
mainfrom
feature/atomic-munching-donut

Conversation

@twallac10

Copy link
Copy Markdown
Contributor

Root Cause

The `package-push-chart` CI job set chart appVersion to the full 40-char SHA via `${{ github.sha }}`, but `docker/metadata-action` with `type=sha,prefix=sha-` tags the image with the short 7-char SHA. This mismatch caused ImagePullBackOff — the chart referenced a tag that did not exist.

Fix

Truncate to 7 chars in the chart job to match the actual Docker image tag format.

twallac10 and others added 15 commits March 7, 2026 08:33
- Scaffold kubebuilder project with HelmReleaseTest CRD
- CRD types: HelmReleaseTestSpec (helmReleaseRef, kustomizationRef, cronJobRef),
  full status fields, kubebuilder print columns
- Webhook handler (internal/webhook): HMAC-SHA256 validation, Flux event parsing,
  HelmReleaseTest matching, 5-min dedup window, Job creation from CronJob template
- Job watcher controller: watches batch/v1 Jobs by label, lazy SHA resolution,
  updates HelmReleaseTest status, posts GitHub commit status
- Kustomization SHA resolver (internal/kustomization): unstructured Kustomization fetch
- GitHub status reporter (internal/github): POST /statuses/{sha} with env-based config
- cmd/main.go: webhook goroutine on :8080, probes on :8082, metrics on :8081,
  leader election ID helm-release-test-operator.testing.platform.io
- RBAC markers: batch jobs/cronjobs, kustomize+helm flux CRDs, helmreleasetests
- Sample manifests: HelmReleaseTest CR, suspended CronJob, Flux Provider+Alert
- Unit tests: HMAC validation, SHA parsing, dedup logic, GitHub status posting
- All verification steps pass: make generate, manifests, build, test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Scope push trigger to main only so feature branch pushes don't
fire a second run alongside the pull_request trigger.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- errcheck: wrap resp.Body.Close in func literal, remove duplicate os.Setenv calls
- lll: break long flag.StringVar line in main.go
- staticcheck QF1008: drop embedded .Time from CreationTimestamp.After call

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Multi-platform build (linux/amd64 + linux/arm64) covers Ubuntu k8s nodes
and Mac OS kind clusters (Apple Silicon). On PRs, builds both platforms
without pushing to verify the Dockerfile. On push to main, pushes
ghcr.io/<owner>/testrun-operator:latest and :sha-<sha> tags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Critical:
- Controller: add LastRunJob guard to prevent re-processing completed Jobs,
  eliminating redundant status patches and duplicate GitHub API calls

Important:
- Webhook: add 1 MiB body size limit via http.MaxBytesReader
- Webhook: remove unused testing.platform.io/helmrelease annotation write
- GitHub: convert PostCommitStatus to Poster struct with injectable HTTPClient,
  read Token/Repo once at startup in main.go instead of inside the leaf function
- main.go: implement fluxWebhookRunnable (manager.Runnable) for graceful shutdown
  with 5s drain timeout instead of bare goroutine
- main.go: inject github.Poster into reconciler
- manager.yaml: fix health probe arg and port from :8081 to :8082
- api types: remove LastTestedRevision field that was declared but never populated

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…FORM

Without --platform=\$BUILDPLATFORM, Docker pulls the arm64 golang image and
runs the entire Go compile under QEMU on the amd64 runner, which takes many
minutes. With this flag the builder always runs natively; GOARCH=\$TARGETARCH
handles cross-compilation. Only the final distroless layer needs QEMU.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant