xref: /aosp_15_r20/external/googleapis/google/devtools/resultstore/v2/common.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
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
15syntax = "proto3";
16
17package google.devtools.resultstore.v2;
18
19import "google/api/field_behavior.proto";
20import "google/protobuf/duration.proto";
21import "google/protobuf/timestamp.proto";
22
23option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
24option java_multiple_files = true;
25option java_outer_classname = "CommonProto";
26option java_package = "com.google.devtools.resultstore.v2";
27
28// Describes the status of a resource in both enum and string form.
29// Only use description when conveying additional info not captured in the enum
30// name.
31message StatusAttributes {
32  // Enum representation of the status.
33  Status status = 1;
34
35  // A longer description about the status.
36  string description = 2;
37}
38
39// A generic key-value property definition.
40message Property {
41  // The key.
42  string key = 1;
43
44  // The value.
45  string value = 2;
46}
47
48// The timing of a particular Invocation, Action, etc. The start_time is
49// specified, stop time can be calculated by adding duration to start_time.
50message Timing {
51  // The time the resource started running. This is in UTC Epoch time.
52  google.protobuf.Timestamp start_time = 1;
53
54  // The duration for which the resource ran.
55  google.protobuf.Duration duration = 2;
56}
57
58// Represents a dependency of a resource on another resource. This can be used
59// to define a graph or a workflow paradigm through resources.
60message Dependency {
61  // The resource ID components of a resource depended upon. It may be a Target,
62  // ConfiguredTarget, or Action, with the appropriate components filled in.
63  // Invocation ID is elided, as this must point to a resource under this
64  // Invocation.
65  message Id {
66    // The unencoded Target ID of the Target, ConfiguredTarget, or Action.
67    string target_id = 2;
68
69    // The Configuration ID of the ConfiguredTarget, or Action.
70    string configuration_id = 3;
71
72    // The Action ID of the Action.
73    string action_id = 4;
74  }
75
76  // The resource depended upon. It may be a Target, ConfiguredTarget, or
77  // Action.
78  oneof resource {
79    // Output only. The name of a target.  Its format must be:
80    // invocations/${INVOCATION_ID}/targets/${url_encode(TARGET_ID)}
81    // This must point to a target under the same invocation.
82    string target = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
83
84    // Output only. The name of a configured target.  Its format must be:
85    // invocations/${INVOCATION_ID}/targets/${url_encode(TARGET_ID)}/configuredTargets/${CONFIG_ID}
86    // This must point to a configured target under the same invocation.
87    string configured_target = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
88
89    // Output only. The name of an action.  Its format must be:
90    // invocations/${INVOCATION_ID}/targets/${url_encode(TARGET_ID)}/configuredTargets/${CONFIG_ID}/actions/${ACTION_ID}
91    // This must point to an action under the same invocation.
92    string action = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
93  }
94
95  // The ID of the resource depended upon, matching resource name above.
96  Id id = 5;
97
98  // A label describing this dependency.
99  // The label "Root Cause" is handled specially. It is used to point to the
100  // exact resource that caused a resource to fail.
101  string label = 4;
102}
103
104// These correspond to the prefix of the rule name. Eg cc_test has language CC.
105enum Language {
106  // Language unspecified or not listed here.
107  LANGUAGE_UNSPECIFIED = 0;
108
109  // Not related to any particular language
110  NONE = 1;
111
112  // Android
113  ANDROID = 2;
114
115  // ActionScript (Flash)
116  AS = 3;
117
118  // C++ or C
119  CC = 4;
120
121  // Cascading-Style-Sheets
122  CSS = 5;
123
124  // Dart
125  DART = 6;
126
127  // Go
128  GO = 7;
129
130  // Google-Web-Toolkit
131  GWT = 8;
132
133  // Haskell
134  HASKELL = 9;
135
136  // Java
137  JAVA = 10;
138
139  // Javascript
140  JS = 11;
141
142  // Lisp
143  LISP = 12;
144
145  // Objective-C
146  OBJC = 13;
147
148  // Python
149  PY = 14;
150
151  // Shell (Typically Bash)
152  SH = 15;
153
154  // Swift
155  SWIFT = 16;
156
157  // TypeScript
158  TS = 18;
159
160  // Webtesting
161  WEB = 19;
162
163  // Scala
164  SCALA = 20;
165
166  // Protocol Buffer
167  PROTO = 21;
168
169  // Extensible Markup Language
170  XML = 22;
171}
172
173// Status of a resource.
174enum Status {
175  // The implicit default enum value. Should never be set.
176  STATUS_UNSPECIFIED = 0;
177
178  // Displays as "Building". Means the target is compiling, linking, etc.
179  BUILDING = 1;
180
181  // Displays as "Built". Means the target was built successfully.
182  // If testing was requested, it should never reach this status: it should go
183  // straight from BUILDING to TESTING.
184  BUILT = 2;
185
186  // Displays as "Broken". Means build failure such as compile error.
187  FAILED_TO_BUILD = 3;
188
189  // Displays as "Testing". Means the test is running.
190  TESTING = 4;
191
192  // Displays as "Passed". Means the test was run and passed.
193  PASSED = 5;
194
195  // Displays as "Failed". Means the test was run and failed.
196  FAILED = 6;
197
198  // Displays as "Timed out". Means the test didn't finish in time.
199  TIMED_OUT = 7;
200
201  // Displays as "Cancelled". Means the build or test was cancelled.
202  // E.g. User hit control-C.
203  CANCELLED = 8;
204
205  // Displays as "Tool Failed". Means the build or test had internal tool
206  // failure.
207  TOOL_FAILED = 9;
208
209  // Displays as "Incomplete". Means the build or test did not complete.  This
210  // might happen when a build breakage or test failure causes the tool to stop
211  // trying to build anything more or run any more tests, with the default
212  // bazel --nokeep_going option or the --notest_keep_going option.
213  INCOMPLETE = 10;
214
215  // Displays as "Flaky". Means the aggregate status contains some runs that
216  // were successful, and some that were not.
217  FLAKY = 11;
218
219  // Displays as "Unknown". Means the tool uploading to the server died
220  // mid-upload or does not know the state.
221  UNKNOWN = 12;
222
223  // Displays as "Skipped". Means building and testing were skipped.
224  // (E.g. Restricted to a different configuration.)
225  SKIPPED = 13;
226}
227
228// Indicates the upload status of the invocation, whether it is
229// post-processing, or immutable, etc.
230enum UploadStatus {
231  // The implicit default enum value. Should never be set.
232  UPLOAD_STATUS_UNSPECIFIED = 0;
233
234  // The invocation is still uploading to the ResultStore.
235  UPLOADING = 1;
236
237  // The invocation upload is complete. The ResultStore is still post-processing
238  // the invocation.
239  POST_PROCESSING = 2;
240
241  // All post-processing is complete, and the invocation is now immutable.
242  // Data may be subject to TTL and can be deleted.
243  IMMUTABLE = 3;
244}
245