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

Add test for composer.json in sub-extensions #6

Open
3 tasks
TravisCarden opened this issue Jan 2, 2020 · 2 comments
Open
3 tasks

Add test for composer.json in sub-extensions #6

TravisCarden opened this issue Jan 2, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@TravisCarden
Copy link
Contributor

TravisCarden commented Jan 2, 2020

The Drupal.org Composer service handles sub-extensions and their dependencies separately such that drupal/example_submodule can have different dependencies from drupal/example. Indeed, if a submodule requires packages that are not technically required to use the base extension, Acquia considers this a best practice so as not to require users to deploy unused code. Thus, since the Drupal.org Composer service dynamically creates an implicit composer.json for them anyway, sub-extensions should take ownership of their metadata and dependencies and create their own physical composer.json. Create a test for this.

  • Add a warning for sub-extensions that don't have their own composer.json.
  • Document the feature.
  • Link to the documentation in the warning message.
@danepowell
Copy link
Collaborator

danepowell commented Jan 2, 2020

Pro tip: if you are the maintainer of such a module, and you want to be able to install all of the dependencies (including submodule dependencies) for testing purposes, the best way I've found is to declare the submodule as a Composer path repository in the root-level composer.json, and then declare the submodule as a dev dependency.

As a reference, this is what I did for Acquia Connector, which ships with the Acquia Search submodule: https://git.drupalcode.org/project/acquia_connector/commit/a657b8523566177f065ba2ff167c9b596822aa8c#3957b91a0d8450cea0115cfd5af69eac90d75897

@JPustkuchen
Copy link

I had similar problems with the Drupal.org Testbot and created an issue and a workaround based on your implementation here. https://www.drupal.org/project/drupalci_testbot/issues/3250126

Thank you very much for giving that idea! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants