Skip to content

Commit 041dd68

Browse files
committed
fix: allow fork overrides for overlay jobs, error only on image/alert flags
Cross-checked with openshift/release step-ref YAMLs. Overlay jobs support GITHUB_ORG_NAME, GITHUB_REPOSITORY_NAME, and RELEASE_BRANCH_NAME overrides but NOT IMAGE_REPO, IMAGE_REGISTRY, TAG_NAME, or SKIP_SEND_ALERT. The script now allows --org, --repo, --branch for overlay jobs and errors only on the unsupported flags. Assisted-by: OpenCode
1 parent f5524b3 commit 041dd68

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

skills/prow-trigger-nightly/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ GKE and OSD-GCP each share a single cluster — never run two jobs on the same p
8080

8181
## Step 2: Options
8282

83-
**Important:** Overlay repo jobs do NOT support parameter overrides via Gangway. The script will error if override flags are passed for an overlay job. If the user selected an overlay job, skip this step and go directly to Step 3. Mention that overlay jobs always run with their default configuration.
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.
8484

8585
For RHDH repo jobs, present all options together. The user picks by number — multiple selections allowed (e.g. "2, 5"):
8686

skills/prow-trigger-nightly/scripts/trigger_nightly_job.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,20 +293,15 @@ def build_payload(args: argparse.Namespace) -> dict:
293293
is_overlay = args.job.startswith(OVERLAY_JOB_PREFIX)
294294

295295
if is_overlay:
296-
# Overlay jobs don't support parameter overrides or alerts.
296+
# Overlay jobs support fork overrides only (org, repo, branch).
297+
# Image overrides and alerts are not supported.
297298
unsupported: list[str] = []
298299
if args.image_repo:
299300
unsupported.append("--image-repo")
300301
if args.image_registry:
301302
unsupported.append("--image-registry")
302303
if args.tag:
303304
unsupported.append("--tag")
304-
if args.org:
305-
unsupported.append("--org")
306-
if args.repo:
307-
unsupported.append("--repo")
308-
if args.branch:
309-
unsupported.append("--branch")
310305
if args.send_alerts:
311306
unsupported.append("--send-alerts")
312307
if unsupported:
@@ -315,6 +310,13 @@ def build_payload(args: argparse.Namespace) -> dict:
315310
"These flags only work with rhdh repo jobs."
316311
)
317312
sys.exit(1)
313+
314+
if args.org:
315+
envs["MULTISTAGE_PARAM_OVERRIDE_GITHUB_ORG_NAME"] = args.org
316+
if args.repo:
317+
envs["MULTISTAGE_PARAM_OVERRIDE_GITHUB_REPOSITORY_NAME"] = args.repo
318+
if args.branch:
319+
envs["MULTISTAGE_PARAM_OVERRIDE_RELEASE_BRANCH_NAME"] = args.branch
318320
else:
319321
# RHDH repo jobs support full overrides.
320322
if args.image_repo:

0 commit comments

Comments
 (0)