Skip to content

Audit fixes (2026-09) - #3

Merged
luthermonson merged 2 commits into
mainfrom
fix/audit-2026-09
Sep 11, 2026
Merged

luthermonson merged 2 commits into
mainfrom
fix/audit-2026-09

Conversation

@luthermonson

Copy link
Copy Markdown
Contributor

Audited KV/cache fixes for cache-symfony. Adopts ephpm_kv_setnx where it was missing (atomic add()/NX/locks), stops reporting OOM writes as success, fixes the incrBy false->0 cast across the copied KvOps, and refreshes docs/CI. Every behavioral change has a test (agent ran the suite green in WSL PHP 8.5).

…ormance

- doSave() now records each key whose set() returned false and returns the
  list of failed ids (AbstractAdapter::doSave contract), instead of always
  returning true and masking OOM-dropped writes as success.
- SapiKvOps::incrBy() no longer does `(int) false === 0`: it detects the
  SAPI's false return (stored value is not an integer) and throws, per the
  KvOpsInterface::incrBy contract.
- Add EphpmKvAdapterIntegrationTest wiring the adapter (over InMemoryKvOps)
  into Symfony's shared AdapterTestCase/CachePoolTest suite, with documented
  $skippedTests for genuinely unsupported features (prefix clear / SCAN,
  NamespacedPoolInterface) and assert()-gated key validation.
- Tests for both behavior fixes (doSave failure collection via FailingSetKvOps;
  SapiKvOps incrBy throw via stubbed ephpm_kv_* globals).
- README: current release v0.8.6 -> v0.10.2 (min-ePHPm floor language kept).
@ephpm

ephpm Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

ePHPm Preview — removed

Preview deployment has been torn down.

@ephpm
ephpm Bot temporarily deployed to preview-pr-3 September 11, 2026 06:47 Inactive
@ephpm
ephpm Bot temporarily deployed to preview-pr-3 September 11, 2026 06:47 Inactive
@ephpm
ephpm Bot temporarily deployed to preview-pr-3 September 11, 2026 06:47 Inactive
…its Tests/)

The AdapterTestCase base class lives under Symfony\Component\Cache\Tests\,
which is export-ignored from the symfony/cache dist tarball, so under CI's
composer install --prefer-dist it is not autoloadable and PHPUnit fatals with
"Class ... AdapterTestCase not found" at class-declaration time (before any
skip logic can run). Forcing a prefer-source install is fragile across
symfony/cache 6.4 vs 7.x, so drop the optional conformance harness and keep the
package's own passing unit tests. The real audit fixes (doSave failure-id
collection and SapiKvOps::incrBy throwing on a non-integer) and their
regression tests are unchanged.

Also removes the now-unused cache/integration-tests dev dependency, the
Symfony\Component\Cache\Tests\ autoload-dev map, the preferred-install
source pin, and the assertions-enabling test script that only the harness
needed.
@luthermonson
luthermonson merged commit 9ea3c74 into main Sep 11, 2026
3 checks passed
@luthermonson
luthermonson deleted the fix/audit-2026-09 branch September 11, 2026 06:51
@ephpm
ephpm Bot temporarily deployed to preview-pr-3 September 11, 2026 06:52 Inactive
@ephpm
ephpm Bot temporarily deployed to preview-pr-3 September 11, 2026 06:52 Inactive

This branch was successfully deployed

1 active deployment
preview-pr-3 — cc6b8582 Deployed Sep 11, 2026 by ephpm[bot]
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