From 313c180366694a91e0ce50c213fe2e5af35ed0d3 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Sun, 2 Aug 2026 11:56:34 +0000 Subject: [PATCH] fix: prevent ValueError when slug is missing with --handle-no-reports-found --- codecov_cli/services/upload/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/codecov_cli/services/upload/__init__.py b/codecov_cli/services/upload/__init__.py index 2793c3924..0d0773527 100644 --- a/codecov_cli/services/upload/__init__.py +++ b/codecov_cli/services/upload/__init__.py @@ -104,6 +104,16 @@ def do_upload_logic( upload_data = collector.generate_upload_data(report_type) except click.ClickException as exp: if handle_no_reports_found: + if slug is None: + logger.warning( + "No coverage reports found. Cannot trigger upload completion: no slug provided." + ) + return RequestResult( + error=None, + warnings=None, + status_code=200, + text="No coverage reports found. Upload completion skipped: no slug provided.", + ) logger.info( "No coverage reports found. Triggering notifications without uploading." )