Skip to content
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 deployImage as part of API export, add additional activity children, and allow more flexible deployment targets #817

Open
wants to merge 7 commits into
base: mwf/grim-sapphire
Choose a base branch
from

Conversation

MicroFish91
Copy link
Contributor

@MicroFish91 MicroFish91 commented Dec 27, 2024

Partially addresses: #719

Docker extension currently is calling into the command directly, but I wanted to expose the command as part of the extension API, so I reorganized it that way and added a backwards compatibility wrapper to keep everything working the same so Docker doesn't have to update anything.

I also made the command less opinionated by allowing the user to pick revision containers as well, basically allowing the command to deploy to all possible resource targets (instead of assuming the latest single revision mode container apps). This required adding an optional context value for the Template.

I also added two new activity children to the command to better indicate when registry credentials were added to the container app envelope.

Examples:
image

image

@MicroFish91 MicroFish91 changed the title Add deployImageApi to list of command exports and add updated activity children Add deployImageApi to list of api exports and add updated activity children Dec 30, 2024
@MicroFish91 MicroFish91 changed the title Add deployImageApi to list of api exports and add updated activity children Add deployImageApi to api export and add updated activity children Dec 30, 2024
@MicroFish91 MicroFish91 changed the title Add deployImageApi to api export and add updated activity children Add deployImageApi as part of API export and add updated activity children Dec 30, 2024
@MicroFish91 MicroFish91 changed the title Add deployImageApi as part of API export and add updated activity children Add deployImageApi to API export, add additional activity children, and allow more flexible deployment targets Dec 30, 2024
@MicroFish91 MicroFish91 changed the title Add deployImageApi to API export, add additional activity children, and allow more flexible deployment targets Add deployImage as part of API export, add additional activity children, and allow more flexible deployment targets by template Dec 30, 2024
@MicroFish91 MicroFish91 changed the title Add deployImage as part of API export, add additional activity children, and allow more flexible deployment targets by template Add deployImage as part of API export, add additional activity children, and allow more flexible deployment targets Dec 30, 2024
@MicroFish91 MicroFish91 marked this pull request as ready for review December 30, 2024 21:23
@MicroFish91 MicroFish91 requested a review from a team as a code owner December 30, 2024 21:23
import { type ContainerRegistryImageSourceContext } from "../../image/imageSource/containerRegistry/ContainerRegistryImageSourceContext";
import { type DeployImageToAcaOptionsContract } from "../vscode-azurecontainerapps.api";

export async function deployImageApi(deployImageOptions: DeployImageToAcaOptionsContract): Promise<void> {
Copy link
Contributor Author

@MicroFish91 MicroFish91 Dec 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all a carryover of existing code. Only difference is the callWithTelemetryAndErrorHandling wrapper

@@ -8,6 +8,15 @@ export interface AzureContainerAppsExtensionApi {
deployWorkspaceProject(options: DeployWorkspaceProjectOptionsContract): Promise<DeployWorkspaceProjectResults>;
}

// The interface of the command options passed to the Azure Container Apps extension's deployImageToAca command
// This interface is shared with the Docker extension (https://github.com/microsoft/vscode-docker)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carryover of existing interface, but moved into the api type definition

import { type ContainerRegistryImageSourceContext } from "../image/imageSource/containerRegistry/ContainerRegistryImageSourceContext";
import { type DeployImageContext } from "./DeployImageContext";

export async function deployImage(context: IActionContext & Partial<ContainerRegistryImageSourceContext>, node: ContainerItem): Promise<void> {
Copy link
Contributor Author

@MicroFish91 MicroFish91 Dec 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New changes:

  1. Wizard context now includes containersIdx and template which are used to allow targets to each revision's container while in multiple revisions mode
  2. Added activity children for logging the existing resource group and container app to keep formatting similar to the other major commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant