Skip to content

Commit

Permalink
Upload-process logic
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-codecov committed Nov 8, 2024
1 parent 10882aa commit 61f586a
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 49 deletions.
98 changes: 55 additions & 43 deletions codecov_cli/commands/upload_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
)
7 changes: 1 addition & 6 deletions codecov_cli/services/upload/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)}")
Expand Down

0 comments on commit 61f586a

Please sign in to comment.