Skip to content

Commit 25defd0

Browse files
committed
AC-6974::Cloud Native S3 Web API test Failures -2.4-develop - Fixed GraphQL testCacheIdHeaderWithCurrency Test
1 parent 99f1f6c commit 25defd0

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

app/code/Magento/GraphQlCache/Setup/ConfigOptionsList.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,22 @@
2020
*/
2121
class ConfigOptionsList implements ConfigOptionsListInterface
2222
{
23+
/**
24+
* Input key for the option
25+
*/
26+
private const INPUT_KEY_SALT = 'id_salt';
27+
28+
/**
29+
* Path to the value in the deployment config
30+
*/
31+
private const CONFIG_PATH_SALT = 'cache/graphql/id_salt';
32+
2333
/**
2434
* @var Random
2535
*/
2636
private $random;
2737

2838
/**
29-
* Deployment configuration
30-
*
3139
* @var DeploymentConfig
3240
*/
3341
private $deploymentConfig;
@@ -51,9 +59,9 @@ public function getOptions(): array
5159
{
5260
return [
5361
new TextConfigOption(
54-
ConfigOptionsListConstants::INPUT_KEY_SALT,
62+
self::INPUT_KEY_SALT,
5563
TextConfigOption::FRONTEND_WIZARD_TEXT,
56-
ConfigOptionsListConstants::CONFIG_PATH_SALT,
64+
self::CONFIG_PATH_SALT,
5765
'GraphQl Salt'
5866
),
5967
];
@@ -65,17 +73,17 @@ public function getOptions(): array
6573
*/
6674
public function createConfig(array $data, DeploymentConfig $deploymentConfig)
6775
{
68-
$currentIdSalt = $this->deploymentConfig->get(ConfigOptionsListConstants::CONFIG_PATH_SALT);
76+
$currentIdSalt = $this->deploymentConfig->get(self::CONFIG_PATH_SALT);
6977

7078
$configData = new ConfigData(ConfigFilePool::APP_ENV);
7179

7280
// Use given salt if set, else use current
73-
$id_salt = $data[ConfigOptionsListConstants::INPUT_KEY_SALT] ?? $currentIdSalt;
81+
$id_salt = $data[self::INPUT_KEY_SALT] ?? $currentIdSalt;
7482

7583
// If there is no salt given or currently set, generate a new one
7684
$id_salt = $id_salt ?? $this->random->getRandomString(ConfigOptionsListConstants::STORE_KEY_RANDOM_STRING_SIZE);
7785

78-
$configData->set(ConfigOptionsListConstants::CONFIG_PATH_SALT, $id_salt);
86+
$configData->set(self::CONFIG_PATH_SALT, $id_salt);
7987

8088
return [$configData];
8189
}

lib/internal/Magento/Framework/Config/ConfigOptionsListConstants.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class ConfigOptionsListConstants
4040
public const CONFIG_PATH_DB_LOGGER_LOG_EVERYTHING = 'db_logger/log_everything';
4141
public const CONFIG_PATH_DB_LOGGER_QUERY_TIME_THRESHOLD = 'db_logger/query_time_threshold';
4242
public const CONFIG_PATH_DB_LOGGER_INCLUDE_STACKTRACE = 'db_logger/include_stacktrace';
43-
public const CONFIG_PATH_SALT = 'cache/graphql/id_salt';
4443
/**#@-*/
4544

4645
/**
@@ -86,7 +85,6 @@ class ConfigOptionsListConstants
8685
public const INPUT_KEY_RESOURCE = 'resource';
8786
public const INPUT_KEY_SKIP_DB_VALIDATION = 'skip-db-validation';
8887
public const INPUT_KEY_CACHE_HOSTS = 'http-cache-hosts';
89-
public const INPUT_KEY_SALT = 'id_salt';
9088
/**#@-*/
9189

9290
/**#@+

0 commit comments

Comments
 (0)