-
Notifications
You must be signed in to change notification settings - Fork 690
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
Support limiting minimum instances to a time range #404
Support limiting minimum instances to a time range #404
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.
Looks alright, seems like a nice addition to the original feature
8ca8bbf
to
fae79b2
Compare
@@ -130,6 +130,8 @@ | |||
|
|||
private int minimumNumberOfInstances; | |||
|
|||
private MinimumNumberOfInstancesTimeRangeConfig minimumNumberOfInstancesTimeRangeConfig; |
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 about old configs not having this property? Should you manage that in readResolve?
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.
IIUC There is a nullcheck for its usage
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.
Right!
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.
Correct, there's a null check. And I did a quick check now and couldn't find anywhere that I had missed checking. :)
I won't have time to review this for a couple days. |
@jvz do you have the bandwidth to review this? |
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.
A small suggestion but looks fine!
} | ||
|
||
// For some reason, all days will validate against this method so no need to repeat for each day. | ||
public FormValidation doCheckMonday(@QueryParameter boolean monday, |
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.
Maybe a different name if it's valid for all days?
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.
Ideally, yes, but it's some sort of Jelly magic based on the field names.
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. Thanks for tests, too!
import java.util.Map; | ||
|
||
public class MinimumNumberOfInstancesTimeRangeConfig { | ||
|
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 field names are excessively long due to the class name prefix. Is this prefix required?
</f:entry> | ||
</f:rowSet> | ||
</f:optionalBlock> | ||
<f:entry /> |
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.
Is this empty entry element required?
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.
Not required, but it gets really cramped and ugly without it.
Merging tomorrow if no one has any objections |
Follow-up to PR #401, this PR adds the option to limit minimum number of instances to a specific time range.
I got some wishes for that from work so that we don't have build agents up and running all weekend when no one is working.