Skip to content

feat: Send upload size to upload request and cli version with API requests#702

Open
calvin-codecov wants to merge 2 commits intomainfrom
cy/more_metrics
Open

feat: Send upload size to upload request and cli version with API requests#702
calvin-codecov wants to merge 2 commits intomainfrom
cy/more_metrics

Conversation

@calvin-codecov
Copy link
Copy Markdown
Contributor

@calvin-codecov calvin-codecov commented Apr 21, 2026

Closes https://github.com/codecov/core-engineering/issues/31

  • Changes upload size calculation from sys.getsizeof() to len() as len more accurately represents the bytes' size while getsizeof includes Python overhead in its memory size.
  • Include Codecov CLI version in the data for all post requests
  • Send through correct file_not_found data attribute

Comment on lines -269 to -273
mocked_legacy_upload_endpoint.match = [
matchers.json_params_matcher(request_data),
matchers.header_matcher(headers),
]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This seems like it was incorrectly using the mocked_legacy_upload_endpoint even though this is a different endpoint. I think we want the mocked_test_results_endpoint (newly added below) which would match with the argument at line 295 and with the url designated in this function

commit_sha,
report_code,
upload_coverage,
file_not_found=file_not_found,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This seemed like a missed line from before. We weren't passing in the file_not_found value that is defined higher up at line 59/61 and self.get_url_and_possibly_update_data() takes it in with a default value of "False" so it would always just set `data['file_not_found'] to False

Please review this in particular

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.

1 participant