Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Merge remote-tracking branch 'origin/release/v4.5' into sentinel-metrics-sidebar-page

Andras Bacsaif63726279c98
diff --cc .ai/lessons.md
index 3298a28d68,69790b0ee1..d1e140e5eb
--- a/.ai/lessons.md
+++ b/.ai/lessons.md
@@@ -4,8 -4,18 +4,19 @@@
- Reproduce the reported failure on the unchanged baseline before adding a fix.
- When a symptom matches an earlier fix, inspect that fix and prove why it no longer works before adding another workaround.
- Test old reports against the current branch because later changes can make the report obsolete.
+- Test serialized worker tasks with the real process driver. An in-process test does not prove that captured models or nested closures survive serialization.
- Use the same regression test before and after the production change so the result shows the behavior difference.
+ - Several dev instances can run from one checkout (see `./scripts/dev urls`). After you add a migration, run it on each running instance of that checkout, or those instances fail on the new code.
+ - The checkout is shared with other sessions. When the full suite fails, rerun each failing file alone and compare with a clean `git archive HEAD` copy before you connect a failure to your change.
+ - Run seeders and other artisan commands that write SSH keys in a dev container as `www-data` (`docker exec -u www-data`). Root-owned files in `storage/app/ssh` make every SSH call from the web process fail.
+ - `sshd` keeps the login shell of an open multiplexed SSH connection. Call `SshMultiplexingHelper::removeMuxFile()` before a live test of SSH or login-shell behavior.
+ - SSH retries replay the full command batch. Only exit code 255 is an SSH transport failure; other exit codes come from the remote command, so do not retry them. Keep batches safe to run twice (for example `docker rm -f <name> || true` before `docker run --name <name>`).
+ - Redirect browser test output to a file (`> /tmp/x.log 2>&1`); piping it (`| tail`) hangs because the Playwright server keeps the pipe open.
+ - Browser `click('Text')` can match a hidden element first (for example inactive modal steps) and wait forever; use `button:visible:has-text("Text")`.
+ - A new worktree has no `vendor/` or `public/build/`. Run `composer install --ignore-platform-req=ext-zip` on the host and copy `public/build` from the main checkout before page-rendering tests; otherwise they fail with a Vite manifest error.
+ - Never run `php artisan test` inside a dev container (`./scripts/dev exec` or `docker exec coolify-dev-*`). The container sets `DB_CONNECTION=pgsql` as a real environment variable, which wins over `phpunit.xml`, so `RefreshDatabase` runs `migrate:fresh` on the dev database and wipes it. Run tests on the host only.
+ - Do not symlink `vendor` into another worktree. Composer resolves the base path from the real `vendor` path, so the tests load the app classes of the other checkout. Run `composer install --ignore-platform-req=ext-zip` in the worktree.
+ - Call `visit()` directly in each `tests/v4/Browser` test body; Pest does not mark a test that only uses helper-wrapped `visit()` as a browser test, so it fails with `sendText() on null`.
## Verify the complete user flow
- Do not use a passing unit test, a successful build, or a healthy process as proof for a reported UI failure.
diff --cc app/Livewire/Server/Charts.php
index 654f0b9686,c77662315a..6ff1f682fa
--- a/app/Livewire/Server/Charts.php
+++ b/app/Livewire/Server/Charts.php
@@@ -118,19 -113,25 +122,38 @@@ class Charts extends Componen
}
}
+ /**
+ * Fetch a metric that may not exist on an older Sentinel; a failure yields null
+ * rather than breaking the whole chart refresh.
+ */
+ private function optionalMetric(callable $fetch): mixed
+ {
+ try {
+ return $fetch();
+ } catch (\Throwable) {
+ return null;
+ }
+ }
+
+ /**
+ * Metrics settings belong to Sentinel, so they use the same event as the Sentinel page and API.
+ *
+ * @param array<int, string> $changedFields
+ */
+ private function auditSentinelUpdate(array $changedFields): void
+ {
+ if ($changedFields === []) {
+ return;
+ }
+
+ auditLog('ui.server.sentinel.updated', [
+ 'team_id' => $this->server->team_id,
+ 'server_uuid' => $this->server->uuid,
+ 'server_name' => $this->server->name,
+ 'changed_fields' => $changedFields,
+ ]);
+ }
+
public function setInterval()
{
if ($this->interval <= 10) {