-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
When looking up git commits, find_commit.dart uses a git log invocation here:
flutter/dev/tools/bin/find_commit.dart
Lines 68 to 75 in a2233ea
| return git(secondaryRepoDirectory, <String>[ | |
| 'log', | |
| '--format=%H', | |
| '--until=${anchor.timestamp.toIso8601String()}', | |
| '--max-count=1', | |
| secondaryBranch, | |
| '--', | |
| ]); |
This is called from here:
flutter/dev/tools/bin/find_commit.dart
Lines 99 to 105 in a2233ea
| print(findCommit( | |
| primaryRepoDirectory: primaryRepo, | |
| primaryBranch: git(primaryRepo, <String>['rev-parse', '--abbrev-ref', 'HEAD']).trim(), | |
| primaryTrunk: 'master', | |
| secondaryRepoDirectory: secondaryRepo, | |
| secondaryBranch: 'master', | |
| ).trim()); |
Since we hardcode master as both the primary and secondary repo branches, it will fail for repos that have only a main branch and no master, such as flutter/cocoon.
See example failure here:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8797370543676737825/+/u/Customer_testing/customer_testing/test_stderr
Related, but we should probably fail whichever tools are using find_commit.dart if the lookup fails. In the log above it looks like even though the lookup fails, we continue on and run the tests anyway:
git -C ../../bin/cache/pkg/tests checkout
dart --enable-asserts run_tests.dartNote the lack of SHA in the checkout command, which I presume is meant to be there.