Project

Profile

Help

Task #8488

[EPIC] Upgrade to django 3.2

Added by daviddavis 4 months ago. Updated about 7 hours ago.

Status:
NEW
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
Start date:
Due date:
% Done:

89%

Estimated time:
(Total: 0:00 h)
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

See the subtasks for the identified work.


Subtasks

Refactor #8821: Have the content app make all of its ORM calls in another Threadpool executorCLOSED - CURRENTRELEASEdalley

Actions
Task #8975: Provide environment variables to permit Django ORM to work in an async contextCLOSED - CURRENTRELEASEdalley

Actions
Task #9018: Bump the pulpcore requirement to django 3.2MODIFIEDdaviddavis

Actions
Task #9112: Update `contrib.JSONField` to `JSONField`MODIFIEDdaviddavis

Actions
Issue #9120: Deprecation warning for RepositoryVersionContentDetails idMODIFIEDActions
Ansible Plugin - Task #9121: Update `contrib.JSONField` to `JSONField`CLOSED - DUPLICATE

Actions
Issue #9129: Syncing is running out of DB connectionsPOSTgerrodActions
Task #9171: Remove workaround in RemoteArtifactSaver now that we're on Django 3.2MODIFIED

Actions
RPM Support - Task #9189: Update `contrib.JSONField` to `JSONField`POSTipanova@redhat.com

Actions

Related issues

Blocked by Pulp - Task #8853: [EPIC] Drop support for Python 3.6NEW

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

History

#1 Updated by dalley 4 months ago

  • Related to Refactor #6529: Pulp 3 may be using Django in an unsafe way (with async) added

#2 Updated by daviddavis 4 months ago

Here's my branch: https://github.com/daviddavis/pulpcore/tree/django3

Most of everything is working aside from the task code (more on this below). The django-guid package has a 3.x version which they recommend using since it supports ASGI. However, it does not support Python 3.6. But it appears that django-guid 2.2 is working for now.

The biggest change will be handling django's ORM in our async code. Django's ORM is not async safe and therefore you have to use sync_to_async()[0] when calling django's ORM (otherwise you get an error[1]).

Alternatively, there is a variable we can set DJANGO_ALLOW_ASYNC_UNSAFE[2] but I don't think we should go this route. From the django docs, it says, "do not use this in production environments".

[0] https://docs.djangoproject.com/en/3.2/topics/async/#sync-to-async

[1] "SynchronousOnlyOperation: You cannot call this from an async context - use a thread or sync_to_async"

[2] https://docs.djangoproject.com/en/3.2/topics/async/#sync-to-async

#3 Updated by dalley 3 months ago

The compatibility status of django-guardian is a little unclear still. They have it in their test matrix but there is an unmerged PR addressing some compatibility issue.

#4 Updated by daviddavis 2 months ago

django-guardian 2.4.0 was released and it claims support for django 3.2.

#5 Updated by bmbouter 2 months ago

  • Sprint/Milestone set to 3.14.0

#6 Updated by bmbouter 2 months ago

  • Subject changed from Upgrade to django 3.2 to [Epic] Upgrade to django 3.2
  • Description updated (diff)

#7 Updated by bmbouter 2 months ago

  • Related to deleted (Refactor #6529: Pulp 3 may be using Django in an unsafe way (with async))

#8 Updated by daviddavis about 2 months ago

  • Related to Task #8853: [EPIC] Drop support for Python 3.6 added

#9 Updated by bmbouter about 2 months ago

  • Related to deleted (Task #8853: [EPIC] Drop support for Python 3.6)

#10 Updated by bmbouter about 2 months ago

  • Blocked by Task #8853: [EPIC] Drop support for Python 3.6 added

#11 Updated by daviddavis about 2 months ago

  • Sprint/Milestone changed from 3.14.0 to 3.15.0

#12 Updated by dalley about 1 month ago

  • Sprint/Milestone deleted (3.15.0)

We don't really need both the epic and the subtask, closing the subtask, making this one the "real" issue.

#13 Updated by dalley about 1 month ago

  • Subject changed from [Epic] Upgrade to django 3.2 to Upgrade to django 3.2
  • Sprint/Milestone set to 3.15.0

#14 Updated by bmbouter 8 days ago

  • Subject changed from Upgrade to django 3.2 to [EPIC] Upgrade to django 3.2

Please register to edit this issue

Also available in: Atom PDF