add link to a github commit for schema checks (#3187)

This commit is contained in:
Aleksandra 2023-11-02 09:02:51 +01:00 committed by GitHub
parent 6b7aef8b70
commit 236326f70d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 2 deletions

View file

@ -755,6 +755,10 @@ export default gql`
The URL of the schema check on the Hive Web App.
"""
webUrl: String
"""
The GitHub repository associated with the schema check.
"""
githubRepository: String
breakingSchemaChanges: SchemaChangeConnection
safeSchemaChanges: SchemaChangeConnection
@ -789,6 +793,10 @@ export default gql`
The URL of the schema check on the Hive Web App.
"""
webUrl: String
"""
The GitHub repository associated with the schema check.
"""
githubRepository: String
"""
Breaking changes can exist in an successful schema check if the check was manually approved.
@ -840,6 +848,10 @@ export default gql`
The URL of the schema check on the Hive Web App.
"""
webUrl: String
"""
The GitHub repository associated with the schema check.
"""
githubRepository: String
compositionErrors: SchemaErrorConnection

View file

@ -26,7 +26,7 @@ import { CriticalityLevel } from '@/gql/graphql';
import { useRouteSelector } from '@/lib/hooks';
import { withSessionProtection } from '@/lib/supertokens/guard';
import { cn } from '@/lib/utils';
import { ListBulletIcon } from '@radix-ui/react-icons';
import { ExternalLinkIcon, ListBulletIcon } from '@radix-ui/react-icons';
import * as ToggleGroup from '@radix-ui/react-toggle-group';
const SchemaChecks_NavigationQuery = graphql(`
@ -49,6 +49,7 @@ const SchemaChecks_NavigationQuery = graphql(`
commit
author
}
githubRepository
}
}
pageInfo {
@ -126,6 +127,16 @@ const Navigation = (props: {
) : null}
</div>
</NextLink>
{edge.node.githubRepository && edge.node.meta ? (
<a
className="text-xs font-medium text-gray-500 hover:text-gray-400 ml-[-1px]"
target="_blank"
rel="noreferrer"
href={`https://github.com/${edge.node.githubRepository}/commit/${edge.node.meta.commit}`}
>
<ExternalLinkIcon className="inline" /> associated with Git commit
</a>
) : null}
</div>
))}
{props.isLastPage && query.data.target.schemaChecks.pageInfo.hasNextPage && (

View file

@ -133,7 +133,7 @@ function ListPage({
</NextLink>
{version.githubMetadata ? (
<a
className="text-xs font-medium text-gray-500 hover:text-gray-400"
className="text-xs font-medium text-gray-500 hover:text-gray-400 ml-[-1px]"
target="_blank"
rel="noreferrer"
href={`https://github.com/${version.githubMetadata.repository}/commit/${version.githubMetadata.commit}`}