Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use rector downgrade php #2582

Merged
merged 11 commits into from
Jun 28, 2022
Merged

Use rector downgrade php #2582

merged 11 commits into from
Jun 28, 2022

Conversation

samsonasik
Copy link
Member

No description provided.

@samsonasik
Copy link
Member Author

It seems got error:

0s
Run bin/rector process rules --ansi
 [ERROR] File path                                                              
         "/home/runner/work/rector-src/rector-src/vendor/rector/rector-downgrade
         -php/config/config.php" was not found while creating                   
         "Symplify\SmartFileSystem\SmartFileInfo" object.     

@TomasVotruba
Copy link
Member

TomasVotruba commented Jun 28, 2022

Possibly this is missing in composer.json to make config extension work:
https://github.com/rectorphp/rector-symfony/blob/c6abe8d19e2ebde7365e94eb8bb268b87935bd9d/composer.json#L61-L66

Should be added to rector-downgrade-php composer.json

An type as well: https://github.com/rectorphp/rector-symfony/blob/c6abe8d19e2ebde7365e94eb8bb268b87935bd9d/composer.json#L3

@samsonasik
Copy link
Member Author

@samsonasik samsonasik closed this Jun 28, 2022
@samsonasik samsonasik reopened this Jun 28, 2022
@samsonasik
Copy link
Member Author

Let's try

Comment on lines 54 to 56
-
run: composer require rector/rector-downgrade-php:dev-main --no-update
if: github.repository != 'rectorphp/rector-downgrade-php'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is temporary as require rector/rector-src in previous step seems using --no-update

@samsonasik
Copy link
Member Author

@TomasVotruba I am not sure about error on packages-tests workflow for rectorphp/rector-downgrade-php:

There were 671 errors:
1) Rector\Tests\DowngradePhp53\Rector\Dir\DirConstToFileConstRector\DirConstToFileConstRectorTest::test with data set #0 (Symplify\SmartFileSystem\SmartFileInfo Object (...))
Symfony\Component\DependencyInjection\Exception\RuntimeException: Cannot autowire service "Rector\DeadCode\Comparator\Parameter\ParameterDefaultsComparator": argument "$defaultParameterValueResolver" of method "__construct()" references class "Rector\DowngradePhp80\Reflection\DefaultParameterValueResolver" but no such service exists.

it seems overlapped with previous command for composer require rector/rector-src dev-main#${{github.event.pull_request.head.sha}} --no-update

https://github.com/rectorphp/rector-src/runs/7091105254?check_suite_focus=true#step:8:27

@samsonasik
Copy link
Member Author

samsonasik commented Jun 28, 2022

tweaked with check to not require rector/rector-src temporary on package tests for rectorphp/rector-downgrade-php ,it seems due to overlapped service 1323080

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba TomasVotruba merged commit e97dd8f into main Jun 28, 2022
@TomasVotruba TomasVotruba deleted the use-rector-downgrade-php branch June 28, 2022 12:35
@TomasVotruba
Copy link
Member

Let's roll 🎊💪

CoalesceAnalyzer::class,
NamespacedNameDecorator::class,
NamedVariableFactory::class,
BinaryOpTreeRootLocator::class,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are any of these used only in the downgrade set?
If so, those should be moved there, even for price of namespace rename

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems yes

@TomasVotruba
Copy link
Member

TomasVotruba commented Jun 28, 2022

For ref, this PR makes use of this package: https://github.com/rectorphp/rector-downgrade-php

@TomasVotruba
Copy link
Member

TomasVotruba commented Jun 28, 2022

Thanks to this decoupling, we got ~21 % speed improvement on CI run for rules-test 🎉 ⚡


Before - 3:43

image


After - 3:04

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants