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-PHP81] Checklist #1275

Closed
sreichel opened this issue Jan 19, 2023 · 42 comments
Closed

[WIP-PHP81] Checklist #1275

sreichel opened this issue Jan 19, 2023 · 42 comments

Comments

@sreichel
Copy link
Collaborator

sreichel commented Jan 19, 2023

Based on https://github.com/cmuench/n98-magerun/tree/feature/php81

Available commands:

  • completion Dump the shell completion script
  • help Display help for a command
  • install Install magento
  • list List commands
  • open-browser Open current project in browser (experimental)
  • script Runs multiple n98-magerun commands
  • shell Runs n98-magerun as shell - Removed with symfony3?
  • uninstall Uninstall magento (drops database and empties current folder or folder set via installationFolder)

admin ✔️

  • admin:notifications Toggles admin notifications
  • admin:user:change-password Changes the password of a adminhtml user.
  • admin:user:change-status Set active status of an adminhtml user. If no option is set the status will be toggled.
  • admin:user:create Create admin user.
  • admin:user:delete Delete the account of a adminhtml user.
  • admin:user:list List admin users.

cache ✔️

  • cache:clean Clean magento cache
  • cache:dir:flush Flush (empty) Magento cache directory
  • cache:disable Disables magento caches
  • cache:enable Enables magento caches
  • cache:flush Flush magento cache storage
  • cache:list Lists all magento caches
  • cache:report View inside the cache
  • cache:view Prints a cache entry

category ✔️

  • category:create:dummy Create a dummy category

cms ✔️

  • cms:block:list List all cms blocks
  • cms:block:toggle Toggle a cms block

composer - removed

  • composer:diagnose Diagnoses the system to identify common errors.
  • composer:init Creates a basic composer.json file in current directory.
  • composer:install [i] Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
  • composer:require Adds required packages to your composer.json and installs them.
  • composer:search Searches for packages.
  • composer:update [u|upgrade] Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
  • composer:validate Validates a composer.json and composer.lock.

config ✔️

  • config:delete Deletes a store config item
  • config:dump Dump merged xml config
  • config:get Get a core config item
  • config:search Search system configuration descriptions.
  • config:set Set a core config item

customer ✔️

  • customer:change-password Changes the password of a customer.
  • customer:create Creates a new customer/user for shop frontend.
  • customer:create:dummy Generate dummy customers. You can specify a count and a locale.
  • customer:delete Delete Customer/s
  • customer:info Loads basic customer info by email address.
  • customer:list Lists customers

db ✔️

  • db:console [mysql-client] Opens mysql client by database config from local.xml
  • db:create Create currently configured database
  • db:drop Drop current database
  • db:dump Dumps database with mysqldump cli client
  • db:import Imports database with mysql cli client according to database defined in local.xml
  • db:info Dumps database informations
  • db:maintain:check-tables Check database tables
  • db:query Executes an SQL query on the database defined in local.xml
  • db:status Shows important server status information or custom selected status values
  • db:variables Shows important variables or custom selected

design ✔️

  • design:demo-notice Toggles demo store notice for a store view

dev ✔️

  • dev:class:lookup Resolves a grouped class name
  • dev:code:model:method Code annotations: Reads the columns from a table and writes the getter and setter methods into the class file for @methods.
  • dev:console Opens PHP interactive shell with initialized Mage::app() (Experimental)
  • dev:email-template:usage Display database transactional email template usage
  • dev:ide:phpstorm:meta Generates meta data file for PhpStorm auto completion (default version : 2019.1+)
  • dev:log Toggle development log (system.log, exception.log)
  • dev:log:db Turn on/off database query logging
  • dev:log:size Get size of log file
  • dev:merge-css Toggles CSS Merging
  • dev:merge-js Toggles JS Merging
  • dev:module:create Create and register a new magento module.
  • dev:module:dependencies:from Show list of modules which depend on %s module
  • dev:module:dependencies:on Show list of modules which given module depends on
  • dev:module:disable Disable a module or all modules in codePool
  • dev:module:enable Enable a module or all modules in codePool
  • dev:module:list List all installed modules
  • dev:module:observer:list Lists all registered observers
  • dev:module:rewrite:conflicts Lists all magento rewrite conflicts
  • dev:module:rewrite:list Lists all magento rewrites
  • dev:module:update Update a Magento module.
  • dev:profiler Toggles profiler for debugging
  • dev:report:count Get count of report files
  • dev:setup:script:attribute Creates attribute script for a given attribute code
  • dev:symlinks Toggle allow symlinks setting
  • dev:template-hints Toggles template hints
  • dev:template-hints-blocks Toggles template hints block names
  • dev:theme:duplicates Find duplicate files (templates, layout, locale, etc.) between two themes.
  • dev:theme:info Displays settings of current design on particular store view
  • dev:theme:list Lists all available themes
  • dev:translate:admin Toggle inline translation tool for admin
  • dev:translate:export Export inline translations
  • dev:translate:set Adds a translation to core_translate table. Globally for locale
  • dev:translate:shop Toggle inline translation tool for shop

eav ✔️

  • eav:attribute:create-dummy-values Create a dummy values for dropdown attributes
  • eav:attribute:list Lists all EAV attributes
  • eav:attribute:remove Removes attribute for a given attribute code
  • eav:attribute:view View informations about an EAV attribute

index ✔️

  • index:list Lists all magento indexes
  • index:reindex Reindex a magento index by code
  • index:reindex:all Reindex all magento indexes

local-config ✔️

  • local-config:generate Generates local.xml config

media ✔️

  • media:cache:image:clear Clears image cache
  • media:cache:jscss:clear Clears JS/CSS cache
  • media:dump Creates an archive with content of media folder.

script ✔️

  • script:repo:list Lists all scripts in repository
  • script:repo:run Run script from repository

sys ✔️

  • sys:check Checks Magento System
  • sys:cron:history Last executed cronjobs with status.
  • sys:cron:list Lists all cronjobs
  • sys:cron:run Runs a cronjob by job code
  • sys:info Prints infos about the current magento system.
  • sys:maintenance Toggles maintenance mode.
  • sys:modules:list List all installed modules
  • sys:setup:change-version Change module setup resource version
  • sys:setup:compare-versions Compare module version with core_resource table.
  • sys:setup:incremental List new setup scripts to run, then runs one script
  • sys:setup:remove Remove module setup resource entry
  • sys:setup:run Runs all new setup scripts.
  • sys:store:config:base-url:list Lists all base urls
  • sys:store:list Lists all installed store-views
  • sys:url:list Get all urls.
  • sys:website:list Lists all websites
@sreichel sreichel changed the title [PHP81-support] Checklist [PHP81] Checklist Jan 19, 2023
@sreichel
Copy link
Collaborator Author

sreichel commented Jan 19, 2023

For next PR ...

cmuench#87

Tasks

  • index:reindex ... fix output
  • sys:check .... is incomplete. Ext intl is required now

Errors

  • admin:user:change-password
  • customer:create:dummy
  • customer:info
  • db:maintain:check-tables
  • design:demo-notice
  • dev:module:dependencies:from
  • dev:module:dependencies:on
  • dev:module:observer:list
  • eav:attribute:view
  • script:repo:run
  • sys:setup:run

@ADDISON74
Copy link

A real work to be appreciated to keep this tool up to date which was heavily used during Magento 1. OpenMage continues Magento 1 and doesn't stop at being an LTS.

@sreichel
Copy link
Collaborator Author

@cmuench PR is ready.

Did not touch composer related commands. Do we still need them?

Install/Uninstall needs to be tested by someone else (does not work in my DDEV environment)

Unittests have to be adjusted. Some help would be nice here :)

@cmuench
Copy link
Member

cmuench commented May 17, 2023

@sreichel I do not work with Magento 1 anymore on a daily base. Maybe we should remove the Composer library from Magerun 1.
Removing means that we have to replace also the internal downloader logic which is using the Composer packages.
I already did that for Magerun 2 to prevent conflicts with Symfony components etc.

@sreichel
Copy link
Collaborator Author

It would have been easier to backport magerun2 🤣

Install/CI fails b/c composer dowload does not work. @cmuench can we/you backport install cmd from magerun2?

@sreichel
Copy link
Collaborator Author

sreichel commented May 19, 2023

For next PR ...

Backport from n89-magerun2 ...

Updates

  • twig/twig v3

Tasks

  • completion .... Shell not detected, Symfony shell completion only supports "bash").
  • admin:user:change-password ... add check password length
  • cms:block:toggle ... add suggestions
  • customer:change-password ... dont break for short passwords, ask again
  • db:create ... dont break for short passwords, ask again
  • dev:code:model:method ... does not work for eav (catalog/product, ...)
  • eav:attribute:create-dummy-values ... error displayed, but works

Errors

  • open-browser
  • script

@cmuench
Copy link
Member

cmuench commented May 19, 2023

@sreichel I tested the installation on my local machine and it works in the provided ddev environment. Currently I don't know why it's failing in CI.
Did the install fail on your machine?

@sreichel
Copy link
Collaborator Author

@cmuench package download does not work for me too. Install dir magento is created with subdir vendor/compoer, but there are no magento files ...

In InstallCommand.php line 1046:
                                                                                                   
  Installation failed (Exit code 1). Could not open input file: /var/www/html/magento/install.php  

@cmuench
Copy link
Member

cmuench commented May 20, 2023

@cmuench ok, interesting. We will find the issue :-)

@cmuench
Copy link
Member

cmuench commented May 20, 2023

@sreichel I can reproduce it! That's good.

@cmuench
Copy link
Member

cmuench commented May 20, 2023

@sreichel I guess Composer 2.2 is not compatible. I will try to backport the downloader logic from Magerun 2.

@cmuench
Copy link
Member

cmuench commented May 23, 2023

@sreichel I started to backport the installer command.
It requires also the backport of the sub-command logic.
My WIP is pushed to the branch.

The main issue is that the installer of n98-magerun2 works stricly with Composer packages.
The config in the config.yaml looks like this:

  N98\Magento\Command\Installer\InstallCommand:
    magento-packages:
      - name: mage-os-2.4.5-p1
        package: magento/project-community-edition
        version: 2.4.5-p1
        options:
          repository-url: https://mirror.mage-os.org

In n98-magerun1 we have a different structure:

  N98\Magento\Command\Installer\InstallCommand:
    magento-packages:
      - name: openmage-20.0.14
        version: 20.0.14
        dist:
          url: https://github.com/OpenMage/magento-lts/archive/v20.0.14.zip
          type: zip
          shasum: 15172228925d2f03db00712e591f14b15210bea1
        extra:
          sample-data: sample-data-1.9.2.4

Currently we use the internal Composer library to handle that.
Sadly I do not see a good way to call an external Composer binary and feed it with the information of the package.
I could replace the logic with a simple download and extract, but this would break a lot of automations.
If you have a good idea. Let me know.

@sreichel
Copy link
Collaborator Author

sreichel commented May 23, 2023

@cmuench can we use https://github.com/firegento/magento for composer installable packages instead of magento-mirror?

@cmuench
Copy link
Member

cmuench commented May 30, 2023

@sreichel Installer is now working in the Github Actions.
Next a lot of tests have to be fixed.
Currently 43 tests are failing.

@cmuench
Copy link
Member

cmuench commented May 30, 2023

Seems that most of the tests are currently not compatible with the new console "ask" method.

@sreichel
Copy link
Collaborator Author

sreichel commented May 30, 2023

@cmuench thanks for working on this.

Unfortunately my ddev env has some problems ... https://stackoverflow.com/q/76366191/5703627

My changes are very similar to magerun2, may we can reuse some code for unit tests?

@sreichel
Copy link
Collaborator Author

@cmuench we also have to fix sample data intstall.

I can create a repo from @Vinai (or my own) sample data to allow install via composer.

@sreichel
Copy link
Collaborator Author

sreichel commented Jun 1, 2023

Next a lot of tests have to be fixed.

@cmuench Working on this next days. Will also update to phpunit 9.

@alexherbs
Copy link

alexherbs commented Aug 15, 2023

Hello,

i wanted to mention following errors which occured during switching from OpenMage PHP7.4 to PHP8.1, maybe its useful for your checklist (n98-magerun --version: 2.3.0):

2023-08-15T03:32:21+00:00 ERR (3): Deprecated functionality: Return type of N98\Magento\Modules::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/n98-magerun.phar/src/N98/Magento/Modules.php on line 96

2023-08-15T03:32:21+00:00 ERR (3): Deprecated functionality: Return type of N98\Magento\Modules::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/bin/n98-magerun.phar/src/N98/Magento/Modules.php on line 108

2023-08-15T06:05:29+00:00 ERR (3): Deprecated functionality: explode(): Passing null to parameter #2 ($string) of type string is deprecated in phar:///usr/bin/n98-magerun.phar/src/N98/Magento/Command/System/Url/ListCommand.php on line 83

@cmuench
Copy link
Member

cmuench commented Aug 28, 2023

@sreichel Spent some time to fix the tests and already did the upgrade to PHPUnit 9.
I had to skip some tests because too much changed in PHPUnit which needs a lot of more time to refactor.
Most of the tests are running fine.

@cmuench
Copy link
Member

cmuench commented Aug 28, 2023

@sreichel I merged the current state to develop branch. I did this to get the Github Actions running. The old Ubuntu Version in the Github Actions was not supported anymore.

@cmuench
Copy link
Member

cmuench commented Aug 28, 2023

@sreichel Phar build is also fixed and files.magerun.net is updated with the latest dev version if n98-magerun1.
This means that we can now test in a real OpenMage installation. Sadly I have no real OpenMage project to test.

@cmuench
Copy link
Member

cmuench commented Aug 29, 2023

@sreichel sample data "no" should work in the next minutes. Pushed a fix to develop branch.

@cmuench
Copy link
Member

cmuench commented Aug 29, 2023

@sreichel You ask about we can handle the DB port... I used port 3306 in the container in the install command.
This is OK inside the container. The dynamic port numbers are only for the port forwording to the host.
I use the db container and create a separate db for each instance.
That works with the PhpStorm ddev integration plugin without any issue.

@cmuench
Copy link
Member

cmuench commented Aug 29, 2023

@sreichel I added functional tests to the Github Actions. This helps to find issues which cannot be found in the Unit Tests.
We test Magento 1.9 and OpenMage 20.0.20.

@cmuench
Copy link
Member

cmuench commented Aug 30, 2023

@sreichel I will extend the OpenMage Build with a build matrix.
I test it in this PR #1297.
It will also test with MySQL 5.7 and MySQL 8.0

@ADDISON74
Copy link

@sreichel - Could you please allocate some time to complete this checklist? For everyone who uses OpenMage it would be a gift to be able to continue using n98-magerun. We could also add some custom commands to DDEV as you wanted.

@cmuench
Copy link
Member

cmuench commented Sep 25, 2023

@sreichel @ADDISON74 The develop version is already "green" in all tests. Feel free to test it in a real project. I sadly have not any real OpenMage project.

@sreichel
Copy link
Collaborator Author

@ADDISON74 i will update during next days.

@sreichel
Copy link
Collaborator Author

sreichel commented Oct 2, 2023

@cmuench how about to drop support for php < 8.1 for v3?

v2.3 works up to php 8.0, right? We dont need any backward compatibilty and could make use of php 8.1 features.

@sreichel
Copy link
Collaborator Author

sreichel commented Oct 3, 2023

@cmuench work on some cleanup ... (and phpstan L9)

  • do we still need M2 related switches?
  • can we drop EE-related code? EE does not work with php8.

@cmuench
Copy link
Member

cmuench commented Oct 3, 2023

@sreichel thanks for working on the finalization of the release.
About dropping the PHP 7.4 support. We should wait with that. I am very conservative with that. The n98-magerun2 version is still compatible with 7.4.
There are a lot of automatization downloading and executing n98-magerun. We need to plan and announce this.

In the EE command should be a check. We can add a constraint to current the PHP version there and skip the tests

The M2 related switches are to provide a hint if the wrong version is used. I think after 10 years we can remove that.

@sreichel
Copy link
Collaborator Author

sreichel commented Oct 6, 2023

@cmuench do we need to support something below php8.1 for v3?

For php7-8.0 you can still use v2.3.

For a php8.1 release we can update to symfony 6.4.

EE commands can be moved into an add-on. I know there are commands the are EE-only snare disabled for CE, but others that have different behavior inside the command. This causes some problems with phpstan, that can't find EE-related classes.

However ... I have to split my work into smaller PRs ... hope it's okay to not doing it in one big PR.

@cmuench
Copy link
Member

cmuench commented Oct 6, 2023

@sreichel The plan is that the current release is still compatible with the latest Magento Open Source 1.9 with PHP 7.4. Let's bring first the build in production. I want to stay on Symfony LTS releases which is currently 5.4.
Next LTS is 6.4. The 6.3 release will have the EOL soon.

@sreichel
Copy link
Collaborator Author

sreichel commented Oct 6, 2023

Okay. :)

What about EE-commands? Is it fine to move them into a separate repo?

(already removed that code for phpstan and have to revert it ...)

@cmuench
Copy link
Member

cmuench commented Oct 6, 2023

@sreichel They will never be called and registered in OpenMage due to this code:

 public function isEnabled()
 {
     return $this->getApplication()->isMagentoEnterprise();
 }

We can just ignore them and remove the test setup.
I am defensive, because we do not know if someone is still running Magento EE. I guess it's a license problem if someone does.
I am not sure that the best procedure here is. It's also fine to drop the support for Magento EE here.

@sreichel
Copy link
Collaborator Author

sreichel commented Oct 6, 2023

@cmuench i know, but im sure there are commands that work for EE and CE, but have different behavior inside the command. (e.g. create admin user - adding roles)

@cmuench
Copy link
Member

cmuench commented Oct 6, 2023

We can drop support for EE this release. And deprecate then the old Magento CE 1.9 for the next major release.
Than we can prepare the people and make the tool only compatible with OpenMage.

@sreichel
Copy link
Collaborator Author

sreichel commented Oct 6, 2023

Okay ... PRs incoming next days :)

@sreichel
Copy link
Collaborator Author

sreichel commented Oct 6, 2023

@sreichel - Could you please allocate some time to complete this checklist? For everyone who uses OpenMage ...

Maybe some OM users want to join for help? At least with tests?

@sreichel
Copy link
Collaborator Author

@cmuench killed my work with composer require ... ... LOL

I'll try to split my PRs into small chunks ... sorry for extra work, but maybe PRs are much more clear.

@sreichel
Copy link
Collaborator Author

@cmuench think we can close this.

All my changes in pipeline are only code style improvments. No functional changes.

I'll provide updates step by step, but i thinks its ready to make a php81 release.

@cmuench cmuench closed this as completed Oct 22, 2023
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

No branches or pull requests

4 participants