Problem/Motivation

There is one PHPStan warning for this project, so the pipelines end with an amber warning not green pass. As this project is also used as downstream testing for gitlab_templates merge requests, it would help if the pipeline could end green. Then any amber warning would immediately indicate that something it wrong in the MR being tested. Currently, the amber warning always needs double checking to make sure it is just the same phpstan problem.

There is only one warning

------ ---------------------------------------------------------------------- 
  Line   src/Routing/DatasetRouteEnhancer.php                                  
 ------ ---------------------------------------------------------------------- 
  39     \Drupal calls should be avoided in classes, use dependency injection  
         instead                                                               
 ------ ---------------------------------------------------------------------- 
 [ERROR] Found 1 error               

https://git.drupalcode.org/project/decoupled_pages/-/jobs/1291628

Proposed resolution

Either fix the problem or add it to a phpstan.baseline - downloaded from the job and attached

CommentFileSizeAuthor
phpstan-baseline.neon_.txt187 bytesjonathan1055
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

jonathan1055 created an issue. See original summary.

silvi.addweb made their first commit to this issue’s fork.

jonathan1055’s picture

Status: Active » Needs work

Thanks for starting work on this. The change seem to remove the PHPStan warning, compare the updated job with scheduled pipeline job

However, the nightwatch tests now fail, whereas on the scheduled pipepline they pass.

jonathan1055’s picture

Just rebased the MR. Same as before, PHPStan now passes but the Nighwatch tests fail. Does it need an argument in the .services.yml ?

jonathan1055 changed the visibility of the branch 3439980-fix-phpstan-warning to hidden.

jonathan1055’s picture

Status: Needs work » Needs review

So, it did need the argument in .services.yml and because there is no short name/ alias defined in the core services file, it has to be the full class name

    arguments:
      - '@Drupal\Component\DependencyInjection\ReverseContainer'

This works now, Nightwatch tests pass and the pipeline is fully green. Ready for review.

fjgarlin made their first commit to this issue’s fork.

fjgarlin’s picture

Status: Needs review » Fixed

Yup. Seems to be defined that way in core: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/core.services...

Given that this project is part of the "gitlab_templates" downstream pipelines and that we want to keep the full pipeline green to avoid false errors upstream AND that the change is small and looks good, I'll merge this.

Thanks!

Status: Fixed » Closed (fixed)

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