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
6a480da9
Commit
6a480da9
authored
Jan 11, 2018
by
Jacopo
Committed by
Rémy Coutable
Jan 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes begin false positive
parent
62c36041
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
1 deletion
+19
-1
db/migrate/20171220191323_add_index_on_namespaces_lower_name.rb
...rate/20171220191323_add_index_on_namespaces_lower_name.rb
+2
-0
lib/gitlab/database/migration_helpers.rb
lib/gitlab/database/migration_helpers.rb
+1
-0
lib/gitlab/kubernetes/helm/pod.rb
lib/gitlab/kubernetes/helm/pod.rb
+1
-0
rubocop/cop/line_break_around_conditional_block.rb
rubocop/cop/line_break_around_conditional_block.rb
+2
-1
spec/rubocop/cop/line_break_around_conditional_block_spec.rb
spec/rubocop/cop/line_break_around_conditional_block_spec.rb
+13
-0
No files found.
db/migrate/20171220191323_add_index_on_namespaces_lower_name.rb
View file @
6a480da9
...
...
@@ -9,6 +9,7 @@ class AddIndexOnNamespacesLowerName < ActiveRecord::Migration
return
unless
Gitlab
::
Database
.
postgresql?
disable_statement_timeout
if
Gitlab
::
Database
.
version
.
to_f
>=
9.5
# Allow us to hot-patch the index manually ahead of the migration
execute
"CREATE INDEX CONCURRENTLY IF NOT EXISTS
#{
INDEX_NAME
}
ON namespaces (lower(name));"
...
...
@@ -21,6 +22,7 @@ class AddIndexOnNamespacesLowerName < ActiveRecord::Migration
return
unless
Gitlab
::
Database
.
postgresql?
disable_statement_timeout
if
Gitlab
::
Database
.
version
.
to_f
>=
9.2
execute
"DROP INDEX CONCURRENTLY IF EXISTS
#{
INDEX_NAME
}
;"
else
...
...
lib/gitlab/database/migration_helpers.rb
View file @
6a480da9
...
...
@@ -512,6 +512,7 @@ module Gitlab
batch_size:
10_000
,
interval:
10
.
minutes
)
unless
relation
.
model
<
EachBatch
raise
TypeError
,
'The relation must include the EachBatch module'
end
...
...
lib/gitlab/kubernetes/helm/pod.rb
View file @
6a480da9
...
...
@@ -14,6 +14,7 @@ module Gitlab
generate_config_map
spec
[
'volumes'
]
=
volumes_specification
end
::
Kubeclient
::
Resource
.
new
(
metadata:
metadata
,
spec:
spec
)
end
...
...
rubocop/cop/line_break_around_conditional_block.rb
View file @
6a480da9
...
...
@@ -99,7 +99,8 @@ module RuboCop
end
def
begin_line?
(
line
)
line
=~
/^\s*@?(\w|\|+|=|\[|\]|\s)+begin/
# an assignment followed by a begin or ust a begin
line
=~
/^\s*(@?(\w|\|+|=|\[|\]|\s)+begin|begin)/
end
def
assignment_line?
(
line
)
...
...
spec/rubocop/cop/line_break_around_conditional_block_spec.rb
View file @
6a480da9
...
...
@@ -94,6 +94,19 @@ describe RuboCop::Cop::LineBreakAroundConditionalBlock do
end
it
"doesn't flag violation for
#{
conditional
}
preceded by a begin definition"
do
source
=
<<~
RUBY
begin
#{
conditional
}
condition
do_something
end
end
RUBY
inspect_source
(
source
)
expect
(
cop
.
offenses
).
to
be_empty
end
it
"doesn't flag violation for
#{
conditional
}
preceded by an assign/begin definition"
do
source
=
<<~
RUBY
@project ||= begin
#{
conditional
}
condition
...
...
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