You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When trying to retrieve build information using pyartifactory, an error occurs due to a missing type field in the Docker image layers within the artifacts. Specifically, some Docker layers do not have a type field, and this causes a Pydantic validation error when attempting to parse the response into the BuildInfo model.
To Reproduce
Originally, the bug was encountered while trying to promote a Docker image using art.builds.promote_build(build_name, build_number, build_promote_request).
Due to this issue, I decided to test with a simpler request to retrieve build information using art.builds.get_build_info(build_name, build_number)
Steps to reproduce the behavior:
Pull and push an image to artifactory using jfrog cli
docker pull nginx
docker tag nginx:latest <URL of repository>/nginx:1.0.0
jfrog docker push <URL of repository>/nginx:1.0.0 --build-name=nginx --build-number=1.0.0
jfrog rt build-publish nginx 1.0.0
We can see the build in the UI
Attempt to retrieve build information using art.builds.get_build_info(build_name, build_number) where build_name and build_number point to a Docker image that has layers without a type field.
art.builds.get_build_info("nginx","1.0.0")
See the following error:
9 validation errors for BuildInfo buildInfo.modules.0.artifacts.1.type Field required For further information visit https://errors.pydantic.dev/2.9/v/missing
As you can see only the manifest has a TYPE filed. Expected behavior
The retrieval of build information should handle artifacts that do not have a type field gracefully. The type field should be treated as optional, and the absence of this field should not cause the operation to fail.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment:
Ubuntu 24.04
pyartifactory version 2.7.1:
Python 3.12.3:
Additional context
This issue can be reproduced consistently with Docker image artifacts, as not all image layers have a type field in their metadata. It appears that the BuildArtifact model in pyartifactory expects this field, causing validation errors when it is missing.
The text was updated successfully, but these errors were encountered:
Describe the bug
When trying to retrieve build information using
pyartifactory
, an error occurs due to a missingtype
field in the Docker image layers within the artifacts. Specifically, some Docker layers do not have atype
field, and this causes a Pydantic validation error when attempting to parse the response into theBuildInfo
model.To Reproduce
Originally, the bug was encountered while trying to promote a Docker image using
art.builds.promote_build(build_name, build_number, build_promote_request)
.Due to this issue, I decided to test with a simpler request to retrieve build information using
art.builds.get_build_info(build_name, build_number)
Steps to reproduce the behavior:
We can see the build in the UI
art.builds.get_build_info(build_name, build_number)
wherebuild_name
andbuild_number
point to a Docker image that has layers without atype
field.Here the content of the json of the build
As you can see only the manifest has a TYPE filed.
Expected behavior
The retrieval of build information should handle artifacts that do not have a
type
field gracefully. Thetype
field should be treated as optional, and the absence of this field should not cause the operation to fail.Screenshots
If applicable, add screenshots to help explain your problem.
Environment:
Additional context
This issue can be reproduced consistently with Docker image artifacts, as not all image layers have a
type
field in their metadata. It appears that theBuildArtifact
model inpyartifactory
expects this field, causing validation errors when it is missing.The text was updated successfully, but these errors were encountered: