From 0efd9e6a2fa8bde0f6c14e88951b44badca063a2 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Sat, 28 Dec 2024 08:13:08 +0100 Subject: [PATCH 1/3] Upgrade to latest Helm version (#45258) --- Dockerfile.ci | 2 +- dev/breeze/src/airflow_breeze/global_constants.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.ci b/Dockerfile.ci index 6d160952b4964..7c0b529d4711f 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -1254,7 +1254,7 @@ RUN bash /scripts/docker/install_mysql.sh prod \ && chmod 0440 /etc/sudoers.d/airflow # Install Helm -ARG HELM_VERSION="v3.15.3" +ARG HELM_VERSION="v3.16.4" RUN SYSTEM=$(uname -s | tr '[:upper:]' '[:lower:]') \ && PLATFORM=$([ "$(uname -m)" = "aarch64" ] && echo "arm64" || echo "amd64" ) \ diff --git a/dev/breeze/src/airflow_breeze/global_constants.py b/dev/breeze/src/airflow_breeze/global_constants.py index c154318aa515d..9fccc368c7982 100644 --- a/dev/breeze/src/airflow_breeze/global_constants.py +++ b/dev/breeze/src/airflow_breeze/global_constants.py @@ -557,7 +557,7 @@ def get_airflow_extras(): DEFAULT_EXECUTOR = CURRENT_EXECUTORS[0] KIND_VERSION = "v0.26.0" -HELM_VERSION = "v3.15.3" +HELM_VERSION = "v3.16.4" # Initialize image build variables - Have to check if this has to go to ci dataclass USE_AIRFLOW_VERSION = None From 6020a26ed4d96554ea11c35d3580e09007be99fc Mon Sep 17 00:00:00 2001 From: Shubham Raj <48172486+shubhamraj-git@users.noreply.github.com> Date: Sat, 28 Dec 2024 14:40:18 +0530 Subject: [PATCH 2/3] Delete variable button on variable list page (#45238) * delete a variable * success toaster * key * look * delete modal * rename * rename --- .../pages/Variables/DeleteVariableButton.tsx | 74 +++++++++++++++---- airflow/ui/src/queries/useDeleteVariable.ts | 60 +++++++++++++++ 2 files changed, 118 insertions(+), 16 deletions(-) create mode 100644 airflow/ui/src/queries/useDeleteVariable.ts diff --git a/airflow/ui/src/pages/Variables/DeleteVariableButton.tsx b/airflow/ui/src/pages/Variables/DeleteVariableButton.tsx index e9e63d233d88d..c8dcdf7054de1 100644 --- a/airflow/ui/src/pages/Variables/DeleteVariableButton.tsx +++ b/airflow/ui/src/pages/Variables/DeleteVariableButton.tsx @@ -16,29 +16,71 @@ * specific language governing permissions and limitations * under the License. */ -import { Box } from "@chakra-ui/react"; +import { Flex, useDisclosure, Text, VStack, Heading } from "@chakra-ui/react"; import { FiTrash } from "react-icons/fi"; +import { Button, Dialog } from "src/components/ui"; import ActionButton from "src/components/ui/ActionButton"; +import { useDeleteVariable } from "src/queries/useDeleteVariable"; type Props = { readonly deleteKey: string; }; -const DeleteVariableButton = ({ deleteKey }: Props) => ( - - } - onClick={() => - // TODO: Will be removed once implemented - // eslint-disable-next-line no-alert - alert(`To be implemented: Selected key is ${deleteKey}`) - } - text="Delete Variable" - withText={false} - /> - -); +const DeleteVariableButton = ({ deleteKey: variableKey }: Props) => { + const { onClose, onOpen, open } = useDisclosure(); + const { isPending, mutate } = useDeleteVariable({ + onSuccessConfirm: onClose, + }); + + const renderDeleteButton = () => ( + + ); + + return ( + <> + } + onClick={() => { + onOpen(); + }} + text="Delete Variable" + withText={false} + /> + + + + + + Delete Variable - {variableKey} + + + + + + + + Are you sure you want to delete the variable key: `{variableKey}`? + + + {renderDeleteButton()} + + + + + + ); +}; export default DeleteVariableButton; diff --git a/airflow/ui/src/queries/useDeleteVariable.ts b/airflow/ui/src/queries/useDeleteVariable.ts new file mode 100644 index 0000000000000..6ff80d07a3bdd --- /dev/null +++ b/airflow/ui/src/queries/useDeleteVariable.ts @@ -0,0 +1,60 @@ +/*! + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { useQueryClient } from "@tanstack/react-query"; + +import { + useVariableServiceDeleteVariable, + useVariableServiceGetVariablesKey, +} from "openapi/queries"; +import { toaster } from "src/components/ui"; + +const onError = () => { + toaster.create({ + description: "Delete variable request failed.", + title: "Failed to delete the variable", + type: "error", + }); +}; + +export const useDeleteVariable = ({ + onSuccessConfirm, +}: { + onSuccessConfirm: () => void; +}) => { + const queryClient = useQueryClient(); + + const onSuccess = async () => { + await queryClient.invalidateQueries({ + queryKey: [useVariableServiceGetVariablesKey], + }); + + toaster.create({ + description: "The variable key deletion request was successful.", + title: "Variable Deleted Successfully", + type: "success", + }); + + onSuccessConfirm(); + }; + + return useVariableServiceDeleteVariable({ + onError, + onSuccess, + }); +}; From a22faa5921bd6b3fbb8a95f582f56da1cdf39fc5 Mon Sep 17 00:00:00 2001 From: GPK Date: Sat, 28 Dec 2024 13:13:30 +0000 Subject: [PATCH 3/3] loop scheduler before running dag in docker tests (#45262) --- docker_tests/test_docker_compose_quick_start.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docker_tests/test_docker_compose_quick_start.py b/docker_tests/test_docker_compose_quick_start.py index eab0a7a62e019..4b6335facff51 100644 --- a/docker_tests/test_docker_compose_quick_start.py +++ b/docker_tests/test_docker_compose_quick_start.py @@ -98,6 +98,7 @@ def test_trigger_dag_and_wait_for_result(default_docker_image, tmp_path_factory, compose.down(remove_orphans=True, volumes=True, quiet=True) try: compose.up(detach=True, wait=True, color=not os.environ.get("NO_COLOR")) + compose.execute(service="airflow-scheduler", command=["airflow", "scheduler", "-n", "50"]) api_request("PATCH", path=f"dags/{DAG_ID}", json={"is_paused": False}) api_request("POST", path=f"dags/{DAG_ID}/dagRuns", json={"dag_run_id": DAG_RUN_ID})