-
Notifications
You must be signed in to change notification settings - Fork 48
Closed
Labels
Description
Objective
Complete the Run→RunE migration by updating all remaining commands and verifying the entire codebase is migrated.
Context
This is Batch 5 of 5 in the Run→RunE migration. This ensures 100% coverage and validates the complete migration.
Parent Issue: #5300
Depends on: Batches 1-4 should be completed first
Approach
1. Identify Remaining Commands
Scan the entire pkg/cli/ directory for any commands still using Run::
grep -r "Run: func" pkg/cli/
grep -r "os.Exit(1)" pkg/cli/2. Migrate Each Remaining Command
Apply the standard migration pattern:
- Change
Run:toRunE: - Remove
os.Exit(1)calls - Return errors directly
3. Verification
After migration, verify no Run: usage remains:
# Should return no results
grep -r "^\s*Run:\s*func" pkg/cli/
grep -r "os.Exit(1)" pkg/cli/4. Update Documentation
If any documentation mentions the old error handling pattern, update it to reference the new approach.
Files to Modify
- Any remaining command files in
pkg/cli/not covered in batches 1-4 - Potentially update documentation in
DEVGUIDE.mdor similar files
Acceptance Criteria
- Zero commands use
Run:(all useRunE:) - Zero
os.Exit(1)calls in command functions - All commands return errors to Cobra
- Complete test suite passes (
make test) - Linting passes (
make lint) - Manual smoke testing of all commands succeeds
- Documentation updated if needed
- Verification grep commands return no results
Verification Commands
# Build fresh binary
make clean
make build
# Verify no old patterns remain
grep -r "Run: func" pkg/cli/ cmd/
grep -r "os.Exit(1)" pkg/cli/ cmd/
# Full test suite
make test
make lint
# Smoke test major commands
./gh-aw --help
./gh-aw compile --help
./gh-aw status
./gh-aw logs --helpFinal Checklist
- All 107+ commands migrated to
RunE - No
Run:usage in command definitions - No
os.Exit(1)in command functions - All tests pass
- Error messages remain user-friendly
- Exit codes work correctly
- Code is cleaner and more maintainable
Related to [plan] Migrate CLI commands from Run to RunE for idiomatic error handling #5300
AI generated by Plan Command for #5282
Reactions are currently unavailable