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

Package sort for deterministic ordering in ListBundles API #1084

Merged

Conversation

grokspawn
Copy link
Contributor

@grokspawn grokspawn commented Mar 31, 2023

Description of the change:

Motivation for the change:
solves #1069

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

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 31, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 31, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 31, 2023
@codecov
Copy link

codecov bot commented Mar 31, 2023

Codecov Report

Merging #1084 (59b6138) into master (49eae7b) will increase coverage by 0.03%.
The diff coverage is 100.00%.

❗ Current head 59b6138 differs from pull request most recent head e04391e. Consider uploading reports for the commit e04391e to get more accurate results

@@            Coverage Diff             @@
##           master    #1084      +/-   ##
==========================================
+ Coverage   52.57%   52.61%   +0.03%     
==========================================
  Files         107      107              
  Lines        9384     9389       +5     
==========================================
+ Hits         4934     4940       +6     
+ Misses       3523     3522       -1     
  Partials      927      927              
Impacted Files Coverage Δ
pkg/cache/json.go 53.15% <100.00%> (+1.75%) ⬆️
pkg/cache/pkgs.go 70.63% <100.00%> (+1.03%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

pkg/cache/json.go Outdated Show resolved Hide resolved
@@ -34,6 +35,7 @@ func (pkgs packageIndex) GetPackage(_ context.Context, name string) (*registry.P
CurrentCSVName: ch.Head,
})
}
sort.Slice(channels, func(i, j int) bool { return strings.Compare(channels[i].Name, channels[j].Name) < 0 })
Copy link
Member

Choose a reason for hiding this comment

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

This come up in a different conversation somewhere didn't it? Did we never fix this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe you're thinking of operator-lifecycle-manager/pull/2925 ?

Signed-off-by: Jordan Keister <jordan@nimblewidget.com>
Signed-off-by: Jordan Keister <jordan@nimblewidget.com>
Signed-off-by: Jordan Keister <jordan@nimblewidget.com>
Signed-off-by: Jordan Keister <jordan@nimblewidget.com>
@grokspawn grokspawn marked this pull request as ready for review April 3, 2023 16:05
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 3, 2023
Copy link
Contributor

@tmshort tmshort left a comment

Choose a reason for hiding this comment

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

/lgtm
This solves the ordering issues of the bundles, but not of the package manifests, a related, but separate issue.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 3, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 3, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grokspawn, tmshort

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-merge-robot openshift-merge-robot merged commit 7835ea9 into operator-framework:master Apr 3, 2023
@grokspawn grokspawn deleted the package-sort branch April 3, 2023 18:12
grokspawn added a commit to grokspawn/operator-registry that referenced this pull request Apr 19, 2023
…framework#1084)

* impose order on maps

Signed-off-by: Jordan Keister <jordan@nimblewidget.com>

* now modding GetBundle

Signed-off-by: Jordan Keister <jordan@nimblewidget.com>

* more terse

Signed-off-by: Jordan Keister <jordan@nimblewidget.com>

* forgot bundles

Signed-off-by: Jordan Keister <jordan@nimblewidget.com>

---------

Signed-off-by: Jordan Keister <jordan@nimblewidget.com>
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.

None yet

4 participants