Address code quality issues flagged on the core inclusion MR

Created on 12 April 2024, 8 months ago
Updated 29 April 2024, 8 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
    8 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
    8 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
    8 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
    8 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 8 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
    8 months ago
    Total: 47s
    #163380
  • Pipeline finished with Skipped
    8 months ago
    #163381
  • Pipeline finished with Failed
    5 months ago
    Total: 51s
    #244169
  • Pipeline finished with Failed
    5 months ago
    Total: 51s
    #244171
  • Pipeline finished with Failed
    5 months ago
    Total: 50s
    #244222
  • Pipeline finished with Failed
    5 months ago
    #248049
  • Pipeline finished with Success
    4 months ago
    Total: 299s
    #272295
  • Pipeline finished with Success
    4 months ago
    Total: 750s
    #272305
  • Pipeline finished with Failed
    2 months ago
    Total: 347s
    #311336
  • Pipeline finished with Success
    2 months ago
    #311371
  • Pipeline finished with Canceled
    about 2 months ago
    #330841
  • Pipeline finished with Failed
    about 2 months ago
    #330842
  • Pipeline finished with Canceled
    about 2 months ago
    #330850
  • Pipeline finished with Canceled
    about 2 months ago
    #330852
  • Pipeline finished with Failed
    about 2 months ago
    #330854
  • Pipeline finished with Canceled
    about 2 months ago
    #330856
  • Pipeline finished with Canceled
    about 2 months ago
    #330857
  • Pipeline finished with Failed
    about 2 months ago
    #330859
  • Pipeline finished with Success
    about 2 months ago
    #330865
  • Pipeline finished with Success
    about 2 months ago
    #330873
  • Pipeline finished with Failed
    25 days ago
    Total: 1958s
    #352120
  • Pipeline finished with Skipped
    25 days ago
    #352154
Production build 0.71.5 2024