Skip to content

Commit d708077

Browse files
ephraimbuddyshubham-pyc
authored andcommitted
Move GitDagBundle to providers (apache#47636)
* Move `GitDagBundle` to providers This commit moves GitDagBundle into the providers package. As part of the move, a new `GIT` provider is created and like `operators`, `transfers` etc, we now have `bundles` package. The bundle package is where the `GitDagBundles` lives. * fixup! Move `GitDagBundle` to providers * Update documentation * Fix static checks * add git to compatibility tests matrix * Update doctree * Update with recent changes * Fix doc, update version and add provider to prod image preinstalled providers * fixup! Fix doc, update version and add provider to prod image preinstalled providers * Fix doc * update breeze command hash * Fix incompatible providers regex removal syntax * Remove providers mistakenly added in pyproject.toml * Update providers/git/pyproject.toml
1 parent cf847e6 commit d708077

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1348
-276
lines changed

.github/ISSUE_TEMPLATE/airflow_providers_bug_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ body:
6565
- fab
6666
- facebook
6767
- ftp
68+
- git
6869
- github
6970
- google
7071
- grpc

.github/workflows/test-providers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ jobs:
205205
run: |
206206
for provider in ${REMOVE_PROVIDERS}; do
207207
echo "Removing incompatible provider: ${provider}"
208-
rm -vf dist/apache_airflow_providers_${provider/./_}*
208+
rm -vf dist/apache_airflow_providers_${provider/./_}-*
209209
done
210210
if: matrix.remove-providers != ''
211211
- name: "Download airflow package: wheel"

INSTALL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ airbyte, alibaba, amazon, apache.beam, apache.cassandra, apache.drill, apache.dr
321321
apache.hdfs, apache.hive, apache.iceberg, apache.impala, apache.kafka, apache.kylin, apache.livy,
322322
apache.pig, apache.pinot, apache.spark, apprise, arangodb, asana, atlassian.jira, celery, cloudant,
323323
cncf.kubernetes, cohere, common.compat, common.io, common.messaging, common.sql, databricks,
324-
datadog, dbt.cloud, dingding, discord, docker, edge, elasticsearch, exasol, fab, facebook, ftp,
324+
datadog, dbt.cloud, dingding, discord, docker, edge, elasticsearch, exasol, fab, facebook, ftp, git,
325325
github, google, grpc, hashicorp, http, imap, influxdb, jdbc, jenkins, microsoft.azure,
326326
microsoft.mssql, microsoft.psrp, microsoft.winrm, mongo, mysql, neo4j, odbc, openai, openfaas,
327327
openlineage, opensearch, opsgenie, oracle, pagerduty, papermill, pgvector, pinecone, postgres,

airflow-core/docs/extra-packages-ref.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ Some of those enable Airflow to use executors to run tasks with them - other tha
266266
+---------------------+-----------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------+
267267
| fab | ``pip install 'apache-airflow[fab]'`` | FAB auth manager | |
268268
+---------------------+-----------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------+
269+
| git | ``pip install 'apache-airflow[git]'`` | Git bundle and hook | |
270+
+---------------------+-----------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------+
269271
| github | ``pip install 'apache-airflow[github]'`` | GitHub operators and hook | |
270272
+---------------------+-----------------------------------------------------+-----------------------------------------------------------------+----------------------------------------------+
271273
| influxdb | ``pip install 'apache-airflow[influxdb]'`` | Influxdb operators and hook | |

airflow-core/src/airflow/config_templates/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2478,7 +2478,7 @@ dag_processor:
24782478
[
24792479
{
24802480
"name": "my-git-repo",
2481-
"classpath": "airflow.dag_processing.bundles.git.GitDagBundle",
2481+
"classpath": "airflow.providers.git.bundles.git.GitDagBundle",
24822482
"kwargs": {
24832483
"subdir": "dags",
24842484
"tracking_ref": "main",

airflow-core/src/airflow/dag_processing/bundles/provider.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
# under the License.
1717

1818
---
19-
package-name: apache-airflow-providers-bundles
19+
package-name: apache-airflow-providers-git
2020
name: GIT
2121
description: |
22-
`GIT <https://git-scm.com/>`__
22+
`Distributed version control system (GIT) <https://git-scm.com/>`__
2323
2424
state: not-ready
2525
source-date-epoch: 1726861127
@@ -29,13 +29,19 @@ versions:
2929

3030
integrations:
3131
- integration-name: GIT (Git)
32+
external-doc-url: https://git-scm.com/
33+
tags: [software]
3234

3335
hooks:
3436
- integration-name: GIT
3537
python-modules:
36-
- airflow.dag_processing.bundles.git
38+
- airflow.providers.git.hooks.git
39+
bundles:
40+
- integration-name: GIT
41+
python-modules:
42+
- airflow.providers.git.bundles.git
3743

3844

3945
connection-types:
40-
- hook-class-name: airflow.dag_processing.bundles.git.GitHook
46+
- hook-class-name: airflow.providers.git.hooks.git.GitHook
4147
connection-type: git

airflow-core/src/airflow/provider.yaml.schema.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,30 @@
313313
]
314314
}
315315
},
316+
"bundles": {
317+
"type": "array",
318+
"items": {
319+
"type": "object",
320+
"properties": {
321+
"integration-name": {
322+
"type": "string",
323+
"description": "Integration name. It must have a matching item in the 'integration' section of any provider."
324+
},
325+
"python-modules": {
326+
"description": "List of python modules containing the bundles.",
327+
"type": "array",
328+
"items": {
329+
"type": "string"
330+
}
331+
}
332+
},
333+
"additionalProperties": false,
334+
"required": [
335+
"integration-name",
336+
"python-modules"
337+
]
338+
}
339+
},
316340
"connection-types": {
317341
"type": "array",
318342
"description": "Array of connection types mapped to hook class names",

airflow-core/src/airflow/provider_info.schema.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,30 @@
8686
]
8787
}
8888
},
89+
"bundles": {
90+
"type": "array",
91+
"items": {
92+
"type": "object",
93+
"properties": {
94+
"integration-name": {
95+
"type": "string",
96+
"description": "Integration name. It must have a matching item in the 'integration' section of any provider."
97+
},
98+
"python-modules": {
99+
"description": "List of python modules containing the bundles.",
100+
"type": "array",
101+
"items": {
102+
"type": "string"
103+
}
104+
}
105+
},
106+
"additionalProperties": false,
107+
"required": [
108+
"integration-name",
109+
"python-modules"
110+
]
111+
}
112+
},
89113
"connection-types": {
90114
"type": "array",
91115
"description": "Map of connection types mapped to hook class names.",

airflow-core/src/airflow/providers_manager.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,6 @@ def _create_customized_form_field_behaviours_schema_validator():
171171

172172

173173
def _check_builtin_provider_prefix(provider_package: str, class_name: str) -> bool:
174-
if "bundles" in provider_package:
175-
# TODO: AIP-66: remove this when this package is moved to providers directory
176-
return True
177174
if provider_package.startswith("apache-airflow"):
178175
provider_path = provider_package[len("apache-") :].replace("-", ".")
179176
if not class_name.startswith(provider_path):

airflow-core/tests/unit/api_fastapi/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def configure_git_connection_for_dag_bundle(session):
115115
(
116116
"dag_processor",
117117
"dag_bundle_config_list",
118-
): '[{ "name": "dag_maker", "classpath": "airflow.dag_processing.bundles.git.GitDagBundle", "kwargs": {"subdir": "dags", "tracking_ref": "main", "refresh_interval": 0}}, { "name": "another_bundle_name", "classpath": "airflow.dag_processing.bundles.git.GitDagBundle", "kwargs": {"subdir": "dags", "tracking_ref": "main", "refresh_interval": 0}}]'
118+
): '[{ "name": "dag_maker", "classpath": "airflow.providers.git.bundles.git.GitDagBundle", "kwargs": {"subdir": "dags", "tracking_ref": "main", "refresh_interval": 0}}, { "name": "another_bundle_name", "classpath": "airflow.providers.git.bundles.git.GitDagBundle", "kwargs": {"subdir": "dags", "tracking_ref": "main", "refresh_interval": 0}}]'
119119
}
120120
):
121121
yield

0 commit comments

Comments
 (0)