Skip to content

chore(ci): manual nightly job trigger (Bash script and AI command) - #4355

Merged
openshift-merge-bot[bot] merged 7 commits into
redhat-developer:mainfrom
zdrapela:ocp-ci-rest-trigger
Mar 9, 2026
Merged

chore(ci): manual nightly job trigger (Bash script and AI command)#4355
openshift-merge-bot[bot] merged 7 commits into
redhat-developer:mainfrom
zdrapela:ocp-ci-rest-trigger

Conversation

@zdrapela

@zdrapela zdrapela commented Mar 4, 2026

Copy link
Copy Markdown
Member

Description

To be merged after openshift/release#75596 and testing with actual parameter overrides is needed.

This PR adds a script to allow easy manual triggering of nightly jobs. This is useful, for example, to verify an RC build or to trigger a job against your own fork of the repository.

Also, add an AI command to trigger job(s) using natural language. This helps with selecting the job name and image by fetching from what's available, and ask user follow-up questions about sending a Slack alert and using their own fork of the repository (for testing purposes).

Docs:

Which issue(s) does this PR fix

PR acceptance criteria

Please make sure that the following steps are complete:

  • GitHub Actions are completed and successful
  • Unit Tests are updated and passing
  • E2E Tests are updated and passing
  • Documentation is updated if necessary (requirement for new features)
  • Add a screenshot if the change is UX/UI related

How to test changes / Special notes to the reviewer

@zdrapela zdrapela changed the title chore(ci): add script an AI command for triggering nightly jobs chore(ci): manual nightly job trigger (script and AI command) Mar 4, 2026
@github-actions

github-actions Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@rm3l rm3l left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/hold

Looks good, but on hold per this in the description:

To be merged after openshift/release#75596 and testing with actual parameter overrides is needed.

@zdrapela

zdrapela commented Mar 9, 2026

Copy link
Copy Markdown
Member Author

/agentic_review

@zdrapela

zdrapela commented Mar 9, 2026

Copy link
Copy Markdown
Member Author

/agentic_describe

@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Mar 9, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Claude allowlist too strict 🐞 Bug ⛯ Reliability
Description
.claude/settings.json only allows bare curl invocations, but the Claude command requires piped
commands using grep/sed/sort/jq/tail, so the assistant is likely blocked from performing Step
1/Tag fetch as written.
Code

.claude/settings.json[R1-6]

+{
+  "permissions": {
+    "allow": [
+      "Bash(curl -s 'https://prow.ci.openshift.org/configured-jobs/redhat-developer/rhdh')",
+      "Bash(curl -s 'https://quay.io/api/v1/repository/rhdh/rhdh-hub-rhel9/tag/?limit=20&onlyActiveTags=true&filter_tag_name=like:1.')"
+    ]
Evidence
The allowlist only contains two exact Bash commands (curl-only). The Claude command explicitly
instructs running piped shell pipelines to extract job names and tags, which are not allowlisted.

.claude/settings.json[1-6]
.claude/commands/trigger-nightly-job.md[19-23]
.claude/commands/trigger-nightly-job.md[86-90]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The Claude command prompt requires executing piped shell pipelines, but Claude permissions only allow curl-only commands. This will likely block the command from functioning.

## Issue Context
- `.claude/settings.json` allowlist entries are curl-only.
- `.claude/commands/trigger-nightly-job.md` instructs `curl | grep | sed | sort` and `curl | jq | sort | tail`.

## Fix Focus Areas
- .claude/settings.json[1-7]
- .claude/commands/trigger-nightly-job.md[17-24]
- .claude/commands/trigger-nightly-job.md[84-91]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Tag/repo flags inconsistent 🐞 Bug ✓ Correctness
Description
The script help says --tag requires --quay-repo, but validation only enforces the opposite
direction (--quay-repo requires --tag), allowing --tag alone and contradicting the documented
usage.
Code

.ibm/pipelines/trigger-nightly-job.sh[R186-189]

+  if [[ -n "${QUAY_REPO}" && -z "${TAG_NAME}" ]]; then
+    log::error "--quay-repo requires --tag to be set."
+    exit 1
+  fi
Evidence
The usage text states --tag requires --quay-repo, but validate_args does not reject --tag
without --quay-repo. The Claude command docs also describe the image override as using both flags
together (or neither).

.ibm/pipelines/trigger-nightly-job.sh[71-74]
.ibm/pipelines/trigger-nightly-job.sh[174-190]
.claude/commands/trigger-nightly-job.md[79-83]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`--tag` is documented as requiring `--quay-repo`, but the script only errors when `--quay-repo` is provided without `--tag`. This allows a `--tag`-only invocation that contradicts the script’s help text and the AI prompt.

## Issue Context
This is a UX/correctness issue in `validate_args()`.

## Fix Focus Areas
- .ibm/pipelines/trigger-nightly-job.sh[71-77]
- .ibm/pipelines/trigger-nightly-job.sh[174-190]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Pipefail breaks ibm rules 🐞 Bug ⛯ Reliability
Description
The new script sets global set -o errexit/nounset/pipefail inside .ibm/, which contradicts
documented repository shell conventions for .ibm/ scripts and may cause consistency/linting
problems.
Code

.ibm/pipelines/trigger-nightly-job.sh[R39-41]

+set -o errexit
+set -o nounset
+set -o pipefail
Evidence
Repo guidance explicitly says to never use set -o pipefail in .ibm/ scripts and that only
.ibm/pipelines/openshift-ci-tests.sh should define global set options; the new script violates
both points.

.ibm/pipelines/trigger-nightly-job.sh[39-45]
.cursor/rules/ci-e2e-testing.mdc[348-353]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
New `.ibm/` script sets global bash `set` options, including `set -o pipefail`, which conflicts with repo-documented conventions for `.ibm/` scripts.

## Issue Context
The conventions appear intended to keep consistent error-handling behavior across pipeline scripts.

## Fix Focus Areas
- .ibm/pipelines/trigger-nightly-job.sh[39-41]
- .cursor/rules/ci-e2e-testing.mdc[348-353]
- .claude/rules/ci-e2e-testing.md[345-350]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Grey Divider

Previous review results

Review updated until commit b6c89b9

Results up to commit N/A


Grey Divider

Looking for bugs?

Come back again in a few minutes. An AI review agent is analysing this pull request Grey Divider

Qodo Logo

@rhdh-qodo-merge

Copy link
Copy Markdown

Review Summary by Qodo

Add nightly job trigger script and AI commands for OpenShift CI

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add bash script for triggering RHDH nightly ProwJobs via OpenShift CI Gangway REST API
• Support parameter overrides for custom images, GitHub forks, and branches
• Add AI commands for Claude, Cursor, and RuleSync to trigger jobs with natural language
• Include job selection, image tag fetching, and shared cluster constraint validation

Grey Divider

File Changes

1. .ibm/pipelines/trigger-nightly-job.sh ✨ Enhancement +346/-0

Bash script for triggering nightly ProwJobs

• New bash script for triggering RHDH nightly ProwJobs via Gangway REST API
• Supports parameter overrides for Quay repo, image tag, GitHub org/repo, and branch
• Includes authentication handling with automatic SSO login via oc login --web
• Provides dry-run mode and job status polling with Prow URL retrieval
• Comprehensive error handling and validation for job names and parameters

.ibm/pipelines/trigger-nightly-job.sh


2. .claude/commands/trigger-nightly-job.md ✨ Enhancement +145/-0

Claude AI command for job triggering workflow

• New AI command for Claude to assist with triggering nightly jobs
• Implements 7-step workflow: fetch jobs, select job, choose image, check fork override, enable
 alerts, build command, report results
• Includes natural language mapping for job selection across multiple platforms (OCP, AKS, EKS, GKE,
 OSD)
• Enforces shared cluster constraints for GKE and OSD-GCP jobs to prevent concurrent runs
• Provides permission configuration for fetching Prow jobs and Quay image tags

.claude/commands/trigger-nightly-job.md


3. .cursor/commands/trigger-nightly-job.md ✨ Enhancement +140/-0

Cursor IDE AI command for job triggering

• New AI command for Cursor IDE to assist with triggering nightly jobs
• Implements same 7-step workflow as Claude command for consistency
• Includes natural language mapping and shared cluster constraint validation
• Provides guidance for job selection, image tag selection, and fork overrides

.cursor/commands/trigger-nightly-job.md


View more (2)
4. .rulesync/commands/trigger-nightly-job.md ✨ Enhancement +147/-0

RuleSync AI command for job triggering

• New AI command for RuleSync with multi-target support
• Implements same 7-step workflow with additional metadata for rule synchronization
• Includes natural language mapping and shared cluster constraint validation
• Provides comprehensive guidance for all job triggering scenarios

.rulesync/commands/trigger-nightly-job.md


5. .claude/settings.json ⚙️ Configuration changes +8/-0

Claude settings for job trigger permissions

• New settings file configuring permissions for Claude AI command
• Allows bash execution for fetching Prow configured jobs and Quay image tags
• Restricts external API calls to specific endpoints for security

.claude/settings.json


Grey Divider

Qodo Logo

@zdrapela

zdrapela commented Mar 9, 2026

Copy link
Copy Markdown
Member Author

/agentic_describe

@zdrapela

zdrapela commented Mar 9, 2026

Copy link
Copy Markdown
Member Author

/agentic_review

@rhdh-qodo-merge

Copy link
Copy Markdown

Review Summary by Qodo

Add nightly job trigger script and AI commands for OpenShift CI

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add bash script to trigger RHDH nightly ProwJobs via OpenShift CI Gangway REST API
• Support parameter overrides for custom images, GitHub forks, and branches
• Add AI commands for natural language job selection and execution
• Include dry-run mode and job status polling capabilities

Grey Divider

File Changes

1. .ibm/pipelines/trigger-nightly-job.sh ✨ Enhancement +346/-0

Bash script for triggering nightly CI jobs

• New bash script for triggering RHDH nightly ProwJobs via Gangway REST API
• Supports parameter overrides: custom Quay image, GitHub org/repo/branch, Slack alerts
• Includes authentication handling with automatic SSO login via oc login --web
• Provides dry-run mode and job status polling with Prow URL retrieval
• Comprehensive argument parsing and validation with detailed usage documentation

.ibm/pipelines/trigger-nightly-job.sh


2. .claude/commands/trigger-nightly-job.md ✨ Enhancement +145/-0

Claude AI command for job triggering workflow

• New AI command definition for Claude to trigger nightly jobs
• Implements 7-step workflow: fetch jobs, natural language selection, image selection, fork
 override, Slack alerts, command building, and result reporting
• Includes natural language mapping for job names and shared cluster constraints for GKE/OSD-GCP
• Fetches available jobs from Prow and image tags from Quay API
• Provides permission configuration for curl commands to external APIs

.claude/commands/trigger-nightly-job.md


3. .cursor/commands/trigger-nightly-job.md ✨ Enhancement +140/-0

Cursor IDE AI command for job triggering

• New AI command definition for Cursor IDE to trigger nightly jobs
• Implements identical 7-step workflow as Claude version
• Includes natural language mapping, shared cluster constraints, and API integrations
• Supports fetching available jobs and image tags with user-friendly selection

.cursor/commands/trigger-nightly-job.md


View more (2)
4. .rulesync/commands/trigger-nightly-job.md ✨ Enhancement +147/-0

Rulesync AI command for job triggering

• New AI command definition with rulesync targets configuration
• Implements complete 7-step workflow for triggering nightly jobs
• Includes natural language job mapping and shared cluster constraint validation
• Supports multi-target deployment via rulesync framework

.rulesync/commands/trigger-nightly-job.md


5. .claude/settings.json ⚙️ Configuration changes +8/-0

Claude permissions configuration for API access

• New settings file defining permissions for Claude AI commands
• Allows curl commands to fetch Prow configured jobs and Quay image tags
• Restricts external API access to specific endpoints for security

.claude/settings.json


Grey Divider

Qodo Logo

@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Mar 9, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit b6c89b9

Comment thread .claude/settings.json Outdated
Comment on lines +1 to +7
{
"permissions": {
"allow": [
"Bash(curl -s 'https://prow.ci.openshift.org/configured-jobs/redhat-developer/rhdh')",
"Bash(curl -s 'https://quay.io/api/v1/repository/rhdh/rhdh-hub-rhel9/tag/?limit=20&onlyActiveTags=true&filter_tag_name=like:1.')"
]
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Claude allowlist blocks command 🐞 Bug ⛯ Reliability

.claude/settings.json only allows raw curl calls, but the Claude command requires piped commands
(grep/sed/sort/jq/tail) and executing .ibm/pipelines/trigger-nightly-job.sh. In an
allowlist-enforced environment, the command will be unable to fetch jobs/tags or trigger the job at
all.
Agent Prompt
### Issue description
The Claude command workflow cannot execute as written because `.claude/settings.json` allowlists only two plain `curl` commands, while the command definition requires additional shell utilities (`grep`, `sed`, `sort`, `jq`, `tail`) and executing `.ibm/pipelines/trigger-nightly-job.sh`.

### Issue Context
Claude will be blocked from performing the required steps under an exact-command allowlist model.

### Fix Focus Areas
- .claude/settings.json[1-7]
- .claude/commands/trigger-nightly-job.md[19-23]
- .claude/commands/trigger-nightly-job.md[88-90]
- .claude/commands/trigger-nightly-job.md[117-126]

### Suggested direction
- Add allowlist entries for the **full piped commands** exactly as documented (or refactor docs to match allowlisted commands).
- Decide whether Claude is expected to execute the trigger script; if yes, add an allow entry for `Bash(.ibm/pipelines/trigger-nightly-job.sh ...)` (potentially with constrained patterns), otherwise adjust the command to only print the final command for the user to run manually.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread .claude/settings.json Outdated
Comment on lines +1 to +6
{
"permissions": {
"allow": [
"Bash(curl -s 'https://prow.ci.openshift.org/configured-jobs/redhat-developer/rhdh')",
"Bash(curl -s 'https://quay.io/api/v1/repository/rhdh/rhdh-hub-rhel9/tag/?limit=20&onlyActiveTags=true&filter_tag_name=like:1.')"
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Claude allowlist too strict 🐞 Bug ⛯ Reliability

.claude/settings.json only allows bare curl invocations, but the Claude command requires piped
commands using grep/sed/sort/jq/tail, so the assistant is likely blocked from performing Step
1/Tag fetch as written.
Agent Prompt
## Issue description
The Claude command prompt requires executing piped shell pipelines, but Claude permissions only allow curl-only commands. This will likely block the command from functioning.

## Issue Context
- `.claude/settings.json` allowlist entries are curl-only.
- `.claude/commands/trigger-nightly-job.md` instructs `curl | grep | sed | sort` and `curl | jq | sort | tail`.

## Fix Focus Areas
- .claude/settings.json[1-7]
- .claude/commands/trigger-nightly-job.md[17-24]
- .claude/commands/trigger-nightly-job.md[84-91]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +186 to +189
if [[ -n "${QUAY_REPO}" && -z "${TAG_NAME}" ]]; then
log::error "--quay-repo requires --tag to be set."
exit 1
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Tag/repo flags inconsistent 🐞 Bug ✓ Correctness

The script help says --tag requires --quay-repo, but validation only enforces the opposite
direction (--quay-repo requires --tag), allowing --tag alone and contradicting the documented
usage.
Agent Prompt
## Issue description
`--tag` is documented as requiring `--quay-repo`, but the script only errors when `--quay-repo` is provided without `--tag`. This allows a `--tag`-only invocation that contradicts the script’s help text and the AI prompt.

## Issue Context
This is a UX/correctness issue in `validate_args()`.

## Fix Focus Areas
- .ibm/pipelines/trigger-nightly-job.sh[71-77]
- .ibm/pipelines/trigger-nightly-job.sh[174-190]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@zdrapela
zdrapela force-pushed the ocp-ci-rest-trigger branch from b6c89b9 to f8548eb Compare March 9, 2026 15:34
@openshift-ci openshift-ci Bot removed the lgtm label Mar 9, 2026
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@zdrapela
zdrapela force-pushed the ocp-ci-rest-trigger branch from 908ab26 to ff88b72 Compare March 9, 2026 15:48
@zdrapela

zdrapela commented Mar 9, 2026

Copy link
Copy Markdown
Member Author

/unhold

@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@sonarqubecloud

sonarqubecloud Bot commented Mar 9, 2026

Copy link
Copy Markdown

@openshift-ci openshift-ci Bot added the lgtm label Mar 9, 2026
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@openshift-merge-bot
openshift-merge-bot Bot merged commit d82cc45 into redhat-developer:main Mar 9, 2026
18 checks passed
@openshift-ci

openshift-ci Bot commented Mar 9, 2026

Copy link
Copy Markdown

@zdrapela: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-ocp-helm ff88b72 link unknown /test e2e-ocp-helm

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@zdrapela zdrapela changed the title chore(ci): manual nightly job trigger (script and AI command) chore(ci): manual nightly job trigger (Bash script and AI command) Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants