Rhodecode Pull Requests VCS path
Hello,
We use TeamCity with Rhodecode as source code hosting solution. We can easily trigger builds on commits but to detect pull requests I didn't find any way.
For each pull request Rhodecode generates a shadow repo with an URL like this:
server_url/depo_path/pull-request/PR_Number/repository
as explained here:
As a workaround, I defined two new parameters in my build cfg "branch" and "URL" with the default values "master" and the path to my repo.
Then on rhodecode side I wrote an extension which is triggered on each pull request to start a build through TeamCity REST API with PR URL and branch as argument.
Is there a more straight forward way to do this? Can I overwrite VCS clone URL when I trigger a build via REST API without custom parameters?
My solution doesn't update the pull request with build result.
So is there any way to improve Rhodecode integration?
Best regards,
Alexis.
Please sign in to leave a comment.
Hi Alexis,
First, as you described, every hosting provider handles pull requests in a completely different manner, so it's rather complex to provide a unified solution. Given what you are mentioning, improving integration is going to be hard.
A relatively easy option to ease changing repositories would be assigning the URL to a parameter such as %url%, and then creating another two parameters, say %standard% and %pull_request%, so you can run a build and simply pass the %url% to %pull_request%, but this doesn't change the core of the issue.
Another, maybe even easier option, would be to simply extract the configuration as a template, then create a second configuration specifically for pull requests. This would also be more flexible in that you would be easily able to change the workflow for pull requests if it needs extra stuff without needing to modify anything of the regular build workflow.