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
b21a23c7
Commit
b21a23c7
authored
Mar 20, 2020
by
Francisco Javier López
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add flag snippet_count_check to GitAccessSnippet
parent
9ce3beb3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
lib/gitlab/git_access_snippet.rb
lib/gitlab/git_access_snippet.rb
+4
-1
spec/lib/gitlab/git_access_snippet_spec.rb
spec/lib/gitlab/git_access_snippet_spec.rb
+10
-0
No files found.
lib/gitlab/git_access_snippet.rb
View file @
b21a23c7
...
...
@@ -98,7 +98,10 @@ module Gitlab
def
check_single_change_access
(
change
)
Checks
::
SnippetCheck
.
new
(
change
,
logger:
logger
).
validate!
Checks
::
PushFileCountCheck
.
new
(
change
,
repository:
repository
,
limit:
Snippet
::
MAX_FILE_COUNT
,
logger:
logger
).
validate!
if
Feature
.
enabled?
(
:snippet_count_check
)
Checks
::
PushFileCountCheck
.
new
(
change
,
repository:
repository
,
limit:
Snippet
::
MAX_FILE_COUNT
,
logger:
logger
).
validate!
end
rescue
Checks
::
TimedLogger
::
TimeoutError
raise
TimeoutError
,
logger
.
full_message
end
...
...
spec/lib/gitlab/git_access_snippet_spec.rb
View file @
b21a23c7
...
...
@@ -209,6 +209,16 @@ describe Gitlab::GitAccessSnippet do
expect
{
push_access_check
}.
to
raise_forbidden
(
'foo'
)
end
context
'when feature flag :snippet_count_check is disabled'
do
it
'does not check push file count'
do
stub_feature_flags
(
snippet_count_check:
false
)
expect
(
Gitlab
::
Checks
::
PushFileCountCheck
).
not_to
receive
(
:new
)
expect
{
push_access_check
}.
not_to
raise_error
end
end
end
private
...
...
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