Skip to content

Conversation

@adrianosela
Copy link
Contributor

@adrianosela adrianosela commented Aug 14, 2025

[ME-4981] Add IsV2 Flag for Tunnel Cert Requests

Summary by CodeRabbit

  • New Features
    • Added an optional boolean field, is_v2, to the public TunnelCertificateSignRequest message. This field is non-breaking and preserves existing behavior when unset.
    • No other messages or services are modified, ensuring backward compatibility for existing clients.
    • Clients may begin sending the new flag as needed without impacting current integrations.

@coderabbitai
Copy link

coderabbitai bot commented Aug 14, 2025

Walkthrough

Adds a boolean field is_v2 (field number 4) to the TunnelCertificateSignRequest message in connector/connector.proto. No other messages or services are modified.

Changes

Cohort / File(s) Summary
Proto schema update
connector/connector.proto
Added field bool is_v2 = 4 to TunnelCertificateSignRequest; existing fields unchanged; no other schema elements modified.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A nibble of bits, a flag set true,
I twitch my ears—hello, v2!
In proto fields, I hop with glee,
One more burrow in the API.
Carrots compiled, requests aligned,
Ship it swift—tails intertwined. 🥕✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ME-4981_add_is_v2_flag_for_tunnel_cert_reqs

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.

@adrianosela adrianosela marked this pull request as ready for review August 15, 2025 02:02
@adrianosela adrianosela merged commit d4794c5 into main Aug 15, 2025
@adrianosela adrianosela deleted the ME-4981_add_is_v2_flag_for_tunnel_cert_reqs branch August 15, 2025 02:03
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

🧹 Nitpick comments (3)
connector/connector.proto (3)

72-72: Consider presence semantics: optional vs default false

If you need to distinguish “unset” from “explicitly false,” use presence. Two options:

  • Prefer: proto3 optional (requires protoc and language plugins >= 3.12).
  • Alternative: google.protobuf.BoolValue wrapper.

Suggested change (if presence is needed):

-  bool is_v2 = 4;
+  optional bool is_v2 = 4;

If your build toolchain doesn’t support proto3 optional across all consumers, use the wrapper type instead and add the import:

  • Field:
  • bool is_v2 = 4;
  • google.protobuf.BoolValue is_v2 = 4;
- Import (top of file):

import "google/protobuf/wrappers.proto";


---

`72-72`: **Document the intent and default behavior of is_v2**

A short comment makes the API clearer for downstream consumers and avoids guesswork.

```diff
-  bool is_v2 = 4;
+  // When true, request a v2-format tunnel certificate. Defaults to false for backward compatibility.
+  bool is_v2 = 4;

72-72: Future-proofing: use an enum for versioning instead of a boolean

If there’s any chance of a v3 (or variants), an enum avoids additive boolean flags (is_v3, is_v4, …) and scales better.

Minimal field change here:

-  bool is_v2 = 4;
+  TunnelCertVersion version = 4; // defaults to VERSION_V1 if unset

And define elsewhere in this file:

enum TunnelCertVersion {
  VERSION_UNSPECIFIED = 0; // Treat as V1 for backward compatibility
  VERSION_V1 = 1;
  VERSION_V2 = 2;
}

This keeps wire-compatibility and gives clear semantics going forward.

📜 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 c98d04f and cefcec8.

⛔ Files ignored due to path filters (3)
  • connector/connector.pb.go is excluded by !**/*.pb.go
  • gen/kotlin/border0/v1/TunnelCertificateSignRequestKt.kt is excluded by !**/gen/**
  • gen/swift/connector.pb.swift is excluded by !**/gen/**
📒 Files selected for processing (1)
  • connector/connector.proto (1 hunks)
🔇 Additional comments (2)
connector/connector.proto (2)

68-73: LGTM: backward-compatible field addition with a safe tag number

Adding bool is_v2 = 4; is wire-compatible (old clients ignore unknown fields). Tag 4 fills the next available slot in this message, which is ideal. No concerns with Go/JSON name mapping: it will generate IsV2 in Go and isV2 for JSON.


68-73: Stubs regenerated for Go/Kotlin/Swift — no downstream changes found

Generated stubs in this repo already include the new field and I found no non-generated consumers that need updates; the proto bool default is false when the field is absent.

  • Checked files showing the regen:
    • connector/connector.proto — TunnelCertificateSignRequest { bool is_v2 = 4; }
    • connector/connector.pb.go — TunnelCertificateSignRequest has IsV2 bool and GetIsV2()
    • gen/kotlin/border0/v1/TunnelCertificateSignRequestKt.kt — isV2 property with get/set/clear
    • gen/swift/connector.pb.swift — isV2 property and encode/decode handling
  • No non-generated code (consumers) found that construct or inspect is_v2.
  • No JSON/YAML/OpenAPI schemas referencing is_v2 were found in the repo.
  • Server default behavior: absent boolean fields default to false (generated getters return false when not set).

Action: none required in this repo. If you publish stubs for any other language targets not present here, regenerate those targets as well.

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