Skip to content

refactor: Phase 2 — extension points + Download orchestrator + BlackListConfigBuilder (#356)#357

Merged
JusterZhu merged 1 commit into
masterfrom
feat/phase2-extensions-download
May 24, 2026
Merged

refactor: Phase 2 — extension points + Download orchestrator + BlackListConfigBuilder (#356)#357
JusterZhu merged 1 commit into
masterfrom
feat/phase2-extensions-download

Conversation

@JusterZhu

Copy link
Copy Markdown
Collaborator

Phase 2 of the v2 refactoring: completes extension point system, wires Download orchestrator into strategies, and adds BlackListConfigBuilder.

Changes:

  • IUpdatePipelineFactory interface + .PipelineFactory() extension point
  • .DownloadPipeline() extension point
  • ClientUpdateStrategy and UpgradeUpdateStrategy accept optional IDownloadOrchestrator via constructor
  • BlackListConfigBuilder with fluent AddBlackFiles/Formats/Dirs API
  • ConfigureBlackList(Action) builder overload

Full solution: 0 errors
Closes #356

…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
Copilot AI review requested due to automatic review settings May 24, 2026 08:51
@JusterZhu JusterZhu added the refactor Refactor some existing code. label May 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 IUpdatePipelineFactory as a new pipeline entry-point abstraction.
  • Adds new bootstrap extension-point registrations for PipelineFactory<T>() and DownloadPipeline<T>().
  • Adds BlackListConfigBuilder to fluently construct BlackListConfig instances.

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&lt;T&gt;()</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; }
@JusterZhu JusterZhu merged commit b6c5d19 into master May 24, 2026
1 check passed
@JusterZhu JusterZhu deleted the feat/phase2-extensions-download branch May 24, 2026 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactor some existing code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 2: Extension points completion + Download subsystem integration

2 participants