Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate composer files. #10

Merged
merged 4 commits into from
May 24, 2016
Merged

Conversation

danepowell
Copy link
Contributor

@danepowell danepowell commented May 2, 2016

An easy and common mistake is to add a module as a composer.json dependency and forget to run composer update to generate a new composer.lock. This causes a lot of confusion when the module mysteriously doesn't get deployed.

This validates that composer.lock is up to date with composer.json (among other things).

@danepowell
Copy link
Contributor Author

Hmm... doesn't seem that the failing tests are directly related to this PR.

@danepowell
Copy link
Contributor Author

Maybe this should be part of the validation Phing tasks, instead of a separate Travis step.

@grasmash
Copy link
Contributor

grasmash commented May 4, 2016

@danepowell If it's a phing task, when should it be executed? During the build of the docroot, of a deployment artifact, or when tests are run? Maybe a simple warning would suffice?

@danepowell
Copy link
Contributor Author

I'd like composer validate to run as an automated test, as part of validate:all. The current solution was just an easier stopgap.

Composer already issues a warning if composer.json and composer.lock are out of sync, the problem is that people don't heed it. A failing test seems like necessary motivation.

@danepowell
Copy link
Contributor Author

This should be ready to merge, the failing test is unrelated

@grasmash
Copy link
Contributor

Rerunning tests.

@grasmash
Copy link
Contributor

Looks like the failed tests may be related to composer validation:

     [exec] ./composer.json is valid for simple usage with composer but has
     [exec] strict errors that make it unable to be published as a package:
     [exec] See https://getcomposer.org/doc/04-schema.md for details on the schema
     [exec] description : The property description is required
     [exec] The package "phing/phing" is pointing to a commit-ref, this is bad practice and can cause unforeseen issues.
     [exec] require.roave/security-advisories : unbound version constraints (dev-master) should be avoided
     [exec] require.drupal-composer/drupal-security-advisories : exact version constraints (8.0.x-dev) should be avoided if the package follows semantic versioning

@danepowell
Copy link
Contributor Author

As they should, since it turns out our composer.json is invalid. I will fix.

@grasmash grasmash merged commit fdef9cd into acquia:8.x May 24, 2016
@danepowell danepowell deleted the feature/composer-validate branch September 26, 2016 16:06
@mikemadison13 mikemadison13 mentioned this pull request Nov 14, 2016
@vishakha-s vishakha-s mentioned this pull request Jan 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants