nathanwilliams-ct commented on code in PR #2174:
URL: https://github.com/apache/buildstream/pull/2174#discussion_r3795766970


##########
src/buildstream/_stream.py:
##########
@@ -844,7 +844,8 @@ def artifact_log(self, targets):
                 self._context.messenger.warn("{} is cached without log 
files".format(ref))
                 continue
 
-            artifact_logs[obj.name] = obj._get_logs()
+            name = ref if isinstance(obj, ArtifactElement) else 
obj._get_full_name()

Review Comment:
   Perhaps it would be better if ArtifactElement overrode the `_get_full_name` 
method or the `__full_name` variable, instead of having this awkward condition 
here?
   
   ```suggestion
               name = obj._get_full_name()
   ```
   
   In `ArtifactElement`
   ```python
   def _get_full_name(self)
      return self.ref
   ```



##########
src/buildstream/_stream.py:
##########
@@ -844,7 +844,8 @@ def artifact_log(self, targets):
                 self._context.messenger.warn("{} is cached without log 
files".format(ref))
                 continue
 
-            artifact_logs[obj.name] = obj._get_logs()
+            name = ref if isinstance(obj, ArtifactElement) else 
obj._get_full_name()

Review Comment:
   Perhaps it would be better if `ArtifactElement` overrode the 
`_get_full_name` method or the `__full_name` variable, instead of having this 
awkward condition here?
   
   ```suggestion
               name = obj._get_full_name()
   ```
   
   In `ArtifactElement`
   ```python
   def _get_full_name(self)
      return self.ref
   ```



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