diff --git a/docs/source/ci-cd.md b/docs/source/ci-cd.md index 2c3d61b1a..fcdd365c0 100644 --- a/docs/source/ci-cd.md +++ b/docs/source/ci-cd.md @@ -51,7 +51,8 @@ jobs: echo 'export PATH=$HOME/.rover/bin:$PATH' >> $BASH_ENV - checkout # after rover is installed, you can run it just like you would locally! - - run: rover graph check my-graph@prod --schema ./schema.graphql + # only run this command with the `--background` flag if you have the Apollo Studio GitHub integration enabled on your repository + - run: rover graph check my-graph@prod --schema ./schema.graphql --background ``` ## GitHub Actions @@ -124,9 +125,10 @@ jobs: # Add Rover to the $GITHUB_PATH so it can be used in another step # https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#adding-a-system-path echo "$HOME/.rover/bin" >> $GITHUB_PATH + # only run this command with the `--background` flag if you have the Apollo Studio GitHub integration enabled on your repository - name: Run check against prod run: | - rover graph check my-graph@prod --schema ./test.graphql + rover graph check my-graph@prod --schema ./test.graphql --background ``` @@ -283,8 +285,10 @@ If you're running in a Node.js workflow, it might be easier to use the [NPM dist You can use Rover by adding it to your `package.json` dependencies using [these instructions](./getting-started#npm-installer) and then execute it using npm scripts, similar to other workflows you might already have. If you don't want to install Rover as a dependency, you can run it with `npx` by using the `-p` flag: +> **Note:** Only run this command with the `--background` flag if you have the Apollo Studio GitHub integration enabled on your repository. + ```bash -npx -p @apollo/rover rover graph check my-graph@prod --schema=./schema.graphql +npx -p @apollo/rover rover graph check my-graph@prod --schema=./schema.graphql --background ``` Since most commands require you be authenticated, see the above sections for instructions on how to add environment variables for your CI/CD provider. diff --git a/docs/source/commands/graphs.mdx b/docs/source/commands/graphs.mdx index 675e96195..614bb8110 100644 --- a/docs/source/commands/graphs.mdx +++ b/docs/source/commands/graphs.mdx @@ -118,6 +118,12 @@ As shown, arguments and options are similar to [`graph publish`](#graph-publish) To configure the behavior of schema checks (such as the time range of past operations to check against), see the [documentation for schema checks](/studio/check-configurations/#using-apollo-studio-recommended). +If you don't want to wait for the check to complete, you can run the command with the `--background` flag. You can then look up the check's result in Apollo Studio on the Checks tab. + +#### Running checks in CI + +If you're running schema checks in CI, you might want to pass the `--background` flag to `rover graph check`. This flag instructs Rover to initiate schema checks but _not_ await their result. If you've [connected Apollo Studio to your GitHub repository](/studio/github-integration/), the integration detects the checks execution and adds a status to the associated pull request. + ## Deleting a variant ### `graph delete` diff --git a/docs/source/commands/subgraphs.mdx b/docs/source/commands/subgraphs.mdx index a728f633f..0f84cdae2 100644 --- a/docs/source/commands/subgraphs.mdx +++ b/docs/source/commands/subgraphs.mdx @@ -246,6 +246,12 @@ As shown, arguments and options are similar to [`subgraph publish`](#subgraph-pu To configure the behavior of schema checks (such as the time range of past operations to check against), see the [documentation for schema checks](/studio/check-configurations/#using-apollo-studio-recommended). +If you don't want to wait for the check to complete, you can run the command with the `--background` flag. You can then look up the check's result in Apollo Studio on the Checks tab. + +#### Running checks in CI + +If you're running schema checks in CI, you might want to pass the `--background` flag to `rover subgraph check`. This flag instructs Rover to initiate schema checks but _not_ await their result. If you've [connected Apollo Studio to your GitHub repository](/studio/github-integration/), the integration detects the checks execution and adds a status to the associated pull request. + ## Deleting a subgraph ### `subgraph delete`