summaryrefslogtreecommitdiff
path: root/lib/gitlab/contributions_calendar.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add latest changes from gitlab-org/gitlab@13-1-stable-eeGitLab Bot2020-06-181-4/+4
|
* Further remove code branches by database typeAndreas Brandl2019-07-291-5/+1
| | | | | | | | We dropped MySQL support and a lot of mysql specific code has been removed in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/29608. This comes in from the other direction and removes any `if postgresql?` branches.
* Eliminate most N+1 queries loading UserController#calendar_activitiesStan Hu2019-03-011-0/+1
| | | | | | | | | | We can reduce a significant number of queries by preloading the associations for events. On GitLab.com, for a date that had 456 events, this brought the load time down from 8.7 to 1.2 s. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/58392
* Replace deprecated uniq on a Relation with distinctJasper Maes2018-10-261-1/+1
|
* Enable frozen string for lib/gitlab/*.rbgfyoung2018-10-221-0/+2
|
* Added FromUnion to easily select from a UNIONYorick Peterse2018-09-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds the module `FromUnion`, which provides the class method `from_union`. This simplifies the process of selecting data from the result of a UNION, and reduces the likelihood of making mistakes. As a result, instead of this: union = Gitlab::SQL::Union.new([foo, bar]) Foo.from("(#{union.to_sql}) #{Foo.table_name}") We can now write this instead: Foo.from_union([foo, bar]) This commit also includes some changes to make this new setup work properly. For example, a bug in Rails 4 (https://github.com/rails/rails/issues/24193) would break the use of `from("sub-query-here").includes(:relation)` in certain cases. There was also a CI query which appeared to repeat a lot of conditions from an outer query on an inner query, which isn't necessary. Finally, we include a RuboCop cop to ensure developers use this new module, instead of using Gitlab::SQL::Union directly. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/51307
* Disable existing offenses for the CodeReuse copsYorick Peterse2018-09-111-0/+6
| | | | | This whitelists all existing offenses for the various CodeReuse cops, of which most are triggered by the CodeReuse/ActiveRecord cop.
* Include private contributions in user contribution graphGeorge Tsiolis2018-09-071-6/+6
|
* Replace .having with .where in calendar queryJan Provaznik2018-05-301-1/+1
| | | | | | | | | | | | | | the current syntax doesn't work properly in Rails 5, the resulting query looks like: HAVING "events"."project_id" IN (0) instead of: HAVING "events"."project_id" IN (SELECT "projects"."id" FROM... Also we should not use ActiveRecord internal methods. In this case we can filter projects in WHERE clause instead of doing this in HAVING clause. Usage of WHERE should be also more efficient because grouping is then done on much smaller subset of records.
* Count discussions on issues and merge requests as contributions for the ↵Riccardo Padovani2018-03-071-1/+1
| | | | contributions calendar
* #43691: DiffNotes not counted by ContributionsCalendarRiccardo Padovani2018-03-051-1/+1
|
* Port `read_cross_project` ability from EEBob Van Landuyt2018-02-221-0/+6
|
* fix rubocop violations 👮Mike Greiling2017-07-311-4/+4
|
* fix mysql syntax for date INTERVAL arithmaticMike Greiling2017-07-311-3/+7
|
* adjust timezone for date grouping in contributions calendarMike Greiling2017-07-291-2/+4
|
* use timezone-aware Date.current instead of Date.today in ↵Mike Greiling2017-07-291-2/+2
| | | | ContributionsCalendar class
* Enable Style/DotPosition Rubocop :cop:Grzegorz Bizon2017-06-211-23/+23
|
* Fix memoization in ContributionsCalendar#activity_datesfix-memoization-in-contributions-calendarSean McGivern2017-06-071-1/+1
| | | | | This doesn't appear to be actually called twice, but having it appear to work but not would be a problem if it was.
* Add comment events to contributions calendar22645-add-discussion-contribs-to-calendarRémy Coutable2017-02-131-2/+4
| | | | Signed-off-by: Rémy Coutable <remy@rymai.me>
* Merge branch '23403-fix-events-for-private-project-features' into 'security'Robert Speicher2016-11-091-25/+49
| | | | | | | | | | | | 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>
* Replace contributions calendar timezone payload with datesClement Ho2016-09-161-9/+8
|
* Reduce contributions calendar data payloadClement Ho2016-08-251-1/+0
|
* Group the contributing calendar by dayPhil Hughes2016-05-161-1/+1
| | | | This aligns the boxes correctly with the day on the left side of the calendar
* Simplify `ContributionsCalendar#starting_year` and `#starting_month`Robert Speicher2016-01-011-2/+2
|
* Fix rubocop warnings in libGuilherme Garnier2015-10-031-1/+0
|
* Fix contributions calendar empty problem under mysqlZhang Sen2015-04-251-1/+1
| | | | | | | 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.
* Improve contribution calendar per day infoDmitriy Zaporozhets2015-03-221-2/+2
|
* Contribution calendar will use events instead of commits to count contributionsDmitriy Zaporozhets2015-03-221-12/+7
|
* Refactor contributions events and write tests for calendarDmitriy Zaporozhets2015-03-221-6/+2
|
* Replace commits calendar with contributions calendarDmitriy Zaporozhets2015-03-211-0/+65
* 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