You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Aryaman-leo (via GitHub)" <gi...@apache.org> on 2026/02/19 13:19:38 UTC

[PR] feat(ui): support custom_logo via /api/v2/config with fallback [airflow]

Aryaman-leo opened a new pull request, #62169:
URL: https://github.com/apache/airflow/pull/62169

   This PR adds support for overriding the default Airflow logo in the UI navigation via a configurable custom_logo parameter defined in the [api] section of airflow.cfg.
   
   The implementation reads the custom_logo value from the authenticated /api/v2/config endpoint and introduces a BrandLogo wrapper component in the UI. If a custom logo is configured, it is rendered in place of the default AirflowPin. If the value is not set or the image fails to load, the UI gracefully falls back to the default logo.
   
   This change:
   
   Preserves the existing authentication model (requires_authenticated remains unchanged)
   
   Does not introduce breaking changes to the public API schema
   
   Maintains backward compatibility
   
   Provides safe fallback behavior
   
   Example configuration:
   
   [api]
   custom_logo = https://example.com/logo.svg
   expose_config = True
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(ui): support custom_logo via /api/v2/config with fallback [airflow]

Posted by "Aryaman-leo (via GitHub)" <gi...@apache.org>.
Aryaman-leo commented on PR #62169:
URL: https://github.com/apache/airflow/pull/62169#issuecomment-3927292719

   I’ve opened a PR for this change:
   
   https://github.com/apache/airflow/pull/62169
   
   It adds support for overriding the default Airflow logo via the custom_logo configuration with a safe fallback to the default logo. Feedback is welcome.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(ui): support custom_logo via /api/v2/config with fallback [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun closed pull request #62169: feat(ui): support custom_logo via /api/v2/config with fallback
URL: https://github.com/apache/airflow/pull/62169


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(ui): support custom_logo via /api/v2/config with fallback [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #62169:
URL: https://github.com/apache/airflow/pull/62169#discussion_r2829071167


##########
airflow-core/src/airflow/ui/src/components/BrandLogo.tsx:
##########
@@ -0,0 +1,40 @@
+import { Box, Image, type BoxProps } from "@chakra-ui/react";
+import { useState, useEffect } from "react";
+
+import { useConfigServiceGetConfig } from "openapi/queries";
+import { AirflowPin } from "src/assets/AirflowPin";
+
+export const BrandLogo = (props: BoxProps) => {
+  const { data } = useConfigServiceGetConfig();
+  const [isValid, setIsValid] = useState(false);
+
+  const rawLogo = data
+    ? data.sections
+        .find((section) => section.name === "api")
+        ?.options.find((option) => option.key === "custom_logo")?.value
+    : undefined;
+
+  const logo = typeof rawLogo === "string" ? rawLogo : Array.isArray(rawLogo) ? rawLogo[0] : undefined;
+
+  useEffect(() => {
+    if (typeof logo !== "string" || logo.trim() === "") {
+      setIsValid(false);
+      return;
+    }
+
+    const img = new window.Image();

Review Comment:
   no, window is globalThis in vite



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(ui): support custom_logo via /api/v2/config with fallback [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #62169:
URL: https://github.com/apache/airflow/pull/62169#issuecomment-3927266492

   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (ruff, mypy and type annotations). Our [prek-hooks]( https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#prerequisites-for-prek-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/airflow-core/docs/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/dev/breeze/doc/README.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#coding-style-and-best-practices).
   - Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
   Apache Airflow is a community-driven project and together we are making it better 🚀.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] feat(ui): support custom_logo via /api/v2/config with fallback [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #62169:
URL: https://github.com/apache/airflow/pull/62169#discussion_r2829061662


##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/config.py:
##########
@@ -36,3 +37,6 @@ class ConfigResponse(BaseModel):
     external_log_name: str | None = None
     theme: Theme | None
     multi_team: bool
+    # added custom logo support 
+    custom_logo: Optional[str] = None
+

Review Comment:
   We already have a THEME config object to customize the UI.



##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py:
##########
@@ -45,6 +45,7 @@
 
 @config_router.get(
     "/config",
+    response_model=ConfigResponse,

Review Comment:
   why? unrelated? 



##########
airflow-core/src/airflow/ui/src/layouts/Nav/Nav.tsx:
##########
@@ -27,8 +27,9 @@ import {
   usePluginServiceGetPlugins,
 } from "openapi/queries";
 import type { ExternalViewResponse } from "openapi/requests/types.gen";
-import { AirflowPin } from "src/assets/AirflowPin";
 import { DagIcon } from "src/assets/DagIcon";
+// import { AirflowPin } from "src/assets/AirflowPin";

Review Comment:
   ?



##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py:
##########
@@ -62,6 +63,8 @@ def get_configs() -> ConfigResponse:
         "external_log_name": getattr(task_log_reader.log_handler, "log_name", None),
         "theme": loads(conf.get("api", "theme", fallback="{}")) or None,
         "multi_team": conf.getboolean("core", "multi_team"),
+        # for sustom logo 

Review Comment:
   typo



##########
airflow-core/src/airflow/ui/openapi-gen/queries/queries.ts:
##########
@@ -407,6 +407,7 @@ export const useDagStatsServiceGetDagStats = <TData = Common.DagStatsServiceGetD
 * @returns Config Successful Response
 * @throws ApiError
 */
+

Review Comment:
   why?



##########
airflow-core/src/airflow/ui/openapi-gen/requests/core/OpenAPI.ts:
##########
@@ -49,7 +49,7 @@ export const OpenAPI: OpenAPIConfig = {
 	TOKEN: undefined,
 	USERNAME: undefined,
 	VERSION: '2',
-	WITH_CREDENTIALS: false,
+	WITH_CREDENTIALS: true,

Review Comment:
   why?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org