Skip to content
Open
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
92 changes: 92 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# CLAUDE.md — Agent Context for redhat-developer/helm

## Project overview

Red Hat's downstream build of [Helm](https://github.com/helm/helm). This is
not a fork — it is a rebuild with Red Hat's base image and FIPS compliance.
The upstream Helm source is vendored and patched per release branch. The main
branch tracks upstream Helm v4 development.

## Build commands

```bash
make build # Build the helm binary to bin/helm
make test # Run linter (golangci-lint) + unit tests
make test-unit # Unit tests only
make test-style # golangci-lint run ./... + license header check
make build-cross # Cross-compile for all supported platforms
make format # Run goimports
```

CI runs `make test-coverage` and `make build` via `.github/workflows/build-test.yml`.
Linting uses golangci-lint v2 (config in `.golangci.yml`).

### FIPS builds (release branches only)

Release branches (e.g. `release-3.21`) add FIPS 140 compliance:
- `go.mod` includes `godebug fips140=auto`
- Makefile sets `GOFIPS140 ?= certified` and prepends it to build targets

The `main` branch (Helm v4) does not currently use FIPS flags.

## Test commands

```bash
go test ./... # All unit tests
go test ./pkg/action/... # Single package
go test -run TestSpecificFunc ./pkg/cmd/ # Single test
make test-coverage # Unit tests with coverage report
make gen-test-golden # Regenerate golden files for cmd/action tests
```

Tests use the `testify` assertion library (`github.com/stretchr/testify`).

## Dependency management

Dependencies are managed with Go modules. The `main` branch does **not**
vendor dependencies (no `vendor/` directory). Release branches may vendor
via `go mod vendor`.

```bash
go mod tidy # Clean up go.mod/go.sum
go mod vendor # Vendor dependencies (release branches only)
```

When bumping dependencies, ensure `go.sum` checksums are consistent and
`go.mod` changes are minimal (only the intended dependency).

## Branch strategy

| Branch | Purpose |
|--------|---------|
| `main` | Default branch. Helm v4 development (unstable) |
| `release-X.Y` | Track upstream Helm releases for Red Hat rebuilds |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] internal consistency

The branch strategy table lists only main and release-X.Y, but dev-v3 is described in prose at line 69. CI configurations confirm dev-v3 is a first-class branch (build-test.yml, codeql-analysis.yml, dependabot.yml). An agent scanning the table as a quick reference would miss this branch.


PRs often target `release-X.Y` branches rather than `main`. When creating
a PR, check the issue for the target branch — it may specify a release
branch (e.g. "apply to release-3.21").

Helm v3 stable development continues on `dev-v3`. Bug fixes go to v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[low] scope-creep

Lines 69-70 introduce the dev-v3 branch, which was not listed in Issue #79's branch strategy requirements. The addition is factually accurate and useful for agents, but extends slightly beyond the explicit scope of the issue.

(`main`) first, then get backported to v3.

## Downstream integration

- **Jira tickets**: Referenced as `HELM-xxx` or `OCPTOOLS-xxx` in issues
and PR descriptions
- **OCP target versions**: PRs note the target OpenShift version
(e.g. `ocp-tools-4.22`)
- **Post-merge workflow**: After a PR merges, update `upstream_sources.yml`
in the midstream repo, then run check-patch and Brew builds
- **Scratch/Brew builds**: `check-patch` validates the build before the
full `build-pipeline` Brew build

## Review guidance for dependency bumps

When reviewing vendored dependency bumps:

1. Verify `go.sum` checksums are consistent with the declared version
2. Confirm vendored code matches the declared module version
3. Check that no unrelated source changes are included
4. Validate the CVE or security advisory justifying the bump
5. Ensure the Go directive and K8s API versions are unchanged unless
intentionally updated
Loading