-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(server): add default logs bucket behavior to build #1391
Conversation
WalkthroughThe changes add a new field, Changes
Possibly related PRs
Suggested reviewers
Poem
Tip 🌐 Web search-backed reviews and chat
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for reearth-cms canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
server/internal/infrastructure/gcp/taskrunner.go (2)
262-263
: Consider extracting common build options.The changes look good, but I notice identical BuildOptions configuration in both copy() and importItems() functions.
Consider extracting the common BuildOptions into a helper function to reduce duplication:
+func getDefaultBuildOptions() *cloudbuild.BuildOptions { + return &cloudbuild.BuildOptions{ + DiskSizeGb: defaultDiskSizeGb, + DefaultLogsBucketBehavior: "REGIONAL_USER_OWNED_BUCKET", + } +} func copy(ctx context.Context, p task.Payload, conf *TaskConfig) error { // ... build := &cloudbuild.Build{ // ... - Options: &cloudbuild.BuildOptions{ - DiskSizeGb: defaultDiskSizeGb, - DefaultLogsBucketBehavior: "REGIONAL_USER_OWNED_BUCKET", - }, + Options: getDefaultBuildOptions(), // ... } // ... } func importItems(ctx context.Context, p task.Payload, conf *TaskConfig) error { // ... build := &cloudbuild.Build{ // ... - Options: &cloudbuild.BuildOptions{ - DiskSizeGb: defaultDiskSizeGb, - DefaultLogsBucketBehavior: "REGIONAL_USER_OWNED_BUCKET", - }, + Options: getDefaultBuildOptions(), // ... } // ... }
134-137
: Consider adding DefaultLogsBucketBehavior to decompressAsset.For consistency with copy() and importItems(), consider adding DefaultLogsBucketBehavior to the BuildOptions in decompressAsset().
Options: &cloudbuild.BuildOptions{ MachineType: machineType, DiskSizeGb: diskSizeGb, + DefaultLogsBucketBehavior: "REGIONAL_USER_OWNED_BUCKET", },
This would ensure consistent behavior across all Cloud Build operations.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
server/internal/infrastructure/gcp/taskrunner.go
(2 hunks)
🔇 Additional comments (1)
server/internal/infrastructure/gcp/taskrunner.go (1)
186-187
: LGTM! Verify Cloud Build logs bucket behavior.The addition of DefaultLogsBucketBehavior and the formatting changes look good. Let's verify that "REGIONAL_USER_OWNED_BUCKET" is the correct value for your use case.
✅ Verification successful
🌐 Web query:
What are the valid values for DefaultLogsBucketBehavior in Google Cloud Build?
Length of output: 3247
LGTM! DefaultLogsBucketBehavior is correctly set.
The use of
"REGIONAL_USER_OWNED_BUCKET"
is valid based on the Cloud Build documentation and related sources, confirming that it is one of the accepted values forDefaultLogsBucketBehavior
. No changes are needed.
Overview
This PR adds default logs bucket behavior to build
Summary by CodeRabbit