summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQinusty <jrsmith9822@gmail.com>2018-08-01 15:01:25 +0000
committerQinusty <jrsmith9822@gmail.com>2018-08-01 15:01:25 +0000
commit62a250fefa33f9dcfdc54b09ab4ec4d276fa7891 (patch)
tree009375bce1baac4b4d8b70b4d047bb769ea4fce5
parenteabc38998ea35f5cd07846e40460b35453a995a8 (diff)
parent0756c61569050e98fae4005278d51717024b82fa (diff)
downloadbuildstream-62a250fefa33f9dcfdc54b09ab4ec4d276fa7891.tar.gz
Merge branch 'Qinusty/481' into 'master'
Add SKIPPED message type for actions being skipped See merge request BuildStream/buildstream!562
-rw-r--r--buildstream/_artifactcache/cascache.py13
-rw-r--r--buildstream/_frontend/widget.py1
-rw-r--r--buildstream/_message.py1
3 files changed, 12 insertions, 3 deletions
diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py
index 3ef563368..1b2dc198f 100644
--- a/buildstream/_artifactcache/cascache.py
+++ b/buildstream/_artifactcache/cascache.py
@@ -32,6 +32,7 @@ from .._protos.google.bytestream import bytestream_pb2, bytestream_pb2_grpc
from .._protos.build.bazel.remote.execution.v2 import remote_execution_pb2, remote_execution_pb2_grpc
from .._protos.buildstream.v2 import buildstream_pb2, buildstream_pb2_grpc
+from .._message import MessageType, Message
from .. import _signals, utils
from .._exceptions import ArtifactError
@@ -264,7 +265,7 @@ class CASCache(ArtifactCache):
for remote in push_remotes:
remote.init()
-
+ skipped_remote = True
element.info("Pushing {} -> {}".format(element._get_brief_display_key(), remote.spec.url))
try:
@@ -280,8 +281,6 @@ class CASCache(ArtifactCache):
if response.digest.hash == tree.hash and response.digest.size_bytes == tree.size_bytes:
# ref is already on the server with the same tree
- element.info("Skipping {}, remote ({}) already has artifact cached".format(
- element._get_brief_display_key(), remote.spec.url))
continue
except grpc.RpcError as e:
@@ -309,6 +308,7 @@ class CASCache(ArtifactCache):
missing_blobs[d.hash] = d
# Upload any blobs missing on the server
+ skipped_remote = False
for digest in missing_blobs.values():
def request_stream():
resource_name = os.path.join(digest.hash, str(digest.size_bytes))
@@ -344,6 +344,13 @@ class CASCache(ArtifactCache):
if e.code() != grpc.StatusCode.RESOURCE_EXHAUSTED:
raise ArtifactError("Failed to push artifact {}: {}".format(refs, e), temporary=True) from e
+ if skipped_remote:
+ self.context.message(Message(
+ None,
+ MessageType.SKIPPED,
+ "Remote ({}) already has {} cached".format(
+ remote.spec.url, element._get_brief_display_key())
+ ))
return pushed
################################################
diff --git a/buildstream/_frontend/widget.py b/buildstream/_frontend/widget.py
index 24e146c16..9e8534f7a 100644
--- a/buildstream/_frontend/widget.py
+++ b/buildstream/_frontend/widget.py
@@ -160,6 +160,7 @@ class TypeName(Widget):
MessageType.START: "blue",
MessageType.SUCCESS: "green",
MessageType.FAIL: "red",
+ MessageType.SKIPPED: "yellow",
MessageType.ERROR: "red",
MessageType.BUG: "red",
}
diff --git a/buildstream/_message.py b/buildstream/_message.py
index 32650450a..37630eb86 100644
--- a/buildstream/_message.py
+++ b/buildstream/_message.py
@@ -36,6 +36,7 @@ class MessageType():
START = "start" # Status start message
SUCCESS = "success" # Successful status complete message
FAIL = "failure" # Failing status complete message
+ SKIPPED = "skipped"
# Messages which should be reported regardless of whether