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.
Helper issue for #1498720: [meta] Make the entity storage system handle changes in the entity and field schema definitions to avoid spamming it with patches to be tested. I hope I didn't break too much stuff.
Comment | File | Size | Author |
---|---|---|---|
#98 | et-entity_schema_handling-2298525-97.patch | 151.37 KB | plach |
#94 | et-entity_schema_handling-2298525-94.patch | 217.06 KB | plach |
#94 | et-entity_schema_handling-2298525-94.interdiff.txt | 3.51 KB | plach |
#90 | et-entity_schema_handling-2298525-90.patch | 217.7 KB | plach |
#87 | interdiff.txt | 2.6 KB | effulgentsia |
Comments
Comment #1
plachComment #2
plachComment #4
plachComment #6
plachThis merges @alexpott's work from the parent issues. I hope I got it right as I had a lot of conflicts...
(unit tests failures are expected, I need to adjust those tests to match the latest changes)
Comment #7
plachComment #10
plachJust a reroll to see whether failures are the same
Comment #12
plachComment #14
plachComment #16
plachComment #18
plachJust an (awful) reroll after #2287727: Rename FieldConfig to FieldStorageConfig and #597236: Add entity caching to core.
Comment #19
plachnow with patch
Comment #21
plachThis should fix the PHPUnit failures we used to have above, now I just need to fix all the new failures :P
Comment #22
plachComment #23
plachI definitely need some sleep...
Comment #25
plachThis should fix most failures. It incorporates #2279395-54: The PostgreSQL backend does not handle NULL values for serial fields gracefully as this now depends on it.
Comment #27
alexpottPushed to plach's sandbox - branch is called: 2298525-alexpott
Comment #29
plachRerolled
Comment #31
plachThis should be green again, finally
(pushed to the
wip
branch, I'm going to go back to a serious branch asap :)Comment #32
plachRe-uploading
Comment #33
plachAnd this should restore some previously-removed test coverage.
Comment #34
plachSome final clean-up.
Comment #35
plachFirst attempt to see how part2 behaves...
Comment #37
plachApparently a tiny fatal in a PHP unit test can break all the test result reporting...
Comment #38
plachComment #39
plachComment #41
plachComment #43
plachComment #45
plachComment #46
plachComment #48
plachComment #49
plachComment #51
plachJust a reroll of #1498720-169: [meta] Make the entity storage system handle changes in the entity and field schema definitions for now.
Comment #52
plachComment #53
plachAnother reroll including #2326719-31: Move pseudo-private table mapping functions from ContentEntityDatabaseStorage to public API of DefaultTableMapping
Comment #54
effulgentsia CreditAttribution: effulgentsia commentedBot check for the next sub-issue I plan on opening.
Comment #56
plachJust a reroll of the full patch now that #2326719: Move pseudo-private table mapping functions from ContentEntityDatabaseStorage to public API of DefaultTableMapping has landed.
Comment #57
plachA nasty reroll after #2326949: Move entity-type-specific schema information from the storage class to a schema handler and above all #2250119: Run updates in a full environment went in. Fingers crossed.
Comment #59
plachThis should fix test failures.
Comment #60
effulgentsia CreditAttribution: effulgentsia commentedHere's the next step I'd like us to focus our reviews on after #2330121: Replace ContentEntityDatabaseStorage::getSchema() with a new EntityTypeListenerInterface implemented by SqlContentEntityStorageSchema. This patch includes that one in order to get a bot check. Once it passes, I'll open the issue for just its own piece.
[Edit: here's that issue: #2333113: Add an EntityDefinitionUpdateManager so that entity handlers can respond (e.g., by updating db schema) to code updates in a controlled way (e.g., from update.php)]
Comment #61
effulgentsia CreditAttribution: effulgentsia commentedThanks for the reroll in #57. Rerolling #59 on top of #60 will also be a bit tedious, but I'll work on that, and will post it here once I'm done.
Comment #62
plachI needed #59 to keep working on one of the last bullets on my todo list: blocking module uninstallation when they provide field storage definitions for which data exists. Patch coming soon :)
Comment #63
effulgentsia CreditAttribution: effulgentsia commentedThis is a reroll of #59 on top of #60. The "-do-not-test" one doesn't include any of #60. The "-full" one includes everything, but resolves the various conflicts introduced by #60.
Re #62, great! If your new patch is based on #59, then when you post yours, please post an interdiff relative to #59, and hopefully that interdiff won't be too hard to apply to these patches here.
Comment #64
plachAnd with this we should be "done" with my todo list, at least here. The other two bullets were adding test coverage for the entity schema manager, which can happen in its own issue, and temporarily blocking entity schema layout changes, which is not fully supported yet by storage classes, and requires just a throw somewhere. We should do this only before committing the very final version of the last patch so we can write proper test coverage meanwhile.
Comment #66
plachComment #67
plachAnother fun reroll + some test fixes
Comment #69
plachThis one should be better
Comment #71
plachJust a plain reroll. Working on test failures now.
Comment #72
plachSome test fixes.
Comment #75
effulgentsia CreditAttribution: effulgentsia commentedJust a reroll of #72.
Comment #77
effulgentsia CreditAttribution: effulgentsia commentedMerged in changes from the history of #2333113: Add an EntityDefinitionUpdateManager so that entity handlers can respond (e.g., by updating db schema) to code updates in a controlled way (e.g., from update.php). Also reordered some functions in SqlContentEntityStorageSchema to match their order in HEAD to make the diff easier to review.
The "-do-not-test" patch is rebased on top of #2333113-58: Add an EntityDefinitionUpdateManager so that entity handlers can respond (e.g., by updating db schema) to code updates in a controlled way (e.g., from update.php), so is the last step once that lands.
Comment #79
tim.plunkettThis really doesn't seem right to me. Why does EntityManagerInterface know about FieldStorageDefinition anything?
Can't we please create a new class and move all of this stuff out? I don't know at what point EntityManager became the dumping ground for all of this code that only pertains to half of entity types, but this is getting out of control.
EDIT: Ugh, just realized I'm posting to a test-only issue. I'll track down the real one tomorrow...
Comment #80
effulgentsia CreditAttribution: effulgentsia commentedThe real issue with that change is #2333113: Add an EntityDefinitionUpdateManager so that entity handlers can respond (e.g., by updating db schema) to code updates in a controlled way (e.g., from update.php). However, realize that EntityManagerInterface already has a ton of methods that deal with field definitions. So if you want to decouple everything field-related from EntityManager, please open a new issue for that rather than holding up that one. However, I'll point out that
isFieldable()
is a method of EntityTypeInterface, so I don't think it's entirely unreasonable for EntityManager to deal with field definitions in addition to entity type definitions, but if there's a good way to partition EntityManager into smaller parts, I'm ok with that too.Comment #81
effulgentsia CreditAttribution: effulgentsia commentedRemoving the system_system_info_alter() change as out of scope for this issue. Seems like can be a separate issue and post-beta. Elsewhere we decided to not add hasData() to entity storage handlers, so if we want to change our mind on that, let's do it in a dedicated issue.
Also fixed a stray merge conflict.
Comment #82
plach-1 on the last interdiff: blocking module uninstallation was planned with @alexpott in the last hard problems discussion about this topic we had in Austin. This was meant to prevent modules from breaking while we unify the field purging code.
Comment #83
effulgentsia CreditAttribution: effulgentsia commentedMerged changes from #2333113: Add an EntityDefinitionUpdateManager so that entity handlers can respond (e.g., by updating db schema) to code updates in a controlled way (e.g., from update.php) and fixed #82.
Comment #85
effulgentsia CreditAttribution: effulgentsia commentedMerged changes from #2333113: Add an EntityDefinitionUpdateManager so that entity handlers can respond (e.g., by updating db schema) to code updates in a controlled way (e.g., from update.php), which is now RTBC. And fixed the cause of #83's exceptions (system.module's hunk in the interdiff).
Comment #87
effulgentsia CreditAttribution: effulgentsia commentedComment #89
plachThanks for the rerolls, I will work on those failures later today if no one beats me to it.
Comment #90
plachNo luck here, trying some bot debugging
Comment #92
effulgentsia CreditAttribution: effulgentsia commentedMakes sense, but seems a different scope than #2337927: SqlContentEntityStorage::onFieldStorageDefinition(Create|Update|Delete)() is broken for base fields, so I opened #2338873: Modules providing non-configurable field storage definitions can be uninstalled, leaving orphaned unpurged data. Maybe having it isolated will also help with troubleshooting those failures?
Comment #93
plachI think I found a way to make the test pass, I will post a patch soon.
Comment #94
plachOk, this should fix the install/uninstall test failures.
Comment #96
plachI am going to reroll this so we can have a first patch in #2337927: SqlContentEntityStorage::onFieldStorageDefinition(Create|Update|Delete)() is broken for base fields.
Comment #97
effulgentsia CreditAttribution: effulgentsia commentedHeh, I just happened to do this before seeing your comment, so here's my reroll. Curious if yours ends up being identical or not.
Comment #98
plachNot sure, mine includes #94...
(for the bot)
Comment #99
plachThe only difference is here: mine is keeping this line.
Comment #102
plachThe parent issue has been fixed :)