Skip to content

Including go.work for project structure#26

Merged
r2unit merged 1 commit intodevelopfrom
refactor/work-env
Aug 25, 2025
Merged

Including go.work for project structure#26
r2unit merged 1 commit intodevelopfrom
refactor/work-env

Conversation

@r2unit
Copy link
Owner

@r2unit r2unit commented Aug 25, 2025

Summary by CodeRabbit

  • New Features

    • Introduced WebSocket-based configuration push for droids with live status/heartbeat and per-droid messaging.
    • Added a central droid hub to monitor connections, modes (PUSH/PULL), and maintenance state.
    • Droid creation now defaults ws_preferred to true if not provided.
  • Refactor

    • Migrated project module paths to a new namespace; behavior unchanged.
  • Chores

    • Added module descriptors for frontend and droid components.
    • Cleaned up Docker build file comments.
  • Database

    • Added/registered droids table migration including ws_preferred field (default enabled).

@coderabbitai
Copy link

coderabbitai bot commented Aug 25, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR relocates module/import paths to github.com/r2unit/holonet, introduces WebSocket-based droid config push with a central hub and DB field ws_preferred, adds droid/frontend submodules, updates the root module path, adjusts an internal import filter, and removes comments from the Dockerfile.

Changes

Cohort / File(s) Summary
Droid WS hub and API
pkg/api/droids.go, pkg/droid/hub.go, pkg/database/tables/droids_table.go, patches/0001-droids-add-ws_preferred-remote-WS-config-push-hub-Se.patch
Adds WS-driven droid config push and runtime hub; introduces ws_preferred column; WS handlers for hello/heartbeat/config.ack; default ws_preferred=true on create; new Hub types/methods and updated method signatures; migration/patch included.
Module path relocation
cmd/core/main.go, pkg/api/*, pkg/cache/hearthbeat.go, pkg/database/*, pkg/database/tables/*, pkg/git/git.go, pkg/netbox/*, pkg/queue/netbox_queue.go, pkg/web/web.go, pkg/websocket/websocket.go, pkg/workflow/*, pkg/workflow/connection/*, pkg/workflow/template/atlas_example.go
Updates imports from github.com/holonet/core/... to github.com/r2unit/holonet/pkg/.... No logic changes.
Module declarations
go.mod, droid/go.mod, frontend/go.mod
Root module path updated to github.com/r2unit/holonet; adds new Go modules for droid and frontend with Go 1.23.4.
Workflow internal import filter update
pkg/workflow/environment.go
Adjusts internal import prefix filters from github.com/holonet/core to github.com/r2unit/holonet.
Build/package housekeeping
build/package/dockerfile
Removes header and a comment line; no build-step changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant D as Droid Client
  participant API as API (Droid WS Endpoint)
  participant H as Droid Hub
  participant DB as Database

  D->>API: WS Connect (Authorization/X-Droid-Token)
  API->>DB: Validate token / fetch droid row (ws_preferred, zones, mode)
  API->>H: RegisterConnection(token, name, zones, mode, conn)
  API-->>D: config.update {name, zones, mode, ws_preferred}
  D-->>API: hello / config.ack
  API->>H: UpdateHeartbeat(token, metrics?, status?)
  H-->>API: Current state for token
  API-->>D: (optional) further messages via Hub
  note over H,API: Broadcast/SendToToken for targeted pushes
  D-->>API: heartbeat (periodic)
  API->>H: UpdateHeartbeat(token, metrics, status)
  D-x API: Disconnect
  API->>H: Disconnect(conn)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

A rabbit taps the webs with glee,
“Push the config! Let droids be free.”
A hub now hums, their hearts aligned,
Tokens masked, connections signed.
New paths hop to r2unit’s lane—
Carrots cached, all systems sane. 🥕🧩

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d3f3fcd and bf7120f.

⛔ Files ignored due to path filters (2)
  • go.sum is excluded by !**/*.sum
  • go.work is excluded by !**/*.work
📒 Files selected for processing (89)
  • build/package/dockerfile (0 hunks)
  • cmd/core/main.go (1 hunks)
  • droid/go.mod (1 hunks)
  • frontend/go.mod (1 hunks)
  • go.mod (1 hunks)
  • patches/0001-droids-add-ws_preferred-remote-WS-config-push-hub-Se.patch (0 hunks)
  • pkg/api/admin/action_handlers.go (1 hunks)
  • pkg/api/admin/cache.go (1 hunks)
  • pkg/api/admin/handlers.go (1 hunks)
  • pkg/api/admin/permissions.go (1 hunks)
  • pkg/api/api.go (1 hunks)
  • pkg/api/api_queue.go (1 hunks)
  • pkg/api/auth.go (1 hunks)
  • pkg/api/droids.go (6 hunks)
  • pkg/api/endpoints.go (1 hunks)
  • pkg/api/frontend_provision.go (1 hunks)
  • pkg/api/frontends_ws.go (1 hunks)
  • pkg/api/git_credentials.go (1 hunks)
  • pkg/api/handshake.go (1 hunks)
  • pkg/api/health_ws.go (1 hunks)
  • pkg/api/middleware.go (1 hunks)
  • pkg/api/netbox.go (1 hunks)
  • pkg/api/policy.go (1 hunks)
  • pkg/api/user_handlers.go (1 hunks)
  • pkg/api/users/action_handlers.go (1 hunks)
  • pkg/api/users/auth_handlers.go (1 hunks)
  • pkg/api/users/create.go (1 hunks)
  • pkg/api/users/delete.go (1 hunks)
  • pkg/api/users/groups.go (1 hunks)
  • pkg/api/users/handlers.go (1 hunks)
  • pkg/api/users/login.go (1 hunks)
  • pkg/api/users/logout.go (1 hunks)
  • pkg/api/users/permissions.go (1 hunks)
  • pkg/api/users/read.go (1 hunks)
  • pkg/api/users/refresh.go (1 hunks)
  • pkg/api/users/suspend.go (1 hunks)
  • pkg/api/users/update.go (1 hunks)
  • pkg/api/workflow.go (1 hunks)
  • pkg/api/workflow_containers.go (1 hunks)
  • pkg/api/ws.go (1 hunks)
  • pkg/cache/hearthbeat.go (1 hunks)
  • pkg/database/database.go (1 hunks)
  • pkg/database/device_credentials.go (1 hunks)
  • pkg/database/git_credentials.go (1 hunks)
  • pkg/database/heartbeat.go (1 hunks)
  • pkg/database/init_admin.go (1 hunks)
  • pkg/database/netbox_credentials.go (1 hunks)
  • pkg/database/tables/device_platform_table.go (1 hunks)
  • pkg/database/tables/device_role_table.go (1 hunks)
  • pkg/database/tables/devices_credentials_table.go (1 hunks)
  • pkg/database/tables/devices_table.go (1 hunks)
  • pkg/database/tables/droids_table.go (2 hunks)
  • pkg/database/tables/git_credentials_table.go (1 hunks)
  • pkg/database/tables/groups_table.go (1 hunks)
  • pkg/database/tables/jobs_table.go (1 hunks)
  • pkg/database/tables/logs_table.go (1 hunks)
  • pkg/database/tables/netbox_credentials_table.go (1 hunks)
  • pkg/database/tables/permissions_table..go (1 hunks)
  • pkg/database/tables/queue_table.go (1 hunks)
  • pkg/database/tables/refresh_tokens_table.go (1 hunks)
  • pkg/database/tables/tasks_table.go (1 hunks)
  • pkg/database/tables/token_policies_table.go (1 hunks)
  • pkg/database/tables/tokens_table.go (1 hunks)
  • pkg/database/tables/user_groups_table.go (1 hunks)
  • pkg/database/tables/users_table.go (1 hunks)
  • pkg/database/tables/workflows_table.go (1 hunks)
  • pkg/droid/hub.go (8 hunks)
  • pkg/git/git.go (1 hunks)
  • pkg/netbox/atlas.go (1 hunks)
  • pkg/netbox/config.go (1 hunks)
  • pkg/netbox/devices.go (1 hunks)
  • pkg/netbox/gatekeeper.go (1 hunks)
  • pkg/netbox/heartbeat.go (1 hunks)
  • pkg/netbox/init_dummy.go (1 hunks)
  • pkg/netbox/init_netbox.go (1 hunks)
  • pkg/netbox/netbox.go (1 hunks)
  • pkg/queue/netbox_queue.go (1 hunks)
  • pkg/web/web.go (1 hunks)
  • pkg/websocket/websocket.go (1 hunks)
  • pkg/workflow/connection/manager.go (1 hunks)
  • pkg/workflow/connection/netconf.go (1 hunks)
  • pkg/workflow/connection/ssh.go (1 hunks)
  • pkg/workflow/device_connector.go (1 hunks)
  • pkg/workflow/device_verifier.go (1 hunks)
  • pkg/workflow/environment.go (2 hunks)
  • pkg/workflow/executor.go (1 hunks)
  • pkg/workflow/maintenance_history.go (1 hunks)
  • pkg/workflow/template/atlas_example.go (1 hunks)
  • pkg/workflow/workflow.go (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/work-env

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@r2unit r2unit merged commit d80f0ec into develop Aug 25, 2025
5 of 6 checks passed
@r2unit r2unit deleted the refactor/work-env branch August 25, 2025 10:33
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