feat(boards): ✨ Implement azdo boards work-item show command - #330
Merged
Conversation
Add html-to-markdown/v2 v2.5.2 for Html→Markdown description rendering in the boards work-item show command (issue #238 decision 16), along with the forced transitive upgrades (goldmark v1.8.2, golang.org/x/net v0.55.0, go-colorful v1.4.0). Drop spewerspew/spew: the --raw flags it served were removed repo-wide.
Add GetWorkItemEnvelope, a low-level fetch that captures the raw work item payload including the multilineFieldsFormat map the vendored WorkItem model drops (issue #238 decision 15). The show command uses it to detect whether the description is Markdown or Html.
Add the Go text template rendering work item details: url, id, rev, type, state, reason, title, assignments, timestamps, area, iteration, tags, format-aware description, and optional relations/comments blocks.
Implement azdo boards work-item show [ORG:]PROJECT/ID (issue #238): fetches the work item with Expand=All, verifies it belongs to the requested project, renders the description format-aware (Markdown pass-through, Html converted via html-to-markdown) and supports --comments, --relations and JSON export. Deviation from the issue: no --raw flag.
Register show.NewCmd under boards work-item and add an example line showing how to view a work item with its comment thread.
Drop the --raw/-r flag and the spew dump path; the command now renders template or JSON output only.
Drop the --raw/-r flag and the spew dump path; the command now renders template or JSON output only.
Drop the --raw/-r flag and the spew dump path; the command now renders template or JSON output only.
Drop the --raw/-r flag and the spew dump path; the command now renders template or JSON output only.
Hermetic gomock tests covering target parsing, ID validation, Expand=All fetch, project-membership guard, format-aware description rendering (incl. Html→Markdown conversion), --comments/--relations toggles, JSON output, scope parsing and error paths.
Remove TestRunShow_RawFlag and assert the raw flag is no longer registered.
Regenerated command reference: new boards work-item show page with JSON fields, updated work-item/pr/pipelines/iteration pages without the --raw flag, refreshed help reference index.
Previously the script retried commits whenever any pre-commit hook modified staged files. The typos hook is now detected explicitly; if it rewrote files the check-in aborts so the fixes can be reviewed. A hook that fails without touching files is also treated as a fatal error immediately instead of consuming retry attempts.
azdo boards work-item show 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 #238
Summary
Implements
azdo boards work-item show [ORG:]PROJECT/IDfollowing the hardened spec in #238 (decisions 1-16), plus a repo-wide cleanup.New command
boards work-item showwith aliasesview/statusExpand=Allin a single call (fields, relations, links)html-to-markdown/v2; legacy items without a format map fall back to Html--comments/--relationstoggles for the comment thread and relations block--json/--jq/--templateexport of the raw work item payload--rawflag ---rawwas removed repo-wide (pr view,pipelines agent/pool show,boards iteration show,boards work-item show)Supporting changes
internal/azdo.GetWorkItemEnvelope: low-level fetch capturingmultilineFieldsFormat, which the vendored SDKWorkItemmodel drops (decision 15)html-to-markdown/v2added (+ transitive upgrades: goldmark, x/net, go-colorful);spewremovedscripts/checkin.sh: retry a failed commit only when a pre-commit hook modified staged files; abort instantly on fatal hook failures and on typos hook modifications (never retry); topologically sorted commit sequence.pre-commit-config.yaml:vendor/excluded from all hooks (yamllint failed on vendored yaml)Verification
go test ./...- passmake lint- 0 issuesmake docs- regenerated