You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "shashbha14 (via GitHub)" <gi...@apache.org> on 2026/02/16 14:44:00 UTC
[PR] Add REST API to refresh DAG bundle without restart [airflow]
shashbha14 opened a new pull request, #62022:
URL: https://github.com/apache/airflow/pull/62022
Closes #60616
## Summary
- Adds `POST /api/v2/dagBundles/{bundle_name}/refresh` endpoint
- Adds `DagBundleRefreshRequest` model to signal the DAG processor
- DAG processor consumes requests and force-refreshs the bundle
- Adds Alembic migration and tests
## What it does
Allows authorized clients to force-refresh a DAG bundle immediately via API, without needing to restart the dag processor or wait for the polling interval. This allows CI/CD pipelines and external systems to programmatically refresh DAG bundles after deployment.
## Changes
- **`airflow-core/src/airflow/models/dagbundle.py`** - Added `DagBundleRefreshRequest` model
- **`airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_bundles.py`** - Added endpoint
- **`airflow-core/src/airflow/api_fastapi/core_api/routes/public/__init__.py`** - Router registration
- **`airflow-core/src/airflow
--
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] Add REST API to refresh DAG bundle without restart [airflow]
Posted by "ephraimbuddy (via GitHub)" <gi...@apache.org>.
ephraimbuddy commented on PR #62022:
URL: https://github.com/apache/airflow/pull/62022#issuecomment-3929428920
> > will still encounter the same “waiting for refresh” situation.
>
>
>
> This is as immediate as you are going to get without a _lot_ of changes. I wouldn't zero in too much on the immediate word, just as long as we avoid waiting for the next refresh interval to end, we should be good to go. My 2c.
The refresh interval can even be adjusted
--
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] Add REST API to refresh DAG bundle without restart [airflow]
Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham commented on PR #62022:
URL: https://github.com/apache/airflow/pull/62022#issuecomment-3928793419
> will still encounter the same “waiting for refresh” situation.
This is as immediate as you are going to get without a _lot_ of changes. I wouldn't zero in too much on the immediate word, just as long as we avoid waiting for the next refresh interval to end, we should be good to go. My 2c.
--
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] Add REST API to refresh DAG bundle without restart [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on code in PR #62022:
URL: https://github.com/apache/airflow/pull/62022#discussion_r2832604692
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_bundles.py:
##########
@@ -0,0 +1,62 @@
+# 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.
+from __future__ import annotations
+
+from fastapi import Depends, HTTPException, status
+
+from airflow._shared.timezones import timezone
+from airflow.api_fastapi.common.db.common import SessionDep
+from airflow.api_fastapi.common.router import AirflowRouter
+from airflow.api_fastapi.core_api.openapi.exceptions import create_openapi_http_exception_doc
+from airflow.api_fastapi.logging.decorators import action_logging
+from airflow.models.dagbundle import DagBundleModel, DagBundleRefreshRequest
+
+dag_bundles_router = AirflowRouter(tags=["DAG Bundle"], prefix="/dagBundles")
+
+
+@dag_bundles_router.post(
+ "/{bundle_name}/refresh",
+ responses=create_openapi_http_exception_doc(
+ [status.HTTP_404_NOT_FOUND, status.HTTP_409_CONFLICT]
+ ),
+ status_code=status.HTTP_201_CREATED,
+ dependencies=[Depends(action_logging())],
Review Comment:
There is no additional permission check here. Does that mean that any authenticated user can perform the refresh dag bundle action ? Is that safe?
--
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] Add REST API to refresh DAG bundle without restart [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #62022:
URL: https://github.com/apache/airflow/pull/62022#issuecomment-4031604359
Closing, PRs from this users are ignoring review comments, not fixing underlying problems they report to fix or complete AI hallucination.
Please refrain from opening such PRs, it's not helping the project.
--
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] Add REST API to refresh DAG bundle without restart [airflow]
Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun closed pull request #62022: Add REST API to refresh DAG bundle without restart
URL: https://github.com/apache/airflow/pull/62022
--
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