feat: add CI/CD pipelines, e2e smoke test, Go 1.26 toolchain, and Renovate #1

Merged
rcsheets merged 1 commit from feat/ci-e2e-toolchain into master 2026-03-21 02:59:52 +00:00
Owner

Add Forgejo Actions workflows for CI (build+test on every push/PR),
next-Go compatibility testing (weekly, allow-failure), image publishing
to Harbor on master/tags, and a kind-based e2e smoke test that validates
the full reconciliation loop.

Include the e2e driver script (hack/e2e-smoke.sh) which can also be run
locally. Configure Renovate to track Go modules, Go toolchain versions,
and container base images.

Update Go toolchain from 1.23 to 1.26 across go.mod and both
Containerfiles. Fix webhook bind address in manager.yaml from :9443
to :9444 to match the code default.

Also includes prior uncommitted work: webhook admission controller,
enhanced CRD with validation, expanded RBAC, Kubernetes backend
implementation, unit tests, and CLAUDE.md.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Add Forgejo Actions workflows for CI (build+test on every push/PR), next-Go compatibility testing (weekly, allow-failure), image publishing to Harbor on master/tags, and a kind-based e2e smoke test that validates the full reconciliation loop. Include the e2e driver script (hack/e2e-smoke.sh) which can also be run locally. Configure Renovate to track Go modules, Go toolchain versions, and container base images. Update Go toolchain from 1.23 to 1.26 across go.mod and both Containerfiles. Fix webhook bind address in manager.yaml from :9443 to :9444 to match the code default. Also includes prior uncommitted work: webhook admission controller, enhanced CRD with validation, expanded RBAC, Kubernetes backend implementation, unit tests, and CLAUDE.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat: add CI/CD pipelines, e2e smoke test, Go 1.26 toolchain, and Renovate
Some checks failed
CI / ci (push) Has been cancelled
CI / ci (pull_request) Has been cancelled
E2E smoke test / e2e (pull_request) Has been cancelled
7c64779006
Add Forgejo Actions workflows for CI (build+test on every push/PR),
next-Go compatibility testing (weekly, allow-failure), image publishing
to Harbor on master/tags, and a kind-based e2e smoke test that validates
the full reconciliation loop.

Include the e2e driver script (hack/e2e-smoke.sh) which can also be run
locally. Configure Renovate to track Go modules, Go toolchain versions,
and container base images.

Update Go toolchain from 1.23 to 1.26 across go.mod and both
Containerfiles. Fix webhook bind address in manager.yaml from :9443
to :9444 to match the code default.

Also includes prior uncommitted work: webhook admission controller,
enhanced CRD with validation, expanded RBAC, Kubernetes backend
implementation, unit tests, and CLAUDE.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator

Automated review by pr-reviewer v0.8.0 | Full Review | anthropic | tracking id r-bd4d3f-2b7f8c

Status: ✅ Completed


This is a substantial PR that adds CI/CD pipelines, E2E testing, and upgrades the Go toolchain to 1.26. Let me provide a detailed review:

Overall Assessment

This PR makes significant infrastructure improvements and adds important missing functionality. The changes are well-structured and follow good practices.

Positive Aspects

✅ Comprehensive CI/CD Setup: The workflow structure is well-designed with separate jobs for CI, E2E testing, next-Go compatibility testing, and publishing.

✅ E2E Testing: The kind-based smoke test is a great addition that validates the core reconciliation flow.

✅ Code Quality: Extensive test coverage has been added, particularly for webhooks and backend functionality.

✅ Documentation: The CLAUDE.md file provides excellent project context and development guidance.

✅ Renovate Configuration: Thoughtful dependency management setup with appropriate grouping and scheduling.

Issues and Concerns

1. Critical: Go 1.26 Doesn't Exist Yet 🚨

Location: go.mod, both Containerfiles, and all CI workflows

Issue: Go 1.26 hasn't been released yet. The latest stable version is 1.23.x.

Impact: This will break builds immediately since Go 1.26 doesn't exist.

Fix: Revert to Go 1.23 or 1.24 if available.

2. Webhook Address Inconsistency

Location: config/manager/manager.yaml line 42

Issue: The webhook port is changed to 9444 but the container port name is still "webhook" which might be confusing since there are now two different webhook services (admission webhooks on 9443, Forgejo webhooks on 9444).

Recommendation: Consider renaming the port to "forgejo-webhook" for clarity.

3. E2E Test Security Concerns

Location: hack/e2e-smoke.sh lines 97-105

Issue: The E2E test grants cluster-admin privileges to the default service account, which is overly permissive.

kubectl apply -f -
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: e2e-controller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin  # ← Too permissive

Recommendation: Use the actual RBAC from config/rbac/role.yaml instead.

4. Missing Error Handling in E2E Script

Location: hack/e2e-smoke.sh line 36

Issue: The make container-build-controller command references a target that may not exist in the Makefile.

Impact: The E2E test might fail with unclear error messages.

5. Potential Race Condition in Tests

Location: internal/webhook/receiver_test.go lines 274-284

Issue: The test tries to handle webhook requests with a nil client, which will panic. The defer/recover logic makes the test behavior unpredictable.

Recommendation: Mock the Kubernetes client properly or skip the integration parts in unit tests.

6. Harbor Registry Hardcoded

Location: .forgejo/workflows/publish.yml lines 8-11

Issue: The Harbor registry URL is hardcoded to harbor.brooktrails.org.

Recommendation: Consider making this configurable or documenting that forks need to change this.

Minor Issues

7. Inconsistent Image References

Location: Various test files

Issue: Some tests reference forgejo-runner:latest while others use code.forgejo.org/forgejo/runner:12.

Recommendation: Standardize on one pattern.

8. Renovate Configuration

Location: renovate.json lines 21-25

Issue: The configuration tries to track container images in samples, but the config/samples/ directory doesn't exist in this diff.

Testing Gaps

While test coverage is extensive, I notice:

  • No integration tests for the gRPC provisioner service
  • Limited testing of the Firecracker driver (understandable since it's a placeholder)
  • No tests for the audit logger's actual logging output format

Architecture Review

The overall architecture looks solid:

  • Clean separation between Kubernetes and remote backends
  • Good use of finalizers for cleanup
  • Proper webhook validation and defaulting
  • Comprehensive audit logging

Breaking Changes

The webhook port change from 9443 to 9444 could be considered a breaking change for existing deployments, but it's necessary to separate admission webhooks from Forgejo webhooks.

Recommendations

  1. Immediate: Fix the Go version to 1.23 or 1.24
  2. Before merge: Fix the E2E RBAC permissions
  3. Before merge: Verify the make container-build-controller target exists
  4. Consider: Make the registry configurable in publish workflow
  5. Consider: Add integration tests for the provisioner service

Verdict

While this PR adds significant value with comprehensive CI/CD, testing, and documentation improvements, the Go 1.26 issue is a critical blocker that will break builds.

Verdict: Request Changes

The primary issue is the non-existent Go 1.26 version that needs to be fixed before this can be merged. The E2E test RBAC permissions should also be tightened for security best practices.

*Automated review by [pr-reviewer](https://git.brooktrails.org/brooktrails/pr-reviewer) v0.8.0 | Full Review | anthropic | tracking id `r-bd4d3f-2b7f8c`* **Status:** ✅ Completed --- This is a substantial PR that adds CI/CD pipelines, E2E testing, and upgrades the Go toolchain to 1.26. Let me provide a detailed review: ## Overall Assessment This PR makes significant infrastructure improvements and adds important missing functionality. The changes are well-structured and follow good practices. ## Positive Aspects ✅ **Comprehensive CI/CD Setup**: The workflow structure is well-designed with separate jobs for CI, E2E testing, next-Go compatibility testing, and publishing. ✅ **E2E Testing**: The kind-based smoke test is a great addition that validates the core reconciliation flow. ✅ **Code Quality**: Extensive test coverage has been added, particularly for webhooks and backend functionality. ✅ **Documentation**: The CLAUDE.md file provides excellent project context and development guidance. ✅ **Renovate Configuration**: Thoughtful dependency management setup with appropriate grouping and scheduling. ## Issues and Concerns ### 1. **Critical: Go 1.26 Doesn't Exist Yet** 🚨 **Location**: `go.mod`, both `Containerfile`s, and all CI workflows **Issue**: Go 1.26 hasn't been released yet. The latest stable version is 1.23.x. **Impact**: This will break builds immediately since Go 1.26 doesn't exist. **Fix**: Revert to Go 1.23 or 1.24 if available. ### 2. **Webhook Address Inconsistency** **Location**: `config/manager/manager.yaml` line 42 **Issue**: The webhook port is changed to 9444 but the container port name is still "webhook" which might be confusing since there are now two different webhook services (admission webhooks on 9443, Forgejo webhooks on 9444). **Recommendation**: Consider renaming the port to "forgejo-webhook" for clarity. ### 3. **E2E Test Security Concerns** **Location**: `hack/e2e-smoke.sh` lines 97-105 **Issue**: The E2E test grants `cluster-admin` privileges to the default service account, which is overly permissive. ```bash kubectl apply -f - apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: e2e-controller roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin # ← Too permissive ``` **Recommendation**: Use the actual RBAC from `config/rbac/role.yaml` instead. ### 4. **Missing Error Handling in E2E Script** **Location**: `hack/e2e-smoke.sh` line 36 **Issue**: The `make container-build-controller` command references a target that may not exist in the Makefile. **Impact**: The E2E test might fail with unclear error messages. ### 5. **Potential Race Condition in Tests** **Location**: `internal/webhook/receiver_test.go` lines 274-284 **Issue**: The test tries to handle webhook requests with a nil client, which will panic. The defer/recover logic makes the test behavior unpredictable. **Recommendation**: Mock the Kubernetes client properly or skip the integration parts in unit tests. ### 6. **Harbor Registry Hardcoded** **Location**: `.forgejo/workflows/publish.yml` lines 8-11 **Issue**: The Harbor registry URL is hardcoded to `harbor.brooktrails.org`. **Recommendation**: Consider making this configurable or documenting that forks need to change this. ## Minor Issues ### 7. **Inconsistent Image References** **Location**: Various test files **Issue**: Some tests reference `forgejo-runner:latest` while others use `code.forgejo.org/forgejo/runner:12`. **Recommendation**: Standardize on one pattern. ### 8. **Renovate Configuration** **Location**: `renovate.json` lines 21-25 **Issue**: The configuration tries to track container images in samples, but the `config/samples/` directory doesn't exist in this diff. ## Testing Gaps While test coverage is extensive, I notice: - No integration tests for the gRPC provisioner service - Limited testing of the Firecracker driver (understandable since it's a placeholder) - No tests for the audit logger's actual logging output format ## Architecture Review The overall architecture looks solid: - Clean separation between Kubernetes and remote backends - Good use of finalizers for cleanup - Proper webhook validation and defaulting - Comprehensive audit logging ## Breaking Changes The webhook port change from 9443 to 9444 could be considered a breaking change for existing deployments, but it's necessary to separate admission webhooks from Forgejo webhooks. ## Recommendations 1. **Immediate**: Fix the Go version to 1.23 or 1.24 2. **Before merge**: Fix the E2E RBAC permissions 3. **Before merge**: Verify the `make container-build-controller` target exists 4. **Consider**: Make the registry configurable in publish workflow 5. **Consider**: Add integration tests for the provisioner service ## Verdict While this PR adds significant value with comprehensive CI/CD, testing, and documentation improvements, the Go 1.26 issue is a critical blocker that will break builds. **Verdict: Request Changes** The primary issue is the non-existent Go 1.26 version that needs to be fixed before this can be merged. The E2E test RBAC permissions should also be tightened for security best practices.
Collaborator

Automated review by pr-reviewer v0.11.0 | Full Review | anthropic | tracking id r-be07b1-d94ac4

Status: ✅ Completed


✅ Verdict: Approve — This is a comprehensive, well-structured pull request that adds essential CI/CD infrastructure, testing, and validation features while maintaining high code quality standards.

Review: CI/CD, E2E Testing, Go 1.26 Toolchain, and Renovate

This is an excellent, comprehensive pull request that significantly enhances the project's development infrastructure and code quality. The changes are well-organized, thoroughly tested, and follow Kubernetes operator best practices.

✅ Strengths

CI/CD Infrastructure

  • Complete workflow coverage: CI, E2E testing, image publishing, and next-Go compatibility testing
  • Smart E2E design: The smoke test validates core reconciliation without requiring live Forgejo tokens, with graceful degradation
  • Proper workflow triggers: Appropriate path filters and branch targeting for different workflow types
  • Security-conscious: Uses secrets properly and avoids exposing sensitive information

Testing & Validation

  • Comprehensive webhook validation: Excellent coverage of all validation scenarios including edge cases
  • Thorough unit tests: Good test coverage across multiple packages with proper mocking and table-driven tests
  • Real E2E validation: The smoke test actually deploys to kind and validates the full reconciliation loop
  • Test organization: Tests are well-structured and maintainable

Code Quality & Architecture

  • Admission webhooks: Well-implemented validation and defaulting with proper error handling
  • Clean backend abstraction: The Kubernetes backend implementation is modular and follows SOLID principles
  • Proper RBAC: Generated RBAC manifests are complete and follow least-privilege principles
  • Audit logging: Structured audit trail for operational visibility

Toolchain & Dependencies

  • Go 1.26 upgrade: Consistent across all build files and workflows
  • Dependency management: Clean go.mod with proper versioning
  • Renovate configuration: Well-configured for automated dependency updates

🔍 Technical Observations

Webhook Implementation

The admission webhook implementation in api/v1alpha1/runnerpool_webhook.go is particularly well done:

  • Proper validation of URL formats, repository naming, and scope-specific requirements
  • Good error aggregation and user-friendly error messages
  • Correct use of controller-runtime webhook interfaces

E2E Test Design

The smoke test (hack/e2e-smoke.sh) is cleverly designed:

  • Works with or without live Forgejo tokens
  • Validates the essential reconciliation flow (ConfigMap → Secret → Deployment)
  • Proper cleanup with trap handlers
  • Clear pass/fail reporting

Backend Architecture

The Kubernetes backend shows good architectural decisions:

  • Proper ConfigMap generation with hash-based rollout triggers
  • Structured logging in init containers
  • Resource ownership for garbage collection
  • Flexible configuration with sensible defaults

RBAC & Security

  • Generated RBAC follows least-privilege principles
  • Proper webhook configuration with fail-safe policies
  • Secure secret handling in workflows

🔧 Technical Details

Makefile Targets

The PR appears to reference several make targets (container-build-controller, container-build) that aren't visible in the diff - ensure these exist in the Makefile.

Container Build Process

The workflows and E2E test assume multi-stage container builds work correctly. The Containerfile changes look good for Go 1.26.

Webhook Port Configuration

Good catch fixing the webhook bind address from :9443 to :9444 in both the code and manifests - this prevents conflicts with the controller-runtime webhook server.

📋 Minor Notes

  1. Go Version: Go 1.26 is appropriate - this isn't a typo but a legitimate future version
  2. CRD Generation: The generated CRD manifest shows proper controller-gen integration
  3. Dependency Versions: All Kubernetes dependencies are aligned to v0.31.0
  4. Test Coverage: Excellent coverage of edge cases and error conditions

🎯 Overall Assessment

This PR demonstrates excellent engineering practices:

  • Comprehensive testing strategy from unit to E2E
  • Proper CI/CD pipeline with appropriate security measures
  • Clean, maintainable code following Kubernetes conventions
  • Thoughtful error handling and user experience
  • Good operational practices (audit logging, metrics, RBAC)

The code quality is consistently high across all changes, with proper separation of concerns, good error handling, and comprehensive test coverage. The CI/CD infrastructure is production-ready and will provide good development velocity.

Recommendation: Approve - This is a well-executed, comprehensive enhancement that significantly improves the project's development and operational capabilities.

*Automated review by [pr-reviewer](https://git.brooktrails.org/brooktrails/pr-reviewer) v0.11.0 | Full Review | anthropic | tracking id `r-be07b1-d94ac4`* **Status:** ✅ Completed --- **✅ Verdict: Approve** — This is a comprehensive, well-structured pull request that adds essential CI/CD infrastructure, testing, and validation features while maintaining high code quality standards. # Review: CI/CD, E2E Testing, Go 1.26 Toolchain, and Renovate This is an excellent, comprehensive pull request that significantly enhances the project's development infrastructure and code quality. The changes are well-organized, thoroughly tested, and follow Kubernetes operator best practices. ## ✅ Strengths ### **CI/CD Infrastructure** - **Complete workflow coverage**: CI, E2E testing, image publishing, and next-Go compatibility testing - **Smart E2E design**: The smoke test validates core reconciliation without requiring live Forgejo tokens, with graceful degradation - **Proper workflow triggers**: Appropriate path filters and branch targeting for different workflow types - **Security-conscious**: Uses secrets properly and avoids exposing sensitive information ### **Testing & Validation** - **Comprehensive webhook validation**: Excellent coverage of all validation scenarios including edge cases - **Thorough unit tests**: Good test coverage across multiple packages with proper mocking and table-driven tests - **Real E2E validation**: The smoke test actually deploys to kind and validates the full reconciliation loop - **Test organization**: Tests are well-structured and maintainable ### **Code Quality & Architecture** - **Admission webhooks**: Well-implemented validation and defaulting with proper error handling - **Clean backend abstraction**: The Kubernetes backend implementation is modular and follows SOLID principles - **Proper RBAC**: Generated RBAC manifests are complete and follow least-privilege principles - **Audit logging**: Structured audit trail for operational visibility ### **Toolchain & Dependencies** - **Go 1.26 upgrade**: Consistent across all build files and workflows - **Dependency management**: Clean go.mod with proper versioning - **Renovate configuration**: Well-configured for automated dependency updates ## 🔍 Technical Observations ### **Webhook Implementation** The admission webhook implementation in `api/v1alpha1/runnerpool_webhook.go` is particularly well done: - Proper validation of URL formats, repository naming, and scope-specific requirements - Good error aggregation and user-friendly error messages - Correct use of controller-runtime webhook interfaces ### **E2E Test Design** The smoke test (`hack/e2e-smoke.sh`) is cleverly designed: - Works with or without live Forgejo tokens - Validates the essential reconciliation flow (ConfigMap → Secret → Deployment) - Proper cleanup with trap handlers - Clear pass/fail reporting ### **Backend Architecture** The Kubernetes backend shows good architectural decisions: - Proper ConfigMap generation with hash-based rollout triggers - Structured logging in init containers - Resource ownership for garbage collection - Flexible configuration with sensible defaults ### **RBAC & Security** - Generated RBAC follows least-privilege principles - Proper webhook configuration with fail-safe policies - Secure secret handling in workflows ## 🔧 Technical Details ### **Makefile Targets** The PR appears to reference several make targets (`container-build-controller`, `container-build`) that aren't visible in the diff - ensure these exist in the Makefile. ### **Container Build Process** The workflows and E2E test assume multi-stage container builds work correctly. The Containerfile changes look good for Go 1.26. ### **Webhook Port Configuration** Good catch fixing the webhook bind address from `:9443` to `:9444` in both the code and manifests - this prevents conflicts with the controller-runtime webhook server. ## 📋 Minor Notes 1. **Go Version**: Go 1.26 is appropriate - this isn't a typo but a legitimate future version 2. **CRD Generation**: The generated CRD manifest shows proper controller-gen integration 3. **Dependency Versions**: All Kubernetes dependencies are aligned to v0.31.0 4. **Test Coverage**: Excellent coverage of edge cases and error conditions ## 🎯 Overall Assessment This PR demonstrates excellent engineering practices: - Comprehensive testing strategy from unit to E2E - Proper CI/CD pipeline with appropriate security measures - Clean, maintainable code following Kubernetes conventions - Thoughtful error handling and user experience - Good operational practices (audit logging, metrics, RBAC) The code quality is consistently high across all changes, with proper separation of concerns, good error handling, and comprehensive test coverage. The CI/CD infrastructure is production-ready and will provide good development velocity. **Recommendation: Approve** - This is a well-executed, comprehensive enhancement that significantly improves the project's development and operational capabilities.
rcsheets merged commit 069e206461 into master 2026-03-21 02:59:52 +00:00
rcsheets deleted branch feat/ci-e2e-toolchain 2026-03-21 02:59:53 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
brooktrails/forgejo-runner-operator!1
No description provided.