Skip to content

Feat/hook ca command to aks tree#1942

Merged
Tatsinnit merged 3 commits intoAzure:mainfrom
Tatsinnit:feat/hook-ca-command-to-aks-tree
Mar 2, 2026
Merged

Feat/hook ca command to aks tree#1942
Tatsinnit merged 3 commits intoAzure:mainfrom
Tatsinnit:feat/hook-ca-command-to-aks-tree

Conversation

@Tatsinnit
Copy link
Copy Markdown
Member

Hook Container Assist to AKS Cluster Tree

This PR takes care of #1941 , it adds a Run Container Assist command directly to the AKS cluster tree node in CloudExplorer, so users can right-click a cluster and launch Container Assist without being re-prompted for subscription and cluster information that's already available from the tree context. Also adds (Preview) labels to all Container Assist and OIDC commands, and repositions the explorer context menu entry.

Changes

1. New tree-aware Container Assist command (aks.runContainerAssistFromTree)

  • aksContainerAssist.ts — Added runContainerAssistFromTree() entry point that:

    • Resolves the AksClusterTreeNode from the command target via getAksClusterTreeNode()
    • Extracts subscriptionId, resourceGroupName, and clusterName from the tree node
    • Prompts only for the workspace folder (skipping subscription/cluster selection)
    • Delegates to collectAzureContextFromTree() for remaining prompts (ACR, namespace, workflow name)
    • Reuses the existing processContainerAssistAction() pipeline
  • azureSelections.ts — Added collectAzureContextFromTree() that:

    • Accepts pre-resolved subscriptionId, clusterName, and clusterResourceGroup
    • Constructs a Cluster object directly, skipping the subscription and cluster picker UX
    • Prompts for ACR (via existing selectClusterAcr/selectAcr fallback), namespace, and workflow name
  • extension.ts — Registered the new command with telemetry tracking

  • package.json — Added command definition and menu contributions:

    • view/item/context group 8@2 — appears in the AKS cluster right-click menu
    • aks.developDeploySubMenu group 1_developer@2 — appears in the simplified menu's Develop & Deploy submenu
    • commandPalette — gated by containerAssistEnabledPreview feature flag and workspaceFolderCount >= 1

2. (Preview) labels on all Container Assist / OIDC commands

Updated command titles in package.json:

  • AKS: Run Container Assist For AKS Deployment Generation… (Preview)
  • AKS: Run Container Assist… (Preview)
  • AKS: Setup OIDC for GitHub Actions… (Preview)
  • AKS: Set GitHub Actions Secrets… (Preview)

3. Repositioned explorer context menu entry

Moved the existing aks.runContainerAssist entry in explorer/context from the bottom of the menu to group 2_workspace@10, positioning it near standard workspace actions like "Add Folder to Chat".

Testing

  • TypeScript compilation passes (npx tsc --noEmit — zero errors)
  • Verified menu positioning in the extension host
  • Manually tested tree-to-Container-Assist flow: right-click cluster → Run Container Assist → prompts skip subscription/cluster → proceeds to ACR/namespace selection

Thanks ❤️ and cc & FYI: @tejhan, @bosesuneha , @davidgamero , @gambtho

Hook "Run Container Assist (Preview)" into the CloudExplorer cluster
context menu so users can launch Container Assist directly from a
cluster node. Subscription and cluster are pre-filled from the tree
context — only ACR, namespace, and workflow name are prompted.

Changes:
- Add `aks.runContainerAssistFromTree` command and menu entries in
  package.json (view/item/context, developDeploySubMenu, commandPalette)
- Add `runContainerAssistFromTree()` handler that resolves cluster info
  from the tree node via `getAksClusterTreeNode()`
- Add `pickWorkspaceFolder()` helper for tree-invoked flows
- Add `collectAzureContextFromTree()` in azureSelections.ts that skips
  subscription and cluster prompts
- Register new command in extension.ts
- Gated behind `aks.containerAssistEnabledPreview` setting

Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>
…entry

- Add "(Preview)" suffix to all Container Assist and OIDC command titles:
  - AKS: Run Container Assist For AKS Deployment Generation (Preview)
  - AKS: Run Container Assist (Preview)
  - AKS: Setup OIDC for GitHub Actions (Preview)
  - AKS: Set GitHub Actions Secrets (Preview)
- Move Container Assist to 2_workspace group in explorer context menu
  so it appears near "Add Folder to Chat" instead of at the bottom

Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>
@Tatsinnit Tatsinnit self-assigned this Mar 1, 2026
@Tatsinnit Tatsinnit added the enhancement 🚀 New feature or request or improvements on existing code. label Mar 1, 2026
@Tatsinnit Tatsinnit linked an issue Mar 1, 2026 that may be closed by this pull request
6 tasks
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hooks the existing Container Assist feature into the AKS cluster tree (CloudExplorer), allowing users to right-click an AKS cluster node and launch Container Assist without being re-prompted for subscription and cluster information already available from the tree context. It also adds (Preview) labels to all Container Assist and OIDC commands, and repositions the explorer context menu entry.

Changes:

  • Added a new runContainerAssistFromTree command that extracts cluster context from the AKS tree node and skips subscription/cluster prompts, delegating to a new collectAzureContextFromTree function in azureSelections.ts
  • Registered the new command in extension.ts and added menu/palette entries in package.json, including tree context menu placements for both normal and simplified menu structures
  • Updated (Preview) labels on all Container Assist and OIDC-related commands, and moved the aks.runContainerAssist explorer context menu entry to group 2_workspace@10

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/commands/aksContainerAssist/aksContainerAssist.ts Adds runContainerAssistFromTree() entry point and pickWorkspaceFolder() helper
src/commands/aksContainerAssist/azureSelections.ts Adds collectAzureContextFromTree() that skips subscription/cluster prompts when these are already known from the tree
src/extension.ts Imports and registers the new runContainerAssistFromTree command with telemetry
package.json Adds command definition, updates (Preview) titles, adds menu entries (context menu + submenu + command palette), and repositions the existing explorer context menu entry

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package.json Outdated
Comment thread src/commands/aksContainerAssist/aksContainerAssist.ts
Comment thread src/commands/aksContainerAssist/aksContainerAssist.ts
- Hide runContainerAssistFromTree from command palette (when: "never")
  since it requires a tree node context and would show a confusing error
- Extract shared action logic into executeContainerAssistActions() helper
  to eliminate duplication between runContainerAssist and
  runContainerAssistFromTree (steps: QuickPick, model picker, Azure
  context collection, action processing, post-generation)
- Add test coverage for runContainerAssistFromTree: invalid target,
  missing workspace folder, and disabled feature flag

Signed-off-by: Tatsat Mishra <tamishra@microsoft.com>
Comment thread src/commands/aksContainerAssist/aksContainerAssist.ts Outdated
Comment thread src/commands/aksContainerAssist/azureSelections.ts
@Tatsinnit Tatsinnit merged commit e4ec7ff into Azure:main Mar 2, 2026
11 checks passed
Comment thread package.json
{
"command": "aks.runContainerAssistFromTree",
"group": "1_developer@2",
"when": "config.aks.containerAssistEnabledPreview && workspaceFolderCount >= 1"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For the cmd palette option, maybe we should use the runContainerAssist function since the sub/cluster info might not be available to runContainerAssistFromTree when launching from the cmd palette

@Tatsinnit Tatsinnit mentioned this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement 🚀 New feature or request or improvements on existing code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Run Container Assist from AKS Cluster Tree (CloudExplorer)

3 participants