BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e2bdce8d
Commit
e2bdce8d
authored
Mar 07, 2018
by
Riccardo Padovani
Committed by
Sean McGivern
Mar 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Count discussions on issues and merge requests as contributions for the contributions calendar
parent
cfe203fa
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
2 deletions
+9
-2
feature--43691-count-diff-note-calendar-activity.yml
...ased/feature--43691-count-diff-note-calendar-activity.yml
+1
-1
contributions_calendar.rb
lib/gitlab/contributions_calendar.rb
+1
-1
contributions_calendar_spec.rb
spec/lib/gitlab/contributions_calendar_spec.rb
+7
-0
No files found.
changelogs/unreleased/feature--43691-count-diff-note-calendar-activity.yml
View file @
e2bdce8d
---
title
:
Count comments on diffs as contributions for the contributions calendar
title
:
Count comments on diffs a
nd discussions a
s contributions for the contributions calendar
merge_request
:
17418
author
:
Riccardo Padovani
type
:
fixed
lib/gitlab/contributions_calendar.rb
View file @
e2bdce8d
...
...
@@ -23,7 +23,7 @@ module Gitlab
mr_events
=
event_counts
(
date_from
,
:merge_requests
)
.
having
(
action:
[
Event
::
MERGED
,
Event
::
CREATED
,
Event
::
CLOSED
],
target_type:
"MergeRequest"
)
note_events
=
event_counts
(
date_from
,
:merge_requests
)
.
having
(
action:
[
Event
::
COMMENTED
]
,
target_type:
%w(Note DiffNote)
)
.
having
(
action:
[
Event
::
COMMENTED
])
union
=
Gitlab
::
SQL
::
Union
.
new
([
repo_events
,
issue_events
,
mr_events
,
note_events
])
events
=
Event
.
find_by_sql
(
union
.
to_sql
).
map
(
&
:attributes
)
...
...
spec/lib/gitlab/contributions_calendar_spec.rb
View file @
e2bdce8d
...
...
@@ -77,6 +77,13 @@ describe Gitlab::ContributionsCalendar do
expect
(
calendar
(
contributor
).
activity_dates
[
today
]).
to
eq
(
1
)
end
it
"counts the discussions on merge requests and issues"
do
create_event
(
public_project
,
today
,
0
,
Event
::
COMMENTED
,
:discussion_note_on_merge_request
)
create_event
(
public_project
,
today
,
2
,
Event
::
COMMENTED
,
:discussion_note_on_issue
)
expect
(
calendar
(
contributor
).
activity_dates
[
today
]).
to
eq
(
2
)
end
context
"when events fall under different dates depending on the time zone"
do
before
do
create_event
(
public_project
,
today
,
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment