Commit 19c3a52
authored
refactor: Unify OSS update path through OSSUpdateStrategy (#414)
* refactor: unify OSS update path through OSSUpdateStrategy
Move client-side OSS logic (version config download, upgrade check,
process launch) from LaunchOssAsync() into OSSUpdateStrategy. The
strategy now handles both client and upgrade OSS roles internally.
- OSSUpdateStrategy.ExecuteAsync(): detects role via
GlobalConfigInfoOSS env var, dispatches to ExecuteClientAsync()
or ExecuteUpgradeAsync() accordingly
- GeneralUpdateBootstrap: AppType.OSS now goes through
LaunchWithStrategy(new OSSUpdateStrategy()) — consistent with
Client and Upgrade paths
- Deleted LaunchOssAsync(), DownloadOssFile(), IsOssUpgrade() from
GeneralUpdateBootstrap
Closes #409
* refactor: simplify OSS to single-process flow, remove upgrade/client split
OSS mode no longer needs a separate upgrade process. The strategy
downloads version config, downloads packages from OSS, decompresses,
starts the main app, and exits — all in one process.
- Removed client/upgrade env-var-based dispatch from OSSUpdateStrategy
- Single ExecuteAsync() flow: download config -> download packages -> decompress -> start app -> exit
- Removed GlobalConfigInfoOSS env var bridging (no longer needed)
Related #409
* refactor: OSS client/upgrade split with upgrade process
OSS mode uses a separate upgrade process to download packages and
decompress, but does NOT check UpgradeClientVersion (the upgrade
process itself never needs upgrading — differs from standard flow).
Client side (main app):
Download version config → check update → start upgrade process → exit
Upgrade side (GeneralUpdate.Upgrade.exe):
Read version config → download OSS packages → decompress → start main app
Related #409
* refactor: add AppType.OSSClient/OSSUpgrade, remove env-var dispatch
Replace AppType.OSS with explicit OSSClient/OSSUpgrade to match the
Client/Upgrade pattern. OSSUpdateStrategy now accepts AppType via
constructor instead of detecting role via GlobalConfigInfoOSS env var.
- AppType enum: OSS = 3 -> OSSClient = 3, OSSUpgrade = 4
- Bootstrap dispatch: OSSClient/OSSUpgrade through LaunchWithStrategy
- OSSUpdateStrategy: role dispatched by constructor AppType parameter
- Updated tests for new enum values
Closes #409
* fix: remove dead GlobalConfigInfoOSS write from OSS client path
The upgrade side (ExecuteUpgradeAsync) reads version config directly
from the local JSON file — it never reads GlobalConfigInfoOSS env var.
Writing it in ExecuteClientAsync was dead code.
Removed ossConfig + Environments.SetEnvironmentVariable block.
Related #409
* fix: guard against empty UpdateUrl in OSS client download
DownloadVersionConfig calls HttpClient which throws
InvalidOperationException when UpdateUrl is empty/null. Skip the
download when UpdateUrl is not configured, then check for local
version config file existence as before.
Fixes OssIntegrationTests.OSSUpdateStrategy_RequiresConfig test.
Related #4091 parent 9a1f15e commit 19c3a52
5 files changed
Lines changed: 151 additions & 160 deletions
File tree
- src/c#/GeneralUpdate.Core
- Bootstrap
- Configuration
- Strategy
- tests/CoreTest
- Bootstrap
- Configuration
Lines changed: 4 additions & 89 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | | - | |
| 75 | + | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | 158 | | |
224 | 159 | | |
225 | 160 | | |
| |||
373 | 308 | | |
374 | 309 | | |
375 | 310 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | 311 | | |
397 | 312 | | |
398 | 313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
0 commit comments