Skip to content

Implement dry-run mode for workflow updates#9983

Closed
Copilot wants to merge 4 commits intomainfrom
copilot/implement-dry-run-mode
Closed

Implement dry-run mode for workflow updates#9983
Copilot wants to merge 4 commits intomainfrom
copilot/implement-dry-run-mode

Conversation

Copy link
Contributor

Copilot AI commented Jan 14, 2026

Removes TODO at line 90 in update_command.go and implements --dry-run flag for gh aw update command to preview changes without modifying files.

Changes

Core implementation:

  • Thread dryRun parameter through update pipeline: UpdateWorkflowsWithExtensionCheckUpdateActionsUpdateWorkflowsupdateWorkflow
  • Skip file writes, compilation, fix execution, and PR creation when dryRun=true
  • Display "Would update..." instead of "Updated..." in console output

Display changes:

  • Show "Running in dry-run mode - no files will be modified" banner at start
  • Modified showUpdateSummary() to display planned vs actual changes based on mode

Tests:

  • Added update_dry_run_test.go with three test cases verifying no file modifications occur
  • Updated existing test signatures to include dryRun parameter

Example Usage

# Preview what would be updated
gh aw update --dry-run

# Output shows:
# ℹ Running in dry-run mode - no files will be modified
# ℹ Would update actions/checkout from v4 to v4.3.1
# ℹ Would update 1 action(s):
#   • actions/checkout
# ℹ Would update and compile 2 workflow(s):
#   • ci-doctor
#   • test-workflow

Pattern follows existing gh aw fix command which defaults to dry-run unless --write is specified.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Code Quality] Implement dry-run mode for workflow updates</issue_title>
<issue_description>## Description

The pkg/cli/update_command.go file contains a TODO for implementing dry-run mode for workflow updates (line 90). This feature would allow users to preview what changes would be made before actually updating workflows.

Suggested Changes

Implement dry-run functionality in the update command:

  1. Add dry-run logic to UpdateWorkflowsWithExtensionCheck() function
  2. When --dry-run is specified:
    • Detect which workflows would be updated
    • Show diff of proposed changes
    • Display update summary without making changes
  3. Add tests for dry-run behavior

Files Affected

  • pkg/cli/update_command.go (line 90 - remove TODO, implement feature)
  • pkg/cli/update_workflows.go (add dry-run support)
  • pkg/cli/update_command_test.go (add dry-run tests)

Success Criteria

  • gh aw update --dry-run shows proposed changes without modifying files
  • Output clearly indicates this is a dry-run (no actual changes)
  • All existing update tests pass
  • New tests verify dry-run behavior
  • Update help text documents the --dry-run flag

Source

TODO comment in pkg/cli/update_command.go:90:

// TODO: Implement dry-run mode for workflow updates
return fmt.Errorf("--dry-run mode not yet implemented for workflow updates")

Priority

Low - Nice-to-have feature for safer workflow updates

AI generated by Discussion Task Miner - Code Quality Improvement Agent

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 14, 2026 17:06
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement dry-run mode for workflow updates Implement dry-run mode for workflow updates Jan 14, 2026
Copilot AI requested a review from mnkiefer January 14, 2026 17:30
@pelikhan pelikhan marked this pull request as ready for review January 14, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Code Quality] Implement dry-run mode for workflow updates

3 participants