[log] Add debug logging to proxy/response_transform.go#7739
Merged
Conversation
Add 5 debug log calls to unwrapSingleObject and replaceNodesArray
functions in the proxy package, reusing the existing logTransform
logger (logger.New("proxy:response_transform")).
The new log calls trace:
- When a wrapped empty array is restored to top-level shape
- When a wrapped array matches the original and is restored
- When a search envelope (total_count) is skipped
- When a GraphQL response envelope (data field) is skipped
- When a single-element filtered array is unwrapped
- When replaceNodesArray replaces a nodes/edges key with DIFC-filtered items
These calls are gated by the DEBUG=proxy:* env var and help
developers trace how the GitHub API proxy transforms responses
during DIFC enforcement.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
✅ Ready to approve
The change is limited to gated debug logging using the existing logTransform logger and does not alter transformation behavior.
Note: this review does not count toward required approvals for merging.
Pull request overview
This PR adds additional debug-level observability to the proxy response-shaping logic, making it easier to trace how DIFC-filtered GitHub API payloads are being reshaped (or intentionally left unchanged) in internal/proxy/response_transform.go.
Changes:
- Add debug logs in
unwrapSingleObjectto trace the key branching paths for restoring/unwrapping response shapes. - Add a debug log in
replaceNodesArrayto report whethernodesvsedgeswas replaced and how many accessible items remain.
File summaries
| File | Description |
|---|---|
| internal/proxy/response_transform.go | Adds debug logging around response “shape restoration” and GraphQL nodes/edges replacement to help diagnose post-filter transformations. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add 5 debug log calls to
unwrapSingleObjectandreplaceNodesArrayininternal/proxy/response_transform.go, reusing the existinglogTransformlogger (logger.New("proxy:response_transform")).Changes
unwrapSingleObject– traces the 5 distinct code paths this function takes when deciding how to reshape a GitHub API response after DIFC filtering:logTransform.Print("... restoring wrapped empty array ...")logTransform.Printf("... restoring wrapped array ..., len=%d")total_countpresent)logTransform.Print("... skipping search envelope ...")datapresent)logTransform.Print("... skipping GraphQL response envelope ...")logTransform.Print("... unwrapping single-element filtered array ...")replaceNodesArray– logs which key (nodesoredges) was replaced and how many DIFC-accessible items remain:Validation
go build ./...✅go test ./...✅ (all 25 packages)go vet ./...✅proxyis a higher-level package that safely importsloggerActivation
DEBUG=proxy:* ./awmg --config config.tomlWarning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
index.crates.ioSee Network Configuration for more information.