-
Notifications
You must be signed in to change notification settings - Fork 4
fix(context): exposed StatusCode #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's Guide by SourceryThis pull request refactors the Context implementation to expose the HTTP status code by replacing the writtenStatus flag with a statusCode integer and adding a new getter function. The changes focus on updating how the status code is set and retrieved in the context, ensuring that if a code is not explicitly set, a default status (200 OK) is returned. Updated class diagram for Context implementationclassDiagram
class Context {
+Response: http.ResponseWriter
+Request: *http.Request
-statusCode: int
-values: map[string]any
+WriteStatus(code: int): void
+StatusCode(): int
}
%% Note: The 'writtenStatus' field has been removed and replaced by 'statusCode'
note for Context "Removed 'writtenStatus' bool and added 'statusCode' int with default handling"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov ReportAll modified and coverable lines are covered by tests β
Additional details and impacted files@@ Coverage Diff @@
## main #38 +/- ##
==========================================
+ Coverage 91.93% 92.01% +0.07%
==========================================
Files 38 38
Lines 1414 1427 +13
==========================================
+ Hits 1300 1313 +13
Misses 78 78
Partials 36 36
Flags with carried forward coverage won't be shown. Click here to find out more. β View full report in Codecov by Sentry. |
Here's the code health analysis summary for commits Analysis Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @cnlangzi - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding an explicit flag for status written to avoid potential ambiguity if someone explicitly calls WriteStatus(0).
Here's what I looked at during the review
- π’ General issues: all looks good
- π’ Security: all looks good
- π’ Testing: all looks good
- π’ Complexity: all looks good
- π’ Documentation: all looks good
Help me be more useful! Please click π or π on each comment and I'll use the feedback to improve your reviews.
Changed
StatusCode
incontext
Fixed
Added
Tests
Tasks to complete before merging PR:
make unit-test
to check for any regressions πmake lint
to check for any issuesSummary by Sourcery
New Features: