Add schema validation of namespaces and sources methods
This commit is contained in:
parent
57528aa2bc
commit
e025d8c2b2
5 changed files with 96 additions and 9 deletions
|
@ -289,7 +289,7 @@ class GitLabBuildTrigger(BuildTriggerHandler):
|
|||
'url': gl_client.host + '/' + namespace['path'],
|
||||
}
|
||||
|
||||
return list(namespaces.values())
|
||||
return BuildTriggerHandler.build_namespaces_response(namespaces)
|
||||
|
||||
@_catch_timeouts
|
||||
def list_build_sources_for_namespace(self, namespace):
|
||||
|
@ -313,7 +313,8 @@ class GitLabBuildTrigger(BuildTriggerHandler):
|
|||
|
||||
gl_client = self._get_authorized_client()
|
||||
repositories = _paginated_iterator(gl_client.getprojects, RepositoryReadException)
|
||||
return [repo_view(repo) for repo in repositories if repo['namespace']['path'] == namespace]
|
||||
repos = [repo_view(repo) for repo in repositories if repo['namespace']['path'] == namespace]
|
||||
return BuildTriggerHandler.build_sources_response(repos)
|
||||
|
||||
@_catch_timeouts
|
||||
def list_build_subdirs(self):
|
||||
|
|
Reference in a new issue