-
Notifications
You must be signed in to change notification settings - Fork 40
chore(agent-readiness): bootstrap basic AGENTS.md and minor repo updates for agents #3094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
johnmcollier
wants to merge
2
commits into
redhat-developer:main
Choose a base branch
from
johnmcollier:agentready
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| paths: | ||
| - "api/**/*.go" | ||
| --- | ||
|
|
||
| # API Types Rules | ||
|
|
||
| - New API versions go in `api/v1alphaN/` following the existing version directories. | ||
| - All exported types and fields must have godoc comments (Go convention: comment starts with the symbol name). | ||
| - After modifying any type in `api/`, run `make manifests generate` — the generated CRD YAML and deepcopy code must be committed with the source change. | ||
| - Validation markers (`+kubebuilder:validation:*`) go on struct fields, not separately. | ||
| - Check `api/current-types.go` to understand which API version is current/promoted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| paths: | ||
| - "internal/controller/**/*.go" | ||
| --- | ||
|
|
||
| # Controller Rules | ||
|
|
||
| - Reconcile logic lives in `internal/controller/backstage_controller.go`. | ||
| - Use server-side apply (`r.Patch(.., client.Apply, ..)`) for idempotent resource management — avoid plain `Create` which fails on re-reconcile. | ||
| - Gate optional features on CRD presence before registering scheme or adding RBAC. | ||
| - Do not hard-code `replicas` in any Deployment/StatefulSet template — omit to allow HPA. | ||
| - After any controller change, run `make manifests generate fmt vet` before committing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| paths: | ||
| - "integration_tests/**/*.go" | ||
| - "tests/**/*.go" | ||
| --- | ||
|
|
||
| # Integration & E2E Test Rules | ||
|
|
||
| - Some integration tests may require a running Kubernetes cluster and/or existing controller. Use `make integration-test USE_EXISTING_CLUSTER=true USE_EXISTING_CONTROLLER=true`. | ||
| - The `PROFILE` variable selects the test suite: `backstage.io` (faster, default for CI) or `rhdh`. | ||
| - Staticcheck (ST1001) is excluded for test files — dot-imports are allowed. | ||
| - Use `--focus` to run a single test: `make integration-test ARGS='--focus "test name"' USE_EXISTING_CLUSTER=true USE_EXISTING_CONTROLLER=true`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "hooks": { | ||
| "PostToolUse": [ | ||
| { | ||
| "matcher": "Edit|Write", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "case \"$CLAUDE_FILE_PATH\" in *.go) gofmt -w \"$CLAUDE_FILE_PATH\" 2>/dev/null || true ;; esac" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # rhdh-operator | ||
|
|
||
| Kubernetes operator for Red Hat Developer Hub (RHDH), based on the Backstage operator. | ||
| Manages `Backstage` CRs and reconciles them into Deployments, ConfigMaps, and related resources. | ||
|
|
||
| ## Build & Test Commands | ||
|
|
||
| - Build: `make build` | ||
| - Test (unit and integration tests not requiring real cluster): `make test` | ||
| - Integration test (on running cluster and controller): `make integration-test PROFILE=backstage.io USE_EXISTING_CLUSTER=true USE_EXISTING_CONTROLLER=true` | ||
| - Lint: `make lint` (golangci-lint + yamllint) | ||
| - Lint fix: `make lint-fix` | ||
| - Format: `make fmt` (goimports) | ||
| - Security scan: `make gosec` | ||
| - Generate CRD/deepcopy: `make manifests generate` | ||
| - Single-file lint: `golangci-lint run ./path/to/package/...` | ||
| - Single-file vet: `go vet ./path/to/package/...` | ||
|
|
||
| ## Key Conventions | ||
|
|
||
| <!-- TODO (maintainers): Add 2-3 conventions an agent couldn't discover by reading the code. | ||
| Examples: naming rules, Kubernetes-specific patterns, things that always break if missed. | ||
| See best_practices.md for patterns already captured from PR reviews. --> | ||
|
|
||
| ## Architecture | ||
|
|
||
| - Design and configuration overview: `docs/design.md` | ||
|
|
||
| <!-- TODO (maintainers): Document non-obvious architectural decisions or unexpected code locations. | ||
| Examples: "reconciler logic is split across pkg/ and internal/", "CRD validation happens in the webhook not the controller", invariants that must hold across the reconcile loop. --> | ||
|
|
||
| ## Pattern References | ||
|
|
||
| - CR examples and dependent resources: `examples/` | ||
| - Operator coding patterns (from PR reviews): `best_practices.md` | ||
| - Design and configuration docs: `docs/` | ||
|
|
||
| ## PR Conventions | ||
|
|
||
| - PR description must link the related issue (`Fixes #<issue>`) and include test and documentation checkboxes. | ||
| - Agent-assisted commits should include an `Assisted-by: <model>` footer. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| @AGENTS.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.