jenkinsci / jenkins.rb

Deprecated, see https://www.jenkins.io/jep/7
394 stars 83 forks source link

Ruby Runtime 0.12 + Jenkins 1.598 and Above Not Saving Job Parameters #112

Open nikki-rally opened 9 years ago

nikki-rally commented 9 years ago

Hello,

In Jenkins 1.598 and greater + ruby-runtime 0.12 job configs are no longer saving for plugins that use the ruby-runtime plugin. Env is Mac OS X Yosemite.

Steps to Reproduce:

  1. Using a Jenkins >= 1.598
  2. Install the Yammer plugin.
  3. Create a test job
  4. Add Yammer as a Post Build Action, put some string in the field
  5. Save the job
  6. Go back into the job and you will see that the Post Build Action has not saved. If you open the job config.xml you will also observe that the publisher is not getting written.

This has also been observed in the Chef plugin, which also appears to rely on the ruby-runtime plugin (see open issue: https://github.com/melezhik/chef-plugin/issues/4 ).

melezhik commented 9 years ago

+1

n-rodriguez commented 9 years ago

Hi!

I got the same issue with this plugin : https://github.com/codevise/jenkins-mysql-job-databases-plugin

n-rodriguez commented 9 years ago

Jenkins 1.597 logs :

INFOS: Jenkins is fully up and running
getConfigPage -> /builders/create_database/config
getConfigPage -> /publishers/drop_database/config
instance created: #<Builders::CreateDatabase:0x16174a6d> (hudson.tasks.BuildWrapper)
mars 07, 2015 9:12:50 PM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
AVERTISSEMENT: 'stapler-class' is deprecated: hudson.tasks.Shell
instance created: #<Publishers::DropDatabase:0x5bf32ac9> (hudson.tasks.Publisher)

We can see that two instances are created :

instance created: #<Builders::CreateDatabase:0x16174a6d> (hudson.tasks.BuildWrapper)
instance created: #<Publishers::DropDatabase:0x5bf32ac9> (hudson.tasks.Publisher)
n-rodriguez commented 9 years ago

Jenkins 1.598 logs :

INFOS: Jenkins is fully up and running
getConfigPage -> /builders/create_database/config
getConfigPage -> /publishers/drop_database/config
instance created: #<Builders::CreateDatabase:0xe877d8f> (hudson.tasks.BuildWrapper)
mars 07, 2015 9:15:56 PM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
AVERTISSEMENT: 'stapler-class' is deprecated: hudson.tasks.Shell

Only one instance is created :

instance created: #<Builders::CreateDatabase:0xe877d8f> (hudson.tasks.BuildWrapper)

Something seems to be lost around here (or before) : https://github.com/jenkinsci/jenkins.rb/blob/master/ruby-runtime/lib/jenkins/model/descriptor.rb#L57

n-rodriguez commented 9 years ago

Hi there!

Any news?

nikki-rally commented 9 years ago

@n-rodriguez What environment are you seeing this on? So far we have only observed it on Mac OS X Yosemite.

Thx for your info! Attempting to trace down here as well. Suspect lines 66-71 in JobPropertyDescriptor.java ( https://github.com/jenkinsci/jenkins/blob/84c76253862a2f36f813a7aa45b77d99c1616be4/core/src/main/java/hudson/model/JobPropertyDescriptor.java )isn't working right or isn't being called as this appears to be where the newInstance method your reference above is being called from in Jenkins (maybe?). No recent changes to that file though.

n-rodriguez commented 9 years ago

@n-rodriguez What environment are you seeing this on?

I get this behavior on Debian Wheezy (Jenkins prod install with OpenJDK 6) and on ArchLinux (Jenkins development with OpenJDK 8).

nikki-rally commented 9 years ago

Related to this open bug? https://issues.jenkins-ci.org/browse/JENKINS-20262 .

n-rodriguez commented 9 years ago

Suspect lines 66-71 in JobPropertyDescriptor.java ( https://github.com/jenkinsci/jenkins/blob/84c76253862a2f36f813a7aa45b77d99c1616be4/core/src/main/java/hudson/model/JobPropertyDescriptor.java )isn't working right or isn't being called as this appears to be where the newInstance method your reference above is being called from in Jenkins (maybe?).

Good find! An you're right : the newInstance method is not called :

On Jenkins 1.597

INFOS: Jenkins is fully up and running
############## ONE CALL
--- !ruby/object:Java::OrgKohsukeStapler::RequestImpl {}
--- !ruby/object:Java::NetSfJson::JSONObject {}
instance created: #<Builders::CreateMysqlDatabase:0x648edc16> (hudson.tasks.BuildWrapper)
mars 12, 2015 10:09:58 PM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
AVERTISSEMENT: 'stapler-class' is deprecated: hudson.tasks.Shell
############## ONE CALL
--- !ruby/object:Java::OrgKohsukeStapler::RequestImpl {}
--- !ruby/object:Java::NetSfJson::JSONObject {}
instance created: #<Publishers::DestroyMysqlDatabase:0x6d933d31> (hudson.tasks.Publisher)

On Jenkins 1.602

INFOS: Jenkins is fully up and running
############## ONE CALL
--- !ruby/object:Java::OrgKohsukeStapler::RequestImpl {}
--- !ruby/object:Java::NetSfJson::JSONObject {}
instance created: #<Builders::CreateMysqlDatabase:0x648edc16> (hudson.tasks.BuildWrapper)
mars 12, 2015 10:09:58 PM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
AVERTISSEMENT: 'stapler-class' is deprecated: hudson.tasks.Shell
nikki-rally commented 9 years ago

Think I found the problem commit. Culprit appears to be - https://github.com/jenkinsci/jenkins/commit/b3225944d127412a21e9763394bd90a1c870adcf?diff=unified . After reverting the Descriptor.java file to the commit before this ( c01333c346176c93e8cbf93b5822978d8d2c0bff ) I see a return to normal behavior with the plugin build parameters saving as they're supposed to.

sunggun-yu commented 9 years ago

is this fixed?

n-rodriguez commented 9 years ago

@sunggun-yu : seems to be with Jenkins 1.607

sunggun-yu commented 9 years ago

@n-rodriguez Thank you. but, I have same issue with 1.608 and 1.609.

nikki-rally commented 9 years ago

Yes, we experience this problem with 1.598 and above. As noted previously this appears to be due to a reverted commit. We need the ruby-runtime author or core Jenkins authors to weigh in on the course that needs to be taken to fix this.

nikki-rally commented 9 years ago

Appears to be fixed in Jenkins 1.610 . Can anyone confirm?

sunggun-yu commented 9 years ago

@nikki-rally it works with 1.610 so far. I've just tested saving config. Thank you so much.

n-rodriguez commented 9 years ago

@nikki-rally it works :)

nikki-rally commented 9 years ago

Thx for your feedback! Unless anyone has any objections I'm going to close this as I don't see it being fixed for those X number of jenkins any time soon. :)

francos commented 9 years ago

@nikki-rally @sunggun-yu this is still not working for me, I have Jenkins 1.617, is it still working for you?

Nevermind, seems like it worked now, weird :/