Skip to content

Whole plugin module breaks if user gives wrong destination for external_view plugin #55571

Description

@atuls4441

Apache Airflow version

main (development)

If "Other Airflow 2 version" selected, which one?

No response

What happened?

pt/airflow/airflow-core/src/airflow/api_fastapi/core_api/routes/public/plugins.py", line 47, in get_plugins
    return PluginCollectionResponse(
  File "/usr/python/lib/python3.10/site-packages/pydantic/main.py", line 253, in __init__
    validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for PluginCollectionResponse
plugins.16.external_views.0.destination
  Input should be 'nav', 'dag', 'dag_run', 'task' or 'task_instance' [type=literal_error, input_value='Assets', input_type=str]
    For further information visit https://errors.pydantic.dev/2.11/v/literal_e
Image

What you think should happen instead?

The error makes sense that its user mistake but other plugins should still work.

How to reproduce

Try to register below plugin:

from airflow.plugins_manager import AirflowPlugin

external_view1 = {
        "name": "Airflow Croma",
        "href": "http://localhost:28080/dags/access_control",
        "destination": "Assets",
        "icon": "book",
        "url_route": "my_external_view",
        # "category": "browse"
    }

# Defining the plugin class
class AirflowTestPlugin2(AirflowPlugin):
    name = "test_plugin2"
    external_views = [external_view1]

Operating System

Linux

Versions of Apache Airflow Providers

No response

Deployment

Other

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

affected_version:3.1Issues Reported for 3.1area:corekind:bugThis is a clearly a bugpriority:highHigh priority bug that should be patched quickly but does not require immediate new release

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions