Fix env overrides for optional scalar config values#5796
Open
preko-p wants to merge 1 commit into
Open
Conversation
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.
References
Description
Environment variable overrides only walked config keys that were already present and non-empty in the merged config object. Valid optional scalar config settings with empty or absent defaults, such as
matomo.trackerUrlandrest.ssrBaseUrl, could therefore ignore their correspondingDSPACE_*environment variables unless a placeholder default was added.This PR extracts the environment override logic into a focused helper and adds a bounded supplemental map for optional scalar config leaves that cannot be discovered by the runtime object walk.
Instructions for Reviewers
List of changes in this PR:
matomo.trackerUrlviaDSPACE_MATOMO_TRACKERURLrest.baseUrlviaDSPACE_REST_BASEURLrest.ssrBaseUrlviaDSPACE_REST_SSRBASEURLDSPACE_REST_SSRBASEURLhandling inconfig.server.tsfor compatibility.DefaultAppConfig.DSPACE_*names;Scope note: this is intentionally a scalar-only fix for optional config leaves that cannot be discovered from the runtime object shape. It does not attempt to infer TypeScript interfaces at runtime or parse arrays/objects from environment variables.
Verification performed locally with Node
v22.17.1andnpm@10.9.4:Results:
7 SUCCESS0 errorswith existing repo-wide warningsgit diff --check: no whitespace errorsChecklist
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).npm run lintnpm run check-circ-deps)package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.