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

Dependencies version constraints not applied when installing a new extension in an interactive request #6073

Open
manueladan-nttdata opened this issue Jul 24, 2024 · 5 comments

Comments

@manueladan-nttdata
Copy link

Describe the bug
Drush pm:install doesn't take into account dependencies version restrictions of the extension to be installed.

To Reproduce
In a fresh Drupal 10.3.1 installation (minimal profile) I created a new custom module named "test" with just the .info file as follows:

name: 'Test'
type: module
description: 'Just a test.'
package: Custom
core_version_requirement: ^10 || ^11
dependencies:
  - drupal:system (>=14.0)

It must not be possible to install since it requires a (not yet) existing version of Drupal core. From the extend administration UI I can not install it:

image

But drush allows me to do so:

# drush pm:install test
 [success] Successfully enabled: test

Expected behavior
Drush shouldn't complete the Test module installation since its dependency on system >= 14.0 can not be satisfied.

Actual behavior
As described.

Workaround
Install extension throw the UI, but unfortunatelly extension installation is a common process where the UI is not involved (CI/CD ...)

System Configuration

Q A
Drush version? 12.5.2.0
Drupal version? 10.3.1
PHP version 8.2.15
OS? Linux

Additional information
Add any other context about the problem here.

@weitzman
Copy link
Member

I think this only throws the error for interactive requests. Non interactive are allowed to proceed. This went in at https://github.com/drush-ops/drush/pull/4733/files. Discussed at. #6006 (comment)

@manueladan-nttdata
Copy link
Author

It seems to happen regardless the session is interactive or not:

Interactive (inside docker container launched with docker exec --interactive --tty ...):

image

Non-interactive:

image

@weitzman
Copy link
Member

ok, perhaps someone can debug why interactive is not sufficient.

@weitzman weitzman reopened this Jul 24, 2024
@weitzman weitzman changed the title Dependencies version constraints not applied when installing a new extension Dependencies version constraints not applied when installing a new extension in an interactive request Jul 24, 2024
@manueladan-nttdata
Copy link
Author

I was trying to address this. I'm not familiar with Drush internals, so this is an initial attempt. I worked in 12.x that matches my testing environment, it should moved into 13.x when done.

https://github.com/drush-ops/drush/compare/12.x...manueladan-nttdata:drush:6073-dependencies_version_constraints?expand=1

Output with this change:

image

@weitzman
Copy link
Member

weitzman commented Aug 2, 2024

Help wanted, here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants