fxpio / composer-asset-plugin

NPM/Bower Dependency Manager for Composer
MIT License
893 stars 156 forks source link

Incomplete installations on Travis #168

Closed mrclay closed 8 years ago

mrclay commented 8 years ago

We're installing on Travis-CI and notice that sometimes (probably rate limiting) assets are reported as installed (https://travis-ci.org/Elgg/Elgg/jobs/92918942#L261) but don't contain the build resources (https://travis-ci.org/Elgg/Elgg/jobs/92918942#L606 shows dist/jquery.js doesn't exist).

What can we do about this? If all files aren't installed, shouldn't composer report it as a failure?

francoispluchino commented 8 years ago

Because, you don't install the stable version of jquery. In dev, the dist folder doesn't exist. And this plugin downloads only the source.

mrclay commented 8 years ago

Our composer.json does have "prefer-stable": true. Is there really no way to use the "^2.1.4" syntax?

mrclay commented 8 years ago

Or does resolving that to a particular tag cost a bunch of GitHub API requests...

francoispluchino commented 8 years ago

I just did a test with:

{
    "require": {
        "bower-asset/jquery": "^2.1.4"
    },
    "prefer-stable": true,
    "minimum-stability": "dev"
}

Reslut:

$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing bower-asset/jquery (2.1.4)
    Loading from cache

Writing lock file
Generating autoload files

The stable version with dist folder is downloaded.

For your question, you can see the FAQs How to reduce the number of requests for getting the package definitions?.

francoispluchino commented 8 years ago

Same result with --prefer-source option:

$ composer install --prefer-source
Loading composer repositories with package information
Installing dependencies (including require-dev)
  - Installing bower-asset/jquery (2.1.4)
    Cloning 7751e69b615c6eca6f783a81e292a55725af6b85

Writing lock file
Generating autoload files

It is recommended that add the --prefer-source option in your Travis config.

And install the last stable version of this plugin (currently v1.1.1).