Problem/Motivation

When updating a migrate_drupal test, sometimes there is a need to add to any of the various .php files that provide D6 and D7 table dumps (located in /core/modules/migrate_drupal/src/Tests/Table). These files are generated by the core/scripts/migrate-dump-d6.sh script which reads the d6.gz DB dump and generates all the table .php dumps.

While the process is documented in the migrate-dump-d6.sh, it is not foolproof, so additional documentation is needed.

Proposed resolution

Options include:

  • Creating a new documentation page as a child of #2127611: Migrate API overview.
  • Add a "README.txt" to /core/modules/migrate_drupal/src/Tests/Table
  • Others?

Remaining tasks

Figure out where the documentation should go, and get it written.

User interface changes

None.

API changes

None.

Comments

benjy’s picture

Can we outline the specific problems with the current docs. One i know of is, uncompressing and importing the Db in one hit.

gunzip < core/modules/migrate_drupal/src/Tests/d6.gz | mysql -uroot -hmysql d6

Also, I think people have had issues creating a binary patch correctly. Or is that fixed with .gitattributes file now?

benjy’s picture

Also, the entry that needs to go in your settings file, I have an example on the sandbox page: https://www.drupal.org/sandbox/benjy/2405029

ultimike’s picture

Benjy,

I think there are a few of issues:

  1. New contributors aren't always aware that they shouldn't edit the individual table dumps directly. Even with the @file docblock at the top of each table dump, I think most people won't even notice it.
  2. The documentation in migrate-dump-d6.sh only outlines the process for re-generating the tables. I think we need to provide some additional documentation about the bigger picture - why it is done this way, how to create a diff file that includes the d6.gz, etc...
  3. I don't think the .gitattributes file is all that needs to be done, users also need to use git diff --full-index --binary > thepatchname.patch, no?
  4. The entry in the settings file also needs better documentation - good call.

-mike

benjy’s picture

So i had a play with this, the core .gitattributes file seems to be causing our issues, changing this:

-*.gz      -text diff
+*.gz      -text -diff

allowed me to create patches with git diff --binary as expected.

ultimike’s picture

benjy - will this be acceptable to Alex? I thought he wanted us to figure out a way to do without the .gitattributes file...

-mike

benjy’s picture

I think he meant without having a new .gitattributes in the migrate module. If the problem is just that the core one is wrong, then we should be able to fix that.

ultimike’s picture

quietone’s picture

Status: Active » Fixed

The script referred to in this issue, migrate-dump-d6.sh, has been superseded by db-tools.sh in #2550291: Improve and generalize database dump tools.

This issue is about the documentation for generating the dumps and that is done, Generating database fixtures for D8 Migrate tests.

Therefor, setting as fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.