-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
This issue tracks the implementation of the azdo pipelines variable-group delete command.
Command Description
Delete a variable group from a project. The Azure CLI issues TaskAgentClient.delete_variable_group and prints a success message (source). azdo should provide the same capability with confirmation prompts, consistent output handling, and the shared resolver used by the other variable-group commands.
azdo Command Signature
azdo pipelines variable-group delete [ORGANIZATION/]PROJECT/VARIABLE_GROUP_ID_OR_NAME [--yes]
Flags:
--yes, -y: Skip the confirmation prompt.- JSON export flags registering
deletedandgroupIdso automation can detect successful deletions via--json.
Behavior
- Resolve scope and the target group identifier using the shared helper (numeric ID or case-insensitive name lookup with collision checks).
- Start the progress indicator.
- If
--yesis not provided, prompt the user (Delete variable group <name>?). Returnutil.ErrCancelwhen declined. - Call
client.DeleteVariableGroup(project, groupID)and treat non-nil errors as fatal. - Stop progress before printing output. Table output:
Variable group deleted.JSON output:{ "deleted": true, "groupId": <id> }. - Add debug logging for resolved IDs and confirmation decisions.
Command Wiring
- Implement
internal/cmd/pipelines/variablegroup/delete/delete.goexposingNewCmd(ctx util.CmdContext) *cobra.Command. - Register it from
internal/cmd/pipelines/variablegroup/variablegroup.gosoazdo pipelines variable-group deleteis available alongside other variable-group commands. - Regenerate documentation (
make docs) after wiring.
SDK / Client Requirements
- Requires the Task Agent client (
ClientFactory().TaskAgent(...)). If the client is missing, follow "Handling Missing Azure DevOps SDK Clients" inAGENTS.md.
Tooling & Validation
- Format new Go files with
gofmt/goimports. - Run
go build ./cmd/azdo/...to ensure the CLI compiles. - Add/update hermetic tests using mocks (Task Agent client, prompts) and execute
go test ./....
Testing
- Unit tests covering:
- Successful deletion with
--yes. - Prompt decline returning
util.ErrCancel. - Lookup by name including collision handling.
- SDK error propagation.
- JSON export structure.
- Successful deletion with
References
- Azure CLI implementation:
variable_group_delete - Azure DevOps REST API 7.1: Delete variable group
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels