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

Finish Migrating Catalog > Attributes & Features > Attribute Group > Add / edit attribute value #33126

Closed
1 of 5 tasks
MatShir opened this issue Jul 6, 2023 · 4 comments · Fixed by #32475
Closed
1 of 5 tasks
Assignees
Labels
Attributes Label: Which BO under menu is concerned Feature Type: New Feature migration symfony migration project PR available Solution: issue is being addressed Ready Status: Issue is ready to be worked on

Comments

@MatShir
Copy link
Contributor

MatShir commented Jul 6, 2023

Part of Symfony migration project

Status

In order to finish the migration of this back-office page, we need to:

Todo List:

Unblocking #32475

While working on PR #32475, it was found that a bug in blockwishlist module creates a problem. According to this comment, an exception is thrown when the BO user attempts to delete a Attribute value.

So we cannot migrate the page without fixing this bug in blockwishlist module!

A PR to fix blockwishlist module was submitted here PrestaShop/blockwishlist#226 BUT it could not be tested by QA. This is because when QA team attempts to verify the PR, their tests are hindered by the bug #32844 . The bug #32844 prevents the PR to be validated.

So to sum up, in order to unblock PR #32745

About PR #32475

The PR #32475 aimed to create a new Symfony backoffice page to replace the legacy page "Catalog > Attributes & Features > Add new / edit attribute Group". The new Symfony page should follow the coding standards we have for all Symfony pages while providing the same behavior that the legacy page. It aims to create an equivalent page, but powered by Symfony and Twig :) .

Just like other Symfony pages, the application layer is Symfony + Twig, but it uses Commands and Queries to fetch and modify data. Command and Query Handlers are adapters that do rely on legacy.

What you must do for PR #32475 is to fetch it

  • Verify it is correct (for you), if not please fix wrong items you have found
  • Have it reviewed (and approved) by committers
  • The QA will not test it: they will test the last PR (see below)

About the last PR

First Todo List items will be done by multiple PRs merged into develop. So the work of "create a new Symfony page that provides the same behavior/features as the legacy page" will be carried out BUT it is done on a Symfony page not accessible yet in the backoffice. You can browse it if you know the URL. It's like it's hidden.

In order to "finish" the job, a last PR is needed: this is the PR which removes legacy files and enables the LegacyLinks that will redirect old URLs to the new page. So the new Symfony page replaces the legacy page in the back-office. When this is done, the migration is complete.

It is possible QA will find problems when testing the last PR: behaviors that used to work with the legacy page and are not working / implemented in the Symfony page. Then you must fix them.

Please ask @MatShir if you have questions about the behavior or @matks if you have questions about the code

@MatShir MatShir added Feature Type: New Feature Attributes Label: Which BO under menu is concerned migration symfony migration project Ready Status: Issue is ready to be worked on labels Jul 6, 2023
@prestonBot prestonBot added the PR available Solution: issue is being addressed label Jul 6, 2023
@MatShir MatShir added this to Backlog in Symfony Migration via automation Jul 10, 2023
@MatShir MatShir moved this from Backlog to To do in Symfony Migration Jul 10, 2023
@matks matks changed the title Catalog > Attributes & Features > Attribute Group > Add / edit attribute value Finish Migrating Catalog > Attributes & Features > Attribute Group > Add / edit attribute value Jul 27, 2023
@matks
Copy link
Contributor

matks commented Jul 27, 2023

Note: if I am not wrong when the 3 issues
#10510
#10508
#33126
will be completed, the whole Tab "Catalog > Attributes & Features > Attribute Group" will have been migrated 👍

@matks
Copy link
Contributor

matks commented Jul 27, 2023

Check-List (copied from #13989) to help verify new Symfony page is ready

Controller / template

  • All controller actions are migrated and protected with @AdminSecurity annotations when eligible and @DemoRestricted annotations when eligible
  • All links targeting this page are updated: either using _legacy_link or updating the code
  • The new SF routes have _legacy_link and _legacy_parameters provided and explained
  • Controller catches Domain Exception and translate them nicely
  • Twig templates must contain relevant blocks to allow partial extension by modules
  • JS being used on the page can be used as enabled extensions and use a PageMap for selectors
Conventions
  • The new controller actions comply with our naming convention
  • The new SF routes names and paths comply with our naming convention
  • The new Twig template names comply actions with our naming convention
  • Created files (controller, JS assets, CSS assets and twig views) must be in the right folder following the convention
  • CSS being added must follow theme conventions

Core

  • Commands and Queries only use native types but internally use VOs
  • All Handlers must have an Interface
Conventions
  • The created SF service names comply with our naming convention
  • The created files must follow the folder convention (Domain, Core, Adapter...)

Polishing

  • The legacy controller and templates files are gone
  • If PR includes a new concept/mechanism, documentation must be written
  • JS and CSS assets must be compiled and up-to-date
  • License headers must be up-to-date
  • New hooks have been added to the hooks list and the SQL updates
  • Performance must be correct: page loading time, filtering/sorting/searching response time, actions response time

Testing

  • Commands and Queries are tested with Behat tests
  • Eligible Core classes are covered with unit tests*
  • Controller is covered with survival test
  • (soon) Controller is covered with E2E tests using puppeeter
  • If we break E2E tests because IDs change, we must update the E2E tests

*Eligible = easy to isolate and unit tests provide values (for example testing getters/setters is useless)

@lartist lartist self-assigned this Aug 3, 2023
@matks
Copy link
Contributor

matks commented Aug 28, 2023

Thanks to @lartist the situation with module blockwishlist has been fixed. It does not block anymore the PR since version 3.0.1 .

Now we can continue PR #32475 : Verify it is correct (if not fix wrong items found), have it reviewed (and approved) by committers.

@matthieu-rolland matthieu-rolland self-assigned this Sep 14, 2023
@WahbiPS
Copy link

WahbiPS commented Nov 23, 2023

Not the priority for the moment

Symfony Migration automation moved this from To do to Done Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attributes Label: Which BO under menu is concerned Feature Type: New Feature migration symfony migration project PR available Solution: issue is being addressed Ready Status: Issue is ready to be worked on
Projects
Development

Successfully merging a pull request may close this issue.

6 participants