This library provides a convenient interface for interacting with GitHub and ZenHub's GraphQL APIs. It simplifies common operations and offers a structured approach to managing data.
./gradlew clean build
We follow Semantic Versioning 2.0.0, as we do in most projects at ZIRO.
The version can be found in the gradle build file.
We should follow the git-flow process as we do in other projects.
To use this SDK, you will need to set up a valid GitHub and Zenhub tokens via the following environment variables: GITHUB_API_TOKEN
and ZENHUB_GRAPHQL_TOKEN
, respectively.
This may have already been done. You can run the following commands to check:
echo $GITHUB_API_TOKEN # If nothing prints, then you need to set it up.
echo $ZENHUB_GRAPHQL_TOKEN # If nothing prints, then you need to set it up.
If they are not set up, then you can follow these instructions.
There is a GitHubClientSmokeTest.kt file you can explore to better understand how to invoke the API. Furthermore, you can actually run the file. Similarly, there is a ZenHubClientSmokeTest.kt file.
The schemas are found in the corresponding GraphQL folder. However, please note that we do not modify the schema files manually. There is a gradle task to fetch the latest schema from the web for you.
./gradlew updateSchemas
You can write your own graphql queries and mutations by adding them to the corresponding GraphQL folder.
You can modify the graphql queries and mutations as needed, however, you must be careful not to introduce breaking changes. In order to avoid breaking changes, you should follow the Parallel Change Pattern.
When you build the project, kotlin code will be automatically generated from the GraphQL code and added to the classpath. You can use the smoke test classes (as described in Making API Calls) to verify the results.
You will need to configure your environment variables for Sonatype. In your rc file, add the following:
export SONATYPE_USERNAME=gradle
export SONATYPE_PASSWORD=<get password from 1pass>
To publish the SDK, you can run the following command:
./gradlew publish
To publish a snapshot for use during development, you can run the following command:
./gradlew publish -Psnapshot