Skip to content

User is able to register multiple plugins using same name #55140

@atul-astronomer

Description

@atul-astronomer

Apache Airflow version

main (development)

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

No response

What happened?

User is able to register multiple FastAPI plugins using same name

On UI, only 1 plugin is visible

Image

What you think should happen instead?

No response

How to reproduce

Register 2 FastAPI plugins using same name and see no error is coming but on UI, only 1 plugin is listed

from airflow.plugins_manager import AirflowPlugin
from fastapi import FastAPI

my_app = FastAPI()

@my_app.get("/ping")
async def ping():
    return {"message": "pong"}

class MyFastAPIPlugin(AirflowPlugin):
    name = "my_fastapi_plugin"
    fastapi_apps = [
        {
            "name": "example_api",
            "app": my_app,
            "url_prefix": "/example"
        }
    ]

@my_app.get("/hello")
async def ping():
    return {"message": "Hello"}

class MyFastAPIPlugin2(AirflowPlugin):
    name = "my_fastapi_plugin"
    fastapi_apps = [
        {
            "name": "example_api",
            "app": my_app,
            "url_prefix": "/example"
        }
    ]

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

Metadata

Metadata

Assignees

Labels

area:APIAirflow's REST/HTTP APIarea:pluginskind:bugThis is a clearly a bugpriority:mediumBug that should be fixed before next release but would not block a release

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions