Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Commit message:
Migrate Drupal 6 roles and permissions #2150407 by andypost, chx
This patch introduces the entity destination in a very minimal state. Our first two migration specific process plugins also show up. We get the role source as well (this is unit tested). And then the migration (this is integration tested).
Entity will get unit tests later when it does something. In its current state unit testing is pointless. The integration test suffices.
I do not plan writing unit tests for the one off process plugins.
Comment | File | Size | Author |
---|---|---|---|
#26 | interdiff.txt | 3.09 KB | chx |
#26 | 2150407_26.patch | 21.37 KB | chx |
Comments
Comment #1
chx CreditAttribution: chx commentedComment #2
eliza411 CreditAttribution: eliza411 commentedUpdating the issue to reflect that map has been renamed to static_map
Comment #3
eliza411 CreditAttribution: eliza411 commentedI'm trying to sort out the "getting started" steps for writing migrations. Uploading my work-in-progress on the config file.
Comment #4
eliza411 CreditAttribution: eliza411 commentedAfter much patient explaining from chx and some excellent new docs at https://drupal.org/node/2135345#scalar_list, here's a revised migration config file.
We still need tests and the two migration-specific plugins.
Comment #5
eliza411 CreditAttribution: eliza411 commentedI'm not sure how the attachment got lost - here it is.
Comment #6
bdone CreditAttribution: bdone commentedgoing to try some work on this.
Comment #7
bdone CreditAttribution: bdone commentedhere is an as-is first pass, still needing much work...
Comment #8
bdone CreditAttribution: bdone commentedComment #9
chx CreditAttribution: chx commentedI have added the missing two plugins. Note how SystemUpdate7000 processes a string while NodeUpdate7008 processes the array -- as instructed by the handle_multiples key in their respective class annotation. This is absolutely untested. What we need at this point is a dump which has several roles with permissions that the pipeline changes.
Comment #10
chx CreditAttribution: chx commentedComment #11
chx CreditAttribution: chx commentedThis passes for me but it won't pass the bot without the related issue and it needs more tests so I am keeping it at needs work.
Comment #12
chx CreditAttribution: chx commentedComment #13
bdone CreditAttribution: bdone commentedgoing to update the test to assert the mapped permissions...
Comment #14
bdone CreditAttribution: bdone commentedthis updates the asserts, including the mapped permissions from the permissions key in config. patch #12 is against HEAD from the imp sandbox. i wasn't quite sure how to re-roll this, amidst the imp sandbox to core issue queue transition.
Comment #15
chx CreditAttribution: chx commentedThanks, I will reroll once all the dependencies are in. It's very helpful to see it this cleanly -- a few more permissions are necessary still but I can add those now now that it's this cleanly visible what adding permissions mean, like 'administer nodes' (to test NodeUpdate7008) and something to test SystemUpdate7000.
Comment #16
chx CreditAttribution: chx commentedComment #17
chx CreditAttribution: chx commentedComment #18
chx CreditAttribution: chx commentedI recall webchick protesting the transform() @inheritdoc stating it's a lie. I can't argue that... so documented them.
Comment #19
dawehnerThis variable name is not really helpful to understand what this plugin manager does. what about using migrateEntityField(Plugin)Manager ?
As the documentation of __construct as well as properties are missing, I had to go all the way down to the container call to figure out what this could mean.
If we don't really need it, let's try to not add it now?
Comment #20
dawehnerAgain ... please add @group Drupal
I try to figure out why we need a seperate namespace here?
Comment #21
chx CreditAttribution: chx commentedI will reroll tomorrow for plugin manager but I am not going to remove the commented out parts from Entity. It'd make the sandbox a must to keep around and that's superb inconvenient. Such parts are the price for small, parallel patches instead of a two megabytes patch, and good luck reviewing. I have relented on everything, making the docs impeccable on the first go even at the cost of velocity but I am not relenting on this one -- getting Entity complete would require to add the field and field instance migrations so we can test fielded entities being migrated but those are entities so they would need to be in the same patch. So we would end up with entity, field settings migration, field instance settings migration and then either node or user (those will become fielded entities) all in a single patch.
Comment #22
chx CreditAttribution: chx commentedFixed those that need fixing. We need a separate namespace cos this allows you to specify the real plugin class and then the preg_replace in MigrateSqlSourceTestCase::setUp derives the test clas.
Comment #23
chx CreditAttribution: chx commentedThis contains andypost's fixes to Entity.php and my tests asserting that id map saving worked. Will need to add this to the guide on gdo...
Comment #24
chx CreditAttribution: chx commentedDiscussed with webchick, moved commented out code into followups but linked them from code this way interested parties can see them / contribute / not forget / etc.
Comment #25
andypostThat's enough for the scope, another follow-up should be to add stub entities.
RTBC with small comment change
Comment #26
chx CreditAttribution: chx commentedComment #27
chx CreditAttribution: chx commentedComment #28
chx CreditAttribution: chx commentedComment #29
chx CreditAttribution: chx commentedComment #30
alexpottCommitted c2e68a5 and pushed to 8.x. Thanks!
Cleaned up some very minor things during commit.