jenkinsci / jms-messaging-plugin

https://plugins.jenkins.io/jms-messaging
12 stars 38 forks source link

CI Triggered jobs blank out parameters #137

Closed Lorquas closed 5 years ago

Lorquas commented 5 years ago

I'm seeing an issue similar to https://github.com/jenkinsci/jms-messaging-plugin/issues/134 except for stringParam and textParam (and possibly other param types?).

using a freestyle job with DSL like:

job('reproducer'){
  parameters {
    stringParam('CI_MESSAGE', null, 'UMB CI Message')
    stringParam( 'NAME', 'world', 'Default name.') // also happens for textParam
  }
  steps {
    shell { command('echo hello $NAME') }
  }
}

with an additional ciBuildTrigger added. Whenever this job is triggered by the CI message, all params are blanked out (defaults ignored) with the exception of the CI_MESSAGE parameter. Our current work around is to copy the value of CI_MESSAGE and manually trigger a new run with the previous CI_MESSAGE.

scoheb commented 5 years ago

so the problem is that the defaults are simply ignored if not specified WHEN the job is triggered by the plugin?

Lorquas commented 5 years ago

@scoheb correct. If the above job were triggered by the plugin you'd simply see "hello " in the console output instead of "hello world"

scoheb commented 5 years ago

@Lorquas I have a snapshot version you can try that has a fix: https://ci.jenkins.io/job/Plugins/job/jms-messaging-plugin/job/PR-138/2/artifact/target/jms-messaging.hpi

If you can, please give it a try.

Lorquas commented 5 years ago

@scoheb tested this this morning and it all seemed to work for text/strings/bools. Thanks!