Problem/Motivation
It was discovered in #2746541: Migrate D6 and D7 node revision translations to D8 that the drupal6 database base dump has an error. mikelutz has changed the times of the revisions for node 1 and explained those changes in comment #365, repeated here for convenience.
#305.12 This changed because the original d6 fixture was weird.
Originally, in the node table you had node 1, Revision id 1, created time 1388271197. changed time 1420861423
in the node revision table you had node 1 revision 1 timestamp 1420861423 and node 1, revision 2001, timestamp 1390095702. It made no sense, the latest revision timestamp was earlier than the first revision timestamp, and the node and revision tables don't match. I swapped the first and last timestamps, and set the node table to match, though I see now the node table still lists the revision for node 1 as revision 1 when it should be revision 2001, and I don't know how changing that will affect other tests.
MariaDB [d6_dump]> select nid,vid,timestamp from node_revisions where nid = 1;
+-----+------+------------+
| nid | vid | timestamp |
+-----+------+------------+
| 1 | 1 | 1390095702 | **
| 1 | 5 | 1390095703 |
| 1 | 2001 | 1420861423 |
+-----+------+------------+
3 rows in set (0.000 sec)
MariaDB [d6_dump]> select nid,vid,created,changed from node where nid = 1;
+-----+-----+------------+------------+
| nid | vid | created | changed |
+-----+-----+------------+------------+
| 1 | 1 | 1390095702 | 1420861423 |
+-----+-----+------------+------------+
1 row in set (0.000 sec)
** Note the timestamp changed from 1388271197 to 1390095702 in #2746541: Migrate D6 and D7 node revision translations to D8
Proposed resolution
Keep all the changes to node 1 from #2746541: Migrate D6 and D7 node revision translations to D8 and then change the latest revision from 1 to 2001, which is the latest revision. Also, add field data for revisions 5 and 2001 for all fields on node 1. Some texts needed to change as well, such as where the title included the revision number. And then update the d6 MigrateNodeTest.php and MigrateNodeRevisionTest.php.
MariaDB [d6_dump]> select nid,vid,created,changed from node where nid = 1;
+-----+------+------------+------------+
| nid | vid | created | changed |
+-----+------+------------+------------+
| 1 | 2001 | 1390095702 | 1420861423 |
+-----+------+------------+------------+
1 row in set (0.001 sec)
Remaining tasks
Fix the failing tests.
Comment | File | Size | Author |
---|---|---|---|
#39 | 3116841-39.patch | 12.25 KB | quietone |
#39 | diff-27-39.txt | 203 bytes | quietone |
#27 | 3116841-27.patch | 12.24 KB | quietone |
Comments
Comment #2
quietone CreditAttribution: quietone as a volunteer commentedMade a start on fixing MigrateNodeTest.
Comment #4
quietone CreditAttribution: quietone as a volunteer commentedAdding more revision data for fields and update revision test to test the correct revision values.
Comment #6
swatichouhan012 CreditAttribution: swatichouhan012 at Valuebound for Valuebound commentedCorrect comment config entities.
Comment #8
quietone CreditAttribution: quietone as a volunteer commentedAdd revisions to the 'upload' table.
Comment #10
quietone CreditAttribution: quietone as a volunteer commentedThe number of comments has changed?
Comment #11
quietone CreditAttribution: quietone as a volunteer commentedUpdate IS.
The only thing I don't understand is why the number of comments has been reduced by 1.
This is ready for review.
Comment #12
quietone CreditAttribution: quietone as a volunteer commentedRegarding comments, none of the comments in the fixture are linked to node 1.
Comment #13
mikelutzYeah, the comment count seems wrong, I noticed that one of the comments comes over as the 'comment' bundle, instead of the story specific comment bundle, This definitly needs more work, I'll try to investigate further.
Comment #14
quietone CreditAttribution: quietone as a volunteer commentedNeeded a reroll
Comment #16
quietone CreditAttribution: quietone as a volunteer commentedHmm, that is unexpected. I can't explain why the comment entity count changed but this remove the changes made in #10 regarding the count and try again.
Comment #18
quietone CreditAttribution: quietone as a volunteer commentedThe revision creation time has changed for node 1, since it is now revision '2001' instead of revision '1'.
Comment #20
mikelutzrtbc
Comment #21
quietone CreditAttribution: quietone as a volunteer commentedBummer, this needs a reroll.
Comment #22
quietone CreditAttribution: quietone as a volunteer commentedReroll for 9.1.x. No changes to the fixture, just d6/MigrateNodeTest
Comment #23
quietone CreditAttribution: quietone as a volunteer commentedThis is blocking #3138795: d6_term_node_revision references non-existent migration
Comment #24
quietone CreditAttribution: quietone as a volunteer commentedRetesting
Comment #25
quietone CreditAttribution: quietone as a volunteer commentedThis is actually a bug.
Comment #26
dww1 new CS violoation:
Extra semicolon here.
Otherwise, seems RTBC to me. I'm only recently in touch with this test, so I'm no expert...
Comment #27
quietone CreditAttribution: quietone as a volunteer commented@dww, thank you and apologies , I shouldn't seen that myself.
Comment #28
dwwBot's happy.
Tests pass.
No more CS violations.
Changes in the patch look consistent with the issue summary.
I could complain that if we're already changing assertions like this:
...that we should strip the pointless 3rd message argument. But that's arguably out of scope. We'll clean all that up in other issues.
Therefore, RTBC.
Thanks,
-Derek
Comment #29
larowlanI took a look at this but have no idea what I'm looking at 😵
I'll ping @quietone to walk me through this tomorrow.
Comment #30
dwwFor the record, this patch is also making it consistent so that vid 5 always belongs to nid 1. E.g. currently (in Git, prior to the patch) we have:
~line 45316
vs. a few spots where it's nid '2' (touched by the patch). E.g.:
~line 2404
...
Comment #31
quietone CreditAttribution: quietone as a volunteer commentedMinor changes to IS
Comment #32
quietone CreditAttribution: quietone as a volunteer commentedComment #33
jungleShould we replace
array()
with[]
?Comment #34
quietone CreditAttribution: quietone as a volunteer commented@jungle, not in this case. That database fixtures drupal6.php and drupal7.php are created by the script core/scripts/db-tools.
Comment #35
larowlanComment #37
larowlanCommitted ba77d3f and pushed to 9.1.x. Thanks!
c/p to 9.0.x
Queuing an 8.9.x test
Comment #39
quietone CreditAttribution: quietone as a volunteer commentedRerolled for 8.9.x
Comment #40
dwwRe-roll looks good. Back to RTBC.
Thanks!
-Derek
Comment #41
alexpottCommitted 67b02fd and pushed to 8.9.x. Thanks!