Skip to content

Commit ba0d0b4

Browse files
committed
Rename onpremise to self-hosted in configs
1 parent f6beb4f commit ba0d0b4

File tree

12 files changed

+39
-31
lines changed

12 files changed

+39
-31
lines changed

src/sentry/conf/server.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,7 +1921,11 @@ def build_cdc_postgres_init_db_volume(settings):
19211921
STATUS_PAGE_ID = None
19221922
STATUS_PAGE_API_HOST = "statuspage.io"
19231923

1924-
SENTRY_ONPREMISE = True
1924+
# Downstream (i.e., getsentry) sets SENTRY_ONPREMISE, so keep reading from that
1925+
# for now, but in the rest of _this_ codebase we should reference
1926+
# SENTRY_SELF_HOSTED.
1927+
SENTRY_ONPREMISE = True # deprecated, use ...
1928+
SENTRY_SELF_HOSTED = SENTRY_ONPREMISE # ... this instead
19251929

19261930
# Whether we should look at X-Forwarded-For header or not
19271931
# when checking REMOTE_ADDR ip addresses
@@ -2181,7 +2185,7 @@ def build_cdc_postgres_init_db_volume(settings):
21812185
# This should be the url pointing to the JS SDK
21822186
JS_SDK_LOADER_DEFAULT_SDK_URL = ""
21832187

2184-
# block domains which are generally used by spammers -- keep this configurable in case an onpremise
2188+
# block domains which are generally used by spammers -- keep this configurable in case a self-hosted
21852189
# install wants to allow it
21862190
INVALID_EMAIL_ADDRESS_PATTERN = re.compile(r"\@qq\.com$", re.I)
21872191

src/sentry/web/client_config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ def get_client_config(request=None):
153153
"statuspage": _get_statuspage(),
154154
"messages": [{"message": msg.message, "level": msg.tags} for msg in messages],
155155
"apmSampling": float(settings.SENTRY_FRONTEND_APM_SAMPLING or 0),
156-
"isOnPremise": settings.SENTRY_ONPREMISE,
156+
"isOnPremise": settings.SENTRY_SELF_HOSTED, # deprecated, use ...
157+
"isSelfHosted": settings.SENTRY_SELF_HOSTED, # ... this instead
157158
"invitesEnabled": settings.SENTRY_ENABLE_INVITES,
158159
"gravatarBaseUrl": settings.SENTRY_GRAVATAR_BASE_URL,
159160
"termsUrl": settings.TERMS_URL,

src/sentry/web/frontend/out.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class OutView(View):
99
def get(self, request):
10-
if not settings.SENTRY_ONPREMISE:
10+
if not settings.SENTRY_SELF_HOSTED:
1111
raise Http404
1212

1313
install_id = options.get("sentry:install-id")

src/sentry/web/helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ def get_default_context(request, existing_context=None, team=None):
2020
"URL_PREFIX": options.get("system.url-prefix"),
2121
"SINGLE_ORGANIZATION": settings.SENTRY_SINGLE_ORGANIZATION,
2222
"PLUGINS": plugins,
23-
"ONPREMISE": settings.SENTRY_ONPREMISE,
23+
"ONPREMISE": settings.SENTRY_SELF_HOSTED, # deprecated, use ...
24+
"SELF_HOSTED": settings.SENTRY_SELF_HOSTED, # ... this instead
2425
}
2526

2627
if existing_context:

src/sentry_plugins/sessionstack/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def get_config(self, project, **kwargs):
123123
},
124124
]
125125

126-
if settings.SENTRY_ONPREMISE:
126+
if settings.SENTRY_SELF_HOSTED:
127127
configurations.extend(
128128
[
129129
{

static/app/components/footer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function BaseFooter({className}: Props) {
1818
return (
1919
<footer className={className}>
2020
<LeftLinks>
21-
{config.isOnPremise && (
21+
{config.isSelfHosted && (
2222
<Fragment>
2323
{'Sentry '}
2424
{getDynamicText({
@@ -47,7 +47,7 @@ function BaseFooter({className}: Props) {
4747
<FooterLink href="https://github.com/getsentry/sentry">
4848
{t('Contribute')}
4949
</FooterLink>
50-
{config.isOnPremise && !config.demoMode && (
50+
{config.isSelfHosted && !config.demoMode && (
5151
<FooterLink href="/out/">{t('Migrate to SaaS')}</FooterLink>
5252
)}
5353
</RightLinks>

static/app/plugins/sessionstack/components/settings.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import DefaultSettings from 'sentry/plugins/components/settings';
77
type Props = DefaultSettings['props'];
88

99
type State = DefaultSettings['state'] & {
10-
showOnPremisesConfiguration?: boolean;
10+
showSelfHostedConfiguration?: boolean;
1111
};
1212

1313
class Settings extends DefaultSettings<Props, State> {
1414
REQUIRED_FIELDS = ['account_email', 'api_token', 'website_id'];
15-
ON_PREMISES_FIELDS = ['api_url', 'player_url'];
15+
SELF_HOSTED_FIELDS = ['api_url', 'player_url'];
1616

1717
renderFields(fields: State['fieldList']) {
1818
return fields?.map(f =>
@@ -29,9 +29,9 @@ class Settings extends DefaultSettings<Props, State> {
2929
return fields?.filter(field => fieldNames.includes(field.name)) ?? [];
3030
}
3131

32-
toggleOnPremisesConfiguration = () => {
32+
toggleSelfHostedConfiguration = () => {
3333
this.setState({
34-
showOnPremisesConfiguration: !this.state.showOnPremisesConfiguration,
34+
showSelfHostedConfiguration: !this.state.showSelfHostedConfiguration,
3535
});
3636
};
3737

@@ -53,9 +53,9 @@ class Settings extends DefaultSettings<Props, State> {
5353
const hasChanges = !isEqual(this.state.initialData, this.state.formData);
5454

5555
const requiredFields = this.filterFields(this.state.fieldList, this.REQUIRED_FIELDS);
56-
const onPremisesFields = this.filterFields(
56+
const selfHostedFields = this.filterFields(
5757
this.state.fieldList,
58-
this.ON_PREMISES_FIELDS
58+
this.SELF_HOSTED_FIELDS
5959
);
6060

6161
return (
@@ -68,19 +68,19 @@ class Settings extends DefaultSettings<Props, State> {
6868
</div>
6969
)}
7070
{this.renderFields(requiredFields)}
71-
{onPremisesFields.length > 0 ? (
71+
{selfHostedFields.length > 0 ? (
7272
<div className="control-group">
7373
<button
7474
className="btn btn-default"
7575
type="button"
76-
onClick={this.toggleOnPremisesConfiguration}
76+
onClick={this.toggleSelfHostedConfiguration}
7777
>
78-
Configure on-premises
78+
Configure self-hosted
7979
</button>
8080
</div>
8181
) : null}
82-
{this.state.showOnPremisesConfiguration
83-
? this.renderFields(onPremisesFields)
82+
{this.state.showSelfHostedConfiguration
83+
? this.renderFields(selfHostedFields)
8484
: null}
8585
</Form>
8686
);

static/app/types/system.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ export interface Config {
121121
invitesEnabled: boolean;
122122
privacyUrl: string | null;
123123
termsUrl: string | null;
124-
isOnPremise: boolean;
124+
isOnPremise: boolean; // deprecated, use ...
125+
isSelfHosted: boolean; // ... this instead
125126
lastOrganization: string | null;
126127
gravatarBaseUrl: string;
127128

static/app/views/alerts/issueRuleEditor/setupAlertIntegrationButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default class SetupAlertIntegrationButton extends AsyncComponent<Props, S
5555
const config = ConfigStore.getConfig();
5656
// link to docs to set up Slack for on-prem folks
5757
const referrerQuery = '?referrer=issue-alert-builder';
58-
const buttonProps = config.isOnPremise
58+
const buttonProps = config.isSelfHosted
5959
? {
6060
href: `https://develop.sentry.dev/integrations/slack/${referrerQuery}`,
6161
}

static/app/views/settings/settingsIndex.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,17 @@ class SettingsIndex extends React.Component<Props> {
6767
render() {
6868
const {organization} = this.props;
6969
const user = ConfigStore.get('user');
70-
const isOnPremise = ConfigStore.get('isOnPremise');
70+
const isSelfHosted = ConfigStore.get('isSelfHosted');
7171

7272
const organizationSettingsUrl =
7373
(organization && `/settings/${organization.slug}/`) || '';
7474

7575
const supportLinkProps = {
76-
isOnPremise,
76+
isSelfHosted,
7777
href: LINKS.FORUM,
7878
to: `${organizationSettingsUrl}support`,
7979
};
80-
const supportText = isOnPremise ? t('Community Forums') : t('Contact Support');
80+
const supportText = isSelfHosted ? t('Community Forums') : t('Contact Support');
8181

8282
return (
8383
<SentryDocumentTitle
@@ -340,7 +340,7 @@ const ExternalHomeLink = styled(
340340
`;
341341

342342
type SupportLinkProps<T extends boolean> = {
343-
isOnPremise: T;
343+
isSelfHosted: T;
344344
href: string;
345345
to: string;
346346
isCentered?: boolean;
@@ -350,12 +350,12 @@ type SupportLinkProps<T extends boolean> = {
350350

351351
const SupportLinkComponent = <T extends boolean>({
352352
isCentered,
353-
isOnPremise,
353+
isSelfHosted,
354354
href,
355355
to,
356356
...props
357357
}: SupportLinkProps<T>) =>
358-
isOnPremise ? (
358+
isSelfHosted ? (
359359
<ExternalHomeLink isCentered={isCentered} href={href} {...props} />
360360
) : (
361361
<HomeLink to={to} {...props} />

tests/fixtures/js-stubs/config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export function Config(params = {}) {
1515
invitesEnabled: false,
1616
privacyUrl: null,
1717
termsUrl: null,
18-
isOnPremise: false,
18+
isOnPremise: false, // deprecated, use ...
19+
isSelfHosted: false, // ... this instead
1920
lastOrganization: null,
2021
gravatarBaseUrl: 'https://gravatar.com',
2122
dsn: 'test-dsn',

tests/js/spec/views/settings/settingsIndex.spec.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ describe('SettingsIndex', function () {
2525
expect(wrapper.find('LoadingIndicator')).toHaveLength(1);
2626
});
2727

28-
it('has different links for on premise users', function () {
29-
ConfigStore.set('isOnPremise', true);
28+
it('has different links for self-hosted users', function () {
29+
ConfigStore.set('isSelfHosted', true);
3030

3131
wrapper = mountWithTheme(
3232
<SettingsIndex
@@ -62,7 +62,7 @@ describe('SettingsIndex', function () {
6262
api = MockApiClient.addMockResponse({
6363
url: `/organizations/${organization.slug}/`,
6464
});
65-
ConfigStore.config.isOnPremise = false;
65+
ConfigStore.config.isSelfHosted = false;
6666
wrapper = mountWithTheme(
6767
<SettingsIndex router={TestStubs.router()} params={{}} />,
6868
TestStubs.routerContext()

0 commit comments

Comments
 (0)