Allow setting float values for cost factor in runner edit
What does this MR do and why?
In short: allows to define float numbers as cost factors in the runner edit form.
Float is the data type that we store in the database. It's also what we use in GraphQL. In fact - some of the SaaS Linux Runners on GitLab.com have the cost factor set to a non-integer value like 0.04
.
Unfortunately, without this change only integer values are allowed by the browser. Which means that in case of the example SaaS Linux Runner mentioned above, I'm unable to do any edits as the browser fails form validation and disallow to submit the form..
According to the spec here and here, the type="number"
input field is by default set to step="1"
. Which means that only integer numbers are allowed and newer browsers are forcing such validation.
By setting this to step="any"
we allow to set the cost factor to any numerical value.
Screenshots or screen recordings
before | after |
---|---|
How to set up and validate locally
- You should have a EE license and simulate running .com (
gon.dot_com is true
) - Visit Admin -> Runners and select any runner
- The fields
Public projects Minutes cost factor
andPrivate projects Minutes cost factor
should be available - Verify you can input any number (especially numbers between 0 and 1, like 0.33).
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.