From 61f586a5e9d366d84c0d04f8f67e409321d8f079 Mon Sep 17 00:00:00 2001 From: Tony Le Date: Fri, 8 Nov 2024 12:46:37 -0500 Subject: [PATCH] Upload-process logic --- codecov_cli/commands/upload_process.py | 98 ++++++++++++++----------- codecov_cli/services/upload/__init__.py | 7 +- 2 files changed, 56 insertions(+), 49 deletions(-) diff --git a/codecov_cli/commands/upload_process.py b/codecov_cli/commands/upload_process.py index d4af415e..2ec897a1 100644 --- a/codecov_cli/commands/upload_process.py +++ b/codecov_cli/commands/upload_process.py @@ -6,6 +6,7 @@ from codecov_cli.commands.combined_upload import combined_upload from codecov_cli.commands.commit import create_commit +from codecov_cli.commands.report import create_report from codecov_cli.commands.upload import do_upload, global_upload_options from codecov_cli.helpers.args import get_cli_args from codecov_cli.helpers.options import global_options @@ -66,8 +67,8 @@ def upload_process( extra_log_attributes=args, ), ) - - if report_type == "coverage": + + if not use_legacy_uploader and report_type == "coverage": ctx.invoke( combined_upload, branch=branch, @@ -104,50 +105,61 @@ def upload_process( token=token, use_legacy_uploader=use_legacy_uploader, ) - else: + return + + ctx.invoke( + create_commit, + commit_sha=commit_sha, + parent_sha=parent_sha, + pull_request_number=pull_request_number, + branch=branch, + slug=slug, + token=token, + git_service=git_service, + fail_on_error=True, + ) + if report_type == "coverage": ctx.invoke( - create_commit, - commit_sha=commit_sha, - parent_sha=parent_sha, - pull_request_number=pull_request_number, - branch=branch, - slug=slug, + create_report, token=token, - git_service=git_service, + code=report_code, fail_on_error=True, - ) - ctx.invoke( - do_upload, - branch=branch, - build_code=build_code, - build_url=build_url, commit_sha=commit_sha, - disable_file_fixes=disable_file_fixes, - disable_search=disable_search, - dry_run=dry_run, - env_vars=env_vars, - fail_on_error=fail_on_error, - files_search_exclude_folders=files_search_exclude_folders, - files_search_explicitly_listed_files=files_search_explicitly_listed_files, - files_search_root_folder=files_search_root_folder, - flags=flags, - gcov_args=gcov_args, - gcov_executable=gcov_executable, - gcov_ignore=gcov_ignore, - gcov_include=gcov_include, - git_service=git_service, - handle_no_reports_found=handle_no_reports_found, - job_code=job_code, - name=name, - network_filter=network_filter, - network_prefix=network_prefix, - network_root_folder=network_root_folder, - plugin_names=plugin_names, - pull_request_number=pull_request_number, - report_code=report_code, - report_type=report_type, slug=slug, - swift_project=swift_project, - token=token, - use_legacy_uploader=use_legacy_uploader, + git_service=git_service, ) + ctx.invoke( + do_upload, + branch=branch, + build_code=build_code, + build_url=build_url, + commit_sha=commit_sha, + disable_file_fixes=disable_file_fixes, + disable_search=disable_search, + dry_run=dry_run, + env_vars=env_vars, + fail_on_error=fail_on_error, + files_search_exclude_folders=files_search_exclude_folders, + files_search_explicitly_listed_files=files_search_explicitly_listed_files, + files_search_root_folder=files_search_root_folder, + flags=flags, + gcov_args=gcov_args, + gcov_executable=gcov_executable, + gcov_ignore=gcov_ignore, + gcov_include=gcov_include, + git_service=git_service, + handle_no_reports_found=handle_no_reports_found, + job_code=job_code, + name=name, + network_filter=network_filter, + network_prefix=network_prefix, + network_root_folder=network_root_folder, + plugin_names=plugin_names, + pull_request_number=pull_request_number, + report_code=report_code, + report_type=report_type, + slug=slug, + swift_project=swift_project, + token=token, + use_legacy_uploader=use_legacy_uploader, + ) diff --git a/codecov_cli/services/upload/__init__.py b/codecov_cli/services/upload/__init__.py index f6e65e76..222638ef 100644 --- a/codecov_cli/services/upload/__init__.py +++ b/codecov_cli/services/upload/__init__.py @@ -121,12 +121,7 @@ def do_upload_logic( else: raise exp if use_legacy_uploader: - if combined_upload: - raise NotImplementedError( - "Combined upload is not supported with legacy uploader" - ) - else: - sender = LegacyUploadSender() + sender = LegacyUploadSender() else: sender = UploadSender() logger.debug(f"Selected uploader to use: {type(sender)}")