Repository navigation
Add AGENTS.md and AI tool configs for agentic development readiness #2477
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
redhat-chai-bot
wants to merge
1
commit into
openshift:oadp-dev
Choose a base branch
from
redhat-chai-bot:ai-readiness/add-agents-md
base: oadp-dev
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 @@ | ||
| read: 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "context": { | ||
| "fileName": "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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,128 @@ | ||
| # AGENTS.md — AI Agent Instructions for openshift/oadp-operator | ||
|
|
||
| ## Project Overview | ||
| The OADP (OpenShift API for Data Protection) Operator is the central component of the OADP ecosystem. It installs and manages Velero and its plugins on OpenShift clusters, providing backup, restore, and disaster recovery capabilities for cluster resources and persistent volumes. Built with the Operator SDK using controller-runtime. | ||
|
|
||
| - **Primary Language**: Go | ||
| - **Module**: `github.com/openshift/oadp-operator` | ||
| - **Default Branch**: `oadp-dev` | ||
|
|
||
| ## Build Instructions | ||
| ```bash | ||
| # Build the operator binary (includes manifests, codegen, fmt, vet) | ||
| make build | ||
|
|
||
| # Build Docker image | ||
| make docker-build | ||
|
|
||
| # Push Docker image | ||
| make docker-push | ||
|
|
||
| # Run the operator locally against a cluster | ||
| make run | ||
| ``` | ||
|
|
||
| ## Test Instructions | ||
| ```bash | ||
| # Run unit tests (includes manifests generation, codegen, fmt, vet, envtest) | ||
| make test | ||
|
|
||
| # Run Go vet | ||
| make vet | ||
|
|
||
| # Run Go fmt | ||
| make fmt | ||
|
|
||
| # Run specific tests | ||
| go test ./internal/controller/... -run TestName | ||
| go test ./pkg/... -run TestName | ||
|
|
||
| # E2E tests are in tests/ directory | ||
| ``` | ||
|
|
||
| ## Linting | ||
| ```bash | ||
| # Run golangci-lint | ||
| make lint | ||
|
|
||
| # Run golangci-lint with auto-fix | ||
| make lint-fix | ||
| ``` | ||
|
|
||
| Configuration: `.golangci.yaml` | ||
|
|
||
| ## Code Generation | ||
| ```bash | ||
| # Generate CRD manifests (WebhookConfiguration, ClusterRole, CRDs) | ||
| make manifests | ||
|
|
||
| # Generate DeepCopy methods | ||
| make generate | ||
| ``` | ||
|
|
||
| ## Code Conventions | ||
| - Operator SDK / controller-runtime patterns | ||
| - API types in `api/` with version directories (v1alpha1) | ||
| - Controllers in `internal/controller/` | ||
| - Shared packages in `pkg/` | ||
| - Test helpers and e2e tests in `tests/` | ||
| - CRD and RBAC manifests in `config/` | ||
| - OLM bundle in `bundle/` | ||
| - Follow existing error handling patterns (wrapped errors) | ||
| - Use kubebuilder markers for RBAC and CRD generation | ||
|
|
||
| ## Project Structure | ||
| ``` | ||
| api/ - OADP API types (DataProtectionApplication, etc.) | ||
| v1alpha1/ - v1alpha1 API version | ||
| cmd/ - Operator entry point | ||
| config/ - Kubernetes manifests | ||
| crd/ - CRD definitions | ||
| rbac/ - RBAC rules | ||
| manager/ - Deployment manifests | ||
| samples/ - Example CR instances | ||
| bundle/ - OLM operator bundle | ||
| build/ - Build scripts and configs | ||
| docs/ - Documentation | ||
| hack/ - Development scripts | ||
| internal/ - Private packages | ||
| controller/ - Reconciler implementations | ||
| common/ - Shared internal utilities | ||
| pkg/ - Shared packages | ||
| credentials/ - Cloud credential handling | ||
| velero/ - Velero installation helpers | ||
| scripts/ - Utility scripts | ||
| tests/ - E2E and integration tests | ||
| e2e/ - End-to-end test suite | ||
| ``` | ||
|
|
||
| ## CI/CD | ||
| - Prow CI for OpenShift (primary) | ||
| - Linter config: `.golangci.yaml` | ||
| - Reproduce CI locally: | ||
| ```bash | ||
| make build | ||
| make lint | ||
| make test | ||
| ``` | ||
|
|
||
| ## Common Tasks | ||
|
|
||
| ### Adding a new field to the DataProtectionApplication CRD | ||
| 1. Add the field to `api/v1alpha1/` types | ||
| 2. Run `make generate` to update DeepCopy methods | ||
| 3. Run `make manifests` to regenerate CRD YAML | ||
| 4. Update the reconciler in `internal/controller/` to handle the new field | ||
| 5. Update `bundle/` for OLM | ||
| 6. Add unit tests | ||
|
|
||
| ### Adding a new Velero plugin integration | ||
| 1. Update the Velero deployment spec in `pkg/velero/` | ||
| 2. Add plugin container/init-container configuration | ||
| 3. Update RBAC if needed (`config/rbac/`) | ||
| 4. Add e2e tests in `tests/e2e/` | ||
|
|
||
| ### Working with the OLM Bundle | ||
| 1. Bundle manifests in `bundle/` | ||
| 2. Regenerate with `make bundle` | ||
| 3. Test with `operator-sdk bundle validate` | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Describe the actual
make testbehavior.make testdoes not invokemake fmt. Its API and bundle freshness checks generate into temporary copies and compare results; they do not update the working tree. Revise this description so agents do not assume formatting or generated files were updated. The target runs unit tests, vet, envtest, lint, and freshness and dependency checks. (raw.githubusercontent.com)Suggested wording
📝 Committable suggestion
🤖 Prompt for AI Agents