Skip to content
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
030a60b
Initial implementation
MicroFish91 Aug 9, 2024
590d35e
Update step priorities
MicroFish91 Aug 9, 2024
fb87c28
Update acrliststep call
MicroFish91 Aug 9, 2024
8dea143
Correct an old priority
MicroFish91 Aug 9, 2024
97fc630
Fix typing
MicroFish91 Aug 9, 2024
8733ed4
Update comment
MicroFish91 Aug 9, 2024
73ec21d
Update shouldPrompt comment with ref link
MicroFish91 Aug 9, 2024
1db17e6
Add managed environment context requirements
MicroFish91 Aug 12, 2024
011cc6b
Add Required context
MicroFish91 Aug 12, 2024
7df9702
PR feedback
MicroFish91 Aug 22, 2024
e844c07
Merge with main
MicroFish91 Sep 9, 2024
d93d25b
Feedback to rename contexts
MicroFish91 Sep 9, 2024
ad4745d
Add/update dependencies
MicroFish91 Sep 17, 2024
ce1794d
First pass core implementation
MicroFish91 Sep 17, 2024
55a8019
Add AcrPullVerifyStep
MicroFish91 Sep 17, 2024
2c926dd
Updates to AcrPullVerifyStep
MicroFish91 Sep 18, 2024
5a1246f
Update comment
MicroFish91 Sep 18, 2024
79ca374
Don't call list creds if identity
MicroFish91 Sep 18, 2024
c50163a
Update should execute condition
MicroFish91 Sep 20, 2024
4669d32
Merge branch 'main' of https://github.com/microsoft/vscode-azureconta…
MicroFish91 Sep 23, 2024
0d728db
Always start with quick start
MicroFish91 Sep 23, 2024
00fe87a
Merge branch 'main' of https://github.com/microsoft/vscode-azureconta…
MicroFish91 Sep 23, 2024
60c12b4
Merge branch 'mwf/cr-ii' of https://github.com/microsoft/vscode-azure…
MicroFish91 Sep 23, 2024
744c684
Merge branch 'mwf/cr-iii' of https://github.com/microsoft/vscode-azur…
MicroFish91 Sep 23, 2024
d3780d5
Add createContainerApp activity output
MicroFish91 Sep 23, 2024
9c5625d
Rename to treeItemLabel
MicroFish91 Sep 25, 2024
0801c1d
Merge with main
MicroFish91 Oct 7, 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
187 changes: 161 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,8 @@
"webpack-cli": "^4.6.0"
},
"dependencies": {
"@azure/arm-appcontainers": "^2.0.0",
"@azure/arm-appcontainers": "^2.1.0-beta.1",
"@azure/arm-authorization": "^9.0.0",
"@azure/arm-containerregistry": "^10.0.0",
"@azure/arm-operationalinsights": "^8.0.0",
"@azure/arm-resources": "^5.2.0",
Expand Down
84 changes: 84 additions & 0 deletions src/commands/AzureWizardActivityOutputExecuteStep.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { activityFailContext, activityFailIcon, activityProgressContext, activityProgressIcon, activitySuccessContext, activitySuccessIcon, AzureWizardExecuteStep, createUniversallyUniqueContextValue, GenericParentTreeItem, GenericTreeItem, nonNullValue, type ExecuteActivityOutput, type IActionContext } from "@microsoft/vscode-azext-utils";

interface ActivityOutputCreateOptions {
stepName: string;
treeItemLabel: string;
outputLogMessage?: string;
activityStatus: 'Success' | 'Fail' | 'Progress';
}

export abstract class AzureWizardActivityOutputExecuteStep<T extends IActionContext> extends AzureWizardExecuteStep<T> {
abstract stepName: string;
protected abstract getSuccessString(context: T): string;
protected abstract getFailString(context: T): string;

protected getProgressString?(context: T): string;
/**
* Optional; define this if you want a special, custom label to be assigned to each tree item
* that is different than the required success or fail strings
*/
protected getTreeItemLabel?(context: T): string;

public createSuccessOutput(context: T): ExecuteActivityOutput {
const success: string = this.getSuccessString(context);

return createExecuteActivityOutput(context, {
activityStatus: 'Success',
stepName: this.stepName,
treeItemLabel: this.getTreeItemLabel ? this.getTreeItemLabel(context) : success,
outputLogMessage: success,
});
}

public createProgressOutput(context: T): ExecuteActivityOutput {
const progress: string | undefined = this.getProgressString?.(context);

return createExecuteActivityOutput(context, {
activityStatus: 'Progress',
stepName: this.stepName,
treeItemLabel: this.getTreeItemLabel ? this.getTreeItemLabel(context) : nonNullValue(progress),
outputLogMessage: progress,
});
}

public createFailOutput(context: T): ExecuteActivityOutput {
const fail: string = this.getFailString(context);

return createExecuteActivityOutput(context, {
activityStatus: 'Fail',
stepName: this.stepName,
treeItemLabel: this.getTreeItemLabel ? this.getTreeItemLabel(context) : fail,
outputLogMessage: fail,
});
}
}

function createExecuteActivityOutput(_: IActionContext, options: ActivityOutputCreateOptions): ExecuteActivityOutput {
const activityContext = options.activityStatus === 'Success' ? activitySuccessContext : options.activityStatus === 'Fail' ? activityFailContext : activityProgressContext;
const contextValue = createUniversallyUniqueContextValue([`${options.stepName}${options.activityStatus}Item`, activityContext]);
const label = options.treeItemLabel;
const iconPath = options.activityStatus === 'Success' ? activitySuccessIcon : options.activityStatus === 'Fail' ? activityFailIcon : activityProgressIcon;

const item = options.activityStatus === 'Fail' ?
// Logic is in place to automatically attach an error item as child if thrown during a registered execute step -- therefore, return fails with a parent tree item
new GenericParentTreeItem(undefined, {
contextValue,
label,
iconPath
}) :
new GenericTreeItem(undefined, {
contextValue,
label,
iconPath
});

return {
item,
message: options.outputLogMessage,
}
}
6 changes: 5 additions & 1 deletion src/commands/EXECUTE_PRIORITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ When creating or updating resources, execute steps should occupy certain priorit

#### Steps
##### Managed Identity Registry Credential
- Coming soon...
- ManagedEnvironmentIdentityEnableStep: 450
- AcrPullVerifyStep: 460
- AcrPullEnableStep: 461
- ManagedIdentityRegistryCredentialAddConfigurationStep: 470

##### Admin User Registry Credential
- AcrEnableAdminUserStep: 450
Expand Down Expand Up @@ -65,6 +68,7 @@ When creating or updating resources, execute steps should occupy certain priorit

#### Steps

- QuickStartImageConfigureStep: 610
- ContainerAppCreateStep: 620
- ContainerAppUpdateStep: 650

Expand Down
13 changes: 13 additions & 0 deletions src/commands/ManagedEnvironmentContext.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { type ManagedEnvironment } from "@azure/arm-appcontainers";
import { type ISubscriptionActionContext } from "@microsoft/vscode-azext-utils";
import { type AzureSubscription } from "@microsoft/vscode-azureresources-api";

export interface ManagedEnvironmentRequiredContext extends ISubscriptionActionContext {
subscription: AzureSubscription;
managedEnvironment: ManagedEnvironment;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { type ManagedEnvironment } from '@azure/arm-appcontainers';
import { type IResourceGroupWizardContext } from '@microsoft/vscode-azext-azureutils';
import { type ExecuteActivityContext } from '@microsoft/vscode-azext-utils';
import { type SetTelemetryProps } from '../../telemetry/SetTelemetryProps';
Expand All @@ -12,11 +11,8 @@ import { type IContainerAppContext } from '../IContainerAppContext';
import { type ImageSourceBaseContext } from '../image/imageSource/ImageSourceContext';
import { type IngressBaseContext } from '../ingress/IngressContext';

export interface CreateContainerAppBaseContext extends IResourceGroupWizardContext, ImageSourceBaseContext, IngressBaseContext, IContainerAppContext, ExecuteActivityContext {
export interface ContainerAppCreateBaseContext extends IResourceGroupWizardContext, ImageSourceBaseContext, IngressBaseContext, IContainerAppContext, ExecuteActivityContext {
newContainerAppName?: string;

managedEnvironmentId?: string;
managedEnvironment?: ManagedEnvironment;
}

export type CreateContainerAppContext = CreateContainerAppBaseContext & SetTelemetryProps<TelemetryProps>;
export type ContainerAppCreateContext = ContainerAppCreateBaseContext & SetTelemetryProps<TelemetryProps>;
Loading