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

chore(deps): Upgrade to Django 4.1 #18830

Merged
merged 30 commits into from
Dec 11, 2023
Merged

chore(deps): Upgrade to Django 4.1 #18830

merged 30 commits into from
Dec 11, 2023

Conversation

webjunkie
Copy link
Contributor

Problem

Upgrade to a more recent Django version.

Changes

How did you test this code?

  • look at CI

webjunkie and others added 12 commits November 15, 2023 16:10
We need to be on >= 3.1.8

Locally there is an additional problem that somehow psycopg2
seemingly overshadows psycopg, making it appear that 3.1 works.

Had to install pip install "psycopg[binary,pool]==3.1.2" to
recreate the problem.
We use custom SQL that somehow doesn't get formatted in the right way
using server or client side cursors.
Come up as
error: Unused "type: ignore" comment
@webjunkie webjunkie force-pushed the chore/Django-4.1-upgrade branch from 7a6a13a to a7dd0d8 Compare November 22, 2023 20:00
Copy link
Member

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

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

clicking around locally things seem to work

(Web analytics doesn't load anything (but it doesn't in master for me now and I'd not loaded it locally before)

I think the roll out is the interesting bit. Whether we merge with folk on standby for a fast rollback if things break in production unexpectedly or if we try and figure out how to get it into dev separately to deploying to production

Comment on lines +957 to +959
AND NOT ("posthog_dashboard"."deleted"
AND "posthog_dashboardtile"."deleted"
AND "posthog_dashboardtile"."deleted" IS NOT NULL)
Copy link
Member

Choose a reason for hiding this comment

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

interesting change... I guess it's only enforcing that we don't return deleted things so probably fine

@pauldambra
Copy link
Member

pauldambra commented Nov 22, 2023

i added the deploy label - pushing a new commit deploys an ephemeral environment we could use as another functionality check

@github-actions github-actions bot temporarily deployed to pr-chore/Django-4.1-upgrade November 23, 2023 10:52 Destroyed
@github-actions github-actions bot temporarily deployed to pr-chore/Django-4.1-upgrade November 23, 2023 11:22 Destroyed
@webjunkie
Copy link
Contributor Author

Looks like it cannot deploy because of the branch name... is there something to circumvent this or do I need a new PR 😓

@pauldambra
Copy link
Member

pauldambra commented Nov 28, 2023 via email

# Conflicts:
#	posthog/api/test/__snapshots__/test_feature_flag.ambr
@github-actions github-actions bot temporarily deployed to pr-chore/Django-4.1-upgrade November 29, 2023 08:36 Destroyed
@github-actions github-actions bot temporarily deployed to pr-chore/Django-4.1-upgrade November 29, 2023 08:43 Destroyed
@github-actions github-actions bot temporarily deployed to pr-chore/Django-4.1-upgrade November 29, 2023 09:51 Destroyed
@benjackwhite benjackwhite self-requested a review December 5, 2023 13:15
@github-actions github-actions bot temporarily deployed to pr-chore/Django-4.1-upgrade December 6, 2023 12:10 Destroyed
@github-actions github-actions bot temporarily deployed to pr-chore/Django-4.1-upgrade December 7, 2023 14:16 Destroyed
@github-actions github-actions bot temporarily deployed to pr-chore/Django-4.1-upgrade December 7, 2023 14:55 Destroyed
@github-actions github-actions bot temporarily deployed to pr-chore/Django-4.1-upgrade December 7, 2023 15:33 Destroyed
@github-actions github-actions bot temporarily deployed to pr-chore/Django-4.1-upgrade December 7, 2023 15:37 Destroyed
@webjunkie
Copy link
Contributor Author

Found one issue with CSRF thanks due to hobby deploy 👏🏻

https://docs.djangoproject.com/en/4.2/releases/4.0/#csrf-trusted-origins-changes

@github-actions github-actions bot temporarily deployed to pr-chore/Django-4.1-upgrade December 7, 2023 16:21 Destroyed
@github-actions github-actions bot temporarily deployed to pr-chore/Django-4.1-upgrade December 7, 2023 16:36 Destroyed
posthog/settings/access.py Outdated Show resolved Hide resolved
# Conflicts:
#	posthog/temporal/data_imports/external_data_job.py
#	posthog/temporal/tests/test_external_data_job.py
@github-actions github-actions bot temporarily deployed to pr-chore/Django-4.1-upgrade December 9, 2023 07:29 Destroyed
@webjunkie
Copy link
Contributor Author

I can log in and things seem to work. I've just fixed some type problems so then CI should be green.

What else can we check or how do we proceed?

@github-actions github-actions bot temporarily deployed to pr-chore/Django-4.1-upgrade December 11, 2023 08:26 Destroyed
@pauldambra
Copy link
Member

I'm not sure forcing the image for a deploy to dev gives us much more than the deploy label does.

@frankh is infrastructure support this week. So maybe we make sure we've got his time booked and deploy this with him on hand to force a rollback if we see issues?

(or we ask him how we can force an image in dev to try this there...)

Copy link
Contributor

@danielxnj danielxnj left a comment

Choose a reason for hiding this comment

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

LGTM

@webjunkie webjunkie merged commit 580c7b1 into master Dec 11, 2023
71 checks passed
@webjunkie webjunkie deleted the chore/Django-4.1-upgrade branch December 11, 2023 13:44
webjunkie added a commit that referenced this pull request Dec 11, 2023
fuziontech pushed a commit that referenced this pull request Dec 11, 2023
Revert "chore(deps): Upgrade to Django 4.1 (#18830)"

This reverts commit 580c7b1.
webjunkie added a commit that referenced this pull request Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants