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

Side by Side Diff: infra/bots/recipe_modules/core/api.py

Issue 2448973002: Change recipes to use bot_update (Closed)
Patch Set: Clean Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | infra/bots/recipes/swarm_RecreateSKPs.expected/Housekeeper-Nightly-RecreateSKPs_Canary.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 5
6 # pylint: disable=W0201 6 # pylint: disable=W0201
7 7
8 8
9 import json 9 import json
10 import os 10 import os
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 self.update_repo(self.m.vars.checkout_root, chromium) 101 self.update_repo(self.m.vars.checkout_root, chromium)
102 102
103 if self.m.vars.need_pdfium_checkout: 103 if self.m.vars.need_pdfium_checkout:
104 pdfium = gclient_cfg.solutions.add() 104 pdfium = gclient_cfg.solutions.add()
105 pdfium.name = 'pdfium' 105 pdfium.name = 'pdfium'
106 pdfium.managed = False 106 pdfium.managed = False
107 pdfium.url = 'https://pdfium.googlesource.com/pdfium.git' 107 pdfium.url = 'https://pdfium.googlesource.com/pdfium.git'
108 pdfium.revision = 'origin/master' 108 pdfium.revision = 'origin/master'
109 self.update_repo(self.m.vars.checkout_root, pdfium) 109 self.update_repo(self.m.vars.checkout_root, pdfium)
110 110
111 # Run 'gclient sync'. 111 # Run bot_update.
112 gclient_cfg.got_revision_mapping['skia'] = 'got_revision' 112 gclient_cfg.got_revision_mapping['skia'] = 'got_revision'
113 checkout_kwargs = {} 113 checkout_kwargs = {}
114 checkout_kwargs['env'] = self.m.vars.default_env 114 checkout_kwargs['env'] = self.m.vars.default_env
115 115
116 # api.gclient.revert() assumes things about the layout of the code, so it 116 update_step = self.m.bot_update.ensure_checkout(
117 # fails for us. Run an appropriate revert sequence for trybots instead. 117 gclient_config=gclient_cfg,
118 gclient_file = self.m.vars.checkout_root.join('.gclient') 118 cwd=self.m.vars.checkout_root,
119 if (self.m.tryserver.is_tryserver and 119 **checkout_kwargs)
120 self.m.path.exists(gclient_file)): # pragma: no cover
121 # These steps taken from:
122 # https://chromium.googlesource.com/chromium/tools/build/+/
123 # 81a696760ab7c25f6606c54fc781b90b8af9fdd2/scripts/slave/
124 # gclient_safe_revert.py
125 if self.m.path.exists(entries_file):
126 self.m.gclient('recurse', [
127 'recurse', '-i', 'sh', '-c',
128 'if [ -e .git ]; then git remote update; fi'])
129 self.m.gclient(
130 'revert',
131 ['revert', '-v', '-v', '-v', '--nohooks', '--upstream'],
132 cwd=self.m.vars.checkout_root)
133
134 update_step = self.m.gclient.checkout(gclient_config=gclient_cfg,
135 cwd=self.m.vars.checkout_root,
136 revert=False,
137 **checkout_kwargs)
138 120
139 self.m.vars.got_revision = ( 121 self.m.vars.got_revision = (
140 update_step.presentation.properties['got_revision']) 122 update_step.presentation.properties['got_revision'])
141 self.m.tryserver.maybe_apply_issue()
142 if self.m.properties.get('patch_storage') == 'gerrit':
143 self.m.bot_update.apply_gerrit_ref(
144 root=str(self.m.vars.checkout_root.join('skia')))
145 123
146 if self.m.vars.need_chromium_checkout: 124 if self.m.vars.need_chromium_checkout:
147 self.m.gclient.runhooks(cwd=self.m.vars.checkout_root, 125 self.m.gclient.runhooks(cwd=self.m.vars.checkout_root,
148 env=self.m.vars.gclient_env) 126 env=self.m.vars.gclient_env)
OLDNEW
« no previous file with comments | « no previous file | infra/bots/recipes/swarm_RecreateSKPs.expected/Housekeeper-Nightly-RecreateSKPs_Canary.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698