From 014a83515796d9768226dfd658dce7184c345b8b Mon Sep 17 00:00:00 2001 From: Jake Spurlock Date: Fri, 4 Sep 2026 23:20:59 -0700 Subject: [PATCH 1/3] chore: stop measuring vendored SDK code as this plugin's coverage `includes/Vendor/AiClient/` holds third-party SDK classes copied verbatim from upstream php-ai-client so the plugin can use capabilities before every environment bundles them. Coverage currently measures them as if they were written here, and because upstream code carries paths this plugin never calls, they score far below the plugin's own code and drag the reported number away from the thing it is supposed to describe. The repository already treats that directory as not-our-code: `phpcs.xml.dist` excludes `includes/Vendor/` and `phpstan.neon.dist` excludes `includes/Vendor/AiClient/src/`. Coverage was the remaining gate still counting it. The vendored README already documented this rationale alongside the other two exemptions, describing an exclusion that did not yet exist. `phpunit.xml.dist` keeps those files out of the clover report, and `codecov.yml` keeps them out of the report Codecov renders from it. Both are needed: the first fixes the data, the second fixes anything reading it. This lowers the absolute number of covered lines as well as uncovered ones, so the headline percentage may move in either direction. The point is that it starts describing this plugin rather than upstream's test suite. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01BRSJEyQyYp3XTeum8fiq3L --- codecov.yml | 13 +++++++++++++ phpunit.xml.dist | 10 ++++++++++ 2 files changed, 23 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..8f99b2b0b --- /dev/null +++ b/codecov.yml @@ -0,0 +1,13 @@ +# Codecov configuration. +# +# `includes/Vendor/` holds third-party SDK code copied verbatim from upstream +# (see includes/Vendor/AiClient/README.md). It is not written or maintained +# here, and it carries code paths this plugin never calls, so scoring it +# measures upstream's test suite rather than this one. The repository already +# treats that directory as not-our-code: phpcs.xml.dist and phpstan.neon.dist +# both exclude it. This does the same for coverage. +# +# phpunit.xml.dist carries the matching exclusion so the underlying report +# never contains those files in the first place. +ignore: + - "includes/Vendor/**" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 97cb05778..ded6cb8c7 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -22,6 +22,16 @@ includes + + + includes/Vendor + From dc06c4b4000edbef16888c72d743322874338842 Mon Sep 17 00:00:00 2001 From: Jake Spurlock Date: Wed, 9 Sep 2026 09:56:00 -0700 Subject: [PATCH 2/3] chore: cut the comments down to the change they describe The rationale for excluding vendored code from coverage was written out three times: once in codecov.yml, once in phpunit.xml.dist, and once in includes/Vendor/AiClient/README.md, each phrased differently. Three copies of one reason drift apart, and eleven lines of comment over two lines of config is the wrong ratio. Both configs now point at the README, which is where the reasoning already lives. Co-Authored-By: Claude Opus 5 (1M context) --- codecov.yml | 13 ++----------- phpunit.xml.dist | 8 +------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/codecov.yml b/codecov.yml index 8f99b2b0b..16a00ecce 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,13 +1,4 @@ -# Codecov configuration. -# -# `includes/Vendor/` holds third-party SDK code copied verbatim from upstream -# (see includes/Vendor/AiClient/README.md). It is not written or maintained -# here, and it carries code paths this plugin never calls, so scoring it -# measures upstream's test suite rather than this one. The repository already -# treats that directory as not-our-code: phpcs.xml.dist and phpstan.neon.dist -# both exclude it. This does the same for coverage. -# -# phpunit.xml.dist carries the matching exclusion so the underlying report -# never contains those files in the first place. +# Third-party code, excluded for the same reason phpcs.xml.dist and +# phpstan.neon.dist exclude it. See includes/Vendor/AiClient/README.md. ignore: - "includes/Vendor/**" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ded6cb8c7..30ef073f4 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -22,13 +22,7 @@ includes - + includes/Vendor From 7e28ba32ac9063173a65707fe3455b662f8bbcff Mon Sep 17 00:00:00 2001 From: Jake Spurlock Date: Wed, 9 Sep 2026 09:59:23 -0700 Subject: [PATCH 3/3] chore: move the Codecov config to .github/.codecov.yml Codecov reads the file from the repository root, dev/, or .github/, under either codecov.yml or .codecov.yml. Putting it in .github/ places it with dependabot.yml and dependency-review-config.yml, the other configs that only GitHub reads. Co-Authored-By: Claude Opus 5 (1M context) --- codecov.yml => .github/.codecov.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename codecov.yml => .github/.codecov.yml (100%) diff --git a/codecov.yml b/.github/.codecov.yml similarity index 100% rename from codecov.yml rename to .github/.codecov.yml