fix(proxy): notify once for each new Traefik patch version

Closes #9727

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2026-11-03 20:43:10 +01:00
co-authored by Claude Opus 5.5
parent 3f929edfc6
commit 2fbe9d2abe
3 changed files with 50 additions and 5 deletions
@@ -167,7 +167,7 @@ it('sends immediate notifications when outdated traefik is detected', function (
expect($notification->servers->first()->outdatedInfo['type'])->toBe('patch_update');
});
it('does not notify about Traefik patch updates', function () {
it('notifies about a Traefik patch update', function () {
$team = Team::factory()->create();
$team->webhookNotificationSettings()->update([
'webhook_enabled' => true,
@@ -178,9 +178,51 @@ it('does not notify about Traefik patch updates', function () {
$job = new CheckTraefikVersionForServerJob($server, ['v3.7' => '3.7.13']);
(new ReflectionMethod($job, 'storeOutdatedInfo'))->invoke($job, '3.7.7', '3.7.13', 'patch_update');
Notification::assertSentTo($team, TraefikVersionOutdated::class);
});
it('does not repeat a Traefik patch update notification for the same latest version', function () {
$team = Team::factory()->create();
$team->webhookNotificationSettings()->update([
'webhook_enabled' => true,
'webhook_url' => 'https://example.com/webhook',
]);
$server = Server::factory()->create([
'team_id' => $team->id,
'traefik_outdated_info' => [
'current' => '3.7.7',
'latest' => '3.7.13',
'type' => 'patch_update',
],
]);
$job = new CheckTraefikVersionForServerJob($server, ['v3.7' => '3.7.13']);
(new ReflectionMethod($job, 'storeOutdatedInfo'))->invoke($job, '3.7.7', '3.7.13', 'patch_update');
Notification::assertNothingSent();
});
it('notifies again when a newer Traefik patch version is released', function () {
$team = Team::factory()->create();
$team->webhookNotificationSettings()->update([
'webhook_enabled' => true,
'webhook_url' => 'https://example.com/webhook',
]);
$server = Server::factory()->create([
'team_id' => $team->id,
'traefik_outdated_info' => [
'current' => '3.7.7',
'latest' => '3.7.13',
'type' => 'patch_update',
],
]);
$job = new CheckTraefikVersionForServerJob($server, ['v3.7' => '3.7.16']);
(new ReflectionMethod($job, 'storeOutdatedInfo'))->invoke($job, '3.7.7', '3.7.16', 'patch_update');
Notification::assertSentTo($team, TraefikVersionOutdated::class);
});
it('notifies about Traefik minor updates', function () {
$team = Team::factory()->create();
$team->webhookNotificationSettings()->update([