Files
Investidor-V2/tools/portal-functional-country-compatibility-qa.php
nala 287e991486
tests / ci (push) Waiting to run
oportunidades 7
2026-10-13 11:40:29 +02:00

14 lines
2.2 KiB
PHP

<?php
// A changed shared fingerprint is not a reinstallation or a country flag change.
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
$root=dirname(__DIR__);$dir=$root.'/storage/app/private/investmoz-v2/portal-audit';$plan=json_decode(file_get_contents($dir.'/portal-stability-latest.json'),true,512,JSON_THROW_ON_ERROR);
putenv('STABILITY_QA_MODE=consumers');$app=(static fn(string $file)=>require $file)($plan['source'].'/tools/portal-stability-runtime.php');
$proof=DB::transaction(function()use($root):array {
DB::statement('SET TRANSACTION READ ONLY');$service=app(App\Services\OrganizationCountryInstallation::class);
$old=hash('sha256',json_encode(array_map(fn($f)=>[$f,hash_file('sha256',$root.'/'.$f)],$service->files()),JSON_THROW_ON_ERROR));$new=$service->fingerprint();
throw_unless($old==='162daff6ce08117582dd7d796639d02b156d1b940cd85ef3587ff88a65747edd',RuntimeException::class,'Active COUNTRY02 fingerprint changed.');
throw_unless($old!==$new&&config('portal.organization_country_enabled')&&app(App\Services\OrganizationCountry::class)->available()&&DB::table('migrations')->where('migration',App\Services\OrganizationCountryInstallation::MIGRATION)->exists(),RuntimeException::class,'Expected installed QA country compatibility.');
return ['result'=>'passed','at'=>gmdate('c'),'active_current_COUNTRY02_fingerprint'=>$old,'candidate_COUNTRY02_fingerprint'=>$new,'installed_QA'=>true,'country_flag_QA'=>true,'historical_readiness_reuse_permitted'=>false,'effect'=>'Shared PortalProfileAccess fingerprint changes; COUNTRY02 remains installed/enabled, no 050000 reapplication or country schema/data/cipher changes. New installation previews/operation scopes must be refreshed.','new_active_writes'=>0,'full_country_regression_not_repeated'=>true];
});$receipt=in_array('--scope',$argv,true)?'functional-scope-country-compatibility-qa-20261011.json':(in_array('--consolidated',$argv,true)?'functional-consolidated-country-compatibility-qa-20261011.json':'functional-country-compatibility-qa-20261011.json');file_put_contents($dir.'/'.$receipt,json_encode($proof,JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));echo json_encode($proof,JSON_THROW_ON_ERROR).PHP_EOL;