Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update or replace jsonfield2 #34

Closed
Jawayria opened this issue Jul 27, 2021 · 8 comments
Closed

Update or replace jsonfield2 #34

Jawayria opened this issue Jul 27, 2021 · 8 comments
Labels
edx/ecommerce outdated dependency A dependency needs to be updated or replaced to support an upgrade initiative

Comments

@Jawayria
Copy link

We use the package jsonfield2 in edx/ecommerce, edx/edx-bulk-grades, edx/edx-celeryutils, edx/edx-enterprise, edx/edx-ora2, edx/edx-platform, edx/edx-proctoring, edx/edx-submissions, edx/edx-zoom, edx/enterprise-catalog, edx/event-routing-backends, edx/license-manager, edx/staff_graded-xblock, edx/super-csv, edx/xblock-lti-consumer. It hasn't yet added support for Django3.2. Please follow the guidance in https://openedx.atlassian.net/wiki/spaces/AC/pages/3036972032/Handling+Outdated+Dependencies to resolve the problem this poses for the Open edX Django 3.2 upgrade.

@Jawayria Jawayria added the outdated dependency A dependency needs to be updated or replaced to support an upgrade initiative label Jul 27, 2021
@MaferMazu
Copy link

MaferMazu commented Aug 11, 2021

I was working on issue #42 and I discovered that jsonfield could support django, at least no problem adding django 3.2 as test environment and jsonfield2 was merged with jsonfield, perhaps the best option is to change the use of jsonfield2 to jsonfield but it would be necessary to change that in edx/ecommerce, edx/edx-bulk-grades, edx/edx-celeryutils, edx/edx-enterprise, edx/edx-ora2, edx/edx-platform, edx/edx-proctoring, edx/edx-submissions, edx/edx-zoom, edx/enterprise-catalog, edx/event-routing-backends, edx/license-manager, edx/staff_graded-xblock, edx/super-csv and edx/xblock-lti-consumer. I could work on this.

@MaferMazu
Copy link

I don't know if adding django 3.2 in the tests is enough to say that jsonfield supports django3.2. If so, what would be the steps to follow to resolve this issue? Do a PR on each repository in the django-32-upgrade branch?

@natabene
Copy link

@MaferMazu Thank you so much for looking into this. @jmbowman Could you help us out here?

@jmbowman
Copy link

The switch back to jsonfield was being done in https://openedx.atlassian.net/browse/BOM-1917 , but I think we lost momentum during the review cycle of openedx/edx-submissions#136 . Trying to get that moving again now, thanks for the reminder. I don't think we'd started the upgrade yet in ecommerce, if you want to help with that.

@MaferMazu
Copy link

I noticed that jsonfield allows to use JSONField but Django> = 3.1 includes JSONField (models.JSONField and forms.JSONField) https://docs.djangoproject.com/en/3.2/releases/3.1/#jsonfield-for-all-supported-database-backends
It would only be necessary to change the current use of the package to the use that is now supported by Django.

Change

from jsonfield.fields import JSONField

# or

from jsonfield import JSONField

to

from django.db.models import JSONField

# or use models.JSONField

from django.db import models

class ContactInfo(models.Model):
    data = models.JSONField()

@jmbowman
Copy link

For a little while we'll need concurrent support for Django 2.2 and 3.2, so we can't just switch the code over; it would have to be conditional, and I don't think that'll play nicely with migrations (Django will want a new migration when the field's class changes). I'm sure we could find a workaround of some sort, but this would be much easier if the jsonfield package provided a clean upgrade path that allows us to upgrade to Django 3.2 before switching over the field types.

@MaferMazu
Copy link

MaferMazu commented Aug 27, 2021

Then I suppose that the best option could be to use the latest version of jsonfield. Adding django 3.2 in the tests environment works fine. I opened an issue in the repo but I don't think they will update it.

@jmbowman
Copy link

Ok, then since we have a path forward on getting all jsonfield2 and jsonfield package usage updated to work with Django 3.2, I'll go ahead and close this out. The actual upgrades to the latest jsonfield package are in progress and can be handled as part of the IDA updating work. Thanks for helping sort all this out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
edx/ecommerce outdated dependency A dependency needs to be updated or replaced to support an upgrade initiative
Projects
None yet
Development

No branches or pull requests

5 participants