batches: migrate structure of selected workspace URL
Created by: courier-new
Closes https://github.com/sourcegraph/sourcegraph/issues/32340.
I initially set out to expose the URL for a selected workspace as a field on a BatchSpecWorkspace
on the GraphQL schema, but that turned out to be a non-trivial refactor, so here we are with a client-side approach that just builds off the execution page path instead.
Changes the URL from:
/users/<username>/batch-changes/<batchChangeName>/executions/<batchSpecID>/execution?workspace=<workspaceID>
to:
/users/<username>/batch-changes/<batchChangeName>/executions/<batchSpecID>/execution/workspaces/<workspaceID>
So it's more consistent with the entities/<entityID>
pattern. To do so I had to nest another layer of router to avoid ugly conditional logic about the relative path, but it's not too bad. Since the SSBC feature is still behind a feature flag, I didn't bother to make it backwards-compatible. I found one link to an old selected workspace URL in our docs, which I updated.
Test plan
Verified manually that I can change the selected workspace from the execution page and visit a URL with a workspace in it to automatically select that one. Since this is part of the sever-side execution feature behind the feature flag, there's no risk to existing users.