fix: ship tested downloads with recoverable quarantine and a working demo - #21
Merged
Merged
Conversation
Comment on lines
16
to
+21
| foreach (FileEntry entry in EnumerateDirectory(fullRoot, options)) | ||
| yield return entry; | ||
| { | ||
| if (seenPaths.Add(entry.FullPath)) | ||
| yield return entry; | ||
| } |
| IReadOnlyList<ManifestEntry> manifest = QuarantineService.Quarantine(resolutions, quarantineDir); | ||
| string manifestPath = Path.Combine(quarantineDir, "manifest.json"); | ||
| QuarantineService.WriteManifest(manifest, manifestPath); | ||
| string manifestPath = Path.Combine(Path.GetFullPath(quarantineDir), "manifest.json"); |
| { | ||
| Directory.CreateDirectory(quarantineDir); | ||
| string fullQuarantineDir = Path.GetFullPath(quarantineDir); | ||
| string manifestPath = Path.Combine(fullQuarantineDir, "manifest.json"); |
|
|
||
| var options = new ScanOptions(); | ||
| var entries = FileScanner.Enumerate( | ||
| [dir.Path, dir.Path, Path.Combine(dir.Path, "nested", ".."), nested], options).ToList(); |
| var duplicateB = new FileEntry(dupB, 9, DateTime.UtcNow); | ||
| var resolutionSameGroupIndex = new DuplicateResolution(group, keep, [duplicateB]); | ||
| var resolution = new DuplicateResolution(group, keep, [duplicate, duplicateB]); | ||
| string groupDir = Path.Combine(quarantineDir, "0"); |
| Assert.True(File.Exists(manifest[0].QuarantinePath)); | ||
| Assert.True(File.Exists(manifest2[0].QuarantinePath)); | ||
| Assert.True(File.Exists(manifest[1].QuarantinePath)); | ||
| Assert.Equal("content A", File.ReadAllText(Path.Combine(groupDir, "dup.txt"))); |
|
|
||
| var manifest = QuarantineService.Quarantine([resolution], quarantineDir); | ||
| string manifestPath = Path.Combine(quarantineDir, "manifest.json"); | ||
| string manifestPath = Path.Combine(dir.Path, "manual-manifest.json"); |
| string keepPath = dir.WriteFile("keep.txt", "dup content"); | ||
| string dupPath = dir.WriteFile("dup.txt", "dup content"); | ||
| string quarantineDir = dir.CreateSubdirectory(".dupesweep-quarantine"); | ||
| string manifestPath = Path.Combine(quarantineDir, "manifest.json"); |
| using var dir = new TempDirectory(); | ||
| string keepPath = dir.WriteFile("keep.txt", "dup content"); | ||
| string firstDuplicatePath = dir.WriteFile("first.txt", "dup content"); | ||
| string missingDuplicatePath = Path.Combine(dir.Path, "missing.txt"); |
|
|
||
| Assert.ThrowsAny<IOException>(() => QuarantineService.Quarantine([resolution], quarantineDir)); | ||
|
|
||
| string manifestPath = Path.Combine(quarantineDir, "manifest.json"); |
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.
What
Provide self-contained DupeSweep downloads with native archive tests, correct the source quickstart, and add a reproducible quarantine/restore demo.
Why
The README pointed to a nonexistent project and scan command, and the existing release had no binary assets. Reviewing the demo also exposed manifest overwrite/partial-move recovery defects and duplicate entries from overlapping scan roots.
How
Quarantine reserves and flushes a complete manifest before moving files and refuses an existing manifest. Scanning deduplicates normalized full paths. Read-only PR/manual CI builds Windows x64, Linux x64, macOS ARM64 and Intel archives, extracts each, verifies binary behavior, retains evidence, and aggregates SHA-256 checksums. Release publication follows merged-source verification.
Affected area
Tests
Checklist
Quarantine does not free same-volume disk space. Use a fresh quarantine directory for another run; retain manifests for recovery. Executables are self-contained but not publisher-signed. Normalized-path deduplication does not establish hard-link or symlink identity guarantees.
Contribution opportunities are tracked in #18, #19 and #20. This PR does not claim external contributors, adoption, or an OpenSSF criticality threshold.