I was going to open a new bug due to a similar issue, but I believe the root cause may be the same.
My issue is that I have the perforce password as an environment variable set at the beginning of the build (technically through the cloudbees folders plus capability for folders to have environment variables, but works the same if you say, inject the environment variable at the beginning of the build). The macro is resolved correctly for the checkout, but fails to resolve if the label portion is used.
I looked at how the variables are being dereferenced, and for getting the decrypted password for the label portion, rather than using the build's environment, only a barebones number of macros are being passed to the substitution, resulting in the same unresolved macro error.
I replaced a single line in src/main/java/hudson/plugins/perforce/PerforceTagAction.java:
190 depot.setPassword(scm.getDecryptedP4Passwd(this.getBuild().getProject(), this.getBuild().getBuiltOn()));
with
190 depot.setPassword(scm.getDecryptedP4Passwd(this.getBuild()));
and after that it works fine in my test environment.
I know this plugin has been eclipsed by the official perforce one, but it's an easy fix. Hey Rob, do you still plan on releasing with patches like this? Should I do a pull request?
Thanks,
Caleb
I was going to open a new bug due to a similar issue, but I believe the root cause may be the same.
My issue is that I have the perforce password as an environment variable set at the beginning of the build (technically through the cloudbees folders plus capability for folders to have environment variables, but works the same if you say, inject the environment variable at the beginning of the build). The macro is resolved correctly for the checkout, but fails to resolve if the label portion is used.
I looked at how the variables are being dereferenced, and for getting the decrypted password for the label portion, rather than using the build's environment, only a barebones number of macros are being passed to the substitution, resulting in the same unresolved macro error.
I replaced a single line in src/main/java/hudson/plugins/perforce/PerforceTagAction.java:
190 depot.setPassword(scm.getDecryptedP4Passwd(this.getBuild().getProject(), this.getBuild().getBuiltOn()));
with
190 depot.setPassword(scm.getDecryptedP4Passwd(this.getBuild()));
and after that it works fine in my test environment.
I know this plugin has been eclipsed by the official perforce one, but it's an easy fix. Hey Rob, do you still plan on releasing with patches like this? Should I do a pull request?
Thanks,
Caleb