This repository was archived by the owner on Sep 30, 2024. It is now read-only.
properly handle instances that have empty settings#4157
Merged
Conversation
In older (2.x) versions of Sourcegraph it was possible to save an empty string as your user/org/global settings. This lead to various issues including just completely breaking the settings page: https://github.com/sourcegraph/sourcegraph/issues/1645 We later fixed that issue and made it such that saving empty settings is forbidden, but it doesn't appear we ever corrected such invalid settings. In one customer environment we've encountered a user who is reporting their settings are empty so we should handle this. This is a quick fix which is cheap for us to maintain, so I opted for this approach for now. The more correct (but also more complex) approach would be to write a migration which transforms any empty settings into non-empty ones. I don't think it is worth the time it would take right now.
32296ed to
7bbd105
Compare
Codecov Report
|
ryan-blunden
approved these changes
May 22, 2019
beyang
approved these changes
May 22, 2019
emidoots
pushed a commit
that referenced
this pull request
May 22, 2019
In older (2.x) versions of Sourcegraph it was possible to save an empty string as your user/org/global settings. This lead to various issues including just completely breaking the settings page: https://github.com/sourcegraph/sourcegraph/issues/1645 We later fixed that issue and made it such that saving empty settings is forbidden, but it doesn't appear we ever corrected such invalid settings. In one customer environment we've encountered a user who is reporting their settings are empty so we should handle this. This is a quick fix which is cheap for us to maintain, so I opted for this approach for now. The more correct (but also more complex) approach would be to write a migration which transforms any empty settings into non-empty ones. I don't think it is worth the time it would take right now.
Member
Author
|
Cherry-picked onto 3.4 for release in 3.4.1 |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
In older (2.x) versions of Sourcegraph it was possible to save an empty string
as your user/org/global settings. This lead to various issues including just
completely breaking the settings page: https://github.com/sourcegraph/sourcegraph/issues/1645
We later fixed that issue and made it such that saving empty settings is
forbidden, but it doesn't appear we ever corrected such invalid settings. In
one customer environment we've encountered a user who is reporting their
settings are empty so we should handle this.
This is a quick fix which is cheap for us to maintain, so I opted for this
approach for now. The more correct (but also more complex) approach would be to
write a migration which transforms any empty settings into non-empty ones. I
don't think it is worth the time it would take right now.
Once merged, this will be released in 3.4.1 and can optionally be released as a patch on the customer's older version if @beyang desires.
Test plan: none