You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue tracks the implementation of the azdo pipelines variable-group variable delete command.
Command Description
Remove a variable from a variable group. The Azure CLI locates the key case-insensitively, removes it from the variables map, and updates the group (source). azdo should provide the same behavior with confirmation support and consistent resolver helpers.
Important REST constraint:
Azure DevOps REST never returns secret variable values. This command must never attempt to print variable values (delete should not print values). Other variable commands must always treat secret values as unavailable and redact them.
Wire command: internal/cmd/pipelines/variablegroup/variable/variable.go must AddCommand(delete.NewCmd(ctx)) and be reachable from azdo pipelines variable-group variable.
Parse scope: util.ParseProjectTargetWithDefaultOrganization(ctx, targetArg) for [ORGANIZATION/]PROJECT/VARIABLE_GROUP_ID_OR_NAME; wrap parse errors with util.FlagErrorWrap.
Client: Task Agent via ctx.ClientFactory().TaskAgent(ctx.Context(), scope.Organization).
Resolve group: shared.ResolveVariableGroup(ctx, taskClient, scope.Project, scope.Target) where ctx is the injected util.CmdContext passed into NewCmd/run (do not use a differently-named context variable unless you define it explicitly).
Delete algorithm:
Locate variable key case-insensitively in the group variables map.
Confirm unless --yes; return util.ErrCancel on decline.
Remove key and call TaskAgent.UpdateVariableGroup.
Output:
If stdout is a TTY: print Variable deleted..
If stdout is not a TTY: no output on success.
Tests:
Add unit tests at internal/cmd/pipelines/variablegroup/variable/delete/delete_test.go.
Hermetic mocks: Task Agent client + prompter.
Table-driven cases: delete with --yes, prompt decline -> util.ErrCancel, variable not found, group not found, stdout TTY vs non-TTY output behavior.
Command Wiring
Implement the command in internal/cmd/pipelines/variablegroup/variable/delete/delete.go exposing NewCmd(ctx util.CmdContext) *cobra.Command.
Register it from internal/cmd/pipelines/variablegroup/variable/variable.go so azdo pipelines variable-group variable delete is discoverable.
SDK / Client Requirements
Requires the Task Agent client (ClientFactory().TaskAgent(...)). If the client is missing, follow "Handling Missing Azure DevOps SDK Clients" in AGENTS.md.
This issue tracks the implementation of the
azdo pipelines variable-group variable deletecommand.Command Description
Remove a variable from a variable group. The Azure CLI locates the key case-insensitively, removes it from the variables map, and updates the group (source).
azdoshould provide the same behavior with confirmation support and consistent resolver helpers.Important REST constraint:
azdoCommand SignatureFlags:
--yes: Skip the confirmation prompt.Behavior
[ORGANIZATION/]PROJECT/VARIABLE_GROUP_ID_OR_NAMEusingutil.ParseProjectTargetWithDefaultOrganization.shared.ResolveVariableGroup(do not re-implement ID/name resolution).--yesis set (Delete variable 'VARIABLE_NAME' from group 'VARIABLE_GROUP'?). Returnutil.ErrCancelon decline.UpdateVariableGroup, stop progress.Variable deleted..Implementation Notes (filled checklist)
internal/cmd/pipelines/variablegroup/variable/delete/delete.go(type opts struct, NewCmd(ctx), run(ctx, opts)).internal/cmd/pipelines/variablegroup/variable/variable.gomustAddCommand(delete.NewCmd(ctx))and be reachable fromazdo pipelines variable-group variable.util.ParseProjectTargetWithDefaultOrganization(ctx, targetArg)for[ORGANIZATION/]PROJECT/VARIABLE_GROUP_ID_OR_NAME; wrap parse errors withutil.FlagErrorWrap.ctx.ClientFactory().TaskAgent(ctx.Context(), scope.Organization).shared.ResolveVariableGroup(ctx, taskClient, scope.Project, scope.Target)wherectxis the injectedutil.CmdContextpassed intoNewCmd/run(do not use a differently-named context variable unless you define it explicitly).--yes; returnutil.ErrCancelon decline.TaskAgent.UpdateVariableGroup.Variable deleted..internal/cmd/pipelines/variablegroup/variable/delete/delete_test.go.--yes, prompt decline ->util.ErrCancel, variable not found, group not found, stdout TTY vs non-TTY output behavior.Command Wiring
internal/cmd/pipelines/variablegroup/variable/delete/delete.goexposingNewCmd(ctx util.CmdContext) *cobra.Command.internal/cmd/pipelines/variablegroup/variable/variable.gosoazdo pipelines variable-group variable deleteis discoverable.SDK / Client Requirements
ClientFactory().TaskAgent(...)). If the client is missing, follow "Handling Missing Azure DevOps SDK Clients" inAGENTS.md.References
variable_group_variable_delete