update project
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Support\Release;
|
||||
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
final class ReleaseReadinessGate
|
||||
{
|
||||
public function evaluate(): array
|
||||
{
|
||||
$required = config('release_readiness.required_artifacts', []);
|
||||
$missing = [];
|
||||
|
||||
foreach ($required as $path) {
|
||||
if (! File::exists(base_path($path))) {
|
||||
$missing[] = $path;
|
||||
}
|
||||
}
|
||||
|
||||
$expiredFlags = [];
|
||||
foreach ((new FeatureFlagRegistry())->all() as $flag) {
|
||||
if ($flag->removalTarget !== null && strtotime($flag->removalTarget) !== false && strtotime($flag->removalTarget) < time()) {
|
||||
$expiredFlags[] = $flag->key;
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'status' => empty($missing) && empty($expiredFlags) ? 'pass' : 'fail',
|
||||
'missing_artifacts' => $missing,
|
||||
'expired_flags' => $expiredFlags,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user