build_events.proto 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. // Copyright 2020 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.build.v1;
  16. import "google/devtools/build/v1/build_status.proto";
  17. import "google/protobuf/any.proto";
  18. import "google/protobuf/timestamp.proto";
  19. option cc_enable_arenas = true;
  20. option go_package = "google.golang.org/genproto/googleapis/devtools/build/v1;build";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "BuildEventProto";
  23. option java_package = "com.google.devtools.build.v1";
  24. option php_namespace = "Google\\Cloud\\Build\\V1";
  25. // An event representing some state change that occurred in the build. This
  26. // message does not include field for uniquely identifying an event.
  27. message BuildEvent {
  28. // Notification that the build system has attempted to run the build tool.
  29. message InvocationAttemptStarted {
  30. // The number of the invocation attempt, starting at 1 and increasing by 1
  31. // for each new attempt. Can be used to determine if there is a later
  32. // invocation attempt replacing the current one a client is processing.
  33. int64 attempt_number = 1;
  34. // Arbitrary details about the invocation attempt.
  35. google.protobuf.Any details = 2;
  36. }
  37. // Notification that an invocation attempt has finished.
  38. message InvocationAttemptFinished {
  39. // Final status of the invocation.
  40. BuildStatus invocation_status = 3;
  41. // Arbitrary details about the invocation attempt.
  42. google.protobuf.Any details = 4;
  43. }
  44. // Notification that the build request is enqueued.
  45. message BuildEnqueued {
  46. // Additional details about the Build.
  47. google.protobuf.Any details = 1;
  48. }
  49. // Notification that the build request has finished, and no further
  50. // invocations will occur. Note that this applies to the entire Build.
  51. // Individual invocations trigger InvocationFinished when they finish.
  52. message BuildFinished {
  53. // Final status of the build.
  54. BuildStatus status = 1;
  55. // Additional details about the Build.
  56. google.protobuf.Any details = 2;
  57. }
  58. // Textual output written to standard output or standard error.
  59. message ConsoleOutput {
  60. // The output stream type.
  61. ConsoleOutputStream type = 1;
  62. // The output stream content.
  63. oneof output {
  64. // Regular UTF-8 output; normal text.
  65. string text_output = 2;
  66. // Used if the output is not UTF-8 text (for example, a binary proto).
  67. bytes binary_output = 3;
  68. }
  69. }
  70. // Notification of the end of a build event stream published by a build
  71. // component other than CONTROLLER (See StreamId.BuildComponents).
  72. message BuildComponentStreamFinished {
  73. // How did the event stream finish.
  74. enum FinishType {
  75. // Unknown or unspecified; callers should never set this value.
  76. FINISH_TYPE_UNSPECIFIED = 0;
  77. // Set by the event publisher to indicate a build event stream is
  78. // finished.
  79. FINISHED = 1;
  80. // Set by the WatchBuild RPC server when the publisher of a build event
  81. // stream stops publishing events without publishing a
  82. // BuildComponentStreamFinished event whose type equals FINISHED.
  83. EXPIRED = 2;
  84. }
  85. // How the event stream finished.
  86. FinishType type = 1;
  87. }
  88. // The timestamp of this event.
  89. google.protobuf.Timestamp event_time = 1;
  90. // //////////////////////////////////////////////////////////////////////////
  91. // Events that indicate a state change of a build request in the build
  92. // queue.
  93. oneof event {
  94. // An invocation attempt has started.
  95. InvocationAttemptStarted invocation_attempt_started = 51;
  96. // An invocation attempt has finished.
  97. InvocationAttemptFinished invocation_attempt_finished = 52;
  98. // The build is enqueued.
  99. BuildEnqueued build_enqueued = 53;
  100. // The build has finished. Set when the build is terminated.
  101. BuildFinished build_finished = 55;
  102. // An event containing printed text.
  103. ConsoleOutput console_output = 56;
  104. // Indicates the end of a build event stream (with the same StreamId) from
  105. // a build component executing the requested build task.
  106. // *** This field does not indicate the WatchBuild RPC is finished. ***
  107. BuildComponentStreamFinished component_stream_finished = 59;
  108. // Structured build event generated by Bazel about its execution progress.
  109. google.protobuf.Any bazel_event = 60;
  110. // An event that contains supplemental tool-specific information about
  111. // build execution.
  112. google.protobuf.Any build_execution_event = 61;
  113. // An event that contains supplemental tool-specific information about
  114. // source fetching.
  115. google.protobuf.Any source_fetch_event = 62;
  116. }
  117. }
  118. // Unique identifier for a build event stream.
  119. message StreamId {
  120. // Which build component generates this event stream. Each build component
  121. // may generate one event stream.
  122. enum BuildComponent {
  123. // Unknown or unspecified; callers should never set this value.
  124. UNKNOWN_COMPONENT = 0;
  125. // A component that coordinates builds.
  126. CONTROLLER = 1;
  127. // A component that runs executables needed to complete a build.
  128. WORKER = 2;
  129. // A component that builds something.
  130. TOOL = 3;
  131. }
  132. // The id of a Build message.
  133. string build_id = 1;
  134. // The unique invocation ID within this build.
  135. // It should be the same as {invocation} (below) during the migration.
  136. string invocation_id = 6;
  137. // The component that emitted this event.
  138. BuildComponent component = 3;
  139. }
  140. // The type of console output stream.
  141. enum ConsoleOutputStream {
  142. // Unspecified or unknown.
  143. UNKNOWN = 0;
  144. // Normal output stream.
  145. STDOUT = 1;
  146. // Error output stream.
  147. STDERR = 2;
  148. }