GithubHelp home page GithubHelp logo

mergerine / github-mergerine Goto Github PK

View Code? Open in Web Editor NEW
8.0 4.0 5.0 2.15 MB

DEPRECATED GitHub bot to automatically merge PRs matching certain criteria.

License: MIT License

JavaScript 100.00%
bot merge merger pull-request prs github-bot

github-mergerine's People

Contributors

andersdjohnson avatar dependabot[bot] avatar jmccann avatar varcheesy123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

github-mergerine's Issues

feat: status integration

We could post a message about what mergerine is waiting for on a given PR as the description using the GitHub Status API. This should be optional. Not sure if the status should be pending or failure or success while waiting.

feat: custom merge commit messages

Allow configuration of custom merge commit messages, possibly through a custom plugin function/module. Enable to override the default squash merge commit message behavior of rolling up the PR's commits' messages in a bulleted list with the PR title at the top. E.g., to pull from the PR's body/description, labels, etc.

Ignore PRs that are stale

Add a config option, for example "staleWhenOlderThan": ["14d"]. After mergerine fetches PRs that match labels and notLabels options, it would filter stale results out before populating its queue.

mergeable state "unknown"

When the mergeable state is "unknown" that means github is calculating mergeability. Github does not calculate this until you call the GET /repos/:owner/:repo/pulls/:number API to probe the status. You then need to wait and hit the GET /repos/:owner/:repo/pulls/:number API again to get the status.

Currently the following causes mergebot to "take longer" then normal:

  • PR is merged
    • This makes all other PRs "outdated"
  • Mergebot polls and all PRs return that mergeable state is unknown
  • Mergebot sleeps
  • Mergebot polls again and all PRs properly return their mergeable state

I propose that:

(

  • if at least 1 PR isn't healthy to take action on (merge/update/wait to finish) AND
  • that at least 1 PR was "mergeable state is unknown"

)
OR
(

  • All PRs return "mergeable state is unknown"

)

That we then wait some smaller defined time and then poll again instead of waiting for the normal interval

feat: schedule merge for future time

Allow configuration of a custom label like merge:2020-01-01 to schedule future merges. If a PR passes all other merge criteria, but has a label indicating a merge should not occur until a future date/time, then skip it on the current cycle.

Push PRs with a high-priority label to the front of the queue.

With the current FIFO strategy, this would help bump critical bug fixes to the front to be merged quicker.

Add a config option, for example "priorityLabels": ["high-priority,urgent,critical"].

Quick and dirty solution: Make two Github fetch calls, one for priorityLabels and one for labels, with priorityLabels populating the end of the array and labels at the front, maintaining FIFO.

Better solution. Make a single Github fetch call and perform a sort algorithm that puts the highPriority items at the end and everything else at the front. Need to maintain the same FIFO order for each set of results.

Example:
[normal3, normal2, normal1, urgent3, urgent2, urgent1]

feat: support Jira issues & smart commits

Look for Jira issues and smart commits in PR description or commit messages on the PR branch and include in the merge commit message body (especially for squash merges and the mergeCommitMessageSimple option).

Clean up the results log messages

The results array logs a list of pull requests objects that are not readable.

results:
   [ { pull: [Object] },
     { pull: [Object] },
     { pull: [Object] },
     { pull: [Object] } ]

Seems like this might be redundant with the "decision" log messages that are already logging pr number and the mergeability state.

2018-06-08T13:22:19.450Z mergerine:decide results 3986,4976,5656,7211
2018-06-08T13:22:19.450Z mergerine:decide 3986 is not clean, not merging
2018-06-08T13:22:19.452Z mergerine:decide 7211 is not clean, not merging
2018-06-08T13:22:19.499Z mergerine:decide 4976 is not behind, not updating
2018-06-08T13:22:19.499Z mergerine:decide 5656 is not behind, not updating

feat: allow disabling updates

Add a configuration field to disable the updating of PR branches, leaving only merges as an operation. Should probably implement as a whitelist of actions/phases to enable, so we're future proof and it's safe for users to update in future if new actions/phases are added that they would not want by default.

feat: optional health endpoint

Optionally, via configuration, include an HTTP server that exposes a health check endpoint so that systems hosting and managing a mergerine instance can ping it to check if it's still running, etc. At least return an HTTP 204 No Content, or 200 OK status with some minimal metadata in the response body - maybe consider this IETF RCF for Health Check Response Format.

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.