kaxil commented on code in PR #75229:
URL: https://github.com/apache/airflow/pull/75229#discussion_r4338584241


##########
airflow-core/src/airflow/plugins_manager.py:
##########
@@ -351,7 +352,35 @@ def _is_applies_to_path_known_elsewhere(path: str) -> bool:
     return any(_describe_applies_to_path_error(path, root) is None for root in 
_applies_to_root_models())
 
 
-def _validate_applies_to(plugin_name: str | None, view: ExternalViewDict | 
ReactAppDict, kind: str) -> bool:
+_ACTION_TYPES = frozenset({"link", "react"})
+_ACTION_DESTINATIONS = frozenset({"dag", "dag_run", "task_instance"})
+# The field each action kind cannot render without.
+_ACTION_REQUIRED_TARGET = {"link": "href", "react": "bundle_url"}
+
+
+def _describe_ui_action_error(action: Any) -> str | None:

Review Comment:
   My suggestion here pointed at the wrong model, sorry. 
`TypeAdapter(PluginActionResponse)` only rejects unknown keys because the 
response models are `extra="forbid"`, and as Pierre says that ends up in the 
generated airflowctl models. A private strict model behind 
`_ui_action_adapter`, with the response models back on `extra="allow"`, keeps 
the load-time check without that.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to