The 1.1.x pipeline is red due to pre-existing issues unrelated to any single feature. Splitting them out so feature MRs stay green and reviewable.

PHPCS
- ai_search_block.module — missing @file docblock (it sits below the use statements; must come first). phpcbf auto-fixes.
- modules/ai_search_block_log/ai_search_block_log.module:11 — unused use Drupal\Core\Render\Element;. phpcbf auto-fixes.

PHPStan (level 5)
- modules/ai_search_block_log_tag/src/Hook/AiSearchBlockLogTagHooks.php:87,91 — $entity->original / $entity->get() on a bare EntityInterface. $entity->original is also deprecated in Drupal 11.2 (removed in 12.0). Fix: narrow with instanceof ContentEntityInterface and use $entity->getOriginal().

PHPUnit (CI)
- Job fails with Unknown option "--verbose" — PHPUnit 11 removed the flag, so tests never run. Drop --verbose from the CI config / update the GitLab template ref.

Done when: phpcs, phpstan, and phpunit all pass green on 1.1.x.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

nikro created an issue. See original summary.

nikro’s picture

Version: 1.0.x-dev » 1.1.x-dev

nikro’s picture

Assigned: nikro » abhisekmazumdar
Status: Active » Needs review

Setting for needs review:

Merged results pipeline #887056 passed

Assigning to Abhisek, cuuuz as he rightfully pointed out that these changes need their own issue ^_^

abhisekmazumdar’s picture

Reviewed MR !45 against all 4 warning categories. I have also checked out the branch and re-run the checks locally in DDEV.

Per-category check

  • PHPCS @file docblock: now sits before the use statements in ai_search_block.module. Correct.
  • Unused import: use Drupal\Core\Render\Element; is gone from ai_search_block_log.module. I grepped the file for Element after the removal, nothing left, so it's safe.
  • PHPStan level 5 in AiSearchBlockLogTagHooks.php: the instanceof ContentEntityInterface narrowing fixes the ->get() calls. The version_compare() gate between getOriginal() (11.2+) and $entity->original is needed, not optional, since the module still supports core ^10.2 and getOriginal() doesn't exist before 11.2. Behavior is unchanged: this is a content entity, so $original instanceof ContentEntityInterface and the old !== NULL check are equivalent here.
  • PHPUnit --verbose: _PHPUNIT_EXTRA is emptied in .gitlab-ci.yml. PHPUnit 11 dropped the flag, so removing it is the right fix rather than pinning a template ref.

Local check (DDEV, PHP 8.4)

  • PHPCS (Drupal + DrupalPractice): 0 errors. Four pre-existing warnings are still there (unused $current_month_start in AiSearchBlockLogController.php, a permission suggestion in ai_search_block_log.routing.yml), out of scope for this issue.
  • PHPStan level 5: no errors, 31 files.
  • No PHPUnit tests exist on this branch yet. AiSearchBlockHelperGuardrailTest landed in a later commit on 1.1.x, and the merged-results pipeline #887056 already ran it green.

Diff is 4 files, nothing outside the issue scope.

I'm marking this as RTBC.

abhisekmazumdar’s picture

Status: Needs review » Reviewed & tested by the community
abhisekmazumdar’s picture

Assigned: abhisekmazumdar » Unassigned
nikro’s picture

Status: Reviewed & tested by the community » Fixed

Merged into 1.1.x.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • nikro committed 2e464bcd on 1.1.x
    task: #3609906 Fix pre-existing PHPCS/PHPStan violations and the PHPUnit...