Skip to content

Duplicate log statements in parseUpdateEntityConfig (update_entity_helpers.go) #28631

@github-actions

Description

@github-actions

Problem

parseUpdateEntityConfig in pkg/workflow/update_entity_helpers.go logs identical messages to two different loggers at the same call site, producing duplicate output in debug logs.

Locations

Lines 128–129 — identical message logged twice:

updateEntityHelpersLog.Printf("Parsing %s configuration", params.ConfigKey)
logger.Printf("Parsing %s configuration", params.ConfigKey)

Lines 136–137 — near-duplicate messages logged twice:

updateEntityHelpersLog.Printf("Invalid target-repo configuration for %s", params.ConfigKey)
logger.Print("Invalid target-repo configuration")

updateEntityHelpersLog is logger.New("workflow:update_entity_helpers") while logger is the caller-provided logger (e.g. logger.New("workflow:update_issues")). Both emit the same message to different prefixed channels.

Impact

Every call to parseUpdateEntityConfig (which handles update-issue, update-pull-request, update-discussion, etc.) emits each status message twice. This doubles the noise in debug output and makes logs harder to read when diagnosing config parsing issues.

Recommendation

Remove the updateEntityHelpersLog calls at lines 128 and 136 — they duplicate what the caller-provided logger already says. Keep the logger calls (they carry more specific context via their prefix):

// Before
updateEntityHelpersLog.Printf("Parsing %s configuration", params.ConfigKey)
logger.Printf("Parsing %s configuration", params.ConfigKey)

// After
logger.Printf("Parsing %s configuration", params.ConfigKey)
// Before
updateEntityHelpersLog.Printf("Invalid target-repo configuration for %s", params.ConfigKey)
logger.Print("Invalid target-repo configuration")

// After
logger.Printf("Invalid target-repo configuration for %s", params.ConfigKey)

Note: the file-level updateEntityHelpersLog is still useful for the detail-only log on line 141 ("Parsed target config for %s: target=%s") which has no counterpart in the caller logger. Keep that one.

Severity

  • Low — no functional impact, debug log noise only

Validation

  • go build ./pkg/workflow/ passes
  • go test ./pkg/workflow/... passes

Generated by Sergo - Serena Go Expert · ● 901.5K ·

  • expires on May 3, 2026, 8:34 PM UTC

Metadata

Metadata

Labels

cookieIssue Monster Loves Cookies!sergo

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions