Skip to content

Commit 9deffdc

Browse files
authored
Merge pull request #1334 from nagilson/nagilson-file-overrides
Version 1.7.3 - Introduce File Locking for Install Script
2 parents 276721b + 165be29 commit 9deffdc

22 files changed

+315
-38
lines changed

sample/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sample/yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@
12771277

12781278
"vscode-dotnet-runtime@file:../vscode-dotnet-runtime-extension":
12791279
"resolved" "file:../vscode-dotnet-runtime-extension"
1280-
"version" "1.7.2"
1280+
"version" "1.7.3"
12811281
dependencies:
12821282
"axios" "^1.3.4"
12831283
"axios-cache-interceptor" "^1.0.1"

vscode-dotnet-runtime-extension/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning].
77

88
## [Unreleased]
99

10+
## [1.7.3] - 2023-08-24
11+
12+
Fixes an issue where install script files could have race conditions by introducing file locking mechanisms.
13+
1014
## [1.7.2] - 2023-08-24
1115

1216
This release completely revamps the web request handling to a new library (axios).

vscode-dotnet-runtime-extension/package-lock.json

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vscode-dotnet-runtime-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"description": "This extension installs and manages different versions of the .NET Runtime.",
1414
"appInsightsKey": "02dc18e0-7494-43b2-b2a3-18ada5fcb522",
1515
"icon": "images/dotnetIcon.png",
16-
"version": "1.7.2",
16+
"version": "1.7.3",
1717
"publisher": "ms-dotnettools",
1818
"engines": {
1919
"vscode": "^1.72.0"

vscode-dotnet-runtime-extension/src/extension.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,23 +98,23 @@ export function activate(context: vscode.ExtensionContext, extensionContext?: IE
9898
if (!fs.existsSync(context.globalStoragePath)) {
9999
fs.mkdirSync(context.globalStoragePath);
100100
}
101-
const finalTimeoutValue = timeoutValue === undefined ? defaultTimeoutValue : timeoutValue;
101+
const resolvedTimeoutSeconds = timeoutValue === undefined ? defaultTimeoutValue : timeoutValue;
102102

103103
const acquisitionWorker = new DotnetCoreAcquisitionWorker({
104104
storagePath: context.globalStoragePath,
105105
extensionState: context.globalState,
106106
eventStream,
107-
acquisitionInvoker: new AcquisitionInvoker(context.globalState, eventStream, finalTimeoutValue),
107+
acquisitionInvoker: new AcquisitionInvoker(context.globalState, eventStream, resolvedTimeoutSeconds),
108108
installationValidator: new InstallationValidator(eventStream),
109-
timeoutValue: finalTimeoutValue,
109+
timeoutValue: resolvedTimeoutSeconds,
110110
installDirectoryProvider: new RuntimeInstallationDirectoryProvider(context.globalStoragePath),
111111
});
112112
const existingPathResolver = new ExistingPathResolver();
113-
const versionResolver = new VersionResolver(context.globalState, eventStream, finalTimeoutValue);
113+
const versionResolver = new VersionResolver(context.globalState, eventStream, resolvedTimeoutSeconds);
114114

115115
const dotnetAcquireRegistration = vscode.commands.registerCommand(`${commandPrefix}.${commandKeys.acquire}`, async (commandContext: IDotnetAcquireContext) => {
116116
const dotnetPath = await callWithErrorHandling<Promise<IDotnetAcquireResult>>(async () => {
117-
eventStream.post(new DotnetRuntimeAcquisitionStarted());
117+
eventStream.post(new DotnetRuntimeAcquisitionStarted(commandContext.requestingExtensionId));
118118
eventStream.post(new DotnetAcquisitionRequested(commandContext.version, commandContext.requestingExtensionId));
119119
acquisitionWorker.setAcquisitionContext(commandContext);
120120

vscode-dotnet-runtime-extension/src/test/functional/DotnetCoreAcquisitionExtension.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ suite('DotnetCoreAcquisitionExtension End to End', function() {
108108
const requestedEvent = MockTelemetryReporter.telemetryEvents.find((event: ITelemetryEvent) => event.eventName === 'DotnetAcquisitionRequested');
109109
assert.exists(requestedEvent);
110110
assert.include(requestedEvent!.properties!.AcquisitionStartVersion, '2.2');
111-
assert.include(requestedEvent!.properties!.RequestingExtensionId, requestingExtensionId);
111+
assert.notInclude(requestedEvent!.properties!.RequestingExtensionId, requestingExtensionId); // assert that the extension id is hashed
112112
const startedEvent = MockTelemetryReporter.telemetryEvents.find((event: ITelemetryEvent) => event.eventName === 'DotnetAcquisitionStarted');
113113
assert.exists(startedEvent);
114114
assert.include(startedEvent!.properties!.AcquisitionStartVersion, '2.2');

vscode-dotnet-runtime-extension/yarn.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2544,6 +2544,7 @@
25442544
"mocha" "^9.1.3"
25452545
"open" "^8.4.0"
25462546
"p-retry" "^4.6.1"
2547+
"proper-lockfile" "^4.1.2"
25472548
"public-ip" "^5.0.0"
25482549
"rimraf" "3.0.2"
25492550
"shelljs" "0.8.5"

vscode-dotnet-runtime-library/package-lock.json

Lines changed: 70 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vscode-dotnet-runtime-library/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
},
2323
"devDependencies": {
2424
"@types/chai": "4.2.22",
25+
"@types/proper-lockfile": "^4.1.2",
2526
"glob": "^7.2.0"
2627
},
2728
"dependencies": {
@@ -47,6 +48,7 @@
4748
"mocha": "^9.1.3",
4849
"open": "^8.4.0",
4950
"p-retry": "^4.6.1",
51+
"proper-lockfile": "^4.1.2",
5052
"public-ip": "^5.0.0",
5153
"rimraf": "3.0.2",
5254
"shelljs": "0.8.5",

0 commit comments

Comments
 (0)