Skip to content

ci: fix coverage parser format and resolve fork permission errors - #146

Open
SIDDHANTCOOKIE wants to merge 1 commit into
mainfrom
fix/ci-coverage
Open

SIDDHANTCOOKIE wants to merge 1 commit into
mainfrom
fix/ci-coverage

Conversation

@SIDDHANTCOOKIE

@SIDDHANTCOOKIE SIDDHANTCOOKIE commented Sep 11, 2026

Copy link
Copy Markdown
Member

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:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: TODO

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

  • Chores
    • Coverage reports now include fully covered files.
    • Pull request coverage comments run only for changes from the same repository.
    • Added ignore rules for local node data and Python coverage artifacts.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: c605b80a-651f-48cf-96d5-035e99039676

📥 Commits

Reviewing files that changed from the base of the PR and between c29182d and 2e4eec2.

📒 Files selected for processing (3)
  • .github/workflows/pr-checks.yml
  • .github/workflows/update-badge.yml
  • .gitignore

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The 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.

Changes

Coverage workflow and repository hygiene

Layer / File(s) Summary
Coverage reporting and pull request gating
.github/workflows/pr-checks.yml, .github/workflows/update-badge.yml
Coverage output no longer skips fully covered modules. Pull request coverage comments require a matching head repository.
Generated artifact and local directory ignores
.gitignore
The repository ignores legacy and node-specific directories and Python coverage artifacts.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested labels: Bash Lang

Merge Risk: ⚪ Minimal · up to 2e4ee

Coverage reporting and fork pull-request handling are updated without introducing a merge-blocking behavior change.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes both main changes: fixing the coverage parser format and preventing fork pull request permission errors.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ci-coverage

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.

❤️ Share

A rabbit checks the coverage lines,
No hidden modules left behind.
Same-repo comments pass the gate,
Local artifacts hibernate.
Neat ignore rules clear the way,
Hop by hop, the checks now stay.

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
minichain
   __init__.py100100% 
   block.py921683%10, 14, 17–23, 72, 138–140, 165, 170, 179, 181
   chain.py2276372%17, 22, 28, 32, 34, 37, 41, 68–73, 81–82, 89–90, 98–99, 104–105, 126–129, 182–185, 195–196, 205–206, 209–210, 214–215, 234, 258, 266–274, 283–284, 286–287, 310–313, 316–325, 335–336
   contract.py1548147%11–12, 15–20, 36–89, 124, 128, 136, 192–195, 215–216, 225–227, 234–235, 239–241, 249–250, 252–253, 258–259, 261–262, 264–265, 267–268, 270–271
   mempool.py651675%17–18, 32–34, 39–40, 42–43, 49–50, 56, 59–60, 67–69
   mpt.py14379%18–20
   network_config.py100100% 
   node_config.py100100% 
   p2p.py26319625%30–31, 71, 74, 77, 80, 83–90, 93–94, 97–98, 103, 118, 121, 124–126, 129–131, 134, 137, 140, 144–145, 155–157, 168–182, 189–195, 204–258, 263–373
   persistence.py1713977%84, 90, 92, 133, 143–144, 223–224, 244, 247–248, 270, 282–293, 296–297, 303–307, 310–313, 316–320
   pow.py431467%33, 42, 52–54, 58–60, 70, 75–79
   receipt.py140100% 
   rpc.py822668%41–42, 45, 61, 64, 68, 73–76, 78–91, 96–98
   serialization.py80100% 
   state.py2141792%35, 56–57, 90, 109–110, 156, 169, 217, 277, 302, 332, 335–340
   transaction.py590100% 
   validators.py9189%13
TOTAL144547267% 

Tests Skipped Failures Errors Time
76 0 💤 0 ❌ 0 🔥 6.654s ⏱️

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.

1 participant