Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions static/app/data/forms/projectIssueGrouping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ stack.function:mylibrary_* +app`}
derivedGroupingEnhancements: {
name: 'derivedGroupingEnhancements',
type: 'string',
label: 'Derived Grouping Enhancements (super user only)',
label: 'Derived Grouping Enhancements',
hideLabel: true,
placeholder: '',
multiline: true,
Expand All @@ -115,10 +115,9 @@ stack.function:mylibrary_* +app`}
formatMessageValue: false,
help: () => (
<RuleDescription>
These rules are automatically derived for some languages for customers that have
the GitHub integration and the language has been marked to derive in-app rules.
These rules are not editable but they can be negated by adding their own rules in
the Stack Trace Rules section.
These rules are automatically derived for some languages for organizations that
have the GitHub integration. These rules are not editable but they can be negated
by adding you own rules in the Stack Trace Rules section.
</RuleDescription>
),
validate: () => [],
Expand Down
7 changes: 5 additions & 2 deletions static/app/views/settings/projectIssueGrouping/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@ describe('projectIssueGrouping', () => {
outletContext: {project},
});

// Verify the section is not visible for non-superuser
// Verify the section is visible for non-superuser
expect(await screen.findByText('Issue Grouping')).toBeInTheDocument();
expect(screen.queryByText(/Derived Grouping Enhancements/)).not.toBeInTheDocument();
expect(screen.getByText(/Derived Grouping Enhancements/)).toBeInTheDocument();
expect(
screen.getByRole('textbox', {name: /Derived Grouping Enhancements/})
).toBeDisabled();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misleading test name and dead mock after ungating

Low Severity

The test is still named 'shows derived grouping enhancements only for superusers', which directly contradicts the PR's intent to make the section visible to all users. Additionally, jest.mocked(isActiveSuperuser).mockReturnValue(true) at line 71 is now a no-op — the component no longer imports or uses isActiveSuperuser, so the mock has zero effect on rendering. This leaves the test asserting the same thing twice under a misleading name, giving false confidence that superuser-gating is being tested when it isn't.

Fix in Cursor Fix in Web


// Re-render for superuser
jest.mocked(isActiveSuperuser).mockReturnValue(true);
Expand Down
16 changes: 6 additions & 10 deletions static/app/views/settings/projectIssueGrouping/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import ProjectsStore from 'sentry/stores/projectsStore';
import type {EventGroupingConfig} from 'sentry/types/event';
import type {Project} from 'sentry/types/project';
import getApiUrl from 'sentry/utils/api/getApiUrl';
import {isActiveSuperuser} from 'sentry/utils/isActiveSuperuser';
import {useApiQuery} from 'sentry/utils/queryClient';
import routeTitleGen from 'sentry/utils/routeTitle';
import useOrganization from 'sentry/utils/useOrganization';
Expand Down Expand Up @@ -56,7 +55,6 @@ export default function ProjectIssueGrouping() {
const endpoint = `/projects/${organization.slug}/${project.slug}/`;

const access = new Set(organization.access.concat(project.access));
const activeSuperUser = isActiveSuperuser();
const hasAccess = hasEveryAccess(['project:write'], {organization, project});

const jsonFormProps = {
Expand Down Expand Up @@ -106,14 +104,12 @@ export default function ProjectIssueGrouping() {
fields={[fields.groupingEnhancements]}
/>

{activeSuperUser && (
<JsonForm
{...jsonFormProps}
title={t('Derived Grouping Enhancements')}
fields={[fields.derivedGroupingEnhancements]}
disabled
/>
)}
<JsonForm
{...jsonFormProps}
title={t('Derived Grouping Enhancements')}
fields={[fields.derivedGroupingEnhancements]}
disabled
/>
</Form>
</SentryDocumentTitle>
);
Expand Down
Loading