Skip to content

CLID-687: Add integration test for delete with --force-cache-delete - #1492

Open
adolfo-ab wants to merge 1 commit into
openshift:mainfrom
adolfo-ab:CLID-687
Open

CLID-687: Add integration test for delete with --force-cache-delete#1492
adolfo-ab wants to merge 1 commit into
openshift:mainfrom
adolfo-ab:CLID-687

Conversation

@adolfo-ab

@adolfo-ab adolfo-ab commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Github / Jira issue:

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code Improvements (Refactoring, Performance, CI upgrades, etc)
  • Internal repo assets (diagrams / docs on github repo)
  • This change requires a documentation update on openshift docs

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Expected Outcome

Please describe the outcome expected from the tests.

Summary by CodeRabbit

  • Bug Fixes
    • Improved delete behavior for locally cached repositories.
    • The default delete flow now preserves local cached content.
    • Forced cache deletion removes cached repositories that are not listed in the catalog.
    • Added validation for cache cleanup across disk and registry states, including handling of missing cache paths without disrupting other filesystem errors.

@openshift-merge-bot

Copy link
Copy Markdown
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: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 6, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 6, 2026

Copy link
Copy Markdown

@adolfo-ab: This pull request references CLID-687 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target either version "5.0." or "openshift-5.0.", but it targets "openshift-5.1" instead.

Details

In response to this:

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Github / Jira issue:

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code Improvements (Refactoring, Performance, CI upgrades, etc)
  • Internal repo assets (diagrams / docs on github repo)
  • This change requires a documentation update on openshift docs

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Expected Outcome

Please describe the outcome expected from the tests.

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.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 9c18ab62-891e-400c-9149-85beecca7922

📥 Commits

Reviewing files that changed from the base of the PR and between 6b1bf0d and d8be5d4.

📒 Files selected for processing (2)
  • tests/integration/delete_test.go
  • tests/integration/go.mod
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/integration/delete_test.go

Walkthrough

The delete integration tests now use disk-based mirroring, verify that default deletion preserves the local cache, and cover forced cache deletion for non-catalog repositories.

Changes

Delete cache validation

Layer / File(s) Summary
Default delete flow
tests/integration/delete_test.go
The test mirrors content through disk and verifies that default deletion leaves the local cache intact.
Forced cache deletion
tests/integration/delete_test.go, tests/integration/go.mod
A new test runs deletion with --force-cache-delete=true. Helpers identify non-catalog repositories, inspect tagged cache repositories, handle missing cache paths, and propagate other filesystem errors. The integration module adds k8s.io/apimachinery v0.32.0 as a direct dependency.

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

Mergeability Score: ⚪ Minimal · up to d8be5

The PR adds an integration test and updates test dependency metadata. No actionable merge-blocking risk remains; it is merge-ready after normal checks and review.

Suggested reviewers: aguidirh

🚥 Pre-merge checks | ✅ 13 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning The PR adds Expect(err).NotTo(HaveOccurred()) without a diagnostic message in expectRepositoriesAbsentFromLocalCache; this violates the assertion-message requirement. Add a meaningful message, such as failed to list tagged local-cache repositories: %s, to the new error assertion.
Ipv6 And Disconnected Network Test Compatibility ⚠️ Warning The new Ginkgo It invokes MirrorToDisk with fixtures that reference quay.io, stefanprodan.github.io, and external Helm content, requiring public connectivity. Add internal mirrors or [Skipped:Disconnected] and run periodic-ci-openshift-release-master-nightly-4.22-e2e-metal-ipi-ovn-ipv6 to verify IPv6 compatibility.
✅ Passed checks (13 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding an integration test for delete with --force-cache-delete.
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.
Stable And Deterministic Test Names ✅ Passed The added Ginkgo title is a fixed literal, and existing Describe/It titles contain no runtime values, generated identifiers, timestamps, nodes, namespaces, or IPs.
Microshift Test Compatibility ✅ Passed The new Ginkgo test uses oc-mirror commands, a local registry, filesystem cache checks, and image-set configuration only; it references no unavailable MicroShift API, namespace, or cluster feature.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The added Ginkgo tests exercise local cache and registry filesystem behavior only; they contain no node, topology, scheduling, affinity, scaling, or HA assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed The PR diff only changes tests/integration/delete_test.go and its go.mod dependency; it adds no deployment, operator, controller, or scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The PR adds only test-case code and filesystem checks. No fmt/log/klog/os.Stdout writes or suite-level setup output were added; runner output is captured in buffers.
No-Weak-Crypto ✅ Passed The PR changes only integration-test filesystem logic and a dependency declaration; the diff introduces no MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The parent-to-HEAD diff changes only a Go integration test and go.mod; it adds no container/Kubernetes manifest or privileged setting.
No-Sensitive-Data-In-Logs ✅ Passed The diff adds only static test step labels and a failure message with fixture-derived repository names; it introduces no logging of passwords, tokens, PII, hostnames, or customer data.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@openshift-ci
openshift-ci Bot requested review from aguidirh and r4f4 August 6, 2026 08:24
@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adolfo-ab

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 Aug 6, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/integration/delete_test.go`:
- Around line 158-161: Update listLocalCacheTaggedRepositories’s filepath.Walk
callback to return relErr when filepath.Rel fails, allowing the walk error to
propagate; append repoPath only after successful relative-path resolution.
🪄 Autofix

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: Pro Plus

Run ID: de5d15e7-1869-4b98-a4de-95fa18542725

📥 Commits

Reviewing files that changed from the base of the PR and between 75a5e05 and 6b1bf0d.

📒 Files selected for processing (1)
  • tests/integration/delete_test.go

Comment thread tests/integration/delete_test.go
Comment thread tests/integration/delete_test.go Outdated
@openshift-ci-robot

openshift-ci-robot commented Aug 13, 2026

Copy link
Copy Markdown

@adolfo-ab: This pull request references CLID-687 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target either version "5.0.0." or "openshift-5.0.0.", but it targets "openshift-5.1" instead.

Details

In response to this:

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Github / Jira issue:

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code Improvements (Refactoring, Performance, CI upgrades, etc)
  • Internal repo assets (diagrams / docs on github repo)
  • This change requires a documentation update on openshift docs

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Expected Outcome

Please describe the outcome expected from the tests.

Summary by CodeRabbit

  • Bug Fixes
  • Improved delete behavior for locally cached repositories.
  • The default delete flow now preserves local cached content.
  • Forced cache deletion removes cached repositories that are not listed in the catalog.
  • Added validation for cache cleanup across disk and registry states, including handling of missing cache paths without disrupting other filesystem errors.

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.

@openshift-ci

openshift-ci Bot commented Aug 13, 2026

Copy link
Copy Markdown

@adolfo-ab: all tests passed!

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.

@r4f4 r4f4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 14, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

No second-stage tests were triggered for this PR.

This can happen when:

  • The changed files don't match any pipeline_run_if_changed patterns
  • All files match pipeline_skip_if_only_changed patterns
  • No pipeline-controlled jobs are defined for the main branch

Use /test ? to see all available tests.

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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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