Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codecov: remove token, turn off CI failure #531

Merged
merged 3 commits into from
May 27, 2024
Merged

Conversation

jotak
Copy link
Member

@jotak jotak commented May 22, 2024

codecov upload per PR regularly fails with an error saying it's using tokenless mode, e.g:

 debug - 2024-05-21 10:10:55,574 -- Commit creating result --- {"result": "RequestResult(error=RequestError(code='HTTP Error 429', params={}, description='{\"detail\":\"Tokenless has reached GitHub rate limit. Please upload using a token: https://docs.codecov.com/docs/adding-the-codecov-token. Expected available in 478 seconds.\"}'), warnings=[], status_code=429, text='{\"detail\":\"Tokenless has reached GitHub rate limit. Please upload using a token: https://docs.codecov.com/docs/adding-the-codecov-token. Expected available in 478 seconds.\"}')"}
error - 2024-05-21 10:10:55,574 -- Commit creating failed: {"detail":"Tokenless has reached GitHub rate limit. Please upload using a token: https://docs.codecov.com/docs/adding-the-codecov-token. Expected available in 478 seconds."}
Error: Codecov: Failed to properly create commit: The process '/home/runner/work/_actions/codecov/codecov-action/v4/dist/codecov' failed with exit code 1

This happens despite we're setting the CODECOV_TOKEN in the workflow, or at least we think we do it.

In my understanding, the reason is that workflows on pull_request don't have access to secrets for security reasons. So the CODECOV_TOKEN variable that we pass is actually an empty string.

Now, something not clear to me yet, is why would we need to upload a report per unmerged pull request? The reports are actually uploaded on merged commits (and this works fine). I think the codecov app should be able to post comments per PR, without having to necessarily upload a report, but that's still something I need to figure out.

[Edit, after some digging]: confirming that tokens are ignored in pull_request events, cf https://docs.codecov.com/docs/codecov-uploader#supporting-token-less-uploads-for-forks-of-open-source-repos-using-codecov

It doesn't seem possible to just ask codecov to post comments without doing the report upload (yet to be confirmed).

Refs: codecov/codecov-action#1431, codecov/feedback#301

@jotak jotak added no-qe This PR doesn't necessitate QE approval no-doc This PR doesn't require documentation change on the NetObserv operator labels May 22, 2024
Copy link

openshift-ci bot commented May 22, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from jotak. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov-commenter
Copy link

codecov-commenter commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.27%. Comparing base (47d1fd7) to head (96c5e27).

Current head 96c5e27 differs from pull request most recent head 8083dbd

Please upload reports for the commit 8083dbd to get more accurate results.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #531   +/-   ##
=======================================
  Coverage   57.27%   57.27%           
=======================================
  Files         169      169           
  Lines        8487     8487           
  Branches     1160     1160           
=======================================
  Hits         4861     4861           
  Misses       3299     3299           
  Partials      327      327           
Flag Coverage Δ
uitests 57.92% <ø> (ø)
unittests 55.00% <ø> (ø)

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

@jotak jotak changed the title Do not try to upload codecov per PR Codecov: remove token, turn off CI failure May 22, 2024
@jotak jotak merged commit 8081041 into netobserv:main May 27, 2024
6 of 7 checks passed
jotak added a commit to netobserv/network-observability-operator that referenced this pull request May 27, 2024
jotak added a commit to jotak/flowlogs-pipeline that referenced this pull request May 27, 2024
jotak added a commit to jotak/flowlogs-pipeline that referenced this pull request May 27, 2024
jotak added a commit to jotak/netobserv-agent that referenced this pull request May 27, 2024
jotak added a commit to netobserv/flowlogs-pipeline that referenced this pull request May 28, 2024
openshift-merge-bot bot pushed a commit to netobserv/netobserv-ebpf-agent that referenced this pull request May 28, 2024
* Codecov: remove token, turn off CI failure

See also: netobserv/network-observability-console-plugin#531

Also, align the workflow file with other repos

* Add codecov on push / align with other repos workflows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-doc This PR doesn't require documentation change on the NetObserv operator no-qe This PR doesn't necessitate QE approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants