feat: CGW strategy + plugin architecture + CI workflows#67
Merged
Conversation
Add a new `cgw` CLI strategy that downloads CLI binaries from the Red Hat content gateway (developers.redhat.com). This enables downloading release binaries without requiring an OpenShift cluster or a CLI server. Set CLI_STRATEGY=cgw and CGW_URL to the content gateway base URL (e.g. https://developers.redhat.com/content-gateway/file/cgw/RHTAS/1.4.0). Made-with: Cursor
f8a2ad5 to
61a199c
Compare
…cture Replace the monolithic switch-based PreferredSetupStrategy() in pkg/clients/clistrategy.go with a plugin registry pattern under pkg/strategy/. Each strategy (local, cli_server, cgw, openshift, container, git) is now a self-contained package with init() auto-registration, named business logic functions for testability, and standardized tests (TestRegistered, TestStrategy, TestStrategyError). Key changes: - pkg/strategy/strategy.go: Registry with Register(), Get(), Has() - Each strategy in its own sub-package with init() registration - Business logic extracted into named functions (not nested closures) - kubernetes.ConsoleCLIDownload() accepts controller.Reader for testability - container.go: extracted dockerAPI interface for mock testing - Shared test helpers in pkg/strategy/testutil/ - All tests use t.Context() (Go 1.24+), httptest mocks, no network calls - New env vars: CONTAINER_IMAGE, CONTAINER_PATH, GIT_URL, GIT_BRANCH, GIT_BUILD_DIR - go.mod bumped to go 1.24 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8e4e00a to
1ec3b5d
Compare
Replace the old validate.yml (lint-only) with two workflows: - ci.yml: lint (golangci-lint v2.8.0) + unit tests on every PR/push - e2e.yml: full E2E against a Kind cluster with RHTAS stack deployed via secure-sign-operator's kind-cluster action. Supports workflow_dispatch for cross-repo triggering with operator_image and operator_ref inputs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1ec3b5d to
300baca
Compare
bouskaJ
approved these changes
Apr 28, 2026
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
CGW_URLenv varpkg/strategy/withinit()auto-registration, named business logic functions, and a sharedstrategy.Register()/strategy.Get()/strategy.Has()registryTestRegistered,TestStrategy,TestStrategyErrorwith httptest mocks, fake k8s client (openshift), Docker API mock (container), and local git repo (git). Shared helpers inpkg/strategy/testutil/ci.yml(lint + unit tests on PR/push) ande2e.yml(full Kind + RHTAS deployment, cross-repo triggerable viaworkflow_dispatch)Strategy modules
localcli_serverCLI_SERVER_URLcgwCGW_URLopenshiftcontainerCONTAINER_IMAGE,CONTAINER_PATHgitGIT_URL,GIT_BRANCH,GIT_BUILD_DIRgo buildOther changes
go.modbumped togo 1.24(enablest.Context()in tests)kubernetes.ConsoleCLIDownload()acceptscontroller.Readerparam for testabilitypkg/clients/clistrategy.godeleted, replaced bypkg/clients/strategies.go(blank imports)Test plan
go test ./pkg/... -v -count=1— 22 unit tests passgo build ./...— full project buildsactionlint— both workflows passact push -j unit-test— CI workflow verified locally via act🤖 Generated with Claude Code