-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add multi-repo enterprise context (#510)
## Test plan 1. Open `sourcegraph/cody` project with non-enterprise account. - Open new chat and ask question about current repo (e.g. some class) - assistant should know the answer - Open new chat and ask question about squirrel - assistant should describe you an animal - Open new chat and disable local context. Ask about current repo (e.g. some class) - assistant should not have a context - Save current context as default. Close the IDE. Reopen the IDE. - Go to Chat History tab and open previous chats one by one. Check if both history and context settings are properly preserved. - Open new chat and check if context is disabled. It should be, as we previously set that as new default. Enable it again and set as default. 2. Open `sourcegraph/cody` project with enterprise account. - All checks from point 1) apply there as well. - Click [+] button in the context panel and type sourcegraph repo url (`github.com/sourcegraph/sourcegraph`) - Check if validator blocks from entering incomplete or invalid URL - Add the `sourcegraph/sourcegraph` repo by hitting Add button - Open new chat and ask question about squirrel - assistant should describe you an HTTP server, **NOT** animal. - Set new configuration as default and open new chat. It should use previous context configuration. - Disable `sourcegraph/sourcegraph` remote repo context. - Ask question about squirrel. It should be back to describing you an animal or having no context. - Save current context as default. Close the IDE. Reopen the IDE. - Go to Chat History tab and open previous chats one by one. Check if both history and context settings are properly preserved. - Open new chat and check if `sourcegraph/sourcegraph` is disabled. It should be, as we previously set that as new default. Enable it again and set as default. - Open new chat and check if `sourcegraph/sourcegraph` is enabled, it should be. - Remove `sourcegraph/sourcegraph` repo by clicking on it to select it, and then clicking [-] button. - Ask question about squirrel. It should be back to describing you an animal or having no context. ## Changes * Added multi-repo enterprise context * Improved look of the local context panel * Fixed several bugs like: * history service being instantiated as application-wide service instead of project-wide * current repo url parsing and timing issues ![image](https://github.com/sourcegraph/jetbrains/assets/1519649/91a014db-6a64-4418-aee6-96400c25374f)
- Loading branch information
Showing
34 changed files
with
665 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
src/main/kotlin/com/sourcegraph/cody/agent/protocol/GetRepoIdsParam.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.sourcegraph.cody.agent.protocol | ||
|
||
data class GetRepoIdsParam(val names: List<String>, val first: Int) |
3 changes: 3 additions & 0 deletions
3
src/main/kotlin/com/sourcegraph/cody/agent/protocol/GetRepoIdsResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.sourcegraph.cody.agent.protocol | ||
|
||
data class GetRepoIdsResponse(val repos: List<Repo>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package com.sourcegraph.cody.agent.protocol | ||
|
||
data class Repo(val name: String, val id: String) |
5 changes: 5 additions & 0 deletions
5
src/main/kotlin/com/sourcegraph/cody/agent/protocol/util/ChatRemoteReposResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.sourcegraph.cody.agent.protocol.util | ||
|
||
import com.sourcegraph.cody.agent.protocol.Repo | ||
|
||
data class ChatRemoteReposResponse(val remoteRepos: List<Repo>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.