-
Notifications
You must be signed in to change notification settings - Fork 53
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
Fixes semver range parsing for required packages #423
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #423 +/- ##
==========================================
- Coverage 83.97% 83.78% -0.19%
==========================================
Files 27 27
Lines 1073 1073
==========================================
- Hits 901 899 -2
- Misses 119 120 +1
- Partials 53 54 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
27273d2
to
9775d31
Compare
@@ -31,7 +31,7 @@ type Channel struct { | |||
|
|||
type PackageRequired struct { | |||
property.PackageRequired | |||
SemverRange *bsemver.Range `json:"-"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need a pointer to a function here.
err, | ||
) | ||
} | ||
requiredPackage.SemverRange = &semverRange |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the issue is that we were setting SemverRange
on a copy and not on the instance from requiredPackages
.
I think we have the same issue in master here:
operator-controller/internal/resolution/entities/bundle_entity.go
Lines 234 to 240 in cdb99fa
for _, requiredPackage := range requiredPackages { | |
semverRange, err := bsemver.ParseRange(requiredPackage.VersionRange) | |
if err != nil { | |
return fmt.Errorf("error determining bundle required package semver range for entity '%s': '%w'", b.ID, err) | |
} | |
requiredPackage.SemverRange = &semverRange | |
} |
But I believe it is unused currently in master since we do parsing here anyway:
operator-controller/internal/resolution/variablesources/bundles_and_dependencies.go
Lines 90 to 93 in cdb99fa
semverRange, err := bsemver.ParseRange(requiredPackage.VersionRange) | |
if err != nil { | |
return nil, err | |
} |
Not going to submit a PR for bundle_entity.go
since it is going away as soon as #413 merges.
Signed-off-by: Mikalai Radchuk <mradchuk@redhat.com>
9775d31
to
a603662
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
1e12a2a
Description
Moving fix from #413 into a separate PR.
Reviewer Checklist