codecov / codecov-exe

.exe report uploader for Codecov https://codecov.io
MIT License
26 stars 21 forks source link

400 Bad Request Uploading From Azure Devops #166

Closed rkapoor028 closed 3 years ago

rkapoor028 commented 3 years ago

We are using Codecov -Version 1.12.4 Nuget Package to upload the Cobertura Format XML Coverage reports to CodeCov. The Command we are using is

&"$(Build.SourcesDirectory)\Codecov.1.12.4\tools\codecov.exe" -f "$(Agent.TempDirectory)\Cobertura.xml" -t $(CodeCov_Token)

We are seeing a 400 error "Unable to upload coverage report to Codecov. Server returned: (400) Bad Request" . However, we still see the report for the commit in CodeCov portal. We are not sure if its uploading the complete report or not.

            exe-1.12.4+28c5cd57bef15ea765ee8e362a35f3d74fd9004a

AzurePipelines detected.
Git detected.
Project root: C:\vstsagent\A1\_work\4\s
Yaml not found, that's ok! Learn more at https://docs.codecov.io/docs/codecov-yaml
Reading reports.
C:\vstsagent\A1\_work\_temp\Cobertura.xml
[WRN] Total file size of reports is above 20MB, this may prevent report being shown on codecov.io
Uploading Reports.
[WRN] Reduce the total upload size if this occurs
url: https://codecov.io
query: https://codecov.io/upload/v4?branch=XXXX-12066-project-export&commit=3cb027990650f1a6a073ffae7c1d90XXXXXXX&build=20210120-22326&tag=&pr=&name=&flags=&slug=XXXXX%2FXXXX&package=exe-1.12.4+28c5cd57bef15ea765ee8e362a35f3d74fd9004a&build_url=https://dev.azure.com/XXXXXXXX/DevOps/_build/results?buildId=64123&yaml=&job=64123&service=azure_pipelines&project=DevOps&server_uri=https://dev.azure.com/XXXXXXX/
Pinging Codecov
Uploading
[WRN] Unable to upload coverage report to Codecov. Server returned: (400) Bad Request
[WRN] Unable to upload coverage report to Codecov. Server returned: (400) Bad Request
[WRN] Unknown reason. Possible reason being invalid parameters.
[WRN] Failed to upload the report with CodecovUploader.
Uploading to Codecov
View reports at: https://codecov.io/github/XXXXXXXXX/XXXXXXX/commit/3cb027990650f1a6a073ffae7c1dXXXXXXXXX

Any help will be appreciated. Thanks.

AdmiringWorm commented 3 years ago

@rkapoor028 it is just the first try of the uploader that failed, but from your log the fallback uploader succeeded.

If both had failed, you would not have seen the message View reports at at the end. You would instead have seen an error message (those errors you point to are just warnings), and potentially a stacktrace as well.

Regarding your mention of We are not sure if its uploading the complete report or not., you will either have the complete report, or no report at all. Codecov-exe uploads the full report to codecov.io, but if the report is too large then there may not be shown any report on the website (this is why the warning about the file size).

rkapoor028 commented 3 years ago

Thanks for looking into this. Ok that's good to know.

Our Coverage Report is around 35MBs, what's the size limit for the Report? We are using Cobertura format, any other format which is recommended and will take less size?

AdmiringWorm commented 3 years ago

I am not sure what the size limit actually is (I think it is maximum 45MB), the warning was added before I became a part of maintaining the program.

Personally, I use the OpenCover (XML) format instead of cobertura, but I don't think you will get any size benefit for that. However, I don't think you need to worry about it for quite some time. As long as you see a report on the website, everything should have gone as planned. When/if it suddenly start reporting no report was submitted, then you could look into optimizing the size of the reports (maybe splitting them up into multiple reports, and calling codecov-exe multiple times for each report).

rkapoor028 commented 3 years ago

Perfect! thats sounds like a good plan. We can do that if required in future.

Thanks @AdmiringWorm once again. No more questions from our side.

Will close this issue as well.

AdmiringWorm commented 3 years ago

No problem. If you have any further questions in the future, please feel free to contact me on the gitter channel for this repository: https://gitter.im/codecov-exe/community