Skip to content

Commit 2f558ee

Browse files
nh13epruesse
andauthored
fix: add raise_for_status to CircleCI workflow API call (#1083)
Add missing `raise_for_status()` call after the CircleCI `/workflow/{id}/job` API request in `get_circleci_artifacts`. Without it, an HTTP error (e.g. 500) causes `KeyError: 'items'` instead of a clear HTTP error. See failed CircleCI pipeline [#178886](https://app.circleci.com/pipelines/github/bioconda/bioconda-recipes/178886) (`build_and_upload-osx-arm64`, `build_and_upload-linux-aarch64`). --------- Co-authored-by: Elmar Pruesse <epruesse@users.noreply.github.com>
1 parent af1ac9c commit 2f558ee

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

bioconda_utils/artifacts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ def get_circleci_artifacts(check_run, platform):
216216
# Use API v2 because v1.1 does not have a workflow endpoint
217217
url_wf = f"https://circleci.com/api/v2/workflow/{circleci_workflow_id}/job"
218218
res_wf = requests.get(url_wf, headers=headers)
219+
res_wf.raise_for_status()
219220
json_wf = json.loads(res_wf.text)
220221

221222
if len(json_wf["items"]) == 0:

0 commit comments

Comments
 (0)