[pkgsite-metrics] cmd/ejobs: provide option to use existing binary in GCS

1 view
Skip to first unread message

Ethan Lee (Gerrit)

unread,
12:29 PM (10 hours ago) 12:29 PM
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Ethan Lee has uploaded the change for review

Commit message

cmd/ejobs: provide option to use existing binary in GCS
Change-Id: If8c9acea42618cee300f6e442bfddf428942d8ab

Change diff

diff --git a/cmd/ejobs/main.go b/cmd/ejobs/main.go
index b9d3b32..80d2f79 100644
--- a/cmd/ejobs/main.go
+++ b/cmd/ejobs/main.go
@@ -476,20 +476,29 @@
// Ask the users if they want to overwrite the existing file
// while providing more info to help them with their decision.
updated := attrs.Updated.In(time.Local).Format(time.RFC1123) // use local time zone
- fmt.Printf("The file %q already exists on GCS.\n", baseName)
+ fmt.Printf("The file %q already exists on GCS but has a different checksum.\n", baseName)
fmt.Printf("It was last uploaded on %s", updated)
- // Communicate uploader info if available.
if uploader := attrs.Metadata[uploaderMetadataKey]; uploader != "" {
fmt.Printf(" by %s", uploader)
}
fmt.Println(".")
- fmt.Print("Do you wish to overwrite it? [y/n] ")
- var response string
- fmt.Scanln(&response)
- if r := strings.TrimSpace(response); r != "y" && r != "Y" {
- // Accept "Y" and "y" as confirmation.
- fmt.Println("Cancelling.")
- return "", true, nil
+ for {
+ fmt.Print("Do you want to [o]verwrite, [u]se existing, or [c]ancel? ")
+ var response string
+ fmt.Scanln(&response)
+ r := strings.TrimSpace(strings.ToLower(response))
+ if r == "o" || r == "overwrite" {
+ break
+ }
+ if r == "u" || r == "use" {
+ fmt.Println("Using existing file on GCS.")
+ return gcsPath, false, nil
+ }
+ if r == "c" || r == "cancel" {
+ fmt.Println("Cancelling.")
+ return "", true, nil
+ }
+ fmt.Println("Invalid choice.")
}
}
fmt.Printf("Uploading.\n")

Change information

Files:
  • M cmd/ejobs/main.go
Change size: S
Delta: 1 file changed, 18 insertions(+), 9 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: pkgsite-metrics
Gerrit-Branch: master
Gerrit-Change-Id: If8c9acea42618cee300f6e442bfddf428942d8ab
Gerrit-Change-Number: 708396
Gerrit-PatchSet: 1
Gerrit-Owner: Ethan Lee <etha...@google.com>
Gerrit-Reviewer: Ethan Lee <etha...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Markus Kusano (Gerrit)

unread,
12:33 PM (10 hours ago) 12:33 PM
to Ethan Lee, goph...@pubsubhelper.golang.org, Go LUCI, golang-co...@googlegroups.com
Attention needed from Ethan Lee

Markus Kusano voted and added 1 comment

Votes added by Markus Kusano

Code-Review+2

1 comment

File cmd/ejobs/main.go
Line 479, Patchset 1 (Latest): fmt.Printf("The file %q already exists on GCS but has a different checksum.\n", baseName)
Markus Kusano . unresolved

feel free to ignore, i'm on the fence leaning more to "no" but i wanted to mention: Should we include the checksums in the log message?

Open in Gerrit

Related details

Attention is currently required from:
  • Ethan Lee
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pkgsite-metrics
Gerrit-Branch: master
Gerrit-Change-Id: If8c9acea42618cee300f6e442bfddf428942d8ab
Gerrit-Change-Number: 708396
Gerrit-PatchSet: 1
Gerrit-Owner: Ethan Lee <etha...@google.com>
Gerrit-Reviewer: Ethan Lee <etha...@google.com>
Gerrit-Reviewer: Markus Kusano <kus...@google.com>
Gerrit-Attention: Ethan Lee <etha...@google.com>
Gerrit-Comment-Date: Wed, 01 Oct 2025 16:33:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Ethan Lee (Gerrit)

unread,
1:56 PM (9 hours ago) 1:56 PM
to goph...@pubsubhelper.golang.org, Go LUCI, Markus Kusano, golang-co...@googlegroups.com

Ethan Lee added 1 comment

File cmd/ejobs/main.go
Line 479, Patchset 1 (Latest): fmt.Printf("The file %q already exists on GCS but has a different checksum.\n", baseName)
Markus Kusano . resolved

feel free to ignore, i'm on the fence leaning more to "no" but i wanted to mention: Should we include the checksums in the log message?

Ethan Lee

Hmmm, we could add it in a later CL potentially, but I don't think users would necessarily use the checksums in a message.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
  • requirement satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: pkgsite-metrics
Gerrit-Branch: master
Gerrit-Change-Id: If8c9acea42618cee300f6e442bfddf428942d8ab
Gerrit-Change-Number: 708396
Gerrit-PatchSet: 1
Gerrit-Owner: Ethan Lee <etha...@google.com>
Gerrit-Reviewer: Ethan Lee <etha...@google.com>
Gerrit-Reviewer: Markus Kusano <kus...@google.com>
Gerrit-Comment-Date: Wed, 01 Oct 2025 17:56:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Markus Kusano <kus...@google.com>
satisfied_requirement
open
diffy

Ethan Lee (Gerrit)

unread,
1:56 PM (9 hours ago) 1:56 PM
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Go LUCI, Markus Kusano, golang-co...@googlegroups.com

Ethan Lee submitted the change

Change information

Commit message:
cmd/ejobs: provide option to use existing binary in GCS
Change-Id: If8c9acea42618cee300f6e442bfddf428942d8ab
Files:
  • M cmd/ejobs/main.go
Change size: S
Delta: 1 file changed, 18 insertions(+), 9 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Markus Kusano
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: pkgsite-metrics
Gerrit-Branch: master
Gerrit-Change-Id: If8c9acea42618cee300f6e442bfddf428942d8ab
Gerrit-Change-Number: 708396
Gerrit-PatchSet: 2
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages