go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/resultdb/proto/v1/common.proto (about) 1 // Copyright 2019 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.resultdb.v1; 18 19 import "google/protobuf/timestamp.proto"; 20 21 option go_package = "go.chromium.org/luci/resultdb/proto/v1;resultpb"; 22 23 // A key-value map describing one variant of a test case. 24 // 25 // The same test case can be executed in different ways, for example on 26 // different OS, GPUs, with different compile options or runtime flags. 27 // A variant definition captures one variant. 28 // A test case with a specific variant definition is called test variant. 29 // 30 // Guidelines for variant definition design: 31 // - This rule guides what keys MUST be present in the definition. 32 // A single expected result of a given test variant is enough to consider it 33 // passing (potentially flakily). If it is important to differentiate across 34 // a certain dimension (e.g. whether web tests are executed with or without 35 // site per process isolation), then there MUST be a key that captures the 36 // dimension (e.g. a name from test_suites.pyl). 37 // Otherwise, a pass in one variant will hide a failure of another one. 38 // 39 // - This rule guides what keys MUST NOT be present in the definition. 40 // A change in the key-value set essentially resets the test result history. 41 // For example, if GN args are among variant key-value pairs, then adding a 42 // new GN arg changes the identity of the test variant and resets its history. 43 // 44 // In Chromium, variant keys are: 45 // - bucket: the LUCI bucket, e.g. "ci" 46 // - builder: the LUCI builder, e.g. "linux-rel" 47 // - test_suite: a name from 48 // https://cs.chromium.org/chromium/src/testing/buildbot/test_suites.pyl 49 message Variant { 50 // The definition of the variant. 51 // Key and values must be valid StringPair keys and values, see their 52 // constraints. 53 map<string, string> def = 1; 54 } 55 56 // A string key-value pair. Typically used for tagging, see Invocation.tags 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 // GitilesCommit specifies the position of the gitiles commit an invocation 67 // ran against, in a repository's commit log. More specifically, a ref's commit 68 // log. 69 // 70 // It also specifies the host/project/ref combination that the commit 71 // exists in, to provide context. 72 message GitilesCommit { 73 // The identity of the gitiles host, e.g. "chromium.googlesource.com". 74 // Mandatory. 75 string host = 1; 76 77 // Repository name on the host, e.g. "chromium/src". Mandatory. 78 string project = 2; 79 80 // Commit ref, e.g. "refs/heads/main" from which the commit was fetched. 81 // Not the branch name, use "refs/heads/branch" 82 // Mandatory. 83 string ref = 3; 84 85 // Commit HEX SHA1. All lowercase. Mandatory. 86 string commit_hash = 4; 87 88 // Defines a total order of commits on the ref. 89 // A positive, monotonically increasing integer. The recommended 90 // way of obtaining this is by using the goto.google.com/git-numberer 91 // Gerrit plugin. Other solutions can be used as well, so long 92 // as the same scheme is used consistently for a ref. 93 // Mandatory. 94 int64 position = 5; 95 } 96 97 // A Gerrit patchset. 98 message GerritChange { 99 // Gerrit hostname, e.g. "chromium-review.googlesource.com". 100 string host = 1; 101 // Gerrit project, e.g. "chromium/src". 102 string project = 2; 103 // Change number, e.g. 12345. 104 int64 change = 3; 105 // Patch set number, e.g. 1. 106 int64 patchset = 4; 107 } 108 109 // Deprecated: Use GitilesCommit instead. 110 message CommitPosition { 111 // The following fields identify a git repository and a ref within which the 112 // numerical position below identifies a single commit. 113 string host = 1; 114 string project = 2; 115 string ref = 3; 116 117 // The numerical position of the commit in the log for the host/project/ref 118 // above. 119 int64 position = 4; 120 } 121 122 // Deprecated: Do not use. 123 message CommitPositionRange { 124 // The lowest commit position to include in the range. 125 CommitPosition earliest = 1; 126 127 // Include only commit positions that that are strictly lower than this. 128 CommitPosition latest = 2; 129 } 130 131 // A range of timestamps. 132 // 133 // Currently unused. 134 message TimeRange { 135 // The oldest timestamp to include in the range. 136 google.protobuf.Timestamp earliest = 1; 137 138 // Include only timestamps that are strictly older than this. 139 google.protobuf.Timestamp latest = 2; 140 } 141 142 143 // Represents a reference in a source control system. 144 message SourceRef { 145 // The source control system used. 146 // Only gitiles is supported at this moment. If other systems need to be 147 // supported in future (e.g. non-gitiles git, subversion, google storage 148 // buckets), they can be added here 149 oneof system { 150 // A branch in gitiles repository. 151 GitilesRef gitiles = 1; 152 } 153 } 154 155 // Represents a branch in a gitiles repository. 156 message GitilesRef { 157 // The gitiles host, e.g. "chromium.googlesource.com". 158 string host = 1; 159 160 // The project on the gitiles host, e.g. "chromium/src". 161 string project = 2; 162 163 // Commit ref, e.g. "refs/heads/main" from which the commit was fetched. 164 // Not the branch name, use "refs/heads/branch" 165 string ref = 3; 166 }