Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion awx/conf/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,13 @@ def to_internal_value(self, paths):
class URLField(CharField):
# these lines set up a custom regex that allow numbers in the
# top-level domain
# Django 5.2 removed URLValidator.ul, it was \u00a1-\uffff for unicode letters
ul = r'\u00a1-\uffff'
Copy link

Choose a reason for hiding this comment

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

Bug: Broken regex allowing invalid domain characters

Defining ul as a raw string r'\u00a1-\uffff' prevents Python from decoding the unicode escapes. The regex engine interprets this as literal characters, creating an unintended range from 1 to \ that accepts uppercase letters and symbols like @, while failing to match valid unicode characters. Remove the r prefix.

Fix in Cursor Fix in Web


tld_re = (
r'\.' # dot
r'(?!-)' # can't start with a dash
r'(?:[a-z' + URLValidator.ul + r'0-9' + '-]{2,63}' # domain label, this line was changed from the original URLValidator
r'(?:[a-z' + ul + r'0-9' + '-]{2,63}' # domain label, this line was changed from the original URLValidator
r'|xn--[a-z0-9]{1,59})' # or punycode label
r'(?<!-)' # can't end with a dash
r'\.?' # may have a trailing dot
Expand Down
11 changes: 10 additions & 1 deletion awx/main/dispatch/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,22 @@ def get_dispatcherd_config(for_service: bool = False, mock_publish: bool = False
Parameters:
for_service: if True, include dynamic options needed for running the dispatcher service
this will require database access, you should delay evaluation until after app setup
mock_publish: if True, use mock values that don't require database access
this is used during tests to avoid database queries during app initialization
"""
# When mock_publish=True (e.g., during tests), use a default value to avoid
# database access in get_auto_max_workers() which queries settings.IS_K8S
if mock_publish:
max_workers = 20 # Reasonable default for tests
Copy link
Member

Choose a reason for hiding this comment

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

...sure

else:
max_workers = get_auto_max_workers()

config = {
"version": 2,
"service": {
"pool_kwargs": {
"min_workers": settings.JOB_EVENT_WORKERS,
"max_workers": get_auto_max_workers(),
"max_workers": max_workers,
},
"main_kwargs": {"node_id": settings.CLUSTER_HOST_ID},
"process_manager_cls": "ForkServerManager",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 5.2.8 on 2025-11-20 18:39

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('main', '0204_squashed_deletions'),
]

operations = [
migrations.AlterField(
model_name='instance',
name='peers',
field=models.ManyToManyField(
related_name='peers_from', through='main.InstanceLink', through_fields=('source', 'target'), to='main.receptoraddress'
),
),
migrations.AlterField(
model_name='job',
name='hosts',
field=models.ManyToManyField(editable=False, related_name='jobs', through='main.JobHostSummary', through_fields=('job', 'host'), to='main.host'),
),
migrations.AlterField(
model_name='role',
name='ancestors',
field=models.ManyToManyField(
Copy link
Member

Choose a reason for hiding this comment

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

I saw this in other libraries, I expect it to be a no-op

related_name='descendents', through='main.RoleAncestorEntry', through_fields=('descendent', 'ancestor'), to='main.role'
),
),
]
2 changes: 1 addition & 1 deletion requirements/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
# via
# -r /awx_devel/requirements/requirements.in
# channels
Expand Down
3 changes: 1 addition & 2 deletions requirements/requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -28,4 +28,3 @@ pip>=21.3,<=24.0 # PEP 660 – Editable installs for pyproject.toml based builds
debugpy
remote-pdb
sdb

Loading