sdasd
This commit is contained in:
@@ -38,6 +38,31 @@ final class GiteaDeployStatusService
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function diagnostics(): array
|
||||
{
|
||||
$repositories = array_values(array_filter(array_map(function (mixed $entry): ?string {
|
||||
$normalized = $this->normalizeRepositoryEntry($entry);
|
||||
|
||||
return $normalized['full_name'] ?? null;
|
||||
}, (array) ($this->config['repositories'] ?? []))));
|
||||
|
||||
return [
|
||||
'configured' => $this->isConfigured(),
|
||||
'visibility' => $this->visibility(),
|
||||
'base_url_present' => $this->baseUrl() !== '',
|
||||
'base_url' => $this->baseUrl(),
|
||||
'token_present' => $this->token() !== '',
|
||||
'token_length' => strlen($this->token()),
|
||||
'owner' => trim((string) ($this->config['owner'] ?? '')),
|
||||
'repositories_configured' => $repositories,
|
||||
'poll_idle_seconds' => max(1, (int) ($this->config['poll_idle_seconds'] ?? 5)),
|
||||
'poll_running_seconds' => max(1, (int) ($this->config['poll_running_seconds'] ?? 1)),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
@@ -53,6 +78,7 @@ final class GiteaDeployStatusService
|
||||
'message' => 'Gitea-Status ist noch nicht konfiguriert.',
|
||||
'running_jobs' => [],
|
||||
'repositories_checked' => 0,
|
||||
'diagnostics' => $this->diagnostics(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -96,6 +122,7 @@ final class GiteaDeployStatusService
|
||||
'message' => $message,
|
||||
'running_jobs' => $runningJobs,
|
||||
'repositories_checked' => count($repositories),
|
||||
'diagnostics' => $this->diagnostics(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -105,6 +132,7 @@ final class GiteaDeployStatusService
|
||||
'message' => sprintf('Kein laufendes Gitea-Deployment in %d Repositories.', count($repositories)),
|
||||
'running_jobs' => [],
|
||||
'repositories_checked' => count($repositories),
|
||||
'diagnostics' => $this->diagnostics(),
|
||||
];
|
||||
} catch (\Throwable $exception) {
|
||||
return [
|
||||
@@ -113,6 +141,7 @@ final class GiteaDeployStatusService
|
||||
'message' => 'Gitea-Status konnte nicht geladen werden: ' . $exception->getMessage(),
|
||||
'running_jobs' => [],
|
||||
'repositories_checked' => 0,
|
||||
'diagnostics' => $this->diagnostics(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user