feat: manifest.xml as canonical version source
Generic: Repo Health / Site Health (push) Has been cancelled
Generic: Repo Health / Access control (push) Has been cancelled
Universal: PR Check / Branch Policy (pull_request) Has been cancelled
Generic: Repo Health / Site Health (pull_request) Has been cancelled
Generic: Repo Health / Access control (pull_request) Has been cancelled
Universal: Secret Scanning / Gitleaks Secret Scan (pull_request) Has been cancelled
Universal: PR Check / Validate PR (pull_request) Has been cancelled
Universal: Security Audit / Dependency Audit (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 1: Code Quality (push) Has been cancelled
Platform: moko-platform CI / Gate 1: Code Quality (pull_request) Has been cancelled
Universal: Build & Release / Promote Pre-Release to RC (pull_request) Has been cancelled
Universal: Build & Release / Build & Release Pipeline (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (push) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (push) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (push) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (push) Has been cancelled
Platform: moko-platform CI / CI Summary (push) Has been cancelled
Generic: Repo Health / Release configuration (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (pull_request) Has been cancelled
Platform: moko-platform CI / CI Summary (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Generic: Repo Health / Release configuration (pull_request) Has been cancelled
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled

- version_bump.php: insert <version> tag into manifest.xml if missing
  (placed before <license> per schema order)
- version_read.php: backfill <version> into manifest.xml from fallback
  sources (README.md, Joomla XML) on first read
- manifest-schema.xsd: add version="09.01.00" attribute to xs:schema
- manifest.xml: add <version>, xsi:schemaLocation pointing to schema
  on moko-platform main branch

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-05-26 15:03:52 -05:00
parent 48d574e225
commit e15421699e
4 changed files with 60 additions and 9 deletions
+5 -1
View File
@@ -4,11 +4,15 @@
Auto-generated by cleanup script.
See: https://git.mokoconsulting.tech/MokoConsulting/moko-platform/wiki/Home
-->
<moko-platform xmlns="https://standards.mokoconsulting.tech/moko-platform/1.0" schema-version="1.0">
<moko-platform xmlns="https://standards.mokoconsulting.tech/moko-platform/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://standards.mokoconsulting.tech/moko-platform/1.0 https://git.mokoconsulting.tech/MokoConsulting/moko-platform/raw/branch/main/definitions/manifest-schema.xsd"
schema-version="1.0">
<identity>
<name>moko-platform</name>
<org>MokoConsulting</org>
<description>Enterprise automation, validation, sync, and governance engine for all Moko Consulting repositories</description>
<version>09.01.00</version>
<license spdx="GPL-3.0-or-later">GNU General Public License v3</license>
</identity>
<governance>
+28 -6
View File
@@ -128,12 +128,34 @@ $new = sprintf('%02d.%02d.%02d', $major, $minor, $patch);
// -- Update .mokogitea/manifest.xml (canonical target) --
if (file_exists($mokoManifest) && !empty($mokoContent)) {
$updated = preg_replace(
'|<version>\d{2}\.\d{2}\.\d{2}</version>|',
"<version>{$new}</version>",
$mokoContent,
1
);
if (preg_match('|<version>\d{2}\.\d{2}\.\d{2}</version>|', $mokoContent)) {
// Replace existing version tag
$updated = preg_replace(
'|<version>\d{2}\.\d{2}\.\d{2}</version>|',
"<version>{$new}</version>",
$mokoContent,
1
);
} else {
// Insert <version> before <license> (per schema order) or as last child of <identity>
if (strpos($mokoContent, '<license') !== false) {
$updated = preg_replace(
'|(\s*<license)|',
"\n <version>{$new}</version>\$1",
$mokoContent,
1
);
} elseif (strpos($mokoContent, '</identity>') !== false) {
$updated = preg_replace(
'|(</identity>)|',
" <version>{$new}</version>\n \$1",
$mokoContent,
1
);
} else {
$updated = $mokoContent;
}
}
file_put_contents($mokoManifest, $updated);
}
+24
View File
@@ -89,5 +89,29 @@ if ($version === null) {
exit(1);
}
// -- Backfill: if manifest.xml exists but lacks <version>, insert it --
if ($mokoVersion === null && file_exists($mokoManifest)) {
$content = file_get_contents($mokoManifest);
if (!preg_match('|<version>\d{2}\.\d{2}\.\d{2}</version>|', $content)) {
if (strpos($content, '<license') !== false) {
$content = preg_replace(
'|(\s*<license)|',
"\n <version>{$version}</version>\$1",
$content,
1
);
} elseif (strpos($content, '</identity>') !== false) {
$content = preg_replace(
'|(</identity>)|',
" <version>{$version}</version>\n \$1",
$content,
1
);
}
file_put_contents($mokoManifest, $content);
fwrite(STDERR, "Backfilled manifest.xml with version {$version}\n");
}
}
echo $version . "\n";
exit(0);
+3 -2
View File
@@ -3,7 +3,7 @@
Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
SPDX-License-Identifier: GPL-3.0-or-later
MokoStandards Manifest Schema v1.0
MokoStandards Manifest Schema v09.01.00
Defines the structure of .mokogitea/manifest.xml
Validate: xmllint - -schema definitions/manifest-schema.xsd .mokogitea/manifest.xml
@@ -11,7 +11,8 @@
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:moko="https://standards.mokoconsulting.tech/moko-platform/1.0"
targetNamespace="https://standards.mokoconsulting.tech/moko-platform/1.0"
elementFormDefault="qualified">
elementFormDefault="qualified"
version="09.01.00">
<!-- Root element -->
<xs:element name="moko-platform">