chore(config): snapshot stage focus defaults
deploy-preland / deploy zoomstage.online (push) Skipped
deploy-preland / deploy zoompixel.online (push) Successful in 31s
deploy-preland / deploy zoompixel.ru (push) Successful in 37s
deploy-preland / deploy barbariskatest (push) Failing after 5m1s

This commit is contained in:
Panfilov Konstantin committed 2026-10-17 20:51:44 +03:00
1 parent ac4cc21361
commit a86978a499
3 files changed
+14 -20

No files matched your search

+1 -1
View File
@@ -56,7 +56,7 @@
"1": 0, "1": 0,
"2": 1 "2": 1
}, },
"default": "1" "default": "2"
}, },
"focus": { "focus": {
"weights": { "weights": {
+2 -1
View File
@@ -30,6 +30,7 @@ if (!is_string($query)) {
} }
parse_str($query, $params); parse_str($query, $params);
$config = json_decode((string) file_get_contents(dirname(__DIR__) . '/config.json'), true);
$expected = [ $expected = [
'indpic' => '1', 'indpic' => '1',
'theme' => 'dark', 'theme' => 'dark',
@@ -37,7 +38,7 @@ $expected = [
'registration' => 'after', 'registration' => 'after',
'bchoice' => 'a', 'bchoice' => 'a',
'chb' => 'b', 'chb' => 'b',
'tp' => '1', 'tp' => $config['utm']['tp']['default'] ?? null,
'focus' => 'face', 'focus' => 'face',
'utm_source' => 'stage-ad', 'utm_source' => 'stage-ad',
'subid' => 'click-42', 'subid' => 'click-42',
+11 -18
View File
@@ -17,27 +17,20 @@ $config = is_file($configPath) ? json_decode((string) file_get_contents($configP
if (!is_array($config)) { if (!is_array($config)) {
$failures[] = 'Рабочий config.json должен существовать в корне приленда и содержать валидный JSON.'; $failures[] = 'Рабочий config.json должен существовать в корне приленда и содержать валидный JSON.';
} else { } else {
$expected = [ if (($config['host'] ?? null) !== 'zoomzilla.ru') {
'host' => 'zoomzilla.ru',
'indpic' => ['1' => 1, '2' => 0, 'default' => '1'],
'theme' => ['light' => 0, 'dark' => 1, 'default' => 'dark'],
'degr' => ['1' => 1, '2' => 0, 'default' => '1'],
'registration' => ['before' => 0, 'after' => 1, 'default' => 'after'],
'bchoice' => ['a' => 1, 'b' => 0, 'default' => 'a'],
'chb' => ['a' => 1, 'b' => 0, 'default' => 'b'],
'tp' => ['1' => 0, '2' => 1, 'default' => '1'],
'focus' => ['center' => 0, 'face' => 1, 'default' => 'face'],
];
if (($config['host'] ?? null) !== $expected['host']) {
$failures[] = 'Рабочий config.json обязан направлять загрузку на zoomzilla.ru.'; $failures[] = 'Рабочий config.json обязан направлять загрузку на zoomzilla.ru.';
} }
foreach (array_diff_key($expected, ['host' => true]) as $key => $settings) { $focus = $config['utm']['focus'] ?? null;
$actual = $config['utm'][$key] ?? []; if (($focus['weights'] ?? null) !== ['center' => 0, 'face' => 1]
if (($actual['weights'] ?? null) !== array_diff_key($settings, ['default' => true]) || ($focus['default'] ?? null) !== 'face') {
|| ($actual['default'] ?? null) !== $settings['default']) { $failures[] = 'Рабочий config.json должен фиксировать явно согласованный focus=face.';
$failures[] = "Рабочий config.json должен сохранять stage-настройку UTM {$key}."; }
foreach (['indpic', 'theme', 'degr', 'registration', 'bchoice', 'chb', 'tp'] as $key) {
$setting = $config['utm'][$key] ?? null;
if (!is_array($setting) || !is_array($setting['weights'] ?? null) || !is_string($setting['default'] ?? null)) {
$failures[] = "Рабочий config.json должен хранить валидный stage-снимок UTM {$key}.";
} }
} }
} }