-
Notifications
You must be signed in to change notification settings - Fork 357
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
chore: add type ResourcePoolName string #8978
Conversation
✅ Deploy Preview for determined-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8978 +/- ##
=======================================
Coverage 47.49% 47.49%
=======================================
Files 1167 1168 +1
Lines 176280 176284 +4
Branches 2352 2352
=======================================
+ Hits 83720 83724 +4
Misses 92402 92402
Partials 158 158
Flags with carried forward coverage won't be shown. Click here to find out more.
|
3a35bca
to
29edead
Compare
29edead
to
749b1b1
Compare
@@ -433,7 +432,7 @@ func (k ResourceManager) ResolveResourcePool( | |||
} | |||
found := false | |||
for _, poolName := range poolNames { | |||
if name == poolName { | |||
if string(name) == poolName { |
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.
What do you think about defining a String()
method for the ResourcePoolName
type?
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'm thinking that it would help differentiate the cases where we're creating a new ResourcePoolName
using string( < text > )
and accessing the value of ResourcePoolName
using resourcePoolName.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.
i like this. i do it in most cases. i know string(name)
works just fine, but if you do type ResourcePoolName string
and define String()
on it, then refactoring ResourcePoolName to not be a string is easier.
but, i mean, it's easy either way, so that isn't a killer argument.
type GetJobQStats struct { | ||
ResourcePool 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.
Just double-checking this change wasn't included by accident? It's fine to include but seems slightly unrelated to the rest of the changes?
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.
Ah I'll add it in the commentary, but this is dead code -- I just came across it in this PR, but we should remove it anyway
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.
No need to include it in the commentary! It's fine as is.
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! Couple minor questions but nothing that requires changes.
don't wait on my review for this, @kkunapuli 's review is sufficient. |
Description
Introduce a new type
ResourcePoolName
string, that replaces resource pool name string input/output in RM methods & provides more description where used.Test Plan
Pass existing tests
Commentary (optional)
I couldn't substitute ResourcePoolName type into sproto messages because of an import cycle -- ideally, as we move away from using sproto messages and simply passing in the variables, we can use ResourcePoolName wherever we pass in a string resource pool name.
Checklist
docs/release-notes/
.See Release Note for details.
Ticket
DET-76