diff --git a/awx/main/migrations/0205_add_ordering_to_instancegroup_and_workflow_nodes.py b/awx/main/migrations/0205_add_ordering_to_instancegroup_and_workflow_nodes.py new file mode 100644 index 0000000000..ea6670a88f --- /dev/null +++ b/awx/main/migrations/0205_add_ordering_to_instancegroup_and_workflow_nodes.py @@ -0,0 +1,29 @@ +# Generated by Django 5.2.8 on 2026-02-20 03:39 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0204_squashed_deletions'), + ] + + operations = [ + migrations.AlterModelOptions( + name='instancegroup', + options={ + 'default_permissions': ('change', 'delete', 'view'), + 'ordering': ('pk',), + 'permissions': [('use_instancegroup', 'Can use instance group in a preference list of a resource')], + }, + ), + migrations.AlterModelOptions( + name='workflowjobnode', + options={'ordering': ('pk',)}, + ), + migrations.AlterModelOptions( + name='workflowjobtemplatenode', + options={'ordering': ('pk',)}, + ), + ] diff --git a/awx/main/models/ha.py b/awx/main/models/ha.py index 4b9bba6ba9..6e40ec12a7 100644 --- a/awx/main/models/ha.py +++ b/awx/main/models/ha.py @@ -485,6 +485,7 @@ class InstanceGroup(HasPolicyEditsMixin, BaseModel, RelatedJobsMixin, ResourceMi class Meta: app_label = 'main' + ordering = ('pk',) permissions = [('use_instancegroup', 'Can use instance group in a preference list of a resource')] # Since this has no direct organization field only superuser can add, so remove add permission default_permissions = ('change', 'delete', 'view') diff --git a/awx/main/models/workflow.py b/awx/main/models/workflow.py index 1753dff26d..92e8630148 100644 --- a/awx/main/models/workflow.py +++ b/awx/main/models/workflow.py @@ -200,6 +200,7 @@ class WorkflowJobTemplateNode(WorkflowNodeBase): indexes = [ models.Index(fields=['identifier']), ] + ordering = ('pk',) def get_absolute_url(self, request=None): return reverse('api:workflow_job_template_node_detail', kwargs={'pk': self.pk}, request=request) @@ -286,6 +287,7 @@ class WorkflowJobNode(WorkflowNodeBase): models.Index(fields=["identifier", "workflow_job"]), models.Index(fields=['identifier']), ] + ordering = ('pk',) @property def event_processing_finished(self): diff --git a/pytest.ini b/pytest.ini index 54f261c07c..ae8838c0bb 100644 --- a/pytest.ini +++ b/pytest.ini @@ -15,9 +15,6 @@ markers = filterwarnings = error - # FIXME: Upgrade protobuf https://github.com/protocolbuffers/protobuf/issues/15077 - once:Type google._upb._message.* uses PyType_Spec with a metaclass that has custom tp_new:DeprecationWarning - # FIXME: Upgrade python-dateutil https://github.com/dateutil/dateutil/issues/1340 once:datetime.datetime.utcfromtimestamp\(\) is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC:DeprecationWarning @@ -31,29 +28,12 @@ filterwarnings = # FIXME: Delete this entry once `zope` is updated. once:Deprecated call to `pkg_resources.declare_namespace.'zope'.`.\nImplementing implicit namespace packages .as specified in PEP 420. is preferred to `pkg_resources.declare_namespace`. See https.//setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages:DeprecationWarning: - # FIXME: Delete this entry once `coreapi` is deleted from the dependencies - # FIXME: and is no longer imported at runtime. - once:CoreAPI compatibility is deprecated and will be removed in DRF 3.17:rest_framework.RemovedInDRF317Warning:rest_framework.schemas.coreapi - # FIXME: Delete this entry once the deprecation is acted upon. # Note: RemovedInDjango51Warning may not exist in newer Django versions ignore:'index_together' is deprecated. Use 'Meta.indexes' in 'main.\w+' instead. - # FIXME: Update `awx.main.migrations._dab_rbac` and delete this entry. - # Note: RemovedInDjango50Warning may not exist in newer Django versions - ignore:Using QuerySet.iterator.. after prefetch_related.. without specifying chunk_size is deprecated. - - # FIXME: Figure this out, fix and then delete the entry. It's not entirely - # FIXME: clear what emits it and where. - once:Pagination may yield inconsistent results with an unordered object_list. .class 'awx.main.models.workflow.WorkflowJobTemplateNode'. QuerySet.:django.core.paginator.UnorderedObjectListWarning:django.core.paginator - - # FIXME: Figure this out, fix and then delete the entry. - once::django.core.paginator.UnorderedObjectListWarning:rest_framework.pagination - - # FIXME: Use `open()` via a context manager - # FIXME: in `awx/main/tests/unit/test_tasks.py` to close hanging file - # FIXME: descriptors and then delete the entry. - once:unclosed file <_io.TextIOWrapper name='[^']+' mode='r' encoding='UTF-8'>:ResourceWarning:awx.main.tests.unit.test_tasks + # FIXME: Add ordering to Resource model in django-ansible-base and delete this entry. + once:Pagination may yield inconsistent results with an unordered object_list.*Resource:django.core.paginator.UnorderedObjectListWarning # https://docs.pytest.org/en/stable/usage.html#creating-junitxml-format-files junit_duration_report = call