Skip to content

Commit

Permalink
Merge branch 'flutter:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoamador authored Dec 8, 2023
2 parents da68249 + f0f214c commit 37d7918
Show file tree
Hide file tree
Showing 15 changed files with 257 additions and 280 deletions.
2 changes: 1 addition & 1 deletion analyze/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ environment:

dependencies:
file: 7.0.0
path: 1.8.3
path: 1.9.0
platform: 3.1.3

dev_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion app_dart/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


# Dart Docker official images can be found here: https://hub.docker.com/_/dart
FROM dart:beta@sha256:a719c761acc751554a81f71ed78bff3ff3525b7df5e78e95d2a1c6403b663d4b
FROM dart:beta@sha256:e05aaad0f71e9d045e2a45b63a65f85e5e466b1cc1de34e7e684eede45a29d9b

WORKDIR /app

Expand Down
2 changes: 1 addition & 1 deletion app_dart/lib/src/service/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class Config {
'request may not have tests. Please make sure to add tests before merging. '
'If you need '
'[an exemption](https://github.com/flutter/flutter/wiki/Tree-hygiene#tests) '
'to this rule, contact Hixie or stuartmorgan on the #hackers '
'to this rule, contact "@text-exemption-reviewers" in the #hackers '
'channel in [Chat](https://github.com/flutter/flutter/wiki/Chat) '
'(don\'t just cc them here, they won\'t see it! Use Discord!).'
'\n\n'
Expand Down
2 changes: 1 addition & 1 deletion app_dart/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies:
mime: 1.0.4
mutex: 3.1.0
neat_cache: 2.0.3
path: 1.8.3
path: 1.9.0
process: 5.0.1
process_runner: 4.1.4
protobuf: 2.1.0
Expand Down
2 changes: 1 addition & 1 deletion auto_submit/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


# Dart Docker official images can be found here: https://hub.docker.com/_/dart
FROM dart:beta@sha256:a719c761acc751554a81f71ed78bff3ff3525b7df5e78e95d2a1c6403b663d4b
FROM dart:beta@sha256:e05aaad0f71e9d045e2a45b63a65f85e5e466b1cc1de34e7e684eede45a29d9b

WORKDIR /app

Expand Down
31 changes: 24 additions & 7 deletions cipd_packages/codesign/lib/src/file_codesign_visitor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class FileCodesignVisitor {
'CODESIGN_TEAM_ID': '',
'APP_SPECIFIC_PASSWORD': '',
};
Map<String, String> redactedCredentials = {};

late final File entitlementsFile;

Expand Down Expand Up @@ -131,12 +132,20 @@ update these file paths accordingly.
return fileSystem.file(passwordFilePath).readAsString();
}

void redactPasswords() {
redactedCredentials[codesignAppstoreId] = '<appleID-redacted>';
redactedCredentials[codesignTeamId] = '<teamID-redacted>';
redactedCredentials[appSpecificPassword] = '<appSpecificPassword-redacted>';
}

/// The entrance point of examining and code signing an engine artifact.
Future<void> validateAll() async {
codesignAppstoreId = await readPassword(codesignAppstoreIDFilePath);
codesignTeamId = await readPassword(codesignTeamIDFilePath);
appSpecificPassword = await readPassword(appSpecificPasswordFilePath);

redactPasswords();

await processRemoteZip();

log.info('Codesign completed. Codesigned zip is located at $outputZipPath.'
Expand Down Expand Up @@ -416,23 +425,27 @@ update these file paths accordingly.
'notarytool',
'info',
uuid,
'--password',
appSpecificPassword,
'--apple-id',
codesignAppstoreId,
'--password',
appSpecificPassword,
'--team-id',
codesignTeamId,
];

log.info('checking notary status with ${args.join(' ')}');
String argsWithoutCredentials = args.join(' ');
for (var key in redactedCredentials.keys) {
argsWithoutCredentials = argsWithoutCredentials.replaceAll(key, redactedCredentials[key]!);
}
log.info('checking notary info: $argsWithoutCredentials');
final io.ProcessResult result = processManager.runSync(args);
final String combinedOutput = (result.stdout as String) + (result.stderr as String);

final RegExpMatch? match = _notarytoolStatusCheckPattern.firstMatch(combinedOutput);

if (match == null) {
throw CodesignException(
'Malformed output from "${args.join(' ')}"\n${combinedOutput.trim()}',
'Malformed output from "$argsWithoutCredentials"\n${combinedOutput.trim()}',
);
}

Expand Down Expand Up @@ -465,11 +478,15 @@ update these file paths accordingly.
'--verbose',
];

log.info('uploading ${args.join(' ')}');
String argsWithoutCredentials = args.join(' ');
for (var key in redactedCredentials.keys) {
argsWithoutCredentials = argsWithoutCredentials.replaceAll(key, redactedCredentials[key]!);
}
log.info('uploading to notary: $argsWithoutCredentials');
final io.ProcessResult result = processManager.runSync(args);
if (result.exitCode != 0) {
throw CodesignException(
'Command "${args.join(' ')}" failed with exit code ${result.exitCode}\nStdout: ${result.stdout}\nStderr: ${result.stderr}',
'Command "$argsWithoutCredentials" failed with exit code ${result.exitCode}\nStdout: ${result.stdout}\nStderr: ${result.stderr}',
);
}

Expand All @@ -478,7 +495,7 @@ update these file paths accordingly.
match = _notarytoolRequestPattern.firstMatch(combinedOutput);

if (match == null) {
log.warning('Failed to upload to the notary service with args: ${args.join(' ')}');
log.warning('Failed to upload to the notary service with args: $argsWithoutCredentials');
log.warning('{combinedOutput.trim()}');
retryCount -= 1;
log.warning('Trying again $retryCount more time${retryCount > 1 ? 's' : ''}...');
Expand Down
Loading

0 comments on commit 37d7918

Please sign in to comment.