ARO-RP
AGENTS.md120 starsChanged 59 days agoApache-2.0View on GitHub
Azure Red Hat OpenShift RP — ARM resource provider for OpenShift clusters on Azure. A single aro binary is produced with both RP-side services and the in-cluster ARO Operator, with the service selected in the command line (e.g. aro rp, aro portal, aro operator master) All Golang code in this repository is written for Go 1.26+. Cluster mutations (PUT/DELETE) are async: Frontend writes to CosmosDB with non-terminal state → Backend polls and processes → updates with terminal state. Never bypass…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
All Golang code in this repository is written for Go 1.26+.
- Very specific: line 77
Pointer utils: Use pkg/util/pointerutils, not autorest/to or k8s.io/utils/ptr.
- Distinctive: line 83
Before considering any change complete:
- Very specific: line 86
No new lint violations: make lint-go
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Azure Red Hat OpenShift RP — ARM resource provider for OpenShift clusters on Azure. A single aro binary is produced with both RP-side services and the in-cluster ARO Operator, with the service selected in the command line (e.g. aro rp, aro portal, aro operator master)
All Golang code in this repository is written for Go 1.26+.
Architecture Invariant
Cluster mutations (PUT/DELETE) are async: Frontend writes to CosmosDB with non-terminal state → Backend polls and processes → updates with terminal state. Never bypass this: public API frontend handlers must NOT perform cluster operations directly.
Two Go Modules (critical)
| Module | Path | go.mod |
| Root | github.com/Azure/ARO-RP | go.mod |
| API | github.com/Azure/ARO-RP/pkg/api | pkg/api/go.mod |
Root imports API via replace directive. ./... from root excludes pkg/api/ tests.
Read
docs/agent-guides/build.mdwhen changing build, test, or formatting targets.
Essential Commands
make fmt # Format BOTH modules (golangci-lint, NOT gofmt)
make unit-test-go # Unit tests
make lint-go # Lint
make generate # Code generation (go generate, swagger)
make go-tidy # go mod tidy for BOTH modules
go test -v ./pkg/frontend/... -run TestSpecificFunction # Single testSafety Rails
STOP — read before touching these areas:
| Trigger | Required reading |
Modifying pkg/api/v* types | docs/agent-guides/api-type-system.md |
| Adding/changing VM sizes | docs/agent-guides/azure-product-constraints.md |
| Changing Makefile, CI, or build targets | docs/agent-guides/build.md |
client-generate is destructive — it deletes all generated SDK clients before regenerating. If Docker/autorest fails mid-run, restore with git checkout -- pkg/client/ python/client/.
Where Code Runs
| Runtime context | Packages |
| RP control plane (Azure VMSS) | pkg/frontend, pkg/backend, pkg/cluster, pkg/monitor, pkg/gateway, pkg/portal |
| Customer OpenShift cluster | pkg/operator/controllers |
| CI/dev only (NOT production) | pkg/util/cluster, hack/cluster, test/e2e |
| RP infra deployment | pkg/deploy |
Admin API Handler Pattern ("Underscore Pattern")
Admin API endpoints decouple HTTP parsing from business logic. The main handler extracts parameters and calls an underscore-prefixed function with raw values:
func (f *frontend) postAdminFoo(w http.ResponseWriter, r *http.Request) {
// HTTP layer: extract params, get logger
err := f._postAdminFoo(log, ctx, r)
adminReply(log, w, nil, nil, err)
}
func (f *frontend) _postAdminFoo(log *logrus.Entry, ctx context.Context, r *http.Request) error {
// Business logic: testable without HTTP mocking
}This allows business logic to be invoked by other Go packages without HTTP mocking. When adding admin APIs, follow this pattern and register routes in pkg/frontend/frontend.go.
Code Style (enforced by CI)
- Imports:
gciis used to order Golang imports. See.golangci.yml. - Formatting:
make fmt(notgofmt). Pre-commit hook runsmake fmt. - Pointer utils: Use
pkg/util/pointerutils, notautorest/toork8s.io/utils/ptr. - Error handling: Wrap with
fmt.Errorf("...: %w", err). Useerrors.Is/errors.As. - No files directly in
pkg/util/— must use subpackages.
Definition of Done
Before considering any change complete:
make fmtpassesmake unit-test-gopasses- No new lint violations:
make lint-go
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

