-
Notifications
You must be signed in to change notification settings - Fork 127
SDCICD-1728 adding AGENTS.md with local test config examples #3086
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
Merged
Merged
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,89 @@ | ||
| # AI Agent Instructions - OSDe2e | ||
|
|
||
| ## What This Is | ||
| End-to-end testing framework for Managed services for OSD/ROSA. It is currently applied as a test framework in ROSA nightly CI jobs, OSD operator CICD pipelines and on-demand test schedules such as gap analysis. | ||
|
|
||
| ## Core Test Workflow | ||
| 1. Load config (CLI flags → env vars → custom YAML → defaults) | ||
| 2. Provision cluster (or use existing via CLUSTER_ID) | ||
| 3. Health check (optional) | ||
| 4. Run tests | ||
| 5. Upgrade (optional) | ||
| 6. Cleanup (optional) | ||
|
|
||
| ## Key Files | ||
| - `pkg/common/config/config.go` - All configuration options (START HERE) | ||
| - `cmd/osde2e/main.go` - Entry point | ||
| - `pkg/common/providers/` - Cloud provider implementations (OCM, ROSA) | ||
| - `pkg/common/cluster/healthchecks/` - Health validation logic | ||
| - `internal/llm/` - LLM/AI integration (Gemini) | ||
|
|
||
| ## Common Patterns | ||
|
|
||
| ### Configuration | ||
| - Everything in `config.go`: const key + env var + default | ||
| - Access via `viper.GetString(config.SomeKey)` | ||
| - Precedence: CLI > Env > Custom YAML > Default | ||
|
|
||
| ### Providers | ||
| - Interface: `pkg/common/spi/` | ||
| - Registered in `main.go` | ||
|
|
||
|
|
||
| ### Authoring new platform component tests | ||
| - To add new component tests: Use boilerplate (README https://github.com/openshift/boilerplate/blob/master/boilerplate/openshift/golang-osd-e2e/README.md), not here | ||
|
|
||
| ### Logging | ||
| - Use `logr`/`klog`, not `fmt.Println` | ||
| - Structured logging preferred | ||
|
|
||
|
|
||
| ## Quick Tips | ||
| 1. Config changes? Edit `config.go` only | ||
| 2. Provider logic? Use SPI abstraction | ||
| 3. Integration test failures? Check credentials/env vars | ||
| 4. Always use `gofumpt`, not `gofmt` | ||
| 5. Check git status before committing | ||
|
|
||
| ## Environment | ||
| - See `config.go` for complete list | ||
|
|
||
| ## Architecture | ||
| ``` | ||
| osde2e | ||
| ├── cmd/osde2e/ # CLI commands (provision, test, cleanup, krknai) | ||
| ├── pkg/common/ # Core logic (config, providers, helpers) | ||
| ├── internal/ # LLM analysis (llm, sanitizer, prompts) | ||
| └── test/ # Standalone Ginkgo test suites | ||
| ``` | ||
|
|
||
| ## Interacting With The Code | ||
| - Always stick to existing design patterns in code | ||
| - Keep new code simple and concise | ||
| - Keep pull requests small | ||
| - Always reuse existing code | ||
| - Use go language best practices | ||
| - Prefer implementing existing or new interfaces, don't write extensive procedural logic | ||
| - Extend test helper functionality in https://github.com/openshift/osde2e-common, not here | ||
|
|
||
| ## Before You Commit | ||
| ```bash | ||
| gofumpt -w . # Format (not gofmt!) | ||
| make build # Compile | ||
| go test ./... -v # Test (integration tests need credentials) | ||
| ``` | ||
|
|
||
| ## E2E Testing instructions | ||
| - Do not allow e2e test unless following env vars are set: AD_HOC_TEST_IMAGES|CLUSTER_ID|OCM_CLIENT_ID|OCM_CLIENT_SECRET|AWS_ACCESS_KEY_ID|AWS_SECRET_ACCESS_KEY | ||
| - To run via cli: | ||
| ```bash | ||
| go run cmd/osde2e/main.go test --skip-health-check --skip-must-gather --skip-destroy-cluster --configs=rosa,sts,stage,ad-hoc-image" | ||
| ```` | ||
| - To run via IDE debugger, if IDE is VSCode, use configs/local/example-launch.json; if IDE is GoLand, use configs/local/example-e2e.run.xml | ||
|
|
||
| ## Unit Testing instructions | ||
| - Add or update for unit tests for concrete implementation changes and new functionality, even if nobody asked. | ||
| - Fix any test or type errors until the whole suite is green. | ||
|
|
||
| ## PR instructions | ||
| - Title format: [<jira-ID>] <Title> | ||
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,20 @@ | ||
| <component name="ProjectRunConfigurationManager"> | ||
| <configuration default="false" name="example-e2e" type="GoApplicationRunConfiguration" factoryName="Go Application"> | ||
| <module name="osde2e" /> | ||
| <working_directory value="$PROJECT_DIR$" /> | ||
| <useCustomBuildTags value="true" /> | ||
| <parameters value="test --configs=rosa,sts,stage,ad-hoc-image" /> | ||
| <envs> | ||
| <env name="AD_HOC_TEST_IMAGES" value="quay.io/redhat-user-workloads/oeo-cicada-tenant/openshift/osd-example-operator-e2e:latest" /> | ||
| <env name="AWS_REGION" value="us-east-1" /> | ||
| <env name="SKIP_CLUSTER_HEALTH_CHECKS" value="true" /> | ||
| <env name="SKIP_DESTROY_CLUSTER" value="True" /> | ||
| <env name="SKIP_MUST_GATHER" value="TRUE" /> | ||
| </envs> | ||
| <kind value="PACKAGE" /> | ||
| <package value="github.com/openshift/osde2e/cmd/osde2e" /> | ||
| <directory value="$PROJECT_DIR$" /> | ||
| <filePath value="$PROJECT_DIR$" /> | ||
| <method v="2" /> | ||
| </configuration> | ||
| </component> |
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,25 @@ | ||
| { | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "name": "example-e2e", | ||
| "type": "go", | ||
| "request": "launch", | ||
| "mode": "debug", | ||
| "hideSystemGoroutines": true, | ||
| "program": "./cmd/osde2e/main.go", | ||
| "env": { | ||
| "AD_HOC_TEST_IMAGES": "quay.io/redhat-user-workloads/oeo-cicada-tenant/openshift/osd-example-operator-e2e:latest", | ||
| "AWS_REGION": "us-east-1" | ||
| }, | ||
| "args": [ | ||
| "test", | ||
| "--configs", | ||
| "rosa,sts,stage,ad-hoc-image", | ||
| "--skip-must-gather", | ||
| "--skip-destroy-cluster", | ||
| "--skip-health-check" | ||
| ] | ||
| } | ||
| ] | ||
| } |
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.
I think there could be some value for the agent reading this to have a simple description of how this project is used and to see the README.md for more in depth context.
E.g. "This project is used as part of CICD workflows to validate changes to OpenShift Operators within OSD/ROSA, like Prow nightly jobs"
This extra little context I think would help the agent make decisions faster about design or troubleshooting issues.
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.
The suggested description "This project is used as part of CICD workflows to validate changes to OpenShift Operators within OSD/ROSA, like Prow nightly jobs" is specific to one use case and doesn't represent all that osde2e supports fully. So I've updated the description slightly to include its applications.
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.
This is great! It will give agents a bit more context to run off of without throwing too much at it.