Skip to content

Commit 53d620a

Browse files
Google APIscopybara-github
authored andcommitted
feat: Chrome OS Moblab API: add a new build label field to the Build resource proto
PiperOrigin-RevId: 520792552
1 parent 7bed0dd commit 53d620a

3 files changed

Lines changed: 62 additions & 35 deletions

File tree

google/chromeos/moblab/v1beta1/build_service.proto

Lines changed: 50 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -38,7 +38,8 @@ service BuildService {
3838
"https://www.googleapis.com/auth/moblabapi";
3939

4040
// Lists all build targets that a user has access to.
41-
rpc ListBuildTargets(ListBuildTargetsRequest) returns (ListBuildTargetsResponse) {
41+
rpc ListBuildTargets(ListBuildTargetsRequest)
42+
returns (ListBuildTargetsResponse) {
4243
option (google.api.http) = {
4344
get: "/v1beta1/buildTargets"
4445
};
@@ -63,18 +64,21 @@ service BuildService {
6364

6465
// Checks the stage status for a given build artifact in a partner Google
6566
// Cloud Storage bucket.
66-
rpc CheckBuildStageStatus(CheckBuildStageStatusRequest) returns (CheckBuildStageStatusResponse) {
67+
rpc CheckBuildStageStatus(CheckBuildStageStatusRequest)
68+
returns (CheckBuildStageStatusResponse) {
6769
option (google.api.http) = {
6870
get: "/v1beta1/{name=buildTargets/*/models/*/builds/*/artifacts/*}:check"
6971
};
7072
option (google.api.method_signature) = "name";
7173
}
7274

7375
// Stages a given build artifact from a internal Google Cloud Storage bucket
74-
// to a partner Google Cloud Storage bucket. If any of objects has already
75-
// been copied, it will overwrite the previous objects. Operation <response:
76-
// [StageBuildResponse][google.chromeos.moblab.v1beta1.StageBuildResponse],
77-
// metadata: [StageBuildMetadata][google.chromeos.moblab.v1beta1.StageBuildMetadata]>
76+
// to a partner Google Cloud Storage bucket. The stage will be skipped if all
77+
// the objects in the partner bucket are the same as in the internal bucket.
78+
// Operation
79+
// <response:[StageBuildResponse][google.chromeos.moblab.v1beta1.StageBuildResponse],
80+
// metadata:
81+
// [StageBuildMetadata][google.chromeos.moblab.v1beta1.StageBuildMetadata]>
7882
rpc StageBuild(StageBuildRequest) returns (google.longrunning.Operation) {
7983
option (google.api.http) = {
8084
post: "/v1beta1/{name=buildTargets/*/models/*/builds/*/artifacts/*}:stage"
@@ -88,7 +92,7 @@ service BuildService {
8892
}
8993

9094
// Finds the most stable build for the given build target. The definition of
91-
// the most stable build is determined by evaluating the following rules in
95+
// the most stable build is determined by evaluating the following rule in
9296
// order until one is true. If none are true, then there is no stable build
9397
// and it will return an empty response.
9498
//
@@ -99,7 +103,8 @@ service BuildService {
99103
// 4. Most recent stable channel build with build status Pass
100104
// 5. Most recent beta channel build with build status Pass
101105
// 6. Most recent dev channel build with build status Pass
102-
rpc FindMostStableBuild(FindMostStableBuildRequest) returns (FindMostStableBuildResponse) {
106+
rpc FindMostStableBuild(FindMostStableBuildRequest)
107+
returns (FindMostStableBuildResponse) {
103108
option (google.api.http) = {
104109
get: "/v1beta1/{build_target=buildTargets/*}:findMostStableBuild"
105110
};
@@ -108,6 +113,7 @@ service BuildService {
108113
}
109114

110115
// Request message for finding the most stable build.
116+
// -- NEXT_TAG: 2 --
111117
message FindMostStableBuildRequest {
112118
// Required. The full resource name of the build target.
113119
// For example,
@@ -121,22 +127,25 @@ message FindMostStableBuildRequest {
121127
}
122128

123129
// Response message for finding the most stable build.
130+
// -- NEXT_TAG: 2 --
124131
message FindMostStableBuildResponse {
125132
// The most stable build.
126133
Build build = 1;
127134
}
128135

129136
// Request message for listing build targets.
137+
// -- NEXT_TAG: 3 --
130138
message ListBuildTargetsRequest {
131139
// Optional. The number of build targets to return in a page.
132140
int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];
133141

134-
// Optional. A page token, received from a previous `ListBuildTargets` call. Provide
135-
// this to retrieve the subsequent page.
142+
// Optional. A page token, received from a previous `ListBuildTargets` call.
143+
// Provide this to retrieve the subsequent page.
136144
string page_token = 2 [(google.api.field_behavior) = OPTIONAL];
137145
}
138146

139147
// Response message for listing build targets.
148+
// -- NEXT_TAG: 4 --
140149
message ListBuildTargetsResponse {
141150
// The list of build targets.
142151
repeated BuildTarget build_targets = 1;
@@ -150,6 +159,7 @@ message ListBuildTargetsResponse {
150159
}
151160

152161
// Request message for listing models.
162+
// -- NEXT_TAG: 4 --
153163
message ListModelsRequest {
154164
// Required. The full resource name of build target.
155165
string parent = 1 [
@@ -168,6 +178,7 @@ message ListModelsRequest {
168178
}
169179

170180
// Response message for listing models.
181+
// -- NEXT_TAG: 4 --
171182
message ListModelsResponse {
172183
// The list of models.
173184
repeated Model models = 1;
@@ -181,6 +192,7 @@ message ListModelsResponse {
181192
}
182193

183194
// Request message for listing builds.
195+
// -- NEXT_TAG: 7 --
184196
message ListBuildsRequest {
185197
// Required. The full resource name of the model. The model id is the same as
186198
// the build target id for non-unified builds.
@@ -196,30 +208,32 @@ message ListBuildsRequest {
196208
// Optional. The number of builds to return in a page.
197209
int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
198210

199-
// Optional. A page token, received from a previous `ListBuilds` call. Provide this to
200-
// retrieve the subsequent page.
211+
// Optional. A page token, received from a previous `ListBuilds` call. Provide
212+
// this to retrieve the subsequent page.
201213
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
202214

203-
// Optional. Filter that specifies value constraints of fields. For example, the
204-
// filter can be set as "filter='milestone=milestones/80'" to only select
215+
// Optional. Filter that specifies value constraints of fields. For example,
216+
// the filter can be set as "filter='milestone=milestones/80'" to only select
205217
// builds in milestone 80.
206218
string filter = 4 [(google.api.field_behavior) = OPTIONAL];
207219

208-
// Optional. Read mask that specifies which Build fields to return. If empty, all Build
209-
// fields will be returned.
210-
// Valid fields: name, milestone, build_version.
211-
// For example, if the read_mask is set as "read_mask='milestone'", the
212-
// ListBuilds will return a list of Builds object with only the milestone
213-
// field.
214-
google.protobuf.FieldMask read_mask = 5 [(google.api.field_behavior) = OPTIONAL];
215-
216-
// Optional. The operation that groups by all the Build fields specified in the read
217-
// mask. The group_by field should be the same as the read_mask field in
218-
// convention of SQL.
219-
google.protobuf.FieldMask group_by = 6 [(google.api.field_behavior) = OPTIONAL];
220+
// Optional. Read mask that specifies which Build fields to return. If empty,
221+
// all Build fields will be returned. Valid fields: name, milestone,
222+
// build_version. For example, if the read_mask is set as
223+
// "read_mask='milestone'", the ListBuilds will return a list of Builds object
224+
// with only the milestone field.
225+
google.protobuf.FieldMask read_mask = 5
226+
[(google.api.field_behavior) = OPTIONAL];
227+
228+
// Optional. The operation that groups by all the Build fields specified in
229+
// the read mask. The group_by field should be the same as the read_mask field
230+
// in convention of SQL.
231+
google.protobuf.FieldMask group_by = 6
232+
[(google.api.field_behavior) = OPTIONAL];
220233
}
221234

222235
// Response message for listing builds.
236+
// -- NEXT_TAG: 4 --
223237
message ListBuildsResponse {
224238
// The list of builds.
225239
repeated Build builds = 1;
@@ -233,6 +247,7 @@ message ListBuildsResponse {
233247
}
234248

235249
// Request message for checking if the build artifact is staged.
250+
// -- NEXT_TAG: 3 --
236251
message CheckBuildStageStatusRequest {
237252
// Required. The full resource name of the build artifact.
238253
// For example,
@@ -244,13 +259,14 @@ message CheckBuildStageStatusRequest {
244259
}
245260
];
246261

247-
// Optional. Filter that specifies value constraints of fields. For example, the
248-
// filter can be set as "filter='type=release'" to only check the release
262+
// Optional. Filter that specifies value constraints of fields. For example,
263+
// the filter can be set as "filter='type=release'" to only check the release
249264
// builds.
250265
string filter = 2 [(google.api.field_behavior) = OPTIONAL];
251266
}
252267

253268
// Response message for checking the stage status of a build artifact.
269+
// -- NEXT_TAG: 4 --
254270
message CheckBuildStageStatusResponse {
255271
// The status to represent if the build is staged or not.
256272
bool is_build_staged = 1;
@@ -263,6 +279,7 @@ message CheckBuildStageStatusResponse {
263279
}
264280

265281
// Request message for staging a build artifact.
282+
// -- NEXT_TAG: 3 --
266283
message StageBuildRequest {
267284
// Required. The full resource name of the build artifact.
268285
// For example,
@@ -274,19 +291,21 @@ message StageBuildRequest {
274291
}
275292
];
276293

277-
// Optional. Filter that specifies value constraints of fields. For example, the
278-
// filter can be set as "filter='type=release'" to only check the release
294+
// Optional. Filter that specifies value constraints of fields. For example,
295+
// the filter can be set as "filter='type=release'" to only check the release
279296
// builds.
280297
string filter = 2 [(google.api.field_behavior) = OPTIONAL];
281298
}
282299

283300
// Response message for staging a build artifact.
301+
// -- NEXT_TAG: 2 --
284302
message StageBuildResponse {
285303
// The staged build in the destination bucket.
286304
BuildArtifact staged_build_artifact = 1;
287305
}
288306

289307
// Metadata message for staging a build artifact.
308+
// -- NEXT_TAG: 4 --
290309
message StageBuildMetadata {
291310
// Approximate percentage of progress, e.g. "50" means 50%.
292311
float progress_percent = 1;

google/chromeos/moblab/v1beta1/chromeosmoblab_v1beta1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ apis:
1212
backend:
1313
rules:
1414
- selector: 'google.chromeos.moblab.v1beta1.BuildService.*'
15-
deadline: 10.0
15+
deadline: 30.0
1616

1717
documentation:
1818
summary: |-

google/chromeos/moblab/v1beta1/resources.proto

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@ option java_package = "com.google.chromeos.moblab.v1beta1";
2525
option optimize_for = SPEED;
2626

2727
// Resource that represents a build target.
28+
// -- NEXT_TAG: 2 --
2829
message BuildTarget {
2930
option (google.api.resource) = {
3031
type: "chromeosmoblab.googleapis.com/BuildTarget"
@@ -38,6 +39,7 @@ message BuildTarget {
3839

3940
// Resource that represents a model. Each model belongs to a build target. For
4041
// non-unified build, the model name is the same as its build target name.
42+
// -- NEXT_TAG: 2 --
4143
message Model {
4244
option (google.api.resource) = {
4345
type: "chromeosmoblab.googleapis.com/Model"
@@ -50,6 +52,7 @@ message Model {
5052
}
5153

5254
// Resource that represents a chrome OS milestone.
55+
// -- NEXT_TAG: 2 --
5356
message Milestone {
5457
option (google.api.resource) = {
5558
type: "chromeosmoblab.googleapis.com/Milestone"
@@ -63,6 +66,7 @@ message Milestone {
6366

6467
// Resource that represents a build for the given build target, model, milestone
6568
// and build version.
69+
// -- NEXT_TAG: 9 --
6670
message Build {
6771
option (google.api.resource) = {
6872
type: "chromeosmoblab.googleapis.com/Build"
@@ -122,13 +126,17 @@ message Build {
122126
// The branch of the build.
123127
string branch = 6;
124128

125-
// The read write firmware version of the software that is flashed to the chip
126-
// on the Chrome OS device.
129+
// The firmware version of the software that is flashed to the chip on the
130+
// Chrome OS device.
127131
string rw_firmware_version = 7;
132+
133+
// The labels of the build.
134+
repeated string labels = 8;
128135
}
129136

130137
// Resource that represents a build artifact stored in Google Cloud Storage for
131138
// the given build target, model, build version and bucket.
139+
// -- NEXT_TAG: 6 --
132140
message BuildArtifact {
133141
option (google.api.resource) = {
134142
type: "chromeosmoblab.googleapis.com/BuildArtifact"

0 commit comments

Comments
 (0)