Skip to content

Commit

Permalink
MAGECLOUD-4407: Remove Deprecated Variables from ECE-Tools (magento#629)
Browse files Browse the repository at this point in the history
  • Loading branch information
BaDos authored and shiftedreality committed Nov 5, 2019
1 parent 1fdfbb1 commit 60790c8
Show file tree
Hide file tree
Showing 42 changed files with 154 additions and 1,105 deletions.
28 changes: 1 addition & 27 deletions dist/.magento.env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@
# SCD_MATRIX: #
# "magento/backend": [] #
#######################################################################################################################
# SCD_EXCLUDE_THEMES - Deprecated use SCD_MATRIX instead. #
# This option does not generate static content for the specified theme location(s). #
# This is helpful when static content deployment occurs during the build/deploy phase. #
# Use commas to separate multiple theme locations. #
# Magento Version: 2.1.4 and later #
# Default value: empty line #
# Stages: global, build and deploy #
# Example: #
# stage: #
# build: #
# SCD_EXCLUDE_THEMES: "magento/luma, magento/my-theme" #
#######################################################################################################################
# SCD_STRATEGY - allows you to customize the deployment strategy for static content. #
# Magento Version: 2.2.0 and later (Magento 2.1.* supports the standard strategy only) #
# Default value: quick #
Expand Down Expand Up @@ -155,21 +143,7 @@
# Example: #
# stage: #
# deploy: #
# CLEAN_STATIC_FILES: false #
#######################################################################################################################
# STATIC_CONTENT_SYMLINK - generates symlinks for static content, unless you disable it #
# using this environment variable. This setting is vital in the Pro Production environment #
# for the three node cluster. When this variable is not set (disabled), it must copy every #
# file during the deployment, which increases deployment time. Setting SCD_ON_DEMAND to true #
# disables this variable. #
# Magento Version: 2.1.4 and later #
# Default value: true #
# Possible values: true or false #
# Stages: deploy #
# Example: #
# stage: #
# deploy: #
# STATIC_CONTENT_SYMLINK: false #
# CLEAN_STATIC_FILES: false # #
#######################################################################################################################
# UPDATE_URLS - on deployment, replace Magento base URLs in the database with project URLs. #
# This is useful for local development, where base URLs are set up for your local environment. #
Expand Down
5 changes: 5 additions & 0 deletions patches.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,5 +238,10 @@
"Avoid group concat from source item indexer": {
">=1.0.3 <1.0.5": "MSI-GH-2515__eliminate_group_concat_from_source_item_indexer__grouped-product-indexer__1.0.3.patch"
}
},
"vertex/module-tax": {
"Fix wrong namespace": {
"3.2.0": "MAGECLOUD-4407__fix_namespace_vertex_tax__3.2.0.patch"
}
}
}
12 changes: 12 additions & 0 deletions patches/MAGECLOUD-4407__fix_namespace_vertex_tax__3.2.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -Naur a/vendor/vertex/module-tax/Model/FlexField/Processor/OrderCurrencyGetterProcessor.php b/vendor/vertex/module-tax/Model/FlexField/Processor/OrderCurrencyGetterProcessor.php
--- a/vendor/vertex/module-tax/Model/FlexField/Processor/OrderCurrencyGetterProcessor.php
+++ b/vendor/vertex/module-tax/Model/FlexField/Processor/OrderCurrencyGetterProcessor.php
@@ -4,7 +4,7 @@
* @author Mediotype https://www.mediotype.com/
*/

-namespace Vertex\Tax\Model\Flexfield\Processor;
+namespace Vertex\Tax\Model\FlexField\Processor;

use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Quote\Api\CartRepositoryInterface;
9 changes: 4 additions & 5 deletions scenario/build/generate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
<item name="300" xsi:type="array">
<item name="config-file-exists" xsi:type="object" priority="100">Magento\MagentoCloud\Config\Validator\Build\ConfigFileExists</item>
<item name="deprecated-ini" xsi:type="object" priority="200">Magento\MagentoCloud\Config\Validator\Build\UnsupportedBuildOptionsIni</item>
<item name="stage-config-deprecated-variables" xsi:type="object" priority="300">Magento\MagentoCloud\Config\Validator\Build\StageConfigDeprecatedVariables</item>
<item name="modules-exists" xsi:type="object" priority="400">Magento\MagentoCloud\Config\Validator\Build\ModulesExists</item>
<item name="appropriate-version" xsi:type="object" priority="500">Magento\MagentoCloud\Config\Validator\Build\AppropriateVersion</item>
<item name="scd-options-ignorance" xsi:type="object" priority="600">Magento\MagentoCloud\Config\Validator\Build\ScdOptionsIgnorance</item>
<item name="ideal-state" xsi:type="object" priority="700">Magento\MagentoCloud\Config\Validator\IdealState</item>
<item name="modules-exists" xsi:type="object" priority="300">Magento\MagentoCloud\Config\Validator\Build\ModulesExists</item>
<item name="appropriate-version" xsi:type="object" priority="400">Magento\MagentoCloud\Config\Validator\Build\AppropriateVersion</item>
<item name="scd-options-ignorance" xsi:type="object" priority="500">Magento\MagentoCloud\Config\Validator\Build\ScdOptionsIgnorance</item>
<item name="ideal-state" xsi:type="object" priority="600">Magento\MagentoCloud\Config\Validator\IdealState</item>
</item>
</argument>
</arguments>
Expand Down
1 change: 0 additions & 1 deletion scenario/deploy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
<item name="appropriate-version" xsi:type="object">Magento\MagentoCloud\Config\Validator\Deploy\AppropriateVersion</item>
<item name="scd-options-ignorance" xsi:type="object">Magento\MagentoCloud\Config\Validator\Deploy\ScdOptionsIgnorance</item>
<item name="deprecated-variables" xsi:type="object">Magento\MagentoCloud\Config\Validator\Deploy\DeprecatedVariables</item>
<item name="raw-env-variable" xsi:type="object">Magento\MagentoCloud\Config\Validator\Deploy\RawEnvVariable</item>
<item name="cloud-variables" xsi:type="object">Magento\MagentoCloud\Config\Validator\Deploy\MagentoCloudVariables</item>
<item name="json-format-variable " xsi:type="object">Magento\MagentoCloud\Config\Validator\Deploy\JsonFormatVariable</item>
<item name="service-version" xsi:type="object">Magento\MagentoCloud\Config\Validator\Deploy\ServiceVersion</item>
Expand Down
36 changes: 0 additions & 36 deletions src/Config/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,6 @@ public function getSchema()
StageConfigInterface::STAGE_DEPLOY => StageConfigInterface::VAR_SCD_THREADS_DEFAULT_VALUE,
],
],
StageConfigInterface::VAR_SCD_EXCLUDE_THEMES => [
self::SCHEMA_TYPE => ['string'],
self::SCHEMA_STAGE => [
StageConfigInterface::STAGE_GLOBAL,
StageConfigInterface::STAGE_BUILD,
StageConfigInterface::STAGE_DEPLOY
],
self::SCHEMA_DEFAULT_VALUE => [
StageConfigInterface::STAGE_BUILD => '',
StageConfigInterface::STAGE_DEPLOY => '',
],
],
StageConfigInterface::VAR_SCD_MAX_EXEC_TIME => [
self::SCHEMA_TYPE => ['integer'],
self::SCHEMA_STAGE => [
Expand Down Expand Up @@ -345,16 +333,6 @@ public function getSchema()
StageConfigInterface::STAGE_DEPLOY => false,
],
],
DeployInterface::VAR_STATIC_CONTENT_SYMLINK => [
self::SCHEMA_TYPE => ['boolean'],
self::SCHEMA_STAGE => [
StageConfigInterface::STAGE_GLOBAL,
StageConfigInterface::STAGE_DEPLOY
],
self::SCHEMA_DEFAULT_VALUE => [
StageConfigInterface::STAGE_DEPLOY => true,
],
],
DeployInterface::VAR_CLEAN_STATIC_FILES => [
self::SCHEMA_TYPE => ['boolean'],
self::SCHEMA_STAGE => [
Expand Down Expand Up @@ -506,18 +484,4 @@ public function getSchema()
]
];
}

/**
* Returns array of deprecated variables.
*
* @return array
*/
public function getDeprecatedSchema()
{
return [
StageConfigInterface::VAR_SCD_EXCLUDE_THEMES => [
self::SCHEMA_REPLACEMENT => StageConfigInterface::VAR_SCD_MATRIX,
],
];
}
}
26 changes: 0 additions & 26 deletions src/Config/Stage/Deploy/EnvironmentConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,13 @@ public function __construct(Environment $environment)
/**
* Resolves environment values with and adds custom mappings.
*
* STATIC_CONTENT_THREADS from MAGENTO_CLOUD_VARIABLES has higher priority then $_ENV['STATIC_CONTENT_THREADS']
* Raw $_ENV['STATIC_CONTENT_THREADS'] is deprecated.
*
* @return array
*/
public function getAll(): array
{
$variables = $this->convertEnabledDisabledVariables($this->environment->getVariables());
$variables = $this->convertIntegerVariables($variables);

if (isset($variables['STATIC_CONTENT_EXCLUDE_THEMES'])) {
$variables[DeployInterface::VAR_SCD_EXCLUDE_THEMES] = $variables['STATIC_CONTENT_EXCLUDE_THEMES'];
unset($variables['STATIC_CONTENT_EXCLUDE_THEMES']);
}

if (isset($variables[DeployInterface::VAR_VERBOSE_COMMANDS]) &&
!in_array($variables[DeployInterface::VAR_VERBOSE_COMMANDS], ['-v', '-vv', '-vvv'])
) {
Expand All @@ -71,7 +63,6 @@ private function convertEnabledDisabledVariables(array $variables): array

$disabledFlow = [
DeployInterface::VAR_CLEAN_STATIC_FILES,
DeployInterface::VAR_STATIC_CONTENT_SYMLINK,
DeployInterface::VAR_UPDATE_URLS,
DeployInterface::VAR_GENERATED_CODE_SYMLINK,
];
Expand All @@ -82,12 +73,6 @@ private function convertEnabledDisabledVariables(array $variables): array
}
}

if (isset($variables[DeployInterface::VAR_DO_DEPLOY_STATIC_CONTENT])) {
$variables[DeployInterface::VAR_SKIP_SCD] =
$variables[DeployInterface::VAR_DO_DEPLOY_STATIC_CONTENT] === Environment::VAL_DISABLED;
unset($variables[DeployInterface::VAR_DO_DEPLOY_STATIC_CONTENT]);
}

return $variables;
}

Expand All @@ -101,17 +86,6 @@ private function convertEnabledDisabledVariables(array $variables): array
*/
private function convertIntegerVariables(array $variables): array
{
if (isset($variables[DeployInterface::VAR_STATIC_CONTENT_THREADS])) {
$envScdThreads = $variables[DeployInterface::VAR_STATIC_CONTENT_THREADS];
unset($variables[DeployInterface::VAR_STATIC_CONTENT_THREADS]);
} else {
$envScdThreads = $this->environment->getEnv(DeployInterface::VAR_STATIC_CONTENT_THREADS);
}

if (ctype_digit($envScdThreads)) {
$variables[DeployInterface::VAR_SCD_THREADS] = (int)$envScdThreads;
}

foreach ([DeployInterface::VAR_SCD_THREADS, DeployInterface::VAR_SCD_COMPRESSION_LEVEL] as $varName) {
if (isset($variables[$varName])) {
if (!is_int($variables[$varName]) && !ctype_digit($variables[$varName])) {
Expand Down
15 changes: 0 additions & 15 deletions src/Config/Stage/DeployInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ interface DeployInterface extends StageConfigInterface
const VAR_UPDATE_URLS = 'UPDATE_URLS';
const VAR_FORCE_UPDATE_URLS = 'FORCE_UPDATE_URLS';

/**
* @deprecated will not be supported in the future
*/
const VAR_STATIC_CONTENT_SYMLINK = 'STATIC_CONTENT_SYMLINK';

/**
* The variable responsible to set lock provider for Magento 2.2.5 and higher.
*/
Expand All @@ -52,16 +47,6 @@ interface DeployInterface extends StageConfigInterface
*/
const VAR_GENERATED_CODE_SYMLINK = 'GENERATED_CODE_SYMLINK';

/**
* @deprecated use SCD_THREADS instead
*/
const VAR_STATIC_CONTENT_THREADS = 'STATIC_CONTENT_THREADS';

/**
* @deprecated use SKIP_SCD instead
*/
const VAR_DO_DEPLOY_STATIC_CONTENT = 'DO_DEPLOY_STATIC_CONTENT';

/**
* The variable responsible for enabling google analytics in environments other than prod.
*/
Expand Down
5 changes: 0 additions & 5 deletions src/Config/StageConfigInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ interface StageConfigInterface
const VAR_SCD_MATRIX = 'SCD_MATRIX';
const VAR_X_FRAME_CONFIGURATION = 'X_FRAME_CONFIGURATION';

/**
* @deprecated use SCD_MATRIX instead.
*/
const VAR_SCD_EXCLUDE_THEMES = 'SCD_EXCLUDE_THEMES';

/**
* Environment variables.
*/
Expand Down
1 change: 0 additions & 1 deletion src/Config/Validator/Build/ScdOptionsIgnorance.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public function validate(): Validator\ResultInterface
$scdVariables = [
StageConfigInterface::VAR_SCD_STRATEGY,
StageConfigInterface::VAR_SCD_THREADS,
StageConfigInterface::VAR_SCD_EXCLUDE_THEMES,
];
$configuredScdVariables = [];

Expand Down
90 changes: 0 additions & 90 deletions src/Config/Validator/Build/StageConfigDeprecatedVariables.php

This file was deleted.

Loading

0 comments on commit 60790c8

Please sign in to comment.