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
fa81338f
Commit
fa81338f
authored
Nov 16, 2020
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes a type mismatch when rendering tags with private pipelines
parent
111239ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
app/finders/ci/commit_statuses_finder.rb
app/finders/ci/commit_statuses_finder.rb
+1
-1
spec/finders/ci/commit_statuses_finder_spec.rb
spec/finders/ci/commit_statuses_finder_spec.rb
+4
-4
spec/views/projects/tags/index.html.haml_spec.rb
spec/views/projects/tags/index.html.haml_spec.rb
+9
-0
No files found.
app/finders/ci/commit_statuses_finder.rb
View file @
fa81338f
...
...
@@ -12,7 +12,7 @@ module Ci
end
def
execute
return
[]
unless
Ability
.
allowed?
(
@current_user
,
:read_pipeline
,
@project
)
return
{}
unless
Ability
.
allowed?
(
@current_user
,
:read_pipeline
,
@project
)
commit_statuses
end
...
...
spec/finders/ci/commit_statuses_finder_spec.rb
View file @
fa81338f
...
...
@@ -152,8 +152,8 @@ RSpec.describe Ci::CommitStatusesFinder, '#execute' do
project
.
project_feature
.
update!
(
builds_access_level:
ProjectFeature
::
PRIVATE
)
end
it
'returns
nil
'
do
expect
(
subject
).
to
be_empty
it
'returns
a blank hash
'
do
expect
(
subject
).
to
eq
({})
end
end
...
...
@@ -170,8 +170,8 @@ RSpec.describe Ci::CommitStatusesFinder, '#execute' do
status: :running
)
end
it
'returns
nil
'
do
expect
(
private_subject
).
to
be_empty
it
'returns
a blank hash
'
do
expect
(
private_subject
).
to
eq
({})
end
end
end
...
...
spec/views/projects/tags/index.html.haml_spec.rb
View file @
fa81338f
...
...
@@ -81,5 +81,14 @@ RSpec.describe 'projects/tags/index.html.haml' do
expect
(
page
.
all
(
'.tags .content-list li'
)).
not_to
have_css
'svg.s24'
end
it
'shows no build status or placeholder when pipelines are private'
do
project
.
project_feature
.
update!
(
builds_access_level:
ProjectFeature
::
PRIVATE
)
assign
(
:tag_pipeline_statuses
,
Ci
::
CommitStatusesFinder
.
new
(
project
,
project
.
repository
,
build
(
:user
),
tags
).
execute
)
render
expect
(
page
.
all
(
'.tags .content-list li'
)).
not_to
have_css
'svg.s24'
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