-
Notifications
You must be signed in to change notification settings - Fork 119
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
Update lifecycle of state and configuration files #1117
Update lifecycle of state and configuration files #1117
Conversation
Quetzacoalt91
commented
Jan 14, 2025
Questions | Answers |
---|---|
Description? | Make sure the state is only defined while a process is run (update / backup / restore) and rely on the configuration class for the rest of the module use. |
Type? | Refacto |
BC breaks? | Nope |
Deprecations? | Nope |
Fixed ticket? | / |
Sponsor company | @PrestaShopCorp |
How to test? |
|
@@ -88,7 +88,11 @@ protected function execute(InputInterface $input, OutputInterface $output): ?int | |||
|
|||
$this->upgradeContainer->initPrestaShopAutoloader(); | |||
$this->upgradeContainer->initPrestaShopCore(); | |||
$this->upgradeContainer->getUpdateState()->initDefault($this->upgradeContainer->getProperty(UpgradeContainer::PS_VERSION), $this->upgradeContainer->getUpgrader()->getDestinationVersion()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need the state for the check of requirements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify why ? The objective is to not have the state anymore outside the actual process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we go to the UpgradeSelfCheck class and look for occurrences of the state, we can see that this one is used.
The objective is to not have the state anymore outside the actual process
Can you define "process"? Isn't the requirements check a process in itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The process running the tasks is a part of the (update) funnel. By having the state outside the process applying changes on the store, we struggle to clean the previous context properly in case of error.
Thanks for the class, I'll have a look at it as well.
cc959e9
to
f8c5489
Compare
edbcce1
to
f22cf1a
Compare
f22cf1a
to
ff01cb2
Compare
Quality Gate passedIssues Measures |
Hello @Quetzacoalt91, I tested your PR and it's good for me ! 🎉 Thanks! 8.1.7 → 8.2 |