Public Access
Merge pull request 'fix(workflow-sync): platform detection via /metadata API' (#343) from fix/sync-platform-metadata into main
Generic: Project CI / Tests (pull_request) Failing after 12s
Universal: PR Check / Branch Policy (pull_request) Successful in 1s
Universal: PR Check / Require Docs Update (pull_request) Has been skipped
Universal: PR Check / Wiki Update Reminder (pull_request) Has been skipped
Universal: PR Check / Secret Scan (pull_request) Successful in 8s
Generic: Project CI / Lint & Validate (pull_request) Successful in 39s
Universal: PR Check / Validate PR (pull_request) Failing after 4s
Cascade Main -> Dev / Cascade main -> dev (push) Successful in 9s
Generic: Standards Compliance / Secret Scanning (push) Failing after 5s
Generic: Standards Compliance / License Header Validation (push) Successful in 4s
Generic: Standards Compliance / Repository Structure Validation (push) Failing after 5s
Generic: Standards Compliance / Coding Standards Check (push) Successful in 9s
Platform: mokocli CI / Gate 1: Code Quality (pull_request) Successful in 1m17s
Generic: Standards Compliance / Workflow Configuration Check (push) Failing after 4s
Generic: Standards Compliance / Documentation Quality Check (push) Successful in 5s
Generic: Standards Compliance / README Completeness Check (push) Failing after 4s
Generic: Standards Compliance / Git Repository Hygiene (push) Successful in 6s
Platform: mokocli CI / Gate 1: Code Quality (push) Successful in 1m17s
Generic: Standards Compliance / Version Consistency Check (push) Successful in 48s
Generic: Standards Compliance / File Naming Standards (push) Successful in 4s
Generic: Standards Compliance / Script Integrity Validation (push) Successful in 5s
Generic: Standards Compliance / Line Length Check (push) Successful in 6s
Generic: Standards Compliance / Insecure Code Pattern Detection (push) Successful in 5s
Generic: Standards Compliance / Dead Code Detection (push) Successful in 8s
Generic: Standards Compliance / File Size Limits (push) Successful in 5s
Generic: Standards Compliance / Binary File Detection (push) Successful in 8s
Generic: Standards Compliance / TODO/FIXME Tracking (push) Successful in 4s
Generic: Standards Compliance / Code Complexity Analysis (push) Successful in 52s
Generic: Standards Compliance / Code Duplication Detection (push) Successful in 51s
Generic: Standards Compliance / Broken Link Detection (push) Successful in 7s
Generic: Standards Compliance / API Documentation Coverage (push) Successful in 4s
Generic: Standards Compliance / Accessibility Check (push) Successful in 4s
Generic: Standards Compliance / Performance Metrics (push) Successful in 4s
Generic: Standards Compliance / Dependency Vulnerability Scanning (push) Successful in 49s
Generic: Standards Compliance / Unused Dependencies Check (push) Successful in 53s
Generic: Standards Compliance / Terraform Configuration Validation (push) Successful in 8s
Generic: Standards Compliance / Enterprise Readiness Check (push) Failing after 48s
Generic: Standards Compliance / Repository Health Check (push) 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
Platform: mokocli CI / Gate 2: Unit Tests (8.1) (push) Has been cancelled
Platform: mokocli CI / Gate 2: Unit Tests (8.2) (push) Has been cancelled
Platform: mokocli CI / Gate 2: Unit Tests (8.3) (push) Has been cancelled
Platform: mokocli CI / Gate 3: Self-Health Check (push) Has been cancelled
Platform: mokocli CI / Gate 4: Governance (push) Has been cancelled
Platform: mokocli CI / Gate 5: Template Integrity (push) Has been cancelled
Platform: mokocli CI / CI Summary (push) Has been cancelled
Generic: Standards Compliance / Compliance Summary (push) Has been cancelled
Generic: Project CI / Tests (pull_request) Failing after 12s
Universal: PR Check / Branch Policy (pull_request) Successful in 1s
Universal: PR Check / Require Docs Update (pull_request) Has been skipped
Universal: PR Check / Wiki Update Reminder (pull_request) Has been skipped
Universal: PR Check / Secret Scan (pull_request) Successful in 8s
Generic: Project CI / Lint & Validate (pull_request) Successful in 39s
Universal: PR Check / Validate PR (pull_request) Failing after 4s
Cascade Main -> Dev / Cascade main -> dev (push) Successful in 9s
Generic: Standards Compliance / Secret Scanning (push) Failing after 5s
Generic: Standards Compliance / License Header Validation (push) Successful in 4s
Generic: Standards Compliance / Repository Structure Validation (push) Failing after 5s
Generic: Standards Compliance / Coding Standards Check (push) Successful in 9s
Platform: mokocli CI / Gate 1: Code Quality (pull_request) Successful in 1m17s
Generic: Standards Compliance / Workflow Configuration Check (push) Failing after 4s
Generic: Standards Compliance / Documentation Quality Check (push) Successful in 5s
Generic: Standards Compliance / README Completeness Check (push) Failing after 4s
Generic: Standards Compliance / Git Repository Hygiene (push) Successful in 6s
Platform: mokocli CI / Gate 1: Code Quality (push) Successful in 1m17s
Generic: Standards Compliance / Version Consistency Check (push) Successful in 48s
Generic: Standards Compliance / File Naming Standards (push) Successful in 4s
Generic: Standards Compliance / Script Integrity Validation (push) Successful in 5s
Generic: Standards Compliance / Line Length Check (push) Successful in 6s
Generic: Standards Compliance / Insecure Code Pattern Detection (push) Successful in 5s
Generic: Standards Compliance / Dead Code Detection (push) Successful in 8s
Generic: Standards Compliance / File Size Limits (push) Successful in 5s
Generic: Standards Compliance / Binary File Detection (push) Successful in 8s
Generic: Standards Compliance / TODO/FIXME Tracking (push) Successful in 4s
Generic: Standards Compliance / Code Complexity Analysis (push) Successful in 52s
Generic: Standards Compliance / Code Duplication Detection (push) Successful in 51s
Generic: Standards Compliance / Broken Link Detection (push) Successful in 7s
Generic: Standards Compliance / API Documentation Coverage (push) Successful in 4s
Generic: Standards Compliance / Accessibility Check (push) Successful in 4s
Generic: Standards Compliance / Performance Metrics (push) Successful in 4s
Generic: Standards Compliance / Dependency Vulnerability Scanning (push) Successful in 49s
Generic: Standards Compliance / Unused Dependencies Check (push) Successful in 53s
Generic: Standards Compliance / Terraform Configuration Validation (push) Successful in 8s
Generic: Standards Compliance / Enterprise Readiness Check (push) Failing after 48s
Generic: Standards Compliance / Repository Health Check (push) 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
Platform: mokocli CI / Gate 2: Unit Tests (8.1) (push) Has been cancelled
Platform: mokocli CI / Gate 2: Unit Tests (8.2) (push) Has been cancelled
Platform: mokocli CI / Gate 2: Unit Tests (8.3) (push) Has been cancelled
Platform: mokocli CI / Gate 3: Self-Health Check (push) Has been cancelled
Platform: mokocli CI / Gate 4: Governance (push) Has been cancelled
Platform: mokocli CI / Gate 5: Template Integrity (push) Has been cancelled
Platform: mokocli CI / CI Summary (push) Has been cancelled
Generic: Standards Compliance / Compliance Summary (push) Has been cancelled
This commit was merged in pull request #343.
This commit is contained in:
+7
-68
@@ -593,8 +593,10 @@ class WorkflowSyncCli extends CliFramework
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a repo's manifest.xml and extract the platform value.
|
||||
* Returns 'generic' if the manifest is missing or has no platform field.
|
||||
* Read a repo's platform from the MokoGitea metadata API.
|
||||
* Returns 'generic' if metadata is missing or has no platform field.
|
||||
* (Replaces the retired .mokogitea/manifest.xml lookup — platform now lives
|
||||
* in the repo Metadata endpoint: GET /api/v1/repos/{owner}/{repo}/metadata.)
|
||||
*/
|
||||
private function getRepoPlatform(
|
||||
string $giteaUrl,
|
||||
@@ -607,7 +609,7 @@ class WorkflowSyncCli extends CliFramework
|
||||
$giteaUrl,
|
||||
$token,
|
||||
'GET',
|
||||
"/api/v1/repos/{$org}/{$repoName}/contents/.mokogitea/manifest.xml?ref={$branch}"
|
||||
"/api/v1/repos/{$org}/{$repoName}/metadata"
|
||||
);
|
||||
|
||||
if ($response['code'] !== 200) {
|
||||
@@ -616,74 +618,11 @@ class WorkflowSyncCli extends CliFramework
|
||||
|
||||
$data = json_decode($response['body'], true);
|
||||
|
||||
if (!is_array($data) || !isset($data['content'])) {
|
||||
if (!is_array($data) || empty($data['platform'])) {
|
||||
return 'generic';
|
||||
}
|
||||
|
||||
$xmlContent = base64_decode($data['content']);
|
||||
|
||||
if ($xmlContent === false || $xmlContent === '') {
|
||||
return 'generic';
|
||||
}
|
||||
|
||||
// Suppress XML warnings for malformed manifests
|
||||
$previous = libxml_use_internal_errors(true);
|
||||
$xml = simplexml_load_string($xmlContent);
|
||||
libxml_use_internal_errors($previous);
|
||||
|
||||
if ($xml === false) {
|
||||
return 'generic';
|
||||
}
|
||||
|
||||
// Try <governance><platform> (standard location)
|
||||
$platform = '';
|
||||
|
||||
// Register namespace if present
|
||||
$namespaces = $xml->getNamespaces(true);
|
||||
|
||||
if (!empty($namespaces)) {
|
||||
$ns = reset($namespaces);
|
||||
$xml->registerXPathNamespace('mp', $ns);
|
||||
|
||||
$nodes = $xml->xpath('//mp:governance/mp:platform');
|
||||
|
||||
if (!empty($nodes)) {
|
||||
$platform = trim((string) $nodes[0]);
|
||||
}
|
||||
|
||||
// Fallback: <identity><platform>
|
||||
if ($platform === '') {
|
||||
$nodes = $xml->xpath('//mp:identity/mp:platform');
|
||||
|
||||
if (!empty($nodes)) {
|
||||
$platform = trim((string) $nodes[0]);
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback: top-level <platform>
|
||||
if ($platform === '') {
|
||||
$nodes = $xml->xpath('//mp:platform');
|
||||
|
||||
if (!empty($nodes)) {
|
||||
$platform = trim((string) $nodes[0]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// No namespace
|
||||
if (isset($xml->governance->platform)) {
|
||||
$platform = trim((string) $xml->governance->platform);
|
||||
} elseif (isset($xml->identity->platform)) {
|
||||
$platform = trim((string) $xml->identity->platform);
|
||||
} elseif (isset($xml->platform)) {
|
||||
$platform = trim((string) $xml->platform);
|
||||
}
|
||||
}
|
||||
|
||||
if ($platform === '') {
|
||||
return 'generic';
|
||||
}
|
||||
|
||||
return strtolower($platform);
|
||||
return strtolower(trim((string) $data['platform']));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user