Skip to content

Refactor AutoMerge.Standalone to reuse shared AutoMerge changeset and branch pipelines#6

Draft
Copilot wants to merge 14 commits into
masterfrom
copilot/2026-refactor-standalone-code
Draft

Refactor AutoMerge.Standalone to reuse shared AutoMerge changeset and branch pipelines#6
Copilot wants to merge 14 commits into
masterfrom
copilot/2026-refactor-standalone-code

Conversation

Copy link
Copy Markdown

Copilot AI commented May 8, 2026

The new standalone app carried duplicate changeset retrieval/mapping logic instead of reusing the existing AutoMerge implementation. This PR moves standalone onto shared providers/models and exposes only the minimum shared surface needed for that reuse.

  • Shared provider reuse in standalone

    • AutoMerge.Standalone/AutoMergeControl.cs now uses:
      • MyChangesetChangesetProvider for recent changesets
      • ChangesetByIdChangesetProvider for add-by-id
      • ChangesetViewModel as the shared data model
    • Removed standalone-local changeset query/mapping duplication.
  • Shared branch discovery reuse in standalone

    • AutoMergeControl now retrieves branches for the selected changeset using the same branch discovery path as the main project.
    • BranchesViewModel.GetBranches(...) was made reusable and is now used by both:
      • BranchesViewModel.RefreshAsync() in the main project
      • AutoMergeControl.UpdateBranchesViewAsync() in standalone
    • Standalone branch list now shows source/target classification and validation messages from shared branch logic.
  • Provider extensibility for non-Team Explorer hosts

    • Added ChangesetProviderBase(ChangesetService, string projectName) path for direct service injection.
    • Added matching overloads in:
      • MyChangesetChangesetProvider
      • ChangesetByIdChangesetProvider
    • Existing IServiceProvider-based behavior remains unchanged.
  • Minimal visibility change to enable reuse

    • Settings changed from internal to public so standalone can consume shared settings (e.g., ChangesetCount).
var provider = new MyChangesetChangesetProvider(
    _changesetService,
    "Intact iQ",
    Settings.Instance.ChangesetCount);

_changesets = await provider.GetChangesets(_versionControl.AuthorizedUser);

Copilot AI linked an issue May 8, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits May 8, 2026 20:25
…or-standalone-code

Co-authored-by: vbtrek <26403480+vbtrek@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor standalone project to reuse AutoMerge code Refactor AutoMerge.Standalone to reuse shared AutoMerge changeset pipeline May 8, 2026
Copilot finished work on behalf of vbtrek May 8, 2026 20:32
Copilot AI requested a review from vbtrek May 8, 2026 20:32
@vbtrek
Copy link
Copy Markdown
Owner

vbtrek commented May 8, 2026

@copilot This is quite a good first attempt, in UpdateBranchesView() in AutoMergeControl we need to retrieve the branches for the selected changeset, this seems to be done by BranchesViewModel.RefreshAsync() in the main project

Copy link
Copy Markdown
Author

Copilot AI commented May 8, 2026

@copilot This is quite a good first attempt, in UpdateBranchesView() in AutoMergeControl we need to retrieve the branches for the selected changeset, this seems to be done by BranchesViewModel.Refresh...

Implemented in 59cc702.

AutoMergeControl now loads branches for the selected changeset via shared BranchesViewModel.GetBranches(...) logic (same discovery path used by the main project), including source/target classification and validation message display.

Standalone branches update

Copilot AI changed the title Refactor AutoMerge.Standalone to reuse shared AutoMerge changeset pipeline Refactor AutoMerge.Standalone to reuse shared AutoMerge changeset and branch pipelines May 8, 2026
Copilot finished work on behalf of vbtrek May 8, 2026 21:30
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.

Update standalone

2 participants