Skip to content

[plan] Migrate remaining commands to RunE and verify complete migration #5305

@github-actions

Description

@github-actions

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: to RunE:
  • 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.md or similar files

Acceptance Criteria

  • Zero commands use Run: (all use RunE:)
  • 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 --help

Final Checklist

AI generated by Plan Command for #5282

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions