Skip to content

Add persistent failure report restart regression coverage - #548

Open
JusterZhu wants to merge 6 commits into
justerzhu-upgrade-failure-stage-collectionfrom
justerzhu-persistent-regression-integration
Open

JusterZhu wants to merge 6 commits into
justerzhu-upgrade-failure-stage-collectionfrom
justerzhu-persistent-regression-integration

Conversation

@JusterZhu

@JusterZhu JusterZhu commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Add a cross-PR regression that queues categorized failure reports while HTTP delivery is unavailable, creates a new reporter instance, then replays in order.
  • Verify recordId, status, type, category, phase, errorCode, and message survive source-generated serialization and restart; verify older DTOs still consume the core fields and endpoint credentials are not persisted.
  • Document that future idempotency fields remain disabled unless trusted capability negotiation or explicit operator confirmation establishes server support. HTTP success is not capability proof; the local queue order is not a server sequence or causal order.
  • Add persistent Windows/Linux CI on every push to this integration branch, plus manual dispatch. The job checks the fixed Fix upgrade report record routing and status sequencing #541/Capture update failures by stage and record #544/Add opt-in durable update report replay #543 commit ancestry before running the targeted report regression tests.

Validation

  • Local targeted run: dotnet test tests\CoreTest\CoreTest.csproj --filter "FullyQualifiedName~PersistentUpdateReporterTests|FullyQualifiedName~FailureReportingTests|FullyQualifiedName~ReportRoutingTests" --logger "console;verbosity=normal" — passed, 33 tests.
  • GitHub Actions on integration head 21cf9e1fb26c083f6d7b41f91953b0489ec00785: Windows passed (33/33), Linux passed (33/33). Run #45043524631.

Dependencies and merge-base limitation

This integration depends on:

GitHub allows one PR base, so this PR uses justerzhu-upgrade-failure-stage-collection (#544), which already includes #541. #543 is a separate master-based line; its files therefore temporarily appear in this PR's diff through the dependency merge. This PR must be integrated only after the listed dependencies; it is not independently mergeable against master. No existing dependency PR or branch was changed.

JusterZhu and others added 4 commits November 22, 2026 23:37
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 22, 2026 16:10

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.

🟡 Changes recommended

Reporting failures can skip rollback records or prevent concurrent reports from being persisted, while the concurrency test does not reliably exercise contention.

3 open issues
What changed in this PR

Adds restart/replay regression coverage connecting categorized failure reports with durable reporting. The diff also includes the durable-queue dependency; integration requires the listed dependency PRs.

Changes:

  • Verify failure details, report order, legacy DTO compatibility, and credential exclusion across reporter restart.
  • Include disk-backed replay, strict delivery acknowledgements, and configured reporter registration.
  • Document delivery limits and prerequisites for future server-supported idempotency.
File Description
tests/​CoreTest/​Download/​PersistentUpdateReporterTests.cs Covers persistence, restart, replay, failure details, and registration.
src/​GeneralUpdate.Core/​Download/​Reporting/​PersistentUpdateReporter.cs Adds an opt-in disk-backed FIFO report queue.
src/​GeneralUpdate.Core/​Download/​Reporting/​IUpdateReporter.cs Adds strict HTTP and business-success acknowledgement checks.
src/​GeneralUpdate.Core/​Configuration/​AbstractBootstrap.cs Supports registering and replacing configured reporter instances.
README.md Documents durable reporting setup, limitations, and idempotency safeguards.

Review effort: Balanced

{
if (File.Exists(temp)) File.Delete(temp);
}
await ReplayLockedAsync(token).ConfigureAwait(false);
}
var report = JsonSerializer.Deserialize(json, UpdateReportJsonContext.Default.UpdateReport)
?? throw new InvalidDataException("A queued update report is null.");
await _sender.SendAsync(report, token).ConfigureAwait(false);
Comment on lines +117 to +121
var tasks = Enumerable.Range(1, 8).Select(async i =>
{
await Assert.ThrowsAsync<HttpRequestException>(() => Create(handler).ReportAsync(new UpdateReport(i, 3)));
});
await Task.WhenAll(tasks);
JusterZhu and others added 2 commits November 23, 2026 00:21
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants