Skip to content

Downloads#46

Merged
i2h3 merged 5 commits into
mainfrom
2-download
May 13, 2026
Merged

Downloads#46
i2h3 merged 5 commits into
mainfrom
2-download

Conversation

@i2h3
Copy link
Copy Markdown
Owner

@i2h3 i2h3 commented May 13, 2026

Closes #2

@i2h3 i2h3 added this to the 2.0.0 milestone May 13, 2026
@i2h3 i2h3 requested a review from Copilot May 13, 2026 08:04
@i2h3 i2h3 self-assigned this May 13, 2026
@i2h3 i2h3 added the enhancement New feature or request label May 13, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 corresponding rainmaker-cli info command.
  • 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.

Comment thread Sources/Rainmaker/Server.swift
Comment thread Sources/Rainmaker/Server.swift Outdated
Comment thread Sources/Rainmaker/Server.swift
Comment thread Sources/Rainmaker/Server.swift Outdated
Comment thread Sources/Rainmaker/Server.swift Outdated
Comment thread Sources/Rainmaker/Serving.swift
Comment thread Sources/Rainmaker/Serving.swift Outdated
Comment thread Tests/RainmakerTests/InfoTests.swift
Comment thread Tests/RainmakerTests/InfoTests.swift
Comment thread Sources/RainmakerCLI/Commands/Download.swift Outdated
This is required to leave the test names intact because they are the base to resolve fixtures from the test bundle resources.
@i2h3 i2h3 merged commit 4cfffce into main May 13, 2026
7 checks passed
@i2h3 i2h3 deleted the 2-download branch May 13, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Download

2 participants