Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions cumulusci_ado/vcs/ado/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

from cumulusci_ado.utils.ado import (
custom_to_semver,
download_package,
parse_repo_url,
publish_package,
sanitize_path_name,
Expand Down Expand Up @@ -668,7 +669,10 @@ def __init__(

def _init_repo(self) -> None:
"""Initializes the repository object."""
self.git_client = self.connection.clients.get_git_client()

repo_url = self.options.get("repository_url", self.project_config.repo_url)

if repo_url is not None:
_repo_owner, _repo_name, _host, _project = parse_repo_url(repo_url)

Expand All @@ -685,8 +689,6 @@ def _init_repo(self) -> None:
or ""
)

self.git_client = self.connection.clients.get_git_client()

self.repo = self.git_client.get_repository(self.repo_name, _project)
self.project = self.repo.project if self.repo else None

Expand Down Expand Up @@ -1130,6 +1132,27 @@ def publish_repo_package(self, feed, tag_name: str, description: str) -> None:

return ret

def download_package(self, package_version, path) -> None:
"""Downloads a package from the given feed."""
ctool = self.connection.get_client(
"cumulusci_ado.utils.common.client_tool.client_tool_client.ClientToolClient"
)
numeric_part = custom_to_semver(package_version, self.project_config)

ret = download_package(
ctool,
self.feed_name,
self.package_name,
numeric_part,
path,
file_filter=None,
scope=("organization" if self.organisation_artifact else "project"),
organization=f"https://{self._service_config.url if self._service_config else ''}",
project=(None if self.organisation_artifact else self.project_id),
detect=None,
)
return ret

def get_feed(self) -> Feed:
"""Fetches the feed for the given repository."""
try:
Expand Down
Loading