fix(ci): save all benchmark reports and use git-based dev versioning#196
fix(ci): save all benchmark reports and use git-based dev versioning#196carlos-alm merged 10 commits intomainfrom
Conversation
The branch-compare command was registered in cli.js and its exports
added to index.js, but the implementation file src/branch-compare.js
was never created. This caused two issues:
1. `codegraph branch-compare` crashed with ERR_MODULE_NOT_FOUND
2. `import('@optave/codegraph')` crashed entirely because index.js
has a top-level re-export from the missing file, making the
programmatic API completely unusable
Remove the dead references until an implementation exists.
Closes #166
The branch-compare command was registered in cli.js and index.js but src/branch-compare.js was never committed — it was lost as untracked files in the fix/complexity-sql-sanitize worktree. Recovered the full implementation (568 lines) and integration test (192 lines, 7 tests) from git object 22c8185. This restores the cli.js command and index.js exports that were removed in 746aa65, now that the implementation file exists. Updated the dogfood report to reflect the recovery (no bugs found, rating 8.5/10). Closes #166 Impact: 13 functions changed, 4 affected
Dev builds always produced 2.4.1-dev.<sha> because PATCH was hardcoded to +1 from package.json. Now uses git rev-list to count commits since the release tag, giving monotonically increasing versions like 2.4.5, 2.4.15, etc. Benchmark scripts now use getBenchmarkVersion() (via git describe) to detect dev vs release state, preventing dev runs from overwriting release benchmark data in historical reports. Impact: 2 functions changed, 6 affected
The bench-config.js local mode returned 'dev' as the version string. Now uses getBenchmarkVersion() to derive a proper semver from git state, so all 4 benchmark scripts that use bench-config get dev-aware versions. Impact: 1 functions changed, 4 affected
Both now use git describe --tags --match "v*" to find the nearest
release tag and count commits from it. Previously publish.yml
constructed the tag from package.json (v${CURRENT}) while
bench-version.js used git describe, which would diverge if
package.json was bumped but not yet tagged.
Impact: 1 functions changed, 0 affected
When no git tags exist, bench-version.js now produces PATCH+1 (e.g. "2.5.1-dev") matching publish.yml's fallback, instead of the bare "2.5.0-dev" which diverged. Impact: 1 functions changed, 0 affected
Refactor getBenchmarkVersion to use --abbrev=0 + git rev-list (same as publish.yml) instead of parsing full git describe output. Both now use identical steps: find tag, count commits, get short SHA. Impact: 1 functions changed, 0 affected
Impact: 1 functions changed, 0 affected
…om/optave/codegraph into fix/benchmark-all-reports # Conflicts: # .github/workflows/publish.yml Impact: 3 functions changed, 7 affected
Merges PR #173 (commit-count versioning for dev builds) and fixes a bug where embedding, query, and incremental benchmark reports were never persisted. The "Check for changes" step used `git diff` which only detects modifications to tracked files — newly created report files (untracked) were invisible, so the PR was never created. Now also checks for untracked files via `git ls-files --others`.
|
Claude finished @carlos-alm's task —— View job PR Review: Fix untracked file detection in benchmark workflow and implement git-based dev versioningReview Checklist
Root Cause AnalysisProblem Being Solved: Benchmark workflow fails to detect newly created report files because Why This Approach: Adding Risk Assessment: LOW RISK - This is a legitimate bug fix addressing a real workflow failure, not a workaround to hide issues. Configuration Change Analysis ✅LOW RISK - All changes are justified and improve functionality:
Test Integrity ✅
Code Quality ✅Strengths:
Minor Issues:
Architecture:
Final Assessment |
Greptile SummaryFixed critical bug in benchmark workflow where new report files weren't detected because Key changes:
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 5f4cec0 |
Summary
fix/dogfood-missing-branch-compare): switches dev builds from timestamp-based versioning to git-based commit-count versioning (MAJOR.MINOR.PATCH-dev.SHA), keeping dev and stable versions consistent withscripts/bench-version.js.build,embedding,query,incremental) usedgit diff --quiet HEADwhich only detects modifications to tracked files. When report files likeEMBEDDING-BENCHMARKS.md,QUERY-BENCHMARKS.md, andINCREMENTAL-BENCHMARKS.mddon't yet exist in the repo, they are created as untracked files andgit diffsilently reports no changes, so the PR is never created. Each step now also checks for untracked files viagit ls-files --others --exclude-standard.Test plan
MAJOR.MINOR.PATCH-dev.SHAformatcompute-versionstep works withfetch-depth: 0