-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: display value selector #85
Conversation
…t display value to the one included in env variables
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.
Thank you for your contribution here, much appreciated!
Left a few comments on the things that I would like to discuss before giving it a green check ;)
src/main/resources/io/jenkins/plugins/restlistparam/RestListParameterDefinition/config.jelly
Outdated
Show resolved
Hide resolved
src/main/java/io/jenkins/plugins/restlistparam/RestListParameterDefinition.java
Outdated
Show resolved
Hide resolved
src/main/java/io/jenkins/plugins/restlistparam/RestListParameterDefinition.java
Outdated
Show resolved
Hide resolved
src/main/java/io/jenkins/plugins/restlistparam/RestListParameterDefinition.java
Outdated
Show resolved
Hide resolved
src/main/java/io/jenkins/plugins/restlistparam/logic/ValueResolver.java
Outdated
Show resolved
Hide resolved
@@ -20,7 +20,7 @@ | |||
<select id="${id}-select" class="setting-input" name="value"> | |||
<j:forEach var="value" items="${it.values}" varStatus="loop"> | |||
<f:option value="${value}" selected="${value.equals(it.defaultValue)}"> | |||
${value} | |||
${value.displayValue} |
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.
while something fancy like select element templating is a option with Select2 I guess this works for now
src/main/resources/io/jenkins/plugins/restlistparam/RestListParameterDefinition/index.jelly
Outdated
Show resolved
Hide resolved
src/test/java/io/jenkins/plugins/restlistparam/RestValueServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/jenkins/plugins/restlistparam/RestValueServiceTest.java
Outdated
Show resolved
Hide resolved
lmk if I missed something, or if you have any more comments |
Thank you for the update I will give this another review either today or tomorrow! |
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.
So far so good, sorry for not noticing the re-run issue lat time around. But other than that I didn't notice any problem besides the other nitpick.
src/main/resources/io/jenkins/plugins/restlistparam/RestListParameterDefinition/index.jelly
Outdated
Show resolved
Hide resolved
src/main/resources/io/jenkins/plugins/restlistparam/RestListParameterDefinition/config.jelly
Outdated
Show resolved
Hide resolved
Sorry for the late update, took a long vacation and it's hard to get back on the grind :D |
Welcome back! No worries, I am currently fighting with the Jenkins Infra, cause it refuses to publish 1.4.2, but I will have a look over your changes once that is dealt with. edit1: just found the reason why I cant release, but am non the wiser https://groups.google.com/g/jenkinsci-dev/c/1-46eS41y6I 😞 edit2: now I know why https://www.jenkins.io/blog/2021/09/04/wiki-attacked and until that situation has been dealt with I am stuck with my local copy waiting to release 1.4.2 to the Jenkins repo. |
# Conflicts: # src/main/java/io/jenkins/plugins/restlistparam/RestListParameterDefinition.java
That sounds terrible, hope they can figure it out soon. PS.: In the meantime, I have a proposal for the server paging problem. It turns out to be kinda difficult, but I do have an immature version that works with nexus flawlessly. It can be found in my fork on the |
NGL I spotted that yesterday, and thank you for exploring that feature! So far, from my glance over it I think your changes look like they follow a direction I wanted to explore with that feature, but I will refrain further comment as I really only glanced over the changes. |
Of course, I'm okay with that. I just wanted to bring this to your attention. It already does what I need it to do, but I'd like it to be something more than just a selfish endevour |
was able to release 1.4.2 today. I will be reviewing this PR on the weekend 😉 |
Hey @rolaca11, I now managed to look at your changes here again. I ran into a couple of minor things that I would like to commit back to you here and discuss if you are alright with that? |
Of course, hit me. It's your codebase, your calls :D |
I just prefer asking before writing to pls branches ;) this now 'works' from a to z (Re-Build included, sorry for focusing on that one xD) However, I ran into an interesting side effect of the change to rely on the values list being set within the |
I don't think I get what you're saying, does it cause problems when upgrading to the new version of this plugin, or some legacy Jenkins versions? |
Sorry, I hoped to have properly tested this over the past week but life got in my way. Anyway, I was referring to upgrading from prior version of this plugin. I will continue to be busy for the next couple of days unfortunately, but I will try to get back to this as soon as possible |
Okay, sorry again for taking ages with your PR. I now have figured out what it is that breaks, but have not yet found a suitable fix for it. (at least not one I am comfortable with) It is save to say that my originally proposed idea of referencing just the index in the values list is not a good idea when trying to rebuild a job. so the value has to be passed directly, however, I really have a problem with dumping that json directly into the value property of the select element 🤔 |
Found some time this weekend to look a bit further into this and here my findings:
Thank you for your contribution and patience with me! edit: while diving into this a bit more I came very close ripping out XML entirely from the plugin cause WHO IN THEIR RIGHT MIND STILL USES XML AS THEIR REST RETURN VALUE IN 2021!? (it is save to assume I got a bit tilted testing for XML) |
Nice, thanks for your time and help and all that. I'm happy to help you with something in connection with the PR if you have anything |
@rolaca11 I just pushed my 'refactor' for the display value logic. If you could take one further look over the changes and give me feedback or fix any glaring issue you may find, I would really appreciate it! You may also notice that I added a notice that XML is not supported, as neither your nor my code is able to handle it. It drove me crazy yesterday and lead to decision that lead to #99. editI should mention that your solution would have allowed for the sub expression to work, in a way, however the output of a XML sub object with or without a display expression would look something like this: 'Input' <row>
<name>v10.6.4</name>
<zipball_url>https://api.github.com/repos/jellyfin/jellyfin/zipball/v10.6.4</zipball_url>
<tarball_url>https://api.github.com/repos/jellyfin/jellyfin/tarball/v10.6.4</tarball_url>
<commit>
<sha>b49cd1d3017f23fc75703829ac2ea1d45d8a4881</sha>
<url>https://api.github.com/repos/jellyfin/jellyfin/commits/b49cd1d3017f23fc75703829ac2ea1d45d8a4881</url>
</commit>
<node_id>MDM6UmVmMTYxMDEyMDE5OnJlZnMvdGFncy92MTAuNi40</node_id>
</row> in a pipeline the parameter value would look like this:
(because of the behaviour that |
oo, now I see why this isn't compatible at all with XML stuff... nice catch. I see no obvious issues with your latest commits, so if you think it can go in, I think it can go in as well. |
src/main/resources/io/jenkins/plugins/restlistparam/RestListParameterValue/value.jelly
Outdated
Show resolved
Hide resolved
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.
This LGTM now. Thank you again for your contribution rolaca!
Description
implements #81
Changes
added a new field to Item class, replaced string list of options to Item list. In the end, the HTML Option tag has the value expression in its value property and the string displayed is the displayValue field.
Issues
Didn't test for xPath. Code's probably terrible, first time working with Jenkins plugins and their dependencies