Repository navigation
fix: skip coverage grade comment when grade unavailable - #14299
Open
PrashantBhanage wants to merge 1 commit into
Open
PrashantBhanage wants to merge 1 commit into
PrashantBhanage wants to merge 1 commit into
Conversation
2 tasks done
Damans227
reviewed
Oct 14, 2026
| const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; | ||
| const marker = '<!-- coverage-grade-bot -->'; | ||
|
|
||
| if (!grade || grade === 'N/A') { |
Collaborator
There was a problem hiding this comment.
when does the grade come through empty here? the script exits before writing it when the report is missing, so this step doesnt run then
Damans227
reviewed
Oct 14, 2026
| const marker = '<!-- coverage-grade-bot -->'; | ||
|
|
||
| if (!grade || grade === 'N/A') { | ||
| console.log('Coverage grade not available, skipping comment'); |
Collaborator
There was a problem hiding this comment.
does this fix the 403 from #13490? on a fork PR the grade is there, so posting the comment still fails with the read-only token
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes the Sonar coverage grade comment workflow when coverage grade data is unavailable.
The workflow now:
N/Awhen branch coverage is not available.This change was separated from #13490 as requested by @DaanHoogland.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
N/A
How Has This Been Tested?
Verified the workflow diff against
apache:mainand confirmed that only the intended Sonar coverage handling changes are included.git diff --checkpasses with no whitespace errors.No application code or unit tests were changed.
How did you try to break this feature and the system with this change?
The workflow now handles the case where the coverage grade is unavailable and exits before attempting to create a PR comment, preventing the workflow from trying to post an invalid coverage result.