Address code quality issues flagged on the core inclusion MR

Created on 12 April 2024, 3 months ago
Updated 29 April 2024, about 2 months ago

The core pipeline is more strict than our contrib pipeline. Upon opening the MR to core, a number of code quality issues were flagged;

https://git.drupalcode.org/issue/drupal-3438895/-/pipelines/144932

The task here is to address the more strict standards by applying the fixes to the contrib module space, and then porting those changes over to the core inclusion MR.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇦Canada m4olivei Grimsby, ON

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @m4olivei
  • First commit to issue fork.
  • Pipeline finished with Running
    3 months ago
    #144986
  • 🇪🇸Spain plopesc Valladolid

    Worked on issues related to CSpell, PHPCS & PHPStan.

    Some notes:

    We should add to the core MR modules/navigation/assets to .cspell.json & .eslintignore ignore list

    We should add exceptions for CategorizingPluginManagerTrait in .phpstan-baseline.php file

    $ignoreErrors[] = [
    	'message' => '#^Call to method getDefinitions\\(\\) on an unknown class Drupal\\\\Core\\\\Plugin\\\\CategorizingPluginManagerTrait\\.$#',
    	'count' => 1,
    	'path' => __DIR__ . '/lib/Drupal/Navigation/NavigationBlockManager.php',
    ];
    $ignoreErrors[] = [
    	'message' => '#^Call to method getSortedDefinitions\\(\\) on an unknown class Drupal\\\\Core\\\\Plugin\\\\CategorizingPluginManagerTrait\\.$#',
    	'count' => 1,
    	'path' => __DIR__ . '/lib/Drupal/Navigation/NavigationBlockManager.php',
    ];
  • Pipeline finished with Failed
    2 months ago
    Total: 258s
    #145126
  • 🇨🇦Canada m4olivei Grimsby, ON

    I added OPT_IN_TEST_NEXT_MAJOR: '1' to the Gitlab CI configuration.

    With that, the test suite runs against Drupal 11.x core and the error detailed in #4 no longer shows up. However, another error appears:

    There was 1 failure:
    1) Drupal\Tests\navigation\Functional\ShortcutsNavigationBlockTest::testNavigationBlock
    Failed asserting that two arrays are identical.

    This is checking cache tgs on the page, and there is a new unexpected cache tag returning. However we do have a comment there noting that we were anticipating this.

    I think the contrib module needs to remain usable on the current release of Drupal (both for developers working on it and test run). I think for these test fixes, it's a case of leaving in the contrib module what satisfies the test runs on the current major, and addressing issues in the next major as a change required in 📌 [No commit] Prepare for core inclusion Active , in the MR meant to stand in as a patch for the sync script to apply.

    I'll wire that up, and I'll push an update to the core inclusion PR.

  • Pipeline finished with Success
    2 months ago
    Total: 232s
    #145142
  • 🇨🇦Canada m4olivei Grimsby, ON

    I'm going to merge what we have here so far so that it can make its way to the core inclusion MR.

    The things that are warning at the moment in our contrib CI is eslint, which is a known issue. Also phpstan and phpunit for the next major, which is expected per the conversation here, and I think we can deal with for now.

    I'll leave this issue open in case there is more to address after the core inclusion MR is updated with the latest progress from here and from 📌 [No commit] Prepare for core inclusion Active .

  • Pipeline finished with Skipped
    2 months ago
    #145228
  • 🇨🇦Canada m4olivei Grimsby, ON

    Nearly there on the latest run!

    https://git.drupalcode.org/issue/drupal-3438895/-/pipelines/145241

    Just the "Validatable config" is showing a warning, but it's on to the test runs at time of writing 🤞. I'm out of race track for now though.

  • 🇪🇸Spain plopesc Valladolid

    I think the contrib module needs to remain usable on the current release of Drupal (both for developers working on it and test run). I think for these test fixes, it's a case of leaving in the contrib module what satisfies the test runs on the current major, and addressing issues in the next major as a change required in #3439747: [No commit] Prepare for core inclusion, in the MR meant to stand in as a patch for the sync script to apply.

    Good point!

  • Status changed to Fixed 2 months ago
  • 🇨🇦Canada m4olivei Grimsby, ON

    We're green now on the core MR!

    There is one warning as previously mentioned, but no errors. That warning is out of our control for the moment.

    I'm going to call this one done.

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Pipeline finished with Canceled
    about 2 months ago
    Total: 47s
    #163380
  • Pipeline finished with Skipped
    about 2 months ago
    #163381
Production build 0.69.0 2024