Skip to content

[log] Add debug logging to proxy/response_transform.go#7739

Merged
lpcox merged 1 commit into
mainfrom
log/proxy-response-transform-223899c5b07c6847
Jun 19, 2026
Merged

[log] Add debug logging to proxy/response_transform.go#7739
lpcox merged 1 commit into
mainfrom
log/proxy-response-transform-223899c5b07c6847

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Add 5 debug log calls to unwrapSingleObject and replaceNodesArray in internal/proxy/response_transform.go, reusing the existing logTransform logger (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:

Path New log call
Wrapped empty array restored to top-level logTransform.Print("... restoring wrapped empty array ...")
Wrapped array matches original, restored logTransform.Printf("... restoring wrapped array ..., len=%d")
Search envelope skipped (total_count present) logTransform.Print("... skipping search envelope ...")
GraphQL response envelope skipped (data present) logTransform.Print("... skipping GraphQL response envelope ...")
Single-element filtered array unwrapped logTransform.Print("... unwrapping single-element filtered array ...")

replaceNodesArray – logs which key (nodes or edges) was replaced and how many DIFC-accessible items remain:

logTransform.Printf("replaceNodesArray: replacing %q array with %d accessible item(s)", key, len(items))

Validation

  • go build ./...
  • go test ./... ✅ (all 25 packages)
  • go vet ./...
  • No import cycles — proxy is a higher-level package that safely imports logger
  • No side effects in log arguments — all values are already-computed locals

Activation

DEBUG=proxy:* ./awmg --config config.toml

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • index.crates.io

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "index.crates.io"

See Network Configuration for more information.

Generated by Go Logger Enhancement · 2.3K AIC · ⊞ 34.9K ·

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>
@github-actions github-actions Bot added automation enhancement New feature or request labels Jun 19, 2026
@lpcox lpcox marked this pull request as ready for review June 19, 2026 01:28
Copilot AI review requested due to automatic review settings June 19, 2026 01:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 unwrapSingleObject to trace the key branching paths for restoring/unwrapping response shapes.
  • Add a debug log in replaceNodesArray to report whether nodes vs edges was 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.

@lpcox lpcox merged commit f3ed8f1 into main Jun 19, 2026
24 checks passed
@lpcox lpcox deleted the log/proxy-response-transform-223899c5b07c6847 branch June 19, 2026 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants