Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1904297: Unexpected images left in related_images after pruning #556

Merged
merged 2 commits into from Jan 19, 2021

Conversation

ecordell
Copy link
Member

@ecordell ecordell commented Jan 18, 2021

Description of the change:
Removes stranded bundles (bundles that are not referenced by any channel entry) after a prune operation.

This also abstracts database opening via a package that ensures foreign keys are always enabled - this bug was harder to fix because of this (even querying the db to check if foreign keys are enabled will lie to you if the db is not opened with that flag).

Motivation for the change:
Pruning is often done right before mirroring. If dangling bundles are not removed on prune, it can lead to unexpected images being mirrored.

It looks like this fixes #542

Reviewer Checklist

  • Implementation matches the proposed design, or proposal is updated to match implementation
  • Sufficient unit test coverage
  • Sufficient end-to-end test coverage
  • Docs updated or added to /docs
  • Commit messages sensible and descriptive

the only exception is if the db is opened in read-only mode
pruning is often done right before mirroring, and leaving stranded
bundles can lead to unexpected images in the image list.
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Jan 18, 2021
@openshift-ci-robot
Copy link

@ecordell: This pull request references Bugzilla bug 1904297, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1904297: Unexpected images left in related_images after pruning

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/test-infra repository.

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ecordell

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

The pull request process is described here

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 openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 18, 2021
@codecov
Copy link

codecov bot commented Jan 18, 2021

Codecov Report

Merging #556 (3a6c629) into master (8e6c13f) will increase coverage by 0.03%.
The diff coverage is 44.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #556      +/-   ##
==========================================
+ Coverage   49.45%   49.49%   +0.03%     
==========================================
  Files          90       91       +1     
  Lines        6317     6302      -15     
==========================================
- Hits         3124     3119       -5     
+ Misses       2497     2492       -5     
+ Partials      696      691       -5     
Impacted Files Coverage Δ
pkg/appregistry/dbloader.go 0.00% <0.00%> (ø)
pkg/lib/indexer/indexer.go 6.93% <0.00%> (ø)
pkg/sqlite/query.go 67.08% <0.00%> (ø)
pkg/sqlite/remove.go 0.00% <ø> (ø)
pkg/sqlite/stranded.go 0.00% <0.00%> (ø)
pkg/sqlite/load.go 41.67% <46.87%> (-0.12%) ⬇️
pkg/sqlite/db.go 50.00% <50.00%> (ø)
pkg/appregistry/builder.go 31.73% <100.00%> (ø)
pkg/mirror/mirror.go 34.14% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e6c13f...32f7902. Read the comment docs.

@ecordell
Copy link
Member Author

/retest

@kevinrizza
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 19, 2021
@estroz
Copy link
Member

estroz commented Jan 19, 2021

/test e2e-aws

@openshift-ci-robot
Copy link

@ecordell: This pull request references Bugzilla bug 1904297, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

Bug 1904297: Unexpected images left in related_images after pruning

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/test-infra repository.

@ecordell
Copy link
Member Author

/retest

@openshift-merge-robot openshift-merge-robot merged commit 064f85a into operator-framework:master Jan 19, 2021
@openshift-ci-robot
Copy link

@ecordell: All pull requests linked via external trackers have merged:

Bugzilla bug 1904297 has been moved to the MODIFIED state.

In response to this:

Bug 1904297: Unexpected images left in related_images after pruning

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/test-infra repository.

@kevinrizza
Copy link
Member

/cherry-pick release-4.6

@openshift-cherrypick-robot

@kevinrizza: new pull request created: #560

In response to this:

/cherry-pick release-4.6

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/test-infra repository.

@jianzhangbjz
Copy link
Contributor

/label qe-approved

@openshift-ci-robot openshift-ci-robot added the qe-approved Signifies that QE has signed off on this PR label Jan 26, 2021
@openshift-cherrypick-robot

@kevinrizza: new pull request could not be created: failed to create pull request against operator-framework/operator-registry#openshift-cherrypick-robot:cherry-pick-556-to-release-4.6 from release-4.6: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for openshift-cherrypick-robot:cherry-pick-556-to-release-4.6."}],"documentation_url":"https://docs.github.com/rest/reference/pulls#create-a-pull-request"}

In response to this:

/cherry-pick release-4.6

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/test-infra repository.

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. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"opm index prune" leaves (what appear to be) unrelated operators
7 participants