Skip to content

Conversation

Copy link

Copilot AI commented Oct 27, 2025

Build failure in pkg/listen/proxy/renderer_interactive.go due to format string with 3 placeholders but only 2 arguments provided to Warnf.

Changes:

  • Replaced Warnf with structured logging using log.WithFields()
  • Added structured fields: active_requests, max_connections
  • Simplified warning message to avoid format string placeholders

Before:

log.WithField("prefix", "proxy.InteractiveRenderer").
    Warnf("High connection load detected: %d active requests (limit: %d) --max-connections=%d to increase the limit", activeRequests, maxConns)

After:

log.WithFields(log.Fields{
    "prefix":          "proxy.InteractiveRenderer",
    "active_requests": activeRequests,
    "max_connections": maxConns,
}).Warn("High connection load detected; consider increasing --max-connections")

This makes logs machine-readable and eliminates format string mismatches.

Original prompt

CI job https://github.com/hookdeck/hookdeck-cli/actions/runs/18838248584/job/53744162170 failed with a build error in pkg/listen/proxy/renderer_interactive.go. Error: "(*github.com/sirupsen/logrus.Entry).Warnf format %d reads arg #3, but call has 2 args". This was introduced by a recent commit that updated the max connection warning message.

Goal: Fix the build error by replacing the format-string Warnf call with structured logging (log.WithFields(...).Warn(...)) to avoid format-string mismatches and make logs machine-readable. Add a small unit/verification step (go vet + go test) to confirm the package builds.

Files to change:

  • pkg/listen/proxy/renderer_interactive.go (ref: 244778d)

Proposed code change (replace the existing Warnf call in OnConnectionWarning):

@@
-    // In interactive mode, warnings could be shown in TUI
-    // For now, just log it
-    log.WithField("prefix", "proxy.InteractiveRenderer").
-        Warnf("High connection load detected: %d active requests (limit: %d) --max-connections=%d to increase the limit", activeRequests, maxConns)
+    // In interactive mode, warnings could be shown in TUI
+    // Use structured logging to avoid format-string mismatches and make logs machine-readable
+    log.WithFields(log.Fields{
+        "prefix":          "proxy.InteractiveRenderer",
+        "active_requests": activeRequests,
+        "max_connections": maxConns,
+    }).Warn("High connection load detected; consider increasing --max-connections")

Notes:

  • This removes reliance on fmt-style placeholders which caused the build failure.
  • After applying the change, run go vet ./... and go test ./... to ensure no further issues.

Please create a branch for the fix, commit with a clear message, and open a PR targeting the repository's default branch.

This pull request was created as a result of the following prompt from Copilot chat.

CI job https://github.com/hookdeck/hookdeck-cli/actions/runs/18838248584/job/53744162170 failed with a build error in pkg/listen/proxy/renderer_interactive.go. Error: "(*github.com/sirupsen/logrus.Entry).Warnf format %d reads arg #3, but call has 2 args". This was introduced by a recent commit that updated the max connection warning message.

Goal: Fix the build error by replacing the format-string Warnf call with structured logging (log.WithFields(...).Warn(...)) to avoid format-string mismatches and make logs machine-readable. Add a small unit/verification step (go vet + go test) to confirm the package builds.

Files to change:

  • pkg/listen/proxy/renderer_interactive.go (ref: 244778d)

Proposed code change (replace the existing Warnf call in OnConnectionWarning):

@@
-    // In interactive mode, warnings could be shown in TUI
-    // For now, just log it
-    log.WithField("prefix", "proxy.InteractiveRenderer").
-        Warnf("High connection load detected: %d active requests (limit: %d) --max-connections=%d to increase the limit", activeRequests, maxConns)
+    // In interactive mode, warnings could be shown in TUI
+    // Use structured logging to avoid format-string mismatches and make logs machine-readable
+    log.WithFields(log.Fields{
+        "prefix":          "proxy.InteractiveRenderer",
+        "active_requests": activeRequests,
+        "max_connections": maxConns,
+    }).Warn("High connection load detected; consider increasing --max-connections")

Notes:

  • This removes reliance on fmt-style placeholders which caused the build failure.
  • After applying the change, run go vet ./... and go test ./... to ensure no further issues.

Please create a branch for the fix, commit with a clear message, and open a PR targeting the repository's default branch.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@leggetter leggetter requested a review from alexluong October 27, 2025 19:24
Copilot AI changed the title [WIP] Fix build error in renderer_interactive.go by using structured logging Fix format string mismatch in OnConnectionWarning logging Oct 27, 2025
Copilot AI requested a review from leggetter October 27, 2025 19:26
Copilot finished work on behalf of leggetter October 27, 2025 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants