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 build
We follow Semantic Versioning 2.0.0, as we do in most projects at ZIRO.
The version can be found in version.txt
. YOU MUST BUMP THE VERSION WHEN MAKING CODE CHANGES.
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>
Snapshots are created automatically when working on untagged commits. To publish a snapshot:
./gradlew publish
This will publish a snapshot with the format <branchName>-SNAPSHOT
(e.g. feature-123-SNAPSHOT
).
Release publishing is handled automatically by CI and is blocked for local development to prevent accidents. When CI runs on tagged commits, it publishes the official release version.
Once you merge your changes, the last thing to do is to go here and publish a new release. Click draft a new release, and select your tag, the previous tag, and click generate release notes. Make sure "Set as the latest release" is selected and publish your release. Now you're good to go!