You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CommandRunner has dedicated RunInteractive() method that properly handles stdin/stdout/stderr without LC_ALL=C interference.
4. Consistency with Project Goals
From CLAUDE.md: "Use KISS (Keep It Simple and Stupid) and DRY (Don't Repeat Yourself)"
CommandRunner eliminates repetitive LC_ALL=C setup and interactive mode handling across all package managers.
5. Proven Success
YUM's recent migration to CommandRunner shows:
100% test coverage maintained
Cleaner, more readable code
Robust environment variable handling
Successful interactive mode support
Solution: Migrate All Package Managers to CommandRunner
CommandRunner Interface
typeCommandRunnerinterface {
// Run executes a command with LC_ALL=C for consistent English outputRun(namestring, args...string) ([]byte, error)
// RunContext executes with context support and LC_ALL=C, plus optional extra envRunContext(ctx context.Context, namestring, args []string, env...string) ([]byte, error)
// RunInteractive executes in interactive mode with stdin/stdout/stderr passthroughRunInteractive(ctx context.Context, namestring, args []string, env...string) error
}
Problem Statement
Currently, package managers use inconsistent command execution patterns, creating architectural and testing issues:
Current State Analysis
Uses CommandBuilder✅ MIGRATED (Issue APT CommandRunner Migration (Issue #20 Part 1) #27 - PR feat: implement CommandRunner architecture for APT and YUM package managers (Issue #20) #26)exec.Commandcalls (Issue Snap CommandRunner Migration (Issue #20 Part 2) #28)exec.Commandcalls (Issue Flatpak CommandRunner Migration (Issue #20 Part 3) #29)Issues with Mixed Approaches
exec.CmdknowledgeDecision: Standardize on CommandRunner
Based on comprehensive analysis, CommandRunner is superior to CommandBuilder for this project:
Why CommandRunner Wins
1. Automatic LC_ALL=C Handling
CommandRunner automatically prepends
LC_ALL=Cfor consistent English output across all package managers, with user override capability:2. Simplified Testing
3. Built-in Interactive Support
CommandRunner has dedicated
RunInteractive()method that properly handles stdin/stdout/stderr without LC_ALL=C interference.4. Consistency with Project Goals
From CLAUDE.md: "Use KISS (Keep It Simple and Stupid) and DRY (Don't Repeat Yourself)"
CommandRunner eliminates repetitive LC_ALL=C setup and interactive mode handling across all package managers.
5. Proven Success
YUM's recent migration to CommandRunner shows:
Solution: Migrate All Package Managers to CommandRunner
CommandRunner Interface
Implementation Plan - UPDATED
Migration Progress:
Benefits
Testing Benefits
Architecture Benefits
Code Quality Benefits
Acceptance Criteria - UPDATED
Completion Status: ✅ 1/3 package managers completed (APT ✅, Snap ⏳, Flatpak ⏳)
Priority
High Priority - This achieves architectural consistency and leverages the proven CommandRunner interface that's already successful with YUM.
Related Work
Sub-Issues
This large architectural change has been broken down into manageable sub-issues:
Progress: 1/3 package managers completed. APT migration successful with full test coverage and architectural improvements.