Skip to content

Conversation

@btoonk
Copy link
Contributor

@btoonk btoonk commented Oct 1, 2024

Summary by CodeRabbit

  • New Features

    • Introduced new message types for peer-to-peer communication, including DiscoveryDetailsMessage, HeartbeatMessage, PeerOnlineMessage, and others.
    • Added a field to indicate private network functionality in the configuration settings.
  • Bug Fixes

    • Improved Docker container access by updating volume mounts for broader project file access.
    • Corrected the return type of the ControlStream RPC method for better functionality.
  • Chores

    • Updated the Protocol Buffers compiler command to reflect changes in directory structure for protocol files.

@coderabbitai
Copy link

coderabbitai bot commented Oct 1, 2024

Walkthrough

The pull request introduces changes across multiple files, primarily focusing on the Makefile, common/messages.proto, connector.proto, and device.proto. The Makefile updates the Docker run command to include a new volume mount for the common directory. In common/messages.proto, several new message types are defined for peer-to-peer communication. The connector.proto file sees updates to existing message definitions and the addition of new fields. The device.proto file undergoes field renaming and the removal of certain message definitions to streamline the structure.

Changes

File(s) Change Summary
Makefile Updated docker-run target to mount $(PWD)/common to /app/shared/common alongside existing mounts.
common/messages.proto Introduced new message types: DiscoveryDetailsMessage, HeartbeatMessage, PeerOnlineMessage, PeerOfflineMessage, NetworkStateMessage, WireGuardPeer, and DisconnectMessage; added DisconnectionReason enum.
connector/connector.proto Added import for common/messages.proto; introduced new fields in ControlStreamRequest and ControlStreamResponse; corrected return type of ControlStream method; updated ConnectorConfig to include private_network_enabled.
device/device.proto Added import for common/messages.proto; renamed fields in DeviceToServerMessage and ServerToDeviceMessage to snake_case; removed several message definitions.

Possibly related PRs

Suggested reviewers

  • pedroandrade
  • th3wingman
  • waltzofpearls

Poem

🐇 In the meadow where code does bloom,
A rabbit hops with joy, dispelling gloom.
New messages dance, and fields take flight,
Docker's embrace makes the project bright.
With paths now clear, we leap and play,
Celebrating changes, hip-hip-hooray! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 6ec39dd and 96b3c09.

📒 Files selected for processing (1)
  • common/messages.proto (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • common/messages.proto

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Outside diff range and nitpick comments (2)
Makefile (1)

Line range hint 1-20: Suggestions for Makefile improvements

While the current Makefile structure is functional, consider the following improvements for better maintainability and adherence to Makefile best practices:

  1. Add a .PHONY declaration for non-file targets to avoid conflicts with similarly named files and improve performance:
.PHONY: all docker-run docker-build
  1. Consider adding a clean target to remove generated files:
clean:
    rm -rf $(COMPONENTS:=/*.pb.go)

.PHONY: clean
  1. For better organization, consider grouping related variables together, e.g., all version-related variables at the top of the file.

These suggestions will enhance the Makefile's robustness and maintainability.

connector/connector.proto (1)

Line range hint 28-31: Correct misspellings of "Certificate" in message and field names

There are multiple instances where "Certificate" is misspelled as "Certifcate" in message and field names:

  • At line 28: SshCertifcateSignRequest ssh_certificate_sign_request = 10; should be SshCertificateSignRequest ssh_certificate_sign_request = 10;
  • At line 30: CertifcateSignRequest certifcate_sign_request = 12; should be CertificateSignRequest certificate_sign_request = 12;
  • At line 64: message SshCertifcateSignRequest { should be message SshCertificateSignRequest {
  • At line 68: message SshCertifcateSignResponse { should be message SshCertificateSignResponse {
  • At line 78: message CertifcateSignRequest { should be message CertificateSignRequest {
  • At line 83: message CertifcateSignResponse { should be message CertificateSignResponse {

Apply these diffs to correct the misspellings:

 // In ControlStreamRequest
     SshCertifcateSignRequest ssh_certificate_sign_request = 10;
     UploadRecording upload_recording = 11;
-    CertifcateSignRequest certifcate_sign_request = 12;
+    CertificateSignRequest certificate_sign_request = 12;

 // Message definitions
-message SshCertifcateSignRequest {
+message SshCertificateSignRequest {
     string request_id = 1;
     string socket_id = 2;
     string session_key = 3;
     string user_email = 4;
     bytes public_key = 5;
     bytes ticket = 6;
 }

-message SshCertifcateSignResponse {
+message SshCertificateSignResponse {
     string request_id = 1;
     bytes certificate = 2;
 }

-message CertifcateSignRequest {
+message CertificateSignRequest {
     string request_id = 1;
     bytes certificate_signing_request = 2;
 }

-message CertifcateSignResponse {
+message CertificateSignResponse {
     string request_id = 1;
     bytes certificate = 2;
 }

Also, update any references to these messages and field names throughout the file.

Also applies to: 64-68, 78-79, 83-84

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 155f3f0 and 2ce65b4.

⛔ Files ignored due to path filters (1)
  • connector/connector.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (3)
  • Makefile (1 hunks)
  • connector/connector.proto (5 hunks)
  • generate.sh (1 hunks)
🔇 Additional comments (4)
generate.sh (1)

3-3: ⚠️ Potential issue

Verify directory structure and resolve path inconsistencies

The change from -I/app/proto to --proto_path=/app/protos suggests a directory structure change. However, there's an inconsistency in the paths used within the command:

  1. The new proto path is set to /app/protos
  2. The output paths and wildcard still use /app/proto

This inconsistency could lead to errors in the protocol buffer compilation process.

Please verify the correct directory structure and update the paths consistently. If /app/protos is the new correct path, consider updating the command as follows:

-protoc -I/app/proto --proto_path=/app/protos --go_out=paths=source_relative:/app/proto --go-grpc_out=paths=source_relative:/app/proto /app/proto/*.proto
+protoc --proto_path=/app/protos --go_out=paths=source_relative:/app/protos --go-grpc_out=paths=source_relative:/app/protos /app/protos/*.proto

To verify the directory structure, you can run the following script:

This script will help determine which directory actually contains the .proto files and ensure that the paths in the protoc command are correct.

Makefile (1)

15-15: Expanded Docker volume mounts for broader file access

The changes to the docker-run target expand the volume mounts in the Docker run command. This modification allows for broader access to project files within the Docker container while maintaining the specific component directory mount.

Pros:

  1. Provides access to the entire project directory, which may be necessary for certain build or generation processes.
  2. Maintains backwards compatibility by keeping the specific component directory mount.

Considerations:

  1. Ensure that mounting the entire project directory doesn't expose sensitive information or unnecessary files to the Docker container.
  2. Verify that the expanded access doesn't introduce any unintended side effects in the build process.

To ensure the changes don't introduce any issues, please run the following verification:

connector/connector.proto (2)

12-12: Import statement for device.proto added correctly

The import statement for device/device.proto is correctly added to include the device-related message definitions required for the new fields.


149-149: Addition of private_network_enabled field to ConnectorConfig

The boolean field private_network_enabled is correctly added to the ConnectorConfig message.

Comment on lines 246 to 252

message DiscoveryDetailsMessage {
bool discoverable = 1; // whether the peer should be returned along with the networks its in
string endpoint_public_udp4 = 2; // the endpoint (IPv4 + port) to send packets to for the peer
string endpoint_public_udp6 = 3; // the endpoint (IPv6 + port) to send packets to for the peer
string public_key = 4; // the public key of the peer
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider renaming fields in DiscoveryDetailsMessage for clarity

In the DiscoveryDetailsMessage, consider renaming the fields endpoint_public_udp4 and endpoint_public_udp6 to public_udp4_endpoint and public_udp6_endpoint for better clarity and consistency with public_key.

Apply this diff to rename the fields:

 message DiscoveryDetailsMessage {
     bool discoverable = 1;           // whether the peer should be returned along with the networks it's in
-    string endpoint_public_udp4 = 2; // the endpoint (IPv4 + port) to send packets to for the peer
-    string endpoint_public_udp6 = 3; // the endpoint (IPv6 + port) to send packets to for the peer
+    string public_udp4_endpoint = 2; // the endpoint (IPv4 + port) to send packets to for the peer
+    string public_udp6_endpoint = 3; // the endpoint (IPv6 + port) to send packets to for the peer
     string public_key = 4;           // the public key of the peer
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
message DiscoveryDetailsMessage {
bool discoverable = 1; // whether the peer should be returned along with the networks its in
string endpoint_public_udp4 = 2; // the endpoint (IPv4 + port) to send packets to for the peer
string endpoint_public_udp6 = 3; // the endpoint (IPv6 + port) to send packets to for the peer
string public_key = 4; // the public key of the peer
}
message DiscoveryDetailsMessage {
bool discoverable = 1; // whether the peer should be returned along with the networks its in
string public_udp4_endpoint = 2; // the endpoint (IPv4 + port) to send packets to for the peer
string public_udp6_endpoint = 3; // the endpoint (IPv6 + port) to send packets to for the peer
string public_key = 4; // the public key of the peer
}

UploadRecording upload_recording = 11;
CertifcateSignRequest certifcate_sign_request = 12;
SessionEvent session_event = 13;
DiscoveryDetailsMessage discoveryDetailsMessage = 14;
Copy link

@coderabbitai coderabbitai bot Oct 1, 2024

Choose a reason for hiding this comment

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

⚠️ Potential issue

Use consistent naming convention for field discoveryDetailsMessage

The field discoveryDetailsMessage in ControlStreamRequest uses camelCase. Other fields in the message use snake_case. For consistency, consider renaming it to discovery_details_message.

Apply this diff to fix the inconsistency:

         SessionEvent session_event = 13;
-        DiscoveryDetailsMessage discoveryDetailsMessage = 14;
+        DiscoveryDetailsMessage discovery_details_message = 14;
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
DiscoveryDetailsMessage discoveryDetailsMessage = 14;
SessionEvent session_event = 13;
DiscoveryDetailsMessage discovery_details_message = 14;

Copy link
Contributor

Choose a reason for hiding this comment

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

This is a good comment.

Copy link

Choose a reason for hiding this comment

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

@adrianosela, glad to hear that you found my comment helpful!

(^_^)/

DiscoveryDetailsMessage discoveryDetailsMessage = 14;
}
}

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Correct misspelling of message name ControlStreamReponse

The message name ControlStreamReponse is misspelled. It should be ControlStreamResponse.

Apply this diff to fix the typo:

-message ControlStreamReponse {
+message ControlStreamResponse {
     oneof RequestType {
         Init init = 1;
         ConnectorConfig connector_config = 2;

Also, update any references to this message throughout the file.

Committable suggestion was skipped due to low confidence.

Comment on lines 49 to 52
border0.device.v1.NetworkStateMessage network_state_message = 12;
border0.device.v1.PeerOnlineMessage peerOnlineMessage = 13;
border0.device.v1.PeerOfflineMessage peerOfflineMessage = 14;
border0.device.v1.DisconnectMessage disconnectMessage = 15;
Copy link

@coderabbitai coderabbitai bot Oct 1, 2024

Choose a reason for hiding this comment

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

⚠️ Potential issue

Ensure consistent naming conventions for field names

Fields peerOnlineMessage, peerOfflineMessage, and disconnectMessage in ControlStreamResponse use camelCase, while other fields use snake_case. For consistency, consider renaming them to peer_online_message, peer_offline_message, and disconnect_message.

Apply this diff to fix the inconsistency:

         CertifcateSignResponse certifcate_sign_response = 11;
-        border0.device.v1.NetworkStateMessage network_state_message = 12;
-        border0.device.v1.PeerOnlineMessage peerOnlineMessage = 13;
-        border0.device.v1.PeerOfflineMessage peerOfflineMessage = 14;
-        border0.device.v1.DisconnectMessage disconnectMessage = 15;
+        border0.device.v1.NetworkStateMessage network_state_message = 12;
+        border0.device.v1.PeerOnlineMessage peer_online_message = 13;
+        border0.device.v1.PeerOfflineMessage peer_offline_message = 14;
+        border0.device.v1.DisconnectMessage disconnect_message = 15;
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
border0.device.v1.NetworkStateMessage network_state_message = 12;
border0.device.v1.PeerOnlineMessage peerOnlineMessage = 13;
border0.device.v1.PeerOfflineMessage peerOfflineMessage = 14;
border0.device.v1.DisconnectMessage disconnectMessage = 15;
border0.device.v1.NetworkStateMessage network_state_message = 12;
border0.device.v1.PeerOnlineMessage peer_online_message = 13;
border0.device.v1.PeerOfflineMessage peer_offline_message = 14;
border0.device.v1.DisconnectMessage disconnect_message = 15;

Copy link
Contributor

Choose a reason for hiding this comment

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

good comment.

Copy link

Choose a reason for hiding this comment

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

@adrianosela, thank you! I'm glad you found my comment helpful.

(_/)
(^_^)

Copy link
Contributor

@adrianosela adrianosela left a comment

Choose a reason for hiding this comment

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

I think we should make a new package for the device types and import it in both the connector and device packages. Otherwise its too easy to forget that connector imports it and accidentally make breaking changes? Maybe not since you would see the diff -- but i think its better.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (1)
connector/connector.proto (1)

Line range hint 215-241: Correct misspelling of 'Certificate' in message and field names

The term "Certificate" is misspelled as "Certifcate" in several message and field names. Please correct the spelling in the following instances:

  • SshCertifcateSignRequestSshCertificateSignRequest
  • SshCertifcateSignResponseSshCertificateSignResponse
  • CertifcateSignRequestCertificateSignRequest
  • CertifcateSignResponseCertificateSignResponse
  • Field names such as ssh_certificate_sign_request, ssh_certificate_sign_response, certifcate_sign_request, and certifcate_sign_response should also be updated accordingly.

Apply this diff to fix the typos and update references:

 message ControlStreamRequest {
   oneof RequestType {
     Config config = 1;
     border0.common.v1.HeartbeatMessage heartbeat = 2;
     PluginDiscoveryResults plugin_discovery_results = 3;
     TunnelCertificateSignRequest tunnel_certificate_sign_request = 5;
     Log log = 6;
     ConnectorMetadata metadata = 7;
     AuthorizeRequest authorize = 8;
     SessionUpdateRequest session_update = 9;
-    SshCertifcateSignRequest ssh_certificate_sign_request = 10;
+    SshCertificateSignRequest ssh_certificate_sign_request = 10;
     UploadRecording upload_recording = 11;
-    CertifcateSignRequest certifcate_sign_request = 12;
+    CertificateSignRequest certificate_sign_request = 12;
     SessionEvent session_event = 13;
     border0.common.v1.DiscoveryDetailsMessage discovery_details = 14;
   }
 }

 message ControlStreamResponse {
   oneof RequestType {
     Init init = 1;
     ConnectorConfig connector_config = 2;
     UpdateConfig update_config = 3;
     border0.common.v1.HeartbeatMessage heartbeat = 4;
     TunnelCertificateSignResponse tunnel_certificate_sign_response = 5;
     Discover discover = 6;
     Stop stop = 7;
     Disconnect disconnect = 8;
     AuthorizeResponse authorize = 9;
-    SshCertifcateSignResponse ssh_certificate_sign_response = 10;
+    SshCertificateSignResponse ssh_certificate_sign_response = 10;
-    CertifcateSignResponse certifcate_sign_response = 11;
+    CertificateSignResponse certificate_sign_response = 11;
     border0.common.v1.NetworkStateMessage network_state = 12;
     border0.common.v1.PeerOnlineMessage peer_online = 13;
     border0.common.v1.PeerOfflineMessage peer_offline = 14;
   }
 }

-message SshCertifcateSignRequest {
+message SshCertificateSignRequest {
   string request_id = 1;
   string socket_id = 2;
   string session_key = 3;
   string user_email = 4;
   bytes public_key = 5;
   bytes ticket = 6;
 }

-message SshCertifcateSignResponse {
+message SshCertificateSignResponse {
   string request_id = 1;
   bytes certificate = 2;
 }

-message CertifcateSignRequest {
+message CertificateSignRequest {
   string request_id = 1;
   bytes certificate_signing_request = 2;
 }

-message CertifcateSignResponse {
+message CertificateSignResponse {
   string request_id = 1;
   bytes certificate = 2;
 }

This correction ensures consistency and prevents potential confusion or errors arising from the misspelled term.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 2ce65b4 and ad4c77f.

⛔ Files ignored due to path filters (3)
  • connector/connector.pb.go is excluded by !**/*.pb.go
  • connector/connector_grpc.pb.go is excluded by !**/*.pb.go
  • device/device.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (4)
  • Makefile (1 hunks)
  • connector/connector.proto (4 hunks)
  • device/device.proto (2 hunks)
  • generate.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • Makefile
  • generate.sh
🔇 Additional comments (15)
device/device.proto (7)

10-11: Appropriate import of common messages.

The addition of import "common/messages.proto"; is appropriate to utilize shared message definitions, enhancing code modularity.


20-20: Field name updated to snake_case in DeviceToServerMessage.

Renaming authChallengeSolutionMessage to auth_challenge_solution improves consistency with protobuf naming conventions.


21-21: Reference to common DiscoveryDetailsMessage updated.

Updating to border0.common.v1.DiscoveryDetailsMessage correctly references the common message definition.


22-22: Reference to common HeartbeatMessage updated.

Changing to border0.common.v1.HeartbeatMessage ensures consistent use of the common heartbeat message.


29-29: Field name updated to snake_case in ServerToDeviceMessage.

Renaming authChallengeMessage to auth_challenge aligns with naming conventions.


30-34: References to common messages in ServerToDeviceMessage updated.

Using border0.common.v1 prefixed messages promotes consistency and reuse across the codebase.


20-22: Verify that all references to moved messages are updated and backward compatibility is maintained.

Moving message definitions to common/messages.proto and updating namespaces enhances modularity. However, please verify:

  • All references to these messages are updated throughout the codebase.
  • There are no issues with serialization/deserialization due to namespace changes.

Run the following script to find any remaining references to old messages:

Also applies to: 29-34

connector/connector.proto (8)

12-12: [Approved]

The addition of import "common/messages.proto"; is appropriate and ensures that common message definitions are available for use. This promotes reuse and consistency across the codebase.


15-15: Corrected RPC return type in ControlStream

The return type in the ControlStream RPC method has been corrected from ControlStreamReponse to ControlStreamResponse. This fixes the previous typo and aligns with the correct message definition.


21-21: Updated heartbeat field to use common message

Updating the heartbeat field in ControlStreamRequest to use border0.common.v1.HeartbeatMessage is appropriate. This change leverages the common heartbeat message, promoting consistency and reducing duplication.


32-32: Added discovery_details field to ControlStreamRequest

The addition of border0.common.v1.DiscoveryDetailsMessage discovery_details = 14; to ControlStreamRequest enhances the message with necessary discovery information. The field name follows the snake_case naming convention.


36-36: Defined ControlStreamResponse message

The introduction of the ControlStreamResponse message provides the necessary structure for responses in the control stream. This addition is well-defined and logically structured.


41-41: Updated heartbeat field in ControlStreamResponse

Updating the heartbeat field in ControlStreamResponse to use border0.common.v1.HeartbeatMessage ensures consistency with the request message and utilizes the common definition.


49-51: Added new fields to ControlStreamResponse for enhanced communication

The addition of the following fields enhances the capabilities of ControlStreamResponse:

  • border0.common.v1.NetworkStateMessage network_state = 12;
  • border0.common.v1.PeerOnlineMessage peer_online = 13;
  • border0.common.v1.PeerOfflineMessage peer_offline = 14;

These fields follow the snake_case naming convention and appropriately extend the message for improved status reporting.


145-145: Added private_network_enabled field to ConnectorConfig

Introducing bool private_network_enabled = 4; to ConnectorConfig is a logical extension that allows configuration of the private network feature. The field numbering is sequential and follows protobuf conventions.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (3)
common/messages.proto (3)

11-11: Typo in comment: Correct "its" to "it is"

In the comment on line 11, the phrase "the networks its in" should be "the networks it's in" or "the networks it is in" for clarity.


40-41: Consistency in capitalization of "WireGuard" in comments

In the comments on lines 40 and 41, "wireguard" should be capitalized as "WireGuard" for consistency.


44-45: Consistency in capitalization of abbreviations in comments

Please capitalize "udp", "ipv4", and "ipv6" as "UDP", "IPv4", and "IPv6" in the comments on lines 44 and 45 for consistency and clarity.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between ad4c77f and 6ec39dd.

⛔ Files ignored due to path filters (3)
  • common/messages.pb.go is excluded by !**/*.pb.go
  • connector/connector.pb.go is excluded by !**/*.pb.go
  • connector/connector_grpc.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (3)
  • Makefile (1 hunks)
  • common/messages.proto (1 hunks)
  • connector/connector.proto (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • Makefile
  • connector/connector.proto
🔇 Additional comments (2)
common/messages.proto (2)

1-9: Syntax and package definitions are correct

The syntax version, Go package option, and protobuf package are correctly specified.


10-55: Overall message definitions are appropriate

The message and enum definitions are well-structured, and field types and numbers are correctly assigned. The use of Protocol Buffers best practices is evident.


# add any components here after their directory has been created with .proto files
COMPONENTS:=connector device
COMPONENTS:=common connector device
Copy link
Contributor

Choose a reason for hiding this comment

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

don't need common here since its being mounted as a separate volume below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but we still need to built it to get the go code.

@@ -0,0 +1,55 @@
// sets the .proto file syntax version
Copy link
Contributor

Choose a reason for hiding this comment

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

device.proto more accurate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's not just devices (eg. there is also healtcheck).
otherwise we should split it up. For now I will keep it like this.

Copy link
Contributor

@adrianosela adrianosela left a comment

Choose a reason for hiding this comment

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

LGTM, some nit comments left.

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.

3 participants