ci: coverage 상시 red 해소 — codecov 업로드 실패를 비치명으로 - #12
Merged
Conversation
added 2 commits
August 17, 2026 14:16
…age on codecov upload errors
The `coverage` check has been red on every run since it started reporting
(24/24, 2026-07-22 through 2026-08-17). Measured cause, single and constant:
gh secret list -R Jun025/RustJava -> empty (no secrets at all)
This repo is a fork, and forks do not inherit the upstream repo's secrets, so
`token: ${{ secrets.CODECOV_TOKEN }}` expands to the empty string. The uploader
reports `Token length: 0` and codecov rejects it with
`{"message":"Token required - not valid tokenless upload"}`, exit 1. With
`fail_ci_if_error: true` that sank the whole job.
Across all 24 runs the only failing step is ever `Upload to codecov.io`;
`Generate code coverage` has never failed. So the red carried no signal — it
was a constant, and a constant red hides real regressions rather than
reporting them. It also forced every upstream-sync round to hand-carry a
"coverage red is pre-existing, not a merge blocker" exemption.
Upload errors are now non-fatal. This does not weaken the build check:
`Generate code coverage` is a separate `run:` step with no
`continue-on-error`, so a broken build or failing test still fails the job.
What is no longer fatal is strictly the publish to codecov.io, whose error
text still appears in the step log.
Set CODECOV_TOKEN on this fork to make uploads work again.
…red root cause and fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
티켓:
rustjava-coverage-workflow-codecov-token-red· 발원: PR #11 게이트② 검수 §8 후속 2번근인 — ★추정이 아니라 실측으로 확정했다
coverage는 보고를 시작한 이래 한 번도 초록인 적이 없다.gh run list --workflow coverage.yml --limit 60failure24 /success0**Upload to codecov.io24 / 그 외 0**원인은 시크릿 부재 하나다:
★이 저장소는 fork 다(
isFork: true). fork 는 upstream 의 시크릿을 상속하지 않는다.그래서
token: ${{ secrets.CODECOV_TOKEN }}이 빈 문자열로 전개되고, 업로더 로그가 그대로 말한다:fail_ci_if_error: true가 이 업로드 실패를 job 실패로 승격시켜 왔다.★커버리지 측정 자체는 내내 성공하고 있었다 — 스텝별 결과:
Generate code coveragesuccess ·Upload to codecov.iofailure. 즉 red 가 가리킨 것은 코드가 아니라 발행 경로였다.처방 — ⒝
fail_ci_if_error: false⒜
CODECOV_TOKEN주입은 ★human-step 이다 — 시크릿이 존재하지 않고(위 실측), 발급·등재는 사람 몫이라이 회차에서 할 수 없다. 게다가 fork 용 토큰은 별도 codecov 프로젝트 등록이 선행돼야 한다.
⇒ ⒝를 택하고 ⒜는 사람 몫으로 남긴다(주석과 아래 «되돌리는 법»에 명시).
★무엇을 잃는가
잃는 것: codecov 업로드가 실패해도 CI 가 빨개지지 않는다. 토큰을 나중에 넣은 뒤 그것이 만료·오설정 되면
조용히 데이터가 안 쌓인다.
그 대가를 줄인 방법:
★red 를 «삼키지» 않는가 — 삼키지 않는다
Generate code coverage는 별도run:스텝이고fail_ci_if_error는 codecov-action 의 입력일 뿐이라 무관하다.grep -F continue-on-error .github/workflows/coverage.yml→ rc=1(부재) ⇒ 그 스텝이 실패하면 job 은 여전히 redGenerate code coverage가 전체 테스트를 돌렸다(145 passed; 0 failed등). 테스트가 깨지면cargo llvm-covrc≠0 → 스텝 실패 → job redrust.yml(rust_ci6잡)이고 이 PR 은 그 파일을 손대지 않았다 (git diff origin/main -- .github/workflows/rust.yml빈 출력)★효과 실증 — 「파일을 바꿨다」로 끝내지 않았다
이 브랜치 push 로 워크플로를 실제로 돌렸다:
31997321117(sha96ea9be) ·gh run watch --exit-status★rc=0 ·conclusion=success· 1m16sGenerate code coverage✓ ·Upload to codecov.io✓)⇒ ★★이 저장소 25번째 coverage run 이자 «최초의 green» 이다(앞선 24건 전부 red).
S2 특례 문구 판정
★불요해진다 —
coverage가 green 이므로ci-presence가 rc=1 을 내지 않고, S2~S7 게이트③ 브리프에「coverage red 는 선재이며 머지 차단 사유 아님」을 손으로 적을 이유가 사라진다.
경계
.rs/Cargo.*변경 0coverage.yml은 upstream 이 S2~S7 구간에서 건드리지 않는다(git log origin/main..upstream/main -- <파일>빈 출력) ⇒ 이 수정이 뒤 회차에 충돌을 만들지 않는다main무접촉 · force-push 0 · 머지 0 · upstream 발신 0 · 시크릿 값 출력 0(이름·존재·rc 만)