Skip to content

Commit

Permalink
releaser: turn off upload to mirror by default (bazel-contrib#3677)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sluongng authored Sep 6, 2023
1 parent a8cb4b7 commit 4526df1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
14 changes: 3 additions & 11 deletions go/tools/releaser/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion go/tools/releaser/prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion go/tools/releaser/upgradedep.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 4526df1

Please sign in to comment.