Skip to content

Commit

Permalink
Point to a new artifacts location. (flutter#70673)
Browse files Browse the repository at this point in the history
This is in preparation to move the flutter artifacts to a more secure
location.

Bug:
  go/fxb/64576
  • Loading branch information
godofredoc authored Feb 5, 2021
1 parent d396e26 commit da6528c
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion bin/internal/gradle_wrapper.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
flutter_infra/gradle-wrapper/fd5c1f2c013565a3bea56ada6df9d2b8e96d56aa/gradle-wrapper.tgz
flutter_infra_release/gradle-wrapper/fd5c1f2c013565a3bea56ada6df9d2b8e96d56aa/gradle-wrapper.tgz
2 changes: 1 addition & 1 deletion bin/internal/material_fonts.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
flutter_infra/flutter/fonts/1363603dd17dd609018e53cdbd5fef6791814337/fonts.zip
flutter_infra_release/flutter/fonts/1363603dd17dd609018e53cdbd5fef6791814337/fonts.zip
2 changes: 1 addition & 1 deletion bin/internal/update_dart_sdk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if (-not $dartSdkBaseUrl) {
$dartSdkBaseUrl = "https://storage.googleapis.com"
}
$dartZipName = "dart-sdk-windows-x64.zip"
$dartSdkUrl = "$dartSdkBaseUrl/flutter_infra/flutter/$engineVersion/$dartZipName"
$dartSdkUrl = "$dartSdkBaseUrl/flutter_infra_release/flutter/$engineVersion/$dartZipName"

if (Test-Path $dartSdkPath) {
# Move old SDK to a new location instead of deleting it in case it is still in use (e.g. by IntelliJ).
Expand Down
2 changes: 1 addition & 1 deletion bin/internal/update_dart_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ if [ ! -f "$ENGINE_STAMP" ] || [ "$ENGINE_VERSION" != `cat "$ENGINE_STAMP"` ]; t
fi

DART_SDK_BASE_URL="${FLUTTER_STORAGE_BASE_URL:-https://storage.googleapis.com}"
DART_SDK_URL="$DART_SDK_BASE_URL/flutter_infra/flutter/$ENGINE_VERSION/$DART_ZIP_NAME"
DART_SDK_URL="$DART_SDK_BASE_URL/flutter_infra_release/flutter/$ENGINE_VERSION/$DART_ZIP_NAME"

# if the sdk path exists, copy it to a temporary location
if [ -d "$DART_SDK_PATH" ]; then
Expand Down
16 changes: 8 additions & 8 deletions dev/bots/test/fake_process_manager_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ void main() {

test('start works', () async {
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
'gsutil acl get gs://flutter_infra_release/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output1', ''),
],
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
'gsutil cat gs://flutter_infra_release/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output2', ''),
],
};
Expand All @@ -48,10 +48,10 @@ void main() {

test('run works', () async {
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
'gsutil acl get gs://flutter_infra_release/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output1', ''),
],
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
'gsutil cat gs://flutter_infra_release/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output2', ''),
],
};
Expand All @@ -65,10 +65,10 @@ void main() {

test('runSync works', () async {
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
'gsutil acl get gs://flutter_infra_release/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output1', ''),
],
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
'gsutil cat gs://flutter_infra_release/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output2', ''),
],
};
Expand All @@ -82,10 +82,10 @@ void main() {

test('captures stdin', () async {
final Map<String, List<ProcessResult>> calls = <String, List<ProcessResult>>{
'gsutil acl get gs://flutter_infra/releases/releases.json': <ProcessResult>[
'gsutil acl get gs://flutter_infra_release/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output1', ''),
],
'gsutil cat gs://flutter_infra/releases/releases.json': <ProcessResult>[
'gsutil cat gs://flutter_infra_release/releases/releases.json': <ProcessResult>[
ProcessResult(0, 0, 'output2', ''),
],
};
Expand Down
4 changes: 2 additions & 2 deletions dev/bots/unpublish_package.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import 'package:path/path.dart' as path;
import 'package:platform/platform.dart' show Platform, LocalPlatform;
import 'package:process/process.dart';

const String gsBase = 'gs://flutter_infra';
const String gsBase = 'gs://flutter_infra_release';
const String releaseFolder = '/releases';
const String gsReleaseFolder = '$gsBase$releaseFolder';
const String baseUrl = 'https://storage.googleapis.com/flutter_infra';
const String baseUrl = 'https://storage.googleapis.com/flutter_infra_release';

/// Exception class for when a process fails to run, so we can catch
/// it and provide something more readable than a stack trace.
Expand Down
4 changes: 2 additions & 2 deletions dev/tools/java_and_objc_doc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ const String kDocRoot = 'dev/docs/doc';
Future<void> main(List<String> args) async {
final String engineVersion = File('bin/internal/engine.version').readAsStringSync().trim();

final String javadocUrl = 'https://storage.googleapis.com/flutter_infra/flutter/$engineVersion/android-javadoc.zip';
final String javadocUrl = 'https://storage.googleapis.com/flutter_infra_release/flutter/$engineVersion/android-javadoc.zip';
generateDocs(javadocUrl, 'javadoc', 'io/flutter/view/FlutterView.html');

final String objcdocUrl = 'https://storage.googleapis.com/flutter_infra/flutter/$engineVersion/ios-objcdoc.zip';
final String objcdocUrl = 'https://storage.googleapis.com/flutter_infra_release/flutter/$engineVersion/ios-objcdoc.zip';
generateDocs(objcdocUrl, 'objcdoc', 'Classes/FlutterViewController.html');
}

Expand Down
4 changes: 2 additions & 2 deletions dev/tools/repackage_gradle_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ popd > /dev/null
echo
echo "Uploading repackaged gradle wrapper..."
echo "Content hash: $STAMP"
gsutil.py cp -n "$WRAPPER_TEMP_DIR/gradle-wrapper.tgz" "gs://flutter_infra/gradle-wrapper/$STAMP/gradle-wrapper.tgz"
gsutil.py cp -n "$WRAPPER_TEMP_DIR/gradle-wrapper.tgz" "gs://flutter_infra_release/gradle-wrapper/$STAMP/gradle-wrapper.tgz"

echo "flutter_infra/gradle-wrapper/$STAMP/gradle-wrapper.tgz" > "$WRAPPER_VERSION_PATH"
echo "flutter_infra_release/gradle-wrapper/$STAMP/gradle-wrapper.tgz" > "$WRAPPER_VERSION_PATH"

rm -rf "$WRAPPER_TEMP_DIR"
echo
Expand Down
8 changes: 4 additions & 4 deletions packages/flutter_tools/lib/src/cache.dart
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ class FlutterWebSdk extends CachedArtifact {
} else if (_platform.isWindows) {
platformName += 'windows-x64';
}
final Uri url = Uri.parse('${cache.storageBaseUrl}/flutter_infra/flutter/$version/$platformName.zip');
final Uri url = Uri.parse('${cache.storageBaseUrl}/flutter_infra_release/flutter/$version/$platformName.zip');
if (location.existsSync()) {
location.deleteSync(recursive: true);
}
Expand Down Expand Up @@ -907,7 +907,7 @@ abstract class EngineCachedArtifact extends CachedArtifact {
FileSystem fileSystem,
OperatingSystemUtils operatingSystemUtils,
) async {
final String url = '${cache.storageBaseUrl}/flutter_infra/flutter/$version/';
final String url = '${cache.storageBaseUrl}/flutter_infra_release/flutter/$version/';

final Directory pkgDir = cache.getCacheDir('pkg');
for (final String pkgName in getPackageDirs()) {
Expand Down Expand Up @@ -942,7 +942,7 @@ abstract class EngineCachedArtifact extends CachedArtifact {

Future<bool> checkForArtifacts(String engineVersion) async {
engineVersion ??= version;
final String url = '${cache.storageBaseUrl}/flutter_infra/flutter/$engineVersion/';
final String url = '${cache.storageBaseUrl}/flutter_infra_release/flutter/$engineVersion/';

bool exists = false;
for (final String pkgName in getPackageDirs()) {
Expand Down Expand Up @@ -1574,7 +1574,7 @@ class IosUsbArtifacts extends CachedArtifact {
}

@visibleForTesting
Uri get archiveUri => Uri.parse('${cache.storageBaseUrl}/flutter_infra/ios-usb-dependencies${cache.useUnsignedMacBinaries ? '/unsigned' : ''}/$name/$version/$name.zip');
Uri get archiveUri => Uri.parse('${cache.storageBaseUrl}/flutter_infra_release/ios-usb-dependencies${cache.useUnsignedMacBinaries ? '/unsigned' : ''}/$name/$version/$name.zip');
}

// Many characters are problematic in filenames, especially on Windows.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ $licenseSource
LICENSE
}
s.author = { 'Flutter Dev Team' => '[email protected]' }
s.source = { :http => '${_cache.storageBaseUrl}/flutter_infra/flutter/${_cache.engineRevision}/$artifactsMode/artifacts.zip' }
s.source = { :http => '${_cache.storageBaseUrl}/flutter_infra_release/flutter/${_cache.engineRevision}/$artifactsMode/artifacts.zip' }
s.documentation_url = 'https://flutter.dev/docs'
s.platform = :ios, '8.0'
s.vendored_frameworks = 'Flutter.xcframework'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class UpdatePackagesCommand extends FlutterCommand {
'Downloading lcov data for package:flutter...',
);
final String urlBase = globals.platform.environment['FLUTTER_STORAGE_BASE_URL'] ?? 'https://storage.googleapis.com';
final Uri coverageUri = Uri.parse('$urlBase/flutter_infra/flutter/coverage/lcov.info');
final Uri coverageUri = Uri.parse('$urlBase/flutter_infra_release/flutter/coverage/lcov.info');
final List<int> data = await _net.fetchUrl(coverageUri);
final String coverageDir = globals.fs.path.join(
Cache.flutterRoot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void main() {

final File expectedPodspec = outputDirectory.childFile('Flutter.podspec');
final String podspecContents = expectedPodspec.readAsStringSync();
expect(podspecContents, contains("'$storageBaseUrl/flutter_infra/flutter/$engineRevision/ios/artifacts.zip'"));
expect(podspecContents, contains("'$storageBaseUrl/flutter_infra_release/flutter/$engineRevision/ios/artifacts.zip'"));
}, overrides: <Type, Generator>{
FileSystem: () => memoryFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Expand All @@ -228,7 +228,7 @@ void main() {

final File expectedPodspec = outputDirectory.childFile('Flutter.podspec');
final String podspecContents = expectedPodspec.readAsStringSync();
expect(podspecContents, contains("'$storageBaseUrl/flutter_infra/flutter/$engineRevision/ios-profile/artifacts.zip'"));
expect(podspecContents, contains("'$storageBaseUrl/flutter_infra_release/flutter/$engineRevision/ios-profile/artifacts.zip'"));
}, overrides: <Type, Generator>{
FileSystem: () => memoryFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Expand All @@ -246,7 +246,7 @@ void main() {

final File expectedPodspec = outputDirectory.childFile('Flutter.podspec');
final String podspecContents = expectedPodspec.readAsStringSync();
expect(podspecContents, contains("'$storageBaseUrl/flutter_infra/flutter/$engineRevision/ios-release/artifacts.zip'"));
expect(podspecContents, contains("'$storageBaseUrl/flutter_infra_release/flutter/$engineRevision/ios-release/artifacts.zip'"));
}, overrides: <Type, Generator>{
FileSystem: () => memoryFileSystem,
ProcessManager: () => FakeProcessManager.any(),
Expand Down

0 comments on commit da6528c

Please sign in to comment.