Skip to content

Conversation

@ishymko
Copy link
Member

@ishymko ishymko commented Dec 15, 2025

Description

Post code coverage delta comment on PRs without third-party actions by running tests twice and comparing via a script.

Examples

Screenshot 2025-12-16 at 11 29 03 Screenshot 2025-12-16 at 11 31 06 Screenshot 2025-12-16 at 11 32 45

Fixes #192.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ishymko, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the project's continuous integration setup by modifying the Vitest configuration to output a 'json-summary' coverage report. This change is crucial for enabling automated comparison of code coverage metrics, which can help in tracking coverage trends and ensuring code quality over time.

Highlights

  • Coverage Reporting: The Vitest configuration has been updated to include 'json-summary' as a coverage reporter. This addition will generate a summary JSON file of coverage results.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/coverage-experiment.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ishymko ishymko force-pushed the ishymko/coverage-delta branch from bf31b7f to e7c83e9 Compare December 15, 2025 16:05
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds the json-summary coverage reporter to the Vitest configuration. This change is a standard and correct way to generate a coverage summary, which is often used in CI environments to compare code coverage. The change is straightforward and I have no issues to report.

@ishymko ishymko force-pushed the ishymko/coverage-delta branch from 310104f to bfee779 Compare December 15, 2025 16:13
@github-actions
Copy link

github-actions bot commented Dec 16, 2025

🧪 Code Coverage Delta

Metric Main PR Delta
lines 81.57% 81.57% ⚪️ 0.00%
statements 81.33% 81.33% ⚪️ 0.00%
functions 87.18% 87.18% ⚪️ 0.00%
branches 69.98% 69.98% ⚪️ 0.00%

Generated by unit-tests.yml

@a2aproject a2aproject deleted a comment from github-actions bot Dec 16, 2025
@ishymko ishymko changed the title ci: compare coverage ci: post code coverage delta comment on PRs Dec 16, 2025
@ishymko ishymko marked this pull request as ready for review December 16, 2025 10:34
@ishymko ishymko requested a review from a team as a code owner December 16, 2025 10:34
@ishymko ishymko merged commit 49b0616 into main Dec 16, 2025
19 of 20 checks passed
@ishymko ishymko deleted the ishymko/coverage-delta branch December 16, 2025 10:42
ishymko added a commit that referenced this pull request Dec 16, 2025
# Description

The job added in #262 [is failing on
main](https://github.com/a2aproject/a2a-js/actions/runs/20265128688/job/58186385412)
as it tries to post a PR comment although there is no PR 🤦 .

Fixed by:
1. Add conditions for PR related steps.
2. Bring back publishing coverage report as artifact removed mistakenly
in #262.
3. Add a link to this artifact to code coverage comment on PRs.
ishymko added a commit that referenced this pull request Dec 17, 2025
# Description

Original approach from #262 isn't going to work for PRs from forks, as
such actions can't have write access to the upstream repo by default and
granting this access is not secure.

Following the approach with a dedicated
[`workflow_run`](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#workflow_run)
triggered workflow which is executed in a secure context.

Reference:
https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/.

Tested in a fork: ishymko#2.

Re #192
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.

[Feat]: Integrate test coverage into CI

3 participants