Skip to content

Fix search scopes not getting properly merged

Warren Gifford requested to merge fa/fix-clobbered-scopes into master

Created by: attfarhan

Fixes https://github.com/sourcegraph/sourcegraph/issues/3529.

Search scopes would only display the lowest-level list of scopes (e.g. user scopes would override organization scopes, and organization scopes would override global scopes). The settings were not getting merged properly when the value was an array.

This change removes deep merging of fields in the site settings. Instead, by default, we will shallow merge objects, and pass in custom merge functions for the properties that require deep merging. This PR adds those custom functions for extensions, search.scopes, search.repositoryGroups, search.SavedQueries, and notices.

Test plan:

Merge request reports

Loading