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).
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 83.60% 84.78% +1.18%
==========================================
Files 14 14
Lines 500 539 +39
==========================================
+ Hits 418 457 +39
Misses 63 63
Partials 19 19 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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