Add detailed debug logging to _resolve_dependency_to_artifact
This commit is contained in:
@@ -435,6 +435,8 @@ def _resolve_dependency_to_artifact(
|
|||||||
if not package:
|
if not package:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
logger.info(f"_resolve_dependency_to_artifact: package_id={package.id}, version={version!r}, tag={tag!r}")
|
||||||
|
|
||||||
if version:
|
if version:
|
||||||
# Check if this is a version constraint (>=, <, etc.) or exact version
|
# Check if this is a version constraint (>=, <, etc.) or exact version
|
||||||
if _is_version_constraint(version):
|
if _is_version_constraint(version):
|
||||||
@@ -452,6 +454,7 @@ def _resolve_dependency_to_artifact(
|
|||||||
Artifact.id == pkg_version.artifact_id
|
Artifact.id == pkg_version.artifact_id
|
||||||
).first()
|
).first()
|
||||||
if artifact:
|
if artifact:
|
||||||
|
logger.info(f"_resolve_dependency_to_artifact: found by version {version}")
|
||||||
return (artifact.id, version, artifact.size)
|
return (artifact.id, version, artifact.size)
|
||||||
|
|
||||||
# Also check if there's a tag with this exact name
|
# Also check if there's a tag with this exact name
|
||||||
@@ -459,6 +462,7 @@ def _resolve_dependency_to_artifact(
|
|||||||
Tag.package_id == package.id,
|
Tag.package_id == package.id,
|
||||||
Tag.name == version,
|
Tag.name == version,
|
||||||
).first()
|
).first()
|
||||||
|
logger.info(f"_resolve_dependency_to_artifact: tag lookup by version name, found={tag_record is not None}")
|
||||||
if tag_record:
|
if tag_record:
|
||||||
artifact = db.query(Artifact).filter(
|
artifact = db.query(Artifact).filter(
|
||||||
Artifact.id == tag_record.artifact_id
|
Artifact.id == tag_record.artifact_id
|
||||||
@@ -472,6 +476,7 @@ def _resolve_dependency_to_artifact(
|
|||||||
Tag.package_id == package.id,
|
Tag.package_id == package.id,
|
||||||
Tag.name == tag,
|
Tag.name == tag,
|
||||||
).first()
|
).first()
|
||||||
|
logger.info(f"_resolve_dependency_to_artifact: tag lookup by tag param, found={tag_record is not None}")
|
||||||
if tag_record:
|
if tag_record:
|
||||||
artifact = db.query(Artifact).filter(
|
artifact = db.query(Artifact).filter(
|
||||||
Artifact.id == tag_record.artifact_id
|
Artifact.id == tag_record.artifact_id
|
||||||
@@ -479,6 +484,9 @@ def _resolve_dependency_to_artifact(
|
|||||||
if artifact:
|
if artifact:
|
||||||
return (artifact.id, tag, artifact.size)
|
return (artifact.id, tag, artifact.size)
|
||||||
|
|
||||||
|
# Debug: list actual tags
|
||||||
|
sample_tags = db.query(Tag).filter(Tag.package_id == package.id).limit(3).all()
|
||||||
|
logger.info(f"_resolve_dependency_to_artifact: NOT FOUND. Sample tags: {[t.name for t in sample_tags]}")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
@@ -685,11 +693,6 @@ def resolve_dependencies(
|
|||||||
db, project_name, package_name, ref, ref
|
db, project_name, package_name, ref, ref
|
||||||
)
|
)
|
||||||
if not resolved:
|
if not resolved:
|
||||||
# Debug: list available tags
|
|
||||||
from .models import Tag
|
|
||||||
tags = db.query(Tag).filter(Tag.package_id == package.id).limit(5).all()
|
|
||||||
tag_names = [t.name for t in tags]
|
|
||||||
logger.warning(f"resolve_dependencies: artifact not found for ref={ref!r}. Sample tags: {tag_names}")
|
|
||||||
raise DependencyNotFoundError(project_name, package_name, ref)
|
raise DependencyNotFoundError(project_name, package_name, ref)
|
||||||
|
|
||||||
root_artifact_id, root_version, root_size = resolved
|
root_artifact_id, root_version, root_size = resolved
|
||||||
|
|||||||
Reference in New Issue
Block a user