Skip to content

Remove duplicate log statements in parseUpdateEntityConfig#28634

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-duplicate-log-statements
Apr 27, 2026
Merged

Remove duplicate log statements in parseUpdateEntityConfig#28634
pelikhan merged 2 commits intomainfrom
copilot/fix-duplicate-log-statements

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 26, 2026

parseUpdateEntityConfig logged identical messages to both updateEntityHelpersLog (file-level) and the caller-provided logger at the same call sites, doubling debug output on every update-issue, update-pull-request, update-discussion, etc. invocation.

Changes

  • Remove duplicate parse log: Drop updateEntityHelpersLog.Printf("Parsing %s configuration", ...) — the caller's logger.Printf already emits this with a more specific prefix.
  • Consolidate error log: Replace the two-line invalid-target-repo logs with a single logger.Printf that preserves the ConfigKey context previously only on the removed line.
  • Retain unique detail log: Keep updateEntityHelpersLog.Printf("Parsed target config for %s: target=%s", ...) — it has no counterpart in the caller logger.
// 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)

Copilot AI changed the title [WIP] Fix duplicate log statements in parseUpdateEntityConfig Remove duplicate log statements in parseUpdateEntityConfig Apr 26, 2026
Copilot AI requested a review from gh-aw-bot April 26, 2026 20:57
@github-actions

This comment has been minimized.

@github-actions
Copy link
Copy Markdown
Contributor

Hey @Copilot 👋 — great cleanup work on the duplicate log statements in parseUpdateEntityConfig! Removing the redundant updateEntityHelpersLog calls and consolidating the error message with the ConfigKey context is a nice, focused improvement.

One thing that would strengthen this PR before merge:

  • No test coverage — there are no test file changes included. Even a small unit test or table-driven test case for parseUpdateEntityConfig covering the invalid-target-repo path (and confirming the log output) would give reviewers confidence the consolidation doesn't silently drop information.

If you'd like a hand, here's a prompt you can assign to your coding agent:

Add or extend unit tests for `parseUpdateEntityConfig` in `pkg/workflow/update_entity_helpers.go`.
Cover the following scenarios:
1. Valid configuration — verify the function returns a non-nil *UpdateEntityConfig.
2. Invalid target-repo configuration (isInvalid == true) — verify the function returns nil and that logger receives the message "Invalid target-repo configuration for <ConfigKey>" (with the ConfigKey interpolated, not the old context-free string).
Use the existing test patterns in the `pkg/workflow/` package.

Generated by Contribution Check · ● 925.7K ·

@pelikhan pelikhan marked this pull request as ready for review April 27, 2026 13:37
Copilot AI review requested due to automatic review settings April 27, 2026 13:37
@pelikhan pelikhan merged commit 7bc0945 into main Apr 27, 2026
19 checks passed
@pelikhan pelikhan deleted the copilot/fix-duplicate-log-statements branch April 27, 2026 13:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Reduces noisy debug output during update-entity configuration parsing by removing duplicate log statements in parseUpdateEntityConfig.

Changes:

  • Removed a redundant “Parsing … configuration” log emitted to both helper and caller loggers.
  • Consolidated invalid target-repo logging into a single caller logger message that retains ConfigKey context.
Show a summary per file
File Description
pkg/workflow/update_entity_helpers.go Removes duplicate parse log output and consolidates invalid target-repo logging in parseUpdateEntityConfig.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 1/1 changed files
  • Comments generated: 0

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.

Duplicate log statements in parseUpdateEntityConfig (update_entity_helpers.go)

4 participants