From 6b94d1ef71d30bb2b25779eaecd9111f29a1992b Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 1 Feb 2024 13:52:08 -0800 Subject: [PATCH 1/4] appservice: Always add PostDeploySyncTriggersStep in wizard and check if it should execute (#1681) * Always add PostDeploySyncTriggersStep and check if it should execute * Bunp version --- appservice/package-lock.json | 4 ++-- appservice/package.json | 2 +- .../src/deploy/wizard/PostDeploySyncTriggersExecuteStep.ts | 5 +++-- appservice/src/deploy/wizard/createDeployWizard.ts | 4 +--- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/appservice/package-lock.json b/appservice/package-lock.json index 7bdcc6d963..fb90ad4eea 100644 --- a/appservice/package-lock.json +++ b/appservice/package-lock.json @@ -1,12 +1,12 @@ { "name": "@microsoft/vscode-azext-azureappservice", - "version": "2.3.4", + "version": "2.3.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@microsoft/vscode-azext-azureappservice", - "version": "2.3.4", + "version": "2.3.5", "license": "MIT", "dependencies": { "@azure/abort-controller": "^1.0.4", diff --git a/appservice/package.json b/appservice/package.json index b852fbf050..d584d4641f 100644 --- a/appservice/package.json +++ b/appservice/package.json @@ -1,7 +1,7 @@ { "name": "@microsoft/vscode-azext-azureappservice", "author": "Microsoft Corporation", - "version": "2.3.4", + "version": "2.3.5", "description": "Common tools for developing Azure App Service extensions for VS Code", "tags": [ "azure", diff --git a/appservice/src/deploy/wizard/PostDeploySyncTriggersExecuteStep.ts b/appservice/src/deploy/wizard/PostDeploySyncTriggersExecuteStep.ts index bdbacd9e77..63a0c7496b 100644 --- a/appservice/src/deploy/wizard/PostDeploySyncTriggersExecuteStep.ts +++ b/appservice/src/deploy/wizard/PostDeploySyncTriggersExecuteStep.ts @@ -17,7 +17,8 @@ export class PostDeploySyncTriggersExecuteStep extends AzureWizardExecuteStep Date: Thu, 1 Feb 2024 15:05:46 -0800 Subject: [PATCH 2/4] Use context.fsPath instead of context.workspace.uri.fsPath (#1682) --- appservice/src/deploy/wizard/DeployExecuteStepBase.ts | 2 +- appservice/src/deploy/wizard/DeployLocalGitExecuteStep.ts | 2 +- appservice/src/deploy/wizard/createDeployWizard.ts | 2 +- .../src/deploy/wizard/deployZip/DeployFlexExecuteStep.ts | 2 +- .../src/deploy/wizard/deployZip/DeployWarExecuteStep.ts | 4 ++-- .../src/deploy/wizard/deployZip/DeployZipBaseExecuteStep.ts | 2 +- .../src/deploy/wizard/deployZip/DeployZipPushExecuteStep.ts | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/appservice/src/deploy/wizard/DeployExecuteStepBase.ts b/appservice/src/deploy/wizard/DeployExecuteStepBase.ts index 421e277a3a..7d672ffe62 100644 --- a/appservice/src/deploy/wizard/DeployExecuteStepBase.ts +++ b/appservice/src/deploy/wizard/DeployExecuteStepBase.ts @@ -51,7 +51,7 @@ function getLinuxFxVersionForTelemetry(config: SiteConfigResource): string { } async function setDeploymentTelemetry(context: InnerDeployContext, config: SiteConfigResource, aspPromise: Promise): Promise { - context.telemetry.properties.sourceHash = await randomUtils.getPseudononymousStringHash(context.workspaceFolder.uri.fsPath); + context.telemetry.properties.sourceHash = await randomUtils.getPseudononymousStringHash(context.fsPath); context.telemetry.properties.destHash = await randomUtils.getPseudononymousStringHash(context.site.fullName); context.telemetry.properties.scmType = String(config.scmType); context.telemetry.properties.isSlot = context.site.isSlot ? 'true' : 'false'; diff --git a/appservice/src/deploy/wizard/DeployLocalGitExecuteStep.ts b/appservice/src/deploy/wizard/DeployLocalGitExecuteStep.ts index 987a7024c5..45e613dd6e 100644 --- a/appservice/src/deploy/wizard/DeployLocalGitExecuteStep.ts +++ b/appservice/src/deploy/wizard/DeployLocalGitExecuteStep.ts @@ -9,6 +9,6 @@ import { DeployExecuteStepBase } from "./DeployExecuteStepBase"; export class DeployLocalGitExecuteStep extends DeployExecuteStepBase { public async deployCore(context: InnerDeployContext): Promise { - await localGitDeploy(context.site, { fsPath: context.workspaceFolder.uri.fsPath }, context); + await localGitDeploy(context.site, { fsPath: context.fsPath }, context); } } diff --git a/appservice/src/deploy/wizard/createDeployWizard.ts b/appservice/src/deploy/wizard/createDeployWizard.ts index 66f1896fbf..8080fc15c4 100644 --- a/appservice/src/deploy/wizard/createDeployWizard.ts +++ b/appservice/src/deploy/wizard/createDeployWizard.ts @@ -42,7 +42,7 @@ export async function createDeployExecuteSteps(context: InnerDeployContext): Pro executeSteps.push(new DeployWarExecuteStep()); } else if (javaRuntime && /^java/i.test(javaRuntime) && !context.site.isFunctionApp) { const pathFileMap = new Map([ - [path.basename(context.workspaceFolder.uri.fsPath), 'app.jar'] + [path.basename(context.fsPath), 'app.jar'] ]); executeSteps.push(new DeployZipPushExecuteStep(pathFileMap)); } else if (context.deployMethod === 'flexconsumption') { diff --git a/appservice/src/deploy/wizard/deployZip/DeployFlexExecuteStep.ts b/appservice/src/deploy/wizard/deployZip/DeployFlexExecuteStep.ts index 4a3be17d92..88bc2688ee 100644 --- a/appservice/src/deploy/wizard/deployZip/DeployFlexExecuteStep.ts +++ b/appservice/src/deploy/wizard/deployZip/DeployFlexExecuteStep.ts @@ -21,7 +21,7 @@ export class DeployFlexExecuteStep extends DeployZipBaseExecuteStep { }; return await runWithZipStream(context, { - fsPath: context.workspaceFolder.uri.fsPath, + fsPath: context.fsPath, site: context.site, pathFileMap: this.pathFileMap, callback, diff --git a/appservice/src/deploy/wizard/deployZip/DeployWarExecuteStep.ts b/appservice/src/deploy/wizard/deployZip/DeployWarExecuteStep.ts index 66579f8f48..916e9d2eb5 100644 --- a/appservice/src/deploy/wizard/deployZip/DeployWarExecuteStep.ts +++ b/appservice/src/deploy/wizard/deployZip/DeployWarExecuteStep.ts @@ -12,12 +12,12 @@ import { DeployZipBaseExecuteStep } from "./DeployZipBaseExecuteStep"; export class DeployWarExecuteStep extends DeployZipBaseExecuteStep { public async deployZip(context: InnerDeployContext): Promise { - if (getFileExtension(context.workspaceFolder.uri.fsPath) !== 'war') { + if (getFileExtension(context.fsPath) !== 'war') { throw new Error(l10n.t('Path specified is not a war file')); } const kuduClient = await context.site.createClient(context); - await kuduClient.warPushDeploy(context, () => fs.createReadStream(context.workspaceFolder.uri.fsPath), { + await kuduClient.warPushDeploy(context, () => fs.createReadStream(context.fsPath), { isAsync: true, author: publisherName, deployer: publisherName, diff --git a/appservice/src/deploy/wizard/deployZip/DeployZipBaseExecuteStep.ts b/appservice/src/deploy/wizard/deployZip/DeployZipBaseExecuteStep.ts index 7416d6325e..2b7823e937 100644 --- a/appservice/src/deploy/wizard/deployZip/DeployZipBaseExecuteStep.ts +++ b/appservice/src/deploy/wizard/deployZip/DeployZipBaseExecuteStep.ts @@ -16,7 +16,7 @@ export abstract class DeployZipBaseExecuteStep extends DeployExecuteStepBase { } public async deployCore(context: InnerDeployContext): Promise { - const fsPath = context.workspaceFolder.uri.fsPath; + const fsPath = context.fsPath; if (!(await AzExtFsExtra.pathExists(fsPath))) { throw new Error(l10n.t('Failed to deploy path that does not exist: {0}', fsPath)); } diff --git a/appservice/src/deploy/wizard/deployZip/DeployZipPushExecuteStep.ts b/appservice/src/deploy/wizard/deployZip/DeployZipPushExecuteStep.ts index 7f2d179fdd..23d313ef35 100644 --- a/appservice/src/deploy/wizard/deployZip/DeployZipPushExecuteStep.ts +++ b/appservice/src/deploy/wizard/deployZip/DeployZipPushExecuteStep.ts @@ -23,7 +23,7 @@ export class DeployZipPushExecuteStep extends DeployZipBaseExecuteStep { }; return await runWithZipStream(context, { - fsPath: context.workspaceFolder.uri.fsPath, + fsPath: context.fsPath, site: context.site, pathFileMap: this.pathFileMap, callback, From 3f77b43c3cb8c40078dea6f0aa46e9b6a1c7e594 Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 1 Feb 2024 15:33:41 -0800 Subject: [PATCH 3/4] Revert "appservice: Use management endpoint for all kudu calls (#1677)" (#1683) * Revert "appservice: Use management endpoint for all kudu calls (#1677)" This reverts commit 79f6c4ddcf6a5a4b84aff81d0bdff90620e4ca61. * Bump package for publish (again --- appservice/package-lock.json | 18 +++++++++--------- appservice/package.json | 4 ++-- appservice/src/SiteClient.ts | 28 ++++++---------------------- 3 files changed, 17 insertions(+), 33 deletions(-) diff --git a/appservice/package-lock.json b/appservice/package-lock.json index fb90ad4eea..a47561ae2d 100644 --- a/appservice/package-lock.json +++ b/appservice/package-lock.json @@ -1,12 +1,12 @@ { "name": "@microsoft/vscode-azext-azureappservice", - "version": "2.3.5", + "version": "2.3.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@microsoft/vscode-azext-azureappservice", - "version": "2.3.5", + "version": "2.3.6", "license": "MIT", "dependencies": { "@azure/abort-controller": "^1.0.4", @@ -18,7 +18,7 @@ "@azure/core-client": "^1.7.2", "@azure/core-rest-pipeline": "^1.10.3", "@azure/storage-blob": "^12.3.0", - "@microsoft/vscode-azext-azureutils": "^2.0.6", + "@microsoft/vscode-azext-azureutils": "2.0.2", "@microsoft/vscode-azext-github": "^1.0.0", "@microsoft/vscode-azext-utils": "^2.1.0", "dayjs": "^1.11.2", @@ -676,9 +676,9 @@ } }, "node_modules/@microsoft/vscode-azext-azureutils": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureutils/-/vscode-azext-azureutils-2.0.6.tgz", - "integrity": "sha512-NZDQgAQhTjpAvjDChSQIbKzATe35wnSd0PcgSzYxApX37Ha+l0yHnIrxR8HZJZ3aTS6Jtqxt9yeXIuStcKTPwA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureutils/-/vscode-azext-azureutils-2.0.2.tgz", + "integrity": "sha512-r+7NqedkvfFazztO7kxT1AU/B/UfiGhTDlRtFHx+W5bhp+yJw0eOtX8VPJXXSXoOaq2dzuGBwxAQ0bDD1lNPcQ==", "dependencies": { "@azure/arm-resources": "^5.0.0", "@azure/arm-resources-profile-2020-09-01-hybrid": "^2.0.0", @@ -7381,9 +7381,9 @@ } }, "@microsoft/vscode-azext-azureutils": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureutils/-/vscode-azext-azureutils-2.0.6.tgz", - "integrity": "sha512-NZDQgAQhTjpAvjDChSQIbKzATe35wnSd0PcgSzYxApX37Ha+l0yHnIrxR8HZJZ3aTS6Jtqxt9yeXIuStcKTPwA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/vscode-azext-azureutils/-/vscode-azext-azureutils-2.0.2.tgz", + "integrity": "sha512-r+7NqedkvfFazztO7kxT1AU/B/UfiGhTDlRtFHx+W5bhp+yJw0eOtX8VPJXXSXoOaq2dzuGBwxAQ0bDD1lNPcQ==", "requires": { "@azure/arm-resources": "^5.0.0", "@azure/arm-resources-profile-2020-09-01-hybrid": "^2.0.0", diff --git a/appservice/package.json b/appservice/package.json index d584d4641f..ac3f32f719 100644 --- a/appservice/package.json +++ b/appservice/package.json @@ -1,7 +1,7 @@ { "name": "@microsoft/vscode-azext-azureappservice", "author": "Microsoft Corporation", - "version": "2.3.5", + "version": "2.3.6", "description": "Common tools for developing Azure App Service extensions for VS Code", "tags": [ "azure", @@ -40,7 +40,7 @@ "@azure/core-client": "^1.7.2", "@azure/core-rest-pipeline": "^1.10.3", "@azure/storage-blob": "^12.3.0", - "@microsoft/vscode-azext-azureutils": "^2.0.6", + "@microsoft/vscode-azext-azureutils": "2.0.2", "@microsoft/vscode-azext-github": "^1.0.0", "@microsoft/vscode-azext-utils": "^2.1.0", "dayjs": "^1.11.2", diff --git a/appservice/src/SiteClient.ts b/appservice/src/SiteClient.ts index a0818b9076..c23c21f2a7 100644 --- a/appservice/src/SiteClient.ts +++ b/appservice/src/SiteClient.ts @@ -323,9 +323,7 @@ export class SiteClient implements IAppSettingsClient { } public async zipPushDeploy(context: IActionContext, file: RequestBodyType, rawQueryParameters: KuduModels.PushDeploymentZipPushDeployOptionalParams): Promise { - const client: ServiceClient = await createGenericClient(context, this._site.subscription, { - endpoint: this._site.subscription.environment.managementEndpointUrl, - }); + const client: ServiceClient = await createGenericClient(context, this._site.subscription); const queryParameters = convertQueryParamsValuesToString(rawQueryParameters); const queryString = new URLSearchParams(queryParameters).toString(); const request = createPipelineRequest({ @@ -338,9 +336,7 @@ export class SiteClient implements IAppSettingsClient { } public async warPushDeploy(context: IActionContext, file: RequestBodyType, rawQueryParameters: KuduModels.PushDeploymentWarPushDeployOptionalParams): Promise { - const client: ServiceClient = await createGenericClient(context, this._site.subscription, { - endpoint: this._site.subscription.environment.managementEndpointUrl, - }); + const client: ServiceClient = await createGenericClient(context, this._site.subscription); const queryParameters = convertQueryParamsValuesToString(rawQueryParameters); const queryString = new URLSearchParams(queryParameters).toString(); const request = createPipelineRequest({ @@ -355,9 +351,7 @@ export class SiteClient implements IAppSettingsClient { // TODO: only supporting /zip endpoint for now, but should support /zipurl as well public async flexDeploy(context: IActionContext, file: RequestBodyType, rawQueryParameters: { remoteBuild?: boolean, Deployer?: string }): Promise { - const client: ServiceClient = await createGenericClient(context, this._site.subscription, { - endpoint: this._site.subscription.environment.managementEndpointUrl, - }); + const client: ServiceClient = await createGenericClient(context, this._site.subscription); const queryParameters = convertQueryParamsValuesToString(rawQueryParameters); const queryString = new URLSearchParams(queryParameters).toString(); const request = createPipelineRequest({ @@ -370,9 +364,7 @@ export class SiteClient implements IAppSettingsClient { } public async deploy(context: IActionContext, id: string): Promise { - const client: ServiceClient = await createGenericClient(context, this._site.subscription, { - endpoint: this._site.subscription.environment.managementEndpointUrl, - }); + const client: ServiceClient = await createGenericClient(context, this._site.subscription); return await client.sendRequest(createPipelineRequest({ method: 'PUT', url: `${this._site.kuduUrl}/api/deployments/${id}` @@ -383,7 +375,6 @@ export class SiteClient implements IAppSettingsClient { public async getDeployResults(context: IActionContext): Promise { const client: ServiceClient = await createGenericClient(context, this._site.subscription, { addStatusCodePolicy: true, - endpoint: this._site.subscription.environment.managementEndpointUrl, }); const response: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({ method: 'GET', @@ -403,7 +394,6 @@ export class SiteClient implements IAppSettingsClient { public async getDeployResult(context: IActionContext, deployId: string): Promise { const client: ServiceClient = await createGenericClient(context, this._site.subscription, { addStatusCodePolicy: true, - endpoint: this._site.subscription.environment.managementEndpointUrl, }); const response: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({ method: 'GET', @@ -416,7 +406,6 @@ export class SiteClient implements IAppSettingsClient { public async getLogEntry(context: IActionContext, deployId: string): Promise { const client: ServiceClient = await createGenericClient(context, this._site.subscription, { addStatusCodePolicy: true, - endpoint: this._site.subscription.environment.managementEndpointUrl, }); const response: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({ method: 'GET', @@ -437,7 +426,6 @@ export class SiteClient implements IAppSettingsClient { public async getLogEntryDetails(context: IActionContext, deployId: string, logId: string): Promise { const client: ServiceClient = await createGenericClient(context, this._site.subscription, { addStatusCodePolicy: true, - endpoint: this._site.subscription.environment.managementEndpointUrl, }); const response: AzExtPipelineResponse = await client.sendRequest(createPipelineRequest({ method: 'GET', @@ -454,9 +442,7 @@ export class SiteClient implements IAppSettingsClient { } public async vfsGetItem(context: IActionContext, url: string): Promise { - const client: ServiceClient = await createGenericClient(context, this._site.subscription, { - endpoint: this._site.subscription.environment.managementEndpointUrl, - }); + const client: ServiceClient = await createGenericClient(context, this._site.subscription); return await client.sendRequest(createPipelineRequest({ method: 'GET', url, @@ -464,9 +450,7 @@ export class SiteClient implements IAppSettingsClient { } public async vfsPutItem(context: IActionContext, data: string | ArrayBuffer, url: string, rawHeaders?: {}): Promise { - const client: ServiceClient = await createGenericClient(context, this._site.subscription, { - endpoint: this._site.subscription.environment.managementEndpointUrl, - }); + const client: ServiceClient = await createGenericClient(context, this._site.subscription); const headers = createHttpHeaders(rawHeaders); return await client.sendRequest(createPipelineRequest({ method: 'PUT', From f43e74bff783ea300437e1ac8d96807b56e35db0 Mon Sep 17 00:00:00 2001 From: "Brandon Waterloo [MSFT]" <36966225+bwateratmsft@users.noreply.github.com> Date: Fri, 2 Feb 2024 13:09:49 -0500 Subject: [PATCH 4/4] Let VSCode change the settings.json (#1684) --- .vscode/settings.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8d4dd17d56..04363e2af7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "editor.codeActionsOnSave": { - "source.fixAll.eslint": true, - "source.organizeImports": true + "source.fixAll.eslint": "explicit", + "source.organizeImports": "explicit" }, "editor.detectIndentation": false, "editor.formatOnSave": true,