diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 41e942fbc7cd70..75e586ab5d82e3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -866,6 +866,10 @@ tests/sentry/api/endpoints/test_organization_attribute_mappings.py @get /tests/sentry/scm/ @getsentry/scm ## End of SCM +## SCM Frontend +/static/app/components/repositories @getsentry/coding-workflows-sentry-frontend @getsentry/scm +## End of SCM Frontend + # End of Coding Workflows # Conduit diff --git a/.github/codeowners-coverage-baseline.txt b/.github/codeowners-coverage-baseline.txt index 3b19ec26e909ba..1d3ee12af227dc 100644 --- a/.github/codeowners-coverage-baseline.txt +++ b/.github/codeowners-coverage-baseline.txt @@ -752,8 +752,6 @@ static/app/components/hook.spec.tsx static/app/components/hook.tsx static/app/components/hookOrDefault.spec.tsx static/app/components/hookOrDefault.tsx -static/app/components/hotkeysLabel.spec.tsx -static/app/components/hotkeysLabel.tsx static/app/components/hovercard.spec.tsx static/app/components/hovercard.tsx static/app/components/iconCircledNumber.tsx diff --git a/src/sentry_plugins/jira/plugin.py b/src/sentry_plugins/jira/plugin.py index 47d44c77bb1477..fb9427e71702ad 100644 --- a/src/sentry_plugins/jira/plugin.py +++ b/src/sentry_plugins/jira/plugin.py @@ -89,7 +89,7 @@ def build_dynamic_field(self, group, field_meta): schema.get("items") == "user" or schema["type"] == "user" ): fieldtype = "select" - sentry_url = f"/api/0/issues/{group.id}/plugins/{self.slug}/autocomplete" + sentry_url = f"/api/0/organizations/{group.organization.slug}/issues/{group.id}/plugins/{self.slug}/autocomplete" fkwargs["url"] = "{}?jira_url={}".format( sentry_url, quote_plus(field_meta["autoCompleteUrl"]), diff --git a/static/app/components/alerts/pageBanner.stories.tsx b/static/app/components/alerts/pageBanner.stories.tsx index 445eb0ab1ad42e..6c7d85bf55c492 100644 --- a/static/app/components/alerts/pageBanner.stories.tsx +++ b/static/app/components/alerts/pageBanner.stories.tsx @@ -4,6 +4,7 @@ import styled from '@emotion/styled'; import replaysDeadRageBackground from 'sentry-images/spot/replay-dead-rage-changelog.svg'; import {Button, LinkButton} from '@sentry/scraps/button'; +import {InlineCode} from '@sentry/scraps/code'; import {ExternalLink} from '@sentry/scraps/link'; import {PageBanner} from 'sentry/components/alerts/pageBanner'; @@ -42,7 +43,7 @@ export default Storybook.story('PageBanner', story => {

This example renders an X in the top-right corner. You can wire it up with - something like useDismissAlert(). + something like useDismissAlert().

Is Dismissed? {String(isDismissed)} @@ -72,7 +73,7 @@ export default Storybook.story('PageBanner', story => {

The banner will resize if it's shrunk really narrow. To make it expand inside a - flex parent set flex-grow:1. + flex parent set flex-grow:1.

+ + {field.state.value + ? t( + '%s of %s existing repos have code review enabled', + reposWithCodeReviewCount, + seerReposCount + ) + : t( + '%s of %s existing repos have code review disabled', + seerReposCount - reposWithCodeReviewCount, + seerReposCount + )} + + + + )} + + + + {field => ( + + } + )} + > + + + + + + + + + )} + + + ); +} diff --git a/static/gsApp/views/seerAutomation/components/repoDetails/repoDetailsForm.tsx b/static/gsApp/views/seerAutomation/components/repoDetails/repoDetailsForm.tsx index 36d787f8fba4e1..661b2a7301d171 100644 --- a/static/gsApp/views/seerAutomation/components/repoDetails/repoDetailsForm.tsx +++ b/static/gsApp/views/seerAutomation/components/repoDetails/repoDetailsForm.tsx @@ -3,12 +3,12 @@ import {Stack} from '@sentry/scraps/layout'; import {Form} from 'sentry/components/forms/form'; import JsonForm from 'sentry/components/forms/jsonForm'; +import {type RepositorySettings} from 'sentry/components/repositories/useBulkUpdateRepositorySettings'; import {t, tct} from 'sentry/locale'; import {type RepositoryWithSettings} from 'sentry/types/integrations'; import type {Organization} from 'sentry/types/organization'; import {useCanWriteSettings} from 'getsentry/views/seerAutomation/components/useCanWriteSettings'; -import {type RepositorySettings} from 'getsentry/views/seerAutomation/onboarding/hooks/useBulkUpdateRepositorySettings'; interface Props { organization: Organization; diff --git a/static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx b/static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx index 4e065e988b1a4d..87ea64f66ada6d 100644 --- a/static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx +++ b/static/gsApp/views/seerAutomation/components/repoTable/seerRepoTable.tsx @@ -20,6 +20,8 @@ import {LoadingError} from 'sentry/components/loadingError'; import {LoadingIndicator} from 'sentry/components/loadingIndicator'; import {Panel} from 'sentry/components/panels/panel'; import {ScmRepoTreeModal} from 'sentry/components/repositories/scmRepoTreeModal'; +import {useBulkUpdateRepositorySettings} from 'sentry/components/repositories/useBulkUpdateRepositorySettings'; +import {getRepositoryWithSettingsQueryKey} from 'sentry/components/repositories/useRepositoryWithSettings'; import {IconAdd} from 'sentry/icons'; import {IconSearch} from 'sentry/icons/iconSearch'; import {t, tct} from 'sentry/locale'; @@ -35,8 +37,6 @@ import {useOrganization} from 'sentry/utils/useOrganization'; import {SeerRepoTableHeader} from 'getsentry/views/seerAutomation/components/repoTable/seerRepoTableHeader'; import {SeerRepoTableRow} from 'getsentry/views/seerAutomation/components/repoTable/seerRepoTableRow'; -import {useBulkUpdateRepositorySettings} from 'getsentry/views/seerAutomation/onboarding/hooks/useBulkUpdateRepositorySettings'; -import {getRepositoryWithSettingsQueryKey} from 'getsentry/views/seerAutomation/onboarding/hooks/useRepositoryWithSettings'; const GRID_COLUMNS = '40px 1fr 118px 150px'; const SELECTED_ROW_HEIGHT = 44; diff --git a/static/gsApp/views/seerAutomation/components/repoTable/seerRepoTableHeader.tsx b/static/gsApp/views/seerAutomation/components/repoTable/seerRepoTableHeader.tsx index 54464c61b68585..2154026373c489 100644 --- a/static/gsApp/views/seerAutomation/components/repoTable/seerRepoTableHeader.tsx +++ b/static/gsApp/views/seerAutomation/components/repoTable/seerRepoTableHeader.tsx @@ -8,6 +8,7 @@ import {Flex} from '@sentry/scraps/layout'; import {addErrorMessage, addSuccessMessage} from 'sentry/actionCreators/indicator'; import {DropdownMenu} from 'sentry/components/dropdownMenu'; import {QuestionTooltip} from 'sentry/components/questionTooltip'; +import type {useBulkUpdateRepositorySettings} from 'sentry/components/repositories/useBulkUpdateRepositorySettings'; import {SimpleTable} from 'sentry/components/tables/simpleTable'; import {t, tct, tn} from 'sentry/locale'; import {parseQueryKey} from 'sentry/utils/api/apiQueryKey'; @@ -15,7 +16,6 @@ import type {Sort} from 'sentry/utils/discover/fields'; import {useListItemCheckboxContext} from 'sentry/utils/list/useListItemCheckboxState'; import {useCanWriteSettings} from 'getsentry/views/seerAutomation/components/useCanWriteSettings'; -import type {useBulkUpdateRepositorySettings} from 'getsentry/views/seerAutomation/onboarding/hooks/useBulkUpdateRepositorySettings'; interface Props { gridColumns: string; diff --git a/static/gsApp/views/seerAutomation/components/repoTable/seerRepoTableRow.tsx b/static/gsApp/views/seerAutomation/components/repoTable/seerRepoTableRow.tsx index ecca8455caf784..0208f6e6de1bd7 100644 --- a/static/gsApp/views/seerAutomation/components/repoTable/seerRepoTableRow.tsx +++ b/static/gsApp/views/seerAutomation/components/repoTable/seerRepoTableRow.tsx @@ -12,6 +12,11 @@ import { addSuccessMessage, } from 'sentry/actionCreators/indicator'; import {getRepoStatusLabel} from 'sentry/components/repositories/getRepoStatusLabel'; +import {useBulkUpdateRepositorySettings} from 'sentry/components/repositories/useBulkUpdateRepositorySettings'; +import { + getRepositoryWithSettingsQueryKey, + useRepositoryWithSettings, +} from 'sentry/components/repositories/useRepositoryWithSettings'; import {SimpleTable} from 'sentry/components/tables/simpleTable'; import {IconOpen} from 'sentry/icons/iconOpen'; import {t} from 'sentry/locale'; @@ -26,11 +31,6 @@ import {useQueryClient} from 'sentry/utils/queryClient'; import {useOrganization} from 'sentry/utils/useOrganization'; import {useCanWriteSettings} from 'getsentry/views/seerAutomation/components/useCanWriteSettings'; -import {useBulkUpdateRepositorySettings} from 'getsentry/views/seerAutomation/onboarding/hooks/useBulkUpdateRepositorySettings'; -import { - getRepositoryWithSettingsQueryKey, - useRepositoryWithSettings, -} from 'getsentry/views/seerAutomation/onboarding/hooks/useRepositoryWithSettings'; interface Props { gridColumns: string; diff --git a/static/gsApp/views/seerAutomation/onboarding/configureCodeReviewStep.tsx b/static/gsApp/views/seerAutomation/onboarding/configureCodeReviewStep.tsx index 9aca9f09218163..abd5295a726169 100644 --- a/static/gsApp/views/seerAutomation/onboarding/configureCodeReviewStep.tsx +++ b/static/gsApp/views/seerAutomation/onboarding/configureCodeReviewStep.tsx @@ -16,13 +16,13 @@ import { } from 'sentry/components/guidedSteps/guidedSteps'; import {LoadingIndicator} from 'sentry/components/loadingIndicator'; import {PanelBody} from 'sentry/components/panels/panelBody'; +import {useBulkUpdateRepositorySettings} from 'sentry/components/repositories/useBulkUpdateRepositorySettings'; import {t} from 'sentry/locale'; import {DEFAULT_CODE_REVIEW_TRIGGERS} from 'sentry/types/integrations'; import {useOrganization} from 'sentry/utils/useOrganization'; import {trackGetsentryAnalytics} from 'getsentry/utils/trackGetsentryAnalytics'; import {useSeerOnboardingContext} from 'getsentry/views/seerAutomation/onboarding/hooks/seerOnboardingContext'; -import {useBulkUpdateRepositorySettings} from 'getsentry/views/seerAutomation/onboarding/hooks/useBulkUpdateRepositorySettings'; import {MaxWidthPanel, PanelDescription, StepContent} from './common'; import {RepositorySelector} from './repositorySelector'; diff --git a/static/gsApp/views/seerAutomation/repoDetails.tsx b/static/gsApp/views/seerAutomation/repoDetails.tsx index 1afc2c2079e653..c25218d84f9fb9 100644 --- a/static/gsApp/views/seerAutomation/repoDetails.tsx +++ b/static/gsApp/views/seerAutomation/repoDetails.tsx @@ -9,6 +9,7 @@ import {useIsSeerSupportedProvider} from 'sentry/components/events/autofix/utils import {LoadingError} from 'sentry/components/loadingError'; import {LoadingIndicator} from 'sentry/components/loadingIndicator'; import {RepoProviderIcon} from 'sentry/components/repositories/repoProviderIcon'; +import {useRepositoryWithSettings} from 'sentry/components/repositories/useRepositoryWithSettings'; import {SentryDocumentTitle} from 'sentry/components/sentryDocumentTitle'; import {t, tct} from 'sentry/locale'; import {useOrganization} from 'sentry/utils/useOrganization'; @@ -17,7 +18,6 @@ import {SettingsPageHeader} from 'sentry/views/settings/components/settingsPageH import {RepoDetailsForm} from 'getsentry/views/seerAutomation/components/repoDetails/repoDetailsForm'; import {SeerSettingsPageWrapper} from 'getsentry/views/seerAutomation/components/seerSettingsPageWrapper'; -import {useRepositoryWithSettings} from 'getsentry/views/seerAutomation/onboarding/hooks/useRepositoryWithSettings'; export default function SeerRepoDetails() { const {repoId} = useParams<{repoId: string}>(); diff --git a/static/gsApp/views/seerAutomation/settings.tsx b/static/gsApp/views/seerAutomation/settings.tsx index e8c9881fd286f4..d2ba78a3f63d42 100644 --- a/static/gsApp/views/seerAutomation/settings.tsx +++ b/static/gsApp/views/seerAutomation/settings.tsx @@ -15,6 +15,10 @@ import type {Organization} from 'sentry/types/organization'; import {fetchMutation} from 'sentry/utils/queryClient'; import {useOrganization} from 'sentry/utils/useOrganization'; import {SettingsPageHeader} from 'sentry/views/settings/components/settingsPageHeader'; +import { + CodeReviewOverviewSection, + useCodeReviewOverviewSection, +} from 'sentry/views/settings/seer/overview/codeReviewOverviewSection'; import { SCMOverviewSection, useSCMOverviewSection, @@ -37,7 +41,10 @@ export function SeerAutomationSettings() { const organization = useOrganization(); const canWrite = useCanWriteSettings(); + const showSeerOverview = organization.features.includes('seer-overview'); + const scmOverviewData = useSCMOverviewSection(); + const codeReviewOverviewData = useCodeReviewOverviewSection(); const orgEndpoint = `/organizations/${organization.slug}/`; const orgMutationOpts = mutationOptions({ @@ -82,9 +89,9 @@ export function SeerAutomationSettings() { /> - - {t('Default Code Review for New Repos')} - , - } - )} - size="xs" - icon="info" - /> - - } - > - - {field => ( - - + ) : ( + + {t('Default Code Review for New Repos')} + , + } + )} + size="xs" + icon="info" /> - - )} - - } - mutationOptions={orgMutationOpts} > - {field => ( - } - )} - > - - - )} - - + + {field => ( + + + + )} + + + {field => ( + } + )} + > + + + )} + + + )}