Update fetch configs for infra projects.

Bug: 1415507

Change-Id: I096b150ca0ee0a4b9a14c3b2059c666cfdf8213b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4379198
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
changes/98/4379198/8
Joanna Wang 2 years ago committed by LUCI CQ
parent 2075f733e8
commit bf6e21d9d7

@ -15,21 +15,14 @@ class Infra(config_util.Config):
@staticmethod @staticmethod
def fetch_spec(props): def fetch_spec(props):
return { return {
'type': 'gclient_git', 'alias': {
'gclient_git_spec': { 'config': 'infra_superproject',
'solutions': [ },
{
'name' : 'infra',
'url' : 'https://chromium.googlesource.com/infra/infra.git',
'managed' : False,
}
],
},
} }
@staticmethod @staticmethod
def expected_root(_props): def expected_root(_props):
return 'infra' return ''
def main(argv=None): def main(argv=None):

@ -14,26 +14,18 @@ class InfraInternal(config_util.Config):
@staticmethod @staticmethod
def fetch_spec(_props): def fetch_spec(_props):
def url(host, repo):
return 'https://%s.googlesource.com/%s.git' % (host, repo)
spec = {
'solutions': [
{
'name': 'infra_internal',
'url': url('chrome-internal', 'infra/infra_internal'),
'managed': False
},
],
}
return { return {
'type': 'gclient_git', 'alias': {
'gclient_git_spec': spec, 'config': 'infra_superproject',
'props': [
'--checkout_internal=True',
],
},
} }
@staticmethod @staticmethod
def expected_root(_props): def expected_root(_props):
return 'infra_internal' return ''
def main(argv=None): def main(argv=None):
@ -42,4 +34,3 @@ def main(argv=None):
if __name__ == '__main__': if __name__ == '__main__':
sys.exit(main(sys.argv)) sys.exit(main(sys.argv))

@ -3,6 +3,7 @@
# found in the LICENSE file. # found in the LICENSE file.
import sys import sys
import ast
import config_util # pylint: disable=import-error import config_util # pylint: disable=import-error
@ -12,7 +13,7 @@ import config_util # pylint: disable=import-error
class InfraSuperproject(config_util.Config): class InfraSuperproject(config_util.Config):
"""Basic Config class for the whole set of Infrastructure repositories.""" """Basic Config class for the whole set of Infrastructure repositories."""
@staticmethod @staticmethod
def fetch_spec(_props): def fetch_spec(props):
def url(host, repo): def url(host, repo):
return 'https://%s.googlesource.com/%s.git' % (host, repo) return 'https://%s.googlesource.com/%s.git' % (host, repo)
@ -22,12 +23,12 @@ class InfraSuperproject(config_util.Config):
'name': '.', 'name': '.',
'url': url('chromium', 'infra/infra_superproject'), 'url': url('chromium', 'infra/infra_superproject'),
'managed': False, 'managed': False,
'custom_vars': { 'custom_vars': {},
'checkout_internal': True
}
}, },
], ],
} }
if ast.literal_eval(props.get('checkout_internal', 'False')):
spec['solutions'][0]['custom_vars']['checkout_internal'] = True
return { return {
'type': 'gclient_git', 'type': 'gclient_git',
'gclient_git_spec': spec, 'gclient_git_spec': spec,

Loading…
Cancel
Save