blob: 253ec8bc72928c996b22eb1325367cffb85e5816 [file] [log] [blame]
// Copyright 2021 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package cv.internal.run.eventpb;
option go_package = "go.chromium.org/luci/cv/internal/run/eventpb;eventpb";
import "google/protobuf/timestamp.proto";
import "go.chromium.org/luci/cv/internal/tryjob/task.proto";
message LongOpCompleted {
reserved 4; // cancel_triggers
// Long Operation ID.
string operation_id = 1;
enum Status {
LONG_OP_STATUS_UNSPECIFIED = 0;
// SUCCEEDED means the long operation succeeded.
SUCCEEDED = 1;
// FAILED means the long operation experienced a failure.
FAILED = 2;
// Cancelled is true if the LongOp detected that it was cancelled by the Run
// Manager and thus stopped its working before completion.
CANCELLED = 3;
// Expired means the long operation expired.
//
// If this is the case, the `result` field may be unset: this should be rare
// but may happen if Run Manager detects expiry before a LongOpCompleted
// event is sent by the long operation handling task.
EXPIRED = 4;
}
// Status of the long operation.
Status status = 2;
oneof result {
PostStartMessage post_start_message = 3;
ResetTriggers reset_triggers = 6;
cv.internal.tryjob.ExecuteTryjobsResult execute_tryjobs = 5;
ExecutePostActionResult execute_post_action = 7;
PostGerritMessage post_gerrit_message = 8;
}
message PostStartMessage {
reserved 1, 2;
reserved "posted", "permanent_errors";
// Approximate time when CV became certain that the message was posted on
// the last CL.
google.protobuf.Timestamp time = 3;
}
message PostGerritMessage {
// Approximate time when CV became certain that the message was posted on
// the last CL.
google.protobuf.Timestamp time = 1;
}
message ResetTriggers {
message Result {
// ID of the CL that this long op is trying to reset its trigger.
int64 id = 1;
// The external id of the CL.
string external_id = 2;
message Success {
// The timestamp when trigger is successfully reset from LUCI CV
// PoV.
//
// It is possible by the time LUCI CV is trying to reset the trigger,
// it has already been removed by the user. Therefore, this timestamp
// is the time when LUCI CV observes that trigger is removed.
google.protobuf.Timestamp reset_at = 1;
}
message Failure {
// The message when CV failed to reset the trigger.
string failure_message = 1;
}
oneof detail {
Success success_info = 3;
Failure failure_info = 4;
}
}
// The top-level long ops status will be SUCCEEDED iff all triggers are
// reset successfully, in other word, all results have `reset_at` set.
repeated Result results = 1;
}
message ExecutePostActionResult {
string summary = 1;
}
}