fix: improve logging for webhook debugging - #5
Open
twallac10 wants to merge 6 commits into
Open
Conversation
* Implement HelmReleaseTest operator (atomic-munching-donut plan)
- 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>
* Fix duplicate workflow runs on PR creation
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>
* Fix all golangci-lint issues
- 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>
* Add Docker build and push workflow for GHCR
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>
* Address all critical and important code review findings
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>
* Fix slow multi-platform Docker builds by pinning builder to BUILDPLATFORM
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>
* docs: add Helm chart design doc
* feat: add helm chart scaffold
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add CRD to helm chart
* feat: add RBAC templates to helm chart
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add deployment template to helm chart
* fix: add imagePullSecrets support for private registry
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add service template to helm chart
* feat: add helm chart package and push to CI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
fix: use short SHA for chart appVersion
fix: bump chart version per CI run for Flux detection
Add debug-level (V1) request logging to the webhook handler so HTTP requests from Flux notification-controller are visible in operator logs. Log HMAC validation details and filtered event metadata. Add startup diagnostics for HMAC secret and GitHub config. Fix controller bug where "skipping GitHub status post" was logged but the call was not actually skipped. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Test plan
go build ./...passesgo test ./internal/...)🤖 Generated with Claude Code