Code Studio Warning in Validate Code stage of the pipeline job.
Date Published: July 30, 2022
Issue
Warning that occurred in the earlier Validate Code stage of the pipeline job. With the following message in the log:
You have committed files or directories that Acquia recommends gitignoring.
Please do not commit any of the following files or directories:
vendor, node_modules, docroot/composer.json, docroot/libraries, docroot/core, docroot/modules/contrib, docroot/themes/contrib, docroot/profiles/contrib
A lot of these directories are committed in your codebase currently when they should be gitignored so composer can add them during the build for you.
Resolution
To resolve this warning you need to add the recommended folder into your root .gitignore file. We recommend to use the following sample: https://github.com/acquia/drupal-recommended-project/blob/master/.gitignore Following the steps to resolve this issue:
Remove the folders that you are seeing. Ex:
rm -rf vendor docroot/module/contrib
Add and commit your change via git
Modify the .gitignore base on the sample: https://github.com/acquia/drupal-recommended-project/blob/master/.gitignore
Run `composer install` and add/commit your changes.