Repository navigation
Codify the shared response-writer wrapper pattern - #10585
Conversation
There was a problem hiding this comment.
Pull request overview
Clarifies the shared response-writer embedding pattern identified in #10584 and strengthens its contract coverage.
Changes:
- Documents
BaseResponseWriteras the shared wrapper base. - Verifies implicit
200 OKcapture. - Verifies optional-interface passthrough through
Unwrap.
Show a summary per file
| File | Description |
|---|---|
internal/httputil/response_writer.go |
Clarifies shared wrapper usage. |
internal/server/response_writer.go |
Documents inherited interface passthrough. |
internal/server/response_writer_test.go |
Adds status and http.Flusher coverage. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Balanced
🔒 mcpg Read-Only Stress — default AWFSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS
References: §30772710499
|
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS
Run: §30772710508
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS
References: §30772710502
|
The semantic clustering audit identified
internal/httputil/BaseResponseWriterandinternal/server/responseWriteras a near-duplicate pair, but the current structure is intentional:server.responseWriteralready extends the shared status-capturing wrapper rather than reimplementing it. This change makes that relationship explicit and adds coverage for the contract that matters across wrappers.Pattern clarification
BaseResponseWriterdoc comment to state that it is the shared embed-first wrapper for package-specific response writers.Unwrappassthrough.Contract coverage
200 OKstatus capture on firstWrite.http.ResponseWriterinterfaces throughhttp.ResponseController, preserving the intendedUnwrapbehavior for derived wrappers.Example
This keeps the existing package organization intact while making the shared-wrapper pattern easier to recognize and less likely to be flagged as accidental duplication in future audits.