Skip to content

[task] Rename utility files in pkg/cli to match their specific purpose #3616

@github-actions

Description

@github-actions

Objective

Rename small utility files in pkg/cli to accurately reflect their specific purpose, improving code discoverability and maintainability.

Context

This addresses Priority 1: High Impact, Low Risk refactoring identified in #3604. Three utility files have generic names that don't match their actual content:

Files to Rename

1. shared_utils.go (3 functions - all PR auto-merge related)

Current name: Generic "shared_utils"
Actual purpose: PR auto-merge functionality
Recommended action:

  • Option A: Rename to pr_merge_utils.go or pr_automerge.go
  • Option B: Move functions into pr_command.go since they're PR-specific

2. frontmatter_utils.go (3 functions - frontmatter field updates)

Current name: Generic "frontmatter_utils"
Actual purpose: Frontmatter field editing
Recommended action:

  • Option A: Rename to frontmatter_editor.go or frontmatter_update.go
  • Option B: Inline into files that use it (if limited usage)

3. repeat_utils.go (2 functions - retry logic)

Current name: Generic "repeat_utils"
Actual purpose: Retry/backoff functionality
Recommended action:

  • Option A: Rename to retry.go
  • Option B: Move to a general utilities package if used widely

Approach

  1. Analyze usage: Determine how many files import each utility
  2. Choose strategy: Rename vs. consolidate vs. move based on usage
  3. Make changes: Rename files or move functions as appropriate
  4. Update imports: Fix all import statements across the codebase
  5. Verify: Ensure all tests pass and no broken imports

Files to Modify

  • pkg/cli/shared_utils.go → rename or consolidate
  • pkg/cli/frontmatter_utils.go → rename or consolidate
  • pkg/cli/repeat_utils.go → rename or consolidate
  • All files importing these utilities (update import paths)

Acceptance Criteria

  • All utility files have clear, descriptive names matching their purpose
  • File names accurately reflect the contained functionality
  • All imports updated correctly across the codebase
  • All tests pass (make test-unit)
  • No broken imports or references
  • Code formatted (make fmt)

Estimated Effort

1-2 hours

Related

Part of refactoring work identified in #3604
Related to #3604

AI generated by Plan Command for #3604

Metadata

Metadata

Assignees

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