Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
hide internal labels from UI #18638
hide internal labels from UI #18638
Changes from 2 commits
a0cc309
309497b
d66c7ca
f822cb8
828c722
46922b4
dcd21b5
4885dc1
07236a6
4477559
0627e2b
1d099a5
a85969c
7b0c838
f0623a6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Instead of repeating the same filtering logic in all locations and writing tests for each, why not create a function that removes labels from the map returned by
GetAllLabels
? That way we'd only need to test the new function rather than adding tests for all the places that require this logic.This would isolate all testing to this new func - no need to test all places where the labels are hidden. Also makes it much easier to add new scenarios for hidden labels.
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 agree that function would be good, I could go even deeper because there is no need to repeat logic appending Labels to slice. It looks exactly the same everywhere.
About tests, I actually would like to keep them. I would even love to add more unit tests for those functions, as they are not tested that way. Unless there is a reason not to.
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 with a bit of refactoring, I have added
makeLabels
function that does all the repetitive stuff related to labels.I have also added tests for this function.
All that taken into account I would actually like to leave tests for
MakeServers
etc. as they are. If for no other reason than just to test thatmakeLabels
is used.