Skip to content

PHP fleet hygiene: audit composer autoload-dev for OR-class-shadowing pattern #89

@rubenvdlinde

Description

@rubenvdlinde

Context

softwarecatalog#230 (closed today by softwarecatalog#232) surfaced a subtle bug pattern: autoload-dev PSR-4 mapping OCA\\OpenRegister\\tests/Stubs/ shadows the real OpenRegister classes in any production deployment that retains dev autoloads (the standard composer install --no-dev is supposed to drop these, but not every deploy path enforces it).

The exact same pattern is plausibly present in any other Conduction PHP app that has unit tests stubbing OpenRegister entities — i.e. all of them.

Action

  • Grep every PHP app's composer.json for autoload-dev.psr-4 entries that map OCA\\OpenRegister\\ (or other OR namespaces)
  • Verify the stub is loaded via tests/bootstrap.php (not via composer autoload) so prod vendor/ can't shadow real classes
  • Land per-app fixes following the softwarecatalog#232 pattern

Why this is non-code-adjacent

Silent prod bug — runtime symptoms manifest as "ObjectEntity has no method getSchema" or method-cannot-be-configured exceptions, easy to misdiagnose as an upstream OR issue.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions