-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Second-riskiest part. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will we be removing There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Noted on getsentry/self-hosted#796. 👍 |
||
"invitesEnabled": settings.SENTRY_ENABLE_INVITES, | ||
"gravatarBaseUrl": settings.SENTRY_GRAVATAR_BASE_URL, | ||
"termsUrl": settings.TERMS_URL, | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Introduced in #3350 so Django templates can vary:
We're not using this anymore, but if we remove this then we should probably remove |
||||
} | ||||
|
||||
if existing_context: | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Ancient plugin. See |
||
configurations.extend( | ||
[ | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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. |
||
}; | ||
|
||
class Settings extends DefaultSettings<Props, State> { | ||
REQUIRED_FIELDS = ['account_email', 'api_token', 'website_id']; | ||
ON_PREMISES_FIELDS = ['api_url', 'player_url']; | ||
SELF_HOSTED_FIELDS = ['api_url', 'player_url']; | ||
|
||
renderFields(fields: State['fieldList']) { | ||
return fields?.map(f => | ||
|
@@ -29,9 +29,9 @@ class Settings extends DefaultSettings<Props, State> { | |
return fields?.filter(field => fieldNames.includes(field.name)) ?? []; | ||
} | ||
|
||
toggleOnPremisesConfiguration = () => { | ||
toggleSelfHostedConfiguration = () => { | ||
this.setState({ | ||
showOnPremisesConfiguration: !this.state.showOnPremisesConfiguration, | ||
showSelfHostedConfiguration: !this.state.showSelfHostedConfiguration, | ||
}); | ||
}; | ||
|
||
|
@@ -53,9 +53,9 @@ class Settings extends DefaultSettings<Props, State> { | |
const hasChanges = !isEqual(this.state.initialData, this.state.formData); | ||
|
||
const requiredFields = this.filterFields(this.state.fieldList, this.REQUIRED_FIELDS); | ||
const onPremisesFields = this.filterFields( | ||
const selfHostedFields = this.filterFields( | ||
this.state.fieldList, | ||
this.ON_PREMISES_FIELDS | ||
this.SELF_HOSTED_FIELDS | ||
); | ||
|
||
return ( | ||
|
@@ -68,19 +68,19 @@ class Settings extends DefaultSettings<Props, State> { | |
</div> | ||
)} | ||
{this.renderFields(requiredFields)} | ||
{onPremisesFields.length > 0 ? ( | ||
{selfHostedFields.length > 0 ? ( | ||
<div className="control-group"> | ||
<button | ||
className="btn btn-default" | ||
type="button" | ||
onClick={this.toggleOnPremisesConfiguration} | ||
onClick={this.toggleSelfHostedConfiguration} | ||
> | ||
Configure on-premises | ||
Configure self-hosted | ||
</button> | ||
</div> | ||
) : null} | ||
{this.state.showOnPremisesConfiguration | ||
? this.renderFields(onPremisesFields) | ||
{this.state.showSelfHostedConfiguration | ||
? this.renderFields(selfHostedFields) | ||
: null} | ||
</Form> | ||
); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,17 +67,17 @@ class SettingsIndex extends React.Component<Props> { | |
render() { | ||
const {organization} = this.props; | ||
const user = ConfigStore.get('user'); | ||
const isOnPremise = ConfigStore.get('isOnPremise'); | ||
const isSelfHosted = ConfigStore.get('isSelfHosted'); | ||
|
||
const organizationSettingsUrl = | ||
(organization && `/settings/${organization.slug}/`) || ''; | ||
|
||
const supportLinkProps = { | ||
isOnPremise, | ||
isSelfHosted, | ||
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 commentThe 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. |
||
|
||
return ( | ||
<SentryDocumentTitle | ||
|
@@ -340,7 +340,7 @@ const ExternalHomeLink = styled( | |
`; | ||
|
||
type SupportLinkProps<T extends boolean> = { | ||
isOnPremise: T; | ||
isSelfHosted: T; | ||
href: string; | ||
to: string; | ||
isCentered?: boolean; | ||
|
@@ -350,12 +350,12 @@ type SupportLinkProps<T extends boolean> = { | |
|
||
const SupportLinkComponent = <T extends boolean>({ | ||
isCentered, | ||
isOnPremise, | ||
isSelfHosted, | ||
href, | ||
to, | ||
...props | ||
}: SupportLinkProps<T>) => | ||
isOnPremise ? ( | ||
isSelfHosted ? ( | ||
<ExternalHomeLink isCentered={isCentered} href={href} {...props} /> | ||
) : ( | ||
<HomeLink to={to} {...props} /> | ||
|
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 butgetsentry
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!