apollographql / rover

The CLI for Apollo GraphOS
https://rover.apollo.dev
Other
409 stars 86 forks source link

Support optional operation checks #1447

Open zionts opened 1 year ago

zionts commented 1 year ago

Description

As a new feature of Apollo's schema checks, we are allowing operation checks to be configured as optional via variant-level settings in the checks configuration page. image (see associated FE work in this PR and new API surface area in this monorepo PR)

This new setting will mean that the operations check task will be optional, and the rover subgraph check command will need to be updated to accommodate for that possibility. This has been a feature requested by users for two different reasons

  1. Some users are only interested in running build checks (e.g. for dev workflows)
  2. Some users want operation checks to be less restrictive when there is no traffic (currently, it will fail on any potentially breaking change)

    Acceptance Criteria

    • [ ] Rover subgraph check does not crash when operation checks are disabled
    • [ ] Output from CLI makes it clear that operation checks were disabled
    • [ ] Any API updates required to accommodate this (can be handled via other tickets)
    • [ ] Decide on whether users will be able to override the variant-level configuration with a flag (e.g. --build-only)
d3rp3tt3 commented 1 year ago

This ticket includes the product requirements, with the proposed Rover messaging. The text below is from that ticket. https://github.com/mdg-private/houston-product-design/issues/28

Improvement: API message for no operations and ops checks enabled

Conditions

Current behavior

  1. User or script runs: rover subgraph check
  2. Operations check fails
  3. Error message today:
error[E030]: This operation check has encountered 1 schema change that would break operations 
from existing client traffic. The changes in the schema you proposed are incompatible 
with graph my-graph@my-variant. 
See https://www.apollographql.com/docs/studio/schema-checks/ for more information on 
resolving operation check errors.

Expected behavior

  1. User or script runs: rover subgraph check
  2. Operations check fails
  3. Error message
We didn't detect any operations for your variant, so your operation checks failed. 
If you are using this variant for development and don't want operation checks to run, 
you can turn them off in the configuration page (link to variant's configuration page).

New message: API message for ops checks disabled

Conditions

Behavior

  1. User or script runs: rover subgraph check
  2. Composition checks are run but operations checks are not
  3. Message from API
We didn't run operation checks since they're disabled for this variant. If you use this supergraph 
variant in production, you should use operation checks to detect potentially 
dangerous changes before they go to production. 
Configure schema checks in Studio: (link to checks config page for the variant).
jackonawalk commented 1 year ago

Champion customer asking for this too: https://graphchampions.slack.com/archives/C03QK0PMS01/p1670021179456389