-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add backward compatibility to API in support of the new managed identity features #816
Changes from 34 commits
87841ca
1088867
3e85ad6
e0a7003
c35bd08
ef87f0f
631be79
b537741
146661f
e4ede57
7906366
7c8d543
b8a81fb
a5db872
c9292be
1feaddd
a139430
f2cd6a7
300a5da
2d05935
209d1ac
e2c87c6
7a8787c
eff6574
5b22cc9
bd3e538
57661f6
d2eddbb
4ec09bb
85eba7d
85d8d1c
ac5b4dc
31db97f
6f7cb74
75df8de
6a98700
08428a0
7849f25
3be6e34
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
# Change Log | ||
|
||
### 0.0.2 | ||
### 0.0.3 | ||
|
||
### Changed | ||
* [[816]](https://github.com/microsoft/vscode-azurecontainerapps/pull/816) Added backward compatibility to ensure existing functionality remains unaffected by new managed identity features. | ||
|
||
### 0.0.2 | ||
|
||
### Changed | ||
* [[615]](https://github.com/microsoft/vscode-azurecontainerapps/pull/615) Removed ability to set option `ignoreExistingDeploySettings`. This will now happen automatically by default. | ||
|
||
## 0.0.1 | ||
* Initial release | ||
|
||
### Added | ||
|
||
* [[578]](https://github.com/microsoft/vscode-azurecontainerapps/pull/578) Added an API entry-point to the `deployWorkspaceProject` command |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,11 +15,21 @@ import { type DeployWorkspaceProjectContext } from "../deployWorkspaceProject/De | |
import { getDeployWorkspaceProjectResults, type DeployWorkspaceProjectResults } from "../deployWorkspaceProject/getDeployWorkspaceProjectResults"; | ||
import { type DeployWorkspaceProjectInternalContext } from "../deployWorkspaceProject/internal/DeployWorkspaceProjectInternalContext"; | ||
import { deployWorkspaceProjectInternal } from "../deployWorkspaceProject/internal/deployWorkspaceProjectInternal"; | ||
import { RegistryCredentialType } from "../registryCredentials/RegistryCredentialsAddConfigurationListStep"; | ||
import type * as api from "./vscode-azurecontainerapps.api"; | ||
|
||
export async function deployWorkspaceProjectApi(deployWorkspaceProjectOptions: api.DeployWorkspaceProjectOptionsContract): Promise<DeployWorkspaceProjectResults> { | ||
return await callWithTelemetryAndErrorHandling('containerApps.api.deployWorkspaceProject', async (context: IActionContext): Promise<DeployWorkspaceProjectResults> => { | ||
const { resourceGroupId, rootPath, dockerfilePath, srcPath, suppressConfirmation, suppressContainerAppCreation, shouldSaveDeploySettings } = deployWorkspaceProjectOptions; | ||
const { | ||
resourceGroupId, | ||
rootPath, | ||
dockerfilePath, | ||
srcPath, | ||
suppressRegistryPrompt, | ||
suppressConfirmation, | ||
suppressContainerAppCreation, | ||
shouldSaveDeploySettings | ||
} = deployWorkspaceProjectOptions; | ||
|
||
const subscription: AzureSubscription = await subscriptionExperience(context, ext.rgApiV2.resources.azureResourceTreeDataProvider, { | ||
selectBySubscriptionId: getSubscriptionIdFromOptions(deployWorkspaceProjectOptions), | ||
|
@@ -38,12 +48,14 @@ export async function deployWorkspaceProjectApi(deployWorkspaceProjectOptions: a | |
rootFolder, | ||
srcPath: srcPath ? Uri.file(srcPath).fsPath : undefined, | ||
dockerfilePath: dockerfilePath ? Uri.file(dockerfilePath).fsPath : undefined, | ||
newRegistryCredentialType: RegistryCredentialType.DockerLogin, | ||
shouldSaveDeploySettings: !!shouldSaveDeploySettings, | ||
}); | ||
|
||
const deployWorkspaceProjectContext: DeployWorkspaceProjectContext = await deployWorkspaceProjectInternal(deployWorkspaceProjectInternalContext, { | ||
suppressActivity: true, | ||
suppressConfirmation, | ||
suppressRegistryPrompt: suppressRegistryPrompt ?? true, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This PR introduced the prompt, so add ability to suppress and default it to true to preserve existing behavior |
||
suppressContainerAppCreation, | ||
suppressProgress: true, | ||
suppressWizardTitle: true, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ import type * as api from "./vscode-azurecontainerapps.api"; | |
|
||
export function getAzureContainerAppsApiProvider(): apiUtils.AzureExtensionApiProvider { | ||
return createApiProvider([<api.AzureContainerAppsExtensionApi>{ | ||
// Todo: Change this to 0.0.2 later. 0.0.2 is backwards compatible anyway so this change should be fine either way. | ||
// Todo: Change this to 0.0.3 later. 0.0.3 is backwards compatible anyway so this change should be fine either way. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When we eventually add managed identity support for the api, I will bump the major version There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, but just so you know, this changing is purely aesthetic. semver doesn't actually register this as a different version number since there's no major version number. |
||
// For some reason it's causing a block on Function side, so just keep it at 0.0.1 until we figure out why | ||
apiVersion: '0.0.1', | ||
deployWorkspaceProject: deployWorkspaceProjectApi | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { type Registry } from "@azure/arm-containerregistry"; | ||
import { AzureWizardPromptStep, type IAzureQuickPickItem } from "@microsoft/vscode-azext-utils"; | ||
import { localize } from "../../../../utils/localize"; | ||
import { isRecommendedPick } from "../../../../utils/pickUtils"; | ||
import { acrCreatePick, AcrListStep } from "../../../image/imageSource/containerRegistry/acr/AcrListStep"; | ||
import { type DeployWorkspaceProjectInternalContext } from "../DeployWorkspaceProjectInternalContext"; | ||
|
||
export class DwpAcrListStep<T extends DeployWorkspaceProjectInternalContext> extends AzureWizardPromptStep<T> { | ||
public async prompt(context: T): Promise<void> { | ||
const picks: IAzureQuickPickItem<Registry | undefined>[] = await this.getPicks(context); | ||
if (!picks.length) { | ||
// No container registries to choose from | ||
return; | ||
} | ||
|
||
const placeHolder: string = localize('selectContainerRegistry', 'Select an Azure Container Registry to store your image'); | ||
const pick: IAzureQuickPickItem<Registry | undefined> = await context.ui.showQuickPick(picks, { placeHolder, suppressPersistence: true }); | ||
|
||
context.telemetry.properties.usedRecommendedRegistry = isRecommendedPick(pick) ? 'true' : 'false'; | ||
context.registry = pick.data; | ||
} | ||
|
||
public shouldPrompt(context: T): boolean { | ||
return !context.registry; | ||
} | ||
|
||
public async getPicks(context: T): Promise<IAzureQuickPickItem<Registry | undefined>[]> { | ||
return [ | ||
acrCreatePick, | ||
...await AcrListStep.getSortedAndRecommendedPicks(context), | ||
]; | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need additional discussions about whether we want to default to managed identity here in the future. For now, I'm keeping it as
Docker Login
to preserve existing behavior.