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
fb312dc3
Commit
fb312dc3
authored
Jul 29, 2020
by
Wei-Meng Lee
Committed by
Shinya Maeda
Jul 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error when blob has no auxiliary viewer
parent
1b464470
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+1
-1
changelogs/unreleased/weimeng-master-patch-35379.yml
changelogs/unreleased/weimeng-master-patch-35379.yml
+5
-0
spec/helpers/blob_helper_spec.rb
spec/helpers/blob_helper_spec.rb
+10
-0
No files found.
app/helpers/blob_helper.rb
View file @
fb312dc3
...
...
@@ -359,7 +359,7 @@ module BlobHelper
def
show_suggest_pipeline_creation_celebration?
experiment_enabled?
(
:suggest_pipeline
)
&&
@blob
.
path
==
Gitlab
::
FileDetector
::
PATTERNS
[
:gitlab_ci
]
&&
@blob
.
auxiliary_viewer
.
valid?
(
project:
@project
,
sha:
@commit
.
sha
,
user:
current_user
)
&&
@blob
.
auxiliary_viewer
&
.
valid?
(
project:
@project
,
sha:
@commit
.
sha
,
user:
current_user
)
&&
@project
.
uses_default_ci_config?
&&
cookies
[
suggest_pipeline_commit_cookie_name
].
present?
end
...
...
changelogs/unreleased/weimeng-master-patch-35379.yml
0 → 100644
View file @
fb312dc3
---
title
:
Fix error when blob has no auxiliary viewer
merge_request
:
38018
author
:
type
:
fixed
spec/helpers/blob_helper_spec.rb
View file @
fb312dc3
...
...
@@ -282,6 +282,16 @@ RSpec.describe BlobHelper do
expect
(
helper
.
show_suggest_pipeline_creation_celebration?
).
to
be_falsey
end
end
context
'blob does not have auxiliary view'
do
before
do
allow
(
blob
).
to
receive
(
:auxiliary_viewer
).
and_return
(
nil
)
end
it
'is false'
do
expect
(
helper
.
show_suggest_pipeline_creation_celebration?
).
to
be_falsey
end
end
end
context
'experiment disabled'
do
...
...
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