Problem/Motivation
Project url: https://www.drupal.org/project/pathauto
This module has been previously vetted for Drupal 9 with the following snippet added to curated.json:
{
"package": "drupal/pathauto",
"constraint": "1.9",
"patches": {
"Issue #3179835: Migrate forum pattern to taxonomy term forums if forum is enabled on the source site": "https://www.drupal.org/files/issues/2022-01-06/pathauto-migrate_forum_pattern_if_forum_is_enabled_on_source-3179835-22--complete.patch",
"Issue #3179865: Derive pathauto pattern migrations to solve inaccurate pattern migration dependencies": "https://www.drupal.org/files/issues/2021-04-06/pathauto-derive_pathauto_migrations_per_entity_type-3179865-25.patch",
"Issue #3182708: Migrate language-specific patterns": "https://www.drupal.org/files/issues/2022-01-06/pathauto-migrate_multilingual_patterns-3182708--12.patch",
"Issue #3079275: Custom aliases (which are not generated with the actual patterns) can be lost during the migration": "https://www.drupal.org/files/issues/2022-01-06/pathauto-prevent_losing_custom_aliases-3079275-27--combined--do-not-test.patch",
"Issue #3190980: [PP-1] Allow source counts to be cached: implement ::doCount() instead of ::count()": "https://www.drupal.org/files/issues/2021-01-05/3190980-2.patch"
},
"install": [
"pathauto"
],
"replaces": [
{
"name": "pathauto"
},
{
"name": "pathauto_entity"
},
{
"name": "pathauto_persist"
}
],
"vetted": true
},
[...]
{
"package": "drupal/token",
"constraint": "^1.10",
"replaces": {
"name": "pathauto"
},
"install": [
"token"
],
"vetted": true
},
Steps to reproduce
n/a
Proposed resolution
Take snippet from D9 recommendation, update for Drupal 10 compatibility, add to D10 curated.json
Remaining tasks
- On a D7 site, install Pathauto
- Configure some content types with patterns and generate aliases
- Add snippet from D9 recommendation into D10 curated.json (locally)
- Generate new recommendations.json
- Use acli to generate a new D10 project based on this new recommendations.json file
- Test to see if old recommendation still works
- If not, update recommendation snippet to D10 appropriate values and update recommendations.json by running make
NOTE this module has test coverage in AM:A and thus those should be run as well after the migration to the D10 instance.
User interface changes
API changes
Data model changes
Comments
Comment #2
dan612 commentedAfter adding the snippet and regenerating the recommendations file, I ran the acli command and was met with:
Issue #1:
This has a newer patch. Altering reference to https://www.drupal.org/files/issues/2023-05-08/pathauto-n3179835-25.patch and trying again did not help the situation. I think this needs a complete re-roll. Did that here https://www.drupal.org/project/pathauto/issues/3179835#comment-15466623 and now everything installs cleanly. Interesting...I thought I would have to re-roll a few of these but I guess the other patches must rely on the first.
To test the migration i set up some basic pathauto configs in Drupal 7:
Then bulk generated aliases and ran migration via AM:A. This resulted in both the config and aliases coming over successfully:
Now to run the tests!...The first thing I attempted was to just list out the available groups, which resulted in this:
I think this is something straightforward...like we are missing a
voiddeclaration in our function signatures..I updated that file locally and then hit the same issue in a number of different files:After that was met with:
I think this function is missing $expected_cache_key = []. I added that...then could finally run
../../vendor/bin/phpunit --group=pathautoThere were some errors that need to be reviewed. This is getting pretty confusing as these issues are not actually present in the underlying module but are put in place by multiple different patches. So i think outstanding tasks right now are:
Output of phpunit attached here.
Comment #3
wim leersThis should not be possible. The patch MUST still apply. Unless you are not targeting Pathauto 1.9 anymore, because that's the version all patches applied to, and will continue to apply to for eternity.
The MR is still empty so I can't see it.
I bet you updated to https://www.drupal.org/project/pathauto/releases/8.x-1.11, because that's the first version with Drupal 10 compatibility.
Let's create a sibling MR in this issue against the 1.9.x branch of the module, so we can see how
\Drupal\Tests\acquia_migrate\FunctionalJavascript\PathautoMigrationTestworks with these recommendations. To tell it to use the updated recommendations, modify this in that MR against 1.9.x:Most of the test failures are trivial to resolve though:
drupal_get_path()does not exist anymore and is a trivial string replacement, and errors likeTypeError: Cannot access offset of type string on stringare explicitly about weird magic that PHP <=7 used to do but PHP >=8 does not anymore! 💡 That's exactly why these migrations need to be re-vetted, and why I've been saying that we can't assume migrations that were developed against PHP 7 will work flawlessly on PHP 8 too!Comment #5
wim leersMR looks great, and is green! 🤩
Next step: #3.4, to verify the integration tests in the AM:A module actually pass too 🤓 See #3406774: Update: drupal/core:9.5.11 for a prior example of creating such a sibling MR.
Comment #6
dan612 commentedI was trying to get this to run locally but am encountering this:
Which I believe is a problem with my local setup. I did have chromedriver running but not inside the container which I think was the ultimate issue. That might take a while to sort out, so perhaps easier to just test in the CI 😇
Comment #8
wim leerschromedriveris a nightmare.Yes, go for CI 😄 It's going to be MUUUUUUUUUUUUUCH faster anyway.
Comment #9
wim leersD'oh. Looks like the logic I added in the CI only works if the sibling MR lives on a different issue fork 🫣
Comment #10
dan612 commentedWell...I got it to be green but I am not sure if it is quite working as I see this in the output:
So I think changing the filename was OK to get past the first part, but now we need the artifact to export it with the same name because when we try to run ACLI later on we encounter this:
Comment #11
wim leersYep — sorry, this is tricky stuff. This is the first MR like this against
recommendations-10, so the first time we're running into this.You just move on to a next major contrib module to vet for Drupal 10 — I'll figure this out!
Comment #12
wim leers👆 All that painful back-and-forth resulted in a solution, which I extracted into #3425024: .gitlab-ci.yml: module MR to test a D10 recommendations MR does not work. That'll allow the "test MR" to become as trivial as it should be (a single line!) 👍
Now that tests are actually running, it's become clear that they're failing:
See https://git.drupalcode.org/project/acquia_migrate/-/jobs/953545.
This might require changes in
\Drupal\Tests\acquia_migrate\FunctionalJavascript\PathautoMigrationTest, but most likely it just needs changes upstream, inPathautoMigrationAssertionsTrait(which AM:A's test reuses) or the upstream kernel test that uses that same trait.@dan612 is aware of that, and we agreed on how to proceed — captured it over at #3179835-28: Migrate forum pattern to taxonomy term forums if forum is enabled on the source site.
Comment #13
wim leersMerged #3425024: .gitlab-ci.yml: module MR to test a D10 recommendations MR does not work into the "test" MR, which now is a single line MR again like it was always supposed to be! 😄
Comment #14
dan612 commentedI'd like to call attention to this patch - https://www.drupal.org/project/pathauto/issues/3079275#comment-15271879
I believe work from the other patches is now looped into this one. For example, the patch from this issue - https://www.drupal.org/project/pathauto/issues/3179835#comment-15474081 - introduces a hook_migrate_process_info_alter() to do
This same snippet is in the patch from #67.
. I spot checked a few other classes/code changes and they were all present in the "combined" patch.
So...I think this means we can omit the first 3 patches and just use #67. However, that patch also will fail validation and need to be updated - for example the
setUpfunctions lack a: voidNeed to test more.
Comment #15
dan612 commentedtrying something...
Comment #16
dan612 commentedI took what was in #67 and then changed out some things to avoid errors. The issue label conflicts with the patch name, at the moment...but I just wanted to see what this would do in CI. Turns out it flopped before it could try to fly 😞
Comment #17
wim leersArgh, this again! Looks like d.o's GitLab CI keeps changing underneath us 😬
Comment #18
wim leersI'm hoping that this was caused by my hand being forced yesterday to hotfix us from chasing
default-refof the d.o GitLab CI template and my having pinned it to1.1.2. In #3425649: Update to version 1.2.1 of the d.o GitLab CI template and adopt the `cspell` job, I'm pinning that to 1.2.1 instead, and hopefully a simple rebase here will fix the problem cited in #17 🤞Comment #19
wim leers#3425649: Update to version 1.2.1 of the d.o GitLab CI template and adopt the `cspell` job landed.
Merged latest
1.9.xinto the "test" MR 🤞Comment #20
wim leersStill fails tests:
Comment #21
wim leersComment #22
dan612 commentedswapped out
node_typeforentity_bundleto see if that helps things alongComment #24
jienckebd commentedConfirming that Dan is awesome and did great work on this.
Tests are running okay locally now based on this updated patch.
That patch combines 4 of the original pathauto patches from Drupal 9 and adjusts them to pass tests on Drupal 10.
We can't discern if the tests pass because our pipeline configuration is still failing either due to IEF in D10, bean_migrate in D9, or database connection issues. I'm moving around those for now but let me know if I can help there.