Skip to content

fix: COMPOSER_INSTALL_OPTIONS from options.json silently ignored (#1265)#1274

Merged
ramonskie merged 1 commit into
masterfrom
fix/composer-install-options-ignored-1265
May 28, 2026
Merged

fix: COMPOSER_INSTALL_OPTIONS from options.json silently ignored (#1265)#1274
ramonskie merged 1 commit into
masterfrom
fix/composer-install-options-ignored-1265

Conversation

@ramonskie
Copy link
Copy Markdown
Contributor

Summary

  • COMPOSER_INSTALL_OPTIONS set in .bp-config/options.json was silently ignored in v5
  • The composer extension always fell back to the hardcoded default ["--no-interaction", "--no-dev"], making it impossible to install dev dependencies via configuration
  • Adds a regression integration test to prevent recurrence

Root Cause

supply.go parses COMPOSER_INSTALL_OPTIONS from options.json into s.Options.ComposerInstallOptions correctly, but never wrote it into the extension Context.Data map. The composer extension reads it back via ctx.GetStringSlice("COMPOSER_INSTALL_OPTIONS"), which returned nil, so the hardcoded default was always used.

Fix

One line added in supply.go alongside the other options already written to the context:

ctx.Set("COMPOSER_INSTALL_OPTIONS", s.Options.ComposerInstallOptions)

Testing

Added an integration test (composer_test.go) with a fixture app that:

  • Sets "COMPOSER_INSTALL_OPTIONS": ["--dev"] in .bp-config/options.json
  • Has psr/log ^3.0 as a require-dev dependency only
  • Serves a response confirming the dev package is accessible at runtime

The test asserts:

  1. Staging logs do not contain --no-dev (confirming the user option overrides the default)
  2. The running app responds with "dev dependencies installed"

Fixes #1265

…nsion

COMPOSER_INSTALL_OPTIONS set in .bp-config/options.json was silently
ignored because supply.go never wrote the parsed value into the
extension Context.Data map. The composer extension reads it back via
ctx.GetStringSlice(), which returned nil, causing the hardcoded default
["--no-interaction", "--no-dev"] to always be used.

Fix: add ctx.Set("COMPOSER_INSTALL_OPTIONS", s.Options.ComposerInstallOptions)
alongside the other options already written to the context.

Adds a regression integration test with a fixture app that sets
COMPOSER_INSTALL_OPTIONS to ["--dev"] and verifies that a require-dev
package (psr/log) is installed and accessible at runtime.

Fixes #1265
@pierre3119
Copy link
Copy Markdown

Problem solved. Thanks!

Copy link
Copy Markdown

@pierre3119 pierre3119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem solved. Thanks!

@ramonskie ramonskie merged commit fa1a46d into master May 28, 2026
7 checks passed
@ramonskie ramonskie deleted the fix/composer-install-options-ignored-1265 branch May 28, 2026 12:26
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.

can't install dev dependencies in V5_0_4

3 participants