Coder Social home page Coder Social logo

notriddle / autorebase Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tibdex/autorebase

0.0 3.0 0.0 181 KB

GitHub App to automatically rebase and merge pull requests

Home Page: https://github.com/apps/autorebase

License: MIT License

JavaScript 100.00%

autorebase's Introduction

build status

Autorebase

🐼 Automated Pull Request Rebasing and Merging

Autorebase is a GitHub App to automatically rebase and merge pull requests.

Autorebase integrates especially well in repositories with branch protection set up to enforce up-to-date status checks.

Usage

  1. 🔌 Install the publicly hosted Autorebase GitHub App on your repository.
  2. 🔐 [recommended] Protect the branches on which pull requests will be made, such as master. In particular, it's best to enable required status checks with the "Require branches to be up to date before merging" option.
  3. 🏷️ When you're ready to hand over a pull request to Autorebase, simply add the "autorebase" label to it.
  4. ✨ That's it! Pull requests with the "autorebase" label will then be rebased when their base branch moved forward (mergeable_state === "behind") and "rebased and merged" once the required status checks are green and up-to-date (mergeable_state === "clean").

FAQ

How Does It Work?

Autorebase relies on github-rebase (which itself relies on github-cherry-pick) to perform all the required Git operations directly through the GitHub REST API instead of having to clone repositories on a server and executing Git CLI commands.

github-rebase is the 🗝️ to being able to run Autorebase as a stateless, easy to maintain and cheap to operate, Azure Function/AWS Lambda!

Which Permissions & Webhooks Is Autorebase Using?

Permissions

  • Repository contents [read & write]: because the rebasing process requires creating commits and manipulating branches.
  • Issues [read & write]: to manipulate labels relevant to Autorebase on pull requests.
  • Pull requests [read & write]: to merge pull requests.
  • Commit statuses [read-only]: to know whether the status checks are green or not.

Webhooks

  • Push: to detect when a pull request base branch moved forward.
  • Pull request: to detect when the "autorebase" label is added/removed.
  • Pull request review: because it can change the mergeable state of pull requests.
  • Status: to know when the status checks turn green.

Why Recommend Up-to-Date Status Checks?

To "keep master always green".

The goal is to never merge a pull request that could threaten the stability of the base branch test suite.

Green status checks are not enough to offer this guarantee. They must be up-to-date to ensure that the pull request was tested against the latest code on the base branch. Otherwise, you're exposed to "semantic conflicts".

Why Rebasing Instead of Squashing/Merging?

Squashing

Good pull requests are made of multiple small and atomic commits. You loose some useful information when squashing them in a single big commit. Decreasing the granularity of commits on master also makes tools such as git blame and git bisect less powerful.

Merging

Merge commits are often seen as undesirable clutter:

  • They make the Git graph much more complex and arguably harder to use.
  • They are often poorly named, such as "Merge #1337 into master", repeating what's already obvious.

Besides, even when pull requests are "rebased and merged" (actually merged with the --ff-only option), you can still, when looking at a commit on master in the GitHub UI, find out which pull request introduced it.

If you're convinced that rebasing is the best option, you can easily enforce it as the only allowed method to merge pull requests on your repository.

Why Not Clicking on the “Update Branch” Button Provided by GitHub Instead?

Because it creates merge commits and thus exacerbates the issue explained just above.

When Not to Use Autorebase?

Rebasing rewrites the Git history so it's best not to do it on pull requests where several developers are collaborating and pushing commits to the head branch.

What Are the Alternatives?

Why the 🐼 Logo?

Because Autorebase loves eating branches 🎍!

autorebase's People

Contributors

tibdex avatar

Watchers

 avatar  avatar  avatar

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.