From d1fdad77187aa1219a06255f8b22cb0c185e0810 Mon Sep 17 00:00:00 2001 From: Dirk Julich Date: Tue, 25 Aug 2026 18:19:07 +0200 Subject: [PATCH] =?UTF-8?q?AAP-87599=20=E2=80=94=20Re-parent=200206=20and?= =?UTF-8?q?=20add=200209=20merge=20migration=20for=202.6=20backport=20(#16?= =?UTF-8?q?612)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * AAP-87599 — Re-parent 0206 and update 0207 as merge point for 2.6 backport Re-parent 0206_jobhostsummary_host_id_idx to depend on 0203 instead of 0205, and add 0205 as a second dependency on 0207 to converge the migration graph. This follows the gateway backport migration pattern (AAP-80663) so that the same 0206 migration file can be backported to stable-2.6 (where 0204/0205 do not exist) without breaking upgrade paths. * AAP-87599 — Move merge point to 0209, restore 0207 to original Reverts the 0205 dependency addition on 0207_alter_skip_tags and instead adds 0209_merge_0205_0206 at the end of the chain. This keeps 0207 pristine so it can be backported to stable-2.7 in the future without a naming conflict. Migration graph after this change: 0203 → 0204 → 0205 ──────────────────────────────────┐ \ ↓ → 0206 → 0207_skip_tags → 0208_sys_auditor → 0209_merge * AAP-87599 — Move merge point to 0207 for devel/2.7 parity Restructure the migration graph so devel matches stable-2.7 through the merge point: - 0207_merge_0205_0206 is now identical on both branches (depends on 0205 + 0206, empty operations) - Renumber 0207_alter_skip_tags → 0208, 0208_fix_system_auditor → 0209 - Both depend linearly from the merge point forward Graph: 0205 ──────────────┐ \ ↓ 0206 → 0207_merge → 0208_skip_tags → 0209_sys_auditor * Fix test references after migration rename 0208→0209 Update test_migrations.py to reference 0209_fix_system_auditor_migration after the merge point restructure moved it from 0208 to 0209. --------- Co-authored-by: Claude Opus 4.6 Co-authored-by: Peter Braun --- awx/main/migrations/0206_jobhostsummary_host_id_idx.py | 2 +- awx/main/migrations/0207_merge_0205_0206.py | 10 ++++++++++ ...xtfield.py => 0208_alter_skip_tags_to_textfield.py} | 2 +- ...gration.py => 0209_fix_system_auditor_migration.py} | 2 +- awx/main/tests/functional/test_migrations.py | 8 ++++---- 5 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 awx/main/migrations/0207_merge_0205_0206.py rename awx/main/migrations/{0207_alter_skip_tags_to_textfield.py => 0208_alter_skip_tags_to_textfield.py} (90%) rename awx/main/migrations/{0208_fix_system_auditor_migration.py => 0209_fix_system_auditor_migration.py} (96%) diff --git a/awx/main/migrations/0206_jobhostsummary_host_id_idx.py b/awx/main/migrations/0206_jobhostsummary_host_id_idx.py index 8607bc92f6..5ae7956682 100644 --- a/awx/main/migrations/0206_jobhostsummary_host_id_idx.py +++ b/awx/main/migrations/0206_jobhostsummary_host_id_idx.py @@ -3,7 +3,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('main', '0205_add_ordering_to_instancegroup_and_workflow_nodes'), + ('main', '0203_remove_team_of_teams'), ] operations = [ diff --git a/awx/main/migrations/0207_merge_0205_0206.py b/awx/main/migrations/0207_merge_0205_0206.py new file mode 100644 index 0000000000..3dc111bc39 --- /dev/null +++ b/awx/main/migrations/0207_merge_0205_0206.py @@ -0,0 +1,10 @@ +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ('main', '0205_add_ordering_to_instancegroup_and_workflow_nodes'), + ('main', '0206_jobhostsummary_host_id_idx'), + ] + + operations = [] diff --git a/awx/main/migrations/0207_alter_skip_tags_to_textfield.py b/awx/main/migrations/0208_alter_skip_tags_to_textfield.py similarity index 90% rename from awx/main/migrations/0207_alter_skip_tags_to_textfield.py rename to awx/main/migrations/0208_alter_skip_tags_to_textfield.py index 9624b29d8f..da386f4bf2 100644 --- a/awx/main/migrations/0207_alter_skip_tags_to_textfield.py +++ b/awx/main/migrations/0208_alter_skip_tags_to_textfield.py @@ -5,7 +5,7 @@ from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ - ('main', '0206_jobhostsummary_host_id_idx'), + ('main', '0207_merge_0205_0206'), ] operations = [ diff --git a/awx/main/migrations/0208_fix_system_auditor_migration.py b/awx/main/migrations/0209_fix_system_auditor_migration.py similarity index 96% rename from awx/main/migrations/0208_fix_system_auditor_migration.py rename to awx/main/migrations/0209_fix_system_auditor_migration.py index cfb207a016..c9a122eee9 100644 --- a/awx/main/migrations/0208_fix_system_auditor_migration.py +++ b/awx/main/migrations/0209_fix_system_auditor_migration.py @@ -37,7 +37,7 @@ def fix_system_auditor_assignments(apps, schema_editor): class Migration(migrations.Migration): dependencies = [ - ('main', '0207_alter_skip_tags_to_textfield'), + ('main', '0208_alter_skip_tags_to_textfield'), ] operations = [ diff --git a/awx/main/tests/functional/test_migrations.py b/awx/main/tests/functional/test_migrations.py index e6a09ae3a5..7bb25d4fc5 100644 --- a/awx/main/tests/functional/test_migrations.py +++ b/awx/main/tests/functional/test_migrations.py @@ -251,7 +251,7 @@ class TestSystemAuditorMigration: def test_fix_system_auditor_migration_backfills_missing(self, migrator): """ - Migration 0208 should backfill Platform Auditor for any + Migration 0209 should backfill Platform Auditor for any system_auditor members who were missed by the original migration. """ state = migrator.apply_initial_migration(('main', '0190_alter_inventorysource_source_and_more')) @@ -273,7 +273,7 @@ class TestSystemAuditorMigration: "Setup: user should not have Platform Auditor before corrective migration" ) - state = migrator.apply_tested_migration(('main', '0208_fix_system_auditor_migration')) + state = migrator.apply_tested_migration(('main', '0209_fix_system_auditor_migration')) RoleUserAssignment = state.apps.get_model('dab_rbac', 'RoleUserAssignment') assert RoleUserAssignment.objects.filter(user=user.id, role_definition__name='Platform Auditor').exists(), ( @@ -282,7 +282,7 @@ class TestSystemAuditorMigration: def test_fix_system_auditor_migration_no_duplicates(self, migrator): """ - Migration 0208 must be idempotent — users who already have + Migration 0209 must be idempotent — users who already have Platform Auditor should not receive a duplicate assignment. """ state = migrator.apply_initial_migration(('main', '0190_alter_inventorysource_source_and_more')) @@ -299,7 +299,7 @@ class TestSystemAuditorMigration: # Confirm the user already has the assignment (from the fixed 0192) assert RoleUserAssignment.objects.filter(user=user.id, role_definition__name='Platform Auditor').exists() - state = migrator.apply_tested_migration(('main', '0208_fix_system_auditor_migration')) + state = migrator.apply_tested_migration(('main', '0209_fix_system_auditor_migration')) RoleUserAssignment = state.apps.get_model('dab_rbac', 'RoleUserAssignment') assert RoleUserAssignment.objects.filter(user=user.id, role_definition__name='Platform Auditor').count() == 1, (