arobirosa / areco-deployment-script-manager

Simple but powerful Patch system for SAP Commerce Cloud (hybris)
Apache License 2.0
12 stars 5 forks source link

Show areco scripts which are pending execution #23

Closed arobirosa closed 1 year ago

arobirosa commented 1 year ago

Is your feature request related to a problem?

If a areco script has an error, the programmers don't know what arecos coming after that one weren't executed.

Describe the solution you'd like

All arecos which will be executed after the error is solved are stored with the status 'PENDING'.

Describe alternatives you've considered

To show the list of pending arecos in a log message.

Additional context Mone

DevPJ9 commented 1 year ago

Hello @arobirosa I would like to work on this.

arobirosa commented 1 year ago

Hi @DevPJ9 ,

great to hear that! Do you already how to implement the solution? Do you would like to discuss it together? Let me know. We could describe the solution on this ticket and then create the pull request.

What version of SAP commerce would you like to use for developing?

Do I need to give you any special permissions?

Thanks for helping!

DevPJ9 commented 1 year ago

Hello @arobirosa. Thanks for considering my request.

No, I am a bit confused about the requirement , do we have to assign pending arecos "PENDING" status or we just have to log it? I would appreciate some guidance during the implementation of this.

I am not sure about SAP commerce version, not worked with it.

No special permissons are needed as of now, we can discuss it later depending on the requirements as we discuss the solution.

Thanks.

arobirosa commented 1 year ago

Hi @DevPJ9 ,

I will upgrade the project to SAP commerce 2205.

I believe that a solution could be that DeploymentScriptFinder creates new script executions with status PENDING (new status). Then DeploymentScriptRunner takes these script executions and runs them. If the directory with the areco was removed from disk, the execution script is saved with the status REMOVED_ON_DISK (new status).

Please check if this solution is possible.

Cheers!

DevPJ9 commented 1 year ago

ok, sure. I will look into it and let you if I get stuck.

arobirosa commented 1 year ago

The solution is more complex than what I thought. This ticket is not suitable for contributors.

arobirosa commented 1 year ago

This change solves an issue when running arecos which remove CMSComponents: The method de.hybris.platform.cms2.servicelayer.interceptor.impl.CMSAbstractComponentRemoveInterceptor#onRemove try to save all models including the script execution models which are just created. This makes the areco fail.

If the script execution models are saved by the runner with the status pending, this bug is solved.

Workaround for the older versions of Areco deployment manager: The method org.areco.ecommerce.deploymentscripts.core.impl.ArecoDeploymentScriptsRunner#run sets the status "error" to the script execution model and saves it before the call "aScript.run()".

arobirosa commented 1 year ago

Hi @DevPJ9,

Because this ticket solves a bug found on Friday, I want to ask you if I can start working on it on Friday.

Thanks a lot!

DevPJ9 commented 1 year ago

Hello @arobirosa. Yes, As you mentioned it requires a good knowledge of SAP technologies and I am working on windows not Linux as well so I think I will not be able to contribute to this task.

arobirosa commented 1 year ago

Hi @DevPJ9 ,

I will assign this ticket to me.

Under Windows isn't possible to develop with SAP commerce because the path of some files is too long. You must use a VM with linux or a machine with MacOS.

Thanks a lot!

arobirosa commented 1 year ago

I commited and reverted an integration test to try to reproduce the error with the CMSAbstractComponentRemoveInterceptor. It was not possible.

I will continue with the implementation of this ticket.

arobirosa commented 1 year ago

Now the deployment scripts which weren't executed because one failed which are in the same hybris extension are shown in backoffice. The deployment manager won't generate the "pending" executions across all extensions because this requires a big refactoring of the script runner and most of the projects only have one extension with deployment scripts.

This technical limitation was documented here