Skip to content

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

Open
@courier-new

Description

@courier-new

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions