Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

cody: development branch #49761

Merged
merged 23 commits into from
Mar 23, 2023
Merged

cody: development branch #49761

merged 23 commits into from
Mar 23, 2023

Conversation

novoselrok
Copy link
Contributor

@novoselrok novoselrok commented Mar 21, 2023

Test plan

  • Chatting and executing recipes should still work.
  • pnpm run build && pnpm run test:integration && pnpm run test:unit should be green.

App preview:

Check out the client app preview documentation to learn more.

beyang and others added 4 commits March 14, 2023 22:49
Fixes the Cody integration tests by adding a separate in-memory secret
store when testing. The VSCode secret storage uses the Keychain
Access.app on macOS to store the values, but it does not separate
between developing the extension and testing the extension. So whenever
you would run the integration test, it would override the previously set
development access token. We can avoid that by switching to an in-memory
implementation when testing.

## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
* Run `pnpm run build && pnpm run test` in the
`client/cody/vscode-codegen` directory. The tests should pass.

## App preview:

- [Web](https://sg-web-rn-fix-cody-integration-test.onrender.com/search)

Check out the [client app preview
documentation](https://docs.sourcegraph.com/dev/how-to/client_pr_previews)
to learn more.
This PR refactors parts of the extension to make it unit testable,
specifically the `Transcript` class. This involved making the
`Transcript` class and its dependencies independent of the VSCode API. I
replaced specific implementations with interfaces where possible,
allowing us to mock any dependencies we need. I added a single unit test
as a proof of concept, and more will be coming in subsequent PRs.

I recommend that you review commit by commit, as I tried to group the
relevant changes as much as possible.

## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->
* Run `pnpm run build && pnpm run test:unit && pnpm run
test:integration`, tests should be green.

## App preview:

- [Web](https://sg-web-rn-make-cody-unit-testable.onrender.com/search)

Check out the [client app preview
documentation](https://docs.sourcegraph.com/dev/how-to/client_pr_previews)
to learn more.
RE [slack thread
](https://sourcegraph.slack.com/archives/C04NPH6SZMW/p1678900652268589)

1. Add: auto scroll to the bottom of the screen on new chat messages
([Loom](https://www.loom.com/share/5bf6b5d9bef6446291d5a8ef480f7776))


![cody](https://user-images.githubusercontent.com/68532117/225409267-c67b0485-b5b2-4e0a-b979-ef9f4994da29.gif)

2. Replace `arrow-up` icon with `arrow-down` on expanded context
messages.

Also updated the default font color for bot messages

<table>
<tr>
<td>Before</td>
<td>After</td>
</tr>
<tr>
<td>
<img width="487" alt="image"
src="https://user-images.githubusercontent.com/68532117/225406411-f3d2ddaa-aa1c-4627-9d25-13f04d64cf06.png">
</td>
<td>
<img width="489" alt="image"
src="https://user-images.githubusercontent.com/68532117/225405891-ef303973-4140-4b4a-a429-92b7a4f5aa7a.png">
</td>
</tr>
</table>


## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

launch Cody in VS Code Debug mode:
- Run `pnpm i` at the root of this repository
- Select `Launch Cody Extension` from the dropdown menu in the `RUN AND
DEBUG` sidebar in VS Code

## App preview:

- [Web](https://sg-web-bee-cody-chat-scroll.onrender.com/search)

Check out the [client app preview
documentation](https://docs.sourcegraph.com/dev/how-to/client_pr_previews)
to learn more.

---------

Co-authored-by: Dominic Cooney <[email protected]>
Rok Novosel and others added 14 commits March 21, 2023 14:09
Implements the new Sourcegraph backend for the Cody extension. Since
it's a fairly large PR, I recommend reviewing commit by commit.

## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

* Chatting and executing recipes should still work.
* `pnpm run build && pnpm run test:integration && pnpm run test:unit`
should be green.

## App preview:

- [Web](https://sg-web-rn-cody-sourcegraph-backend.onrender.com/search)

Check out the [client app preview
documentation](https://docs.sourcegraph.com/dev/how-to/client_pr_previews)
to learn more.
This PR removes all the unused and outdated directories from the
`client/cody` project as they have been integrated into the main app,
and moves the VS Code extension to the base `client/cody` directory.

I have also updated the README.md in `client/cody` to reflect the
changes.

All CSS files are now using relative units instead of hard-coded units.
Everything should scale according to user's system.

Some minor CSS fixes. 

<table>
<tr>
<td>Before</td>
<td>After</td>
</tr>
<tr>
<td>
<img width="425" alt="image"
src="https://user-images.githubusercontent.com/68532117/226679956-d4182efb-3175-4aab-88ea-f3130babf507.png">
</td>
<td>
<img width="435" alt="image"
src="https://user-images.githubusercontent.com/68532117/226713400-195b4158-3192-4492-95a9-e89a8a98acbf.png">
</td>
</tr>
</table>

<table>
<tr>
<td>Before</td>
<td>After</td>
</tr>
<tr>
<td>
<img width="425" alt="image"
src="https://user-images.githubusercontent.com/68532117/226689174-b50fef13-32fd-4260-935f-933c559fa100.png">
</td>
<td>
<img width="425" alt="image"
src="https://user-images.githubusercontent.com/68532117/226713189-d725ff96-f976-41a7-8fec-b1146142c32e.png">
</td>
</tr>
</table>

Replaced placeholder logo with logo for cody:
<img width="510" alt="image"
src="https://user-images.githubusercontent.com/68532117/226713033-c4b5b629-6fb8-47eb-8a0d-a857c4357417.png">



## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

Run the following commands from the **root** of this repository in this
branch:
- pnpm --filter cody run build
- pnpm --filter cody run test:unit
- pnpm --filter cody run test:integration
- pnpm --filter cody run vsce:package

Everything should work as before the move.

## App preview:

- [Web](https://sg-web-bee-cody-restructure.onrender.com/search)

Check out the [client app preview
documentation](https://docs.sourcegraph.com/dev/how-to/client_pr_previews)
to learn more.
…t find the repository on their Sourcegraph instance.
@novoselrok novoselrok requested a review from abeatrix March 23, 2023 10:56
@novoselrok novoselrok marked this pull request as ready for review March 23, 2023 10:56
Rok Novosel and others added 5 commits March 23, 2023 12:48
### 1. Fix light theme issue 
RE[ issue reported by user 1
](https://sourcegraph.slack.com/archives/C04MSD3DP5L/p1679515816745719)[issue
reported by user
2](https://sourcegraph.slack.com/archives/C04MSD3DP5L/p1679519459355209)

Issue: 

![image](https://user-images.githubusercontent.com/68532117/227261916-14cc57dd-4926-4350-aece-5edfa7189725.png)


We have been using --vscode-background and --vscode-foreground as the
default color, which is different than the default color theme for the
sidebar. Replace these values with `--vscode-sideBar-background` and
`--vscode-sideBar-foreground` fixed the issue.

## Test plan

<!-- All pull requests REQUIRE a test plan:
https://docs.sourcegraph.com/dev/background-information/testing_principles
-->

Tested on multiple light themes and dark themes:

<img width="2168" alt="Screenshot 2023-03-23 at 7 26 47 AM"
src="https://user-images.githubusercontent.com/68532117/227253076-562f5977-c331-4354-8838-c9e1d49dab23.png">

<img width="2168" alt="Screenshot 2023-03-23 at 7 27 00 AM"
src="https://user-images.githubusercontent.com/68532117/227253039-35e7aed6-bfe7-4147-a4ad-75e34cd6e337.png">

<img width="2168" alt="Screenshot 2023-03-23 at 7 27 31 AM"
src="https://user-images.githubusercontent.com/68532117/227253125-9da78126-e440-4faf-a09f-406f496d3413.png">

<img width="2168" alt="Screenshot 2023-03-23 at 7 27 22 AM"
src="https://user-images.githubusercontent.com/68532117/227253166-78ec9a0f-86a1-43e7-908a-e82ea4e9b115.png">

## App preview:

- [Web](https://sg-web-bee-cody-login.onrender.com/search)

Check out the [client app preview
documentation](https://docs.sourcegraph.com/dev/how-to/client_pr_previews)
to learn more.
Copy link
Contributor

@abeatrix abeatrix left a comment

Choose a reason for hiding this comment

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

All the tests work and the package built from this branch also works!

@novoselrok novoselrok merged commit 50c6b27 into main Mar 23, 2023
@novoselrok novoselrok deleted the cody-main branch March 23, 2023 19:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants