fix(actor): align _resolve_actor_name error + annotate cloud validators
CI / load-versions (pull_request) Successful in 14s
CI / push-validation (pull_request) Successful in 25s
CI / lint (pull_request) Successful in 52s
CI / typecheck (pull_request) Successful in 56s
CI / quality (pull_request) Successful in 56s
CI / build (pull_request) Successful in 59s
CI / helm (pull_request) Successful in 38s
CI / security (pull_request) Successful in 1m26s
CI / unit_tests (pull_request) Successful in 5m3s
CI / docker (pull_request) Successful in 1m30s
CI / integration_tests (pull_request) Successful in 8m35s
CI / coverage (pull_request) Failing after 9m29s
CI / status-check (pull_request) Failing after 3s
CI / load-versions (pull_request) Successful in 14s
CI / push-validation (pull_request) Successful in 25s
CI / lint (pull_request) Successful in 52s
CI / typecheck (pull_request) Successful in 56s
CI / quality (pull_request) Successful in 56s
CI / build (pull_request) Successful in 59s
CI / helm (pull_request) Successful in 38s
CI / security (pull_request) Successful in 1m26s
CI / unit_tests (pull_request) Successful in 5m3s
CI / docker (pull_request) Successful in 1m30s
CI / integration_tests (pull_request) Successful in 8m35s
CI / coverage (pull_request) Failing after 9m29s
CI / status-check (pull_request) Failing after 3s
The _resolve_actor_name error message did not contain the substrings the
TDD behave scenarios assert against ("Actor name is required" and
"Missing required 'name' field"); update the BadParameter text so both
case-insensitive substring checks match without changing the surrounding
guidance that points users at the YAML 'name' field.
Two field_validator("region") classmethods in cloud_types.py (the GCP
and Azure variants) lacked an annotation on parameter v, tripping the
architecture.feature:38 "Type hints are used throughout" guard for
public functions. Add the narrow ``str | None`` type that matches the
existing -> str | None return type and the value the Pydantic v2
validator actually receives.
ISSUES CLOSED: #11047
This commit is contained in:
@@ -413,8 +413,9 @@ def _resolve_actor_name(
|
||||
raw_name = config_blob.get("name")
|
||||
if not raw_name or not isinstance(raw_name, str) or not raw_name.strip():
|
||||
raise typer.BadParameter(
|
||||
f"Missing actor name. Provide it either as the positional NAME "
|
||||
f"argument to `agents actor add`, or via a 'name' field inside "
|
||||
f"Actor name is required: missing required 'name' field. "
|
||||
f"Provide it either as the positional NAME argument to "
|
||||
f"`agents actor add`, or via a 'name' field inside "
|
||||
f"{config_path} (e.g. ``name: local/my-actor`` at the top of the "
|
||||
"YAML / JSON document)."
|
||||
)
|
||||
|
||||
@@ -269,7 +269,7 @@ class GCPResource(CloudResource):
|
||||
|
||||
@field_validator("region")
|
||||
@classmethod
|
||||
def validate_region(cls, v) -> str | None:
|
||||
def validate_region(cls, v: str | None) -> str | None:
|
||||
"""Validate GCP region is non-empty.
|
||||
|
||||
Args:
|
||||
@@ -369,7 +369,7 @@ class AzureResource(CloudResource):
|
||||
|
||||
@field_validator("region")
|
||||
@classmethod
|
||||
def validate_region(cls, v) -> str | None:
|
||||
def validate_region(cls, v: str | None) -> str | None:
|
||||
"""Validate Azure region is non-empty.
|
||||
|
||||
Args:
|
||||
|
||||
Reference in New Issue
Block a user