Skip to content

feat: flashlight-mount + flashlight-init-scripts inputs (v2.1.0)#8

Merged
PrestaEdit merged 1 commit into
mainfrom
feat/flashlight-mount-and-init-scripts
Jul 12, 2026
Merged

feat: flashlight-mount + flashlight-init-scripts inputs (v2.1.0)#8
PrestaEdit merged 1 commit into
mainfrom
feat/flashlight-mount-and-init-scripts

Conversation

@PrestaEdit

Copy link
Copy Markdown
Contributor

What

Two additive Flashlight inputs — no behaviour change when omitted, so this ships as v2.1.0 with full backward compat.

flashlight-mount'auto' | 'root' | 'modules' | 'themes', default 'auto'

  • auto — current composer.json-based detection.
  • root — mounts the workspace at /var/www/html:rw for custom PrestaShop builds (Flashlight's own develop-prestashop reference example).
  • modules / themes — force the location regardless of composer.json (useful when type: is wrong or absent).

flashlight-init-scripts — path, default ''

Optional directory (absolute or relative to the workspace) mounted read-only at /tmp/init-scripts. Flashlight runs every executable file with a shebang alphabetically, after MySQL dump restore and before nginx starts. Ideal for seeding data, patching config, or wiring in an internal module at boot.

Path is validated at parse time; missing directory fails fast with a clear error.

Fix bundled in

The withInputs test helper was mangling env keys with dashes (INPUT_FLASHLIGHT_MOUNT instead of INPUT_FLASHLIGHT-MOUNT). @actions/core.getInput('foo-bar') actually reads INPUT_FOO-BAR. Fixed so dashed inputs are testable (this was hidden until now because no test verified a dashed input's roundtrip).

Test plan

  • npm run lint clean
  • npm test52 tests, 12 suites (was 43). New coverage:
    • mount.ts: root/modules/themes modes + auto behavior preserved.
    • compose-template.ts: init-scripts volume rendered when path provided, absent when not.
    • inputs.ts: mode validation (throws on 'nope'), init-scripts pass-through.
  • Bundle rebuilt.
  • Docs PR on prestaflow.io (follow-up).
  • Smoke test with flashlight-mount: root (follow-up on prestaflow-prestashop or a scratch repo).

Rollout

  • Land as v2.1.0.
  • Move @v2 after tag.

🤖 Generated with Claude Code

Two additive inputs — no behaviour change when omitted, so v2.1.0
targets full backwards compatibility with v2.0.x consumers.

flashlight-mount ('auto' | 'root' | 'modules' | 'themes', default
'auto'):
- 'auto' keeps the existing composer.json-based detection.
- 'root' mounts the workspace at /var/www/html (custom PrestaShop
  build). Follows Flashlight's develop-prestashop reference example.
- 'modules' and 'themes' force those locations regardless of
  composer.json, useful when the type field is wrong or absent.

flashlight-init-scripts (path, default ''):
- Optional directory (absolute or relative to the workspace) mounted
  read-only at /tmp/init-scripts inside the container. Flashlight
  runs every executable file with a shebang, alphabetically, after
  the MySQL dump is restored and before nginx starts.
- Path is validated at parse time; a missing / non-directory path
  fails fast with a clear error.

Also fixes the withInputs test helper to preserve dashes in env var
keys (@actions/core.getInput('foo-bar') reads INPUT_FOO-BAR, not
INPUT_FOO_BAR); the helper's earlier substitution meant dashed
inputs would have failed to load in tests — hidden until now because
no test verified a dashed input's roundtrip.

52/52 tests pass (was 43); bundle rebuilt.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@PrestaEdit
PrestaEdit merged commit 839faaf into main Jul 12, 2026
1 check passed
@PrestaEdit
PrestaEdit deleted the feat/flashlight-mount-and-init-scripts branch July 12, 2026 08:49
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