Details
-
Type:
Bug
-
Status: Resolved (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Component/s: active-choices-plugin
-
Labels:None
-
Environment:Jenkins 2.6 (win), Active choices 1.4, Chrome 51
-
Similar Issues:
Description
When I create an active choices reactive reference like the wine example but using a checkbox parameter instead an single value selection it won't get updated on changing the checkboxes. If I modify the choice type of the reference parameter to single select it works.
Attachments
Attachments
- config[1].xml
- 10 kB
- example.jpg
- 2 kB
- jenkins2016103101.png
- 314 kB
- jquery.png
- 45 kB
- screenshot-1.png
- 19 kB
- setup.jpg
- 106 kB
- uno-choice-0.15-20161026.hpi
- 1.73 MB
- uno-choice-20161029.hpi
- 1.74 MB
Issue Links
- is duplicated by
-
JENKINS-36868 Unable to get checkbox value from
-
- Closed
-
Activity
ping Matthias Zangl
Sorry for my late response.
I just checked my setup again - I just rebuilt it because since the original request some time passed by I tried to build the same as yours (without the OPTION_B).
And it still does not work with OPTION_A being a multiselect checkbox.
On the chrome javascript console it keeps saying (no matter what I really select - but every click triggers those lines)
cascading changes from parameter OPTION_A...
Values retrieved from Referenced Parameters: OPTION_A=Alpha
What I can't see from your example why OPTION_C is a,g instead of Alpha,Gamma - where does the mapping to the values take place? Maybe that changes something?
As soon as I change my checkboxes to multiselect box it works again.
I'm having the same issue.
If I set the choice type on the Active Choices Parameter to anything other than "check boxes", things seem to work ok. (i.e. - the Active Choices Reactive Parameter referencing the parameter updates correctly).
When it is set to Check boxes, the reactive parameter honors what the default values are at startup, but will not update when they are changed.
Hi Matthias Zangl, thanks for reproducing the issue. And Dean Thackery, thanks too for confirming you also have the same issue.
Other than Jenkins 2.6, Windows, and active-choices-plugin 1.4; any other different in the environment? Any other relevant plug-in? Specially if it is included in the job configuration. Anyone building on Linux?
Ioannis Moutsatsos, if you have time to try to reproduce after Matthias' comment, that'd be great. I'll have some spare time during the next days to work on more issues.
Cheers
Bruno
Hi Bruno,
meanwhile we are on Jenkins 2.7.1 (updated a month ago) - still the same issue. With yesterday's demo I did a completly new job without any other plugins. Of course we've several plugins installed on our jenkins instance.
Just let me know if you need any further details. I can also provide the XML file of the sample job although it's very primitive
thanks,
Matthias
Hi Matthias,
Thanks for the blazing fast reply.
You went out of you way to set up this env and reproduce the issue, and provided excellent information for us. I think now it's our turn to give it a try
When I try to reproduce issues for Jenkins plug-ins, normally I start the plug-in in debug mode, create a job with the name of the ticket, open a notepad, and start writing everything I do, and then post it back here, plus screen shots if necessary.
So once I have some spare time I should update this ticket with my findings too.
Thanks heaps
Bruno
We're building on Linux.
Jenkins version 2.19.1
plugin version 1.4
I found this morning that on a sandbox installation of Jenkins that we have, that the check box update is working. This instance is basically a mirror of our production Jenkins (which we were using to test an update of Jenkins recently, so it has all the same jobs, plugins, etc. installed on it)
The only difference that I found was that in our sandbox (where things appear to be working), we are on older versions of the git plugin and it's dependencies.
Versions on working system:
git 2.4.0
git-client 1.19.0
git-parameter 0.4.0
git-server 1.6
Versions on non-working system:
git 3.0.0
git-client 2.0.0
git-parameter 0.7.0
git-server 1.7
I don't know if this will help of not.
-Dean
The git plugins have no effect on this issue. I updated the plugins in our sandbox, and it still works.
Running with Jenkins 1.580.1, in Eclipse/Maven, in debug mode. Using the latest from the git repository.
Created a job, with two parameters, as in the images provided by Matthias. OPTION_A is a simple active choices, with the following script.
return [ 'Alpha:selected', 'Beta', 'Gamma']
Then, there is OPTION_C, which is an active reactive reference parameter. It references OPTION_A, and has the following script.
return "<b>$OPTION_A</b>"
Attaching a screencast of the job in action.
It works without any problem for me. Will produce a snapshot binary and attach it here.
Attached uno-choice-0.15-20161026.hpi, which contains the same code that I used to try to reproduce the issue. Giving it a last try, by trying to run this hpi with a brand new Jenkins LTS war.
Installed latest plug-in, in a brand new Jenkins 2.19.1. Attaching screen shots.
Followed the same steps described earlier. Copied the OPTION_A and OPTION_C scripts that were added in one of the comments above. Here's the screen cast of the result.
Matthias Zangl I could not reproduce the issue. Dean Thackery thank you for trying it out and confirming you were running on Linux too. Here's my set up:
Jenkins 1.580.1 and Jenkins 2.19.1
Plug-in version: 1.5-SNAPSHOT, latest in Git
Linux Ubuntu 16.04.1
So the best I can guess is that the latest code has some fix, that is not available in 1.14. If that's the case, anyone trying the attached snapshot HPI should be able to test and confirm the issue is gone
Cheers
Bruno
Bruno P. Kinoshita Matthias Zangl I can' reproduce the issue o Windows 10, with Jenkins 2.11 and ActiveChoices v1.4. Sorry...
How can I test it with the hpi you provided? I just copied it to my plugins folder and named it uno-choice.hpi, but the plugin stopped working using the existing testcase.
My jenkins is hosted on Windows 7 using the Jenkins Service.
thanks,
Matthias
Thanks for testing it Ioannis Moutsatsos
Matthias Zangl, preferably in a test server, you go to the plug-in management screen, select the Advanced tab, and upload the hpi there. You can also try to manually install as you did, by placing the hpi file in the plug-ins folder, but find it easier and more reliable to install using the user interface.
I installed a fresh test server on a windows 7 host with jenkins 2.19, default plugins and using active choices 1.4. And now it is working...
I keep on testing if I can get the same behaviour on test server. Currently it is no option to upgrade the production server. But within the next couple of weeks I will upgrade our production server.
I keep you informed about the results.
thanks for your efforts,
Matthias
That's great news Matthias. Kudos for the investigate work
And it is also interesting that the jquery plugin seems to be the issue.
Jenkins plug-in developers use "adjuncts", which are a resource that imports an asset only once. So if two plug-ins need JQuery, what is important is that they are both using adjuncts.
The Delivery Pipeline plug-in seems to be using adjuncts
As well as Active Choices
But the JQuery adjunct version used in both is different. We are a few versions behind.
I just attached a new HPI file (see timestamp). If you have time, could you try this one, with and without the delivery pipeline plugin, please?
Cheers
B
Hi Matthias,
I suspect the Delivery Pipeline Plugin is not really causing this issue.
I started the plugin in debug again in Eclipse. Re-created the job using the same script from my previous commits. Installed the Delivery Pipeline plug-in. Restarted Jenkins. Configured the job to include the Delivery Plugin configuration, with some dummy values.
Everything works fine.
Your Jenkins looks a bit different, and I have never seen theme.js appear in any of my previous errors with JavaScript in Jenkins. Are you sure you don't have another plug-in causing this issue? You may have to do some investigate work, starting always by a blank vanilla Jenkins + active choices, and then slowly adding your other plug-in/dependency/script/etc.
I'll have to work on other issues in this development cycle, and likely won't have time to debug this issue again, unless there is a definite way to reproduce it in my environment (or if there is a pull request ). Will start another development cycle near December anyway, so we can fix it before x-mas and cut a release.
Hi Bruno,
sure, I understand. On my first try to reproduce in my test environment I built it too be similiar as my production server. The theme.js may come from a theming plugin I installed.
I'll start from scratch and see if I can track it down to the JQuery plugin again.
I keep you informed
best regards,
Matthias
Hi Bruno,
ok, started from scratch. I installed the jenkins 2.19.1 using the suggest plugins during installation. After that I installed active choices plugin and built my demo project. As expected it worked. Then I only installed jQuery plugin + restarted jenkins service and the sample stopped working. Disabling the jQuery plugin and restart jenkins service it works again.
At this point I started from scratch again. This time I didn't install any plugins during jenkins installation routine. After installation I just added active choices plugin (including the plugins it obviously depends on), restarted and my example project worked. Then I just installed jquery (and its depending plugins) , restarted and it didn't work anymore.
The host in this sandbox environment was a windows 7 32 bit.
Hope this helps you to reproduce it on your side.
best regards,
Matthias
Matthias Zangl thank you for your investigation. I finally can reproduce this bug and I can confirm that is related not only to the jQuery plugin, but also a particular version of the plugin. Active Choice Reactive references are working as expected with jQuery plugin 1.7.2-1 but not with the latest version 1.11.2-0.
Hopefully Bruno P. Kinoshita will be able to focus on this particular finding to resolve the bug. Thank you both!!
Bruno P. Kinoshita attached is an example to try.
With multi-select you get this
With Check Boxes you get
Note that the checkbox values are not propagated to AC_REFPRAM_C but interestingly, they are propagated to the build!
Code changed in jenkins
User: Bruno P. Kinoshita
Path:
pom.xml
src/test/js/lib/jquery-1.11.2.min.js
src/test/js/lib/jquery-1.7.2.min.js
src/test/js/lib/qunit-1.14.0.css
src/test/js/lib/qunit-1.14.0.js
src/test/js/lib/tests.html
http://jenkins-ci.org/commit/active-choices-plugin/8a97011b547cde9520929a1370e38c0b3a4972ef
Log:
JENKINS-36158: update JQuery to 1.11.2 to match stapler-jquery-adjunct's version
Code changed in jenkins
User: Bruno P. Kinoshita
Path:
src/main/resources/org/biouno/unochoice/stapler/unochoice/unochoice.js
http://jenkins-ci.org/commit/active-choices-plugin/a5f051216707b73f214748bf1717ec9e98acea55
Log:
[FIXED JENKINS-36158] use .prop instead of .attr, and treat it as bool
Previous change was to upgrade JQuery. Then started debugging this issue after a message on the biouno-developers mailing list.
Debugging, could find that a e.attr('checked') was returning undefined, though it was supposed to return something... searching I found some people with similar problem. Looks like e.attr() was replaced by e.prop(), and now it returns boolean.
http://forum.jquery.com/topic/please-explain-attr-vs-prop-change-in-1-6
https://stackoverflow.com/questions/5270689/attrchecked-checked-does-not-work/15385392
Fixed, included in the next release. Thanks!
Bruno
Could you please provide more information about the setup of your parameters. I have not been able to reproduce the issue.
Here is my setup
OPTION_C is a AC reactive reference, similar to how you have described it. It receives as reference parameter the check box values of OPTION_A. OPTION_C is displayed as Formatted HTML using: