feat: replace chb with consent groups and preserve runtime config (api#317, #17)
deploy-preland / deploy zoomstage.online (push) Successful in 42s

This commit is contained in:
Panfilov Konstantin committed 2026-10-24 04:35:44 +03:00
1 parent 188b78a115
commit 89cc16eb4a
12 files changed
+208 -9

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
<?php
/** preland#17: consent-конфиг мигрируется после совместимого кода, без замены runtime-снимком. */
declare(strict_types=1);
$root=dirname(__DIR__);$workflow=file_get_contents($root.'/.gitea/workflows/deploy.yml');
$upload=strpos($workflow,'- name: Upload over SFTP');$patch=strpos($workflow,'- name: Migrate consent UTM in preserved host config');
if($upload===false||$patch===false||$patch<$upload)throw new RuntimeException('Consent config patch должен выполняться после совместимого кода.');
$section=substr($workflow,$patch,strpos($workflow,'- name: Check the page',$patch)-$patch);
foreach(['get -p $REMOTE_DIR/config.json','ensure-cons-config.php','config.json.upload-$revision','rename $REMOTE_DIR/config.json.upload-$revision']as$expected){if(!str_contains($section,$expected))throw new RuntimeException('Отсутствует безопасный этап: '.$expected);}
if(str_contains($section,'put -p config.json '))throw new RuntimeException('Снимок Git не должен заменять runtime config.');
echo "PASS: consent config patch follows compatible code and uses atomic targeted replacement\n";