[PLAN] Project update bot: road to Drupal 11
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3371547. --> Reported by: [bbrala](https://www.drupal.org/user/3366066) >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>There was a session on this subject in DrupalCon Pittsburg. </p> <p>Recorded video: <a href="https://www.youtube.com/watch?v=i5qheD6NcDY">YouTube - Project update bot - The road to Drupal 11: Pittsburgh 2023</a><br> Slides:<br> <a href="https://www.swis.nl/system/files/inline/Project%20update%20bot%20-%20Road%20to%20Drupal%2011%20-%20share.pptx">Project update bot - Road to Drupal 11 (pptx)</a><br> <a href="https://www.swis.nl/system/files/inline/Project%20update%20bot%20-%20Road%20to%20Drupal%2011%20-%20share.pdf">Project update bot - Road to Drupal 11 (pdf)</a></p> <p>There i asses that the road to Drupal 10 was a hard one:</p> <ol> <li>It has been <strong>a rough ride</strong> for contrib and tooling maintainers alike</li> <li>Breaking <strong>backwards compatibility</strong> in patches is a bad idea&trade;</li> <li>We should <strong>start earlier</strong> helping maintainers</li> </ol> <p>In order to make Drupal 11 even easier to upgrade to we need a few things.</p> <ol> <li>Fully utilize Gitlab</li> <li>Track deprecations better</li> <li>Backwards compatible fixes</li> </ol> <p>This issue is here to track progress on nextleveling the processes surrounding project analysis and the update bot.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>There are 3 themes we need to address.</p> <h2>Utilizing Gitlab</h2> <dl> <dt>&#9745; Move the project update bot to Gitlab</dt> <dd> <ol> <li><span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/project_analysis/-/work_items/3365648" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/project_analysis/-/work_items/3365648</a></span></li> <li><span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/project_analysis/issues/3380618" title="Status: Closed (fixed)">#3380618: Run updatebot on GitLab</a></span><del>Run updatebot on Gitlab in a seperate step. Split the job in multple parrallel jobs, also make sure they need manual "execute" so we can first run on a set of test projects, then run a small batch, after that the whole set.</del> <p>The bot code in this repo is stable, been testing posting updates and there are no real weird things. This work can start. </p></li> </ol> </dd> <dt>Investigate: Utilize Gitlab templates to enable opt-in to frequent updates</dt> <dd> <ol> <li>When the whole workflow if moved to git, we might be able to supply contrib with a job that runs updatebot on their project only.</li> </ol> </dd> <dt>Investigate: Use merge requests instead of patches</dt> <dd> <ol> <li><span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/project_analysis/-/work_items/3286278" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/project_analysis/-/work_items/3286278</a></span> <del>There might be merrit in using merge requests instead of patches. We kinda need gitlab issues then, or perhaps some MR automation as part of the issue creation process. Although perhaps using <a href="https://docs.gitlab.com/ee/user/project/push_options.html">push options</a> could perhaps be a way to simplify the workflow. <p>Personal access tokens have just been enabled, this means we can use the API to create MR's. An option would be to; use the bot to click the create mr/issue branch button. Then use the git to push to that branch. MR can be opens through the API (or GitLab cli tool).</p></del></li> <p></p></ol> </dd><dt>Use Gitlab issues when available</dt> <dd> <ol> <li>The migration to gitlab issues will change a lot in the bot part of the code.</li> </ol> </dd> </dl> <h2>Track deprecations</h2> <dl> <dt>Track deprecations better</dt> <dd> <ol> <li>We want to track deprecations better. Currectly there is a repository by mglaman here: <a href="https://github.com/mglaman/drupal-change-record-triage">github mglaman/drupal-change-record-triage</a> which created issues and enables tracking of change records. We could use help to judge and label those issues. </li> <li>Eventually we might want to have some sort of link to issues in change records that track the automation issues.</li> </ol> </dd> <h2>Backwards compatible fixes</h2> <p>In order to allow for patched during the drupal 10 lifecycle and modules to support Drupal 11 without breaking.</p> <dl> <dt>Patches should be backwards compatible</dt> <dd> <ol> <li>Rector can do this, but we need to add support for BC fixes to Drupal Rector <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/rector/issues/3350886" title="Status: Closed (fixed)">#3350886: Add backward compatibility to Rector rules</a></span></li> <li>&#9745; <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/drupal/issues/3371619" title="Status: Closed (fixed)">#3371619: Implement utility method for invoking backward compatible code</a></span> a stable interface to supply Generate BC-compatible and breaking patches.</li> <li>Drupal PHPStan needs to understand BC code. Tracked: <a href="https://github.com/mglaman/phpstan-drupal/issues/461">mglaman/phpstan-drupal/issues/461</a> and <a href="https://github.com/phpstan/phpstan-deprecation-rules/issues/73">phpstan/phpstan-deprecation-rules/issues/73</a>. Unblocked in PHPStan 1.10 since 05-08-2023. <strong>Until this is solved we can first implement this with a <code>@phpstan-ignore</code> tag in the patches. There is a proposed solution here: <a href="https://github.com/mglaman/phpstan-drupal/pull/659">https://github.com/mglaman/phpstan-drupal/pull/659</a> which would just stop phpstan from parsing into the deprecation helper class. It has some drawbacks, since it stops checking the code in there also.</strong></li> <li>&#9745; <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/rector/issues/3384046" title="Status: Closed (fixed)">#3384046: Create a Drupal 10.1 rule</a></span> Write a first D10 rule in Drupal Rector</li> <li>Then start writing the backlog of rules based on <a href="https://github.com/mglaman/drupal-change-record-triage">github mglaman/drupal-change-record-triage</a> there is also d9 deprecations missing we should probably add.</li> </ol> </dd> <dl> <dt>Start running analysis against drupal 10 compatible modules<br> <dt> </dt></dt><dd> <ol> <li>Run on default images to enabled D10 install <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/project_analysis/-/work_items/3335335" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/project_analysis/-/work_items/3335335</a></span></li> <li>Create a Drupal 10 -&gt; 11 branch for project analysis <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-7"><a href="https://www.drupal.org/project/project_analysis/issues/3397247" title="Status: Closed (fixed)">#3397247: Create a Drupal 10 -&gt; 11 branch for project analysis</a></span></li> </ol> </dd> <h3 id="summary-remaining-tasks">Remaining tasks</h3> <ol> <li>Create relevant issues</li> <li>Update IS when issues are created</li> <li>Flesh out steps needed</li> </ol> <h3 id="summary-ui-changes">User interface changes</h3> <p>n.a.</p> <h3 id="summary-api-changes">API changes</h3> <p>n.a.</p> <h3 id="summary-data-model-changes">Data model changes</h3> <p>n.a.</p> </dl></dl></dl> > Related issue: [Issue #3365648](https://www.drupal.org/node/3365648) > Related issue: [Issue #3371619](https://www.drupal.org/node/3371619) > Related issue: [Issue #3350886](https://www.drupal.org/node/3350886) > Related issue: [Issue #3384046](https://www.drupal.org/node/3384046) > Related issue: [Issue #3286278](https://www.drupal.org/node/3286278) > Related issue: [Issue #3380618](https://www.drupal.org/node/3380618)
issue