Skip to content

enabling 4.22 to be used in the hosted pipeline#967

Merged
acornett21 merged 1 commit into
mainfrom
ocp_4_22
Jun 12, 2026
Merged

enabling 4.22 to be used in the hosted pipeline#967
acornett21 merged 1 commit into
mainfrom
ocp_4_22

Conversation

@acornett21

Copy link
Copy Markdown
Contributor

Merge Request Checklists

  • Development is done in feature branches
  • Code changes are submitted as pull request into a primary branch [Provide reason for non-primary branch submissions]
  • Code changes are covered with unit and integration tests.
  • Code passes all automated code tests:
    • Linting
    • Code formatter - Black
    • Security scanners
    • Unit tests
    • Integration tests
  • Code is reviewed by at least 1 team member
  • Pull request is tagged with "risk/good-to-go" label for minor changes

Signed-off-by: Adam D. Cornett <adc@redhat.com>
@acornett21 acornett21 added the risk/good-to-go Indicates a small risk change label Jun 10, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 10, 2026
@acornett21 acornett21 marked this pull request as ready for review June 11, 2026 17:16
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 11, 2026
@qodo-code-review

qodo-code-review Bot commented Jun 11, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0)

Grey Divider


Remediation recommended

1. Duplicated max version constant 🐞 Bug ⚙ Maintainability
Description
preflight-trigger.yml hard-codes the OpenShift CI maximum supported version (DPTP_VER) in two
separate step scripts, which creates a code-drift risk where future edits update only one
occurrence. If they diverge, the task could create a ProwJob using one OCP version but attempt to
download artifacts using another, leading to hard-to-debug failures.
Code

ansible/roles/operator-pipeline/templates/openshift/tasks/preflight-trigger.yml[R212-216]

          # This is the maximum version supported by openshift-ci
-          DPTP_VER="4.21"
+          DPTP_VER="4.22"
          CP_VER="$(params.ocp_version)"

          if [ "$(printf '%s\n' "$DPTP_VER" "$CP_VER" | sort -V | head -n1)" == "$DPTP_VER" ]; then
Evidence
The same max-version constant is defined in two different steps and used to compute OCP_VER for
separate preflight-trigger operations (job creation vs artifact retrieval). Keeping these in sync
is required for the task to behave consistently.

ansible/roles/operator-pipeline/templates/openshift/tasks/preflight-trigger.yml[212-232]
ansible/roles/operator-pipeline/templates/openshift/tasks/preflight-trigger.yml[281-293]

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 Tekton Task template duplicates the OpenShift CI max supported version (`DPTP_VER`) in two different step scripts. This makes it easy to introduce inconsistencies in future updates.

### Issue Context
Both the `create-openshift-ci-prowjob` and `get-prowjob-artifacts-and-decrypt` steps compute `OCP_VER` from `DPTP_VER` before invoking `preflight-trigger` commands. These must remain consistent.

### Fix Focus Areas
- ansible/roles/operator-pipeline/templates/openshift/tasks/preflight-trigger.yml[6-40]
- ansible/roles/operator-pipeline/templates/openshift/tasks/preflight-trigger.yml[204-220]
- ansible/roles/operator-pipeline/templates/openshift/tasks/preflight-trigger.yml[266-293]

### Suggested fix
Add a new Task param like `openshift_ci_max_ocp_version` (default `4.22`) and reference it in both scripts (e.g., `DPTP_VER="$(params.openshift_ci_max_ocp_version)"`) so the cap is defined in exactly one place.

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


Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Enable OCP 4.22 in hosted preflight pipeline
⚙️ Configuration changes ✨ Enhancement 🕐 10-20 Minutes

Grey Divider

Walkthroughs

Description
• Bump hosted pipeline default OCP version to 4.22.
• Raise max openshift-ci supported version gate to 4.22.
• Keep version comparison logic intact while enabling newer clusters.
Diagram
graph TD
  F["preflight-trigger.yml"] --> P(["Preflight trigger task"]) --> R{{"openshift-ci steps"}}
  P --> J{{"ProwJob templates"}}
  P --> V["ocp_version default: 4.22"]

  subgraph Legend
    direction LR
    _file["Template file"] ~~~ _task(["Task/logic"]) ~~~ _ext{{"External system"}}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Centralize supported OCP versions in a single variable/source
  • ➕ Avoids duplicating the max version constant (DPTP_VER) in multiple script blocks
  • ➕ Makes future version bumps less error-prone
  • ➕ Easier to audit/version-control supported ranges
  • ➖ Requires a small refactor and agreement on where the canonical value lives
  • ➖ May touch more templates/roles than this minimal change
2. Derive max supported version dynamically from openshift-ci metadata
  • ➕ Eliminates hardcoded max version bumps
  • ➕ Automatically follows upstream support windows
  • ➖ Adds external dependency/lookup logic that may reduce determinism
  • ➖ Increases failure modes when metadata is unavailable or changes format

Recommendation: For a minimal, low-risk enablement, this PR’s direct bump to 4.22 is appropriate. If 4.xx bumps are frequent, consider centralizing the max supported version to avoid duplicated DPTP_VER updates and reduce drift between script sections.

Grey Divider

File Changes

Other (1)
preflight-trigger.yml Update hosted preflight OCP default/max to 4.22 +3/-3

Update hosted preflight OCP default/max to 4.22

• Changes the ocp_version parameter default from 4.21 to 4.22. Updates the hardcoded maximum openshift-ci supported version (DPTP_VER) in the preflight version-gating logic from 4.21 to 4.22.

ansible/roles/operator-pipeline/templates/openshift/tasks/preflight-trigger.yml


Grey Divider

Qodo Logo

@mrhillsman

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 11, 2026
@mrhillsman mrhillsman added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 12, 2026
@mrhillsman mrhillsman self-requested a review June 12, 2026 16:02
@mrhillsman mrhillsman added lgtm Indicates that a PR is ready to be merged. and removed approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. labels Jun 12, 2026
@acornett21 acornett21 merged commit a1586d1 into main Jun 12, 2026
45 of 48 checks passed
@acornett21 acornett21 deleted the ocp_4_22 branch June 12, 2026 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Indicates that a PR is ready to be merged. ready-for-testing risk/good-to-go Indicates a small risk change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants