Skip to content

Commit

Permalink
feat: Add PeeredNetworkIpRange to NetworkConfigs message
Browse files Browse the repository at this point in the history
feat: Add NpmPackages to Artifact and Results messages and new SHA512 hash type
docs: Various doc updates

Committer: @giangnguyen
PiperOrigin-RevId: 525153459
  • Loading branch information
Google APIs authored and Copybara-Service committed Apr 18, 2023
1 parent 7b605f6 commit 0c7c7df
Showing 1 changed file with 113 additions and 54 deletions.
167 changes: 113 additions & 54 deletions google/devtools/cloudbuild/v1/cloudbuild.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ option go_package = "cloud.google.com/go/cloudbuild/apiv1/v2/apiv1pb;apiv1pb";
option java_multiple_files = true;
option java_package = "com.google.cloudbuild.v1";
option objc_class_prefix = "GCB";
option ruby_package = "Google::Cloud::Build::V1";
option php_namespace = "Google\\Cloud\\Build\\V1";
option ruby_package = "Google::Cloud::Build::V1";
option (google.api.resource_definition) = {
type: "compute.googleapis.com/Network"
pattern: "projects/{project}/global/networks/{network}"
Expand Down Expand Up @@ -558,6 +558,19 @@ message UploadedMavenArtifact {
TimeSpan push_timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// An npm package uploaded to Artifact Registry using the NpmPackage
// directive.
message UploadedNpmPackage {
// URI of the uploaded npm package.
string uri = 1;

// Hash types and values of the npm package.
FileHashes file_hashes = 2;

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

// A step in the build pipeline.
message BuildStep {
// Required. The name of the container image that will run this particular
Expand Down Expand Up @@ -698,10 +711,12 @@ message Results {
// indices.
repeated string build_step_images = 3;

// Path to the artifact manifest. Only populated when artifacts are uploaded.
// Path to the artifact manifest for non-container artifacts uploaded to Cloud
// Storage. Only populated when artifacts are uploaded to Cloud Storage.
string artifact_manifest = 4;

// Number of artifacts uploaded. Only populated when artifacts are uploaded.
// Number of non-container artifacts uploaded to Cloud Storage. Only populated
// when artifacts are uploaded to Cloud Storage.
int64 num_artifacts = 5;

// List of build step outputs, produced by builder images, in the order
Expand All @@ -712,14 +727,17 @@ message Results {
// Only the first 4KB of data is stored.
repeated bytes build_step_outputs = 6;

// Time to push all non-container artifacts.
// Time to push all non-container artifacts to Cloud Storage.
TimeSpan artifact_timing = 7;

// Python artifacts uploaded to Artifact Registry at the end of the build.
repeated UploadedPythonPackage python_packages = 8;

// Maven artifacts uploaded to Artifact Registry at the end of the build.
repeated UploadedMavenArtifact maven_artifacts = 9;

// Npm packages uploaded to Artifact Registry at the end of the build.
repeated UploadedNpmPackage npm_packages = 12;
}

// An artifact that was uploaded during a build. This
Expand All @@ -745,6 +763,7 @@ message ArtifactResult {
//
// - $PROJECT_ID: the project ID of the build.
// - $PROJECT_NUMBER: the project number of the build.
// - $LOCATION: the location/region of the build.
// - $BUILD_ID: the autogenerated ID of the build.
// - $REPO_NAME: the source repository name specified by RepoSource.
// - $BRANCH_NAME: the branch name specified by RepoSource.
Expand All @@ -759,6 +778,40 @@ message Build {
pattern: "projects/{project}/locations/{location}/builds/{build}"
};

// Possible status of a build or build step.
enum Status {
// Status of the build is unknown.
STATUS_UNKNOWN = 0;

// Build has been created and is pending execution and queuing. It has not
// been queued.
PENDING = 10;

// Build or step is queued; work has not yet begun.
QUEUED = 1;

// Build or step is being executed.
WORKING = 2;

// Build or step finished successfully.
SUCCESS = 3;

// Build or step failed to complete successfully.
FAILURE = 4;

// Build or step failed due to an internal cause.
INTERNAL_ERROR = 5;

// Build or step took longer than was allowed.
TIMEOUT = 6;

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

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

// A non-fatal problem encountered during the execution of the build.
message Warning {
// The relative importance of this warning.
Expand Down Expand Up @@ -817,40 +870,6 @@ message Build {
string detail = 2;
}

// Possible status of a build or build step.
enum Status {
// Status of the build is unknown.
STATUS_UNKNOWN = 0;

// Build has been created and is pending execution and queuing. It has not
// been queued.
PENDING = 10;

// Build or step is queued; work has not yet begun.
QUEUED = 1;

// Build or step is being executed.
WORKING = 2;

// Build or step finished successfully.
SUCCESS = 3;

// Build or step failed to complete successfully.
FAILURE = 4;

// Build or step failed due to an internal cause.
INTERNAL_ERROR = 5;

// Build or step took longer than was allowed.
TIMEOUT = 6;

// 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. The 'Build' name with format:
// `projects/{project}/locations/{location}/builds/{build}`, where {build}
// is a unique identifier generated by the service.
Expand Down Expand Up @@ -898,7 +917,7 @@ message Build {
//
// `timeout` starts ticking from `startTime`.
//
// Default time is ten minutes.
// Default time is 60 minutes.
google.protobuf.Duration timeout = 12;

// A list of images to be pushed upon the successful completion of all build
Expand Down Expand Up @@ -961,7 +980,8 @@ message Build {
// are:
//
// * BUILD: time to execute all build steps.
// * PUSH: time to push all specified images.
// * PUSH: time to push all artifacts including docker images and non docker
// artifacts.
// * FETCHSOURCE: time to fetch source.
// * SETUPBUILD: time to set up build.
//
Expand Down Expand Up @@ -1061,6 +1081,21 @@ message Artifacts {
repeated string paths = 2;
}

// Npm package to upload to Artifact Registry upon successful completion
// of all build steps.
message NpmPackage {
// Artifact Registry repository, in the form
// "https://$REGION-npm.pkg.dev/$PROJECT/$REPOSITORY"
//
// Npm package in the workspace specified by path will be zipped and
// uploaded to Artifact Registry with this location as a prefix.
string repository = 1;

// Path to the package.json.
// e.g. workspace/path/to/package
string package_path = 2;
}

// A list of images to be pushed upon the successful completion of all build
// steps.
//
Expand Down Expand Up @@ -1102,6 +1137,16 @@ message Artifacts {
//
// If any objects fail to be pushed, the build is marked FAILURE.
repeated PythonPackage python_packages = 5;

// A list of npm packages to be uploaded to Artifact Registry upon
// successful completion of all build steps.
//
// Npm packages in the specified paths will be uploaded
// to the specified Artifact Registry repository using the builder service
// account's credentials.
//
// If any packages fail to be pushed, the build is marked FAILURE.
repeated NpmPackage npm_packages = 6;
}

// Start and end times for a build execution phase.
Expand Down Expand Up @@ -1168,6 +1213,9 @@ message Hash {

// Use a md5 hash.
MD5 = 2;

// Use a sha512 hash.
SHA512 = 4;
}

// The type of hash that was performed.
Expand Down Expand Up @@ -1270,7 +1318,7 @@ message GetBuildRequest {
// Request to list builds.
message ListBuildsRequest {
// The parent of the collection of `Builds`.
// Format: `projects/{project}/locations/location`
// Format: `projects/{project}/locations/{location}`
string parent = 9 [(google.api.resource_reference) = {
child_type: "cloudbuild.googleapis.com/Build"
}];
Expand Down Expand Up @@ -1798,10 +1846,10 @@ message BuildOptions {

// Specifies the manner in which the build should be verified, if at all.
enum VerifyOption {
// Not a verifiable build. (default)
// Not a verifiable build (the default).
NOT_VERIFIED = 0;

// Verified build.
// Build must be verified.
VERIFIED = 1;
}

Expand Down Expand Up @@ -1854,18 +1902,18 @@ message BuildOptions {
// rely on the default logging behavior as it may change in the future.
LOGGING_UNSPECIFIED = 0;

// Cloud Logging and Cloud Storage logging are enabled.
// Build logs are stored in Cloud Logging and Cloud Storage.
LEGACY = 1;

// Only Cloud Storage logging is enabled.
// Build logs are stored in Cloud Storage.
GCS_ONLY = 2;

// This option is the same as CLOUD_LOGGING_ONLY.
STACKDRIVER_ONLY = 3 [deprecated = true];

// Only Cloud Logging is enabled. Note that logs for both the Cloud Console
// UI and Cloud SDK are based on Cloud Storage logs, so neither will provide
// logs if this option is chosen.
// Build logs are stored in Cloud Logging. Selecting this option will not
// allow [logs
// streaming](https://cloud.google.com/sdk/gcloud/reference/builds/log).
CLOUD_LOGGING_ONLY = 5;

// Turn off all logging. No build logs will be captured.
Expand Down Expand Up @@ -1896,7 +1944,7 @@ message BuildOptions {
// "disk free"; some of the space will be used by the operating system and
// build utilities. Also note that this is the minimum disk size that will be
// allocated for the build -- the build may run with a larger disk than
// requested. At present, the maximum disk size is 1000GB; builds that request
// requested. At present, the maximum disk size is 2000GB; builds that request
// more than the maximum are rejected with an error.
int64 disk_size_gb = 6;

Expand Down Expand Up @@ -1957,7 +2005,7 @@ message BuildOptions {
// it is indicative of a build request with an incorrect configuration.
repeated Volume volumes = 14;

// Option to specify how default logs buckets are setup.
// Optional. Option to specify how default logs buckets are setup.
DefaultLogsBucketBehavior default_logs_bucket_behavior = 21
[(google.api.field_behavior) = OPTIONAL];
}
Expand Down Expand Up @@ -2062,9 +2110,9 @@ message WorkerPool {
// Output only. `WorkerPool` state.
State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];

// Private Pool configuration for the `WorkerPool`.
// Configuration for the `WorkerPool`.
oneof config {
// Private Pool using a v1 configuration.
// Legacy Private Pool configuration.
PrivatePoolV1Config private_pool_v1_config = 12;
}

Expand All @@ -2088,7 +2136,7 @@ message PrivatePoolV1Config {
// Size of the disk attached to the worker, in GB.
// See [Worker pool config
// file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema).
// Specify a value of up to 1000. If `0` is specified, Cloud Build will use
// Specify a value of up to 2000. If `0` is specified, Cloud Build will use
// a standard disk size.
int64 disk_size_gb = 2;
}
Expand Down Expand Up @@ -2127,6 +2175,17 @@ message PrivatePoolV1Config {

// Option to configure network egress for the workers.
EgressOption egress_option = 2;

// Immutable. Subnet IP range within the peered network. This is specified
// in CIDR notation with a slash and the subnet prefix size. You can
// optionally specify an IP address before the subnet prefix value. e.g.
// `192.168.0.0/29` would specify an IP range starting at 192.168.0.0 with a
// prefix size of 29 bits.
// `/16` would specify a prefix size of 16 bits, with an automatically
// determined IP within the peered VPC.
// If unspecified, a value of `/24` will be used.
string peered_network_ip_range = 3
[(google.api.field_behavior) = IMMUTABLE];
}

// Machine configuration for the workers in the pool.
Expand Down Expand Up @@ -2181,7 +2240,7 @@ message GetWorkerPoolRequest {
message DeleteWorkerPoolRequest {
// Required. The name of the `WorkerPool` to delete.
// Format:
// `projects/{project}/locations/{workerPool}/workerPools/{workerPool}`.
// `projects/{project}/locations/{location}/workerPools/{workerPool}`.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down

0 comments on commit 0c7c7df

Please sign in to comment.