Search in sources :

Example 26 with PreconditionFailure

use of com.google.rpc.PreconditionFailure in project bazel-buildfarm by bazelbuild.

the class ShardInstance method denyActionResponse.

private static ExecuteResponse denyActionResponse(Digest actionDigest, String description) {
    PreconditionFailure.Builder preconditionFailureBuilder = PreconditionFailure.newBuilder();
    preconditionFailureBuilder.addViolationsBuilder().setType(VIOLATION_TYPE_MISSING).setSubject("blobs/" + DigestUtil.toString(actionDigest)).setDescription(description);
    PreconditionFailure preconditionFailure = preconditionFailureBuilder.build();
    return ExecuteResponse.newBuilder().setStatus(com.google.rpc.Status.newBuilder().setCode(Code.FAILED_PRECONDITION.value()).setMessage(invalidActionVerboseMessage(actionDigest, preconditionFailure)).addDetails(Any.pack(preconditionFailure)).build()).build();
}
Also used : Actions.checkPreconditionFailure(build.buildfarm.common.Actions.checkPreconditionFailure) PreconditionFailure(com.google.rpc.PreconditionFailure)

Aggregations

PreconditionFailure (com.google.rpc.PreconditionFailure)26 Test (org.junit.Test)18 Digest (build.bazel.remote.execution.v2.Digest)13 Violation (com.google.rpc.PreconditionFailure.Violation)12 ExecuteResponse (build.bazel.remote.execution.v2.ExecuteResponse)10 ByteString (com.google.protobuf.ByteString)9 Action (build.bazel.remote.execution.v2.Action)8 Directory (build.bazel.remote.execution.v2.Directory)6 Actions.checkPreconditionFailure (build.buildfarm.common.Actions.checkPreconditionFailure)6 Poller (build.buildfarm.common.Poller)6 ExecuteEntry (build.buildfarm.v1test.ExecuteEntry)6 Operation (com.google.longrunning.Operation)6 Status (io.grpc.Status)6 ExecutionException (java.util.concurrent.ExecutionException)6 InvalidProtocolBufferException (com.google.protobuf.InvalidProtocolBufferException)5 ExecuteOperationMetadata (build.bazel.remote.execution.v2.ExecuteOperationMetadata)4 Watcher (build.buildfarm.common.Watcher)4 Any (com.google.protobuf.Any)4 QueueEntry (build.buildfarm.v1test.QueueEntry)3 QueuedOperation (build.buildfarm.v1test.QueuedOperation)3