Skip to content

Conversation

@akshita31
Copy link
Contributor

@akshita31 akshita31 commented Nov 27, 2018

Fixes: #2478

With this change we will have an install.Lock for each package that is downloaded rather than having a single install.Lock for the runtime dependencies.
This will be a step forward towards the validation of the downloads as listed here: #2694.

Also, in this PR, I have added an "Id" attribute to the packages so that whatever part of the code needs access to a particular package to verify if the required dependency is installed or not, they could filter the packages from package.json easily, eg, for the case of the debugger packages as I have done in this PR.

cc @NTaylorMullen

@codecov
Copy link

codecov bot commented Nov 27, 2018

Codecov Report

Merging #2707 into master will decrease coverage by 0.05%.
The diff coverage is 83.01%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2707      +/-   ##
==========================================
- Coverage   65.55%   65.49%   -0.06%     
==========================================
  Files          99      100       +1     
  Lines        4331     4350      +19     
  Branches      631      632       +1     
==========================================
+ Hits         2839     2849      +10     
- Misses       1308     1317       +9     
  Partials      184      184
Flag Coverage Δ
#integration 53.69% <73.58%> (+0.22%) ⬆️
#unit 85.26% <93.75%> (+0.38%) ⬆️
Impacted Files Coverage Δ
src/packageManager/PackageFilterer.ts 90% <100%> (-4.74%) ⬇️
src/CSharpExtDownloader.ts 85% <100%> (-1.21%) ⬇️
src/features/commands.ts 34.78% <100%> (ø) ⬆️
src/main.ts 93.8% <100%> (+1.56%) ⬆️
src/omnisharp/extension.ts 79.64% <100%> (ø) ⬆️
src/common.ts 70% <100%> (+0.33%) ⬆️
src/packageManager/AbsolutePathPackage.ts 95.65% <100%> (-4.35%) ⬇️
src/coreclr-debug/activate.ts 28.57% <33.33%> (-0.22%) ⬇️
src/tools/GetRuntimeDependencyWithId.ts 50% <50%> (ø)
src/packageManager/PackageManager.ts 94.28% <94.73%> (-0.46%) ⬇️
... and 3 more

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 cab094a...686b9ba. Read the comment docs.

@akshita31 akshita31 changed the title WIP : Use a separate install.Lock for each dependency Use a separate install.Lock for each dependency Nov 27, 2018
@rchande
Copy link

rchande commented Nov 27, 2018

How do this work if I upgrade an existing installation? We'll just stop looking at my existing install.lock and be good to go?

Copy link

@rchande rchande left a comment

Choose a reason for hiding this comment

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

LGTM modulo question

@akshita31
Copy link
Contributor Author

What is the meaning of upgrading existing installation ? Whenever the extension updates it creates a new folder and is not concerned with the contents of the old one right?

@rchande
Copy link

rchande commented Nov 27, 2018

Ah, right.

private extensionPath: string) {
}

public async installRuntimeDependencies(): Promise<boolean> {
Copy link
Contributor

Choose a reason for hiding this comment

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

We are now always calling this method when the C# extension starts right? If so, shouldn't we avoid posting some of these events to the event stream until after we have determined if there are any missing packages?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gregg-miskelly You are right, but with the current code structure it is not possible and we will need some refactoring in order to achieve that. I will do that in a subsequent PR.

@akshita31
Copy link
Contributor Author

@NTaylorMullen Do you have any concerns with this change ?

@NTaylorMullen
Copy link

@NTaylorMullen Do you have any concerns with this change ?

Based on what you wrote in the description of the PR this sounds great! Means we wont have busted partial installs of dependencies it sounds like. Any negative implications to this?

@akshita31
Copy link
Contributor Author

@NTaylorMullen I am still unsure of what part fails on the user's systems when they have an improper download/install. With this PR, I think it will help us identify better which of the three dependencies got corrupted as each will have its own install.Lock file that should be put only when both the download and install completed without throwing an exception.

And if for a dependency say OmniSharp, the download failed this time and the install.Lock was not put into the expected location, the next time the user opens vscode, it would detect that it needs to install Omnisharp as the install.Lock is not present.

@NTaylorMullen
Copy link

Awesome, ya this would be a great addition, no concerns!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants