-
Notifications
You must be signed in to change notification settings - Fork 475
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
feat(amazonq): Auto update language servers when new versions are available #6310
feat(amazonq): Auto update language servers when new versions are available #6310
Conversation
…ilable Problem: - Only one version is installed right now Solution: - Automatically update when a new version is available in the manifest
|
await fs.delete(tempFolder) | ||
}) | ||
|
||
describe('download', () => { |
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.
These tests can likely be made obsolete by testing the same scenarios in tests for AmazonQLSPInstaller
.
Stubbing the http fetcher should be enough to test the entire flow, and then you could have complex tests where it first downloads from the remote, then a subsequent call should instead use the 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.
yeah now that the installer exists I can bring them up a level. I'll add that as a followup item
@@ -201,6 +202,50 @@ export class HttpResourceFetcher implements ResourceFetcher { | |||
} | |||
} | |||
|
|||
export class RetryableResourceFetcher extends HttpResourceFetcher { |
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 think this should probably be done in a different way. Maybe the httpResourceFetcher can have retries in it? I think we can re-visit this after this PR
@@ -270,3 +271,14 @@ export async function getMachineId(): Promise<string> { | |||
// TODO: check exit code. | |||
return (await proc.run()).stdout.trim() ?? 'unknown-host' | |||
} | |||
|
|||
export function getApplicationSupportFolder() { | |||
switch (process.platform) { |
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.
TODO support more platforms and their fallback locations
new Range(supportedLspServerVersions) | ||
).resolve() | ||
|
||
// TODO Cleanup old versions of language servers |
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.
Calling this out explicitly so we don't forget
} | ||
|
||
const downloadTasks = contents.map(async (content) => { | ||
// TODO This should be using the retryable http library but it doesn't seem to support zips 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.
Calling this out as well, we should switch to something that has retries with backoffs
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.
Approved as this code does not impact prod and we can do fast follow ups
Problem:
Solution:
TODO
feature/x
branches will not be squash-merged at release time.