commit melhorias compras5
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-22 19:39:09 +02:00
parent 36dcfdf00c
commit db1615fac1
79 changed files with 4082 additions and 120 deletions
+20 -3
View File
@@ -15,7 +15,14 @@ if (in_array('--refresh-running-preview', $argv, true)) {
|| ! is_file($private.'/settings.json')) {
throw new LogicException('Private review identity mismatch.');
}
$candidate = storage_path('framework/testing/sgc-distribution-integrated-qa-20261122');
$candidateRelative = 'storage/framework/testing/sgc-distribution-integrated-qa-20261122';
if (in_array('--candidate', $argv, true)) {
$candidateRelative = $argv[array_search('--candidate', $argv, true) + 1] ?? '';
}
if (! preg_match('~^storage/framework/testing/[A-Za-z0-9_-]+$~D', $candidateRelative)) {
throw new LogicException('Only an explicit private candidate can refresh this review.');
}
$candidate = base_path($candidateRelative);
$expected = $argv[array_search('--refresh-running-preview', $argv, true) + 1] ?? '';
if (! preg_match('/^[a-f0-9]{64}$/D', $expected) || hash_file('sha256', $candidate.'/manifest.json') !== $expected) {
throw new LogicException('Explicit validated private manifest hash required.');
@@ -58,8 +65,18 @@ $private = 'C:/laragon/data/sgf-tempo/qa/distribution-visual-'.$database;
if (! mkdir($private.'/public', 0700, true) && ! is_dir($private.'/public')) {
throw new RuntimeException('Private review directory creation failed.');
}
$candidate = storage_path('framework/testing/sgc-distribution-integrated-qa-20261122');
if (hash_file('sha256', $candidate.'/manifest.json') !== '1edb9ab0aa62fcf4e9c9075ce6e405de5435dc8ea4799d1949535a96c718df4e') {
$candidateRelative = 'storage/framework/testing/sgc-distribution-integrated-qa-20261122';
$candidateHash = '1edb9ab0aa62fcf4e9c9075ce6e405de5435dc8ea4799d1949535a96c718df4e';
if (in_array('--candidate', $argv, true)) {
$position = array_search('--candidate', $argv, true);
$candidateRelative = $argv[$position + 1] ?? '';
$candidateHash = $argv[$position + 2] ?? '';
}
if (! preg_match('~^storage/framework/testing/[A-Za-z0-9_-]+$~D', $candidateRelative) || ! preg_match('/^[a-f0-9]{64}$/D', $candidateHash)) {
throw new LogicException('Explicit private candidate path and hash required.');
}
$candidate = base_path($candidateRelative);
if (hash_file('sha256', $candidate.'/manifest.json') !== $candidateHash) {
throw new RuntimeException('The private candidate differs from the validated build.');
}
(new Filesystem)->copyDirectory($candidate, $private.'/public/build');