diff --git a/lib/Enterprise/RepositorySynchronizer.php b/lib/Enterprise/RepositorySynchronizer.php index e997434..ff3dc38 100644 --- a/lib/Enterprise/RepositorySynchronizer.php +++ b/lib/Enterprise/RepositorySynchronizer.php @@ -173,37 +173,15 @@ class RepositorySynchronizer $platform = $this->detectPlatform($repoInfo); $this->logger->logInfo("Detected platform for {$repo}: {$platform}"); - // Load file list from the Terraform definition for this platform - $filesToSync = $this->definitionParser->parseForPlatform($platform, $repoRoot); - - // Append shared workflows — the parser can't extract them from nested - // subdirectories blocks due to heredoc interference in .tf files. - $sharedFiles = $this->getSharedWorkflows($platform, $repoRoot); - - // Deduplicate by destination — shared workflows take precedence over parser entries - $seen = []; - foreach ($filesToSync as $f) { - $seen[$f['destination']] = true; - } - foreach ($sharedFiles as $f) { - if (!isset($seen[$f['destination']])) { - $filesToSync[] = $f; - } - } - - $defCount = count($filesToSync) - count($sharedFiles); - $sharedAdded = count($filesToSync) - $defCount; - $sharedTotal = count($sharedFiles); + // Load shared workflows and config files for this platform from templates + $filesToSync = $this->getSharedWorkflows($platform, $repoRoot); + $sharedTotal = count($filesToSync); $this->logger->logInfo( - "Loaded " . count($filesToSync) . " sync entries for {$platform}" - . " (def={$defCount}, shared={$sharedAdded}/{$sharedTotal} added, " - . ($sharedTotal - $sharedAdded) . " deduped)" + "Loaded {$sharedTotal} sync entries for {$platform}" ); - // Log shared workflow destinations for debugging - foreach ($sharedFiles as $sf) { + foreach ($filesToSync as $sf) { $dest = $sf['destination'] ?? '?'; - $added = !isset($seen[$dest]) ? 'ADDED' : 'DEDUPED'; - $this->logger->logInfo(" shared: {$dest} [{$added}]"); + $this->logger->logInfo(" sync: {$dest}"); } if (empty($filesToSync)) {