fix(serverless): log debug path from the HTTP request - #93
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
There was a problem hiding this comment.
Pull request overview
This pull request updates serverless client debug logging so the request path and status are derived from the generated OpenAPI client’s HTTPResponse (specifically Request.URL.Path), removing duplicated hard-coded path literals across wrapper methods and keeping debug output aligned with future OpenAPI regenerations.
Changes:
- Refactors
logResponseto accept*http.Responseand derive(path, status)via a helper. - Updates serverless wrapper methods to pass
resp.HTTPResponseintologResponse. - Adds unit tests to validate path/status extraction behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/api/serverless/log.go | Changes logResponse signature to take *http.Response and adds responsePathStatus helper. |
| internal/api/serverless/log_test.go | Updates existing logging test and adds coverage for responsePathStatus. |
| internal/api/serverless/client.go | Switches debug logging calls to use resp.HTTPResponse instead of hard-coded paths. |
| internal/api/serverless/env.go | Switches debug logging calls to use resp.HTTPResponse instead of hard-coded paths. |
| internal/api/serverless/secrets.go | Switches debug logging calls to use resp.HTTPResponse instead of hard-coded paths (still nil body). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Duplicated OpenAPI path literals in wrappers would drift on a deployments/apps rename. Take path and status from the generated client's HTTPResponse instead. Co-authored-by: Cursor <cursoragent@cursor.com>
df86dda to
f4af5ec
Compare
Summary
--debugpath/status now come from the generated client'sHTTPResponse(Request.URL.Path) instead of duplicated OpenAPI path literals in each wrapper.fix/env-redact-stacksologResponsealready exists.Test plan
go test -race ./internal/api/serverless/make lint--debugstill prints the request path after a list/show callMade with Cursor