codecov / codecov-api

Code for the API of Codecov
Other
216 stars 30 forks source link

fix(test results): accept null branch and add default branch #708

Closed joseph-sentry closed 2 months ago

joseph-sentry commented 2 months ago

previously the test results upload endpoint did not require a branch field in the data included with the upload but it also did not allow null values for the branch field, so in v0.7.3 of the CLI when we added the branch field to the upload, some uploads were broken because the CLI would not be able to detect a branch and so the branch field would be set to None.

This change modifies the endpoint to accept null values for the branch and if the endpoint is creating the Commit object in the database and the branch field is set to null then it will set the branch field of the commit to the default branch of the repo it's targetting.

codecov-notifications[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:white_check_mark: All tests successful. No failed tests found.

:loudspeaker: Thoughts on this report? Let us know!

codecov-qa[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.65%. Comparing base (8339939) to head (c5db211). Report is 1 commits behind head on main.

:white_check_mark: All tests successful. No failed tests found.

@@           Coverage Diff           @@
##             main     #708   +/-   ##
=======================================
  Coverage   91.65%   91.65%           
=======================================
  Files         632      632           
  Lines       16917    16917           
=======================================
  Hits        15506    15506           
  Misses       1411     1411           
Flag Coverage Δ
unit 91.65% <100.00%> (ø)
unit-latest-uploader 91.65% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
upload/views/test_results.py 98.63% <100.00%> (ø)

... and 1 file with indirect coverage changes

:mega: Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

codecov-public-qa[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.65%. Comparing base (8339939) to head (c5db211). Report is 1 commits behind head on main.

:white_check_mark: All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #708   +/-   ##
=======================================
  Coverage   91.65%   91.65%           
=======================================
  Files         632      632           
  Lines       16917    16917           
=======================================
  Hits        15506    15506           
  Misses       1411     1411           
Flag Coverage Δ
unit 91.65% <100.00%> (ø)
unit-latest-uploader 91.65% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
upload/views/test_results.py 98.63% <100.00%> (ø)

... and 1 file with indirect coverage changes

Impacted file tree graph

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 96.00%. Comparing base (8339939) to head (c5db211). Report is 1 commits behind head on main.

Changes have been made to critical files, which contain lines commonly executed in production. Learn more

:white_check_mark: All tests successful. No failed tests found.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #708 +/- ## ================================================ + Coverage 95.98000 96.00000 +0.02000 ================================================ Files 812 812 Lines 18254 18323 +69 ================================================ + Hits 17522 17591 +69 Misses 732 732 ``` | [Flag](https://app.codecov.io/gh/codecov/codecov-api/pull/708/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/codecov/codecov-api/pull/708/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `91.65% <100.00%> (ø)` | | | [unit-latest-uploader](https://app.codecov.io/gh/codecov/codecov-api/pull/708/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `91.65% <100.00%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.