refactor(env): change array merge strategy from unique to replace #645
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.
Summary
Changes the deep merge array strategy from
mergeArraysUnique(which concatenated and deduplicated arrays) toreplaceArrays(which allows later configuration sources to completely override earlier ones).Before: Arrays were merged and deduplicated
['uuid', 'postgis']+['postgis', 'hstore']→['uuid', 'postgis', 'hstore']After: Later arrays completely replace earlier ones
['uuid', 'postgis']+['postgis', 'hstore']→['postgis', 'hstore']This fixes the issue where arrays like
api.metaSchemaswith non-empty defaults could not be fully replaced by config/env/override values.Review & Testing Checklist for Human
db.extensions,jobs.*.supported,graphile.schema,api.exposedSchemas,api.metaSchemas, etc.). Verify no existing configurations rely on the old additive merge behavior.mergeArraysUniqueis now exported asreplaceArrays. Check if any external code imports the old name from@pgpmjs/env.Notes
api.metaSchemaswhich had non-empty defaultsLink to Devin run: https://app.devin.ai/sessions/c09cd3880f9445d584dd937e037c2da4
Requested by: @pyramation