This repository was archived by the owner on Sep 30, 2024. It is now read-only.
Fix woes related to undefined frontendCodyProConfig.sscBaseUrl#62835
Merged
Conversation
unknwon
approved these changes
May 21, 2024
This was referenced May 22, 2024
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.
We need a URL to point the user to the webpage to manage their Cody Pro subscription in a couple places. And to support testing in lower environments, we made that configurable in https://github.com/sourcegraph/sourcegraph/pull/62790/files#diff-70a08658447c0eeaf1f548b8e325cac30a08567323d32e50b1953786404a5b07.
There was a problem in that PR however, the "default" value in the
site.schema.jsondoesn't do what you'd think. So at runtime the value forfrontendCodyProConfig.sscBaseUrlwas always always the empty string. This leads to confusing errors whenever you try to manage your Cody Pro subscription.I tried to just update the Sourcegraph.com site config to supply that value like intended, however in doing that the Sourcegraph.com frontend jobs would start to crash loop. (Because only supplying the
sscBaseUrlconfig value means that thecodyProConfigsettings contain "invalid values" forsscBackendOrigin.... since things have been broken in production for XX hours now, and I'd like to making any logic changes under duress, this PR just backs out the problematic line of code in that earlier PR. (So instead of reading the uninitialized config setting, it just hard-codes the default value.)
The ideal fix for this, IMHO, would be to expose a new config settings
showEmbeddedUiso that the functionisEmbeddedCodyProUIEnabled()can rely on that. Since that way, we can supply all of thecodyProConfigconfiguration data for Sourcegraph.com, without any fears of unintentionally enabling the new UI. Otherwise, it seems dangerous to set all of the config values, but somehow not the Stripe Publishable key because that is the thing that controls the UI we display.Test Plan
Tested locally.