[Bug] Fix Symfony env var tracking for mercure_settings in prepend()#1805
Open
vrobert78 wants to merge 1 commit intopimcore:2026.xfrom
Open
[Bug] Fix Symfony env var tracking for mercure_settings in prepend()#1805vrobert78 wants to merge 1 commit intopimcore:2026.xfrom
vrobert78 wants to merge 1 commit intopimcore:2026.xfrom
Conversation
In PimcoreStudioBackendExtension::prepend(), the mercure_settings parameters were set using $containerConfig from getConfigNodeFromSymfonyTree(), which internally calls resolveValue(). This strips %env(X)% references to plain strings, causing Symfony's container compiler to report env vars like MERCURE_JWT_COOKIE_HOST as "never used" even when correctly referenced in mercure_settings config. Fix: call $this->processConfiguration() directly in prepend() so that env var placeholders are preserved as proper DI parameter references. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Up to standards ✅🟢 Issues
|
| Category | Results |
|---|---|
| UnusedCode | 1 medium |
🟢 Metrics 0 complexity
Metric Results Complexity 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.



Problem
In
PimcoreStudioBackendExtension::prepend(), themercure_settingscontainer parameters were being set using$containerConfigobtained fromConfigurationHelper::getConfigNodeFromSymfonyTree(). That helper internally callsresolveValue(), which strips%env(X)%references down to plain strings.As a result, Symfony's container compiler never sees these as proper env var parameter references, and reports env vars like
MERCURE_JWT_COOKIE_HOSTas "never used" — even when correctly referenced inmercure_settingsconfiguration — causing a deployment failure.Fix
Replace the use of
$containerConfigin themercure_settingsloop insideprepend()with a fresh call to$this->processConfiguration(), which preserves%env(X)%placeholders as proper DI parameter references that Symfony can track through compilation.Test
Verified on Upsun (Platform.sh Flex) with
MERCURE_JWT_COOKIE_HOSTset via env var: container compiles cleanly with no "never used" warning and the env var is correctly resolved at runtime.🤖 Generated with Claude Code