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

fix: Recipe update skip ignored files #885

Merged
merged 1 commit into from
Apr 15, 2022
Merged

Conversation

maxime-aknin
Copy link
Contributor

I ran into an issue with the composer recipes:update command. While trying to update doctrine/doctrine-bundle recipe from 2.0 to 2.4, the command ouput stated that the recipe was updated with conflicts, but there were no actual changes made in files (except the symfony lock file):
Screen Shot 2022-03-15 at 5 15 21 PM

What's happening is that this recipe update contains changes that are applied to phpunit.xml by Symfony\Flex\Configurator\EnvConfigurator, but this file is also added to gitignore by phpunit/phpunit recipe

The fact that there is an ignored file in the recipe patch makes the git apply command in RecipePatcher fail without applying the patch, and this failure is not detected by the rest of the function.
Screen Shot 2022-03-15 at 5 31 10 PM

My proposal is to filter out ignored files from the beginning of the generatePatch function to fix this issue.

Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

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

Thank you for this @maxime-aknin! I thought I had all the edge cases covered. I was wrong :).

I've left some comments - mostly minutiae coding standard changes.

Cheers!

src/Update/RecipePatcher.php Outdated Show resolved Hide resolved
src/Update/RecipePatcher.php Outdated Show resolved Hide resolved
src/Update/RecipePatcher.php Outdated Show resolved Hide resolved
src/Update/RecipePatcher.php Outdated Show resolved Hide resolved
src/Update/RecipePatcher.php Outdated Show resolved Hide resolved
tests/Update/RecipePatcherTest.php Outdated Show resolved Hide resolved
tests/Update/RecipePatcherTest.php Outdated Show resolved Hide resolved
tests/Update/RecipePatcherTest.php Outdated Show resolved Hide resolved
@weaverryan
Copy link
Member

Oh, and for the coding standards, I should have just pointed you at fabbot (one of the CI checks): https://fabbot.io/report/symfony/flex/885/d84cd84094be56d55cfd5db080db4c40a6dcce16 - you can fix everything automatically from there.

@maxime-aknin
Copy link
Contributor Author

Hello @weaverryan 👋

That's ok I think every code style problem is now fixed. Sorry I didn't take the time to properly check the code standards before submitting. Thanks for the feedback and for the great symfonycast 🤘

Cheers !

@fabpot
Copy link
Member

fabpot commented Apr 3, 2022

@weaverryan Can you check now that the code has been updated now?

Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

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

Looks great 👍

@fabpot
Copy link
Member

fabpot commented Apr 15, 2022

Thank you @maxime-aknin.

@fabpot fabpot merged commit c0c28f8 into symfony:1.x Apr 15, 2022
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.

None yet

5 participants