def get_response_push(self, project, branches): """ Build branches on push events and return API response. Return a JSON response with the following:: { "build_triggered": true, "project": "project_name", "versions": [...] } :param project: Project instance :type project: Project :param branches: List of branch names to build :type branches: list(str) """ to_build, not_building = build_branches(project, branches) if not_building: log.info( 'Skipping project branches: project=%s branches=%s', project, branches, ) triggered = True if to_build else False return { 'build_triggered': triggered, 'project': project.slug, 'versions': list(to_build), }
def get_response_push(self, project, branches): """ Build branches on push events and return API response. Return a JSON response with the following:: { "build_triggered": true, "project": "project_name", "versions": [...] } :param project: Project instance :type project: Project :param branches: List of branch names to build :type branches: list(str) """ to_build, not_building = build_branches(project, branches) if not_building: log.info('Skipping project branches: project=%s branches=%s', project, branches) triggered = True if to_build else False return {'build_triggered': triggered, 'project': project.slug, 'versions': list(to_build)}