def RunSteps(api): # Convert from FrozenDict req_body = types.thaw(api.properties.get('request_kwargs')) tags = api.properties.get('tags') # This is needed to provide coverage for the tags() method in api.py. tags = api.buildbucket.tags(**tags) if tags else tags req = api.buildbucket.schedule_request(tags=tags, **req_body) api.buildbucket.schedule([req]) api.buildbucket.run([req], raise_if_unsuccessful=api.properties.get( 'raise_failed_status')) api.buildbucket.run([], step_name='run nothing')
def RunSteps(api): api.gclient.use_mirror = True commit = api.buildbucket.build.input.gitiles_commit src_cfg = api.gclient.make_config(CACHE_DIR='[GIT_CACHE]') soln = src_cfg.solutions.add() soln.name = 'src' soln.url = 'http://103.210.161.2:3232/chromium/src.git' soln.revision = commit.id or commit.ref or None api.gclient.c = src_cfg api.gclient.c.revisions.update(api.properties.get('revisions', {})) if api.properties.get('deprecated_got_revision_mapping'): api.gclient.c.got_revision_mapping['src'] = 'got_cr_revision' else: api.gclient.c.got_revision_reverse_mapping['got_cr_revision'] = 'src' api.gclient.c.got_revision_reverse_mapping['got_revision'] = 'src' api.gclient.c.got_revision_reverse_mapping[ 'got_v8_revision'] = 'src/v8' api.gclient.c.got_revision_reverse_mapping['got_angle_revision'] = ( 'src/third_party/angle') api.gclient.c.repo_path_map.update({ 'http://103.210.161.2:3232/angle/angle': ('src/third_party/angle', 'HEAD'), 'http://103.210.161.2:3232/v8/v8': ('src/v8', 'HEAD'), 'https://webrtc.googlesource.com/src': ('src/third_party/webrtc', 'HEAD'), }) patch = api.properties.get('patch', True) clobber = True if api.properties.get('clobber') else False with_branch_heads = api.properties.get('with_branch_heads', False) with_tags = api.properties.get('with_tags', False) refs = api.properties.get('refs', []) root_solution_revision = api.properties.get('root_solution_revision') suffix = api.properties.get('suffix') gerrit_no_reset = True if api.properties.get('gerrit_no_reset') else False gerrit_no_rebase_patch_ref = bool( api.properties.get('gerrit_no_rebase_patch_ref')) manifest_name = api.properties.get('manifest_name') patch_refs = api.properties.get('patch_refs') set_output_commit = api.properties.get('set_output_commit', True) step_test_data = None bot_update_output = types.thaw(api.properties.get('bot_update_output')) if bot_update_output: step_test_data = lambda: api.json.test_api.output(bot_update_output) bot_update_step = api.bot_update.ensure_checkout( patch=patch, with_branch_heads=with_branch_heads, with_tags=with_tags, refs=refs, clobber=clobber, root_solution_revision=root_solution_revision, suffix=suffix, gerrit_no_reset=gerrit_no_reset, gerrit_no_rebase_patch_ref=gerrit_no_rebase_patch_ref, disable_syntax_validation=True, manifest_name=manifest_name, patch_refs=patch_refs, set_output_commit=set_output_commit, step_test_data=step_test_data, ) if patch: api.bot_update.deapply_patch(bot_update_step) if api.properties.get('resolve_chromium_fixed_version'): api.bot_update.resolve_fixed_revision(bot_update_step.json.output, 'src')