Skip to content

Configure Codecov for Per-Directory Coverage Badges #1944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sarthak-19 opened this issue Mar 18, 2025 · 5 comments
Open

Configure Codecov for Per-Directory Coverage Badges #1944

sarthak-19 opened this issue Mar 18, 2025 · 5 comments
Assignees
Labels
Infrastructure Issues for the overall performance plugin infrastructure

Comments

@sarthak-19
Copy link
Contributor

sarthak-19 commented Mar 18, 2025

Summary

Related #1789 (comment)

We need to configure Codecov to display coverage badges for each plugin directory in our repository. This will allow us to track and display code coverage metrics on a per-directory basis, providing more granular insights into our codebase.

Details

Currently, our Codecov setup provides an overall coverage badge for the entire repository. We want to enhance this by showing individual coverage badges for each plugin directory.

Steps to Achieve This

  1. Update GitHub Actions Workflow: Modify the .github/workflows/php-test-plugins.yml file to include flags for each plugin when uploading coverage reports to Codecov.

  2. Configure Codecov YAML: Create or update the codecov.yml file to define the flags for each plugin directory.

Expected Outcome

  • Each plugin directory will have its own coverage badge.
  • The badges will be displayed in the README , providing clear visibility into the coverage status of each plugin.

Additional Information

cc : @westonruter

@sarthak-19
Copy link
Contributor Author

Work in progress for this issue 🙇🏻

@westonruter
Copy link
Member

@sarthak-19 thanks for opening this issue, but please connect with @ShyamGadde on it because he has some thoughts as well: #1935 (comment)

@sarthak-19
Copy link
Contributor Author

sarthak-19 commented Mar 18, 2025

@ShyamGadde I went through your detailed comparison here : #1838 (comment)

And while the suggested approach seems to be going with Option 2 #1838 (comment), I see you've already implemented this.

So are you planning to change that approach in your PR or can I work on this specific issue? If yes, should I branch out from trunk code only?
Was thinking that later we might have merge conflicts if your PR gets merged, then you'll probably be best person to approach in that case.
Would love to hear your thoughts on this. 🙇🏻

@ShyamGadde
Copy link
Contributor

ShyamGadde commented Mar 19, 2025

@sarthak-19 I believe integrating the per-plugin flags would be most effective within PR #1838 itself for several reasons:

  1. PR Run unit tests only for plugins with changes #1838 is already modifying how we handle test reporting for individual plugins
  2. The carryforward flag functionality (which we'll need) would require these per-plugin flags as a prerequisite
  3. Simply defining flags in codecov.yml isn't sufficient - we need to modify how we upload reports with those flags for them to appear in the Codecov dashboard

Since PR #1838 is already changing the report upload process, it makes sense to incorporate this work there to avoid duplication of effort and potential merge conflicts later. Once that PR is merged, adding the coverage badges for individual plugins should be relatively straightforward.

You can take a look at how this was done in this commit 93dbf21. One thing I'm currently addressing is ensuring forks will work with tokenless uploads, similar to how the GitHub Action handles it.

I'd be happy to discuss this approach further if you have any questions or alternative ideas!

@swissspidy swissspidy added the Infrastructure Issues for the overall performance plugin infrastructure label Mar 25, 2025
@sarthak-19
Copy link
Contributor Author

Hi @ShyamGadde thanks for pointing this out.

Since PR #1838 is already changing the report upload process, it makes sense to incorporate this work there to avoid duplication of effort and potential merge conflicts later.

Indeed this makes sense, once the work in completed and PR is merged we can use this issue or create new one for adding the coverage badges for individual plugins. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Infrastructure Issues for the overall performance plugin infrastructure
Projects
Status: Not Started/Backlog 📆
Development

No branches or pull requests

4 participants