aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/googleapis/google/devtools/build/v1/build_events.proto
blob: e745aee8285aa50445ac5918d465ab1239f10047 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
// Copyright 2017 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.devtools.build.v1;

import "google/api/annotations.proto";
import "google/devtools/build/v1/build_status.proto";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "google/rpc/status.proto";

option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/devtools/build/v1;build";
option java_multiple_files = true;
option java_outer_classname = "BuildEventProto";
option java_package = "com.google.devtools.build.v1";


// An event representing some state change that occured in the build. This
// message does not include field for uniquely identifying an event.
message BuildEvent {
  // Notification that the build system has attempted to run the build tool.
  message InvocationAttemptStarted {
    // The number of the invocation attempt, starting at 1 and increasing by 1
    // for each new attempt. Can be used to determine if there is a later
    // invocation attempt replacing the current one a client is processing.
    int64 attempt_number = 1;
  }

  // Notification that an invocation attempt has finished.
  message InvocationAttemptFinished {
    // The status of the build request.
    // If OK, the build request was run, though this does not mean the
    // requested build tool succeeded. "exit_code" will be set to the
    // exit code of the build tool.
    // If not OK, the build request was not successfully executed.
    // "exit_code" will not be set.
    google.rpc.Status status = 1;

    // The exit code of the build tool.
    google.protobuf.Int32Value exit_code = 2;

    // Final status of the invocation.
    BuildStatus invocation_status = 3;
  }

  // Notification that the build request is enqueued. It could happen when
  // a new build request is inserted into the build queue, or when a
  // build request is put back into the build queue due to a previous build
  // failure.
  message BuildEnqueued {

  }

  // Notification that the build request has finished, and no further
  // invocations will occur.  Note that this applies to the entire Build.
  // Individual invocations trigger InvocationFinished when they finish.
  message BuildFinished {
    // Final status of the build.
    BuildStatus status = 1;
  }

  // Textual output written to standard output or standard error.
  message ConsoleOutput {
    // The output stream type.
    ConsoleOutputStream type = 1;

    // The output stream content.
    oneof output {
      // Regular UTF-8 output; normal text.
      string text_output = 2;

      // Used if the output is not UTF-8 text (for example, a binary proto).
      bytes binary_output = 3;
    }
  }

  // Notification of the end of a build event stream published by a build
  // component other than CONTROLLER (See StreamId.BuildComponents).
  message BuildComponentStreamFinished {
    // How did the event stream finish.
    enum FinishType {
      // Unknown or unspecified; callers should never set this value.
      FINISH_TYPE_UNSPECIFIED = 0;

      // Set by the event publisher to indicate a build event stream is
      // finished.
      FINISHED = 1;

      // Set by the WatchBuild RPC server when the publisher of a build event
      // stream stops publishing events without publishing a
      // BuildComponentStreamFinished event whose type equals FINISHED.
      EXPIRED = 2;
    }

    // How the event stream finished.
    FinishType type = 1;
  }

  // The timestamp of this event.
  google.protobuf.Timestamp event_time = 1;

  // //////////////////////////////////////////////////////////////////////////
  // Events that indicate a state change of a build request in the build
  // queue.
  oneof event {
    // An invocation attempt has started.
    InvocationAttemptStarted invocation_attempt_started = 51;

    // An invocation attempt has finished.
    InvocationAttemptFinished invocation_attempt_finished = 52;

    // The build is enqueued (just inserted to the build queue or put back
    // into the build queue due to a previous build failure).
    BuildEnqueued build_enqueued = 53;

    // The build has finished. Set when the build is terminated.
    BuildFinished build_finished = 55;

    // An event containing printed text.
    ConsoleOutput console_output = 56;

    // Indicates the end of a build event stream (with the same StreamId) from
    // a build component executing the requested build task.
    // *** This field does not indicate the WatchBuild RPC is finished. ***
    BuildComponentStreamFinished component_stream_finished = 59;

    // Structured build event generated by Bazel about its execution progress.
    google.protobuf.Any bazel_event = 60;

    // An event that contains supplemental tool-specific information about
    // build execution.
    google.protobuf.Any build_execution_event = 61;

    // An event that contains supplemental tool-specific information about
    // source fetching.
    google.protobuf.Any source_fetch_event = 62;
  }
}

// Unique identifier for a build event stream.
message StreamId {
  // Which build component generates this event stream. Each build component
  // may generate one event stream.
  enum BuildComponent {
    // Unknown or unspecified; callers should never set this value.
    UNKNOWN_COMPONENT = 0;

    // A component that coordinates builds.
    CONTROLLER = 1;

    // A component that runs executables needed to complete a build.
    WORKER = 2;

    // A component that builds something.
    TOOL = 3;

    DEPRECATED = 4;
  }

  int64 project_number = 5;

  // The id of a Build message.
  string build_id = 1;

  // The unique invocation ID within this build.
  // It should be the same as {invocation} (below) during the migration.
  string invocation_id = 6;

  // The component that emitted this event.
  BuildComponent component = 3;

  // The unique invocation ID within this build.
  // It should be the same as {invocation_id} below during the migration.
  string invocation = 4;
}

// The type of console output stream.
enum ConsoleOutputStream {
  // Unspecified or unknown.
  UNKNOWN = 0;

  // Normal output stream.
  STDOUT = 1;

  // Error output stream.
  STDERR = 2;
}