The following four deprecation messages are globally suppressed in DeprecationListenerTrait
'CommentVariable is deprecated in Drupal 8.4.x and will be removed before Drupal 9.0.x. Use \Drupal\node\Plugin\migrate\source\d6\NodeType instead.',
'CommentType is deprecated in Drupal 8.4.x and will be removed before Drupal 9.0.x. Use \Drupal\node\Plugin\migrate\source\d7\NodeType instead.',
'CommentVariablePerCommentType is deprecated in Drupal 8.4.x and will be removed before Drupal 9.0.x. Use \Drupal\node\Plugin\migrate\source\d6\NodeType instead.',
'The Drupal\migrate_drupal\Plugin\migrate\source\d6\i18nVariable is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use Drupal\migrate_drupal\Plugin\migrate\source\d6\VariableTranslation',
Core does not actually trigger these deprecation notices except in the tests specifically testing the deprecated classes, so they should be removed from the global list and the individual tests should be labeled as legacy with the appropriate expected deprecations.
Comments
Comment #2
mikelutzComment #3
mikelutzComment #4
mile23I see one green test, so I feel safe with RTBC.
I feel a little nitpicky about this pattern, because the string literals are completely literal and don't need to be assembled. They maybe should be @expectedDeprecation annotations.
Other than the minor nit, LGTM.
Comment #5
alexpott@mikelutz thanks for working on this. It's great to see this being tackled.
I agree with @Mile23 let's not use the ExpectedDeprecationTrait unnecessarily. Also it would be good to confirm that we have matching non-legacy test coverage.
For example for i18nVariable we have both:
But for we have VariableTranslation:
So are we losing test coverage in any way?
Comment #6
mikelutzWe aren't losing test coverage with this patch, but it looks like we did miss adding the kernel test for VariableTranslation in #2861383: Rename i18n migrations to _translation
In #2791119: Write meaningful Migrate source tests kernel tests for sources became favored over unit tests, so the kernel test for variable translation should definitely be created. I created a novice issue #3004684: Create a Kernel Test for VariableTranslation source plugin to do that, because I don't feel it belongs in this issue, it's a follow up to 2861383..
The other three sources were replaced with the NodeType source in comment migrations in #2887142: NodeType source plugin should include comment information, and that source and the new comment migrations are thoroughly covered in tests.
I moved the deprecation expectations into annotations. For some reason I didn't know they could go there, I thought ExpectDeprecationTrait was the only way to declare them. Lesson learned.
Comment #7
alexpott@mikelutz but atm the i18Variable kernel test is a kernel test of VariableTranslation - because i18Variable extends VariableTranslation. With this change we're marking it for removal so either #3004684: Create a Kernel Test for VariableTranslation source plugin is a blocker or we need to do it here.
Comment #8
mikelutzOkay, that makes sense. Here you go, we can close the other issue as outdated then.
Comment #9
mikelutzComment #10
quietone commentedChanged the status on #3004684: Create a Kernel Test for VariableTranslation source plugin to outdated.
Comment #11
phenaproxima@mikelutz explained what's happening in this patch to me, since I was confused about why we are adding a completely new test here. It makes sense now. Let's do it.
Comment #13
phenaproximaDang.
Comment #14
mikelutzReroll against some i18n work recently committed
Comment #15
phenaproximaThanks! RTBC when green.
Comment #16
alexpottCommitted 44b86a4 and pushed to 8.7.x. Thanks!