I am running tfs 2015 and have it build when a pull request is create to a certain branch.
It appears that the retention policies are not working on it as they should be only lasting 1 day and they are there for months at a time.
I think the problem is the source branch. on the pull requests builds it has it as the refs/pull/688/merge. The retention policies look for refs/heads/*.
Is this why they are not getting deleted and if so how can I add the pull request builds to get them deleted?
I have tried typing refs/pull/* in the retention but it comes back as refs/head/refs/pull/*
This is due to the refs/pull/688/merge
branch was created and only for the build of pull request. However, the normal branch is refer/heads/(master/feature/...)
. It's not in the branch filters of normal branch. So the build retention has no effect on the pull request build.
For now, you may have to delete the pull request builds manually. You can also add a user voice in this site for this feature request. PM will kindly review it.
It's explained in Microsoft's documentation here. Your Minimum to keep
is not zero, so there will always be something kept for the pull requests "branches".
In your case you want to add a new retention policy with 1 for Days to keep
0 for Minimum to keep
and refs/pull/*
for Branch specification / Branch filters
In 2017 (local, not VSTS) typing /ref/pull/*
doesn't work, you end up with +refs/heads//ref/pull/*
- the + being the include
. Typing refs/pull/*
works fine and you get +refs/pull/*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With