go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/cv/internal/run/eventpb/longop.proto (about) 1 // Copyright 2021 The LUCI Authors. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 syntax = "proto3"; 16 17 package cv.internal.run.eventpb; 18 19 option go_package = "go.chromium.org/luci/cv/internal/run/eventpb;eventpb"; 20 21 import "google/protobuf/timestamp.proto"; 22 import "go.chromium.org/luci/cv/internal/tryjob/task.proto"; 23 24 message LongOpCompleted { 25 reserved 4; // cancel_triggers 26 27 // Long Operation ID. 28 string operation_id = 1; 29 30 enum Status { 31 LONG_OP_STATUS_UNSPECIFIED = 0; 32 // SUCCEEDED means the long operation succeeded. 33 SUCCEEDED = 1; 34 // FAILED means the long operation experienced a failure. 35 FAILED = 2; 36 // Cancelled is true if the LongOp detected that it was cancelled by the Run 37 // Manager and thus stopped its working before completion. 38 CANCELLED = 3; 39 // Expired means the long operation expired. 40 // 41 // If this is the case, the `result` field may be unset: this should be rare 42 // but may happen if Run Manager detects expiry before a LongOpCompleted 43 // event is sent by the long operation handling task. 44 EXPIRED = 4; 45 } 46 // Status of the long operation. 47 Status status = 2; 48 49 oneof result { 50 PostStartMessage post_start_message = 3; 51 ResetTriggers reset_triggers = 6; 52 cv.internal.tryjob.ExecuteTryjobsResult execute_tryjobs = 5; 53 ExecutePostActionResult execute_post_action = 7; 54 PostGerritMessage post_gerrit_message = 8; 55 } 56 57 message PostStartMessage { 58 reserved 1, 2; 59 reserved "posted", "permanent_errors"; 60 // Approximate time when CV became certain that the message was posted on 61 // the last CL. 62 google.protobuf.Timestamp time = 3; 63 } 64 65 message PostGerritMessage { 66 // Approximate time when CV became certain that the message was posted on 67 // the last CL. 68 google.protobuf.Timestamp time = 1; 69 } 70 71 message ResetTriggers { 72 message Result { 73 // ID of the CL that this long op is trying to reset its trigger. 74 int64 id = 1; 75 // The external id of the CL. 76 string external_id = 2; 77 78 message Success { 79 // The timestamp when trigger is successfully reset from LUCI CV 80 // PoV. 81 // 82 // It is possible by the time LUCI CV is trying to reset the trigger, 83 // it has already been removed by the user. Therefore, this timestamp 84 // is the time when LUCI CV observes that trigger is removed. 85 google.protobuf.Timestamp reset_at = 1; 86 } 87 message Failure { 88 // The message when CV failed to reset the trigger. 89 string failure_message = 1; 90 } 91 oneof detail { 92 Success success_info = 3; 93 Failure failure_info = 4; 94 } 95 } 96 97 // The top-level long ops status will be SUCCEEDED iff all triggers are 98 // reset successfully, in other word, all results have `reset_at` set. 99 repeated Result results = 1; 100 } 101 102 message ExecutePostActionResult { 103 string summary = 1; 104 } 105 }