You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "Pearl1594 (via GitHub)" <gi...@apache.org> on 2026/05/08 14:34:35 UTC
[PR] [WIP] Add code coverage grading workflow [cloudstack]
Pearl1594 opened a new pull request, #13140:
URL: https://github.com/apache/cloudstack/pull/13140
### Description
This PR adds a github workflow to add grades to the code coverage. An attempt to encourage increasing overall test coverage of the project.
<!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
<!-- For new features, provide link to FS, dev ML discussion etc. -->
<!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
<!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
<!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
<!-- Fixes: # -->
<!--- ******************************************************************************* -->
<!--- NOTE: AUTOMATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
<!--- PLEASE PUT AN 'X' in only **ONE** box -->
<!--- ******************************************************************************* -->
### Types of changes
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Enhancement (improves an existing feature and functionality)
- [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
- [ ] Build/CI
- [ ] Test (unit or integration test code)
### Feature/Enhancement Scale or Bug Severity
#### Feature/Enhancement Scale
- [ ] Major
- [ ] Minor
#### Bug Severity
- [ ] BLOCKER
- [ ] Critical
- [ ] Major
- [ ] Minor
- [ ] Trivial
### Screenshots (if appropriate):
### How Has This Been Tested?
<!-- Please describe in detail how you tested your changes. -->
<!-- Include details of your testing environment, and the tests you ran to -->
#### How did you try to break this feature and the system with this change?
<!-- see how your change affects other areas of the code, etc. -->
<!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add code coverage grading workflow [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland merged PR #13140:
URL: https://github.com/apache/cloudstack/pull/13140
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add code coverage grading workflow [cloudstack]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #13140:
URL: https://github.com/apache/cloudstack/pull/13140#issuecomment-4408161192
## [](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=13140) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=13140&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=13140&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=13140&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=13140&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=13140&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=13140)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add code coverage grading workflow [cloudstack]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13140:
URL: https://github.com/apache/cloudstack/pull/13140#issuecomment-4407665175
## π΄ Test Coverage Grade: `D` β Marginal
| Metric | Value |
|--------|-------|
| Line coverage | **22.71%** |
| Branch coverage | **17.13%** |
### Grade Scale
| Grade | Line Coverage | Meaning |
|-------|--------------|---------|
| π’ A | β₯ 80% | Excellent |
| π‘ B | 60β79% | Good |
| π C | 40β59% | Acceptable |
| π΄ D | 20β39% | Marginal β meets minimum gate |
| β F | < 20% | Failing β below minimum gate |
> Branch coverage is shown as a secondary signal. Grade is determined by **line coverage**.
> [View full Actions run](https://github.com/apache/cloudstack/actions/runs/25561460107)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add code coverage grading workflow [cloudstack]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #13140:
URL: https://github.com/apache/cloudstack/pull/13140#issuecomment-4407327167
## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/13140?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 3.51%. Comparing base ([`72b99a3`](https://app.codecov.io/gh/apache/cloudstack/commit/72b99a3f8ce2265d51dd42526afaf1b399f378f3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`beb0879`](https://app.codecov.io/gh/apache/cloudstack/commit/beb0879c0f3bddb06b8bdaf3c9b9ba75ca0321c9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
> :exclamation: There is a different number of reports uploaded between BASE (72b99a3) and HEAD (beb0879). Click for more details.
>
> <details><summary>HEAD has 1 upload less than BASE</summary>
>
>| Flag | BASE (72b99a3) | HEAD (beb0879) |
>|------|------|------|
>|unittests|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #13140 +/- ##
=============================================
- Coverage 18.08% 3.51% -14.58%
=============================================
Files 6037 464 -5573
Lines 542546 40154 -502392
Branches 66432 7559 -58873
=============================================
- Hits 98146 1413 -96733
+ Misses 433378 38551 -394827
+ Partials 11022 190 -10832
```
| [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/13140/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Ξ | |
|---|---|---|
| [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/13140/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `3.51% <ΓΈ> (ΓΈ)` | |
| [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/13140/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/13140?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add code coverage grading workflow [cloudstack]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #13140:
URL: https://github.com/apache/cloudstack/pull/13140#discussion_r3234719580
##########
.github/workflows/codecov.yml:
##########
@@ -21,14 +21,15 @@ on: [pull_request, push]
permissions:
contents: read
+ pull-requests: write # required to post/update the grade comment on PRs
Review Comment:
The workflow posts a PR comment via `github.rest.issues.createComment(...)`, which requires `issues: write` permission. With only `pull-requests: write` set, this step is likely to fail with a 403 on the default `GITHUB_TOKEN`. Add `issues: write` (and consider dropping `pull-requests: write` if you only create an issue comment) to follow least-privilege and avoid runtime failures.
This issue also appears in the following locations of the same file:
- line 23
- line 86
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add code coverage grading workflow [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #13140:
URL: https://github.com/apache/cloudstack/pull/13140#issuecomment-4546704162
@Pearl1594 can you address the conflicts.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add code coverage grading workflow [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on code in PR #13140:
URL: https://github.com/apache/cloudstack/pull/13140#discussion_r3271879841
##########
.github/workflows/codecov.yml:
##########
@@ -21,14 +21,15 @@ on: [pull_request, push]
permissions:
contents: read
+ pull-requests: write # required to post/update the grade comment on PRs
Review Comment:
@Pearl1594 , can you consider this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add code coverage grading workflow [cloudstack]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #13140:
URL: https://github.com/apache/cloudstack/pull/13140#issuecomment-4606579038
## [](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=13140) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=13140&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=13140&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=13140&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=13140&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=13140&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=13140)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add code coverage grading workflow [cloudstack]
Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #13140:
URL: https://github.com/apache/cloudstack/pull/13140#issuecomment-4407683591
## [](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=13140) **Quality Gate passed**
Issues
 [0 New issues](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=13140&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_cloudstack&pullRequest=13140&issueStatuses=ACCEPTED)
Measures
 [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_cloudstack&pullRequest=13140&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)
 [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=13140&metric=new_coverage&view=list)
 [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_cloudstack&pullRequest=13140&metric=new_duplicated_lines_density&view=list)
<!-- sqra-placement-anchor -->
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_cloudstack&pullRequest=13140)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add code coverage grading workflow [cloudstack]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13140:
URL: https://github.com/apache/cloudstack/pull/13140#issuecomment-4408073494
## π΄ Test Coverage Grade: `D` β Marginal
| Metric | Value |
|--------|-------|
| Line coverage | **22.70%** |
| Branch coverage | **17.14%** |
### Grade Scale
| Grade | Line Coverage | Meaning |
|-------|--------------|---------|
| π’ A | β₯ 80% | Excellent - this code sleeps well at night π΄ |
| π‘ B | 60-79% | Good - almost there, don't stop now π |
| π C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags π¬ |
| π΄ D | 20-39% | Marginal - boldly shipping where no test has gone before π |
| β F | < 20% | Failing - tests? what tests? π₯ |
> Branch coverage is shown as a secondary signal. Grade is determined by **line coverage**.
> [View full Actions run](https://github.com/apache/cloudstack/actions/runs/25565096854)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add code coverage grading workflow [cloudstack]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13140:
URL: https://github.com/apache/cloudstack/pull/13140#issuecomment-4606581868
## π΄ Test Coverage Grade: `D` β Marginal
| Metric | Value |
|--------|-------|
| Line coverage | **22.73%** |
| Branch coverage | **17.16%** |
### Grade Scale
| Grade | Line Coverage | Meaning |
|-------|--------------|---------|
| π’ A | β₯ 80% | Excellent - this code sleeps well at night π΄ |
| π‘ B | 60-79% | Good - almost there, don't stop now π |
| π C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags π¬ |
| π΄ D | 20-39% | Marginal - boldly shipping where no test has gone before π |
| β F | < 20% | Failing - tests? what tests? π₯ |
> Branch coverage is shown as a secondary signal. Grade is determined by **line coverage**.
> [View full Actions run](https://github.com/apache/cloudstack/actions/runs/26840951459)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add code coverage grading workflow [cloudstack]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13140:
URL: https://github.com/apache/cloudstack/pull/13140#issuecomment-4544685312
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add code coverage grading workflow [cloudstack]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #13140:
URL: https://github.com/apache/cloudstack/pull/13140#discussion_r3409961437
##########
.github/workflows/sonar-check.yml:
##########
@@ -65,3 +65,51 @@ jobs:
verbose: true
name: codecov
token: ${{ secrets.CODECOV_TOKEN }}
+ - name: Compute Coverage Grade
+ id: grade
+ run: bash scripts/coverage-grade.sh client/target/site/jacoco-aggregate/jacoco.xml
+ - name: Post Coverage Grade Comment on PR
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ const grade = '${{ steps.grade.outputs.coverage_grade }}';
+ const label = '${{ steps.grade.outputs.coverage_grade_label }}';
+ const linePct = '${{ steps.grade.outputs.line_coverage }}';
+ const branchPct = '${{ steps.grade.outputs.branch_coverage }}';
+ const emojiMap = { A: 'π’', B: 'π‘', C: 'π ', D: 'π΄', F: 'β' };
+ const emoji = emojiMap[grade] ?? 'β';
+ const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
+
+ const branchRow = branchPct !== 'N/A'
+ ? `| Branch coverage | **${branchPct}%** |`
+ : '';
+
+ const body = [
+ `## ${emoji} Test Coverage Grade: \`${grade}\` β ${label}`,
+ '',
+ '| Metric | Value |',
+ '|--------|-------|',
+ `| Line coverage | **${linePct}%** |`,
+ branchRow,
+ '',
+ '### Grade Scale',
+ '| Grade | Line Coverage | Meaning |',
+ '|-------|--------------|---------|',
+ '| π’ A | β₯ 80% | Excellent - this code sleeps well at night π΄ |',
+ '| π‘ B | 60-79% | Good - almost there, don\'t stop now π |',
+ '| π C | 40-59% | Acceptable - your code is wearing a seatbelt, but no airbags π¬ |',
+ '| π΄ D | 20-39% | Marginal - boldly shipping where no test has gone before π |',
+ '| β F | < 20% | Failing - tests? what tests? π₯ |',
+ '',
+ '> Branch coverage is shown as a secondary signal. Grade is determined by **line coverage**.',
+ `> [View full Actions run](${runUrl})`,
+ ].filter(l => l !== undefined).join('\n');
+
+ await github.rest.issues.createComment({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: context.issue.number,
+ body: body,
+ });
Review Comment:
This step calls `github.rest.issues.createComment(...)`. With the workflow permissions currently set to `pull-requests: write` (and no `issues: write`), the default `GITHUB_TOKEN` will typically get a 403 when creating issue comments. Add `issues: write` to the workflow `permissions:` block (and consider whether `pull-requests: write` is still needed).
##########
scripts/coverage-grade.sh:
##########
@@ -0,0 +1,174 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# coverage-grade.sh
+#
+# Parses the JaCoCo aggregate XML report and outputs an AβF coverage grade.
+#
+# Usage:
+# ./scripts/coverage-grade.sh [path/to/jacoco.xml]
+#
+# Exit codes:
+# 0 β grade is D or above (line coverage >= 20%)
+# 1 β grade is F (line coverage < 20%)
+#
Review Comment:
The exit-code documentation doesn't match the script behavior: the script also exits with code 2 (missing report / missing counters), but only 0 and 1 are documented. This can confuse CI consumers and local users interpreting failures.
##########
.github/workflows/sonar-check.yml:
##########
@@ -65,3 +65,51 @@ jobs:
verbose: true
name: codecov
token: ${{ secrets.CODECOV_TOKEN }}
+ - name: Compute Coverage Grade
+ id: grade
+ run: bash scripts/coverage-grade.sh client/target/site/jacoco-aggregate/jacoco.xml
+ - name: Post Coverage Grade Comment on PR
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ const grade = '${{ steps.grade.outputs.coverage_grade }}';
+ const label = '${{ steps.grade.outputs.coverage_grade_label }}';
+ const linePct = '${{ steps.grade.outputs.line_coverage }}';
+ const branchPct = '${{ steps.grade.outputs.branch_coverage }}';
+ const emojiMap = { A: 'π’', B: 'π‘', C: 'π ', D: 'π΄', F: 'β' };
+ const emoji = emojiMap[grade] ?? 'β';
+ const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
+
+ const branchRow = branchPct !== 'N/A'
+ ? `| Branch coverage | **${branchPct}%** |`
+ : '';
Review Comment:
When branch coverage is not available, `branchRow` is set to an empty string. Since the body array only filters out `undefined`, this leaves a blank line inside the markdown table (ending the table early). Prefer using `undefined` and keep the existing filter.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add code coverage grading workflow [cloudstack]
Posted by "DaanHoogland (via GitHub)" <gi...@apache.org>.
DaanHoogland commented on PR #13140:
URL: https://github.com/apache/cloudstack/pull/13140#issuecomment-4728514521
@Pearl1594 , shall we happily ignore co-pilot and merge?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add code coverage grading workflow [cloudstack]
Posted by "Pearl1594 (via GitHub)" <gi...@apache.org>.
Pearl1594 commented on PR #13140:
URL: https://github.com/apache/cloudstack/pull/13140#issuecomment-4730917943
I dont think these comments are that high priority, so we could ignore..
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org