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

[PR #7405/f7267c71 backport][stable-7] Fix the ability to run Composer "working_dir" dependent commands #7460

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Nov 1, 2023

This is a backport of PR #7405 as merged into main (f7267c7).

SUMMARY

When the composer plugin runs a command, it searches for the command available options using composer help.
However, some composer commands are not available globally, but only in a given working directory. Therefore, it is required to pass the working_dir parameter to all composer command invocation that is not a global command.

Fixes #3787

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

composer module

ADDITIONAL INFORMATION

Before this change, the execution of:

- name: Compile the .env.local file to PHP
  community.general.composer:
    command: symfony:dump-env
    working_dir: "/path/to/my/directory"
    arguments: prod

was throwing an error:

fatal: FAILED! => {"changed": false, "msg": "There are no commands defined in the \"symfony\" namespace. help [--format FORMAT] [--raw] [--] [<command_name>]"}

* pass the working_dir to all composer command invocations that are not global

* add changelog fragment

* Update changelog fragment

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit f7267c7)
@ansibullbot
Copy link
Collaborator

cc @dmtrs
click here for bot help

@ansibullbot ansibullbot added backport bug This issue/PR relates to a bug module module new_contributor Help guide this first time contributor plugins plugin (any type) labels Nov 1, 2023
@felixfontein felixfontein merged commit be2fd43 into stable-7 Nov 1, 2023
@felixfontein felixfontein deleted the patchback/backports/stable-7/f7267c7123f178cfd0b39ebe9c6149fe3f63e477/pr-7405 branch November 1, 2023 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants