Skip to content

feat(php-tests)!: emit text + Clover XML coverage, per-format booleans, drop coverage-command#18

Open
kojiromike wants to merge 4 commits into
mainfrom
feat/coverage-text-and-clover
Open

feat(php-tests)!: emit text + Clover XML coverage, per-format booleans, drop coverage-command#18
kojiromike wants to merge 4 commits into
mainfrom
feat/coverage-text-and-clover

Conversation

@kojiromike
Copy link
Copy Markdown
Contributor

@kojiromike kojiromike commented May 20, 2026

Summary

  • Default coverage run produces three artifacts under coverage-report/: HTML report, coverage.txt (PHPUnit text report), clover.xml (machine-readable line coverage) for cheap agent / CI consumption.
  • Three new boolean inputs — coverage-html, coverage-text, coverage-clover (all default true) — let callers opt out of any format. At least one must be true.
  • Breaking: coverage-command is removed. The booleans are now the entire API for choosing outputs. Callers who need to customize PHPUnit (config path, suites, listeners, bootstrap, coverage filters, etc.) configure those in phpunit.xml, which PHPUnit auto-discovers.

Pairs with openCoreEMR/github-workflows-internal#33 (surfaces the text Summary in the PR comment and links the artifact).

Why drop coverage-command

The previous design eval'd an arbitrary string input. Even though the input is caller-trusted in GHA's model, the escape hatch invites future foot-shooting (e.g., a caller accidentally interpolating untrusted context). The booleans cover the common cases; phpunit.xml covers the rest.

Test plan

  • Pin this branch via uses: on a real caller; confirm coverage-report/{coverage.txt,clover.xml,index.html} all appear in the uploaded artifact.
  • Set coverage-clover: false and confirm clover.xml is absent.
  • Set all three booleans to false and confirm the step fails fast with a clear error.
  • Confirm a caller with a custom phpunit.xml (suites, exclusions) still picks it up via auto-discovery.

Default coverage-command now writes coverage.txt and clover.xml into
coverage-report/ alongside the HTML report, so consumers (PR comments,
agents, CI tools) can read coverage without scraping HTML.

Assisted-by: Claude Code
Add coverage-html, coverage-text, coverage-clover (all default true) so
callers can opt out of any format. The default coverage-command becomes
empty and is composed from the booleans; setting coverage-command still
overrides everything as an escape hatch.

Assisted-by: Claude Code
@kojiromike kojiromike added the github-actions GitHub Actions ecosystem label May 20, 2026
The booleans (coverage-html, coverage-text, coverage-clover) are now the
entire API for choosing which coverage outputs to emit. Removing the
arbitrary-shell-eval escape hatch eliminates a foot-gun: callers can no
longer accidentally interpolate untrusted GitHub context into a shell
string, and the workflow no longer eval's a free-form input.

Callers that need to customize PHPUnit (config path, suites, listeners,
bootstrap, coverage exclusions, etc.) configure those in phpunit.xml,
which PHPUnit auto-discovers.

BREAKING CHANGE: The coverage-command input has been removed. Callers
that set it must remove the input and move any custom PHPUnit
configuration into phpunit.xml.

Assisted-by: Claude Code
POSIX-canonical form in [[ ]] tests; reserve == for arithmetic inside
(( )).

Assisted-by: Claude Code
@kojiromike kojiromike changed the title feat(php-tests): emit text + Clover XML coverage, gated by booleans feat(php-tests)!: emit text + Clover XML coverage, per-format booleans, drop coverage-command May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github-actions GitHub Actions ecosystem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant