Jobs fail when the project directory structure contains same folder as _WEB_ROOT
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3503613. --> Reported by: [damian.skiba](https://www.drupal.org/user/2799077) Related to !348 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>When a project includes a <code>composer.json</code> file with dependencies (e.g., <code>drupal/core</code> or other modules), tools like PHPCS and PHPStan perform checks and validations on these dependencies as well.<br>For example:</p> <ul> <li><strong>PHPCS checks validation in dependencies:</strong> <a href="https://git.drupalcode.org/project/droopler/-/jobs/4201053">Log example</a>.</li> <li><strong>PHPStan creates symbolic link loops:</strong> <a href="https://git.drupalcode.org/project/droopler/-/jobs/4201054"> Log example</a>.</li> </ul> <p>This issue seems related to <a href="https://www.drupal.org/project/gitlab_templates/issues/3502879">this task on drupal.org</a>, as these problems have persisted for two days.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>1. Use the following <code>composer.json</code> configuration:</p> <pre>&nbsp; "require": {<br>&nbsp;&nbsp;&nbsp; "php": "&gt;=8.1",<br>&nbsp;&nbsp;&nbsp; "bower-asset/colorbox": "^1.6",<br>&nbsp;&nbsp;&nbsp; "bower-asset/masonry": "^4.2",<br>&nbsp;&nbsp;&nbsp; "composer/installers": "^2.2",<br>&nbsp;&nbsp;&nbsp; "cweagans/composer-patches": "^1.6",<br>&nbsp;&nbsp;&nbsp; "drupal/admin_toolbar": "^3.0",<br>&nbsp;&nbsp;&nbsp; "drupal/ala": "^2.5",<br>&nbsp;&nbsp;&nbsp; "drupal/better_exposed_filters": "^7.0",<br>&nbsp;&nbsp;&nbsp; "drupal/block_field": "^1.0@RC",<br>&nbsp;&nbsp;&nbsp; "drupal/bootstrap_layout_builder": "^2.1",<br>&nbsp;&nbsp;&nbsp; "drupal/checklistapi": "^2.0",<br>&nbsp;&nbsp;&nbsp; "drupal/coffee": "^2.0",<br>&nbsp;&nbsp;&nbsp; "drupal/color_field": "^3.0",<br>&nbsp;&nbsp;&nbsp; "drupal/colorbox": "^2.0",<br>&nbsp;&nbsp;&nbsp; "drupal/components": "^3.0",<br>&nbsp;&nbsp;&nbsp; "drupal/conditional_fields": "^4.0@alpha",<br>&nbsp;&nbsp;&nbsp; "drupal/config_update": "2.0.x-dev@dev",<br>&nbsp;&nbsp;&nbsp; "drupal/contact_formatter": "^2.0",<br>&nbsp;&nbsp;&nbsp; "drupal/core-composer-scaffold": "^10.0",<br>&nbsp;&nbsp;&nbsp; "drupal/core-recommended": "^10.0",<br>&nbsp;&nbsp;&nbsp; "drupal/dashboard": "^2.0",<br>&nbsp;&nbsp;&nbsp; "drupal/default_content": "^2.0@alpha",<br>&nbsp;&nbsp;&nbsp; "drupal/emulsify_twig": "^5.0",<br>&nbsp;&nbsp;&nbsp; "drupal/entity_reference_display": "^2.0",<br>&nbsp;&nbsp;&nbsp; "drupal/entity_reference_revisions": "^1.3",<br>&nbsp;&nbsp;&nbsp; "drupal/facets": "^2.0",<br>&nbsp;&nbsp;&nbsp; "drupal/field_group": "^3.0",<br>&nbsp;&nbsp;&nbsp; "drupal/field_validation": "^1.1",<br>&nbsp;&nbsp;&nbsp; "drupal/frontend_editing": "1.7.3",<br>&nbsp;&nbsp;&nbsp; "drupal/gin": "^4.0",<br>&nbsp;&nbsp;&nbsp; "drupal/gin_toolbar": "^2.0",<br>&nbsp;&nbsp;&nbsp; "drupal/google_analytics": "^4.0",<br>&nbsp;&nbsp;&nbsp; "drupal/google_tag": "^2.0",<br>&nbsp;&nbsp;&nbsp; "drupal/link_attributes": "^1.1 || ^2.1",<br>&nbsp;&nbsp;&nbsp; "drupal/menu_admin_per_menu": "^1.6",<br>&nbsp;&nbsp;&nbsp; "drupal/metatag": "^1.2 || ^2.0",<br>&nbsp;&nbsp;&nbsp; "drupal/paragraphs": "^1.1",<br>&nbsp;&nbsp;&nbsp; "drupal/pathauto": "^1.0",<br>&nbsp;&nbsp;&nbsp; "drupal/project_browser": "^1.0@beta",<br>&nbsp;&nbsp;&nbsp; "drupal/radix": "^6.0",<br>&nbsp;&nbsp;&nbsp; "drupal/redirect": "^1.0-beta1",<br>&nbsp;&nbsp;&nbsp; "drupal/redis": "^1.7",<br>&nbsp;&nbsp;&nbsp; "drupal/search_api": "^1.29",<br>&nbsp;&nbsp;&nbsp; "drupal/simple_sitemap": "^4.1",<br>&nbsp;&nbsp;&nbsp; "drupal/smtp": "^1.0@beta",<br>&nbsp;&nbsp;&nbsp; "drupal/svg_image": "^3.0",<br>&nbsp;&nbsp;&nbsp; "drupal/tvi": "2.0.x-dev@dev",<br>&nbsp;&nbsp;&nbsp; "drupal/twig_tweak": "^3.4",<br>&nbsp;&nbsp;&nbsp; "drupal/webform": "^6.2",<br>&nbsp;&nbsp;&nbsp; "drush/drush": "^13",<br>&nbsp;&nbsp;&nbsp; "npm-asset/countup": "^1.9",<br>&nbsp;&nbsp;&nbsp; "npm-asset/in-viewport": "^3.6",<br>&nbsp;&nbsp;&nbsp; "npm-asset/jquery-ui-touch-punch": "^0.2",<br>&nbsp;&nbsp;&nbsp; "npm-asset/select2": "^4.0.4",<br>&nbsp;&nbsp;&nbsp; "npm-asset/slick-carousel": "^1.8",<br>&nbsp;&nbsp;&nbsp; "oomphinc/composer-installers-extender": "^2.0"<br>&nbsp; },</pre><p> 2. Run PHPCS and PHPStan checks</p> > Related issue: [Issue #3497525](https://www.drupal.org/node/3497525) > Related issue: [Issue #3503626](https://www.drupal.org/node/3503626)
issue