codecov / codecov-cli

Codecov's Command Line Interface. Used for uploading to Codecov in your CI, Test Labelling, Local Upload, and more
Apache License 2.0
56 stars 39 forks source link

Missing 1 required positional argument: 'args' #544

Open RomainMuller opened 1 month ago

RomainMuller commented 1 month ago

I am seeing failures on 0.8.0 when trying to run codecovcli create-report-results:

debug - 2024-10-24 09:38:09,453 -- Using ci service from provider name: GithubActions
  debug - 2024-10-24 09:38:09,456 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.GitVersioningSystem'>
  debug - 2024-10-24 09:38:09,458 -- versioning system found: <class 'codecov_cli.helpers.versioning_systems.GitVersioningSystem'>
  debug - 2024-10-24 09:38:09,461 -- Loading config from /home/runner/work/orchestrion/orchestrion/codecov.yml
  debug - 2024-10-24 09:38:09,466 -- Creating report results --- {"auto_load_params_from": "GithubActions", "verbose": true, "codecov_yml_path": null, "enterprise_url": null, "version": "cli-0.8.0", "command": "create-report-results", "commit_sha": "cec[48](https://github.com/DataDog/orchestrion/actions/runs/11495397264/job/31998711406?pr=353#step:4:49)201fa756423589e768c1561fe5661b9f103", "fail_on_error": true, "git_service": "github", "slug": "DataDog/orchestrion", "code": "default"}
  Traceback (most recent call last):
    File "/opt/hostedtoolcache/Python/3.12.7/x64/bin/codecovcli", line 8, in <module>
      sys.exit(run())
               ^^^^^
    File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/codecov_cli/main.py", line 83, in run
      cli(obj={})
    File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
      return self.main(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/click/core.py", line 1078, in main
      rv = self.invoke(ctx)
           ^^^^^^^^^^^^^^^^
    File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
      return _process_result(sub_ctx.command.invoke(sub_ctx))
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
      return ctx.invoke(self.callback, **ctx.params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/click/core.py", line 783, in invoke
      return __callback(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/hostedtoolcache/Python/3.12.7/x[64](https://github.com/DataDog/orchestrion/actions/runs/11495397264/job/31998711406?pr=353#step:4:65)/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
      return f(get_current_context(), *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/codecov_cli/commands/create_report_result.py", line 36, in create_report_results
      create_report_results_logic(
    File "/opt/hostedtoolcache/Python/3.12.7/x64/lib/python3.12/site-packages/codecov_cli/services/report/__init__.py", line 79, in create_report_results_logic
      sending_result = send_reports_result_request(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  TypeError: send_reports_result_request() missing 1 required positional argument: 'args'

It appears the code is indeed invalid, as the offending call found here:

https://github.com/codecov/codecov-cli/blob/08745b94524bb789ad8df39980f6b8ebc45d4a51/codecov_cli/services/report/__init__.py#L79-L86

Does indeed not pass the required args value to the function defined there:

https://github.com/codecov/codecov-cli/blob/08745b94524bb789ad8df39980f6b8ebc45d4a51/codecov_cli/services/report/__init__.py#L94-L102