Coder Social home page Coder Social logo

robotboyfriend / pierre-decheck Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alvarocavalcanti/pierre-decheck

0.0 0.0 0.0 687 KB

Dependent Pull Requests Checker

License: MIT License

Makefile 1.33% Python 98.17% Shell 0.17% Dockerfile 0.33%

pierre-decheck's Introduction

Pierre DeCheck - A Dependent Pull-Request Checker

CircleCI

Key Features

It checks for dependent pull requests, both same-repo and external, which should be defined by keywords on either pull request's body or comments:

  • Same repo: Depends on #1
  • External:
    • Depends on alvarocavalcanti/pierre-decheck#1
    • Depends on https://github.com/alvarocavalcanti/pierre-decheck/pull/1

Pierre will perform checks only upon PR creation and Comment Activity (added/removed). In every case it will fetch all the PR's bodies (the PR body itself and from all its comments), extract the dependencies and perform the checks. Thus, it does not observe the dependencies themselves and re-run the checks if their status change.

For now, the best way of re-checking the dependencies statuses is to add a new comment. I suggest pierre re-check. ๐Ÿ˜ƒ

Installation

  1. Checkout/download this repo
  2. Publish the app wherever suits you the best (it has both Heroku and AWS Lambda configuration in place) and take note of the app's URL
  3. Go to the repository you want to set it up, then go to Settings > Webhooks > Add Webhook
  4. Under "Payload URL" enter <YOUR_APP_URL>/webhook
  5. Under "Content type" select "application/json"
  6. Under "Which events would you like to trigger this webhook?" select "Let me select individual events." and then: "Commit comments", "Issue comments", "Issues", "Pull requests" and "Pull request review comments"
  7. Finally, make sure "Active" is selected and then create the webhook
  8. Create an access token for your repo and grant it with either repo:status for Public repos or repo (Full control of private repositories) for Private repos.
  9. Add the token as an environment variable for you app, labeled GITHUB_TOKEN

Usage

  1. Create a pull request on the repository that has pierre set up
  2. Add the keywords Depends on # (for same-repo) or "Depends on owner/repo#" (for external) followed by an issue/pull request number, Depends on #2 or Depends on owner/repo#2, to the pull request description, or later, as a comment. (Alternatively, Depends on <GITHUB_URL_OF_ISSUE_OR_PR> style can be used) Pull Request Checks Example
  3. Every time a comment is added or deleted, pierre will check the dependencies and update the "Checks" section: Pull Request Checks Example

Optional feature: Depending on a Released PR

Usually when one has external dependencies (other repos) these dependencies requires not only a PR to be merged, but also released. To that extent, Pierre offers an optional configuration: by setting the environment variable RELEASE_LABEL to any given value, Pierre will then consider any dependency as met only if its state is closed and if it also has the proper label. On the screenshot below it's possible to see how it looks like when the dependency is closed but does not have the release label:

Pull Request Checks Exemple

Contributing

Contributing document.

Code Style

Code style document.

Recommended IDEs

  1. PyCharm - Community edition is free and decent, Professional edition is awesome
  2. VisualStudio Code - Completely free, large amount of extensions and great community support

References

  1. Github Repo Statuses
  2. Github Webhooks
  3. Github Events
  4. Github Event Types & Payloads
  5. Building a CI Server (Github Guide)

pierre-decheck's People

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.