ci: Add Codecov coverage for cluster simulator groups - #5974
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📜 Recent review details⏰ Context from checks skipped due to timeout. (1)
📝 WalkthroughWalkthroughThe cluster simulator CI now uses Ubuntu 24 builds, enables gcov coverage, stages coverage artifacts, and conditionally uploads per-matrix reports to Codecov using OIDC. ChangesCluster simulator coverage
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to This PR adds coverage collection for the cluster simulator CI jobs without introducing an actionable merge-blocking risk; it is merge-ready after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Build as cluster-simulator-ci.bash
participant Stage as Staging payload
participant CI as CI matrix job
participant Codecov
Build->>Build: Run builds with WITHGCOV=1
Build->>Stage: Stage .gcno coverage artifacts
Stage->>CI: Provide coverage inputs
CI->>Codecov: Upload per-matrix .info report via OIDC
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/CI-cluster-simulator.yml:
- Line 21: Move id-token: write from the workflow-level permissions to the test
job’s permissions, leaving only contents: read at the top level so checkout
continues to work. Ensure the test job retains both contents: read and id-token:
write, while other jobs do not receive OIDC permission.
- Line 128: Update the Codecov action reference in the workflow step from the
mutable v4 tag to the verified 40-character commit SHA for the intended v4
release, preserving the trailing comment “# Codecov Action v4”.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 2066968e-b613-4de2-968a-fa41ff3c2a36
📒 Files selected for processing (2)
.github/workflows/CI-cluster-simulator.ymltest/infra/control/cluster-simulator-ci.bash
📜 Review details
⏰ Context from checks skipped due to timeout. (6)
- GitHub Check: CI-builds / builds (debian12,-dbg)
- GitHub Check: CI-builds / builds (ubuntu22,-tap-mysqlx)
- GitHub Check: CI-builds / builds (ubuntu22,-tap)
- GitHub Check: CI-builds / builds (ubuntu24,-tap-genai-gcov)
- GitHub Check: run / trigger
- GitHub Check: build
🧰 Additional context used
🪛 GitHub Check: SonarCloud Code Analysis
.github/workflows/CI-cluster-simulator.yml
[warning] 21-21: Move this write permission from workflow level to job level.
[failure] 128-128: Use full commit SHA hash for this dependency.
🪛 zizmor (1.28.0)
.github/workflows/CI-cluster-simulator.yml
[error] 21-21: overly broad permissions (excessive-permissions): id-token: write is overly broad at the workflow level
(excessive-permissions)
🔇 Additional comments (3)
test/infra/control/cluster-simulator-ci.bash (2)
207-210: LGTM!
262-268: LGTM!.github/workflows/CI-cluster-simulator.yml (1)
89-89: LGTM!
5fb969d to
c4f8599
Compare
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
- Build the shared simulator runtime with GCOV instrumentation - Cache the GCOV metadata required to generate coverage in the simulator test jobs - Upload simulator coverage under a shared Codecov flag Signed-off-by: Wazir Ahmed <wazir@proxysql.com>
c4f8599 to
a058387
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v3.0 #5974 +/- ##
==========================================
+ Coverage 49.83% 53.60% +3.77%
==========================================
Files 386 504 +118
Lines 121339 148005 +26666
Branches 31988 37488 +5500
==========================================
+ Hits 60472 79344 +18872
- Misses 47385 51120 +3735
- Partials 13482 17541 +4059
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Scope OIDC permissions to simulator test jobs and pin the Codecov action to the reviewed v4.6.0 commit. Signed-off-by: Wazir Ahmed <wazir@proxysql.com>
Signed-off-by: Wazir Ahmed <wazir@proxysql.com>
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
| install -d \ | ||
| "${STAGE_TEMP_DIR}/lib/obj" \ | ||
| "${STAGE_TEMP_DIR}/src/obj" | ||
| cp -a "${REPO_ROOT}"/lib/obj/*.gcno \ | ||
| "${STAGE_TEMP_DIR}/lib/obj/" | ||
| cp -a "${REPO_ROOT}"/src/obj/*.gcno \ | ||
| "${STAGE_TEMP_DIR}/src/obj/" |
There was a problem hiding this comment.
💡 Edge Case: Unguarded .gcno glob can hard-fail the whole build job
In handle_stage, cp -a "${REPO_ROOT}"/lib/obj/*.gcno ... and the src/obj equivalent run under set -euo pipefail without nullglob. If either directory contains no .gcno files (e.g. a build variant that doesn't instrument that tree, or WITHGCOV not taking effect), the glob stays literal, cp fails, and the entire staging step—and thus the ~90-minute build job with no cache saved—fails. Consider guarding the copy so missing coverage metadata degrades gracefully rather than aborting the build.
Use nullglob so empty matches are skipped instead of aborting under set -e.:
install -d \
"${STAGE_TEMP_DIR}/lib/obj" \
"${STAGE_TEMP_DIR}/src/obj"
shopt -s nullglob
for gcno in "${REPO_ROOT}"/lib/obj/*.gcno; do
cp -a "${gcno}" "${STAGE_TEMP_DIR}/lib/obj/"
done
for gcno in "${REPO_ROOT}"/src/obj/*.gcno; do
cp -a "${gcno}" "${STAGE_TEMP_DIR}/src/obj/"
done
shopt -u nullglob
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
CI failed: Build failure in the cluster simulator test suite due to missing coverage library linkage flags (-lgcov / --coverage) causing undefined gcov references.Overview1 log analyzed showing a build/linking failure during cluster simulator unit tests introduced in the Codecov CI integration changes. FailuresCluster Simulator Linker Error (confidence: high)
Summary
Code Review 👍 Approved with suggestions 0 resolved / 1 findingsAdds Codecov coverage reporting and GCOV instrumentation for cluster simulator test groups. Consider guarding the .gcno file globbing pattern in handle_stage to prevent hard failures if no matching files are found. 💡 Edge Case: Unguarded .gcno glob can hard-fail the whole build job📄 test/infra/control/cluster-simulator-ci.bash:264-270 In handle_stage, Use nullglob so empty matches are skipped instead of aborting under set -e.🤖 Prompt for agentsTip Comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|



Summary
simulation-testsCodecov flagContext
PR #5861 added CI execution for all registered
cluster_sim_*groups, buttheir coverage was not included in Codecov. This follow-up adds the missing
coverage upload.
Related PRs
Summary by CodeRabbit
Summary by CodeRabbit
Tests
Chores