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
95cf4b0c
Commit
95cf4b0c
authored
Nov 19, 2019
by
Etienne Baqué
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added project_id to with_release scope
parent
f40d8c1c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+1
-1
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+1
-1
spec/models/concerns/issuable_spec.rb
spec/models/concerns/issuable_spec.rb
+6
-6
No files found.
app/finders/issuable_finder.rb
View file @
95cf4b0c
...
...
@@ -585,7 +585,7 @@ class IssuableFinder
elsif
filter_by_any_release?
items
.
any_release
else
items
.
with_release
(
params
[
:release_tag
])
items
.
with_release
(
params
[
:release_tag
]
,
params
[
:project_id
]
)
end
end
...
...
app/models/concerns/issuable.rb
View file @
95cf4b0c
...
...
@@ -101,7 +101,7 @@ module Issuable
scope
:any_milestone
,
->
{
where
(
'milestone_id IS NOT NULL'
)
}
scope
:with_milestone
,
->
(
title
)
{
left_joins_milestones
.
where
(
milestones:
{
title:
title
})
}
scope
:any_release
,
->
{
joins_milestone_releases
}
scope
:with_release
,
->
(
tag
)
{
joins_milestone_releases
.
where
(
milestones:
{
releases:
{
tag:
tag
}
}
)
}
scope
:with_release
,
->
(
tag
,
project_id
)
{
joins_milestone_releases
.
where
(
milestones:
{
releases:
{
tag:
tag
,
project_id:
project_id
}
}
)
}
scope
:opened
,
->
{
with_state
(
:opened
)
}
scope
:only_opened
,
->
{
with_state
(
:opened
)
}
scope
:closed
,
->
{
with_state
(
:closed
)
}
...
...
spec/models/concerns/issuable_spec.rb
View file @
95cf4b0c
...
...
@@ -891,36 +891,36 @@ describe Issuable do
describe
'#with_release'
do
it
'returns the issues tied a specfic release'
do
expect
(
items
.
with_release
(
'v1.0'
)).
to
contain_exactly
(
issue_1
,
issue_2
,
issue_3
)
expect
(
items
.
with_release
(
'v1.0'
,
project
.
id
)).
to
contain_exactly
(
issue_1
,
issue_2
,
issue_3
)
end
context
'when a release has a milestone with one issue and another one with no issue'
do
it
'returns that one issue'
do
expect
(
items
.
with_release
(
'v2.0'
)).
to
contain_exactly
(
issue_3
)
expect
(
items
.
with_release
(
'v2.0'
,
project
.
id
)).
to
contain_exactly
(
issue_3
)
end
context
'when the milestone with no issue is added as a filter'
do
it
'returns an empty list'
do
expect
(
items
.
with_release
(
'v2.0'
).
with_milestone
(
'm3'
)).
to
be_empty
expect
(
items
.
with_release
(
'v2.0'
,
project
.
id
).
with_milestone
(
'm3'
)).
to
be_empty
end
end
context
'when the milestone with the issue is added as a filter'
do
it
'returns this issue'
do
expect
(
items
.
with_release
(
'v2.0'
).
with_milestone
(
'm2'
)).
to
contain_exactly
(
issue_3
)
expect
(
items
.
with_release
(
'v2.0'
,
project
.
id
).
with_milestone
(
'm2'
)).
to
contain_exactly
(
issue_3
)
end
end
end
context
'when there is no issue under a specific release'
do
it
'returns no issue'
do
expect
(
items
.
with_release
(
'v4.0'
)).
to
be_empty
expect
(
items
.
with_release
(
'v4.0'
,
project
.
id
)).
to
be_empty
end
end
context
'when a non-existent release tag is passed in'
do
it
'returns no issue'
do
expect
(
items
.
with_release
(
'v999.0'
)).
to
be_empty
expect
(
items
.
with_release
(
'v999.0'
,
project
.
id
)).
to
be_empty
end
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