Skip to content

Code coverage uploads fail occasionally at the CI #9832

@ahukkanen

Description

@ahukkanen

Describe the bug
At #9686 we tried to solve the issue with the "flaky" code coverage reports that sometimes report coverage dropped even when it didn't really drop.

The implemented solution was based on simplecov-ruby/simplecov#1019 which explains simplecov having a bug and we can avoid that bug by letting codecov itself merge the reports and keeping them separate on parallel runs.

After this was implemented, we started getting this kind of error when trying to upload the reports to codecov:

https://codecov.io/upload/v4?package=bash-1.0.6&token=<hidden>&package=bash-1.0.6&token=&branch=develop&commit=c6791f1455d88ba20aedd3c6a93a709d8771b5ae&build=3061503581&build_url=https%3A%2F%2Fgithub.com%2Fdecidim%2Fdecidim%2Factions%2Fruns%2F3061503581&name=decidim-admin&tag=&slug=decidim%2Fdecidim&service=github-actions&flags=decidim-admin&pr=&job=%5BCI%5D%20Admin%20%28system%20tests%29&cmd_args=n,C,F
{'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')}
404

To Reproduce
This happens randomly, so see #9686 (comment).

That comment explains an actual case where this happened and the reason why it happened.

Expected behavior
It would be expected that the code coverage report uploading succeeds normally.

Screenshots
Coverage report upload failed

Stacktrace

==> Uploading to Codecov
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  448k  100   171  100  448k    881  [23](https://github.com/decidim/decidim/actions/runs/3061503581/jobs/4941352077#step:6:24)13k --:--:-- --:--:-- --:--:-- 2[31](https://github.com/decidim/decidim/actions/runs/3061503581/jobs/4941352077#step:6:32)3k
    {'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')}

Extra data (please complete the following information):

  • Device: The machine running at Microsoft datacenter
  • Device OS: Linux
  • Browser: Any
  • Decidim Version: develop
  • Decidim installation: N/A

Additional context
The codecov uploader we are using (https://codecov.io/bash) would allow passing the "codecov token" using -t TOKEN. It would need to be added here:

bash <(curl -s https://codecov.io/bash) -n $REPORT_NAME -C $SHA -F $REPORT_NAME
else
bash <(curl -s https://codecov.io/bash) -n $REPORT_NAME -C $SHA -P $PRID -F $REPORT_NAME

After investigating the codecov script, this could be also solved simply by providing the CODECOV_TOKEN environment value to the upload script.

The problem is that at least I don't have access to the Codecov account to get that token.

Anyone knows who has access to the Codecov account?

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: internalPRs that aren't necessary to add to the CHANGELOG for implementers

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions