Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions scripts/verify_cloud_run_strategy_plugin_mounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,36 @@ def _check_signal_path(
f"{service}:{env_name} signal_path is outside allowed prefixes: {signal_path}"
)

signal_raw = _run(["gcloud", "storage", "cat", signal_path])
try:
signal_raw = _run(["gcloud", "storage", "cat", signal_path])
except RuntimeError as exc:
print(
f"Warning: {service}:{env_name} signal_path is not readable yet; "
f"strategy runtime will ignore the plugin until a valid signal exists: "
f"{signal_path} ({exc})"
)
return
try:
signal = json.loads(signal_raw)
except json.JSONDecodeError as exc:
raise ValueError(f"{service}:{env_name} signal_path does not contain valid JSON: {signal_path}") from exc
print(
f"Warning: {service}:{env_name} signal_path does not contain valid JSON; "
f"strategy runtime will ignore the plugin until it is fixed: {signal_path} ({exc})"
)
return
if not isinstance(signal, dict):
raise ValueError(f"{service}:{env_name} signal_path must contain a JSON object: {signal_path}")
print(
f"Warning: {service}:{env_name} signal_path must contain a JSON object; "
f"strategy runtime will ignore the plugin until it is fixed: {signal_path}"
)
return
if expected_schema and str(signal.get("schema_version") or "").strip() != expected_schema:
raise ValueError(
f"{service}:{env_name} expected schema {expected_schema}, "
f"got {signal.get('schema_version')!r} at {signal_path}"
print(
f"Warning: {service}:{env_name} expected schema {expected_schema}, "
f"got {signal.get('schema_version')!r} at {signal_path}; "
"strategy runtime will ignore the plugin until it is fixed."
)
Comment on lines +187 to 191

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep schema mismatches blocking deploy

When a mount sets expected_schema_version and the artifact is otherwise valid JSON with the wrong schema, this now only warns and the workflow proceeds. I checked the runtime path wired in main.py (parse_strategy_plugin_mounts / load_configured_strategy_plugin_signals from the vendored quant_platform_kit), and that loader does not consume expected_schema_version, so it will not ignore the plugin as this message says; it can load an incompatible signal into strategy execution instead of falling back to the base plan.

Useful? React with 👍 / 👎.

return


def _verify_target(
Expand Down