mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
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:
co-authored by
Claude Opus 5.5
parent
3f929edfc6
commit
2fbe9d2abe
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user