Skip to content

Commit 1d96a33

Browse files
committed
Merge branch 'master' into tkdodo/ref/releases-endpoint-to-apiOptions
2 parents fe09546 + 776213e commit 1d96a33

File tree

40 files changed

+543
-267
lines changed

40 files changed

+543
-267
lines changed

src/sentry/objectstore/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
class ObjectstoreUploadOptions(TypedDict):
77
url: str
88
scopes: list[tuple[str, str]]
9-
# TODO: add authToken
9+
authToken: str | None
1010
expirationPolicy: str

src/sentry/preprod/api/endpoints/project_preprod_upload_options.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from sentry.api.bases.project import ProjectEndpoint, ProjectReleasePermission
1717
from sentry.api.utils import generate_locality_url
1818
from sentry.models.project import Project
19+
from sentry.objectstore import get_preprod_session
1920
from sentry.objectstore.types import ObjectstoreUploadOptions
2021
from sentry.utils.http import absolute_uri
2122

@@ -35,6 +36,7 @@ def get(self, request: Request, project: Project) -> Response:
3536
return Response({"detail": "Feature not enabled"}, status=403)
3637

3738
organization = project.organization
39+
session = get_preprod_session(org=organization.id, project=project.id)
3840

3941
path = reverse(
4042
"sentry-api-0-organization-objectstore",
@@ -53,6 +55,7 @@ def get(self, request: Request, project: Project) -> Response:
5355
("org", str(organization.id)),
5456
("project", str(project.id)),
5557
],
58+
authToken=session.mint_token(),
5659
expirationPolicy=format_expiration(
5760
TimeToLive(timedelta(days=30))
5861
), # Hardcoded for now, check with Objectstore before increasing

src/sentry/utils/prompts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class _PromptConfig(TypedDict):
1515
"data_consent_banner": {"required_fields": ["organization_id"]},
1616
"data_consent_priority": {"required_fields": ["organization_id"]},
1717
"github_missing_members": {"required_fields": ["organization_id"]},
18+
"issue_android_tombstones_onboarding": {"required_fields": ["organization_id", "project_id"]},
1819
"issue_feedback_hidden": {"required_fields": ["organization_id", "project_id"]},
1920
"issue_priority": {"required_fields": ["organization_id"]},
2021
"issue_replay_inline_onboarding": {"required_fields": ["organization_id", "project_id"]},

static/app/components/profiling/continuousProfileHeader.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import {trackAnalytics} from 'sentry/utils/analytics';
1313
import {generateLinkToEventInTraceView} from 'sentry/utils/discover/urls';
1414
import {useLocation} from 'sentry/utils/useLocation';
1515
import {useOrganization} from 'sentry/utils/useOrganization';
16+
import {TopBar} from 'sentry/views/navigation/topBar';
17+
import {useHasPageFrameFeature} from 'sentry/views/navigation/useHasPageFrameFeature';
1618

1719
interface ContinuousProfileHeader {
1820
transaction: Event | null;
@@ -21,6 +23,7 @@ interface ContinuousProfileHeader {
2123
export function ContinuousProfileHeader({transaction}: ContinuousProfileHeader) {
2224
const location = useLocation();
2325
const organization = useOrganization();
26+
const hasPageFrameFeature = useHasPageFrameFeature();
2427

2528
// @TODO add breadcrumbs when other views are implemented
2629
const breadCrumbs = useMemo((): ProfilingBreadcrumbsProps['trails'] => {
@@ -51,7 +54,13 @@ export function ContinuousProfileHeader({transaction}: ContinuousProfileHeader)
5154
</SmallerProfilingBreadcrumbsWrapper>
5255
</SmallerHeaderContent>
5356
<StyledHeaderActions>
54-
<FeedbackButton />
57+
{hasPageFrameFeature ? (
58+
<TopBar.Slot name="feedback">
59+
<FeedbackButton>{null}</FeedbackButton>
60+
</TopBar.Slot>
61+
) : (
62+
<FeedbackButton />
63+
)}
5564
{transactionTarget && (
5665
<LinkButton size="sm" onClick={handleGoToTransaction} to={transactionTarget}>
5766
{t('Go to Trace')}

static/app/components/profiling/profileHeader.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import {generateLinkToEventInTraceView} from 'sentry/utils/discover/urls';
1313
import {isSchema, isSentrySampledProfile} from 'sentry/utils/profiling/guards/profile';
1414
import {useLocation} from 'sentry/utils/useLocation';
1515
import {useOrganization} from 'sentry/utils/useOrganization';
16+
import {TopBar} from 'sentry/views/navigation/topBar';
17+
import {useHasPageFrameFeature} from 'sentry/views/navigation/useHasPageFrameFeature';
1618
import {useProfiles} from 'sentry/views/profiling/profilesProvider';
1719

1820
function getTransactionName(input: Profiling.ProfileInput): string {
@@ -36,6 +38,7 @@ function ProfileHeader({transaction, projectId, eventId}: ProfileHeaderProps) {
3638
const location = useLocation();
3739
const organization = useOrganization();
3840
const profiles = useProfiles();
41+
const hasPageFrameFeature = useHasPageFrameFeature();
3942

4043
const transactionName =
4144
profiles.type === 'resolved' ? getTransactionName(profiles.data) : '';
@@ -89,7 +92,13 @@ function ProfileHeader({transaction, projectId, eventId}: ProfileHeaderProps) {
8992
</SmallerProfilingBreadcrumbsWrapper>
9093
</SmallerHeaderContent>
9194
<StyledHeaderActions>
92-
<FeedbackButton />
95+
{hasPageFrameFeature ? (
96+
<TopBar.Slot name="feedback">
97+
<FeedbackButton>{null}</FeedbackButton>
98+
</TopBar.Slot>
99+
) : (
100+
<FeedbackButton />
101+
)}
93102
{transactionTarget && (
94103
<LinkButton size="sm" onClick={handleGoToTransaction} to={transactionTarget}>
95104
{t('Go to Trace')}

static/app/views/alerts/list/header.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import {useLocation} from 'sentry/utils/useLocation';
1515
import {useNavigate} from 'sentry/utils/useNavigate';
1616
import {useOrganization} from 'sentry/utils/useOrganization';
1717
import {makeAlertsPathname} from 'sentry/views/alerts/pathnames';
18+
import {TopBar} from 'sentry/views/navigation/topBar';
19+
import {useHasPageFrameFeature} from 'sentry/views/navigation/useHasPageFrameFeature';
1820

1921
type Props = {
2022
activeTab: 'stream' | 'rules';
@@ -25,6 +27,7 @@ export function AlertHeader({activeTab}: Props) {
2527
const location = useLocation();
2628
const organization = useOrganization();
2729
const {selection} = usePageFilters();
30+
const hasPageFrameFeature = useHasPageFrameFeature();
2831
/**
2932
* Incidents list is currently at the organization level, but the link needs to
3033
* go down to a specific project scope.
@@ -79,7 +82,13 @@ export function AlertHeader({activeTab}: Props) {
7982
>
8083
{t('Create Alert')}
8184
</CreateAlertButton>
82-
<FeedbackButton />
85+
{hasPageFrameFeature ? (
86+
<TopBar.Slot name="feedback">
87+
<FeedbackButton>{null}</FeedbackButton>
88+
</TopBar.Slot>
89+
) : (
90+
<FeedbackButton />
91+
)}
8392
<LinkButton
8493
size="sm"
8594
onClick={handleNavigateToSettings}

static/app/views/automations/components/automationFeedbackButton.tsx

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
11
import {FeedbackButton} from 'sentry/components/feedbackButton/feedbackButton';
22
import {t} from 'sentry/locale';
3+
import {TopBar} from 'sentry/views/navigation/topBar';
4+
import {useHasPageFrameFeature} from 'sentry/views/navigation/useHasPageFrameFeature';
5+
6+
const automationFeedbackOptions = {
7+
messagePlaceholder: t('How can we improve the alerts experience?'),
8+
tags: {
9+
['feedback.source']: 'automations',
10+
['feedback.owner']: 'aci',
11+
},
12+
};
313

414
export function AutomationFeedbackButton() {
15+
const hasPageFrameFeature = useHasPageFrameFeature();
16+
17+
if (hasPageFrameFeature) {
18+
return (
19+
<TopBar.Slot name="feedback">
20+
<FeedbackButton feedbackOptions={automationFeedbackOptions}>
21+
{null}
22+
</FeedbackButton>
23+
</TopBar.Slot>
24+
);
25+
}
26+
527
return (
6-
<FeedbackButton
7-
size="sm"
8-
feedbackOptions={{
9-
messagePlaceholder: t('How can we improve the alerts experience?'),
10-
tags: {
11-
['feedback.source']: 'automations',
12-
['feedback.owner']: 'aci',
13-
},
14-
}}
15-
>
28+
<FeedbackButton size="sm" feedbackOptions={automationFeedbackOptions}>
1629
{t('Feedback')}
1730
</FeedbackButton>
1831
);

static/app/views/dashboards/manage/index.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ import type {DashboardsLayout} from 'sentry/views/dashboards/manage/types';
5959
import {DashboardFilter, PREBUILT_DASHBOARD_LABEL} from 'sentry/views/dashboards/types';
6060
import type {DashboardDetails, DashboardListItem} from 'sentry/views/dashboards/types';
6161
import {PREBUILT_DASHBOARDS} from 'sentry/views/dashboards/utils/prebuiltConfigs';
62+
import {TopBar} from 'sentry/views/navigation/topBar';
63+
import {useHasPageFrameFeature} from 'sentry/views/navigation/useHasPageFrameFeature';
6264
import RouteError from 'sentry/views/routeError';
6365

6466
import DashboardGrid from './dashboardGrid';
@@ -162,6 +164,7 @@ function ManageDashboards() {
162164
const navigate = useNavigate();
163165
const location = useLocation();
164166
const api = useApi();
167+
const hasPageFrameFeature = useHasPageFrameFeature();
165168
const dashboardGridRef = useRef<HTMLDivElement>(null);
166169
const hasPrebuiltDashboards = organization.features.includes(
167170
'dashboards-prebuilt-insights-dashboards'
@@ -645,7 +648,13 @@ function ManageDashboards() {
645648
</TemplateSwitch>
646649
)}
647650

648-
<FeedbackButton />
651+
{hasPageFrameFeature ? (
652+
<TopBar.Slot name="feedback">
653+
<FeedbackButton>{null}</FeedbackButton>
654+
</TopBar.Slot>
655+
) : (
656+
<FeedbackButton />
657+
)}
649658
<Feature features={['dashboards-ai-generate']}>
650659
{({hasFeature: hasAiGenerate}) =>
651660
hasAiGenerate && areAiFeaturesAllowed ? (

static/app/views/detectors/components/monitorFeedbackButton.tsx

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
11
import {FeedbackButton} from 'sentry/components/feedbackButton/feedbackButton';
22
import {t} from 'sentry/locale';
3+
import {TopBar} from 'sentry/views/navigation/topBar';
4+
import {useHasPageFrameFeature} from 'sentry/views/navigation/useHasPageFrameFeature';
5+
6+
const monitorFeedbackOptions = {
7+
messagePlaceholder: t('How can we improve the monitor experience?'),
8+
tags: {
9+
['feedback.source']: 'monitors',
10+
['feedback.owner']: 'aci',
11+
},
12+
};
313

414
export function MonitorFeedbackButton() {
15+
const hasPageFrameFeature = useHasPageFrameFeature();
16+
17+
if (hasPageFrameFeature) {
18+
return (
19+
<TopBar.Slot name="feedback">
20+
<FeedbackButton feedbackOptions={monitorFeedbackOptions}>{null}</FeedbackButton>
21+
</TopBar.Slot>
22+
);
23+
}
24+
525
return (
6-
<FeedbackButton
7-
size="sm"
8-
feedbackOptions={{
9-
messagePlaceholder: t('How can we improve the monitor experience?'),
10-
tags: {
11-
['feedback.source']: 'monitors',
12-
['feedback.owner']: 'aci',
13-
},
14-
}}
15-
>
26+
<FeedbackButton size="sm" feedbackOptions={monitorFeedbackOptions}>
1627
{t('Feedback')}
1728
</FeedbackButton>
1829
);

static/app/views/explore/errors/content.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import {
1616
} from 'sentry/views/explore/errors/body';
1717
import {ErrorsFilterSection} from 'sentry/views/explore/errors/filterContent';
1818
import {useControlSectionExpanded} from 'sentry/views/explore/hooks/useControlSectionExpanded';
19+
import {TopBar} from 'sentry/views/navigation/topBar';
20+
import {useHasPageFrameFeature} from 'sentry/views/navigation/useHasPageFrameFeature';
1921

2022
export default function ErrorsContent() {
2123
const organization = useOrganization();
@@ -37,6 +39,7 @@ export default function ErrorsContent() {
3739
}
3840

3941
function ErrorsHeader() {
42+
const hasPageFrameFeature = useHasPageFrameFeature();
4043
return (
4144
<Layout.Header unified>
4245
<Layout.HeaderContent unified>
@@ -45,7 +48,13 @@ function ErrorsHeader() {
4548
</Layout.Title>
4649
</Layout.HeaderContent>
4750
<Layout.HeaderActions>
48-
<FeedbackButton />
51+
{hasPageFrameFeature ? (
52+
<TopBar.Slot name="feedback">
53+
<FeedbackButton>{null}</FeedbackButton>
54+
</TopBar.Slot>
55+
) : (
56+
<FeedbackButton />
57+
)}
4958
</Layout.HeaderActions>
5059
</Layout.Header>
5160
);

0 commit comments

Comments
 (0)