devopshq / artifactory

dohq-artifactory: a Python client for Artifactory
https://devopshq.github.io/artifactory/
MIT License
275 stars 148 forks source link

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

Open hransun opened 5 months ago

hransun commented 5 months ago

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 commented 3 months ago

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 commented 3 months ago

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

Relavent code: https://github.com/devopshq/artifactory/blob/b1169024750ee7a3e567d5493d2d9652d5c47918/dohq_artifactory/admin.py#L820

https://github.com/devopshq/artifactory/blob/b1169024750ee7a3e567d5493d2d9652d5c47918/artifactory.py#L2382-L2416