Skip to content

Fix ocp-priv CoreOS tag race condition and add error logging#3195

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift-eng:mainfrom
joepvd:fix-coreos-priv-tag-race
Jul 23, 2026
Merged

Fix ocp-priv CoreOS tag race condition and add error logging#3195
openshift-merge-bot[bot] merged 1 commit into
openshift-eng:mainfrom
joepvd:fix-coreos-priv-tag-race

Conversation

@joepvd

@joepvd joepvd commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix race condition where concurrent oc tag calls for the ocp-priv imagestream all try to create it simultaneously, causing AlreadyExists failures. Added a single retry so the second attempt tags into the now-existing imagestream.
  • Log the error when CoreOS mirroring fails — previously it was only sent to Slack and never appeared in Jenkins console output.

Test plan

  • make unit passes (3064 tests)
  • ruff check and ruff format --check pass on changed file
  • Verify in next build-sync-konflux run that the ocp-priv tag no longer fails

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability when tagging private CI images by automatically retrying once after a tagging failure.
    • Added clearer error reporting when CoreOS image mirroring fails, including the affected version and failure details.

Concurrent oc tag calls for the ocp-priv imagestream race to create it
when it doesn't exist yet, causing AlreadyExists failures. Add a retry
so the second attempt tags into the now-existing imagestream.

Also log the error when CoreOS mirroring fails, since previously it was
only sent to Slack and never appeared in Jenkins logs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift-eng/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 508c7feb-8ee8-4d2c-b5a1-553c222f85ad

📥 Commits

Reviewing files that changed from the base of the PR and between 8148432 and d9a0a42.

📒 Files selected for processing (1)
  • pyartcd/pyartcd/pipelines/build_sync.py

Walkthrough

Build synchronization now retries failed private CI imagestream tagging once and logs detailed errors when CoreOS image mirroring fails.

Changes

Build sync reliability

Layer / File(s) Summary
CI imagestream failure handling
pyartcd/pyartcd/pipelines/build_sync.py
Private ocp-priv tagging retries once after a ChildProcessError; CoreOS mirroring failures now log the version and exception alongside the existing Slack notification.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: locriandev, ashwindasr


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error The new error log prints ChildProcessError directly; cmd_gather_async embeds stdout/stderr in that exception, which can leak hostnames or other data. Log a redacted summary (e.g. exit code and sanitized context) instead of the raw exception, or ensure stdout/stderr are stripped before logging.
Ai-Attribution ⚠️ Warning HEAD includes Co-Authored-By: Claude Opus 4.6, but no Assisted-by or Generated-by Red Hat AI trailer. Replace the AI-related Co-Authored-By trailer with the required Red Hat Assisted-by or Generated-by attribution.
✅ Passed checks (9 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the retry fix for the ocp-priv tag race and the added CoreOS error logging.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Weak-Crypto ✅ Passed Patch only adds a retry and error logging in build_sync.py; no weak crypto, custom crypto, or secret comparisons appear.
Container-Privileges ✅ Passed The PR only changes build_sync.py; no container/K8s manifests or privilege flags (privileged, hostPID/network/IPC, SYS_ADMIN, allowPrivilegeEscalation) are introduced.
No-Hardcoded-Secrets ✅ Passed No hardcoded secrets were added: the patch only adds retry/logging code and uses existing env-based kubeconfig/pullspec values.
No-Injection-Vectors ✅ Passed No injection patterns were introduced: the change only adds retry/error logging, and subprocess calls use create_subprocess_exec via exectools, not shell=True or eval-like APIs.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 23, 2026
@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fgallott

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:

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 23, 2026
@openshift-ci

openshift-ci Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

@joepvd: The following tests 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/art-pre-commit-check d9a0a42 link false /test art-pre-commit-check
ci/prow/security d9a0a42 link false /test security

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.

@openshift-merge-bot
openshift-merge-bot Bot merged commit d3df44b into openshift-eng:main Jul 23, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants