Skip to content

No dependency tracking - reproducible false negative #8493

Description

@webard

A rule's output for file A can depend on the contents of file B (AddOverrideAttributeToOverriddenMethodsRector reads the parent, AddReturnTypeDeclarationBasedOnParentClassMethodRector and ReturnTypeFromStrictTypedCallRector read declarations in other files).

The cache stores A's verdict under a hash of A's own contents, so a change in B leaves the entry looking valid.

Reproduction, with AddOverrideAttributeToOverriddenMethodsRector alone:

  1. class Base without foo(), class Child extends Base with foo().
  2. Run once - nothing to change, both files cached.
  3. Add foo() to Base. Do not touch Child.
  4. Run again.

warm cache: [OK] Rector is done!
cold cache: + #[\Override] -> 1 file would have been changed

Same files on disk; the only difference is the cache. src/Caching holds no per-file dependency information, so nothing invalidates Child. The run is green, which makes this a silent false negative rather than a visible miss.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions