src-cli icon indicating copy to clipboard operation
src-cli copied to clipboard

batches: improve UX when `src batch apply|preview` is run on an unsupported instance

Open courier-new opened this issue 3 years ago • 0 comments

Currently if you run src batch preview|apply on dotcom or another environment where batch changes is unsupported, it will fail on the version check when it tries to query batch changes and GraphQL returns an error. This is a bit hacky and could be cleaned up:

  • Expose a proper field like batchChangesEnabled from the GraphQL root query which can be queried in place of trying to access actual batch changes features, to save a trip to the DB.
    • Where does this live in the schema?
    • What if batch changes is only enabled for certain users?
    • What do we do for instances on an older version of Sourcegraph before this field was introduced?
  • Query this at the same time as the version, as currently, but handle it more elegantly, parsing and providing a nicer error message than just bubbling up the GraphQL wrapped error.
    • Can we point users to a marketing page here?
    • Does this need to happen for other src commands too?

courier-new avatar Feb 02 '22 01:02 courier-new