Code Monkey home page Code Monkey logo

gerrit-rest-java-client's Introduction

gerrit-rest-java-client

Linux Build Windows Build Coverage Status Quality Gate Technical Dept Dependency Status Maven Central

Introduction

Java implementation of the Gerrit Code Review Tool REST API.

Only Gerrit 2.6 or newer is supported (missing / incomplete REST API in older versions).

This implementation is used for example as base for the Gerrit IntelliJ Plugin.

Many different authentication-methods are supported (HTTP basic, HTTP digest, LDAP with form, HTTP password from Gerrit setting, ...).

Usage

This library implements com.google.gerrit.extensions.api.GerritApi.

You just need a few lines to get it working:

GerritRestApiFactory gerritRestApiFactory = new GerritRestApiFactory();
GerritAuthData.Basic authData = new GerritAuthData.Basic("http://localhost:8080");
// or: authData = new GerritAuthData.Basic("https://example.com/gerrit", "user", "password");
GerritApi gerritApi = gerritRestApiFactory.create(authData);
List<ChangeInfo> changes = gerritApi.changes().query("status:merged").withLimit(10).get();

If you like to write a script instead of a full Java application, you might want to use Groovy. There is a basic Groovy example available.

Note: It is not guaranteed that all interfaces are implemented. If an implementation is missing, you get a com.google.gerrit.extensions.restapi.NotImplementedException. Feel free to implement it and create a pull request at GitHub - it is quite easy! :)

Note: The source of com.google.gerrit.extensions is included in this repository at the moment because not all extensions to this API are merged into Gerrit repository yet.

Maven Artifact

Releases are available with Maven:

<dependency>
    <groupId>com.urswolfer.gerrit.client.rest</groupId>
    <artifactId>gerrit-rest-java-client</artifactId>
    <version>0.8.13</version>
</dependency>

Android Support

Apache HttpClient causes problems on Android platform. There is a workaround by using HttpClient for Android. Android support builds are not officially released, but you should be able to create your own build by using the httpclient-android branch. You probably want to merge master branch into this branch before building it.

Dependencies

This library depends on Apache HttpClient, Gson and Guava.

Your Support

If you like this library, you can support it:

  • Star it: Star it at GitHub. GitHub account required.
  • Improve it: Report bugs or feature requests. Or even fix / implement them by yourself - everything is open source!
  • Donate: You can find donation-possibilities at the bottom of this file.

Donations

If you like this work, you can support it with this donation link. If you don't like Paypal (Paypal takes 2.9% plus $0.30 per transaction fee from your donation), please contact me. Please only use the link from github.com/uwolfer/gerrit-intellij-plugin to verify that it is correct.

Copyright and license

Copyright 2013 - 2017 Urs Wolfer

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

gerrit-rest-java-client's People

Contributors

anaidoo avatar aschi avatar cameleeck avatar edwinkempin avatar forrert avatar hongkailiu avatar irissmann avatar liudongmiao avatar magnayn avatar martinthink avatar sschuberth avatar sstafford avatar timrcoulson avatar trygvis avatar uwolfer avatar

Watchers

 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.