Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Legacy upload sender not working with extra args #574

Merged
merged 6 commits into from
Dec 6, 2024

Conversation

tony-codecov
Copy link
Contributor

@tony-codecov tony-codecov commented Dec 6, 2024

These args are not used in legacy uploader:

  • report_code
  • upload_file_type
  • git_service

Added **kwargs ignore these and also ignore any other extra args being passed to the legacy upload sender.

Fixes #572

Copy link

codecov bot commented Dec 6, 2024

❌ 5 Tests Failed:

Tests completed Failed Passed Skipped
3555 5 3550 0
View the top 3 failed tests by shortest run time
api.temp.calculator.test_calculator::test_divide
Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError
api.temp.calculator.test_calculator::test_divide
Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError
api.temp.calculator.test_calculator::test_divide
Stack Traces | 0.001s run time
def
                test_divide():
                > assert Calculator.divide(1, 2) == 0.5
                E assert 1.0 == 0.5
                E + where 1.0 = <function Calculator.divide at 0x104c9eb90>(1, 2)
                E + where <function Calculator.divide at 0x104c9eb90> = Calculator.divide
                .../temp/calculator/test_calculator.py:30: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link

github-actions bot commented Dec 6, 2024

✅ All tests successful. No failed tests were found.

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

@tony-codecov tony-codecov changed the title fix: Add parent_sha and upload_coverage to legacy upload sender arg list fix: Legacy uploader doesn't work with codecov-cli 9.1.0 Dec 6, 2024
@tony-codecov tony-codecov changed the title fix: Legacy uploader doesn't work with codecov-cli 9.1.0 fix: Legacy upload sender not working with extra args Dec 6, 2024
Copy link
Contributor

@joseph-sentry joseph-sentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for this to work i think wherever you're calling send_upload_data, you have to pass the arguments as kwargs:

sending_result = sender.send_upload_data(
    upload_data=upload_data,
    commit_sha=commit_sha,
    token=token,
    env_vars=env_vars,
    report_code=report_code,
    upload_file_type=upload_file_type,
    name=name,
    branch=branch,
    slug=slug,
    pull_request_number=pull_request_number,
    build_code=build_code,
    build_url=build_url,
    job_code=job_code,
    flags=flags,
    ci_service=ci_service,
    git_service=git_service,
    enterprise_url=enterprise_url,
    parent_sha=parent_sha,
    upload_coverage=upload_coverage,
    args=args,
)

sender.send_upload_data pass arguments as kwargs
Comment on lines 217 to +222
sending_result = UploadSender().send_upload_data(
upload_collection, random_sha, random_token, upload_coverage=True, **named_upload_data
upload_collection,
random_sha,
random_token,
upload_coverage=True,
**named_upload_data,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting caught this, unrelated to PR

@tony-codecov tony-codecov merged commit 8510d4a into main Dec 6, 2024
19 checks passed
@tony-codecov tony-codecov deleted the tony/fix-572 branch December 6, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v9.1.0 breaks codecov-action@v4 due to changes in the uploader
3 participants