Skip to content

Commit

Permalink
feat: [cloudbuild] Add option to enable structured logging (#5934)
Browse files Browse the repository at this point in the history
* feat: Add GoModule to Artifact and Results messages and new GO_MODULE_H1 hash type

PiperOrigin-RevId: 713355615

Source-Link: googleapis/googleapis@16db802

Source-Link: googleapis/googleapis-gen@9983231
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWRldnRvb2xzLWNsb3VkYnVpbGQvLk93bEJvdC55YW1sIiwiaCI6Ijk5ODMyMzEzMTQ1NmVjMGVhZTUxMzFlZTY3M2E5NjRjYWM2OTcwOGIifQ==

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: Add option to enable structured logging

PiperOrigin-RevId: 714092337

Source-Link: googleapis/googleapis@fd5b486

Source-Link: googleapis/googleapis-gen@52d230d
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWRldnRvb2xzLWNsb3VkYnVpbGQvLk93bEJvdC55YW1sIiwiaCI6IjUyZDIzMGRiZTZjNGE2YzYxMTJmOGYzNDZlYjIyM2EwYmZhNGZhODgifQ==

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: d-goog <[email protected]>
  • Loading branch information
3 people authored Jan 10, 2025
1 parent f5e89da commit 36be8cd
Show file tree
Hide file tree
Showing 4 changed files with 1,112 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,19 @@ message UploadedMavenArtifact {
TimeSpan push_timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// A Go module artifact uploaded to Artifact Registry using the GoModule
// directive.
message UploadedGoModule {
// URI of the uploaded artifact.
string uri = 1;

// Hash types and values of the Go Module Artifact.
FileHashes file_hashes = 2;

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

// An npm package uploaded to Artifact Registry using the NpmPackage
// directive.
message UploadedNpmPackage {
Expand Down Expand Up @@ -878,6 +891,11 @@ message Results {
// Maven artifacts uploaded to Artifact Registry at the end of the build.
repeated UploadedMavenArtifact maven_artifacts = 9;

// Optional. Go module artifacts uploaded to Artifact Registry at the end of
// the build.
repeated UploadedGoModule go_modules = 10
[(google.api.field_behavior) = OPTIONAL];

// Npm packages uploaded to Artifact Registry at the end of the build.
repeated UploadedNpmPackage npm_packages = 12;
}
Expand Down Expand Up @@ -1206,6 +1224,40 @@ message Artifacts {
string version = 5;
}

// Go module to upload to Artifact Registry upon successful completion of all
// build steps. A module refers to all dependencies in a go.mod file.
message GoModule {
// Optional. Artifact Registry repository name.
//
// Specified Go modules will be zipped and uploaded to Artifact Registry
// with this location as a prefix.
// e.g. my-go-repo
string repository_name = 1 [(google.api.field_behavior) = OPTIONAL];

// Optional. Location of the Artifact Registry repository. i.e. us-east1
// Defaults to the build’s location.
string repository_location = 2 [(google.api.field_behavior) = OPTIONAL];

// Optional. Project ID of the Artifact Registry repository.
// Defaults to the build project.
string repository_project_id = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. Source path of the go.mod file in the build's workspace. If not
// specified, this will default to the current directory.
// e.g. ~/code/go/mypackage
string source_path = 4 [(google.api.field_behavior) = OPTIONAL];

// Optional. The Go module's "module path".
// e.g. example.com/foo/v2
string module_path = 5 [(google.api.field_behavior) = OPTIONAL];

// Optional. The Go module's semantic version in the form vX.Y.Z. e.g.
// v0.1.1 Pre-release identifiers can also be added by appending a dash and
// dot separated ASCII alphanumeric characters and hyphens.
// e.g. v0.2.3-alpha.x.12m.5
string module_version = 6 [(google.api.field_behavior) = OPTIONAL];
}

// Python package to upload to Artifact Registry upon successful completion
// of all build steps. A package can encapsulate multiple objects to be
// uploaded to a single repository.
Expand Down Expand Up @@ -1272,6 +1324,12 @@ message Artifacts {
// If any artifacts fail to be pushed, the build is marked FAILURE.
repeated MavenArtifact maven_artifacts = 3;

// Optional. A list of Go modules to be uploaded to Artifact Registry upon
// successful completion of all build steps.
//
// If any objects fail to be pushed, the build is marked FAILURE.
repeated GoModule go_modules = 4 [(google.api.field_behavior) = OPTIONAL];

// A list of Python packages to be uploaded to Artifact Registry upon
// successful completion of all build steps.
//
Expand Down Expand Up @@ -1356,6 +1414,9 @@ message Hash {
// Use a md5 hash.
MD5 = 2;

// Dirhash of a Go module's source code which is then hex-encoded.
GO_MODULE_H1 = 3;

// Use a sha512 hash.
SHA512 = 4;
}
Expand Down Expand Up @@ -2327,6 +2388,11 @@ message BuildOptions {
// Optional. Option to specify how default logs buckets are setup.
DefaultLogsBucketBehavior default_logs_bucket_behavior = 21
[(google.api.field_behavior) = OPTIONAL];

// Optional. Option to specify whether structured logging is enabled.
//
// If true, JSON-formatted logs are parsed as structured logs.
bool enable_structured_logging = 23 [(google.api.field_behavior) = OPTIONAL];
}

// ReceiveTriggerWebhookRequest [Experimental] is the request object accepted by
Expand Down
Loading

0 comments on commit 36be8cd

Please sign in to comment.