[Feat] Code coverage on commit#1199
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe changes add Composer coverage commands, increase PHPUnit memory, and extend the test workflow with PCOV, Clover reporting, base-branch comparison, and a 75% pull-request patch-coverage gate. Repository guidance documents the local and CI coverage process. ChangesCoverage enforcement
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PullRequest
participant GitHubActions
participant GitCheckout
participant PHPUnitPCOV
participant DiffCover
PullRequest->>GitHubActions: Trigger pull-request workflow
GitHubActions->>GitCheckout: Fetch full history and base branch
GitHubActions->>PHPUnitPCOV: Run tests and write Clover coverage
PHPUnitPCOV-->>GitHubActions: Return coverage report
GitHubActions->>DiffCover: Compare changed lines with base branch
DiffCover-->>GitHubActions: Enforce 75% patch coverage and produce Markdown report
🚥 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/tests.yml:
- Around line 35-38: Prevent shell injection in both affected workflow steps by
adding BASE_REF: ${{ github.base_ref }} to each step’s env block and replacing
direct github.base_ref interpolation with $BASE_REF in the git fetch command at
.github/workflows/tests.yml:35-38 and the diff-cover command at
.github/workflows/tests.yml:100-106.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 26fc9061-86cf-4202-94bb-7609bcced3cb
📒 Files selected for processing (6)
.github/copilot-instructions.md.github/workflows/tests.yml.gitignorecomposer.jsonphpunit.xmlstorage/plugins/.gitignore
💤 Files with no reviewable changes (1)
- storage/plugins/.gitignore
There was a problem hiding this comment.
Pull request overview
Adds a PR-time patch-coverage gate to the CI test workflow (diff-cover against a generated Clover report) and introduces local Composer scripts to generate coverage across different local PHP runners (Herd/Lerd/Yerd). This fits into the repo’s existing PHPUnit/Laravel test setup by extending the existing tests GitHub Actions workflow and documenting the new expectation for contributors.
Changes:
- Adds Composer scripts for generating Clover coverage output and enforcing patch coverage via
diff-cover. - Updates the
testsGitHub Actions workflow to run coverage on PRs and publish a patch-coverage report to the job summary. - Adds
/buildto.gitignoreand increases PHPUnit memory limit.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
storage/plugins/.gitignore |
Removes the legacy plugins storage ignore file (risk: plugin clones can show as untracked). |
phpunit.xml |
Increases PHPUnit memory limit to 2G. |
composer.json |
Adds coverage and diff-cover related scripts for local use. |
.gitignore |
Ignores /build output directory. |
.github/workflows/tests.yml |
Runs coverage + diff-cover on PRs and publishes a markdown report to job summary. |
.github/copilot-instructions.md |
Documents the new patch coverage expectation and local commands. |
Comments suppressed due to low confidence (1)
storage/plugins/.gitignore:1
- Removing
storage/plugins/.gitignoremeans any legacy plugin repos cloned intostorage/plugins/will show up as untracked changes and can be accidentally committed. Keeping a.gitignorehere helps ensure plugin install/uninstall doesn’t pollute git status.
Adds a code coverage gate on commit + local scripting supporting Herd, Lerd and Yerd via:
Update unit test job to include code coverage, with a 75% coverage target on changed code.
Summary by CodeRabbit
Tests
Chores
Documentation