Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 4 additions & 41 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This project provides AI-driven tools for end-to-end feature development in Open

| Command | Purpose |
| ----------------------------------------- | -------------------------------------------------------------- |
| `/oape:init <repo-short-name>` | Clone an allowed operator repo by short name |
| `/oape:api-generate <EP-URL>` | Generate Go API types from Enhancement Proposal |
| `/oape:api-generate-tests <path>` | Generate integration test suites for API types |
| `/oape:api-implement <EP-URL>` | Generate controller code from Enhancement Proposal + API types |
Expand All @@ -23,8 +24,8 @@ This project provides AI-driven tools for end-to-end feature development in Open
## Typical Workflow

```bash
# 1. Navigate to an operator repository
cd /path/to/operator-repo
# 1. Clone an operator repository (if not already cloned)
/oape:init cert-manager-operator

# 2. Generate API types
/oape:api-generate https://github.com/openshift/enhancements/pull/XXXX
Expand All @@ -46,45 +47,7 @@ make generate && make manifests && make build && make test

## Supported Operator Repositories

These repositories can be used to test the OAPE commands. Clone any of them and run the commands from within.

### Cert-Manager Operators

| Repository | Description | Framework |
| --------------------------------------------------------------------------------------- | ---------------------------------------------- | ------------------ |
| [openshift/cert-manager-operator](https://github.com/openshift/cert-manager-operator) | Manages cert-manager installation on OpenShift | controller-runtime |
| [openshift/jetstack-cert-manager](https://github.com/openshift/jetstack-cert-manager) | Core cert-manager (upstream fork) | controller-runtime |
| [openshift/cert-manager-istio-csr](https://github.com/openshift/cert-manager-istio-csr) | Certificate signing for Istio service mesh | controller-runtime |

### External Secrets Operators

| Repository | Description | Framework |
| --------------------------------------------------------------------------------------------- | ------------------------------------- | ------------------ |
| [openshift/external-secrets-operator](https://github.com/openshift/external-secrets-operator) | Manages external-secrets on OpenShift | controller-runtime |
| [openshift/external-secrets](https://github.com/openshift/external-secrets) | Core external-secrets (upstream fork) | controller-runtime |

### Additional Test Repositories

| Repository | Description | Framework |
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------- | ------------------ |
| [openshift/cluster-ingress-operator](https://github.com/openshift/cluster-ingress-operator) | Good example of controller-runtime patterns | controller-runtime |
| [openshift/cluster-authentication-operator](https://github.com/openshift/cluster-authentication-operator) | Good example of library-go patterns | library-go |
| [openshift/secrets-store-csi-driver-operator](https://github.com/openshift/secrets-store-csi-driver-operator) | CSI driver operator with bash e2e | library-go |

---

## Quick Clone Commands

```bash
# Cert-Manager Operators
git clone --filter=blob:none https://github.com/openshift/cert-manager-operator.git
git clone --filter=blob:none https://github.com/openshift/jetstack-cert-manager.git
git clone --filter=blob:none https://github.com/openshift/cert-manager-istio-csr.git

# External Secrets Operators
git clone --filter=blob:none https://github.com/openshift/external-secrets-operator.git
git clone --filter=blob:none https://github.com/openshift/external-secrets.git
```
The allowed repositories and their base branches are defined in [`team-repos.csv`](team-repos.csv). DO NOT raise PRs on any repos beyond that list. Always read `team-repos.csv` to determine the correct repo URL and base branch before cloning or creating branches.

---

Expand Down
24 changes: 21 additions & 3 deletions plugins/oape/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ AI-driven OpenShift operator development tools, following OpenShift and Kubernet

## Commands

### `/oape:init`

Clones an allowed OpenShift operator repository by short name into the current directory so that subsequent `/oape:*` commands can operate immediately.

**Usage:**
```shell
/oape:init cert-manager-operator
```

**What it does:**
1. **Prechecks** -- Validates the short name argument, required tools (`git`, `gh`), and GitHub authentication.
2. **Repository Resolution** -- Matches the short name against the allowlist (case-insensitive, with partial match disambiguation).
3. **Clone** -- Runs `git clone --filter=blob:none` into the current working directory. If the directory already exists with the correct remote, reuses it.
4. **Verify** -- Changes into the cloned directory and reports the Go module and detected framework.

### `/oape:api-generate`

Reads an OpenShift enhancement proposal PR, extracts the required API changes, and generates compliant Go type definitions in the correct paths of the current OpenShift operator repository.
Expand Down Expand Up @@ -54,13 +69,16 @@ Reads an OpenShift enhancement proposal PR, extracts the required implementation

**Typical Workflow:**
```shell
# First, generate the API types
# Clone the operator repository (if not already cloned)
/oape:init cert-manager-operator

# Generate the API types
/oape:api-generate https://github.com/openshift/enhancements/pull/1234

# Then, generate integration tests for the new types
# Generate integration tests for the new types
/oape:api-generate-tests api/v1alpha1/myresource_types.go

# Then, generate the controller implementation
# Generate the controller implementation
/oape:api-implement https://github.com/openshift/enhancements/pull/1234
```

Expand Down
Loading