Install contrib module dependencies specified in info.yml file (when no composer.json file exists)
Migrated issue
Reported by: abramm
Problem/Motivation
The GitLab CI template currently does not install contrib module dependencies specified in .info.yml file if the composer.json file is not present.
This may affect phpstan and phpunit steps causing failures.
The composer.json file is currently not mandatory for contrib modules and is automatically generated for modules releases on Drupal.org. Many maintainers relies on this behavior to avoid maintaining the separate composer.json file.
As a workaround, the module maintainer may either add a composer.json file or add a section to their .gitlab-ci.yml file to manually install dependencies in composer/after_script, e.g.:
composer:
after_script:
- composer require 'drupal/other_custom_module'
However, it would be great if this would be handled automatically.
Steps to reproduce
1. Run a pipeline for a contrib module having dependency on another contrib module.
2. Check the composer job log.
Expected: there are log records about dependencies being installed.
Actual: dependencies from .info.yml file aren't installed.
Proposed resolution
Update the template to handle automatic installation of contrib module dependencies.
Related issue: Issue #2551703
Related issue: Issue #1398772
Related issue: Issue #3250765