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

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