Search before asking
What happened
invalid number of commits per user in Code Commits panel, Work Logs dashboard, when user has multiple accounts and his email does not match the one in GitHub.
What do you expect to happen
original sql
with _accounts as (
select ua.account_id, ua.user_id, u.name, u.email
from accounts a
join user_accounts ua on a.id = ua.account_id
join users u on ua.user_id = u.id
where ua.user_id in (${users:singlequote})
)
SELECT count(distinct c.sha)
FROM commits c
join _accounts a on c.author_id = a.email
where $__timeFilter(authored_date)
proper sql
with _accounts as (
select ua.account_id, ua.user_id, u.name, a.email <------ should be account email, not user email
from accounts a
join user_accounts ua on a.id = ua.account_id
join users u on ua.user_id = u.id
where ua.user_id in (${users:singlequote})
)
SELECT count(distinct c.sha)
FROM commits c
join _accounts a on c.author_id = a.email
where $__timeFilter(authored_date)
How to reproduce
create teams and users with user email not equal to his Github email, open panel and observe 0 commits.
Anything else
No response
Version
v1.0.3-beta10@99376a8
Are you willing to submit PR?
Code of Conduct
Search before asking
What happened
invalid number of commits per user in
Code Commitspanel, Work Logs dashboard, when user has multiple accounts and his email does not match the one in GitHub.What do you expect to happen
original sql
proper sql
How to reproduce
create teams and users with user email not equal to his Github email, open panel and observe 0 commits.
Anything else
No response
Version
v1.0.3-beta10@99376a8
Are you willing to submit PR?
Code of Conduct