mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-18 03:20:26 +00:00
feat(proxy): enhance Traefik version notifications to show patch and minor upgrades
- Store both patch update and newer minor version information simultaneously - Display patch update availability alongside minor version upgrades in notifications - Add newer_branch_target and newer_branch_latest fields to traefik_outdated_info - Update all notification channels (Discord, Telegram, Slack, Pushover, Email, Webhook) - Show minor version in format (e.g., v3.6) for upgrade targets instead of patch version - Enhance UI callouts with clearer messaging about available upgrades - Remove verbose logging in favor of cleaner code structure - Handle edge case where SSH command returns empty response 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
56
tests/Unit/NotifyOutdatedTraefikServersJobTest.php
Normal file
56
tests/Unit/NotifyOutdatedTraefikServersJobTest.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
use App\Jobs\NotifyOutdatedTraefikServersJob;
|
||||
|
||||
it('has correct queue and retry configuration', function () {
|
||||
$job = new NotifyOutdatedTraefikServersJob;
|
||||
|
||||
expect($job->tries)->toBe(3);
|
||||
});
|
||||
|
||||
it('handles servers with null traefik_outdated_info gracefully', function () {
|
||||
// Create a mock server with null traefik_outdated_info
|
||||
$server = \Mockery::mock('App\Models\Server')->makePartial();
|
||||
$server->traefik_outdated_info = null;
|
||||
|
||||
// Accessing the property should not throw an error
|
||||
$result = $server->traefik_outdated_info;
|
||||
|
||||
expect($result)->toBeNull();
|
||||
});
|
||||
|
||||
it('handles servers with traefik_outdated_info data', function () {
|
||||
$expectedInfo = [
|
||||
'current' => '3.5.0',
|
||||
'latest' => '3.6.2',
|
||||
'type' => 'minor_upgrade',
|
||||
'upgrade_target' => 'v3.6',
|
||||
'checked_at' => '2025-11-14T10:00:00Z',
|
||||
];
|
||||
|
||||
$server = \Mockery::mock('App\Models\Server')->makePartial();
|
||||
$server->traefik_outdated_info = $expectedInfo;
|
||||
|
||||
// Should return the outdated info
|
||||
$result = $server->traefik_outdated_info;
|
||||
|
||||
expect($result)->toBe($expectedInfo);
|
||||
});
|
||||
|
||||
it('handles servers with patch update info without upgrade_target', function () {
|
||||
$expectedInfo = [
|
||||
'current' => '3.5.0',
|
||||
'latest' => '3.5.2',
|
||||
'type' => 'patch_update',
|
||||
'checked_at' => '2025-11-14T10:00:00Z',
|
||||
];
|
||||
|
||||
$server = \Mockery::mock('App\Models\Server')->makePartial();
|
||||
$server->traefik_outdated_info = $expectedInfo;
|
||||
|
||||
// Should return the outdated info without upgrade_target
|
||||
$result = $server->traefik_outdated_info;
|
||||
|
||||
expect($result)->toBe($expectedInfo);
|
||||
expect($result)->not->toHaveKey('upgrade_target');
|
||||
});
|
||||
Reference in New Issue
Block a user