Repository: cal-itp/benefits

Issue:
Remove LOAD_SAMPLE_DATA option from Benefits migration process
In #827, we introduced a few environment variables to support loading different data migrations. Since we're moving towards a secrets management approach that allows us to use one data migration file, contained in the same repository as the code, we should remove this now unneeded option.

## Acceptance criteria
 - [x] Data migration file is named to reflect that it is used for real, not just a sample file
 - [x] Environment variables and supporting code added in #827 are removed
 - [x] Documentation is updated
 - [x] App settings / Key Vault values from #1242 and #1241 are ready to go (removing this option will trigger their usage)
 - [x] Other developers on the team are aware that the new deployment process is in effect 🚨 📣


Discussion:

Resolving patch:
diff --git a/benefits/core/migrations/0002_sample_data.py b/benefits/core/migrations/0002_data.py
similarity index 97%
rename from benefits/core/migrations/0002_sample_data.py
rename to benefits/core/migrations/0002_data.py
--- a/benefits/core/migrations/0002_sample_data.py
+++ b/benefits/core/migrations/0002_data.py
@@ -1,19 +1,13 @@
-"""Data migration which loads sample data.
-Set environment variable DJANGO_LOAD_SAMPLE_DATA to False to skip loading sample data.
+"""Data migration which loads configuration data for Benefits.
 """
 import json
 import os
 
-from django.conf import settings
 from django.db import migrations
 from django.utils.translation import gettext_lazy as _
 
 
-def load_sample_data(app, *args, **kwargs):
-    if not settings.LOAD_SAMPLE_DATA:
-        print("  LOAD_SAMPLE_DATA is set to False, skipping sample data")
-        return
-
+def load_data(app, *args, **kwargs):
     EligibilityType = app.get_model("core", "EligibilityType")
 
     mst_senior_type = EligibilityType.objects.create(
@@ -277,5 +271,5 @@ class Migration(migrations.Migration):
     ]
 
     operations = [
-        migrations.RunPython(load_sample_data),
+        migrations.RunPython(load_data),
     ]
diff --git a/benefits/core/migrations/0003_data_migration_order.py b/benefits/core/migrations/0003_data_migration_order.py
deleted file mode 100644
--- a/benefits/core/migrations/0003_data_migration_order.py
+++ /dev/null
@@ -1,14 +0,0 @@
-"""This migration simply ensures that data migrations (assumed to be files that start with 0002) will run sequentially.
-It does so by looking for all migration files starting with "0002" and declaring them in its dependency list.
-"""
-import os
-
-from django.conf import settings
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-    migrations_directory = os.path.join(settings.BASE_DIR, "benefits", "core", "migrations")
-    dependencies = [("core", file.replace(".py", "")) for file in os.listdir(migrations_directory) if file.startswith("0002")]
-
-    operations = []
diff --git a/benefits/settings.py b/benefits/settings.py
--- a/benefits/settings.py
+++ b/benefits/settings.py
@@ -151,8 +151,6 @@ def _filter_empty(ls):
     }
 }
 
-LOAD_SAMPLE_DATA = os.environ.get("DJANGO_LOAD_SAMPLE_DATA", "true").lower() != "false"
-
 # Password validation
 
 AUTH_PASSWORD_VALIDATORS = []


Test patch: