-
Notifications
You must be signed in to change notification settings - Fork 72
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-62305] Make password parameters work with the build step in Jenkins 2.236+ #46
Conversation
…ter values to secrets
…ls parameters over password parameters
src/main/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStep.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStepTest.java
Show resolved
Hide resolved
@@ -8,6 +8,24 @@ | |||
|
|||
Adds the Pipeline `build` step, which triggers builds of other jobs. | |||
|
|||
### Passing secret values to other jobs |
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.
Mention also in help-parameters.html
.
src/test/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStepTest.java
Show resolved
Hide resolved
FWIW, I realized that snippet generation for password parameters is already broken even on older versions of Jenkins. You can fix it using
Even so, at least snippet generation works with that patch, so I'll push it to the PR branch. |
See JENKINS-62305.
jenkinsci/jenkins#4630 changed the
@DataBoundConstructor
forPasswordParameterValue
so that one of its parameters is aSecret
, butSecret
is not supported by data binding viaDescribableModel
instructs
.This PR uses
CustomDescribableModel
to maintain compatibility with existing uses of thebuild
step with password parameters, and adds documentation explaining that credentials should be preferred over password parameters going forward.TODO: Do we want to add a runtime warning (e.g. message in the build log) any time a password parameter is used with the
build
step? My understanding is that while password parameters are not ideal, they are not completely broken, so I am a little hesitant to add a warning if the issues are relatively minor.Other things that are broken and that this PR does not attempt to fix:
<object of type hudson.util.Secret>
, so we'd need to implementcustomUninstantiate
to fix that.build
step (https://www.jenkins.io/doc/pipeline/steps/pipeline-build-step/). Once the job that creates those docs is updated to run against Jenkins 2.236 or higher, it will fail. A special case will need to be added to https://github.com/jenkins-infra/pipeline-steps-doc-generator to handlePasswordParameterValue
.