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

Rework of module updates : Introducing Sources and their Providers #850

Merged
merged 15 commits into from
Sep 12, 2024

Conversation

Quetzacoalt91
Copy link
Member

@Quetzacoalt91 Quetzacoalt91 commented Aug 8, 2024

Questions Answers
Description? The current implementation of modules updates has some flaws. Updates from the PrestaShop archive don't have their migration file executed, or can be updated a second time with the Marketplace API. This PR reworks the way we find new updates, by looking at all potential providers at the same time and get the most recent release from them.
Type? new feature
BC breaks? Nope
Deprecations? Nope
Fixed ticket? Candidates are PrestaShop/PrestaShop#36498, PrestaShop/PrestaShop#36567, PrestaShop/PrestaShop#36572 and PrestaShop/PrestaShop#35774.
Sponsor company @PrestaShopCorp
How to test? Modules are now updated from only one source. Either from the marketplace, the PrestaShop archive or when a zip is provided for this specific module.

Current state of logs

No updates

=== Step upgradeModules
Checking updates of module gamification...
Module gamification is up-to-date.
2 modules left to update.

No migration files to run

=== Step upgradeModules
Checking updates of module ps_imageslider...
Module ps_imageslider update files (1.1.0 => 3.1.4) have been fetched from https://api.addons.prestashop.com/?id_module=22320&method=module&version=1.7.8.11.
Content of archive /var/www/html/**admin_folder**/autoupgrade/tmp/ps_imageslider.zip is extracted
Module ps_imageslider does not need to be migrated. Module is up to date.
35 modules left to update.

With migration files

=== Step upgradeModules
Checking updates of module ps_linklist...
Module ps_linklist update files (1.2.0 => 5.0.5) have been fetched from https://api.addons.prestashop.com/?id_module=24360&method=module&version=1.7.8.11.
Content of archive /var/www/html/**admin_folder**/autoupgrade/tmp/ps_linklist.zip is extracted
(1/6) Applying migration file install-1.3.php.
(2/6) Applying migration file install-1.4.php.
(3/6) Applying migration file upgrade-3.0.php.
(4/6) Applying migration file upgrade-4.0.php.
(5/6) Applying migration file upgrade-5.0.php.
(6/6) Applying migration file upgrade-5.0.5.php.
33 modules left to update.

Work in progress:

  • Provider of sources from filesystem
  • Provider of sources from Marketplace
  • Provider of sources from Distribution API Coming in another PR as new feature
  • Provider of sources from Composer (PrestaShop release)

Refacto:

  • Move common code in a new parent class AbstractSourceProvider

@Quetzacoalt91 Quetzacoalt91 self-assigned this Aug 8, 2024
@Quetzacoalt91 Quetzacoalt91 force-pushed the module-sources branch 21 times, most recently from efaf05e to 4795c6c Compare September 4, 2024 08:20
@Quetzacoalt91 Quetzacoalt91 force-pushed the module-sources branch 5 times, most recently from d7acfd8 to 25af9df Compare September 4, 2024 15:56
@Quetzacoalt91 Quetzacoalt91 marked this pull request as ready for review September 4, 2024 16:34
Copy link
Contributor

@AureRita AureRita left a comment

Choose a reason for hiding this comment

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

Hi @Quetzacoalt91

Thank you for your PR, I tested it and it seems to works as you can see :

image

Tested from :
1.7.8.9 to 8.1.7
8.0.5 to 8.1.7
8.1.5 to 8.1.7
8.1.7 to 9.0.0
8.1.5 to 9.0.0
8.0.5 to 9.0.0

All issues are tested on it and corrected

Because the PR seems to works as expected, It's QA ✔️

Thank you

@Quetzacoalt91 Quetzacoalt91 merged commit 37b0b49 into PrestaShop:dev Sep 12, 2024
34 checks passed
@Quetzacoalt91 Quetzacoalt91 deleted the module-sources branch September 12, 2024 12:13
@ps-jarvis
Copy link
Collaborator

PR merged, well done!

Message to @PrestaShop/committers: do not forget to milestone it before the merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants