fix: auto-download pre-built release for empty submodule sub-packages #325

Open
jmiller wants to merge 1 commits from fix/submodule-release-download into dev
Owner

Summary

  • When a Joomla package has a sub-package that is a git submodule with an empty/missing source directory (e.g. failed CI checkout), the packager now falls back to downloading the latest stable release ZIP from the submodule's Gitea remote
  • Also supports pre-staged ZIPs in the output directory for manual/workflow pre-population
  • Fixes MokoSuiteBackup "Install path does not exist: MokoSuiteClient.zip" error caused by empty submodule during CI build

How it works

  1. Pre-built ZIP check: If a ZIP already exists in the output dir for a sub-package, use it directly (skip building from source)
  2. Submodule release download: If the source dir has no manifest XML (empty submodule), read .gitmodules to find the remote URL, derive the Gitea API path, and download the latest stable release asset
  3. Build from source: Original behavior as fallback

Test plan

  • Verify normal packaging (submodule present) still works as before
  • Test with empty submodule directory — should auto-download from Gitea release
  • Test with pre-staged ZIP in output directory — should use it directly
  • Verify MokoSuiteBackup release package includes valid MokoSuiteClient.zip (~4 MB)

https://claude.ai/code/session_01MbEjBtsSjPuTWhqqrMS2wG

## Summary - When a Joomla package has a sub-package that is a git submodule with an empty/missing source directory (e.g. failed CI checkout), the packager now falls back to downloading the latest stable release ZIP from the submodule's Gitea remote - Also supports pre-staged ZIPs in the output directory for manual/workflow pre-population - Fixes MokoSuiteBackup "Install path does not exist: MokoSuiteClient.zip" error caused by empty submodule during CI build ## How it works 1. **Pre-built ZIP check**: If a ZIP already exists in the output dir for a sub-package, use it directly (skip building from source) 2. **Submodule release download**: If the source dir has no manifest XML (empty submodule), read `.gitmodules` to find the remote URL, derive the Gitea API path, and download the latest `stable` release asset 3. **Build from source**: Original behavior as fallback ## Test plan - [ ] Verify normal packaging (submodule present) still works as before - [ ] Test with empty submodule directory — should auto-download from Gitea release - [ ] Test with pre-staged ZIP in output directory — should use it directly - [ ] Verify MokoSuiteBackup release package includes valid MokoSuiteClient.zip (~4 MB) https://claude.ai/code/session_01MbEjBtsSjPuTWhqqrMS2wG
jmiller added 1 commit 2026-06-28 19:35:25 +00:00
fix: auto-download pre-built release for empty submodule sub-packages
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 16s
Universal: PR Check / Branch Policy (pull_request) Successful in 1s
Universal: PR Check / Validate PR (pull_request) Failing after 6s
Universal: PR Check / Secret Scan (pull_request) Successful in 8s
Platform: mokocli CI / Gate 1: Code Quality (pull_request) Failing after 48s
Platform: mokocli CI / Gate 2: Unit Tests (8.1) (pull_request) Has been cancelled
Platform: mokocli CI / Gate 2: Unit Tests (8.2) (pull_request) Has been cancelled
Platform: mokocli CI / Gate 2: Unit Tests (8.3) (pull_request) Has been cancelled
Platform: mokocli CI / Gate 3: Self-Health Check (pull_request) Has been cancelled
Platform: mokocli CI / Gate 4: Governance (pull_request) Has been cancelled
Platform: mokocli CI / Gate 5: Template Integrity (pull_request) Has been cancelled
Platform: mokocli CI / CI Summary (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
84259c6636
When a Joomla package has a sub-package that is a git submodule with an
empty or missing source directory (e.g. failed CI checkout), the packager
now falls back to downloading the latest stable release ZIP from the
submodule's Gitea remote.

Also supports pre-staged ZIPs in the output directory, allowing manual
or workflow-based pre-population of sub-package archives.

Claude-Session: https://claude.ai/code/session_01MbEjBtsSjPuTWhqqrMS2wG
Some required checks failed
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 16s
Universal: PR Check / Branch Policy (pull_request) Successful in 1s
Universal: PR Check / Validate PR (pull_request) Failing after 6s
Universal: PR Check / Secret Scan (pull_request) Successful in 8s
Platform: mokocli CI / Gate 1: Code Quality (pull_request) Failing after 48s
Platform: mokocli CI / Gate 2: Unit Tests (8.1) (pull_request) Has been cancelled
Platform: mokocli CI / Gate 2: Unit Tests (8.2) (pull_request) Has been cancelled
Platform: mokocli CI / Gate 2: Unit Tests (8.3) (pull_request) Has been cancelled
Platform: mokocli CI / Gate 3: Self-Health Check (pull_request) Has been cancelled
Platform: mokocli CI / Gate 4: Governance (pull_request) Has been cancelled
Platform: mokocli CI / Gate 5: Template Integrity (pull_request) Has been cancelled
Platform: mokocli CI / CI Summary (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/submodule-release-download:fix/submodule-release-download
git checkout fix/submodule-release-download
Sign in to join this conversation.
No Reviewers
No labels
Priority -
Type -
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoCLI#325