Updated autoroller script to fix failures and license script edge cases (#215)

This commit is contained in:
Ben Konyi 2019-02-06 15:28:27 -08:00 committed by GitHub
parent c82412bcdc
commit cc2b7b0b67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 2 deletions

View File

@ -352,7 +352,7 @@ def main():
most_recent_commit = args.dart_sdk_revision
else:
# Get the most recent commit that is a reasonable candidate.
most_recent_commit = get_most_recent_green_build(success_threshold=0.9)
most_recent_commit = get_most_recent_green_build(success_threshold=1.0)
if args.skip_tests:
dart_roll_helper_args.append('--no-test')
if args.skip_build:

View File

@ -48,6 +48,8 @@ class BuildStatus:
return True
except KeyError:
return False
except TypeError:
return False
def is_completed(self):
@ -159,7 +161,7 @@ def get_most_recent_green_build(success_threshold=0.95):
# Ignore revisions that returned bad state. This could be due to the bots
# being purple or some other infrastructure issues.
valid_states = bool(reduce(lambda x, prev: x.is_valid_status() and prev, commit_states))
valid_states = bool(reduce(lambda x, y: x and y.is_valid_status(), commit_states))
if not valid_states:
continue

View File

@ -198,12 +198,25 @@ def update_licenses():
print_error('Unknown license script error: {}. Aborting roll.'
.format(result))
sys.exit(ERROR_LICENSE_SCRIPT_FAILED)
# Ignore 'licenses_skia' as they shouldn't change during a Dart SDK roll.
src_files = ['licenses_flutter', 'licenses_third_party', 'tool_signature']
for f in src_files:
path = os.path.join(license_script_output_path(), f)
if os.path.isfile(path):
shutil.copy(path, engine_golden_licenses_path())
p = subprocess.Popen(['pub', 'get'], cwd=engine_license_script_package_path())
p.wait()
gclient_sync()
# Update the LICENSE file.
with open(sky_license_file_path(), 'w') as sky_license:
p = subprocess.Popen(['dart', os.path.join('lib', 'main.dart'),
'--release', '--src', ENGINE_HOME,
'--out', engine_license_script_output_path()],
cwd=engine_license_script_package_path(),
stdout=sky_license)
p.wait()
def get_commit_range(start, finish):

View File

@ -66,6 +66,18 @@ def engine_license_script_path():
return os.path.join(ENGINE_HOME, 'flutter', 'ci', 'licenses.sh')
def engine_license_script_dart_path():
return os.path.join(engine_license_script_package_path(), 'lib', 'main.dart')
def engine_license_script_package_path():
return os.path.join(ENGINE_HOME, 'flutter', 'tools', 'licenses')
def engine_license_script_output_path():
return os.path.join(ENGINE_HOME, 'out', 'licenses')
def engine_flutter_path():
return os.path.join(ENGINE_HOME, 'flutter')
@ -86,6 +98,10 @@ def package_flutter_path():
return os.path.join(FLUTTER_HOME, 'packages', 'flutter')
def sky_license_file_path():
return os.path.join(ENGINE_HOME, 'flutter', 'sky', 'packages', 'sky_engine', 'LICENSE')
def update_dart_deps_path():
return os.path.join(ENGINE_HOME, 'tools', 'dart', 'create_updated_flutter_deps.py')