Development#
Guide for contributors and developers.
Project Structure#
pages/
├── cmd/
│ ├── operator/ # Operator entrypoint
│ └── syncer/ # Syncer entrypoint
├── pkg/
│ ├── apis/v1alpha1/ # CRD types
│ ├── controller/ # Reconciliation logic
│ └── syncer/ # Git sync and webhook server
└── charts/kup6s-pages/ # Helm chart
├── Chart.yaml
├── values.yaml
├── templates/
├── crds/
└── tests/ # Helm unit testsPrerequisites#
- Go 1.26+
- Helm 3
- Docker (for building images)
- Access to a Kubernetes cluster (for testing)
Build#
# Build both binaries
make build
# Build individually
make build-operator
make build-syncerTest#
# Go tests
make test
# Helm chart tests
make helm-lint
make helm-testRun Locally#
# Operator (requires kubeconfig)
make run-operator
# Or with custom flags:
go run ./cmd/operator --pages-domain=pages.local --cluster-issuer=selfsigned
# Syncer
make run-syncer
# Or with custom flags:
go run ./cmd/syncer --sites-root=./tmp/sites --sync-interval=30s --allowed-hosts=github.comCode Quality#
# Run linter
make lint
# Format code
make fmt
# Vet
make vet
# Tidy dependencies
make tidyDocker Images#
# Build images
make docker-build
# Push images
make docker-pushHelm Development#
# Lint chart
make helm-lint
# Run unit tests
make helm-test
# Template chart (preview output)
make helm-template
# Install locally
make deploy
# Uninstall
make undeployKey Packages#
| Package | Description |
|---|---|
pkg/apis/v1alpha1 | StaticSite CRD types and scheme registration |
pkg/controller | Operator reconciliation logic |
pkg/syncer | Git synchronization and webhook handlers |
Releasing#
Version Scheme#
We follow Semantic Versioning with pre-release identifiers:
- Stable:
1.0.0,1.1.0,2.0.0 - Alpha:
1.0.0-alpha.1,1.0.0-alpha.2(early testing, API may change) - Beta:
1.0.0-beta.1,1.0.0-beta.2(feature complete, stabilizing) - Release Candidate:
1.0.0-rc.1(final testing before stable)
What Gets Released#
Each release publishes:
| Artifact | Registry | Example Tag |
|---|---|---|
| Operator image | ghcr.io/kup6s/pages-operator | v1.0.0-alpha.1, 1.0.0-alpha.1 |
| Syncer image | ghcr.io/kup6s/pages-syncer | v1.0.0-alpha.1, 1.0.0-alpha.1 |
| Helm chart | oci://ghcr.io/kup6s/kup6s-pages | 1.0.0-alpha.1 |
Pre-Release Checklist#
Before releasing:
All CI checks pass on main
# Verify locally go test -race ./... go build ./... helm lint charts/kup6s-pages helm unittest charts/kup6s-pagesUpdate CHANGELOG.md (if it exists) with release notes
Leave Chart.yaml alone: on
mainit always carries the placeholder version, and the release workflow sets the real one from the tagversion: 0.0.0 appVersion: "latest"
Creating a Release#
Option 1: GitHub CLI (Recommended)#
# For alpha release
gh release create v1.0.0-alpha.1 \
--title "v1.0.0-alpha.1" \
--notes "First alpha release of kup6s-pages" \
--prerelease
# For stable release
gh release create v1.0.0 \
--title "v1.0.0" \
--notes "First stable release"Option 2: GitHub Web UI#
- Go to Releases → Draft a new release
- Click Choose a tag → type
v1.0.0-alpha.1→ Create new tag - Set Release title:
v1.0.0-alpha.1 - Write release notes describing changes
- Check Set as a pre-release for alpha/beta/rc versions
- Click Publish release
After Release#
The release workflow automatically:
- Runs all tests
- Builds Docker images with version tags
- Pushes images to ghcr.io
- Sets
versionandappVersioninChart.yamlfrom the tag, in the workflow’s checkout only - Packages and pushes Helm chart to OCI registry
- Builds the documentation from the tag and deploys it
Every job checks out the release tag, so images, chart and documentation come from the same commit.
The workflow commits nothing, so main can be protected by a ruleset that requires pull requests.
Monitor the workflow at: https://github.com/kup6s/pages/actions
Installing a Release#
# Helm chart
helm install pages oci://ghcr.io/kup6s/kup6s-pages --version 1.0.0-alpha.1
# Direct image reference
ghcr.io/kup6s/pages-operator:v1.0.0-alpha.1
ghcr.io/kup6s/pages-syncer:v1.0.0-alpha.1Release Troubleshooting#
Release workflow failed#
- Check workflow logs at GitHub Actions
- Common issues:
- Tests failing → fix and create new release
- Registry auth failed → check
GITHUB_TOKENpermissions - Helm push failed → ensure chart name matches repository
Wrong version released#
- Delete the GitHub release
- Delete the git tag:
git push --delete origin v1.0.0-alpha.1 - Create a new release with correct version
Yanking a release#
To remove a broken release from use:
- Mark GitHub release as pre-release to warn users
- Add warning to release notes
- Release a patch version with the fix
Contributing#
- Fork the repository
- Create a feature branch
- Make your changes
- Run
make lintandmake test - Submit a pull request
Documentation#
Documentation is built with Hugo using the Book theme.
# Build docs
make docs-build
# Serve locally
make docs-serve