Skip to content

Move UpdateStack to separate interface to improve testing#328

Merged
geofflamrock merged 1 commit intomainfrom
stack-actions-update
Aug 19, 2025
Merged

Move UpdateStack to separate interface to improve testing#328
geofflamrock merged 1 commit intomainfrom
stack-actions-update

Conversation

Base automatically changed from stack-actions-push to main August 19, 2025 10:04
@geofflamrock geofflamrock requested a review from Copilot August 19, 2025 10:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the stack update functionality by moving StackHelpers.UpdateStack into a separate StackActions interface to improve testability. Commands now use the IStackActions interface instead of directly calling static methods, enabling easier unit testing without requiring full Git repositories.

  • Moved UpdateStack functionality from StackHelpers to StackActions class
  • Updated multiple command handlers to use the new IStackActions interface
  • Converted integration tests to unit tests using mocked dependencies

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
UpdateStackCommand.cs Modified to use new StackActions interface with additional dependencies
SyncStackCommand.cs Updated constructor to use new StackActions interface
PushStackCommand.cs Updated StackActions constructor call with new parameters
PullStackCommand.cs Updated StackActions constructor call with new parameters
StackHelpers.cs Added GetUpdateStrategy method to extract strategy determination logic
StackActions.cs Added UpdateStack method and supporting merge/rebase implementation
UpdateStackCommandHandlerTests.cs Converted integration tests to unit tests using mocks
SyncStackCommandHandlerTests.cs Converted integration tests to unit tests using mocks
StackHelpersTests.cs Removed tests that were moved to StackActionsTests
StackActionsTests.cs Added comprehensive unit tests for new UpdateStack functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}
}

public void UpdateBranchLineUsingMerge(
Copy link

Copilot AI Aug 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UpdateBranchLineUsingMerge method is marked as public but appears to be an internal implementation detail. Consider making it private to reduce the public API surface.

Suggested change
public void UpdateBranchLineUsingMerge(
private void UpdateBranchLineUsingMerge(

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Changes only affect the internal API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant