-
Notifications
You must be signed in to change notification settings - Fork 129
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
Order by name first and by id by default #337
Conversation
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.
The change looks good, but two more things are needed:
- Please unit test the
id
(sortKey
, as to be renamed to) functions on individual types, and the respective functions that sort their objects (infile/writer.go
) - Please see the attached comment below
@hbagdi should we consider this a breaking change?
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.
Renaming looks good - the other part of my review seems to remain unsolved:
- Please unit test the
id
(sortKey
, as to be renamed to) functions on individual types, and the respective functions that sort their objects (infile/writer.go
)
This is borderline but I feel this is NOT a breaking change:
Is that fair enough? |
Codecov Report
@@ Coverage Diff @@
## main #337 +/- ##
==========================================
+ Coverage 52.58% 53.66% +1.07%
==========================================
Files 60 60
Lines 4874 4877 +3
==========================================
+ Hits 2563 2617 +54
+ Misses 2013 1962 -51
Partials 298 298
Continue to review full report at Codecov.
|
} | ||
if p.Route != nil { | ||
key += *p.Route.ID | ||
if p.Name != nil { |
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.
non-blocker: you could simplify this. A plugin's name field can never be nil
.
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 thought so too, but then I realized that even if it's impossible, the sortkey()
shouldn't trigger an error for that situation as it's responsability is to sort and not to validate what it is sorting. That's why I wrote it this way.
if s.Name != nil { | ||
return *s.Name | ||
} | ||
if s.ID != nil { | ||
return *s.ID | ||
} | ||
return "" | ||
} |
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.
The sort key for FServiceVersion seems to be missing and we should add that.
It can be done separately or part of this PR - either is fine.
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.
There was neither any compareID()
associated with this type, it seems like it was never sorted
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've added #348 to track it.
If you are interested, please take that on once you this PR is merged in.
Thanks you!
This looks good from a product perspective. Let's merge once technical review is complete. |
No description provided.