Skip to content

Backend 4: Upgrade Django 5.2 to 6.0.3#9322

Merged
Archaeopteryx merged 1 commit into
masterfrom
camd/back-end-package-upgrade-phase-4
May 27, 2026
Merged

Backend 4: Upgrade Django 5.2 to 6.0.3#9322
Archaeopteryx merged 1 commit into
masterfrom
camd/back-end-package-upgrade-phase-4

Conversation

@camd
Copy link
Copy Markdown
Collaborator

@camd camd commented Mar 22, 2026

Summary

Phase 4 of the Python/Django upgrade plan: upgrades Django from 5.2.12 LTS to 6.0.3.

Package upgrades:

  • Django 5.2.12 → 6.0.3
  • djangorestframework 3.16.1 → 3.17.0 (Django 6.0 support)
  • django-filter 25.1 → 25.2 (Django 6.0 support)
  • django-debug-toolbar 5.2.0 → 6.2.0 (Django 6.0 support)
  • dockerflow 2024.4.2 → 2026.3.4 (Django 6.0 support)
  • asgiref 3.8.1 → 3.11.1 (minimum required by Django 6.0)
  • typing-extensions 4.12.0 → 4.15.0 (align dev/common versions)

Code changes:

  • settings.py: Switch from deprecated dockerflow.logging.JsonLogFormatter to MozlogFormatter
  • settings.py: Change django.contrib.postgres.search to django.contrib.postgres in INSTALLED_APPS (Django 6.0 requires the parent app for SearchVectorField)
  • settings.py: Silence debug_toolbar.E001 system check (django-debug-toolbar 6.x raises an error when DEBUG=False but toolbar is in INSTALLED_APPS; this happens when tests toggle DEBUG at runtime)
  • Aligned package versions between dev.txt and common.txt to prevent pip install conflicts (distlib, filelock, identify, idna, nodeenv, packaging, platformdirs, sqlparse, virtualenv)

Packages kept as-is:

  • drf-spectacular 0.29.0 and django-redis 6.0.0: no Django 6.0 classifiers yet, but no upper-bound pins — work fine with Django 6.0
  • urllib3 kept at 1.26.18 (upgrading to 2.x changes gzip decompression behavior, breaking log parser tests)

Test plan

  • Full backend test suite passes (1360 passed, 2 skipped, 9 xfailed)
  • CI linters pass (ruff, isort, pre-commit)
  • Docker image builds successfully
  • Verify heartbeat/version/lbheartbeat endpoints work in deployment

🤖 Generated with Claude Code

@camd camd changed the title Upgrade Django 5.2 to 6.0.3 BE4: Upgrade Django 5.2 to 6.0.3 Mar 22, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.94%. Comparing base (c661d06) to head (0828052).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9322   +/-   ##
=======================================
  Coverage   82.94%   82.94%           
=======================================
  Files         613      613           
  Lines       35372    35372           
  Branches     3263     3278   +15     
=======================================
  Hits        29338    29338           
  Misses       5665     5665           
  Partials      369      369           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@camd camd changed the title BE4: Upgrade Django 5.2 to 6.0.3 Phase 4: Upgrade Django 5.2 to 6.0.3 Mar 23, 2026
@camd camd changed the title Phase 4: Upgrade Django 5.2 to 6.0.3 Backend 4: Upgrade Django 5.2 to 6.0.3 Apr 12, 2026
@camd camd force-pushed the camd/back-end-package-upgrade-phase-3 branch from 790634e to 2a8023a Compare April 13, 2026 01:07
@camd camd requested review from a team, beatrice-acasandrei and esanuandra as code owners April 13, 2026 01:07
@camd camd force-pushed the camd/back-end-package-upgrade-phase-3 branch 2 times, most recently from 1ffb6ff to 19f6dcd Compare May 5, 2026 20:47
Base automatically changed from camd/back-end-package-upgrade-phase-3 to master May 7, 2026 18:54
@camd camd force-pushed the camd/back-end-package-upgrade-phase-4 branch from 9494b62 to 2ee7e24 Compare May 25, 2026 18:15
Upgrades Django and related packages for Django 6.0 compatibility:
- Django 5.2.12 → 6.0.3
- djangorestframework 3.16.1 → 3.17.0 (Django 6.0 support)
- django-filter 25.1 → 25.2 (Django 6.0 support)
- django-debug-toolbar 5.2.0 → 6.2.0 (Django 6.0 support)
- dockerflow 2024.4.2 → 2026.3.4 (Django 6.0 support)
- asgiref 3.8.1 → 3.11.1 (required by Django 6.0)
- typing-extensions 4.12.0 → 4.15.0 (align dev/common)

Code changes:
- Use MozlogFormatter instead of deprecated JsonLogFormatter
- Add django.contrib.postgres to INSTALLED_APPS (required by Django 6.0
  for SearchVectorField)
- Silence debug_toolbar.E001 check (triggered when tests toggle DEBUG)
- Align dev.txt package versions with common.txt to prevent conflicts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@camd camd self-assigned this May 25, 2026
@camd camd force-pushed the camd/back-end-package-upgrade-phase-4 branch from 2ee7e24 to 0828052 Compare May 25, 2026 18:28
"format": "[%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s",
},
"json": {"()": "dockerflow.logging.JsonLogFormatter", "logger_name": "treeherder"},
"json": {"()": "dockerflow.logging.MozlogFormatter", "logger_name": "treeherder"},
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

JsonLogFormatter is a deprecated reference to MozlogFormatter. In the new version of dockerflow this will become a failure, rather than a warning. So fixing here. No functional difference.

@Archaeopteryx Archaeopteryx merged commit 25cfa6b into master May 27, 2026
7 checks passed
@Archaeopteryx Archaeopteryx deleted the camd/back-end-package-upgrade-phase-4 branch May 27, 2026 09:08
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.

3 participants