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

Product Comments v6.0.0 unzips incorrectly into the modules folder #33728

Closed
2 tasks done
Julian-Collins opened this issue Aug 26, 2023 · 42 comments · Fixed by PrestaShop/productcomments#181
Closed
2 tasks done
Labels
8.1.x Branch BO Category: Back Office Bug Type: Bug Fixed Resolution: issue closed because fixed Module manager Label: Which BO under menu is concerned Module Module Productcomments Module: productcomments

Comments

@Julian-Collins
Copy link

Prerequisites

Describe the bug and add attachments

I have tried to update the product comments module to v6.0.0 that was released yesterday and its unpacking the payload directing into the modules folder. i.e /modules and keeps repeatedy showing as the update is required

where it should be into /modules/productcomments

It looks like the release file has https://github.com/PrestaShop/productcomments/releases/tag/v6.0.0 not been zipped up correctly as its not got the directory structure within it

Expected behavior

Updated module should unzip into modules/productcomments

Steps to reproduce

  1. Go into Module Manger
  2. Select Updates
  3. Click Update for Product Comments

PrestaShop version(s) where the bug happened

8.1.1

PHP version(s) where the bug happened

8.1

If your bug is related to a module, specify its name and its version

productcomments v6.0.0

Your company or customer's name goes here (if applicable).

No response

@Julian-Collins Julian-Collins added Bug Type: Bug New New issue not yet processed by QA labels Aug 26, 2023
@leemyongpakvn
Copy link
Contributor

I confirm this problem. The correct release zip must has productcomments folder inside, but this 6.0.0 release does not. Amazingly, the Artifacts zip in Build & Release draft at https://github.com/PrestaShop/productcomments/actions/runs/5951694823 is correct.

@leemyongpakvn leemyongpakvn added the 8.1.x Branch label Aug 26, 2023
@Hlavtox
Copy link
Contributor

Hlavtox commented Aug 27, 2023

@leemyongpakvn Yeah, but the release update workflow is broken and doesn't work. So somebody did it manually - badly.

@matks
Copy link
Contributor

matks commented Aug 27, 2023

In order to un-publish productcomments 6.0.0 from Distribution API I just marked it as "pre-release" in https://github.com/PrestaShop/productcomments/releases/tag/v6.0.0 . It will not be featured by https://api.prestashop-project.org/modules/8.1.1 in one hour, when the cron behind Distribution API refreshes the data.

@matks
Copy link
Contributor

matks commented Aug 27, 2023

The ZIP archive A in https://github.com/PrestaShop/productcomments/releases/tag/v6.0.0 seems correct while the ZIP
archive B downloadable through Distribution API https://api.prestashop-project.org//assets//modules//productcomments//v6.0.0//productcomments.zip seem not.

For example archive B contains tests folder and archive A does not.

Something wrong happened between the GitHub release artifact and Distribution API storing it for download.

@matks
Copy link
Contributor

matks commented Aug 27, 2023

@leemyongpakvn Yeah, but the release update workflow is broken and doesn't work

Indeed #33749

@leemyongpakvn
Copy link
Contributor

@Hlavtox build dependencies & create artifact is OK but update_release_draft is Skipped. I think we can try @M0rgan01 solution in Slack.

@matks
Copy link
Contributor

matks commented Aug 28, 2023

Productcomments 6.0.0 is no more pushed by Distribution API to PS instances https://api.prestashop-project.org/modules/8.1.1

In order to resume pushing, the github release must be modified so it is not pre-release. Please only do this after solving the problem.

@M0rgan01
Copy link
Contributor

I just saw, there are 3 concerns for me:

  • the CI has a problem when building the zip. I created a ticket for this Release drafter not working on zip step #33749
  • the ZIP that I had to create manually must contain a folder. It can be fixed easily
  • The Distribution API did not update the data during my various tries

@leemyongpakvn
Copy link
Contributor

There are 2 steps in Github Build & Release Draft, both of them create zip file.

  • Build dependencies & create artifact is Succeeded.
  • Update Release Draft is Skipped
    GitHub_BuildRelease
    GitHub_BuildArtifacts

@M0rgan01
Copy link
Contributor

Indeed, you can find the zip in the summary of actions (https://github.com/PrestaShop/productcomments/actions/runs/5953972519)

@leemyongpakvn
Copy link
Contributor

@M0rgan01 My screenshots are in case of pre-release, and update_release_draft is skipped.

@M0rgan01
Copy link
Contributor

@leemyongpakvn Yes I saw, but I think even when merging on master I could have retrieved the zip built by the build step if I would have known 👍

@leemyongpakvn
Copy link
Contributor

@M0rgan01 OK. Let's try to fix this issue with productcomments 6.0.1 at PrestaShop/productcomments#181

@M0rgan01
Copy link
Contributor

We are finally obligated to create a new release, 6.0.1, to fix the issue. Even if we manually update the zip file and republish the release, the zip download link will not be updated.

@leemyongpakvn
Copy link
Contributor

leemyongpakvn commented Aug 28, 2023

FYI, at least 3 modules Release that built with current Organization Build & Release but still have correct structure:

  1. https://github.com/PrestaShop/contactform/releases/tag/v4.4.1
  2. https://github.com/PrestaShop/ps_linklist/releases/tag/v6.0.3
  3. https://github.com/PrestaShop/ps_languageselector/releases/tag/v2.1.3
    These releases were built on March and June this year, a few months before Release drafter not working on zip step #33749

@Hlavtox
Copy link
Contributor

Hlavtox commented Aug 28, 2023

@leemyongpakvn I did it manually, that's why it's correct. :-) See https://github.com/PrestaShop/ps_linklist/actions/runs/5354084130

@leemyongpakvn
Copy link
Contributor

leemyongpakvn commented Aug 28, 2023

@Hlavtox I see ;) How about 2 other releases in March ?
Update: never mind ;), those 2 releases were built 2 months before Organizaton Build & Release changed

@leemyongpakvn
Copy link
Contributor

leemyongpakvn commented Aug 28, 2023

@Hlavtox We have clearer information when testing locally in productcomments repo with
https://github.com/PrestaShop/productcomments/actions/runs/6000817427 Annotations:

update_release_draft
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/upload-release-asset@v1.0.2. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/

@leemyongpakvn
Copy link
Contributor

It looks like we need to replace outdated upload-release-asset@v1.0.2 by https://github.com/softprops/action-gh-release

@M0rgan01
Copy link
Contributor

I think the problem comes from the PR PrestaShop/.github#7. When going from actions/download-artifact@v1 to actions/download-artifact@v2, the tree structure changed. See https://github.com/actions/download-artifact/tree/releases/v2#compatibility-between-v1-and-v2. @leemyongpakvn

@hibatallahAouadni hibatallahAouadni added BO Category: Back Office Module manager Label: Which BO under menu is concerned Productcomments Module: productcomments and removed New New issue not yet processed by QA labels Aug 28, 2023
@leemyongpakvn
Copy link
Contributor

@M0rgan01 There are some thoughts, and we must try and fail till success ;) It is still risky with testing locally on productcomments. I see bot has just updated productcomments in https://github.com/PrestaShop/native-modules to v6.0.1. The client had problem with v6.0.0 upgrade, if they do v6.0.1 upgrade, then will be forced to downgrade back to 5.0.3, then they will be upset 😠
So I suggest droping v6.0.1 as soon as possible, and switch to test on a non-native module like https://github.com/PrestaShop/ps_qualityassurance

@matks
Copy link
Contributor

matks commented Aug 28, 2023

Hi @leemyongpakvn you're right to be careful 😉 but if I can reassure you

  • the release git tag is valid ✅ verified
  • the release ZIP archive is valid ✅ verified (@M0rgan01 performed the upgrade on his backoffice, the unzipping was successfull)

@matks
Copy link
Contributor

matks commented Aug 28, 2023

Distribution API now successfully serves productcomments 6.0.1 https://api.prestashop-project.org/modules/8.1.1 and @M0rgan01 was able to successfully install it from the API 😉

@matks
Copy link
Contributor

matks commented Aug 28, 2023

@Julian-Collins Can you retry? The problem should be fixed by release 6.0.1

@hibatallahAouadni hibatallahAouadni added Waiting for author Status: action required, waiting for author feedback NMI Status: issue needs more information labels Aug 28, 2023
@Julian-Collins
Copy link
Author

@matks - Its installs now into the right folder but errors when trying configure

Oops... looks like an unexpected error occurred.

You have requested a non-existent service "product_comment_repository".

[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException 0]

Im doing this on a test clone of my live site so im happy to provide more debug info if you require

@prestashop-issue-bot prestashop-issue-bot bot removed the Waiting for author Status: action required, waiting for author feedback label Aug 28, 2023
@Julian-Collins
Copy link
Author

Stack trace from debug mode:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException:
You have requested a non-existent service "product_comment_repository".

at vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:289
at Symfony\Component\DependencyInjection\Container->make()
(vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Container.php:231)
at Symfony\Component\DependencyInjection\Container->get()
(classes/module/Module.php:3443)
at ModuleCore->get()
(modules/productcomments/productcomments.php:172)
at ProductComments->_postProcess()
(modules/productcomments/productcomments.php:260)
at ProductComments->getContent()
(controllers/admin/AdminModulesController.php:696)
at AdminModulesControllerCore->postProcessCallback()
(controllers/admin/AdminModulesController.php:921)
at AdminModulesControllerCore->postProcess()
(classes/controller/Controller.php:308)
at ControllerCore->run()
(classes/Dispatcher.php:510)
at DispatcherCore->dispatch()
(admin297mwm0l3l8di5fbzkh/index.php:95)

@matks
Copy link
Contributor

matks commented Aug 28, 2023

OK so at least it installs 😄 now it's no more a install process bug, it's a "regular" behavior bug

The missing service product_comment_repository is defined here https://github.com/PrestaShop/productcomments/blob/dev/config/common.yml#L12 🤔 so it's declared. It's strange your PrestaShop is not able to find it. Could you clear the cache in var/cache ?

@leemyongpakvn
Copy link
Contributor

@matks I'm not absolutely sure we fixed issue with productcomments v6.0.1 locally because in its Actions: Build workflow 409 - Failed because update_release_draft job Failed, while Build workflow 410 - Success but update_release_draft job was Skipped.

@Julian-Collins
Copy link
Author

@matks - Clearing the cache made no difference , its still throwing the exception

@Julian-Collins
Copy link
Author

I have managed to get it working again by reseting the module.
This isnt a problem as we havent switched this on but it could be a problem for other users if they loose their user added coments by resetting the module

@matks
Copy link
Contributor

matks commented Aug 29, 2023

@matks I'm not absolutely sure we fixed issue with productcomments v6.0.1 locally because in its Actions: Build workflow 409 - Failed because update_release_draft job Failed, while Build workflow 410 - Success but update_release_draft job was Skipped.

Ah 😄 we dont talk about the same issue.

I talk about the issue "Product Comments v6.0.0 unzips incorrectly into the modules folder": this one is fixed by 6.0.1 . The latest release now correctly unzips.

But I agree there is another issue remaining, the one which created the situation 😉 the problem with the GitHub Action.

@leemyongpakvn
Copy link
Contributor

@matks So we will continue with the remaining issue locally before apply globally in Organization Build&Release ?

@M0rgan01
Copy link
Contributor

@leemyongpakvn We have targeted the problem, which is the update of the download-artifact action. I propose a fix directly on the repository .github PrestaShop/.github#9

@leemyongpakvn
Copy link
Contributor

@M0rgan01 It looks well. @matks Do you agree to test directly on the repository .github or we need to test locally first ? Whatever you choose, we still need a new Release of a native module to test it in action.

@florine2623 florine2623 added the Waiting for dev Status: action required, waiting for tech feedback label Aug 30, 2023
@leemyongpakvn
Copy link
Contributor

@Julian-Collins @florine2623 This issue was solved by PrestaShop/productcomments#186

@Julian-Collins
Copy link
Author

v6.0.2 isnt visible to upgrade to in my modules yet - will check again later

@leemyongpakvn
Copy link
Contributor

@Julian-Collins v6.0.2 is available in Module Updates now.

@Julian-Collins
Copy link
Author

Thanks @leemyongpakvn - I have seen it and updated

@matks
Copy link
Contributor

matks commented Sep 11, 2023

@leemyongpakvn Is the problem solved for all modules or only productcomments?

@matks
Copy link
Contributor

matks commented Sep 11, 2023

If it's fixed for every module 😄 we can close this issue

@leemyongpakvn
Copy link
Contributor

@matks The problem is fixed locally for productcomments first, then apply globally for all modules via Organization .github. Julian-Collins updated productcomments to v6.0.2 and did not report any issue so we can consider it is OK now (it is really OK on my side :).

@matks
Copy link
Contributor

matks commented Sep 11, 2023

Youhou! 🎉

@hibatallahAouadni hibatallahAouadni added Fixed Resolution: issue closed because fixed and removed NMI Status: issue needs more information Waiting for dev Status: action required, waiting for tech feedback labels Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.1.x Branch BO Category: Back Office Bug Type: Bug Fixed Resolution: issue closed because fixed Module manager Label: Which BO under menu is concerned Module Module Productcomments Module: productcomments
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants