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

Optional fixtures #8377

Merged
merged 9 commits into from Feb 4, 2020
Merged

Optional fixtures #8377

merged 9 commits into from Feb 4, 2020

Conversation

lukassykora
Copy link
Contributor

Please be sure you are submitting this against the staging branch.

Q A
Bug fix? Yes
New feature?
Automated tests included?
Related user documentation PR URL
Related developer documentation PR URL
Issues addressed (#s or URLs) #8359
BC breaks?
Deprecations?

Description:

The services that are not sometimes available need an argument optional=true. The config.php was modified to remove the services where the argument is optional = true and class does not exist.

Steps to reproduce the bug:

  1. After build process run php bin/console

Steps to test this PR:

  1. After build process run php bin/console, there should not be any error

Copy link
Contributor

@anton-vlasenko anton-vlasenko left a comment

Choose a reason for hiding this comment

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

Please resolve merge conflict.

@escopecz
Copy link
Sponsor Member

escopecz commented Feb 3, 2020

Rebased. Conflicts in compser.json resolved by running composer update

Copy link
Contributor

@anton-vlasenko anton-vlasenko left a comment

Choose a reason for hiding this comment

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

  1. There is a merge conflict again. It has to be resolved.
  2. I've generated the package, installed it and got the following error in the console (php bin/console).
PHP Warning:  include(vendor/composer/../../plugins/MauticCitrixBundle/Tests/DataFixtures/ORM/LoadCitrixData.php): failed to open stream: No such file or directory in vendor/composer/ClassLoader.php on line 444
PHP Stack trace:
PHP   1. {main}() bin/console:0
PHP   2. Symfony\Bundle\FrameworkBundle\Console\Application->run() bin/console:41
PHP   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() vendor/symfony/console/Application.php:148
PHP   4. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() vendor/symfony/framework-bundle/Console/Application.php:74
PHP   5. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() vendor/symfony/console/Application.php:255
PHP   6. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() vendor/symfony/framework-bundle/Console/Application.php:86
PHP   7. Symfony\Component\Console\Command\ListCommand->run() vendor/symfony/console/Application.php:1001
PHP   8. Symfony\Component\Console\Command\ListCommand->execute() vendor/symfony/console/Command/Command.php:255
PHP   9. Symfony\Component\Console\Helper\DescriptorHelper->describe() vendor/symfony/console/Command/ListCommand.php:75
PHP  10. Symfony\Component\Console\Descriptor\TextDescriptor->describe() vendor/symfony/console/Helper/DescriptorHelper.php:67
PHP  11. Symfony\Component\Console\Descriptor\TextDescriptor->describeApplication() vendor/symfony/console/Descriptor/Descriptor.php:55
PHP  12. Symfony\Component\Console\Descriptor\ApplicationDescription->getCommands() vendor/symfony/console/Descriptor/TextDescriptor.php:194
PHP  13. Symfony\Component\Console\Descriptor\ApplicationDescription->inspectApplication() vendor/symfony/console/Descriptor/ApplicationDescription.php:75
PHP  14. Symfony\Bundle\FrameworkBundle\Console\Application->all() vendor/symfony/console/Descriptor/ApplicationDescription.php:102
PHP  15. Symfony\Bundle\FrameworkBundle\Console\Application->all() vendor/symfony/framework-bundle/Console/Application.php:122
PHP  16. Symfony\Bundle\FrameworkBundle\Console\Application->has() vendor/symfony/console/Application.php:706
PHP  17. Symfony\Component\Console\CommandLoader\ContainerCommandLoader->get() vendor/symfony/console/Application.php:518
PHP  18. Symfony\Component\DependencyInjection\ServiceLocator->get() vendor/symfony/console/CommandLoader/ContainerCommandLoader.php:46
PHP  19. ContainerDxavvtd\appProdProjectContainer->{closure:var/cache/prod/ContainerDxavvtd/getConsole_CommandLoaderService.php:64-66}() vendor/symfony/dependency-injection/ServiceLocator.php:64
PHP  20. ContainerDxavvtd\appProdProjectContainer->load() var/cache/prod/ContainerDxavvtd/getConsole_CommandLoaderService.php:65
PHP  21. require() var/cache/prod/ContainerDxavvtd/appProdProjectContainer.php:5489
PHP  22. ContainerDxavvtd\appProdProjectContainer->load() var/cache/prod/ContainerDxavvtd/getDoctrine_FixturesLoadCommandService.php:9
PHP  23. require() var/cache/prod/ContainerDxavvtd/appProdProjectContainer.php:5489
PHP  24. spl_autoload_call() var/cache/prod/ContainerDxavvtd/getMautic_Citrix_Fixture_LoadCitrixDataService.php:8
PHP  25. Composer\Autoload\ClassLoader->loadClass() var/cache/prod/ContainerDxavvtd/getMautic_Citrix_Fixture_LoadCitrixDataService.php:8
PHP  26. Composer\Autoload\includeFile() vendor/composer/ClassLoader.php:322

Warning: include(vendor/composer/../../plugins/MauticCitrixBundle/Tests/DataFixtures/ORM/LoadCitrixData.php): failed to open stream: No such file or directory in vendor/composer/ClassLoader.php on line 444

Call Stack:
    0.0017     400720   1. {main}() bin/console:0
    0.0512    7245064   2. Symfony\Bundle\FrameworkBundle\Console\Application->run() bin/console:41
    0.0646    7631176   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() vendor/symfony/console/Application.php:148
    0.3054   37891688   4. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() vendor/symfony/framework-bundle/Console/Application.php:74
    0.3058   37891608   5. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() vendor/symfony/console/Application.php:255
    0.3058   37891608   6. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() vendor/symfony/framework-bundle/Console/Application.php:86
    0.3067   37905272   7. Symfony\Component\Console\Command\ListCommand->run() vendor/symfony/console/Application.php:1001
    0.3070   37906288   8. Symfony\Component\Console\Command\ListCommand->execute() vendor/symfony/console/Command/Command.php:255
    0.3101   38126400   9. Symfony\Component\Console\Helper\DescriptorHelper->describe() vendor/symfony/console/Command/ListCommand.php:75
    0.3101   38126400  10. Symfony\Component\Console\Descriptor\TextDescriptor->describe() vendor/symfony/console/Helper/DescriptorHelper.php:67
    0.3101   38126400  11. Symfony\Component\Console\Descriptor\TextDescriptor->describeApplication() vendor/symfony/console/Descriptor/Descriptor.php:55
    0.3139   38141728  12. Symfony\Component\Console\Descriptor\ApplicationDescription->getCommands() vendor/symfony/console/Descriptor/TextDescriptor.php:194
    0.3139   38141728  13. Symfony\Component\Console\Descriptor\ApplicationDescription->inspectApplication() vendor/symfony/console/Descriptor/ApplicationDescription.php:75
    0.3139   38141728  14. Symfony\Bundle\FrameworkBundle\Console\Application->all() vendor/symfony/console/Descriptor/ApplicationDescription.php:102
    0.3139   38141728  15. Symfony\Bundle\FrameworkBundle\Console\Application->all() vendor/symfony/framework-bundle/Console/Application.php:122
    0.3640   42766264  16. Symfony\Bundle\FrameworkBundle\Console\Application->has() vendor/symfony/console/Application.php:706
    0.3640   42766264  17. Symfony\Component\Console\CommandLoader\ContainerCommandLoader->get() vendor/symfony/console/Application.php:518
    0.3641   42766264  18. Symfony\Component\DependencyInjection\ServiceLocator->get() vendor/symfony/console/CommandLoader/ContainerCommandLoader.php:46
    0.3641   42766264  19. ContainerDxavvtd\appProdProjectContainer->{closure:var/cache/prod/ContainerDxavvtd/getConsole_CommandLoaderService.php:64-66}() vendor/symfony/dependency-injection/ServiceLocator.php:64
    0.3641   42766584  20. ContainerDxavvtd\appProdProjectContainer->load() var/cache/prod/ContainerDxavvtd/getConsole_CommandLoaderService.php:65
    0.3642   42792840  21. require('var/cache/prod/ContainerDxavvtd/getDoctrine_FixturesLoadCommandService.php') var/cache/prod/ContainerDxavvtd/appProdProjectContainer.php:5489
    0.3906   45968728  22. ContainerDxavvtd\appProdProjectContainer->load() var/cache/prod/ContainerDxavvtd/getDoctrine_FixturesLoadCommandService.php:9
    0.3907   45970664  23. require('var/cache/prod/ContainerDxavvtd/getMautic_Citrix_Fixture_LoadCitrixDataService.php') var/cache/prod/ContainerDxavvtd/appProdProjectContainer.php:5489
    0.3907   45970664  24. spl_autoload_call() var/cache/prod/ContainerDxavvtd/getMautic_Citrix_Fixture_LoadCitrixDataService.php:8
    0.3907   45970760  25. Composer\Autoload\ClassLoader->loadClass() var/cache/prod/ContainerDxavvtd/getMautic_Citrix_Fixture_LoadCitrixDataService.php:8
    0.3907   45970760  26. Composer\Autoload\includeFile() vendor/composer/ClassLoader.php:322

PHP Warning:  include(): Failed opening 'vendor/composer/../../plugins/MauticCitrixBundle/Tests/DataFixtures/ORM/LoadCitrixData.php' for inclusion (include_path='.:/usr/local/Cellar/php@7.2/7.2.25/share/php@7.2/pear') in vendor/composer/ClassLoader.php on line 444
PHP Stack trace:
PHP   1. {main}() bin/console:0
PHP   2. Symfony\Bundle\FrameworkBundle\Console\Application->run() bin/console:41
PHP   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() vendor/symfony/console/Application.php:148
PHP   4. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() vendor/symfony/framework-bundle/Console/Application.php:74
PHP   5. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() vendor/symfony/console/Application.php:255
PHP   6. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() vendor/symfony/framework-bundle/Console/Application.php:86
PHP   7. Symfony\Component\Console\Command\ListCommand->run() vendor/symfony/console/Application.php:1001
PHP   8. Symfony\Component\Console\Command\ListCommand->execute() vendor/symfony/console/Command/Command.php:255
PHP   9. Symfony\Component\Console\Helper\DescriptorHelper->describe() vendor/symfony/console/Command/ListCommand.php:75
PHP  10. Symfony\Component\Console\Descriptor\TextDescriptor->describe() vendor/symfony/console/Helper/DescriptorHelper.php:67
PHP  11. Symfony\Component\Console\Descriptor\TextDescriptor->describeApplication() vendor/symfony/console/Descriptor/Descriptor.php:55
PHP  12. Symfony\Component\Console\Descriptor\ApplicationDescription->getCommands() vendor/symfony/console/Descriptor/TextDescriptor.php:194
PHP  13. Symfony\Component\Console\Descriptor\ApplicationDescription->inspectApplication() vendor/symfony/console/Descriptor/ApplicationDescription.php:75
PHP  14. Symfony\Bundle\FrameworkBundle\Console\Application->all() vendor/symfony/console/Descriptor/ApplicationDescription.php:102
PHP  15. Symfony\Bundle\FrameworkBundle\Console\Application->all() vendor/symfony/framework-bundle/Console/Application.php:122
PHP  16. Symfony\Bundle\FrameworkBundle\Console\Application->has() vendor/symfony/console/Application.php:706
PHP  17. Symfony\Component\Console\CommandLoader\ContainerCommandLoader->get() vendor/symfony/console/Application.php:518
PHP  18. Symfony\Component\DependencyInjection\ServiceLocator->get() vendor/symfony/console/CommandLoader/ContainerCommandLoader.php:46
PHP  19. ContainerDxavvtd\appProdProjectContainer->{closure:var/cache/prod/ContainerDxavvtd/getConsole_CommandLoaderService.php:64-66}() vendor/symfony/dependency-injection/ServiceLocator.php:64
PHP  20. ContainerDxavvtd\appProdProjectContainer->load() var/cache/prod/ContainerDxavvtd/getConsole_CommandLoaderService.php:65
PHP  21. require() var/cache/prod/ContainerDxavvtd/appProdProjectContainer.php:5489
PHP  22. ContainerDxavvtd\appProdProjectContainer->load() var/cache/prod/ContainerDxavvtd/getDoctrine_FixturesLoadCommandService.php:9
PHP  23. require() var/cache/prod/ContainerDxavvtd/appProdProjectContainer.php:5489
PHP  24. spl_autoload_call() var/cache/prod/ContainerDxavvtd/getMautic_Citrix_Fixture_LoadCitrixDataService.php:8
PHP  25. Composer\Autoload\ClassLoader->loadClass() var/cache/prod/ContainerDxavvtd/getMautic_Citrix_Fixture_LoadCitrixDataService.php:8
PHP  26. Composer\Autoload\includeFile() vendor/composer/ClassLoader.php:322

Warning: include(): Failed opening 'vendor/composer/../../plugins/MauticCitrixBundle/Tests/DataFixtures/ORM/LoadCitrixData.php' for inclusion (include_path='.:/usr/local/Cellar/php@7.2/7.2.25/share/php@7.2/pear') in vendor/composer/ClassLoader.php on line 444

Call Stack:
    0.0017     400720   1. {main}() bin/console:0
    0.0512    7245064   2. Symfony\Bundle\FrameworkBundle\Console\Application->run() bin/console:41
    0.0646    7631176   3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() vendor/symfony/console/Application.php:148
    0.3054   37891688   4. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() vendor/symfony/framework-bundle/Console/Application.php:74
    0.3058   37891608   5. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() vendor/symfony/console/Application.php:255
    0.3058   37891608   6. Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand() vendor/symfony/framework-bundle/Console/Application.php:86
    0.3067   37905272   7. Symfony\Component\Console\Command\ListCommand->run() vendor/symfony/console/Application.php:1001
    0.3070   37906288   8. Symfony\Component\Console\Command\ListCommand->execute() vendor/symfony/console/Command/Command.php:255
    0.3101   38126400   9. Symfony\Component\Console\Helper\DescriptorHelper->describe() vendor/symfony/console/Command/ListCommand.php:75
    0.3101   38126400  10. Symfony\Component\Console\Descriptor\TextDescriptor->describe() vendor/symfony/console/Helper/DescriptorHelper.php:67
    0.3101   38126400  11. Symfony\Component\Console\Descriptor\TextDescriptor->describeApplication() vendor/symfony/console/Descriptor/Descriptor.php:55
    0.3139   38141728  12. Symfony\Component\Console\Descriptor\ApplicationDescription->getCommands() vendor/symfony/console/Descriptor/TextDescriptor.php:194
    0.3139   38141728  13. Symfony\Component\Console\Descriptor\ApplicationDescription->inspectApplication() vendor/symfony/console/Descriptor/ApplicationDescription.php:75
    0.3139   38141728  14. Symfony\Bundle\FrameworkBundle\Console\Application->all() vendor/symfony/console/Descriptor/ApplicationDescription.php:102
    0.3139   38141728  15. Symfony\Bundle\FrameworkBundle\Console\Application->all() vendor/symfony/framework-bundle/Console/Application.php:122
    0.3640   42766264  16. Symfony\Bundle\FrameworkBundle\Console\Application->has() vendor/symfony/console/Application.php:706
    0.3640   42766264  17. Symfony\Component\Console\CommandLoader\ContainerCommandLoader->get() vendor/symfony/console/Application.php:518
    0.3641   42766264  18. Symfony\Component\DependencyInjection\ServiceLocator->get() vendor/symfony/console/CommandLoader/ContainerCommandLoader.php:46
    0.3641   42766264  19. ContainerDxavvtd\appProdProjectContainer->{closure:var/cache/prod/ContainerDxavvtd/getConsole_CommandLoaderService.php:64-66}() vendor/symfony/dependency-injection/ServiceLocator.php:64
    0.3641   42766584  20. ContainerDxavvtd\appProdProjectContainer->load() var/cache/prod/ContainerDxavvtd/getConsole_CommandLoaderService.php:65
    0.3642   42792840  21. require('var/cache/prod/ContainerDxavvtd/getDoctrine_FixturesLoadCommandService.php') var/cache/prod/ContainerDxavvtd/appProdProjectContainer.php:5489
    0.3906   45968728  22. ContainerDxavvtd\appProdProjectContainer->load() var/cache/prod/ContainerDxavvtd/getDoctrine_FixturesLoadCommandService.php:9
    0.3907   45970664  23. require('var/cache/prod/ContainerDxavvtd/getMautic_Citrix_Fixture_LoadCitrixDataService.php') var/cache/prod/ContainerDxavvtd/appProdProjectContainer.php:5489
    0.3907   45970664  24. spl_autoload_call() var/cache/prod/ContainerDxavvtd/getMautic_Citrix_Fixture_LoadCitrixDataService.php:8
    0.3907   45970760  25. Composer\Autoload\ClassLoader->loadClass() var/cache/prod/ContainerDxavvtd/getMautic_Citrix_Fixture_LoadCitrixDataService.php:8
    0.3907   45970760  26. Composer\Autoload\includeFile() vendor/composer/ClassLoader.php:322


In getMautic_Citrix_Fixture_LoadCitrixDataService.php line 8:
                                                                                                                     
  Attempted to load class "LoadCitrixData" from namespace "MauticPlugin\MauticCitrixBundle\Tests\DataFixtures\ORM".  
  Did you forget a "use" statement for another namespace?                                                            

Copy link
Contributor

@anton-vlasenko anton-vlasenko left a comment

Choose a reason for hiding this comment

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

Nitpick: I've also noticed that the package generation takes considerably more time now (like 50%-100% more). I haven't performed any tests though, so this is just my rough estimate.
It could be related to that collection class we borrowed from Laravel. It may be too slow in comparison with php arrays.

@dongilbert
Copy link
Member

The cache compilation happens once though so it's not an issue. It's better than creating an untested pass-by-reference array function to mimick the same functionality.

@anton-vlasenko
Copy link
Contributor

anton-vlasenko commented Feb 3, 2020

The cache compilation happens once though so it's not an issue. It's better than creating an untested pass-by-reference array function to mimick the same functionality.

Good to know. Thanks for explaining, @dongilbert.
But I'm not sure if this issue is cache related. It always starts to build distribution package from scratch in a separate folder. So it must always take about the same time to build a package.
But I don't insist that we have to fix it.

@dongilbert
Copy link
Member

I see - I didn't realize that's what you were talking about

@lukassykora
Copy link
Contributor Author

There are changes in composer.json so maybe the longer time for generation relates to it.

@escopecz
Copy link
Sponsor Member

escopecz commented Feb 3, 2020

@lukassykora there are conflicts in composer.lock. I fixed it once today by rebasing, then running composer update, git rebase --continue and git push --force. If you won't get to it then I'll do it tomorrow morning.

@dongilbert
Copy link
Member

The conflicts have been resolved following @escopecz's suggestion.

Copy link
Contributor

@anton-vlasenko anton-vlasenko left a comment

Choose a reason for hiding this comment

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

@escopecz Could you please merge?

@escopecz escopecz merged commit c141206 into mautic:3.x Feb 4, 2020
@escopecz escopecz removed this from the 3.0.0-beta milestone Apr 6, 2020
@escopecz escopecz added this to the 3.0.0 milestone Apr 6, 2020
@escopecz escopecz added this to Needs code review and/or test in Mautic 3 Apr 6, 2020
@escopecz escopecz added code-review-needed PR's that require a code review before merging ready-to-test PR's that are ready to test and removed code-review-needed PR's that require a code review before merging ready-to-test PR's that are ready to test labels Apr 6, 2020
@escopecz escopecz moved this from Needs code review and/or test to Done in Mautic 3 Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Mautic 3
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants