-
Notifications
You must be signed in to change notification settings - Fork 78
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
refactor: split up label command into separate Fetch/GetLabels/GetIDOrName #967
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #967 +/- ##
==========================================
- Coverage 70.01% 63.69% -6.32%
==========================================
Files 245 243 -2
Lines 10715 10723 +8
==========================================
- Hits 7502 6830 -672
- Misses 2537 3178 +641
- Partials 676 715 +39
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Where do you intend to use this? / What is the benefit of this refactor?
internal/cmd/base/labels.go
Outdated
Fetch func(s state.State, idOrName string) (any, error) | ||
SetLabels func(s state.State, resource any, labels map[string]string) error | ||
GetLabels func(resource any) map[string]string | ||
GetIDOrName func(resource any) string |
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.
We could make LabelCmds
generic over the resource structs to get rid of the any
here
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.
Good point, added that in 6d4faef. We could think about doing that for the other structs in internal/cmd/base
as well.
This change is intended for an upcoming resource that has labels but doesn't have numeric IDs.