feat: build metadata tracking and excludeTests config shorthand#105
Conversation
Track engine name, version, and codegraph version in a new build_meta table (migration v7). Warn during incremental builds when the engine or codegraph version has changed since the last build, suggesting --no-incremental. Display build metadata in the info command with mismatch warnings. Accept excludeTests at the top level of .codegraphrc.json as a shorthand for query.excludeTests, with the nested form taking precedence. Impact: 4 functions changed, 8 affected
|
Claude finished @carlos-alm's task —— View job Root Cause AnalysisProblem Being Solved: This PR addresses two legitimate UX issues:
Why This Approach: Both solutions are well-justified:
Risk Assessment: Low risk - both features are additive with proper fallbacks and comprehensive test coverage. Configuration Changes✅ No concerning configuration relaxations detected
Test Integrity✅ Strong test coverage with no red flags
Code Quality ReviewBuild Metadata Implementation (src/builder.js:355-368, src/db.js:115-132)Strengths:
Minor Concerns:
Config Hoisting Implementation (src/config.js:49-52)Strengths:
CLI Info Command Enhancement (src/cli.js:672-703)Strengths:
API Exports (src/index.js:27-33)Strengths:
Minor Issues Identified:
Security Considerations✅ No security concerns identified:
Performance Impact✅ Minimal performance overhead:
Final Recommendation
This PR demonstrates thoughtful engineering with attention to edge cases, proper testing, and user experience improvements. |
Greptile SummaryThis PR adds build metadata tracking and a config shorthand for Build Metadata Tracking:
Config Shorthand:
Testing:
Code Quality:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
Start[buildGraph starts] --> LoadConfig[Load config with excludeTests hoisting]
LoadConfig --> CheckIncremental{Incremental build?}
CheckIncremental -->|Yes| GetMeta[getBuildMeta: read engine & version from DB]
CheckIncremental -->|No| Parse[Parse files]
GetMeta --> Compare{Engine or version changed?}
Compare -->|Yes| Warn[Warn: Consider --no-incremental]
Compare -->|No| Parse
Warn --> Parse
Parse --> BuildGraph[Build nodes & edges]
BuildGraph --> SetMeta[setBuildMeta: persist engine, version, timestamp]
SetMeta --> Close[Close DB]
subgraph "Config Processing"
LoadConfig --> CheckTop{Top-level excludeTests exists?}
CheckTop -->|Yes| CheckNested{Nested query.excludeTests exists?}
CheckTop -->|No| UseDefaults[Use defaults]
CheckNested -->|Yes| UseNested[Use nested value]
CheckNested -->|No| Hoist[Hoist to query.excludeTests]
Hoist --> Cleanup[Delete top-level property]
UseNested --> Cleanup
Cleanup --> Done[Return merged config]
end
Last reviewed commit: f65b364 |
|
Addressed the review feedback in 8e08725:
All 565 tests pass. |
Summary
build_metatable (migration v7) stores engine name, version, codegraph version, and build timestamp. Incremental builds now warn when the engine or codegraph version has changed since the last build, suggesting--no-incremental.infocommand (9.4):codegraph infodisplays build metadata from the DB and warns on version/engine mismatches.excludeTestsconfig shorthand (9.2):{ "excludeTests": true }at the top level of.codegraphrc.jsonis now hoisted intoquery.excludeTests. Nested form takes precedence.Test plan
excludeTestshoisting (top-level true, nested precedence, top-level false)build_metahelpers (table creation, null on missing table, read/write, upsert)