Skip to content

Commit

Permalink
Refactored upload-process to upload-coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-codecov committed Nov 14, 2024
1 parent 998e09f commit 3daff9a
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 312 deletions.
289 changes: 0 additions & 289 deletions codecov_cli/commands/combined_upload.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

import click

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
from codecov_cli.services.upload_coverage import upload_coverage_logic
from codecov_cli.types import CommandContext

logger = logging.getLogger("codecovcli")
Expand All @@ -24,7 +24,7 @@
help="SHA (with 40 chars) of what should be the parent of this commit",
)
@click.pass_context
def upload_process(
def upload_coverage(
ctx: CommandContext,
branch: typing.Optional[str],
build_code: typing.Optional[str],
Expand Down Expand Up @@ -62,22 +62,32 @@ def upload_process(
):
args = get_cli_args(ctx)
logger.debug(
"Starting upload process",
"Starting upload coverage",
extra=dict(
extra_log_attributes=args,
),
)

if not use_legacy_uploader and report_type == "coverage":
versioning_system = ctx.obj["versioning_system"]
codecov_yaml = ctx.obj["codecov_yaml"] or {}
cli_config = codecov_yaml.get("cli", {})
ci_adapter = ctx.obj.get("ci_adapter")
enterprise_url = ctx.obj.get("enterprise_url")
args = get_cli_args(ctx)
ctx.invoke(
combined_upload,
upload_coverage_logic,
cli_config,
versioning_system,
ci_adapter,
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,
enterprise_url=enterprise_url,
env_vars=env_vars,
fail_on_error=fail_on_error,
files_search_exclude_folders=files_search_exclude_folders,
Expand All @@ -99,11 +109,12 @@ def upload_process(
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,
upload_file_type=report_type,
use_legacy_uploader=use_legacy_uploader,
args=args,
)
return

Expand Down
4 changes: 2 additions & 2 deletions codecov_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from codecov_cli.commands.send_notifications import send_notifications
from codecov_cli.commands.staticanalysis import static_analysis
from codecov_cli.commands.upload import do_upload
from codecov_cli.commands.upload_process import upload_process
from codecov_cli.commands.upload_coverage import upload_coverage
from codecov_cli.helpers.ci_adapters import get_ci_adapter, get_ci_providers_list
from codecov_cli.helpers.config import load_cli_config
from codecov_cli.helpers.logging_utils import configure_logger
Expand Down Expand Up @@ -74,7 +74,7 @@ def cli(
cli.add_command(label_analysis)
cli.add_command(static_analysis)
cli.add_command(empty_upload)
cli.add_command(upload_process)
cli.add_command(upload_coverage)
cli.add_command(send_notifications)
cli.add_command(process_test_results)

Expand Down
4 changes: 2 additions & 2 deletions codecov_cli/services/upload/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def do_upload_logic(
cli_config: typing.Dict,
versioning_system: VersioningSystemInterface,
ci_adapter: CIAdapterBase,
combined_upload: bool = False,
upload_coverage: bool = False,
*,
args: dict = None,
branch: typing.Optional[str],
Expand Down Expand Up @@ -151,7 +151,7 @@ def do_upload_logic(
git_service,
enterprise_url,
parent_sha,
combined_upload,
upload_coverage,
args,
)
else:
Expand Down
Loading

0 comments on commit 3daff9a

Please sign in to comment.