Skip to content

Skip AddSeeTestAnnotationRector to fix rector-dry CI gate - #12

Merged
erikfrerejean merged 1 commit into
6from
fix/rector-see-test-annotation
Jul 28, 2026
Merged

Skip AddSeeTestAnnotationRector to fix rector-dry CI gate#12
erikfrerejean merged 1 commit into
6from
fix/rector-see-test-annotation

Conversation

@erikfrerejean

Copy link
Copy Markdown
Member

Problem

The Static analysis job fails on make rector-dry (exit 2). All three PHPUnit jobs pass.

Rector's rectorPreset enables AddSeeTestAnnotationRector, which wants to add @see annotations pointing at test classes to both classes in src/:

+ * @see \WeDevelop\SvgImage\Tests\Assets\SvgTest
+ * @see \WeDevelop\SvgImage\Tests\Task\MigrateCurrentSvgsTaskTest

This is not caused by any change on branch 6 — the same failure hit fix/silverstripe-assets-compatibility on 2026-07-21. The container project ships no composer.lock and runs minimum-stability: dev, so CI installs whatever is current upstream and the rule started firing somewhere after the last green run on 2026-05-07.

Fix

Skip the rule instead of applying the annotations. .gitattributes marks /tests export-ignore and the module's composer.json declares no autoload-dev for the WeDevelop\SvgImage\Tests\ namespace, so those @see references would point at classes absent from every published install. The config already skips three other rules.

Verification

Run in-container against this change:

Gate Result
make rector-dry exit 0 — [OK] Rector is done!
make analyse exit 0 — [OK] No errors
make test 12/12 OK, 25 assertions

Follow-up (not in this PR)

CI is not reproducible: unpinned dev-stability dependencies mean the next rule added upstream breaks the build again on a branch that changed nothing. Committing a composer.lock for the container project under .docker/app/ would address that.

Rector's rectorPreset enables AddSeeTestAnnotationRector, which wants to
add @see annotations pointing at test classes in src/. Since /tests is
export-ignored and the module declares no autoload-dev for the Tests
namespace, those references would dangle in every published install.

The rule started firing after an upstream dependency update; the
container project pins nothing, so CI has failed on every branch since
2026-07-21.
@erikfrerejean
erikfrerejean merged commit b17d59c into 6 Jul 28, 2026
4 checks passed
@erikfrerejean
erikfrerejean deleted the fix/rector-see-test-annotation branch July 28, 2026 13:47
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