ephraimbuddy commented on code in PR #44976:
URL: https://github.com/apache/airflow/pull/44976#discussion_r1908446917
##########
airflow/dag_processing/bundles/git.py:
##########
@@ -120,9 +154,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.ssh_hook:
+ with self.ssh_hook.get_conn():
Review Comment:
> Where/how does this work? I'm not spotting it in the diff.
Paramiko makes the connection which git uses to authenticate with services
like github.com.
> Are you sure we aren't relying on
[this](https://github.com/apache/airflow/blob/351ac28c7c4dde3a611e4260bbb0f01c7618f261/providers/src/airflow/providers/ssh/hooks/ssh.py#L322-L323)
to populate something that git sees when it tries to auth? Paramiko must be
doing some magic here for us, and I still worry part of that magic is an extra
ssh connection.
I don't think it's an extra SSH connection. The way we connect is to use
`with ssh_hook.get_conn`, which opens an SSH connection and allows us to
authenticate with SSH. The connection is closed outside the loop, which is
immediately after we are done.
--
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]