Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #3341238: Upgrade Drupal version to Drupal 9.5 #3312

Merged
merged 17 commits into from
Apr 3, 2023

Conversation

navneet0693
Copy link
Collaborator

@navneet0693 navneet0693 commented Feb 13, 2023

Problem

Currently, Open Social is using Drupal 9.4 ( https://github.com/goalgorilla/open_social/blob/11.7.1/composer.json#L127 )

Drupal 9.4's security support is going to end on June 21, 2023 as per documentation in https://www.drupal.org/about/core/policies/core-release-cycles/schedule#current

The current minor version upgrade of Drupal is https://www.drupal.org/project/drupal/releases/9.5.3.

So, we are upgrading Open Social to Drupal 9.5.3

Release notes of Drupal 9.5: https://www.drupal.org/project/drupal/releases/9.5.0

Solution

  1. Upgrade Drupal core dependencies to latest version of Drupal 9.5
  2. Deprecation of modules and themes which are mentioned Drupal 9.5 release notes will be dealt when Open Social will move to Drupal 10.

Drupal 10 preparation

( taking notes for future Drupal 10 preparation )

Make sure that our PHP support is 8.1

Make sure drupal_social is adjusted for Rector, ECS, and dependencies to use Drupal 10 and PHP 8.1. GitHub - goalgorilla/drupal_social: Open Social Development repository.

Make sure the dev dependencies are updated in GitHub - goalgorilla/open_social_dev: require-dev dependencies for goalgorilla/open_social required to run tests and coding standard checks.

Adopt the change records from https://www.drupal.org/list-changes/drupal/published?keywords_description=&to_branch=10.0.x&version=&created_op=%3E%3D&created%5Bvalue%5D=&created%5Bmin%5D=&created%5Bmax%5D=

Make sure our PHPStan baseline is at a minimum.

Make sure the contributed modules and Open Social code are ready for Drupal 10.

Use Rector and ECS check tools to upgrade the code compatibility.

Make sure our PHPStan, PHPCS, and PHPUnit settings files are updated as well.

Make sure to take of following deprecations:

https://www.drupal.org/node/3223395

https://www.drupal.org/node/3276601

https://www.drupal.org/node/3306232

https://www.drupal.org/node/3272679

https://www.drupal.org/node/3276601

https://www.drupal.org/node/3304314

https://www.drupal.org/node/3259831

https://www.drupal.org/node/3304899

https://www.drupal.org/node/3304481

https://www.drupal.org/node/3310028

https://www.drupal.org/node/3310025

https://www.drupal.org/node/3313997

https://www.drupal.org/node/3319135

Double check https://www.drupal.org/project/drupal/releases/9.5.0 for removals, deprecations and contributed project information.

Use at least following versions:

https://www.drupal.org/project/bootstrap/releases/8.x-3.26

https://www.drupal.org/project/gin/releases/8.x-3.0-rc1

gin_toolbar 8.x-1.0-rc1

Review our Social Base and Social Blue for removal of libraries and core themes.

Issue tracker

https://www.drupal.org/project/social/issues/3341238

Theme issue tracker

N.A

How to test

  • All checks should pass.

Definition of done

Before merge

  • Code/peer review is completed
  • All commit messages are clear and clean. If applicable a rebase was performed
  • All automated tests are green
  • Functional/manual tests of the acceptance criteria are approved
  • All acceptance criteria were met
  • New features or changes to existing features are covered by tests, either unit (preferably) or behat
  • Update path is tested. New hook_updates should respect update order, right naming convention and consider hook_post_update code
  • Module can be safely uninstalled. Update/implement hook_uninstall and make sure that removed configuration or dependencies are removed/uninstalled
  • This pull request has all required labels (team/type/priority)
  • This pull request has a milestone
  • This pull request has an assignee (if applicable)
  • Any front end changes are tested on all major browsers
  • New UI elements, or changes on UI elements are approved by the design team
  • New features, or feature changes are approved by the product owner

After merge

  • Code is tested on all branches that it has been cherry-picked
  • Update hook number might need adjustment, make sure they have the correct order
  • The Drupal.org ticket(s) are updated according to this pull request status

Screenshots

N.A

Release notes

As Drupal 9.4 was reaching end of security in June 21, 2023. We have upgraded Open Social to Drupal 9.5

Change Record

N.A

Translations

N.A

@navneet0693 navneet0693 added status: needs work This pull request needs more work before it's ready for review prio: high type: dependencies Updating a dependency file team: gravitiers labels Feb 13, 2023
@navneet0693 navneet0693 added this to the 11.8.0-alpha1 milestone Feb 13, 2023
@navneet0693 navneet0693 self-assigned this Feb 13, 2023
@mergeable
Copy link

mergeable bot commented Feb 13, 2023

Thanks for contributing towards Open Social! A maintainer from the @goalgorilla/maintainers group might not review all changes from all teams/contributors. Please don't be discouraged if it takes a while. In the meantime, we have some automated checks running and it might be that you will see our comments with some tips or requests to speed up the review process. 😊

@navneet0693 navneet0693 force-pushed the feature/drupal9.5 branch 2 times, most recently from 1f2c78b to dd7c552 Compare February 13, 2023 12:58
@navneet0693 navneet0693 marked this pull request as ready for review February 14, 2023 02:38
@navneet0693 navneet0693 added status: needs review This pull request is waiting for a requested review and removed status: needs work This pull request needs more work before it's ready for review labels Feb 15, 2023
@navneet0693 navneet0693 removed their assignment Feb 15, 2023
@open-social-tugboat
Copy link

Tugboat has finished building the preview for this pull request!

Link:

Dashboard:

5 similar comments
@open-social-tugboat
Copy link

Tugboat has finished building the preview for this pull request!

Link:

Dashboard:

@open-social-tugboat
Copy link

Tugboat has finished building the preview for this pull request!

Link:

Dashboard:

@open-social-tugboat
Copy link

Tugboat has finished building the preview for this pull request!

Link:

Dashboard:

@open-social-tugboat
Copy link

Tugboat has finished building the preview for this pull request!

Link:

Dashboard:

@open-social-tugboat
Copy link

Tugboat has finished building the preview for this pull request!

Link:

Dashboard:

navneet0693 and others added 4 commits March 13, 2023 14:13
Currently, Open Social is using Drupal 9.4 ( https://github.com/goalgorilla/open_social/blob/11.7.1/composer.json#L127 )

Drupal 9.4's security support is going to end on June 21, 2023 as per documentation in https://www.drupal.org/about/core/policies/core-release-cycles/schedule#current

The current minor version upgrade of Drupal is https://www.drupal.org/project/drupal/releases/9.5.3.

So, we are upgrading Open Social to Drupal 9.5.3
Rector:

vendor/bin/rector process html/profiles/contrib/social --dry-run
 3285/3285 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
3 files with changes
====================

1) html/profiles/contrib/social/modules/custom/entity_access_by_field/tests/src/Kernel/EntityAccessNodeAccessTestBase.php:15

    ---------- begin diff ----------
@@ @@
    *
    * @var array
    */
-  public static $modules = ['group', 'options', 'entity', 'variationcache', 'node', 'gnode', 'social_group', 'flag', 'address', 'image', 'file', 'entity_access_by_field'];
+  protected static $modules = ['group', 'options', 'entity', 'variationcache', 'node', 'gnode', 'social_group', 'flag', 'address', 'image', 'file', 'entity_access_by_field'];

   /**
    * The entity type manager service.
    ----------- end diff -----------

Applied rules:
 * ProtectedStaticModulesPropertyRector (https://www.drupal.org/node/2909426)

2) html/profiles/contrib/social/modules/social_features/social_embed/tests/src/Kernel/SocialUserEmbedTest.php:84

    ---------- begin diff ----------
@@ @@

       // All requests should be ok except last one as it will be $retries + 1.
       $status_code = ($i === $retries) ? Response::HTTP_FORBIDDEN : Response::HTTP_OK;
-      $this->assertEqual($response->getStatusCode(), $status_code);
+      $this->assertEquals($response->getStatusCode(), $status_code);
     }
   }

@@ @@

       // All requests should be ok except last one as it will be $retries + 1.
       $status_code = ($i === $retries) ? Response::HTTP_FORBIDDEN : Response::HTTP_OK;
-      $this->assertEqual($response->getStatusCode(), $status_code);
+      $this->assertEquals($response->getStatusCode(), $status_code);
     }
   }
    ----------- end diff -----------

Applied rules:
 * AssertEqualRector
 * ProtectedStaticModulesPropertyRector (https://www.drupal.org/node/2909426)

3) html/profiles/contrib/social/tests/behat/features/bootstrap/FeatureContext.php:722

    ---------- begin diff ----------
@@ @@
       /** @var \Drupal\file\Entity\File $file */
       $file = \Drupal::entityTypeManager()->getStorage('file')->load($fid);
       $url = $file->createFileUrl();
-      $page = file_url_transform_relative($url);
+      $page = \Drupal::service('file_url_generator')->transformRelative($url);
       $this->visitPath($page);

       if ($expected_access == 0) {
    ----------- end diff -----------

Applied rules:
 * FileUrlTransformRelativeRector
 * ProtectedStaticModulesPropertyRector (https://www.drupal.org/node/2909426)

 [OK] 3 files would have changed (dry-run) by Rector

---------------------------------------------------------------------------------------------

PHPStan:

vendor/bin/phpstan analyse -c html/profiles/contrib/social/phpstan.neon --memory-limit=-1 html/profiles/contrib/social

 ! [NOTE] The Xdebug PHP extension is active, but "--xdebug" is not used. This may slow down performance and the process
 !        will not halt at breakpoints.

 1063/1063 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ ---------------------------------------------------------
  Line   modules/custom/activity_creator/activity_creator.module
 ------ ---------------------------------------------------------
  404    Cannot access property $data on object|true.
 ------ ---------------------------------------------------------

 ------ ------------------------------------------------------
  Line   modules/custom/download_count/download_count.module
 ------ ------------------------------------------------------
  76     Cannot access offset 'type' on non-empty-array|true.
  77     Cannot access offset 'id' on non-empty-array|true.
 ------ ------------------------------------------------------

 ------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  Line   modules/social_features/social_embed/tests/src/Kernel/SocialUserEmbedTest.php
 ------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
         Ignored error pattern #^Call to deprecated method assertEqual\(\) of class Drupal\\KernelTests\\KernelTestBase\:
         in drupal\:8\.0\.0 and is removed from drupal\:10\.0\.0\. Use
           \$this\->assertEquals\(\) instead\.$# in path
         html/profiles/contrib/social/modules/social_features/social_embed/tests/src/Kernel/SocialUserEmbedTest.php was not matched in reported
         errors.
 ------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 [ERROR] Found 4 errors
@tbsiqueira
Copy link
Contributor

Other dependent PRs are already merged, we can merge this as soon as we have all green checks!

@tbsiqueira tbsiqueira modified the milestones: 11.8.0, 11.9.0-alpha1 Mar 14, 2023
@robertragas robertragas merged commit 945dc1c into main Apr 3, 2023
@robertragas robertragas deleted the feature/drupal9.5 branch April 3, 2023 08:11
@tbsiqueira tbsiqueira restored the feature/drupal9.5 branch April 3, 2023 08:50
@tbsiqueira
Copy link
Contributor

We reverted this PR and we are going to recreate it with the latest updated code from main

#3368

tbsiqueira pushed a commit that referenced this pull request Apr 3, 2023
Issue #3341238: Upgrade Drupal version to Drupal 9.5
tbsiqueira pushed a commit that referenced this pull request Apr 3, 2023
This is the merge commit, that is being reapplied to main after the original pr
had to be reverted

see: #3312
see: #3368
tbsiqueira pushed a commit that referenced this pull request Apr 4, 2023
This is the merge commit, that is being reapplied to main after the original pr
had to be reverted

see: #3312
see: #3368
zanvidmar pushed a commit that referenced this pull request Apr 7, 2023
This is the merge commit, that is being reapplied to main after the original pr
had to be reverted

see: #3312
see: #3368
@Kingdutch Kingdutch added type: repository Improvements to working with the repository (e.g. templates, README files, or workflows) and removed internal labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prio: high status: needs review This pull request is waiting for a requested review type: dependencies Updating a dependency file type: repository Improvements to working with the repository (e.g. templates, README files, or workflows)
Development

Successfully merging this pull request may close these issues.

6 participants