feluelle commented on code in PR #44976:
URL: https://github.com/apache/airflow/pull/44976#discussion_r1904027649
##########
airflow/dag_processing/bundles/git.py:
##########
@@ -40,20 +109,35 @@ class GitDagBundle(BaseDagBundle):
:param repo_url: URL of the git repository
:param tracking_ref: Branch or tag for this DAG bundle
:param subdir: Subdirectory within the repository where the DAGs are
stored (Optional)
+ :param ssh_conn_id: Connection ID for SSH connection to the repository
(Optional)
Review Comment:
```suggestion
:param git_conn_id: Connection ID for SSH connection to the repository
(Optional)
```
##########
airflow/dag_processing/bundles/git.py:
##########
@@ -120,9 +217,16 @@ def _has_version(repo: Repo, version: str) -> bool:
except BadName:
return False
+ def _refresh(self):
+ self.bare_repo.remotes.origin.fetch("+refs/heads/*:refs/heads/*")
+ self.repo.remotes.origin.pull()
+
def refresh(self) -> None:
if self.version:
raise AirflowException("Refreshing a specific version is not
supported")
- self.bare_repo.remotes.origin.fetch("+refs/heads/*:refs/heads/*")
- self.repo.remotes.origin.pull()
+ if self.hook:
+ with self.hook.get_conn():
+ self._refresh()
+ else:
+ self._refresh()
Review Comment:
```suggestion
with self.hook.get_conn():
self._refresh()
```
How can the `self.hook` be none? We set it in the init.
--
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]