pierrejeambrun commented on code in PR #65720:
URL: https://github.com/apache/airflow/pull/65720#discussion_r3138464983


##########
airflow-core/newsfragments/65720.improvement.rst:
##########


Review Comment:
   To remove. Please tell your agent to stop adding those newsfragment (unless 
it's significant.rst) or remove them yourself before opening the PR. 



##########
airflow-core/src/airflow/ui/vite.config.ts:
##########
@@ -18,13 +18,18 @@
  */
 import babel from "@rolldown/plugin-babel";
 import react, { reactCompilerPreset } from "@vitejs/plugin-react";
+import { readFileSync } from "node:fs";
 import cssInjectedByJsPlugin from "vite-plugin-css-injected-by-js";
 import { defineConfig } from "vitest/config";
 
+const pyprojectToml = readFileSync("../../../pyproject.toml", "utf8");
+const airflowVersion = /^version\s*=\s*"(.+?)"/mu.exec(pyprojectToml)?.[1] ?? 
"0";
+
 // https://vitejs.dev/config/
 export default defineConfig({
   base: "./",
   build: { chunkSizeWarningLimit: 1600, manifest: true },
+  define: { APP_VERSION: JSON.stringify(airflowVersion) },
   optimizeDeps: {
     exclude: ["@guanmingchiu/sqlparser-ts"], // WASM package needs to be 
excluded from pre-bundling
   },

Review Comment:
   I would instead use the 'version' api endpoint to retrieve the version 
instead embedding this information at build time. This will avoid that relative 
path and regexp handling that isn't great.
   
   `get_version`



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