-
Notifications
You must be signed in to change notification settings - Fork 124
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
Repo creation errors out with Ruby bindings #3639
Comments
I suspect the pulpcore version at the time of creating the bindings may have been different from 3.49.9. See also https://discourse.pulpproject.org/t/we-will-stop-publishing-bindings-soon/1240 |
If that's the cause, even more reason for us to start generating the bindings ourselves. I can try pulp-rpm 3.26 for now if that would be preferable. |
I've confirmed that regenerating the bindings myself fixes the issue. In comparing the generated bindings with the bindings on rubygems.org, I'm seeing references to
and
for examples. |
We (Katello) still need to come up with a solid plan to create our own Ruby bindings. Building the bindings ourselves is easy as a one-off, but we'd need our self-generation process ironed out before we can start doing it reliably. Is there any way this can be handled without us having to monkey-patch things? |
@ianballou Are you talking about the short-term (handling this specific issue) or the long-term (working on the self-generation process)? We'd be happy to work with you on getting the long-term process sorted out. |
@dralley I was talking about the short term. For our upcoming Katello 4.14, if we need to generate our own bindings, it would need to be done manually each time. It's not impossible, but there's always the risk of our packaging automation being used to bump the pulp_rpm_client version and having a new version pulled from rubygems. |
The problemAfter some investigation and experimentation, these are my conclusions:
diff --git a/tmp/wrong-api.json b/tmp/right-api.json
index fc0ae2d..5fd2c53 100644
--- a/tmp/wrong-api.json
+++ b/tmp/right-api.json
@@ -9066,6 +9066,7 @@
"description": "A serializer for Content Copy API.",
"properties": {
"config": {
+ "type": "object",
"description": "A JSON document describing sources, destinations, and content to be copied"
},
"dependency_solving": {
@@ -10104,6 +10105,7 @@
"minimum": 0
},
"repo_config": {
+ "type": "object",
"description": "A JSON document describing config.repo file"
},
# ...
# The rest is very similar The experiment was:
IdeasI'm not sure what is the way to go, but some general approaches I see are:
|
Actually not specifying the |
@pedro-psb Wow. Great work! |
Drf JSONField is actually 'any' because it can be of any type (list, obj int, bool, etc). Nevertheless, we (and drf-spectacular) always interpret it as being of type 'object'. In v0.27.0, drf-spectacular fixed that on their side, which broke us. Although it is not correct to keep using JSONFields strictly as a object, this commit adds a drf-spectacular extension that enforces that it should always be trated as an 'object' on openapi schema generation. The reason is to provide a safe fix for our users, who need their bindings working the same way as they always did. Closes: pulp#3639
Drf JSONField is actually 'any' because it can be of any type (list, obj int, bool, etc). Nevertheless, we (and drf-spectacular) always interpret it as being of type 'object'. In v0.27.0, drf-spectacular fixed that on their side, which broke us. Although it is not correct to keep using JSONFields strictly as a object, this commit adds a drf-spectacular extension that enforces that it should always be trated as an 'object' on openapi schema generation. The reason is to provide a safe fix for our users, who need their bindings working the same way as they always did. Closes: pulp#3639
Drf JSONField is actually 'any' because it can be of any type (list, obj int, bool, etc). Nevertheless, we (and drf-spectacular) always interpret it as being of type 'object'. In v0.27.0, drf-spectacular fixed that on their side, which broke us. Although it is not correct to keep using JSONFields strictly as a object, this commit adds a drf-spectacular extension that enforces that it should always be trated as an 'object' on openapi schema generation. The reason is to provide a safe fix for our users, who need their bindings working the same way as they always did. Closes: pulp#3639
Drf JSONField is actually 'any' because it can be of any type (list, obj int, bool, etc). Nevertheless, we (and drf-spectacular) always interpret it as being of type 'object'. In v0.27.0, drf-spectacular fixed that on their side, which broke us. Although it is not correct to keep using JSONFields strictly as a object, this commit adds a drf-spectacular extension that enforces that it should always be trated as an 'object' on openapi schema generation. The reason is to provide a safe fix for our users, who need their bindings working the same way as they always did. Closes: pulp#3639
I've confirmed that using pulp-openapi-generator >= 5.3.0 fixes that (OpenAPITools/openapi-generator#10192). |
The JSONField was yielding an empty type on the schema, which broke bindings generation. This replaces drf serializers.JSONField with a custom one that is an OpenApi 'object' type. Closes: pulp#3639
See pulp/pulp_rpm#3639 (cherry picked from commit 58425d7)
See pulp/pulp_rpm#3639 (cherry picked from commit 58425d7)
See pulp/pulp_rpm#3639 (cherry picked from commit 2d90c0c)
See pulp/pulp_rpm#3639 [noissue] (cherry picked from commit 2d90c0c)
See pulp/pulp_rpm#3639 [noissue] (cherry picked from commit 2d90c0c)
See pulp/pulp_rpm#3639 (cherry picked from commit 58425d7)
See pulp/pulp_rpm#3639 (cherry picked from commit 58425d7)
See pulp/pulp_rpm#3639 (cherry picked from commit 58425d7)
See pulp/pulp_rpm#3639 [noissue] (cherry picked from commit 2d90c0c)
See pulp/pulp_rpm#3639 (cherry picked from commit 58425d7)
See pulp/pulp_rpm#3639 (cherry picked from commit 58425d7)
See pulp/pulp_rpm#3639 (cherry picked from commit 58425d7)
See pulp/pulp_rpm#3639 (cherry picked from commit 58425d7)
See pulp/pulp_rpm#3639 (cherry picked from commit 58425d7)
See pulp/pulp_rpm#3639 (cherry picked from commit 58425d7)
See pulp/pulp_rpm#3639 (cherry picked from commit 2d90c0c)
See pulp/pulp_rpm#3639 (cherry picked from commit 2d90c0c)
See pulp/pulp_rpm#3639 (cherry picked from commit 2d90c0c)
See pulp/pulp_rpm#3639 (cherry picked from commit 2d90c0c)
See pulp/pulp_rpm#3639 (cherry picked from commit 2d90c0c)
See pulp/pulp_rpm#3639 (cherry picked from commit 2d90c0c)
DRF serializers.JSONField can be any json entity, but we want more precise types for better schema/bindings representation. New fields that are supposed to be dict or list structures should use the new JSONDictField or JSONListField field. Some context: <pulp/pulp_rpm#3639>
DRF serializers.JSONField can be any json entity, but we want more precise types for better schema/bindings representation. New fields that are supposed to be dict or list structures should use the new JSONDictField or JSONListField field. Some context: <pulp/pulp_rpm#3639>
DRF serializers.JSONField can be any json entity, but we want more precise types for better schema/bindings representation. New fields that are supposed to be dict or list structures should use the new JSONDictField or JSONListField field. Some context: <pulp/pulp_rpm#3639>
DRF serializers.JSONField can be any json entity, but we want more precise types for better schema/bindings representation. New fields that are supposed to be dict or list structures should use the new JSONDictField or JSONListField field. Some context: <pulp/pulp_rpm#3639>
DRF serializers.JSONField can be any json entity, but we want more precise types for better schema/bindings representation. New fields that are supposed to be dict or list structures should use the new JSONDictField or JSONListField field. Some context: <pulp/pulp_rpm#3639>
Version
pulp-rpm 3.27.1 (client has same version)
Tested with Katello 4.14.develop
Describe the bug
Creating a repository returns a traceback. The repo does get created, but there's an error.
To Reproduce
Try to create an RPM repo with the Ruby bindings
Expected behavior
Repo is created without an error.
The text was updated successfully, but these errors were encountered: