dosubot[bot] commented on issue #8833: URL: https://github.com/apache/incubator-devlake/issues/8833#issuecomment-4235203569
<!-- Answer --> The bug analysis looks correct. The `_accounts` CTE in the "Code Commits" panel selects `u.email` from the `users` table, but the outer query joins on `c.author_id = a.email` — so when a user's DevLake user email differs from their GitHub account email, the join fails and returns 0 commits [[1]](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/grafana/dashboards/WorkLogs.json#L789-L791). Interestingly, other panels in the same dashboard (e.g., "Lines of code") use `c.author_id = a.account_id` instead of an email-based join [[2]](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/grafana/dashboards/WorkLogs.json#L862), which avoids this issue entirely. The fix proposed here — changing `u.email` to `a.email` in the CTE — should resolve the mismatch. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response#message_id=698fd24e-c1d3-47c3-bc0d-c16f0f5bb014&feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer#message_id=698fd24e-c1d3-47c3-bc0d-c16f0f5bb014&feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources#message_id=698fd24e-c1d3-47c3-bc0d-c16f0f5bb014&feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose#message_id=698fd24e-c1d3-47c3-bc0d-c16f0f5bb014&feedback_type=too_verbose) | [Hallucination](https:// app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination#message_id=698fd24e-c1d3-47c3-bc0d-c16f0f5bb014&feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report#message_id=698fd24e-c1d3-47c3-bc0d-c16f0f5bb014&feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other#message_id=698fd24e-c1d3-47c3-bc0d-c16f0f5bb014&feedback_type=other)</sup> [](https://app.dosu.dev/b4e8e847-d479-4541-83a8-d88d83fea5c9/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge) [](https://cursor.com/link/prompt?text=The%20bug%20analysis%20looks%20correct.%20The%20%60_accounts%60%20CTE%20in%20the%20%22Code%20Commits%22%20panel%20selects%20%60u.email%60%20from%20the%20%60users%60%20table%2C%20but%20the%20outer%20query%20joins%20on%20%60c.author_id%20%3D%20a.email%60%20%E2%80%94%20so%20when%20a%20user%27s%20DevLake%20user%20email%20differs%20from%20their%20GitHub%20account%20email%2C%20the%20join%20fails%20and%20returns%200%20commits%20%5B%5B1%5D%5D%28https%3A//github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/grafana/dashboards/WorkLogs.json%23L789-L791%29.%0A%0AInterestingly%2C%20other%20panels%20in%20the%20same%20dashboard%20%28e.g.%2C%20%22Lines%20of%20 code%22%29%20use%20%60c.author_id%20%3D%20a.account_id%60%20instead%20of%20an%20email-based%20join%20%5B%5B2%5D%5D%28https%3A//github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/grafana/dashboards/WorkLogs.json%23L862%29%2C%20which%20avoids%20this%20issue%20entirely.%20The%20fix%20proposed%20here%20%E2%80%94%20changing%20%60u.email%60%20to%20%60a.email%60%20in%20the%20CTE%20%E2%80%94%20should%20resolve%20the%20mismatch.) [](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=join-discord) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-devlake/issues/8833) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
