def get_job_build_range(jenkins, job): url = JOB_INFO_URL.format(jenkins, job) resp = util.get_json(url) first = resp['firstBuild']['number'] last = resp['lastFailedBuild']['number'] return xrange(last, first, -1)
def get_main_bug_task(bug_id): url = BUG_TASKS_URL.format(bug_id) resp = util.get_json(url) task = resp['entries'][0] task = util.select_keys(task, ['assignee_link', 'bug_target_name', 'importance', 'status']) util.rename_key(task, 'bug_target_name', 'target') return task
def get_build(jenkins, job, number, short=True): if short: url_template = BUILD_SHORT_INFO_URL else: url_template = BUILD_INFO_URL url = url_template.format(jenkins, job, number) resp = util.get_json(url) return resp
def get_downstream_build_names(jenkins, job, ignore_list): url = JOB_INFO_URL.format(jenkins, job) resp = util.get_json(url) names = [] for pair in resp["downstreamProjects"]: name = pair["name"] if name and name not in ignore_list: names.append(name) return names
def get_build(jenkins, job, number): url = BUILD_INFO_URL.format(jenkins, job, number) resp = util.get_json(url) return resp
def get_assignee(link): resp = util.get_json(link) return util.select_keys(resp, ['display_name', 'name', 'is_team'])
def get_bug_basic_info(link): resp = util.get_json(link) info = util.select_keys(resp, ['id', 'title', 'duplicate_of_link']) return info