Closed buep closed 6 years ago
I'll add the tag 'Bug' to this. This should already be working. Suggestion: We need to write a failing test to ensure that i does actually not work.
The relevant code is here: https://github.com/Praqma/pretested-integration-plugin/blob/3c2178ca2da29970d5e46a073b785a26aa91ff07/src/main/java/org/jenkinsci/plugins/pretestedintegration/PretestedIntegrationPostCheckout.java#L128-L154
Often the post-build step, where we publish successful integrated changes to the SCM requires authorization.
If will be natural to use the same as when authenticating in the Git SCM configuration part of the job, where this is achieved using the Jenkins Credentials plugin. (Alternatively it handled on the build slave configuration, like having ssh-keys configured, but then we do not have to worry as this works transparent from Jenkins).
So we need to first of all test credentials work for both freestyle jobs and pipeline jobs.
We think it is working for freestyle builds and there is still an abstract build object available, where from we can get the credentials used in the Git SCM. We need at test for it though.
For pipeline there is nothing as an abstract build, as pipeline jobs uses the run object two levels higher in the hierarchy and from there the credentials are not available.
To avoid the user have to specify credentials with the pipeline post-build steps, we can automatically copy the credential ID during the Git scm part of the job to a build action, and then our build actions is available in the post-build step to use. This was a suggestion from @bicschneider.