From 492f1cbb80503c7a2fd0db46bb0993da98793403 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sat, 23 May 2026 15:43:42 -0500 Subject: [PATCH] fix: version_set_platform.php reads manifest.xml + supports joomla platform - Added .mokogitea/manifest.xml XML lookup (new format) - Added .mokogitea/.mokostandards fallback (legacy) - Platform 'joomla' now handled alongside 'waas-component' This was the root cause of manifest version not updating during releases. Co-Authored-By: Claude Opus 4.6 (1M context) --- cli/version_set_platform.php | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/cli/version_set_platform.php b/cli/version_set_platform.php index 8e9a4c7..4752b45 100644 --- a/cli/version_set_platform.php +++ b/cli/version_set_platform.php @@ -64,16 +64,32 @@ if ($suffix !== '' && !str_ends_with($version, $suffix)) { $root = realpath($path) ?: $path; -// Detect platform +// Detect platform — check manifest.xml first, then legacy .mokostandards $platform = ''; -$mokoStandards = "{$root}/.github/.mokostandards"; -if (!file_exists($mokoStandards)) { - $mokoStandards = "{$root}/.mokostandards"; + +// New format: .mokogitea/manifest.xml (XML with tag) +$manifestXml = "{$root}/.mokogitea/manifest.xml"; +if (file_exists($manifestXml)) { + $xml = @simplexml_load_file($manifestXml); + if ($xml && isset($xml->governance->platform)) { + $platform = (string) $xml->governance->platform; + } } -if (file_exists($mokoStandards)) { - $content = file_get_contents($mokoStandards); - if (preg_match('/^platform:\s*(.+)/m', $content, $m)) { - $platform = trim($m[1], " \t\n\r\"'"); + +// Legacy: .mokostandards YAML file +if (empty($platform)) { + $mokoStandards = "{$root}/.github/.mokostandards"; + if (!file_exists($mokoStandards)) { + $mokoStandards = "{$root}/.mokogitea/.mokostandards"; + } + if (!file_exists($mokoStandards)) { + $mokoStandards = "{$root}/.mokostandards"; + } + if (file_exists($mokoStandards)) { + $content = file_get_contents($mokoStandards); + if (preg_match('/^platform:\s*(.+)/m', $content, $m)) { + $platform = trim($m[1], " \t\n\r\"'"); + } } } @@ -116,7 +132,7 @@ if ($platform === 'crm-module') { } // Joomla: in XML manifests -if ($platform === 'waas-component') { +if (in_array($platform, ['waas-component', 'joomla'], true)) { foreach (glob("{$root}/src/*.xml") ?: glob("{$root}/*.xml") ?: [] as $file) { $content = file_get_contents($file); if (!str_contains($content, '