go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/analysis/proto/bq/test_variant_branch_row.proto (about) 1 // Copyright 2023 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.bq; 18 19 import "google/protobuf/timestamp.proto"; 20 import "go.chromium.org/luci/analysis/proto/v1/sources.proto"; 21 import "go.chromium.org/luci/common/bq/pb/options.proto"; 22 23 option go_package = "go.chromium.org/luci/analysis/proto/bq;bqpb"; 24 25 // Represents analysis for a test variant on a source branch at a point in time. 26 message TestVariantBranchRow { 27 // The LUCI Project. E.g. "chromium". 28 string project = 1; 29 30 // The identity of the test. 31 string test_id = 2; 32 33 // Hash of the variant, as 16 lowercase hexadecimal characters. 34 // E.g. "96c68dc946ab4068". 35 string variant_hash = 3; 36 37 // Hash of the source branch, as 16 lowercase hexadecimal characters. 38 string ref_hash = 4; 39 40 // Describes one specific way of running the test, e.g. a specific bucket, 41 // builder and a test suite. 42 // 43 // This will be encoded as a JSON object like 44 // {"builder":"linux-rel","os":"Ubuntu-18.04",...} 45 // to take advantage of BigQuery's JSON support, so that the query will only 46 // be billed for the variant keys it reads. 47 // 48 // In the protocol buffer, it must be a string as per 49 // https://cloud.google.com/bigquery/docs/write-api#data_type_conversions 50 string variant = 5 [(bqschema.options).bq_type = "JSON"]; 51 52 // The branch in source control. 53 luci.analysis.v1.SourceRef ref = 6; 54 55 // The test history represented as a set of [start commit position, 56 // end commit position] segments, where segments have statistically 57 // different failure and/or flake rates. The segments are ordered so that 58 // the most recent segment appears first. 59 // If a client is only interested in the current failure/flake rate, they 60 // can just query the first segment. 61 repeated Segment segments = 7; 62 63 // This field has value = 1 if the test variant has any unexpected 64 // test results in the last 90 days (excluding presubmit runs that do not 65 // results in CL submission). It has value = 0 otherwise. 66 // It is int value instead of bool because we use it as partitioning key 67 // (BigQuery does not support bool as partitioning key). 68 int64 has_recent_unexpected_results = 8; 69 70 // The Spanner commit timestamp that reflects the version of data that was 71 // exported. Rows with later timestamps are strictly newer. 72 // In the test_variant_segments table, only one version of analysis 73 // will be present for a given (project, test_id, variant_hash, ref_hash). 74 google.protobuf.Timestamp version = 9; 75 } 76 77 // Represents a period in history where the test had a consistent failure and 78 // flake rate. Segments are separated by changepoints. Each segment captures 79 // information about the changepoint which started it. 80 message Segment { 81 // If set, means the segment commenced with a changepoint. 82 // If unset, means the segment began with the beginning of recorded 83 // history for the segment. (All recorded history for a test variant branch 84 // is deleted after 90 days of no results, so this means there were 85 // no results for at least 90 days before the segment.) 86 bool has_start_changepoint = 1; 87 88 // The nominal commit position at which the segment starts (inclusive). 89 // Guaranteed to be strictly greater than the end_position of the 90 // chronologically previous segment (if any). 91 // If this segment has a starting changepoint, this is the nominal position 92 // of the changepoint (when the new test behaviour started). 93 // If this segment does not have a starting changepoint, this is the 94 // simply the first commit position in the known history of the test. 95 int64 start_position = 2; 96 97 // The lower bound of the starting changepoint position in a 99% two-tailed 98 // confidence interval. Inclusive. 99 // Only set if has_start_changepoint is set. 100 int64 start_position_lower_bound_99th = 3; 101 102 // The upper bound of the starting changepoint position in a 99% two-tailed 103 // confidence interval. Inclusive. 104 // Only set if has_start_changepoint is set. 105 // When has_start_changepoint is set, the following invariant holds: 106 // previous_segment.start_position <= start_position_lower_bound_99th <= start_position <= start_position_upper_bound_99th 107 // where previous_segment refers to the chronologically previous segment. 108 int64 start_position_upper_bound_99th = 4; 109 110 // The earliest hour a test verdict at the indicated start_position 111 // was recorded. Gives an approximate upper bound on the timestamp the 112 // changepoint occurred, for systems which need to filter by date. 113 google.protobuf.Timestamp start_hour = 5; 114 115 // The nominal commit position at which the segment ends (inclusive). 116 // This is either the last recorded commit position in the test history 117 // (for this test variant branch), or the position of the last verdict 118 // seen before the next detected changepoint. 119 int64 end_position = 6; 120 121 // The earliest hour a test verdict at the indicated end_position 122 // was recorded. Gives an approximate lower bound on the timestamp 123 // the changepoint occurred, for systems which need to filter by date. 124 google.protobuf.Timestamp end_hour = 7; 125 126 // Counts of test results, runs and verdicts over a time period. Includes only 127 // test results for submitted code changes. This is defined as: 128 // (1) where the code under test was already submitted when the test ran 129 // (e.g. postsubmit builders) 130 // (2) where the code under test was not submitted at the time the test ran, 131 // but was submitted immediately after (e.g. because the tests ran as part 132 // of a tryjob, the presubmit run the tryjob was triggered by succeeded, 133 // and submitted code as a result). 134 // Currently, when test results lead to CL submission via recycled CQ runs, 135 // they are not counted. 136 // Next ID: 18 137 message Counts { 138 // All the following statistics exclude the effect of exonerations, 139 // and skipped test results. 140 // For runs and test results, duplicate (recycled) runs are not counted. 141 // Verdicts with only skipped/duplicate results are not counted. 142 143 // The number of unexpected non-skipped test results. 144 int64 unexpected_results = 1; 145 146 // The total number of non-skipped test results. 147 int64 total_results = 2; 148 149 // The number of expected passed test results. 150 int64 expected_passed_results = 10; 151 152 // The number of expected failed test results. 153 int64 expected_failed_results = 11; 154 155 // The number of expected crashed test results. 156 int64 expected_crashed_results = 12; 157 158 // The number of expected aborted test results. 159 int64 expected_aborted_results = 13; 160 161 // The number of unexpected passed test results. 162 int64 unexpected_passed_results = 14; 163 164 // The number of unexpected failed test results. 165 int64 unexpected_failed_results = 15; 166 167 // The number of unexpected crashed test results. 168 int64 unexpected_crashed_results = 16; 169 170 // The number of unexpected aborted test results. 171 int64 unexpected_aborted_results = 17; 172 173 // The number of test runs which had an unexpected test result but were 174 // not retried. 175 int64 unexpected_unretried_runs = 3; 176 177 // The number of test run which had an unexpected test result, were 178 // retried, and still contained only unexpected test results. 179 int64 unexpected_after_retry_runs = 4; 180 181 // The number of test runs which had an unexpected test result, were 182 // retried, and eventually recorded an expected test result. 183 int64 flaky_runs = 5; 184 185 // The total number of test runs. 186 int64 total_runs = 6; 187 188 // The number of verdicts with only unexpected test results. 189 int64 unexpected_verdicts = 7; 190 191 // The number of verdicts with a mix of expected and unexpected test results. 192 int64 flaky_verdicts = 8; 193 194 // The total number of verdicts. 195 int64 total_verdicts = 9; 196 } 197 198 // Total number of test results/runs/verdicts in the segment. 199 Counts counts = 8; 200 }