Skip to content

[plan] Standardize progress and info messages with console formatters #11623

@github-actions

Description

@github-actions

Objective

Convert scattered progress and info messages to use console.FormatProgressMessage() and console.FormatInfoMessage() for consistency.

Context

From discussion #11611: Many CLI files use direct fmt.Printf for progress updates and informational messages instead of the standardized console formatters.

Primary Files: commands.go, git.go, file_tracker.go, run_workflow_tracking.go

Approach

  1. Identify progress and info messages:

    • Progress: Operations in progress (e.g., "Creating branch...", "Compiling workflow...")
    • Info: General information (e.g., "Found workflow file at...", "Using branch...")
  2. Convert to console formatters:

    • Use console.FormatProgressMessage() for operations
    • Use console.FormatInfoMessage() for informational output
    • Create console.LogVerbose() helper for verbose output
    • Ensure all output goes to stderr
  3. Test the changes:

    • Verify messages display correctly
    • Test with and without verbose flags
    • Ensure TTY/non-TTY modes work

Files to Modify

  • Update: pkg/cli/commands.go (~5 instances)
  • Update: pkg/cli/git.go (~10 instances)
  • Update: pkg/cli/file_tracker.go (~5 instances)
  • Update: pkg/cli/run_workflow_tracking.go (~15 instances)
  • Consider: pkg/console/verbose.go (new helper for verbose output)

Implementation Examples

// ❌ WRONG - Direct fmt.Printf:
fmt.Printf("Found workflow file at path: %s\n", fileOrWorkflowName)
fmt.Printf("Creating and switching to branch: %s\n", branchName)

// ✅ CORRECT - Console formatted:
fmt.Fprintln(os.Stderr, console.FormatInfoMessage(fmt.Sprintf("Found workflow file at path: %s", fileOrWorkflowName)))
fmt.Fprintln(os.Stderr, console.FormatProgressMessage(fmt.Sprintf("Creating branch: %s", branchName)))
// NEW HELPER (pkg/console/verbose.go):
func LogVerbose(verbose bool, message string) {
    if verbose {
        fmt.Fprintln(os.Stderr, FormatVerboseMessage(message))
    }
}

// Usage:
console.LogVerbose(verbose, fmt.Sprintf("Processing %d workflows", count))

Acceptance Criteria

  • All progress messages use console.FormatProgressMessage()
  • All info messages use console.FormatInfoMessage()
  • console.LogVerbose() helper created for verbose output
  • Verbose output in run_workflow_tracking.go uses new helper
  • All output goes to stderr (except JSON)
  • Tests verify proper formatting
  • Code passes make fmt and make lint
  • make agent-finish completes successfully

Priority

Phase 3: Progress & Info Messages (6-8 hours estimated)

AI generated by Plan Command for discussion #11611

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions