Uh oh!
There was an error while loading. Please reload this page.
🌱 Part 4: Reduce number of variable sources. Required packages - #500
Conversation
1ba218a to
764afeeCompare9e70605 to
fb7fc7dCompare90de92a to
dfee29bComparedfee29b to
7fc644aCompareCodecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@## main #500 +/- ##
==========================================
+ Coverage 84.45% 85.21% +0.76%
==========================================
Files 23 23 Lines 907 893 -14 ==========================================
- Hits 766 761 -5 + Misses 96 91 -5 + Partials 45 41 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
1e883c2 to
1a29986CompareSigned-off-by: Mikalai Radchuk <mradchuk@redhat.com>
1a29986 to
6585f6eCompare| By("running reconcile") | ||
| res, err := reconciler.Reconcile(ctx, ctrl.Request{NamespacedName: opKey}) | ||
| Expect(res).To(Equal(ctrl.Result{})) | ||
| Expect(err).To(MatchError(fmt.Sprintf("no package '%s' found", pkgName))) |
There was a problem hiding this comment.
Since I had similar comments on previous parts of this refactoring & most of our errors use double quotation marks I updated the format here.
I'm happy to revert this and move into a separate PR if this is too distracting
| if versionRange != "" && channelName != "" { | ||
| return nil, fmt.Errorf("no package %q matching version %q found in channel %q", packageName, versionRange, channelName) | ||
| } | ||
| if versionRange != "" { | ||
| return nil, fmt.Errorf("no package %q matching version %q found", packageName, versionRange) | ||
| } | ||
| if channelName != "" { | ||
| return nil, fmt.Errorf("no package %q found in channel %q", packageName, channelName) | ||
| } |
There was a problem hiding this comment.
What do you think about building up the error message as we're building the predicates (since we're already making the necessary conditional checks as we go)?
There was a problem hiding this comment.
I think I'm not in favour of this approach because:
- There are more combinations of errors than we have conditions for predicates. Unless I'm missing something, we will have to add more
ifs under existing predicateifs to get equivalent behaviour - Might be just me, but when I debug an error or read code I appreicate when codebase has unique errors and it is clear which condition yields the error. I found it quite hard to follow what was going on with errors in this PoC which had similar approach.
There was a problem hiding this comment.
I agree with the emphasis on readability here.
m1kola
commented
Nov 10, 2023
For some reasons jobs in the merge queue did not get triggered. Probably will have to wait for it to timeout and requeue again. |
Uh oh!
There was an error while loading. Please reload this page.
Description
Spliting #460 into smaller chunks. Related to #437
In this part I extract code related to creating required package variables from
RequiredPackageVariableSourceandOperatorVariableSourceinto a separate function.RequiredPackageVariableSourcegets removed in this PR.OperatorVariableSourcewill be removed later in #501Reviewer Checklist