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
0e7ee444
Commit
0e7ee444
authored
Apr 06, 2020
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove plan_id from GroupChangesAuditor
plan_id is not used so tracking changes to this column is useless
parent
8fc3e503
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
26 deletions
+1
-26
ee/lib/ee/audit/group_changes_auditor.rb
ee/lib/ee/audit/group_changes_auditor.rb
+1
-13
ee/spec/lib/ee/audit/group_changes_auditor_spec.rb
ee/spec/lib/ee/audit/group_changes_auditor_spec.rb
+0
-13
No files found.
ee/lib/ee/audit/group_changes_auditor.rb
View file @
0e7ee444
...
...
@@ -7,11 +7,10 @@ module EE
request_access_enabled membership_lock lfs_enabled
shared_runners_minutes_limit
require_two_factor_authentication
two_factor_grace_period
plan_id
two_factor_grace_period
project_creation_level)
.
freeze
COLUMN_HUMAN_NAME
=
{
plan_id:
'plan'
,
visibility_level:
'visibility'
}.
freeze
...
...
@@ -36,11 +35,6 @@ module EE
from:
::
Gitlab
::
Access
.
project_creation_level_name
(
old
),
to:
::
Gitlab
::
Access
.
project_creation_level_name
(
new
)
}
when
:plan_id
{
from:
plan_name
(
old
),
to:
plan_name
(
new
)
}
else
{
from:
old
,
...
...
@@ -51,12 +45,6 @@ module EE
private
def
plan_name
(
plan_id
)
return
'none'
unless
plan_id
.
present?
Plan
.
find_by_id
(
plan_id
.
to_i
)
&
.
name
||
'unknown'
end
def
column_human_name
(
column
)
COLUMN_HUMAN_NAME
.
fetch
(
column
,
column
.
to_s
)
end
...
...
ee/spec/lib/ee/audit/group_changes_auditor_spec.rb
View file @
0e7ee444
...
...
@@ -39,19 +39,6 @@ describe EE::Audit::GroupChangesAuditor do
expect
(
event
.
details
[
:change
]).
to
eq
'project_creation_level'
end
it
'creates an event when the group plan changes'
do
new_plan
=
create
(
:free_plan
,
name:
'plan-1'
)
group
.
update!
(
plan_id:
new_plan
.
id
)
expect
{
foo_instance
.
execute
}.
to
change
{
SecurityEvent
.
count
}.
by
(
1
)
event
=
SecurityEvent
.
last
expect
(
event
.
details
[
:from
]).
to
eq
'none'
expect
(
event
.
details
[
:to
]).
to
eq
'plan-1'
expect
(
event
.
details
[
:change
]).
to
eq
'plan'
end
it
'creates an event when attributes change'
do
# Exclude special cases covered from above
columns
=
described_class
::
COLUMNS
-
described_class
::
COLUMN_HUMAN_NAME
.
keys
-
[
:project_creation_level
]
...
...
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