Browse Source

chore: remove appstore-connect frontend code (#73071)

Removes the frontend code from Sentry for `appstore-connect` integration
which will be sunsetted soon.

After merging this in, we also need to remove the backend
implementation.

cc @kahest @jernejstrasner 

Ref: https://github.com/getsentry/sentry/issues/51994
Yagiz Nizipli 8 months ago
parent
commit
5eb86dd98e

+ 1 - 12
static/app/actionCreators/modal.tsx

@@ -10,10 +10,9 @@ import type {OverwriteWidgetModalProps} from 'sentry/components/modals/widgetBui
 import type {WidgetViewerModalOptions} from 'sentry/components/modals/widgetViewerModal';
 import type {Category} from 'sentry/components/platformPicker';
 import ModalStore from 'sentry/stores/modalStore';
-import type {AppStoreConnectStatusData, CustomRepoType} from 'sentry/types/debugFiles';
+import type {CustomRepoType} from 'sentry/types/debugFiles';
 import type {Event} from 'sentry/types/event';
 import type {Group, IssueOwnership} from 'sentry/types/group';
-import type {SentryApp} from 'sentry/types/integrations';
 import type {MissingMember, Organization, OrgRole, Team} from 'sentry/types/organization';
 import type {Project} from 'sentry/types/project';
 import {WidgetType} from 'sentry/views/dashboards/types';
@@ -199,20 +198,10 @@ export async function openHelpSearchModal(options?: HelpSearchModalOptions) {
   openModal(deps => <Modal {...deps} {...options} />, {modalCss});
 }
 
-export type SentryAppDetailsModalOptions = {
-  isInstalled: boolean;
-  onInstall: () => Promise<void>;
-  organization: Organization;
-  sentryApp: SentryApp;
-  onCloseModal?: () => void; // used for analytics
-};
-
 type DebugFileSourceModalOptions = {
-  appStoreConnectSourcesQuantity: number;
   onSave: (data: Record<string, any>) => Promise<void>;
   organization: Organization;
   sourceType: CustomRepoType;
-  appStoreConnectStatusData?: AppStoreConnectStatusData;
   onClose?: () => void;
   sourceConfig?: Record<string, any>;
 };

+ 0 - 20
static/app/components/globalAppStoreConnectUpdateAlert/index.tsx

@@ -1,20 +0,0 @@
-import * as AppStoreConnectContext from 'sentry/components/projects/appStoreConnectContext';
-import type {Organization} from 'sentry/types/organization';
-import type {Project} from 'sentry/types/project';
-
-import UpdateAlert from './updateAlert';
-
-type Props = Pick<React.ComponentProps<typeof UpdateAlert>, 'className' | 'Wrapper'> & {
-  organization: Organization;
-  project?: Project;
-};
-
-function GlobalAppStoreConnectUpdateAlert({project, organization, ...rest}: Props) {
-  return (
-    <AppStoreConnectContext.Provider project={project} organization={organization}>
-      <UpdateAlert project={project} {...rest} />
-    </AppStoreConnectContext.Provider>
-  );
-}
-
-export default GlobalAppStoreConnectUpdateAlert;

+ 0 - 64
static/app/components/globalAppStoreConnectUpdateAlert/updateAlert.tsx

@@ -1,64 +0,0 @@
-import {useContext} from 'react';
-import styled from '@emotion/styled';
-
-import {Alert} from 'sentry/components/alert';
-import AppStoreConnectContext from 'sentry/components/projects/appStoreConnectContext';
-import {space} from 'sentry/styles/space';
-import type {Project} from 'sentry/types/project';
-
-type Props = {
-  Wrapper?: React.ComponentType<React.PropsWithChildren<{}>>;
-  className?: string;
-  project?: Project;
-};
-
-function UpdateAlert({Wrapper, project, className}: Props) {
-  const appStoreConnectContext = useContext(AppStoreConnectContext);
-
-  if (
-    !project ||
-    !appStoreConnectContext ||
-    !Object.keys(appStoreConnectContext).some(
-      key => !!appStoreConnectContext[key].updateAlertMessage
-    )
-  ) {
-    return null;
-  }
-
-  const notices = (
-    <Notices className={className}>
-      {Object.keys(appStoreConnectContext).map(key => {
-        const {updateAlertMessage} = appStoreConnectContext[key];
-        if (!updateAlertMessage) {
-          return null;
-        }
-
-        return (
-          <NoMarginBottomAlert key={key} type="warning" showIcon>
-            <AlertContent>{updateAlertMessage}</AlertContent>
-          </NoMarginBottomAlert>
-        );
-      })}
-    </Notices>
-  );
-
-  return Wrapper ? <Wrapper>{notices}</Wrapper> : notices;
-}
-
-export default UpdateAlert;
-
-const Notices = styled('div')`
-  display: grid;
-  gap: ${space(2)};
-  margin-bottom: ${space(3)};
-`;
-
-const NoMarginBottomAlert = styled(Alert)`
-  margin-bottom: 0;
-`;
-
-const AlertContent = styled('div')`
-  display: grid;
-  grid-template-columns: 1fr max-content;
-  gap: ${space(1)};
-`;

+ 0 - 403
static/app/components/modals/debugFileCustomRepository/appStoreConnect/index.tsx

@@ -1,403 +0,0 @@
-import {Fragment, useState} from 'react';
-import styled from '@emotion/styled';
-
-import {addErrorMessage, addSuccessMessage} from 'sentry/actionCreators/indicator';
-import type {ModalRenderProps} from 'sentry/actionCreators/modal';
-import type {Client} from 'sentry/api';
-import {Alert} from 'sentry/components/alert';
-import {Button} from 'sentry/components/button';
-import ButtonBar from 'sentry/components/buttonBar';
-import LoadingIndicator from 'sentry/components/loadingIndicator';
-import {DEFAULT_TOAST_DURATION} from 'sentry/constants';
-import {t, tct} from 'sentry/locale';
-import {space} from 'sentry/styles/space';
-import type {
-  AppStoreConnectStatusData,
-  CustomRepoAppStoreConnect,
-} from 'sentry/types/debugFiles';
-import type {Organization} from 'sentry/types/organization';
-import type {Project} from 'sentry/types/project';
-import {unexpectedErrorMessage} from 'sentry/utils/appStoreValidationErrorMessage';
-import withApi from 'sentry/utils/withApi';
-
-import StepOne from './stepOne';
-import StepTwo from './stepTwo';
-import type {AppStoreApp, StepOneData, StepTwoData} from './types';
-import {getAppStoreErrorMessage} from './utils';
-
-type Props = Pick<ModalRenderProps, 'Header' | 'Body' | 'Footer'> & {
-  api: Client;
-  onSubmit: () => void;
-  orgSlug: Organization['slug'];
-  projectSlug: Project['slug'];
-  appStoreConnectStatusData?: AppStoreConnectStatusData;
-  initialData?: CustomRepoAppStoreConnect;
-};
-
-const steps = [t('App Store Connect credentials'), t('Choose an application')];
-
-function AppStoreConnect({
-  Header,
-  Body,
-  Footer,
-  api,
-  initialData,
-  orgSlug,
-  projectSlug,
-  onSubmit,
-  appStoreConnectStatusData,
-}: Props) {
-  const {credentials} = appStoreConnectStatusData ?? {};
-
-  const [isLoading, setIsLoading] = useState(false);
-  const [activeStep, setActiveStep] = useState(0);
-  const [appStoreApps, setAppStoreApps] = useState<AppStoreApp[]>([]);
-
-  const [stepOneData, setStepOneData] = useState<StepOneData>({
-    issuer: initialData?.appconnectIssuer,
-    keyId: initialData?.appconnectKey,
-    privateKey: typeof initialData?.appconnectPrivateKey === 'object' ? undefined : '',
-    errors: undefined,
-  });
-
-  const [stepTwoData, setStepTwoData] = useState<StepTwoData>({
-    app: undefined,
-  });
-
-  async function checkCredentials() {
-    setIsLoading(true);
-
-    try {
-      const response = await api.requestPromise(
-        `/projects/${orgSlug}/${projectSlug}/appstoreconnect/apps/`,
-        {
-          method: 'POST',
-          data: {
-            id: stepOneData.privateKey !== undefined ? undefined : initialData?.id,
-            appconnectIssuer: stepOneData.issuer,
-            appconnectKey: stepOneData.keyId,
-            appconnectPrivateKey: stepOneData.privateKey,
-          },
-        }
-      );
-
-      const storeApps: AppStoreApp[] = response.apps;
-
-      if (!!initialData && !storeApps.find(app => app.appId === initialData.appId)) {
-        addErrorMessage(t('Credentials not authorized for this application'));
-        setIsLoading(false);
-        return;
-      }
-
-      setAppStoreApps(storeApps);
-
-      if (
-        stepTwoData.app?.appId &&
-        !storeApps.find(app => app.appId === stepTwoData.app?.appId)
-      ) {
-        setStepTwoData({app: storeApps[0]});
-      }
-
-      if (initialData) {
-        updateCredentials();
-        return;
-      }
-
-      setIsLoading(false);
-      goNext();
-    } catch (error) {
-      setIsLoading(false);
-      const appStoreConnnectError = getAppStoreErrorMessage(error);
-      if (typeof appStoreConnnectError === 'string') {
-        // app-connect-authentication-error
-        // app-connect-forbidden-error
-        addErrorMessage(appStoreConnnectError);
-        return;
-      }
-      setStepOneData({...stepOneData, errors: appStoreConnnectError});
-    }
-  }
-
-  function closeModal() {
-    setTimeout(() => onSubmit(), DEFAULT_TOAST_DURATION);
-  }
-
-  async function updateCredentials() {
-    if (!initialData) {
-      return;
-    }
-
-    try {
-      await api.requestPromise(
-        `/projects/${orgSlug}/${projectSlug}/appstoreconnect/${initialData.id}/`,
-        {
-          method: 'POST',
-          data: {
-            appconnectIssuer: stepOneData.issuer,
-            appconnectKey: stepOneData.keyId,
-            appconnectPrivateKey: stepOneData.privateKey,
-            appName: initialData.appName,
-            appId: initialData.appId,
-            bundleId: initialData.bundleId,
-          },
-        }
-      );
-
-      addSuccessMessage(t('Successfully updated custom repository'));
-      closeModal();
-    } catch (error) {
-      setIsLoading(false);
-      const appStoreConnnectError = getAppStoreErrorMessage(error);
-
-      if (typeof appStoreConnnectError === 'string') {
-        if (appStoreConnnectError === unexpectedErrorMessage) {
-          addErrorMessage(t('An error occurred while updating the custom repository'));
-          return;
-        }
-        addErrorMessage(appStoreConnnectError);
-      }
-    }
-  }
-
-  async function persistData() {
-    if (!stepTwoData.app) {
-      return;
-    }
-
-    setIsLoading(true);
-
-    try {
-      await api.requestPromise(`/projects/${orgSlug}/${projectSlug}/appstoreconnect/`, {
-        method: 'POST',
-        data: {
-          appconnectIssuer: stepOneData.issuer,
-          appconnectKey: stepOneData.keyId,
-          appconnectPrivateKey: stepOneData.privateKey,
-          appName: stepTwoData.app.name,
-          appId: stepTwoData.app.appId,
-          bundleId: stepTwoData.app.bundleId,
-        },
-      });
-
-      addSuccessMessage(t('Successfully added custom repository'));
-      closeModal();
-    } catch (error) {
-      setIsLoading(false);
-      const appStoreConnnectError = getAppStoreErrorMessage(error);
-
-      if (typeof appStoreConnnectError === 'string') {
-        if (appStoreConnnectError === unexpectedErrorMessage) {
-          addErrorMessage(t('An error occurred while adding the custom repository'));
-          return;
-        }
-        addErrorMessage(appStoreConnnectError);
-      }
-    }
-  }
-
-  function isFormInvalid() {
-    switch (activeStep) {
-      case 0:
-        return Object.keys(stepOneData).some(key => {
-          if (key === 'errors') {
-            const errors = stepOneData[key] ?? {};
-            return Object.keys(errors).some(error => !!errors[error]);
-          }
-
-          if (key === 'privateKey' && stepOneData[key] === undefined) {
-            return false;
-          }
-
-          return !stepOneData[key];
-        });
-      case 1:
-        return Object.keys(stepTwoData).some(key => !stepTwoData[key]);
-      default:
-        return false;
-    }
-  }
-
-  function goNext() {
-    setActiveStep(activeStep + 1);
-  }
-
-  function handleGoBack() {
-    const newActiveStep = activeStep - 1;
-    setActiveStep(newActiveStep);
-  }
-
-  function handleGoNext() {
-    switch (activeStep) {
-      case 0:
-        checkCredentials();
-        break;
-      case 1:
-        persistData();
-        break;
-      default:
-        break;
-    }
-  }
-
-  function renderCurrentStep() {
-    switch (activeStep) {
-      case 0:
-        return <StepOne stepOneData={stepOneData} onSetStepOneData={setStepOneData} />;
-      case 1:
-        return (
-          <StepTwo
-            appStoreApps={appStoreApps}
-            stepTwoData={stepTwoData}
-            onSetStepTwoData={setStepTwoData}
-          />
-        );
-      default:
-        return (
-          <Alert type="error" showIcon>
-            {t('This step could not be found.')}
-          </Alert>
-        );
-    }
-  }
-
-  function getAlerts() {
-    const alerts: React.ReactElement[] = [];
-
-    if (activeStep !== 0) {
-      return alerts;
-    }
-
-    if (credentials?.status === 'invalid') {
-      alerts.push(
-        <StyledAlert type="warning" showIcon>
-          {credentials.code === 'app-connect-forbidden-error'
-            ? t(
-                'Your App Store Connect credentials have insufficient permissions. To reconnect, update your credentials.'
-              )
-            : t(
-                'Your App Store Connect credentials are invalid. To reconnect, update your credentials.'
-              )}
-        </StyledAlert>
-      );
-    }
-
-    return alerts;
-  }
-
-  function renderBodyContent() {
-    const alerts = getAlerts();
-
-    return (
-      <Fragment>
-        {!!alerts.length && (
-          <Alerts>
-            {alerts.map((alert, index) => (
-              <Fragment key={index}>{alert}</Fragment>
-            ))}
-          </Alerts>
-        )}
-        {renderCurrentStep()}
-      </Fragment>
-    );
-  }
-
-  if (initialData && !appStoreConnectStatusData) {
-    return <LoadingIndicator />;
-  }
-
-  return (
-    <Fragment>
-      <Header closeButton>
-        <HeaderContent>
-          <NumericSymbol>{activeStep + 1}</NumericSymbol>
-          <HeaderContentTitle>{steps[activeStep]}</HeaderContentTitle>
-          <StepsOverview>
-            {tct('[currentStep] of [totalSteps]', {
-              currentStep: activeStep + 1,
-              totalSteps: initialData ? 1 : steps.length,
-            })}
-          </StepsOverview>
-        </HeaderContent>
-      </Header>
-      <Body>{renderBodyContent()}</Body>
-      <Footer>
-        <ButtonBar gap={1}>
-          {activeStep !== 0 && <Button onClick={handleGoBack}>{t('Back')}</Button>}
-          <StyledButton
-            priority="primary"
-            onClick={handleGoNext}
-            disabled={isLoading || isFormInvalid()}
-          >
-            {isLoading && (
-              <LoadingIndicatorWrapper>
-                <LoadingIndicator mini />
-              </LoadingIndicatorWrapper>
-            )}
-            {initialData
-              ? t('Update')
-              : activeStep + 1 === steps.length
-                ? t('Save')
-                : steps[activeStep + 1]}
-          </StyledButton>
-        </ButtonBar>
-      </Footer>
-    </Fragment>
-  );
-}
-
-export default withApi(AppStoreConnect);
-
-const HeaderContent = styled('div')`
-  display: grid;
-  grid-template-columns: max-content max-content 1fr;
-  align-items: center;
-  gap: ${space(1)};
-`;
-
-const NumericSymbol = styled('div')`
-  border-radius: 50%;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-  width: 24px;
-  height: 24px;
-  font-weight: ${p => p.theme.fontWeightBold};
-  font-size: ${p => p.theme.fontSizeMedium};
-  background-color: ${p => p.theme.yellow300};
-`;
-
-const HeaderContentTitle = styled('div')`
-  font-weight: ${p => p.theme.fontWeightBold};
-  font-size: ${p => p.theme.fontSizeExtraLarge};
-`;
-
-const StepsOverview = styled('div')`
-  color: ${p => p.theme.gray300};
-  display: flex;
-  justify-content: flex-end;
-`;
-
-const LoadingIndicatorWrapper = styled('div')`
-  height: 100%;
-  position: absolute;
-  width: 100%;
-  top: 0;
-  left: 0;
-  display: flex;
-  align-items: center;
-  justify-content: center;
-`;
-
-const StyledButton = styled(Button)`
-  position: relative;
-`;
-
-const Alerts = styled('div')`
-  display: grid;
-  gap: ${space(1.5)};
-  margin-bottom: ${space(3)};
-`;
-
-const StyledAlert = styled(Alert)`
-  margin: 0;
-`;

+ 0 - 107
static/app/components/modals/debugFileCustomRepository/appStoreConnect/stepOne.tsx

@@ -1,107 +0,0 @@
-import {Fragment} from 'react';
-
-import {Alert} from 'sentry/components/alert';
-import Textarea from 'sentry/components/forms/controls/textarea';
-import FieldGroup from 'sentry/components/forms/fieldGroup';
-import Input from 'sentry/components/input';
-import ExternalLink from 'sentry/components/links/externalLink';
-import {t, tct} from 'sentry/locale';
-
-import type {StepOneData} from './types';
-
-type Props = {
-  onSetStepOneData: (stepOneData: StepOneData) => void;
-  stepOneData: StepOneData;
-};
-
-function StepOne({stepOneData, onSetStepOneData}: Props) {
-  return (
-    <Fragment>
-      <Alert type="info">
-        {tct(
-          'Please enter the [docLink:App Store Connect API Key] details. The key needs to have the "Developer" role for Sentry to discover the app builds.',
-          {
-            docLink: (
-              <ExternalLink href="https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api" />
-            ),
-          }
-        )}
-      </Alert>
-      <FieldGroup
-        label={t('Issuer')}
-        inline={false}
-        error={stepOneData.errors?.issuer}
-        flexibleControlStateSize
-        stacked
-        required
-      >
-        <Input
-          type="text"
-          name="issuer"
-          placeholder={t('Issuer')}
-          value={stepOneData.issuer}
-          onChange={e =>
-            onSetStepOneData({
-              ...stepOneData,
-              issuer: e.target.value,
-              errors: stepOneData.errors
-                ? {...stepOneData.errors, issuer: undefined}
-                : undefined,
-            })
-          }
-        />
-      </FieldGroup>
-      <FieldGroup
-        label={t('Key ID')}
-        inline={false}
-        error={stepOneData.errors?.keyId}
-        flexibleControlStateSize
-        stacked
-        required
-      >
-        <Input
-          type="text"
-          name="keyId"
-          placeholder={t('Key Id')}
-          value={stepOneData.keyId}
-          onChange={e =>
-            onSetStepOneData({
-              ...stepOneData,
-              keyId: e.target.value,
-              errors: stepOneData.errors
-                ? {...stepOneData.errors, keyId: undefined}
-                : undefined,
-            })
-          }
-        />
-      </FieldGroup>
-      <FieldGroup
-        label={t('Private Key')}
-        inline={false}
-        flexibleControlStateSize
-        stacked
-        required
-      >
-        <Textarea
-          name="privateKey"
-          value={stepOneData.privateKey}
-          rows={5}
-          autosize
-          placeholder={
-            stepOneData.privateKey === undefined
-              ? t('(Private Key unchanged)')
-              : '-----BEGIN PRIVATE KEY-----\n[PRIVATE-KEY]\n-----END PRIVATE KEY-----'
-          }
-          onChange={e =>
-            onSetStepOneData({
-              ...stepOneData,
-              privateKey: e.target.value,
-            })
-          }
-        />
-      </FieldGroup>
-    </Fragment>
-  );
-}
-
-export default StepOne;

+ 0 - 43
static/app/components/modals/debugFileCustomRepository/appStoreConnect/stepTwo.tsx

@@ -1,43 +0,0 @@
-import styled from '@emotion/styled';
-
-import SelectField from 'sentry/components/forms/fields/selectField';
-import {t} from 'sentry/locale';
-
-import type {AppStoreApp, StepTwoData} from './types';
-
-type Props = {
-  appStoreApps: AppStoreApp[];
-  onSetStepTwoData: (stepTwoData: StepTwoData) => void;
-  stepTwoData: StepTwoData;
-};
-
-function StepTwo({stepTwoData, onSetStepTwoData, appStoreApps}: Props) {
-  return (
-    <StyledSelectField
-      name="application"
-      label={t('App Store Connect application')}
-      options={appStoreApps.map(appStoreApp => ({
-        value: appStoreApp.appId,
-        label: appStoreApp.name,
-      }))}
-      placeholder={t('Select application')}
-      onChange={appId => {
-        const selectedAppStoreApp = appStoreApps.find(
-          appStoreApp => appStoreApp.appId === appId
-        );
-        onSetStepTwoData({app: selectedAppStoreApp});
-      }}
-      value={stepTwoData.app?.appId ?? ''}
-      inline={false}
-      flexibleControlStateSize
-      stacked
-      required
-    />
-  );
-}
-
-export default StepTwo;
-
-const StyledSelectField = styled(SelectField)`
-  padding-right: 0;
-`;

+ 0 - 16
static/app/components/modals/debugFileCustomRepository/appStoreConnect/types.tsx

@@ -1,16 +0,0 @@
-export type AppStoreApp = {
-  appId: string;
-  bundleId: string;
-  name: string;
-};
-
-export type StepOneData = {
-  errors?: Record<keyof StepOneData, string | undefined>;
-  issuer?: string;
-  keyId?: string;
-  privateKey?: string;
-};
-
-export type StepTwoData = {
-  app?: AppStoreApp;
-};

+ 0 - 99
static/app/components/modals/debugFileCustomRepository/appStoreConnect/utils.tsx

@@ -1,99 +0,0 @@
-import * as Sentry from '@sentry/react';
-
-import {t} from 'sentry/locale';
-import {
-  getAppStoreValidationErrorMessage,
-  unexpectedErrorMessage,
-} from 'sentry/utils/appStoreValidationErrorMessage';
-
-import type {StepOneData} from './types';
-
-// since translations are done on the front-end we need to map  back-end error messages to front-end messages
-const fieldErrorMessageMapping = {
-  appconnectIssuer: {
-    issuer: {
-      'Ensure this field has at least 36 characters.': t(
-        'This field should be exactly 36 characters.'
-      ),
-      'Ensure this field has no more than 36 characters.': t(
-        'This field should be exactly 36 characters.'
-      ),
-    },
-  },
-  appconnectKey: {
-    keyId: {
-      'Ensure this field has at least 2 characters.': t(
-        'This field should be between 2 and 20 characters.'
-      ),
-      'Ensure this field has no more than 20 characters.': t(
-        'This field should be between 2 and 20 characters.'
-      ),
-    },
-  },
-};
-
-type ResponseJSONDetailed = {
-  detail: Parameters<typeof getAppStoreValidationErrorMessage>[0] & {
-    extra: Record<string, any>;
-    message: string;
-  };
-};
-
-type AppStoreConnectField = keyof typeof fieldErrorMessageMapping;
-
-type ResponseJSON = Record<AppStoreConnectField, string[]>;
-
-type Error = {
-  status: number;
-  responseJSON?: ResponseJSON | ResponseJSONDetailed;
-};
-
-export function getAppStoreErrorMessage(
-  error: Error | string
-): string | Record<keyof StepOneData, string> {
-  if (typeof error === 'string') {
-    return error;
-  }
-
-  const detailedErrorResponse = (error.responseJSON as undefined | ResponseJSONDetailed)
-    ?.detail;
-
-  if (detailedErrorResponse) {
-    return getAppStoreValidationErrorMessage(detailedErrorResponse) as string;
-  }
-
-  const errorResponse = error.responseJSON as undefined | ResponseJSON;
-
-  if (!errorResponse) {
-    return unexpectedErrorMessage;
-  }
-
-  return (Object.keys(errorResponse) as AppStoreConnectField[]).reduce(
-    (acc, serverSideField) => {
-      const fieldErrorMessage = fieldErrorMessageMapping[serverSideField] ?? {};
-      const field = Object.keys(fieldErrorMessage)[0];
-
-      const errorMessages: string[] = errorResponse[serverSideField].map(errorMessage => {
-        if (fieldErrorMessage[field][errorMessage]) {
-          return fieldErrorMessage[field][errorMessage];
-        }
-
-        // This will be difficult to happen,
-        // but if it happens we will be able to see which message is not being mapped on the fron-tend
-        Sentry.withScope(scope => {
-          scope.setExtra('serverSideField', serverSideField);
-          scope.setExtra('message', errorMessage);
-          Sentry.captureException(
-            new Error('App Store Connect - Untranslated error message')
-          );
-        });
-
-        return errorMessage;
-      });
-
-      // the UI only displays one error message at a time
-      return {...acc, [field]: errorMessages[0]};
-    },
-    {}
-  ) as Record<keyof StepOneData, string>;
-}

+ 0 - 62
static/app/components/modals/debugFileCustomRepository/index.tsx

@@ -9,27 +9,15 @@ import Form from 'sentry/components/forms/form';
 import HookOrDefault from 'sentry/components/hookOrDefault';
 import {getDebugSourceName} from 'sentry/data/debugFileSources';
 import {t, tct} from 'sentry/locale';
-import type {AppStoreConnectStatusData} from 'sentry/types/debugFiles';
 import {CustomRepoType} from 'sentry/types/debugFiles';
 import type {Organization} from 'sentry/types/organization';
-import {useParams} from 'sentry/utils/useParams';
 
-import AppStoreConnect from './appStoreConnect';
 import Http from './http';
 import {getFinalData, getFormFieldsAndInitialData} from './utils';
 
-type AppStoreConnectInitialData = React.ComponentProps<
-  typeof AppStoreConnect
->['initialData'];
-
 type HttpInitialData = React.ComponentProps<typeof Http>['initialData'];
 
-type RouteParams = {
-  projectId: string;
-};
-
 type Props = {
-  appStoreConnectSourcesQuantity: number;
   /**
    * Callback invoked with the updated config value.
    */
@@ -39,19 +27,12 @@ type Props = {
    * Type of this source.
    */
   sourceType: CustomRepoType;
-
-  appStoreConnectStatusData?: AppStoreConnectStatusData;
   /**
    * The sourceConfig. May be empty to create a new one.
    */
   sourceConfig?: Record<string, any>;
 } & Pick<ModalRenderProps, 'Header' | 'Body' | 'Footer' | 'closeModal' | 'CloseButton'>;
 
-const HookedAppStoreConnectMultiple = HookOrDefault({
-  hookName: 'component:disabled-app-store-connect-multiple',
-  defaultComponent: ({children}) => <Fragment>{children}</Fragment>,
-});
-
 const HookedCustomSymbolSources = HookOrDefault({
   hookName: 'component:disabled-custom-symbol-sources',
   defaultComponent: ({children}) => <Fragment>{children}</Fragment>,
@@ -65,12 +46,9 @@ function DebugFileCustomRepository({
   onSave,
   sourceConfig,
   sourceType,
-  appStoreConnectStatusData,
   closeModal,
   organization,
-  appStoreConnectSourcesQuantity,
 }: Props) {
-  const {projectId: projectSlug} = useParams<RouteParams>();
   function handleSave(data?: Record<string, any>) {
     if (!data) {
       closeModal();
@@ -83,46 +61,6 @@ function DebugFileCustomRepository({
     });
   }
 
-  if (sourceType === CustomRepoType.APP_STORE_CONNECT) {
-    return (
-      <Feature organization={organization} features="app-store-connect-multiple">
-        {({hasFeature, features}) => {
-          if (
-            hasFeature ||
-            (appStoreConnectSourcesQuantity === 1 && sourceConfig) ||
-            appStoreConnectSourcesQuantity === 0
-          ) {
-            return (
-              <AppStoreConnect
-                Header={Header}
-                Body={Body}
-                Footer={Footer}
-                orgSlug={organization.slug}
-                projectSlug={projectSlug}
-                onSubmit={handleSave}
-                initialData={sourceConfig as AppStoreConnectInitialData}
-                appStoreConnectStatusData={appStoreConnectStatusData}
-              />
-            );
-          }
-
-          return (
-            <Fragment>
-              <CloseButton />
-              <HookedAppStoreConnectMultiple organization={organization}>
-                <FeatureDisabled
-                  features={features}
-                  featureName={t('App Store Connect Multiple')}
-                  hideHelpToggle
-                />
-              </HookedAppStoreConnectMultiple>
-            </Fragment>
-          );
-        }}
-      </Feature>
-    );
-  }
-
   return (
     <Feature organization={organization} features="custom-symbol-sources">
       {({hasFeature, features}) => {

+ 2 - 2
static/app/components/modals/debugFileCustomRepository/utils.tsx

@@ -66,7 +66,7 @@ export function getFormFieldsAndInitialData(
   type: CustomRepoType,
   sourceConfig?: Record<string, any>
 ) {
-  if (type === CustomRepoType.HTTP || type === CustomRepoType.APP_STORE_CONNECT) {
+  if (type === CustomRepoType.HTTP) {
     return {};
   }
 
@@ -212,7 +212,7 @@ export function getFormFieldsAndInitialData(
 }
 
 export function getFinalData(type: CustomRepoType, data: Record<string, any>) {
-  if (type === CustomRepoType.HTTP || type === CustomRepoType.APP_STORE_CONNECT) {
+  if (type === CustomRepoType.HTTP) {
     return data;
   }
 

Some files were not shown because too many files changed in this diff