|
| 1 | +--- |
| 2 | +name: rhdh-pr-review |
| 3 | +description: Test PR changes on a live RHDH cluster. Fetches CI-built images from PR comments, checks cluster status (deploying if needed), deploys the full PR operator bundle or manifests (not just image swap), actively verifies the code changes by exercising affected code paths on the cluster, and closes with findings including best-practice and security assessment. Use when asked to review an rhdh-operator PR, test PR changes on a cluster, deploy PR images for testing, or deploy PR bundle. Also use when user mentions "operator PR", "review PR", or "test this PR on my cluster". Currently supports rhdh-operator PRs. |
| 4 | +--- |
| 5 | + |
| 6 | +<cli_setup> |
| 7 | +This skill uses the orchestrator CLI for activity tracking. **Set up first:** |
| 8 | + |
| 9 | +```bash |
| 10 | +RHDH=../rhdh/scripts/rhdh |
| 11 | +``` |
| 12 | +</cli_setup> |
| 13 | + |
| 14 | +<essential_principles> |
| 15 | + |
| 16 | +<principle name="ensure_cluster"> |
| 17 | +Always verify the user has a running RHDH cluster with `oc` access before deploying PR bundles. |
| 18 | +If no cluster or no RHDH instance, provision one using `redhat-developer/rhdh-test-instance` — see `rhdh-repos.md` for details on that repo's capabilities. |
| 19 | +Don't just tell the user to set things up — do it. |
| 20 | +</principle> |
| 21 | + |
| 22 | +<principle name="use_pr_comment_images"> |
| 23 | +Extract image URLs from PR comments posted by CI — never construct image URLs manually. |
| 24 | +The tag format includes PR number + commit SHA, which only CI knows. |
| 25 | +See `references/operator-pr-images.md` for extraction commands. |
| 26 | +</principle> |
| 27 | + |
| 28 | +<principle name="deploy_full_bundle"> |
| 29 | +Deploy the full PR bundle/manifests, not just the operator binary image. |
| 30 | +PR changes to CRDs, RBAC, default config, or bundle metadata are baked into the OLM bundle or install.yaml manifests — a binary-only image swap misses them and the operator may fail to reconcile. |
| 31 | +For OLM-managed installs, replace the CatalogSource with the PR's `operator-catalog` image so OLM reinstalls the full bundle (CRDs, RBAC, CSV, deployment). |
| 32 | +For non-OLM installs, fetch and apply the PR branch's `install.yaml` (CRDs, RBAC, ConfigMaps, Deployment) with the CI-built operator image substituted in. |
| 33 | +Both paths preserve existing Backstage CRs, config, and Keycloak state — only the operator-side resources are replaced. |
| 34 | +</principle> |
| 35 | + |
| 36 | +</essential_principles> |
| 37 | + |
| 38 | +<intake> |
| 39 | + |
| 40 | +## What would you like to do? |
| 41 | + |
| 42 | +### PR Review Tasks |
| 43 | + |
| 44 | +*For testing PR changes on a live RHDH cluster* |
| 45 | + |
| 46 | +1. **Review rhdh-operator PR** — Deploy PR operator bundle on cluster and get review checklist |
| 47 | + |
| 48 | +**Wait for response before proceeding.** |
| 49 | + |
| 50 | +</intake> |
| 51 | + |
| 52 | +<routing> |
| 53 | + |
| 54 | +### PR Review Routes |
| 55 | + |
| 56 | +| Response | Workflow | |
| 57 | +|----------|----------| |
| 58 | +| 1, "operator", "rhdh-operator", a PR number, "review" | Route to `workflows/review-operator-pr.md` | |
| 59 | + |
| 60 | +**To route:** Read `workflows/review-operator-pr.md` and follow its process. |
| 61 | + |
| 62 | +</routing> |
| 63 | + |
| 64 | +<reference_index> |
| 65 | + |
| 66 | +| Reference | Purpose | Path | |
| 67 | +|-----------|---------|------| |
| 68 | +| operator-pr-images | CI image extraction and validation | `references/operator-pr-images.md` | |
| 69 | +| github-reference | gh CLI patterns, PR queries | `../rhdh/references/github-reference.md` | |
| 70 | +| rhdh-repos | RHDH ecosystem repository map | `../rhdh/references/rhdh-repos.md` | |
| 71 | + |
| 72 | + |
| 73 | +</reference_index> |
| 74 | + |
| 75 | +<skills_index> |
| 76 | + |
| 77 | +| Skill | Purpose | Path | |
| 78 | +|-------|---------|------| |
| 79 | +| rhdh | Orchestrator, environment status, activity tracking | `../rhdh/SKILL.md` | |
| 80 | + |
| 81 | +</skills_index> |
| 82 | + |
| 83 | +<success_criteria> |
| 84 | + |
| 85 | +See `workflows/review-operator-pr.md` `<success_criteria>` for the full checklist. |
| 86 | + |
| 87 | +</success_criteria> |
0 commit comments