Repository navigation
WI-005: #16 Missing problem constructors for common statuses (Unauthorized, Forbidden, Conflict, Unprocessable, Internal) - #23
Conversation
…rized, Forbidden, Conflict, Unprocessable, Internal) Implemented by the Weave Autoloop, attempt 1 (execution exe_615c4b36a4f3).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 58 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Weave review: approved (execution
The step report (
Quality
Non-blocking observations
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #23 +/- ##
==========================================
+ Coverage 84.41% 85.48% +1.07%
==========================================
Files 14 14
Lines 526 565 +39
==========================================
+ Hits 444 483 +39
Misses 63 63
Partials 19 19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FHBdej3KvFACHzafbEhw7C
Work item WI-005 of work package WP-001 (GitHub issues).
problem_helpers.goshipsProblemBadRequest/NewBadRequestProblemandProblemNotFound/NewNotFoundProblem, but nothing for the other statuses that come up just as often in a typical API:Without these, every call site falls back to the fully manual
httpsuite.NewProblemDetails(status, type, title, detail)— which is exactly the 4-argument ceremony theNewBadRequestProblem/NewNotFoundProblemhelpers exist to avoid for those two statuses.Measured impact in one consumer (GolgiMed, ~150k LOC): 845 manual
NewProblemDetails(...)calls, of which ~730 are exactly the canonical(status, "unauthorized", "Unauthorized", detail)/(status, "forbidden", "Forbidden", detail)/ etc. shape that aNewUnauthorizedProblem(detail)/NewForbiddenProblem(detail)would collapse to one line.Requested:
ProblemUnauthorized/NewUnauthorizedProblem,ProblemForbidden/NewForbiddenProblem,ProblemConflict/NewConflictProblem,ProblemUnprocessable/NewUnprocessableProblem,ProblemInternal/NewInternalProblem, matching the existingProblemBadRequest/ProblemNotFoundpattern.Implemented by the Weave Autoloop, attempt 1, execution
exe_615c4b36a4f3.Changed files:
problem_config.goproblem_helpers.goproblem_helpers_test.go