data_diff: add dedicated unit test file for pure functions

Open Beginner friendly
#718 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Quiet
Tech stack
sql, typescript

Research direction

Start with the pure functions in packages/opencode/src/altimate/native/connections/data-diff.ts and the related tool file at packages/opencode/src/altimate/tools/data-diff.ts. Create packages/opencode/test/altimate/data-diff.test.ts with table-driven cases for the listed functions across postgres, snowflake, bigquery, clickhouse, mysql, oracle, and tsql. Done means the dedicated tests cover each named function and dialect-specific behavior.

Written by the indexing model from the issue text.

Description

Flagged during v0.5.22 release review (Tech Lead persona).

The data_diff feature ships 1,164 lines in:

  • packages/opencode/src/altimate/native/connections/data-diff.ts
  • packages/opencode/src/altimate/tools/data-diff.ts

Coverage gap — no dedicated test file exercises the pure functions:

  • resolveTableSources, injectCte
  • isAuditColumn, isAutoTimestampDefault
  • buildColumnDiscoverySQL, parseColumnInfo
  • quoteIdentForDialect, dateTruncExpr
  • partitionMode, buildPartitionWhereClause
  • mergeOutcomes, extractStats

Create packages/opencode/test/altimate/data-diff.test.ts with table-driven tests per dialect (postgres, snowflake, bigquery, clickhouse, mysql, oracle, tsql). Estimated ~2 hours.

Deferred because: v0.5.22 ships adversarial tests covering the main attack surface via tool-facing paths. Dedicated unit coverage is a maintainability improvement, not a shipping blocker.

Dominant language
TypeScript
Stars
813
Forks
134
Avg merge
2d 5h
Merged PRs (30d)
62

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AltimateAI/altimate-code

All issues in AltimateAI/altimate-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.