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

Side by Side Diff: projects.py

Issue 20284003: Simplify cq url match rules and add http urls (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/commit-queue@master
Patch Set: Created 7 years, 5 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
« no previous file with comments | « no previous file | tests/project_test.py » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Define the supported projects.""" 4 """Define the supported projects."""
5 5
6 import json 6 import json
7 import logging 7 import logging
8 import os 8 import os
9 import re 9 import re
10 import sys 10 import sys
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 []) 157 [])
158 context_obj = context.Context( 158 context_obj = context.Context(
159 rietveld_obj, 159 rietveld_obj,
160 local_checkout, 160 local_checkout,
161 async_push.AsyncPush( 161 async_push.AsyncPush(
162 'https://chromium-status.appspot.com/cq', 162 'https://chromium-status.appspot.com/cq',
163 _chromium_status_pwd(root_dir))) 163 _chromium_status_pwd(root_dir)))
164 164
165 project_bases = [ 165 project_bases = [
166 '^%s/trunk(|/.*)$' % re.escape(base) for base in BLINK_SVN_BASES] 166 '^%s/trunk(|/.*)$' % re.escape(base) for base in BLINK_SVN_BASES]
167 167 project_bases.append(
168 aliases = ( 168 r'^https?\:\/\/chromium.googlesource.com\/chromium\/blink(?:\.git)?%s$' %
169 'https://chromium.googlesource.com/chromium/blink', 169 BRANCH_MATCH)
170 'https://chromium.googlesource.com/chromium/blink.git',
171 )
172 project_bases.extend(
173 r'^%s%s$' % (re.escape(i), BRANCH_MATCH) for i in aliases)
174 verifiers_no_patch = [ 170 verifiers_no_patch = [
175 project_base.ProjectBaseUrlVerifier(project_bases), 171 project_base.ProjectBaseUrlVerifier(project_bases),
176 reviewer_lgtm.ReviewerLgtmVerifier( 172 reviewer_lgtm.ReviewerLgtmVerifier(
177 _get_chromium_committers(), 173 _get_chromium_committers(),
178 [re.escape(user)]), 174 [re.escape(user)]),
179 ] 175 ]
180 verifiers = [] 176 verifiers = []
181 prereq_builder = 'blink_presubmit' 177 prereq_builder = 'blink_presubmit'
182 prereq_tests = ['presubmit'] 178 prereq_tests = ['presubmit']
183 step_verifiers = [ 179 step_verifiers = [
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 local_checkout, 241 local_checkout,
246 async_push.AsyncPush( 242 async_push.AsyncPush(
247 'https://chromium-status.appspot.com/cq', 243 'https://chromium-status.appspot.com/cq',
248 _chromium_status_pwd(root_dir))) 244 _chromium_status_pwd(root_dir)))
249 245
250 project_bases = [ 246 project_bases = [
251 '^%s/trunk/src(|/.*)$' % re.escape(base) for base in CHROME_SVN_BASES] 247 '^%s/trunk/src(|/.*)$' % re.escape(base) for base in CHROME_SVN_BASES]
252 248
253 aliases = ( 249 aliases = (
254 # Old path. 250 # Old path.
255 'http://git.chromium.org/git/chromium.git', 251 'git.chromium.org/git/chromium',
256 'https://git.chromium.org/git/chromium.git',
257 # New path. 252 # New path.
258 'http://git.chromium.org/chromium/src.git', 253 'git.chromium.org/chromium/src',
259 'https://git.chromium.org/chromium/src.git', 254 'chromium.googlesource.com/chromium/src',
260 'http://git.chromium.org/git/chromium/src',
261 'https://git.chromium.org/git/chromium/src',
262 'http://git.chromium.org/git/chromium/src.git',
263 'https://git.chromium.org/git/chromium/src.git',
264 'https://chromium.googlesource.com/chromium/src',
265 'https://chromium.googlesource.com/chromium/src.git',
266 ) 255 )
267 project_bases.extend( 256 project_bases.extend(
268 r'^%s%s$' % (re.escape(i), BRANCH_MATCH) for i in aliases) 257 r'^https?\:\/\/%s(?:\.git)?%s$' % (re.escape(i), BRANCH_MATCH)
258 for i in aliases)
269 verifiers_no_patch = [ 259 verifiers_no_patch = [
270 project_base.ProjectBaseUrlVerifier(project_bases), 260 project_base.ProjectBaseUrlVerifier(project_bases),
271 reviewer_lgtm.ReviewerLgtmVerifier( 261 reviewer_lgtm.ReviewerLgtmVerifier(
272 _get_chromium_committers(), 262 _get_chromium_committers(),
273 [re.escape(user)]), 263 [re.escape(user)]),
274 ] 264 ]
275 verifiers = [] 265 verifiers = []
276 prereq_builder = 'chromium_presubmit' 266 prereq_builder = 'chromium_presubmit'
277 prereq_tests = ['presubmit'] 267 prereq_tests = ['presubmit']
278 step_verifiers = [ 268 step_verifiers = [
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 'https://nativeclient-status.appspot.com/cq', 550 'https://nativeclient-status.appspot.com/cq',
561 _chromium_status_pwd(root_dir))) 551 _chromium_status_pwd(root_dir)))
562 552
563 host_aliases = SVN_HOST_ALIASES + [ 553 host_aliases = SVN_HOST_ALIASES + [
564 'http://src.chromium.org', 'https://src.chromium.org'] 554 'http://src.chromium.org', 'https://src.chromium.org']
565 svn_bases = [i + '/native_client' for i in host_aliases] 555 svn_bases = [i + '/native_client' for i in host_aliases]
566 project_bases = [ 556 project_bases = [
567 '^%s/%s(|/.*)$' % (re.escape(base), offset) for base in svn_bases 557 '^%s/%s(|/.*)$' % (re.escape(base), offset) for base in svn_bases
568 ] 558 ]
569 aliases = ( 559 aliases = (
570 'http://git.chromium.org/native_client/src/native_client.git', 560 'git.chromium.org/native_client/src/native_client',
571 'https://chromium.googlesource.com/native_client/src/native_client.git', 561 'chromium.googlesource.com/native_client/src/native_client',
572 ) 562 )
573 project_bases.extend( 563 project_bases.extend(
574 r'^%s%s$' % (re.escape(i), BRANCH_MATCH) for i in aliases) 564 r'^https?\:\/\/%s(?:\.git)?%s$' % (re.escape(i), BRANCH_MATCH)
565 for i in aliases)
575 verifiers_no_patch = [ 566 verifiers_no_patch = [
576 project_base.ProjectBaseUrlVerifier(project_bases), 567 project_base.ProjectBaseUrlVerifier(project_bases),
577 reviewer_lgtm.ReviewerLgtmVerifier( 568 reviewer_lgtm.ReviewerLgtmVerifier(
578 _get_nacl_committers(), 569 _get_nacl_committers(),
579 [re.escape(user)]), 570 [re.escape(user)]),
580 ] 571 ]
581 verifiers = [ 572 verifiers = [
582 presubmit_check.PresubmitCheckVerifier(context_obj), 573 presubmit_check.PresubmitCheckVerifier(context_obj),
583 ] 574 ]
584 if not no_try: 575 if not no_try:
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 chrome/trunk/tools. 662 chrome/trunk/tools.
672 663
673 These don't have a try server but have presubmit checks. 664 These don't have a try server but have presubmit checks.
674 """ 665 """
675 # Ignore no_try. 666 # Ignore no_try.
676 path = 'tools' 667 path = 'tools'
677 project_bases = [ 668 project_bases = [
678 '^%s/trunk/%s(|/.*)$' % (re.escape(base), path) 669 '^%s/trunk/%s(|/.*)$' % (re.escape(base), path)
679 for base in CHROME_SVN_BASES 670 for base in CHROME_SVN_BASES
680 ] 671 ]
681 regexp = r'([a-z0-9\-_]+)'
682 githost = '://git.chromium.org/'
683 googlesource = '://chromium.googlesource.com/'
684 aliases = ( 672 aliases = (
685 re.escape( 'http' + githost + 'chromium/tools/') + regexp + r'\.git', 673 # Old path.
686 re.escape('https' + githost + 'chromium/tools/') + regexp + r'\.git', 674 'git.chromium.org/git/chromium/tools',
687 re.escape( 'http' + githost + 'git/chromium/tools/') + regexp, 675 # New path.
688 re.escape('https' + githost + 'git/chromium/tools/') + regexp, 676 'git.chromium.org/chromium/tools',
689 re.escape( 'http' + githost + 'git/chromium/tools/') + regexp + r'\.git', 677 'chromium.googlesource.com/chromium/tools',
690 re.escape('https' + githost + 'git/chromium/tools/') + regexp + r'\.git',
691 re.escape('https' + googlesource + 'chromium/tools/') + regexp,
692 re.escape('https' + googlesource + 'chromium/tools/') + regexp + r'\.git',
693 ) 678 )
694 project_bases.extend('^%s%s$' % (i, BRANCH_MATCH) for i in aliases) 679 project_bases.extend(
680 r'^https?\:\/\/%s\/([a-z0-9\-_]+)(?:\.git)?%s$' % (
681 re.escape(i), BRANCH_MATCH) for i in aliases)
695 return _internal_simple(path, project_bases, user, root_dir, rietveld_obj) 682 return _internal_simple(path, project_bases, user, root_dir, rietveld_obj)
696 683
697 684
698 def _gen_chromium_deps(user, root_dir, rietveld_obj, _no_try): 685 def _gen_chromium_deps(user, root_dir, rietveld_obj, _no_try):
699 """Generates a PendingManager commit queue for 686 """Generates a PendingManager commit queue for
700 chrome/trunk/deps/. 687 chrome/trunk/deps/.
701 """ 688 """
702 # Ignore no_try. 689 # Ignore no_try.
703 path = 'deps' 690 path = 'deps'
704 project_bases = [ 691 project_bases = [
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 """List the projects that can be managed by the commit queue.""" 731 """List the projects that can be managed by the commit queue."""
745 return sorted( 732 return sorted(
746 x[5:] for x in dir(sys.modules[__name__]) if x.startswith('_gen_')) 733 x[5:] for x in dir(sys.modules[__name__]) if x.startswith('_gen_'))
747 734
748 735
749 def load_project(project, user, root_dir, rietveld_obj, no_try): 736 def load_project(project, user, root_dir, rietveld_obj, no_try):
750 """Loads the specified project.""" 737 """Loads the specified project."""
751 assert os.path.isabs(root_dir) 738 assert os.path.isabs(root_dir)
752 return getattr(sys.modules[__name__], '_gen_' + project)( 739 return getattr(sys.modules[__name__], '_gen_' + project)(
753 user, root_dir, rietveld_obj, no_try) 740 user, root_dir, rietveld_obj, no_try)
OLDNEW
« no previous file with comments | « no previous file | tests/project_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698