Project

Profile

Help

Issue #3705

Asynchronous updates to list objects does not work

Added by bizhang over 1 year ago. Updated 6 months ago.

Status:
MODIFIED
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Severity:
2. Medium
Version:
Platform Release:
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:
Sprint 37

Description

When I try to update a python project: `http PATCH $REMOTE_HREF name='foo' projects:='[{"name":"pip-tools", "version_specifier":">=1.12,<=2.0"}]'`

`projects` always gets passed into `PythonRemoteSerializer.update()` as `[]`

Tracing through the code shows that we take the data and pass it to a QueryDict before passing it to a serializer: https://github.com/pulp/pulp/blob/3.0-dev/pulpcore/pulpcore/app/tasks/base.py#L32

Talking with @dkliban, this is done because there is some code that checks if it was a form submission from the browsable API or if it came from the rest API directly and not having the querydict there was causing it to think it was a form submission. A regular dictionary was making it always think it was a form submission.

But with this QueryDict, drf thinks list data is an HTML Input [https://github.com/encode/django-rest-framework/blob/master/rest_framework/serializers.py#L603]
because the QueryDict has a getlist attribute on it [https://github.com/encode/django-rest-framework/blob/master/rest_framework/utils/html.py#L9]

And parse_html_list returns a empty list on this data.

Associated revisions

Revision 8302f6c9 View on GitHub
Added by werwty over 1 year ago

Stop creating QueryDict for async update data

I could not find any asnyc updates that breaks with this change.
Smash also passes cleanly. I suspect breakage might have occured
when we had more complex nested relationships.

closes #3705
https://pulp.plan.io/issues/3705

Revision 8302f6c9 View on GitHub
Added by werwty over 1 year ago

Stop creating QueryDict for async update data

I could not find any asnyc updates that breaks with this change.
Smash also passes cleanly. I suspect breakage might have occured
when we had more complex nested relationships.

closes #3705
https://pulp.plan.io/issues/3705

Revision 8302f6c9 View on GitHub
Added by werwty over 1 year ago

Stop creating QueryDict for async update data

I could not find any asnyc updates that breaks with this change.
Smash also passes cleanly. I suspect breakage might have occured
when we had more complex nested relationships.

closes #3705
https://pulp.plan.io/issues/3705

History

#1 Updated by amacdona@redhat.com over 1 year ago

@dkliban, if we dropped the browsable interface, could we drop the QueryDict?

#2 Updated by amacdona@redhat.com over 1 year ago

  • Subject changed from Updates to list objects does not work to Asynchronous updates to list objects does not work

#3 Updated by CodeHeeler over 1 year ago

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

#4 Updated by bizhang over 1 year ago

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

#5 Updated by bizhang over 1 year ago

  • Status changed from ASSIGNED to POST

#6 Updated by werwty over 1 year ago

  • Status changed from POST to MODIFIED

#7 Updated by daviddavis 6 months ago

  • Sprint/Milestone set to 3.0

#8 Updated by bmbouter 6 months ago

  • Tags deleted (Pulp 3)

Please register to edit this issue

Also available in: Atom PDF