diff --git a/.env b/.env
index aa71233a8..5b0a06060 100644
--- a/.env
+++ b/.env
@@ -120,6 +120,12 @@ VORTEX_PROVISION_OVERRIDE_DB=0
# is not available.
VORTEX_PROVISION_FALLBACK_TO_PROFILE=0
+# Verify that configuration was not changed by database updates.
+# If enabled and config files are present, the provision will fail if
+# database update hooks modify active configuration, preventing
+# drush config:import from silently overwriting those changes.
+VORTEX_PROVISION_VERIFY_CONFIG_UNCHANGED_AFTER_UPDATE=0
+
# Skip database sanitization.
#
# Database sanitization is enabled by default in all non-production
diff --git a/.vortex/docs/content/development/variables.mdx b/.vortex/docs/content/development/variables.mdx
index eee5f9c6b..70b5f3ede 100644
--- a/.vortex/docs/content/development/variables.mdx
+++ b/.vortex/docs/content/development/variables.mdx
@@ -401,6 +401,7 @@ The list below is automatically generated with [Shellvar](https://github.com/ale
| `VORTEX_PROVISION_SKIP` | Flag to skip site provisioning. | `UNDEFINED` | `scripts/vortex/provision.sh` |
| `VORTEX_PROVISION_TYPE` | Set to 'profile' to install a site from profile instead of the database dump. | `database` | `.env`, `scripts/vortex/provision.sh` |
| `VORTEX_PROVISION_USE_MAINTENANCE_MODE` | Put the site into a maintenance mode during site provisioning. | `1` | `.env`, `scripts/vortex/provision.sh` |
+| `VORTEX_PROVISION_VERIFY_CONFIG_UNCHANGED_AFTER_UPDATE` | Verify that configuration was not changed by database updates. If enabled and config files are present, the provision will fail if database update hooks modify active configuration, preventing drush config:import from silently overwriting those changes. | `UNDEFINED` | `.env`, `scripts/vortex/provision.sh` |
| `VORTEX_PURGE_CACHE_ACQUIA_SKIP` | Skip purging of edge cache in Acquia environment. | `UNDEFINED` | `ACQUIA ENVIRONMENT` |
| `VORTEX_RELEASE_VERSION_SCHEME` | Versioning scheme used for releases.
Can be one of: calver, semver, other @see https://www.vortextemplate.com/docs/releasing | `calver` | `.env` |
| `VORTEX_SHOW_LOGIN` | Show one-time login link. | `UNDEFINED` | `scripts/vortex/info.sh` |
diff --git a/.vortex/docs/content/drupal/provision.mdx b/.vortex/docs/content/drupal/provision.mdx
index 07b49d942..34b8f0856 100644
--- a/.vortex/docs/content/drupal/provision.mdx
+++ b/.vortex/docs/content/drupal/provision.mdx
@@ -133,13 +133,16 @@ section.
▼
🔄 Run DB updates
▼
+⑦ 💡 Verify config unchanged? ──Config changed──► 🏁 EXIT 1 (fail) ✗
+ │ Config unchanged (or check disabled)
+ ▼
⬇️ Import configuration (if config files present)
▼
🧹 Rebuild caches
▼
🔄 Run deployment hooks
▼
-⑦ 😷 Run DB sanitization
+⑧ 😷 Run DB sanitization
▼
⚙️ Run custom scripts
▼
@@ -158,7 +161,8 @@ You can control the provisioning flow using the following environment variables:
4. `VORTEX_PROVISION_FALLBACK_TO_PROFILE=1`
Automatically fall back to installing from profile if the database dump file or container image is not available. Useful for distribution demos or when using recipes/profiles that can install without a pre-existing database.
5. `VORTEX_PROVISION_POST_OPERATIONS_SKIP=1`
Skip configuration imports, database updates, and other post-provisioning steps. Essentially, this is `drush sql:drop` and `$(drush sql:connect) < .data/db.sql` commands. This is useful when you want to provision a site without running any additional operations.
`ahoy import-db` uses this flag to import DB and exit.
6. `VORTEX_PROVISION_USE_MAINTENANCE_MODE=1`
Enable maintenance mode right after the site is bootstrappable and disable it at the end. Useful when you want to prevent users from accessing the site while it is being provisioned.
-7. `VORTEX_PROVISION_SANITIZE_DB_SKIP=1`
Disable database sanitization.
+7. `VORTEX_PROVISION_VERIFY_CONFIG_UNCHANGED_AFTER_UPDATE=1`
Verify that active configuration was not changed by database updates. When enabled and config files are present, the provision will fail if `drush updatedb` modifies active configuration, preventing `drush config:import` from silently overwriting those changes.
+8. `VORTEX_PROVISION_SANITIZE_DB_SKIP=1`
Disable database sanitization.
:::tip
diff --git a/.vortex/installer/tests/Fixtures/handler_process/_baseline/.env b/.vortex/installer/tests/Fixtures/handler_process/_baseline/.env
index a85067fb3..8e379075a 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/_baseline/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/_baseline/.env
@@ -110,6 +110,12 @@ VORTEX_PROVISION_OVERRIDE_DB=0
# is not available.
VORTEX_PROVISION_FALLBACK_TO_PROFILE=0
+# Verify that configuration was not changed by database updates.
+# If enabled and config files are present, the provision will fail if
+# database update hooks modify active configuration, preventing
+# drush config:import from silently overwriting those changes.
+VORTEX_PROVISION_VERIFY_CONFIG_UNCHANGED_AFTER_UPDATE=0
+
# Skip database sanitization.
#
# Database sanitization is enabled by default in all non-production
diff --git a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_acquia/.env b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_acquia/.env
index b054eafb4..59cd30f46 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_acquia/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_acquia/.env
@@ -1,4 +1,4 @@
-@@ -149,13 +149,8 @@
+@@ -155,13 +155,8 @@
VORTEX_DB_FILE=db.sql
# Database download source.
@@ -13,7 +13,7 @@
# Environment to download the database from.
#
# Applies to hosting environments.
-@@ -206,17 +201,3 @@
+@@ -212,17 +207,3 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_container_registry/.env b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_container_registry/.env
index 15e629ddb..a6e94b66b 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_container_registry/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_container_registry/.env
@@ -1,4 +1,4 @@
-@@ -149,12 +149,11 @@
+@@ -155,12 +155,11 @@
VORTEX_DB_FILE=db.sql
# Database download source.
@@ -15,7 +15,7 @@
# Environment to download the database from.
#
-@@ -206,17 +205,3 @@
+@@ -212,17 +211,3 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_ftp/.env b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_ftp/.env
index ffc765d4e..ca9234051 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_ftp/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_ftp/.env
@@ -1,4 +1,4 @@
-@@ -149,13 +149,19 @@
+@@ -155,13 +155,19 @@
VORTEX_DB_FILE=db.sql
# Database download source.
@@ -23,7 +23,7 @@
# Environment to download the database from.
#
# Applies to hosting environments.
-@@ -206,17 +212,3 @@
+@@ -212,17 +218,3 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_lagoon/.env
index cc996d11b..997c9ca82 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_lagoon/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_lagoon/.env
@@ -1,4 +1,4 @@
-@@ -149,13 +149,8 @@
+@@ -155,13 +155,8 @@
VORTEX_DB_FILE=db.sql
# Database download source.
@@ -13,7 +13,7 @@
# Environment to download the database from.
#
# Applies to hosting environments.
-@@ -206,17 +201,3 @@
+@@ -212,17 +207,3 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_s3/.env b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_s3/.env
index 3b8c10bdf..8f477d4eb 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/db_download_source_s3/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/db_download_source_s3/.env
@@ -1,4 +1,4 @@
-@@ -149,13 +149,16 @@
+@@ -155,13 +155,16 @@
VORTEX_DB_FILE=db.sql
# Database download source.
@@ -20,7 +20,7 @@
# Environment to download the database from.
#
# Applies to hosting environments.
-@@ -206,17 +209,3 @@
+@@ -212,17 +215,3 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.env b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.env
index 309a11f73..671fa75fb 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_circleci/.env
@@ -1,4 +1,4 @@
-@@ -179,7 +179,7 @@
+@@ -185,7 +185,7 @@
# Deployment occurs when tests pass in the CI environment.
# @see https://www.vortextemplate.com/docs/deployment
diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_gha/.env b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_gha/.env
index 309a11f73..671fa75fb 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_gha/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_all_gha/.env
@@ -1,4 +1,4 @@
-@@ -179,7 +179,7 @@
+@@ -185,7 +185,7 @@
# Deployment occurs when tests pass in the CI environment.
# @see https://www.vortextemplate.com/docs/deployment
diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_artifact/.env b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_artifact/.env
index bba4458d7..747c9a0ba 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_artifact/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_artifact/.env
@@ -1,4 +1,4 @@
-@@ -179,7 +179,7 @@
+@@ -185,7 +185,7 @@
# Deployment occurs when tests pass in the CI environment.
# @see https://www.vortextemplate.com/docs/deployment
diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_container_image/.env b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_container_image/.env
index 0afc60758..e4870b663 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_container_image/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_container_image/.env
@@ -1,4 +1,4 @@
-@@ -179,7 +179,7 @@
+@@ -185,7 +185,7 @@
# Deployment occurs when tests pass in the CI environment.
# @see https://www.vortextemplate.com/docs/deployment
diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_lagoon/.env
index 85d59a171..86e0ae2c4 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_lagoon/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_lagoon/.env
@@ -1,4 +1,4 @@
-@@ -179,7 +179,7 @@
+@@ -185,7 +185,7 @@
# Deployment occurs when tests pass in the CI environment.
# @see https://www.vortextemplate.com/docs/deployment
diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.env b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.env
index c57a27d8e..9f004b9c9 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_circleci/.env
@@ -1,4 +1,4 @@
-@@ -174,14 +174,6 @@
+@@ -180,14 +180,6 @@
VORTEX_RELEASE_VERSION_SCHEME=calver
################################################################################
diff --git a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_gha/.env b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_gha/.env
index c57a27d8e..9f004b9c9 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_gha/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/deploy_types_none_gha/.env
@@ -1,4 +1,4 @@
-@@ -174,14 +174,6 @@
+@@ -180,14 +180,6 @@
VORTEX_RELEASE_VERSION_SCHEME=calver
################################################################################
diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/.env b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/.env
index fd7fd8282..e4cfe0813 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/.env
@@ -7,7 +7,7 @@
# The timezone used within the containers.
TZ=UTC
-@@ -127,6 +127,13 @@
+@@ -133,6 +133,13 @@
VORTEX_PROVISION_USE_MAINTENANCE_MODE=1
################################################################################
@@ -21,7 +21,7 @@
# DATABASE SOURCE #
################################################################################
-@@ -149,13 +156,8 @@
+@@ -155,13 +162,8 @@
VORTEX_DB_FILE=db.sql
# Database download source.
@@ -36,7 +36,7 @@
# Environment to download the database from.
#
# Applies to hosting environments.
-@@ -163,6 +165,9 @@
+@@ -169,6 +171,9 @@
# a branch name or an environment name.
VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod
@@ -46,7 +46,7 @@
################################################################################
# RELEASE VERSIONING #
################################################################################
-@@ -179,7 +184,7 @@
+@@ -185,7 +190,7 @@
# Deployment occurs when tests pass in the CI environment.
# @see https://www.vortextemplate.com/docs/deployment
@@ -55,7 +55,7 @@
################################################################################
# NOTIFICATIONS #
-@@ -196,7 +201,7 @@
+@@ -202,7 +207,7 @@
# An email address to send notifications from.
#
# Applies to email notifications.
@@ -64,7 +64,7 @@
# Email address(es) to send notifications to.
#
-@@ -206,17 +211,3 @@
+@@ -212,17 +217,3 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/.env
index 4f8bcacd0..b03fffd2d 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_lagoon/.env
@@ -1,4 +1,4 @@
-@@ -127,6 +127,18 @@
+@@ -133,6 +133,18 @@
VORTEX_PROVISION_USE_MAINTENANCE_MODE=1
################################################################################
@@ -17,7 +17,7 @@
# DATABASE SOURCE #
################################################################################
-@@ -149,13 +161,8 @@
+@@ -155,13 +167,8 @@
VORTEX_DB_FILE=db.sql
# Database download source.
@@ -32,7 +32,7 @@
# Environment to download the database from.
#
# Applies to hosting environments.
-@@ -179,7 +186,7 @@
+@@ -185,7 +192,7 @@
# Deployment occurs when tests pass in the CI environment.
# @see https://www.vortextemplate.com/docs/deployment
@@ -41,7 +41,7 @@
################################################################################
# NOTIFICATIONS #
-@@ -206,17 +213,3 @@
+@@ -212,17 +219,3 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/.env b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/.env
index a221c75a6..dbdbb975e 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/.env
@@ -7,7 +7,7 @@
# The timezone used within the containers.
TZ=UTC
-@@ -127,6 +127,13 @@
+@@ -133,6 +133,13 @@
VORTEX_PROVISION_USE_MAINTENANCE_MODE=1
################################################################################
@@ -21,7 +21,7 @@
# DATABASE SOURCE #
################################################################################
-@@ -149,13 +156,8 @@
+@@ -155,13 +162,8 @@
VORTEX_DB_FILE=db.sql
# Database download source.
@@ -36,7 +36,7 @@
# Environment to download the database from.
#
# Applies to hosting environments.
-@@ -163,6 +165,9 @@
+@@ -169,6 +171,9 @@
# a branch name or an environment name.
VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod
@@ -46,7 +46,7 @@
################################################################################
# RELEASE VERSIONING #
################################################################################
-@@ -179,7 +184,7 @@
+@@ -185,7 +190,7 @@
# Deployment occurs when tests pass in the CI environment.
# @see https://www.vortextemplate.com/docs/deployment
@@ -55,7 +55,7 @@
################################################################################
# NOTIFICATIONS #
-@@ -196,7 +201,7 @@
+@@ -202,7 +207,7 @@
# An email address to send notifications from.
#
# Applies to email notifications.
@@ -64,7 +64,7 @@
# Email address(es) to send notifications to.
#
-@@ -206,17 +211,3 @@
+@@ -212,17 +217,3 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/.env
index 144856b1f..617791567 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___lagoon/.env
@@ -1,4 +1,4 @@
-@@ -127,6 +127,18 @@
+@@ -133,6 +133,18 @@
VORTEX_PROVISION_USE_MAINTENANCE_MODE=1
################################################################################
@@ -17,7 +17,7 @@
# DATABASE SOURCE #
################################################################################
-@@ -149,13 +161,8 @@
+@@ -155,13 +167,8 @@
VORTEX_DB_FILE=db.sql
# Database download source.
@@ -32,7 +32,7 @@
# Environment to download the database from.
#
# Applies to hosting environments.
-@@ -179,7 +186,7 @@
+@@ -185,7 +192,7 @@
# Deployment occurs when tests pass in the CI environment.
# @see https://www.vortextemplate.com/docs/deployment
@@ -41,7 +41,7 @@
################################################################################
# NOTIFICATIONS #
-@@ -206,17 +213,3 @@
+@@ -212,17 +219,3 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/.env
index 4f8bcacd0..b03fffd2d 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/migration_disabled_lagoon/.env
@@ -1,4 +1,4 @@
-@@ -127,6 +127,18 @@
+@@ -133,6 +133,18 @@
VORTEX_PROVISION_USE_MAINTENANCE_MODE=1
################################################################################
@@ -17,7 +17,7 @@
# DATABASE SOURCE #
################################################################################
-@@ -149,13 +161,8 @@
+@@ -155,13 +167,8 @@
VORTEX_DB_FILE=db.sql
# Database download source.
@@ -32,7 +32,7 @@
# Environment to download the database from.
#
# Applies to hosting environments.
-@@ -179,7 +186,7 @@
+@@ -185,7 +192,7 @@
# Deployment occurs when tests pass in the CI environment.
# @see https://www.vortextemplate.com/docs/deployment
@@ -41,7 +41,7 @@
################################################################################
# NOTIFICATIONS #
-@@ -206,17 +213,3 @@
+@@ -212,17 +219,3 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/.env
index 9c189d3c8..601f9cffe 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_acquia/.env
@@ -1,4 +1,4 @@
-@@ -164,6 +164,24 @@
+@@ -170,6 +170,24 @@
VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod
################################################################################
diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/.env
index 3e24caa25..5c1f51473 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_ftp/.env
@@ -1,4 +1,4 @@
-@@ -164,6 +164,35 @@
+@@ -170,6 +170,35 @@
VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod
################################################################################
diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/.env
index 2acff57ed..9eae0e48e 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_lagoon/.env
@@ -1,4 +1,4 @@
-@@ -164,6 +164,24 @@
+@@ -170,6 +170,24 @@
VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod
################################################################################
diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/.env
index 2f83a8e5e..0859a0d38 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_s3/.env
@@ -1,4 +1,4 @@
-@@ -164,6 +164,32 @@
+@@ -170,6 +170,32 @@
VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod
################################################################################
diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/.env
index fcfd67a4c..ac309d232 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/migration_download_source_url/.env
@@ -1,4 +1,4 @@
-@@ -164,6 +164,29 @@
+@@ -170,6 +170,29 @@
VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod
################################################################################
@@ -28,7 +28,7 @@
# RELEASE VERSIONING #
################################################################################
-@@ -220,3 +243,6 @@
+@@ -226,3 +249,6 @@
# URL of the database used for demonstration with URL database download type.
VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db_d11.demo.sql
diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/.env
index fcfd67a4c..ac309d232 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled/.env
@@ -1,4 +1,4 @@
-@@ -164,6 +164,29 @@
+@@ -170,6 +170,29 @@
VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod
################################################################################
@@ -28,7 +28,7 @@
# RELEASE VERSIONING #
################################################################################
-@@ -220,3 +243,6 @@
+@@ -226,3 +249,6 @@
# URL of the database used for demonstration with URL database download type.
VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db_d11.demo.sql
diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.env
index fcfd67a4c..ac309d232 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_circleci/.env
@@ -1,4 +1,4 @@
-@@ -164,6 +164,29 @@
+@@ -170,6 +170,29 @@
VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod
################################################################################
@@ -28,7 +28,7 @@
# RELEASE VERSIONING #
################################################################################
-@@ -220,3 +243,6 @@
+@@ -226,3 +249,6 @@
# URL of the database used for demonstration with URL database download type.
VORTEX_DOWNLOAD_DB_URL=https://github.com/drevops/vortex/releases/download/__VERSION__/db_d11.demo.sql
diff --git a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/.env
index 45cce0b40..d7392e83b 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/migration_enabled_lagoon/.env
@@ -1,4 +1,4 @@
-@@ -127,6 +127,18 @@
+@@ -133,6 +133,18 @@
VORTEX_PROVISION_USE_MAINTENANCE_MODE=1
################################################################################
@@ -17,7 +17,7 @@
# DATABASE SOURCE #
################################################################################
-@@ -149,13 +161,8 @@
+@@ -155,13 +167,8 @@
VORTEX_DB_FILE=db.sql
# Database download source.
@@ -32,7 +32,7 @@
# Environment to download the database from.
#
# Applies to hosting environments.
-@@ -164,6 +171,24 @@
+@@ -170,6 +177,24 @@
VORTEX_DOWNLOAD_DB_ENVIRONMENT=prod
################################################################################
@@ -57,7 +57,7 @@
# RELEASE VERSIONING #
################################################################################
-@@ -179,7 +204,7 @@
+@@ -185,7 +210,7 @@
# Deployment occurs when tests pass in the CI environment.
# @see https://www.vortextemplate.com/docs/deployment
@@ -66,7 +66,7 @@
################################################################################
# NOTIFICATIONS #
-@@ -206,17 +231,3 @@
+@@ -212,17 +237,3 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/names/.env b/.vortex/installer/tests/Fixtures/handler_process/names/.env
index f276b201c..587723b5b 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/names/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/names/.env
@@ -31,7 +31,7 @@
# Shield message.
DRUPAL_SHIELD_PRINT="Restricted access."
-@@ -121,7 +121,7 @@
+@@ -127,7 +127,7 @@
#
# Applied if database sanitization is enabled.
# @see https://www.vortextemplate.com/docs/drupal/provision#database-sanitization
@@ -40,7 +40,7 @@
# Put the site into a maintenance mode during site provisioning.
VORTEX_PROVISION_USE_MAINTENANCE_MODE=1
-@@ -196,7 +196,7 @@
+@@ -202,7 +202,7 @@
# An email address to send notifications from.
#
# Applies to email notifications.
@@ -49,7 +49,7 @@
# Email address(es) to send notifications to.
#
-@@ -205,7 +205,7 @@
+@@ -211,7 +211,7 @@
# Multiple names can be specified as a comma-separated list of email addresses
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_all/.env b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_all/.env
index 7f34e2569..2a8ca295d 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_all/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_all/.env
@@ -1,4 +1,4 @@
-@@ -191,7 +191,7 @@
+@@ -197,7 +197,7 @@
# The channels of the notifications.
#
# A combination of comma-separated values: email,slack,newrelic,github,jira,webhook
@@ -7,7 +7,7 @@
# An email address to send notifications from.
#
-@@ -206,6 +206,12 @@
+@@ -212,6 +212,12 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_github_only/.env b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_github_only/.env
index 9d4ef259d..91ae810ed 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_github_only/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_github_only/.env
@@ -1,4 +1,4 @@
-@@ -191,21 +191,7 @@
+@@ -197,21 +197,7 @@
# The channels of the notifications.
#
# A combination of comma-separated values: email,slack,newrelic,github,jira,webhook
diff --git a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_jira_only/.env b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_jira_only/.env
index 3624ce05b..0becdd2a1 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_jira_only/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_jira_only/.env
@@ -1,4 +1,4 @@
-@@ -191,21 +191,10 @@
+@@ -197,21 +197,10 @@
# The channels of the notifications.
#
# A combination of comma-separated values: email,slack,newrelic,github,jira,webhook
diff --git a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_newrelic_only/.env b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_newrelic_only/.env
index 833a36aaa..1cd1d2075 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_newrelic_only/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_newrelic_only/.env
@@ -1,4 +1,4 @@
-@@ -191,21 +191,7 @@
+@@ -197,21 +197,7 @@
# The channels of the notifications.
#
# A combination of comma-separated values: email,slack,newrelic,github,jira,webhook
diff --git a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_none/.env b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_none/.env
index 84069b25e..3b9ad8194 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_none/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_none/.env
@@ -1,4 +1,4 @@
-@@ -191,21 +191,7 @@
+@@ -197,21 +197,7 @@
# The channels of the notifications.
#
# A combination of comma-separated values: email,slack,newrelic,github,jira,webhook
diff --git a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_slack_only/.env b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_slack_only/.env
index 5694ed384..4a19fea45 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_slack_only/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_slack_only/.env
@@ -1,4 +1,4 @@
-@@ -191,21 +191,7 @@
+@@ -197,21 +197,7 @@
# The channels of the notifications.
#
# A combination of comma-separated values: email,slack,newrelic,github,jira,webhook
diff --git a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_webhook_only/.env b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_webhook_only/.env
index 57818aae7..a42b09035 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/notification_channels_webhook_only/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/notification_channels_webhook_only/.env
@@ -1,4 +1,4 @@
-@@ -191,21 +191,10 @@
+@@ -197,21 +197,10 @@
# The channels of the notifications.
#
# A combination of comma-separated values: email,slack,newrelic,github,jira,webhook
diff --git a/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/.env b/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/.env
index 4f8bcacd0..b03fffd2d 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/provision_database_lagoon/.env
@@ -1,4 +1,4 @@
-@@ -127,6 +127,18 @@
+@@ -133,6 +133,18 @@
VORTEX_PROVISION_USE_MAINTENANCE_MODE=1
################################################################################
@@ -17,7 +17,7 @@
# DATABASE SOURCE #
################################################################################
-@@ -149,13 +161,8 @@
+@@ -155,13 +167,8 @@
VORTEX_DB_FILE=db.sql
# Database download source.
@@ -32,7 +32,7 @@
# Environment to download the database from.
#
# Applies to hosting environments.
-@@ -179,7 +186,7 @@
+@@ -185,7 +192,7 @@
# Deployment occurs when tests pass in the CI environment.
# @see https://www.vortextemplate.com/docs/deployment
@@ -41,7 +41,7 @@
################################################################################
# NOTIFICATIONS #
-@@ -206,17 +213,3 @@
+@@ -212,17 +219,3 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/provision_profile/.env b/.vortex/installer/tests/Fixtures/handler_process/provision_profile/.env
index c41be8a9e..c43ff35c7 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/provision_profile/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/provision_profile/.env
@@ -7,7 +7,7 @@
# Overwrite a database if it exists.
#
-@@ -148,21 +148,6 @@
+@@ -154,21 +154,6 @@
# The file is used to import the database into an empty database container.
VORTEX_DB_FILE=db.sql
@@ -29,7 +29,7 @@
################################################################################
# RELEASE VERSIONING #
################################################################################
-@@ -206,17 +191,3 @@
+@@ -212,17 +197,3 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_cms_profile/.env b/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_cms_profile/.env
index 723b99553..7acececa1 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_cms_profile/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_cms_profile/.env
@@ -7,7 +7,7 @@
# Drupal configuration directory.
#
-@@ -206,17 +206,3 @@
+@@ -212,17 +212,3 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_profile/.env b/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_profile/.env
index af7e88b1e..a6741341d 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_profile/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/starter_drupal_profile/.env
@@ -1,4 +1,4 @@
-@@ -206,17 +206,3 @@
+@@ -212,17 +212,3 @@
# with optional names in the format "email|name".
# Example: "to1@example.com|Jane Doe, to2@example.com|John Doe"
VORTEX_NOTIFY_EMAIL_RECIPIENTS="webmaster@star-wars.com|Webmaster"
diff --git a/.vortex/installer/tests/Fixtures/handler_process/version_scheme_other/.env b/.vortex/installer/tests/Fixtures/handler_process/version_scheme_other/.env
index 54be5fac9..60bf5ce20 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/version_scheme_other/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/version_scheme_other/.env
@@ -1,4 +1,4 @@
-@@ -171,7 +171,7 @@
+@@ -177,7 +177,7 @@
#
# Can be one of: calver, semver, other
# @see https://www.vortextemplate.com/docs/releasing
diff --git a/.vortex/installer/tests/Fixtures/handler_process/version_scheme_semver/.env b/.vortex/installer/tests/Fixtures/handler_process/version_scheme_semver/.env
index 8079f5eae..e1f4df3dc 100644
--- a/.vortex/installer/tests/Fixtures/handler_process/version_scheme_semver/.env
+++ b/.vortex/installer/tests/Fixtures/handler_process/version_scheme_semver/.env
@@ -1,4 +1,4 @@
-@@ -171,7 +171,7 @@
+@@ -177,7 +177,7 @@
#
# Can be one of: calver, semver, other
# @see https://www.vortextemplate.com/docs/releasing
diff --git a/.vortex/tests/bats/unit/provision.bats b/.vortex/tests/bats/unit/provision.bats
index 2dd690ae2..2548bf989 100644
--- a/.vortex/tests/bats/unit/provision.bats
+++ b/.vortex/tests/bats/unit/provision.bats
@@ -1626,3 +1626,250 @@ assert_provision_info() {
popd >/dev/null || exit 1
}
+
+@test "Provision: DB; no site; configs; verify config unchanged" {
+ pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1
+
+ # Remove .env file to test in isolation.
+ rm ./.env && touch ./.env
+ rm -f ./scripts/custom/provision-20-migration.sh
+
+ export VORTEX_PROVISION_SANITIZE_DB_PASSWORD="MOCK_DB_SANITIZE_PASSWORD"
+ export CI=1
+ export VORTEX_PROVISION_VERIFY_CONFIG_UNCHANGED_AFTER_UPDATE=1
+
+ mkdir "./.data"
+ touch "./.data/db.sql"
+
+ mocked_uuid="c9360453-e1ea-4292-b074-ea375f97d72b"
+ echo "uuid: ${mocked_uuid}" >"./config/default/system.site.yml"
+ echo "name: 'SUT'" >>"./config/default/system.site.yml"
+
+ create_global_command_wrapper "vendor/bin/drush"
+
+ declare -a STEPS=(
+ # Drush status calls.
+ "@drush -y --version # Drush Commandline Tool mocked_drush_version"
+ "@drush -y status --field=drupal-version # mocked_core_version"
+ "@drush -y status --fields=bootstrap # fail"
+ "@drush -y php:eval print realpath(\Drupal\Core\Site\Settings::get(\"config_sync_directory\")); # $(pwd)/config/default"
+
+ # Site provisioning information.
+ "Provisioning site from the database dump file."
+ "Dump file path: $(pwd)/.data/db.sql"
+ "- Existing site was found."
+ "- Site content will be preserved."
+ "- Sanitization will be skipped for an existing database."
+ "- Existing site content will be removed and fresh content will be imported from the database dump file."
+ "Existing site was not found."
+ "Fresh site content will be imported from the database dump file."
+ "@drush -y sql:drop"
+ "@drush -y sql:connect"
+ "- Unable to import database from file."
+ "- Dump file $(pwd)/.data/db.sql does not exist."
+ "- Site content was not changed."
+ "Imported database from the dump file."
+ # Profile.
+ "- Provisioning site from the profile."
+ "- Existing site content will be removed and new content will be created from the profile."
+ "- Installed a site from the profile."
+ "- Fresh site content will be created from the profile."
+
+ # Drupal environment information.
+ "Current Drupal environment: ci"
+ "@drush -y php:eval print \Drupal\core\Site\Settings::get('environment'); # ci"
+
+ # Post-provision operations.
+ "- Skipped running of post-provision operations as VORTEX_PROVISION_POST_OPERATIONS_SKIP is set to 1."
+
+ # Maintenance mode.
+ "Enabling maintenance mode."
+ "@drush -y maint:set 1"
+ "Enabled maintenance mode."
+
+ # UUID setup.
+ "@drush -y config-set system.site uuid ${mocked_uuid}"
+ "Updated site UUID from the configuration with ${mocked_uuid}"
+
+ # Config verification - export before updatedb.
+ "@drush * # 0"
+
+ # Database updates.
+ "Running database updates."
+ "@drush -y updatedb --no-cache-clear"
+
+ # Config verification - export after updatedb.
+ "@drush * # 0"
+
+ "Verified that database updates did not change configuration."
+ "Completed running database updates."
+ "- Configuration was changed by database updates."
+
+ # Configuration import.
+ "Importing configuration."
+ "@drush -y config:import"
+ "Completed configuration import."
+ "@drush -y pm:list --status=enabled # config_split"
+ "Importing config_split configuration."
+ "@drush -y config:import"
+ "Completed config_split configuration import."
+
+ # Cache rebuild.
+ "Rebuilding cache."
+ "@drush -y cache:rebuild"
+ "Cache was rebuilt."
+
+ # Deployment hooks.
+ "Running deployment hooks."
+ "@drush -y deploy:hook"
+ "Completed deployment hooks."
+
+ # Database sanitization.
+ "Sanitizing database."
+ "@drush -y sql:sanitize --sanitize-password=MOCK_DB_SANITIZE_PASSWORD --sanitize-email=user+%uid@localhost"
+ "Sanitized database using drush sql:sanitize."
+ "- Updated username with user email."
+ "@drush -y sql:query --file=../scripts/sanitize.sql"
+ "Applied custom sanitization commands from file"
+ "@drush -y sql:query UPDATE \`users_field_data\` SET mail = '', name = '' WHERE uid = '0';"
+ "@drush -y sql:query UPDATE \`users_field_data\` SET name = '' WHERE uid = '0';"
+ "Reset user 0 username and email."
+ "- Updated user 1 email."
+ "- Skipped database sanitization as VORTEX_PROVISION_SANITIZE_DB_SKIP is set to 1."
+
+ # Custom post-install script.
+ "Running custom post-install script './scripts/custom/provision-10-example.sh'."
+ "@drush -y php:eval print \Drupal\core\Site\Settings::get('environment'); # ci"
+ " > Setting site name."
+ "@drush -y php:eval \Drupal::service('config.factory')->getEditable('system.site')->set('name', 'YOURSITE')->save();"
+ " > Installing contrib modules."
+ "@drush -y pm:install admin_toolbar coffee config_split config_update media environment_indicator pathauto redirect robotstxt shield stage_file_proxy xmlsitemap"
+ " > Installing Redis module."
+ "@drush -y pm:install redis"
+ " > Installing and configuring ClamAV."
+ "@drush -y pm:install clamav"
+ "@drush -y config-set clamav.settings mode_daemon_tcpip.hostname clamav"
+ " > Installing Solr search modules."
+ "@drush -y pm:install search_api search_api_solr"
+ " > Installing custom site modules."
+ "@drush -y pm:install ys_base"
+ "@drush -y pm:install ys_search"
+ " > Running deployment hooks."
+ "@drush -y deploy:hook"
+ " ==> Started example operations."
+ " Environment: ci"
+ " Running example operations in non-production environment."
+ # Assert that VORTEX_PROVISION_OVERRIDE_DB is correctly passed to the script.
+ " Fresh database detected. Performing additional example operations."
+ "- Existing database detected. Performing additional example operations."
+ " ==> Finished example operations."
+ "Completed running of custom post-install script './scripts/custom/provision-10-example.sh'."
+
+ # Disabling maintenance mode.
+ "Disabling maintenance mode."
+ "@drush -y maint:set 0"
+ "Disabled maintenance mode."
+
+ # Installation completion.
+ "Finished site provisioning"
+ )
+
+ mocks="$(run_steps "setup")"
+
+ run ./scripts/vortex/provision.sh
+ assert_success
+
+ run_steps "assert" "${mocks[@]}"
+
+ assert_provision_info 0 0 0 1 0 1 0
+ assert_output_contains "Verify config after update : Yes"
+
+ popd >/dev/null || exit 1
+}
+
+@test "Provision: DB; no site; configs; verify config changed" {
+ pushd "${LOCAL_REPO_DIR}" >/dev/null || exit 1
+
+ # Remove .env file to test in isolation.
+ rm ./.env && touch ./.env
+ rm -f ./scripts/custom/provision-20-migration.sh
+
+ export CI=1
+ export VORTEX_PROVISION_VERIFY_CONFIG_UNCHANGED_AFTER_UPDATE=1
+
+ mkdir "./.data"
+ touch "./.data/db.sql"
+
+ mocked_uuid="c9360453-e1ea-4292-b074-ea375f97d72b"
+ echo "uuid: ${mocked_uuid}" >"./config/default/system.site.yml"
+ echo "name: 'SUT'" >>"./config/default/system.site.yml"
+
+ create_global_command_wrapper "vendor/bin/drush"
+
+ declare -a STEPS=(
+ # Drush status calls.
+ "@drush -y --version # Drush Commandline Tool mocked_drush_version"
+ "@drush -y status --field=drupal-version # mocked_core_version"
+ "@drush -y status --fields=bootstrap # fail"
+ "@drush -y php:eval print realpath(\Drupal\Core\Site\Settings::get(\"config_sync_directory\")); # $(pwd)/config/default"
+
+ # Site provisioning information.
+ "Provisioning site from the database dump file."
+ "Existing site was not found."
+ "Fresh site content will be imported from the database dump file."
+ "@drush -y sql:drop"
+ "@drush -y sql:connect"
+ "Imported database from the dump file."
+
+ # Drupal environment information.
+ "Current Drupal environment: ci"
+ "@drush -y php:eval print \Drupal\core\Site\Settings::get('environment'); # ci"
+
+ # Maintenance mode.
+ "Enabling maintenance mode."
+ "@drush -y maint:set 1"
+ "Enabled maintenance mode."
+
+ # UUID setup.
+ "@drush -y config-set system.site uuid ${mocked_uuid}"
+
+ # Config verification - export before updatedb.
+ "@drush * # 0"
+
+ # Database updates.
+ "Running database updates."
+ "@drush -y updatedb --no-cache-clear"
+
+ # Config verification - export after updatedb.
+ "@drush * # 0"
+
+ # Mock diff to simulate config changes detected.
+ "@diff * # 1 # Files before/changed.yml and after/changed.yml differ"
+
+ # Verification failure.
+ "Configuration was changed by database updates."
+ "The following configuration files were changed:"
+ "Files before/changed.yml and after/changed.yml differ"
+ "Configuration before updates:"
+ "Configuration after updates:"
+ "Review the update hooks and manually export updated configuration."
+
+ # These should NOT appear (script exits before them).
+ "- Verified that database updates did not change configuration."
+ "- Completed running database updates."
+ "- Importing configuration."
+ "- Rebuilding cache."
+ "- Running deployment hooks."
+ "- Disabling maintenance mode."
+ "- Finished site provisioning"
+ )
+
+ mocks="$(run_steps "setup")"
+
+ run ./scripts/vortex/provision.sh
+ assert_failure
+
+ run_steps "assert" "${mocks[@]}"
+
+ popd >/dev/null || exit 1
+}
diff --git a/scripts/vortex/provision.sh b/scripts/vortex/provision.sh
index 5df324682..42d1867ab 100755
--- a/scripts/vortex/provision.sh
+++ b/scripts/vortex/provision.sh
@@ -38,6 +38,12 @@ VORTEX_PROVISION_USE_MAINTENANCE_MODE="${VORTEX_PROVISION_USE_MAINTENANCE_MODE:-
# state before any updates ran (for example, DB caching in CI).
VORTEX_PROVISION_POST_OPERATIONS_SKIP="${VORTEX_PROVISION_POST_OPERATIONS_SKIP:-0}"
+# Verify that configuration was not changed by database updates.
+# If enabled and config files are present, the provision will fail if
+# database update hooks modify active configuration, preventing
+# drush config:import from silently overwriting those changes.
+VORTEX_PROVISION_VERIFY_CONFIG_UNCHANGED_AFTER_UPDATE="${VORTEX_PROVISION_VERIFY_CONFIG_UNCHANGED_AFTER_UPDATE:-0}"
+
# Provision database dump file.
# If not set, it will be auto-discovered from the VORTEX_DB_DIR directory using
# the VORTEX_DB_FILE name.
@@ -138,10 +144,18 @@ note "Fallback to profile : $(yesno "${VORTEX_PROVISION_FALLBACK_TO_P
note "Overwrite existing DB : $(yesno "${VORTEX_PROVISION_OVERRIDE_DB}")"
note "Skip DB sanitization : $(yesno "${VORTEX_PROVISION_SANITIZE_DB_SKIP}")"
note "Skip post-provision operations : $(yesno "${VORTEX_PROVISION_POST_OPERATIONS_SKIP}")"
+note "Verify config after update : $(yesno "${VORTEX_PROVISION_VERIFY_CONFIG_UNCHANGED_AFTER_UPDATE}")"
note "Use maintenance mode : $(yesno "${VORTEX_PROVISION_USE_MAINTENANCE_MODE}")"
echo
################################################################################
+if [ "${VORTEX_PROVISION_VERIFY_CONFIG_UNCHANGED_AFTER_UPDATE}" = "1" ]; then
+ for cmd in diff mktemp; do command -v "${cmd}" >/dev/null || {
+ fail "Command ${cmd} is not available"
+ exit 1
+ }; done
+fi
+
#
# Provision site by importing the database from the dump file.
#
@@ -299,7 +313,35 @@ if [ "${site_has_config_files}" = "1" ]; then
fi
task "Running database updates."
-drush updatedb --no-cache-clear
+
+if [ "${VORTEX_PROVISION_VERIFY_CONFIG_UNCHANGED_AFTER_UPDATE}" = "1" ] && [ "${site_has_config_files}" = "1" ]; then
+ config_before=$(mktemp -d)
+ drush config:export --destination="${config_before}"
+
+ drush updatedb --no-cache-clear
+
+ config_after=$(mktemp -d)
+ drush config:export --destination="${config_after}"
+
+ config_diff=$(diff -rq "${config_before}" "${config_after}" || true)
+
+ if [ -n "${config_diff}" ]; then
+ fail "Configuration was changed by database updates."
+ note "The following configuration files were changed:"
+ echo "${config_diff}"
+ note "Configuration before updates: ${config_before}"
+ note "Configuration after updates: ${config_after}"
+ note "Review the update hooks and manually export updated configuration."
+ exit 1
+ fi
+
+ rm -rf "${config_before}" "${config_after}"
+
+ pass "Verified that database updates did not change configuration."
+else
+ drush updatedb --no-cache-clear
+fi
+
pass "Completed running database updates."
echo