fix(insight): count git_commit events in commit metrics#785
Open
daniel-enqz wants to merge 2 commits into
Open
fix(insight): count git_commit events in commit metrics#785daniel-enqz wants to merge 2 commits into
daniel-enqz wants to merge 2 commits into
Conversation
The extractor emits commits made with -m/--message as type='git_commit' (since v1.0.161), reserving type='git' data='commit' only for commits without a message. The Insight dashboard queries were never updated and still filtered on the legacy shape, so the Commit Rate widget, time-to-first-commit, sessions-with-commit, and the productivity score only counted no-message commits — undercounting real commit activity. Count both shapes everywhere commits are tallied. Fixes mksglu#784
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes the Insight dashboard's commit metrics, which were undercounting commits — see #784.
Why
In v1.0.161 the extractor (
src/session/extract.ts) started emitting commits made with-m/--messageastype='git_commit'(commit subject indata), reservingtype='git', data='commit'only for commits without a message.session-db'shas_commitwas updated to match (type='git_commit').insight/server.mjswas never updated and still filtered on the legacytype='git' AND data='commit', so it counted only no-message commits. In real usage almost all commits use-m, so the dashboard showed near-zero commits (e.g. 2 reported vs 38 actually recorded).Change
Count both shapes in all four commit tallies:
timeToFirstCommitcommitRate(both project_dir and fallback branches)commitSessions(productivity score input)Testing
node --check insight/server.mjspasses.2, now reflects the fullgit_commit+ legacy count (38).Closes #784