Kollect turns Kubernetes state into durable inventory: you declare what matters once, and Kollect keeps it current and delivers the same canonical rows to Git, object storage, databases and event streams. This file is the working contract for AI coding assistants and new contributors: the commands, the gates, what CI enforces and where else to change when you add something. CONTRIBUTING.md owns the process.
| Command | What it does |
|---|---|
task build |
Build the manager binary |
task test |
Run unit tests with envtest |
task lint |
Run golangci-lint v2 and go-arch-lint |
task verify |
Fail if generated artifacts (manifests, deepcopy, RBAC) are stale |
task check |
Run the full local gate (see below) |
task scrub |
Fail if staged files contain forbidden strings |
task lint:markdown |
Lint tracked Markdown source with markdownlint-cli2 |
task spec:validate |
Validate openspec/config.yaml, every OpenSpec change and capability spec (strict) |
task lint:shell |
Lint shell scripts with ShellCheck |
task helm-test |
Lint the chart, verify helm-docs drift, run helm-unittest |
task test-integration |
Run integration-tagged tests; fails unless every one of them ran and passed (needs Docker) |
task check runs hack/check.sh. It runs every required CI gate that can run on a developer
machine, reports each failed gate, and exits non-zero if any failed. The gates, in order:
verifyformat:checklint:shelllint:markdownlintvulnchecktestscrubspec:validateaudit-rbacbuildhelmgo-modgitleaksgitleaks-detectworkflow-securityworkflow-security-auditrenovate-config(only when a Docker daemon answers; otherwise it prints that it skipped it)
After the gates it runs the guard sweep: every hack/test/*_test.sh and
hack/test/lab_harness_meta_suite.sh, plain, plus --self-test for each guard whose code
mentions that flag. A guard whose header declares that it requires Docker is skipped with a
printed reason. Last, it prints an exclusion table of the required gates it does not run locally,
each with its reason: test-integration, kind-smoke, docker-build, pipeline-cli-smoke and
dependency-review.
A release is eligible only when these check runs are green on its exact commit
(required_checks in hack/release/verify-eligibility.sh):
ci.yamlgitleaks: installs gitleaks withhack/install-gitleaks.sh, thengitleaks detect --source . --config .github/gitleaks.toml --verbose --redact --no-git.workflow-security: installs zizmor withhack/install-zizmor.shand audits.github/offline at high severity.verify:task verify.audit-rbac:bash hack/audit-rbac.sh(Polaris and kubeaudit).vulncheck:task vulncheck(govulncheck).lint:task format:check,task lint:shell, thehack/testguards (plain, and with--self-testfor most guards that have one), thentask lint.tool-pins-selftest: the--self-testofhack/test/consistency_tool_pins_test.shand ofhack/test/consistency_toolchain_pins_test.sh.test: a report job; on a change outside the documentation paths it fails unless thetest-suitejob (task coverage, unit tests with the coverage floor) succeeded.build:task build.test-integration:task test-integration(testcontainers).helm: installs Helm and the helm-unittest plugin, thentask helm-test.docker-build:task docker:build,task docker:build:pipeline, and a smoke run of the pipeline image, which must run as a non-root user.
preflight.yamlpreflight: on pull requests, the commit identity check (hack/check-commit-identity.sh); thentask lint:markdown,go mod tidywith no drift ingo.sum,go mod verifyandtask verify.
e2e-smoke.yamlkind-smoke: a report job; on a change outside the documentation paths it fails unlesskind-smoke-run(the kind smoke scenariohack/kind/e2e/smoke.sh) succeeded.pipeline-cli-smoke: the pipeline CLI scenariohack/kind/e2e/pipeline-cli-smoke.shon kind.
- Commits: Conventional Commits with an optional gitmoji shortcode, merged with rebase and merge; see CONTRIBUTING.md.
- Behavioural changes are specified and verified with OpenSpec; see docs/development/spec-workflow.md.
- Add the field to the spec type, for example
KollectProfileSpecinapi/v1alpha1/kollectprofile_types.go. - Regenerate with
make generate manifests, thenbash hack/helm-sync-crds.sh; this updatesconfig/crd/bases/andcharts/kollect/crds/. - Run
python3 hack/gen-glossary.pyto refresh the generated CRD block indocs/GLOSSARY.md(hack/test/glossary_drift_test.shchecks it). - Update the schema golden with
UPDATE_GOLDEN=1 go test ./test/schema/ -run TestCRDSpecOpenAPIFragments; it rewritestest/schema/golden/<kind>.spec.openapi.yaml, whichtask verifychecks. - Document the field on its CR page,
docs/crds/<kind>.md, and indocs/crds/index.md. - Finish with
task verifygreen.
- Declare the collector in
internal/metrics/metrics.goand add it toregisterTothere. - Add an entry to
Catalogininternal/metrics/metrics_catalog.go; the catalog test requires every registered metric there. - Add the name to
registeredMetricNamesininternal/metrics/metrics_catalog_test.go(TestRegisterMatchesRegisteredMetricNamesfails without it). - Add a row to
docs/operator-manual/metrics.md;hack/test/consistency_metrics_test.shchecks it. - Only when the metric should alert: add a rule to
charts/kollect/templates/prometheusrule.yaml; the same guard checks its metric name. - Finish with
go test ./internal/metrics/andbash hack/test/consistency_metrics_test.shgreen.
- Create the package
internal/sink/<name>with its type name and backend. - Register its factory in
NewRegistryininternal/sink/registry.go. - Add exactly one row for the type to the primary matrix of
docs/operator-manual/lab-backend-fidelity.md(hack/test/docs_lab_doc_04_fidelity_test.shchecks it). - Accept the type in a family CRD enum, for example
KollectEventSinkSpecinapi/v1alpha1/kollecteventsink_types.go, regenerate as for a CRD field, and updatetest/schema/golden/<kind>.spec.openapi.yamlthe same way. - Check that
ToKollectSinkSpecinapi/v1alpha1/sink_adapter.gomaps the family to the sink spec. - Check that
internal/validation/family_sink.govalidates the family's type. - No integration package edit is needed:
Taskfile.ymlalready covers./internal/sink/.... - Finish with
task verifyandtask lintgreen.
task test-integrationneeds Docker; a new integration-tagged package outside the listed ones must be added toINTEGRATION_PACKAGESinTaskfile.yml. Without Docker,task test-integration:explorereports what it could not run (CONTRIBUTING.md,Taskfile.yml).task scrubchecks staged files only, andhack/scrub-patterns.txtholds case-insensitive regular expressions, so stage your change before you run it (hack/scrub.sh).task changelog:verifyis deliberately not a pull-request gate: rebase merges change commit hashes, so it always drifts there; run it locally before tagging (.github/workflows/preflight.yaml).- The required
testandkind-smokecontexts report on every pull request, including documentation-only ones; the real work runs intest-suiteandkind-smoke-run(.github/workflows/ci.yaml,.github/workflows/e2e-smoke.yaml). - A changed CRD schema keeps
task verifyred until the schema golden is updated (test/schema/contract_test.go).