diff --git a/.mokogitea/workflows/issue-branch.yml b/.mokogitea/workflows/issue-branch.yml index 616511b..349f515 100644 --- a/.mokogitea/workflows/issue-branch.yml +++ b/.mokogitea/workflows/issue-branch.yml @@ -5,7 +5,7 @@ # FILE INFORMATION # DEFGROUP: Gitea.Workflow # INGROUP: mokocli.Automation -# VERSION: 09.32.00 +# VERSION: 09.32.01 # BRIEF: Auto-create feature branch when an issue is opened name: "Universal: Issue Branch" diff --git a/README.md b/README.md index c0b26cf..f324a51 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ DEFGROUP: MokoPlatform.Root INGROUP: MokoPlatform REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform PATH: /README.md -VERSION: 09.32.00 +VERSION: 09.32.01 BRIEF: Project overview and documentation --> diff --git a/cli/branch_rename.php b/cli/branch_rename.php index 52a4b32..82abf2d 100644 --- a/cli/branch_rename.php +++ b/cli/branch_rename.php @@ -10,7 +10,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/branch_rename.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Rename a git branch via Gitea API (create new, update PR, delete old) */ diff --git a/cli/bulk_workflow_push.php b/cli/bulk_workflow_push.php index 9a2f3f1..e8dbf28 100644 --- a/cli/bulk_workflow_push.php +++ b/cli/bulk_workflow_push.php @@ -12,7 +12,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/bulk_workflow_push.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Push a workflow file to all governed repos via the Gitea Contents API */ diff --git a/cli/bulk_workflow_trigger.php b/cli/bulk_workflow_trigger.php index faf5269..ddd9ac7 100644 --- a/cli/bulk_workflow_trigger.php +++ b/cli/bulk_workflow_trigger.php @@ -12,7 +12,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/bulk_workflow_trigger.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Trigger a workflow across multiple repos at once */ diff --git a/cli/client_dashboard.php b/cli/client_dashboard.php index 97ce0e1..b592074 100644 --- a/cli/client_dashboard.php +++ b/cli/client_dashboard.php @@ -12,7 +12,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/client_dashboard.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Generate unified client dashboard HTML */ diff --git a/cli/client_inventory.php b/cli/client_inventory.php index 3c3eb1f..23cc5e9 100644 --- a/cli/client_inventory.php +++ b/cli/client_inventory.php @@ -12,7 +12,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/client_inventory.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Discover and list all client-waas repos with their server configuration status */ diff --git a/cli/client_provision.php b/cli/client_provision.php index 82db6b1..e245dd0 100644 --- a/cli/client_provision.php +++ b/cli/client_provision.php @@ -12,7 +12,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/client_provision.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Provision a new client environment end-to-end */ diff --git a/cli/grafana_dashboard.php b/cli/grafana_dashboard.php index 90d3fdc..f26b515 100644 --- a/cli/grafana_dashboard.php +++ b/cli/grafana_dashboard.php @@ -12,7 +12,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/grafana_dashboard.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Manage Grafana dashboards via API */ diff --git a/cli/joomla_build.php b/cli/joomla_build.php index 4b69a17..fbdd491 100644 --- a/cli/joomla_build.php +++ b/cli/joomla_build.php @@ -10,7 +10,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/joomla_build.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Build a Joomla extension ZIP from manifest — all types supported * NOTE: Called by pre-release and auto-release workflows. */ diff --git a/cli/joomla_metadata_validate.php b/cli/joomla_metadata_validate.php index 4a2b9b4..ea57f31 100644 --- a/cli/joomla_metadata_validate.php +++ b/cli/joomla_metadata_validate.php @@ -10,7 +10,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/joomla_metadata_validate.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Validate MokoGitea repo metadata against Joomla extension manifest XML */ diff --git a/cli/manifest_detect.php b/cli/manifest_detect.php index 09eeaf5..b85a026 100644 --- a/cli/manifest_detect.php +++ b/cli/manifest_detect.php @@ -10,7 +10,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/manifest_detect.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Auto-detect manifest fields from source files and optionally push to API */ diff --git a/cli/manifest_integrity.php b/cli/manifest_integrity.php index 555dbf9..071402e 100644 --- a/cli/manifest_integrity.php +++ b/cli/manifest_integrity.php @@ -10,7 +10,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/manifest_integrity.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Cross-check manifest API fields against repo contents across the org */ diff --git a/cli/manifest_licensing.php b/cli/manifest_licensing.php index ee0228c..0f36449 100644 --- a/cli/manifest_licensing.php +++ b/cli/manifest_licensing.php @@ -10,7 +10,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/manifest_licensing.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Ensure licensing tags (updateservers, dlid) in Joomla extension manifests */ diff --git a/cli/manifest_read.php b/cli/manifest_read.php index fb63935..70be688 100644 --- a/cli/manifest_read.php +++ b/cli/manifest_read.php @@ -10,7 +10,7 @@ * INGROUP: mokocli * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/manifest_read.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Read repo metadata from Gitea manifest API, auto-detect the rest */ diff --git a/cli/platform_detect.php b/cli/platform_detect.php index edad9f6..adbdb5c 100644 --- a/cli/platform_detect.php +++ b/cli/platform_detect.php @@ -10,7 +10,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/platform_detect.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Auto-detect repository platform type and optionally update manifest */ diff --git a/cli/release_cascade.php b/cli/release_cascade.php index bdcc068..6dc5999 100644 --- a/cli/release_cascade.php +++ b/cli/release_cascade.php @@ -10,7 +10,7 @@ * INGROUP: mokocli * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli * PATH: /cli/release_cascade.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Cascade release zip to all lower stability channels */ diff --git a/cli/release_publish.php b/cli/release_publish.php index f9f156b..7fc2691 100644 --- a/cli/release_publish.php +++ b/cli/release_publish.php @@ -10,7 +10,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/release_publish.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Publish a release and create copies for all lesser stability streams. */ diff --git a/cli/scaffold_client.php b/cli/scaffold_client.php index 01a5994..94550b7 100644 --- a/cli/scaffold_client.php +++ b/cli/scaffold_client.php @@ -12,7 +12,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/scaffold_client.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Scaffold a new client-waas repo from Template-Client-WaaS with pre-configured settings */ diff --git a/cli/updates_xml_sync.php b/cli/updates_xml_sync.php index 7a6b0d3..59ca4d7 100644 --- a/cli/updates_xml_sync.php +++ b/cli/updates_xml_sync.php @@ -10,7 +10,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/updates_xml_sync.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Sync updates.xml to target branches via Gitea API * NOTE: Called by pre-release and auto-release workflows after updates.xml * is modified on the current branch. Pushes the file to other branches diff --git a/cli/version_auto_bump.php b/cli/version_auto_bump.php index 190e5e5..640978d 100644 --- a/cli/version_auto_bump.php +++ b/cli/version_auto_bump.php @@ -10,7 +10,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/version_auto_bump.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Auto patch-bump, set stability suffix, and commit — single CLI replacing inline workflow bash */ diff --git a/cli/version_bump.php b/cli/version_bump.php index aa2d51a..19c166f 100644 --- a/cli/version_bump.php +++ b/cli/version_bump.php @@ -27,6 +27,7 @@ class VersionBumpCli extends CliFramework $this->addArgument('--path', 'Repository root', '.'); $this->addArgument('--minor', 'Bump minor version', false); $this->addArgument('--major', 'Bump major version', false); + $this->addArgument('--min-version', 'Minimum base version (ensures bump is above this)', ''); } protected function run(): int @@ -116,6 +117,28 @@ class VersionBumpCli extends CliFramework $baseVersion = $v; } } + + // Check --min-version: ensures dev never falls behind stable + $minVersion = $this->getArgument('--min-version'); + if (!empty($minVersion)) { + $minVersion = preg_replace('/-(?:dev|alpha|beta|rc)$/', '', $minVersion); + if (preg_match('/^\d{2}\.\d{2}\.\d{2}$/', $minVersion)) { + if ($baseVersion === null || version_compare($minVersion, $baseVersion, '>')) { + $this->log('INFO', "Using --min-version {$minVersion} (higher than manifest {$baseVersion})"); + $baseVersion = $minVersion; + } + } + } + + // Auto-detect: scan git tags for higher versions from other channels + if ($baseVersion !== null) { + $gitTagVersion = $this->getHighestGitTagVersion($root); + if ($gitTagVersion !== null && version_compare($gitTagVersion, $baseVersion, '>')) { + $this->log('INFO', "Git tag version {$gitTagVersion} is higher than manifest {$baseVersion} — using as base"); + $baseVersion = $gitTagVersion; + } + } + if ($baseVersion === null) { $this->log('ERROR', "No version found in manifest.xml, README.md, or Joomla XML"); return 1; @@ -343,6 +366,54 @@ class VersionBumpCli extends CliFramework echo "{$old} -> {$newFull}\n"; return 0; } + + /** + * Scan git release tags for the highest version across all channels. + * + * Checks release names like "MokoSuiteClient (VERSION: 09.32.01)" in + * git tags (stable, release-candidate, development, etc.) to find the + * highest version that has been released on any channel. + */ + private function getHighestGitTagVersion(string $root): ?string + { + $highest = null; + + // Method 1: Parse version from git tag annotations / release commit messages + $output = []; + exec("cd " . escapeshellarg($root) . " && git log --all --oneline --grep='chore(version)' --grep='chore(release)' --format='%s' -20 2>/dev/null", $output); + + foreach ($output as $line) { + if (preg_match('/(\d{2}\.\d{2}\.\d{2})/', $line, $m)) { + $v = preg_replace('/-(?:dev|alpha|beta|rc)$/', '', $m[1]); + if ($highest === null || version_compare($v, $highest, '>')) { + $highest = $v; + } + } + } + + // Method 2: Check version in remote branches' manifest files + $branches = ['origin/main', 'origin/rc', 'origin/dev']; + $manifestPaths = ['source/pkg_*.xml', 'pkg_*.xml']; + + foreach ($branches as $branch) { + foreach ($manifestPaths as $pattern) { + $files = []; + exec("cd " . escapeshellarg($root) . " && git ls-tree --name-only {$branch} -- '{$pattern}' 2>/dev/null", $files); + + foreach ($files as $file) { + $content = shell_exec("cd " . escapeshellarg($root) . " && git show {$branch}:{$file} 2>/dev/null"); + if ($content && preg_match('#(\d{2}\.\d{2}\.\d{2})(?:-(?:dev|alpha|beta|rc))?#', $content, $m)) { + $v = $m[1]; + if ($highest === null || version_compare($v, $highest, '>')) { + $highest = $v; + } + } + } + } + } + + return $highest; + } } $app = new VersionBumpCli(); diff --git a/cli/version_check.php b/cli/version_check.php index 0c5b4d2..ebd0779 100644 --- a/cli/version_check.php +++ b/cli/version_check.php @@ -10,7 +10,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/version_check.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Validate version consistency across README, manifests, and sub-packages */ diff --git a/cli/wiki_sync.php b/cli/wiki_sync.php index 0916fa9..4c25e1a 100644 --- a/cli/wiki_sync.php +++ b/cli/wiki_sync.php @@ -10,7 +10,7 @@ * INGROUP: mokoplatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /cli/wiki_sync.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Sync select wiki pages from mokoplatform to all template repos */ diff --git a/cli/workflow_sync.php b/cli/workflow_sync.php index a168d11..25765c2 100644 --- a/cli/workflow_sync.php +++ b/cli/workflow_sync.php @@ -10,7 +10,7 @@ * INGROUP: moko-platform * REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform * PATH: /cli/workflow_sync.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Sync workflows from Generic → platform templates → live repos based on manifest.platform */ diff --git a/deploy/backup-before-deploy.php b/deploy/backup-before-deploy.php index 50caa26..72de919 100644 --- a/deploy/backup-before-deploy.php +++ b/deploy/backup-before-deploy.php @@ -12,7 +12,7 @@ * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /deploy/backup-before-deploy.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Snapshot Joomla directories before deployment for rollback capability */ diff --git a/deploy/deploy-dolibarr.php b/deploy/deploy-dolibarr.php index e31243c..1eb6dad 100644 --- a/deploy/deploy-dolibarr.php +++ b/deploy/deploy-dolibarr.php @@ -12,7 +12,7 @@ * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /deploy/deploy-dolibarr.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Deploy Dolibarr module files to a remote server via SFTP/rsync */ diff --git a/deploy/health-check.php b/deploy/health-check.php index b8e22b1..5fa1595 100644 --- a/deploy/health-check.php +++ b/deploy/health-check.php @@ -12,7 +12,7 @@ * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /deploy/health-check.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Post-deploy health check — verify a Joomla site is responding correctly */ diff --git a/deploy/rollback-joomla.php b/deploy/rollback-joomla.php index bfee124..5a17750 100644 --- a/deploy/rollback-joomla.php +++ b/deploy/rollback-joomla.php @@ -12,7 +12,7 @@ * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /deploy/rollback-joomla.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Rollback a Joomla deployment by restoring from a pre-deploy snapshot */ diff --git a/deploy/sync-joomla.php b/deploy/sync-joomla.php index 865044e..e57740b 100644 --- a/deploy/sync-joomla.php +++ b/deploy/sync-joomla.php @@ -12,7 +12,7 @@ * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /deploy/sync-joomla.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Sync Joomla site directories between two servers via rsync over SSH */ diff --git a/mcp/servers/mokocrm_api/CONTRIBUTING.md b/mcp/servers/mokocrm_api/CONTRIBUTING.md index a74f168..6ccbf1f 100644 --- a/mcp/servers/mokocrm_api/CONTRIBUTING.md +++ b/mcp/servers/mokocrm_api/CONTRIBUTING.md @@ -14,7 +14,7 @@ DEFGROUP: dolibarr-api-mcp.Documentation INGROUP: dolibarr-api-mcp REPO: https://git.mokoconsulting.tech/MokoConsulting/dolibarr-api-mcp - VERSION: 09.32.00 + VERSION: 09.32.01 PATH: ./CONTRIBUTING.md BRIEF: Contribution guidelines for the project --> diff --git a/mcp/servers/mokocrm_api/SECURITY.md b/mcp/servers/mokocrm_api/SECURITY.md index 2c85edb..ec2d220 100644 --- a/mcp/servers/mokocrm_api/SECURITY.md +++ b/mcp/servers/mokocrm_api/SECURITY.md @@ -10,7 +10,7 @@ DEFGROUP: dolibarr-api-mcp.Documentation INGROUP: dolibarr-api-mcp REPO: https://git.mokoconsulting.tech/MokoConsulting/dolibarr-api-mcp PATH: /SECURITY.md -VERSION: 09.32.00 +VERSION: 09.32.01 BRIEF: Security vulnerability reporting and handling policy --> diff --git a/mcp/servers/mokosuite_api/CONTRIBUTING.md b/mcp/servers/mokosuite_api/CONTRIBUTING.md index d2dcbcf..271f233 100644 --- a/mcp/servers/mokosuite_api/CONTRIBUTING.md +++ b/mcp/servers/mokosuite_api/CONTRIBUTING.md @@ -14,7 +14,7 @@ DEFGROUP: INGROUP: Project.Documentation REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoCli-Template-Generic - VERSION: 09.32.00 + VERSION: 09.32.01 PATH: ./CONTRIBUTING.md BRIEF: Contribution guidelines for the project --> diff --git a/mcp/servers/mokosuite_api/SECURITY.md b/mcp/servers/mokosuite_api/SECURITY.md index b11f23f..4e3bae9 100644 --- a/mcp/servers/mokosuite_api/SECURITY.md +++ b/mcp/servers/mokosuite_api/SECURITY.md @@ -23,7 +23,7 @@ DEFGROUP: [PROJECT_NAME] INGROUP: [PROJECT_NAME].Documentation REPO: [REPOSITORY_URL] PATH: /SECURITY.md -VERSION: 09.32.00 +VERSION: 09.32.01 BRIEF: Security vulnerability reporting and handling policy --> diff --git a/tests/Unit/VersionBumpTest.php b/tests/Unit/VersionBumpTest.php index 8dbf486..58151b5 100644 --- a/tests/Unit/VersionBumpTest.php +++ b/tests/Unit/VersionBumpTest.php @@ -63,7 +63,7 @@ class VersionBumpTest extends TestCase { file_put_contents( "{$this->tmpDir}/README.md", - "\nSome content\n" + "\nSome content\n" ); $this->execute(); diff --git a/tests/Unit/VersionReadTest.php b/tests/Unit/VersionReadTest.php index e982a0d..8d4a990 100644 --- a/tests/Unit/VersionReadTest.php +++ b/tests/Unit/VersionReadTest.php @@ -34,7 +34,7 @@ class VersionReadTest extends TestCase { file_put_contents( "{$this->tmpDir}/README.md", - "# Test\n\n" + "# Test\n\n" ); $this->assertSame('02.03.04', trim($this->runScript())); @@ -68,7 +68,7 @@ class VersionReadTest extends TestCase { file_put_contents( "{$this->tmpDir}/README.md", - "\n" + "\n" ); mkdir("{$this->tmpDir}/src", 0755, true); file_put_contents( diff --git a/validate/check_file_integrity.php b/validate/check_file_integrity.php index 65f66c4..711f116 100644 --- a/validate/check_file_integrity.php +++ b/validate/check_file_integrity.php @@ -12,7 +12,7 @@ * INGROUP: MokoPlatform * REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform * PATH: /validate/check_file_integrity.php - * VERSION: 09.32.00 + * VERSION: 09.32.01 * BRIEF: Compare deployed files on a remote server against the local repository to detect drift */