From a94127293d2d200e0a1264f333bbc0cfb47a4c72 Mon Sep 17 00:00:00 2001 From: Saga4 Date: Mon, 2 Jun 2025 18:13:08 +0530 Subject: [PATCH 1/2] coverage undefined bug fix --- codeflash/api/cfapi.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codeflash/api/cfapi.py b/codeflash/api/cfapi.py index 00d324db9..273a3d61e 100644 --- a/codeflash/api/cfapi.py +++ b/codeflash/api/cfapi.py @@ -115,7 +115,7 @@ def suggest_changes( "existingTests": existing_tests, "generatedTests": generated_tests, "traceId": trace_id, - "coverage": coverage_message, + "coverage_message": coverage_message, } return make_cfapi_request(endpoint="/suggest-pr-changes", method="POST", payload=payload) @@ -151,7 +151,7 @@ def create_pr( "existingTests": existing_tests, "generatedTests": generated_tests, "traceId": trace_id, - "coverage": coverage_message, + "coverage_message": coverage_message, } return make_cfapi_request(endpoint="/create-pr", method="POST", payload=payload) @@ -187,10 +187,10 @@ def get_blocklisted_functions() -> dict[str, set[str]] | dict[str, Any]: try: req = make_cfapi_request(endpoint="/verify-existing-optimizations", method="POST", payload=information) if req.status_code == not_found: - logger.debug(req.json()["message"]) + logger.debug(req.json()["error"]) return {} if req.status_code == internal_server_error: - logger.error(req.json()["message"]) + logger.error(req.json()["error"]) return {} req.raise_for_status() content: dict[str, list[str]] = req.json() From 739ae40c6ad712f26445b69b4902184b4c3caa08 Mon Sep 17 00:00:00 2001 From: Kevin Turcios Date: Mon, 2 Jun 2025 11:19:33 -0700 Subject: [PATCH 2/2] fix merge conflict --- codeflash/api/cfapi.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/codeflash/api/cfapi.py b/codeflash/api/cfapi.py index 0876ab91e..fefcb0822 100644 --- a/codeflash/api/cfapi.py +++ b/codeflash/api/cfapi.py @@ -183,12 +183,6 @@ def get_blocklisted_functions() -> dict[str, set[str]] | dict[str, Any]: information = {"pr_number": pr_number, "repo_owner": owner, "repo_name": repo} try: req = make_cfapi_request(endpoint="/verify-existing-optimizations", method="POST", payload=information) - if req.status_code == not_found: - logger.debug(req.json()["error"]) - return {} - if req.status_code == internal_server_error: - logger.error(req.json()["error"]) - return {} req.raise_for_status() content: dict[str, list[str]] = req.json() except Exception as e: