Dear Travis Team & Community,
I was looking for a way to remove a branch from Travis.
In my case, this is a feature branch which no longer really exists (although GitHub has not garbage collected the commits yet), and it is failing in Travis. I’d prefer to remove this permanent red exclamation mark of shame. I was unaware that Travis would trigger a build for every branch, so this is my fault for not properly reading the documentation. I am still hoping I can get rid of it somehow.
My first search led me here: github - Is there a way to prune Travis's list of branches? - Stack Overflow
which led me here: Branches are retained indefinitely, even after merge & delete · Issue #2614 · travis-ci/travis-ci · GitHub
where it is stated that:
We are working on a new Branches page design, and a few new useful features to it as well.
More information to come soon.
but rather soon it will have been half a decade since these words were posted, so I hope it is not out of place for me to ask for an update. I would be glad for any kind of workaround as well.
I don’t know what you are talking about. “Не who makes no mistakes makes nothing.” If people were able to program flawlessly, there would not be a need for testing and CI in the first place.
AFAICS, if you delete a branch at Github, it’s not deleted from Travis branch view – but it is moved all the way to the bottom of the page to under “inactive branches”. Since you only work with “active branches” and “inactive branches” are only of historical interest (read: none), they don’t in any way hint that the project’s code is flawed or anything.
That said, you can permanently delete a branch at Github instantly – if you do that with the git
client. The effect on Travis is the same though.
E.g. at Travis CI - Test and Deploy with Confidence, I’ve deleted the php
branch at Github and Branch_e35ce419
with Git client (or rather, TortoiseGit that wraps it; there, you can delete a remote branch in the “Browse references” dialog).
I was speaking in jest, I have no shame of failed tests. However, I prefer not to have builds for feature branches show up in the build history in Travis. I’d also prefer not to debate the pros and cons of that choice, in fear of getting off topic. Note that the branch has already been deleted from GitHub, only the commits are still there, because they have not been garbage collected. I would indeed like to remove all builds for this no longer existing feature branch from Travis, I don’t even want them to show up under “Inactive Branches”. To be more concrete, this is the project and it’s the feature-interface2
branch that shouldn’t be there. If you follow the commit to GitHub, you’ll see that this branch does not exist, but the commit is currently still there, and dangling and in fact the commits have recently been garbage collected, so the link to the commit is just a 404.