Skip to content
Merged
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
7d03828
Impl
MicroFish91 Mar 5, 2024
206fbff
Impl
MicroFish91 Mar 5, 2024
7b05781
Add V2 deployment settings interface
MicroFish91 Mar 5, 2024
b1bb125
Scaffold v2 and configuration model
MicroFish91 Mar 5, 2024
764ae2a
Update
MicroFish91 Mar 5, 2024
9ecb4e7
Update with todos
MicroFish91 Mar 5, 2024
45c1481
Change some names
MicroFish91 Mar 5, 2024
965c625
Impl
MicroFish91 Mar 6, 2024
b23eae6
Add wizard context
MicroFish91 Mar 6, 2024
b95c868
Reorganize folders
MicroFish91 Mar 7, 2024
46993a9
Reorganize files
MicroFish91 Mar 7, 2024
107b698
Update
MicroFish91 Mar 7, 2024
6fa8e61
Merge with scaffold/v2
MicroFish91 Mar 7, 2024
58406fa
Init new step
MicroFish91 Mar 7, 2024
5dcdd58
Impl
MicroFish91 Mar 8, 2024
6196043
Update step name
MicroFish91 Mar 8, 2024
7876b85
Update
MicroFish91 Mar 8, 2024
e8fb557
Revert v2 connection
MicroFish91 Mar 8, 2024
ea2bdbf
Simplify util
MicroFish91 Mar 8, 2024
3e00f1e
Update types
MicroFish91 Mar 12, 2024
c52123d
Wip
MicroFish91 Mar 12, 2024
8b98b37
Wip
MicroFish91 Mar 14, 2024
d3ff220
Update
MicroFish91 Mar 14, 2024
cc4c49d
Revert command test
MicroFish91 Mar 14, 2024
45411e5
Merge with main
MicroFish91 Mar 15, 2024
1747594
Fix merge
MicroFish91 Mar 15, 2024
7077f0f
Fix message
MicroFish91 Mar 15, 2024
c7c8441
Fixes
MicroFish91 Mar 15, 2024
37825da
Fix merge
MicroFish91 Mar 15, 2024
b5feac6
Update
MicroFish91 Mar 15, 2024
0beb2d4
Update
MicroFish91 Mar 15, 2024
bad4d4a
Update to verifying
MicroFish91 Mar 15, 2024
b5c2888
Wip
MicroFish91 Mar 15, 2024
0cfc69c
Update shouldExecute
MicroFish91 Mar 15, 2024
ff28284
Impl
MicroFish91 Mar 15, 2024
96ec865
Update fail message
MicroFish91 Mar 15, 2024
7380b08
Update activity log
MicroFish91 Mar 15, 2024
ed80b2b
Merge with mwf/deep-val
MicroFish91 Mar 15, 2024
d53c76b
Fixes
MicroFish91 Mar 15, 2024
202ce35
Revert v2 hookup for testing
MicroFish91 Mar 15, 2024
acab8e0
Update shouldExecute
MicroFish91 Mar 15, 2024
925c618
Impl
MicroFish91 Mar 17, 2024
3aa3175
Update subscription logic
MicroFish91 Mar 17, 2024
1a33952
Use wizard steps instead
MicroFish91 Mar 18, 2024
9516e22
Update
MicroFish91 Mar 18, 2024
0ca7bf7
Remove todo
MicroFish91 Mar 18, 2024
88530c8
Update
MicroFish91 Mar 18, 2024
6daf2e3
Impl
MicroFish91 Mar 19, 2024
0c1d173
Remove unused logic
MicroFish91 Mar 19, 2024
32061ee
Impl
MicroFish91 Mar 19, 2024
667cf8e
Impl
MicroFish91 Mar 19, 2024
f96ee0a
Change dockerfile step name
MicroFish91 Mar 19, 2024
be0b8e8
Impl
MicroFish91 Mar 19, 2024
5295b92
Impl
MicroFish91 Mar 19, 2024
551ede4
Remove tests
MicroFish91 Mar 19, 2024
e75392b
Update
MicroFish91 Mar 19, 2024
872a061
Remove todo:
MicroFish91 Mar 19, 2024
1b9fbc1
Merge with mwf/remove-dwp
MicroFish91 Mar 19, 2024
b5b6654
Merge branch 'mwf/acr-val' of https://github.com/microsoft/vscode-azu…
MicroFish91 Mar 19, 2024
c153cc4
Merge branch 'mwf/dwp-v2-tree' of https://github.com/microsoft/vscode…
MicroFish91 Mar 19, 2024
2a4343f
Merge branch 'mwf/dwp-starting-config-1' of https://github.com/micros…
MicroFish91 Mar 19, 2024
25f38ef
Merge branch 'mwf/add-missing-resources' of https://github.com/micros…
MicroFish91 Mar 19, 2024
2d3f94a
Merge branch 'mwf/2-step' of https://github.com/microsoft/vscode-azur…
MicroFish91 Mar 19, 2024
bda6353
Merge branch 'mwf/man-env-list-step' of https://github.com/microsoft/…
MicroFish91 Mar 19, 2024
fd6129b
Merge branch 'mwf/remove-dwp' of https://github.com/microsoft/vscode-…
MicroFish91 Mar 19, 2024
7a35ff5
Trick git into understanding case sensitivity pt1
MicroFish91 Mar 19, 2024
77d73ac
pt2
MicroFish91 Mar 19, 2024
6b8b24d
Merge branch 'mwf/2-step' of https://github.com/microsoft/vscode-azur…
MicroFish91 Mar 19, 2024
4da0c7a
Merge branch 'mwf/man-env-list-step' of https://github.com/microsoft/…
MicroFish91 Mar 19, 2024
bfb1bf8
Merge branch 'mwf/remove-dwp' of https://github.com/microsoft/vscode-…
MicroFish91 Mar 19, 2024
16a91e6
Update shouldPrompt
MicroFish91 Mar 19, 2024
c013027
Merge with main
MicroFish91 Mar 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion extension.bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
export * from '@microsoft/vscode-azext-utils';
// Export activate/deactivate for main.js
export * from './src/commands/deployWorkspaceProject/DeployWorkspaceProjectContext';
export * from './src/commands/deployWorkspaceProject/getDefaultValues/DefaultResourcesNameStep';
export * from './src/commands/ingress/IngressContext';
export * from './src/commands/ingress/IngressPromptStep';
export * from './src/commands/ingress/editTargetPort/getDefaultPort';
Expand Down
1 change: 1 addition & 0 deletions src/commands/api/deployWorkspaceProjectApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export async function deployWorkspaceProjectApi(deployWorkspaceProjectOptions: a
suppressActivity: true,
suppressConfirmation,
suppressContainerAppCreation,
suppressProgress: true,
suppressWizardTitle: true,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class ManagedEnvironmentNameStep extends AzureWizardPromptStep<IManagedEn
const prompt: string = localize('containerAppNamePrompt', 'Enter a container apps environment name.');
context.newManagedEnvironmentName = (await context.ui.showInputBox({
prompt,
validateInput: this.validateInput,
validateInput: ManagedEnvironmentNameStep.validateInput,
asyncValidationTask: (name: string) => this.validateNameAvailable(context, name)
})).trim();

Expand All @@ -25,7 +25,7 @@ export class ManagedEnvironmentNameStep extends AzureWizardPromptStep<IManagedEn
return !context.managedEnvironment && !context.newManagedEnvironmentName;
}

private validateInput(name: string | undefined): string | undefined {
public static validateInput(name: string | undefined): string | undefined {
name = name ? name.trim() : '';

const { minLength, maxLength } = { minLength: 4, maxLength: 20 };
Expand Down
38 changes: 22 additions & 16 deletions src/commands/deployWorkspaceProject/deployWorkspaceProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,20 @@

import { callWithTelemetryAndErrorHandling, createSubscriptionContext, nonNullProp, subscriptionExperience, type IActionContext, type ISubscriptionContext } from "@microsoft/vscode-azext-utils";
import { type AzureSubscription } from "@microsoft/vscode-azureresources-api";
import { ProgressLocation, window } from "vscode";
import { window } from "vscode";
import { ext } from "../../extensionVariables";
import { type SetTelemetryProps } from "../../telemetry/SetTelemetryProps";
import { type DeployWorkspaceProjectNotificationTelemetryProps as NotificationTelemetryProps } from "../../telemetry/commandTelemetryProps";
import { ContainerAppItem, isIngressEnabled, type ContainerAppModel } from "../../tree/ContainerAppItem";
import { ManagedEnvironmentItem } from "../../tree/ManagedEnvironmentItem";
import { localize } from "../../utils/localize";
import { type IContainerAppContext } from "../IContainerAppContext";
import { type DeployWorkspaceProjectResults } from "../api/vscode-azurecontainerapps.api";
import { browseContainerApp } from "../browseContainerApp";
import { type DeployWorkspaceProjectContext } from "./DeployWorkspaceProjectContext";
import { getDefaultContextValues } from "./getDefaultValues/getDefaultContextValues";
import { type DeploymentConfiguration } from "./deploymentConfiguration/DeploymentConfiguration";
import { getTreeItemDeploymentConfiguration } from "./deploymentConfiguration/getTreeItemDeploymentConfiguration";
import { getWorkspaceDeploymentConfiguration } from "./deploymentConfiguration/workspace/getWorkspaceDeploymentConfiguration";
import { getDeployWorkspaceProjectResults } from "./getDeployWorkspaceProjectResults";
import { deployWorkspaceProjectInternal, type DeployWorkspaceProjectInternalContext } from "./internal/deployWorkspaceProjectInternal";

Expand All @@ -25,29 +28,32 @@ export async function deployWorkspaceProject(context: IActionContext & Partial<D
item = undefined;
}

const subscription: AzureSubscription = await subscriptionExperience(context, ext.rgApiV2.resources.azureResourceTreeDataProvider);
const subscription: AzureSubscription = item?.subscription ?? await subscriptionExperience(context, ext.rgApiV2.resources.azureResourceTreeDataProvider);
const subscriptionContext: ISubscriptionContext = createSubscriptionContext(subscription);

// Show loading indicator while we configure default values
let defaultContextValues: Partial<DeployWorkspaceProjectContext> | undefined;
await window.withProgress({
location: ProgressLocation.Notification,
cancellable: false,
title: localize('loadingWorkspaceTitle', 'Loading workspace project deployment configurations...')
}, async () => {
defaultContextValues = await getDefaultContextValues({ ...context, ...subscriptionContext }, item);
});

const deployWorkspaceProjectInternalContext: DeployWorkspaceProjectInternalContext = Object.assign(context, {
...defaultContextValues,
const containerAppContext: IContainerAppContext = Object.assign(context, {
...subscriptionContext,
subscription
});

let deploymentConfiguration: DeploymentConfiguration;
if (item) {
deploymentConfiguration = await getTreeItemDeploymentConfiguration(item);
} else {
// Todo: Conditionally call v1 to v2 settings conversion (https://github.com/microsoft/vscode-azurecontainerapps/issues/612)

// Todo: Monorepo core logic (workspace settings path) https://github.com/microsoft/vscode-azurecontainerapps/issues/613
deploymentConfiguration = await getWorkspaceDeploymentConfiguration({ ...containerAppContext });
}

const deployWorkspaceProjectInternalContext: DeployWorkspaceProjectInternalContext = Object.assign(containerAppContext, {
...deploymentConfiguration,
});

const deployWorkspaceProjectResultContext: DeployWorkspaceProjectContext = await deployWorkspaceProjectInternal(deployWorkspaceProjectInternalContext, {
suppressActivity: false,
suppressConfirmation: false,
suppressContainerAppCreation: false,
suppressProgress: false,
suppressWizardTitle: false
});

Expand Down
93 changes: 0 additions & 93 deletions src/commands/deployWorkspaceProject/deployWorkspaceProjectV2.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { type ManagedEnvironment } from "@azure/arm-appcontainers";
import { type Registry } from "@azure/arm-containerregistry";
import { type ResourceGroup } from "@azure/arm-resources";
import { type WorkspaceFolder } from "vscode";
Expand All @@ -15,6 +16,7 @@ export interface DeploymentConfiguration {
srcPath?: string;
envPath?: string;
resourceGroup?: ResourceGroup;
managedEnvironment?: ManagedEnvironment;
containerApp?: ContainerAppModel;
containerRegistry?: Registry;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { ext } from "../../../extensionVariables";
import { ContainerAppItem } from "../../../tree/ContainerAppItem";
import { ManagedEnvironmentItem } from "../../../tree/ManagedEnvironmentItem";
import { localize } from "../../../utils/localize";
import { type DeploymentConfiguration } from "./DeploymentConfiguration";

export async function getTreeItemDeploymentConfiguration(item: ContainerAppItem | ManagedEnvironmentItem): Promise<DeploymentConfiguration> {
if (ContainerAppItem.isContainerAppItem(item)) {
return { containerApp: item.containerApp };
} else if (ManagedEnvironmentItem.isManagedEnvironmentItem(item)) {
return { managedEnvironment: item.managedEnvironment };
} else {
const incompatibleMessage: string = localize('incompatibleTreeItem', 'An incompatible tree item was provided to Azure Container Apps for project deployment.');
ext.outputChannel.appendLog(localize('incompatibleMessageLog', 'Error: {0}', incompatibleMessage));
throw new Error(incompatibleMessage);
}
}

This file was deleted.

Loading