Release v0.1.16
This commit is contained in:
@@ -31,6 +31,8 @@ ENDPOINT_SURFACE_CATEGORIES = {
|
||||
DEFAULT_ENDPOINT_DECLARATIONS = (
|
||||
META_ROOT / "tools" / "inventory" / "endpoint-surface-declarations.json"
|
||||
)
|
||||
REQUIRED_LOCALES = ("de", "en")
|
||||
REFERENCE_LOCALE = "de"
|
||||
|
||||
|
||||
def main() -> int:
|
||||
@@ -353,6 +355,14 @@ def _extract_manifests(
|
||||
}
|
||||
for permission in manifest.permissions
|
||||
],
|
||||
"architecture": (
|
||||
manifest.architecture.to_dict()
|
||||
if manifest.architecture is not None
|
||||
else None
|
||||
),
|
||||
"information_governance": (
|
||||
manifest.information_governance.to_dict()
|
||||
),
|
||||
"interface_catalog": manifest_interface_catalog(manifest),
|
||||
"frontend": (
|
||||
{
|
||||
@@ -447,20 +457,27 @@ def _assemble_inventory(
|
||||
usages = {item["key"] for item in webui["translationUsages"]}
|
||||
catalogs = webui["translationCatalog"]
|
||||
catalog_keys = {locale: set(entries) for locale, entries in catalogs.items()}
|
||||
expected_locales = sorted(catalog_keys)
|
||||
expected_locales = sorted(set(catalog_keys) | set(REQUIRED_LOCALES))
|
||||
missing_catalog_entries = [
|
||||
{
|
||||
"key": key,
|
||||
"missing_locales": [
|
||||
locale for locale in expected_locales if key not in catalog_keys[locale]
|
||||
locale
|
||||
for locale in expected_locales
|
||||
if key not in catalog_keys.get(locale, set())
|
||||
],
|
||||
}
|
||||
for key in sorted(usages)
|
||||
if any(key not in catalog_keys[locale] for locale in expected_locales)
|
||||
if any(key not in catalog_keys.get(locale, set()) for locale in expected_locales)
|
||||
]
|
||||
fields = webui["fields"]
|
||||
help_candidates = [field for field in fields if field["helpCandidate"]]
|
||||
dynamic_help = [field for field in fields if field.get("helpDynamic")]
|
||||
governance_adoption = Counter(
|
||||
dimension["adoption"]
|
||||
for manifest in manifests
|
||||
for dimension in manifest["information_governance"]["dimensions"].values()
|
||||
)
|
||||
source_declarations = _source_interface_declarations(webui, manifests)
|
||||
declaration_health = _declaration_health(source_declarations, manifests)
|
||||
runtime_comparison = (
|
||||
@@ -502,9 +519,26 @@ def _assemble_inventory(
|
||||
},
|
||||
"translation_health": {
|
||||
"locales": expected_locales,
|
||||
"reference_locale": REFERENCE_LOCALE,
|
||||
"reference_locale_entries": len(catalog_keys.get(REFERENCE_LOCALE, set())),
|
||||
"reference_locale_complete": not any(
|
||||
REFERENCE_LOCALE in item["missing_locales"]
|
||||
for item in missing_catalog_entries
|
||||
),
|
||||
"used_keys": len(usages),
|
||||
"missing_catalog_entries": missing_catalog_entries,
|
||||
},
|
||||
"information_governance_health": {
|
||||
"dimensions": len(manifests) * 4,
|
||||
"adoption_counts": dict(sorted(governance_adoption.items())),
|
||||
"modules": [
|
||||
{
|
||||
"module_id": manifest["id"],
|
||||
"dimensions": manifest["information_governance"]["dimensions"],
|
||||
}
|
||||
for manifest in manifests
|
||||
],
|
||||
},
|
||||
"api": {
|
||||
"backend_endpoints": classified_endpoints,
|
||||
"frontend_references": frontend_refs,
|
||||
@@ -517,6 +551,7 @@ def _assemble_inventory(
|
||||
"modules": len(manifests),
|
||||
"ui_fields": len(fields),
|
||||
"ui_fields_with_static_help": len(fields) - len(help_candidates),
|
||||
"ui_fields_with_resolvable_f1_context": len(fields),
|
||||
"help_review_candidates": len(help_candidates),
|
||||
"dynamic_help_references": len(dynamic_help),
|
||||
"ui_actions": len(webui.get("actions", [])),
|
||||
@@ -536,6 +571,12 @@ def _assemble_inventory(
|
||||
"backend_endpoints_without_static_webui_reference": len(unreferenced),
|
||||
"unclassified_backend_endpoints": len(unclassified),
|
||||
"stale_endpoint_declarations": len(stale_declarations),
|
||||
"information_governance_dimensions": len(manifests) * 4,
|
||||
"information_governance_enforced": governance_adoption["enforced"],
|
||||
"information_governance_partial": governance_adoption["partial"],
|
||||
"information_governance_contract_only": governance_adoption[
|
||||
"contract_only"
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
@@ -856,6 +897,7 @@ def _render_markdown(inventory: dict[str, Any]) -> str:
|
||||
f"- UI fields: {summary['ui_fields']}",
|
||||
f"- UI actions: {summary['ui_actions']}",
|
||||
f"- Fields with statically associated help: {summary['ui_fields_with_static_help']}",
|
||||
f"- Fields with a resolvable F1 context: {summary['ui_fields_with_resolvable_f1_context']}",
|
||||
f"- Fields with dynamic help references: {summary['dynamic_help_references']}",
|
||||
f"- Help review candidates: {summary['help_review_candidates']}",
|
||||
f"- Stable interface declarations: {summary['interface_declarations']}",
|
||||
@@ -872,7 +914,12 @@ def _render_markdown(inventory: dict[str, Any]) -> str:
|
||||
),
|
||||
f"- Unclassified backend endpoints: {summary['unclassified_backend_endpoints']}",
|
||||
f"- Stale endpoint declarations: {summary['stale_endpoint_declarations']}",
|
||||
f"- Used translation keys missing from a locale catalog: {len(missing)}",
|
||||
f"- Reference locale: `{inventory['translation_health']['reference_locale']}`",
|
||||
f"- Reference locale complete: `{str(inventory['translation_health']['reference_locale_complete']).lower()}`",
|
||||
f"- Used translation keys missing from a required locale catalog: {len(missing)}",
|
||||
f"- Information-governance dimensions enforced: {summary['information_governance_enforced']}",
|
||||
f"- Information-governance dimensions partial: {summary['information_governance_partial']}",
|
||||
f"- Information-governance dimensions contract-only: {summary['information_governance_contract_only']}",
|
||||
"",
|
||||
"## Help Review Candidates",
|
||||
"",
|
||||
|
||||
Reference in New Issue
Block a user