Comments (21)
This might not be needed now that GitHub has added the ability to auto-delete feature branches after PR merges: https://help.github.com/en/github/administering-a-repository/managing-the-automatic-deletion-of-branches
I'd argue this is more important now - with that feature turned on, stale branches tend to be orphaned/abandoned, or long-lived branches now, as opposed to work that's being actively worked on.
Whitelist your long-lived branches, enable auto-prune of merged branches, and then let stale
clean up the abandoned branches.
The ideal workflow for this would be to raise a PR with the name "Pruning [branch]", auto-close it, then delete the branch - this would let users browse closed PRs if they need to get back to a branch which has been pruned.
You can have head branches automatically deleted after pull requests are merged in your repository.
from stale.
This might not be needed now that GitHub has added the ability to auto-delete feature branches after PR merges: https://help.github.com/en/github/administering-a-repository/managing-the-automatic-deletion-of-branches
You can have head branches automatically deleted after pull requests are merged in your repository.
from stale.
what would the interface look like here?
- deleteStaleBranch: true
- daysUntilBranchStale: 60
- exemptStaleBranchMatches:
- gh-pages
- "long-running.*"
from stale.
Wow! Over 4 years later and still no traction here!
This might not be needed now that GitHub has added the ability to auto-delete feature branches after PR merges: https://help.github.com/en/github/administering-a-repository/managing-the-automatic-deletion-of-branches
I'd argue this is more important now - with that feature turned on, stale branches tend to be orphaned/abandoned, or long-lived branches now, as opposed to work that's being actively worked on.
Whitelist your long-lived branches, enable auto-prune of merged branches, and then let
stale
clean up the abandoned branches.The ideal workflow for this would be to raise a PR with the name "Pruning [branch]", auto-close it, then delete the branch - this would let users browse closed PRs if they need to get back to a branch which has been pruned.
**Managing the automatic deletion of branches - GitHub Help**You can have head branches automatically deleted after pull requests are merged in your repository.
Agree this is still super important today. As @peter-dolkens points out, there are plenty of edge cases where a PR isn't merged or even opened in the first place but still orphaned branches remain.
I work at a modestly sized organization with roughly 60 engineers and even with GitHub's native automatic deletion of branches after merge, we still have 500+ stale branches on one of our most used repositories. There are many downstream CI/CD systems that maintain history for these branches until they are deleted upstream.
You can have head branches automatically deleted after pull requests are merged in your repository.
from stale.
+1 for this as well, should be reopened.
I have a huge number of orphaned branches w/o PRs I'd love to have stale bot clean up.
These are usually under /branches/stale
on the repo.
Our org has several hundred that will never get purged unless we have some automation.
from stale.
I think people missing the point branches can be created on the fly and not neccessarily branch that you create PR from is the branch you started off with and soon you end up with lots of stale branches in the repository if you work in a larger team.
from stale.
Mostly agree with the notes. I would say that automatically pruning branches on merge
is fine, however, if a PR is closed
a probot comment with grace period would be good because often PRs can be closed and not merged when the work still a WIP and plans to be re-visited. This gives user option to add to whitelist before the branch is automatically deleted.
re: prune branch that haven't been pushed to in X days. Yeah, disabled by default, and "default" days number should even be 6mo-1yr
While we're on the topic, what do folks think of a tool that detects stale repos themselves? I find a lot of open source projects/companies grow the number of repos over time and most of them are completely deprecated after a while.
from stale.
was considering building this app, but looks like its already been done by @SvanBoxel here 🎉
from stale.
Any updates on this? because we should not add another bot just for deleting branches, stale
should be able to do it when asked.
from stale.
I like it. I was imagining that functionality would belong in a separate app, but as I think more about it, I think it makes sense to be part of stale. Here's a few notes on how I imagine it would work:
- Automatically prune the branch on
pull_request.closed
(it can easily be reverted from the GitHub UI) - Prune branches that haven't been pushed to in X days
- Support for a whitelist of branches not to prune (e.g. long-lived branches for beta/stable releases)
from stale.
For the purpose of the current system of defaults in stale, I think that:
Automatically prune the branch on pull_request.closed (it can easily be reverted from the GitHub UI)
should be set to true by default, since it's very easily undone. However, is it worth throwing a check for whether the PR was merged or not? I know I have accidentally closed PRs on my phone before, and there are lots of cases for closing a pr but still using the branch somewhere else.
Prune branches that haven't been pushed to in X days
should be set to either a very high number (90?) or disabled by default.
from stale.
While we're on the topic, what do folks think of a tool that detects stale repos themselves?
My 2c: I think it is hard to detect stale repos. Repos that have no activity may still be consumed as packages by other projects. It is also not going to save cost as Github charges per user and not per repo.
from stale.
Is this still relevant? If so, please comment with any updates or addition details.
from stale.
I think this is still relevant.
from stale.
Support for a whitelist of branches not to prune (e.g. long-lived branches for beta/stable releases)
Does github expose the protected branches set up in the repo? I'd like to be able to use that so my configuration on a repo is not split too much.
from stale.
Perhaps, you could apply one of the exemptLabels
within the branch name for safe-keeping?
fix/bugBasher2867-everFresh
from stale.
I was imagining that functionality would belong in a separate app, but as I think more about it, I think it makes sense to be part of stale.
i can certainly see how this functionality would be useful to existing users of the stale bot, but i could also see this being more separate. i am personally not a stale bot user, but i'd love to have some automated help cleaning up old branches
from stale.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
from stale.
Yes, it is still relevant.
from stale.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
from stale.
+1 for this. Whilst automatic branch deletion on PR merge is very nice, it doesn't solve the problem of engineers naturally creating many test/experimental branches that just never get merged into mainline. You can't effectively force all engineers in your company to have "Github cleanup" days - automation is the solution. A per-org "maximum unprotected branch age" or similar would be a decent start.
from stale.
Related Issues (20)
- stale.yml doesn't take effect in apache/apisix HOT 5
- Should this be used anymore? HOT 13
- Unable to access private repository HOT 1
- Exponential backoff HOT 1
- Stalebot stopped work (last message Oct 28th) HOT 3
- Stale bot is not working in Apache SeaTunnel HOT 1
- Require a (merge/rebase) commit to un-stale a PR HOT 1
- Trouble activating the bot
- Support ignoring all pull requests
- How to install stale on GitHub Enterprise.
- Why was this closed? How do we prevent this? HOT 9
- Link in the "about" section of the repo is incorrect HOT 2
- Is there a way to send messages to slack as well?
- Continued issues with this bot: HOT 8
- New Github Issues: Close reasons HOT 3
- Question regarding label configuration
- [question] Stale in my project seems stop working after Jul HOT 2
- Is this Project even maintained anymore? HOT 5
- Is it possible to support `stale.yaml` in addition to `stale.yml`?
- stale website url returns 404
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stale.