Skip to content

feat(sync): add SFTP pull direction#634

Open
risu729 wants to merge 7 commits into
mainfrom
feat/sftp-pull-direction
Open

feat(sync): add SFTP pull direction#634
risu729 wants to merge 7 commits into
mainfrom
feat/sftp-pull-direction

Conversation

@risu729
Copy link
Copy Markdown
Owner

@risu729 risu729 commented May 16, 2026

Closes #413.

Summary

  • add biwa sync --pull for copying eligible remote-generated artifacts back into the local sync root
  • make pull non-destructive by default: only existing generated local files are updated unless --overwrite is passed
  • add --overwrite for explicit pull overwrites, local file deletion, remote-only file creation, and empty-directory mirroring
  • apply ignore/include/exclude filters to remote pull candidates and keep rejecting remote symlink entries
  • keep pull remote-state inspection read-only for existing remote directories while retaining push-side permission normalization
  • update sync behavior docs and generated CLI usage

Testing

  • LINT=true mise run check
  • cargo test ssh::sync::tests
  • cargo test --test ssh_e2e_sync e2e_sync_pull

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 16, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
biwa-docs 6997c61 Commit Preview URL

Branch Preview URL
May 18 2026, 06:49 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented May 16, 2026

Codecov Report

❌ Patch coverage is 64.20048% with 150 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.32%. Comparing base (7e848bd) to head (6997c61).
⚠️ Report is 278 commits behind head on main.

Files with missing lines Patch % Lines
src/ssh/sync.rs 65.93% 139 Missing ⚠️
src/cli/sync.rs 0.00% 11 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #634       +/-   ##
===========================================
+ Coverage   41.28%   51.32%   +10.04%     
===========================================
  Files          16       25        +9     
  Lines         671     2457     +1786     
===========================================
+ Hits          277     1261      +984     
- Misses        394     1196      +802     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a pull synchronization mode to biwa, enabling file transfers from a remote host to the local sync root. The changes include adding a --pull flag to the sync command, updating documentation, and implementing the core pull logic with safety guards against unsafe path traversal and symlink manipulation. Review feedback highlights opportunities to improve performance by using asynchronous file system operations and ensuring that local file and directory permissions remain consistent with the project's security policies (0700 for directories and 0600 for files). Additionally, there is a suggestion to refine how the tool handles local symlinks during the pull process to make the synchronization more robust.

Comment thread src/ssh/sync.rs Outdated
Comment thread src/ssh/sync.rs Outdated
Comment thread src/ssh/sync.rs Outdated
Comment thread src/ssh/sync.rs
@risu729 risu729 force-pushed the feat/sftp-pull-direction branch from 5c126fa to bdac444 Compare May 16, 2026 20:39
@risu729 risu729 marked this pull request as ready for review May 18, 2026 19:22
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.

feat(sync): SFTP pull direction (remote to local)

1 participant