Giter Club home page Giter Club logo

github-integrator's Introduction

github-integrator Build Status Coverage Status Stories in Ready

Binds GitHub's PullRequests comments to shell executions.

screenshot

Usage

  • You will have to create a .properties file following the example here;
  • You will have to create a .json file containing the executions configuration, like this;

Right now, the application passes the following parameters down to the script:

  • $1: the pull request origin repository owner login (e.g.: caarlos0);
  • $2: the pull request origin repository name (e.g.: github-integrator);
  • $3: the pull request origin branch (e.g.: feature/more-parameters);
  • $4: the pull request number;
  • $5 to $n: the group values from the regex expression.

Scripts should be fast. If your script is slow, it will hold the execution of other commands until it ends. This will probably be fixed soon.

While we don't have any stable release, you will need to compile the project using Maven:

mvn clean install

Then, you can execute the app like this:

INTEGRATOR_CONFIG=my.properties java -jar \
  target/github-integrator-1.0-SNAPSHOT-jar-with-dependencies.jar

Throughput

Throughput Graph

Contributing

Feel free to try to fix an existing issue or open new ones.

github-integrator's People

Contributors

caarlos0 avatar diego-aslz avatar waffle-iron avatar

Stargazers

Alexsandro Specht avatar  avatar Giovani Zamboni avatar

Watchers

James Cloos avatar

Forkers

diego-aslz

github-integrator's Issues

bug while parsing github json

Exception in thread "main" java.io.IOException: Parse exception converting JSON to object
    at org.eclipse.egit.github.core.client.GitHubClient.parseJson(GitHubClient.java:424)
    at org.eclipse.egit.github.core.client.GitHubClient.parseJson(GitHubClient.java:403)
    at org.eclipse.egit.github.core.client.GitHubClient.parseError(GitHubClient.java:514)
    at org.eclipse.egit.github.core.client.GitHubClient.createException(GitHubClient.java:547)
    at org.eclipse.egit.github.core.client.GitHubClient.get(GitHubClient.java:740)
    at org.eclipse.egit.github.core.client.PageIterator.next(PageIterator.java:173)
    at org.eclipse.egit.github.core.service.GitHubService.getAll(GitHubService.java:151)
    at org.eclipse.egit.github.core.service.PullRequestService.getPullRequests(PullRequestService.java:152)
    at com.carlosbecker.MainIntegrator.work(MainIntegrator.java:52)
    at com.carlosbecker.MainIntegrator.work(MainIntegrator.java:48)
    at com.carlosbecker.App.runOnce(App.java:31)
    at com.carlosbecker.App.run(App.java:25)
    at com.carlosbecker.App.main(App.java:38)
Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:187)
    at com.google.gson.Gson.fromJson(Gson.java:805)
    at com.google.gson.Gson.fromJson(Gson.java:770)
    at org.eclipse.egit.github.core.client.GitHubClient.parseJson(GitHubClient.java:422)
    ... 12 more
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
    at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:387)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176)
    ... 15 more

Happens only when the something is configured wrong in the executions.json (e.g.: the repository doesn't exist)

wrong reply message when using regex

If the regex actually contains a regular expression, the bot will comment the regex without it's parsed groups.

Example:

executions.json (partial):

"regex": "deploy this to (production|staging)"

Comment was:

deploy this to production please

Reply was:

Ok, working on 'deploy this to (production|staging)'...

Reply should have been:

Ok, working on 'deploy this to production'...

reduce the amount of api calls by allowing multiple scripts per repo

Each repo can have one script/regex pair.

In a scenario when a single repo have multiple regex/script pairs, the bot will do more requests than needed to the github api (by getting again the open prs, the comments, et al).

This can be improved by allowing multiple script/regex pairs for repos.

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.