Description

I've upgraded from Jenkins 1.653 to 2.36 and P4-Plugin from 1.4.2 to 1.4.12 today and immediately started facing this issue, which broken all my CI build infrstructure, since my bash scripts relay on number provided by P4_CHANGELIST variable.

The issue is that it stores "now" instead of revision number if SCM is synced to head:

As I understand this is only when "Pin build at Perforce Label" is set to "now", e.g. via a Parameter variable.

From build console output:

P4 Task: syncing files at client/label: now
...
+ echo P4_CHANGELISTnow
...
Set build name.
New build name is 'now'

Attachments

Activity

Okay, got it. I will try to rework my job configurations and scripts to avoid "now" as the p4 label and see how it goes.

As I mentioned above, "Pin build at Perforce Label" is set to ${BUILD_NUMBER} in all of my build stage jobs (this is the parameter available to be modified when user selects to build the job manually, currently the default value for it is set to "now" everywhere on my Jenkins and this worked perfectly until P4 Plugin v1.4.6 inclusive).

Multijob is not related in fact, as I also mentioned above in my comments when started investigating this deeper.

Pavel Pigalov
added a comment - 2017-04-12 13:36 Okay, got it. I will try to rework my job configurations and scripts to avoid "now" as the p4 label and see how it goes.
As I mentioned above, " Pin build at Perforce Label " is set to ${BUILD_NUMBER } in all of my build stage jobs (this is the parameter available to be modified when user selects to build the job manually, currently the default value for it is set to "now" everywhere on my Jenkins and this worked perfectly until P4 Plugin v1.4.6 inclusive).
Multijob is not related in fact, as I also mentioned above in my comments when started investigating this deeper.

Paul Allen
added a comment - 2017-04-12 15:43 Try setting the ${BUILD_NUMBER } to an empty string when it is not being used. The code ignores `null` or empty values in the "Pin build at Perforce Label" field.

Pavel Pigalov
added a comment - 2017-05-17 12:13 Moving to Resolved without any fix from code side as per notes above.
SOLUTION is not to use "now" as an indication of head revision, just leave the corresponding parameters values empty instead.

Paul Allen
added a comment - 2017-05-17 12:42 Thank you for looking at and closing the issue.
One final note; Using an empty string will build the latest change and record the change number in the build history, however using now records 'now' in the build history.