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

feat: Upgrade to Django 2.2 #1416

Merged
merged 24 commits into from
Nov 23, 2020
Merged

feat: Upgrade to Django 2.2 #1416

merged 24 commits into from
Nov 23, 2020

Conversation

faucomte97
Copy link
Member

@faucomte97 faucomte97 commented Nov 5, 2020

This change is Reviewable

@faucomte97 faucomte97 self-assigned this Nov 5, 2020
@codecov
Copy link

codecov bot commented Nov 5, 2020

Codecov Report

Merging #1416 (7c283c9) into django_2_upgrade (a2837ac) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@                Coverage Diff                @@
##           django_2_upgrade    #1416   +/-   ##
=================================================
  Coverage             74.79%   74.79%           
=================================================
  Files                    68       68           
  Lines                   988      988           
  Branches                124      124           
=================================================
  Hits                    739      739           
  Misses                  246      246           
  Partials                  3        3           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a2837ac...7c283c9. Read the comment docs.

Copy link
Contributor

@mrniket mrniket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 17 of 20 files at r1.
Reviewable status: 17 of 20 files reviewed, 4 unresolved discussions (waiting on @faucomte97)

a discussion (no related file):
are we editing previous migrations here?



setup.py, line 25 at r1 (raw file):

    include_package_data=True,
    install_requires=[
        "django>=1.11.24, <= 2.0.0",

we don't have to support 1.11 if we have the long-running feature branch


aimmo/migrations/0003_auto_20160802_1418.py, line 104 at r1 (raw file):

                        to=settings.AUTH_USER_MODEL,
                        null=True,
                        on_delete=models.SET_NULL,

are we editing a previous migration here? I think we forgot to name this migration something human understandable


aimmo/tests/test_models.py, line 6 at r1 (raw file):

class TestModels(TestCase):

I see what this test case is testing here but I'm unsure whether how useful this test will be to keep? Each test has a maintainability cost associated to it too.

Copy link
Contributor

@mrniket mrniket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 20 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @faucomte97)

@faucomte97 faucomte97 changed the base branch from development to django_2_upgrade November 6, 2020 11:41
Copy link
Member Author

@faucomte97 faucomte97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @mrniket)

a discussion (no related file):

Previously, mrniket (Niket Shah) wrote…

are we editing previous migrations here?

Yeah, it was required by Django 2.0 to update the on_delete fields everywhere including the past migrations. Without that the tests can't run and the migrations can't be run either



setup.py, line 25 at r1 (raw file):

Previously, mrniket (Niket Shah) wrote…

we don't have to support 1.11 if we have the long-running feature branch

Done.


aimmo/migrations/0003_auto_20160802_1418.py, line 104 at r1 (raw file):

Previously, mrniket (Niket Shah) wrote…

are we editing a previous migration here? I think we forgot to name this migration something human understandable

Yeah there are about 6 old migrations that have no clear name. Should I figure out what they were for and rename them?


aimmo/tests/test_models.py, line 6 at r1 (raw file):

Previously, mrniket (Niket Shah) wrote…

I see what this test case is testing here but I'm unsure whether how useful this test will be to keep? Each test has a maintainability cost associated to it too.

True, I think the test would only be useful if someone ever changes the on_delete field, so I guess it's more of a safeguard. If you think it's not really useful, I can remove it

Copy link
Collaborator

@razvan-pro razvan-pro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 18 of 20 files at r1, 2 of 2 files at r2.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @faucomte97 and @mrniket)


example_project/example_project/urls.py, line 11 at r2 (raw file):

urlpatterns = [
    url(r"^", include(portal_urls)),
    url(r'^administration/', include((admin.site.urls[0], 'admin'), namespace='admin')),

Double quotes and idea in portal PR 🙂

Copy link
Collaborator

@razvan-pro razvan-pro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r3.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @faucomte97 and @mrniket)

Copy link
Contributor

@mrniket mrniket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @faucomte97 and @razvan-pro)


aimmo/migrations/0003_auto_20160802_1418.py, line 104 at r1 (raw file):

Previously, faucomte97 (Florian Aucomte) wrote…

Yeah there are about 6 old migrations that have no clear name. Should I figure out what they were for and rename them?

Dw, I think it's fine to leave it as it is 😊


aimmo/tests/test_models.py, line 6 at r1 (raw file):

Previously, faucomte97 (Florian Aucomte) wrote…

True, I think the test would only be useful if someone ever changes the on_delete field, so I guess it's more of a safeguard. If you think it's not really useful, I can remove it

Yeah, I'm in favour of removing it. @razvan-pro, second opinion?

Copy link
Member Author

@faucomte97 faucomte97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @faucomte97 and @razvan-pro)


example_project/example_project/urls.py, line 11 at r2 (raw file):

Previously, razvan-pro (Razvan Mahu) wrote…

Double quotes and idea in portal PR 🙂

Done.

Copy link
Contributor

@mrniket mrniket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r4.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @faucomte97 and @razvan-pro)

Copy link
Collaborator

@razvan-pro razvan-pro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @faucomte97 and @mrniket)


aimmo/tests/test_models.py, line 6 at r1 (raw file):

Previously, mrniket (Niket Shah) wrote…

Yeah, I'm in favour of removing it. @razvan-pro, second opinion?

Hm, it would be good to have a test like this, but maybe we can do it more isolated without going through all the models at once: e.g. test if removing a worksheet which has a game attached to it would raise an error (not sure if users can delete worksheets at the moment). If we don't have tests like this already, it may take a long time to cover everything individually now, so then yeah, we can probably delete this for now and do some functional tests in the future.

Copy link
Contributor

@mrniket mrniket left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @faucomte97 and @razvan-pro)


aimmo/tests/test_models.py, line 6 at r1 (raw file):

Previously, razvan-pro (Razvan Mahu) wrote…

Hm, it would be good to have a test like this, but maybe we can do it more isolated without going through all the models at once: e.g. test if removing a worksheet which has a game attached to it would raise an error (not sure if users can delete worksheets at the moment). If we don't have tests like this already, it may take a long time to cover everything individually now, so then yeah, we can probably delete this for now and do some functional tests in the future.

Yeah, I was thinking a higher-level test but be better in this instance. I believe we don't have tests like this currently...

Copy link
Collaborator

@razvan-pro razvan-pro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 3 files at r5.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @faucomte97)

Copy link
Collaborator

@razvan-pro razvan-pro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 1 files at r4, 6 of 6 files at r6.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @faucomte97)

@faucomte97 faucomte97 changed the title feat: Upgrade to Django 2.0 feat: Upgrade to Django 2.2 Nov 19, 2020
Copy link
Member Author

@faucomte97 faucomte97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 36 files reviewed, 1 unresolved discussion (waiting on @faucomte97, @mrniket, and @razvan-pro)


aimmo/tests/test_models.py, line 6 at r1 (raw file):

Previously, mrniket (Niket Shah) wrote…

Yeah, I was thinking a higher-level test but be better in this instance. I believe we don't have tests like this currently...

Done.

Copy link
Collaborator

@razvan-pro razvan-pro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 28 of 28 files at r11.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @faucomte97 and @mrniket)


Pipfile, line 10 at r11 (raw file):

pytest-django = "==4.1.0"
pytest-pythonpath = "*"
#codeforlife-portal = "*"

Idea: can we try getting portal from a git branch here? I see there is a way to specify this https://github.com/pypa/pipfile


setup.py, line 26 at r11 (raw file):

    install_requires=[
        "django==2.2.*",
        # "django-autoconfig >= 0.3.6, < 1.0.0",

We'll need to fix this somehow, I assume it's still needed right?

Copy link
Member Author

@faucomte97 faucomte97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @mrniket and @razvan-pro)


Pipfile, line 10 at r11 (raw file):

Previously, razvan-pro (Razvan Mahu) wrote…

Idea: can we try getting portal from a git branch here? I see there is a way to specify this https://github.com/pypa/pipfile

I can't seem to lock the Pipfile if I do that because portal points to old repos still :(


setup.py, line 26 at r11 (raw file):

Previously, razvan-pro (Razvan Mahu) wrote…

We'll need to fix this somehow, I assume it's still needed right?

yes indeed

Copy link
Collaborator

@razvan-pro razvan-pro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @mrniket)


Pipfile, line 10 at r11 (raw file):

Previously, faucomte97 (Florian Aucomte) wrote…

I can't seem to lock the Pipfile if I do that because portal points to old repos still :(

Ah, I see, yeah, we'd need to sync all of them if we want to try this

@faucomte97 faucomte97 merged commit 2489966 into django_2_upgrade Nov 23, 2020
@faucomte97 faucomte97 deleted the django_2_0_test branch March 1, 2022 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants