Skip to content

Conversation

@deepsm007
Copy link
Contributor

Improves logging in ci-images-mirror to include both source and target digests when skipping image sync operations.

Currently, when ci-images-mirror determines that an image is already in sync (source and target digests match), it logs a debug message but only includes the target digest. This makes it difficult to debug cases where:

  • Images appear to be out of sync (e.g., different release labels) but are marked as "already in sync"
  • The digest comparison logic needs verification
  • Troubleshooting requires manual cross-referencing of multiple log entries

The "Image needs sync" log already includes both digests for comparison, but the "already in sync" log was missing this critical information.

Manual verification showed the images are out of sync:
Source image (internal registry for app.ci): Release label 202601261115.p2.gf3ceb77.assembly.stream.el9
Target image (QCI): Release label 202601201943.p2.g7a68b22.assembly.stream.el9

Example

Before:
{"level":"debug","msg":"Image already in sync, skipping","target":"quay.io/openshift/ci:ocp_4.22_base-rhel9","digest":"sha256:3955031d..."}
After:
{"level":"debug","msg":"Image already in sync, skipping","target":"quay.io/openshift/ci:ocp_4.22_base-rhel9","source":"registry.ci.openshift.org/ocp/4.22:base-rhel9","sourceDigest":"sha256:3955031d...","targetDigest":"sha256:3955031d..."}

@openshift-ci-robot
Copy link
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@coderabbitai
Copy link

coderabbitai bot commented Jan 26, 2026

Walkthrough

A single file receives logging enhancements and comment clarifications in the mirror digest comparison logic. The changes add detailed logging when digests match, insert debug information via "Image needs sync" messages, and expand comments to clarify target digest behavior.

Changes

Cohort / File(s) Summary
Logging and comment enhancements
cmd/ci-images-mirror/main.go
Enhanced logging to include target, source, sourceDigest, and targetDigest fields when digests match. Added info-level log "Image needs sync" with digest details before proceeding. Expanded comments to clarify behavior when target digest is empty.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

✨ Finishing touches
  • 📝 Generate docstrings

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 26, 2026
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: 0

Caution

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

⚠️ Outside diff range comments (1)
cmd/ci-images-mirror/main.go (1)

199-207: Remove duplicate “Image needs sync” log entry.

Two identical Info logs will fire back-to-back, producing redundant noise. Keep only one.

🛠️ Proposed fix
-		// Log sync needed with digest details for debugging
-		s.logger.WithField("source", source).WithField("target", targetImage).
-			WithField("sourceDigest", sourceInfo.Digest).WithField("targetDigest", targetInfo.Digest).
-			Info("Image needs sync")
-
 		s.logger.WithField("source", source).WithField("target", targetImage).
 			WithField("sourceDigest", sourceInfo.Digest).WithField("targetDigest", targetInfo.Digest).
 			Info("Image needs sync")

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 26, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 26, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deepsm007, Prucek

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-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD 9c27eed and 2 for PR HEAD 9757457 in total

@openshift-ci-robot
Copy link
Contributor

Scheduling required tests:
/test e2e

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test integration-optional-test

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 26, 2026

@deepsm007: 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/breaking-changes 9757457 link false /test breaking-changes

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

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.

3 participants