Skip to content
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
emidoots merged 1 commit intomasterfrom
sg/empty-settings
May 22, 2019
Merged

properly handle instances that have empty settings#4157
emidoots merged 1 commit intomasterfrom
sg/empty-settings

Conversation

@emidoots
Copy link
Copy Markdown
Member

@emidoots emidoots commented 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.

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

@emidoots emidoots requested a review from beyang May 22, 2019 03:36
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.
@emidoots emidoots force-pushed the sg/empty-settings branch from 32296ed to 7bbd105 Compare May 22, 2019 03:37
@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2019

Codecov Report

Merging #4157 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted Files Coverage Δ
cmd/frontend/db/settings.go 63% <0%> (-1.29%) ⬇️

@emidoots emidoots merged commit 636f9f1 into master May 22, 2019
@emidoots emidoots deleted the sg/empty-settings branch May 22, 2019 19:10
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.
@emidoots
Copy link
Copy Markdown
Member Author

Cherry-picked onto 3.4 for release in 3.4.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants