Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
feat: cloudbuild/v1 add new fields and annotate OUTPUT_OUT fields. (#79)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/d38ead4b-834e-4df6-8d70-237b6acdf43b/targets
  • Loading branch information
yoshi-automation committed Mar 9, 2020
1 parent 46db220 commit 0889fff
Show file tree
Hide file tree
Showing 6 changed files with 279 additions and 46 deletions.
75 changes: 51 additions & 24 deletions protos/google/devtools/cloudbuild/v1/cloudbuild.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// 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";

Expand Down Expand Up @@ -271,8 +270,7 @@ message RepoSource {
// project ID requesting the build is assumed.
string project_id = 1;

// Name of the Cloud Source Repository. If omitted, the name "default" is
// assumed.
// Required. Name of the Cloud Source Repository.
string repo_name = 2;

// A revision within the Cloud Source Repository must be specified in
Expand All @@ -299,6 +297,14 @@ message RepoSource {
// This must be a relative path. If a step's `dir` is specified and is an
// absolute path, this value is ignored for that step's execution.
string dir = 7;

// Only trigger a build if the revision regex does NOT match the revision
// regex.
bool invert_regex = 8;

// Substitutions to use in a triggered build.
// Should only be used with RunBuildTrigger
map<string, string> substitutions = 9;
}

// Location of the source in a supported storage service.
Expand All @@ -324,7 +330,7 @@ message BuiltImage {
string digest = 3;

// Output only. Stores timing information for pushing the specified image.
TimeSpan push_timing = 4;
TimeSpan push_timing = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// A step in the build pipeline.
Expand Down Expand Up @@ -405,7 +411,7 @@ message BuildStep {
repeated Volume volumes = 9;

// Output only. Stores timing information for executing this build step.
TimeSpan timing = 10;
TimeSpan timing = 10 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Stores timing information for pulling this build step's
// builder image only.
Expand Down Expand Up @@ -520,13 +526,16 @@ message Build {

// Build or step was canceled by a user.
CANCELLED = 7;

// Build was enqueued for longer than the value of `queue_ttl`.
EXPIRED = 9;
}

// Output only. Unique identifier of the build.
string id = 1;
string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. ID of the project.
string project_id = 16;
string project_id = 16 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Status of the build.
Status status = 2;
Expand All @@ -541,19 +550,22 @@ message Build {
repeated BuildStep steps = 11;

// Output only. Results of the build.
Results results = 10;
Results results = 10 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Time at which the request to create the build was received.
google.protobuf.Timestamp create_time = 6;
google.protobuf.Timestamp create_time = 6
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Time at which execution of the build was started.
google.protobuf.Timestamp start_time = 7;
google.protobuf.Timestamp start_time = 7
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Time at which execution of the build was finished.
//
// The difference between finish_time and start_time is the duration of the
// build's execution.
google.protobuf.Timestamp finish_time = 8;
google.protobuf.Timestamp finish_time = 8
[(google.api.field_behavior) = OUTPUT_ONLY];

// Amount of time that this build should be allowed to run, to second
// granularity. If this amount of time elapses, work on the build will cease
Expand Down Expand Up @@ -595,7 +607,7 @@ message Build {
BuildOptions options = 23;

// Output only. URL to logs for this build in Google Cloud Console.
string log_url = 25;
string log_url = 25 [(google.api.field_behavior) = OUTPUT_ONLY];

// Substitutions data for `Build` resource.
map<string, string> substitutions = 29;
Expand All @@ -615,7 +627,7 @@ message Build {
//
// If the build does not specify source or images,
// these keys will not be included.
map<string, TimeSpan> timing = 33;
map<string, TimeSpan> timing = 33 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Artifacts produced by a build that should be uploaded upon
Expand Down Expand Up @@ -700,7 +712,8 @@ message SourceProvenance {
//
// If the build source came in a single package such as a gzipped tarfile
// (`.tar.gz`), the `FileHash` will be for the single path to that file.
map<string, FileHashes> file_hashes = 4;
map<string, FileHashes> file_hashes = 4
[(google.api.field_behavior) = OUTPUT_ONLY];
}

// Container message for hashes of byte content of files, used in
Expand Down Expand Up @@ -801,12 +814,17 @@ message CancelBuildRequest {
// changes.
message BuildTrigger {
// Output only. Unique identifier of the trigger.
string id = 1;
string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Human-readable description of this trigger.
string description = 10;

// User assigned name of the trigger. Must be unique within the project.
// User-assigned name of the trigger. Must be unique within the project.
// Trigger names must meet the following requirements:
//
// + They must contain only alphanumeric characters and dashes.
// + They can be 1-64 characters long.
// + They must begin and end with an alphanumeric character.
string name = 21;

// Tags for annotation of a `BuildTrigger`
Expand Down Expand Up @@ -838,7 +856,8 @@ message BuildTrigger {
}

// Output only. Time when the trigger was created.
google.protobuf.Timestamp create_time = 5;
google.protobuf.Timestamp create_time = 5
[(google.api.field_behavior) = OUTPUT_ONLY];

// If true, the trigger will never result in a build.
bool disabled = 9;
Expand All @@ -847,7 +866,7 @@ message BuildTrigger {
map<string, string> substitutions = 11;

// ignored_files and included_files are file glob matches using
// http://godoc/pkg/path/filepath#Match extended with support for "**".
// https://golang.org/pkg/path/filepath/#Match extended with support for "**".
//
// If ignored_files and changed files are both empty, then they are
// not used to determine whether or not to trigger a build.
Expand Down Expand Up @@ -919,9 +938,12 @@ message PullRequestFilter {
string branch = 2;
}

// Whether to block builds on a "/gcbrun" comment from a repository owner or
// Whether to block builds on a "/gcbrun" comment from a repository admin or
// collaborator.
CommentControl comment_control = 5;

// If true, branches that do NOT match the git_ref will trigger a build.
bool invert_regex = 6;
}

// Push contains filter properties for matching GitHub git pushes.
Expand All @@ -941,6 +963,10 @@ message PushFilter {
// RE2 and described at https://github.com/google/re2/wiki/Syntax
string tag = 3;
}

// When true, only trigger a build if the revision regex does NOT match the
// git_ref regex.
bool invert_regex = 4;
}

// Request to create a new `BuildTrigger`.
Expand All @@ -957,7 +983,7 @@ message GetBuildTriggerRequest {
// Required. ID of the project that owns the trigger.
string project_id = 1 [(google.api.field_behavior) = REQUIRED];

// Required. ID of the `BuildTrigger` to get.
// Required. Identifier (`id` or `name`) of the `BuildTrigger` to get.
string trigger_id = 2 [(google.api.field_behavior) = REQUIRED];
}

Expand Down Expand Up @@ -1087,9 +1113,10 @@ message BuildOptions {
// Storage.
LogStreamingOption log_streaming_option = 5;

// Option to specify a `WorkerPool` for the build. User specifies the pool
// with the format "[WORKERPOOL_PROJECT_ID]/[WORKERPOOL_NAME]".
// This is an experimental field.
// Option to specify a `WorkerPool` for the build.
// Format: projects/{project}/workerPools/{workerPool}
//
// This field is experimental.
string worker_pool = 7;

// Option to specify the logging mode, which determines where the logs are
Expand Down
27 changes: 26 additions & 1 deletion protos/protos.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,12 @@ export namespace google {

/** RepoSource dir */
dir?: (string|null);

/** RepoSource invertRegex */
invertRegex?: (boolean|null);

/** RepoSource substitutions */
substitutions?: ({ [k: string]: string }|null);
}

/** Represents a RepoSource. */
Expand Down Expand Up @@ -735,6 +741,12 @@ export namespace google {
/** RepoSource dir. */
public dir: string;

/** RepoSource invertRegex. */
public invertRegex: boolean;

/** RepoSource substitutions. */
public substitutions: { [k: string]: string };

/** RepoSource revision. */
public revision?: ("branchName"|"tagName"|"commitSha");

Expand Down Expand Up @@ -1711,7 +1723,8 @@ export namespace google {
FAILURE = 4,
INTERNAL_ERROR = 5,
TIMEOUT = 6,
CANCELLED = 7
CANCELLED = 7,
EXPIRED = 9
}
}

Expand Down Expand Up @@ -3278,6 +3291,9 @@ export namespace google {

/** PullRequestFilter commentControl */
commentControl?: (google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl|keyof typeof google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl|null);

/** PullRequestFilter invertRegex */
invertRegex?: (boolean|null);
}

/** Represents a PullRequestFilter. */
Expand All @@ -3295,6 +3311,9 @@ export namespace google {
/** PullRequestFilter commentControl. */
public commentControl: (google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl|keyof typeof google.devtools.cloudbuild.v1.PullRequestFilter.CommentControl);

/** PullRequestFilter invertRegex. */
public invertRegex: boolean;

/** PullRequestFilter gitRef. */
public gitRef?: "branch";

Expand Down Expand Up @@ -3386,6 +3405,9 @@ export namespace google {

/** PushFilter tag */
tag?: (string|null);

/** PushFilter invertRegex */
invertRegex?: (boolean|null);
}

/** Represents a PushFilter. */
Expand All @@ -3403,6 +3425,9 @@ export namespace google {
/** PushFilter tag. */
public tag: string;

/** PushFilter invertRegex. */
public invertRegex: boolean;

/** PushFilter gitRef. */
public gitRef?: ("branch"|"tag");

Expand Down
Loading

0 comments on commit 0889fff

Please sign in to comment.