Repository navigation
Conversation
154223e to
7788c75
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors cleanup jobs to rely on repository abstractions, improves duplicate stack cleanup behavior, and adds integration coverage for cleanup/repository operations.
Changes:
- Reworked orphaned-data and cleanup jobs with lock renewal, cancellation checks, and repository-based deletes/updates.
- Added event repository helpers for bulk deletion, stack reassignment, and distinct-id aggregation.
- Added integration tests for cleanup pagination, retention, duplicate signatures, and event repository operations.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/Exceptionless.Core/Jobs/CleanupDataJob.cs |
Extends lock duration and renews locks during paged cleanup/retention loops. |
src/Exceptionless.Core/Jobs/CleanupOrphanedDataJob.cs |
Replaces direct Elasticsearch calls with repository methods for orphan cleanup and duplicate-stack fixing. |
src/Exceptionless.Core/Repositories/EventRepository.cs |
Adds bulk delete, stack reassignment, and composite aggregation helpers. |
src/Exceptionless.Core/Repositories/Interfaces/IEventRepository.cs |
Exposes new event repository cleanup/query APIs and composite cursor type. |
src/Exceptionless.Core/Repositories/StackRepository.cs |
Adds duplicate signature aggregation lookup. |
src/Exceptionless.Core/Repositories/Interfaces/IStackRepository.cs |
Exposes duplicate signature lookup API. |
tests/Exceptionless.Tests/Jobs/CleanupDataJobTests.cs |
Adds cleanup pagination and retention integration coverage. |
tests/Exceptionless.Tests/Jobs/CleanupOrphanedDataJobTests.cs |
Adds integration coverage for orphan cleanup and duplicate stack merging. |
tests/Exceptionless.Tests/Repositories/EventRepositoryTests.cs |
Adds coverage for distinct ids, stack reassignment, and bulk delete helpers. |
tests/Exceptionless.Tests/Repositories/StackRepositoryTests.cs |
Adds duplicate signature repository coverage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7788c75 to
3c5880b
Compare
|
Merged origin/main and addressed the outstanding review feedback in 92fa434. Summary:
Verification:
All review threads are resolved. |
92fa434 to
281071e
Compare
|
Production-readiness pass complete on f6fcc4b.
Production-readiness verdict: READY. |
|
Production-readiness refresh complete on bd560b0.
Production-readiness verdict: READY. PR remains open and unmerged. |
|
Follow-up reviewer audit complete on c2bcdc6. Feedback ledger
RCA and current design proof
Thermo-nuclear review
Verification
Verdict: READY. No code changes were required in this follow-up audit; the PR remains open and unmerged. |
|
Final destructive-cleanup and query audit complete on Coverage and confidenceThis repository does not have 100% coverage, so I cannot honestly claim that no change can ever break anything. The exact-head hosted result is 78% line coverage (23,782/30,603) and 67% branch coverage (11,127/16,628); Core is 75%/67%. The authoritative isolated run is green: 2,742 .NET tests, 2,740 passed, 0 failed, and 2 intentional performance-test skips. All four new Deletion-safety findings and fixes
One residual limit is explicit: parent validation and event delete-by-query are separate cross-index operations. Supported ingestion writes the parent before the event, which satisfies the runtime invariant, but an out-of-contract event-first import or concurrent parent restore after the final check can still race cleanup. Eliminating that class absolutely would require an age grace period, two-pass quarantine, or cross-index coordination. Green tests cannot turn that non-atomic design into a mathematical guarantee. Query/performance verdictThe result is mixed, not uniformly “faster”:
CI proves behavior, not performance parity. A defensible performance gate would compare Verdict: merge-ready for the supported parent-before-event runtime invariant, with substantially stronger fail-closed behavior and exact-head integration proof. It is not 100%-covered, not an absolute cross-index no-loss guarantee, and not yet performance-benchmarked. |
|
Upstream follow-up for the strict MGET safety finding:
Exceptionless should retain its current fail-closed adapter until a released Foundatio.Repositories package contains #314. After upgrading, the intended cleanup is to replace the duplicated raw MGET implementation and internal interface-to-base-class cast with canonical I also merged the latest |
|
Final exact-head thermo and strict-MGET follow-up:
The MGET behavior was a real upstream Foundatio.Repositories gap: HTTP-200 per-item errors were logged and omitted, making them indistinguishable from missing documents. I filed issue #313 and opened PR #314. Both hosted build runs pass 841/841 tests with 0 failures/skips; CodeQL and CLA are green. The fix is opt-in/backward-compatible and adds no request round trip: strict mode changes only per-item response validation. Thermo verdict: no remaining blocking finding in this PR. Keep the local fail-closed adapter until #314 is released and the package is upgraded; then replace it with canonical |
c00aa6b to
4b85d0c
Compare
Cleanup pages through all distinct event identifiers, fails closed on parent-read errors, and renews its lock during long operations. Duplicate-stack redirects and an occurrence ledger preserve late events and counters; atomic tag patches preserve concurrent updates. Internal reconciliation fields stay out of API JSON. No public API breaking changes.
Validation: includes
mainat89607b48b. The latest merge changes only CONTRIBUTING.md; application/tests match green head7a0ebe3c3. Its build, 10 independent concurrency-test runs, 33 repository/service tests, and full hosted CI passed. Final-head CI passed for2fe40985b: all API/E2E shards, client tests, Docker build, and CLA are green. No local builds/tests were rerun for the docs-only merge.Parent validation and event deletion remain separate cross-index operations and assume parent-before-event ingestion. Performance parity is unbenchmarked.
Verification and implementation details
The concurrency regression now runs 20 overlapping tag/counter pairs one pair at a time, retaining count/tag assertions and adding the final occurrence timestamp assertion. Its former 40-write burst exhausted the counter method’s existing bounded conflict retries. Production code and retry limits are unchanged. Local verification used an independently owned disposable Elasticsearch container; the temporary fixture adjustment was restored and excluded from the commit.
The October 27 merge is conflict-free and includes current main. All 25 review threads are resolved. The disposable test container was removed after verification; shared persistent containers and volumes were untouched.
Local verification:
dotnet build tests/Exceptionless.Tests/Exceptionless.Tests.csproj -m:1 --no-restore; ten independent runs filtered toAddEventTagsAsync_WithConcurrentCounterUpdates_PreservesBothChanges; thendotnet test --project tests/Exceptionless.Tests/Exceptionless.Tests.csproj --no-build -- --filter-class Exceptionless.Tests.Repositories.StackRepositoryTests --filter-class Exceptionless.Tests.Services.StackServiceTests. No test-runner retries were used. The temporary fixture patch bypassed shared AppHost startup for these local checks; hosted CI passed with the committed fixture unchanged.The installed Foundatio.Repositories package lacks the upstream strict multi-get option, so the local fail-closed adapter remains necessary.