-
Notifications
You must be signed in to change notification settings - Fork 237
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
Windows: make win-ca also work with the agent #4618
Windows: make win-ca also work with the agent #4618
Conversation
|
7f61d0a
to
1b1642e
Compare
In the PR #4598, we fixed a bug related to how we installed self-signed certificates on Windows. This PR only fixed the issue for VS Code. This PR additionally fixes the problem for the agent. For the agent, we use a slightly different `extensionUri`. This PR adds logic to manually copy the `roots.exe` file over to the directory we use as `extensionUri` with the agent.
1b1642e
to
7a0cce6
Compare
import { copyFileSync } from 'node:fs' | ||
import path from 'node:path' | ||
|
||
copyFileSync( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Written as a script so that it works consistently on macOS/Windows
From the unit test logs on Windows in the
The logs for this PR no longer show this error https://github.com/sourcegraph/cody/actions/runs/9578695458/job/26409501979?pr=4618#step:9:31 |
export async function initializeVscodeExtension( | ||
workspaceRoot: vscode.Uri, | ||
extensionActivate: ExtensionActivate, | ||
extensionClient: ExtensionClient | ||
): Promise<void> { | ||
const paths = envPaths('Cody') | ||
const extensionPath = paths.config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason why instead we do not simply set extensionPath
to __dirname
?
It seems then we could completely avoid having copyWinCaRootsBinary
, and it would be more correct also as that is path where extension files exists from the agent perspective, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not opposed to that change but we should make it separate from this PR. If we do this, then we should consider cleaning up the old directory, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do all sorts of stuff in this directory, like downloading symf/bfg, etc. It's a bigger scope change than what I have appetite to deal with right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
## Changes Follow up to the sourcegraph/cody#4618 ## Test plan ``` ➜ CODY_DIR=/Users/pkukielka/Work/sourcegraph/cody ./gradlew :buildPlugin ➜ unzip -l build/distributions/Sourcegraph-6.0-localbuild.zip | grep exe 69252760 06-19-2024 16:09 Sourcegraph/agent/node-win-x64.exe 82944 06-19-2024 16:09 Sourcegraph/agent/win-ca-roots.exe ```
## Changes Follow up to the sourcegraph/cody#4618 ## Test plan ``` ➜ CODY_DIR=/Users/pkukielka/Work/sourcegraph/cody ./gradlew :buildPlugin ➜ unzip -l build/distributions/Sourcegraph-6.0-localbuild.zip | grep exe 69252760 06-19-2024 16:09 Sourcegraph/agent/node-win-x64.exe 82944 06-19-2024 16:09 Sourcegraph/agent/win-ca-roots.exe ```
In the PR #4598, we fixed a bug related to how we installed self-signed certificates on Windows. This PR only fixed the issue for VS Code. This PR additionally fixes the problem for the agent. For the agent, we use a slightly different
extensionUri
. This PR adds logic to manually copy theroots.exe
file over to the directory we use asextensionUri
with the agent. The benefit of solving this problem like this is that it works automatically for all agent clients, avoiding the need to do custom solutions for individual clients like JetBrains.Test plan
Manually confirmed that we are no longer printing out an error when running the tests on Windows.