bug: release_package.php and version_bump.php fail with source/ entry-point #248

Closed
opened 2026-06-06 17:24:46 +00:00 by jmiller · 1 comment
Owner

Summary

CLI tools fail to build packages or bump versions when a repo uses source/ instead of src/ as entry-point. The SourceResolver class handles the fallback correctly, but:

  1. version_bump.php throws Class MokoEnterprise\SourceResolver not found if composer autoload is stale
  2. release_package.php produces wrong element name (mokowaas-*.zip instead of pkg_mokowaas-*.zip) and fails to build the top-level package ZIP
  3. The pre-release workflow completes in <5 seconds without producing artifacts

Root Cause

  • The autoloader issue is fixed by composer dump-autoload but the CI runner doesn't do this
  • The element detection reads entry-point from manifest.xml but the path handling on line 198 may not resolve correctly for all cases
  • MokoGitea now has a Manifest API (GET /repos/{owner}/{repo}/manifest) that returns entry_point, platform, package_type — the CLI tools should use this instead of parsing XML locally

Proposed Fix

  1. Add require_once __DIR__ . '/../vendor/autoload.php' to CLI entry points (or ensure CliFramework loads it)
  2. Use MokoGitea Manifest API as primary source for entry-point when running in CI (GITEA_TOKEN available)
  3. Fall back to local .mokogitea/manifest.xml parsing when offline
  4. Test with repos using source/ directory

Affected Repos

  • MokoWaaS (renamed src/ to source/ on 2026-06-06)
  • MokoWaaSBase (uses source/ from inception)
  • Any future repo following moko-platform standards

References

  • MokoGitea Manifest API: GET /repos/{owner}/{repo}/manifest returns entry_point field
  • SourceResolver already supports source/ as primary candidate
## Summary CLI tools fail to build packages or bump versions when a repo uses `source/` instead of `src/` as entry-point. The `SourceResolver` class handles the fallback correctly, but: 1. `version_bump.php` throws `Class MokoEnterprise\SourceResolver not found` if composer autoload is stale 2. `release_package.php` produces wrong element name (`mokowaas-*.zip` instead of `pkg_mokowaas-*.zip`) and fails to build the top-level package ZIP 3. The pre-release workflow completes in <5 seconds without producing artifacts ## Root Cause - The autoloader issue is fixed by `composer dump-autoload` but the CI runner doesn't do this - The element detection reads `entry-point` from manifest.xml but the path handling on line 198 may not resolve correctly for all cases - MokoGitea now has a Manifest API (`GET /repos/{owner}/{repo}/manifest`) that returns `entry_point`, `platform`, `package_type` — the CLI tools should use this instead of parsing XML locally ## Proposed Fix 1. Add `require_once __DIR__ . '/../vendor/autoload.php'` to CLI entry points (or ensure CliFramework loads it) 2. Use MokoGitea Manifest API as primary source for entry-point when running in CI (GITEA_TOKEN available) 3. Fall back to local `.mokogitea/manifest.xml` parsing when offline 4. Test with repos using `source/` directory ## Affected Repos - MokoWaaS (renamed `src/` to `source/` on 2026-06-06) - MokoWaaSBase (uses `source/` from inception) - Any future repo following moko-platform standards ## References - MokoGitea Manifest API: `GET /repos/{owner}/{repo}/manifest` returns `entry_point` field - SourceResolver already supports `source/` as primary candidate
Author
Owner

Branch created: feature/248-bug-release-package-php-and-version-bump

git fetch origin
git checkout feature/248-bug-release-package-php-and-version-bump
Branch created: [`feature/248-bug-release-package-php-and-version-bump`](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/src/branch/feature/248-bug-release-package-php-and-version-bump) ```bash git fetch origin git checkout feature/248-bug-release-package-php-and-version-bump ```
Sign in to join this conversation.
No labels
Priority -
Type -
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/mokoplatform#248