mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 20:14:45 +00:00
Merge remote-tracking branch 'origin/next' into v5-parallel-inertia-react
This commit is contained in:
commit
a2fc08a7b3
36 files changed
+305
-966
No files matched your search
@@ -95,6 +95,6 @@ it('ensures docker_compose_raw update is wrapped in try-catch for error handling
|
||||
->toContain('// This keeps the original user input clean while preventing content reapplication')
|
||||
->toContain('try {')
|
||||
->toContain('$originalYaml = Yaml::parse($originalCompose);')
|
||||
->toContain('} catch (\Exception $e) {')
|
||||
->toContain("ray('Failed to update docker_compose_raw");
|
||||
->toContain('} catch (Exception) {')
|
||||
->toContain('// If parsing fails, keep the original docker_compose_raw unchanged');
|
||||
});
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
function rayRemovalFiles(string $directory): array
|
||||
{
|
||||
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory));
|
||||
$files = [];
|
||||
|
||||
foreach ($iterator as $file) {
|
||||
if ($file->isFile() && $file->getExtension() === 'php') {
|
||||
$files[] = $file->getPathname();
|
||||
}
|
||||
}
|
||||
|
||||
sort($files);
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
||||
function rayRemovalBasePath(string $path = ''): string
|
||||
{
|
||||
return dirname(__DIR__, 2).($path === '' ? '' : DIRECTORY_SEPARATOR.$path);
|
||||
}
|
||||
|
||||
it('does not include Ray as a dependency', function () {
|
||||
$composer = json_decode(file_get_contents(rayRemovalBasePath('composer.json')), true, flags: JSON_THROW_ON_ERROR);
|
||||
$lock = json_decode(file_get_contents(rayRemovalBasePath('composer.lock')), true, flags: JSON_THROW_ON_ERROR);
|
||||
$lockedPackageNames = collect([
|
||||
...($lock['packages'] ?? []),
|
||||
...($lock['packages-dev'] ?? []),
|
||||
])->pluck('name');
|
||||
|
||||
expect($composer['require'] ?? [])->not->toHaveKey('spatie/laravel-ray')
|
||||
->and($composer['require-dev'] ?? [])->not->toHaveKey('spatie/laravel-ray')
|
||||
->and($lockedPackageNames)->not->toContain('spatie/laravel-ray', 'spatie/ray');
|
||||
});
|
||||
|
||||
it('does not ship Ray configuration', function () {
|
||||
expect(file_exists(rayRemovalBasePath('config/ray.php')))->toBeFalse();
|
||||
});
|
||||
|
||||
it('does not call ray from application code', function () {
|
||||
$files = [
|
||||
...rayRemovalFiles(rayRemovalBasePath('app')),
|
||||
...rayRemovalFiles(rayRemovalBasePath('bootstrap/helpers')),
|
||||
];
|
||||
|
||||
$rayCalls = collect($files)
|
||||
->filter(fn (string $file): bool => preg_match('/\bray\s*\(/', file_get_contents($file)) === 1)
|
||||
->map(fn (string $file): string => str_replace(rayRemovalBasePath().'/', '', $file))
|
||||
->values();
|
||||
|
||||
expect($rayCalls)->toBeEmpty();
|
||||
});
|
||||
Reference in new issue
Block a user