feat: validate Joomla metadata against package/component XML manifest #257

Open
opened 2026-06-18 20:12:52 +00:00 by jmiller · 1 comment
Owner

Problem

MokoGitea repo metadata (.mokogitea/manifest.xml) drives the update server feed (updates.xml). If the metadata doesn't match the actual Joomla package/component XML manifest, updates break silently — the <element>, <type>, and <client> in the feed won't match what Joomla registers in #__extensions.

This mismatch blocked MokoSuiteBackup updates for days before it was caught manually.

Proposed Feature

Add a moko validate:joomla-metadata CLI command that:

  1. Reads the MokoGitea repo metadata (via API or .mokogitea/manifest.xml)
  2. Reads the Joomla manifest XML (e.g. source/pkg_mokosuitebackup.xml or source/packages/com_mokosuitebackup/mokosuitebackup.xml)
  3. Compares critical fields and reports mismatches

Fields to validate

Metadata Field Joomla XML Source Match Rule
package_type <extension type=\"...\"> Must match (package, component, module, etc.)
element name (derived) <packagename> / <element> / <name> Must match Joomla's element derivation logic
display_name <name> tag Should match
version <version> tag Should match (warn if different)
php_minimum composer.json require.php Should match
target_version <targetplatform version> in update XML Should match pattern
description <description> tag Should match

Output example

$ moko validate:joomla-metadata

Validating MokoSuiteBackup metadata...

  package_type: package ✓ (matches <extension type=\"package\">)
  element:      pkg_mokosuitebackup ✓ (derived from package + mokosuitebackup)
  display_name: Package - MokoSuiteBackup ✓
  version:      01.22.09-dev ✓
  php_minimum:  8.1 ✓ (matches composer.json)

  ✓ All checks passed

Error example

  element:      MokoSuiteBackup ✗ (expected pkg_mokosuitebackup)
    Fix: Set package_type to \"package\" in .mokogitea/manifest.xml

  ✗ 1 mismatch found — update delivery will fail

Integration

  • Should be callable standalone: moko validate:joomla-metadata
  • Should also be callable from CI workflows (exit code 1 on failure)
  • The Template-Joomla repo should add this as a step in ci-joomla.yml and pr-check.yml

Related

  • MokoGitea-Fork #635 — element name derivation fix
  • MokoGitea-Fork PR #643 — lowercase + clean element names
## Problem MokoGitea repo metadata (`.mokogitea/manifest.xml`) drives the update server feed (`updates.xml`). If the metadata doesn't match the actual Joomla package/component XML manifest, updates break silently — the `<element>`, `<type>`, and `<client>` in the feed won't match what Joomla registers in `#__extensions`. This mismatch blocked MokoSuiteBackup updates for days before it was caught manually. ## Proposed Feature Add a `moko validate:joomla-metadata` CLI command that: 1. Reads the MokoGitea repo metadata (via API or `.mokogitea/manifest.xml`) 2. Reads the Joomla manifest XML (e.g. `source/pkg_mokosuitebackup.xml` or `source/packages/com_mokosuitebackup/mokosuitebackup.xml`) 3. Compares critical fields and reports mismatches ### Fields to validate | Metadata Field | Joomla XML Source | Match Rule | |---|---|---| | `package_type` | `<extension type=\"...\">` | Must match (package, component, module, etc.) | | element name (derived) | `<packagename>` / `<element>` / `<name>` | Must match Joomla's element derivation logic | | `display_name` | `<name>` tag | Should match | | `version` | `<version>` tag | Should match (warn if different) | | `php_minimum` | composer.json `require.php` | Should match | | `target_version` | `<targetplatform version>` in update XML | Should match pattern | | `description` | `<description>` tag | Should match | ### Output example ``` $ moko validate:joomla-metadata Validating MokoSuiteBackup metadata... package_type: package ✓ (matches <extension type=\"package\">) element: pkg_mokosuitebackup ✓ (derived from package + mokosuitebackup) display_name: Package - MokoSuiteBackup ✓ version: 01.22.09-dev ✓ php_minimum: 8.1 ✓ (matches composer.json) ✓ All checks passed ``` ### Error example ``` element: MokoSuiteBackup ✗ (expected pkg_mokosuitebackup) Fix: Set package_type to \"package\" in .mokogitea/manifest.xml ✗ 1 mismatch found — update delivery will fail ``` ## Integration - Should be callable standalone: `moko validate:joomla-metadata` - Should also be callable from CI workflows (exit code 1 on failure) - The Template-Joomla repo should add this as a step in `ci-joomla.yml` and `pr-check.yml` ## Related - MokoGitea-Fork #635 — element name derivation fix - MokoGitea-Fork PR #643 — lowercase + clean element names
Author
Owner

Branch created: feature/257-feat-validate-joomla-metadata-against-pa

git fetch origin
git checkout feature/257-feat-validate-joomla-metadata-against-pa
Branch created: [`feature/257-feat-validate-joomla-metadata-against-pa`](https://git.mokoconsulting.tech/MokoConsulting/mokoplatform/src/branch/feature/257-feat-validate-joomla-metadata-against-pa) ```bash git fetch origin git checkout feature/257-feat-validate-joomla-metadata-against-pa ```
Sign in to join this conversation.
No labels
Priority Medium
Type Feature
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/mokoplatform#257