feat(boards): ✨ Implement azdo boards work-item relation add command - #331
Merged
Conversation
Adds SplitAndTrimCSV (comma-separated value parsing with empty-element validation) and ResolveRelationType/PopulateFriendlyNames (relation-type name resolution and friendly-name rendering), mirroring the Azure DevOps CLI extension helpers. Foundation for the boards work-item relation subcommands.
Implements 'azdo boards work-item relation add' per issue #272: resolves the relation type to its reference name, converts target work item IDs to URLs, builds /relations/- JSON Patch operations, updates the work item, and renders the refreshed relation list or JSON output.
Introduces the relation command group under boards work-item, wiring the add subcommand.
Registers the relation group in the work-item command tree so the new subcommand is reachable via 'azdo boards work-item relation add'.
Covers relation-type resolution, target ID/URL validation, patch document construction, scope parsing (default and explicit organization), JSON and table output, and error paths, using the mocks under internal/mocks.
Regenerates the command reference: new relation and relation add pages, updated work-item page with relation link, refreshed help reference index.
azdo boards work-item relation add command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #272
Summary
Adds the
azdo boards work-item relation addcommand to attach relations to an existing work item:azdo boards work-item relation add [ORG:]PROJECT/ID --relation-type <name> --target-id <ID>— link other work items--target-url <URL>— attach arbitrary artifact relations (mutually exclusive with--target-id)parent,child,related)--json/--jq/--templatesupportedChanges
SplitAndTrimCSV,ResolveRelationType,PopulateFriendlyNames), mirroring the Azure DevOps CLI extensionrelationcommand group withaddsubcommand, wired intoboards work-iteminternal/mocks)Verification
go build ./cmd/azdo/...— OKgo vet ./internal/cmd/boards/workitem/...— OKgofumpt— cleangolangci-lint(2.12.2) — 0 issuesgo test ./...— 2205 tests passCommits are topologically sorted: shared helpers → add command → relation group → tree wiring → tests → docs.