target.proto 4.5 KB

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