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
Download all-artifacts.zip from Apicurio-registry v2 according to the instruction. In my case it is apicurio-registry 2.5.10.Final
Deploy a fresh installation of Apicurio-registry v3 (the bug is also reproducible on localhost using Docker and in-memory DB): docker run -d -p 8080:8080 apicurio/apicurio-registry:3.0.4
Import artifacts to registry v3 using curl: curl -Sv -X POST "http://localhost:8080/apis/registry/v3/admin/import" -H "Accept: application/json" -H "Content-Type: application/zip" --data-binary @all-artifacts.zip
Make sure that the artifacts being imported successfully: curl http://localhost:8080/apis/registry/v3/groups/default/artifacts
Take any artifactId, check that its versions are available in both apis: curl http://localhost:8080/apis/registry/v2/groups/default/artifacts/SomeArtifact-value/versions/ curl http://localhost:8080/apis/registry/v3/groups/default/artifacts/SomeArtifact-value/versions/
Make sure that its versions also available as a list in confluence-compatible API: http://localhost:8080/apis/ccompat/v7/subjects/SomeArtifact-value/versions
Try obtaining the latest version using ccompat API: curl http://localhost:8080/apis/ccompat/v7/subjects/SomeArtifact-value/versions/latest {"message":"No version '<tip of the branch 'latest'>' found for artifact with ID 'SomeArtifact-value' in group 'default'.","error_code":40402}
The same goes for api v2: $ curl http://localhost:8080/apis/registry/v2/groups/default/artifacts/SomeArtifact-value/versions/latest {"message":"No version '<tip of the branch 'latest'>' found for artifact with ID 'SomeArtifact-value' in group 'default'.","error_code":404,"detail":"VersionNotFoundException: No version '<tip of the branch 'latest'>' found for artifact with ID 'SomeArtifact-value' in group 'default'.","name":"VersionNotFoundException"
Expected vs Actual Behaviour
It was expected here to obtain the last version of artifact (there were two of them in this case) from Confluence-compatible API and API v2. But due to lack of branch field it is not possible anymore in version 3.0.4.
I believe this field should be added during /v3/admin/import request to maintain backwards-compatbility.
I also tried creating a new artifact from scratch using API v2, this way branch with name "latest" was created automatically and there was no such problem:
Description
Registry
Version: 3.0.4
Persistence type: SQL
Environment
Kubernetes 1.26
Steps to Reproduce
docker run -d -p 8080:8080 apicurio/apicurio-registry:3.0.4
curl -Sv -X POST "http://localhost:8080/apis/registry/v3/admin/import" -H "Accept: application/json" -H "Content-Type: application/zip" --data-binary @all-artifacts.zip
curl http://localhost:8080/apis/registry/v3/groups/default/artifacts
curl http://localhost:8080/apis/registry/v2/groups/default/artifacts/SomeArtifact-value/versions/ curl http://localhost:8080/apis/registry/v3/groups/default/artifacts/SomeArtifact-value/versions/
http://localhost:8080/apis/ccompat/v7/subjects/SomeArtifact-value/versions
curl http://localhost:8080/apis/ccompat/v7/subjects/SomeArtifact-value/versions/latest {"message":"No version '<tip of the branch 'latest'>' found for artifact with ID 'SomeArtifact-value' in group 'default'.","error_code":40402}
$ curl http://localhost:8080/apis/registry/v2/groups/default/artifacts/SomeArtifact-value/versions/latest {"message":"No version '<tip of the branch 'latest'>' found for artifact with ID 'SomeArtifact-value' in group 'default'.","error_code":404,"detail":"VersionNotFoundException: No version '<tip of the branch 'latest'>' found for artifact with ID 'SomeArtifact-value' in group 'default'.","name":"VersionNotFoundException"
Expected vs Actual Behaviour
It was expected here to obtain the last version of artifact (there were two of them in this case) from Confluence-compatible API and API v2. But due to lack of branch field it is not possible anymore in version 3.0.4.
I believe this field should be added during /v3/admin/import request to maintain backwards-compatbility.
I also tried creating a new artifact from scratch using API v2, this way branch with name "latest" was created automatically and there was no such problem:
curl -X POST -H "Content-type: application/json; artifactType=AVRO" -H "X-Registry-ArtifactId: SomeTestArtifact-value" --data '{"type":"record","name":"price","namespace":"com.example","fields":[{"name":"symbol","type":"string"},{"name":"price","type":"string"}]}' http://localhost:8080/apis/registry/v2/groups/default/artifacts
curl -X POST "http://localhost:8080/apis/registry/v2/groups/default/artifacts/SomeTestArtifact-value/versions" -H "Content-Type: application/json" -d '{"type": "record", "name": "price", "namespace":"com.example", "fields": [{"name": "symbol", "type": "string"}, {"name": "price", "type": "string"}]}'
curl http://localhost:8080/apis/registry/v3/groups/default/artifacts/SomeTestArtifact-value/branches
{"branches":[{"branchId":"latest","createdOn":"2024-11-28T11:58:21Z","owner":"","modifiedOn":"2024-11-28T11:58:21Z","modifiedBy":"","systemDefined":true}],"count":1}
curl http://localhost:8080/apis/ccompat/v7/subjects/SomeTestArtifact-value/versions/latest
{"id":249,"subject":"SomeTestArtifact-value","version":2,"schema":"{\"type\": \"record\", \"name\": \"price\", \"namespace\":\"com.example\", \"fields\": [{\"name\": \"symbol\", \"type\": \"string\"}, {\"name\": \"price\", \"type\": \"string\"}]}","references":[]}
curl http://localhost:8080/apis/registry/v2/groups/default/artifacts/SomeTestArtifact-value/versions/latest
{"type": "record", "name": "price", "namespace":"com.example", "fields": [{"name": "symbol", "type": "string"}, {"name": "price", "type": "string"}]}
The text was updated successfully, but these errors were encountered: