Auto build of Azure Pull Requests
Answered
Hi,
Has anyone been able to get Azure Pull Requests to build automatically? I can see the pull/*/merge branch and trigger that manually in TC, and the results get reported back into Azure.
But has anyone gotten these branches to build automatically? I tried various branch trigger patterns to no avail. Can it not be done b/c of this bug?
https://youtrack.jetbrains.com/issue/TW-64647
Any suggestions would be appreciated.
Thanks
Please sign in to leave a comment.
Hello Alex,
Could you please confirm:
1) if you are using Pull Requests feature or have the branch defined in the branch specification (in the VCS root settings)? Could you please send over the VCS root settings and Pull Requests settings if in use?
2) for the VCS trigger, is it correct that newly-created PRs do not trigger for you, or does it affect only the changes in existing PRs? A screenshot of VCS trigger setup would also come handy.
Hi,
In collecting this information, I did come across something I didn't see the first time:
"The branch specification of your VCS Root must not contain patterns matching pull request branches"
My original spec was just +:*. I've changed it to: +:refs/heads/*
Question: Does this rule apply just to the Branch Specification of the VCS Root, or does it also apply to the "Branch Filter" in Additional Options?
Also, do I need to put any kind of filter inside the Pull Request Build Feature settings? Or can I leave that blank?
I've made these changes and it's still not auto building. It does not build for new PRs, nor does it build for PR updates. What can I try next?
Hello Alex,
Yes, the branch specification should not include refs/pull/* branches, and your branch specification looks good. Branch filter is also correct; essentially, branch specification defines a list of available branches, branch filter will further limit it depending on the pattern (in this setup, it allows every branch available from both the specification and Pull Requests feature to be built). The "target branch" filter could further limit the available branches if this is required.
I would like to suggest to check VCS trigger setup; if it has non-default branch filter (which is configured separately), the PR branches may be excluded. Could you please take a screenshot of the VCS trigger settings window? Please also feel free to reach out by using "Submit a request" form at the top of the page - this way, you could also attach teamcity-server.log and teamcity-vcs.log files so I would check if anything is awry (configuration name would be appreciated).
Hey Fedor,
Thanks for the continued help! Here's the trigger setup. I was trying to use a VCS Trigger earlier, but I have it disabled right now. Should I turn it back on?
Here is the vcs log: https://drive.google.com/file/d/1qH8JjLXcj8PJruhd5mXNQythJyvbiu5e/view?usp=sharing
And here is the server log: https://drive.google.com/file/d/12iitp9ZYxWyRCpcMTuMabwvSdBZLGQKv/view?usp=sharing
Hello Alex,
Yes, I would suggest to turn it on to see the PR-related refs build automatically. You may also want to amend the branch filter to either
so to see all branches build automatically (both PR refs and feature branches) or
to automatically trigger just the PR refs. I will check the logs now; in the meantime, could you please let me know if newly-created PR triggers for you after these changes?