feat(Docker): Upgrade to PHP 8.5.0RC3 with native ext-uri support
BREAKING CHANGE: Requires PHP 8.5.0RC3 Changes: - Update Docker base image from php:8.4-fpm to php:8.5.0RC3-fpm - Enable ext-uri for native WHATWG URL parsing support - Update composer.json PHP requirement from ^8.4 to ^8.5 - Add ext-uri as required extension in composer.json - Move URL classes from Url.php85/ to Url/ directory (now compatible) - Remove temporary PHP 8.4 compatibility workarounds Benefits: - Native URL parsing with Uri\WhatWg\Url class - Better performance for URL operations - Future-proof with latest PHP features - Eliminates PHP version compatibility issues
This commit is contained in:
@@ -23,8 +23,10 @@ use App\Framework\Context\ExecutionContext;
|
||||
use App\Framework\MachineLearning\ModelManagement\NotificationAlertingService;
|
||||
use App\Framework\MachineLearning\ModelManagement\MLConfig;
|
||||
use App\Framework\Core\ValueObjects\Version;
|
||||
use App\Framework\Notification\Storage\NotificationRepository;
|
||||
use App\Framework\Notification\Storage\DatabaseNotificationRepository;
|
||||
use App\Framework\Notification\ValueObjects\NotificationStatus;
|
||||
use App\Framework\Notification\NullNotificationDispatcher;
|
||||
use App\Framework\Database\ValueObjects\SqlQuery;
|
||||
|
||||
// Bootstrap container
|
||||
$performanceCollector = new EnhancedPerformanceCollector(
|
||||
@@ -81,8 +83,14 @@ $errors = [];
|
||||
|
||||
// Get services
|
||||
try {
|
||||
$alertingService = $container->get(NotificationAlertingService::class);
|
||||
$notificationRepo = $container->get(NotificationRepository::class);
|
||||
// Manually instantiate NotificationAlertingService with NullNotificationDispatcher
|
||||
// to avoid interface binding issues in tests
|
||||
$dispatcher = new NullNotificationDispatcher();
|
||||
$config = $container->get(MLConfig::class);
|
||||
$alertingService = new NotificationAlertingService($dispatcher, $config, 'admin');
|
||||
|
||||
// DatabaseNotificationRepository can be auto-resolved by container
|
||||
$notificationRepo = $container->get(DatabaseNotificationRepository::class);
|
||||
} catch (\Throwable $e) {
|
||||
echo red("✗ Failed to initialize services: " . $e->getMessage() . "\n");
|
||||
exit(1);
|
||||
@@ -101,7 +109,7 @@ try {
|
||||
usleep(100000); // 100ms
|
||||
|
||||
// Verify notification was created
|
||||
$notifications = $notificationRepo->getAll('admin', 10);
|
||||
$notifications = $notificationRepo->findByUser('admin', 10);
|
||||
|
||||
if (count($notifications) > 0) {
|
||||
$lastNotification = $notifications[0];
|
||||
@@ -138,7 +146,7 @@ try {
|
||||
|
||||
usleep(100000);
|
||||
|
||||
$notifications = $notificationRepo->getAll('admin', 10);
|
||||
$notifications = $notificationRepo->findByUser('admin', 10);
|
||||
$found = false;
|
||||
|
||||
foreach ($notifications as $notification) {
|
||||
@@ -175,16 +183,16 @@ try {
|
||||
|
||||
usleep(100000);
|
||||
|
||||
$notifications = $notificationRepo->getAll('admin', 10);
|
||||
$notifications = $notificationRepo->findByUser('admin', 10);
|
||||
$found = false;
|
||||
|
||||
foreach ($notifications as $notification) {
|
||||
if (str_contains($notification->title, 'Low Confidence')) {
|
||||
$found = true;
|
||||
echo green("✓ PASSED\n");
|
||||
echo " - Average Confidence: 45%\n");
|
||||
echo " - Threshold: 70%\n");
|
||||
echo " - Priority: {$notification->priority->value} (should be NORMAL)\n");
|
||||
echo " - Average Confidence: 45%\n";
|
||||
echo " - Threshold: 70%\n";
|
||||
echo " - Priority: {$notification->priority->value} (should be NORMAL)\n";
|
||||
$passed++;
|
||||
break;
|
||||
}
|
||||
@@ -211,16 +219,16 @@ try {
|
||||
|
||||
usleep(100000);
|
||||
|
||||
$notifications = $notificationRepo->getAll('admin', 10);
|
||||
$notifications = $notificationRepo->findByUser('admin', 10);
|
||||
$found = false;
|
||||
|
||||
foreach ($notifications as $notification) {
|
||||
if (str_contains($notification->title, 'Model Deployed')) {
|
||||
$found = true;
|
||||
echo green("✓ PASSED\n");
|
||||
echo " - Model: image-classifier v4.2.1\n");
|
||||
echo " - Environment: production\n");
|
||||
echo " - Priority: {$notification->priority->value} (should be LOW)\n");
|
||||
echo " - Model: image-classifier v4.2.1\n";
|
||||
echo " - Environment: production\n";
|
||||
echo " - Priority: {$notification->priority->value} (should be LOW)\n";
|
||||
$passed++;
|
||||
break;
|
||||
}
|
||||
@@ -251,15 +259,15 @@ try {
|
||||
|
||||
usleep(100000);
|
||||
|
||||
$notifications = $notificationRepo->getAll('admin', 10);
|
||||
$notifications = $notificationRepo->findByUser('admin', 10);
|
||||
$found = false;
|
||||
|
||||
foreach ($notifications as $notification) {
|
||||
if (str_contains($notification->title, 'Auto-Tuning Triggered')) {
|
||||
$found = true;
|
||||
echo green("✓ PASSED\n");
|
||||
echo " - Suggested Parameters: learning_rate, batch_size, epochs\n");
|
||||
echo " - Priority: {$notification->priority->value} (should be NORMAL)\n");
|
||||
echo " - Suggested Parameters: learning_rate, batch_size, epochs\n";
|
||||
echo " - Priority: {$notification->priority->value} (should be NORMAL)\n";
|
||||
$passed++;
|
||||
break;
|
||||
}
|
||||
@@ -291,15 +299,15 @@ try {
|
||||
|
||||
usleep(100000);
|
||||
|
||||
$notifications = $notificationRepo->getAll('admin', 10);
|
||||
$notifications = $notificationRepo->findByUser('admin', 10);
|
||||
$found = false;
|
||||
|
||||
foreach ($notifications as $notification) {
|
||||
if (str_contains($notification->title, 'Critical System Alert')) {
|
||||
$found = true;
|
||||
echo green("✓ PASSED\n");
|
||||
echo " - Level: critical\n");
|
||||
echo " - Priority: {$notification->priority->value} (should be URGENT)\n");
|
||||
echo " - Level: critical\n";
|
||||
echo " - Priority: {$notification->priority->value} (should be URGENT)\n";
|
||||
$passed++;
|
||||
break;
|
||||
}
|
||||
@@ -318,7 +326,7 @@ try {
|
||||
// Test 7: Notification Data Integrity
|
||||
echo cyan("Test 7: Notification Data Integrity... ");
|
||||
try {
|
||||
$notifications = $notificationRepo->getAll('admin', 20);
|
||||
$notifications = $notificationRepo->findByUser('admin', 20);
|
||||
|
||||
if (count($notifications) >= 3) {
|
||||
$driftNotification = null;
|
||||
@@ -340,11 +348,11 @@ try {
|
||||
|
||||
if ($hasModelName && $hasVersion && $hasDriftValue && $hasThreshold && $hasAction) {
|
||||
echo green("✓ PASSED\n");
|
||||
echo " - Model Name: {$driftNotification->data['model_name']}\n");
|
||||
echo " - Version: {$driftNotification->data['version']}\n");
|
||||
echo " - Drift Value: {$driftNotification->data['drift_value']}\n");
|
||||
echo " - Action URL: {$driftNotification->actionUrl}\n");
|
||||
echo " - Action Label: {$driftNotification->actionLabel}\n");
|
||||
echo " - Model Name: {$driftNotification->data['model_name']}\n";
|
||||
echo " - Version: {$driftNotification->data['version']}\n";
|
||||
echo " - Drift Value: {$driftNotification->data['drift_value']}\n";
|
||||
echo " - Action URL: {$driftNotification->actionUrl}\n";
|
||||
echo " - Action Label: {$driftNotification->actionLabel}\n";
|
||||
$passed++;
|
||||
} else {
|
||||
echo red("✗ FAILED: Incomplete notification data\n");
|
||||
@@ -367,7 +375,7 @@ try {
|
||||
// Test 8: Notification Status Tracking
|
||||
echo cyan("Test 8: Notification Status Tracking... ");
|
||||
try {
|
||||
$notifications = $notificationRepo->getAll('admin', 10);
|
||||
$notifications = $notificationRepo->findByUser('admin', 10);
|
||||
|
||||
if (count($notifications) > 0) {
|
||||
$unreadCount = 0;
|
||||
@@ -414,7 +422,7 @@ if ($failed > 0) {
|
||||
// Display Recent Notifications
|
||||
echo "\n" . blue("═══ Recent Notifications ═══\n\n");
|
||||
try {
|
||||
$recentNotifications = $notificationRepo->getAll('admin', 10);
|
||||
$recentNotifications = $notificationRepo->findByUser('admin', 10);
|
||||
|
||||
if (count($recentNotifications) > 0) {
|
||||
foreach ($recentNotifications as $i => $notification) {
|
||||
|
||||
Reference in New Issue
Block a user