Result storage and queryable API for Tekton CI/CD workload history. Stores TaskRun/PipelineRun/CustomRun execution data in persistent storage, freeing cluster resources. Log retrieval is provided via pluggable logging backends (e.g., Loki, Blob storage such as GCS/S3, Splunk).
Behavioral guidelines: See .agents/guidelines.md for generic coding principles.
# Build all binaries
make all
# Build specific component
make bin/api # API server
make bin/watcher # Result watcher
make bin/retention-policy-agent # Retention policy agent
make bin/tkn-results # CLI tool
# Test — requires no cluster
./test/presubmit-tests.sh --unit-tests
# Integration tests — requires kind cluster + Postgres
./test/presubmit-tests.sh --integration-tests
# Format code — required before PR submission
make fmt
# Lint — must pass before every PR
make golangci-lint
# Code generation — required after proto file changes
cd proto && go generate ./...# Lint a Go pkg
golangci-lint run path/to/package/
# Format single file
gofmt -w path/to/file.go
# Vet a Go pkg
go vet path/to/package/-
Postgres database is required. The API server stores all execution data in Postgres. Development and testing require a running Postgres instance.
-
Logs are not stored directly. Tekton Results does not store logs in its database. Logs are fetched from a configured third-party logging backend (e.g., Loki, Blob storage such as GCS/S3, Splunk) via the logging plugin.
-
gRPC API is the source of truth. All data mutations go through the API server at
pkg/api/server/. The watcher and clients never write directly to the database. -
Proto definitions drive code generation. After changing any
.protofile inproto/, runcd proto && go generate ./...to regenerate Go bindings. -
Dependencies are vendored. All Go dependencies live in
vendor/. Review agents should ignore thevendor/directory — it contains third-party code. -
Use structured logging. Import
knative.dev/pkg/loggingand use the context-aware logger. Never usefmt.Printforlog.Printin production code. -
Test coverage is enforced. PRs that add functionality must include tests. Integration tests are tagged
//go:build e2eand require a cluster.
API Server (cmd/api, pkg/api/): gRPC server backed by Postgres database.
Exposes Result and Record resources via proto-defined API (see proto/<proto_version>/).
Handles all data mutations and queries.
Watcher (cmd/watcher, pkg/watcher/): Kubernetes controller that watches
TaskRun, PipelineRun, and CustomRun resources. Creates or updates corresponding
Records via the Results API. Annotates original CRDs with result identifiers.
Retention Policy Agent (cmd/retention-policy-agent, pkg/retention/):
Deletes old data from the database based on configured retention policies.
CLI (cmd/tkn-results): Client tool for querying the Results API.
Logs (pkg/logs/): Integration with the configured logging backend
(e.g., Loki, Blob storage such as GCS/S3, Splunk) for log retrieval.
Logs are read from the external log store, not stored in the Results database.
- New API handler: Follow the pattern in
pkg/api/server/<proto_version>/results.go - Watcher shared reconciler logic: See
pkg/watcher/reconciler/dynamic/ - Watcher resource-specific reconciler: See
pkg/watcher/reconciler/pipelinerun/,taskrun/, orcustomrun/ - Proto definition changes: Follow
proto/<proto_version>/results.proto - Database migrations: See
tools/tkn-results-migrator/ - Integration tests: Follow examples in
test/e2e/
- Pull requests must follow the repository PR template in
.github/pull_request_template.md. - Run
make fmtbefore submitting for review. make golangci-lintmust pass with zero issues.- Tests required for any functionality changes.
- Follow Tekton commit message standards.
- Add
/kind <type>label (bug, feature, cleanup, etc.). - Update release notes block if user-facing changes.
- Run
cd proto && go generate ./...after proto changes. - Ignore
vendor/directory in reviews — contains vendored dependencies only.
None configured yet. Repo-local skills can be added to .agents/skills/.