CLID-657: Add warning when using different version for m2d and d2m#1444
CLID-657: Add warning when using different version for m2d and d2m#1444adolfo-ab wants to merge 1 commit into
Conversation
|
@adolfo-ab: This pull request references CLID-657 which is a valid jira issue. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
Caution Review failedAn error occurred during the review process. Please try again later. WalkthroughAdds oc-mirror version metadata persistence and validation to mirror-to-disk and disk-to-mirror workflows. ChangesVersion Metadata Tracking
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (13 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with 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.
Inline comments:
In `@internal/pkg/cli/executor.go`:
- Around line 918-920: The version metadata write error in the
version.WriteVersionMetadata call is being treated as a fatal error that causes
the mirror-to-disk operation to fail completely. Instead of returning an error,
log this as a non-fatal warning to allow the mirror-to-disk operation to
continue successfully, consistent with how similar metadata write failures are
handled in the disk-to-mirror code path. Capture the error from
version.WriteVersionMetadata and pass it to a logging function (e.g., a warning
or info log) rather than wrapping it in a fmt.Errorf return statement.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 998fda2d-0b81-4f19-a5e8-4198e8f31c39
📒 Files selected for processing (4)
internal/pkg/cli/executor.gointernal/pkg/config/metadata.gointernal/pkg/version/metadata.gointernal/pkg/version/metadata_test.go
12fd44e to
0d27216
Compare
aguidirh
left a comment
There was a problem hiding this comment.
Thanks for the PR Adolfo.
I did few suggestions, please let me know if you have questions about them.
|
/test v1-e2e |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: adolfo-ab, aguidirh The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@adolfo-ab: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Description
When users do mirror-to-disk using a given version of oc-mirror, and then disk-to-mirror using a different version, they might find unexpected behaviors if major changes have occurred between versions.
With this PR I propose saving the version metadata during m2d (in
working-dir/internal/oc-mirror-version.json), and then compare it with the version of the binary during d2m. If there is a mismatch or the version metadata file cannot be found, we show a non-fatal warning. For now we compare theGitVersionandGitCommit, but when we are removed from the payload we can consider using the actual version of oc-mirror.Github / Jira issue:
CLID-657
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Summary by CodeRabbit