ci: fix coverage parser format and resolve fork permission errors - #146
SIDDHANTCOOKIE wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe pull request updates both coverage workflows to display fully covered modules. It restricts coverage comments to same-repository pull requests. It also ignores local MiniChain directories and generated coverage artifacts. ChangesCoverage workflow and repository hygiene
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Suggested labels: Merge Risk: ⚪ Minimal · up to Coverage reporting and fork pull-request handling are updated without introducing a merge-blocking behavior change. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. A rabbit checks the coverage lines, Comment |
Addressed Issues:
This PR fixes two separate issues occurring in our GitHub Actions CI pipeline regarding test coverage reporting:
Fixes "bad format or wrong data" parsing error: The MishaKav/pytest-coverage-comment action was failing to parse the coverage output. This was caused by the :skip-covered flag in the pytest command, which appended a sentence at the bottom of the table (e.g., "7 files skipped due to complete coverage") that broke the action's table parser. This flag has been removed from both pr-checks.yml and update-badge.yml.
Fixes "Permission denied" on fork PRs: When a contributor opens a PR from a fork, GitHub downgrades the GITHUB_TOKEN to read-only for security purposes. This was causing the workflow to crash entirely when the coverage action attempted to write a comment back to the PR.
Security Note: Rather than dangerously escalating permissions via pull_request_target (which introduces remote code execution risks from untrusted forks), we have added an if condition to gracefully skip the commenting step if the PR originates from a fork. Tests will still run and pass, but it simply won't attempt to post the comment.
Screenshots/Recordings:
TODO: If applicable, add screenshots or recordings that demonstrate the interface before and after the changes.
Additional Notes:
AI Usage Disclosure:
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.
Check one of the checkboxes below:
I have used the following AI models and tools: TODO
Checklist
Summary by CodeRabbit