Loading ci/get_id_of_last_job_occurence.py +6 −1 Original line number Diff line number Diff line Loading @@ -52,12 +52,17 @@ job_id = -1 # check last 500 pipelines max for page in range(100): url_pls = API_BASE_URL + "/pipelines" # need both suffixes here to descend through the pages and get also older pipelines suffix = PER_PAGE_SUFFIX + PAGE_SUFFIX.format(page) resp_pls = requests.get(url_pls + suffix) for pl in resp_pls.json(): if pl["ref"] == branch_name: url_jobs = url_pls + f"/{pl['id']}/jobs" resp_jobs = requests.get(url_jobs + suffix) # only one of the suffixes here - this assumes only max of 50 jobs per pipeline # so only one page needed resp_jobs = requests.get(url_jobs + PER_PAGE_SUFFIX) if job_name not in resp_jobs.text: continue Loading Loading
ci/get_id_of_last_job_occurence.py +6 −1 Original line number Diff line number Diff line Loading @@ -52,12 +52,17 @@ job_id = -1 # check last 500 pipelines max for page in range(100): url_pls = API_BASE_URL + "/pipelines" # need both suffixes here to descend through the pages and get also older pipelines suffix = PER_PAGE_SUFFIX + PAGE_SUFFIX.format(page) resp_pls = requests.get(url_pls + suffix) for pl in resp_pls.json(): if pl["ref"] == branch_name: url_jobs = url_pls + f"/{pl['id']}/jobs" resp_jobs = requests.get(url_jobs + suffix) # only one of the suffixes here - this assumes only max of 50 jobs per pipeline # so only one page needed resp_jobs = requests.get(url_jobs + PER_PAGE_SUFFIX) if job_name not in resp_jobs.text: continue Loading