Compare commits

...

6 Commits

Author SHA1 Message Date
gitea-actions[bot] 1655e2a0ae chore: promote changelog [Unreleased] → [09.32.00] 2026-06-21 02:04:14 +00:00
gitea-actions[bot] 4aef631244 chore(release): build 09.32.00 [skip ci]
Platform: mokoplatform CI / Gate 2: Unit Tests (8.1) (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 2: Unit Tests (8.2) (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 2: Unit Tests (8.3) (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 3: Self-Health Check (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 4: Governance (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 5: Template Integrity (push) Blocked by required conditions
Platform: mokoplatform CI / CI Summary (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 1: Code Quality (push) Failing after 1m3s
2026-06-21 02:04:11 +00:00
jmiller 6b2cf099f7 Merge pull request 'feat: SourceResolver queries Gitea Manifest API for entry_point (#249)' (#286) from feature/249-source-resolver-api into main
Platform: mokoplatform CI / Gate 2: Unit Tests (8.1) (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 2: Unit Tests (8.2) (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 2: Unit Tests (8.3) (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 3: Self-Health Check (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 4: Governance (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 5: Template Integrity (push) Blocked by required conditions
Platform: mokoplatform CI / CI Summary (push) Blocked by required conditions
Platform: mokoplatform CI / Gate 1: Code Quality (push) Failing after 1m1s
2026-06-21 02:04:01 +00:00
gitea-actions[bot] fefa44965f chore(version): auto-bump patch 09.31.01-dev [skip ci]
Universal: Build & Release / Promote to RC (pull_request) Has been skipped
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Failing after 1s
Universal: Workflow Sync Trigger / Sync workflows to live repos (pull_request) Failing after 3s
Universal: Build & Release / Build & Release Pipeline (pull_request) Successful in 14s
2026-06-21 02:02:20 +00:00
Jonathan Miller 2b7e38b711 feat: SourceResolver queries Gitea Manifest API for entry_point (#249)
Universal: Auto Version Bump / Version Bump (push) Successful in 12s
SourceResolver::resolve() now checks the Gitea Manifest API first when
GA_TOKEN/GITEA_TOKEN and GITHUB_REPOSITORY are available (CI environments).
Falls back to filesystem detection (source/, src/, htdocs/) when offline.

- API results cached per org/repo for process lifetime
- 5s timeout to avoid blocking local dev
- resolveFromApi() also available as standalone method
- org/repo derived from GITHUB_REPOSITORY env or git remote URL
2026-06-20 21:02:04 -05:00
jmiller 3ed575906f chore: sync issue-branch.yml from Template-Generic [skip ci] 2026-06-21 01:40:36 +00:00
38 changed files with 141 additions and 43 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
# FILE INFORMATION
# DEFGROUP: Gitea.Workflow
# INGROUP: mokocli.Automation
# VERSION: 09.31.00
# VERSION: 09.32.00
# BRIEF: Auto-create feature branch when an issue is opened
name: "Universal: Issue Branch"
+4 -4
View File
@@ -12,6 +12,10 @@ BRIEF: Release changelog
# Changelog
## [Unreleased]
## [09.32.00] --- 2026-06-21
## [09.32.00] --- 2026-06-21
## [09.31.00] --- 2026-06-21
## [09.31.00] --- 2026-06-21
@@ -37,7 +41,3 @@ BRIEF: Release changelog
- Renamed `MokoEnterprise` namespace → `MokoCli` across all files
- Renamed `MokoStandardsParser` class → `ManifestParser`
- Fixed `composer.json` autoload paths: `src/``source/`
## [09.29.00] --- 2026-06-09
## [09.28.00] --- 2026-06-07
+1 -1
View File
@@ -6,7 +6,7 @@ DEFGROUP: MokoPlatform.Root
INGROUP: MokoPlatform
REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
PATH: /README.md
VERSION: 09.31.00
VERSION: 09.32.00
BRIEF: Project overview and documentation
-->
+1 -1
View File
@@ -10,7 +10,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/branch_rename.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Rename a git branch via Gitea API (create new, update PR, delete old)
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/bulk_workflow_push.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Push a workflow file to all governed repos via the Gitea Contents API
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/bulk_workflow_trigger.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Trigger a workflow across multiple repos at once
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/client_dashboard.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Generate unified client dashboard HTML
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/client_inventory.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Discover and list all client-waas repos with their server configuration status
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/client_provision.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Provision a new client environment end-to-end
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/grafana_dashboard.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Manage Grafana dashboards via API
*/
+1 -1
View File
@@ -10,7 +10,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/joomla_build.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Build a Joomla extension ZIP from manifest — all types supported
* NOTE: Called by pre-release and auto-release workflows.
*/
+1 -1
View File
@@ -10,7 +10,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/joomla_metadata_validate.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Validate MokoGitea repo metadata against Joomla extension manifest XML
*/
+1 -1
View File
@@ -10,7 +10,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/manifest_detect.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Auto-detect manifest fields from source files and optionally push to API
*/
+1 -1
View File
@@ -10,7 +10,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/manifest_integrity.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Cross-check manifest API fields against repo contents across the org
*/
+1 -1
View File
@@ -10,7 +10,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/manifest_licensing.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Ensure licensing tags (updateservers, dlid) in Joomla extension manifests
*/
+1 -1
View File
@@ -10,7 +10,7 @@
* INGROUP: mokocli
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
* PATH: /cli/manifest_read.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Read repo metadata from Gitea manifest API, auto-detect the rest
*/
+1 -1
View File
@@ -10,7 +10,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/platform_detect.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Auto-detect repository platform type and optionally update manifest
*/
+1 -1
View File
@@ -10,7 +10,7 @@
* INGROUP: mokocli
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokocli
* PATH: /cli/release_cascade.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Cascade release zip to all lower stability channels
*/
+1 -1
View File
@@ -10,7 +10,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/release_publish.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Publish a release and create copies for all lesser stability streams.
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/scaffold_client.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Scaffold a new client-waas repo from Template-Client-WaaS with pre-configured settings
*/
+1 -1
View File
@@ -10,7 +10,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/updates_xml_sync.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* 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
+1 -1
View File
@@ -10,7 +10,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/version_auto_bump.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Auto patch-bump, set stability suffix, and commit — single CLI replacing inline workflow bash
*/
+1 -1
View File
@@ -10,7 +10,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/version_check.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Validate version consistency across README, manifests, and sub-packages
*/
+1 -1
View File
@@ -10,7 +10,7 @@
* INGROUP: mokoplatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /cli/wiki_sync.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Sync select wiki pages from mokoplatform to all template repos
*/
+1 -1
View File
@@ -10,7 +10,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/workflow_sync.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Sync workflows from Generic → platform templates → live repos based on manifest.platform
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /deploy/backup-before-deploy.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Snapshot Joomla directories before deployment for rollback capability
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /deploy/deploy-dolibarr.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Deploy Dolibarr module files to a remote server via SFTP/rsync
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /deploy/health-check.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Post-deploy health check — verify a Joomla site is responding correctly
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /deploy/rollback-joomla.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Rollback a Joomla deployment by restoring from a pre-deploy snapshot
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /deploy/sync-joomla.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Sync Joomla site directories between two servers via rsync over SSH
*/
+100 -2
View File
@@ -51,17 +51,29 @@ class SourceResolver
*/
private const CANDIDATES = ['source', 'src', 'htdocs'];
/** Cache of API-resolved entry points keyed by "org/repo". */
private static array $apiCache = [];
/**
* Resolve the source directory name for a repository root.
*
* Returns the first candidate directory that exists, or 'source' as the
* default when no candidate is found (e.g. for new repos being scaffolded).
* Resolution order:
* 1. Gitea Manifest API `entry_point` (when GA_TOKEN/GITEA_TOKEN + GITHUB_REPOSITORY are set)
* 2. First candidate directory that exists on the filesystem
* 3. 'source' as the default (e.g. for new repos being scaffolded)
*
* @param string $root Absolute path to the repository root.
* @return string Directory name (e.g. 'source', 'src', 'htdocs').
*/
public static function resolve(string $root): string
{
// Try API first (CI environments where token + repo are available)
$apiResult = self::resolveFromApi($root);
if ($apiResult !== null) {
return $apiResult;
}
// Filesystem fallback
foreach (self::CANDIDATES as $candidate) {
if (is_dir("{$root}/{$candidate}")) {
return $candidate;
@@ -71,6 +83,92 @@ class SourceResolver
return 'source';
}
/**
* Query the MokoGitea Manifest API for the entry_point field.
*
* Only attempts the call when GA_TOKEN or GITEA_TOKEN is set. Results are
* cached per org/repo for the lifetime of the process.
*
* @param string $root Repository root (used to derive org/repo from git remote).
* @return string|null Directory name from entry_point, or null if unavailable.
*/
public static function resolveFromApi(string $root): ?string
{
$token = getenv('GA_TOKEN') ?: getenv('GITEA_TOKEN') ?: '';
if ($token === '') {
return null;
}
[$org, $repo] = self::resolveOrgRepo($root);
if ($org === '' || $repo === '') {
return null;
}
$cacheKey = "{$org}/{$repo}";
if (array_key_exists($cacheKey, self::$apiCache)) {
return self::$apiCache[$cacheKey];
}
$baseUrl = rtrim(getenv('GITEA_URL') ?: 'https://git.mokoconsulting.tech', '/');
$url = "{$baseUrl}/api/v1/repos/{$org}/{$repo}/manifest";
$ctx = stream_context_create([
'http' => [
'header' => "Authorization: token {$token}\r\nAccept: application/json\r\n",
'timeout' => 5,
'ignore_errors' => true,
],
]);
$body = @file_get_contents($url, false, $ctx);
if ($body === false) {
self::$apiCache[$cacheKey] = null;
return null;
}
$status = 0;
if (isset($http_response_header[0])) {
preg_match('/\d{3}/', $http_response_header[0], $m);
$status = (int) ($m[0] ?? 0);
}
if ($status < 200 || $status >= 300) {
self::$apiCache[$cacheKey] = null;
return null;
}
$data = json_decode($body, true);
$entryPoint = $data['entry_point'] ?? '';
// Normalize: "source/" → "source", "cli/" → "cli"
$result = ($entryPoint !== '') ? rtrim($entryPoint, '/') : null;
self::$apiCache[$cacheKey] = $result;
return $result;
}
/**
* Resolve org/repo from GITHUB_REPOSITORY env or git remote.
*
* @return array{0: string, 1: string}
*/
private static function resolveOrgRepo(string $root): array
{
$envRepo = getenv('GITHUB_REPOSITORY') ?: '';
if ($envRepo !== '' && str_contains($envRepo, '/')) {
return explode('/', $envRepo, 2);
}
$remoteUrl = trim((string) @shell_exec(
'git -C ' . escapeshellarg($root) . ' remote get-url origin 2>/dev/null'
));
if ($remoteUrl !== '' && preg_match('#[/:]([^/]+)/([^/]+?)(?:\.git)?$#', $remoteUrl, $m)) {
return [$m[1], $m[2]];
}
return ['', ''];
}
/**
* Resolve the source directory as an absolute path.
*
+1 -1
View File
@@ -14,7 +14,7 @@
DEFGROUP: dolibarr-api-mcp.Documentation
INGROUP: dolibarr-api-mcp
REPO: https://git.mokoconsulting.tech/MokoConsulting/dolibarr-api-mcp
VERSION: 09.31.00
VERSION: 09.32.00
PATH: ./CONTRIBUTING.md
BRIEF: Contribution guidelines for the project
-->
+1 -1
View File
@@ -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.31.00
VERSION: 09.32.00
BRIEF: Security vulnerability reporting and handling policy
-->
+1 -1
View File
@@ -14,7 +14,7 @@
DEFGROUP:
INGROUP: Project.Documentation
REPO: https://git.mokoconsulting.tech/MokoConsulting/MokoCli-Template-Generic
VERSION: 09.31.00
VERSION: 09.32.00
PATH: ./CONTRIBUTING.md
BRIEF: Contribution guidelines for the project
-->
+1 -1
View File
@@ -23,7 +23,7 @@ DEFGROUP: [PROJECT_NAME]
INGROUP: [PROJECT_NAME].Documentation
REPO: [REPOSITORY_URL]
PATH: /SECURITY.md
VERSION: 09.31.00
VERSION: 09.32.00
BRIEF: Security vulnerability reporting and handling policy
-->
+1 -1
View File
@@ -63,7 +63,7 @@ class VersionBumpTest extends TestCase
{
file_put_contents(
"{$this->tmpDir}/README.md",
"<!-- VERSION: 09.31.00 -->\nSome content\n"
"<!-- VERSION: 09.32.00 -->\nSome content\n"
);
$this->execute();
+2 -2
View File
@@ -34,7 +34,7 @@ class VersionReadTest extends TestCase
{
file_put_contents(
"{$this->tmpDir}/README.md",
"# Test\n<!-- VERSION: 09.31.00 -->\n"
"# Test\n<!-- VERSION: 09.32.00 -->\n"
);
$this->assertSame('02.03.04', trim($this->runScript()));
@@ -68,7 +68,7 @@ class VersionReadTest extends TestCase
{
file_put_contents(
"{$this->tmpDir}/README.md",
"<!-- VERSION: 09.31.00 -->\n"
"<!-- VERSION: 09.32.00 -->\n"
);
mkdir("{$this->tmpDir}/src", 0755, true);
file_put_contents(
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/mokoplatform
* PATH: /validate/check_file_integrity.php
* VERSION: 09.31.00
* VERSION: 09.32.00
* BRIEF: Compare deployed files on a remote server against the local repository to detect drift
*/