[infra] Rely on the default ACL when uploading release artifacts.

The dart-archive bucket default ACL has been changed to make all
uploaded objects public. Therefore, we no longer need to specify an ACL
on upload. This change enables the scripts to work with uniform bucket
ACLs.

The bucket cannot be switched to uniform ACLs until this change reaches
the stable branch or it won't be possible to release Dart.

This change removes the uses of the gsutil -a public-read option from
the release scripts.

Change-Id: I27a76b9849771ddc380576ffe962926ebfbf4fc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221341
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
diff --git a/tools/bots/bot_utils.py b/tools/bots/bot_utils.py
index 5bd718b..58f136d 100755
--- a/tools/bots/bot_utils.py
+++ b/tools/bots/bot_utils.py
@@ -227,7 +227,6 @@
                local_path,
                remote_path,
                recursive=False,
-               public=False,
                multithread=False):
         assert remote_path.startswith('gs://')
 
@@ -235,8 +234,6 @@
             args = ['-m', 'cp']
         else:
             args = ['cp']
-        if public:
-            args += ['-a', 'public-read']
         if recursive:
             args += ['-R']
         args += [local_path, remote_path]
diff --git a/tools/bots/dart_sdk.py b/tools/bots/dart_sdk.py
index 0451f7b..d14f3ce 100755
--- a/tools/bots/dart_sdk.py
+++ b/tools/bots/dart_sdk.py
@@ -117,7 +117,6 @@
         dir_name,
         dartdocs_destination_gcsdir,
         recursive=True,
-        public=True,
         multithread=True)
 
 
@@ -185,7 +184,7 @@
 
 def DartArchiveFile(local_path, remote_path, checksum_files=False):
     gsutil = bot_utils.GSUtil()
-    gsutil.upload(local_path, remote_path, public=True)
+    gsutil.upload(local_path, remote_path)
     if checksum_files:
         # 'local_path' may have a different filename than 'remote_path'. So we need
         # to make sure the *.md5sum file contains the correct name.
@@ -194,10 +193,10 @@
         mangled_filename = remote_path[remote_path.rfind('/') + 1:]
         local_md5sum = bot_utils.CreateMD5ChecksumFile(local_path,
                                                        mangled_filename)
-        gsutil.upload(local_md5sum, remote_path + '.md5sum', public=True)
+        gsutil.upload(local_md5sum, remote_path + '.md5sum')
         local_sha256 = bot_utils.CreateSha256ChecksumFile(
             local_path, mangled_filename)
-        gsutil.upload(local_sha256, remote_path + '.sha256sum', public=True)
+        gsutil.upload(local_sha256, remote_path + '.sha256sum')
 
 
 def Run(command, env=None):
diff --git a/tools/linux_dist_support/upload_debian_packages.py b/tools/linux_dist_support/upload_debian_packages.py
index d2f7151..ab3c911 100755
--- a/tools/linux_dist_support/upload_debian_packages.py
+++ b/tools/linux_dist_support/upload_debian_packages.py
@@ -22,7 +22,7 @@
     remote_tarfile = '/'.join(
         [namer.src_directory(revision),
          os.path.basename(tarfile)])
-    gsutil.upload(tarfile, remote_tarfile, public=True)
+    gsutil.upload(tarfile, remote_tarfile)
     # Archive all files except the tar file to the linux packages dir
     for entry in os.listdir(builddir):
         full_path = os.path.join(builddir, entry)
@@ -31,7 +31,7 @@
         if full_path != tarfile:
             package_dir = namer.linux_packages_directory(revision)
             remote_file = '/'.join([package_dir, os.path.basename(entry)])
-            gsutil.upload(full_path, remote_file, public=True)
+            gsutil.upload(full_path, remote_file)
 
 
 if __name__ == '__main__':
diff --git a/tools/promote.py b/tools/promote.py
index 966b735..4d32d19 100755
--- a/tools/promote.py
+++ b/tools/promote.py
@@ -152,30 +152,30 @@
         remove_gs_directory(to_loc)
         has_signed = exists(from_loc)
         if has_signed:
-            Gsutil(['-m', 'cp', '-a', 'public-read', '-R', from_loc, to_loc])
+            Gsutil(['-m', 'cp', '-R', from_loc, to_loc])
             # Because gsutil copies differently to existing directories, we need
             # to use the base directory for the next recursive copy.
             to_loc = release_namer.base_directory(to_revision)
 
         # Copy the unsigned sdk directory without clobbering signed files.
         from_loc = raw_namer.sdk_directory(revision)
-        Gsutil(['-m', 'cp', '-n', '-a', 'public-read', '-R', from_loc, to_loc])
+        Gsutil(['-m', 'cp', '-n', '-R', from_loc, to_loc])
 
         # Copy api-docs zipfile.
         from_loc = raw_namer.apidocs_zipfilepath(revision)
         to_loc = release_namer.apidocs_zipfilepath(to_revision)
-        Gsutil(['-m', 'cp', '-a', 'public-read', from_loc, to_loc])
+        Gsutil(['-m', 'cp', from_loc, to_loc])
 
         # Copy linux deb and src packages.
         from_loc = raw_namer.linux_packages_directory(revision)
         to_loc = release_namer.linux_packages_directory(to_revision)
         remove_gs_directory(to_loc)
-        Gsutil(['-m', 'cp', '-a', 'public-read', '-R', from_loc, to_loc])
+        Gsutil(['-m', 'cp', '-R', from_loc, to_loc])
 
         # Copy VERSION file.
         from_loc = raw_namer.version_filepath(revision)
         to_loc = release_namer.version_filepath(to_revision)
-        Gsutil(['cp', '-a', 'public-read', from_loc, to_loc])
+        Gsutil(['cp', from_loc, to_loc])
 
     promote(revision)
     promote('latest')