Skip to content

Commit

Permalink
Merge branch 'Azure:main' into fix-issue#4411
Browse files Browse the repository at this point in the history
  • Loading branch information
Menghua1 authored Nov 15, 2024
2 parents b8a87dd + a49be25 commit e73c721
Show file tree
Hide file tree
Showing 95 changed files with 3,072 additions and 414 deletions.
1 change: 1 addition & 0 deletions .vscode/cspell-github-user-aliases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ otiai10
pamelafox
pbnj
sebastianmattar
sergi
sethvargo
stretchr
theckman
Expand Down
3 changes: 3 additions & 0 deletions cli/azd/.vscode/cspell-azd-dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ devcenters
devcentersdk
devdeviceid
devel
diffmatchpatch
discarder
docf
dockerfiles
Expand All @@ -94,6 +95,7 @@ doublestar
dskip
eastus
endregion
entra
entraid
envlist
envname
Expand Down Expand Up @@ -192,6 +194,7 @@ semconv
serverfarms
servicebus
setenvs
skus
snapshotter
springapp
sqlserver
Expand Down
3 changes: 3 additions & 0 deletions cli/azd/.vscode/cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ overrides:
- filename: docs/proxy-configuration.md
words:
- Telerik
- filename: test/recording/recording.go
words:
- oidctoken
- filename: test/functional/testdata/samples/funcapp/getting_started.md
words:
- funcignore
Expand Down
12 changes: 11 additions & 1 deletion cli/azd/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release History

## 1.11.0-beta.1 (Unreleased)
## 1.12.0-beta.1 (Unreleased)

### Features Added

Expand All @@ -10,6 +10,16 @@

### Other Changes

## 1.11.0 (2024-11-13)

### Features Added

- [[4527]](https://github.com/Azure/azure-dev/pull/4527) Add new `alpha` command `azd add`.

### Bugs Fixed

- [[4524]](https://github.com/Azure/azure-dev/pull/4524) Fix using parameters for .NET Aspire deployment.

## 1.10.4 (2024-11-06)

### Bugs Fixed
Expand Down
7 changes: 6 additions & 1 deletion cli/azd/cmd/auth_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,12 @@ func (la *loginAction) Run(ctx context.Context) (*actions.ActionResult, error) {
return nil, err
}

if la.flags.clientID == "" {
forceRefresh := false
if v, err := strconv.ParseBool(os.Getenv("AZD_DEBUG_LOGIN_FORCE_SUBSCRIPTION_REFRESH")); err == nil && v {
forceRefresh = true
}

if la.flags.clientID == "" || forceRefresh {
// Update the subscriptions cache for regular users (i.e. non-service-principals).
// The caching is done here to increase responsiveness of listing subscriptions in the application.
// It also allows an implicit command for the user to refresh cached subscriptions.
Expand Down
34 changes: 28 additions & 6 deletions cli/azd/cmd/cmd_help.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,39 @@ func getCmdHelpDefaultCommands(cmd *cobra.Command) string {

// getCmdHelpDefaultFlags provides the default implementation for displaying the help flags section.
func getCmdHelpDefaultFlags(cmd *cobra.Command) (result string) {
if cmd.HasAvailableLocalFlags() {
flags := getFlagsDetails(cmd.LocalFlags())
// force the following flags as global flags for display purposes when displaying help.
forceGlobalFlagNames := map[string]struct{}{
"help": {},
"docs": {},
}

forceGlobalFlags := pflag.NewFlagSet("", pflag.ContinueOnError)
localFlags := pflag.NewFlagSet("", pflag.ContinueOnError)

cmd.LocalFlags().VisitAll(func(f *pflag.Flag) {
if _, ok := forceGlobalFlagNames[f.Name]; ok {
forceGlobalFlags.AddFlag(f)
} else {
localFlags.AddFlag(f)
}
})

if localFlags.HasAvailableFlags() {
details := getFlagsDetails(localFlags)
result = fmt.Sprintf("%s\n%s\n",
output.WithBold("%s", output.WithUnderline("Flags")),
flags)
details)
}
if cmd.HasAvailableInheritedFlags() {
globalFlags := getFlagsDetails(cmd.InheritedFlags())

globalFlags := pflag.NewFlagSet("", pflag.ContinueOnError)
globalFlags.AddFlagSet(cmd.InheritedFlags())
globalFlags.AddFlagSet(forceGlobalFlags)

if globalFlags.HasAvailableFlags() {
details := getFlagsDetails(globalFlags)
result += fmt.Sprintf("%s\n%s\n",
output.WithBold("%s", output.WithUnderline("Global Flags")),
globalFlags)
details)
}
return result
}
Expand Down
6 changes: 6 additions & 0 deletions cli/azd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"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/cmd/add"
"github.com/azure/azure-dev/cli/azd/internal/telemetry"
"github.com/azure/azure-dev/cli/azd/pkg/output"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -320,6 +321,11 @@ func NewRootCmd(
},
}).
UseMiddleware("hooks", middleware.NewHooksMiddleware)
root.
Add("add", &actions.ActionDescriptorOptions{
Command: add.NewAddCmd(),
ActionResolver: add.NewAddAction,
})

// Register any global middleware defined by the caller
if len(middlewareChain) > 0 {
Expand Down
Loading

0 comments on commit e73c721

Please sign in to comment.