Public Access
fix: split repoRoot into apiRoot + standardsRoot
- Definitions load from MokoStandards-API (repoRoot = API repo) - Template files load from MokoStandards (standardsRoot = sibling dir) - Set MOKOSTANDARDS_ROOT env var to override template source location Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -167,7 +167,10 @@ class RepositorySynchronizer
|
||||
$this->logger->logInfo("Starting synchronization for {$org}/{$repo}");
|
||||
|
||||
// Resolve repo root (two levels up from this file: Enterprise/ → lib/ → api/ → root)
|
||||
$repoRoot = dirname(dirname(dirname(__DIR__)));
|
||||
// API repo root (definitions, sync code)
|
||||
$repoRoot = dirname(dirname(__DIR__));
|
||||
// MokoStandards repo root (templates, configs)
|
||||
$standardsRoot = getenv('MOKOSTANDARDS_ROOT') ?: dirname($repoRoot) . '/MokoStandards';
|
||||
|
||||
// Detect platform from repo metadata
|
||||
$repoInfo = $this->adapter->getRepo($org, $repo);
|
||||
@@ -212,7 +215,7 @@ class RepositorySynchronizer
|
||||
}
|
||||
|
||||
// Create PR with file updates driven by the definition
|
||||
$result = $this->createSyncPR($org, $repo, $platform, $filesToSync, $repoRoot, $force);
|
||||
$result = $this->createSyncPR($org, $repo, $platform, $filesToSync, $standardsRoot, $force);
|
||||
$prNumber = $result['number'] ?? null;
|
||||
$summary = $result['summary'] ?? [];
|
||||
|
||||
@@ -280,7 +283,7 @@ class RepositorySynchronizer
|
||||
$defaultBranch = $repoInfo['default_branch'] ?? 'main';
|
||||
|
||||
// Resolve repo root relative to this file's location
|
||||
$repoRoot = dirname(dirname(dirname(__DIR__)));
|
||||
$repoRoot = dirname(dirname(__DIR__));
|
||||
$baseDefPath = "{$repoRoot}/definitions/default/{$platform}.tf";
|
||||
if (!file_exists($baseDefPath)) {
|
||||
$baseDefPath = "{$repoRoot}/definitions/default/default-repository.tf";
|
||||
|
||||
Reference in New Issue
Block a user