Skip to content

Run server-side button should not appear until executors are properly setup

Created by: malomarrec

image

Current state

  • Before executors are setup, users see a prompt to set them up at https://ACME.sourcegraph.com/users/someone/batch-changes/some-batch-change/edit
  • After executors are setup (determined by conf.Get().ExecutorToken != ""), users see a button to Run Batch Spec
  • When admin start setting up executors, there's some amount of time where server-side batch changes is not ready to use, yet conf.Get().ExecutorToken != "" so users see the Run Batch Spec button. Running batch changes server-side will fail, and admin will get noisy bug reports and questions.
  • This is mostly fine for small teams, and unmanageable for large teams with many users, where typically (a) setting up executors will make more time so the confusing UI state will last for a bit (b) more users mean there's more change that they'll stumble on this
  • This problem only exists for self-hosted customers. On cloud, customers get executors by default and never see the "setup executors" screen.

Proposal

  • On cloud instances, no-op.
  • On self-hosted instances:
    • admins have to turn on a setExecutorsLive:true before users see the Run batch spec button. Until this is set to true, all non-admin users see the "set up executors button".
    • admins need to be able to test out executors before the regular users. So this behaviour does not apply to admins. Admins see the Run batch spec button when conf.Get().ExecutorToken != "", regardless of the value of the setExecutorsLive flag.

So here's the experience users get:

Admin:

  • no executor token set: see the "setup executors prompt"
  • executor token set: see the Run batch spec button

Users:

  • no executor token set: see the "setup executors prompt"
  • executor token set:
    • if setExecutorsLive:false still see the "setup executors prompt" -> admins are doing some work
    • if setExecutorsLive:true see the Run batch spec button -> executors are ready