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
| Comment | File | Size | Author |
|---|---|---|---|
| phpstan-baseline.neon_.txt | 187 bytes | jonathan1055 |
Issue fork decoupled_pages-3439980
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:
- 8.x-1.x
changes, plain diff MR !7
- 3439980-fix-phpstan-warning
compare
Comments
Comment #4
jonathan1055 commentedThanks 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.
Comment #5
jonathan1055 commentedJust rebased the MR. Same as before, PHPStan now passes but the Nighwatch tests fail. Does it need an argument in the .services.yml ?
Comment #7
jonathan1055 commentedSo, 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
This works now, Nightwatch tests pass and the pipeline is fully green. Ready for review.
Comment #10
fjgarlin commentedYup. 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!