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
11c06054
Commit
11c06054
authored
Jul 15, 2019
by
Etienne Baqué
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made some code fixes based on review suggestions
parent
18d877b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
29 deletions
+15
-29
ee/changelogs/unreleased/10359-feature-flag-keep-underscore.yml
...ngelogs/unreleased/10359-feature-flag-keep-underscore.yml
+1
-1
ee/lib/audit/details.rb
ee/lib/audit/details.rb
+6
-6
ee/spec/lib/audit/details_spec.rb
ee/spec/lib/audit/details_spec.rb
+8
-22
No files found.
ee/changelogs/unreleased/10359-feature-flag-keep-underscore.yml
View file @
11c06054
---
title
:
Fix
feature displaying
flag names in the audit log
title
:
Fix
displaying feature
flag names in the audit log
merge_request
:
14621
author
:
type
:
fixed
ee/lib/audit/details.rb
View file @
11c06054
...
...
@@ -27,15 +27,15 @@ module Audit
case
action
.
keys
.
first
when
:add
"Added
#{
target_
detail_valu
e
}#{
@details
[
:as
]
?
" as
#{
@details
[
:as
]
}
"
:
''
}
"
"Added
#{
target_
nam
e
}#{
@details
[
:as
]
?
" as
#{
@details
[
:as
]
}
"
:
''
}
"
when
:remove
"Removed
#{
target_
detail_valu
e
}
"
"Removed
#{
target_
nam
e
}
"
when
:failed_login
"Failed to login with
#{
oath_label
}
authentication"
when
:custom_message
detail_value
else
text_for_change
(
target_
detail_valu
e
)
text_for_change
(
target_
nam
e
)
end
end
...
...
@@ -48,11 +48,11 @@ module Audit
changed
.
join
(
' '
)
end
def
target_
detail_valu
e
@details
[
:target_type
]
==
'Operations::FeatureFlag'
?
detail_value
:
detail_valu
e_with_space
def
target_
nam
e
@details
[
:target_type
]
==
'Operations::FeatureFlag'
?
detail_value
:
target_nam
e_with_space
end
def
detail_valu
e_with_space
def
target_nam
e_with_space
detail_value
.
tr
(
'_'
,
' '
)
end
...
...
ee/spec/lib/audit/details_spec.rb
View file @
11c06054
...
...
@@ -69,35 +69,21 @@ describe Audit::Details do
end
end
context
'f
eature flag
'
do
context
'f
ailed_login
'
do
let
(
:feature_flag
)
do
{
remove:
'feature_flag'
,
target_type:
'Operations::FeatureFlag'
failed_login:
'google_oauth2'
,
author_name:
'username'
,
target_details:
'testuser'
,
ip_address:
'127.0.0.1'
}
end
let
(
:
custom_message
)
{
"Removed feature_flag"
}
let
(
:
message
)
{
'Failed to login with GOOGLE authentication'
}
it
'shows
message as is
'
do
it
'shows
the correct failed login meessage
'
do
string
=
described_class
.
humanize
(
feature_flag
)
expect
(
string
).
to
eq
(
custom_message
)
end
context
'failed_login'
do
let
(
:feature_flag
)
do
{
failed_login:
'google_oauth2'
,
target_type:
'Operations::FeatureFlag'
}
end
let
(
:message
)
{
'Failed to login with GOOGLE authentication'
}
it
'shows the correct failed login meessage'
do
string
=
described_class
.
humanize
(
feature_flag
)
expect
(
string
).
to
eq
message
end
expect
(
string
).
to
eq
message
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