Files
zeekayandHanzo Dev f888991a7a drop the Sentry wordmark from the react app
FSL-1.0-Apache-2.0 grants us the code, not the name. "Sentry" is
Functional Software's trademark, so every place the running app says it
to a user -- page titles, onboarding, empty states, toasts, settings
copy, the self-hosted footer -- now says Sentinel.

Attribution is the other half of the deal and stays untouched: upstream
copyright headers, LICENSE, NOTICE. So does anything where the mark is a
fact rather than a brand -- @sentry/* packages, sentry-cli, the wizard
and bundler plugins, docs.sentry.io, the whole gettingStartedDocs tree.
Renaming those would leave instructions that no longer work.

Nothing structural moved. No import, identifier, route path, feature
flag, API field or test id changed; the diff is 312 lines in and 312
out. Colocated specs were updated in lockstep with the copy they assert.
Marketing and community links point at hanzo.ai, only where a real page
exists to point at.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-10 18:01:22 -07:00

220 lines
6.0 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import {Fragment, useMemo} from 'react';
import styled from '@emotion/styled';
import uniqBy from 'lodash/uniqBy';
import {Alert} from 'sentry/components/alert';
import ExternalLink from 'sentry/components/links/externalLink';
import {space} from 'sentry/styles/space';
import type {CodeOwner, RepositoryProjectPathConfig} from 'sentry/types';
type CodeOwnerErrorKeys = keyof CodeOwner['errors'];
function ErrorMessage({
message,
values,
link,
linkValue,
}: {
link: string;
linkValue: React.ReactNode;
message: string;
values: string[];
}) {
return (
<Fragment>
<ErrorMessageContainer>
<span>{message}</span>
<b>{values.join(', ')}</b>
</ErrorMessageContainer>
<ErrorCtaContainer>
<ExternalLink href={link}>{linkValue}</ExternalLink>
</ErrorCtaContainer>
</Fragment>
);
}
function ErrorMessageList({
message,
values,
linkFunction,
linkValueFunction,
}: {
linkFunction: (s: string) => string;
linkValueFunction: (s: string) => string;
message: string;
values: string[];
}) {
return (
<Fragment>
<ErrorMessageContainer>
<span>{message}</span>
</ErrorMessageContainer>
<ErrorMessageListContainer>
{values.map((value, index) => (
<ErrorInlineContainer key={index}>
<b>{value}</b>
<ErrorCtaContainer>
<ExternalLink href={linkFunction(value)} key={index}>
{linkValueFunction(value)}
</ExternalLink>
</ErrorCtaContainer>
</ErrorInlineContainer>
))}
</ErrorMessageListContainer>
</Fragment>
);
}
interface CodeOwnerErrorsProps {
codeowners: CodeOwner[];
orgSlug: string;
projectSlug: string;
}
export function CodeOwnerErrors({
codeowners,
orgSlug,
projectSlug,
}: CodeOwnerErrorsProps) {
const filteredCodeowners = useMemo(() => {
const owners = codeowners.filter(({errors}) => {
// Remove codeowners files with no errors
return Object.values(errors).some(values => values.length);
});
// Uniq errors
return uniqBy(owners, codeowner => JSON.stringify(codeowner.errors));
}, [codeowners]);
const errMessage = (
codeMapping: RepositoryProjectPathConfig,
type: CodeOwnerErrorKeys,
values: string[]
) => {
switch (type) {
case 'missing_external_teams':
return (
<ErrorMessage
message="There’s a problem linking teams and members from an integration"
values={values}
link={`/settings/${orgSlug}/integrations/${codeMapping?.provider?.slug}/${codeMapping?.integrationId}/?tab=teamMappings`}
linkValue="Configure Team Mappings"
/>
);
case 'missing_external_users':
return (
<ErrorMessage
message={`The following usernames do not have an association in the organization: ${orgSlug}`}
values={values}
link={`/settings/${orgSlug}/integrations/${codeMapping?.provider?.slug}/${codeMapping?.integrationId}/?tab=userMappings`}
linkValue="Configure User Mappings"
/>
);
case 'missing_user_emails':
return (
<ErrorMessage
message={`The following emails do not have an Sentinel user in the organization: ${orgSlug}`}
values={values}
link={`/settings/${orgSlug}/members/`}
linkValue="Invite Users"
/>
);
case 'teams_without_access':
return (
<ErrorMessageList
message={`The following teams do not have access to the project: ${projectSlug}`}
values={values}
linkFunction={value =>
`/settings/${orgSlug}/teams/${value.slice(1)}/projects/`
}
linkValueFunction={value => `Configure ${value} Permissions`}
/>
);
case 'users_without_access':
return (
<ErrorMessageList
message={`The following users are not on a team that has access to the project: ${projectSlug}`}
values={values}
linkFunction={email => `/settings/${orgSlug}/members/?query=${email}`}
linkValueFunction={() => `Configure Member Settings`}
/>
);
default:
return null;
}
};
return (
<Fragment>
{filteredCodeowners.map(({id, codeMapping, errors}) => {
const errorPairs = Object.entries(errors).filter(
([_, values]) => values.length
) as Array<[CodeOwnerErrorKeys, string[]]>;
const errorCount = errorPairs.reduce(
(acc, [_, values]) => acc + values.length,
0
);
return (
<Alert
key={id}
type="error"
showIcon
expand={
<AlertContentContainer key="container">
{errorPairs.map(([type, values]) => (
<ErrorContainer key={`${id}-${type}`}>
{errMessage(codeMapping!, type, values)}
</ErrorContainer>
))}
</AlertContentContainer>
}
>
{`There were ${errorCount} ownership issues within Sentinel on the latest sync with the CODEOWNERS file`}
</Alert>
);
})}
</Fragment>
);
}
const AlertContentContainer = styled('div')`
overflow-y: auto;
max-height: 350px;
`;
const ErrorContainer = styled('div')`
display: grid;
grid-template-areas: 'message cta';
grid-template-columns: 2fr 1fr;
gap: ${space(2)};
padding: ${space(1.5)} 0;
`;
const ErrorInlineContainer = styled(ErrorContainer)`
gap: ${space(1.5)};
grid-template-columns: 1fr 2fr;
align-items: center;
padding: 0;
`;
const ErrorMessageContainer = styled('div')`
grid-area: message;
display: grid;
gap: ${space(1.5)};
`;
const ErrorMessageListContainer = styled('div')`
grid-column: message / cta-end;
gap: ${space(1.5)};
`;
const ErrorCtaContainer = styled('div')`
grid-area: cta;
justify-self: flex-end;
text-align: right;
line-height: 1.5;
`;