Project

Profile

Help

Issue #9056

ruby and python bindings missing enums OneOfPackageChecksumTypeEnumNullEnum & OneOfMetadataChecksumTypeEnumNullEnum

Added by jsherril@redhat.com 3 months ago. Updated about 1 month ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Sprint 103
Quarter:

Description

After upgrading ot 3.13.3 of the pulp_rpm_client, the ruby bindings started throwing an error:

uninitialized constant PulpRpmClient::OneOfMetadataChecksumTypeEnumNullEnum (NameError)

looking at the code, there are references to OneOfMetadataChecksumTypeEnumNullEnum but the class isn't defined anywhere. I dug into the python client code and it appears it may be the same case for it too.

I see other enums defined properly

We've got a workaround for now , but would like this fixed going forward.


Related issues

Copied to Pulp - Backport #9265: Backport #9056 "ruby and python bindings missing enums OneOfPackageChecksumTypeEnumNullEnum & OneOfMetadataChecksumTypeEnumNullEnum" to 3.14.zCLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision eab862a6 View on GitHub
Added by Fabricio Aguiar about 1 month ago

Removing OpenAPI blank enums

closes #9056

History

#1 Updated by dkliban@redhat.com 2 months ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 100

#2 Updated by rchan 2 months ago

  • Sprint changed from Sprint 100 to Sprint 101

#3 Updated by ipanova@redhat.com about 2 months ago

  • Sprint changed from Sprint 101 to Sprint 102

#4 Updated by rchan about 1 month ago

  • Sprint changed from Sprint 102 to Sprint 103

#5 Updated by dalley about 1 month ago

  • Priority changed from Normal to High

#6 Updated by fao89 about 1 month ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to fao89

#7 Updated by fao89 about 1 month ago

The issue happens with fields with choices that are nullable

metadata_checksum_type = models.CharField(null=True, choices=CHECKSUM_CHOICES, max_length=10)
package_checksum_type = models.CharField(null=True, choices=CHECKSUM_CHOICES, max_length=10)

drf_spectacular uses oneOf to distinguish the options null/choice

"metadata_checksum_type": {
    "nullable": true,
    "description": "The checksum type for metadata.",
    "oneOf": [
        {
            "$ref": "#/components/schemas/MetadataChecksumTypeEnum"
        },
        {
            "$ref": "#/components/schemas/NullEnum"
        }
    ]
},
"package_checksum_type": {
    "nullable": true,
    "description": "The checksum type for packages.",
    "oneOf": [
        {
            "$ref": "#/components/schemas/PackageChecksumTypeEnum"
        },
        {
        "$ref": "#/components/schemas/NullEnum"
        }
    ]
},

pulp-openapi-generator creates these models:

MetadataChecksumTypeEnum, PackageChecksumTypeEnum and NullEnum

The issue happens when declaring the types:

openapi_types = {
    'pulp_labels': 'object',
    'name': 'str',
    'description': 'str',
    'retain_repo_versions': 'int',
    'remote': 'str',
    'autopublish': 'bool',
    'metadata_signing_service': 'str',
    'retain_package_versions': 'int',
    'metadata_checksum_type': 'OneOfMetadataChecksumTypeEnumNullEnum',
    'package_checksum_type': 'OneOfPackageChecksumTypeEnumNullEnum',
    'gpgcheck': 'int',
    'repo_gpgcheck': 'int',
    'sqlite_metadata': 'bool'
}

what would be type PackageChecksumTypeEnum or NullEnum is declared as OneOfPackageChecksumTypeEnumNullEnum

#8 Updated by fao89 about 1 month ago

  • Project changed from Pulp to RPM Support

#9 Updated by fao89 about 1 month ago

  • Project changed from RPM Support to Pulp

#10 Updated by pulpbot about 1 month ago

  • Status changed from ASSIGNED to POST

#12 Updated by dalley about 1 month ago

  • Sprint/Milestone set to 3.15.0

#13 Updated by dalley about 1 month ago

  • Copied to Backport #9265: Backport #9056 "ruby and python bindings missing enums OneOfPackageChecksumTypeEnumNullEnum & OneOfMetadataChecksumTypeEnumNullEnum" to 3.14.z added

#14 Updated by Anonymous about 1 month ago

  • Status changed from POST to MODIFIED

#15 Updated by pulpbot about 1 month ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF