Skip to content

Introduce azdo pipelines queue command group #240

Description

@tmeckel

Command Group Description

Introduce a new queue subgroup under the existing azdo pipelines command group (umbrella tracked in #116). The queue subgroup is a thin router: it has no leaf commands of its own at the moment — it currently exists to register the show leaf (filed as a sub-issue of this umbrella) and to be the natural home for future agent-queue-related commands (e.g. list).

The queue subgroup surfaces the agent queue resource from the Azure Pipelines task agent API. It is distinct from the pool subgroup (sibling umbrella, filed in the same wave), which surfaces agent pools (a related but separate resource). Both subgroups share the same vendored SDK client (taskagent.Client) — the split is purely CLI ergonomics to match the Azure CLI's az pipelines pool vs az pipelines queue grouping.

Why a separate subgroup from build (#213) / runs (#214)? Agent queues are scoped to a project (an agent queue lives within a project and references a pool). The build and runs subgroups also operate at the project level, but they share the legacy Build API. The queue subgroup takes the modern Pipelines task agent API path. Pools are org-scoped; queues are project-scoped — this matches the Azure CLI's az pipelines pool [ORGANIZATION] vs az pipelines queue [ORGANIZATION/]PROJECT signatures.

Implementation Notes

  • The queue subgroup has no behavior of its own. Its sole responsibility is to register child leaf commands via cmd.AddCommand(...).
  • The first child is azdo pipelines queue show (tracked in feat: Implement azdo pipelines queue show command #245).
  • No new SDK client is required — taskagent.Client is already wired in internal/azdo/connection.go:60 (interface) and internal/azdo/factory.go:133-139 (impl). No new mocks are required — MockTaskAgentClient.GetAgentQueue and MockTaskAgentClient.GetAgentQueues are already present at internal/mocks/taskagent_client_mock.go:456-486.
  • No new shared helpers are required for this parent. Future shared logic across multiple queue leaves may be extracted into this package's queue.go or a separate internal/cmd/pipelines/queue/shared package — do not pre-extract.
  • The Use: line should be queue (no description on the Use line itself; the Short and Long fields provide description text).
  • Aliases are not provided on group commands; only on leaf commands.
  • The subgroup does take a positional project scope ([ORGANIZATION/]PROJECT) because queues live in a project.

Command Wiring

  1. Create internal/cmd/pipelines/queue/queue.go:
package queue

import (
	"github.com/spf13/cobra"

	"github.com/tmeckel/azdo-cli/internal/cmd/pipelines/queue/show"
	"github.com/tmeckel/azdo-cli/internal/cmd/util"
)

func NewCmd(ctx util.CmdContext) *cobra.Command {
	cmd := &cobra.Command{
		Use:   "queue [ORGANIZATION/]PROJECT",
		Short: "Manage Azure DevOps agent queues.",
		Long: `Surface for Azure DevOps agent queues.

Mirrors the 'az pipelines queue' group from the Azure CLI. Queues are
project-scoped; the positional [ORGANIZATION/]PROJECT argument falls back
to the configured default organization when omitted.`,
	}

	cmd.AddCommand(show.NewCmd(ctx))
	return cmd
}
  1. Register the new subgroup in the existing umbrella at internal/cmd/pipelines/pipelines.go:
import (
	// ... existing imports ...
	"github.com/tmeckel/azdo-cli/internal/cmd/pipelines/pool"
	"github.com/tmeckel/azdo-cli/internal/cmd/pipelines/queue"
	// ...
)

func NewCmd(ctx util.CmdContext) *cobra.Command {
	cmd := &cobra.Command{ /* ... existing ... */ }
	cmd.AddCommand(variablegroup.NewCmd(ctx))
	cmd.AddCommand(variable.NewCmd(ctx))
	cmd.AddCommand(build.NewCmd(ctx))     // #213
	cmd.AddCommand(runs.NewCmd(ctx))      // #214
	cmd.AddCommand(pool.NewCmd(ctx))      // new (sibling umbrella, #239)
	cmd.AddCommand(queue.NewCmd(ctx))     // new (this issue, #240)
	return cmd
}
  1. No change is required to internal/cmd/root/root.go (the pipelines group is already registered).

SDK / Client Requirements

  • Client: taskagent.Client (vendored, already wired).
    • Interface: internal/azdo/connection.go:60TaskAgent(ctx context.Context, organization string) (taskagent.Client, error).
    • Factory: internal/azdo/factory.go:133-139 — constructs the client from the connection.
    • Mock: internal/mocks/taskagent_client_mock.go — full mock implementing taskagent.Client; GetAgentQueue is at lines 456-471, GetAgentQueues at 486-501. Other queue methods are present for future leaves.
  • No new vendored packages required. vendor/github.com/microsoft/azure-devops-go-api/azuredevops/v7/taskagent/ is already present.
  • No new mocks required for the parent itself. Mocks for future leaves (e.g. GetAgentQueue for show) already exist.
  • No go mod tidy / go mod vendor / scripts/generate_mocks.sh work required for this parent or for its first leaf.

Sub-Issues

  • feat: Implement azdo pipelines queue show command #245feat: Implement \azdo pipelines queue show` command` (filed; new in this wave).
  • feat: Implement \azdo pipelines queue list` command` (planned; not yet filed).
  • feat: Implement \azdo pipelines queue create` command` (planned; not yet filed).
  • feat: Implement \azdo pipelines queue update` command` (planned; not yet filed).
  • feat: Implement \azdo pipelines queue delete` command` (planned; not yet filed).

Each new leaf will be filed as a follow-up issue using the same canonical 12-section body format (mirroring the boards show sub-issues #236/#237/#238). When filed, the issue number will replace the placeholder in the checklist above.

Tooling & Validation

  • go build ./... is clean.
  • go test ./internal/cmd/pipelines/queue/... passes.
  • go run cmd/azdo/azdo.go pipelines queue --help renders the subgroup's short and long descriptions and lists show as a child.
  • go run cmd/azdo/azdo.go pipelines --help shows queue alongside variable-group, variable, build, runs, and pool.
  • make lint passes (golangci-lint, per .golangci.yml).
  • make docs regenerates docs/pipelines_queue.md with the new subgroup.

References

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions