Skip to content

refactor: Phase 1b — extract ClientUpdateStrategy and UpgradeUpdateStrategy (#354)#355

Merged
JusterZhu merged 1 commit into
masterfrom
feat/client-upgrade-strategies
May 24, 2026
Merged

refactor: Phase 1b — extract ClientUpdateStrategy and UpgradeUpdateStrategy (#354)#355
JusterZhu merged 1 commit into
masterfrom
feat/client-upgrade-strategies

Conversation

@JusterZhu
Copy link
Copy Markdown
Collaborator

Summary

Extracts role-based strategies from Bootstrap inline methods. Completes the 3-role strategy system from section 2.3.

Changes

New: ClientUpdateStrategy : IStrategy

  • Encapsulates client workflow: version validation, dual-version check (client+upgrade), Bowl process management, custom options, silent mode, ProcessInfo IPC creation, backup, download, pipeline execution
  • Supports .UseUpdatePrecheck() and .UseCustomOption() for extensibility
  • Composes OS strategy internally (Windows/Linux/Mac)

New: UpgradeUpdateStrategy : IStrategy

  • Encapsulates upgrade workflow: Default mode (apply runtime options, download, execute pipeline) and Scripts mode (version validation, backup, download, pipeline, start app)
  • Composes OS strategy internally

Simplified: GeneralUpdateBootstrap

  • ~220 lines (down from ~560)
  • LaunchAsync() dispatches by AppType → creates role strategy → calls Create() + ExecuteAsync()
  • Old inline methods (LaunchClientAsync, LaunchUpgradeAsync, ExecuteClientWorkflowAsync, ExecuteUpgradeWorkflowAsync) removed

Architecture after Phase 1b

GeneralUpdateBootstrap.LaunchAsync()
  ├── AppType.ClientApp  → ClientUpdateStrategy  → OS strategy (Windows/Linux/Mac)
  ├── AppType.UpgradeApp → UpgradeUpdateStrategy → OS strategy
  └── AppType.OSSApp     → OSSUpdateStrategy     → OS-agnostic

Verification

  • Full solution: 0 errors, 0 warnings
  • Tests: 54/55 passed (same pre-existing failure)

Closes #354

…rategy

- Created ClientUpdateStrategy : IStrategy — encapsulates client workflow
  (version validation, dual-version check, Bowl mgmt, custom options,
  ProcessInfo IPC creation, backup, download, pipeline execution, StartApp)
- Created UpgradeUpdateStrategy : IStrategy — encapsulates upgrade workflow
  (Default/Scripts mode, version validation, backup, download, pipeline)
- Bootstrap.LaunchAsync() now delegates to role strategies via AppType
- Bootstrap simplified to ~220 lines (down from ~560)
- All three role strategies implement IStrategy with Create(GlobalConfigInfo)

Architecture: ClientUpdateStrategy | UpgradeUpdateStrategy | OSSUpdateStrategy
               └── composes OS strategy (Windows/Linux/Mac)

Closes #354
Copilot AI review requested due to automatic review settings May 24, 2026 08:44
@JusterZhu JusterZhu added the refactor Refactor some existing code. label May 24, 2026
@JusterZhu JusterZhu merged commit e0f509d into master May 24, 2026
1 check failed
@JusterZhu JusterZhu deleted the feat/client-upgrade-strategies branch May 24, 2026 08:45
@JusterZhu JusterZhu review requested due to automatic review settings May 24, 2026 09:09
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 1b: Extract ClientUpdateStrategy and UpgradeUpdateStrategy from Bootstrap

1 participant