Skip to content

[SANDBOX-1705] Upgrade to OCP 4.21 deps#1266

Open
metlos wants to merge 5 commits intocodeready-toolchain:masterfrom
metlos:upgrade-ocp-4.21
Open

[SANDBOX-1705] Upgrade to OCP 4.21 deps#1266
metlos wants to merge 5 commits intocodeready-toolchain:masterfrom
metlos:upgrade-ocp-4.21

Conversation

@metlos
Copy link
Contributor

@metlos metlos commented Mar 18, 2026

Related PRs:

Summary by CodeRabbit

  • Chores
    • Updated module dependency versions and transitive pins.
    • Added module replacement redirects to use alternate module sources.
    • Removed/adjusted an indirect dependency entry.
  • Bug Fixes / Improvements
    • Improved metrics parsing to enforce UTF‑8 validation, making metric handling more robust.

metlos and others added 3 commits March 12, 2026 12:28
- Update openshift/api to release-4.21
- Update k8s.io dependencies to v0.34.3
- Update controller-runtime to v0.22.5
- Add replace directives for api and toolchain-common forks
- Fix prometheus TextParser: use NewTextParser with UTF8Validation
  (common v0.66.1 changed ValidationScheme enum)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@openshift-ci openshift-ci bot requested review from jrosental and rsoaresd March 18, 2026 13:46
@coderabbitai
Copy link

coderabbitai bot commented Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bb4083df-361c-4585-9666-491860f7ef9f

📥 Commits

Reviewing files that changed from the base of the PR and between 2b57840 and 6db782c.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod
🚧 Files skipped from review as they are similar to previous changes (1)
  • go.mod

Walkthrough

Updated Go module dependency versions and added two replace directives in go.mod. Adjusted Prometheus metric parsing in testsupport/metrics/metrics.go to use a text parser with UTF‑8 validation.

Changes

Cohort / File(s) Summary
Dependency Remapping
go.mod
Bumped multiple direct and indirect module versions; added replace directives remapping github.com/codeready-toolchain/apigithub.com/metlos/api and github.com/codeready-toolchain/toolchain-commongithub.com/metlos/toolchain-common to specific pseudo-versions.
Metrics Parser Enhancement
testsupport/metrics/metrics.go
Imported github.com/prometheus/common/model and replaced expfmt.TextParser{} with expfmt.NewTextParser(model.UTF8Validation) to enable UTF‑8 validation when parsing metric text.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[SANDBOX-1705] Upgrade to OCP 4.21 deps' directly and clearly summarizes the main change: upgrading dependencies to OpenShift/OCP 4.21, which is exactly what the changeset accomplishes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@go.mod`:
- Around line 16-17: Update the stale comment above the openshift dependency to
reference the correct branch: change the text that currently says "using latest
commit from 'github.com/openshift/api branch release-4.19'" to mention
"release-4.21" so it matches the upgraded dependency line for
github.com/openshift/api v0.0.0-20260304172252-b0658d22beea; ensure only the
comment text is updated (not the module line).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1745fbb5-d30a-433d-a349-bbed687e34c5

📥 Commits

Reviewing files that changed from the base of the PR and between ea125f1 and 5ec1fba.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • go.mod
  • testsupport/metrics/metrics.go

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
go.mod (1)

20-140: ⚠️ Potential issue | 🔴 Critical

Remove replace directives pointing to personal forks before merging.

The go.mod file contains two replace directives that redirect dependencies to personal GitHub forks instead of canonical repositories:

  • github.com/codeready-toolchain/apigithub.com/metlos/api
  • github.com/codeready-toolchain/toolchain-commongithub.com/metlos/toolchain-common

These must be removed before this change is merged to production. Ensure companion PRs in the api and toolchain-common repositories are merged to their canonical locations first.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@go.mod` around lines 20 - 140, Remove the temporary replace directives that
point the modules github.com/codeready-toolchain/api -> github.com/metlos/api
and github.com/codeready-toolchain/toolchain-common ->
github.com/metlos/toolchain-common from go.mod; instead restore/leave the
canonical module requirements (github.com/codeready-toolchain/api and
github.com/codeready-toolchain/toolchain-common) and ensure the upstream PRs in
those repositories are merged first so CI resolves the official packages.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@go.mod`:
- Around line 150-152: The go.mod contains replace directives pointing to
personal forks (github.com/metlos/api and github.com/metlos/toolchain-common);
remove or replace them with canonical module paths and appropriate versions/tags
before merging. Either (1) change the replace lines to point at official
codeready-toolchain modules with released or official pre-release tags, (2)
remove the replace directives entirely if those forked changes are no longer
required, or (3) keep them only temporarily and update them to the canonical
repositories once the companion PRs are merged; ensure any types referenced
(e.g., UserSignup, MasterUserRecord, Space, and utilities used from
toolchain-common) are compatible with the chosen canonical versions.

---

Outside diff comments:
In `@go.mod`:
- Around line 20-140: Remove the temporary replace directives that point the
modules github.com/codeready-toolchain/api -> github.com/metlos/api and
github.com/codeready-toolchain/toolchain-common ->
github.com/metlos/toolchain-common from go.mod; instead restore/leave the
canonical module requirements (github.com/codeready-toolchain/api and
github.com/codeready-toolchain/toolchain-common) and ensure the upstream PRs in
those repositories are merged first so CI resolves the official packages.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 01805c78-c9fb-4aef-9303-1f5588c57f19

📥 Commits

Reviewing files that changed from the base of the PR and between 5ec1fba and 2b57840.

📒 Files selected for processing (1)
  • go.mod

Comment on lines +150 to +152
replace github.com/codeready-toolchain/api => github.com/metlos/api v0.0.0-20260318102359-237e681a639a

replace github.com/codeready-toolchain/toolchain-common => github.com/metlos/toolchain-common v0.0.0-20260318113116-fbd4bba9beb1
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check companion PR status and verify no breaking changes

echo "=== Checking companion PR status ==="
gh pr view 501 --repo codeready-toolchain/api --json state,mergeable,title
gh pr view 522 --repo codeready-toolchain/toolchain-common --json state,mergeable,title

echo -e "\n=== Checking if forked commits match companion PRs ==="
# Check if the commit hashes in replace directives match the companion PRs
gh pr view 501 --repo codeready-toolchain/api --json commits --jq '.commits[-1].oid' | grep -q "237e681a639a" && echo "api commit matches" || echo "api commit MISMATCH"
gh pr view 522 --repo codeready-toolchain/toolchain-common --json commits --jq '.commits[-1].oid' | grep -q "fbd4bba9beb1" && echo "toolchain-common commit matches" || echo "toolchain-common commit MISMATCH"

Repository: codeready-toolchain/toolchain-e2e

Length of output: 635


🏁 Script executed:

# First, examine the go.mod file to confirm the replace directives
wc -l go.mod

Repository: codeready-toolchain/toolchain-e2e

Length of output: 87


🏁 Script executed:

# Look at the specific lines mentioned (150-152) and surrounding context
sed -n '140,160p' go.mod

Repository: codeready-toolchain/toolchain-e2e

Length of output: 535


🏁 Script executed:

# Search for any comments or documentation about these replace directives
rg -i "metlos|replace" go.mod -B 2 -A 2

Repository: codeready-toolchain/toolchain-e2e

Length of output: 376


🏁 Script executed:

# Check if there are any other replace directives in the file
grep "^replace " go.mod

Repository: codeready-toolchain/toolchain-e2e

Length of output: 308


🏁 Script executed:

# Search the codebase for any references to these forked packages or companion PRs
rg "metlos|companion.*pr|pending.*merge" -i --type-not=binary | head -20

Repository: codeready-toolchain/toolchain-e2e

Length of output: 107


🏁 Script executed:

# Check git log for changes to go.mod, specifically the replace directives
git log --oneline --all -S "metlos" -- go.mod | head -20

Repository: codeready-toolchain/toolchain-e2e

Length of output: 163


🏁 Script executed:

# Get the full commit that added these replace directives
git log -p -S "metlos" -- go.mod | head -100

Repository: codeready-toolchain/toolchain-e2e

Length of output: 59


🏁 Script executed:

# Check if there's a PR description or commit message explaining this
git log --format="%H %s %b" -S "metlos" -- go.mod | head -50

Repository: codeready-toolchain/toolchain-e2e

Length of output: 176


🏁 Script executed:

# Try to get more recent git history with simpler command
git log --oneline -20 go.mod

Repository: codeready-toolchain/toolchain-e2e

Length of output: 142


🏁 Script executed:

# Check if there's a PR or branch context
git branch -a --contains HEAD | head -10

Repository: codeready-toolchain/toolchain-e2e

Length of output: 108


🏁 Script executed:

# Look for any README or documentation about replace directives or development setup
find . -maxdepth 2 -type f \( -name "README*" -o -name "CONTRIBUTING*" -o -name "*.md" \) -exec grep -l "replace\|fork\|metlos" {} \;

Repository: codeready-toolchain/toolchain-e2e

Length of output: 90


🏁 Script executed:

# Check for any .github or documentation about this
ls -la .github/ 2>/dev/null || echo "No .github directory"

Repository: codeready-toolchain/toolchain-e2e

Length of output: 310


🏁 Script executed:

# Look for any CI/build configuration that might reference these
find . -maxdepth 2 -type f \( -name "*.yml" -o -name "*.yaml" \) -exec grep -l "metlos\|replace" {} \;

Repository: codeready-toolchain/toolchain-e2e

Length of output: 59


🏁 Script executed:

# Check the README for any context about replace directives or forks
cat README.adoc | grep -i -A 5 -B 5 "replace\|metlos\|fork\|dependency"

Repository: codeready-toolchain/toolchain-e2e

Length of output: 4443


🏁 Script executed:

# Check if there's recent git history showing when replace directives were added
git log --all --format="%H %ai %s" go.mod | head -5

Repository: codeready-toolchain/toolchain-e2e

Length of output: 676


🏁 Script executed:

# Get the actual commit diff that introduced metlos
git show 2b578400b082dd05b509660877c2999ad9f4a212:go.mod 2>/dev/null | grep -A 2 -B 2 "metlos" || echo "Commit doesn't reference metlos"

Repository: codeready-toolchain/toolchain-e2e

Length of output: 376


🏁 Script executed:

# Check if metlos forks are actually accessible/valid
python3 << 'EOF'
import subprocess
import json

# Try to check if the commit hashes exist in the metlos repos
commits = {
    "api": "237e681a639a",
    "toolchain-common": "fbd4bba9beb1"
}

for repo_name, commit in commits.items():
    repo_url = f"https://github.com/metlos/{repo_name}"
    try:
        result = subprocess.run(
            ["git", "ls-remote", repo_url, commit],
            capture_output=True,
            timeout=5,
            text=True
        )
        if result.returncode == 0 and result.stdout.strip():
            print(f"✓ {repo_name}: Commit {commit} exists and is accessible")
        else:
            print(f"✗ {repo_name}: Commit {commit} not found or repo not accessible")
    except Exception as e:
        print(f"✗ {repo_name}: Error checking - {e}")
EOF

Repository: codeready-toolchain/toolchain-e2e

Length of output: 209


🏁 Script executed:

# Double-check by trying to fetch the actual commits directly from metlos repos
git ls-remote https://github.com/metlos/api refs/heads/* refs/tags/* 2>&1 | grep -E "237e681a639a|HEAD" || echo "Repository or commits not found"

Repository: codeready-toolchain/toolchain-e2e

Length of output: 145


🏁 Script executed:

# Check if these versions exist as tags or releases
curl -s https://api.github.com/repos/metlos/api/tags 2>&1 | head -20 || echo "Cannot reach GitHub API"

Repository: codeready-toolchain/toolchain-e2e

Length of output: 356


🏁 Script executed:

# The first commit exists! Let's verify the second one
git ls-remote https://github.com/metlos/toolchain-common refs/heads/* refs/tags/* 2>&1 | grep -E "fbd4bba9beb1|HEAD" || echo "Checking second repo..."

Repository: codeready-toolchain/toolchain-e2e

Length of output: 145


🏁 Script executed:

# Check if these are in development branches by looking at the metlos repos
git ls-remote https://github.com/metlos/api 2>&1 | head -20

Repository: codeready-toolchain/toolchain-e2e

Length of output: 930


🏁 Script executed:

# Check metlos/toolchain-common as well
git ls-remote https://github.com/metlos/toolchain-common 2>&1 | head -20

Repository: codeready-toolchain/toolchain-e2e

Length of output: 1592


🏁 Script executed:

# Now let's check what the actual purpose is - look for any documentation or PR references
# that explain these forks are for development
find . -type f -name "*.md" -o -name "*.adoc" -o -name "*.txt" | xargs grep -l "upgrade-ocp\|metlos" 2>/dev/null | head -5

Repository: codeready-toolchain/toolchain-e2e

Length of output: 59


🏁 Script executed:

# Check the current branch and what it's tracking
git branch -vv

Repository: codeready-toolchain/toolchain-e2e

Length of output: 289


🏁 Script executed:

# Check if there's a PR description or branch name that explains this
git log --oneline -1

Repository: codeready-toolchain/toolchain-e2e

Length of output: 142


🏁 Script executed:

# See if there's any documentation about this specific upgrade work
find . -type f \( -name "*.md" -o -name "*.adoc" \) -exec grep -l "4.21\|OCP.*4" {} \;

Repository: codeready-toolchain/toolchain-e2e

Length of output: 96


🏁 Script executed:

# Check the setup/README.adoc for context about OCP 4.21
cat ./setup/README.adoc | grep -A 10 -B 10 "4.21\|upgrade\|OCP"

Repository: codeready-toolchain/toolchain-e2e

Length of output: 1029


🏁 Script executed:

# Look at the actual commit that's being reviewed
git show 2b57840 --stat

Repository: codeready-toolchain/toolchain-e2e

Length of output: 14309


🏁 Script executed:

# Get the commit message in full
git show 2b57840 --format=fuller

Repository: codeready-toolchain/toolchain-e2e

Length of output: 50393


Replace directives point to personal forks — must be resolved before merge.

The replace directives reference personal forks (github.com/metlos/api and github.com/metlos/toolchain-common) instead of the canonical codeready-toolchain repositories. These appear to be part of companion work on the upgrade-ocp-4.21 branch but cannot be merged as-is:

Options to resolve:

  1. Wait for companion PRs to merge to canonical repositories and update to point to official releases
  2. Remove the replace directives if the changes are no longer needed
  3. Update to point to official pre-release tags if available

Risks of merging with personal forks:

  • Bypasses official code review and release process
  • Commits could be force-pushed or deleted
  • Potential for incompatible API changes affecting types like UserSignup, MasterUserRecord, Space, and utilities from toolchain-common
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@go.mod` around lines 150 - 152, The go.mod contains replace directives
pointing to personal forks (github.com/metlos/api and
github.com/metlos/toolchain-common); remove or replace them with canonical
module paths and appropriate versions/tags before merging. Either (1) change the
replace lines to point at official codeready-toolchain modules with released or
official pre-release tags, (2) remove the replace directives entirely if those
forked changes are no longer required, or (3) keep them only temporarily and
update them to the canonical repositories once the companion PRs are merged;
ensure any types referenced (e.g., UserSignup, MasterUserRecord, Space, and
utilities used from toolchain-common) are compatible with the chosen canonical
versions.

@openshift-ci
Copy link

openshift-ci bot commented Mar 18, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexeykazakov, MatousJobanek, metlos

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [MatousJobanek,alexeykazakov,metlos]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sonarqubecloud
Copy link

@openshift-ci
Copy link

openshift-ci bot commented Mar 19, 2026

@metlos: 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 6db782c link true /test e2e

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.

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.

3 participants