Skip to content

Modernize Helm Spray for Helm 4, portable builds, CI, and AI-assisted tooling#105

Open
tonybjzhao wants to merge 26 commits into
ThalesGroup:masterfrom
tonybjzhao:AU_Thales-Against-The-Machine_2026June
Open

Modernize Helm Spray for Helm 4, portable builds, CI, and AI-assisted tooling#105
tonybjzhao wants to merge 26 commits into
ThalesGroup:masterfrom
tonybjzhao:AU_Thales-Against-The-Machine_2026June

Conversation

@tonybjzhao

Copy link
Copy Markdown

Summary

This PR modernizes Helm Spray as part of the “AI Against The Machine 2026 June” work.

It includes the six planned maintenance tasks plus additional AI-assisted competition tooling and validation work.

Main Changes

  • Replace helm fetch with helm pull and remove shell copy logic.
  • Move sub-chart weights to schema-safe spray.weights.<chart-or-alias>.
  • Improve enabled / condition handling.
  • Improve readiness handling for hook-only charts and StatefulSet OnDelete.
  • Modernize release builds with portable CGO_ENABLED=0 artifacts.
  • Add Helm 4 smoke and integration tests.
  • Fix Helm 4 legacy plugin argument handling.
  • Add CI updates for Go 1.26 and golangci-lint v2.
  • Add AI-assisted docs, skills, and web tooling used during the competition.

Related Upstream Issues

This work addresses or improves behavior related to:

Validation

Tested locally with:

scripts/helm4_integration_tests.sh
scripts/helm4_smoke_test.sh
go test ./...
go vet ./...
make dist

tonybjzhao and others added 26 commits June 25, 2026 14:19
…26June_TZ' into AU_Thales-Against-The-Machine_2026June
- 18 skills covering architecture, code quality, testing, safety, and workflow
- Skills: git-commit, go-api-design, go-architecture-review, go-code-review,
  go-coding-standards, go-concurrency-review, go-context, go-database,
  go-dependency-audit, go-design-patterns, go-error-handling, go-interface-design,
  go-modernize, go-observability, go-performance-review, go-security-audit,
  go-test-quality, go-test-table-driven
- skills-lock.json tracks installed skill versions and hashes
Phase 1: Bug Fixes (14 issues)
- Replace deprecated ioutil with os.MkdirTemp/os.CreateTemp
- Fix shell injection in Fetch() with os.ReadDir
- Add bounds checking after os.ReadDir
- Replace reflect.TypeOf with type switch
- Handle strconv.Atoi error properly
- Fix WithNumberedLines infinite loop on empty string
- Remove redundant == true/false comparisons
- Fix README typos

Phase 2: Wait Algorithm Fix (ThalesGroup#60, ThalesGroup#58)
- Deployments: check unavailableReplicas > 0
- StatefulSets: remove updatedReplicas check for OnDelete strategy

Phase 3: Helm 4 Migration
- Update go.mod: helm.sh/helm/v3 → helm.sh/helm/v4
- Update all imports for new package structure
- Handle chart.Charter interface from loader.Load()
- Use chart/common.Values instead of chartutil.Values

Phase 4: Web GUI
- New cmd/web.go command: helm spray web
- HTTP server with chart browser and spray execution
- WebSocket live log streaming
- Static HTML/CSS/JS frontend (dark theme)
- API: /api/charts, /api/chart, /api/releases, /api/spray, /ws

Phase 5: Unit Tests (39 test cases)
- pkg/util/util_test.go: Duration function
- internal/log/log_test.go: Info, WithNumberedLines, Error
- internal/values/values_test.go: mergeMaps
- internal/dependencies/dependencies_test.go: Get, tags
- internal/web/chart_scanner_test.go: parseWeights, computeExecutionOrder

Phase 6: Documentation + CI/CD
- GitHub Actions workflow: build, test, lint, cross-compile
- Expanded CONTRIBUTING.md
- Updated AGENTS.md with all changes
- Add Condition field to Dependency struct, populated from req.Condition
- Use dependency's Condition path instead of hardcoded <usedName>.enabled
- Fall back to <usedName>.enabled when Condition is empty (backward compat)
- Handle comma-delimited condition paths (use first path)
- Skip sub-chart with warning when condition resolves to false in values
- Warn at detail level for non-standard condition paths
- Update upgrade() signature to accept mergedValues parameter
- Add TestCondition with 5 test cases (standard, non-standard, empty, alias, comma)
- Update README and root.go help text
…26June' into AU_Thales-Against-The-Machine_2026June
Ran 'go mod tidy' to regenerate missing checksums for Helm v4,
gorilla/websocket, k8s.io, and other transitive dependencies.
- Add net/http import to chart_scanner.go (undefined: http)
- Remove unused os import from server.go
- Change web.go init() to exported AddWebCommand(rootCmd) function
  since upstream uses NewRootCmd() pattern instead of rootCmd var
- Call AddWebCommand(cmd) from root.go
- Fix test values to use spray.weights.<name> format (upstream convention)
- Use common.Values type in tests instead of map[string]interface{}
- Duration: use strings.Replace for h0m in middle (e.g. 1h0m30s -> 1h30s)
  instead of only checking suffix, which missed the middle case
- WithNumberedLines test: fix empty string expectation — bufio.Scanner
  on empty input produces no tokens, so no output is correct
go.mod was auto-upgraded to Go 1.26.0 by 'go mod tidy' because
helm.sh/helm/v4 v4.2.2 requires go >= 1.26.0. The CI matrix and
golangci-lint setup now use Go 1.26 to match.
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.

2 participants