-
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 variable list command.
Command Description
List the variables in a variable group. The Azure CLI retrieves the group and returns the variables dictionary as-is (source). azdo should expose the same information with user-friendly formatting, readOnly metadata, and JSON export.
azdo Command Signature
azdo pipelines variable-group variable list [ORGANIZATION/]PROJECT/VARIABLE_GROUP_ID_OR_NAME
Behavior
- Resolve project scope and group identifier via the shared helper.
- Start the progress indicator, fetch the group, then stop the indicator prior to rendering output.
- If the group is missing, return a descriptive error.
- Sort variables alphabetically for deterministic output.
- Default table columns:
NAME,VALUE(mask when secret),SECRET(Yes/No),READ-ONLY(Yes/No). - Register JSON fields with
util.AddJSONFlags(cmd, &opts.exporter, []string{"name","secret","readOnly","value"})and emit a slice of{ name, secret, readOnly, value *string }. Drop thevaluepointer whensecretis true so filtering via--json name,secretworks predictably. - Add
zap.L().Debuglogs for group resolution.
Command Wiring
- Implement
internal/cmd/pipelines/variablegroup/variable/list/list.gowithNewCmd(ctx util.CmdContext) *cobra.Command. - Register it from
internal/cmd/pipelines/variablegroup/variable/variable.goso the hierarchy exposesazdo pipelines variable-group variable list. - Run
make docsafter wiring.
SDK / Client Requirements
- Requires the Task Agent client (
ClientFactory().TaskAgent(...)). If missing, follow Handling Missing Azure DevOps SDK Clients.
Tooling & Validation
gofmt/goimportsnew files.go build ./cmd/azdo/...to ensure compilation.- Add/update hermetic tests with mocks; run
go test ./....
Testing
- Successful listing with secret + non-secret variables.
- Missing group error.
- Deterministic ordering.
- JSON export structure.
References
- Azure CLI:
variable_group_variable_list - Azure DevOps REST API 7.1: Update variable group
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels