Skip to content

[Feat] Code coverage on commit#1199

Open
RichardAnderson wants to merge 5 commits into
vitodeploy:4.xfrom
RichardAnderson:feat/code-coverage
Open

[Feat] Code coverage on commit#1199
RichardAnderson wants to merge 5 commits into
vitodeploy:4.xfrom
RichardAnderson:feat/code-coverage

Conversation

@RichardAnderson

@RichardAnderson RichardAnderson commented Jul 14, 2026

Copy link
Copy Markdown
Member

Adds a code coverage gate on commit + local scripting supporting Herd, Lerd and Yerd via:

  • composer test:coverage:herd
  • composer test:coverage:lerd
  • composer test:coverage:yerd

Update unit test job to include code coverage, with a 75% coverage target on changed code.

Summary by CodeRabbit

  • Tests

    • Pull requests now require at least 75% coverage for newly changed application code.
    • Added coverage reporting and diff-based validation for local use and PR checks.
    • Increased test execution memory to 2G to improve reliability.
  • Chores

    • Improved test workflow efficiency with concurrency and cancellation of in-progress runs.
    • Tightened workflow permissions and enhanced summaries for easier review.
    • Updated ignore rules to exclude generated build output and plugin files as appropriate.
  • Documentation

    • Added/expanded guidance for running and validating coverage checks locally.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review 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: Pro Plus

Run ID: 446b4590-14d2-4998-9c0c-da90074da998

📥 Commits

Reviewing files that changed from the base of the PR and between 8e0195f and 4891891.

📒 Files selected for processing (1)
  • .github/workflows/tests.yml

📝 Walkthrough

Walkthrough

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

Changes

Coverage enforcement

Layer / File(s) Summary
Coverage tooling and test configuration
composer.json, phpunit.xml, .gitignore
Composer scripts generate and compare coverage reports, PHPUnit receives a 2G memory limit, and /build is ignored.
Workflow preparation
.github/workflows/tests.yml
The workflow adds read-only permissions, concurrency control, full checkout history, base-branch fetching, and PCOV setup.
Pull-request coverage gate
.github/workflows/tests.yml, .github/copilot-instructions.md
Pull requests generate Clover coverage, run diff-cover against the base branch, enforce 75% patch coverage, publish the report, and document the requirement.

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
Loading
🚥 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 reflects the main change: adding code coverage checks to commits and CI.
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

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

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

@RichardAnderson
RichardAnderson marked this pull request as ready for review July 14, 2026 20:23
@RichardAnderson
RichardAnderson requested a review from Copilot July 14, 2026 20:23

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 252ac4c and 8e0195f.

📒 Files selected for processing (6)
  • .github/copilot-instructions.md
  • .github/workflows/tests.yml
  • .gitignore
  • composer.json
  • phpunit.xml
  • storage/plugins/.gitignore
💤 Files with no reviewable changes (1)
  • storage/plugins/.gitignore

Comment thread .github/workflows/tests.yml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 tests GitHub Actions workflow to run coverage on PRs and publish a patch-coverage report to the job summary.
  • Adds /build to .gitignore and 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/.gitignore means any legacy plugin repos cloned into storage/plugins/ will show up as untracked changes and can be accidentally committed. Keeping a .gitignore here helps ensure plugin install/uninstall doesn’t pollute git status.

Comment thread .github/workflows/tests.yml
Comment thread .github/workflows/tests.yml
Comment thread composer.json
@RichardAnderson
RichardAnderson requested a review from saeedvz July 14, 2026 20:39
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.

2 participants