fix(deployments): trim remote command outputs before processing

Normalize saved command output for reliable status and metadata handling, and bump the Coolify version to 4.3.23.
This commit is contained in:
Andras Bacsai
2026-09-18 15:34:50 +02:00
parent 23f24f8425
commit e2e2d4010b
7 changed files with 43 additions and 14 deletions
+24 -2
View File
@@ -23,6 +23,11 @@ function remoteCommandOutputCollector(): object
{
$this->saveCommandOutput($output, $append);
}
public function trimmedOutput(string $key = 'dockerfile'): string
{
return $this->trimmedSavedOutput($key)->value();
}
};
}
@@ -37,11 +42,28 @@ it('preserves whitespace across streamed saved output chunks', function () {
->toBe("FROM alpine\nARG FIRST\nARG SECOND\nRUN true\n");
});
it('replaces saved output without trimming it when append is disabled', function () {
it('trims saved output when append is disabled', function () {
$collector = remoteCommandOutputCollector();
$collector->collectOutput('old');
$collector->collectOutput(" new output\n", append: false);
expect((string) $collector->saved_outputs->get('dockerfile'))->toBe(" new output\n");
expect((string) $collector->saved_outputs->get('dockerfile'))->toBe('new output');
});
it('keeps non-appended command output safe for exact status comparisons', function () {
$collector = remoteCommandOutputCollector();
$collector->collectOutput("\"healthy\"\n", append: false);
expect(str($collector->saved_outputs->get('dockerfile'))->replace('"', '')->value())
->toBe('healthy');
});
it('normalizes streamed scalar output without changing the saved value', function () {
$collector = remoteCommandOutputCollector();
$collector->collectOutput("node\n");
expect($collector->trimmedOutput())->toBe('node')
->and((string) $collector->saved_outputs->get('dockerfile'))->toBe("node\n");
});
+2 -2
View File
@@ -25,8 +25,8 @@ it('publishes v4 branch builds under the commit sha with a traceable internal ve
->toContain('ARG COOLIFY_VERSION')
->toContain('ENV COOLIFY_VERSION=${COOLIFY_VERSION}')
->and($constants)
->toContain("'version' => env('COOLIFY_VERSION') ?: '4.3.22'")
->and($versions['coolify']['v4']['version'])->toBe('4.3.22')
->toContain("'version' => env('COOLIFY_VERSION') ?: '4.3.23'")
->and($versions['coolify']['v4']['version'])->toBe('4.3.23')
->and($versions['coolify']['nightly']['version'])->toBe('4.4-rc.1')
->and($nightlyVersions)->toBe($versions);
});