-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Rename onpremise to self-hosted in configs #30528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
size-limit report
|
ae97218
to
ba0d0b4
Compare
k so I'm gonna ignore those codecov reds. 👀 The visual diff though seems actually relevant, let me make sure I understand what this is doing ... |
@@ -20,7 +20,8 @@ def get_default_context(request, existing_context=None, team=None): | |||
"URL_PREFIX": options.get("system.url-prefix"), | |||
"SINGLE_ORGANIZATION": settings.SENTRY_SINGLE_ORGANIZATION, | |||
"PLUGINS": plugins, | |||
"ONPREMISE": settings.SENTRY_ONPREMISE, | |||
"ONPREMISE": settings.SENTRY_SELF_HOSTED, # deprecated, use ... | |||
"SELF_HOSTED": settings.SENTRY_SELF_HOSTED, # ... this instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are these contexts? What consumes them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduced in #3350 so Django templates can vary:
{% if ONPREMISE %}<a href="/out/">{% trans "Migrate to SaaS" %}</a>{% endif %} |
We're not using this anymore, but if we remove this then we should probably remove SINGLE_ORGANIZATION
as well, but I want to be conservative here so I am leaving these in.
# for now, but in the rest of _this_ codebase we should reference | ||
# SENTRY_SELF_HOSTED. | ||
SENTRY_ONPREMISE = True # deprecated, use ... | ||
SENTRY_SELF_HOSTED = SENTRY_ONPREMISE # ... this instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the risky part. We need to make sure that getsentry
(and I guess whatever goofy third-party stuff exists out in the wild) doesn't break. As we can see, SENTRY_ONPREMISE
defaults to true, and probably nothing but getsentry
overrides that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not too important for this pr, but if we want to remove SENTRY_ONPREMISE
we should also check with the single tenant team to see whether they set this variable differently as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call @wedamija. This came up at #30528 (comment) as well, and I've put single-tenant on the pile at getsentry/self-hosted#796 to make sure it isn't forgotten. Close one!
href: LINKS.FORUM, | ||
to: `${organizationSettingsUrl}support`, | ||
}; | ||
const supportText = isOnPremise ? t('Community Forums') : t('Contact Support'); | ||
const supportText = isSelfHosted ? t('Community Forums') : t('Contact Support'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I should update the forums link as well to keep up with getsentry/self-hosted#1151, but that's out of scope for this repo.
@@ -7,12 +7,12 @@ import DefaultSettings from 'sentry/plugins/components/settings'; | |||
type Props = DefaultSettings['props']; | |||
|
|||
type State = DefaultSettings['state'] & { | |||
showOnPremisesConfiguration?: boolean; | |||
showSelfHostedConfiguration?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ancient plugin has a few config values that are only relevant on self-hosted. This is the source of the screenshots that changed.
@@ -123,7 +123,7 @@ def get_config(self, project, **kwargs): | |||
}, | |||
] | |||
|
|||
if settings.SENTRY_ONPREMISE: | |||
if settings.SENTRY_SELF_HOSTED: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ancient plugin. See settings.tsx
.
@@ -153,7 +153,8 @@ def get_client_config(request=None): | |||
"statuspage": _get_statuspage(), | |||
"messages": [{"message": msg.message, "level": msg.tags} for msg in messages], | |||
"apmSampling": float(settings.SENTRY_FRONTEND_APM_SAMPLING or 0), | |||
"isOnPremise": settings.SENTRY_ONPREMISE, | |||
"isOnPremise": settings.SENTRY_SELF_HOSTED, # deprecated, use ... | |||
"isSelfHosted": settings.SENTRY_SELF_HOSTED, # ... this instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second-riskiest part. getsentry
does consume the isOnPremise
config key in some places. Third-party JavaScript (plugins?) might as well. Preserve the key!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will we be removing isOnPremise
after getsentry
is updated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to, but I'm not sure how much impact that has on self-hosters. Probably not much? I'd like to at least get one release out with both keys and a notice in the changelog, then remove "sometime" after that. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd imagine it shouldn't affect them, if they are customizing their install, they shouldn't have a need to differentiate between the two? But otherwise sounds good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean the default is true. Nobody except us in SaaS should need to change the default. Also yes, like you say, nobody in the wild building their own plugins or whatever should need to vary their behavior on whether this config is true or false, realistically they would just always deliver whatever behavior they're building for their custom app/plugin. I think I'm convinced that we can remove this sooner rather than later (meaning, at the earliest, after getsentry
is updated and 21.12.0 goes out).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm ... single-tenant, though ... 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, PR needed there as well!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted on getsentry/self-hosted#796. 👍
2f2fdc2
to
ba0d0b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code wise this seems good, I think it'd be good to get a review from @getsentry/ecosystem too though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 changes to the sessionstack plugin look good!
ba0d0b4
to
ef80ddf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be wise to split out the FE/BE pieces of this pr. Deploy the BE piece first then the FE, that way we make sure we don't have any issues during deploy.
# for now, but in the rest of _this_ codebase we should reference | ||
# SENTRY_SELF_HOSTED. | ||
SENTRY_ONPREMISE = True # deprecated, use ... | ||
SENTRY_SELF_HOSTED = SENTRY_ONPREMISE # ... this instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not too important for this pr, but if we want to remove SENTRY_ONPREMISE
we should also check with the single tenant team to see whether they set this variable differently as well.
This reverts commit 31ad2a9.
Big things to think about here are backcompat for both getsentry and self-hosted users. Customizations? Plugins? FE? BE?