Project

Profile

Help

Issue #1435

closed

Determine if __cmp__ in Package model is safe with mongoengine

Added by bmbouter about 7 years ago. Updated almost 4 years ago.

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

Description

There is a scary todo[0] and some discussion about it during review[1]. This overrides the mongoengine cmp which may have unintentional side effects. For example querysets and caching in mongoengine may rely on the builtin cmp definition behavior for core functionality.

I think the key question to answer here is: "Is overriding the mongoengine the cmp safe?"

Come up with an answer to that question, remove the scary DANGER note, and adjust the code so that it's safe.

[0]: https://github.com/bmbouter/pulp_rpm/blob/2fbaa0221bc9d585067458dd72194ced15078e50/plugins/pulp_rpm/plugins/db/models.py#L171
[1]: https://github.com/pulp/pulp_rpm/pull/741#discussion_r47690165

Also available in: Atom PDF