-
Notifications
You must be signed in to change notification settings - Fork 103
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
[JENKINS-61068] set correct value on parambuild page #32
Conversation
getDefaultParameterValue is used to get value on parambuild and buildWithParameters urls (trigger build). Those pages use text boxes to represent Active Choices parameters. The method should respect users configuration and return values with ":selected" suffix. If no value contains the suffix, it should return the first element (backward compatibility).
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.
Code looks good. Thanks for adding a unit test.
Just need to find time now to review it with calm, testing and understanding more about this change 👍
Thanks @agabrys !
If you need more details - let me know. I described how the feature works in the JENKINS-61068 ticket. |
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.
Finally had some minutes to review. Code is excellent, the issue has excellent description.
I initially couldn't replicate it. But that's because I was using a multi select element, not a single element.
With a single element, I can reproduce the issue. But my only question about fixing this, is that this could actually introduce another issue.
As far as I know, an HTML input with no multiple selection enabled, shouldn't return two values. The change in this PR appears to change that.
In the image above. States & Cities is the example I always test. Cities has an input for multiple elements, and the last two items have :selected
. The third element is an input for a single element, with just one item with :selected
. Then the test2
has two entries with :selected
, and the HTML input is a single element, but it still has 2 values selected.
So I am a bit reluctant to merge & release it right now. /cc @imoutsatsos any thoughts?
I'm aware of it and I ignored it. Why? The method which I introduced is used only on With this fix the job administrator has control which value(s) will be displayed by default on the
So the PR does not completely fix the problem (you are still able to set multiple values to radio button), but at least the job administrator has control which values will popup as default. No the job administrator does not have any control on |
Roger that @imoutsatsos . Merging tonight, then prepare an hpi and attach to the issue and CC you there. We can postpone the release for a few days/weeks to give you and others time to test it too 👍 Thanks and thanks @agabrys too! |
Hello 🙂 Is any chance for a release in the near future? |
Hi @agabrys just waiting for https://issues.jenkins-ci.org/browse/JENKINS-61751 to be tested/merged too, then planning a release by the end of this month 👍 (or sooner if that issue is solved faster) |
getDefaultParameterValue is used to get value on parambuild and buildWithParameters urls (trigger build). Those pages use text boxes to represent Active Choices parameters.
The method should respect users configuration and return values with ":selected" suffix. If no value contains the suffix, it should return the first element (backward compatibility).