Skip to content

[log] Add debug logging to guard/wasm_payload.go policy validation#4841

Draft
github-actions[bot] wants to merge 1 commit intomainfrom
log/wasm-payload-logging-698aa4410bbc1cf5
Draft

[log] Add debug logging to guard/wasm_payload.go policy validation#4841
github-actions[bot] wants to merge 1 commit intomainfrom
log/wasm-payload-logging-698aa4410bbc1cf5

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Changes

Adds logWasm debug logging calls to internal/guard/wasm_payload.go for improved troubleshooting of WASM guard policy validation.

Functions enhanced

  • normalizePolicyPayload — logs when a string policy is received (with length) and whether parsing succeeded or the policy was passed through unchanged
  • buildStrictLabelAgentPayload — logs validation entry and success with the resolved repos and min-integrity values
  • BuildLabelAgentPayload — logs the counts of trusted-bots and trusted-users being injected, and confirms injection into the allow-only object

Why

wasm_payload.go contains dense policy validation logic. When guard policy issues occur in production, there was no debug signal to trace which validation step failed or what values were being processed. These log calls use the existing logWasm logger (declared in wasm.go, same package) and follow the pkg:filename naming convention already established.

Validation

  • go build ./...
  • go test ./internal/guard/...

Generated by Go Logger Enhancement · ● 3.1M ·

Add logWasm debug logging to key policy payload functions:
- normalizePolicyPayload: log string policy parsing entry/result
- buildStrictLabelAgentPayload: log validation entry and success with policy fields
- BuildLabelAgentPayload: log trusted-bots/users injection counts

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added automation enhancement New feature or request labels Apr 30, 2026
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.

0 participants