fix: batch fixes for #60, #38, #59, #67, #68#70
Conversation
- #68: Suppress /up health check from nginx access logs - #60: Use schedule:work instead of schedule:run while loop - #38: Fix ssh-keygen quoting with escapeshellarg() - #59: Clear git_commit_sha after deploying specific commit - #67: Add errorlog channel + PHP-FPM catch_workers_output for container logging Closes #60, closes #38, closes #59, closes #67, closes #68
PR Review: fix: batch fixes for #60, #38, #59, #67, #68Good batch of targeted fixes. The changes are generally well-reasoned and the PR description clearly explains the motivation for each. A few concerns worth addressing before merge. Bug: Missing try/finally in deploy() — git_commit_sha can get stuckFile: src/Repositories/CoolifyApplicationRepository.php If $this->client->get('deploy', ...) throws an exception (network error, 5xx, timeout), the cleanup call that clears git_commit_sha never runs. The application ends up permanently pinned to that specific commit until someone manually clears it. The current code skips cleanup on exception. Wrapping in try/finally guarantees cleanup regardless of the deploy outcome: $response = null;
try {
$response = $this->client->get('deploy', $params);
} finally {
if ($commit !== null) {
$this->update($uuid, ['git_commit_sha' => '']);
}
}Missing test coverageSeveral new code paths have no tests: 1. generatePhpFpmConf() has no unit test. The existing "generates php.ini with correct settings" test is a straightforward template: it('generates php-fpm.conf with catch_workers_output enabled', function () {
$generator = new DockerGenerator;
$content = $generator->generatePhpFpmConf();
expect($content)->toContain('[www]')
->and($content)->toContain('catch_workers_output = yes')
->and($content)->toContain('decorate_workers_output = no');
});2. "writes all Docker files to disk" test is now stale — it does not assert docker/php-fpm.conf exists, so the new file could be silently removed in a future refactor without any test failing. 3. "deploys a specific commit" test does not verify the cleanup. ApplicationRepositoryTest.php:85 verifies the PATCH to set the commit SHA, but not the second PATCH to clear it afterward. The regression from #59 could reappear undetected. 4. No test for schedule:work in the supervisor config. Worth a simple assertion that the generated supervisord.conf contains schedule:work and not the old shell loop. Nginx /up suppression is hardcodedFile: src/Docker/DockerGenerator.php The PR hardcodes /up for access log suppression. The codebase already has a coolify.docker.health_check_path config key used for the Docker HEALTHCHECK command. If a user has set a custom health check path (e.g. /health), their endpoint still gets logged. Using the configured value would keep things consistent: $healthPath = config('coolify.docker.health_check_path', '/up');
// then interpolate $healthPath into the nginx location blockMinor: style tags in bulletList may render literallyFile: src/Console/InstallCommand.php The bulletList call wraps the value in comment style tags. Symfony Console's bulletList helper does not process style tags the same way as $this->line(). In non-TTY environments (CI pipelines, log capture) this may render the tags literally. Worth a quick manual smoke-test. Positive notes
|
- Wrap deploy() in try/finally so git_commit_sha is cleared even on failure - Use configured health_check_path for nginx log suppression instead of hardcoded /up - Add tests: php-fpm.conf generation, schedule:work supervisor config, deploy SHA cleanup, write-to-disk includes php-fpm.conf
|
@claude rereview please |
|
Claude finished @StuMason's task in 2m 8s —— View job Re-review: PR #70
Review Summary: ✅ All Previous Concerns AddressedI've reviewed the latest commit ( Previous Issues — Now Fixed
Test ResultsCode Quality NotesThe implementation is clean and follows good practices:
Verdict: This PR is ready to merge. All five issue fixes are well-implemented with appropriate test coverage. |
Summary
Five low-effort, high-impact fixes from open issues:
/uphealth check from nginx access logs (access_log off; log_not_found off)schedule:workinstead of awhile/sleep/schedule:runloopssh-keygen"Too many arguments" by usingescapeshellarg()for all parametersgit_commit_shaafter deploying a specific commit so future deploys use HEADdocker/php-fpm.confwithcatch_workers_output = yes, useerrorlogchannel (notstderr— which doesn't work with PHP-FPM), add logging guidance tocoolify:installAlso closed #51 and #26 as out of scope.
Closes #60, closes #38, closes #59, closes #67, closes #68
Test plan
coolify:installshows logging recommendationphp-fpm.confCOPY linecoolify:provisionsetsLOG_STACK=daily,errorlog