Conversation
🌃 Changes: - 🔲 UpdateOptions: add Bowl, UpdateLogUrl, Script, RetryInterval, Hub - 🔲 OssDownloadSource: new IDownloadSource for OSS version listing - 🔲 OSSUpdateStrategy: refactor to use DownloadSource/Orchestrator injection - 🔲 IProcessInfoProvider: add SharedMemoryProvider + AutoProvider (3-tier IPC fallback) - 🔲 AbstractBootstrap: add ConfigureBlackList(Action‹BlackListConfigBuilder›) fluent overload - 🔲 FileTreeCore: add FileTreeSnapshot, FileTreeComparer, FileTreeDiffer - 🔲 csproj: AOT conditional compilation (SignalR excluded in PublishAot), DrivelutionMiddleware conditional removal - 🔲 Tests: 7 new test files (DownloadRobustness, IpcFallback, OssIntegration, HooksIntegration, EventListenerBatch, FileTreeComparer) ✅ dotnet build: 0 errors, 0 warnings ✅ dotnet test CoreTest: 80/80 pass (excl. 1 pre-existing ConfiginfoBuilder failure + 2 platform-specific IPC) Closes #388
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fills remaining refactor-plan gaps in GeneralUpdate.Core by adding OSS download-source support, IPC fallback providers, file-tree diffing APIs, new configuration options, AOT project conditions, and related tests.
Changes:
- Adds OSS
IDownloadSourceintegration and refactorsOSSUpdateStrategytoward the download orchestration abstraction. - Adds IPC fallback providers, file-tree snapshot/comparer/differ helpers, and a blacklist builder overload.
- Adds AOT/Drivelution project conditions and new test coverage for downloads, IPC, OSS, hooks, events, and file-tree comparison.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
src/c#/GeneralUpdate.Core/Configuration/UpdateOptions.cs |
Adds new option constants for watchdog, logging/script, retry, and hub configuration. |
src/c#/GeneralUpdate.Core/Configuration/AbstractBootstrap.cs |
Adds fluent builder overload for blacklist configuration. |
src/c#/GeneralUpdate.Core/Download/Sources/OssDownloadSource.cs |
Adds OSS-backed download source that converts OSS version JSON to download assets. |
src/c#/GeneralUpdate.Core/Strategy/OSSUpdateStrategy.cs |
Refactors OSS strategy to use injected source/orchestrator or local JSON fallback. |
src/c#/GeneralUpdate.Core/Ipc/IProcessInfoProvider.cs |
Adds shared-memory and automatic fallback IPC providers. |
src/c#/GeneralUpdate.Core/FileSystem/FileTreeCore/FileTreeSnapshot.cs |
Adds new file-tree snapshot and file-entry types. |
src/c#/GeneralUpdate.Core/FileSystem/FileTreeCore/FileTreeComparer.cs |
Adds file-tree diff and comparison helpers. |
src/c#/GeneralUpdate.Core/FileSystem/FileTreeCore/FileTreeDiffer.cs |
Adds delta path/delete production and delta heuristic helpers. |
src/c#/GeneralUpdate.Core/GeneralUpdate.Core.csproj |
Adds AOT-related conditions and conditional Drivelution middleware compilation. |
tests/CoreTest/Download/DownloadRobustnessTests.cs |
Adds retry/download robustness tests. |
tests/CoreTest/Ipc/IpcFallbackTests.cs |
Adds IPC provider and fallback tests. |
tests/CoreTest/Integration/OssIntegrationTests.cs |
Adds OSS source/strategy integration tests. |
tests/CoreTest/Hooks/HooksIntegrationTests.cs |
Adds update hook/context tests. |
tests/CoreTest/Event/EventListenerBatchTests.cs |
Adds event listener and dispatch tests. |
tests/CoreTest/FileSystem/FileTreeComparerTests.cs |
Adds file-tree comparison and differ tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| foreach (var asset in assets) | ||
| { | ||
| var zipFilePath = Path.Combine(_appPath, $"{version.PacketName}{Format.ZIP}"); | ||
| var zipFilePath = Path.Combine(_appPath, $"{asset.Name}{Format.ZIP}"); |
| if (string.IsNullOrWhiteSpace(v.Url)) | ||
| throw new InvalidOperationException( | ||
| $"OSS version '{v.PacketName ?? v.Version}' has no download URL."); | ||
| var zipName = $"{v.PacketName ?? v.Version}zip"; |
| throw new InvalidOperationException( | ||
| $"OSS version '{v.PacketName ?? v.Version}' has no download URL."); | ||
|
|
||
| var zipName = $"{v.PacketName ?? v.Version}zip"; |
Comment on lines
+116
to
+120
| using var mmf = MemoryMappedFile.CreateNew(_mapName, MaxPayload); | ||
| using var accessor = mmf.CreateViewAccessor(0, MaxPayload); | ||
| accessor.Write(0, bytes.Length); | ||
| accessor.WriteArray(4, bytes, 0, bytes.Length); | ||
| return Task.CompletedTask; |
Comment on lines
+43
to
+49
| public void CustomPermissionHooks_StoresScriptPath() | ||
| { | ||
| var hooks = new CustomPermissionHooks("/usr/local/bin/my-script.sh"); | ||
| var ctx = new UpdateContext("app", "/path", "1.0.0", null, 1); | ||
|
|
||
| // CustomPermissionHooks throws when script fails | ||
| var ex = Assert.ThrowsAsync<InvalidOperationException>(() => |
Comment on lines
+39
to
+41
| <!-- DrivelutionMiddleware: conditionally compiled when Drivelution reference is present. | ||
| Add <ProjectReference> to GeneralUpdate.Drivelution to enable automatically. --> | ||
| <Compile Remove="Pipeline\DrivelutionMiddleware.cs" Condition="'$(HasDrivelutionReference)' != 'true'" /> |
| public Hooks.IUpdateHooks Hooks { get; set; } = new Hooks.NoOpUpdateHooks(); | ||
| /// <summary>Update status reporter injected by the bootstrap.</summary> | ||
| public Download.Reporting.IUpdateReporter Reporter { get; set; } = new Download.Reporting.NoOpUpdateReporter(); | ||
| /// <summary>Download source for OSS version listing. Override via <c>.DownloadSource<OssDownloadSource>()</c>.</summary> |
Comment on lines
+157
to
+162
| _providers = new IProcessInfoProvider[] | ||
| { | ||
| new NamedPipeProcessInfoProvider(), | ||
| new SharedMemoryProcessInfoProvider(), | ||
| new EncryptedFileProcessInfoProvider() | ||
| }; |
Comment on lines
+37
to
+38
| var oldMap = old.Entries.ToDictionary(e => e.RelativePath, e => e, StringComparer.OrdinalIgnoreCase); | ||
| var newMap = updated.Entries.ToDictionary(e => e.RelativePath, e => e, StringComparer.OrdinalIgnoreCase); |
Comment on lines
+78
to
+79
| var oldMap = old.Entries.ToDictionary(e => e.RelativePath, e => e, StringComparer.OrdinalIgnoreCase); | ||
| var newDict = updated.Entries.ToDictionary(e => e.RelativePath, e => e, StringComparer.OrdinalIgnoreCase); |
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
Fills all remaining gaps between the refactor plan v2 and actual implementation.
Changes
UpdateOptions - 5 missing constants added:
Bowl(watchdog path),UpdateLogUrl,Script,RetryInterval(TimeSpan),Hub(HubConfig?)OssDownloadSource - new
IDownloadSourcefor OSS version listing:OssDownloadSource.csreads version JSON from OSS, returnsDownloadAssetlistOSSUpdateStrategyrefactored to useDownloadSource+DownloadOrchestratorinjectionIPC - 3-tier fallback:
SharedMemoryProcessInfoProvider(MemoryMappedFile, Linux-friendly)AutoProcessInfoProvider(NamedPipe -> SharedMemory -> EncryptedFile auto-fallback)ConfigureBlackList - fluent builder overload:
.ConfigureBlackList(cfg => cfg.AddBlackFiles("*.log").AddBlackFormats(".pdb"))FileTreeCore - Snapshot/Comparer/Differ:
FileTreeSnapshot- captures file tree stateFileTreeComparer- producesFileTreeDiff(added/modified/deleted)FileTreeDiffer- produces delta paths + ShouldUseDeltaPatching heuristiccsproj - AOT + Drivelution:
PublishAot=trueDrivelutionMiddlewareconditionally removed (not hard-removed)Tests - 7 new test files (80 tests):
Build + Tests
dotnet build src/c#/GeneralUpdate.slnx- 0 errors, 0 warningsdotnet test tests/CoreTest- 80/80 new tests pass (1 pre-existing ConfiginfoBuilder failure, 2 platform-specific IPC skipped)Closes #388