Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The find_repository() method does not support federated repositories #450

Open
hransun opened this issue Jun 28, 2024 · 2 comments
Open
Labels
Help Wanted We will be glad if somebody proposes a solution via PR

Comments

@hransun
Copy link

hransun commented Jun 28, 2024

When the repo is federated repo the call return None.
Actually the repo is there and here are the debug log:

[2024-06-28 11:12:36,453] {admin.py:135} DEBUG - Read RepositoryLocal [xxx-pip-unstable-local]
[2024-06-28 11:12:36,463] {connectionpool.py:1051} DEBUG - Starting new HTTPS connection (1): xxx:443
[2024-06-28 11:12:37,305] {connectionpool.py:546} DEBUG - https://xxx:443 "GET /artifactory/api/repositories/xxx-pip-unstable-local HTTP/11" 200 None
[2024-06-28 11:12:37,306] {admin.py:151} DEBUG - RepositoryLocal [xxx-pip-unstable-local] exist
[2024-06-28 11:12:37,306] {admin.py:135} DEBUG - Read RepositoryRemote [xxx-pip-unstable-local]
[2024-06-28 11:12:37,699] {connectionpool.py:546} DEBUG - https://xxxx:443 "GET /artifactory/api/repositories/xxx-pip-unstable-local HTTP/11" 200 None
[2024-06-28 11:12:37,699] {admin.py:151} DEBUG - RepositoryRemote [xxx-pip-unstable-local] exist
[2024-06-28 11:12:37,700] {admin.py:135} DEBUG - Read RepositoryVirtual [xxx-pip-unstable-local]
[2024-06-28 11:12:37,802] {connectionpool.py:546} DEBUG - https://xxx:443 "GET /artifactory/api/repositories/xxx-pip-unstable-local HTTP/11" 200 None
[2024-06-28 11:12:37,802] {admin.py:151} DEBUG - RepositoryVirtual [xxx-pip-unstable-local] exist

I've tested with dohq-artifactory-0.10.0

@jdeblock11
Copy link

I’m experiencing the same issue. We’re trying to recursively search packages in federated repos and it’s unable to find the repo in artifactory.

@jdeblock11
Copy link

Looks like ArtifactoryPath.find_repository needs to be extended to include RepositoryFederated.

Relavent code:

class RepositoryFederated(RepositoryLocal):

artifactory/artifactory.py

Lines 2382 to 2416 in b116902

def find_repository_local(self, name):
obj = RepositoryLocal(self, name)
if obj.read():
return obj
return None
def find_repository_virtual(self, name):
obj = RepositoryVirtual(self, name)
if obj.read():
return obj
return None
def find_repository_remote(self, name):
obj = RepositoryRemote(self, name)
if obj.read():
return obj
return None
def find_repository(self, name):
try:
return self.find_repository_local(name)
except ArtifactoryException:
pass
try:
return self.find_repository_remote(name)
except ArtifactoryException:
pass
try:
return self.find_repository_virtual(name)
except ArtifactoryException:
pass
return None

@allburov allburov added the Help Wanted We will be glad if somebody proposes a solution via PR label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted We will be glad if somebody proposes a solution via PR
Development

No branches or pull requests

3 participants