Skip to content
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

[CI, Enhancement] Add Codecov support #2222

Merged
merged 13 commits into from
Dec 12, 2024

Conversation

icfaust
Copy link
Contributor

@icfaust icfaust commented Dec 11, 2024

Description

Codecov is a code coverage analysis service which can integrate with the coverage.py result files that are generated by GitHub actions CI. A separate upload github action is created which is triggered by the successful completion of the pull request / push CI. This is separated as a 'workflow_run' event because it needs to access secrets to communicate with codecov and because pull requests run untested code (vulnerability surface in GitHub). The workflow_run uses the main branch, so certain settings of codecov-cli need to be manually supplied about the PR for codecov to properly integrate (the PR number, the commit SHA).

As of now, the default codecov settings are used, so that no CI failures can be generated by codecov. Thus functionality cannot be tested as it is 'workflow_run'. An example run using my fork will be presented to show operation using the code of this PR. Once it is brought into main, comments will be made by codecov, and it will be added to github checks to show the delta in code coverage as well as the overall percent. Accessing codecov will provide a GUI for seeing the changes in the code.

A follow up PR integrating codecov into azure pipelines will be necessary. This is because of the slow iteration cycle of the azure pipelines CI (as I will only be able to test via PRs, not on my own fork).


PR should start as a draft, then move to ready for review state after CI is passed and all applicable checkboxes are closed.
This approach ensures that reviewers don't spend extra time asking for regular requirements.

You can remove a checkbox as not applicable only if it doesn't relate to this PR in any way.
For example, PR with docs update doesn't require checkboxes for performance while PR with any change in actual code should have checkboxes and justify how this code change is expected to affect performance (or justification should be self-evident).

Checklist to comply with before moving PR from draft:

PR completeness and readability

  • I have reviewed my changes thoroughly before submitting this pull request.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes or created a separate PR with update and provided its number in the description, if necessary.
  • Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
  • I have added a respective label(s) to PR if I have a permission for that.
  • I have resolved any merge conflicts that might occur with the base branch.

Testing

  • I have run it locally and tested the changes extensively.
  • All CI jobs are green or I have provided justification why they aren't.
  • I have extended testing suite if new functionality was introduced in this PR.

@icfaust
Copy link
Contributor Author

icfaust commented Dec 11, 2024

Oops, this won't work because of the secret. Will need to come up with another approach (and especially with the ability to test it)

@icfaust
Copy link
Contributor Author

icfaust commented Dec 11, 2024

I'm going to have to separate it and put it in a workflow_run, may require local testing on my own fork (I hate having to do this again)

@icfaust icfaust marked this pull request as ready for review December 12, 2024 11:09
@icfaust
Copy link
Contributor Author

icfaust commented Dec 12, 2024

example PR with it functional: icfaust#7

@icfaust icfaust merged commit 7743060 into uxlfoundation:main Dec 12, 2024
12 of 27 checks passed
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