From ff5794d0ccbe4d516bf91d8a64d3987d89e2d16a Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sat, 6 Jun 2026 12:09:14 -0500 Subject: [PATCH] fix: remove dead definitionParser reference in RepositorySynchronizer The definitionParser property was never initialized or implemented. synchronizeRepository() crashed with "Call to a member function parseForPlatform() on null". Replaced with direct use of getSharedWorkflows() which provides all files to sync. --- lib/Enterprise/RepositorySynchronizer.php | 34 ++++------------------- 1 file changed, 6 insertions(+), 28 deletions(-) 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)) {