Skip to content

Keep map_helpers.go and git_helpers.go as standalone files#7175

Closed
Copilot wants to merge 2 commits intomainfrom
copilot/review-small-helper-files
Closed

Keep map_helpers.go and git_helpers.go as standalone files#7175
Copilot wants to merge 2 commits intomainfrom
copilot/review-small-helper-files

Conversation

Copy link
Contributor

Copilot AI commented Dec 21, 2025

Evaluated whether map_helpers.go (2 functions) and git_helpers.go (1 function) should be consolidated, relocated, or kept as-is.

Decision: Keep Both Files

Rationale:

  • Both files have comprehensive headers documenting purpose and organization
  • Fit established helper file pattern (9 helper files in pkg/workflow/ ranging 63-303 lines)
  • Meet helper file criteria: shared utilities, clear domain focus, stable functionality
  • git_helpers.go has different domain than pkg/gitutil:
    • pkg/gitutil: String validation (IsAuthError, IsHexString)
    • git_helpers.go: Git command execution and repository metadata
  • Room for growth in their respective domains

Usage Analysis:

  • parseIntValue(): 2 production callers
  • filterMapKeys(): 1 production caller
  • GetCurrentGitTag(): 1 production caller

Low usage is appropriate for current codebase size. No action needed.

Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Review and decide on small helper files (map_helpers, git_helpers)</issue_title>
<issue_description>## Objective

Review very small helper files and decide whether to keep them for future growth or merge them into related files.

Context

Two helper files contain minimal functions:

  • map_helpers.go (2 functions) - Map manipulation utilities
  • git_helpers.go (1 function) - Git utilities

These files may be:

  • Kept for future expansion as more helpers are added
  • Merged into more general utility files
  • Moved to appropriate packages (e.g., git_helpers.gopkg/gitutil)

Approach

  1. Analyze map_helpers.go:

    • Review the 2 functions and their usage across the codebase
    • Determine if more map helpers are likely to be added
    • Decision: Keep for growth OR merge into general utilities
  2. Analyze git_helpers.go:

    • Review the single function and its purpose
    • Check if it belongs in pkg/gitutil package
    • Check if more Git helpers are needed
    • Decision: Keep for growth OR move to pkg/gitutil OR merge elsewhere
  3. Document decision:

    • If keeping: Add file header explaining purpose and future use
    • If merging: Move functions and update imports
    • If moving to pkg/gitutil: Relocate and update imports
  4. Verify no breakage:

    • Run all tests after any changes
    • Ensure imports are correctly updated

Files to Review

  • pkg/workflow/map_helpers.go (2 functions)
  • pkg/workflow/git_helpers.go (1 function)
  • Potentially: pkg/gitutil/ (target for git_helpers)

Acceptance Criteria

AI generated by Plan Command for #7136

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Dec 21, 2025
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Review and decide on small helper files Keep map_helpers.go and git_helpers.go as standalone files Dec 22, 2025
Copilot AI requested a review from mnkiefer December 22, 2025 00:05
@pelikhan pelikhan closed this Dec 22, 2025
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.

[plan] Review and decide on small helper files (map_helpers, git_helpers)

3 participants