Drupal 9 porting day recap
These are the steps I went through on "Drupal 9 porting day" on April 28, 2020, which was initiated by Drupal core "Initiative coordinator coordinator", Gábor Hojtsy. It was focused around timezones: Australia & New Zealand, Europe, and Americas.
Image credit: Aaron Deutsch
I'd like to dedicate this post to Hook 42 and to my family in lockdown (sons Aaron & Jacob, husband Josh, and mom Merleigh). Hope everyone reading this is healthy and safe!
Please pardon my super crude Drupal site (especially if you are on mobile)! I haven't written blog posts here since 2013, and it's running on Drupal 6! o_O Yes, the cobbler needs new shoes, and I hope to get some in the next few months. Meanwhile, this was important and timely enough information that I didn't want to wait to update the website before putting it out into the world. And, it's pretty ironic I'm writing about Drupal 9 patches on a D6 site ;)
Thank you!
Huge thanks to Gábor for the porting day idea and coordination as well as the amazing #DrupalCares Drupal 9 module challenge! The Drupal community is very lucky to have you.
Also a big thanks to the many porting day coordinators and participants listed in order of Slack participation (if I missed someone, please ping me on Twitter or Drupal.org and I'll try to add quickly): heddn, xjm, berdir, longwave, mondrake, penyaskito, ccjjmartin, drumm, damienmckenna, nterbogt, larowlan, shrop, kimb0, dww, surabhi.gokte, Peter Wong, jungle, Ankush Gautam, Ankush Gautam, Ankit Pathak, VladimirAus, mirom, dan2k3k4, klausi, Kiran Rao, geerlingguy, DuaelFr, renatog, svenbergryen, neetumorwani, shaktik, bircher, Matroskeen, alexpott, Jeevan, Atul Sharma, Manuel Garcia, piyuesh23, Nitish Singh Guleria, wizonesolutions, rahulrasgon, renatog, Paulo Calaes, JayKandari, Amit Sharma, Sonal, Matroskeen, Tejas Shah, kristen_pol, nerdstein, Nitesh, jrockowitz, mikelutz, jurgenhaas, eojthebrave, KarinG, Leeotzu, mixologic, japerry, Vishal Chaudahry, mikelutz, Aimee Rae
Step 0: Resources used
There are a lot of Drupal 9 resources out there but here's what I focused on for the porting day:
- Slack readiness channel
- Drupal 9 compatibility contribution quickstart guide
- Drupal 9 Deprecation Status
- drupal-check
- Upgrade Status
- drupal8-rector
- Upgrade Rector
- Running PHPUnit tests
- State of Drupal 9
- Various Drupal issue queues and change records
Image credit: Gábor Hojtsy
Step 1: Checking in via #d9readiness
I woke up early due to an Ash-throated Flycatcher repeatedly pecking the window. Since my family was asleep, I checked the #d9readiness Slack channel to see what was going on. I saw a message from Gábor asking if anyone needed help picking a project to work on. Someone else said they wanted help finding a project, and Gábor suggested they look at projects from "group 100" in the Drupal 9 Deprecation Status report that only need info file updates. Earlier others had already been looking at "group 50".
I chimed in saying that I couldn't sleep so would try to find one from the list as well. I went to get (decaf) coffee (yes, I know) and more importantly chocolate to keep me going. The person asking for help chatted that they couldn't find anything in "group 100" so they were going to start looking in "group 200". So that is where I started. (Side note that it did turn out there were projects in "group 100" that could have been worked on but I found that out after picking something from "group 200".)
Step 2: Looking at an existing Slack thread for example
Gábor suggested looking at a Slack thread to see the process with a real example for D8 Editor Advanced link module. He went through the analysis roughly as follows:
- Searched issue queue and found existing D9 deprecated report that showed no errors: https://www.drupal.org/project/editor_advanced_link/issues/3042615
- Checked in the dev code that the info file hadn't been updated yet
- Scanned the dev code and found it was "very simple"
- Suspected there might be JavaScript deprecations but they were using core so "ok"
- Double checked deprecations with Upgrade Status module to get a more complete picture (has more detail than drupal-check) and found no issues
- Concluded that only the info file needs updating
- Was going to submit an issue for the info file but found existing one: https://www.drupal.org/project/editor_advanced_link/issues/3105317
- Added comment with review process and tagged the issue with "Drupal 9 porting day": https://www.drupal.org/project/editor_advanced_link/issues/3105317#comme...
- Pinged a project maintainer via Slack to see if it could be committed
- Maintainer is busy but will hopefully will commit it soon
- End of work on this project... time to move to another one :)
Step 3: Finding a project
Needed to find a project that isn't D9 ready but isn't being actively worked on by others.
- I went to "Drupal 9 Deprecation Status" for <=500 for projects that appear to only need info.yml file updates
Although I was only looking specifically at <=500 for info.yml file issues, you can find all projects that need an info.yml file update or all projects that still need any type of work for Drupal 9 compatibility.
- Decided to work backwards from the end of the list of "Group 200" because other people are probably going in top-to-bottom order. This is the order I will check:
- views_accordion 1.3
- override_node_options 2.4
- ckeditor_font 1.0
- workbench 1.1
- field_formatter_class 1.1
- contribute 1.0-beta8
- block_content_permissions 1.8
- auto_entitylabel 3.0-beta2
- menu_admin_per_menu 1.0
- search_api_autocomplete 1.3
- media_entity_browser 2.0-alpha2
- username_enumeration_prevention 1.0
- colorbutton 1.1
- panelbutton 1.2
- real_aes 2.2
- schema_metatag 1.4
- antibot 1.3
- token_filter 1.1
- Checking views_accordion
- Find the issue queue
https://www.drupal.org/project/issues/views_accordion
- Scan open issues for "Drupal 9" and found one with a D9 patch that needs review where the issue was not assigned to anyone (note that it was marked "Needs work" because of a failed test but more on that later)
https://www.drupal.org/project/views_accordion/issues/3100388
- Quickly checked the patch and saw it was only for the info file so assigned the issue to myself and tagged it with "Drupal 9 porting day"
- Another issue was noted as a D9 blocker so assigned it to myself and tagged it with "Drupal 9 porting day"
https://www.drupal.org/project/views_accordion/issues/3091388
- Started a thread in the #d9readiness Slack channel and listed the two issues found
https://drupal.slack.com/archives/CDDD98AMN/p1588088050447400
- Find the issue queue
Step 4: Info patch review
The info patch was the easiest to review so I started there:
https://www.drupal.org/project/views_accordion/issues/3100388
- Read through the change record for the change
- Reviewed the patch and, for Drupal 8, the patch is correct (note that for D9, the info file will need to be updated)
- Tests are failing so checked the note from @katherined about
$defaultTheme
and confirmed that it's fixed in the other issue (see below) - Downloaded the module code
git clone --branch 8.x-1.x https://git.drupalcode.org/project/views_accordion.git
- Downloaded the patch
wget https://www.drupal.org/files/issues/2020-03-21/3100388-3.patch
- Applied the patch
[mac:kristen:views_accordion]$ patch -p1 < 3100388-3.patch
patching file views_accordion.info.yml - Added comment with findings and unassigned issue
https://www.drupal.org/project/views_accordion/issues/3100388#comment-13...
Step 5: Checked back into with the #d9readiness channel
It's a good thing to check in with the relevant Slack channel regularly if you are doing a sprint or contribution day. Fortunately I did because I saw @penyaskito pointed to an earlier message from the module maintainer, @Manuel Garcia, related to the issue I was about to review.
https://app.slack.com/client/T06GX3JTS/CDDD98AMN/thread/CDDD98AMN-158808...
They were worried the patch might break existing installations. The thread had a helpful discussion with @berdir and @penyaskito on how to proceed. This is a great example why the Drupal community is amazing!
Step 6: jQuery UI patch review
Besides the info file, there was a blocker for D9 compatibility due to the use of jQuery so I moved on to reviewing the related patch:
https://www.drupal.org/project/views_accordion/issues/3091388#comment-13...
- Reviewed the change records
- https://www.drupal.org/node/3064015 - "Modules and/or themes depending on jQuery UI should remove it as a dependency and manage their own libraries."
- https://www.drupal.org/node/3067969 - "The jQuery UI asset libraries not in use by Drupal core have been marked deprecated and will be removed from core in Drupal 9." Note: has an explicit example for switching to the jQuery UI Accordion module
- Reviewed the patch against the example in the change record
- Info file is updated with dependency:
jquery_ui_accordion:jquery_ui_accordion
- Reference of
core/jquery.ui.accordion
changed tojquery_ui_accordion/accordion
in libraries file - Fixed failing tests by adding:
protected $defaultTheme = 'stark';
- Also updated composer.json with dependency:
"drupal/jquery_ui_accordion": "^1.0"
- Looks good
- Info file is updated with dependency:
- Downloaded patch
wget https://www.drupal.org/files/issues/2020-03-21/3100388-3.patch
- Applied the patch successfully (note that it was applied on top of the info file patch to see if they were compatible)
[mac:kristen:views_accordion]$ patch -p1 < 3091388-6.patch
patching file composer.json
patching file tests/src/Functional/ViewsAccordionTest.php
patching file tests/src/FunctionalJavascript/ViewsAccordionTest.php
patching file views_accordion.info.yml
Hunk #1 succeeded at 5 with fuzz 1 (offset 1 line).
patching file views_accordion.libraries.yml
- Searched the code for
"jquery.ui.accordion"
after applying the patch and found a reference to it in the documentation - Added comment, marked
"Needs work"
, and unassigned - Next steps needed are to update this patch with minor change and manually test the updated patch and the info file patch together on Drupal <8.7.7, 8.8, and 9 (optionally, an update function could be added for the new module dependency)
Step 7: Review project page
Note that this should have been done before step 4 but I forgot to check until after reviewing the issues I found by manually looking at the issue queue.
Project maintainers can add Drupal 9 information and link to relevant issues as noted by in https://twitter.com/DropIsMoving/status/1130868996771844096. Adding D9 information to the project page will potentially help the previous two issues get worked on faster and avoid duplicate issues.
- Reviewed the views_accordion page for D9 info but nothing was there
- Checked the issue queue to see if a related issue was already created but didn't find anything relevant
https://www.drupal.org/project/issues/views_accordion?text=drupal+9
- Created an issue to add the Drupal 9 info to the project page and tagged it for "Drupal 9 porting day" and "Drupal 9 compatibility"
https://www.drupal.org/project/views_accordion/issues/3131959
Step 8: Install D8 site to check deprecations
For this round, I decided to use simplytest.me to check again for deprecations after adding the jQuery patch above, the jQuery UI Accordion module, and the Upgrade Status module. Note that initially I applied both patches but got an error that I created an issue for: https://www.drupal.org/project/simplytest/issues/3131964
- Go to https://simplytest.me/
- Open
"Advanced options"
- Type
"views_accordion"
for"Enter a project name"
text field - Choose
8.x-1.x
for version - Click
"Add an additional project"
button - Type
"jquery_ui_accordion"
into text field - Click
"Add an additional project"
button again - Type
"upgrade_status"
into text field - Click
"Add a patch"
button - Copy/paste the patch file URL
https://www.drupal.org/files/issues/2020-01-30/3091388-6.patch
- Click
"Launch sandbox"
button - Wait for simplytest.me to finish installing
- Success! You'll get a URL similar to:
https://stm5ea90733d366a-snjvt0qoedy7maoqy3mzycrx6vzbeixv.tugboat.qa/
- Log into site (
admin
/admin
) - Go to Upgrade Status report at
/admin/reports/upgrade-status
- Go to the
CONTRIBUTE PROJECTS
section - Choose
Views Accordion
- Click
"Scan selected"
button - Found 5 warnings
- Click on warnings link to view warnings and really found 3 things
- Class Drupal\Tests\BrowserTestBase not found and could not be autoloaded.
- Class Drupal\FunctionalJavascriptTests\WebDriverTestBase not found and could not be autoloaded.
- Add core_version_requirement: ^8 || ^9 to views_accordion.info.yml to designate that the module is compatible with Drupal 9. See https://drupal.org/node/3070687.
- I assume a and b are due to running via simplytest.me (I looked at other deprecation issues and didn't see anyone "fixing that") and c is handled by the other patch so this should be covered
- Updated Slack channel thread with note about the autoload warnings
Step 9: Go to bed :)
I was hoping to do more poking around but it got late and I got tired. So… this will have to do. I updated this blog post and went to bed. :)
Goodnight!
p.s. I'm zonked so probably made some mistakes... please let me know if you find any.
Attachment | Size |
---|---|
slack_d9readiness_getting_started.png | 190.16 KB |
slack_d9readiness_views_accordion_thread1.png | 44.62 KB |
slack_d9readiness_views_accordion_thread2.png | 164.37 KB |
views_accordion_info_patch.png | 240.82 KB |
views_accordion_info_yml.png | 89.24 KB |
views_accordion_project_page.png | 186.91 KB |
views_accordion_queue.png | 255.84 KB |
views_accordion_simplytestme_one_patch.png | 633.36 KB |
views_accordion_simplytestme_site.png | 125.94 KB |
views_accordion_stats.png | 89.5 KB |
views_accordion_stm_upgrade_status_contributed_projects.png | 242.43 KB |
views_accordion_stm_upgrade_status_views_accordion.png | 305.88 KB |
views_accordion_stm_upgrade_status.png | 244.13 KB |
drupal9_deprecation_status_filters.png | 211.76 KB |
gabor_contribution_weekend_steps.png | 890.78 KB |
drupal_cares_aaron_deutsch.jpeg | 95.26 KB |
- kristen's blog
- 10735 reads
This is a featured content block that has been configured to show blog nodes with terms SEO or Drupal SEO by the author kristen. It shows random list of 20 results in the block and 30 results on the more page.
- Drupal Meta Tags (nodewords) Module for SEO
- Drupal SEO Modules
- Make Drupal SEO Friendly
- Drupal SEO Reviews
- BADCamp Drupal SEO Presentation 2009
- Drupal Nofollow Link Sculpting
- 503 HTTP Status Code when Site Down
- Drupal Node Teaser SEO
- Basic SEO Top 10
- Drupal Pathauto URL Aliases Settings
- Free Google Keyword Research Tool
- HTML Validation: Free HTML Validator Tools
- Fix Duplicate Content with Global Redirect Module
- Drupal Has Multiple h1 Tags
- Drupal Pathauto Module
- Kristen
- Free SEO Tools