-
Notifications
You must be signed in to change notification settings - Fork 168
As a user, I can rest easy in the knowledge that Pulp's Celery tasks are not serialized dangerously #2241
Conversation
I think the code is not Python 2.6 compliant. Can you update the PR so that Jenkins is happy. |
I'm glad the commits are preserved. Any changes to this PR can you squash into your commit, and preserve the other 2 (as you've already done). |
Please add details to the commit message outlining the changes. I think the topics are:
|
""" | ||
Convert a dictionary representation of the UnitAssociationCriteria into a new | ||
UnitAssociationCriteria object. | ||
The output of to_dict() is suitable as input to this method. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a newline above this to separate it from the paragraph above it.
|
||
|
||
@celery.task(base=PulpTask) | ||
def publish(repo_id, distributor_id, overrides=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this moved from somewhere else? I can't think of why this is added.
@ipanova This looks really great, I left a bunch of small comments to handle. The two things I don't understand and I believe should be removed are these comments #2241 (comment) and #2241 (comment) Once all of that gets fixed I think it will be good for merging. I can review again on Monday if you want or not, or you can merge it otherwise. |
8c74544
to
61f2671
Compare
045e2a5
to
11ab04a
Compare
@ipanova The most recent push addresses the technical concerns. Can you rebase against the latest master so it can be cleanly merged? |
* Recursive serialization and deserialization * Force all Pulp Celery tasks to inherit from PulpTask
closes pulp#23 https://pulp.plan.io/issues/23 UnitAssociationCriteria arrives as dict in the task code, when it needs to be UnitAssociationCriteria object. to_dict() method was introduced to serialize UnitAssociationCriteria to a dictionary prior to it being sent as an argument to apply_sync(). the from_dict() method was introduced to return UnitAssociationCriteria object from a dictionary that was produced by to_dict() This commit also introduces a testcase that checks that all Celery tasks defined in Pulp inhherit from PulpTask and not from Celery directly. There have been done also changes to criteria. Due to the introduction of de/sereliazions methods, criteria's value cannot be None. Code and tests were updated accordigly.
@bmbouter conflicts resolved, jenkins is happy :) |
@ipanova great job! Also thanks to @shubham90 for his work on this too. |
https://pulp.plan.io/issues/23