damccorm commented on code in PR #37490:
URL: https://github.com/apache/beam/pull/37490#discussion_r2759636681


##########
sdks/python/apache_beam/runners/portability/sdk_container_builder.py:
##########
@@ -262,10 +262,11 @@ def _invoke_docker_build_and_push(self, 
container_image_name):
     build.steps.append(step)
 
     source = cloud_build_types.Source()
-    source.storageSource = cloud_build_types.StorageSource()
+    storage_source = cloud_build_types.StorageSource()
     gcs_bucket, gcs_object = self._get_gcs_bucket_and_name(gcs_location)
-    source.storageSource.bucket = os.path.join(gcs_bucket)
-    source.storageSource.object = gcs_object
+    storage_source.bucket = os.path.join(gcs_bucket)
+    storage_source.object_ = gcs_object
+    source.storage_source = storage_source

Review Comment:
   Do these changes have any impact? It seems like they're doing the same thing



##########
sdks/python/apache_beam/runners/portability/sdk_container_builder.py:
##########
@@ -325,16 +326,8 @@ def _upload_to_gcs(self, local_file_path, gcs_location):
     _LOGGER.info('Completed GCS upload to %s.', gcs_location)
 
   def _get_cloud_build_id_and_log_url(self, metadata):
-    id = None
-    log_url = None
-    for item in metadata.additionalProperties:
-      if item.key == 'build':
-        for field in item.value.object_value.properties:
-          if field.key == 'logUrl':
-            log_url = field.value.string_value
-          if field.key == 'id':
-            id = field.value.string_value
-    return id, log_url
+    build = metadata.build
+    return (build.id, build.log_url)

Review Comment:
   @jrmccluskey could you please take a look? (unclear to me if this is related 
to the migration, so feel free to ignore if you don't have extra insight)



##########
sdks/python/apache_beam/runners/portability/sdk_container_builder.py:
##########
@@ -325,16 +326,8 @@ def _upload_to_gcs(self, local_file_path, gcs_location):
     _LOGGER.info('Completed GCS upload to %s.', gcs_location)
 
   def _get_cloud_build_id_and_log_url(self, metadata):
-    id = None
-    log_url = None
-    for item in metadata.additionalProperties:
-      if item.key == 'build':
-        for field in item.value.object_value.properties:
-          if field.key == 'logUrl':
-            log_url = field.value.string_value
-          if field.key == 'id':
-            id = field.value.string_value
-    return id, log_url
+    build = metadata.build
+    return (build.id, build.log_url)

Review Comment:
   Is this always set? If not, we could check if this is set first, and then 
fall back to the previous logic if not.



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