Upgrade to Django 5.2 LTS (#16185)

Upgrade to Django 5.2 LTS with compatibility fixes across fields, migrations, dispatch config, tests, and dev deps.

Dependencies:
- Upgrade django to 5.2.8 and relax requirements.in to >=5.2,<5.3.
- Bump django-debug-toolbar to >=6.0 for compatibility.

Backend:
- awx/conf/fields.py: switch URL TLD regex to use DomainNameValidator.ul in custom URLField.
- awx/main/management/commands/gather_analytics.py: use datetime.timezone.utc for naïve datetime handling.
- awx/main/dispatch/config.py: add mock_publish option; avoid DB access for test runs, set default max_workers, and support a noop broker.

Migrations (SQLite/Postgres compatibility):
- Add awx/main/migrations/_sqlite_helper.py with db-aware AlterIndexTogether/RenameIndex wrappers; consume in 0144_event_partitions.py and 0184_django_indexes.py.
- Update 0187_hop_nodes.py to use CheckConstraint(condition=...).
- Add 0205_alter_instance_peers_alter_job_hosts_and_more.py adjusting through_fields/relations on instance.peers, job.hosts, and role.ancestors.
- _dab_rbac.py: iterate roles with chunk_size=1000 for migration performance.

Tests:
Include hcp_terraform in default credential types in test_credential.py.
---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Alan Rominger <arominge@redhat.com>
This commit is contained in:
Hao Liu
2025-12-03 14:22:52 -05:00
committed by GitHub
parent 711b018ae7
commit b24156805a
12 changed files with 152 additions and 35 deletions

View File

@@ -13,7 +13,7 @@ cryptography
Cython
daphne
distro
django==4.2.26 # CVE-2025-32873
django>=5.2,<5.3 # Django 5.2 LTS, allow patch updates
django-cors-headers
django-crum
django-extensions

View File

@@ -124,7 +124,7 @@ dispatcherd==2025.5.21
# via -r /awx_devel/requirements/requirements.in
distro==1.9.0
# via -r /awx_devel/requirements/requirements.in
django==4.2.26
django==5.2.8
# via
# -r /awx_devel/requirements/requirements.in
# channels

View File

@@ -1,5 +1,5 @@
build
django-debug-toolbar==3.2.4
django-debug-toolbar>=6.0 # Django 5.2 compatibility
django-test-migrations
drf-spectacular>=0.27.0 # Modern OpenAPI 3.0 schema generator
# pprofile - re-add once https://github.com/vpelletier/pprofile/issues/41 is addressed
@@ -28,4 +28,3 @@ pip>=21.3,<=24.0 # PEP 660 Editable installs for pyproject.toml based builds
debugpy
remote-pdb
sdb