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

chore: Add Codecov token parameter #10459

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

filzrev
Copy link
Contributor

@filzrev filzrev commented Dec 14, 2024

After PR(#10456) is merged to main.

Following error occurred on CI job on main branch.

error - 2024-12-14 13:42:58,342 -- Upload failed: {"message":"Token required because branch is protected"}
==> Failed to upload coverage
    Exiting...

For protected branch. Tokenless Uploads for Public Repositories seems not works.
So I've added parameter that is used before.

Copy link

codecov bot commented Dec 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.40%. Comparing base (fe673ec) to head (f796f72).
Report is 494 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10459      +/-   ##
==========================================
+ Coverage   74.31%   79.40%   +5.08%     
==========================================
  Files         536      547      +11     
  Lines       23189    23623     +434     
  Branches     4056     4061       +5     
==========================================
+ Hits        17234    18758    +1524     
+ Misses       4853     3695    -1158     
- Partials     1102     1170      +68     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@filzrev filzrev force-pushed the chore-chore-add-ci-codecov-step2 branch 2 times, most recently from bbbe2eb to f796f72 Compare December 14, 2024 14:34
@filzrev
Copy link
Contributor Author

filzrev commented Dec 15, 2024

Note: ci environment seems be removed at this commit

So it need to set CODECOV_TOKEN as repository secrets to work this settings. (or revert to use ci environment secrets)

@filzrev filzrev force-pushed the chore-chore-add-ci-codecov-step2 branch 2 times, most recently from 5a7c297 to 4f6f756 Compare December 16, 2024 20:03
@filzrev
Copy link
Contributor Author

filzrev commented Dec 16, 2024

I've added .github/codecov.yml file for Codecov.

What's changed from default Codecov setting

  1. coverage:: Set to report coverage information only.
  2. comment: false: Suppress PR comment from CodeCov. (To suppress GitHub notifications)
  3. github_checks:: Suppress GitHub annotations. (Because It's deprecated to use by Codecov)

TODO
After this PR is merged to main branch.
Following checks will be displayed on PR's GitHub Checks. and it can confirm code coverage information from these links.

  • codecov/patch
  • codecov/project

image

If these checks are not displayed.
It might to re-install Codecov GitHub apps to docfx repository.

@filzrev filzrev force-pushed the chore-chore-add-ci-codecov-step2 branch from 4f6f756 to bd8e9ea Compare December 21, 2024 12:07
@filzrev
Copy link
Contributor Author

filzrev commented Dec 21, 2024

Change fail_ci_if_error parameter to false.

It's required because forked repository's main branch CI is failed when CODECOV_TOKEN token is not set.
And when custom CODECOV_TOKEN token is explicitly set on forked respository.
Tokenless Uploads for dotnet/docfx is failed on Pull Request CI.

So don't use CODECOV_TOKEN secret on forked respository. and ignore main branch's CI error on forked repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant