Skip to content

Commit

Permalink
fix: surface processing errors
Browse files Browse the repository at this point in the history
codecov/worker#99 had the unwanted and overlooked effect of slightly changing the format
of the response from Codecov label-analysis.

Before the "errors" key was inside the "result" (it shouldn't be)
So the CLI is not surfacing these errors anymore.

These changes fix that and move the log line to a more logical position.
  • Loading branch information
giovanni-guidini committed Sep 19, 2023
1 parent 01f36c1 commit ccf2b31
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions codecov_cli/commands/labelanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,16 @@ def label_analysis(
)
resp_json = resp_data.json()
if resp_json["state"] == "finished":
logger.info(
"Received list of tests from Codecov",
extra=dict(
extra_log_attributes=dict(
processing_errors=resp_json.get("errors", [])
)
),
)
request_result = _potentially_calculate_absent_labels(
resp_data.json()["result"], requested_labels
resp_json["result"], requested_labels
)
if not dry_run:
runner.process_labelanalysis_result(request_result)
Expand Down Expand Up @@ -206,14 +214,6 @@ def label_analysis(
def _potentially_calculate_absent_labels(
request_result, requested_labels
) -> LabelAnalysisRequestResult:
logger.info(
"Received list of tests from Codecov",
extra=dict(
extra_log_attributes=dict(
processing_errors=request_result.get("errors", [])
)
),
)
if request_result["absent_labels"]:
# This means that Codecov already calculated everything for us
final_result = LabelAnalysisRequestResult(request_result)
Expand Down

0 comments on commit ccf2b31

Please sign in to comment.