Hello PTC Community,
I have been working with Jenkins and the PTC Plugin for quite some time. And now facing issues at the Check-in stage. I am using Jenkins 2.89.4 and PTC Plug V 2.1.
Our scenario just before PTC Check-in stage:
So my intention is to checkin all files into PTC and still maintaining their "Projectstructure". What I am ending up with is that SomefileLevel1.txt gets updated correctly V1.2 but on any file which is on DirectoryLevel2< the Plugin creates a Directory inside the FolderLevel1 and creates a branched version of SomefileLevel2.txt V 188.8.131.52. I have attached a screenshot of my sandbox to further clarify the situation.
Am I completely misunderstanding the concept here or is this some kind of bug in the Plugin? I am just wondering as many people in forum are successfully using the checkin feature but from my point of view this limits the use of any sub-project structures inside a project.
there are probably multiple solutions, here is mine:
Admin Client > Configuration Management > Policies > Global > Tab Others.
Here you can add additional policies. I highligted the once that are related to your question.
Please give a try.
thank you for your reply.
I sent over the settings to our PTC Admin and he configured the policy for our Playground project. Unfortunatelly I still see the same behaviour. I have attached a screenshot of the project policies.
My understanding is that PTC Plugin works on API Level instead of using the client so this policy settings do not apply to this API interface. Am I correct?
In one of my Log analysis sessions I came acros this part of the log. (See attachment)
Lock failed: The file DirectoryLevel3\PTCCheckinTest.txt is not a current or destined or pending member or a subproject of /Playground/PlaygroundTest/ArnoTest/DirectoryLevel2/project.pj
This error tells me that the plugin tries to lock a member in a directory and obviously fails as the intendet member is inside the project DirectoryLevel3 not the directory.
So later it does the unwanted member add together with a new directory:
si projectadd --user=username --port=7001 --hostname=integrity.company.xyz.com --saveTimestamp --nocloseCP --onExistingArchive=sharearchive --project=#/Playground#PlaygroundTest/ArnoTest/DirectoryLevel2 --cpid=:none --sourceFile=remote://D:\BuildServer\jenkins\workspace\PTC_Playground\ArnoTest\DirectoryLevel2\DirectoryLevel3\PTCCheckinTest.txt --description=Build updates from PTC_Playground #23 -- DirectoryLevel3\PTCCheckinTest.txt returned exit code 0
In contrast on the "root level = #/Playground#PlaygroundTest/ArnoTest/DirectoryLevel2" of the checkin procedure it does the checkin correctly:
si lock --user=username --port=7001 --hostname=integrity.company.xyz.com --project=#/Playground#PlaygroundTest/ArnoTest/DirectoryLevel2 --cpid=:none -- PTCCheckinTestL2.txt returned exit code 0
Attempting to checkin file: D:\BuildServer\jenkins\workspace\PTC_Playground\ArnoTest\DirectoryLevel2\PTCCheckinTestL2.txt
si projectci --user=username --port=7001 --hostname=integrity.company.xyz.com --saveTimestamp --nocloseCP --nodifferentNames --branchVariant --nocheckinUnchanged --project=#/Playground#PlaygroundTest/ArnoTest/DirectoryLevel2 --cpid=:none --sourceFile=remote://D:\BuildServer\jenkins\workspace\PTC_Playground\ArnoTest\DirectoryLevel2\PTCCheckinTestL2.txt --description=Build updates from PTC_Playground #23 -- PTCCheckinTestL2.txt returned exit code 0
It feels like I am missing a setting that forces the PTC plugin to use Sub-Projects instead of Directories for its checkin process.
The settings that Volker mentioned work for si add,but not for si projectadd. The Jenkins Plugin is using si projectadd as it makes a direct connection to the Integrity Server and is not using a sandbox. si add can only be used from a sandbox context.
Looking at the preferences for si projectadd (si viewprefs --command=projectadd --showvalidvalues), I do not see an option for creating subprojects. Without this option, I don't think the Jenkins plug-in as is can create and use subprojects instead of subdirectories.
i tried the "si projectadd" and also in my env is this command just creating a folder, not a project.
Assuming the code you have mentioned above is part of the Jenkins plug-in itself, I would suggest to create a PTC Case and ask for help. The plugin is written and currently maintained by PTC directly.
See this link: https://wiki.jenkins.io/display/JENKINS/PTC+Integrity+Plugin