Skip to content

fix: report duplicate plugin names as import errors#66649

Merged
potiuk merged 1 commit into
apache:mainfrom
jinoo7099:fix/report-duplicate-plugin-names
May 10, 2026
Merged

fix: report duplicate plugin names as import errors#66649
potiuk merged 1 commit into
apache:mainfrom
jinoo7099:fix/report-duplicate-plugin-names

Conversation

@jinoo7099
Copy link
Copy Markdown
Contributor

@jinoo7099 jinoo7099 commented May 10, 2026

Description

Report duplicate Airflow plugin names as plugin import errors.

When multiple plugins define the same name, Airflow already skips the later duplicate plugin, but the conflict was only logged as a warning. This made the issue hard to discover from the UI/API because only one plugin appeared in the plugin list.

This change keeps the existing behavior of skipping duplicate plugin names and continuing to load subsequent plugins, but also records the duplicate as a plugin import error so it is visible from the plugin import errors endpoint/UI.

Testing

sample plugin code

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"
        }
    ] 
  • Before : Import error is not shown.
image
  • After : Duplicate Airflow plugin names are shown as an import error.
image

Was generative AI tooling used to co-author this PR?

  • Yes — OpenAI Codex (GPT-5)

Generated-by: OpenAI Codex (GPT-5) following the guidelines

@potiuk
Copy link
Copy Markdown
Member

potiuk commented May 10, 2026

LGTM

@potiuk potiuk merged commit 04a058a into apache:main May 10, 2026
79 checks passed
@jinoo7099 jinoo7099 deleted the fix/report-duplicate-plugin-names branch May 13, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User is able to register multiple plugins using same name

2 participants