Adding AGENTS.md#4573
Conversation
Signed-off-by: Gergely Csatari <gergely.csatari@nokia.com> Assisted-by: GitHub Copilot: Claude Haiku 4.5
✅ Deploy Preview for kptdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Adds a new AGENTS.md guide intended for AI/code agents working on the kpt repository, including repository context, contributor guidelines, and commonly used build/test/CI commands to reduce setup friction and encourage consistent workflows.
Changes:
- Introduces
AGENTS.mdwith generic rules for AI-assisted coding and PR reviews. - Documents key build/test targets (
make all,make test-docker, e2e targets) and environment variables. - Summarizes repository structure and CI workflows to help agents navigate the codebase.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Gergely Csatari <gergely.csatari@nokia.com> Assisted-by: GitHub Copilot: Claude Haiku 4.5 Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Gergely Csatari <gergely.csatari@nokia.com> Assisted-by: GitHub Copilot: Claude Haiku 4.5 Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Gergely Csatari <gergely.csatari@nokia.com> Assisted-by: GitHub Copilot: Claude Haiku 4.5
Signed-off-by: Gergely Csatari <gergely.csatari@nokia.com> Assisted-by: GitHub Copilot: Claude Haiku 4.5
Signed-off-by: Gergely Csatari <gergely.csatari@nokia.com> Assisted-by: GitHub Copilot: Claude Haiku 4.5 Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| * **.github/workflows/verifyContent.yml**: Verifies CLI examples | ||
| * Runs `make build`, installs mdrip/kind, runs `make site-verify-examples` | ||
| * Triggered on changes to `commands/`, `internal/` paths |
|
|
||
| ## Environment Variables | ||
|
|
||
| * **KRM_FN_RUNTIME**: Select function runtime for tests: `docker`, `podman` or `nerdctl` |
|
|
||
| **kpt** is a package-centric toolchain that automates Kubernetes configuration editing and management. It enables declarative configuration authoring, automation, and delivery at scale through a "Configuration as Data" approach, supporting Kubernetes platforms and KRM-driven infrastructure (e.g., Config Connector, Crossplane). | ||
|
|
||
| - **Language**: Go 1.26.3 |
There was a problem hiding this comment.
Should the version be included?
| **kpt** is a package-centric toolchain that automates Kubernetes configuration editing and management. It enables declarative configuration authoring, automation, and delivery at scale through a "Configuration as Data" approach, supporting Kubernetes platforms and KRM-driven infrastructure (e.g., Config Connector, Crossplane). | ||
|
|
||
| - **Language**: Go 1.26.3 | ||
| - **Repository Size**: ~78 MB |
There was a problem hiding this comment.
I don't think this is meaningful info like this, we could put an approx line or file count, but that would also have to be kept up to date.
| **Trust these instructions first.** Only perform searches if you find this information incomplete or inaccurate. | ||
|
|
||
| ### Prerequisites | ||
| - Go 1.26.3 (specified in `go.mod`) |
There was a problem hiding this comment.
I think we should instruct the AI to check the go.mod for this so we don't have to update it here too.
| - Go 1.26.3 (specified in `go.mod`) | ||
| - Git (required and checked at runtime) | ||
| - Docker or Podman (for `test-docker` and function runtime tests) | ||
| - KinD (CI uses v0.30.0 for live e2e/apply workflows; `make install-kind` installs v0.29.0 and is used by `verifyContent.yml`) (for e2e live apply tests with Kubernetes 1.33 and 1.34) |
There was a problem hiding this comment.
Again, we should point it at the file containing the version, not specify it straight up.
| make fix # Run go fix | ||
| make vet # Run go vet | ||
| make tidy # Run go mod tidy | ||
| make generate # Generate code from templates (mdtogo, copyright headers) |
There was a problem hiding this comment.
I think generate runs schema generation too, please check
| * **.golangci.yml**: Linting configuration (golangci-lint v2.11.4) | ||
| * **go.mod / go.sum**: Dependency management (Go 1.26.3) |
There was a problem hiding this comment.
Again, I think we should remove the versions.
| ### Build & CI Configuration | ||
|
|
||
| * **.github/workflows/go.yml**: Main CI workflow | ||
| * Runs on Linux (docker/podman matrix) and macOS | ||
| * Executes: `make all` + `make test-docker` | ||
| * Triggered on PRs (except changes limited to ignored paths like `**.md`) and pushes (pushes exclude dependabot branches) | ||
| * **.github/workflows/verifyContent.yml**: Verifies CLI examples | ||
| * Runs `make build`, installs mdrip/kind, runs `make site-verify-examples` | ||
| * Triggered on changes to `commands/`, `internal/` paths | ||
| * **.github/workflows/e2eEnvironment.yml**: KinD-based e2e tests | ||
| * Tests Kubernetes 1.33 and 1.34 with KinD v0.30.0 | ||
| * Runs `./e2e/live/end-to-end-test.sh -k <K8S_VERSION>` | ||
| * **.github/workflows/live-e2e.yml**: Live apply e2e tests | ||
| * Tests with pinned Kubernetes image SHAs | ||
| * Runs `make test-live-apply` with `K8S_VERSION` environment variable |
There was a problem hiding this comment.
Be sure to update this if the API module separation goes in before this PR
|
|
||
| * **release/**: Release automation (GoReleaser config, Homebrew formula generation) | ||
| * **hack/**: Miscellaneous development utilities | ||
| * **healthcheck/**: Separate module for health checking (Go 1.26.3, local Makefile) |
There was a problem hiding this comment.
Another go version ref
| ### Linter Configuration | ||
|
|
||
| * **Enabled Linters**: bodyclose, copyloopvar, dogsled, dupl, errcheck, gochecknoinits, goconst, gocritic, gocyclo, govet, ineffassign, lll, misspell, nakedret, revive, staticcheck, unconvert, unparam, unused, whitespace | ||
| * **Duplication Threshold**: 400 lines | ||
| * **Cyclomatic Complexity**: max 30 | ||
| * **Line Length**: max 170 characters | ||
| * **Revive Confidence**: 0.85 | ||
| * **Excluded Paths**: thirdparty/, third_party, builtin, examples | ||
| * **Test Files**: `funlen` and `gosec` are currently disabled project-wide (see `.golangci.yml`); if enabled later, | ||
| test files have additional exclusions configured. |
There was a problem hiding this comment.
Again, I think we should point it at the file so we don't have to keep this info up to date here.
Adding AGENTS.md
The original AGENTS.md was generated by GitHub Copilot: Claude Haiku 4.5. I've made small edits here and there.