juergbi commented on code in PR #1922:
URL: https://github.com/apache/buildstream/pull/1922#discussion_r1639371875


##########
src/buildstream/_cas/casremote.py:
##########
@@ -59,18 +59,7 @@ def _configure_protocols(self):
 
         local_cas = self.cascache.get_local_cas()
         request = local_cas_pb2.GetInstanceNameForRemotesRequest()
-        cas_endpoint = request.content_addressable_storage
-        cas_endpoint.url = self.spec.url
-        if self.spec.instance_name:
-            cas_endpoint.instance_name = self.spec.instance_name
-        if self.spec.server_cert:
-            cas_endpoint.server_cert = self.spec.server_cert
-        if self.spec.client_key:
-            cas_endpoint.client_key = self.spec.client_key
-        if self.spec.client_cert:
-            cas_endpoint.client_cert = self.spec.client_cert
-        if self.spec.keepalive_time is not None:
-            cas_endpoint.keepalive_time.FromSeconds(self.spec.keepalive_time)
+        
request.content_addressable_storage.CopyFrom(self.spec.to_localcas_remote())

Review Comment:
   I'm not sure either what's more idiomatic but your suggestion sounds 
reasonable to me and it avoids the need for `CopyFrom()`. I've updated the 
branch accordingly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to