Jump to content

Plastic Jenkins plugin fails on repositories containing only one single changeset


Mikael Kalms
 Share

Recommended Posts

Repro steps:

 

1. Create a new, empty repository.

2. Add the following file to the repository with the name Jenkinsfile, and check it in:

pipeline {
	agent any
	
	stages {
		stage ('Fetch PLASTICSCM_CHANGESET_ID') {
			steps {
				echo "Change set ID: ${PLASTICSCM_CHANGESET_ID}"
			}
		}
	}
}

3. Create a new Pipeline job in Jenkins. Set it to be of type "Pipeline script from SCM". Point it to your repository.

4. Tell Jenkins to build the job once.

This is the resulting error message:

Started by user admin
Obtained Jenkinsfile from repository "ChangeSetIdTest@local"
  path "/"
    smartbranch "/main"
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Running on Jenkins in C:\Program Files (x86)\Jenkins\workspace\ChangeSetIdTest
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Declarative: Checkout SCM)
[Pipeline] checkout
[ChangeSetIdTest] $ cm find changeset where date between '2019-02-17T17:07:01' and '2019-02-17T17:08:46' and branch='/main' on repositories 'ChangeSetIdTest@local' --xml --dateformat=yyyy'-'MM'-'dd'T'HH':'mm':'ss
<?xml version="1.0" encoding="utf-8" ?>
<PLASTICQUERY>
  <CHANGESET>
    <ID>6</ID>
    <CHANGESETID>0</CHANGESETID>
    <COMMENT>Root dir</COMMENT>
    <DATE>2019-02-17T17:08:07</DATE>
    <OWNER>[redacted]</OWNER>
    <REPOSITORY>ChangeSetIdTest</REPOSITORY>
    <REPNAME>ChangeSetIdTest</REPNAME>
    <REPSERVER>local</REPSERVER>
    <BRANCH>/main</BRANCH>
    <PARENT>-1</PARENT>
    <GUID>0497ef04-4c81-4090-8458-649885400c84</GUID>
  </CHANGESET>
  <CHANGESET>
    <ID>16</ID>
    <CHANGESETID>1</CHANGESETID>
    <COMMENT>Added jenkinsfile</COMMENT>
    <DATE>2019-02-17T17:08:40</DATE>
    <OWNER>[redacted]</OWNER>
    <REPOSITORY>ChangeSetIdTest</REPOSITORY>
    <REPNAME>ChangeSetIdTest</REPNAME>
    <REPSERVER>local</REPSERVER>
    <BRANCH>/main</BRANCH>
    <PARENT>0</PARENT>
    <GUID>f96514d9-4b05-49e5-98c8-5b2fd5751202</GUID>
  </CHANGESET>
</PLASTICQUERY>
[ChangeSetIdTest] $ cm gwp "C:\Program Files (x86)\Jenkins\workspace\ChangeSetIdTest" --format={1}
C:\Program Files (x86)\Jenkins\workspace\ChangeSetIdTest is not in a workspace.
[ChangeSetIdTest] $ cm diff cs:0@ChangeSetIdTest@local --format={path}#@_sep_@#{revid}#@_sep_@#{parentrevid}#@_sep_@#{status} --repositorypaths
Can't diff cset cs:0@ChangeSetIdTest@local because it doesn't have a parent.
[ChangeSetIdTest] $ cm diff cs:0@ChangeSetIdTest@local --format={path}#@_sep_@#{revid}#@_sep_@#{parentrevid}#@_sep_@#{status} --repositorypaths
Can't diff cset cs:0@ChangeSetIdTest@local because it doesn't have a parent.
[ChangeSetIdTest] $ cm diff cs:0@ChangeSetIdTest@local --format={path}#@_sep_@#{revid}#@_sep_@#{parentrevid}#@_sep_@#{status} --repositorypaths
Can't diff cset cs:0@ChangeSetIdTest@local because it doesn't have a parent.
FATAL: The cm command 'cm diff cs:0@ChangeSetIdTest@local --format={path}#@_sep_@#{revid}#@_sep_@#{parentrevid}#@_sep_@#{status} --repositorypaths' failed after 3 retries
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: The cm command 'cm diff cs:0@ChangeSetIdTest@local --format={path}#@_sep_@#{revid}#@_sep_@#{parentrevid}#@_sep_@#{status} --repositorypaths' failed after 3 retries
Finished: FAILURE

I'm not sure why, but I think that the Jenkins plugin is attempting to find ancestors starting from cset 0, and this operation fails.

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...