Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ea81ec39
Commit
ea81ec39
authored
Mar 05, 2019
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Plain Diff
Merge dev.gitlab.org master into GitLab.com master
parents
d39ef1a1
00285c13
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
68 additions
and
43 deletions
+68
-43
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+5
-0
app/models/concerns/milestoneish.rb
app/models/concerns/milestoneish.rb
+3
-0
app/policies/group_policy.rb
app/policies/group_policy.rb
+3
-0
ee/spec/models/burndown_spec.rb
ee/spec/models/burndown_spec.rb
+12
-8
ee/spec/models/epic_spec.rb
ee/spec/models/epic_spec.rb
+31
-19
ee/spec/services/ee/boards/issues/list_service_spec.rb
ee/spec/services/ee/boards/issues/list_service_spec.rb
+2
-1
ee/spec/services/ee/issuable/clone/attributes_rewriter_spec.rb
...ec/services/ee/issuable/clone/attributes_rewriter_spec.rb
+0
-9
ee/spec/services/ee/issues/update_service_spec.rb
ee/spec/services/ee/issues/update_service_spec.rb
+2
-2
ee/spec/services/epic_issues/list_service_spec.rb
ee/spec/services/epic_issues/list_service_spec.rb
+1
-2
ee/spec/services/epics/issue_promote_service_spec.rb
ee/spec/services/epics/issue_promote_service_spec.rb
+0
-1
ee/spec/services/milestones/update_service_spec.rb
ee/spec/services/milestones/update_service_spec.rb
+1
-1
spec/policies/group_policy_spec.rb
spec/policies/group_policy_spec.rb
+8
-0
No files found.
app/models/concerns/issuable.rb
View file @
ea81ec39
...
...
@@ -121,6 +121,11 @@ module Issuable
end
def
milestone_available?
<<<<<<<
HEAD
=======
return
if
is_a?
(
Epic
)
>>>>>>>
dev
/
master
project_id
==
milestone
&
.
project_id
||
project
.
ancestors_upto
.
compact
.
include?
(
milestone
&
.
group
)
end
...
...
app/models/concerns/milestoneish.rb
View file @
ea81ec39
...
...
@@ -46,6 +46,7 @@ module Milestoneish
end
end
<<<<<<<
HEAD
def
merge_requests_visible_to_user
(
user
)
memoize_per_user
(
user
,
:merge_requests_visible_to_user
)
do
MergeRequestsFinder
.
new
(
user
,
{})
...
...
@@ -53,6 +54,8 @@ module Milestoneish
end
end
=======
>>>>>>>
dev
/
master
def
issue_participants_visible_by_user
(
user
)
User
.
joins
(
:issue_assignees
)
.
where
(
'issue_assignees.issue_id'
=>
issues_visible_to_user
(
user
).
select
(
:id
))
...
...
app/policies/group_policy.rb
View file @
ea81ec39
...
...
@@ -53,7 +53,10 @@ class GroupPolicy < BasePolicy
rule
{
admin
}.
enable
:read_group
rule
{
has_projects
}.
policy
do
<<<<<<<
HEAD
enable
:read_list
=======
>>>>>>>
dev
/
master
enable
:read_label
end
...
...
ee/spec/models/burndown_spec.rb
View file @
ea81ec39
...
...
@@ -133,26 +133,30 @@ describe Burndown do
end
describe
'group milestone burndown'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:nested_group
)
{
create
(
:group
,
parent:
group
)
}
let
(
:parent_group
)
{
create
(
:group
)
}
let
(
:group
)
{
create
(
:group
,
parent:
parent_group
)
}
let
(
:parent_group_project
)
{
create
(
:project
,
group:
parent_group
)
}
let
(
:group_project
)
{
create
(
:project
,
group:
group
)
}
let
(
:nested_group_project
)
{
create
(
:project
,
group:
nested_group
)
}
let
(
:group_milestone
)
{
create
(
:milestone
,
project:
nil
,
group:
group
,
start_date:
start_date
,
due_date:
due_date
)
}
let
(
:nested_group_milestone
)
{
create
(
:milestone
,
group:
nested_group
,
start_date:
start_date
,
due_date:
due_date
)
}
let
(
:parent_group_milestone
)
{
create
(
:milestone
,
project:
nil
,
group:
parent_group
,
start_date:
start_date
,
due_date:
due_date
)
}
let
(
:group_milestone
)
{
create
(
:milestone
,
group:
group
,
start_date:
start_date
,
due_date:
due_date
)
}
context
'when nested group milestone'
,
:nested_groups
do
before
do
<<<<<<<
HEAD
group
.
add_developer
(
user
)
=======
parent_group
.
add_developer
(
user
)
>>>>>>>
dev
/
master
end
it_behaves_like
'burndown for milestone'
do
let
(
:milestone
)
{
nested_
group_milestone
}
let
(
:project
)
{
nested_
group_project
}
let
(
:milestone
)
{
group_milestone
}
let
(
:project
)
{
group_project
}
let
(
:issue_params
)
do
{
milestone:
milestone
,
weight:
2
,
project_id:
nested_
group_project
.
id
,
project_id:
group_project
.
id
,
author:
user
,
created_at:
milestone
.
start_date
}
...
...
ee/spec/models/epic_spec.rb
View file @
ea81ec39
require
'spec_helper'
describe
Epic
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
group:
group
)
}
describe
'associations'
do
subject
{
build
(
:epic
)
}
...
...
@@ -225,29 +228,32 @@ describe Epic do
end
context
'fixed date is not set'
do
subject
{
create
(
:epic
,
start_date:
nil
,
end_date:
nil
)
}
subject
{
create
(
:epic
,
start_date:
nil
,
end_date:
nil
,
group:
group
)
}
let
(
:milestone1
)
do
create
(
:milestone
,
start_date:
Date
.
new
(
2000
,
1
,
1
),
due_date:
Date
.
new
(
2000
,
1
,
10
)
due_date:
Date
.
new
(
2000
,
1
,
10
),
group:
group
)
end
let
(
:milestone2
)
do
create
(
:milestone
,
start_date:
Date
.
new
(
2000
,
1
,
3
),
due_date:
Date
.
new
(
2000
,
1
,
20
)
due_date:
Date
.
new
(
2000
,
1
,
20
),
group:
group
)
end
context
'multiple milestones'
do
before
do
epic_issue1
=
create
(
:epic_issue
,
epic:
subject
)
epic_issue1
.
issue
.
update
(
milestone:
milestone1
)
epic_issue2
=
create
(
:epic_issue
,
epic:
subject
)
epic_issue2
.
issue
.
update
(
milestone:
milestone2
)
issue1
=
create
(
:issue
,
project:
project
,
milestone:
milestone1
)
issue2
=
create
(
:issue
,
project:
project
,
milestone:
milestone2
)
create
(
:epic_issue
,
epic:
subject
,
issue:
issue1
)
create
(
:epic_issue
,
epic:
subject
,
issue:
issue2
)
end
context
'complete start and due dates'
do
...
...
@@ -264,14 +270,16 @@ describe Epic do
create
(
:milestone
,
start_date:
Date
.
new
(
2000
,
1
,
1
),
due_date:
nil
due_date:
nil
,
group:
group
)
end
let
(
:milestone2
)
do
create
(
:milestone
,
start_date:
Date
.
new
(
2000
,
1
,
3
),
due_date:
nil
due_date:
nil
,
group:
group
)
end
...
...
@@ -288,14 +296,16 @@ describe Epic do
create
(
:milestone
,
start_date:
nil
,
due_date:
nil
due_date:
nil
,
group:
group
)
end
let
(
:milestone2
)
do
create
(
:milestone
,
start_date:
nil
,
due_date:
nil
due_date:
nil
,
group:
group
)
end
...
...
@@ -326,7 +336,7 @@ describe Epic do
context
'single milestone'
do
before
do
epic_issue1
=
create
(
:epic_issue
,
epic:
subject
)
epic_issue1
.
issue
.
update
(
milestone:
milestone1
)
epic_issue1
.
issue
.
update
(
milestone:
milestone1
,
project:
project
)
end
context
'complete start and due dates'
do
...
...
@@ -343,7 +353,8 @@ describe Epic do
create
(
:milestone
,
start_date:
Date
.
new
(
2000
,
1
,
1
),
due_date:
nil
due_date:
nil
,
group:
group
)
end
...
...
@@ -360,7 +371,8 @@ describe Epic do
create
(
:milestone
,
start_date:
nil
,
due_date:
nil
due_date:
nil
,
group:
group
)
end
...
...
@@ -377,12 +389,12 @@ describe Epic do
describe
'.update_start_and_due_dates'
do
def
link_epic_to_milestone
(
epic
,
milestone
)
create
(
:issue
,
epic:
epic
,
milestone:
milestone
)
create
(
:issue
,
epic:
epic
,
milestone:
milestone
,
project:
project
)
end
it
'updates in bulk'
do
milestone1
=
create
(
:milestone
,
start_date:
Date
.
new
(
2000
,
1
,
1
),
due_date:
Date
.
new
(
2000
,
1
,
10
))
milestone2
=
create
(
:milestone
,
due_date:
Date
.
new
(
2000
,
1
,
30
))
milestone1
=
create
(
:milestone
,
start_date:
Date
.
new
(
2000
,
1
,
1
),
due_date:
Date
.
new
(
2000
,
1
,
10
)
,
group:
group
)
milestone2
=
create
(
:milestone
,
due_date:
Date
.
new
(
2000
,
1
,
30
)
,
group:
group
)
epics
=
[
create
(
:epic
),
...
...
@@ -418,8 +430,8 @@ describe Epic do
end
context
'query count check'
do
let
(
:milestone
)
{
create
(
:milestone
,
start_date:
Date
.
new
(
2000
,
1
,
1
),
due_date:
Date
.
new
(
2000
,
1
,
10
))
}
let!
(
:epics
)
{
[
create
(
:epic
)]
}
let
(
:milestone
)
{
create
(
:milestone
,
start_date:
Date
.
new
(
2000
,
1
,
1
),
due_date:
Date
.
new
(
2000
,
1
,
10
)
,
group:
group
)
}
let!
(
:epics
)
{
[
create
(
:epic
,
group:
group
)]
}
def
setup_control_group
link_epic_to_milestone
(
epics
[
0
],
milestone
)
...
...
ee/spec/services/ee/boards/issues/list_service_spec.rb
View file @
ea81ec39
...
...
@@ -20,7 +20,8 @@ describe Boards::Issues::ListService, services: true do
let
(
:p3
)
{
create
(
:group_label
,
title:
'P3'
,
group:
group
)
}
let
(
:user_list
)
{
create
(
:user_list
,
board:
board
,
position:
2
)
}
let
(
:milestone_list
)
{
create
(
:milestone_list
,
board:
board
,
position:
3
)
}
let
(
:milestone
)
{
create
(
:milestone
,
group:
group
)
}
let
(
:milestone_list
)
{
create
(
:milestone_list
,
board:
board
,
position:
3
,
milestone:
milestone
)
}
let
(
:backlog
)
{
create
(
:backlog_list
,
board:
board
)
}
let
(
:list1
)
{
create
(
:list
,
board:
board
,
label:
development
,
position:
0
)
}
let
(
:list2
)
{
create
(
:list
,
board:
board
,
label:
testing
,
position:
1
)
}
...
...
ee/spec/services/ee/issuable/clone/attributes_rewriter_spec.rb
View file @
ea81ec39
...
...
@@ -37,15 +37,6 @@ describe Issuable::Clone::AttributesRewriter do
expect
(
new_epic
.
reload
.
milestone
).
to
be_nil
end
it
'copies the milestone when old issue milestone is a group milestone'
do
milestone
=
create
(
:milestone
,
title:
'milestone'
,
group:
group
)
original_issue
.
update
(
milestone:
milestone
)
subject
.
execute
expect
(
new_epic
.
reload
.
milestone
).
to
eq
(
milestone
)
end
end
end
end
ee/spec/services/ee/issues/update_service_spec.rb
View file @
ea81ec39
...
...
@@ -14,10 +14,10 @@ describe Issues::UpdateService do
context
'refresh epic dates'
do
let
(
:epic
)
{
create
(
:epic
)
}
let
(
:issue
)
{
create
(
:issue
,
epic:
epic
)
}
let
(
:issue
)
{
create
(
:issue
,
epic:
epic
,
project:
project
)
}
context
'updating milestone'
do
let
(
:milestone
)
{
create
(
:milestone
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
it
'calls epic#update_start_and_due_dates'
do
expect
(
epic
).
to
receive
(
:update_start_and_due_dates
).
twice
...
...
ee/spec/services/epic_issues/list_service_spec.rb
View file @
ea81ec39
...
...
@@ -55,9 +55,8 @@ describe EpicIssues::ListService do
control_count
=
ActiveRecord
::
QueryRecorder
.
new
{
list_service
.
execute
}.
count
new_group2
=
create
(
:group
,
:private
)
new_project2
=
create
(
:project
,
namespace:
new_group2
)
new_group2
.
add_developer
(
user
)
milestone3
=
create
(
:milestone
,
project:
new_project
2
)
milestone3
=
create
(
:milestone
,
project:
new_project
)
new_issue4
=
create
(
:issue
,
project:
new_project
,
milestone:
milestone3
)
create
(
:epic_issue
,
issue:
new_issue4
,
epic:
epic
,
relative_position:
6
)
...
...
ee/spec/services/epics/issue_promote_service_spec.rb
View file @
ea81ec39
...
...
@@ -64,7 +64,6 @@ describe Epics::IssuePromoteService do
expect
(
epic
.
description
).
to
eq
(
issue
.
description
)
expect
(
epic
.
author
).
to
eq
(
user
)
expect
(
epic
.
group
).
to
eq
(
group
)
expect
(
epic
.
milestone
).
to
eq
(
milestone
)
end
it
'copies group labels assigned to the issue'
do
...
...
ee/spec/services/milestones/update_service_spec.rb
View file @
ea81ec39
...
...
@@ -9,7 +9,7 @@ describe Milestones::UpdateService do
user
=
build
(
:user
)
milestone
=
create
(
:milestone
,
project:
project
)
epic
=
create
(
:epic
)
create
(
:issue
,
milestone:
milestone
,
epic:
epic
)
create
(
:issue
,
milestone:
milestone
,
epic:
epic
,
project:
project
)
due_date
=
3
.
days
.
from_now
.
to_date
described_class
.
new
(
project
,
user
,
{
due_date:
due_date
}).
execute
(
milestone
)
...
...
spec/policies/group_policy_spec.rb
View file @
ea81ec39
...
...
@@ -115,13 +115,21 @@ describe GroupPolicy do
project
.
add_developer
(
current_user
)
end
<<<<<<<
HEAD
it
{
expect_allowed
(
:read_label
,
:read_list
)
}
=======
it
{
expect_allowed
(
:read_label
)
}
>>>>>>>
dev
/
master
context
'in subgroups'
,
:nested_groups
do
let
(
:subgroup
)
{
create
(
:group
,
:private
,
parent:
group
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
subgroup
)
}
<<<<<<<
HEAD
it
{
expect_allowed
(
:read_label
,
:read_list
)
}
=======
it
{
expect_allowed
(
:read_label
)
}
>>>>>>>
dev
/
master
end
end
...
...
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