Skip to content

Commit

Permalink
Extensions: Adds extensions command group (Azure#4766)
Browse files Browse the repository at this point in the history
Adds extensions command group
  • Loading branch information
wbreza authored Feb 6, 2025
1 parent 344b473 commit 00e71f1
Show file tree
Hide file tree
Showing 20 changed files with 1,532 additions and 23 deletions.
13 changes: 7 additions & 6 deletions cli/azd/cmd/actions/action_descriptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,17 @@ type ActionHelpOptions struct {
type RootLevelHelpOption string

const (
CmdGroupNone RootLevelHelpOption = ""
CmdGroupConfig RootLevelHelpOption = "Configure and develop your app"
CmdGroupManage RootLevelHelpOption = "Manage Azure resources and app deployments"
CmdGroupMonitor RootLevelHelpOption = "Monitor, test and release your app"
CmdGroupAbout RootLevelHelpOption = "About, help and upgrade"
CmdGroupNone RootLevelHelpOption = ""
CmdGroupConfig RootLevelHelpOption = "Configure and develop your app"
CmdGroupManage RootLevelHelpOption = "Manage Azure resources and app deployments"
CmdGroupMonitor RootLevelHelpOption = "Monitor, test and release your app"
CmdGroupAbout RootLevelHelpOption = "About, help and upgrade"
CmdGroupExtensions RootLevelHelpOption = "Installed Extensions"
)

func GetGroupAnnotations() []RootLevelHelpOption {
return []RootLevelHelpOption{
CmdGroupConfig, CmdGroupManage, CmdGroupMonitor, CmdGroupAbout,
CmdGroupConfig, CmdGroupManage, CmdGroupMonitor, CmdGroupExtensions, CmdGroupAbout,
}
}

Expand Down
26 changes: 26 additions & 0 deletions cli/azd/cmd/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"github.com/azure/azure-dev/cli/azd/cmd/middleware"
"github.com/azure/azure-dev/cli/azd/internal"
"github.com/azure/azure-dev/cli/azd/internal/cmd"
"github.com/azure/azure-dev/cli/azd/internal/grpcserver"
"github.com/azure/azure-dev/cli/azd/internal/repository"
"github.com/azure/azure-dev/cli/azd/pkg/account"
"github.com/azure/azure-dev/cli/azd/pkg/ai"
Expand All @@ -40,6 +41,7 @@ import (
"github.com/azure/azure-dev/cli/azd/pkg/environment"
"github.com/azure/azure-dev/cli/azd/pkg/environment/azdcontext"
"github.com/azure/azure-dev/cli/azd/pkg/exec"
"github.com/azure/azure-dev/cli/azd/pkg/extensions"
"github.com/azure/azure-dev/cli/azd/pkg/helm"
"github.com/azure/azure-dev/cli/azd/pkg/httputil"
"github.com/azure/azure-dev/cli/azd/pkg/infra"
Expand Down Expand Up @@ -789,6 +791,30 @@ func registerCommonDependencies(container *ioc.NestedContainer) {
})
container.MustRegisterSingleton(workflow.NewRunner)

container.MustRegisterScoped(func(authManager *auth.Manager) prompt.AuthManager {
return authManager
})
container.MustRegisterSingleton(func(subscriptionService *account.SubscriptionsService) prompt.SubscriptionService {
return subscriptionService
})
container.MustRegisterSingleton(func(resourceService *azapi.ResourceService) prompt.ResourceService {
return resourceService
})

container.MustRegisterScoped(prompt.NewPromptService)

// Extensions
container.MustRegisterSingleton(extensions.NewManager)
container.MustRegisterSingleton(extensions.NewSourceManager)

// gRPC Server
container.MustRegisterScoped(grpcserver.NewServer)
container.MustRegisterScoped(grpcserver.NewProjectService)
container.MustRegisterScoped(grpcserver.NewEnvironmentService)
container.MustRegisterScoped(grpcserver.NewPromptService)
container.MustRegisterScoped(grpcserver.NewDeploymentService)
container.MustRegisterSingleton(grpcserver.NewUserConfigService)

// Required for nested actions called from composite actions like 'up'
registerAction[*cmd.ProvisionAction](container, "azd-provision-action")
registerAction[*downAction](container, "azd-down-action")
Expand Down
Loading

0 comments on commit 00e71f1

Please sign in to comment.