amoghrajesh commented on code in PR #52876:
URL: https://github.com/apache/airflow/pull/52876#discussion_r2194697397
##########
providers/git/src/airflow/providers/git/bundles/git.py:
##########
@@ -218,32 +217,53 @@ def _convert_git_ssh_url_to_https(url: str) -> str:
return f"{domain}/{repo_path}"
def view_url(self, version: str | None = None) -> str | None:
+ """
+ Return a URL for viewing the DAGs in the repository.
+
+ This method is deprecated and will be removed in a future release. Use
`view_url_template` instead.
+ """
if not version:
return None
- url = self.repo_url
- if not url:
+ template = self.view_url_template()
+ if not template:
return None
+ return template.format(version=version)
+
+ def view_url_template(self) -> str | None:
+ if hasattr(self, "_view_url_template") and self._view_url_template:
+ # Backward compatibility for released Airflow versions
Review Comment:
Maybe you can explain it better in terms of usage for older airflow and new
provider, maybe update the comment to along the lines of:
```
This is to achieve back compat. Older airflow doesn't have this property
set, so if this is present, it indicates airflow version that can render view
url using template string, otherwise it uses the older mechanism.
```
Give or take..
--
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]