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

Tests failing with composer 2 #152

Closed
andybroomfield opened this issue Oct 29, 2020 · 12 comments
Closed

Tests failing with composer 2 #152

andybroomfield opened this issue Oct 29, 2020 · 12 comments
Labels
bug Something isn't working

Comments

@andybroomfield
Copy link
Contributor

Is there a way we can pin this back to use composer 1 for now?

Getting errors when testing pull requests into localgov_services.
The tests exit after 30 seconds.

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.
67
Error: Process completed with exit code 2.
@andybroomfield andybroomfield added the bug Something isn't working label Oct 29, 2020
@finnlewis
Copy link
Member

Me too @andybroomfield

I've been trying to untangle the dependencies to get it working with composer 2, no joy as yet.

@finnlewis
Copy link
Member

Guessing it's this line if we want to install composer 1.x

https://github.com/localgovdrupal/drupal-container/blob/master/Dockerfile#L56

@finnlewis
Copy link
Member

I tried this, it didn't work:
localgovdrupal/drupal-container#10

@stephen-cox
Copy link
Member

stephen-cox commented Nov 2, 2020

This issue was fixed here localgovdrupal/drupal-container#10 by installing Composer v1 in to the Docker container and using this to run any composer operations. The problem with this solution is that we need to update the Github CI configuration for all repos.

Unfortunately, I'm not aware of a way to fix this problem without making some changes to all the GitHub Ci config. @Adnan-cds points to some workarounds here: actions/runner-images#1924, but they will still need changes to all Github CI config files.

The advantage of using the version installed in the Docker container used to run the tests is we can use Composer 2 later on without having to make changes to all the Github CI later on: https://github.com/localgovdrupal/drupal-container/blob/847d8773550bcdb3dea22b9037f536ff5563fcd7/Dockerfile#L56

The disadvantage being is maybe quite a bit slower, although if this is a concern we should benchmark this.

@Adnan-cds
Copy link
Contributor

The disadvantage being is maybe quite a bit slower, although if this is a concern we should benchmark this.

I have tried to compile a list below for the three available options:

So clearly, the one from the build VM performs best. This leaves us with two future options:

  • As soon as drupal/console-extend-plugin is fixed, switch to the composer v2 that ships with the build VM.
  • Drop "drupal/console" from the localgovdrupal/localgov profile and enjoy composer v2.

@stephen-cox
Copy link
Member

If this is only an issue with drupal/console then I vote to drop it until it supports Composer v2.

@Adnan-cds
Copy link
Contributor

If this is only an issue with drupal/console then I vote to drop it until it supports Composer v2.

Apart from drupal/console, we also need to tell the localgov_project's composer.json to use "drupal/core*: ^8.9.7" but that should be easy.

I was thinking perhaps we can make drupal/console a suggested package of localgovdrupal/localgov rather than a required one.

@stephen-cox
Copy link
Member

For reference, this is the issue that will add Composer 2 support to Drupal Console hechoendrupal/drupal-console-extend-plugin#23 and this is the pull request hechoendrupal/drupal-console-extend-plugin#25

@finnlewis
Copy link
Member

Following your suggestions @stephen-cox and @Adnan-cds - I've tested removing drupal/console and upping core to 8.9.
This seems to work, as @Adnan-cds suggested.

Here's a couple of PRs to help test it:

#153
localgovdrupal/localgov_project#28

What do you think?

@finnlewis
Copy link
Member

Oooh - this is good: https://www.drupal.org/docs/develop/using-composer/preparing-your-site-for-composer-2
Perhaps we should run through the recommendations there too.

@Adnan-cds
Copy link
Contributor

https://www.drupal.org/docs/develop/using-composer/preparing-your-site-for-composer-2

Useful link. Thanks a lot.

We are using two Composer plugins from the given list AFAIK:

  • composer/installers: "drupal/core-recommended: ^8.9.7" should take care of it.
  • drupal/console-extend-plugin: This you have dropped in a different pull request.

So looks like we should be good :)

@Adnan-cds
Copy link
Contributor

I am having that "Back on the road feeling": https://github.com/localgovdrupal/localgov/runs/1354189654 :D

The "Create LocalGovDrupal project" task has finished in 1min 15sec under Composer 2 which is neither an improvement nor a loss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants