1 // Copyright 2018 Google LLC.
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
7 // http://www.apache.org/licenses/LICENSE-2.0
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.
18 package google.devtools.build.v1;
20 import "google/api/annotations.proto";
21 import "google/devtools/build/v1/build_status.proto";
22 import "google/protobuf/any.proto";
23 import "google/protobuf/timestamp.proto";
25 option cc_enable_arenas = true;
26 option go_package = "google.golang.org/genproto/googleapis/devtools/build/v1;build";
27 option java_multiple_files = true;
28 option java_outer_classname = "BuildEventProto";
29 option java_package = "com.google.devtools.build.v1";
31 // An event representing some state change that occurred in the build. This
32 // message does not include field for uniquely identifying an event.
34 // Notification that the build system has attempted to run the build tool.
35 message InvocationAttemptStarted {
36 // The number of the invocation attempt, starting at 1 and increasing by 1
37 // for each new attempt. Can be used to determine if there is a later
38 // invocation attempt replacing the current one a client is processing.
39 int64 attempt_number = 1;
41 // Additional details about the invocation.
42 google.protobuf.Any details = 2;
45 // Notification that an invocation attempt has finished.
46 message InvocationAttemptFinished {
47 // Final status of the invocation.
48 BuildStatus invocation_status = 3;
51 // Notification that the build request is enqueued.
52 message BuildEnqueued {
53 // Additional details about the Build.
54 google.protobuf.Any details = 1;
57 // Notification that the build request has finished, and no further
58 // invocations will occur. Note that this applies to the entire Build.
59 // Individual invocations trigger InvocationFinished when they finish.
60 message BuildFinished {
61 // Final status of the build.
62 BuildStatus status = 1;
65 // Textual output written to standard output or standard error.
66 message ConsoleOutput {
67 // The output stream type.
68 ConsoleOutputStream type = 1;
70 // The output stream content.
72 // Regular UTF-8 output; normal text.
73 string text_output = 2;
75 // Used if the output is not UTF-8 text (for example, a binary proto).
76 bytes binary_output = 3;
80 // Notification of the end of a build event stream published by a build
81 // component other than CONTROLLER (See StreamId.BuildComponents).
82 message BuildComponentStreamFinished {
83 // How did the event stream finish.
85 // Unknown or unspecified; callers should never set this value.
86 FINISH_TYPE_UNSPECIFIED = 0;
88 // Set by the event publisher to indicate a build event stream is
92 // Set by the WatchBuild RPC server when the publisher of a build event
93 // stream stops publishing events without publishing a
94 // BuildComponentStreamFinished event whose type equals FINISHED.
98 // How the event stream finished.
102 // The timestamp of this event.
103 google.protobuf.Timestamp event_time = 1;
105 // //////////////////////////////////////////////////////////////////////////
106 // Events that indicate a state change of a build request in the build
109 // An invocation attempt has started.
110 InvocationAttemptStarted invocation_attempt_started = 51;
112 // An invocation attempt has finished.
113 InvocationAttemptFinished invocation_attempt_finished = 52;
115 // The build is enqueued (just inserted to the build queue or put back
116 // into the build queue due to a previous build failure).
117 BuildEnqueued build_enqueued = 53;
119 // The build has finished. Set when the build is terminated.
120 BuildFinished build_finished = 55;
122 // An event containing printed text.
123 ConsoleOutput console_output = 56;
125 // Indicates the end of a build event stream (with the same StreamId) from
126 // a build component executing the requested build task.
127 // *** This field does not indicate the WatchBuild RPC is finished. ***
128 BuildComponentStreamFinished component_stream_finished = 59;
130 // Structured build event generated by Bazel about its execution progress.
131 google.protobuf.Any bazel_event = 60;
133 // An event that contains supplemental tool-specific information about
135 google.protobuf.Any build_execution_event = 61;
137 // An event that contains supplemental tool-specific information about
139 google.protobuf.Any source_fetch_event = 62;
143 // Unique identifier for a build event stream.
145 // Which build component generates this event stream. Each build component
146 // may generate one event stream.
147 enum BuildComponent {
148 // Unknown or unspecified; callers should never set this value.
149 UNKNOWN_COMPONENT = 0;
151 // A component that coordinates builds.
154 // A component that runs executables needed to complete a build.
157 // A component that builds something.
161 // The id of a Build message.
164 // The unique invocation ID within this build.
165 // It should be the same as {invocation} (below) during the migration.
166 string invocation_id = 6;
168 // The component that emitted this event.
169 BuildComponent component = 3;
172 // The type of console output stream.
173 enum ConsoleOutputStream {
174 // Unspecified or unknown.
177 // Normal output stream.
180 // Error output stream.