Description
Apache Airflow version
3.0.2
If "Other Airflow 2 version" selected, which one?
No response
What happened?
If the repo_url
is provided in the kwargs
of the GitDagBundle
config, a GitHook
is never created due to this if condition:
This means authentication (key file or private key) and environment configuration does not happen on clone repo commands (see
for example where hook is None).A simple workaround is to not provide repo_url
in the config and use host
in the connection definition but the git bundle should cope with both scenarios.
What you think should happen instead?
The GitDagBundle should configure the GitHook even if the repo_url is provided in the bundle config.
How to reproduce
Create a private git repository, and configure the git bundle config list something like the following:
[{"name": "dags-folder", "classpath": "airflow.providers.git.bundles.git.GitDagBundle", "kwargs": {"repo_url": "[email protected]:myorg/my-repo.git" , "tracking_ref": "main", "subdir": "dags"}}]
In addition configure a git connection; it could be like:
{"conn_type":"git","extra":{"private_key": "-----BEGIN OPENSSH PRIVATE KEY-----\nb3...REDACTED...lu\n-----END OPENSSH PRIVATE KEY-----\n", "strict_host_key_checking": "no"},"host":"[email protected]:myorg/my-repo.git"}
Operating System
Debian GNU/Linux
Versions of Apache Airflow Providers
apache_airflow_providers_git-0.0.2
Deployment
Astronomer
Deployment details
No response
Anything else?
Every time if repo_url is configured.
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct