Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
20684f2
ROSAENG-62084 | feat: map cluster_id wire field to NodePool metadata.…
gdbranco Aug 11, 2026
2e3654f
ROSAENG-62084 | fix: align e2e-sdk BASE_URL to E2E_BASE_URL convention
gdbranco Aug 11, 2026
d200da5
ROSAENG-62084 | refactor: rename wire→bridge throughout clientset and…
gdbranco Aug 11, 2026
366350b
ROSAENG-62084 | refactor: rename WIRE_ Makefile vars to BRIDGE_, upda…
gdbranco Aug 11, 2026
63c8de5
ROSAENG-62084 | feat: add generate-all and verify-all convenience tar…
gdbranco Aug 11, 2026
bb4657c
ROSAENG-62084 | chore: regenerate all codegen artifacts after bridge …
gdbranco Aug 11, 2026
3d89cb5
ROSAENG-62084 | fix: remove cluster_id from nodepool creation log
gdbranco Aug 11, 2026
acccfd5
ROSAENG-62084 | fix: remove stale ControlPlaneUpgradePolicy conversio…
gdbranco Aug 11, 2026
7375e7b
ROSAENG-62084 | fix: address security and doc findings from review
gdbranco Aug 11, 2026
15df5ac
ROSAENG-62084 | chore: fix gofmt issues in clientset and bridge-gen
gdbranco Aug 11, 2026
68f2183
propagate upstream optional/required markers through passthrough-gen
gdbranco Aug 11, 2026
98d4025
rename generate/verify to deepcopy/mod, promote generate-all/verify-a…
gdbranco Aug 11, 2026
3cdff54
remove autoNode, fips, sshKey, osImageStream from required in openapi…
gdbranco Aug 11, 2026
1d2b318
fix lint: replace deprecated parser.ParseDir, drop always-nil error r…
gdbranco Aug 11, 2026
654041a
fix bridge-gen template: correct import order and preserve blank line…
gdbranco Aug 11, 2026
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
13 changes: 8 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Three components:
make build # All components
make test # All unit tests
make lint # golangci-lint v2 across all modules
make verify # go.mod tidiness
make verify-mod # go.mod tidiness
make deps # Download and tidy all modules

make build-api # Platform API
Expand All @@ -28,16 +28,19 @@ make test-operator # Operator unit tests
make test-hyperfleet-db # FleetDB unit tests
make test-operator-int # Operator integration tests (Postgres + DynamoDB)

make manifests # Generate CRDs (controller-gen)
make generate # Generate deepcopy
make generate # Run all code generators (passthrough, deepcopy, registry, CRDs, conversion, clientset, openapi)
make verify # Fail if any generated output is out of date

make codegen # Full codegen pipeline (openapi, passthrough, conversion)
make manifests # Generate CRDs (controller-gen + CEL strip)
make generate-deepcopy # Generate deepcopy methods only
make codegen # Full codegen pipeline (passthrough + registry + verify compile)
make generate-clientset # Regenerate typed clientset from CRD types
make generate-openapi # Regenerate OpenAPI spec from CRD types

make verify-codegen # Verify codegen output is up to date
make verify-clientset # Verify clientset matches committed files
make verify-openapi # Verify OpenAPI spec is up to date
make verify-mod # Verify go.mod tidiness

make test-unit # All unit tests (api, operator, codegen, clientset)
make test-integration # Integration tests (fleetdb, operator)
Expand All @@ -54,7 +57,7 @@ clientset/go.mod ← generated typed K8s client for Hyper
hyperfleet-operator/go.mod ← requires: fleetdb, api
platform-api/go.mod ← requires: fleetdb, api
hack/api-codegen/go.mod ← codegen tools (openapi-gen, crd-variants, conversion-gen)
hack/clientset/cmd/wire-gen/go.mod ← wire generation for clientset
hack/clientset/cmd/bridge-gen/go.mod ← bridge and platform generation for clientset
hack/tools/go.mod ← dev tooling dependencies
```

Expand Down
85 changes: 49 additions & 36 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
coverage-api-codegen \
test-e2e test-e2e-api test-e2e-cli test-e2e-platform-monitoring test-e2e-zoa test-e2e-authz test-e2e-sdk \
e2e-authz-infra-up e2e-authz-infra-down e2e-init-db \
fmt vet verify deps mod-tidy \
manifests generate generate-clientset verify-clientset setup-envtest \
fmt vet verify verify-mod deps mod-tidy \
manifests generate generate-deepcopy generate-clientset verify-clientset setup-envtest \
codegen-passthrough codegen-registry codegen-verify codegen verify-codegen \
codegen-conversion verify-conversion \
generate-openapi verify-openapi swagger-ui \
Expand Down Expand Up @@ -37,7 +37,7 @@ TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR)/golangci-lint)
CONTROLLER_GEN := $(abspath $(TOOLS_BIN_DIR)/controller-gen)
CLIENT_GEN := $(abspath $(TOOLS_BIN_DIR)/client-gen)
WIRE_GEN := $(abspath $(TOOLS_BIN_DIR)/wire-gen)
BRIDGE_GEN := $(abspath $(TOOLS_BIN_DIR)/bridge-gen)
SETUP_ENVTEST := $(abspath $(TOOLS_BIN_DIR)/setup-envtest)
GINKGO := $(abspath $(TOOLS_BIN_DIR)/ginkgo)

Expand All @@ -48,11 +48,11 @@ SDK_INPUT ?= v1alpha1/public
SDK_CLIENTSET ?= generated
SDK_OUTPUT_DIR ?= $(abspath clientset)
SDK_OUTPUT_PKG ?= $(SDK_MODULE)/clientset
WIRE_INPUT_DIR ?= $(abspath api/v1alpha1/public)
WIRE_OUTPUT_DIR ?= $(abspath clientset/transport)
WIRE_OUTPUT_PKG ?= transport
WRAPPERS_OUTPUT_DIR ?= $(abspath clientset/wrappers)
WRAPPERS_OUTPUT_PKG ?= wrappers
BRIDGE_INPUT_DIR ?= $(abspath api/v1alpha1/public)
BRIDGE_OUTPUT_DIR ?= $(abspath clientset/transport)
BRIDGE_OUTPUT_PKG ?= transport
PLATFORM_OUTPUT_DIR ?= $(abspath clientset/platform)
PLATFORM_OUTPUT_PKG ?= platform
TYPED_PKG_IMPORT ?= $(SDK_MODULE)/clientset/generated/typed/v1alpha1/public
API_PKG_IMPORT ?= $(SDK_MODULE)/api/v1alpha1/public
SDK_HEADER_FILE ?= $(abspath hack/clientset/license-boilerplate.go.txt)
Expand All @@ -74,8 +74,8 @@ $(SETUP_ENVTEST): $(TOOLS_DIR)/go.mod
$(CLIENT_GEN): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go build -tags=tools -o $(abspath $(TOOLS_BIN_DIR))/client-gen k8s.io/code-generator/cmd/client-gen

$(WIRE_GEN): hack/clientset/cmd/wire-gen/main.go
cd hack/clientset/cmd/wire-gen && go build -o $(WIRE_GEN) .
$(BRIDGE_GEN): hack/clientset/cmd/bridge-gen/main.go
cd hack/clientset/cmd/bridge-gen && go build -o $(BRIDGE_GEN) .

$(GINKGO): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR); go build -tags=tools -o $(abspath $(TOOLS_BIN_DIR))/ginkgo github.com/onsi/ginkgo/v2/ginkgo
Expand All @@ -95,7 +95,7 @@ help:
@echo "Test:"
@echo " test All tests (unit + integration)"
@echo " test-unit Unit tests: API + operator + codegen + clientset (no external services)"
@echo " test-clientset Clientset unit tests (transport, wrappers)"
@echo " test-clientset Clientset unit tests (transport, platform)"
@echo " test-integration Integration tests: FleetDB + operator (podman)"
@echo " test-e2e-authz E2E authz (starts local infra)"
@echo " test-e2e-api E2E API"
Expand All @@ -110,13 +110,15 @@ help:
@echo " lint golangci-lint on all modules"
@echo " fmt Format Go source"
@echo " vet go vet on all modules"
@echo " verify Verify go.mod tidiness"
@echo " verify-mod Verify go.mod tidiness"
@echo ""
@echo "Code Generation:"
@echo " manifests Generate CRD manifests"
@echo " generate Generate deepcopy methods"
@echo " generate-clientset Generate typed client SDK from CRD types"
@echo " verify-clientset Fail if generated clientset is out of date"
@echo " manifests Generate CRD manifests (controller-gen + CEL strip)"
@echo " generate Run all code generators in one pass"
@echo " generate-deepcopy Generate deepcopy methods only"
@echo " verify Fail if any generated output is out of date"
@echo " generate-clientset Generate typed client SDK from CRD types"
@echo " verify-clientset Fail if generated clientset is out of date"
@echo " codegen-passthrough Generate passthrough types from HyperShift"
@echo " codegen-registry Generate field metadata registry from markers"
@echo " codegen-verify Verify codegen outputs compile"
Expand Down Expand Up @@ -222,7 +224,7 @@ test-e2e-zoa: $(GINKGO)
--output-dir=$(TEST_OUTPUT_DIR) ./test/e2e-zoa

test-e2e-sdk: $(GINKGO)
BASE_URL="$${BASE_URL}" \
E2E_BASE_URL="$${BASE_URL}" \
E2E_ACCOUNT_ID="$${E2E_ACCOUNT_ID}" \
E2E_CUSTOMER_ACCOUNT_ID="$${E2E_CUSTOMER_ACCOUNT_ID}" \
CUSTOMER_AWS_PROFILE="$${CUSTOMER_AWS_PROFILE}" \
Expand Down Expand Up @@ -257,23 +259,23 @@ fmt:
cd platform-api && go fmt ./...
cd hack/api-codegen && go fmt ./...
cd clientset && go fmt ./...
cd hack/clientset/cmd/wire-gen && go fmt ./...
cd hack/clientset/cmd/bridge-gen && go fmt ./...

vet:
cd hyperfleet-db && go vet ./...
cd hyperfleet-operator && go vet ./...
cd platform-api && go vet ./...
cd hack/api-codegen && go vet ./...
cd clientset && go vet ./...
cd hack/clientset/cmd/wire-gen && go vet ./...
cd hack/clientset/cmd/bridge-gen && go vet ./...

lint: $(GOLANGCI_LINT)
cd hyperfleet-db && $(GOLANGCI_LINT) run --config ../.golangci.yml --timeout 5m ./...
cd hyperfleet-operator && $(GOLANGCI_LINT) run --config ../.golangci.yml --timeout 5m ./...
cd platform-api && $(GOLANGCI_LINT) run --config ../.golangci.yml --timeout 5m ./...
cd hack/api-codegen && $(GOLANGCI_LINT) run --config ../../.golangci.yml --timeout 5m ./...
cd clientset && $(GOLANGCI_LINT) run --config ../.golangci.yml --timeout 5m ./...
cd hack/clientset/cmd/wire-gen && $(GOLANGCI_LINT) run --config $(abspath .golangci.yml) --timeout 5m ./...
cd hack/clientset/cmd/bridge-gen && $(GOLANGCI_LINT) run --config $(abspath .golangci.yml) --timeout 5m ./...

# All Go modules in the repo (used by verify and MintMaker/Renovate post-upgrade).
override MOD_TIDY_DIRS := hyperfleet-db api hyperfleet-operator platform-api test clientset hack/tools hack/api-codegen
Expand All @@ -285,7 +287,7 @@ mod-tidy:
(cd "$$d" && go mod tidy); \
done

verify: mod-tidy
verify-mod: mod-tidy
git diff --exit-code $(MOD_TIDY_FILES)

deps:
Expand All @@ -295,31 +297,35 @@ deps:

# ── Code Generation ──────────────────────────────────────────────────────

manifests: $(CONTROLLER_GEN)
CRD_VARIANTS := $(abspath bin/crd-variants)
CRD_BASES_DIR := hyperfleet-operator/config/crd/bases

manifests: $(CONTROLLER_GEN) build-api-codegen
cd hyperfleet-operator && $(CONTROLLER_GEN) crd:allowDangerousTypes=true paths="../api/v1alpha1" output:crd:dir=config/crd/bases
$(CRD_VARIANTS) --strip-passthrough-cel --api-dir api/v1alpha1 --crd-dir $(CRD_BASES_DIR)

generate: $(CONTROLLER_GEN)
generate-deepcopy: $(CONTROLLER_GEN)
$(CONTROLLER_GEN) object paths="./api/..."

generate-clientset: $(CLIENT_GEN) $(WIRE_GEN)
generate-clientset: codegen-conversion $(CLIENT_GEN) $(BRIDGE_GEN)
cd api && $(CLIENT_GEN) \
--input-base "$(SDK_API_PKG)" \
--input "$(SDK_INPUT)" \
--clientset-name "$(SDK_CLIENTSET)" \
--output-dir "$(SDK_OUTPUT_DIR)" \
--output-pkg "$(SDK_OUTPUT_PKG)" \
--go-header-file "$(SDK_HEADER_FILE)"
$(WIRE_GEN) \
--mode mappings \
--input-dir "$(WIRE_INPUT_DIR)" \
--output-dir "$(WIRE_OUTPUT_DIR)" \
--output-pkg "$(WIRE_OUTPUT_PKG)" \
$(BRIDGE_GEN) \
--mode bridge \
--input-dir "$(BRIDGE_INPUT_DIR)" \
--output-dir "$(BRIDGE_OUTPUT_DIR)" \
--output-pkg "$(BRIDGE_OUTPUT_PKG)" \
--go-header-file "$(SDK_HEADER_FILE)"
$(WIRE_GEN) \
--mode wrappers \
--input-dir "$(WIRE_INPUT_DIR)" \
--output-dir "$(WRAPPERS_OUTPUT_DIR)" \
--output-pkg "$(WRAPPERS_OUTPUT_PKG)" \
$(BRIDGE_GEN) \
--mode platform \
--input-dir "$(BRIDGE_INPUT_DIR)" \
--output-dir "$(PLATFORM_OUTPUT_DIR)" \
--output-pkg "$(PLATFORM_OUTPUT_PKG)" \
--typed-pkg-import "$(TYPED_PKG_IMPORT)" \
--typed-client-prefix "V1alpha1Public" \
--api-pkg-import "$(API_PKG_IMPORT)" \
Expand All @@ -335,7 +341,7 @@ codegen-passthrough: build-api-codegen
-output-dir v1alpha1 \
-package v1alpha1

codegen-registry: generate build-api-codegen
codegen-registry: codegen-passthrough generate-deepcopy build-api-codegen
./bin/marker-scanner \
-input-dirs api/v1alpha1 \
-output-file hack/api-codegen/pkg/registry/field_metadata.go \
Expand All @@ -351,6 +357,13 @@ verify-codegen: codegen
git diff --exit-code api/v1alpha1/zz_generated.deepcopy.go
git diff --exit-code hack/api-codegen/pkg/registry/

# generate runs all code generators in dependency order.
# codegen-registry already depends on codegen-passthrough and generate-deepcopy,
# so those are transitively covered; they are listed explicitly here for clarity.
generate: codegen-registry manifests codegen-conversion generate-clientset generate-openapi

verify: verify-codegen verify-conversion verify-clientset verify-openapi verify-mod

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍


CONVERSION_OUTPUT_DIR ?= platform-api/pkg/conversion/v1alpha1
CONVERSION_OUTPUT_PKG ?= github.com/openshift-online/rosa-hyperfleet-api/platform-api/pkg/conversion
CONVERSION_CRD_PKG ?= github.com/openshift-online/rosa-hyperfleet-api/api/v1alpha1
Expand All @@ -372,7 +385,7 @@ verify-conversion: codegen-conversion
cd platform-api && go build ./...
git diff --exit-code $(CONVERSION_REST_DIR)/ $(CONVERSION_OUTPUT_DIR)/ platform-api/pkg/conversion/types.go

generate-openapi: codegen-registry
generate-openapi: codegen-conversion
cd hack/api-codegen && go build -o ../../bin/openapi-gen ./cmd/openapi-gen
./bin/openapi-gen \
-input-dirs ./api/v1alpha1 \
Expand Down
12 changes: 6 additions & 6 deletions api/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ type PlacementReference struct {

// +genclient
// +genclient:nonNamespaced
// +wire:field=name,meta=name
// +wire:field=id,meta=uid
// +wire:field=resource_version,meta=resourceVersion
// +wire:field=generation,meta=generation
// +wire:watch=disabled
// +wire:wait
// +bridge:field=name,meta=name
// +bridge:field=id,meta=uid
// +bridge:field=resource_version,meta=resourceVersion
// +bridge:field=generation,meta=generation
// +bridge:watch=disabled
// +bridge:wait
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Namespaced,shortName=hfc
Expand Down
13 changes: 7 additions & 6 deletions api/v1alpha1/nodepool_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ type NodePoolStatus struct {
}

// +genclient
// +wire:field=name,meta=name
// +wire:field=id,meta=uid
// +wire:field=resource_version,meta=resourceVersion
// +wire:field=generation,meta=generation
// +wire:watch=disabled
// +wire:wait
// +bridge:field=cluster_id,meta=namespace
// +bridge:field=name,meta=name
// +bridge:field=id,meta=uid
// +bridge:field=resource_version,meta=resourceVersion
// +bridge:field=generation,meta=generation
// +bridge:watch=disabled
// +bridge:wait
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Namespaced,shortName=hfnp
Expand Down
12 changes: 6 additions & 6 deletions api/v1alpha1/public/cluster_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions api/v1alpha1/public/nodepool_types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading