[Notes] [Git][BuildStream/buildstream][Qinusty/skipped-rework-backport-1.2] 2 commits: cascache.py: Move push/pull messaging to cascache



Title: GitLab

Qinusty pushed to branch Qinusty/skipped-rework-backport-1.2 at BuildStream / buildstream

Commits:

3 changed files:

Changes:

  • buildstream/_artifactcache/cascache.py
    ... ... @@ -225,8 +225,8 @@ class CASCache(ArtifactCache):
    225 225
             for remote in self._remotes[project]:
    
    226 226
                 try:
    
    227 227
                     remote.init()
    
    228
    -
    
    229
    -                element.info("Pulling {} <- {}".format(element._get_brief_display_key(), remote.spec.url))
    
    228
    +                display_key = element._get_brief_display_key()
    
    229
    +                element.status("Pulling artifact {} <- {}".format(display_key, remote.spec.url))
    
    230 230
     
    
    231 231
                     request = buildstream_pb2.GetReferenceRequest()
    
    232 232
                     request.key = ref
    
    ... ... @@ -240,6 +240,7 @@ class CASCache(ArtifactCache):
    240 240
     
    
    241 241
                     self.set_ref(ref, tree)
    
    242 242
     
    
    243
    +                element.info("Pulled artifact {} <- {}".format(display_key, remote.spec.url))
    
    243 244
                     # no need to pull from additional remotes
    
    244 245
                     return True
    
    245 246
     
    
    ... ... @@ -248,11 +249,8 @@ class CASCache(ArtifactCache):
    248 249
                         raise ArtifactError("Failed to pull artifact {}: {}".format(
    
    249 250
                             element._get_brief_display_key(), e)) from e
    
    250 251
                     else:
    
    251
    -                    self.context.message(Message(
    
    252
    -                        None,
    
    253
    -                        MessageType.INFO,
    
    254
    -                        "Remote ({}) does not have {} cached".format(
    
    255
    -                            remote.spec.url, element._get_brief_display_key())
    
    252
    +                    element.info("Remote ({}) does not have {} cached".format(
    
    253
    +                        remote.spec.url, element._get_brief_display_key()
    
    256 254
                         ))
    
    257 255
     
    
    258 256
             return False
    
    ... ... @@ -273,11 +271,11 @@ class CASCache(ArtifactCache):
    273 271
             push_remotes = [r for r in self._remotes[project] if r.spec.push]
    
    274 272
     
    
    275 273
             pushed = False
    
    276
    -
    
    274
    +        display_key = element._get_brief_display_key()
    
    277 275
             for remote in push_remotes:
    
    278 276
                 remote.init()
    
    279 277
                 skipped_remote = True
    
    280
    -            element.info("Pushing {} -> {}".format(element._get_brief_display_key(), remote.spec.url))
    
    278
    +            element.status("Pushing artifact {} -> {}".format(display_key, remote.spec.url))
    
    281 279
     
    
    282 280
                 try:
    
    283 281
                     for ref in refs:
    
    ... ... @@ -354,6 +352,9 @@ class CASCache(ArtifactCache):
    354 352
     
    
    355 353
                         pushed = True
    
    356 354
     
    
    355
    +                if not skipped_remote:
    
    356
    +                    element.info("Pushed artifact {} -> {}".format(display_key, remote.spec.url))
    
    357
    +
    
    357 358
                 except grpc.RpcError as e:
    
    358 359
                     if e.code() != grpc.StatusCode.RESOURCE_EXHAUSTED:
    
    359 360
                         raise ArtifactError("Failed to push artifact {}: {}".format(refs, e), temporary=True) from e
    

  • buildstream/element.py
    ... ... @@ -1672,8 +1672,6 @@ class Element(Plugin):
    1672 1672
                 return False
    
    1673 1673
     
    
    1674 1674
             # Notify successfull download
    
    1675
    -        display_key = self._get_brief_display_key()
    
    1676
    -        self.info("Downloaded artifact {}".format(display_key))
    
    1677 1675
             return True
    
    1678 1676
     
    
    1679 1677
         # _skip_push():
    
    ... ... @@ -1718,8 +1716,6 @@ class Element(Plugin):
    1718 1716
                 return False
    
    1719 1717
     
    
    1720 1718
             # Notify successful upload
    
    1721
    -        display_key = self._get_brief_display_key()
    
    1722
    -        self.info("Pushed artifact {}".format(display_key))
    
    1723 1719
             return True
    
    1724 1720
     
    
    1725 1721
         # _shell():
    

  • tests/testutils/runcli.py
    ... ... @@ -178,7 +178,7 @@ class Result():
    178 178
             return list(pushed)
    
    179 179
     
    
    180 180
         def get_pulled_elements(self):
    
    181
    -        pulled = re.findall(r'\[\s*pull:(\S+)\s*\]\s*INFO\s*Downloaded artifact', self.stderr)
    
    181
    +        pulled = re.findall(r'\[\s*pull:(\S+)\s*\]\s*INFO\s*Pulled artifact', self.stderr)
    
    182 182
             if pulled is None:
    
    183 183
                 return []
    
    184 184
     
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]