Downloads#46
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements the “download” feature requested in issue #2 by adding download capabilities to the Rainmaker library and exposing them via the CLI. It also introduces an info API/command for retrieving WebDAV metadata for a single remote item, plus accompanying tests and fixtures.
Changes:
- Add
Server.download(_:to:force:)for downloading a single file or recursively syncing a directory (with optional overwrite/sync semantics). - Add
Server.info(_:)and correspondingrainmaker-cli infocommand. - Add/extend tests and HTTP fixtures (including a new
URLTestSession.download(...)test hook).
Reviewed changes
Copilot reviewed 62 out of 62 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/RainmakerTests/URLTestSession.swift | Adds download(for:delegate:) to support file-download fixtures in tests. |
| Tests/RainmakerTests/PollTests.swift | Renames suite label. |
| Tests/RainmakerTests/LoginTests.swift | Renames suite label. |
| Tests/RainmakerTests/ListingTests.swift | Renames suite label and test display names. |
| Tests/RainmakerTests/InfoTests.swift | Adds tests for Server.info(_:) (but currently missing fixtures). |
| Tests/RainmakerTests/DownloadTests.swift | Adds tests for downloading files/directories and overwrite behavior. |
| Sources/RainmakerCLI/Commands/Rainmaker.swift | Registers new CLI subcommands (download, info). |
| Sources/RainmakerCLI/Commands/Info.swift | Adds rainmaker-cli info command implementation. |
| Sources/RainmakerCLI/Commands/Download.swift | Adds rainmaker-cli download command implementation. |
| Sources/Rainmaker/Serving.swift | Extends Serving API with download + info and documents expected behavior. |
| Sources/Rainmaker/Server.swift | Implements download + info; adds local/remote enumeration & sync logic for directory downloads. |
| Sources/Rainmaker/Requests/Requesting.swift | Extends request abstraction with async download(for:delegate:). |
| Sources/Rainmaker/RainmakerError.swift | Adds error cases for download/sync scenarios (directory not empty, file exists, enumeration failure, not found). |
| Sources/Rainmaker/Models/Method.swift | Adds HTTP GET method enum case. |
| Sources/Rainmaker/Extensions/FileManager+assertFileDoesNotExist.swift | Adds helper to throw on destination-file conflicts. |
| .swiftpm/xcode/xcshareddata/xcschemes/CLI (Info).xcscheme | Adds an Xcode run scheme for the info CLI flow. |
| .swiftpm/xcode/xcshareddata/xcschemes/CLI (Help).xcscheme | Adds an Xcode run scheme for --help. |
| .swiftpm/xcode/xcshareddata/xcschemes/CLI (Download).xcscheme | Adds an Xcode run scheme for the download CLI flow. |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/overwriteUnchangedFile/PROPFIND/remote.php/dav/files/admin/Readme.md/Headers.txt | Fixture: PROPFIND headers (overwrite-unchanged-file case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/overwriteUnchangedFile/PROPFIND/remote.php/dav/files/admin/Readme.md/Body.xml | Fixture: PROPFIND body (overwrite-unchanged-file case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/overwriteFile/PROPFIND/remote.php/dav/files/admin/Readme.md/Headers.txt | Fixture: PROPFIND headers (overwrite-file case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/overwriteFile/PROPFIND/remote.php/dav/files/admin/Readme.md/Body.xml | Fixture: PROPFIND body (overwrite-file case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/overwriteFile/GET/remote.php/dav/files/admin/Readme.md/Headers.txt | Fixture: GET headers (overwrite-file case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/overwriteFile/GET/remote.php/dav/files/admin/Readme.md/Body.bin | Fixture: GET body (overwrite-file case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/overwriteDirectoryPreservesExistingRemoteItems/PROPFIND/remote.php/dav/files/admin/Documents/Headers.txt | Fixture: PROPFIND headers (preserve-existing-remote-items case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/overwriteDirectoryPreservesExistingRemoteItems/PROPFIND/remote.php/dav/files/admin/Documents/Body.xml | Fixture: PROPFIND body (preserve-existing-remote-items case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/overwriteDirectoryPreservesExistingRemoteItems/GET/remote.php/dav/files/admin/Documents/Example.md/Headers.txt | Fixture: GET headers (preserve-existing-remote-items case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/overwriteDirectoryPreservesExistingRemoteItems/GET/remote.php/dav/files/admin/Documents/Example.md/Body.bin | Fixture: GET body (preserve-existing-remote-items case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/overwriteDirectory/PROPFIND/remote.php/dav/files/admin/Documents/Headers.txt | Fixture: PROPFIND headers (overwrite-directory case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/overwriteDirectory/PROPFIND/remote.php/dav/files/admin/Documents/Body.xml | Fixture: PROPFIND body (overwrite-directory case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/overwriteDirectory/GET/remote.php/dav/files/admin/Documents/Example.md/Headers.txt | Fixture: GET headers (overwrite-directory case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/overwriteDirectory/GET/remote.php/dav/files/admin/Documents/Example.md/Body.bin | Fixture: GET body (overwrite-directory case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/file/PROPFIND/remote.php/dav/files/admin/Readme.md/Headers.txt | Fixture: PROPFIND headers (download file case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/file/PROPFIND/remote.php/dav/files/admin/Readme.md/Body.xml | Fixture: PROPFIND body (download file case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/file/GET/remote.php/dav/files/admin/Readme.md/Headers.txt | Fixture: GET headers (download file case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/file/GET/remote.php/dav/files/admin/Readme.md/Body.bin | Fixture: GET body (download file case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/directory/PROPFIND/remote.php/dav/files/admin/Documents/Headers.txt | Fixture: PROPFIND headers (download directory case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/directory/PROPFIND/remote.php/dav/files/admin/Documents/Body.xml | Fixture: PROPFIND body (download directory case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/directory/GET/remote.php/dav/files/admin/Documents/Example.md/Headers.txt | Fixture: GET headers (download directory case). |
| Tests/RainmakerTests/Responses/32.0.3/DownloadTests/directory/GET/remote.php/dav/files/admin/Documents/Example.md/Body.bin | Fixture: GET body (download directory case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/overwriteUnchangedFile/PROPFIND/remote.php/dav/files/admin/Readme.md/Headers.txt | Fixture: PROPFIND headers (overwrite-unchanged-file case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/overwriteUnchangedFile/PROPFIND/remote.php/dav/files/admin/Readme.md/Body.xml | Fixture: PROPFIND body (overwrite-unchanged-file case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/overwriteFile/PROPFIND/remote.php/dav/files/admin/Readme.md/Headers.txt | Fixture: PROPFIND headers (overwrite-file case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/overwriteFile/PROPFIND/remote.php/dav/files/admin/Readme.md/Body.xml | Fixture: PROPFIND body (overwrite-file case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/overwriteFile/GET/remote.php/dav/files/admin/Readme.md/Headers.txt | Fixture: GET headers (overwrite-file case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/overwriteFile/GET/remote.php/dav/files/admin/Readme.md/Body.bin | Fixture: GET body (overwrite-file case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/overwriteDirectoryPreservesExistingRemoteItems/PROPFIND/remote.php/dav/files/admin/Documents/Headers.txt | Fixture: PROPFIND headers (preserve-existing-remote-items case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/overwriteDirectoryPreservesExistingRemoteItems/PROPFIND/remote.php/dav/files/admin/Documents/Body.xml | Fixture: PROPFIND body (preserve-existing-remote-items case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/overwriteDirectoryPreservesExistingRemoteItems/GET/remote.php/dav/files/admin/Documents/Example.md/Headers.txt | Fixture: GET headers (preserve-existing-remote-items case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/overwriteDirectoryPreservesExistingRemoteItems/GET/remote.php/dav/files/admin/Documents/Example.md/Body.bin | Fixture: GET body (preserve-existing-remote-items case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/overwriteDirectory/PROPFIND/remote.php/dav/files/admin/Documents/Headers.txt | Fixture: PROPFIND headers (overwrite-directory case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/overwriteDirectory/PROPFIND/remote.php/dav/files/admin/Documents/Body.xml | Fixture: PROPFIND body (overwrite-directory case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/overwriteDirectory/GET/remote.php/dav/files/admin/Documents/Example.md/Headers.txt | Fixture: GET headers (overwrite-directory case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/overwriteDirectory/GET/remote.php/dav/files/admin/Documents/Example.md/Body.bin | Fixture: GET body (overwrite-directory case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/file/PROPFIND/remote.php/dav/files/admin/Readme.md/Headers.txt | Fixture: PROPFIND headers (download file case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/file/PROPFIND/remote.php/dav/files/admin/Readme.md/Body.xml | Fixture: PROPFIND body (download file case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/file/GET/remote.php/dav/files/admin/Readme.md/Headers.txt | Fixture: GET headers (download file case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/file/GET/remote.php/dav/files/admin/Readme.md/Body.bin | Fixture: GET body (download file case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/directory/PROPFIND/remote.php/dav/files/admin/Documents/Headers.txt | Fixture: PROPFIND headers (download directory case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/directory/PROPFIND/remote.php/dav/files/admin/Documents/Body.xml | Fixture: PROPFIND body (download directory case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/directory/GET/remote.php/dav/files/admin/Documents/Example.md/Headers.txt | Fixture: GET headers (download directory case). |
| Tests/RainmakerTests/Responses/31.0.12/DownloadTests/directory/GET/remote.php/dav/files/admin/Documents/Example.md/Body.bin | Fixture: GET body (download directory case). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This is required to leave the test names intact because they are the base to resolve fixtures from the test bundle resources.
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.
Closes #2