Repository navigation
Description
Describe the bug
The coverage job uploads coverage.xml with codecov/codecov-action@v4, but the upload only works for pull requests from forks. On main and on pull requests from branches in this repository, Codecov rejects it with "Token required because branch is protected". The job still passes, because the step has fail_ci_if_error: false, so it is easy to miss.
For a fork PR the log says "Fork detected, tokenless uploading used", and the upload goes through. That is why the Codecov bot only comments on PRs from forks, like #622 and #625. But it cannot compare them with main, because there is no report for main. Codecov's public API lists six uploaded commits for this repository, all from fork PRs, the first one from #625 (https://api.codecov.io/api/v2/github/OpenTabular/repos/DeepTab/commits/). So I think no upload from main has arrived since the step was added in 177704a.
To Reproduce
- Open the coverage job of the latest CI run on main: https://github.com/OpenTabular/DeepTab/actions/runs/43623791544/job/132548485529. Expand the step "Upload to Codecov". It shows "Token required because branch is protected" three times, for the commit, the report and the upload.
- The coverage job of fix(data): drop a single-row trailing training batch #578, which comes from a branch in this repository, shows the same three lines: https://github.com/OpenTabular/DeepTab/actions/runs/39682913223/job/120355832923
- The coverage job of fix(architectures): run Trompt on tables without numerical features #622, which comes from a fork, shows "Fork detected, tokenless uploading used" instead: https://github.com/OpenTabular/DeepTab/actions/runs/43611739533/job/132518847000
Expected behavior
The upload works on main and on PRs from this repository, so Codecov can show the change against main on every PR.
Desktop (please complete the following information):
- OS: GitHub Actions, ubuntu-latest
- Python version: the one of the coverage job
- deeptab Version: 2.1.0, main at eb15b6b
Additional context
I think the usual fix is a CODECOV_TOKEN repository secret that is passed to the action as token: ${{ secrets.CODECOV_TOKEN }}. The log links to https://docs.codecov.com/docs/codecov-tokens for the options. This needs admin rights, so I only open the issue. The 90% gate itself is not affected, because pytest checks it with --cov-fail-under=90.
Also, the same API still lists master as the default branch of this repository (https://api.codecov.io/api/v2/github/OpenTabular/repos/DeepTab/), so that setting may need an update after the rename to main as well.
Activity