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

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

Issue 2242213007: Try to use bot_update in Skia repo recipes Base URL: https://skia.googlesource.com/skia@master
Patch Set: Update expectations Created 4 years, 4 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 unified diff | Download patch
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 self.m.vars.checkout_root, 75 self.m.vars.checkout_root,
76 infra_step=True) 76 infra_step=True)
77 77
78 # Initial cleanup. 78 # Initial cleanup.
79 gclient_cfg = self.m.gclient.make_config(**cfg_kwargs) 79 gclient_cfg = self.m.gclient.make_config(**cfg_kwargs)
80 skia = gclient_cfg.solutions.add() 80 skia = gclient_cfg.solutions.add()
81 skia.name = 'skia' 81 skia.name = 'skia'
82 skia.managed = False 82 skia.managed = False
83 skia.url = 'https://skia.googlesource.com/skia.git' 83 skia.url = 'https://skia.googlesource.com/skia.git'
84 skia.revision = self.m.properties.get('revision') or 'origin/master' 84 skia.revision = self.m.properties.get('revision') or 'origin/master'
85 self.update_repo(self.m.vars.checkout_root, skia) 85 # self.update_repo(self.m.vars.checkout_root, skia)
86
87 # TODO(rmistry): Remove the below block after there is a solution for
88 # crbug.com/616443
89 entries_file = self.m.vars.checkout_root.join('.gclient_entries')
90 if self.m.path.exists(entries_file):
91 self.m.file.remove('remove %s' % entries_file,
92 entries_file,
93 infra_step=True) # pragma: no cover
94 86
95 if self.m.vars.need_chromium_checkout: 87 if self.m.vars.need_chromium_checkout:
96 chromium = gclient_cfg.solutions.add() 88 chromium = gclient_cfg.solutions.add()
97 chromium.name = 'src' 89 chromium.name = 'src'
98 chromium.managed = False 90 chromium.managed = False
99 chromium.url = 'https://chromium.googlesource.com/chromium/src.git' 91 chromium.url = 'https://chromium.googlesource.com/chromium/src.git'
100 chromium.revision = 'origin/lkgr' 92 chromium.revision = 'origin/lkgr'
101 self.update_repo(self.m.vars.checkout_root, chromium) 93 # self.update_repo(self.m.vars.checkout_root, chromium)
102 94
103 if self.m.vars.need_pdfium_checkout: 95 if self.m.vars.need_pdfium_checkout:
104 pdfium = gclient_cfg.solutions.add() 96 pdfium = gclient_cfg.solutions.add()
105 pdfium.name = 'pdfium' 97 pdfium.name = 'pdfium'
106 pdfium.managed = False 98 pdfium.managed = False
107 pdfium.url = 'https://pdfium.googlesource.com/pdfium.git' 99 pdfium.url = 'https://pdfium.googlesource.com/pdfium.git'
108 pdfium.revision = 'origin/master' 100 pdfium.revision = 'origin/master'
109 self.update_repo(self.m.vars.checkout_root, pdfium) 101 # self.update_repo(self.m.vars.checkout_root, pdfium)
110 102
111 # Run 'gclient sync'. 103 # Run 'gclient sync'.
112 gclient_cfg.got_revision_mapping['skia'] = 'got_revision' 104 gclient_cfg.got_revision_mapping['skia'] = 'got_revision'
113 gclient_cfg.target_os.add('llvm') 105 gclient_cfg.target_os.add('llvm')
114 checkout_kwargs = {} 106 checkout_kwargs = {}
115 checkout_kwargs['env'] = self.m.vars.default_env 107 checkout_kwargs['env'] = self.m.vars.default_env
116 108
117 # api.gclient.revert() assumes things about the layout of the code, so it 109 # api.gclient.revert() assumes things about the layout of the code, so it
118 # fails for us. Run an appropriate revert sequence for trybots instead. 110 # fails for us. Run an appropriate revert sequence for trybots instead.
111 """
119 gclient_file = self.m.vars.checkout_root.join('.gclient') 112 gclient_file = self.m.vars.checkout_root.join('.gclient')
120 if (self.m.tryserver.is_tryserver and 113 if (self.m.tryserver.is_tryserver and
121 self.m.path.exists(gclient_file)): # pragma: no cover 114 self.m.path.exists(gclient_file)): # pragma: no cover
122 # These steps taken from: 115 # These steps taken from:
123 # https://chromium.googlesource.com/chromium/tools/build/+/ 116 # https://chromium.googlesource.com/chromium/tools/build/+/
124 # 81a696760ab7c25f6606c54fc781b90b8af9fdd2/scripts/slave/ 117 # 81a696760ab7c25f6606c54fc781b90b8af9fdd2/scripts/slave/
125 # gclient_safe_revert.py 118 # gclient_safe_revert.py
126 if self.m.path.exists(entries_file): 119 if self.m.path.exists(entries_file):
127 self.m.gclient('recurse', [ 120 self.m.gclient('recurse', [
128 'recurse', '-i', 'sh', '-c', 121 'recurse', '-i', 'sh', '-c',
129 'if [ -e .git ]; then git remote update; fi']) 122 'if [ -e .git ]; then git remote update; fi'])
130 self.m.gclient( 123 self.m.gclient(
131 'revert', 124 'revert',
132 ['revert', '-v', '-v', '-v', '--nohooks', '--upstream'], 125 ['revert', '-v', '-v', '-v', '--nohooks', '--upstream'],
133 cwd=self.m.vars.checkout_root) 126 cwd=self.m.vars.checkout_root)
127 """
134 128
135 update_step = self.m.gclient.checkout(gclient_config=gclient_cfg, 129 # update_step = self.m.gclient.checkout(gclient_config=gclient_cfg,
136 cwd=self.m.vars.checkout_root, 130 # cwd=self.m.vars.checkout_root,
137 revert=False, 131 # revert=False,
138 **checkout_kwargs) 132 # **checkout_kwargs)
133
134 checkout_kwargs['cwd'] = self.m.vars.checkout_root
135 update_step = self.m.bot_update.ensure_checkout(
136 # Use the gclient_cfg we constructed above.
137 gclient_config=gclient_cfg,
138 # Always run bot_update. Seems to be turned on by other recipes as well.
139 force=True,
140 # Uncomment the below after recipe deps is rolled.
141 # Below param will not be needed after True is the default in bot_update .
142 # gerrit_rebase_patch_ref=True,
143 **checkout_kwargs)
139 144
140 self.m.vars.got_revision = ( 145 self.m.vars.got_revision = (
141 update_step.presentation.properties['got_revision']) 146 update_step.presentation.properties['got_revision'])
142 self.m.tryserver.maybe_apply_issue() 147 # self.m.tryserver.maybe_apply_issue()
143 148
144 if self.m.vars.need_chromium_checkout: 149 if self.m.vars.need_chromium_checkout:
150 # rmistry: hooks??
145 self.m.gclient.runhooks(cwd=self.m.vars.checkout_root, 151 self.m.gclient.runhooks(cwd=self.m.vars.checkout_root,
146 env=self.m.vars.gclient_env) 152 env=self.m.vars.gclient_env)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698