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
60a865d0
Commit
60a865d0
authored
Apr 08, 2020
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix missing scope for `ci_composite_status`
We missed `Ci::Group` scope. This adds a project for `Ci::Group`.
parent
0f9003c7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
10 deletions
+13
-10
app/models/ci/group.rb
app/models/ci/group.rb
+6
-5
app/models/ci/legacy_stage.rb
app/models/ci/legacy_stage.rb
+1
-1
app/models/ci/stage.rb
app/models/ci/stage.rb
+1
-1
spec/models/ci/group_spec.rb
spec/models/ci/group_spec.rb
+5
-3
No files found.
app/models/ci/group.rb
View file @
60a865d0
...
...
@@ -11,11 +11,12 @@ module Ci
include
StaticModel
include
Gitlab
::
Utils
::
StrongMemoize
attr_reader
:stage
,
:name
,
:jobs
attr_reader
:
project
,
:
stage
,
:name
,
:jobs
delegate
:size
,
to: :jobs
def
initialize
(
stage
,
name
:,
jobs
:)
def
initialize
(
project
,
stage
,
name
:,
jobs
:)
@project
=
project
@stage
=
stage
@name
=
name
@jobs
=
jobs
...
...
@@ -23,7 +24,7 @@ module Ci
def
status
strong_memoize
(
:status
)
do
if
Feature
.
enabled?
(
:ci_composite_status
,
default_enabled:
false
)
if
Feature
.
enabled?
(
:ci_composite_status
,
project
,
default_enabled:
false
)
Gitlab
::
Ci
::
Status
::
Composite
.
new
(
@jobs
)
.
status
...
...
@@ -44,11 +45,11 @@ module Ci
end
end
def
self
.
fabricate
(
stage
)
def
self
.
fabricate
(
project
,
stage
)
stage
.
statuses
.
ordered
.
latest
.
sort_by
(
&
:sortable_name
).
group_by
(
&
:group_name
)
.
map
do
|
group_name
,
grouped_statuses
|
self
.
new
(
stage
,
name:
group_name
,
jobs:
grouped_statuses
)
self
.
new
(
project
,
stage
,
name:
group_name
,
jobs:
grouped_statuses
)
end
end
end
...
...
app/models/ci/legacy_stage.rb
View file @
60a865d0
...
...
@@ -20,7 +20,7 @@ module Ci
end
def
groups
@groups
||=
Ci
::
Group
.
fabricate
(
self
)
@groups
||=
Ci
::
Group
.
fabricate
(
project
,
self
)
end
def
to_param
...
...
app/models/ci/stage.rb
View file @
60a865d0
...
...
@@ -109,7 +109,7 @@ module Ci
end
def
groups
@groups
||=
Ci
::
Group
.
fabricate
(
self
)
@groups
||=
Ci
::
Group
.
fabricate
(
project
,
self
)
end
def
has_warnings?
...
...
spec/models/ci/group_spec.rb
View file @
60a865d0
...
...
@@ -3,12 +3,14 @@
require
'spec_helper'
describe
Ci
::
Group
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let!
(
:jobs
)
{
build_list
(
:ci_build
,
1
,
:success
,
project:
project
)
}
subject
do
described_class
.
new
(
'test'
,
name:
'rspec'
,
jobs:
jobs
)
described_class
.
new
(
project
,
'test'
,
name:
'rspec'
,
jobs:
jobs
)
end
let!
(
:jobs
)
{
build_list
(
:ci_build
,
1
,
:success
)
}
it
{
is_expected
.
to
include_module
(
StaticModel
)
}
it
{
is_expected
.
to
respond_to
(
:stage
)
}
...
...
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