4949
5050from cumulusci_ado .utils .ado import (
5151 custom_to_semver ,
52+ download_package ,
5253 parse_repo_url ,
5354 publish_package ,
5455 sanitize_path_name ,
@@ -668,7 +669,10 @@ def __init__(
668669
669670 def _init_repo (self ) -> None :
670671 """Initializes the repository object."""
672+ self .git_client = self .connection .clients .get_git_client ()
673+
671674 repo_url = self .options .get ("repository_url" , self .project_config .repo_url )
675+
672676 if repo_url is not None :
673677 _repo_owner , _repo_name , _host , _project = parse_repo_url (repo_url )
674678
@@ -685,8 +689,6 @@ def _init_repo(self) -> None:
685689 or ""
686690 )
687691
688- self .git_client = self .connection .clients .get_git_client ()
689-
690692 self .repo = self .git_client .get_repository (self .repo_name , _project )
691693 self .project = self .repo .project if self .repo else None
692694
@@ -1130,6 +1132,27 @@ def publish_repo_package(self, feed, tag_name: str, description: str) -> None:
11301132
11311133 return ret
11321134
1135+ def download_package (self , package_version , path ) -> None :
1136+ """Downloads a package from the given feed."""
1137+ ctool = self .connection .get_client (
1138+ "cumulusci_ado.utils.common.client_tool.client_tool_client.ClientToolClient"
1139+ )
1140+ numeric_part = custom_to_semver (package_version , self .project_config )
1141+
1142+ ret = download_package (
1143+ ctool ,
1144+ self .feed_name ,
1145+ self .package_name ,
1146+ numeric_part ,
1147+ path ,
1148+ file_filter = None ,
1149+ scope = ("organization" if self .organisation_artifact else "project" ),
1150+ organization = f"https://{ self ._service_config .url if self ._service_config else '' } " ,
1151+ project = (None if self .organisation_artifact else self .project_id ),
1152+ detect = None ,
1153+ )
1154+ return ret
1155+
11331156 def get_feed (self ) -> Feed :
11341157 """Fetches the feed for the given repository."""
11351158 try :
0 commit comments