ci: add codecov configuration#2069
Conversation
Adds Codecov coverage configuration with: - Project target: auto (threshold: 1%) - Patch target: 80% (threshold: 5%) - Ignores non-code files (docs, hack, experiments, images, markdown, shell) Signed-off-by: Eyal Edri <eedri@redhat.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace stale __data__ ignore pattern (from konflux-ui) with testdata - Add coverage profile generation and Codecov upload step to CI - PR title fixed to use conventional commit prefix Assisted-by: Claude claude-opus-4-6 <noreply@anthropic.com> Signed-off-by: Ralph Bean <rbean@redhat.com>
Site previewPreview: https://61dae297-site.fullsend-ai.workers.dev Commit: |
|
🤖 Review · Started 11:58 AM UTC |
Use env block instead of inline VAR= assignment to avoid SC1007. Assisted-by: Claude claude-opus-4-6 <noreply@anthropic.com> Signed-off-by: Ralph Bean <rbean@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 12:02 PM UTC · Completed 12:10 PM UTC |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
ReviewFindingsHigh
Low
Previous runReviewFindingsHigh
Medium
Low
|
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@v5 | ||
| with: |
There was a problem hiding this comment.
[low] supply-chain
The codecov/codecov-action is referenced by mutable major-version tag (@v5) rather than a full commit SHA. Follows existing repo convention but SHA pinning is best practice. Risk mitigated by read-only permissions.
Suggested fix: Pin the action to a specific commit SHA and use Dependabot or Renovate to keep the pin up to date.
|
|
||
| - name: Generate coverage profile | ||
| run: go test -race -coverprofile=coverage.out ./... | ||
| env: |
There was a problem hiding this comment.
[low] redundant-execution
Go tests are executed twice in the same job: first via make test (go test -race -cover) then again via go test -race -coverprofile=coverage.out. This doubles Go test execution time.
Suggested fix: Modify the Makefile go-test target to accept a COVERPROFILE variable, or remove the make test step since the coverage step runs the same tests.
rh-hemartin
left a comment
There was a problem hiding this comment.
Fix the redundant execution of tests.
|
just making sure you're OK with failing CI if patch coverage is below 80%, we can also set it to false to give a warning as well to start with. |
Replace `make test` (which runs lint-all + go-test + script-test) with its individual components, using the coverprofile-producing `go test` invocation in place of `make go-test`. This avoids running Go tests twice in the same CI job. Assisted-by: Claude claude-opus-4-6 <noreply@anthropic.com> Signed-off-by: Ralph Bean <rbean@redhat.com>
|
Pushed a30c112. Splits |
|
🤖 Finished Review · ✅ Success · Started 9:16 PM UTC · Completed 9:24 PM UTC |
|
|
||
| - run: make script-test | ||
|
|
||
| - name: Upload coverage to Codecov |
There was a problem hiding this comment.
[low] supply-chain
The codecov/codecov-action is referenced by mutable major-version tag (@v5) rather than a full commit SHA. This follows the existing convention in the workflow, but SHA pinning is best practice. Risk is mitigated by read-only permissions.
|
🤖 Finished Retro · ✅ Success · Started 12:13 PM UTC · Completed 12:18 PM UTC |
Retro: PR #2069 —
|
Summary
.codecov.ymlwith standard coverage settingsauto(threshold:1%)80%(threshold:5%)Supersedes #2064 (rebased from fork to upstream with fixes applied).
Original PR by @eedri.
🤖 Generated with Claude Code