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: Add popups for all embeddings conditions #1374

Merged
merged 12 commits into from
Oct 13, 2023
Merged

Conversation

dominiccooney
Copy link
Contributor

Dotcom/App users can always click on the chat input status indicator and see the state of embeddings in a popup.

Caveats/limitations:

  • There's no progress indicator while app is indexing. You need to wait and hit the "Reload" button.
  • Only for dotcom/App users however this will be fixed in a follow up PR.
  • Various existing quirks of local embeddings remain for now. For example, your git repository must have a remote with a slash in the name.

Part of #632

Test plan

This does not add automated tests yet. That is in a follow-up change, I need to update the existing tests to use simplified onboarding first.

UI check: pnpm storybook and examine the App-less Onboarding stories.

Manual tests:

A directory that's not a git repository:

mkdir /tmp/project
cd /tmp/project
echo hello > main.c
code .

Open main.c, open Cody, click on the chat input status indicator:

Screenshot 2023-10-12 at 14 59 15

A git repository that does not have a remote:

git init .

Cmd-Shift-P, Reload Window (we do not watch for repos changing status in this way.) Chat status indicator should be as above.

A git repository with a remote:

Ensure App is not running.

git remote add origin git@host.example:cool/project.git

Cmd-Shift-P, Reload Window (we do not watch for repos changing status in this way.) Chat status indicator:

Screenshot 2023-10-12 at 15 04 26

A git repository that is indexed with app:

git add main.c
git commit -am 'first commit'

Install app if it is not installed. Click Open App and go through the repository indexing flow. If there are existing repositories click Add a repository.

You can force repo indexing by right clicking on App UI, Inspect Element, window.location = '/api/console' in the Console, and run this GraphQL mutation:

mutation addrepo {
  scheduleRepositoriesForEmbedding(repoNames: ["host.example:cool/project"], force: true) {
    alwaysNil
  }
}

Note there is no .git on the repo name. Check that there is a job with state "COMPLETED":

query arewethereyet {
  repository(name: "host.example:cool/project") {
    name
    id
    embeddingJobs(first: 2) {
      nodes {
        state
        revision {
          oid
        }
        startedAt
        stats {
          filesSkipped
          filesScheduled
          filesEmbedded
        }
      }
    }
  }
}

In VScode, open popup and click Reload, status indicator:

Screenshot 2023-10-12 at 15 14 56

git repository indexed by dotcom:

cd /tmp
git clone git@github.com:facebook/react.git --depth=1

In VScode, File, Open Folder, /tmp/react and trust the authors. Chat input status:

Screenshot 2023-10-12 at 15 18 07

Repeat the above looking at different themes.

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.

This is fantastic! I popped a commit on to switch the repo button to a proper VS Code button, so it has all the right hover states etc.

@dominiccooney dominiccooney merged commit 828fb70 into main Oct 13, 2023
12 of 13 checks passed
@dominiccooney dominiccooney deleted the dpc/so-chat-status branch October 13, 2023 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants