Skip to content
Open
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
55 changes: 55 additions & 0 deletions docs/trigger-prow-ci-manually.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Triggering CI Jobs Manually via Gangway API

This document describes how to manually trigger CI jobs using the Gangway CI API.

## Prerequisites

- Access to the OpenShift CI console via SSO
- The `oc` CLI installed locally

## Steps

### 1. Get the CLI Login Command

Open the following link in your browser and log in with SSO:

https://oauth-openshift.apps.ci.l2s4.p1.openshiftapps.com/oauth/token/display

After login, the page will display the `oc login` command with your token directly.

### 2. Log in via the `oc` CLI

Run the login command from the previous step:

```bash
oc login --token=<your-token> --server=https://api.ci.l2s4.p1.openshiftapps.com:6443
```

### 3. Trigger a Job via the Gangway API

Use `curl` to trigger a job by name:

```bash
curl -X POST \
-H "Authorization: Bearer $(oc whoami -t)" \
-d '{"job_name": "${JOB_NAME}", "job_execution_type": "1"}' \
https://gangway-ci.apps.ci.l2s4.p1.openshiftapps.com/v1/executions
```

Replace the `JOB_NAME` value with the name of the job you want to trigger.

Example:
```
curl -X POST \
-H "Authorization: Bearer $(oc whoami -t)" \
-d '{"job_name": "periodic-ci-openshift-online-rosa-e2e-main-periodics-rosa-hcp-e2e-stable-4-21", "job_execution_type": "1"}' \
https://gangway-ci.apps.ci.l2s4.p1.openshiftapps.com/v1/executions
```
Comment on lines +42 to +47

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Add a language tag to the example fenced block.

Line 46 opens a fenced code block without a language, which triggers markdownlint MD040.

Suggested fix
-```
+```bash
 curl -X POST \
   -H "Authorization: Bearer $(oc whoami -t)" \
   -d '{"job_name": "periodic-ci-openshift-online-rosa-e2e-main-periodics-rosa-hcp-e2e-stable-4-21", "job_execution_type": "1"}' \
   https://gangway-ci.apps.ci.l2s4.p1.openshiftapps.com/v1/executions
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 46-46: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/trigger-prow-ci-manually.md` around lines 46 - 51, The fenced code block
containing the curl POST example that starts with ``` should include a language
tag to satisfy markdownlint MD040; change the opening fence from ``` to ```bash
(the block that contains the curl -X POST ... Authorization: Bearer $(oc whoami
-t) ... /v1/executions) so the snippet is correctly highlighted and linted.


### Available Job Names

The CI job names follow the pattern `periodic-ci-openshift-release-main-nightly-<version>-<job>`. To find the exact job name, check the job definitions in the [openshift/release](https://github.com/openshift/release) repository or the CI dashboard.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

The job name pattern doesn't match the example provided.

The described pattern periodic-ci-openshift-release-main-nightly-<version>-<job> doesn't match the example periodic-ci-openshift-online-rosa-e2e-main-periodics-rosa-hcp-e2e-stable-4-21. Key differences include the organization segment (openshift-release vs openshift-online) and the type segment (nightly vs periodics).

Consider updating the pattern description to be more general or clarify that multiple patterns exist for different job types.

📝 Suggested revision
-The CI job names follow the pattern `periodic-ci-openshift-release-main-nightly-<version>-<job>`. To find the exact job name, check the job definitions in the [openshift/release](https://github.com/openshift/release) repository or the CI dashboard.
+The CI job names typically follow the pattern `periodic-ci-<org>-<repo>-<branch>-<job-type>-<job-details>`. For example, nightly jobs use `periodic-ci-openshift-release-main-nightly-<version>-<job>`, while periodic jobs may use different patterns. To find the exact job name, check the job definitions in the [openshift/release](https://github.com/openshift/release) repository or the CI dashboard.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
The CI job names follow the pattern `periodic-ci-openshift-release-main-nightly-<version>-<job>`. To find the exact job name, check the job definitions in the [openshift/release](https://github.com/openshift/release) repository or the CI dashboard.
The CI job names typically follow the pattern `periodic-ci-<org>-<repo>-<branch>-<job-type>-<job-details>`. For example, nightly jobs use `periodic-ci-openshift-release-main-nightly-<version>-<job>`, while periodic jobs may use different patterns. To find the exact job name, check the job definitions in the [openshift/release](https://github.com/openshift/release) repository or the CI dashboard.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/trigger-prow-ci-manually.md` at line 51, The documented CI job name
pattern is incorrect/inconsistent with the example; update the text that
currently states "periodic-ci-openshift-release-main-nightly-<version>-<job>" to
either present a more general pattern or list multiple real patterns (e.g.,
include variants like "periodic-ci-openshift-online-...-periodics-..." shown in
the example). Edit the sentence in docs/trigger-prow-ci-manually.md to replace
the single hardcoded pattern with a generalized description or a short list of
known patterns and add a note pointing readers to the openshift/release job
definitions for exact job names.


## References

- [Triggering Prow Jobs via REST](https://docs.ci.openshift.org/how-tos/triggering-prowjobs-via-rest/)