fix(cli): wrap comment not-found errors with item context#910
Merged
xarmian merged 1 commit intoJul 11, 2026
Merged
Conversation
xarmian
approved these changes
Jul 11, 2026
xarmian
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed and verified against the codebase — this is a clean, correct fix for #902.
- The one-line change matches the exact
wrapItemNotFoundpattern already used atinternal/cli/client.go:241/249/255. wrapItemNotFoundonly rewritesnot_foundAPIErrors and passes all other errors through unchanged, so wrapping the fullCreateCommenterror introduces no behavior change for non-404 failures.- Adds a real case to the existing table test.
The local Windows make build/make test gaps you noted are the expected web/build embed prerequisite, unrelated to this change. CI has been approved to run.
Thanks for the tidy, well-scoped contribution!
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.
What does this PR do?
Applies the existing
wrapItemNotFoundbehavior toClient.CreateComment, sopad item comment TASK-999999 ...reports the failing item ref and workspace instead of the bare API message.The wrapper preserves the original
APIErrorcode, details, and concrete type, matching the existing Get/Update/Delete item paths.Closes #902
How to test
go test ./internal/cli -run 'Test(GetItemWrapsNotFound|NotFoundPreservesDetails|GetItemPassesThroughOtherErrors)$' -count=1go vet ./internal/cligofmt -d internal/cli/client.go internal/cli/item_notfound_test.gogit diff --checkThe focused tests pass on Windows. Broader local package runs have existing workspace prerequisites/platform failures (missing generated
web/buildembed output and Windows HOME/credentials assumptions), unrelated to this two-file CLI change.Checklist
make buildpasses - not run locally; requires the generated web embed assetsmake testpasses - broader Windows baseline has unrelated HOME/credentials failures