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
4 changes: 4 additions & 0 deletions controlplane/src/core/bufservices/check/getCheckSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ export function getCheckSummary(
hasProposalMatchError: check.proposalMatch === 'error',
isLinkedTrafficCheckFailed,
isLinkedPruningCheckFailed,
checkExtensionDeliveryId: check.checkExtensionDeliveryId,
checkExtensionErrorMessage: check.checkExtensionErrorMessage,
}),
isComposable: checkDetails.compositionErrors.length === 0,
isBreaking,
Expand Down Expand Up @@ -249,6 +251,8 @@ export function getCheckSummary(
hasProposalMatchError: check.proposalMatch === 'error',
isLinkedTrafficCheckFailed,
isLinkedPruningCheckFailed,
checkExtensionDeliveryId: check.checkExtensionDeliveryId,
checkExtensionErrorMessage: check.checkExtensionErrorMessage,
}),
isComposable: checkDetails.compositionErrors.length === 0,
isBreaking,
Expand Down
6 changes: 6 additions & 0 deletions controlplane/src/core/repositories/ProposalRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,8 @@ export class ProposalRepository {
hasLintErrors: schema.schemaChecks.hasLintErrors,
hasGraphPruningErrors: schema.schemaChecks.hasGraphPruningErrors,
clientTrafficCheckSkipped: schema.schemaChecks.clientTrafficCheckSkipped,
checkExtensionDeliveryId: schema.schemaChecks.checkExtensionDeliveryId,
checkExtensionErrorMessage: schema.schemaChecks.checkExtensionErrorMessage,
})
.from(schema.schemaChecks)
.where(eq(schema.schemaChecks.id, latestCheck[0].schemaCheckId))
Expand All @@ -602,6 +604,8 @@ export class ProposalRepository {
const hasLintErrors = Boolean(check[0].hasLintErrors);
const hasGraphPruningErrors = Boolean(check[0].hasGraphPruningErrors);
const clientTrafficCheckSkipped = Boolean(check[0].clientTrafficCheckSkipped);
const checkExtensionDeliveryId = check[0].checkExtensionDeliveryId || undefined;
const checkExtensionErrorMessage = check[0].checkExtensionErrorMessage || undefined;

const schemaCheckRepo = new SchemaCheckRepository(this.db);
const linkedChecks = await schemaCheckRepo.getLinkedSchemaChecks({
Expand All @@ -625,6 +629,8 @@ export class ProposalRepository {
hasProposalMatchError: false,
isLinkedTrafficCheckFailed,
isLinkedPruningCheckFailed,
checkExtensionDeliveryId,
checkExtensionErrorMessage,
});

return {
Expand Down
2 changes: 2 additions & 0 deletions controlplane/src/core/repositories/SchemaCheckRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1584,6 +1584,8 @@ export class SchemaCheckRepository {
hasGraphPruningErrors: !!check.hasGraphPruningErrors,
clientTrafficCheckSkipped: !!check.clientTrafficCheckSkipped,
hasProposalMatchError: check.proposalMatch === 'error',
checkExtensionDeliveryId: check.checkExtensionDeliveryId || undefined,
checkExtensionErrorMessage: check.checkExtensionErrorMessage || undefined,
}),
clientTrafficCheckSkipped: !!check.clientTrafficCheckSkipped,
graphPruningCheckSkipped: !!check.graphPruningSkipped,
Expand Down
8 changes: 8 additions & 0 deletions controlplane/src/core/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,8 @@ export const isCheckSuccessful = ({
hasProposalMatchError,
isLinkedTrafficCheckFailed,
isLinkedPruningCheckFailed,
checkExtensionDeliveryId,
checkExtensionErrorMessage,
}: {
isComposable: boolean;
isBreaking: boolean;
Expand All @@ -565,12 +567,18 @@ export const isCheckSuccessful = ({
hasProposalMatchError: boolean;
isLinkedTrafficCheckFailed?: boolean;
isLinkedPruningCheckFailed?: boolean;
checkExtensionDeliveryId?: string;
checkExtensionErrorMessage?: string;
}) => {
// if a subgraph is linked to another subgraph, then the status of the check depends on the traffic and pruning check of the linked subgraph
if (isLinkedTrafficCheckFailed || isLinkedPruningCheckFailed) {
return false;
}

if (checkExtensionDeliveryId && checkExtensionErrorMessage) {
return false;
}

return (
isComposable &&
// If no breaking changes found
Expand Down
2 changes: 1 addition & 1 deletion studio/src/components/check-badge-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const isCheckSuccessful = (
!hasLintErrors &&
!hasGraphPruningErrors &&
!hasProposalMatchError &&
!checkExtensionError
!Boolean(checkExtensionError)
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,8 @@ export const ProposalDetails = ({
checkedSubgraphs,
proposalMatch,
linkedChecks,
checkExtensionDeliveryId,
checkExtensionErrorMessage,
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}) => {
const isSuccessful = isCheckSuccessful(
isComposable,
Expand All @@ -492,6 +494,7 @@ export const ProposalDetails = ({
linkedChecks.some(
(linkedCheck) => linkedCheck.hasGraphPruningErrors && !linkedCheck.isForcedSuccess,
),
checkExtensionErrorMessage,
);

const path = `/${user?.currentOrganization.slug}/${graphData?.graph?.namespace}/graph/${graphData?.graph?.name}/checks/${id}`;
Expand Down Expand Up @@ -581,6 +584,20 @@ export const ProposalDetails = ({
)}
<span className="flex-1 truncate">Pruning Errors</span>
</Badge>
<Badge
variant="outline"
className={cn(
'gap-2 py-1.5',
!checkExtensionDeliveryId && 'text-muted-foreground',
)}
>
{!checkExtensionDeliveryId ? (
<NoSymbolIcon className="h-4 w-4" />
) : (
getCheckIcon(!checkExtensionErrorMessage)
)}
<span className="flex-1 truncate">Extension</span>
</Badge>
</div>
</TableCell>

Expand Down
Loading