Skip to content

Conversation

@eseliger
Copy link
Member

@eseliger eseliger commented Aug 15, 2022

This is available as a faster API from the backend now, so no need to keep this duplicative, slower code. This is a 4.0 deprecation execution.

Comes with https://github.com/sourcegraph/sourcegraph/pull/40426.

Closes https://github.com/sourcegraph/sourcegraph/issues/38968.

Test plan

Verified execution still works.

repos, _, err := svc.ResolveRepositoriesOn(ctx, &on)
if err != nil {
return errors.Wrapf(err, "Resolving %q", on.String())
_, repos, err := svc.ResolveWorkspacesForBatchSpec(ctx, spec, allowUnsupported, allowIgnored)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, this doesn't show the individual queries anymore. A follow-up will deprecate this command and create a new workspaces command as a replacement, that has a more elaborate output, and also properly supports workspaces as a native feature.

This is available as a faster API from the backend now, so no need to keep this duplicative, slower code. This is a 4.0 deprecation execution.
@eseliger eseliger force-pushed the es/no-local-workspace-resolver branch from 6af22f2 to 34f8f9f Compare August 16, 2022 14:44
@eseliger eseliger marked this pull request as ready for review August 22, 2022 13:16
@eseliger eseliger requested review from a team and mrnugget August 22, 2022 13:16
Copy link
Contributor

@courier-new courier-new left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YAY SO MANY DELETIONS!! 🎉

Co-authored-by: Kelli Rockwell <kelli@sourcegraph.com>
@eseliger eseliger merged commit 8afc465 into main Aug 24, 2022
@eseliger eseliger deleted the es/no-local-workspace-resolver branch August 24, 2022 13:56
scjohns pushed a commit that referenced this pull request Apr 24, 2023
This is available as a faster API from the backend now, so no need to keep this duplicative, slower code. This is a 4.0 deprecation execution.
stefanhengl added a commit that referenced this pull request Jul 10, 2024
This bumps sourcegraph/sourcegraph/lib to pull in the latest changes from https://github.com/sourcegraph/sourcegraph/pull/63613 to support the new `version` field for batch specs.

Notes:
 - To resolve repos, batches calls the GraphQL endpoint `resolveWorkspacesForBatchSpec`, which takes the serialized spec. This means all the logic to resolve repos is outsourced to Sourcegraph. This is great news for this PR because we don't have to worry how `on.RepositoriesMatchingQuery` is interpreted. The code path in which src-cli itself resolves the workspaces was removed in #819.
 
### Test plan
- New unit tests
- Manual testing. I tested the following workflow
  - `src batch new -f test.spec.yaml` (-> spec contains `version: 2`)
  - `src batch apply -f test.spec.yaml`   (-> validation passes,  batch spec shows up in Sourcegraph db)
  - `src batch validate -f test.spec.yaml` (-> validation passes or fails if I change the version to an unsupported value)
  - `src batch repos -f test.spec.yaml` (-> checked that returned repos match with expected pattern type) 

Closes SPLF-126
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server-side workspace resolution is the only workspace resolution

4 participants