From 4526df1deb7e84769499e90ce009210a08017e64 Mon Sep 17 00:00:00 2001 From: Son Luong Ngoc Date: Wed, 6 Sep 2023 12:35:23 +0200 Subject: [PATCH] releaser: turn off upload to mirror by default (#3677) Most rules_go maintainers do not have direct access to Bazel team's GSC bucket to upload this mirror. Let's disable it by default for eventually removal. Mirroring should be done by filing a requests in Bazel.git's Github issues. --- go/tools/releaser/file.go | 14 +++----------- go/tools/releaser/prepare.go | 2 +- go/tools/releaser/upgradedep.go | 2 +- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/go/tools/releaser/file.go b/go/tools/releaser/file.go index e98fc1c1bf..8c30981598 100644 --- a/go/tools/releaser/file.go +++ b/go/tools/releaser/file.go @@ -286,16 +286,8 @@ func sha256SumFile(name string) (string, error) { // copyFileToMirror uploads a file to the GCS bucket backing mirror.bazel.build. // gsutil must be installed, and the user must be authenticated with // 'gcloud auth login' and be allowed to write files to the bucket. +// +// Deprecated: To mirror, please file a request to Bazel's Github Issue func copyFileToMirror(ctx context.Context, path, fileName string) (err error) { - dest := "gs://bazel-mirror/" + path - defer func() { - if err != nil { - err = fmt.Errorf("copying file %s to %s: %w", fileName, dest, err) - } - }() - - // This function shells out to gsutil instead of using - // cloud.google.com/go/storage because that package has a million - // dependencies. - return runForError(ctx, ".", "gsutil", "cp", "-n", fileName, dest) + return nil } diff --git a/go/tools/releaser/prepare.go b/go/tools/releaser/prepare.go index 4c7b0413c7..ed50552bc5 100644 --- a/go/tools/releaser/prepare.go +++ b/go/tools/releaser/prepare.go @@ -73,7 +73,7 @@ func runPrepare(ctx context.Context, stderr io.Writer, args []string) error { var githubToken githubTokenFlag var uploadToMirror bool flags.Var(&githubToken, "githubtoken", "GitHub personal access token or path to a file containing it") - flags.BoolVar(&uploadToMirror, "mirror", true, "whether to upload dependency archives to mirror.bazel.build") + flags.BoolVar(&uploadToMirror, "mirror", false, "whether to upload dependency archives to mirror.bazel.build") flags.StringVar(&rnotesPath, "rnotes", "", "Name of file containing release notes in Markdown") flags.StringVar(&version, "version", "", "Version to release") if err := flags.Parse(args); err != nil { diff --git a/go/tools/releaser/upgradedep.go b/go/tools/releaser/upgradedep.go index 6e28c08ed9..69ce26a104 100644 --- a/go/tools/releaser/upgradedep.go +++ b/go/tools/releaser/upgradedep.go @@ -130,7 +130,7 @@ func runUpgradeDep(ctx context.Context, stderr io.Writer, args []string) error { if err != nil { return err } - for _, tool := range []string{"diff", "gazelle", "gsutil", "patch"} { + for _, tool := range []string{"diff", "gazelle", "patch"} { if _, err := exec.LookPath(tool); err != nil { return fmt.Errorf("%s must be installed in PATH", tool) }