Skip to content

feat: implement ADDITIONAL_PREPROCESS_CMDS with v4.x compatibility#1230

Merged
ramonskie merged 1 commit intomasterfrom
feat/additional-preprocess-cmds
Feb 25, 2026
Merged

feat: implement ADDITIONAL_PREPROCESS_CMDS with v4.x compatibility#1230
ramonskie merged 1 commit intomasterfrom
feat/additional-preprocess-cmds

Conversation

@ramonskie
Copy link
Contributor

Summary

Implements ADDITIONAL_PREPROCESS_CMDS support, restoring v4.x parity for apps that need to run arbitrary shell commands during the finalize (staging) phase before the web server starts.

Changes

Options Parsing (src/php/options/options.go)

  • Parse ADDITIONAL_PREPROCESS_CMDS from .bp-config/options.json as a list of shell commands

Finalize Phase (src/php/finalize/finalize.go)

  • Execute each command in sequence during finalize
  • Log each command before execution
  • Emit security warning when commands are present (arbitrary code execution during staging)
  • Fail fast on non-zero exit codes with clear error messages

Integration Tests

  • src/php/integration/preprocess_cmds_test.go — validates command execution and output

Fixtures

  • fixtures/preprocess_cmds/ — test app with multiple preprocess commands

Documentation

  • docs/V4_V5_MIGRATION_GAP_ANALYSIS.md — gap analysis between v4.x and v5.x features

Security Note

ADDITIONAL_PREPROCESS_CMDS allows arbitrary shell execution during staging. A security warning is emitted in the staging log whenever commands are configured.


Depends on: #1229 (PHP version placeholders) → #1226 (remove runtime rewrite binary)

Base automatically changed from feat/php-version-placeholder to master February 25, 2026 16:35
@ramonskie ramonskie force-pushed the feat/additional-preprocess-cmds branch from d44f9b7 to d80adec Compare February 25, 2026 16:38
@ramonskie ramonskie force-pushed the feat/additional-preprocess-cmds branch from d80adec to 573a638 Compare February 25, 2026 16:40
@ramonskie ramonskie merged commit f2ff138 into master Feb 25, 2026
10 of 13 checks passed
@ramonskie ramonskie deleted the feat/additional-preprocess-cmds branch February 25, 2026 17:30
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.

1 participant