Skip to content
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
89fc632
fix const
pa-lem Oct 16, 2025
2117f24
add api function
pa-lem Oct 16, 2025
d82183d
add domain
pa-lem Oct 16, 2025
4e07916
add query
pa-lem Oct 16, 2025
2ede2bf
update domain
pa-lem Oct 16, 2025
495bf89
use fsd in checks
pa-lem Oct 16, 2025
c5bf78d
Merge branch 'stable' of github.com:opsmill/infrahub into ple-fix-ret…
pa-lem Oct 20, 2025
8b14885
add check api
pa-lem Oct 20, 2025
38a5477
update keys
pa-lem Oct 20, 2025
ece8beb
add domain
pa-lem Oct 20, 2025
b5e4b6d
add mutation
pa-lem Oct 20, 2025
a917c43
update query
pa-lem Oct 20, 2025
8027eea
cleanup useless style
pa-lem Oct 20, 2025
cb05e69
remove refetch
pa-lem Oct 20, 2025
d400a05
update mutation
pa-lem Oct 20, 2025
5defc71
remove unused file
pa-lem Oct 21, 2025
9846acd
remove unused file
pa-lem Oct 21, 2025
6702994
Merge branch 'stable' of github.com:opsmill/infrahub into ple-fix-ret…
pa-lem Oct 21, 2025
3a93cf2
add api
pa-lem Oct 21, 2025
8387421
update query keys
pa-lem Oct 21, 2025
670016c
add domain
pa-lem Oct 21, 2025
04b2ff9
add query
pa-lem Oct 21, 2025
faa1302
update component
pa-lem Oct 21, 2025
c64569c
remove file
pa-lem Oct 21, 2025
6a5ee2b
add changelog
pa-lem Oct 22, 2025
eead83b
add errors check
pa-lem Oct 22, 2025
aff1d28
Merge branch 'stable' of github.com:opsmill/infrahub into ple-fix-ret…
pa-lem Oct 22, 2025
c641f71
fix type
pa-lem Oct 22, 2025
f897859
use as const
pa-lem Oct 22, 2025
6d05267
update type
pa-lem Oct 22, 2025
b10b133
update ui for retry
pa-lem Oct 22, 2025
6b4c274
update retry all ui
pa-lem Oct 22, 2025
3ed3581
ensure kind
pa-lem Oct 22, 2025
53d073c
revert tooltip
pa-lem Oct 22, 2025
d479645
improve TS
bilalabbad Oct 23, 2025
55415c9
rephrase changelog
pa-lem Oct 23, 2025
ac4182d
Merge branch 'ple-fix-retry-checks-IFC-1023' of github.com:opsmill/in…
pa-lem Oct 23, 2025
9b5ec2a
Merge branch 'stable' into ple-fix-retry-checks-IFC-1023
pa-lem Oct 23, 2025
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
1 change: 1 addition & 0 deletions changelog/+checks.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Resolved a problem that caused generator checks to fail when retrying requests
5 changes: 4 additions & 1 deletion frontend/app/src/config/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { CheckType } from "@/shared/api/graphql/generated/graphql";

import { RelationshipKind } from "@/entities/nodes/types";
import { PROPOSED_CHANGE_OBJECT } from "@/entities/proposed-changes/constants";

Expand Down Expand Up @@ -115,9 +117,10 @@ export const CHECKS_LABEL = {
IN_PROGRESS: "In progress",
};

export const VALIDATIONS_ENUM_MAP: { [key: string]: string } = {
export const VALIDATIONS_ENUM_MAP: { [key: string]: CheckType } = {
CoreArtifactValidator: "ARTIFACT",
CoreDataValidator: "DATA",
CoreGeneratorValidator: "GENERATOR",
CoreRepositoryValidator: "REPOSITORY",
CoreSchemaValidator: "SCHEMA",
CoreUserValidator: "USER",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { gql } from "@apollo/client";

export const GET_CHECKS = gql`
query GET_CORE_CHECKS($ids: [ID]!) {
CoreCheck(ids: $ids) {
import {
Get_Check_DetailsQuery,
Get_Check_DetailsQueryVariables,
} from "@/shared/api/graphql/generated/graphql";
import graphqlClient from "@/shared/api/graphql/graphqlClientApollo";

const GET_CHECK_DETAILS = gql`
query GET_CHECK_DETAILS($id: ID!) {
CoreCheck(ids: [$id]) {
edges {
node {
id
Expand Down Expand Up @@ -63,3 +69,12 @@ export const GET_CHECKS = gql`
}
}
`;

export interface GetCheckDetailsFromApiParams extends Get_Check_DetailsQueryVariables {}

export const getCheckDetailsFromApi = async (variables: GetCheckDetailsFromApiParams) => {
return graphqlClient.query<Get_Check_DetailsQuery, Get_Check_DetailsQueryVariables>({
query: GET_CHECK_DETAILS,
variables,
});
};
54 changes: 54 additions & 0 deletions frontend/app/src/entities/diff/api/get-validators-from-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { gql } from "@apollo/client";

import {
Get_Check_DetailsQueryVariables,
Get_Core_ValidatorsQuery,
} from "@/shared/api/graphql/generated/graphql";
import graphqlClient from "@/shared/api/graphql/graphqlClientApollo";

const GET_VALIDATORS = gql`
query GET_CORE_VALIDATORS($id: ID!) {
CoreValidator(proposed_change__ids: [$id]) {
edges {
node {
id
display_label
conclusion {
value
}
started_at {
value
}
completed_at {
value
}
state {
value
}
checks {
edges {
node {
conclusion {
value
}
severity {
value
}
}
}
}
__typename
}
}
}
}
`;

export interface GetValidatorsFromApiParams extends Get_Check_DetailsQueryVariables {}

export const getValidatorsFromApi = async (variables: GetValidatorsFromApiParams) => {
return graphqlClient.query<Get_Core_ValidatorsQuery, Get_Check_DetailsQueryVariables>({
query: GET_VALIDATORS,
variables,
});
};
39 changes: 0 additions & 39 deletions frontend/app/src/entities/diff/api/getValidators.ts

This file was deleted.

32 changes: 32 additions & 0 deletions frontend/app/src/entities/diff/api/run-check-from-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { gql } from "@apollo/client";

import {
Run_CheckMutation,
Run_CheckMutationVariables,
} from "@/shared/api/graphql/generated/graphql";
import graphqlClient from "@/shared/api/graphql/graphqlClientApollo";

export const RUN_CHECK = gql`
mutation RUN_CHECK($proposedChangeId: String!, $checkType: CheckType) {
CoreProposedChangeRunCheck (
data: {
id: $proposedChangeId,
check_type: $checkType
}
) {
ok
}
}
`;

export interface RunCheckFromApiParams extends Run_CheckMutationVariables {}

export const runCheckFromApi = ({ proposedChangeId, checkType }: RunCheckFromApiParams) => {
return graphqlClient.mutate<Run_CheckMutation, Run_CheckMutationVariables>({
mutation: RUN_CHECK,
variables: {
proposedChangeId,
checkType,
},
});
};
14 changes: 0 additions & 14 deletions frontend/app/src/entities/diff/api/runCheck.ts

This file was deleted.

50 changes: 23 additions & 27 deletions frontend/app/src/entities/diff/checks/check.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
import { Icon } from "@iconify-icon/react";
import { useAtomValue } from "jotai";

import useQuery from "@/shared/api/graphql/useQuery";
import { InfoButton } from "@/shared/components/buttons/info-button";
import Accordion from "@/shared/components/display/accordion";
import { DateDisplay } from "@/shared/components/display/date-display";
import { CodeViewer } from "@/shared/components/editor/code/code-viewer";
import ErrorScreen from "@/shared/components/errors/error-screen";
import { Skeleton } from "@/shared/components/skeleton";
import { LoadingIndicator } from "@/shared/components/loading/loading-indicator";
import { List } from "@/shared/components/table/list";
import { Popover, PopoverContent, PopoverTrigger } from "@/shared/components/ui/popover";
import { Tooltip } from "@/shared/components/ui/tooltip";
import { classNames } from "@/shared/utils/common";

import { GET_CHECKS } from "@/entities/diff/api/getCheckDetails";
import { DataIntegrityConflicts } from "@/entities/diff/checks/data-integrity-conflicts";
import { SchemaIntegrityConflicts } from "@/entities/diff/checks/schema-integrity-conflicts";
import { useGetCheckDetails } from "@/entities/diff/domain/get-check-details.query";
import { schemaKindLabelState } from "@/entities/schema/stores/schemaKindLabel.atom";

import { DataIntegrityConflicts } from "./data-integrity-conflicts";
import { SchemaIntegrityConflicts } from "./schema-integrity-conflicts";

type tCheckProps = {
id: string;
};
Expand Down Expand Up @@ -75,9 +73,23 @@ const getCheckBorderColor = (severity?: string) => {
export const Check = ({ id }: tCheckProps) => {
const schemaKindLabel = useAtomValue(schemaKindLabelState);

const { loading, error, data } = useQuery(GET_CHECKS, { variables: { ids: [id] } });
const { isPending, error, data: check } = useGetCheckDetails({ checkId: id });

if (error) {
return (
<div className={"flex flex-col rounded-md border-l-4 bg-white p-2"}>
<ErrorScreen message="Something went wrong when fetching the check details" />
</div>
);
}

if (isPending) {
return <LoadingIndicator />;
}

const check = data?.CoreCheck?.edges?.[0]?.node ?? {};
if (!check) {
return null;
}

const {
__typename,
Expand All @@ -92,14 +104,6 @@ export const Check = ({ id }: tCheckProps) => {
conflicts,
} = check;

if (error) {
return (
<div className={"flex flex-col rounded-md border-l-4 bg-white p-2"}>
<ErrorScreen message="Something went wrong when fetching the check details" />
</div>
);
}

const columns = [
{
name: "type",
Expand Down Expand Up @@ -133,20 +137,12 @@ export const Check = ({ id }: tCheckProps) => {
<div className="mb-2 flex">
<div className="flex flex-1 flex-col">
<div className="flex items-center">
{loading ? (
<Skeleton className="mr-2 h-3 w-3 rounded-sm" />
) : (
getCheckIcon(conclusion?.value)
)}
{getCheckIcon(conclusion?.value)}

{loading ? <Skeleton className="h-3 w-40" /> : name?.value || display_label}
{name?.value || display_label}

<div className="flex flex-1 items-center justify-end">
{loading ? (
<Skeleton className="h-3 w-24" />
) : (
created_at?.value && <DateDisplay date={created_at?.value} />
)}
{created_at?.value && <DateDisplay date={created_at?.value} />}

<Popover>
<PopoverTrigger asChild>
Expand Down
Loading
Loading