Thank you for contributing to HyperFleet E2E! This document provides guidelines for developing and contributing to the project.
- Go 1.25+ - Install Go
- Make - Build automation tool
- Container tool - Docker or Podman for building images
- Git - Version control
-
Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/hyperfleet-e2e.git cd hyperfleet-e2e -
Add upstream remote:
git remote add upstream https://github.com/openshift-hyperfleet/hyperfleet-e2e.git
-
Install dependencies and generate code:
make generate
-
Build the binary:
make build
-
Verify your setup:
make check
hyperfleet-e2e/
├── cmd/ - CLI entry point
│ └── hyperfleet-e2e/
├── pkg/ - Core packages
│ ├── api/ - OpenAPI generated client
│ ├── client/ - HyperFleet API client wrapper
│ ├── config/ - Configuration loading and validation
│ ├── e2e/ - Test execution engine (Ginkgo)
│ ├── helper/ - Test helper utilities
│ ├── labels/ - Test label definitions
│ └── logger/ - Structured logging (slog)
├── e2e/ - Test suites
│ ├── cluster/ - Cluster lifecycle tests
│ └── nodepool/ - NodePool management tests
├── testdata/ - Test payloads and fixtures
│ └── payloads/
│ ├── clusters/ - Cluster creation payloads
│ └── nodepools/- NodePool creation payloads
├── configs/ - Configuration files
│ └── config.yaml - Default configuration
└── docs/ - Documentation
Run unit tests for all packages:
make testGenerate coverage report:
make test-coverageView coverage in browser:
open coverage.htmlRun all E2E tests (requires HyperFleet API):
export HYPERFLEET_API_URL=https://api.hyperfleet.example.com
make e2eRun specific test suites:
./bin/hyperfleet-e2e test --label-filter=tier0
./bin/hyperfleet-e2e test --focus "\[Suite: cluster\]"See Development Guide for detailed instructions on writing E2E tests.
Key points:
- Test files use
.goextension (NOT_test.go) - All tests must have labels (Tier0, Tier1, or Tier2)
- Use
ginkgo.By()to mark major test steps - Clean up resources in
AfterEach - Use helper functions from
pkg/helper
When the HyperFleet API OpenAPI schema changes:
# Regenerate from main branch (default)
make generate
# Or from a specific branch/tag
OPENAPI_SPEC_REF=release-0.2 make generateStandard development workflow:
# 1. Make changes to code
# 2. Format code
make fmt
# 3. Run all checks
make check
# 4. Build binary
make build
# 5. Run E2E tests locally (optional)
./bin/hyperfleet-e2e test --label-filter=tier0Build for local testing:
make imageBuild and push to personal Quay registry:
QUAY_USER=myusername make image-dev-
Create test file in appropriate suite directory:
touch e2e/cluster/my-new-test.go
-
Follow the test template structure (see existing tests)
-
Add appropriate labels
-
Test your changes:
make build ./bin/hyperfleet-e2e test --focus "My New Test"
Format all Go code:
make fmtCheck if code is formatted:
make fmt-checkRun golangci-lint:
make lintRun all verification checks:
make verifyBefore committing, ensure:
- Code is formatted (
make fmt) - All checks pass (
make check) - New tests added for new functionality
- Documentation updated if needed
We follow Conventional Commits standards:
<type>(<scope>): <subject>
<body>
<footer>
feat: New featurefix: Bug fixdocs: Documentation changesrefactor: Code refactoringtest: Test changeschore: Build/tooling changes
feat(cluster): add validation for cluster creation payloads
Add payload validation to ensure cluster names follow naming conventions
and required fields are present before sending API requests.
Closes #123
fix(client): handle timeout errors gracefully
Previously, timeout errors would panic. Now they're caught and wrapped
with context about the operation that timed out.
-
Create a feature branch from
main:git checkout -b feature/my-feature
-
Make your changes and commit following commit standards
-
Push to your fork:
git push origin feature/my-feature
-
Open a pull request against
main -
Ensure CI checks pass
-
Address review feedback
-
Once approved, a maintainer will merge your PR
- All CI checks passing
- Code reviewed and approved
- Commit messages follow standards
- Documentation updated if needed
- Tests added for new functionality
Releases are managed by maintainers following semantic versioning (MAJOR.MINOR.PATCH).
- MAJOR: Breaking changes
- MINOR: New features (backwards compatible)
- PATCH: Bug fixes (backwards compatible)
- Update
CHANGELOG.mdwith release notes - Create release branch:
release-X.Y - Tag release:
vX.Y.Z - Build and push container images
- Create GitHub release with changelog
- Read the documentation
- Check existing issues
- Ask questions in pull requests or issues
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.