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:
Andras Bacsai
2025-11-17 09:59:17 +01:00
parent cc6a538fca
commit 6593b2a553
15 changed files with 618 additions and 241 deletions

View File

@@ -103,3 +103,39 @@ it('handles invalid version format gracefully', function () {
expect($result)->toBe(0);
expect($matches)->toBeEmpty();
});
it('handles empty image tag correctly', function () {
// Test that empty string after trim doesn't cause issues with str_contains
$emptyImageTag = '';
$trimmed = trim($emptyImageTag);
// This should be false, not an error
expect(empty($trimmed))->toBeTrue();
// Test with whitespace only
$whitespaceTag = " \n ";
$trimmed = trim($whitespaceTag);
expect(empty($trimmed))->toBeTrue();
});
it('detects latest tag in image name', function () {
// Test various formats where :latest appears
$testCases = [
'traefik:latest' => true,
'traefik:Latest' => true,
'traefik:LATEST' => true,
'traefik:v3.6.0' => false,
'traefik:3.6.0' => false,
'' => false,
];
foreach ($testCases as $imageTag => $expected) {
if (empty(trim($imageTag))) {
$result = false; // Should return false for empty tags
} else {
$result = str_contains(strtolower(trim($imageTag)), ':latest');
}
expect($result)->toBe($expected, "Failed for imageTag: '{$imageTag}'");
}
});