CI/CD and Hive CLI
This guide is a collection of features and capabilities you can configure with Hive, to integrate it with Continuous Integration (CI) Continuous Deployment (CD) setups.
The Hive CLI can be installed on any environment, including CI/CD environments.
Hive CLI under
devDependencies of your project, and use it
directly with your preferred package manager (for example:
yarn hive ... or
pnpm hive ...).
If you are using a different runtime environment for your project, you should install the
Hive CLI binary and use it directly as a binary (
GitHub Check Suites
If you are using GitHub Actions, you can specify an additional flag to the Hive CLI:
If GitHub Integration is enabled for your organization, and
a GitHub repository is linked to the Hive project is
active, you may specify an additional
--github flag to report the results back to GitHub as Check
hive schema:publish schema.graphql --github
hive schema:check schema.graphql --github
We recommend using 2 different models schema publication to Hive:
For your actual runtime (
productiontargets), we recommend using a Hive Client library that runs along with your GraphQL gateway, and publishes the GraphQL schema, along with Usage Reporting feature enabled.
For your development process (
developmenttarget), we recommend using CI pipelines to publish the schema to Hive using Hive CLI:
masterbranch should use
schema:publishcommand to set the schema, once a change has been made and approved.
- Your Pull Request CI pipeline should use
schema:checkcommand to validate the schema and compare it against the latest valid schema of the target.
developmenttarget may also use the Cross-target checks for Conditional Breaking Changes and use real-time traffic from
productionenvironment to determine if a change is breaking or not.
Implementing the above will allow you to:
- Have full control of your schema changes, and be able to identify and manage changes made to your GraphQL schema through Pull Requests.
- Have a complete overview of your GraphQL schema evolution
- Have a clear distinction between your development and production environments, and be able to manage them separately.
- Combine the observability from your
productionenvironment, into the development process, to identify breaking changes before they are merged into