Skip to content
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

Add setting to control speed of diagnostic publishing + detect old MacOS #2350

Closed
wants to merge 26 commits into from
Closed

Conversation

MikhailArkhipov
Copy link

@MikhailArkhipov MikhailArkhipov commented Aug 7, 2018

Fixes #2270

  • Title summarizes what is changing
  • Includes a news entry file (remember to thank yourself!)
  • Unit tests & code coverage are not adversely affected (within reason)
  • Works on all actively maintained versions of Python (e.g. Python 2.7 & the latest Python 3 release)
  • Works on Windows 10, macOS, and Linux (e.g. considered file system case-sensitivity)

@codecov
Copy link

codecov bot commented Aug 7, 2018

Codecov Report

Merging #2350 into master will decrease coverage by 0.08%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2350      +/-   ##
=========================================
- Coverage   75.69%   75.6%   -0.09%     
=========================================
  Files         309     309              
  Lines       14341   14365      +24     
  Branches     2540    2546       +6     
=========================================
+ Hits        10855   10861       +6     
- Misses       3476    3494      +18     
  Partials       10      10
Flag Coverage Δ
#MacOS 73.79% <33.33%> (-0.15%) ⬇️
#Windows 73.92% <33.33%> (-0.09%) ⬇️
Impacted Files Coverage Δ
src/client/common/platform/types.ts 100% <ø> (ø) ⬆️
src/client/activation/downloader.ts 35.36% <ø> (ø) ⬆️
src/client/common/platform/platformService.ts 60.6% <26.66%> (-28.87%) ⬇️
src/client/activation/languageServer.ts 26.28% <41.66%> (+0.2%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 065b377...c63c904. Read the comment docs.

Copy link

@d3r3kk d3r3kk left a comment

Choose a reason for hiding this comment

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

Looks fine, but you might want to alter how versionMajor/Minor are kept.

Also, please reach out to @ericsnowcurrently as he was working on #2245 today as well.

@@ -54,6 +54,7 @@ export class LanguageServerDownloader {
let localTempFilePath = '';
try {
localTempFilePath = await this.downloadFile(downloadUri, 'Downloading Microsoft Python Language Server... ');
// await this.verifyDownload(localTempFilePath, platformString);
Copy link

Choose a reason for hiding this comment

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

Probably can remove this line.

Copy link
Author

Choose a reason for hiding this comment

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

We really should be verifying downloads. This code only temporary disabled to allow hot updates and that new build does not generate engine hashes (it should). Signing LS and nuget is not sufficient without verification.

Copy link

Choose a reason for hiding this comment

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

Cool. Shouldn't we just add that code when it is enabled then?

Copy link
Author

Choose a reason for hiding this comment

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

With the change of the build hash generation is gone. Someone needs to port it from my definition to the one Steve made.

@@ -115,6 +125,15 @@ export class LanguageServerExtensionActivator implements IExtensionActivator {
(this.configuration.getSettings() as PythonSettings).removeListener('change', this.onSettingsChanged.bind(this));
}

private checkSupportedPlatform(): boolean {
const platform = this.services.get<IPlatformService>(IPlatformService);
if (platform.isMac && platform.versionMajor === 10 && platform.versionMinor < 12) {
Copy link

Choose a reason for hiding this comment

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

Wouldn't you want to test for platform.versionMajor < 10 as well here?

Copy link
Author

Choose a reason for hiding this comment

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

I don't think those exist, that would be PowerPC OS 9, right?

Copy link

Choose a reason for hiding this comment

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

Not sure, I'm just looking at the logic driving this decision tree 😃.

const parts = this.version.split('.');
return parts.length > 0 ? parseInt(parts[0], 10) : 0;
}
public get versionMinor(): number {
Copy link

Choose a reason for hiding this comment

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

Perhaps these should be strings? What happens with v10.1s?

Copy link
Author

Choose a reason for hiding this comment

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

Numbers for comparisons. How do we compare random strings? Checked Linux and Windows, they are numbers. Will check on Mac. Possible drop leading 'v'?

Copy link

Choose a reason for hiding this comment

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

That's fair. However, I like @DonJayamanne's idea about making a version string a type and working from that.

Choose a reason for hiding this comment

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

Individual parts can be numbers only if they are guaranteed to be numeric. If not, then we can cast when performing the necessary comparison.

@d3r3kk
Copy link

d3r3kk commented Aug 7, 2018

Also missing are some unit/system tests for the supported or unsupported OS.

@@ -27,6 +27,9 @@ export interface IPlatformService {
is64bit: boolean;
pathVariableName: 'Path' | 'PATH';
virtualEnvBinName: 'bin' | 'scripts';
version: string;

Choose a reason for hiding this comment

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

Shouldn't version be it's own type definition?

Copy link
Author

Choose a reason for hiding this comment

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

This is string returned by os.release() so it has value if some other code wants to parse it differently.

return false;
}
return true;
}

Choose a reason for hiding this comment

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

Why aren't we checking for Windows and Linux?
We need to check minimum requirements on those OS too.

Copy link
Author

@MikhailArkhipov MikhailArkhipov Aug 8, 2018

Choose a reason for hiding this comment

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

Windows is trivial but not really necessary since VSC supports 7,8,10 and so does .NET Core. Anyone knows all the Linux version numbers? ;-)

@lock lock bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide the ability to turn off live error reporting in the new language server
4 participants