Revert "use builtin vitest file snapshots for OpenAPI json file"#1813
Revert "use builtin vitest file snapshots for OpenAPI json file"#1813robert-inkeep wants to merge 1 commit intomainfrom
Conversation
This reverts commit bcb3013.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
PR Review Summary
4 Key Findings | Risk: Medium
🟠⚠️ Major (4) 🟠⚠️
🟠 1) evaluateConversation.ts:11-12, runDatasetItem.ts:18-19, Agent.ts:44-45, ref.ts:14 Revert introduces import path changes that don't match pre-#1801 state
Issue: This revert changes several files from relative imports to src/ prefix style, but the original files (before PR #1801) used relative imports. This means the revert is not restoring the codebase to its pre-#1801 state — it's introducing new import style changes.
Why: A revert PR should restore the exact previous state. Introducing different import styles:
- Creates inconsistency within the same files (e.g.,
evaluateConversation.tsnow hassrc/data/dbon lines 11-12 but../../../../data/db/runDbClienton line 13) - Deviates from the established codebase convention (>95% of files use relative imports)
- The
src/prefix is NOT a TypeScript path alias — it only works viabaseUrl: ".", making it less explicit
Fix: See inline comments with 1-click suggestions to restore the correct relative import paths.
Refs:
💭 Consider (2) 💭
💭 1) openapi.test.ts:27-140 Custom JSON diff implementation has no test coverage
Issue + Why: The custom diff logic (computeJsonDiff, formatDiffOutput, summarizeValue) provides better developer experience for OpenAPI changes than Vitest's built-in snapshots, but has no unit test coverage. If this logic has bugs, snapshot test failures could be misleading or miss real issues.
Suggestion: Consider adding unit tests for the diff utilities in a future PR. This is pre-existing code being restored, so not blocking for this revert.
💭 2) openapi.test.ts:262-268 Custom snapshot update mechanism differs from Vitest conventions
Issue + Why: The UPDATE_OPENAPI_SNAPSHOT=true environment variable approach differs from Vitest's standard -u flag. New contributors may try pnpm test -u and be confused when it doesn't update the snapshot.
Suggestion: Ensure this is documented in AGENTS.md or the package README.
📌 Inline Comments (4)
- 🟠
evaluateConversation.ts:11-12Import path style doesn't match pre-#1801 state - 🟠
runDatasetItem.ts:18-19Import path style doesn't match pre-#1801 state - 🟠
Agent.ts:44-45Import path style doesn't match pre-#1801 state - 🟠
ref.ts:14Import path style doesn't match pre-#1801 state
💡 APPROVE WITH SUGGESTIONS
Summary: The OpenAPI test revert itself looks fine and restores the custom diff logic that provides better developer feedback for API contract changes. However, the revert is not clean — it introduces src/ prefix imports that didn't exist before PR #1801. I've provided 1-click fix suggestions in the inline comments. Once those imports are corrected to use relative paths (matching the pre-#1801 state), this should be good to merge.
Discarded (1)
| Location | Issue | Reason Discarded |
|---|---|---|
stream-helpers.test.ts:23-27 |
Mock type changed from Mock<...> to ReturnType<typeof vi.fn> |
Cosmetic TypeScript change with no behavioral impact |
Reviewer Stats
| Reviewer | Returned | Inline Comments | Main Findings | Pending Recs | Discarded |
|---|---|---|---|---|---|
pr-review-tests |
3 | 0 | 0 | 0 | 1 |
pr-review-consistency |
1 | 4 | 0 | 0 | 0 |
pr-review-standards |
0 | 0 | 0 | 0 | 0 |
| Total | 4 | 4 | 0 | 0 | 1 |
Note: The 4 inline comments cover the same issue (import path inconsistency) across 4 files — they were consolidated from pr-review-consistency's multi-file finding.
| import { manageDbClient } from 'src/data/db'; | ||
| import manageDbPool from 'src/data/db/manageDbPool'; |
There was a problem hiding this comment.
MAJOR Import path style introduced by revert doesn't match pre-#1801 state
This file used relative imports (../../../../data/db) before PR #1801 was merged. The revert should restore those exact imports rather than introducing the src/ prefix style. Currently this creates inconsistency with line 13 which still uses relative imports.
| import { manageDbClient } from 'src/data/db'; | |
| import manageDbPool from 'src/data/db/manageDbPool'; | |
| import { manageDbClient } from '../../../../data/db'; | |
| import manageDbPool from '../../../../data/db/manageDbPool'; |
| import { manageDbClient } from 'src/data/db'; | ||
| import manageDbPool from 'src/data/db/manageDbPool'; |
There was a problem hiding this comment.
MAJOR Import path style introduced by revert doesn't match pre-#1801 state
Same issue as evaluateConversation.ts — this file used relative imports before PR #1801. The revert should restore those exact imports.
| import { manageDbClient } from 'src/data/db'; | |
| import manageDbPool from 'src/data/db/manageDbPool'; | |
| import { manageDbClient } from '../../../../data/db'; | |
| import manageDbPool from '../../../../data/db/manageDbPool'; |
| import manageDbPool from 'src/data/db/manageDbPool'; | ||
| import { env } from 'src/env'; |
There was a problem hiding this comment.
MAJOR Import path style introduced by revert doesn't match pre-#1801 state
Agent.ts used relative imports (../../../data/db/manageDbPool and ../../../env) before PR #1801. The revert introduces src/ prefix style which creates inconsistency with line 46.
| import manageDbPool from 'src/data/db/manageDbPool'; | |
| import { env } from 'src/env'; | |
| import manageDbPool from '../../../data/db/manageDbPool'; | |
| import { env } from '../../../env'; |
| } from '@inkeep/agents-core'; | ||
| import type { Context, Next } from 'hono'; | ||
| import { manageDbClient } from '../data/db'; | ||
| import { manageDbClient } from 'src/data/db'; |
Reverts #1801