Skip to content

Introduce azdo pipelines folder command group #262

Description

@tmeckel

Introduce the azdo pipelines folder subgroup under the pipelines umbrella (#116), parented by the build subgroup umbrella (#213). This subgroup manages Azure DevOps build definition folders.

Project-scoped, with a path target. Folders are owned by projects. The folder subgroup takes a positional [ORGANIZATION/]PROJECT/PATH (or falls back to the default organization + the --project flag for the project component), identical to the variable-group subgroup's delete command (Use: "delete [ORGANIZATION/]PROJECT/GROUP", see internal/cmd/pipelines/variablegroup/delete/delete.go:34).

CLI Structure

azdo pipelines folder
├── create  (#263)
├── delete  (#264)
├── list    (#265)
└── update  (#266)

Four leaves, no showaz pipelines folder does not expose one in the Azure CLI; users discover folders via list and drill into the JSON output to inspect individual folders.

Scope

Mirrors az pipelines folder. All commands reuse the vendored build.Client (same client as the build subgroup, #213):

All four methods are already vendored at vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/build/client.go:584 (CreateFolder), :757 (DeleteFolder), :2490 (GetFolders), :3919 (UpdateFolder). The Folder model is at vendor/.../v7/build/models.go:1401 with fields CreatedBy, CreatedOn, Description, LastChangedBy, LastChangedDate, Path, Project. The FolderQueryOrder enum is at models.go:1419 with values None, FolderAscending ("folderAscending"), FolderDescending ("folderDescending").

All four mocks are already generated at internal/mocks/build_client_mock.go:182-193 (CreateFolder), :254-265 (DeleteFolder), :881-893 (GetFolders), :1420-1432 (UpdateFolder). No mock regeneration needed.

A new helper, util.ParseProjectPathTargetWithDefaultOrganization, is added as part of the create (#263) implementation. It splits [ORGANIZATION/]PROJECT/PATH into 3 strings (PATH may contain /). This mirrors the pattern from #247 where a thin new wrapper is added by the sub-issue that first needs it.

Implementation Outline

  1. Create internal/cmd/pipelines/folder/folder.go (umbrella) with Use: "folder", Aliases: []string{"folders"}. No leaf commands in this file — it only registers the four children.
  2. Register the new subgroup from internal/cmd/pipelines/pipelines.go next to the other subgroups. The exact registration order is up to the implementer, but the slot should keep the help text stable (current order includes agent, build, pool, queue, runs, variable, variable-group).
  3. First leaves: create (feat: Implement azdo pipelines folder create command #263), delete (feat: Implement azdo pipelines folder delete command #264), list (feat: Implement azdo pipelines folder list command #265), update (feat: Implement azdo pipelines folder update command #266) — each implemented in its respective sub-issue.
  4. No new SDK client is required. No new mocks are required. No go mod tidy / go mod vendor / scripts/generate_mocks.sh work is required for this umbrella or for any of its sub-issues.

References

  • az pipelines folder (Azure CLI reference for UX)
  • Vendored SDK client: vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/build/client.go (lines cited above).
  • Vendored SDK model: vendor/.../v7/build/models.go:1401 (Folder), :1419 (FolderQueryOrder).
  • Mocks: internal/mocks/build_client_mock.go (lines cited above).
  • Azure DevOps REST API (Preview 7.1-preview.2, API area Build): Folders — Create Folder (PUT), Delete Folder (DELETE), Get Folders (GET), Update Folder (POST). All four share route id a906531b-d2da-4f55-bda7-f3e676cc50d9 (definition folder operations).
  • Internal client accessor: internal/azdo/factory.go:61ClientFactory().Build(ctx, organization).
  • Internal client interface: internal/azdo/connection.go:50-51.
  • Siblings that share the same client: pipelines/build (feat: Introduce azdo pipelines build command group #213) — same build.Client, same vendor location, same mock file.
  • Siblings that share the project-scope + path-target pattern: pipelines/variable-group delete (internal/cmd/pipelines/variablegroup/delete/delete.go:34Use: "delete [ORGANIZATION/]PROJECT/GROUP"), pipelines/variable-group update (mirror for the fetch→mutate→PUT-style POST pattern).
  • Sibling for the destructive-confirmation pattern: pipelines/variable-group delete confirmation prompt.
  • Sibling for the list+optional-filter pattern: pipelines/variable-group list (no positional target — just [ORGANIZATION/]). Folder list adds an optional --path flag for sub-folder filtering.
  • Pre-existing umbrella issue (this one's structural template): Introduce azdo pipelines agent command group #246 (Introduce azdo pipelines agent command group).
  • Pre-existing umbrella issue (this one's parent): feat: Introduce azdo pipelines build command group #213 (feat: Introduce azdo pipelines build command group).

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions