This commit is contained in:
team 1
2026-05-07 08:24:16 +02:00
parent f47aa2c42a
commit 0523984274
6 changed files with 766 additions and 5 deletions

View File

@@ -43,7 +43,7 @@ final class ConfigSourceAuditCommand extends Command
$this->renderSummary(new SymfonyStyle($input, $output), $result, (bool) $input->getOption('details'));
return Command::SUCCESS;
return ($result['status'] ?? 'UNKNOWN') === 'ERROR' ? Command::FAILURE : Command::SUCCESS;
}
/**
@@ -65,9 +65,20 @@ final class ConfigSourceAuditCommand extends Command
['constructor_defaults' => (string) ($summary['constructor_defaults'] ?? 0)],
['constructor_defaults_without_yaml_mapping' => (string) ($summary['constructor_defaults_without_yaml_mapping'] ?? 0)],
['genre_value_paths_with_source_paths' => (string) ($summary['genre_value_paths_with_source_paths'] ?? 0)],
['genre_declared_source_paths' => (string) ($summary['genre_declared_source_paths'] ?? 0)]
['genre_declared_source_paths' => (string) ($summary['genre_declared_source_paths'] ?? 0)],
['genre_source_of_truth_violations' => (string) ($summary['genre_source_of_truth_violations'] ?? 0)],
['genre_source_of_truth_fallback_empty' => (string) ($summary['genre_source_of_truth_fallback_empty'] ?? 0)],
['genre_source_of_truth_frozen_non_empty' => (string) ($summary['genre_source_of_truth_frozen_non_empty'] ?? 0)]
);
$errors = is_array($result['errors'] ?? null) ? $result['errors'] : [];
if ($errors !== []) {
$io->section('Errors');
foreach ($errors as $error) {
$io->writeln('- ' . (string) $error);
}
}
$warnings = is_array($result['warnings'] ?? null) ? $result['warnings'] : [];
if ($warnings !== []) {
$io->section('Warnings');
@@ -120,5 +131,26 @@ final class ConfigSourceAuditCommand extends Command
$io->section('Single-genre configuration source paths');
$io->table(['Genre value path', 'Legacy/effective source path'], $genreSourceRows);
}
$sourceOfTruthRows = [];
$sourceOfTruth = is_array($result['genre_source_of_truth'] ?? null) ? $result['genre_source_of_truth'] : [];
foreach (($sourceOfTruth['source_path_rows'] ?? []) as $item) {
if (!is_array($item)) {
continue;
}
$sourceOfTruthRows[] = [
(string) ($item['genre_value_path'] ?? ''),
(string) ($item['source_path'] ?? ''),
(string) ($item['state'] ?? ''),
(string) ($item['hash'] ?? ''),
];
}
if ($sourceOfTruthRows !== []) {
$io->section('Genre source-of-truth guard');
$io->table(['Genre value path', 'Legacy/effective source path', 'State', 'Hash'], $sourceOfTruthRows);
}
}
}