requesting specific revision via REST API doing a strange thing with workspaces/streams
I am looking at this page, the section describing how to request a build on a specific VCS changelist revision:
https://www.jetbrains.com/help/teamcity/rest/start-and-cancel-builds.html#Run+a+Build+for+the+Specific+Changes+Revision
It says this is the format:
<build branchName="feature1">
<buildType id="buildConfID"/>
<revisions>
<revision version="57ef8447c7e277eda9d4e3ce433795d5eb755a64" vcsBranchName="refs/heads/feature1">
<vcs-root-instance vcs-root-id="vcsRootId"/>
</revision>
</revisions>
</build>
When I use this format, it does start a build - but it's syncing the workspace to a different perforce stream than what I expect. It does ‘Update Sources’ and replaces the previous workspace contents with that of a different depot/stream in our perforce. When I look at the app/rest/builds/id:xxxxx page for the build compared to one started from the UI, I cannot see any difference. The streams and vcs roots are all identical.
EDIT: Upon further examination, it seems that our VCS Root has a “Stream” and then there is a checkbox “Enable feature branches support” which is checked. Then it says “Edit branch specification:” and in the text field is another stream listed.
The stream I WANT, and which the UI uses, is the one listed in the Edit branch specification. But the one being used by the REST API call is the main Stream setting.
Is there any way that I can tell it to use the stream specified in the Enable feature branches support, when using the REST API?
Thanks for any suggestions!
Please sign in to leave a comment.
Stream-enabled Perforce VCS Roots expect the revision format `<stream>|<revision>`
Please try `<revision version="<stream>|<revision>"...` and let me know if it works.
Best regards,
Anton
Well - it DOES seem to want to sync to the correct stream now, which is amazing! I struggled with that so much last week. Thank you!
However, it fails to sync partway through. I get this error - not sure if it's related or maybe a different issue?
I'm sorry for the delay in my responses.
Could you run a new build, reproduce the issue, and share the complete build log for it? Please also share all logs from the build agent and the server (reproducing the issue with the build is needed to make sure that the logs have the related records).
You can upload the logs using https://uploads.jetbrains.com/ and share the upload ID.
Best regards,
Anton
Thanks for the reply - the perforce connection issue was determined to be something affecting other people and is something to do with perforce, not Team City, they think.
Anyway, don't hesitate to let me know if you have any follow-up questions.
Best regards,
Anton