Usage of `Operation` is not compatible with REAPI

Context

Expected behavior

From REAPI

  // Errors discovered during creation of the `Operation` will be reported
  // as gRPC Status errors, while errors that occurred while running the
  // action will be reported in the `status` field of the `ExecuteResponse`. The
  // server MUST NOT set the `error` field of the `Operation` proto.

Current behavior

In the current implementation, Operation.Status is populated:

https://gitlab.com/BuildGrid/buildgrid/-/blob/master/buildgrid/server/job.py#L354

        # Set the status code/execute response as appropriate
        if cancelled:
            operation_proto.error.CopyFrom(status_pb2.Status(code=code_pb2.CANCELLED))
        elif self._status_code is not None and self._status_code != code_pb2.OK:
            # If there was an error, populate the error field.
            operation_proto.error.CopyFrom(status_pb2.Status(code=self._status_code))
Assignee Loading
Time tracking Loading