Skip to content

Commit bcb5d52

Browse files
authored
Merge pull request #26 from zdrapela/prow-trigger-nightly
feat: add prow-trigger-nightly skill
2 parents 4795808 + d461ec9 commit bcb5d52

2 files changed

Lines changed: 835 additions & 0 deletions

File tree

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
---
2+
name: prow-trigger-nightly
3+
description: >-
4+
Trigger RHDH nightly ProwJobs on demand via the OpenShift CI Gangway REST API.
5+
Supports both rhdh and rhdh-plugin-export-overlays repos. Use when the user
6+
wants to trigger, run, kick off, or start a nightly CI job, run an on-demand
7+
E2E nightly test, list available nightly jobs, or trigger an overlay nightly.
8+
Also use when the user mentions Gangway, "nightly job", "periodic-ci",
9+
RC verification, testing a custom image, running CI against a fork, or
10+
checking available image tags on quay.io.
11+
---
12+
# Trigger Nightly ProwJobs
13+
14+
Trigger RHDH nightly ProwJobs via the OpenShift CI Gangway REST API.
15+
16+
Supports two repositories:
17+
- **rhdh** — the main RHDH application (`periodic-ci-redhat-developer-rhdh-*-nightly`)
18+
- **rhdh-plugin-export-overlays** — plugin export overlays (`periodic-ci-redhat-developer-rhdh-plugin-export-overlays-*-nightly`)
19+
20+
## Script Location
21+
22+
All commands below use paths relative to this skill's directory:
23+
`skills/prow-trigger-nightly/scripts/trigger_nightly_job.py`
24+
25+
## Prerequisites
26+
27+
- Python 3.9+
28+
- `oc` CLI installed (for authentication to OpenShift CI)
29+
30+
## Flow
31+
32+
1. Fetch available jobs and let the user pick one
33+
2. Ask about image override and additional options (fork, alerts)
34+
3. Show the command, confirm, execute, report results
35+
36+
## Step 1: Fetch Jobs and Select
37+
38+
List configured nightly jobs:
39+
40+
```bash
41+
uv run scripts/trigger_nightly_job.py --list
42+
```
43+
44+
Present the jobs in a table with columns: short name and which branches have it. Derive the short name from the job name part after the branch segment (e.g. `e2e-ocp-helm-nightly` -> "OCP Helm"):
45+
46+
| Repo | Job | main | release-1.9 | release-1.8 |
47+
|------|-----|------|-------------|-------------|
48+
| rhdh | OCP Helm | x | x | x |
49+
| rhdh | AKS Helm | x | x | |
50+
| overlays | OCP Helm | x | | |
51+
52+
Then ask the user to describe which job and branch they want in natural language.
53+
54+
### Natural Language Mapping
55+
56+
Map the user's description to the matching full job name from the fetched list. If no branch is mentioned, default to `main`:
57+
58+
**RHDH repo jobs:**
59+
- "ocp helm" / "openshift helm" -> `e2e-ocp-helm-nightly` (not upgrade, not versioned)
60+
- "operator" / "ocp operator" -> `e2e-ocp-operator-nightly` (not auth-providers)
61+
- "helm upgrade" / "upgrade test" -> `e2e-ocp-helm-upgrade-nightly`
62+
- "auth providers" / "authentication" -> `e2e-ocp-operator-auth-providers-nightly`
63+
- "4.17", "4.19", "4.20", "4.21" -> `e2e-ocp-v4-{VERSION}-helm-nightly`
64+
- "aks helm" / "azure helm" -> `e2e-aks-helm-nightly`
65+
- "aks operator" / "azure operator" -> `e2e-aks-operator-nightly`
66+
- "eks helm" / "aws helm" -> `e2e-eks-helm-nightly`
67+
- "eks operator" / "aws operator" -> `e2e-eks-operator-nightly`
68+
- "gke helm" / "google helm" -> `e2e-gke-helm-nightly`
69+
- "gke operator" / "google operator" -> `e2e-gke-operator-nightly`
70+
- "osd" / "osd gcp" -> `e2e-osd-gcp-helm-nightly` or `e2e-osd-gcp-operator-nightly`
71+
- Branch: "1.9", "release 1.9", "1.8 branch" -> match from that branch
72+
- Multiple: "all AKS jobs", "all Operator jobs on main" -> offer to trigger them in sequence
73+
74+
**Overlay repo jobs:**
75+
- "overlay nightly" / "overlay helm" / "overlays nightly" -> `periodic-ci-redhat-developer-rhdh-plugin-export-overlays-main-e2e-ocp-helm-nightly`
76+
77+
### Shared Cluster Constraint (GKE / OSD-GCP only)
78+
79+
GKE and OSD-GCP each share a single cluster — never run two jobs on the same platform simultaneously. Before triggering, warn the user.
80+
81+
## Step 2: Options
82+
83+
**Important:** Overlay repo jobs only support fork overrides (`--org`, `--repo`, `--branch`). Image overrides (`--image-registry`, `--image-repo`, `--tag`) and `--send-alerts` are NOT supported — the script will error if these are passed for an overlay job. If the user doesn't need fork overrides, skip this step and go directly to Step 3.
84+
85+
For RHDH repo jobs, present all options together. The user picks by number — multiple selections allowed (e.g. "2, 5"):
86+
87+
**Image override:**
88+
1. **Default image** — no image flags, use whatever the job is configured with
89+
2. **Custom tag only** — override just the tag, keep default registry and repo
90+
3. **Custom repo + tag** — override image repository and tag, keep default registry (`quay.io`)
91+
4. **Fully custom image** — override registry, repo, and tag
92+
93+
**Additional options:**
94+
5. **Fork override** — run against a fork instead of `redhat-developer/rhdh`
95+
6. **Send Slack alerts** — notify via `--send-alerts`
96+
97+
Constraint: `--image-repo` requires `--tag`, but `--tag` works on its own.
98+
99+
### Follow-up based on selections
100+
101+
**If 2 or 3 selected (quay.io registry)** — fetch available tags and present as numbered options. For `release-*` branches, derive `--tag-filter` by stripping the `release-` prefix. For `main`, omit `--tag-filter` to show all available versions:
102+
103+
```bash
104+
# For release-1.10 branch:
105+
uv run scripts/trigger_nightly_job.py --list-tags --tag-filter 1.10
106+
107+
# For main branch (show all versions):
108+
uv run scripts/trigger_nightly_job.py --list-tags
109+
```
110+
111+
Use `--image-repo <REPO>` to query a different image repository (default: `rhdh/rhdh-hub-rhel9`). Present the numbered results with a final option to enter a custom tag (e.g. `next`, `latest`). For option 3, also ask for the image repository.
112+
113+
**If 4 selected (non-quay registry)** — ask for all three values (tag fetching not available):
114+
- Registry (e.g. `brew.registry.redhat.io`)
115+
- Image repo (e.g. `rhdh/rhdh-hub-rhel9`)
116+
- Tag (e.g. `1.9`)
117+
118+
**If 5 selected** — ask for:
119+
- GitHub org (`--org`): e.g. `my-github-user`
120+
- Repo name (`--repo`): e.g. `rhdh`
121+
- Branch (`--branch`): e.g. `my-feature-branch`
122+
123+
## Step 3: Confirm and Execute
124+
125+
Show the full command and present final options:
126+
127+
```bash
128+
uv run scripts/trigger_nightly_job.py \
129+
--job <FULL_JOB_NAME> \
130+
[--image-registry <REGISTRY>] \
131+
[--image-repo <REPO>] \
132+
[--tag <TAG>] \
133+
[--org <ORG>] \
134+
[--repo <REPO>] \
135+
[--branch <BRANCH>] \
136+
[--send-alerts] \
137+
[--dry-run]
138+
```
139+
140+
1. **Execute** — run the command as shown
141+
2. **Change something** — go back and modify parameters
142+
143+
After execution, show the API response. If a job URL or ID is returned, display it prominently. On error, help diagnose (common issues: expired token, invalid job name).
144+
145+
## Reference
146+
147+
- Script flags: `-j/--job`, `-l/--list`, `-T/--list-tags`, `--tag-filter`, `-I/--image-registry`, `-q/--image-repo`, `-t/--tag`, `-o/--org`, `-r/--repo`, `-b/--branch`, `-S/--send-alerts`, `-n/--dry-run`, `--json`
148+
- Dedicated kubeconfig at `~/.config/openshift-ci/kubeconfig` — won't interfere with your current cluster context
149+
- If auth is needed, the script opens a browser for SSO login
150+
- RHDH jobs list: https://prow.ci.openshift.org/configured-jobs/redhat-developer/rhdh
151+
- Overlay jobs list: https://prow.ci.openshift.org/configured-jobs/redhat-developer/rhdh-plugin-export-overlays
152+
- Image tags: https://quay.io/repository/rhdh/rhdh-hub-rhel9?tab=tags
153+
154+
## Related Skills
155+
156+
- **`overlay`**: Manage the rhdh-plugin-export-overlays repository

0 commit comments

Comments
 (0)