Thank you for your interest in contributing to Version Guard! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors.
- Check if the bug has already been reported in GitHub Issues
- If not, create a new issue with:
- Clear, descriptive title
- Steps to reproduce
- Expected vs actual behavior
- Version Guard version, Go version, OS
- Relevant logs or error messages
- Check GitHub Discussions for existing feature requests
- Create a new discussion with:
- Clear description of the feature
- Use case and benefits
- Potential implementation approach (if applicable)
-
Fork the repository and create a feature branch:
git checkout -b feature/my-new-feature
-
Make your changes:
- Write clear, concise code
- Follow existing code style and patterns
- Add tests for new functionality
- Update documentation as needed
-
Test your changes:
make test # Run all tests make lint # Check code quality make build-all # Verify build
-
Commit your changes:
- Use clear, descriptive commit messages
- Reference relevant issues (e.g., "Fix #123: Description")
-
Push and create a pull request:
git push origin feature/my-new-feature
Then create a PR on GitHub with:
- Description of changes
- Related issues
- Testing performed
- Go 1.24+
- Docker (for local Temporal)
- Make
- AWS CLI (for S3 snapshot testing)
# Clone the repository
git clone https://github.com/block/Version-Guard.git
cd Version-Guard
# Install development tools
make setup
# Build binaries
make build-all
# Run tests
make test
# Start local Temporal server (in separate terminal)
make temporal
# Run the server with auto-reload
make dev- Go: Follow Effective Go and run
gofmt - Linting: Code must pass
golangci-lint(runmake lint) - Imports: Use
goimportsfor import formatting (runmake fmt-imports) - Tests: Write unit tests for new functionality (aim for >80% coverage)
- Place test files next to the code they test (
foo.go→foo_test.go) - Use table-driven tests where appropriate
- Mock external dependencies
Example (table-driven, mirrors the style used across pkg/policy,
pkg/config, and pkg/eol/endoflife):
func TestPolicy_Classify(t *testing.T) {
tests := []struct {
name string
resource *types.Resource
lifecycle *types.VersionLifecycle
want types.Status
}{
{
name: "past EOL classifies RED",
// ...
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := policy.NewDefaultPolicy().Classify(tt.resource, tt.lifecycle)
if got != tt.want {
t.Fatalf("Classify() = %s, want %s", got, tt.want)
}
})
}
}- Tag integration tests with the modern build constraint —
//go:build integrationon the first line, optionally followed by the legacy// +build integrationfor older toolchains. Seepkg/eol/endoflife/integration_test.gofor the reference pattern. - Require actual external dependencies (Wiz, endoflife.date, AWS, etc.) and
are excluded from
make testby default; run them withmake test-integration. - Document setup requirements (env vars, credentials) in the test file's header comment.
Recommended approach: Version Guard includes AI agent skills that automate adding new cloud resource types. No manual configuration editing required.
# With any AI agent that supports Agent Skills (Claude Code, Goose, Amp)
claude "Use the add-version-guard-resource skill to add OpenSearch support"The AI agent will autonomously:
- ✅ Validate product has EOL data on endoflife.date
- 📝 Gather required inputs (resource ID, Wiz report ID, display name)
- 🔍 Auto-detect Wiz CSV schema from existing test fixtures
- ⚙️ Generate
pkg/config/defaults/resources.yamlentry with proper field mappings - 🧪 Run tests to verify configuration works
- 📦 Create properly formatted git commit
Time saved: ~30-60 minutes of manual work reduced to 2-3 minutes.
See SKILLS.md for:
- Installation instructions for different AI platforms
- Detailed usage examples (OpenSearch, Aurora PostgreSQL, EKS)
- Troubleshooting guide
- Creating your own skills
If you prefer to add resources manually (or AI skills are not available), Version Guard is YAML-driven — most resources require zero Go code changes.
-
Add a resource block to
pkg/config/defaults/resources.yamlwithinventory.required_mappings,inventory.field_mappings, and aneolsection pointing at an endoflife.date product. See USAGE.md → Runbook 1 and TRANSFORMS.md for the field reference. -
Add the Wiz report ID to the
WIZ_REPORT_IDSJSON map (the key must match the resource'sid). -
Add a fixture under
pkg/inventory/wiz/testdata/if the new resource has a Wiz CSV shape not already covered by an existing fixture, and apkg/config/loader_test.gocase if the YAML parsing is non-trivial. -
Add a new endoflife.date schema adapter in
pkg/eol/endoflife/adapters.goonly if the product uses non-standard semantics (e.g. EKS-style standard support / extended support split). -
Code changes are only required when you need a non-Wiz inventory source or a non-endoflife.date EOL provider. In that case implement the
InventorySource/EOLProviderinterfaces and wire them into the per-resource maps incmd/server/main.go. There is noDetectorinterface — the generic detection activities inpkg/workflow/detection/activities.godispatch through those maps. -
Add tests for any new code (loader cases, adapter cases, custom sources) and update documentation (README.md, ARCHITECTURE.md) as needed.
Version-Guard/
├── cmd/
│ ├── server/ # Main server binary (worker + HTTP admin)
│ └── cli/ # CLI tool
├── pkg/
│ ├── types/ # Core data structures (Resource, Finding, Snapshot, Status)
│ ├── config/ # YAML loader, transforms DSL, embedded defaults
│ │ └── defaults/ # Canonical resources.yaml shipped with the binary
│ ├── policy/ # Classification policy (RED/YELLOW/GREEN/UNKNOWN)
│ ├── inventory/ # Inventory sources (Wiz generic source + mock)
│ ├── eol/ # EOL data providers (endoflife.date + schema adapters)
│ ├── registry/ # Optional registry client for service lookups
│ ├── store/ # Finding storage interface (in-memory implementation)
│ ├── snapshot/ # Snapshot builder + store (S3 / in-memory backends)
│ ├── workflow/ # Temporal workflows (orchestrator + detection)
│ ├── scan/ # Scan trigger (shared by HTTP /scan and CLI)
│ ├── schedule/ # Temporal Schedule create-or-update wiring
│ └── emitters/ # Emitter interfaces + reference logging emitter
├── charts/version-guard/ # Helm chart
├── deploy/ # Dockerfile + endoflife.date override shim
└── .github/ # GitHub Actions workflows
Releases are managed by maintainers. The container image and Helm chart are
cut from a single vX.Y.Z git tag by the
Docker & Helm workflow:
- If the chart has changed, bump
version(andappVersionif the image changed) in charts/version-guard/Chart.yaml. Land the bump onmainas achore(release)PR. - Tag and push:
git tag -a vX.Y.Z -m "Release vX.Y.Z" && git push origin vX.Y.Z. The tag's version must equalcharts/version-guard/Chart.yaml'sversionwhenever the chart changed since the previous tag — the workflow fails the release otherwise. - The workflow then:
- builds and pushes a multi-arch container image to
ghcr.io/block/Version-Guard(semver +latesttags), and - if the chart changed since the previous
v*tag, packages and pushes the Helm chart tooci://ghcr.io/block/charts.
- builds and pushes a multi-arch container image to
There is no CHANGELOG.md — release notes live on the GitHub Releases page.
- General questions: Use GitHub Discussions
- Bug reports: Use GitHub Issues
- Security issues: Report privately via GitHub's security advisory form (do not open public issues)
Thank you for contributing to Version Guard!