Skip to content

ci: check-coverage action pr commenting feature#2

Merged
benceharomi merged 2 commits intomainfrom
bence/sol-153-improve-code-coverage-checker-ci-job
Jun 30, 2025
Merged

ci: check-coverage action pr commenting feature#2
benceharomi merged 2 commits intomainfrom
bence/sol-153-improve-code-coverage-checker-ci-job

Conversation

@benceharomi
Copy link
Copy Markdown
Member

@benceharomi benceharomi commented Jun 26, 2025

Description

Added PR commenting functionality to the check-coverage GitHub action (post a comment with the result of the code coverage check to an opened PR).

Functional requirements

  • The GitHub action is capable of adding a comment with the result of coverage check (percentage, percentage threshold, #lines covered)
  • The GitHub action is capable of updating the previous comment it posted (to not spam the PR with comments after each change)

Testing requirements

Test passing coverage checks (these are tested in PR #3):

  • coverage check passes -> action successful -> result commented
  • success comment updated with fail comment
  • success comment updated with success comment (with different %)

Test failing coverage checks (these are tested in PR #4):

  • coverage check fails -> action unsuccessful -> result commented
  • fail comment updated with success comment
  • fail comment updated with fail comment (with different %)

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 26, 2025

📊 Coverage Report

Metric Coverage Required Status
Lines 100.00% 90% ✅ Above threshold

Details: 4 of 4 lines covered.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the check-coverage GitHub action by adding functionality to post and update PR comments with the code coverage results. Key changes include:

  • Adding branch filtering for push events and providing a github-token in the workflow.
  • Updating the composite action to include robust file checks, validations, and PR comment update/creation logic.
  • Enhancing logging and error messages for improved clarity in the coverage process.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/ci.yaml Added branch filter for push events and passed the github-token to the action.
.github/actions/check-coverage/action.yaml Extended the coverage check action with PR commenting capabilities and improved error handling.
Comments suppressed due to low confidence (1)

.github/actions/check-coverage/action.yaml:30

  • [nitpick] Consider gating or consolidating debug log output with a verbosity flag to prevent excessive logging in production runs.
        echo "🔍 Debug: Processing coverage file \"${{ inputs.lcov_file }}\""

Copy link
Copy Markdown

@zkfriendly zkfriendly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Looks good!

@benceharomi benceharomi changed the title ci: improved check-coverage action ci: check-coverage action pr commenting feature Jun 30, 2025
@benceharomi benceharomi merged commit 6d92632 into main Jun 30, 2025
5 checks passed
@benceharomi benceharomi deleted the bence/sol-153-improve-code-coverage-checker-ci-job branch June 30, 2025 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants