Add source context to project API return

Currently api/tenant/openstack/project/ returns a list of config
objects but doesn't give you information on where this config
was defined.  Add the source context to the result.

Change-Id: I741d2e935ac6ed23035c40c079b36fd364386577
This commit is contained in:
Ian Wienand 2021-08-24 11:22:45 +10:00
parent 1c6ff1009a
commit bc3d6b7a27
2 changed files with 4 additions and 0 deletions

View File

@ -720,6 +720,9 @@ class TestWeb(BaseTestWeb):
'connection_name': 'gerrit',
'name': 'org/project1',
'configs': [{
'source_context': {'branch': 'master',
'path': 'zuul.yaml',
'project': 'common-config'},
'templates': [],
'default_branch': 'master',
'queue_name': 'integrated',

View File

@ -4479,6 +4479,7 @@ class ProjectConfig(ConfigObject):
def toDict(self):
d = {}
d['source_context'] = self.source_context.toDict()
d['default_branch'] = self.default_branch
if self.merge_mode:
d['merge_mode'] = list(filter(lambda x: x[1] == self.merge_mode,