CI: use a snapshot of core's phpcs rules as changes in Drupal core will break MRs with limited benefit to module development

Created on 19 July 2024, 5 months ago
Updated 6 August 2024, 5 months ago

Overview

I was going create another issue like πŸ“Œ CI: phpcs job failing due to upstream changes in Drupal core: unused variables in catch statements now disallowed Fixed because of the core issue πŸ“Œ Fix 'Drupal.Commenting.InlineComment.NotCapital' coding standard Fixed but then realized that we could just continue to make these issues with little benefit to our module.

We are not going to go into anytime soon. If we continue the current practice everybody who is working on the project will have to make sure that they are developing inside a core clone and that the core clone has been pulled recently.

When you see a phpcs error you have to figure out if it is new code you committed to the MR or if it is new change in core.

Proposed resolution

  1. copy core/php.xml.dist to core.php.xml.dist
  2. This file will be used for our phpcs job
  3. add a new phpcs-rules-match-drupal-11 job to error of core.php.xml.dist does not match core
  4. allow this new rule to fail
  5. In the future when developers see this error they can open a new issue to copy the latest core version in and fix any problems we might have

I think until we do the Drupalcon Barcelona demo we should not care too much about keeping up with the core rules but we can if we want to. but this way at least in progress MR's will have to deal with keeping up with core

Pipelines for review

You can see the shows a new warning that our core.phpcs.xml.dist file is out of date but phpcs job passes. https://git.drupalcode.org/project/experience_builder/-/pipelines/231385

I also ran pipeline with were I copied the most recent core/php.xml.dist. This passed the new job to check to see if the phpcs was up to date but failed the phcs job because we are not up to date with all the rules. https://git.drupalcode.org/project/experience_builder/-/pipelines/231381

Ran pipeline with a phpcs error where we have an unused $exception var to show πŸ“Œ CI: phpcs job failing due to upstream changes in Drupal core: unused variables in catch statements now disallowed Fixed is still caught

πŸ› Bug report
Status

Fixed

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States tedbow Ithaca, NY, USA

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024