Github Schema Checks - How does Apollo studio add schema checks to a PR?

I have the Apollo Studio Github Application enabled for my subgraph repository. If I create a PR to the repository with a few changes and run rover subgraph check... locally, it shows up in Apollo Studio as a schema check and automatically creates a Github check on the PR. However when the same command runs in CI, it is unable to add the check to the PR. How does Apollo Studio decide which PR to update? Is it purely based on the git commit hash?

Rover tries to get the repository remote url, branch name, commit sha, and author from HEAD by default and sends that info to Studio - we refer to it as “GitContext”. Studio then takes that info and creates a “check job” on that PR. My guess is that there’s something strange being done to HEAD in your CI provider. You can override those values with environment variables in cases like these. This is documented here, I hope this helps!

1 Like