Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 63 additions & 52 deletions common/messages.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions common/messages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ message Service {
string upstream_ssh_type = 10;
map<string, string> tags = 11;
repeated IPAddressWithMetadata public_ips = 12;
string display_name = 13;
}
Comment on lines +114 to 115
Copy link

Choose a reason for hiding this comment

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

💡 Verification agent

❓ Verification inconclusive

optional keyword missing – current field has no presence tracking

The PR description and AI summary both state that display_name should be an optional field.
In proto3, presence tracking for singular scalars (so that you can tell unset vs empty string) is only available when the field is declared with the optional keyword:

optional string display_name = 13;

Declaring it without optional (as in the current diff) turns it into a regular scalar with no presence information; clients cannot distinguish "" from not provided, which is often undesirable for UI-facing “display name” semantics.

-  string display_name = 13;
+  optional string display_name = 13;

Confirm that all language targets used in your tool-chain are on protobuf ≥ 3.15 (released 2020-12) where optional is supported; otherwise code-gen will fail.


Add optional to display_name for presence tracking

The display_name field in common/messages.proto needs the optional keyword so that clients can distinguish “unset” from an empty string. Without it, proto3 treats the field as a regular scalar with no presence information.

File: common/messages.proto (around line 114)

Suggested change:

-  string display_name = 13;
+  optional string display_name = 13;

• After updating, ensure your proto compiler and all language generators are using protobuf >= 3.15 (optional fields were introduced in v3.15.0) to avoid code-gen failures.

🤖 Prompt for AI Agents
In common/messages.proto around line 114, the string field display_name lacks
the optional keyword, which is needed for presence tracking to distinguish unset
from empty string values. Modify the field declaration to include the optional
keyword before string, making it "optional string display_name = 13;". After
this change, verify that the protobuf compiler and all language generators used
are version 3.15 or higher to support optional fields and prevent code
generation errors.


message IPAddressWithMetadata {
Expand Down
17 changes: 17 additions & 0 deletions gen/kotlin/border0/common/v1/ServiceKt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,23 @@ public object ServiceKt {
_builder.clearPublicIps()
}


/**
* <code>string display_name = 13;</code>
*/
public var displayName: kotlin.String
@JvmName("getDisplayName")
get() = _builder.getDisplayName()
@JvmName("setDisplayName")
set(value) {
_builder.setDisplayName(value)
}
/**
* <code>string display_name = 13;</code>
*/
public fun clearDisplayName() {
_builder.clearDisplayName()
}
}
}
@kotlin.jvm.JvmSynthetic
Expand Down
9 changes: 8 additions & 1 deletion gen/swift/messages.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ struct Border0_Common_V1_Service: Sendable {

var publicIps: [Border0_Common_V1_IPAddressWithMetadata] = []

var displayName: String = String()

var unknownFields = SwiftProtobuf.UnknownStorage()

init() {}
Expand Down Expand Up @@ -1031,7 +1033,7 @@ extension Border0_Common_V1_WireGuardPeer: SwiftProtobuf.Message, SwiftProtobuf.

extension Border0_Common_V1_Service: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".Service"
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}name\0\u{1}type\0\u{1}ipv4\0\u{1}ipv6\0\u{3}subnet_routes\0\u{3}dns_name\0\u{3}upstream_type\0\u{3}upstream_port\0\u{3}has_upstream_username\0\u{3}upstream_ssh_type\0\u{1}tags\0\u{3}public_ips\0")
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}name\0\u{1}type\0\u{1}ipv4\0\u{1}ipv6\0\u{3}subnet_routes\0\u{3}dns_name\0\u{3}upstream_type\0\u{3}upstream_port\0\u{3}has_upstream_username\0\u{3}upstream_ssh_type\0\u{1}tags\0\u{3}public_ips\0\u{3}display_name\0")

mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
while let fieldNumber = try decoder.nextFieldNumber() {
Expand All @@ -1051,6 +1053,7 @@ extension Border0_Common_V1_Service: SwiftProtobuf.Message, SwiftProtobuf._Messa
case 10: try { try decoder.decodeSingularStringField(value: &self.upstreamSshType) }()
case 11: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMap<SwiftProtobuf.ProtobufString,SwiftProtobuf.ProtobufString>.self, value: &self.tags) }()
case 12: try { try decoder.decodeRepeatedMessageField(value: &self.publicIps) }()
case 13: try { try decoder.decodeSingularStringField(value: &self.displayName) }()
default: break
}
}
Expand Down Expand Up @@ -1093,6 +1096,9 @@ extension Border0_Common_V1_Service: SwiftProtobuf.Message, SwiftProtobuf._Messa
if !self.publicIps.isEmpty {
try visitor.visitRepeatedMessageField(value: self.publicIps, fieldNumber: 12)
}
if !self.displayName.isEmpty {
try visitor.visitSingularStringField(value: self.displayName, fieldNumber: 13)
}
try unknownFields.traverse(visitor: &visitor)
}

Expand All @@ -1109,6 +1115,7 @@ extension Border0_Common_V1_Service: SwiftProtobuf.Message, SwiftProtobuf._Messa
if lhs.upstreamSshType != rhs.upstreamSshType {return false}
if lhs.tags != rhs.tags {return false}
if lhs.publicIps != rhs.publicIps {return false}
if lhs.displayName != rhs.displayName {return false}
if lhs.unknownFields != rhs.unknownFields {return false}
return true
}
Expand Down