[UX] "Branch `main` is protected but no token was provided" is a lie
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 59/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- github-actions, python
调研方向
Start by reading codecov_cli/services/commit/__init__.py at the linked warning location, then trace how the CLI handles token requirements for GitHub Actions and where the backend/API error is produced. The issue suggests clarifying the message to direct users to check OIDC permissions; done means the messages no longer falsely attribute the missing token to branch protection.
由索引模型根据 Issue 内容生成。
描述
Describe the bug
This was mentioned in the action @ https://github.com/codecov/codecov-action/issues/1918, and I've seen it before, I think.
Today, I saw it my CI, when I was wiring new repo, so I decided to take a closer look.
The uploader is pretty sure that the branch is not protected and claims so in this warning: https://github.com/tox-dev/tox-pre-commit/actions/runs/37032575031/job/110924028521#step:24:492. Then, it uses that as an excuse to explain why the token is needed saying that Token required because branch is protected in the error a few lines below.
The token might be expected, but the cause in the messages is untrue. The repository is new and doesn't have branch protection or rulesets configured. I think, this is what's been confusing people.
So it's sort of a UX problem. But also, it's a bit of an abstraction leak because people using GHA expect that the problem is in the action because they see the action printing out the error while the code is in the CLI which is kinda separate 🤷♂️
Expected behavior
I suppose the error message could be made cleaner to tell people to check if they'd enabled OIDC in the permissions key in the job definition if they use GitHub Actions CI/CD.
Regression
It's been like this since inception I recon 🤷♂️
Screenshots
https://github.com/tox-dev/tox-pre-commit/actions/runs/37032575031/job/110924028521#step:24:492
Product Area
coverage and test data uploaders
Versions
- OS: N/A
- Git Host: GitHub
- CI/CD: GitHub Actions CI/CD
- Uploader: codecov-action@v7
Commit and CI link
https://github.com/tox-dev/tox-pre-commit/actions/runs/37032575031/job/110924028521#step:24:492
Additional context
Here's where the warning is lying: https://github.com/codecov/codecov-cli/blame/c7e7bc0ce4fd57b0e349b3e09fcfed7e16f69637/codecov_cli/services/commit/__init__.py#L66
And the error lie is coming from the backend/API.
- 主要语言
- Python
- 星标
- 91
- 派生
- 65
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codecov/codecov-cli 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
codecov/codecov-cli#795 ·
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
codecov/codecov-cli#721 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 65/100
codecov/codecov-cli#777 ·
-
难度 1/5 1 小时以内 新手友好度 5/100
codecov/codecov-cli#715 ·
-
Remove prevent-cli from codecov-cli repo可能重新可做 @calvin-codecov 于 164 天前认领,目前没有进行中的 PR。 未关闭
codecov/codecov-cli#706 · 1 条评论 · 已指派 1 人 ·
查看 codecov/codecov-cli 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
huggingface/smolagents#2976 ·
维护者通常 1 天内回复
-
bug Triage-Needed
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
FuRongJun-1999/dsh-memory#170 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
pgvector/pgvector-python#163 ·
-
难度 1/5 1 小时以内 新手友好度 82/100
521xueweihan/HelloGitHub#3940 ·