Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Unified Diff: scripts/slave/recipes/run_presubmit.py

Issue 15270004: Add step generator protocol, remove annotated_checkout, remove script. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Checkout blobs do not need to be generators Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipes/run_presubmit.py
diff --git a/scripts/slave/recipes/run_presubmit.py b/scripts/slave/recipes/run_presubmit.py
index 0b6c4a250f282e7861bdfa5b0918a3f1569077d9..4b29e506570b120a230bc89b11cca2f3bb8d2404 100644
--- a/scripts/slave/recipes/run_presubmit.py
+++ b/scripts/slave/recipes/run_presubmit.py
@@ -2,21 +2,20 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-def GetFactoryProperties(api, factory_properties, build_properties):
+def GetSteps(api, factory_properties, build_properties):
# TODO(iannucci): Pass the build repo info directly via build_properties
repo_name = factory_properties.get('repo_name')
steps = api.Steps(build_properties)
- spec = steps.gclient_common_spec(repo_name)
-
- git_steps = []
- if spec['solutions'][0]['url'].endswith('.git'):
- email = 'commit-bot@chromium.org'
- git_steps = [
- steps.git_step('config', 'user.email', email),
- steps.git_step('config', 'user.name', 'The Commit Bot'),
- steps.git_step('clean', '-xfq'),
- ]
+ def git_steps(step_history, _failure):
+ spec = step_history['gclient setup'].json_data['CheckoutSpec']
+ if spec['solutions'][0]['url'].endswith('.git'):
+ seed_steps = ['git config user.email', 'git config user.name',
+ 'git clean']
+ yield steps.git('config', 'user.email', 'commit-bot@chromium.org',
+ seed_steps=seed_steps)
+ yield steps.git('config', 'user.name', 'The Commit Bot')
+ yield steps.git('clean', '-xfq')
root = build_properties.get('root', '')
# FIXME: Rietveld passes the blink path as src/third_party/WebKit
@@ -29,23 +28,21 @@ def GetFactoryProperties(api, factory_properties, build_properties):
if repo_name == 'blink_bare':
root = ''
- return {
- 'checkout': 'gclient',
- 'gclient_spec': spec,
- 'steps': git_steps + [
- steps.apply_issue_step(root),
- steps.step('presubmit', [
- api.depot_tools_path('presubmit_support.py'),
- '--root', api.checkout_path(root),
- '--commit',
- '--verbose', '--verbose',
- '--issue', build_properties['issue'],
- '--patchset', build_properties['patchset'],
- '--skip_canned', 'CheckRietveldTryJobExecution',
- '--skip_canned', 'CheckTreeIsOpen',
- '--skip_canned', 'CheckBuildbotPendingBuilds',
- '--rietveld_url', build_properties['rietveld'],
- '--rietveld_email', '', # activates anonymous mode
- '--rietveld_fetch'])
- ]
- }
+ return (
+ steps.gclient_checkout(repo_name),
+ git_steps,
+ steps.apply_issue(root),
+ steps.step('presubmit', [
+ api.depot_tools_path('presubmit_support.py'),
+ '--root', api.checkout_path(root),
+ '--commit',
+ '--verbose', '--verbose',
+ '--issue', build_properties['issue'],
+ '--patchset', build_properties['patchset'],
+ '--skip_canned', 'CheckRietveldTryJobExecution',
+ '--skip_canned', 'CheckTreeIsOpen',
+ '--skip_canned', 'CheckBuildbotPendingBuilds',
+ '--rietveld_url', build_properties['rietveld'],
+ '--rietveld_email', '', # activates anonymous mode
+ '--rietveld_fetch'])
+ )

Powered by Google App Engine
This is Rietveld 408576698