turbaszek commented on a change in pull request #13767:
URL: https://github.com/apache/airflow/pull/13767#discussion_r567718220
##########
File path: dev/provider_packages/prepare_provider_packages.py
##########
@@ -977,70 +933,94 @@ def
get_cross_provider_dependent_packages(provider_package_id: str) -> List[str]
def make_sure_remote_apache_exists_and_fetch():
"""
- Make sure that apache remote exist in git. We need to take a log from the
master of apache
- repository - not locally - because when we commit this change and run it,
our log will include the
- current commit - which is going to have different commit id once we merge.
So it is a bit
- catch-22.
+ Make sure that apache remote exist in git. We need to take a log from the
apache
+ repository - not locally.
+
+ Also the the local repo might be shallow so we need to unshallow it.
+
+ This will:
+ * check if the remote exists and add if it does not
+ * check if the local repo is shallow, markit to be unshallowed in this case
+ * fetch from the remote including all tags and overriding local taags in
case they are set differently
- :return:
"""
try:
+ check_remote_command = ["git", "remote", "get-url", HTTPS_REMOTE]
subprocess.check_call(
- ["git", "remote", "add", "apache-https-for-providers",
"https://github.com/apache/airflow.git"],
+ check_remote_command,
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
- except subprocess.CalledProcessError as e:
- if e.returncode == 128:
- print(
- "[yellow]The remote `apache-https-for-providers` already
exists. If you have trouble running "
- "git log delete the remote[/]",
- file=sys.stderr,
- )
+ print(f"Running command: '{' '.join(check_remote_command)}'")
Review comment:
Should this print be before `check_call`?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]