Skip to content

fix(ci): hold rector at 2.7 so the Nextcloud rules keep working - #3209

Merged
blizzz merged 1 commit into
mainfrom
fix/rector-pin-2-7
Nov 2, 2026
Merged

blizzz merged 1 commit into
mainfrom
fix/rector-pin-2-7

Conversation

@AndyScherzinger

Copy link
Copy Markdown
Member

The Rector job fails on main and therefore on every pull request branched after it, with a failure that has nothing to do with the changes under review:

[ERROR] Could not process "lib/Activity/SettingCheck.php" file, due to:
        "System error: "Class "Rector\PhpDocParser\PhpDocParser\PhpDocNodeTraverser" not found"
        ... On line: 183
[ERROR] Could not process some files, due to: "Reached system errors count limit of 50, exiting...".

Rector 2.8 removed Rector\PhpDocParser\PhpDocParser\PhpDocNodeTraverser. nextcloud/rector v0.5.2 imports that class in src/Rector/AnnotationToAttributeRector.php and instantiates it on line 183 — the line the error names. Every analysed file fails the same way, the run hits the 50-error limit and the job aborts.

The upgrade arrived as a side effect of an automated dependency bump, 8a6a7cb (chore(dev-deps): Bump nextcloud/ocp package), which re-resolved the whole bin lock: "rector/rector": "^2.7.0" allowed the walk to 2.8.3 and carried phpstan 2.3.4 with it. That is why a pull request branched before it, such as #3203, still passes with rector 2.7.0 while #3199 and #2538 fail.

Holding rector at ~2.7.0 alone does not fix it: phpstan 2.3.4 ships phpdoc-parser 2.4 and hands rector 2.7's scoped parser a FullyQualifiedNameNode it does not know, which fails with CallableTypeNode::__construct(): Argument #1 ($identifier) must be of type IdentifierTypeNode. Both have to move together, so the lock is restored to the set that last passed.

Verified against a clean clone of main at 4150d63, running what CI runs (composer i then composer rector:check):

Set Result
main as is — rector 2.8.3, phpstan 2.3.4 63 PhpDocNodeTraverser errors, job aborts
rector ~2.7.0, phpstan left at 2.3.4 fails with the CallableTypeNode type error
rector 2.7.0 + phpstan 2.3.2 (this PR) [OK] Rector is done!

This is a stopgap. The real fix belongs in nextcloud/rector, whose main branch still carries the removed import (last touched 2026-10-14, before rector 2.8 shipped on 2026-10-26). Once there is a release built against rector 2.8 the constraint can be widened again.

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stableX.X
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Rector 2.8 removed Rector\PhpDocParser\PhpDocParser\PhpDocNodeTraverser,
which nextcloud/rector v0.5.2 imports and instantiates in
AnnotationToAttributeRector. Every analysed file then fails with "Class ...
not found", the run trips the 50 system error limit and the Rector job aborts,
so every pull request branched after 8a6a7cb fails a check that has nothing
to do with its own changes.

The upgrade came in as a side effect of an automated dependency bump, which
re-resolved the whole bin lock: "^2.7.0" let it walk into 2.8.3 and carried
phpstan 2.3.4 along. Holding rector at ~2.7.0 on its own is not enough -
phpstan 2.3.4 ships phpdoc-parser 2.4 and hands rector 2.7 a
FullyQualifiedNameNode its scoped parser does not know - so the lock is
restored to the set that last passed, rector 2.7.0 with phpstan 2.3.2.

This is a stopgap. The fix belongs in nextcloud/rector, whose main branch
still carries the removed import; once it has a release built against rector
2.8 the constraint can be widened again.

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@blizzz
blizzz merged commit 4f0b327 into main Nov 2, 2026
86 checks passed
@blizzz
blizzz deleted the fix/rector-pin-2-7 branch November 2, 2026 21:45
@AndyScherzinger AndyScherzinger added this to the v2.5.0 milestone Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants