Repository navigation
Add Helm template coverage CI and Codecov upload - #698
NiallTwomey2 wants to merge 9 commits into
Conversation
Vendor helm-coverage.sh and run it on the three active charts so template branch coverage can be tracked in Codecov without changing ct install. RHIDP-18349
PR Summary by QodoTrack Helm template coverage in CI and Codecov
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
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. Thanks for integrating Codecov - We've got you covered ☂️ |
|
Important The |
|
/agentic_review |
| @@ -0,0 +1,8 @@ | |||
| coverage: | |||
There was a problem hiding this comment.
Setting codecov.coverage.status.project and codecov.coverage.status.patch informational to true
to pass the GitHub checks
| Chart | Covered / total branches | Rate |
|---|---|---|
| rhdh | 71 / 258 | 27.5% |
| must-gather | 47 / 77 | 61.0% |
| orchestrator-infra | 16 / 19 | 84.2% |
| combined | 134 / 354 | 37.9% |
If informational is set to false, which is Codecov's default setting, codecov/project and codecov/patch are failing GitHub checks when project coverage is under target, or patch coverage on changed template lines are under Codecov's patch target, ~70%
There was a problem hiding this comment.
This comment is much more useful as context for reviewers ;)
|
|
||
| # Temporary patch file from sync-upstream-backstage.sh conflict resolution | ||
| rhdh-vendored.patch | ||
| coverage-out/ |
There was a problem hiding this comment.
Ignores coverage-out/ so local XML files never get committed
There was a problem hiding this comment.
same point, obvious by reading the code. So no need to add a comment for this ;)
| curl -fsSL --proto '=https' --tlsv1.2 -o /tmp/helm-coverage.sh \ | ||
| "https://raw.githubusercontent.com/jCOTINEAU/chart-coverage/${CHART_COVERAGE_SHA}/helm-coverage.sh" |
There was a problem hiding this comment.
Fetch the coverage tool at a pinned SHA (HTTPS-only) - using the curl command
There was a problem hiding this comment.
no need to add a comment like this, which is already obvious by reading the code ;)
This comment doesn't add much context to the PR and actually does bloat the review UI.
|
| -e "s|filename=\"templates/|filename=\"${chart_dir}/templates/|g" \ | ||
| -e "s|<source>templates</source>|<source>${chart_dir}</source>|" \ |
There was a problem hiding this comment.
| -e "s|filename=\"templates/|filename=\"${chart_dir}/templates/|g" \ | |
| -e "s|<source>templates</source>|<source>${chart_dir}</source>|" \ | |
| -e "s|<source>templates</source>|<source>${chart_dir}</source>|" \ |
Why is this transformation needed?
From a quick testing, filename already contains the right path starting from templates/. So it should be fine as is relative to ${chart_dir}, which should be the <source>.
| -e "s|filename=\"templates/|filename=\"${chart_dir}/templates/|g" \ | ||
| -e "s|<source>templates</source>|<source>${chart_dir}</source>|" \ |
There was a problem hiding this comment.
| -e "s|filename=\"templates/|filename=\"${chart_dir}/templates/|g" \ | |
| -e "s|<source>templates</source>|<source>${chart_dir}</source>|" \ | |
| -e "s|<source>templates</source>|<source>${chart_dir}</source>|" \ |
| extra_helm_args: ${{ matrix.chart == 'rhdh' && format('--set image.repository={0} --set image.tag={1} --set image.pullPolicy=Always', steps.image.outputs.repo, steps.image.outputs.tag) || matrix.chart == 'backstage' && format('--set upstream.backstage.image.repository={0} --set upstream.backstage.image.tag={1} --set upstream.backstage.image.pullPolicy=Always', steps.image.outputs.repo, steps.image.outputs.tag) || '' }} | ||
| # helm_extra_args: general helm flags (e.g. --values), passed to ct install via --helm-extra-args | ||
| helm_extra_args: ${{ matrix.chart == 'rhdh' && '--values /tmp/rhdh-nightly-values.yaml' || matrix.chart == 'backstage' && '--values /tmp/backstage-nightly-values.yaml' || '' }} | ||
| coverage: |
There was a problem hiding this comment.
| coverage: | |
| coverage: |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| ref: ${{ matrix.branch }} | ||
| fetch-depth: 0 |
There was a problem hiding this comment.
| fetch-depth: 0 |
Full history not needed.
| with: | ||
| fetch-depth: 0 |
There was a problem hiding this comment.
| with: | |
| fetch-depth: 0 |
| curl -fsSL --proto '=https' --tlsv1.2 -o /tmp/helm-coverage.sh \ | ||
| "https://raw.githubusercontent.com/jCOTINEAU/chart-coverage/${CHART_COVERAGE_SHA}/helm-coverage.sh" |
There was a problem hiding this comment.
no need to add a comment like this, which is already obvious by reading the code ;)
This comment doesn't add much context to the PR and actually does bloat the review UI.
| fi | ||
| echo "All chart tests passed (or no charts to test)." | ||
| No newline at end of file |
|
|
||
| # Temporary patch file from sync-upstream-backstage.sh conflict resolution | ||
| rhdh-vendored.patch | ||
| coverage-out/ |
There was a problem hiding this comment.
same point, obvious by reading the code. So no need to add a comment for this ;)
| @@ -0,0 +1,8 @@ | |||
| coverage: | |||
There was a problem hiding this comment.
This comment is much more useful as context for reviewers ;)
| monitoring_heartbeat: ${{ vars.TEST_MONITORING_HEARTBEAT_ENABLED || 'false' }} | ||
| helm_template_values_file: ${{ matrix.chart == 'rhdh' && '/tmp/rhdh-full-plugins-values.yaml' || '' }} | ||
|
|
||
| coverage: |
There was a problem hiding this comment.
This coverage job looks quite similar in both workflows. I would suggest extracting this into a composite action under .github/actions/chart-coverage/action.yml that both workflows call.



Summary
Test plan
Issue: RHIDP-18349