Revert "improve trace logging in packages autoroller" (#154555)
Reverts flutter/flutter#154441 https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20packages_autoroller/11826/overview I can't see how this change would be causing the specific failure on the tree, but the failure is consistent after this commit, so speculatively reverting. The revert label isn't working since we're out of the window, so this is a manual revert.
This commit is contained in:
parent
6fe09872b1
commit
164ff46f7c
@ -33,7 +33,7 @@ class Git {
|
||||
_reportFailureAndExit(args, workingDirectory, result, explanation);
|
||||
}
|
||||
|
||||
Future<ProcessResult> run(
|
||||
Future<int> run(
|
||||
List<String> args,
|
||||
String explanation, {
|
||||
bool allowNonZeroExitCode = false,
|
||||
@ -48,7 +48,7 @@ class Git {
|
||||
if (result.exitCode != 0 && !allowNonZeroExitCode) {
|
||||
_reportFailureAndExit(args, workingDirectory, result, explanation);
|
||||
}
|
||||
return result;
|
||||
return result.exitCode;
|
||||
}
|
||||
|
||||
Future<ProcessResult> _run(List<String> args, String workingDirectory) async {
|
||||
|
@ -140,7 +140,7 @@ This PR was generated by the automated
|
||||
}
|
||||
|
||||
Future<void> _regenerateGradleLockfiles(Directory repoRoot) async {
|
||||
await framework.streamDart(<String>[
|
||||
await framework.runDart(<String>[
|
||||
'${repoRoot.path}/dev/tools/bin/generate_gradle_lockfiles.dart',
|
||||
'--no-gradle-generation',
|
||||
'--no-exclusion',
|
||||
@ -149,10 +149,8 @@ This PR was generated by the automated
|
||||
// If the git checkout is clean, we did not update any lockfiles and we do
|
||||
// not need an additional commit.
|
||||
case NoDiff():
|
||||
stdio.printTrace('No diff after calling generate_gradle_lockfiles.dart');
|
||||
return;
|
||||
case OnlyLockfileChanges():
|
||||
stdio.printTrace('Committing Gradle lockfile changes...');
|
||||
await framework.commit(
|
||||
'Re-generate Gradle lockfiles',
|
||||
addFirst: true,
|
||||
|
@ -380,7 +380,7 @@ abstract class Repository {
|
||||
|
||||
/// Determines if one ref is an ancestor for another.
|
||||
Future<bool> isAncestor(String possibleAncestor, String possibleDescendant) async {
|
||||
final io.ProcessResult result = await git.run(
|
||||
final int exitcode = await git.run(
|
||||
<String>[
|
||||
'merge-base',
|
||||
'--is-ancestor',
|
||||
@ -391,18 +391,18 @@ abstract class Repository {
|
||||
allowNonZeroExitCode: true,
|
||||
workingDirectory: (await checkoutDirectory).path,
|
||||
);
|
||||
return result.exitCode == 0;
|
||||
return exitcode == 0;
|
||||
}
|
||||
|
||||
/// Determines if a given commit has a tag.
|
||||
Future<bool> isCommitTagged(String commit) async {
|
||||
final io.ProcessResult result = await git.run(
|
||||
final int exitcode = await git.run(
|
||||
<String>['describe', '--exact-match', '--tags', commit],
|
||||
'verify $commit is already tagged',
|
||||
allowNonZeroExitCode: true,
|
||||
workingDirectory: (await checkoutDirectory).path,
|
||||
);
|
||||
return result.exitCode == 0;
|
||||
return exitcode == 0;
|
||||
}
|
||||
|
||||
/// Resets repository HEAD to [ref].
|
||||
@ -480,27 +480,16 @@ abstract class Repository {
|
||||
}
|
||||
authorArg = '--author="$author"';
|
||||
}
|
||||
final List<String> commitCmd = <String>[
|
||||
'commit',
|
||||
'--message',
|
||||
message,
|
||||
if (authorArg != null) authorArg,
|
||||
];
|
||||
stdio.printTrace('Executing git $commitCmd...');
|
||||
final io.ProcessResult commitResult = await git.run(
|
||||
commitCmd,
|
||||
await git.run(
|
||||
<String>[
|
||||
'commit',
|
||||
'--message',
|
||||
message,
|
||||
if (authorArg != null) authorArg,
|
||||
],
|
||||
'commit changes',
|
||||
workingDirectory: (await checkoutDirectory).path,
|
||||
);
|
||||
final String stdout = commitResult.stdout as String;
|
||||
if (stdout.isNotEmpty) {
|
||||
stdio.printTrace(stdout);
|
||||
}
|
||||
final String stderr = commitResult.stderr as String;
|
||||
if (stderr.isNotEmpty) {
|
||||
stdio.printTrace(stderr);
|
||||
}
|
||||
|
||||
return reverseParse('HEAD');
|
||||
}
|
||||
|
||||
@ -619,6 +608,13 @@ class FrameworkRepository extends Repository {
|
||||
]);
|
||||
}
|
||||
|
||||
Future<io.ProcessResult> runDart(List<String> args) async {
|
||||
return processManager.run(<String>[
|
||||
fileSystem.path.join((await checkoutDirectory).path, 'bin', 'dart'),
|
||||
...args,
|
||||
]);
|
||||
}
|
||||
|
||||
Future<io.ProcessResult> runFlutter(List<String> args) async {
|
||||
await _ensureToolReady();
|
||||
return processManager.run(<String>[
|
||||
@ -627,27 +623,16 @@ class FrameworkRepository extends Repository {
|
||||
]);
|
||||
}
|
||||
|
||||
Future<void> streamDart(List<String> args) async => _streamProcess(<String>[
|
||||
fileSystem.path.join((await checkoutDirectory).path, 'bin', 'dart'),
|
||||
...args,
|
||||
]);
|
||||
|
||||
Future<io.Process> streamFlutter(
|
||||
List<String> args, {
|
||||
void Function(String)? stdoutCallback,
|
||||
void Function(String)? stderrCallback,
|
||||
}) async => _streamProcess(<String>[
|
||||
fileSystem.path.join((await checkoutDirectory).path, 'bin', 'flutter'),
|
||||
...args,
|
||||
]);
|
||||
|
||||
Future<io.Process> _streamProcess(
|
||||
List<String> cmd, {
|
||||
void Function(String)? stdoutCallback,
|
||||
void Function(String)? stderrCallback,
|
||||
}) async {
|
||||
stdio.printTrace('Executing $cmd...');
|
||||
final io.Process process = await processManager.start(cmd);
|
||||
await _ensureToolReady();
|
||||
final io.Process process = await processManager.start(<String>[
|
||||
fileSystem.path.join((await checkoutDirectory).path, 'bin', 'flutter'),
|
||||
...args,
|
||||
]);
|
||||
process
|
||||
.stdout
|
||||
.transform(utf8.decoder)
|
||||
@ -658,15 +643,6 @@ class FrameworkRepository extends Repository {
|
||||
.transform(utf8.decoder)
|
||||
.transform(const LineSplitter())
|
||||
.listen(stderrCallback ?? stdio.printError);
|
||||
final int exitCode = await process.exitCode;
|
||||
if (exitCode != 0) {
|
||||
throw io.ProcessException(
|
||||
cmd.first,
|
||||
cmd.sublist(1),
|
||||
'Process failed',
|
||||
exitCode,
|
||||
);
|
||||
}
|
||||
return process;
|
||||
}
|
||||
|
||||
|
@ -293,6 +293,10 @@ void main() {
|
||||
'-b',
|
||||
'packages-autoroller-branch-1',
|
||||
]),
|
||||
const FakeCommand(command: <String>[
|
||||
'$checkoutsParentDirectory/flutter_conductor_checkouts/framework/bin/flutter',
|
||||
'help',
|
||||
]),
|
||||
const FakeCommand(command: <String>[
|
||||
'$checkoutsParentDirectory/flutter_conductor_checkouts/framework/bin/flutter',
|
||||
'--verbose',
|
||||
@ -385,6 +389,10 @@ void main() {
|
||||
'-b',
|
||||
'packages-autoroller-branch-1',
|
||||
]),
|
||||
const FakeCommand(command: <String>[
|
||||
'$checkoutsParentDirectory/flutter_conductor_checkouts/framework/bin/flutter',
|
||||
'help',
|
||||
]),
|
||||
const FakeCommand(command: <String>[
|
||||
'$checkoutsParentDirectory/flutter_conductor_checkouts/framework/bin/flutter',
|
||||
'--verbose',
|
||||
|
Loading…
x
Reference in New Issue
Block a user