Skip to content

Conversation

@Williangalvani
Copy link
Member

@Williangalvani Williangalvani commented Oct 30, 2025

WIP.
vibe coded.
needs a proper review by me before I waste anyone else's time

They do seem to work, though.

./core/tools/copy-services-to-remote.sh --host 192.168.15.5 --service ardupilot_manager

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 30, 2025

Reviewer's Guide

Introduce two new Bash CLI utilities under core/devtools to sync service directories between the local repository and a remote BlueOS Docker container using SSH, docker cp, and rsync, with robust argument parsing, logging, and cleanup.

Sequence diagram for pulling services from remote BlueOS container to local repo

sequenceDiagram
    actor User
    participant LocalScript as "pull-services-from-remote.sh"
    participant LocalRepo as "Local Services Dir"
    participant SSH as "SSH Connection"
    participant RemoteHost as "Remote Host (Pi)"
    participant Docker as "Docker Container (blueos-core)"
    User->>LocalScript: Run script with host/service args
    LocalScript->>LocalRepo: Check for uncommitted changes
    LocalScript->>SSH: Test SSH connection
    SSH->>RemoteHost: Connect
    LocalScript->>SSH: Check if container is running
    SSH->>Docker: Query container status
    LocalScript->>SSH: List available services in container
    SSH->>Docker: List /home/pi/services
    LocalScript->>SSH: docker cp service(s) to temp dir
    SSH->>Docker: Copy service(s) to /tmp
    LocalScript->>SSH: rsync service(s) from temp dir to local
    SSH->>LocalRepo: Transfer files
    LocalScript->>SSH: Cleanup temp dir
    User->>LocalScript: View success message and git status
Loading

Sequence diagram for copying services from local repo to remote BlueOS container

sequenceDiagram
    actor User
    participant LocalScript as "copy-services-to-remote.sh"
    participant LocalRepo as "Local Services Dir"
    participant SSH as "SSH Connection"
    participant RemoteHost as "Remote Host (Pi)"
    participant Docker as "Docker Container (blueos-core)"
    User->>LocalScript: Run script with host/service args
    LocalScript->>LocalRepo: Validate service(s) exist
    LocalScript->>SSH: Test SSH connection
    SSH->>RemoteHost: Connect
    LocalScript->>SSH: Check if container is running
    SSH->>Docker: Query container status
    LocalScript->>SSH: rsync service(s) to temp dir on remote
    LocalRepo->>SSH: Transfer files
    LocalScript->>SSH: docker cp service(s) from temp dir into container
    SSH->>Docker: Copy files into /home/pi/services
    LocalScript->>SSH: Cleanup temp dir
    User->>LocalScript: View success message and restart advice
Loading

File-Level Changes

Change Details Files
Add pull-services-from-remote.sh for fetching services from remote container
  • Implemented command-line parsing for user, host, and optional service
  • Added colored logging functions (info, success, warning, error)
  • Checked for git uncommitted changes and prompted before overwrite
  • Validated SSH key-based connection and container running status
  • Extracted services via docker cp into remote temp directory and synced to local via rsync
  • Set up trap for remote temp cleanup and displayed post-sync git status
core/devtools/pull-services-from-remote.sh
Add copy-services-to-remote.sh for pushing services to remote container
  • Implemented command-line parsing for user, host, and optional service
  • Added colored logging functions (info, success, warning, error)
  • Validated SSH key-based connection and container running status
  • Synced local services to remote temp directory via rsync
  • Copied files into container using docker cp and cleaned up temp directory with trap
  • Prompted user to restart services in container after copy
core/devtools/copy-services-to-remote.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@Williangalvani Williangalvani changed the title add tools for syncing files between local repo and remote blueos on the pi [WIP] add tools for syncing files between local repo and remote blueos on the pi Oct 30, 2025
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.

1 participant