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

WIP: Laravel upgrade 5.8 #760

Closed
wants to merge 10 commits into from
Closed

WIP: Laravel upgrade 5.8 #760

wants to merge 10 commits into from

Conversation

dakshhmehta
Copy link

@dakshhmehta dakshhmehta commented Aug 2, 2020

Changes to bump the laravel version to 5.8.

We do have failing tests for following modules:
Setting, Menu and Media
If anyone got an idea on failing test case for above module, please comment.

but despite of having the failing tests, php artisan serve runs the website smoothly. I have tested core modules including Setting, Menu, Page - front-end flow, Login, Forgot Password etc...

Regards,
Daksh

@nWidart
Copy link
Member

nWidart commented Aug 2, 2020

Thank you for the contribution!

Are these the only changes needed for laravel 5.8?

@@ -0,0 +1,9 @@
Activity/
Copy link
Member

Choose a reason for hiding this comment

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

Please don't commit this file.

Copy link
Author

Choose a reason for hiding this comment

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

Okay, I will remove this and modified compose.json before committing finally because these are our internal companies module. I will adjust it.

Copy link
Member

Choose a reason for hiding this comment

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

yeah no worries, I guess as much 😄
For your ease, it might be easier to have a separate asgardcms installation only for the contributions.
That way you don't risk mixing both together by accident.

@@ -1,6 +1,7 @@
/node_modules
/public/hot
/public/storage
/public/modules/*
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, again when we publish module, it just copied file from the module assets to public, we dont need I guess. Take a final call and I will remove it if there is intention to copy assets from modules to public.

phpunit.xml Outdated
@@ -12,7 +12,7 @@
<testsuite name="Core">
<directory>./Modules/Core/Tests/</directory>
</testsuite>
<testsuite name="Dashboard">
<!-- <testsuite name="Dashboard">
Copy link
Member

Choose a reason for hiding this comment

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

Why are these commented?

Copy link
Author

Choose a reason for hiding this comment

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

I am refactoring each of them and uncommenting manually to make it compatible for 3.8 testbench. Mostly setUp and tearDown are protected and return void strictly.

Copy link
Author

Choose a reason for hiding this comment

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

All are done and file is reverted to its original form

@dakshhmehta
Copy link
Author

@nWidart - that changes in Core and Menu composer.json file managed to resolve dependency and php artisan version ran successfully. However, I am passing each of module's Test case now.

@dakshhmehta
Copy link
Author

@nWidart - We are getting empty array from translatable in Setting test suite of phpunit, can you please help over in looking into it?

15) Modules\Setting\Tests\SettingsTest::it_returns_correctly_if_setting_for_locale_is_falsey
Dimsav\Translatable\Exception\LocalesNotDefinedException: Please make sure you have run "php artisan config:publish dimsav/laravel-translatable" and that the locales configuration is defined.

/home/daksh/public_html/lab/asgard4/vendor/dimsav/laravel-translatable/src/Translatable/Locales.php:40
/home/daksh/public_html/lab/asgard4/vendor/dimsav/laravel-translatable/src/Translatable/Locales.php:33
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Container/Container.php:825
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Container/Container.php:667
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Container/Container.php:615
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:767
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:121
/home/daksh/public_html/lab/asgard4/vendor/dimsav/laravel-translatable/src/Translatable/Translatable.php:807
/home/daksh/public_html/lab/asgard4/vendor/dimsav/laravel-translatable/src/Translatable/Translatable.php:718
/home/daksh/public_html/lab/asgard4/vendor/dimsav/laravel-translatable/src/Translatable/Translatable.php:779
/home/daksh/public_html/lab/asgard4/vendor/dimsav/laravel-translatable/src/Translatable/Translatable.php:245
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:1535
/home/daksh/public_html/lab/asgard4/Modules/Setting/Repositories/Eloquent/EloquentSettingRepository.php:100
/home/daksh/public_html/lab/asgard4/Modules/Setting/Repositories/Eloquent/EloquentSettingRepository.php:66
/home/daksh/public_html/lab/asgard4/Modules/Setting/Tests/SettingsTest.php:96

The strange thing we are getting proper output in Tag and other modules using translatable package.

…h module failing testcase due to translatable package issue
@dakshhmehta
Copy link
Author

@nWidart - Another issue needs your attention.

90) Modules\Tests\ThumbnailsManagerTest::it_can_add_a_thumbnail
ReflectionException: Class cache does not exist

/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Container/Container.php:788
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Container/Container.php:667
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Container/Container.php:615
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:767
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Container/Container.php:1227
/home/daksh/public_html/lab/asgard4/vendor/nwidart/laravel-modules/src/FileRepository.php:77
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Container/Container.php:825
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Container/Container.php:667
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Container/Container.php:265
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Container/Container.php:785
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Container/Container.php:667
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Container/Container.php:615
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:767
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Container/Container.php:1227
/home/daksh/public_html/lab/asgard4/vendor/nwidart/laravel-modules/src/Providers/BootstrapServiceProvider.php:23
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:607
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php:75
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:584
/home/daksh/public_html/lab/asgard4/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterProviders.php:17
/home/daksh/public_html/lab/asgard4/vendor/orchestra/testbench-core/src/Concerns/CreatesApplication.php:306
/home/daksh/public_html/lab/asgard4/vendor/orchestra/testbench-core/src/Concerns/CreatesApplication.php:202
/home/daksh/public_html/lab/asgard4/vendor/orchestra/testbench-core/src/TestCase.php:73
/home/daksh/public_html/lab/asgard4/vendor/orchestra/testbench-core/src/Concerns/Testing.php:68
/home/daksh/public_html/lab/asgard4/vendor/orchestra/testbench-core/src/TestCase.php:41
/home/daksh/public_html/lab/asgard4/Modules/Media/Tests/ThumbnailsManagerTest.php:17

Let me know if you need to create them as seperate issue?

@dakshhmehta
Copy link
Author

dakshhmehta commented Aug 2, 2020 via email

@dakshhmehta
Copy link
Author

@nWidart , have you got time to check the failing tests? Also, been using 5.8 since a week now for improving Rarv for some new functionality, haven't found any issue at runtime, so not sure why its failing...

@imagina
Copy link
Contributor

imagina commented Sep 2, 2020

@dakshhmehta , try changing the file: .travis.yml to Laravel 5.8.

imagina added a commit to imagina/imaginacms-platform that referenced this pull request Sep 3, 2020
…tDirSize calculation. It depends on the filesystem.

This commit will solve:
AsgardCms#465
and the pull request to upgrade to Laravel 5.8
AsgardCms#760
nWidart pushed a commit to Idavoll/Media that referenced this pull request Sep 3, 2020
…tDirSize calculation. It depends on the filesystem.

This commit will solve:
AsgardCms/Platform#465
and the pull request to upgrade to Laravel 5.8
AsgardCms/Platform#760
"laravel/tinker": "^1.0",
"nwidart/laravel-modules": "^4.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be here for auto-discovery to work. Otherwise, you have to manually load the service provider and facade for Laravel Modules in the app config.

"nwidart/laravel-modules": "^5.0",

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, I guess I removed it unintentionally.

Copy link
Author

Choose a reason for hiding this comment

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

I have reverted to 4.0, 5.0 seems to be incompatible with other module or am I missing anything?

@mikemand
Copy link
Contributor

mikemand commented Sep 3, 2020

It looks like we'll have to wait for floatingpointsoftware/stylist#45 or maintain our own fork.

I tried to pull this PR down and test it, but I can't get Stylist to provide the backend theme. Every view/partial that the backend needs is giving me an error about not being found. I haven't even tried the frontend yet.

@dakshhmehta
Copy link
Author

dakshhmehta commented Sep 4, 2020 via email

@mikemand
Copy link
Contributor

mikemand commented Sep 4, 2020

@dakshhmehta:

Screen Shot 2020-09-04 at 11 53 35 AM

I've already gone through this with a couple of the other partials (partials.notifications, partials.top-nav). As soon as I add one view to resources/views/partials, another one pops up an error.

All of the views I'm having an error about are in Themes/Adminlte/views.

@dakshhmehta
Copy link
Author

dakshhmehta commented Sep 4, 2020 via email

@mikemand
Copy link
Contributor

mikemand commented Sep 4, 2020

What does your composer.json look like? I think the problem is I ran composer install and it replaced the modules from this PR with the main v4 ones... Not sure why, when they were already "installed".

It would be quite a bit of work to start with a new Laravel base, I think. It might be a good idea though, to get the CMS up to current Laravel versions. The problem is some of the module's required packages. Some of them haven't been updated in two or more years and would need to be replaced by something new.

@dakshhmehta
Copy link
Author

dakshhmehta commented Sep 4, 2020 via email

@imagina
Copy link
Contributor

imagina commented Sep 7, 2020

Right now the platform is only compatible with PHP 7.1.x.

I just send a PR to fix travis-ci build and all the tests are passing for 7.1.x but not >= 7.2

Maybe that's your problem @mikemand

@dakshhmehta
Copy link
Author

dakshhmehta commented Sep 8, 2020 via email

@imagina
Copy link
Contributor

imagina commented Sep 11, 2020

Hello @dakshhmehta , yesterday i sent a new PR solving the testing issues for PHP 7.2,7.3 and 7.4 Can you rebase your PR with that changes to check if your PR pass the travis builds?

@dakshhmehta
Copy link
Author

dakshhmehta commented Sep 11, 2020 via email

@dakshhmehta
Copy link
Author

dakshhmehta commented Oct 24, 2020

@imagina - I want to rebase to your branch, what is your branch and repository? can you share the branch name please?

Edit: I got it. I just pull master, sorry :(

@dakshhmehta
Copy link
Author

Conclusion: don't install laravel/framework v5.8.0 (conflict analysis result)
    - idavoll/menu-module dev-master requires nwidart/laravel-menus ^3.0 -> satisfiable by nwidart/laravel-menus[3.0.0, 3.0.x-dev].
    - nwidart/laravel-menus[3.0.0, ..., 3.0.x-dev] require illuminate/view 5.7.* -> satisfiable by illuminate/view[v5.7.0, ..., 5.7.x-dev].

@nWidart - I need to bump the version 4.0 for make the Menu module in master (idavoll/menu-module) compatible, shall I send the merge request there or what is the right approach?

@dakshhmehta
Copy link
Author

@nWidart , after merging 5.8 compatibility of @imagina , I get following error in the fresh install after cloning master branch.

 Problem 1
    - idavoll/core-module dev-master requires nwidart/laravel-modules ^4.0 -> found nwidart/laravel-modules[4.0.0, 4.0.x-dev, 4.1.0] but it conflicts with your root composer.json require (^5.0).
    - idavoll/core-module 4.0.x-dev is an alias of idavoll/core-module dev-master and thus requires it to be installed too.
    - Root composer.json requires idavoll/core-module 4.0.x-dev -> satisfiable by idavoll/core-module[4.0.x-dev (alias of dev-master)].

Seems composer.lock needs to be part of repository or it has never been before?

@nWidart
Copy link
Member

nWidart commented Nov 10, 2020

I'll close this ticket as the other PRs of upgrades are ready to be merged. Lets see what errors come up after the laravel 8 merge.

@nWidart nWidart closed this Nov 10, 2020
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.

4 participants