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
aa90ca54
Commit
aa90ca54
authored
Oct 07, 2021
by
Adam Cohen
Committed by
Dylan Griffith
Oct 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug on security config page
parent
3b9aa8e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
ee/app/presenters/projects/security/configuration_presenter.rb
...p/presenters/projects/security/configuration_presenter.rb
+4
-1
ee/spec/presenters/projects/security/configuration_presenter_spec.rb
...senters/projects/security/configuration_presenter_spec.rb
+17
-6
No files found.
ee/app/presenters/projects/security/configuration_presenter.rb
View file @
aa90ca54
...
...
@@ -22,7 +22,10 @@ module Projects
latest_pipeline_path:
latest_pipeline_path
,
auto_fix_enabled:
autofix_enabled
,
can_toggle_auto_fix_settings:
auto_fix_permission
,
gitlab_ci_present:
project
.
uses_default_ci_config?
,
# TODO: gitlab_ci_present will incorrectly report `false` if the CI/CD configuration file name
# has been customized and a file with the given custom name exists in the repo. This edge case
# will be addressed in https://gitlab.com/gitlab-org/gitlab/-/issues/342465
gitlab_ci_present:
project
.
repository
.
gitlab_ci_yml
.
present?
,
gitlab_ci_history_path:
gitlab_ci_history_path
,
auto_fix_user_path:
'/'
# TODO: real link will be updated with https://gitlab.com/gitlab-org/gitlab/-/issues/215669
}
...
...
ee/spec/presenters/projects/security/configuration_presenter_spec.rb
View file @
aa90ca54
...
...
@@ -262,14 +262,25 @@ RSpec.describe Projects::Security::ConfigurationPresenter do
end
context
"while retrieving information about gitlab ci file"
do
it
'expects the gitlab_ci_presence to be true if the file is present'
do
expect
(
subject
[
:gitlab_ci_present
]).
to
eq
(
true
)
end
context
'when a .gitlab-ci.yml file exists'
do
before
do
project
.
repository
.
create_file
(
project
.
creator
,
Gitlab
::
FileDetector
::
PATTERNS
[
:gitlab_ci
],
'contents go here'
,
message:
'test'
,
branch_name:
'master'
)
end
it
'expects the gitlab_ci_presence to be false if the file is customized'
do
allow
(
project
).
to
receive
(
:ci_config_path
).
and_return
(
'.other-gitlab-ci.yml'
)
it
'expects gitlab_ci_present to be true'
do
expect
(
subject
[
:gitlab_ci_present
]).
to
eq
(
true
)
end
end
expect
(
subject
[
:gitlab_ci_present
]).
to
eq
(
false
)
context
'when a .gitlab-ci.yml file does not exist'
do
it
'expects gitlab_ci_present to be false if the file is not present'
do
expect
(
subject
[
:gitlab_ci_present
]).
to
eq
(
false
)
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