Repository navigation
magento2-init: add the Valkey keys when the init.env template lacks them - #20
Merged
Merged
Conversation
fetchEnvInitFile prefers a custom ~/.roll or project .roll/environments init.env over the bundled one. A template written before Valkey existed has no ROLL_VALKEY or VALKEY_VERSION line, so the sed substitutions changed nothing while ROLL_REDIS was still set to 0: 2.4.8 and 2.4.9 projects came up with no in-memory store and failed the readiness check. Set both keys through m2initSetEnvValue, which appends a missing line. Raised by Copilot on #19. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
marcepartment
requested review from
HeRovaZy,
epartment-nick and
mlaurense
and
a balanced review from Copilot
November 9, 2026 13:17
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change addressing missing Valkey settings in older custom initialization templates.
No open issues 🎉
What changed in this PR
Fixes Magento initialization with older custom init.env templates that lack Valkey keys, completing the Valkey support introduced in #19.
Changes:
- Adds a helper to update or append environment values, handling files without a trailing newline.
- Uses the helper for Valkey settings so Magento 2.4.8 and 2.4.9 retain an in-memory store.
- Documents the custom-template fix in the changelog.
| File | Description |
|---|---|
utils/magento2-init.sh |
Adds the update-or-append helper and applies it to Valkey settings. |
CHANGELOG.md |
Records compatibility with older custom templates missing Valkey keys. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #19, addressing the Copilot review comment on
utils/magento2-init.sh.Problem
fetchEnvInitFileprefers a custom~/.roll/environments/magento2/init.envor project.roll/environments/magento2/init.envover the bundled template. A custom template written before #19 has noROLL_VALKEYorVALKEY_VERSIONline, so for Magento 2.4.8 and 2.4.9 thesedsubstitutions inm2initWriteEnvConfigchanged nothing whileROLL_REDISwas still set to0. The project came up with no in-memory store andmagento2-initfailed its readiness check.Fix
New
m2initSetEnvValuesetsKEY=valuein.env.rolland appends the line when the file has none (without gluing it onto a last line that lacks a newline). The Valkey branch uses it forROLL_VALKEYandVALKEY_VERSION. It writes no.env.roll.backup.*file.Verification
With
ROLL_HOME_DIRpointing at a custom template taken from before #19 (no Valkey keys):mainROLL_REDIS=0, no Valkey line → no storevalkey:9valkey:8redis:7.2redis:7.2(unchanged).env.roll.roll config conflictsis clean on the result..github/scripts/smoke.sh bash32passes.🤖 Generated with Claude Code