refactor: Phase 2 — extension points + Download orchestrator + BlackListConfigBuilder (#356)#357
Merged
Merged
Conversation
…istConfigBuilder - Added IUpdatePipelineFactory interface + .PipelineFactory<T>() extension point - Added .DownloadPipeline<T>() extension point (IDownloadPipeline already existed) - ClientUpdateStrategy and UpgradeUpdateStrategy now accept optional IDownloadOrchestrator via constructor — uses new download subsystem when available, falls back to legacy DownloadManager - Added BlackListConfigBuilder with fluent API (AddBlackFiles/Formats/Dirs) - Added ConfigureBlackList(Action<BlackListConfigBuilder>) builder overload Closes #356
Contributor
There was a problem hiding this comment.
Pull request overview
Phase 2 of the v2 refactor that expands the bootstrap extension-point surface area and adds new builder-style configuration APIs, intended to make pipeline/download/blacklist customization pluggable from consumers.
Changes:
- Introduces
IUpdatePipelineFactoryas a new pipeline entry-point abstraction. - Adds new bootstrap extension-point registrations for
PipelineFactory<T>()andDownloadPipeline<T>(). - Adds
BlackListConfigBuilderto fluently constructBlackListConfiginstances.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/c#/GeneralUpdate.Core/Pipeline/IUpdatePipelineFactory.cs | Adds a new pipeline factory interface for executing update pipelines. |
| src/c#/GeneralUpdate.Core/FileSystem/BlackListConfigBuilder.cs | Adds a fluent builder to construct BlackListConfig instances. |
| src/c#/GeneralUpdate.Core/Configuration/AbstractBootstrap.cs | Extends the bootstrap extension registry with pipeline/download pipeline registration hooks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+6
to
+13
| /// <summary> | ||
| /// Factory for creating update pipelines. | ||
| /// Injected via <c>Bootstrap.PipelineFactory<T>()</c>. | ||
| /// </summary> | ||
| public interface IUpdatePipelineFactory | ||
| { | ||
| /// <summary>Create a pipeline for the given context.</summary> | ||
| Task ExecutePipelineAsync(PipelineContext context, CancellationToken token = default); |
Comment on lines
+16
to
+32
| public BlackListConfigBuilder AddBlackFiles(params string[] files) | ||
| { | ||
| _blackFiles.AddRange(files); | ||
| return this; | ||
| } | ||
|
|
||
| public BlackListConfigBuilder AddBlackFormats(params string[] formats) | ||
| { | ||
| _blackFormats.AddRange(formats); | ||
| return this; | ||
| } | ||
|
|
||
| public BlackListConfigBuilder AddSkipDirectories(params string[] directories) | ||
| { | ||
| _skipDirectories.AddRange(directories); | ||
| return this; | ||
| } |
Comment on lines
+34
to
+38
| public BlackListConfig Build() => new( | ||
| BlackFiles: _blackFiles.Count > 0 ? _blackFiles.AsReadOnly() : null, | ||
| BlackFormats: _blackFormats.Count > 0 ? _blackFormats.AsReadOnly() : null, | ||
| SkipDirectorys: _skipDirectories.Count > 0 ? _skipDirectories.AsReadOnly() : null | ||
| ); |
Comment on lines
+94
to
+95
| public TBootstrap DownloadPipeline<T>() where T : Download.Abstractions.IDownloadPipeline, new() | ||
| { _extensions[typeof(Download.Abstractions.IDownloadPipeline)] = typeof(T); return (TBootstrap)this; } |
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.
Phase 2 of the v2 refactoring: completes extension point system, wires Download orchestrator into strategies, and adds BlackListConfigBuilder.
Changes:
Full solution: 0 errors
Closes #356