Skip to content

feat: update test flow schema and remove two unnecessary test flow tables#18

Open
Karim-Agami wants to merge 1 commit into
developfrom
feat/test-flow-table-added
Open

feat: update test flow schema and remove two unnecessary test flow tables#18
Karim-Agami wants to merge 1 commit into
developfrom
feat/test-flow-table-added

Conversation

@Karim-Agami

Copy link
Copy Markdown
Collaborator

…e testflow table

@github-actions

Copy link
Copy Markdown

🧪 Test & Coverage Report

Metric Result
Status ✅ Passed
Tests ✅ 209 passed / 209 total
Suites 26 passed / 26 total

Coverage

Category Coverage Covered / Total
🟡 Statements 75.5% 1242 / 1645
🔴 Branches 47.43% 305 / 643
🟡 Functions 60.88% 137 / 225
🟡 Lines 76.07% 1183 / 1555

Updated for commit 8cd779b

@Karim-Agami Karim-Agami requested a review from Mo2Hefny June 17, 2026 13:41
transition: z.record(z.string(), z.unknown()).nullable(),
});

export const SerializedFlowSchema = z.object({

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Schemas should be a contract in the coverit-contracts and added to the models/ folder instead of creating them using zod.


export async function saveAllFlows(
sessionId: string,
payload: AllFlowsPayload,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

SerializedFlow and AllFlowsPayload may be redundant after adding the contracts and just using the same contract you will use for the schema as a type here.

);
}
if (flowsToInsert.length === 0) {
logger.info(`No flows to save for session ${sessionId}`);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be an error and add a constants file for the errors/messages.

`Saved flows for session ${sessionId}: ` +
`${stepsByFingerprint.size} unique steps, ` +
`${Object.values(payload).flat().length} total flows`,
`Saved flows for session ${sessionId}: ${flowsToInsert.length} total flows saved in bulk.`,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Return a Promise<MessageResponse> and add types to the functions declaration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants