sourcegraph/.github
Michael Lin 4a04287e53
ci: add cloud controller gql compat test (#64092)
closes CLO-527


[context](https://sourcegraph.slack.com/archives/CHXHX7XAS/p1721835847010889)

cloud uses a lot of the GraphQL API to pre-configure instances on
customer behave, and it's very sensitive to breaking changes to the
schema upstream.

currently, we have a [cronjob github
actions](https://github.com/sourcegraph/controller/actions/workflows/srcgql-compat.yaml)
that periodically check the schema compatibility every day.

such approach works but we're always playing catch up and will have to
result in extra work on the product team to re-work the PR. it is much
better to catch this in CI time within the monorepo.

This PR added a new github actions to the monorepo that will run on any
`*.graphql` changes. Then it will remotely trigger the cronjob github
action in sourcegraph/controller to run and poll the result. See test
plan for demo.

## FAQ

### Why not run the test in buildkite or directly in this repo using
github actions?

- sourcegraph/controller is a huge repo forhistorical reason (> 2G) and
cloning it is very expensive
- the repo contains sensitive information, and we don't want to make it
possible to expose it accidentally.

### How does authentication work?

We use a [GitHub
App](https://github.com/organizations/sourcegraph/settings/apps/cloud-srcgql-compat-test-invoker)
with extremely limited permissions. It only permits the workflow to
trigger/read the workflow without any access to the source code itself.

Also, GitHub App installation access token has a life span of 1h, much
better than PAT.

![CleanShot 2024-07-25 at 21 58
44](https://github.com/user-attachments/assets/ef29a95d-5465-4e19-ab81-1dd22d14ebd7)

## Test plan

it triggered the job and it worked:

good: https://github.com/sourcegraph/sourcegraph/pull/64094
bad: https://github.com/sourcegraph/sourcegraph/pull/64095
2024-07-30 10:06:49 -07:00
..
ISSUE_TEMPLATE chore(gh): FR template tells where to submit them (#62229) 2024-05-02 14:51:51 -07:00
PULL_REQUEST_TEMPLATE Update .github/PULL_REQUEST_TEMPLATE/browser-extension.md order (#33407) 2022-04-05 17:39:55 +06:00
workflows ci: add cloud controller gql compat test (#64092) 2024-07-30 10:06:49 -07:00
PULL_REQUEST_TEMPLATE.md shorter PR template (#63481) 2024-06-25 17:47:49 -07:00
teams.yml Update teams.yml for product platform teams (#61242) 2024-03-18 14:45:24 -04:00
test.CODEOWNERS Stop tagging @mrnugget (#59184) 2023-12-21 22:04:15 +00:00