Skip to content

Commit 1028e9b

Browse files
achauhan-sccvhvb1989Copilotspboyerwbreza
authored
syncing model-customization with main (#6428)
* adding docs for the internal test recorder (#6350) * adding docs for the internal test recorder * spell * Remove deprecated `login` and `logout` commands (#6395) * Initial plan * Remove deprecated login and logout commands Co-authored-by: spboyer <7681382+spboyer@users.noreply.github.com> * Add helpful error messages for removed login/logout commands Co-authored-by: spboyer <7681382+spboyer@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: spboyer <7681382+spboyer@users.noreply.github.com> * Add `azd env config` commands for environment-specific configuration management (#6348) * Initial plan * Implement env config get, set, and unset commands Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com> * Fix error message formatting to match existing patterns Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com> * Final update - all implementation and testing complete Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com> * Add comprehensive unit tests for env config commands - Added 6 test functions with 23 test cases total - Tests cover all three commands: get, set, and unset - Test cases include: simple values, nested values, objects, error handling, default environment, and multiple operations - All tests passing with 100% coverage of new functionality Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com> * Run gofmt on env_config_test.go to fix formatting - Adjusted struct field alignment in test cases - All tests still passing Co-authored-by: wbreza <6540159+wbreza@users.noreply.github.com> * Update test snapshots for new env config commands - Added snapshots for azd env config, get, set, and unset commands - Updated TestUsage-azd-env.snap to include config subcommand - Updated TestFigSpec.ts with new command definitions - All snapshot tests passing Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com> Co-authored-by: wbreza <6540159+wbreza@users.noreply.github.com> Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com> --------- Co-authored-by: Victor Vazquez <vhvb1989@gmail.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: spboyer <7681382+spboyer@users.noreply.github.com> Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com> Co-authored-by: wbreza <6540159+wbreza@users.noreply.github.com> Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
1 parent f268496 commit 1028e9b

14 files changed

+2130
-78
lines changed

cli/azd/.vscode/cspell.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ overrides:
243243
- userosscache
244244
- docstates
245245
- dylib
246+
- filename: docs/recording-functional-tests-guide.md
247+
words:
248+
- httptest
249+
- Logf
250+
- Getenv
251+
- httptest
246252
ignorePaths:
247253
- "**/*_test.go"
248254
- "**/mock*.go"

cli/azd/cmd/auth_login.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,6 @@ func (lf *loginFlags) Bind(local *pflag.FlagSet, global *internal.GlobalCommandO
196196
lf.global = global
197197
}
198198

199-
func newLoginFlags(cmd *cobra.Command, global *internal.GlobalCommandOptions) *loginFlags {
200-
flags := &loginFlags{}
201-
flags.Bind(cmd.Flags(), global)
202-
203-
return flags
204-
}
205-
206199
func newLoginCmd(parent string) *cobra.Command {
207200
return &cobra.Command{
208201
Use: "login",
@@ -237,9 +230,6 @@ type loginAction struct {
237230
commandRunner exec.CommandRunner
238231
}
239232

240-
// it is important to update both newAuthLoginAction and newLoginAction at the same time
241-
// newAuthLoginAction is the action that is bound to `azd auth login`,
242-
// and newLoginAction is the action that is bound to `azd login`
243233
func newAuthLoginAction(
244234
formatter output.Formatter,
245235
writer io.Writer,
@@ -262,31 +252,6 @@ func newAuthLoginAction(
262252
}
263253
}
264254

265-
// it is important to update both newAuthLoginAction and newLoginAction at the same time
266-
// newAuthLoginAction is the action that is bound to `azd auth login`,
267-
// and newLoginAction is the action that is bound to `azd login`
268-
func newLoginAction(
269-
formatter output.Formatter,
270-
writer io.Writer,
271-
authManager *auth.Manager,
272-
accountSubManager *account.SubscriptionsManager,
273-
flags *loginFlags,
274-
console input.Console,
275-
annotations CmdAnnotations,
276-
commandRunner exec.CommandRunner,
277-
) actions.Action {
278-
return &loginAction{
279-
formatter: formatter,
280-
writer: writer,
281-
console: console,
282-
authManager: authManager,
283-
accountSubManager: accountSubManager,
284-
flags: flags,
285-
annotations: annotations,
286-
commandRunner: commandRunner,
287-
}
288-
}
289-
290255
func (la *loginAction) Run(ctx context.Context) (*actions.ActionResult, error) {
291256
if len(la.flags.scopes) == 0 {
292257
la.flags.scopes = la.authManager.LoginScopes()

cli/azd/cmd/auto_install.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,18 @@ func ExecuteWithAutoInstall(ctx context.Context, rootContainer *ioc.NestedContai
385385
log.Panic("failed to resolve console for unknown flags error:", err)
386386
}
387387

388+
// Check for deprecated commands and provide helpful redirection messages
389+
if unknownCommand == "login" {
390+
console.Message(ctx, "Error: The 'azd login' command has been removed.")
391+
console.Message(ctx, "Please use 'azd auth login' instead.")
392+
return fmt.Errorf("unknown command 'login'")
393+
}
394+
if unknownCommand == "logout" {
395+
console.Message(ctx, "Error: The 'azd logout' command has been removed.")
396+
console.Message(ctx, "Please use 'azd auth logout' instead.")
397+
return fmt.Errorf("unknown command 'logout'")
398+
}
399+
388400
// If unknown flags were found before a non-built-in command, return an error with helpful guidance
389401
if len(unknownFlags) > 0 {
390402
flagsList := strings.Join(unknownFlags, ", ")

0 commit comments

Comments
 (0)