Development Guide
Development Guide
This guide covers development workflows and tooling for the Kure project.
Quick Start
# Get help with all available commands
make help
# Run all standard development tasks
make all
# Quick development cycle
make checkContributing Workflow
The main branch is protected — all changes must go through pull requests.
Branch Workflow
Create a feature branch from
main:git checkout -b feat/my-feature mainUse branch prefixes:
feat/,fix/,docs/,chore/Develop and test locally:
make check # Quick validation make precommit # Full pre-commit checksPush and create a pull request:
git push -u origin feat/my-feature gh pr createFill out the PR template (
.github/PULL_REQUEST_TEMPLATE.md).Pass required CI checks:
lint,test,buildGet 1 approving review, resolve all conversations
Merge (linear history required — rebase, no merge commits)
Branch Protection Rules
- Required status checks (strict):
lint,test,build,rebase-check - Auto-rebase: open PRs are automatically rebased when main is updated (via
auto-rebase.yml) - Required reviews: 1 approving review
- Linear history: enforced (rebase only, no merge commits)
- Conversation resolution: all conversations must be resolved
- Force pushes: disabled
- Branch deletion: disabled
- Enforced for admins: yes
Development Workflow
1. Initial Setup
# Install dependencies
make deps
# Install development tools
make tools2. Development Cycle
# Format code
make fmt
# Run quick checks (lint, vet, short tests)
make check
# Run all tests
make test
# Run tests with coverage
make test-coverage3. Building
# Build all executables
make build
# Build specific executable
make build-kure
make build-kurel
make build-demo
# Build with race detection for debugging
make build-race4. Testing
# Run all tests
make test
# Run tests with verbose output
make test-verbose
# Run tests with race detection
make test-race
# Run only short tests (good for quick feedback)
make test-short
# Run tests with coverage report
make test-coverage
# Run benchmark tests
make test-benchmark
# Run integration tests (when available)
make test-integration5. Code Quality
# Run all linting
make lint
# Format code
make fmt
# Run go vet
make vet
# Tidy modules
make tidy
# Run Qodana static analysis (requires Docker)
make qodana6. Demo and Examples
# Run comprehensive demo
make demo
# Run GVK generators demo
make demo-gvk
# Generate all examples (alias for demo)
make examples7. Package Operations
# Build a kurel package
make kurel-build PACKAGE_PATH=path/to/package
# Show package information
make kurel-info PACKAGE_PATH=path/to/packagePre-commit Workflow
Before committing changes, run:
make precommitThis will:
- Format code with
go fmt - Tidy modules
- Run linters
- Run
go vet - Run all tests
CI/CD Pipeline
The project uses several GitHub Actions workflows:
Main CI Pipeline (.github/workflows/ci.yml)
- Triggers: Push to main/develop, PRs
- Jobs:
- Test (unit, race, coverage)
- Lint and format check
- Build executables
- Generate demo outputs
- Integration tests (main branch only)
- Cross-platform builds
- Security scanning
- Dependency vulnerability checks
Qodana Code Quality (.github/workflows/code_quality.yml)
- Triggers: Push, PRs
- Purpose: Static analysis with JetBrains Qodana
- Uses:
make depsfor setup
Auto-Rebase (.github/workflows/auto-rebase.yml)
- Triggers: Push to main
- Purpose: Automatically rebases all open PRs targeting main
- Uses:
peter-evans/rebase@v4 - Excludes: Dependabot PRs (
dependencieslabel), draft PRs - Auth: Requires
AUTO_REBASE_PATsecret (PAT needed to trigger CI on rebased branches)
Release Pipeline (.github/workflows/release.yml)
- Triggers: Version tags (
v*.*.*) - Jobs:
- Pre-release validation with
make ci-coverage - Release readiness check with
make release-check - Multi-platform build with
make release-build - GitHub release creation
- Go proxy refresh
- Pre-release validation with
PR Checks (.github/workflows/pr-checks.yml)
- Triggers: PR events
- Jobs:
- Quick validation with
make check - Security and dependency checks
- Test coverage validation
- Changed files analysis
- Performance benchmarks (when labeled)
- Documentation validation
- Quick validation with
Dependabot Management
Handling PRs
Use @dependabot commands in PR comments (not gh pr close):
| Command | Effect |
|---|---|
@dependabot close | Close PR, prevent recreation |
@dependabot ignore this dependency | Close PR, ignore dependency permanently |
@dependabot ignore this major version | Ignore major version updates |
@dependabot ignore this minor version | Ignore minor version updates |
@dependabot rebase | Rebase the PR |
@dependabot recreate | Recreate the PR from scratch |
Deferring Updates
When an update requires a blocked dependency (e.g., newer Go version):
- Comment
@dependabot closewith explanation and link to blocking issue - Do not use
gh pr closedirectly - Dependabot will recreate the PR
Reference: GitHub Docs - Dependabot PR Commands
Makefile Targets Reference
Development
help- Display help messageall- Run all standard development tasksinfo- Display project informationclean- Clean build artifacts and caches
Dependencies
deps- Download and tidy Go modulesdeps-upgrade- Upgrade all dependenciestools- Install development toolsoutdated- Check for outdated dependencies
Building
build- Build all executablesbuild-kure- Build kure executablebuild-kurel- Build kurel executablebuild-demo- Build demo executablebuild-race- Build with race detection
Testing
test- Run all teststest-verbose- Run tests with verbose outputtest-race- Run tests with race detectiontest-short- Run short tests onlytest-coverage- Run tests with coverage reporttest-benchmark- Run benchmark teststest-integration- Run integration tests
Code Quality
lint- Run all linterslint-go- Run golangci-lintfmt- Format Go codevet- Run go vettidy- Tidy modulesqodana- Run Qodana static analysis
CI/CD
ci- Run CI pipeline tasksci-coverage- Run CI with coverageci-integration- Run CI with integration testscheck- Quick code quality checkprecommit- Run all pre-commit checks
Release
release-check- Check if ready for releaserelease-build- Build release artifacts for multiple platforms
Utilities
generate- Run go generatemod-graph- Display module dependency graphlist-packages- List all packagesdemo*- Various demo commands
Environment Variables
Key environment variables the Makefile respects:
GO- Go command (default:go)GOROOT- Go root directoryVERSION- Version string for buildsBUILD_DIR- Build output directory (default:bin)OUTPUT_DIR- Demo output directory (default:out)TEST_TIMEOUT- Test timeout (default:30s)PACKAGE_PATH- Package path for kurel operations
Development Tips
Running Demos
The demo system generates example YAML files showing Kure’s capabilities:
# Run all demos
make demo
# Generated files appear in out/ directory
ls -la out/Testing Strategy
- Use
make test-shortfor quick feedback during development - Use
make test-coverageto check coverage before PRs - Use
make test-raceto catch concurrency issues - Use
make checkfor quick pre-commit validation
Code Quality
- The CI pipeline enforces 80% test coverage
- All code must pass golangci-lint checks
- Code must be properly formatted with
go fmt - Modules must be tidy
Performance
- Benchmark tests can be run with
make test-benchmark - PR checks include performance benchmarks when labeled with
performance - Build targets include optimized release builds with
-s -wflags
Troubleshooting
Build Issues
# Clean everything and rebuild
make clean all
# Check Go installation and environment
make infoTest Failures
# Run tests with verbose output for more details
make test-verbose
# Run specific test
go test -v ./pkg/specific/package -run TestSpecificDependency Issues
# Update dependencies
make deps-upgrade
# Check for outdated or vulnerable dependencies
make outdatedThis development guide provides a comprehensive overview of the development workflow using the Makefile and CI/CD pipeline.
Documentation Updates
When modifying a package’s public API, update documentation in the same PR:
- Package README — Update the
README.mdin the package directory (e.g.,pkg/stack/README.md) - Guides — Check the reverse mapping in
AGENTS.mdfor guides that reference the changed package - CLI reference — Regenerated automatically by
make docs-cli(no manual updates needed)
To verify the docs site builds correctly:
# Check all mounted files exist
bash site/scripts/check-mounts.sh
# Generate CLI reference + build site
mise run site:buildCrane Integration
Kure is a dependency of the Crane project (~/src/autops/wharf/crane).
Relationship
- Crane transforms OAM → Kure domain model → Kubernetes manifests
- Kure provides the domain model and manifest generation engine
- Both repos are co-developed with local replace directives
Key Files
- Crane’s requirements:
~/src/autops/wharf/crane/PLAN.md - Crane’s agent guide:
~/src/autops/wharf/crane/AGENTS.md
When Making Changes
- Check if change affects Crane’s integration
- Keep public API (
pkg/stack/) stable when possible - Update Crane if breaking changes are necessary
- Test with
go mod tidyin Crane to verify compatibility
Go Workspaces
Crane uses Go workspaces for local development. The workspace file lives in the parent directory:
# From wharf/ directory
go work init
go work use ./crane ./kureThis allows Crane to use your local Kure changes without pushing.
Before pushing Kure changes that Crane depends on:
- Push Kure changes first
- In Crane:
GOWORK=off go get github.com/go-kure/kure@main - Commit the updated go.mod/go.sum in Crane