Skip to content

Conversation

@joaoantoniocardoso
Copy link
Member

@joaoantoniocardoso joaoantoniocardoso commented Jun 6, 2025

This PR is just for us to keep track of what is needed to have Onvif working on BlueOS 1.4 (enabling the Radcam Manager extension):

  1. CableGuy's multicast API
  2. MCM >=t3.19.4

Summary by Sourcery

Enable full route management support in Cable-Guy by introducing a Route model, extending interface schemas and settings to include routes, and exposing CRUD endpoints for routes while updating dependencies to meet Onvif requirements on BlueOS 1.4

New Features:

  • Add Route model and route management methods in EthernetManager to handle route configuration
  • Introduce REST API endpoints (GET/POST/DELETE) for adding, removing, and retrieving interface routes
  • Extend NetworkInterface schema and migration to SettingsV2 to include persistent route support
  • Include shim definitions for IPvAnyAddress and IPvAnyNetwork to enable Pydantic v2 compatibility

Enhancements:

  • Upgrade PydanticManager initialization to use SettingsV2 and integrate route fields
  • Add default multicast route to the Cable-Guy service configuration

Build:

  • Bump mavlink-camera-manager version to t3.19.4 in bootstrap script

@sourcery-ai
Copy link

sourcery-ai bot commented Jun 6, 2025

Reviewer's Guide

This PR equips the CableGuy service with full route management support—defining a new Route model, extending the EthernetManager to sync OS routes, migrating settings to V2 with routes, exposing REST endpoints for route operations, adding a default multicast route in the config, and bumping the MCM dependency.

File-Level Changes

Change Details Files
Enhanced EthernetManager to support route synchronization and upgraded settings version
  • Switched PydanticManager to use SettingsV2 and updated settings property return type
  • Hooked a new _set_routes_configuration into set_configuration to diff and apply route changes
  • Implemented add_route, remove_route and _execute_route methods with iproute2 calls and error handling
  • Built get_routes, _parse_route and _normalize_gateway to fetch, parse and filter system routes
  • Updated get_interfaces and set_interfaces_priority to include routes in NetworkInterface data
core/services/cable_guy/api/manager.py
Defined a Pydantic Route model and extended network typedefs with IP shims
  • Added Route model with destination, gateway, priority and managed fields plus eq/hash
  • Extended NetworkInterface to include a routes list in its schema
  • Introduced IPvAnyAddress and IPvAnyNetwork shim types to bridge current pydantic version
  • Provided parsing properties on Route for destination_parsed and next_hop_parsed
core/services/cable_guy/typedefs.py
core/services/cable_guy/typedefs_pydantic_network_shin.py
Introduced SettingsV2 with routes support and migration logic
  • Created SettingsV2 subclass that extends SettingsV1 and updates VERSION
  • Changed content typing to include NetworkInterfaceV1 for v1 and NetworkInterface (with routes) for v2
  • Migrated existing settings to carry over default routes based on interface names
core/services/cable_guy/api/settings.py
Exposed new REST endpoints for route operations
  • Added POST /route for adding routes and DELETE /route for removal
  • Added GET /route to retrieve all routes (including unmanaged when requested)
  • Hooked endpoints into manager methods and persisted settings after changes
core/services/cable_guy/main.py
Updated default configuration and bootstrapping
  • Added a default multicast Route entry to DEFAULT_NETWORK_INTERFACES
  • Extended usb0 interface in config to include an empty routes list
  • Bumped mavlink-camera-manager bootstrap version from t3.19.2 to t3.19.4
core/services/cable_guy/config.py
core/tools/mavlink_camera_manager/bootstrap.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

@joaoantoniocardoso joaoantoniocardoso force-pushed the 1.4.2-patched-for-radcam branch from 31f0f4c to f043bf9 Compare August 8, 2025 17:33
@patrickelectric
Copy link
Member

@joaoantoniocardoso Can you list all PRs that were cherry-picked ?

@joaoantoniocardoso joaoantoniocardoso force-pushed the 1.4.2-patched-for-radcam branch from f043bf9 to 2308051 Compare August 8, 2025 18:36
@joaoantoniocardoso
Copy link
Member Author

joaoantoniocardoso commented Aug 8, 2025

@joaoantoniocardoso Can you list all PRs that were cherry-picked ?

I'll actually create all PRs soon. I'll be running this branch now to check if there's anything wrong meanwhile.

Here's the list (it's backwards):

@joaoantoniocardoso joaoantoniocardoso force-pushed the 1.4.2-patched-for-radcam branch from 2308051 to 49986a0 Compare August 8, 2025 18:46
@joaoantoniocardoso
Copy link
Member Author

joaoantoniocardoso commented Aug 22, 2025

No longer needed since we have the 1.4.3-beta going on

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.

5 participants