ansible / awx

AWX provides a web-based user interface, REST API, and task engine built on top of Ansible. It is one of the upstream projects for Red Hat Ansible Automation Platform.
Other
13.5k stars 3.34k forks source link

Fix and test data migration error from DAB RBAC #15138

Closed AlanCoding closed 3 weeks ago

AlanCoding commented 3 weeks ago
SUMMARY

I can explain how this bug was introduced...

One of the latest things done before merging the prior PR that integrated the RBAC app from the DAB library was that the RoleDefinition names were changed to a new naming convention. As a part of this, we didn't want to use all-lowercase names like "jobtemplate", so I called model_class on the ContentType object.

Testing this with the "current" unit tests, you would just pass in the "current" apps, which would have that method. However, with historical migrations, you're using partial models that don't have such methods available.

Thus, https://github.com/ansible/awx/issues/15137

ISSUE TYPE
COMPONENT NAME
AlanCoding commented 3 weeks ago

First version had a failure with

django.db.utils.IntegrityError: NOT NULL constraint failed: main_organization.created

and that was just due to creating the organization object the test needs. I saw this failure locally, and I expect to see it in the checks here. I made a change to the test and am trying to verify that locally before pushing, but it seems these tests can take on the order of ~10 minutes.