Registry: list a domain's scenarios with a version in production
This commit is contained in:
@@ -125,6 +125,14 @@ class ModelRegistry:
|
||||
def status(self, domain: str, scenario: str, version: str) -> str:
|
||||
return self._status(self.get(domain, scenario, version))
|
||||
|
||||
def in_production(self, domain: str) -> list[str]:
|
||||
"""The scenarios of `domain` with a version holding the `produccion` alias, by name."""
|
||||
if domain not in DOMAINS:
|
||||
raise ValueError(f"dominio desconocido: {domain!r}")
|
||||
prefix = registered_name(domain, "")
|
||||
models = self.client.search_registered_models(filter_string=f"name LIKE '{prefix}%'")
|
||||
return sorted(m.name.removeprefix(prefix) for m in models if PRODUCTION_ALIAS in (m.aliases or {}))
|
||||
|
||||
def resolve(self, domain: str, scenario: str, version: str | None = None) -> ResolvedVersion:
|
||||
"""With no `version`, the one holding the `produccion` alias; with a version, that one, whatever
|
||||
its status (to test or compare a candidate). The status travels with it: confirming risks only
|
||||
|
||||
Reference in New Issue
Block a user