mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Updated autoroller script to fix failures and license script edge cases (#215)
This commit is contained in:
parent
c82412bcdc
commit
cc2b7b0b67
@ -352,7 +352,7 @@ def main():
|
|||||||
most_recent_commit = args.dart_sdk_revision
|
most_recent_commit = args.dart_sdk_revision
|
||||||
else:
|
else:
|
||||||
# Get the most recent commit that is a reasonable candidate.
|
# 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:
|
if args.skip_tests:
|
||||||
dart_roll_helper_args.append('--no-test')
|
dart_roll_helper_args.append('--no-test')
|
||||||
if args.skip_build:
|
if args.skip_build:
|
||||||
|
@ -48,6 +48,8 @@ class BuildStatus:
|
|||||||
return True
|
return True
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return False
|
return False
|
||||||
|
except TypeError:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def is_completed(self):
|
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
|
# Ignore revisions that returned bad state. This could be due to the bots
|
||||||
# being purple or some other infrastructure issues.
|
# 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:
|
if not valid_states:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -198,12 +198,25 @@ def update_licenses():
|
|||||||
print_error('Unknown license script error: {}. Aborting roll.'
|
print_error('Unknown license script error: {}. Aborting roll.'
|
||||||
.format(result))
|
.format(result))
|
||||||
sys.exit(ERROR_LICENSE_SCRIPT_FAILED)
|
sys.exit(ERROR_LICENSE_SCRIPT_FAILED)
|
||||||
|
|
||||||
# Ignore 'licenses_skia' as they shouldn't change during a Dart SDK roll.
|
# Ignore 'licenses_skia' as they shouldn't change during a Dart SDK roll.
|
||||||
src_files = ['licenses_flutter', 'licenses_third_party', 'tool_signature']
|
src_files = ['licenses_flutter', 'licenses_third_party', 'tool_signature']
|
||||||
for f in src_files:
|
for f in src_files:
|
||||||
path = os.path.join(license_script_output_path(), f)
|
path = os.path.join(license_script_output_path(), f)
|
||||||
if os.path.isfile(path):
|
if os.path.isfile(path):
|
||||||
shutil.copy(path, engine_golden_licenses_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):
|
def get_commit_range(start, finish):
|
||||||
|
@ -66,6 +66,18 @@ def engine_license_script_path():
|
|||||||
return os.path.join(ENGINE_HOME, 'flutter', 'ci', 'licenses.sh')
|
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():
|
def engine_flutter_path():
|
||||||
return os.path.join(ENGINE_HOME, 'flutter')
|
return os.path.join(ENGINE_HOME, 'flutter')
|
||||||
|
|
||||||
@ -86,6 +98,10 @@ def package_flutter_path():
|
|||||||
return os.path.join(FLUTTER_HOME, 'packages', 'flutter')
|
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():
|
def update_dart_deps_path():
|
||||||
return os.path.join(ENGINE_HOME, 'tools', 'dart', 'create_updated_flutter_deps.py')
|
return os.path.join(ENGINE_HOME, 'tools', 'dart', 'create_updated_flutter_deps.py')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user