feat: CI/CD pipeline setup complete - Ansible playbooks updated, secrets configured, workflow ready
This commit is contained in:
@@ -17,6 +17,8 @@ use App\Framework\DI\Container;
|
||||
use App\Framework\Discovery\Cache\DiscoveryCacheIdentifiers;
|
||||
use App\Framework\Discovery\Factory\DiscoveryServiceFactory;
|
||||
use App\Framework\Discovery\Results\DiscoveryRegistry;
|
||||
use App\Framework\Logging\Logger;
|
||||
use App\Framework\Logging\ValueObjects\LogContext;
|
||||
|
||||
/**
|
||||
* Bootstrapper für den Discovery-Service
|
||||
@@ -26,7 +28,8 @@ final readonly class DiscoveryServiceBootstrapper
|
||||
{
|
||||
public function __construct(
|
||||
private Container $container,
|
||||
private Clock $clock
|
||||
private Clock $clock,
|
||||
private Logger $logger
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -48,23 +51,23 @@ final readonly class DiscoveryServiceBootstrapper
|
||||
$currentContext = ExecutionContext::detect();
|
||||
$contextString = $currentContext->getType()->value;
|
||||
|
||||
// TEMPORARY DEBUG LOGGING
|
||||
error_log("🔍 DISCOVERY DEBUG: Context detected = {$contextString}");
|
||||
error_log("🔍 DISCOVERY DEBUG: Source path = " . $pathProvider->getSourcePath());
|
||||
// Debug logging via framework Logger
|
||||
$this->logger->debug("Context detected = {$contextString}", LogContext::withData([
|
||||
'source_path' => $pathProvider->getSourcePath()
|
||||
]));
|
||||
|
||||
// Direkter Cache-Check mit expliziter toArray/fromArray Serialisierung
|
||||
$defaultPaths = [$pathProvider->getSourcePath()];
|
||||
$cacheKey = DiscoveryCacheIdentifiers::fullDiscoveryKey($defaultPaths, $contextString);
|
||||
|
||||
error_log("🔍 DISCOVERY DEBUG: Cache key = {$cacheKey->toString()}");
|
||||
|
||||
$this->logger->debug("Cache key = {$cacheKey->toString()}");
|
||||
|
||||
$cachedItem = $cache->get($cacheKey);
|
||||
|
||||
error_log("🔍 DISCOVERY DEBUG: Cache hit = " . ($cachedItem->isHit ? 'YES' : 'NO'));
|
||||
$this->logger->debug("Cache hit = " . ($cachedItem->isHit ? 'YES' : 'NO'));
|
||||
|
||||
if ($cachedItem->isHit) {
|
||||
error_log("🔍 DISCOVERY DEBUG: Loading from cache...");
|
||||
$this->logger->debug("Loading from cache...");
|
||||
// Ensure DiscoveryRegistry class is loaded before attempting deserialization
|
||||
if (! class_exists(DiscoveryRegistry::class, true)) {
|
||||
$cachedRegistry = null;
|
||||
@@ -92,7 +95,7 @@ final readonly class DiscoveryServiceBootstrapper
|
||||
|
||||
if ($cachedRegistry !== null && ! $cachedRegistry->isEmpty()) {
|
||||
$routeCount = count($cachedRegistry->attributes->get(\App\Framework\Attributes\Route::class));
|
||||
error_log("🔍 DISCOVERY DEBUG: Cached registry loaded - Route count: {$routeCount}");
|
||||
$this->logger->debug("Cached registry loaded - Route count: {$routeCount}");
|
||||
|
||||
$this->container->singleton(DiscoveryRegistry::class, $cachedRegistry);
|
||||
|
||||
@@ -109,18 +112,22 @@ final readonly class DiscoveryServiceBootstrapper
|
||||
}
|
||||
|
||||
// Fallback: Vollständige Discovery durchführen
|
||||
error_log("🔍 DISCOVERY DEBUG: Performing fresh discovery...");
|
||||
$this->logger->debug("Performing fresh discovery...");
|
||||
$results = $this->performBootstrap($pathProvider, $cache, $discoveryConfig);
|
||||
error_log("🔍 DISCOVERY DEBUG: Discovery completed - isEmpty: " . ($results->isEmpty() ? 'YES' : 'NO'));
|
||||
$this->logger->debug("Discovery completed", LogContext::withData([
|
||||
'is_empty' => $results->isEmpty()
|
||||
]));
|
||||
|
||||
// Nach der Discovery explizit in unserem eigenen Cache-Format speichern
|
||||
$consoleCommandCount = count($results->attributes->get(\App\Framework\Console\ConsoleCommand::class));
|
||||
$routeCount = count($results->attributes->get(\App\Framework\Attributes\Route::class));
|
||||
$initializerCount = count($results->attributes->get(\App\Framework\DI\Initializer::class));
|
||||
|
||||
error_log("🔍 DISCOVERY DEBUG: Found {$routeCount} routes");
|
||||
error_log("🔍 DISCOVERY DEBUG: Found {$consoleCommandCount} console commands");
|
||||
error_log("🔍 DISCOVERY DEBUG: Found {$initializerCount} initializers");
|
||||
$this->logger->debug("Discovery results", LogContext::withData([
|
||||
'routes' => $routeCount,
|
||||
'console_commands' => $consoleCommandCount,
|
||||
'initializers' => $initializerCount
|
||||
]));
|
||||
|
||||
// Only cache if we found meaningful results
|
||||
// An empty discovery likely indicates initialization timing issues
|
||||
|
||||
@@ -97,7 +97,7 @@ final readonly class DiscoveredAttribute
|
||||
|
||||
$filePath = null;
|
||||
$fileData = $data['file'] ?? $data['filePath'] ?? null;
|
||||
if ($fileData !== null && ! empty($fileData)) {
|
||||
if (! empty($fileData)) {
|
||||
if (is_object($fileData)) {
|
||||
// Check if it's a complete FilePath object
|
||||
if ($fileData instanceof FilePath) {
|
||||
@@ -232,9 +232,6 @@ final readonly class DiscoveredAttribute
|
||||
} elseif ($value instanceof \UnitEnum) {
|
||||
// Handle PHP unit enums
|
||||
$sanitizedAdditionalData[$key] = $value->name;
|
||||
} else {
|
||||
// Skip unsupported objects to prevent serialization issues
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
$sanitizedAdditionalData[$key] = $value;
|
||||
|
||||
Reference in New Issue
Block a user