go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/analysis/internal/clustering/proto/failure.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.internal.clustering;
    18  
    19  import "google/protobuf/timestamp.proto";
    20  import "google/protobuf/duration.proto";
    21  import "go.chromium.org/luci/analysis/proto/v1/common.proto";
    22  import "go.chromium.org/luci/analysis/proto/v1/sources.proto";
    23  import "go.chromium.org/luci/analysis/proto/v1/failure_reason.proto";
    24  
    25  option go_package = "go.chromium.org/luci/analysis/internal/clustering/proto;clusteringpb";
    26  
    27  // Chunk is a set of unexpected test failures which are processed together
    28  // for efficiency.
    29  // Serialised and stored in GCS.
    30  message Chunk {
    31    repeated Failure failures = 1;
    32  }
    33  
    34  // LUCI Analysis internal representation of an unexpected test failure.
    35  message Failure {
    36    // The identity of the test result, as defined by the source system.
    37    luci.analysis.v1.TestResultId test_result_id = 1;
    38  
    39    // Timestamp representing the start of the data retention period. This acts
    40    // as the partitioning key in time/date-partitioned tables.
    41    google.protobuf.Timestamp partition_time = 2;
    42  
    43    // The one-based index of this failure within the chunk. Assigned by
    44    // LUCI Analysis ingestion.
    45    int64 chunk_index = 3;
    46  
    47    // Security realm of the test result.
    48    // For test results from ResultDB, this must be set. The format is
    49    // "{LUCI_PROJECT}:{REALM_SUFFIX}", for example "chromium:ci".
    50    string realm = 4;
    51  
    52    // The unique identifier of the test.
    53    // For test results from ResultDB, see luci.resultdb.v1.TestResult.test_id.
    54    string test_id = 5;
    55  
    56    // key:value pairs to specify the way of running a particular test.
    57    // e.g. a specific bucket, builder and a test suite.
    58    luci.analysis.v1.Variant variant = 6;
    59  
    60    // Metadata key value pairs for this test result.
    61    // It might describe this particular execution or the test case.
    62    // A key can be repeated.
    63    repeated luci.analysis.v1.StringPair tags = 25;
    64  
    65    // Hash of the variant.
    66    // hex(sha256(''.join(sorted('%s:%s\n' for k, v in variant.items())))).
    67    string variant_hash = 7;
    68  
    69    // A failure reason describing why the test failed.
    70    luci.analysis.v1.FailureReason failure_reason = 8;
    71  
    72    // The bug tracking component corresponding to this test case, as identified
    73    // by the test results system. If no information is available, this is
    74    // unset.
    75    luci.analysis.v1.BugTrackingComponent bug_tracking_component = 9;
    76  
    77    // The point in time when the test case started to execute.
    78    google.protobuf.Timestamp start_time = 10;
    79  
    80    // The amount of time the test case took to execute.
    81    google.protobuf.Duration duration = 11;
    82  
    83    reserved 12;
    84  
    85    reserved 24;
    86  
    87    // The exonerations applied to the test verdict.
    88    // An empty list indicates the test verdict this test result was a part of
    89    // was not exonerated.
    90    repeated TestExoneration exonerations = 26;
    91  
    92    // The presubmit run the test result was a part of (if any).
    93    PresubmitRun presubmit_run = 27;
    94  
    95    // The status of the build that contained this test result. Can be used
    96    // to filter incomplete results (e.g. where build was cancelled or had
    97    // an infra failure). Can also be used to filter builds with incomplete
    98    // exonerations (e.g. build succeeded but some tests not exonerated).
    99    // This is the build corresponding to ingested_invocation_id.
   100    luci.analysis.v1.BuildStatus build_status = 28;
   101  
   102    // Whether the build was critical to a presubmit run succeeding.
   103    // If the build was not part of a presubmit run, this is unset.
   104    optional bool build_critical = 29;
   105  
   106    // The unsubmitted changelists that were tested (if any).
   107    // Changelists are sorted in ascending (host, change, patchset) order.
   108    // Up to 10 changelists are captured.
   109    repeated luci.analysis.v1.Changelist changelists = 23;
   110  
   111    // The invocation from which this test result was ingested. This is
   112    // the top-level invocation that was ingested, an "invocation" being
   113    // a container of test results as identified by the source test result
   114    // system.
   115    //
   116    // For ResultDB, LUCI Analysis ingests invocations corresponding to
   117    // buildbucket builds.
   118    //
   119    // All test results ingested from the same invocation (i.e. with the
   120    // same ingested_invocation_id) will have the same partition time.
   121    string ingested_invocation_id = 14;
   122  
   123    // The zero-based index for this test result, in the sequence of the
   124    // ingested invocation's results for this test variant. Within the sequence,
   125    // test results are ordered by start_time and then by test result ID.
   126    // The first test result is 0, the last test result is
   127    // ingested_invocation_result_count - 1.
   128    int64 ingested_invocation_result_index = 15;
   129  
   130    // The number of test results having this test variant in the ingested
   131    // invocation.
   132    int64 ingested_invocation_result_count = 16;
   133  
   134    // Is the ingested invocation blocked by this test variant? This is
   135    // only true if all (non-skipped) test results for this test variant
   136    // (in the ingested invocation) are unexpected failures.
   137    //
   138    // Exoneration does not factor into this value; check exonerations
   139    // to see if the impact of this ingested invocation being blocked was
   140    // mitigated by exoneration.
   141    bool is_ingested_invocation_blocked = 17;
   142  
   143    // The identifier of the test run the test ran in. Test results in different
   144    // test runs are generally considered independent as they should be unable
   145    // to leak state to one another.
   146    //
   147    // In Chrome and Chrome OS, a test run logically corresponds to a swarming
   148    // task that runs tests, but this ID is not necessarily the ID of that
   149    // task, but rather any other ID that is unique per such task.
   150    //
   151    // If test result system is ResultDB, this is the ID of the ResultDB
   152    // invocation the test result was immediately contained within, not including
   153    // any "invocations/" prefix.
   154    string test_run_id = 18;
   155  
   156    // The zero-based index for this test result, in the sequence of results
   157    // having this test variant and test run. Within the sequence, test
   158    // results are ordered by start_time and then by test result ID.
   159    // The first test result is 0, the last test result is
   160    // test_run_result_count - 1.
   161    int64 test_run_result_index = 19;
   162  
   163    // The number of test results having this test variant and test run.
   164    int64 test_run_result_count = 20;
   165  
   166    // Is the test run blocked by this test variant? This is only true if all
   167    // (non-skipped) test results for this test variant (in the test run)
   168    // are unexpected failures.
   169    //
   170    // Exoneration does not factor into this value; check exonerations
   171    // to see if the impact of this test run being blocked was
   172    // mitigated by exoneration.
   173    bool is_test_run_blocked = 21;
   174  
   175    // The code sources tested, if known.
   176    luci.analysis.v1.Sources sources = 30;
   177  
   178    // The gardener rotations the build is a part of. Corresponds to the
   179    // `sheriff_rotations` field of the build input properties.
   180    repeated string build_gardener_rotations = 31;
   181  
   182    // Information about the test variant-branch the result is from.
   183    TestVariantBranch test_variant_branch = 32;
   184  
   185    // Next ID: 33.
   186  }
   187  
   188  // Statistics about the (test,variant,ref) the verdict is from.
   189  message TestVariantBranch {
   190    // The counts of verdicts observed for this (test, variant, source ref)
   191    // with a partition time equal or less than the partition time of this
   192    // verdict. This figure only considers verdicts ingested by LUCI Analysis
   193    // prior to this verdict.
   194    // Hourly bucketing is used internally, so data is aligned to hour
   195    // boundaries.
   196  
   197    // The number of flaky verdicts in the preceding 24 hours. A verdict
   198    // is considered flaky for this count if it has both expected and
   199    // unexpected test results (excluding skips). Whether the verdict
   200    // was exonerated is irrelevant.
   201    int64 flaky_verdicts_24h = 1;
   202  
   203    // The number of unexpected verdicts in the preceding 24 hours. A verdict
   204    // is unexpected for this count if has only unexpected test results
   205    // (excluding skips). Whether the verdict was exonerated is irrelevant.
   206    int64 unexpected_verdicts_24h = 2;
   207  
   208    // The total number of verdicts in the preceding 24 hours, excluding
   209    // verdicts with only skipped test results.
   210    int64 total_verdicts_24h = 3;
   211  }
   212  
   213  // LUCI Analysis internal representation of a test exoneration.
   214  message TestExoneration {
   215    // The machine-readable reason for the exoneration.
   216    luci.analysis.v1.ExonerationReason reason = 1;
   217  }
   218  
   219  // LUCI Analysis internal representation of a presubmit run (e.g. LUCI CV Run).
   220  message PresubmitRun {
   221    // Identity of the presubmit run that contains this test result.
   222    // This should be unique per "CQ+1"/"CQ+2" attempt on gerrit.
   223    //
   224    // One presumbit run MAY have many ingested invocation IDs (e.g. for its
   225    // various tryjobs), but every ingested invocation ID only ever has one
   226    // presubmit run ID (if any).
   227    //
   228    // All test results for the same presubmit run will have one
   229    // partition_time.
   230    //
   231    // If the test result was not collected as part of a presubmit run,
   232    // this is unset.
   233    luci.analysis.v1.PresubmitRunId presubmit_run_id = 1;
   234  
   235    // The owner of the presubmit run (if any).
   236    // This is the owner of the CL on which CQ+1/CQ+2 was clicked
   237    // (even in case of presubmit run with multiple CLs).
   238    // There is scope for this field to become an email address if privacy
   239    // approval is obtained, until then it is "automation" (for automation
   240    // service accounts) and "user" otherwise.
   241    string owner = 2;
   242  
   243    // The mode of the presubmit run. E.g. DRY_RUN, FULL_RUN, QUICK_DRY_RUN.
   244    luci.analysis.v1.PresubmitRunMode mode = 3;
   245  
   246    // The presubmit run's ending status. E.g. SUCCESS, FAILURE, CANCELED.
   247    luci.analysis.v1.PresubmitRunStatus status = 4;
   248  }