Add VCS repository only for private repos #13
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When looking at ezsystems/ezplatform-page-builder#757 (a build with 20 dependencies) some issues became visible:
Composer is making a lot of GitHub API calls, which can even go over the API limit
It takes a lot of time to download 20 dependencies.
This PR introduces a new property in the dependencies.json schema: privateRepository.
Example:
For public repositories we don't need to add the repository to Composer Repositories, which results in less GitHub API calls:
For private repositories (where VCS is needed) we set the COMPOSER_NO_INTERACTION variable (https://getcomposer.org/doc/03-cli.md#composer-no-interaction) so that Composer fallbacks to git clone if API limits are exceeded:
To speed things up I've also changed how the packages are installed:
instead of multiple composer require calls we add the packages with --no-install and then download them in one composer install call.