Skip to content

Batch 11: CleanStrategy/DirtyStrategy extension points + Drivelution docs#382

Merged
JusterZhu merged 1 commit into
masterfrom
batch-11-cross-refs
May 24, 2026
Merged

Batch 11: CleanStrategy/DirtyStrategy extension points + Drivelution docs#382
JusterZhu merged 1 commit into
masterfrom
batch-11-cross-refs

Conversation

@JusterZhu
Copy link
Copy Markdown
Collaborator

Summary

Adds the final extension points and documents cross-project integration patterns.

Changes

AbstractBootstrap

  • Add CleanStrategy\<T\>() and DirtyStrategy\<T\>() registration methods
  • Uses trait-based registration since the interfaces live in GeneralUpdate.Differential (circular dependency)

csproj + Strategy docs

  • Improved comments explaining how users enable DrivelutionMiddleware

Architecture Note

Drivelution → Core and Differential → Core are existing references. Adding reverse references (Core → Drivelution/Differential) would create circular dependencies. The extension point registration uses type-trait matching so users can inject their implementations from higher-level composition projects.

Build

  • dotnet build src/c#/GeneralUpdate.slnx — 0 errors

Closes #381

- Add CleanStrategy<T>() and DirtyStrategy<T>() registration methods to AbstractBootstrap
  Uses trait-based registration since ICleanStrategy/IDirtyStrategy live in
  GeneralUpdate.Differential which has a circular dependency on Core
- Improve DrivelutionMiddleware comments in csproj and strategy builders
  to clearly document how users can enable it

Note: DrivelutionMiddleware and Differential extension points cannot use
direct project references due to circular dependency (both projects
reference Core). Users add references from their own composition project.

Closes #381
Copilot AI review requested due to automatic review settings May 24, 2026 11:21
Copy link
Copy Markdown
Contributor

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 aims to finalize cross-project extensibility without introducing circular dependencies by adding new registration hooks in GeneralUpdate.Core and improving documentation/comments around Drivelution integration.

Changes:

  • Add CleanStrategy<T>() and DirtyStrategy<T>() registration methods to AbstractBootstrap.
  • Update Linux/Windows strategy comments regarding Drivelution middleware enablement.
  • Expand GeneralUpdate.Core.csproj comments describing how to restore/build Drivelution middleware.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/c#/GeneralUpdate.Core/Strategy/WindowsStrategy.cs Updates comment intended to guide enabling Drivelution middleware in the Windows pipeline.
src/c#/GeneralUpdate.Core/Strategy/LinuxStrategy.cs Updates comment intended to guide enabling Drivelution middleware in the Linux pipeline.
src/c#/GeneralUpdate.Core/GeneralUpdate.Core.csproj Improves comments explaining how Drivelution middleware can be restored/enabled in the Core build.
src/c#/GeneralUpdate.Core/Configuration/AbstractBootstrap.cs Adds new bootstrap registration methods for clean/dirty strategy extension points.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +88 to +94
/// <summary>Register a custom clean strategy by type name (interface lives in GeneralUpdate.Differential).</summary>
public TBootstrap CleanStrategy<T>() where T : class, new()
{ _extensions[typeof(T)] = typeof(T); return (TBootstrap)this; }

/// <summary>Register a custom dirty strategy by type name (interface lives in GeneralUpdate.Differential).</summary>
public TBootstrap DirtyStrategy<T>() where T : class, new()
{ _extensions[typeof(T)] = typeof(T); return (TBootstrap)this; }
Comment on lines +88 to +92
/// <summary>Register a custom clean strategy by type name (interface lives in GeneralUpdate.Differential).</summary>
public TBootstrap CleanStrategy<T>() where T : class, new()
{ _extensions[typeof(T)] = typeof(T); return (TBootstrap)this; }

/// <summary>Register a custom dirty strategy by type name (interface lives in GeneralUpdate.Differential).</summary>
.UseMiddleware<HashMiddleware>();
// DrivelutionMiddleware requires GeneralUpdate.Drivelution project reference;
// uncomment when the reference is added for net10.0 target.
// DrivelutionMiddleware: add GeneralUpdate.Drivelution project reference to enable
.UseMiddleware<HashMiddleware>();
// DrivelutionMiddleware requires GeneralUpdate.Drivelution project reference;
// uncomment when the reference is added for net10.0 target.
// DrivelutionMiddleware: add GeneralUpdate.Drivelution project reference to enable
Comment on lines +37 to +38
<!-- DrivelutionMiddleware: available for users who add GeneralUpdate.Drivelution reference.
Restore by: 1) Add <ProjectReference> to Drivelution, 2) Remove this Compile Remove -->
@JusterZhu JusterZhu merged commit 387ba8d into master May 24, 2026
1 check passed
@JusterZhu JusterZhu deleted the batch-11-cross-refs branch May 24, 2026 11:35
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.

Batch 11: Cross-project references — DrivelutionMiddleware + Differential

2 participants