Skip to content

Fix code-coverage action - #1221

Merged
gaiksaya merged 1 commit into
opensearch-project:mainfrom
gaiksaya:fix-codeCoverage
Sep 14, 2026
Merged

gaiksaya merged 1 commit into
opensearch-project:mainfrom
gaiksaya:fix-codeCoverage

Conversation

@gaiksaya

Copy link
Copy Markdown
Member

Description

Fix code-coverage action

Issues Resolved

opensearch-project/opensearch-build#6461

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
@gaiksaya gaiksaya added the skip-diff-analyzer Maintainer to skip code-diff-analyzer check, after reviewing issues in AI analysis. label Sep 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ Recommended focus areas for review

Matrix condition may never match

The upload step is gated by matrix.java == 21, but the matrix Java versions are not visible in the diff. If the matrix does not include Java 21 (e.g., only 11/17), the coverage artifact will never be produced, the download step will fail (silently due to continue-on-error), and Codecov upload will be skipped every run. Verify the matrix actually contains 21.

if: ${{ !cancelled() && matrix.java == 21 }}
Single artifact across matrix

upload-artifact@v4 requires unique artifact names per job. If more than one matrix job produces jacoco-coverage-report (e.g., multiple OS or java versions matching the condition), the second upload will fail. If only java==21 ever matches this is fine, but consider including matrix values in the artifact name to be safe.

name: jacoco-coverage-report

@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Point Codecov to the exact report file

The coverage report is uploaded from build/reports/jacoco/test/jacocoTestReport.xml
but Codecov is pointed at the coverage directory. Since the artifact only contains a
single XML file, use files: to point directly at coverage/jacocoTestReport.xml so
Codecov reliably discovers the report.

.github/workflows/reports-scheduler-test-and-build-workflow.yml [90-96]

 - name: Upload coverage
   uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
   if: steps.download-coverage.outcome == 'success'
   with:
     flags: reports-scheduler
-    directory: coverage
+    files: coverage/jacocoTestReport.xml
     token: ${{ secrets.CODECOV_TOKEN }}
Suggestion importance[1-10]: 5

__

Why: Using files: with the explicit path to jacocoTestReport.xml is more reliable than pointing at a directory, though Codecov typically auto-discovers XML reports in the specified directory as well. The improvement is minor but valid.

Low

@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.10%. Comparing base (f250deb) to head (de13b7c).
⚠️ Report is 138 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1221      +/-   ##
============================================
- Coverage     76.85%   73.10%   -3.76%     
- Complexity        0      406     +406     
============================================
  Files            30       68      +38     
  Lines          1923     2220     +297     
  Branches        412      236     -176     
============================================
+ Hits           1478     1623     +145     
- Misses          442      463      +21     
- Partials          3      134     +131     
Flag Coverage Δ
dashboards-reports ?
reports-scheduler 73.10% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gaiksaya
gaiksaya merged commit b764852 into opensearch-project:main Sep 14, 2026
20 of 21 checks passed
@gaiksaya
gaiksaya deleted the fix-codeCoverage branch September 14, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-diff-analyzer Maintainer to skip code-diff-analyzer check, after reviewing issues in AI analysis.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants