jelhan / create-github-actions-setup-for-ember-addon

Setup GitHub Actions for an Ember Addon
MIT License
19 stars 2 forks source link

Provide better feedback if package manager used in .travis-ci.yml and lock file does not match #38

Open jelhan opened 3 years ago

jelhan commented 3 years ago

Some repositories seem to have a mismatch between the package manager used in TravisCI configuration (.travis-ci.yml) and the lock file committed to the repository.

@simonihmig reported this issue when migrating ember-responsive-image. The .travis-ci.yml was using npm but a yarn.lock was committed to the repository.

I faced the same issue when migrating ember-leaflet. But in this case the .travis-ci.yml was using yarn but a package-lock.json was committed to the repository.

It seems like common that TravisCI configuration does not use the package manager expected by the project. I guess the project changed the package manager at some point of time but missed to update .travis-ci.yml and Ember CLI Update configuration.

In most cases a mismatch between package manager used in TravisCI configuration and expected by the project is not an issue. TravisCI picks correct package manager automatically unless install step is provided explicitly. TravisCI configuration created by Ember CLI blueprints only overwrites the install step for the Floating Dependencies scenario. As lock file should be ignored for that scenario using the wrong package manager does not cause any harm.

I think package manager should be detected based on existing yarn.lock or package-lock.json. Even if migrating an existing TravisCI configuration. Existing yarn.lock or package-lock.json seems to be the source of truth. I don't see a use case for using another package manager in CI. Relying on TravisCI configuration and not existing lock file does not seem to provide any value. But it has the risk to migrate bugs...