Skip to content

chore: apply the findings of the 2026-08-03 repository review - #4

Merged
tomas-kulhanek merged 8 commits into
mainfrom
chore/apply-repository-review
Aug 3, 2026
Merged

chore: apply the findings of the 2026-08-03 repository review#4
tomas-kulhanek merged 8 commits into
mainfrom
chore/apply-repository-review

Conversation

@tomas-kulhanek

Copy link
Copy Markdown
Contributor

Applies all six findings of the deep repository review of 811d5db, plus three side findings noticed while verifying them. Every finding was re-verified against the working tree before being touched.

Review findings

ID Severity What
F-01 Medium 'src' and 'tests' were literal paths, not globs, so a change to tests/Fixture/config/enum_tag.yaml could alter what the integration tests assert without triggering CI. Filters are now src/** and tests/**.
F-02 Medium Branch protection on mainnot in this PR, it is a repository setting. See below.
F-03 Low An omitted keys node fell through the config component and failed in the extension with a different exception than the same group with an explicitly empty list. isRequired() puts it where key_prefix and active_key already were, with a regression test for the omitted case.
F-04 Low The AAD example called encryptWithAdditionalData on properties declared as Encryptor/Decryptor, where the method does not exist. Verified: the old snippet fails PHPStan with method.notFound, the new one does not.
F-05 Low All third-party actions pinned to full commit SHAs with a version comment. technote-space/assign-author first — it is the only write-scoped one.
F-06 Low Empty additional data was only asserted on the encrypt side, and WriteOnlyAnonymousAsymmetricEncryptor::isEncrypted() / needsReEncryption() had no direct test. Both covered.

Side findings

  • shivammathur/setup-php had no extensions:, so the runner PHP that actually runs phpstan/phpcs/rector/phpunit was provisioned without ext-sodium, which composer.json requires.
  • The workflow was called "Nightly" but its cron 0 3 1 * * runs monthly. Renamed to match the schedule.
  • The Dependabot composer block used reviewers (deprecated in favour of assignees) and the github-actions block had no commit prefix or PR limit.

Quality gates

composer validate --strict, composer audit, composer phpstan (level 10), composer phpcs, composer rector:check all pass. PHPUnit: 88 tests, 186 assertions, up from 84/177 — four new regression tests.

Still open: F-02

Branch protection was deliberately left out of this PR. Note the interaction with F-01: because ci.yaml keeps paths: filters, a PR touching only README.md or CHANGELOG.md does not run CI, and required status checks would make such a PR unmergeable. Decide that before enabling protection — either drop paths: from the pull_request trigger, or add the documentation paths.

🤖 Generated with Claude Code

tomas-kulhanek and others added 8 commits August 3, 2026 12:41
'src' and 'tests' were literal paths, not globs, so they matched nothing.
Only '**/*.php' actually triggered the workflow, which meant a change to
tests/Fixture/config/enum_tag.yaml could alter what the integration tests
assert without running them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A moved tag or a compromised upstream account silently changes what runs
here. technote-space/assign-author is the one that matters most: it holds
issues: write and pull-requests: write.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
php-extensions only reached the php-actions/composer image. The runner PHP
that setup-php provisions is the one that runs phpstan, phpcs, rector and
phpunit, and composer.json requires ext-sodium.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The cron is '0 3 1 * *' — the first day of the month, not every night.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The composer block used reviewers, which Dependabot deprecated in favour of
assignees, and the github-actions block had no commit message prefix or PR
limit. Actions are pinned to SHAs now, and Dependabot bumps those the same
way it bumps a tag.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A prototyped node always reports a default value, so an omitted "keys"
never reached the requiresAtLeastOneElement check and fell through to the
extension instead, where it failed with a different exception than the same
group with an explicitly empty list. isRequired() puts it where
key_prefix and active_key already were.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The example called encryptWithAdditionalData on properties the section
above declares as Encryptor and Decryptor, where the method does not exist.
Copied into a project running PHPStan it failed with method.notFound.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…tural checks

Empty additional data was only asserted on the encrypt side, and the
write-only anonymous encryptor had no direct test for isEncrypted() or
needsReEncryption() — the two methods a rotation sweep needs from a group
that can never read what it wrote.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tomas-kulhanek
tomas-kulhanek merged commit a2e45c8 into main Aug 3, 2026
5 checks passed
@tomas-kulhanek
tomas-kulhanek deleted the chore/apply-repository-review branch August 3, 2026 18:19
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