Giter Site home page Giter Site logo

Autodelete head branches about probot-chain HOT 7 CLOSED

zwn avatar zwn commented on July 19, 2024
Autodelete head branches

from probot-chain.

Comments (7)

ryanhiebert avatar ryanhiebert commented on July 19, 2024

That sounds like a great idea, if we can do it without additional settings. I didn't realize that the setting wouldn't delete the branch if there are dependent PRs, and I'm really happy about that. If we can read the setting to determine whether or not to delete the branch, I'm all for adding in that deleting behavior to this app. I'm not sure when I'll get to it, but a PR would be welcome!

from probot-chain.

ryanhiebert avatar ryanhiebert commented on July 19, 2024

Welp, I made an attempt, but it's not working. I'll have to look at another time.

from probot-chain.

zwn avatar zwn commented on July 19, 2024

I don't know what has changed but now the branch has been deleted after merging the PR even with dependent PR/branch existing. As far as I am concerned, its working! 👍

from probot-chain.

ryanhiebert avatar ryanhiebert commented on July 19, 2024

Can you tell if the branch was deleted by this app?

from probot-chain.

zwn avatar zwn commented on July 19, 2024

The github UI says that I have deleted the branch. On the dependent PR it says "Base automatically changed...". So... I don't know. It used to say that chainbot changed the base branch. Is there anything specific I should check?

from probot-chain.

ryanhiebert avatar ryanhiebert commented on July 19, 2024

Well, I expect that the dependent PR still says that chain bot changed the base branch. I'm wondering if it is hooked up correctly, or if it's deleting it after the hooks run or something.

from probot-chain.

ryanhiebert avatar ryanhiebert commented on July 19, 2024

OK, so it turns out that this whole app is basically unneeded. At least, I won't need it, given what I've found, and I have a hard time imagining a real use-case where someone would need it.

GitHub will automatically change the base of pull requests that currently
have their head set to the branch being deleted if the deleting is done
automatically on merge or via the button on the pull request.

So if you merge a pull request, and then you click the "Delete branch" button:

Delete branch button

Then you'll see this on all the dependent pull requests:

Base automatically changed activity

And this also works if you have GitHub delete branches automatically on merge:

Automatically delete head branches checkbox in settings

So you probably don't need this. If you think you actually do need this, please let me know.

One particular case that might catch you up is that if you delete the branch via the git cli, it will NOT change the base branch of dependent pull requests, it will just close the issues. I expect that for most cases, though, having it delete head branches automatically, potentially combined with branch protection rules, will be the best way to deal with those cases.

from probot-chain.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.