Automatische Updates, Browser-Tests, CI grün (0.63.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Has been skipped
CI / PHP 8.4 / mariadb:10.6 (pull_request) Has been skipped
CI / PHP 8.3 / mariadb:11.4 (pull_request) Has been skipped
CI / PHP 8.4 / mariadb:11.4 (pull_request) Has been skipped
CI / PHP 8.3 / mysql:8.0 (pull_request) Has been skipped
CI / PHP 8.4 / mysql:8.0 (pull_request) Has been skipped
CI / PHP 8.3 / mysql:8.4 (pull_request) Has been skipped
CI / PHP 8.4 / mysql:8.4 (pull_request) Has been skipped
CI / Browser-Tests (pull_request) Failing after 7m34s
CI / PHP 8.3 / mysql:8.4-1 (pull_request) Successful in 11m55s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 16m43s
CI / Build-Artefakte aktuell (pull_request) Successful in 13m17s

- Opt-in „Updates automatisch installieren“ (AutoUpdate, alle 10 Minuten)
- Playwright-Tests in tests/Browser, CI-Job „Browser-Tests“
- CI: volle Matrix nur auf main, PRs mit einem MySQL-Job
- MySQL-JSON-Reihenfolge in zwei Tests, QM-Suchausschnitt ohne <mark>, h1 auf Startseite/Editor

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-10-07 17:29:20 +00:00
parent 3027a60275
commit e211db9f30
158 changed files with 774 additions and 378 deletions

View file

@ -7,6 +7,7 @@ use App\Support\License\LicenseService;
use App\Support\License\LicenseStore;
use App\Support\License\ServerError;
use App\Support\License\ServerMessages;
use App\Support\Update\AutoUpdate;
use App\Support\Update\Changelog;
use App\Support\Update\Channels;
use App\Support\Update\InstalledVersion;
@ -120,6 +121,7 @@ class Updates extends Page
'shortSha' => $version->short(),
'channels' => $channels->all(),
'activeChannel' => $channels->active(),
'autoUpdate' => app(AutoUpdate::class)->enabled(),
'progress' => app(UpdateProgress::class)->get(),
'migrations' => $migrations,
'pendingMigrations' => count(array_filter($migrations, fn (array $m) => ! $m['ran'])),

View file

@ -6,6 +6,7 @@ use App\Http\Controllers\Controller;
use App\Support\Audit;
use App\Support\License\ServerError;
use App\Support\License\ServerMessages;
use App\Support\Update\AutoUpdate;
use App\Support\Update\Channels;
use App\Support\Update\Migrations;
use App\Support\Update\UpdateCheck;
@ -68,6 +69,15 @@ class UpdateController extends Controller
return response()->json(['ok' => true, 'channel' => $validated['channel']]);
}
public function auto(Request $request, AutoUpdate $auto): JsonResponse
{
$enabled = $request->boolean('enabled');
$auto->setEnabled($enabled);
Audit::log('update.auto_changed', ['enabled' => $enabled]);
return response()->json(['ok' => true, 'enabled' => $enabled]);
}
public function migrations(Migrations $migrations): JsonResponse
{
@set_time_limit(0);

View file

@ -0,0 +1,60 @@
<?php
namespace App\Support\Update;
use App\Support\Settings;
use Illuminate\Support\Facades\Log;
use Throwable;
/**
* „Updates automatisch installieren“ – gedacht für Test- und Vorschau-Instanzen, die
* immer den neuesten Stand ihres Kanals zeigen sollen. Läuft als geplante Aufgabe
* (Cron, Web-Cron oder Pseudo-Cron) und nutzt denselben Ablauf wie der Knopf auf
* der Seite „Aktualisierung“. Einen Kanalwechsel zurück installiert es nie selbst.
*/
class AutoUpdate
{
public function __construct(
private readonly Settings $settings,
private readonly UpdateCheck $check,
private readonly UpdateProgress $progress,
) {}
public function enabled(): bool
{
return (bool) $this->settings->get('updates.auto', false);
}
public function setEnabled(bool $enabled): void
{
$this->settings->set('updates.auto', $enabled);
}
/**
* @return array{sha: string, files: int, pending: bool}|null null, wenn nichts installiert wurde
*/
public function run(): ?array
{
if (! $this->enabled() || $this->progress->isRunning()) {
return null;
}
try {
$result = $this->check->run();
} catch (Throwable $e) {
Log::warning('Automatisches Update: Prüfung fehlgeschlagen: '.$e->getMessage());
return null;
}
if (! $result['has_update'] || ($result['channel_switch']['direction'] ?? null) === 'back') {
return null;
}
@set_time_limit(0);
@ignore_user_abort(true);
Log::info('Automatisches Update auf '.($result['version'] ?? $result['latest_short']).' beginnt.');
return app(Updater::class)->installUpdate();
}
}

View file

@ -9,5 +9,5 @@ namespace App;
*/
final class Version
{
public const VERSION = '0.62.0';
public const VERSION = '0.63.0';
}