Batch 11: CleanStrategy/DirtyStrategy extension points + Drivelution docs#382
Merged
Conversation
- 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
Contributor
There was a problem hiding this comment.
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>()andDirtyStrategy<T>()registration methods toAbstractBootstrap. - Update Linux/Windows strategy comments regarding Drivelution middleware enablement.
- Expand
GeneralUpdate.Core.csprojcomments 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 --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the final extension points and documents cross-project integration patterns.
Changes
AbstractBootstrap
csproj + Strategy docs
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
Closes #381