-
Notifications
You must be signed in to change notification settings - Fork 495
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
telemetry(lsp): Integrate language server/manifest resolver telemetry #6385
base: feature/amazonqLSP
Are you sure you want to change the base?
Conversation
|
7f1f21d
to
f581b17
Compare
94902b9
to
87913ca
Compare
87913ca
to
45b0236
Compare
## Problem Relevant PR: aws/aws-toolkit-vscode#6385 ## Solution - standardize the metrics across the toolkits. <!--- REMINDER: - Read CONTRIBUTING.md first. - Add test coverage for your changes. - Link to related issues/commits. - Testing: how did you test your changes? - Screenshots if applicable --> ## License By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: Shruti Sinha <[email protected]>
7ed2bb7
to
5284763
Compare
6e3b972
to
05f3a2b
Compare
await lspSetupStage('all', async () => { | ||
const installResult = await new WorkspaceLSPResolver().resolve() | ||
await lspSetupStage('launch', async () => activateLsp(context, installResult.resourcePaths)) | ||
getLogger().info('LspController: LSP activated') |
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.
Not necessarily an issue for this PR, but I think we should probably scope these messages to regular codewhisperer language server vs workspace context one
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.
Yeah, I think we could make use of the logging header here that references which LSP it is. Can do as a follow up.
await fs.delete(cacheDirectory, { | ||
recursive: true, | ||
}) | ||
const serverResolvers: StageResolver<LspResult>[] = [ |
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.
not neccessarily a problem but just wanted to call it out for anyone reading -- this is where we will slightly deviate from eclipse/visual studios implementations. We can just do some things a bit simpler
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.
In what ways does this deviate from their implementations? Would it be easier if I modified the implementation to closer mirror those implementations?
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.
Just the structure of having resolvers. It's not a big deal. I just copied Visual Studios implementation and basically ported it to typescript. AFAIK Eclipse ported Visual Studio's implementation for this code to java. This is just a slight refactor of their work
if (!isMac) { | ||
this.skip() | ||
} | ||
localStub.resolves(lspResult('cache')) |
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.
there are technically non stubbed versions of these tests in the integ or e2e folder btw. It might make sense to just add telemetry assertions there
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.
Where are these tests? I am having some trouble finding them.
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.
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.
Added the telemetry to this test, and fixed an edge case with validate emitting when the fetch failed. There are definitely some paths not covered in the e2e tests so it might make sense to keep the other tests as well. However, I'm open to deleting them if you don't see value there.
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.
What functionality is covered in this one thats not in those other ones?
/runIntegrationTests |
Ah looks like the e2e tests are failing with the thing you mentioned in standup |
Oh interesting. I suspect this might be something else since I stubbed the workspaceLSPInstaller. The remote manifest fetch fails on local, but works in CI the first time then fails. Not sure why, but appears to be fairly consistent. I'll adjust the tests and add a note that it doesn't work locally. |
@@ -117,6 +121,86 @@ describe('AmazonQLSPInstaller', () => { | |||
assert.ok(fallback.assetDirectory.startsWith(tempDir)) | |||
assert.deepStrictEqual(fallback.location, 'fallback') | |||
assert.ok(semver.satisfies(fallback.version, supportedLspServerVersions)) | |||
|
|||
// Exclude version numbers so that this test doesn't have to be updated on each update. | |||
// Fetching manifest fails locally, but passes in CI. Therefore, this test will fail locally. |
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.
Can you explain more about this? The test will fail locally?
if (!isMac) { | ||
this.skip() | ||
} | ||
localStub.resolves(lspResult('cache')) |
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.
What functionality is covered in this one thats not in those other ones?
Problem
LSP downloading processes does not emit any telemetry.
Solution
Refactoring
StageResolver
to make telemetry instrumentation more natural.Metric Behavior
Testing
ManifestResolver
inpackages/core/src/test/shared/lsp/manifestResolver.test.ts
.LanguageServerResolver
inpackages/core/src/test/shared/lsp/lspResolver.test.ts
.LanguageServerResolver
only supports mac, so its tests skip on non-mac platforms. There is a techdebt test to address this.Future Work
feature/x
branches will not be squash-merged at release time.