Copilot commented on code in PR #64542:
URL: https://github.com/apache/airflow/pull/64542#discussion_r3025324174


##########
airflow-core/src/airflow/ui/src/layouts/Nav/DocsButton.tsx:
##########
@@ -56,7 +57,7 @@ export const DocsButton = ({
   const { t: translate } = useTranslation("common");
   const showAPIDocs = Boolean(useConfig("enable_swagger_ui")) && showAPI;
 
-  const versionLink = 
`https://airflow.apache.org/docs/apache-airflow/${version}/index.html`;
+  const versionLink = `${stableDocsBaseUrl}/index.html`;

Review Comment:
   `versionLink` is now always pointing to the stable docs index and no longer 
varies by `version`, so the name is misleading. Consider renaming it to 
something like `stableDocsIndexLink` (or similar) to reflect its actual 
behavior.



##########
airflow-core/src/airflow/ui/src/layouts/Nav/DocsButton.tsx:
##########
@@ -28,6 +28,7 @@ import { NavButton } from "./NavButton";
 import { PluginMenuItem } from "./PluginMenuItem";
 
 const baseUrl = document.querySelector("base")?.href ?? 
"http://localhost:8080/";;
+const stableDocsBaseUrl = 
"https://airflow.apache.org/docs/apache-airflow/stable";;

Review Comment:
   `versionLink` is now always pointing to the stable docs index and no longer 
varies by `version`, so the name is misleading. Consider renaming it to 
something like `stableDocsIndexLink` (or similar) to reflect its actual 
behavior.



##########
airflow-core/src/airflow/ui/src/pages/Connections/NothingFoundInfo.tsx:
##########
@@ -19,12 +19,10 @@
 import { Box, Text, Link, Stack } from "@chakra-ui/react";
 import { useTranslation } from "react-i18next";
 
-import { useVersionServiceGetVersion } from "openapi/queries";
+const docsLink = 
"https://airflow.apache.org/docs/apache-airflow/stable/howto/connection.html#visibility-in-ui-and-cli";;

Review Comment:
   The stable docs base URL is now hard-coded in multiple places (here and in 
`DocsButton.tsx`). To reduce duplication and avoid future inconsistencies if 
the base path changes, consider centralizing the stable docs base URL in a 
small shared constant (e.g., a `src/utils/docs.ts` export) and build the full 
URLs from that.
   ```suggestion
   const STABLE_DOCS_BASE_URL = 
"https://airflow.apache.org/docs/apache-airflow/stable";;
   const docsLink = 
`${STABLE_DOCS_BASE_URL}/howto/connection.html#visibility-in-ui-and-cli`;
   ```



-- 
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