go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/analysis/proto/v1/common.proto (about) 1 // Copyright 2022 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 luci.analysis.v1; 18 19 import "google/api/field_behavior.proto"; 20 import "google/protobuf/timestamp.proto"; 21 22 option go_package = "go.chromium.org/luci/analysis/proto/v1;analysispb"; 23 24 // A range of timestamps. 25 message TimeRange { 26 // The oldest timestamp to include in the range. 27 google.protobuf.Timestamp earliest = 1; 28 29 // Include only timestamps that are strictly older than this. 30 google.protobuf.Timestamp latest = 2; 31 } 32 33 // Identity of a test result. 34 message TestResultId { 35 // The test results system. 36 // Currently, the only valid value is "resultdb". 37 string system = 1; 38 39 // ID for the test result in the test results system. 40 // For test results in ResultDB, the format is: 41 // "invocations/{INVOCATION_ID}/tests/{URL_ESCAPED_TEST_ID}/results/{RESULT_ID}" 42 // Where INVOCATION_ID, URL_ESCAPED_TEST_ID and RESULT_ID are values defined 43 // in ResultDB. 44 string id = 2; 45 } 46 47 // Variant represents a way of running a test case. 48 // 49 // The same test case can be executed in different ways, for example on 50 // different OS, GPUs, with different compile options or runtime flags. 51 message Variant { 52 // The definition of the variant. Each key-value pair represents a 53 // parameter describing how the test was run (e.g. OS, GPU, etc.). 54 map<string, string> def = 1; 55 } 56 57 message StringPair { 58 // Regex: ^[a-z][a-z0-9_]*(/[a-z][a-z0-9_]*)*$ 59 // Max length: 64. 60 string key = 1; 61 62 // Max length: 256. 63 string value = 2; 64 } 65 66 // Identity of a bug tracking component in a bug tracking system. 67 message BugTrackingComponent { 68 // The bug tracking system corresponding to this test case, as identified 69 // by the test results system. 70 // Currently, the valid values are "monorail" or "buganizer". 71 string system = 1; 72 73 // The bug tracking component corresponding to this test case, as identified 74 // by the test results system. 75 // If the bug tracking system is monorail, this is the component as the 76 // user would see it, e.g. "Infra>Test>Flakiness". For monorail, the bug 77 // tracking project (e.g. "chromium") is not encoded, but assumed to be 78 // specified in the project's LUCI Analysis configuration. 79 string component = 2; 80 } 81 82 // Identity of a presubmit run (also known as a "CQ Run" or "CV Run"). 83 message PresubmitRunId { 84 // The system that was used to process the presubmit run. 85 // Currently, the only valid value is "luci-cv" for LUCI Commit Verifier 86 // (LUCI CV). 87 string system = 1; 88 89 // Identity of the presubmit run. 90 // If the presubmit system is LUCI CV, the format of this value is: 91 // "{LUCI_PROJECT}/{LUCI_CV_ID}", e.g. 92 // "infra/8988819463854-1-f94732fe20056fd1". 93 string id = 2; 94 } 95 96 // Identity of a bug in a bug-tracking system. 97 message AssociatedBug { 98 // System is the bug tracking system of the bug. This is either 99 // "monorail" or "buganizer". 100 string system = 1; 101 102 // Id is the bug tracking system-specific identity of the bug. 103 // For monorail, the scheme is {project}/{numeric_id}, for 104 // buganizer the scheme is {numeric_id}. 105 string id = 2; 106 107 // A human-readable name for the bug. This is typically the 108 // bug shortlink (e.g. "crbug.com/1234567"). 109 string link_text = 3 110 [(google.api.field_behavior) = OUTPUT_ONLY]; 111 112 // The resolved bug URL, e.g. 113 // E.g. "https://bugs.chromium.org/p/chromium/issues/detail?id=123456". 114 string url = 4 115 [(google.api.field_behavior) = OUTPUT_ONLY]; 116 } 117 118 // ClusterId represents the identity of a cluster. The LUCI Project is 119 // omitted as it is assumed to be implicit from the context. 120 // 121 // This is often used in place of the resource name of the cluster 122 // (in the sense of https://google.aip.dev/122) as clients may need 123 // to access individual parts of the resource name (e.g. to determine 124 // the algorithm used) and it is not desirable to make clients parse 125 // the resource name. 126 message ClusterId { 127 // Algorithm is the name of the clustering algorithm that identified 128 // the cluster. 129 string algorithm = 1; 130 131 // Id is the cluster identifier returned by the algorithm. The underlying 132 // identifier is at most 16 bytes, but is represented here as a hexadecimal 133 // string of up to 32 lowercase hexadecimal characters. 134 string id = 2; 135 } 136 137 // BuildStatus the result of the build in which the test verdict was produced. 138 // This can be used to detect if the test verdict is incomplete (e.g. because 139 // an infra failure or cancellation occurred), and whether the unexpected 140 // test verdict was also followed by a failing build. 141 // 142 // Note: All values prefixed with BUILD_STATUS_ as the names are generic 143 // and likely to conflict with other/future enumerations otherwise. 144 // See https://google.aip.dev/126. 145 enum BuildStatus { 146 // A build must not have this status. 147 BUILD_STATUS_UNSPECIFIED = 0; 148 149 // The build succeeded. 150 BUILD_STATUS_SUCCESS = 1; 151 152 // The build failed. 153 BUILD_STATUS_FAILURE = 2; 154 155 // The build encountered an infrastructure failure. 156 BUILD_STATUS_INFRA_FAILURE = 3; 157 158 // The build was canceled. 159 BUILD_STATUS_CANCELED = 4; 160 } 161 162 // ExonerationReason captures a reason why a test failure was 163 // exonerated. Exonerated means the failure was ignored and did not 164 // have further impact, in terms of causing the build to fail or 165 // rejecting the CL being tested in a presubmit run. 166 // 167 // Based on https://source.chromium.org/chromium/infra/infra/+/main:go/src/go.chromium.org/luci/resultdb/proto/v1/test_result.proto?q=ExonerationReason&type=cs. 168 enum ExonerationReason { 169 // A test failure must not have this status. 170 EXONERATION_REASON_UNSPECIFIED = 0; 171 172 // Similar unexpected results were observed on a mainline branch 173 // (i.e. against a build without unsubmitted changes applied). 174 // (For avoidance of doubt, this includes both flakily and 175 // deterministically occurring unexpected results.) 176 // Applies to unexpected results in presubmit/CQ runs only. 177 OCCURS_ON_MAINLINE = 1; 178 179 // Similar unexpected results were observed in presubmit run(s) for other, 180 // unrelated CL(s). (This is suggestive of the issue being present 181 // on mainline but is not confirmed as there are possible confounding 182 // factors, like how tests are run on CLs vs how tests are run on 183 // mainline branches.) 184 // Applies to unexpected results in presubmit/CQ runs only. 185 OCCURS_ON_OTHER_CLS = 2; 186 187 // The tests are not critical to the test subject (e.g. CL) passing. 188 // This could be because more data is being collected to determine if 189 // the tests are stable enough to be made critical (as is often the 190 // case for experimental test suites). 191 NOT_CRITICAL = 3; 192 193 // The test result was an unexpected pass. (Note that such an exoneration is 194 // not automatically created for unexpected passes, unless the option is 195 // specified to ResultSink or the project manually creates one). 196 UNEXPECTED_PASS = 4; 197 } 198 199 // SubmittedFilter filters test verdicts based on whether they had unsubmitted 200 // changes. 201 enum SubmittedFilter { 202 // Default value. Include all test verdicts. 203 SUBMITTED_FILTER_UNSPECIFIED = 0; 204 205 // Only include test verdicts that don't have unsubmitted changes. 206 ONLY_SUBMITTED = 1; 207 208 // Only include test verdicts that have unsubmitted changes. 209 ONLY_UNSUBMITTED = 2; 210 } 211 212 // PresubmitRunMode describes the mode of a presubmit run. Currently 213 // based on LUCI CV run mode enumeration at 214 // https://source.chromium.org/chromium/infra/infra/+/main:go/src/go.chromium.org/luci/cv/api/bigquery/v1/attempt.proto?q=QUICK_DRY_RUN&type=cs. 215 enum PresubmitRunMode { 216 // A presubmit run must not have this status. 217 PRESUBMIT_RUN_MODE_UNSPECIFIED = 0; 218 219 // Run all tests but do not submit. 220 DRY_RUN = 1; 221 222 // Run all tests and potentially submit. 223 FULL_RUN = 2; 224 225 // Run some tests but do not submit. 226 QUICK_DRY_RUN = 3; 227 228 // Runs some tests on patchset upload but do not submit. 229 NEW_PATCHSET_RUN = 4; 230 } 231 232 // PresubmitRunStatus is the ending status of a presubmit run. 233 // 234 // Note: All values prefixed with PRESUBMIT_RUN_STATUS_ as the names are 235 // generic and likely to conflict with other/future enumerations otherwise. 236 // See https://google.aip.dev/126. 237 // 238 // Based on https://source.chromium.org/chromium/infra/infra/+/main:go/src/go.chromium.org/luci/cv/internal/run/storage.proto;l=28?q=LUCI%20CV%20status%20lang:proto. 239 enum PresubmitRunStatus { 240 // A build must not have this status. 241 PRESUBMIT_RUN_STATUS_UNSPECIFIED = 0; 242 243 // The run succeeded. 244 PRESUBMIT_RUN_STATUS_SUCCEEDED = 1; 245 246 // The run failed. 247 PRESUBMIT_RUN_STATUS_FAILED = 2; 248 249 // The run was canceled. 250 PRESUBMIT_RUN_STATUS_CANCELED = 3; 251 } 252 253 // Represents a range of numeric values, e.g. unexpected verdict rates. 254 message NumericRange { 255 // The inclusive lower bound included in the range. 256 float lower_bound = 1; 257 // The inclusive upper bound included in the range. 258 float upper_bound = 2; 259 }