melink14/rikaikun

Sometimes Codecov fails to upload coverage but succeeds on retry on the same build

Opened this issue · 2 comments

Error message from example run:

[2022-06-20T18:15:33.468Z] ['error'] There was an error running the uploader: Error uploading to [https://codecov.io:](https://codecov.io/) Error: There was an error fetching the storage URL during POST: 404 - {'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}
[2022-06-20T18:15:33.469Z] ['verbose'] The error stack is: Error: Error uploading to [https://codecov.io:](https://codecov.io/) Error: There was an error fetching the storage URL during POST: 404 - {'detail': ErrorDetail(string='Unable to locate build via Github Actions API. Please upload with the Codecov repository upload token to resolve issue.', code='not_found')}

In order to not lose time, it might be good to add some logic to retry the action when it fails. There are two ways to do this as far as I can tell:

  1. Add a duplicate codecov action after the first one which only runs if the first one fails. Since we don't know how long the problem lasts we may need to add a sleep timeout.
  2. https://github.com/Wandalen/wretry.action is an action which can retry simple other github actions. Might be worth trying if it works due to the better interface.

can I work on it?

Thanks for your offer to help on this issue! It's appreciated. Yes, that should be fine. See the contributing guide for best practices/tips and ask if you have any questions.

Fixing this issue should be straightforward but if it seems harder than expected please let us know since I don't want you to waste too much time on unexpected problems.