Respect project visibility settings in the contributions calendar
This MR fixes a number of bugs relating to access controls and date selection of events for the contributions calendar
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/23403
See merge request !2019
Signed-off-by: Rémy Coutable <remy@rymai.me>
When using MySQL as database backend in GitLab, ``date`` in ``date(created_at), count(id) as total_amount``
won't return the ``date`` column (should be ``date(created_at)``), as a result, there's no contribution in the user
profile page.
Adding an ``as date`` can solve this problem.
* count opening of issues and merge requests
* dont trigger git repository - use events from database
* much-much faster since does not affected by repository size