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/resource.proto"; 20import "google/devtools/resultstore/v2/common.proto"; 21import "google/devtools/resultstore/v2/file.proto"; 22 23option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore"; 24option java_multiple_files = true; 25option java_outer_classname = "TargetProto"; 26option java_package = "com.google.devtools.resultstore.v2"; 27 28// Each Target represents data for a given target in a given Invocation. 29// ConfiguredTarget and Action resources under each Target contain the bulk of 30// the data. 31message Target { 32 option (google.api.resource) = { 33 type: "resultstore.googleapis.com/Target" 34 pattern: "invocations/{invocation}/targets/{target}" 35 }; 36 37 // The resource ID components that identify the Target. 38 message Id { 39 // The Invocation ID. 40 string invocation_id = 1; 41 42 // The Target ID. 43 string target_id = 2; 44 } 45 46 // The resource name. Its format must be: 47 // invocations/${INVOCATION_ID}/targets/${url_encode(TARGET_ID)} 48 string name = 1; 49 50 // The resource ID components that identify the Target. They must match the 51 // resource name after proper encoding. 52 Id id = 2; 53 54 // This is the aggregate status of the target. 55 // DEPRECATED - use ConfiguredTarget.status_attributes instead 56 StatusAttributes status_attributes = 3 [deprecated = true]; 57 58 // When this target started and its duration. 59 Timing timing = 4; 60 61 // Attributes that apply to all targets. 62 TargetAttributes target_attributes = 5; 63 64 // Attributes that apply to all test actions under this target. 65 TestAttributes test_attributes = 6; 66 67 // Arbitrary name-value pairs. 68 // This is implemented as a multi-map. Multiple properties are allowed with 69 // the same key. Properties will be returned in lexicographical order by key. 70 repeated Property properties = 7; 71 72 // A list of file references for target level files. 73 // The file IDs must be unique within this list. Duplicate file IDs will 74 // result in an error. Files will be returned in lexicographical order by ID. 75 // Use this field to specify outputs not related to a configuration. 76 repeated File files = 8; 77 78 // Provides a hint to clients as to whether to display the Target to users. 79 // If true then clients likely want to display the Target by default. 80 // Once set to true, this may not be set back to false. 81 bool visible = 10; 82} 83 84// Attributes that apply to all targets. 85message TargetAttributes { 86 // If known, indicates the type of this target. In bazel this corresponds 87 // to the rule-suffix. 88 TargetType type = 1; 89 90 // If known, the main language of this target, e.g. java, cc, python, etc. 91 Language language = 2; 92 93 // The tags attribute of the build rule. These should be short, descriptive 94 // words, and there should only be a few of them. 95 // This is implemented as a set. All tags will be unique. Any duplicate tags 96 // will be ignored. Tags will be returned in lexicographical order. 97 repeated string tags = 3; 98} 99 100// Attributes that apply only to test actions under this target. 101message TestAttributes { 102 // Indicates how big the user indicated the test action was. 103 TestSize size = 1; 104} 105 106// These correspond to the suffix of the rule name. Eg cc_test has type TEST. 107enum TargetType { 108 // Unspecified by the build system. 109 TARGET_TYPE_UNSPECIFIED = 0; 110 111 // An application e.g. ios_application. 112 APPLICATION = 1; 113 114 // A binary target e.g. cc_binary. 115 BINARY = 2; 116 117 // A library target e.g. java_library 118 LIBRARY = 3; 119 120 // A package 121 PACKAGE = 4; 122 123 // Any test target, in bazel that means a rule with a '_test' suffix. 124 TEST = 5; 125} 126 127// Indicates how big the user indicated the test action was. 128enum TestSize { 129 // Unspecified by the user. 130 TEST_SIZE_UNSPECIFIED = 0; 131 132 // Unit test taking less than 1 minute. 133 SMALL = 1; 134 135 // Integration tests taking less than 5 minutes. 136 MEDIUM = 2; 137 138 // End-to-end tests taking less than 15 minutes. 139 LARGE = 3; 140 141 // Even bigger than LARGE. 142 ENORMOUS = 4; 143 144 // Something that doesn't fit into the above categories. 145 OTHER_SIZE = 5; 146} 147