Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
6cf8735
refacto: create backup configuration file and take PS_AUTOUP_KEEP_IMA…
ga-devfront Feb 13, 2026
60bb8c9
refacto: rename upgradeConfiguration to updateConfiguration to follow…
ga-devfront Feb 13, 2026
579e651
fix: cs fixer
ga-devfront Feb 13, 2026
3f92e48
fix: syntax checker and php stan
ga-devfront Feb 13, 2026
fa59088
fix: license header
ga-devfront Feb 13, 2026
815f9bf
fix: cs fixer
ga-devfront Feb 16, 2026
bc1fc3f
fix: phpstan
ga-devfront Feb 16, 2026
390ed83
fix: phpstan
ga-devfront Feb 16, 2026
db102f4
fix: construct visiblity
ga-devfront Feb 16, 2026
988ed22
refacto: moove max files per call into is own config files and make i…
ga-devfront Feb 16, 2026
6c0d3a1
refacto: mooveseconds per call into is own config files and make it c…
ga-devfront Feb 16, 2026
ed73106
refacto: moove max file size zo backup into is own config files and m…
ga-devfront Feb 16, 2026
1cff118
refacto: moove max sql size backup into is own config files and make …
ga-devfront Feb 16, 2026
f7419b9
fix: cs fixer
ga-devfront Feb 16, 2026
0a9b24b
refacto: rename default value array
ga-devfront Feb 16, 2026
9edb394
refacto: rename configurationValidator to UpdateConfigurationValidator
ga-devfront Feb 17, 2026
80700bd
refacto: add validate int and complete validators
ga-devfront Feb 17, 2026
ed5b269
fix: cs fixer
ga-devfront Feb 17, 2026
b8cbbf6
refacto: rename PS_AUTOUP_CUSTOM_MOD_DESACT to DEACTIVATE_NON_NATIVE_…
ga-devfront Feb 17, 2026
0895c44
deprecated: add deprecated tag to a variable
ga-devfront Feb 17, 2026
24c7263
refacto: rename PS_AUTOUP_REGEN_EMAIL to REGENERATE_EMAIL_TEMPLATES
ga-devfront Feb 17, 2026
fa8c2d1
refacto: rename PS_DISABLE_OVERRIDES to DISABLE_OVERRIDES
ga-devfront Feb 17, 2026
1c1700d
fix: issue with backup option controller
ga-devfront Feb 17, 2026
9ea9963
fix: issue with disable override conf
ga-devfront Feb 17, 2026
03070eb
fix: php stan
ga-devfront Feb 17, 2026
98b7626
refacto: rename PS_AUTOUP_KEEP_IMAGES to KEEP_IMAGES
ga-devfront Feb 17, 2026
f2c9f68
refacto: update save type param with abstract instead of arrayCollection
ga-devfront Feb 17, 2026
d7f52d9
refacto: rename function parameter
ga-devfront Feb 18, 2026
30755d4
refacto: refacto CLI config loader
ga-devfront Feb 19, 2026
0aec9f4
refacto: rename configurationValidator on UpgradeContainer to updateC…
ga-devfront Feb 19, 2026
e3b456f
fix: php stan
ga-devfront Feb 19, 2026
580c228
fix: cs fixer
ga-devfront Feb 19, 2026
1753334
fix: cs fixer
ga-devfront Feb 19, 2026
6979eb3
fix: sonar review feedback
ga-devfront Feb 19, 2026
d91d0fe
feat: add restore command options
ga-devfront Feb 19, 2026
fa24526
refacto: processConsoleInputConfiguration command
ga-devfront Feb 20, 2026
35e06e0
refacto: BACKUP_NAME value
ga-devfront Feb 20, 2026
78932d3
refacto: add seconds-per-call configuration for restore command
ga-devfront Feb 20, 2026
03ed4be
fix: feedbacks from review
ga-devfront Feb 20, 2026
0729101
fix: cs fixer
ga-devfront Feb 20, 2026
0a70cd5
feat: add tests
ga-devfront Feb 20, 2026
0a84f48
fix: cs fixer
ga-devfront Feb 20, 2026
83ce790
fix: php unit tests
ga-devfront Feb 23, 2026
7a03f0e
review: rename max-files-per-call to max-files-per-batches
ga-devfront Feb 26, 2026
3a366d8
review: rollback from tertiary to binary condition
ga-devfront Feb 26, 2026
ce00565
review: finish rename max-files-per-call to max-files-per-batch
ga-devfront Feb 26, 2026
e42f18f
review: moove configuration validators into her own package
ga-devfront Feb 26, 2026
ab26b64
review: moove configuration loaders into her own package into parameters
ga-devfront Feb 26, 2026
4f5f601
review: rename seconds-per-call to max-seconds-per-batch
ga-devfront Feb 26, 2026
9e5133e
review: rename max-file-size to max-file-size-allowed
ga-devfront Feb 26, 2026
68f639e
review: rename max-sql-size-to-write-per-call to max-sql-size-to-writ…
ga-devfront Feb 26, 2026
05d0057
review: using class instead of task type inside loaders
ga-devfront Feb 26, 2026
2e3761b
fix: cs fixer
ga-devfront Feb 26, 2026
753092c
review: add UpgradeContainer for initialize parameter for configurati…
ga-devfront Feb 26, 2026
700b373
review: update AbstractConfigurationLoader constructor to not have th…
ga-devfront Feb 26, 2026
b8d284e
fix: cs fixer
ga-devfront Feb 26, 2026
82346a6
fix: php stan issues
ga-devfront Feb 26, 2026
1750562
fix: remove cash from container configurations
ga-devfront Mar 3, 2026
e46bfd3
fix: error on analytics track at end of update
ga-devfront Mar 4, 2026
04fb70e
fix: delete configuration at end of backup and restore task
ga-devfront Mar 4, 2026
471e934
fix: tests after remove cache from container configurations files
ga-devfront Mar 4, 2026
4efff6c
fix: update ui test package lock
ga-devfront Mar 6, 2026
b32f3ba
fix: bool parameter validation for update configuration
ga-devfront Mar 9, 2026
bf96004
fix: cs fixer
ga-devfront Mar 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/upgrade-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ jobs:
\"channel\":\"${{ matrix.UPGRADE_CHANNEL }}\",
\"archive_zip\":\"prestashop_${{ matrix.PS_VERSION_END }}.zip\",
\"archive_xml\":\"prestashop_${{ matrix.PS_VERSION_END }}.xml\",
\"PS_AUTOUP_CUSTOM_MOD_DESACT\":\"true\",
\"disable_non_native_modules\":\"true\",
\"PS_AUTOUP_CHANGE_DEFAULT_THEME\":\"false\",
\"PS_AUTOUP_KEEP_IMAGES\":\"true\",
\"PS_DISABLE_OVERRIDES\":\"true\"
\"keep_images\":\"true\",
\"disable_overrides\":\"true\"
}' > modules/autoupgrade/config.json"

- name: Update online
Expand Down
44 changes: 24 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ Here is an example of the different fields that can be found in it:
"channel": "local",
"archive_zip": "prestashop_8.0.0.zip",
"archive_xml": "prestashop_8.0.0.xml",
"PS_AUTOUP_CUSTOM_MOD_DESACT": 1,
"disable_non_native_modules": 1,
"PS_AUTOUP_CHANGE_DEFAULT_THEME": 0,
"PS_AUTOUP_REGEN_EMAIL": 1,
"PS_AUTOUP_KEEP_IMAGES": 1,
"PS_DISABLE_OVERRIDES": 1
"regenerate_email_templates": 1,
"keep_images": 1,
"disable_overrides": 1
}
```

Expand Down Expand Up @@ -200,22 +200,26 @@ When using the command line interface (CLI), you can configure the module's beha
parameters directly via CLI. Below is a detailed description of the available parameters, including their data types and
impact.

| Command | Configuration file key | CLI option | Possible Values | Description |
|---------------------------------------------|-----------------------------------------------|--------------------------------|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| `update:start` | `channel` | `--channel` | `online`, `online_recommended` (default), `local` | Defines the update channel to use. The `local` channel requires specific files to be placed in the download folder. |
| `update:start` | `chain` | `--chain` | `true` (default), `false`, `'true'`, `'false'`, `'1'`, `'0'`, `1`, `0`, `'on'`, `'off'` | True by default. Allows you to chain update commands automatically. The command will continue executing subsequent tasks without requiring manual intervention to restart the process. |
| `update:start`, `update:check-requirements` | `archive_zip` | `--zip` | Valid file name | Name of the `ZIP` file to use for an update via the archive channel. This file must be placed in `[your-admin-dir]/autoupgrade/download`. |
| `update:start`, `update:check-requirements` | `archive_xml` | `--xml` | Valid file name | Name of the `XML` file corresponding to the ZIP file for the archive channel. Must also be placed in `[your-admin-dir]/autoupgrade/download`. |
| `update:start` | `PS_AUTOUP_CUSTOM_MOD_DESACT` | `--disable-non-native-modules` | `true` (default), `false`, `'true'`, `'false'`, `'1'`, `'0'`, `1`, `0`, `'on'`, `'off'` | If enabled, disables all non-native modules before the update, reducing the risk of compatibility issues. |
| `update:start` | (DEPRECATED) `PS_AUTOUP_CHANGE_DEFAULT_THEME` | no option available | `true`, `false` (default), `'true'`, `'false'`, `'1'`, `'0'`, `1`, `0`, `'on'`, `'off'` | If enabled, forces the use of the default PrestaShop theme after the update. If disabled, retains the current theme. |
| `update:start` | `PS_AUTOUP_REGEN_EMAIL` | `--regenerate-email-templates` | `true` (default), `false`, `'true'`, `'false'`, `'1'`, `'0'`, `1`, `0`, `'on'`, `'off'` | If enabled, keeps the store's customized email templates. Otherwise, the templates are replaced with the default ones. |
| `update:start` | `PS_DISABLE_OVERRIDES` | `--disable-all-overrides` | `true` (default), `false`, `'true'`, `'false'`, `'1'`, `'0'`, `1`, `0`, `'on'`, `'off'` | If enabled, disables all PHP overrides in PrestaShop, ensuring better compatibility during the update process. |
| `backup:create` | `PS_AUTOUP_KEEP_IMAGES` | `--include-images` | `true` (default), `false`, `'true'`, `'false'`, `'1'`, `'0'`, `1`, `0`, `'on'`, `'off'` | If enabled, retains all images in the backup. This operation can take a long time depending on the storage of your images |
| `backup:restore` | no option available | `--backup` | Valid file name | Specify the backup name to restore. The allowed values can be found with backup:list command) |
| `backup:delete` | no option available | `--backup` | Valid file name | Specify the backup name to delete. The allowed values can be found with backup:list command) |
| `update:check-modules` | no option available | `--channel` | `online`, `online_recommended` (default), `local` | Selects the update channel for module compatibility checks. The `local` channel requires specific files to be placed in the download folder. |
| `update:check-modules` | no option available | `--zip` | Valid file name | Sets the ZIP archive in local mode for module checking. |
| | | | | |
| Command | Configuration file key | CLI option | Possible Values | Description |
|---------------------------------------------|-----------------------------------------------|-------------------------------------|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `update:start` | `channel` | `--channel` | `online`, `online_recommended` (default), `local` | Defines the update channel to use. The `local` channel requires specific files to be placed in the download folder. |
| `update:start` | `chain` | `--chain` | `true` (default), `false`, `'true'`, `'false'`, `'1'`, `'0'`, `1`, `0`, `'on'`, `'off'` | True by default. Allows you to chain update commands automatically. The command will continue executing subsequent tasks without requiring manual intervention to restart the process. |
| `update:start`, `update:check-requirements` | `archive_zip` | `--zip` | Valid file name | Name of the `ZIP` file to use for an update via the archive channel. This file must be placed in `[your-admin-dir]/autoupgrade/download`. |
| `update:start`, `update:check-requirements` | `archive_xml` | `--xml` | Valid file name | Name of the `XML` file corresponding to the ZIP file for the archive channel. Must also be placed in `[your-admin-dir]/autoupgrade/download`. |
| `update:start` | `disable_non_native_modules` | `--disable-non-native-modules` | `true` (default), `false`, `'true'`, `'false'`, `'1'`, `'0'`, `1`, `0`, `'on'`, `'off'` | If enabled, disables all non-native modules before the update, reducing the risk of compatibility issues. |
| `update:start` | (DEPRECATED) `PS_AUTOUP_CHANGE_DEFAULT_THEME` | no option available | `true`, `false` (default), `'true'`, `'false'`, `'1'`, `'0'`, `1`, `0`, `'on'`, `'off'` | If enabled, forces the use of the default PrestaShop theme after the update. If disabled, retains the current theme. |
| `update:start` | `regenerate_email_templates` | `--regenerate-email-templates` | `true` (default), `false`, `'true'`, `'false'`, `'1'`, `'0'`, `1`, `0`, `'on'`, `'off'` | If enabled, keeps the store's customized email templates. Otherwise, the templates are replaced with the default ones. |
| `update:start` | `disable_overrides` | `--disable-all-overrides` | `true` (default), `false`, `'true'`, `'false'`, `'1'`, `'0'`, `1`, `0`, `'on'`, `'off'` | If enabled, disables all PHP overrides in PrestaShop, ensuring better compatibility during the update process. |
| `update:start`, `backup:create` | `max_files_per_batch` | `--max-files-per-batch` | `400` | Number of files to handle in a single call to avoid timeouts |
| `backup:create` | `keep_images` | `--include-images` | `true` (default), `false`, `'true'`, `'false'`, `'1'`, `'0'`, `1`, `0`, `'on'`, `'off'` | If enabled, retains all images in the backup. This operation can take a long time depending on the storage of your images |
| `backup:create` | `max_file_size_allowed` | `--max-file-size-allowed` | `15728640` | Max file size allowed in backup |
| `backup:create` | `max_sql_size_to_write_per_batch` | `--max-sql-size-to-write-per-batch` | `4194304` | Reference for SQL file creation, giving a file size before another request is needed |
| `backup:restore` | `backup_name` | `--backup` | Valid file name | Specify the backup name to restore. The allowed values can be found with backup:list command) |
| `backup:restore` | `max_seconds_per_batch` | `--max-seconds-per-batch` | `6` | Number of seconds allowed before having to make another request |
| `backup:delete` | no option available | `--backup` | Valid file name | Specify the backup name to delete. The allowed values can be found with backup:list command) |
| `update:check-modules` | no option available | `--channel` | `online`, `online_recommended` (default), `local` | Selects the update channel for module compatibility checks. The `local` channel requires specific files to be placed in the download folder. |
| `update:check-modules` | no option available | `--zip` | Valid file name | Sets the ZIP archive in local mode for module checking. |
| | | | | |

### Back Office Environment Variables

Expand Down
2 changes: 1 addition & 1 deletion _dev/src/ts/appUI/dialogs/StartBackupDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class StartBackupDialog extends DialogAbstract {
await api.post(form.dataset.routeToSubmit!, new FormData(form));

analytics.track('[SUE] Backup configured', {
backup_images: !!dataOptions.get('PS_AUTOUP_KEEP_IMAGES')
backup_images: !!dataOptions.get('keep_images')
});

this.dispatchDialogContainerOkEvent(event);
Expand Down
6 changes: 3 additions & 3 deletions _dev/src/ts/appUI/pages/UpdatePageUpdateOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ export default class UpdatePageUpdateOptions extends StepPage {
const data = new FormData(this.#form);

analytics.track('[SUE] Update options configured', {
disable_all_overrides: !!data.get('PS_DISABLE_OVERRIDES'),
disable_non_native_modules: !!data.get('PS_AUTOUP_CUSTOM_MOD_DESACT'),
regenerate_customized_email_templates: !!data.get('PS_AUTOUP_REGEN_EMAIL')
disable_all_overrides: !!data.get('disable_overrides'),
disable_non_native_modules: !!data.get('disable_non_native_modules'),
regenerate_customized_email_templates: !!data.get('regenerate_email_templates')
});

await api.post(this.#form.dataset.routeToSubmit!, data);
Expand Down
16 changes: 8 additions & 8 deletions classes/AjaxResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace PrestaShop\Module\AutoUpgrade;

use PrestaShop\Module\AutoUpgrade\Log\Logger;
use PrestaShop\Module\AutoUpgrade\Parameters\UpgradeConfiguration;
use PrestaShop\Module\AutoUpgrade\Parameters\UpdateConfiguration;
use PrestaShop\Module\AutoUpgrade\State\AbstractState;

/**
Expand Down Expand Up @@ -63,9 +63,9 @@ class AjaxResponse
const RESPONSE_FORMAT = 'json';

/**
* @var UpgradeConfiguration
* @var UpdateConfiguration
*/
private $upgradeConfiguration;
private $updateConfiguration;

/**
* @var Logger
Expand Down Expand Up @@ -101,7 +101,7 @@ public function getResponse(): array
$this->state->export(),
[
'typeResult' => self::RESPONSE_FORMAT,
'config' => $this->upgradeConfiguration->toArray(),
'config' => $this->updateConfiguration->toArray(),
]
),
];
Expand Down Expand Up @@ -145,9 +145,9 @@ public function getNextParams(): array
return $this->nextParams;
}

public function getUpgradeConfiguration(): UpgradeConfiguration
public function getUpdateConfiguration(): UpdateConfiguration
{
return $this->upgradeConfiguration;
return $this->updateConfiguration;
}

// SETTERS
Expand Down Expand Up @@ -183,9 +183,9 @@ public function setNextParams(array $nextParams): AjaxResponse
return $this;
}

public function setUpgradeConfiguration(UpgradeConfiguration $upgradeConfiguration): AjaxResponse
public function setUpdateConfiguration(UpdateConfiguration $updateConfiguration): AjaxResponse
{
$this->upgradeConfiguration = $upgradeConfiguration;
$this->updateConfiguration = $updateConfiguration;

return $this;
}
Expand Down
16 changes: 12 additions & 4 deletions classes/Analytics.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@

namespace PrestaShop\Module\AutoUpgrade;

use PrestaShop\Module\AutoUpgrade\Parameters\UpgradeConfiguration;
use PrestaShop\Module\AutoUpgrade\Parameters\BackupConfiguration;
use PrestaShop\Module\AutoUpgrade\Parameters\UpdateConfiguration;
use PrestaShop\Module\AutoUpgrade\State\RestoreState;
use PrestaShop\Module\AutoUpgrade\State\UpdateState;

Expand All @@ -48,10 +49,15 @@ class Analytics
private $properties;

/**
* @var UpgradeConfiguration
* @var UpdateConfiguration
*/
private $updateConfiguration;

/**
* @var BackupConfiguration
*/
private $backupConfiguration;

/**
* @var array{'restore': RestoreState, 'update': UpdateState}
*/
Expand All @@ -67,13 +73,15 @@ class Analytics
* @param array{'restore': RestoreState, 'update': UpdateState} $states
*/
public function __construct(
UpgradeConfiguration $updateConfiguration,
UpdateConfiguration $updateConfiguration,
BackupConfiguration $backupConfiguration,
Environment $environment,
array $states,
string $anonymousUserId,
array $options
) {
$this->updateConfiguration = $updateConfiguration;
$this->backupConfiguration = $backupConfiguration;
$this->states = $states;

$this->anonymousId = $anonymousUserId;
Expand Down Expand Up @@ -122,7 +130,7 @@ public function getProperties($type): array
switch ($type) {
case self::WITH_BACKUP_PROPERTIES:
$additionalProperties = [
'backup_images' => $this->updateConfiguration->shouldBackupImages(),
'backup_images' => $this->backupConfiguration->shouldBackupImages(),
];
$upgradeProperties = $this->properties[self::WITH_BACKUP_PROPERTIES] ?? [];
$additionalProperties = array_merge($upgradeProperties, $additionalProperties);
Expand Down
Loading
Loading