invocation.proto 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/devtools/resultstore/v2/common.proto";
  19. import "google/devtools/resultstore/v2/coverage.proto";
  20. import "google/devtools/resultstore/v2/coverage_summary.proto";
  21. import "google/devtools/resultstore/v2/file.proto";
  22. import "google/devtools/resultstore/v2/file_processing_error.proto";
  23. option go_package = "google.golang.org/genproto/googleapis/devtools/resultstore/v2;resultstore";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "InvocationProto";
  26. option java_package = "com.google.devtools.resultstore.v2";
  27. // An Invocation typically represents the result of running a tool. Each has a
  28. // unique ID, typically generated by the server. Target resources under each
  29. // Invocation contain the bulk of the data.
  30. message Invocation {
  31. option (google.api.resource) = {
  32. type: "resultstore.googleapis.com/Invocation"
  33. pattern: "invocations/{invocation}"
  34. };
  35. // The resource ID components that identify the Invocation.
  36. message Id {
  37. // The Invocation ID.
  38. string invocation_id = 1;
  39. }
  40. // The resource name. Its format must be:
  41. // invocations/${INVOCATION_ID}
  42. string name = 1;
  43. // The resource ID components that identify the Invocation. They must match
  44. // the resource name after proper encoding.
  45. Id id = 2;
  46. // The aggregate status of the invocation.
  47. StatusAttributes status_attributes = 3;
  48. // When this invocation started and its duration.
  49. Timing timing = 4;
  50. // Attributes of this invocation.
  51. InvocationAttributes invocation_attributes = 5;
  52. // The workspace the tool was run in.
  53. WorkspaceInfo workspace_info = 6;
  54. // Arbitrary name-value pairs.
  55. // This is implemented as a multi-map. Multiple properties are allowed with
  56. // the same key. Properties will be returned in lexicographical order by key.
  57. repeated Property properties = 7;
  58. // A list of file references for invocation level files.
  59. // The file IDs must be unique within this list. Duplicate file IDs will
  60. // result in an error. Files will be returned in lexicographical order by ID.
  61. // Use this field to specify build logs, and other invocation level logs.
  62. //
  63. // Files with the following reserved file IDs cause specific post-processing
  64. // or have special handling. These files must be immediately available to
  65. // ResultStore for processing when the reference is uploaded.
  66. //
  67. // build.log: The primary log for the Invocation.
  68. // coverage_report.lcov: Aggregate coverage report for the invocation.
  69. repeated File files = 8;
  70. // Summary of aggregate coverage across all Actions in this Invocation.
  71. // If missing, this data will be populated by the server from the
  72. // coverage_report.lcov file or the union of all ActionCoverages under this
  73. // invocation (in that order).
  74. repeated LanguageCoverageSummary coverage_summaries = 9;
  75. // Aggregate code coverage for all build and test Actions within this
  76. // Invocation. If missing, this data will be populated by the server
  77. // from the coverage_report.lcov file or the union of all ActionCoverages
  78. // under this invocation (in that order).
  79. AggregateCoverage aggregate_coverage = 10;
  80. // NOT IMPLEMENTED.
  81. // ResultStore will read and parse Files with reserved IDs listed above. Read
  82. // and parse errors for all these Files are reported here.
  83. // This is implemented as a map, with one FileProcessingErrors for each file.
  84. // Typically produced when parsing Files, but may also be provided directly
  85. // by clients.
  86. repeated FileProcessingErrors file_processing_errors = 11;
  87. }
  88. // If known, represents the state of the user/build-system workspace.
  89. message WorkspaceContext {
  90. }
  91. // Describes the workspace under which the tool was invoked, this includes
  92. // information that was fed into the command, the source code referenced, and
  93. // the tool itself.
  94. message WorkspaceInfo {
  95. // Data about the workspace that might be useful for debugging.
  96. WorkspaceContext workspace_context = 1;
  97. // Where the tool was invoked
  98. string hostname = 3;
  99. // The client's working directory where the build/test was run from.
  100. string working_directory = 4;
  101. // Tools should set tool_tag to the name of the tool or use case.
  102. string tool_tag = 5;
  103. // The command lines invoked. The first command line is the one typed by the
  104. // user, then each one after that should be an expansion of the previous
  105. // command line.
  106. repeated CommandLine command_lines = 7;
  107. }
  108. // The command and arguments that produced this Invocation.
  109. message CommandLine {
  110. // A label describing this command line.
  111. string label = 1;
  112. // The command-line tool that is run: argv[0].
  113. string tool = 2;
  114. // The arguments to the above tool: argv[1]...argv[N].
  115. repeated string args = 3;
  116. // The subcommand that was run with the tool, usually "build" or "test".
  117. // For example, in the Bazel command "bazel build //foo", this would be set
  118. // to "build". Omit if the tool doesn't accept a subcommand. This is must
  119. // be a reference to one of values in args.
  120. string command = 4;
  121. }
  122. // Attributes that apply to all invocations.
  123. message InvocationAttributes {
  124. // Immutable. The Cloud Project that owns this invocation (this is different than the
  125. // Consumer Cloud Project that calls this API).
  126. // This must be set in the CreateInvocation call, and can't be changed.
  127. // As input, callers can set this field to a project id (string) or a
  128. // stringified int64 project number. As output, the API populates this field
  129. // with the stringified int64 project number (per
  130. // https://google.aip.dev/cloud/2510).
  131. string project_id = 1 [(google.api.field_behavior) = IMMUTABLE];
  132. // The list of users in the command chain. The first user in this sequence
  133. // is the one who instigated the first command in the chain. For example,
  134. // this might contain just the user that ran a Bazel command, or a robot
  135. // that tested a change as part of a CI system. It could also contain the user
  136. // that manually triggered a CI test, then the robot that ran the test.
  137. repeated string users = 2;
  138. // Labels to categorize this invocation.
  139. // This is implemented as a set. All labels will be unique. Any duplicate
  140. // labels added will be ignored. Labels will be returned in lexicographical
  141. // order. Labels should be a list of words describing the Invocation. Labels
  142. // should be short, easy to read, and you shouldn't have more than a handful.
  143. // Labels should not be used for unique properties such as unique IDs. Use
  144. // properties in cases that don't meet these conditions.
  145. repeated string labels = 3;
  146. // This field describes the overall context or purpose of this invocation.
  147. // It will be used in the UI to give users more information about
  148. // how or why this invocation was run.
  149. string description = 4;
  150. // If this Invocation was run in the context of a larger Continuous
  151. // Integration build or other automated system, this field may contain more
  152. // information about the greater context.
  153. repeated InvocationContext invocation_contexts = 6;
  154. // Exit code of the process that ran the invocation. A non-zero value
  155. // means failure. For example, the exit code of a "bazel test" command.
  156. int32 exit_code = 7;
  157. }
  158. // Describes the invocation context which includes a display name and URL.
  159. message InvocationContext {
  160. // A human readable name for the context under which this Invocation was run.
  161. string display_name = 1;
  162. // A URL pointing to a UI containing more information
  163. string url = 2;
  164. }