-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Labels
Description
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
-
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...")
-
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
- Use
-
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.gouses new helper - All output goes to stderr (except JSON)
- Tests verify proper formatting
- Code passes
make fmtandmake lint -
make agent-finishcompletes successfully
Priority
Phase 3: Progress & Info Messages (6-8 hours estimated)
AI generated by Plan Command for discussion #11611
Copilot