Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode: Fix local embeddings status for non-git workspaces, git repos w/out remotes #2235

Merged
merged 10 commits into from
Dec 11, 2023

Conversation

dominiccooney
Copy link
Contributor

@dominiccooney dominiccooney commented Dec 9, 2023

  • When opening a non-git repo, instead of the enhanced context selector showing a non-functional "enable embeddings" button, do not show local embeddings status.
  • When opening a git repo without a remote, instead of showing a spinner indefinitely and "Indexed", show the circle-slash. Fixes bug: Local embeddings spins "indexed" forever in git repos without remotes #2217.
  • During embeddings index generation, show the current file being indexed in the status bar item tooltip.
  • If embeddings index generation fails, show the error message in a tooltip on the status bar. (Test coverage and improvements planned in a follow-up change.)

Adds e2e tests for the major cases above.

Also improves the e2e test framework:

  • Fixes a race condition creating the workspace .vscode directory, and writing .vscode/settings.json. This sometimes meant the tests were running without the correct settings.
  • Adds Playwright extensions so tests can configure an isolated working directory, extra VSCode settings, and treat the test server endpoint as "dotcom".
  • Expands the mock server so that the consumer login path works.
  • Adds testing hooks to local embeddings to use a mock server, embeddings model, and isolated index library path.
  • Deletes obsolete helper for submitting sidebar chat messages.

Test plan

This integration test covers the scenarios of opening no git repo, a git repo without a remote, and a git repo with a remote and then generating embeddings for the repo and querying them:

pnpm test:e2e -- local-embeddings.test.ts

Copy link
Contributor

@toolmantim toolmantim left a comment

Choose a reason for hiding this comment

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

Verified that this all works as expected 👍🏼👏🏼 Two non-blocking notes…

When there's no origin:

Screenshot 2023-12-11 at 12 47 12 pm

it would be nicer to also show an explanation, similar to this state:

With the copy:

Git repository is missing a remote origin.

I would have assumed a similar UI if you open a folder that isn't a Git repo (with the copy "Folder is not a Git repository"), but instead I see the following:

Screenshot 2023-12-11 at 12 51 59 pm

@dominiccooney
Copy link
Contributor Author

Thanks for the feedback! Love the wording of the error messages. I wrestled with it briefly but nothing sounded right.

@dominiccooney dominiccooney merged commit 6416d72 into main Dec 11, 2023
13 of 14 checks passed
@dominiccooney dominiccooney deleted the dpc/embeddings-integration-test branch December 11, 2023 03:07
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.

bug: Local embeddings spins "indexed" forever in git repos without remotes
2 participants