Merge existing patches in Commerce SQL Sanitize

Created on 27 February 2024, 4 months ago
Updated 14 March 2024, 4 months ago

Problem/Motivation

The drush sql:sanitize command supports plugins to sanitize additional parts of a Drupal database, which is useful for Commerce sites needing to remove PII or other pieces of production data from their live site to prepare a development environment. Work in this direction already exists as attempted patches to Commerce Core and the Address modules themselves, but it’s better for maintenance to separate this functionality to its own module where it can be developed on its own release schedule.

Proposed resolution

The starting point for this module will be to take the work in these other MRs and use them to create a commerce_sql_sanitize module. This will require renaming files, namespaces, classes, etc. Besides simple renaming, we’ll need to make some changes to the two MRs, linked below:

  • Core MR: https://git.drupalcode.org/project/commerce/-/merge_requests/22.diff
    This does the work of sanitizing order fields and defining the table truncating feature for logs and payment methods. However, it inappropriately calls the tables it truncates “entity type tables” in various comments, function names, and variable names. We need to clean that up so it’s clear we’re truncating “entity tables”, as an “entity type table” would be a table that actually defines entity types, not the entities themselves.
  • Address MR: https://www.drupal.org/project/address/issues/3189074 đź’¬ Sanitize address fields on drush sql:sanitize Fixed
    This was originally committed and the final commit in the issue thread is a reversion of that commit. We should put this functionality into Commerce SQL Sanitize but target it at Address fields attached to customer profiles

In this ticket the first one MR will be merged. For the Address MR separate ticket is created https://www.drupal.org/project/commerce_sql_sanitize/issues/3424078 đź“Ś Merge commands from the Address module patches Fixed

đź“Ś Task
Status

Fixed

Component

Code

Created by

🇺🇦Ukraine khiminrm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024