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
1050ef73
Commit
1050ef73
authored
Dec 14, 2021
by
Igor Drozdov
Committed by
Peter Leitzen
Dec 14, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Style/SlicingWithRange offences
parent
fddd1c97
Changes
47
Show whitespace changes
Inline
Side-by-side
Showing
47 changed files
with
55 additions
and
60 deletions
+55
-60
.rubocop_todo.yml
.rubocop_todo.yml
+0
-5
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+1
-1
app/helpers/diff_helper.rb
app/helpers/diff_helper.rb
+1
-1
app/models/concerns/token_authenticatable_strategies/encryption_helper.rb
...rns/token_authenticatable_strategies/encryption_helper.rb
+1
-1
app/models/namespaces/traversal/linear.rb
app/models/namespaces/traversal/linear.rb
+1
-1
app/models/serverless/domain.rb
app/models/serverless/domain.rb
+1
-1
app/models/wiki_page.rb
app/models/wiki_page.rb
+1
-1
app/services/cohorts_service.rb
app/services/cohorts_service.rb
+1
-1
app/uploaders/lfs_object_uploader.rb
app/uploaders/lfs_object_uploader.rb
+1
-1
config/initializers/wikicloth_patch.rb
config/initializers/wikicloth_patch.rb
+1
-1
ee/lib/gitlab/geo/log_helpers.rb
ee/lib/gitlab/geo/log_helpers.rb
+1
-1
ee/spec/elastic/migrate/20210421140400_add_new_data_to_merge_requests_documents_spec.rb
...21140400_add_new_data_to_merge_requests_documents_spec.rb
+1
-1
ee/spec/elastic/migrate/20210623081800_add_upvotes_to_issues_spec.rb
...stic/migrate/20210623081800_add_upvotes_to_issues_spec.rb
+1
-1
ee/spec/elastic/migrate/migration_shared_examples.rb
ee/spec/elastic/migrate/migration_shared_examples.rb
+1
-1
lib/banzai/filter/math_filter.rb
lib/banzai/filter/math_filter.rb
+1
-1
lib/banzai/filter/repository_link_filter.rb
lib/banzai/filter/repository_link_filter.rb
+1
-1
lib/extracts_ref.rb
lib/extracts_ref.rb
+1
-1
lib/flowdock/git/builder.rb
lib/flowdock/git/builder.rb
+1
-1
lib/gitlab/chat/output.rb
lib/gitlab/chat/output.rb
+2
-2
lib/gitlab/ci/reports/security/report.rb
lib/gitlab/ci/reports/security/report.rb
+1
-1
lib/gitlab/diff/custom_diff.rb
lib/gitlab/diff/custom_diff.rb
+1
-1
lib/gitlab/diff/inline_diff.rb
lib/gitlab/diff/inline_diff.rb
+2
-2
lib/gitlab/gfm/reference_rewriter.rb
lib/gitlab/gfm/reference_rewriter.rb
+1
-1
lib/gitlab/gpg.rb
lib/gitlab/gpg.rb
+1
-1
lib/gitlab/search/query.rb
lib/gitlab/search/query.rb
+1
-1
lib/gitlab/sherlock/line_profiler.rb
lib/gitlab/sherlock/line_profiler.rb
+1
-1
lib/gitlab/string_range_marker.rb
lib/gitlab/string_range_marker.rb
+1
-1
lib/gitlab/utils/nokogiri.rb
lib/gitlab/utils/nokogiri.rb
+1
-1
lib/tasks/gitlab/seed/group_seed.rake
lib/tasks/gitlab/seed/group_seed.rake
+1
-1
rubocop/cop/migration/schedule_async.rb
rubocop/cop/migration/schedule_async.rb
+1
-1
rubocop/cop/project_path_helper.rb
rubocop/cop/project_path_helper.rb
+1
-1
spec/controllers/projects/serverless/functions_controller_spec.rb
...trollers/projects/serverless/functions_controller_spec.rb
+2
-2
spec/features/merge_request/user_views_open_merge_request_spec.rb
...tures/merge_request/user_views_open_merge_request_spec.rb
+1
-1
spec/features/projects/labels/issues_sorted_by_priority_spec.rb
...eatures/projects/labels/issues_sorted_by_priority_spec.rb
+1
-1
spec/finders/packages/nuget/package_finder_spec.rb
spec/finders/packages/nuget/package_finder_spec.rb
+1
-1
spec/lib/gitlab/gitaly_client/conflict_files_stitcher_spec.rb
.../lib/gitlab/gitaly_client/conflict_files_stitcher_spec.rb
+2
-2
spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb
spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb
+1
-1
spec/lib/gitlab/gpg/invalid_gpg_signature_updater_spec.rb
spec/lib/gitlab/gpg/invalid_gpg_signature_updater_spec.rb
+1
-1
spec/lib/gitlab/graphql/pagination/keyset/connection_generic_keyset_spec.rb
...aphql/pagination/keyset/connection_generic_keyset_spec.rb
+2
-2
spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb
spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb
+2
-2
spec/lib/gitlab/multi_collection_paginator_spec.rb
spec/lib/gitlab/multi_collection_paginator_spec.rb
+1
-1
spec/lib/gitlab/pagination/keyset/order_spec.rb
spec/lib/gitlab/pagination/keyset/order_spec.rb
+1
-1
spec/lib/gitlab/rack_attack_spec.rb
spec/lib/gitlab/rack_attack_spec.rb
+1
-1
spec/models/ci/build_spec.rb
spec/models/ci/build_spec.rb
+1
-1
spec/services/system_notes/commit_service_spec.rb
spec/services/system_notes/commit_service_spec.rb
+1
-1
spec/support/helpers/gpg_helpers.rb
spec/support/helpers/gpg_helpers.rb
+4
-4
spec/support/helpers/memory_usage_helper.rb
spec/support/helpers/memory_usage_helper.rb
+1
-1
No files found.
.rubocop_todo.yml
View file @
1050ef73
...
...
@@ -827,11 +827,6 @@ Style/RescueModifier:
Style/SingleArgumentDig
:
Enabled
:
false
# Offense count: 45
# Cop supports --auto-correct.
Style/SlicingWithRange
:
Enabled
:
false
# Offense count: 63
# Configuration parameters: AllowModifier.
Style/SoleNestedConditional
:
...
...
app/controllers/projects/blob_controller.rb
View file @
1050ef73
...
...
@@ -99,7 +99,7 @@ class Projects::BlobController < Projects::ApplicationController
@content
=
params
[
:content
]
@blob
.
load_all_data!
diffy
=
Diffy
::
Diff
.
new
(
@blob
.
data
,
@content
,
diff:
'-U 3'
,
include_diff_info:
true
)
diff_lines
=
diffy
.
diff
.
scan
(
/.*\n/
)[
2
..
-
1
]
diff_lines
=
diffy
.
diff
.
scan
(
/.*\n/
)[
2
..
]
diff_lines
=
Gitlab
::
Diff
::
Parser
.
new
.
parse
(
diff_lines
).
to_a
@diff_lines
=
Gitlab
::
Diff
::
Highlight
.
new
(
diff_lines
,
repository:
@repository
).
highlight
...
...
app/helpers/diff_helper.rb
View file @
1050ef73
...
...
@@ -283,7 +283,7 @@ module DiffHelper
return
path
unless
path
.
size
>
max
&&
max
>
3
"...
#{
path
[
-
(
max
-
3
)
..
-
1
]
}
"
"...
#{
path
[
-
(
max
-
3
)
..
]
}
"
end
def
code_navigation_path
(
diffs
)
...
...
app/models/concerns/token_authenticatable_strategies/encryption_helper.rb
View file @
1050ef73
...
...
@@ -11,7 +11,7 @@ module TokenAuthenticatableStrategies
# The pattern of the token is "#{DYNAMIC_NONCE_IDENTIFIER}#{token}#{iv_of_12_characters}"
if
token
.
start_with?
(
DYNAMIC_NONCE_IDENTIFIER
)
&&
token
.
size
>
NONCE_SIZE
+
DYNAMIC_NONCE_IDENTIFIER
.
size
token_to_decrypt
=
token
[
1
...-
NONCE_SIZE
]
iv
=
token
[
-
NONCE_SIZE
..
-
1
]
iv
=
token
[
-
NONCE_SIZE
..
]
Gitlab
::
CryptoHelper
.
aes256_gcm_decrypt
(
token_to_decrypt
,
nonce:
iv
)
else
...
...
app/models/namespaces/traversal/linear.rb
View file @
1050ef73
...
...
@@ -204,7 +204,7 @@ module Namespaces
end
if
bottom
skope
=
skope
.
where
(
id:
bottom
.
traversal_ids
[
0
..-
1
]
)
skope
=
skope
.
where
(
id:
bottom
.
traversal_ids
)
end
# The original `with_depth` attribute in ObjectHierarchy increments as you
...
...
app/models/serverless/domain.rb
View file @
1050ef73
...
...
@@ -37,7 +37,7 @@ module Serverless
'a1'
,
serverless_domain_cluster
.
uuid
[
2
..-
3
],
'f2'
,
serverless_domain_cluster
.
uuid
[
-
2
..
-
1
]
serverless_domain_cluster
.
uuid
[
-
2
..
]
].
join
end
end
...
...
app/models/wiki_page.rb
View file @
1050ef73
...
...
@@ -338,7 +338,7 @@ class WikiPage
current_dirname
=
File
.
dirname
(
title
)
if
persisted?
return
title
[
1
..
-
1
]
if
current_dirname
==
'/'
return
title
[
1
..
]
if
current_dirname
==
'/'
return
File
.
join
([
directory
.
presence
,
title
].
compact
)
if
current_dirname
==
'.'
end
...
...
app/services/cohorts_service.rb
View file @
1050ef73
...
...
@@ -38,7 +38,7 @@ class CohortsService
{
registration_month:
registration_month
,
activity_months:
activity_months
[
1
..
-
1
],
activity_months:
activity_months
[
1
..
],
total:
activity_months
.
first
[
:total
],
inactive:
inactive
}
...
...
app/uploaders/lfs_object_uploader.rb
View file @
1050ef73
...
...
@@ -9,7 +9,7 @@ class LfsObjectUploader < GitlabUploader
alias_method
:upload
,
:model
def
filename
model
.
oid
[
4
..
-
1
]
model
.
oid
[
4
..
]
end
def
store_dir
...
...
config/initializers/wikicloth_patch.rb
View file @
1050ef73
...
...
@@ -108,7 +108,7 @@ module WikiCloth
"<span class=
\"
error
\"
>
#{
I18n
.
t
(
'template loop detected'
,
:tree
=>
debug_tree
)
}
</span>"
else
key
=
params
[
0
].
to_s
.
strip
key_options
=
params
[
1
..
-
1
].
collect
{
|
p
|
p
.
is_a?
(
Hash
)
?
{
:name
=>
p
[
:name
].
strip
,
:value
=>
p
[
:value
].
strip
}
:
p
.
strip
}
key_options
=
params
[
1
..
].
collect
{
|
p
|
p
.
is_a?
(
Hash
)
?
{
:name
=>
p
[
:name
].
strip
,
:value
=>
p
[
:value
].
strip
}
:
p
.
strip
}
key_options
||=
[]
key_digest
=
Digest
::
MD5
.
hexdigest
(
key_options
.
to_a
.
sort
{
|
x
,
y
|
(
x
.
is_a?
(
Hash
)
?
x
[
:name
]
:
x
)
<=>
(
y
.
is_a?
(
Hash
)
?
y
[
:name
]
:
y
)
}.
inspect
)
...
...
ee/lib/gitlab/geo/log_helpers.rb
View file @
1050ef73
...
...
@@ -51,7 +51,7 @@ module Gitlab
index
=
context_data
.
index
(
'JID-'
)
return
unless
index
context_data
[
index
+
4
..
-
1
]
context_data
[
index
+
4
..
]
end
end
end
...
...
ee/spec/elastic/migrate/20210421140400_add_new_data_to_merge_requests_documents_spec.rb
View file @
1050ef73
...
...
@@ -56,7 +56,7 @@ RSpec.describe AddNewDataToMergeRequestsDocuments, :elastic, :sidekiq_inline do
it
'only updates merge_request documents missing visibility_level'
,
:aggregate_failures
do
merge_request
=
merge_requests
.
first
add_visibility_level_for_merge_requests
(
merge_requests
[
1
..
-
1
])
add_visibility_level_for_merge_requests
(
merge_requests
[
1
..
])
expected
=
[
Gitlab
::
Elastic
::
DocumentReference
.
new
(
MergeRequest
,
merge_request
.
id
,
merge_request
.
es_id
,
merge_request
.
es_parent
)]
expect
(
::
Elastic
::
ProcessInitialBookkeepingService
).
to
receive
(
:track!
).
with
(
*
expected
).
once
...
...
ee/spec/elastic/migrate/20210623081800_add_upvotes_to_issues_spec.rb
View file @
1050ef73
...
...
@@ -51,7 +51,7 @@ RSpec.describe AddUpvotesToIssues, :elastic, :sidekiq_inline do
it
'only updates issue documents missing upvotes'
,
:aggregate_failures
do
issue
=
issues
.
first
add_upvotes_for_issues
(
issues
[
1
..
-
1
])
add_upvotes_for_issues
(
issues
[
1
..
])
expected
=
[
Gitlab
::
Elastic
::
DocumentReference
.
new
(
Issue
,
issue
.
id
,
issue
.
es_id
,
issue
.
es_parent
)]
expect
(
::
Elastic
::
ProcessInitialBookkeepingService
).
to
receive
(
:track!
).
with
(
*
expected
).
once
...
...
ee/spec/elastic/migrate/migration_shared_examples.rb
View file @
1050ef73
...
...
@@ -53,7 +53,7 @@ RSpec.shared_examples 'migration backfills a field' do
it
'only updates documents missing a field'
,
:aggregate_failures
do
object
=
objects
.
first
add_field_for_objects
(
objects
[
1
..
-
1
])
add_field_for_objects
(
objects
[
1
..
])
expected
=
[
Gitlab
::
Elastic
::
DocumentReference
.
new
(
klass
,
object
.
id
,
object
.
es_id
,
object
.
es_parent
)]
expect
(
::
Elastic
::
ProcessInitialBookkeepingService
).
to
receive
(
:track!
).
with
(
*
expected
).
once
.
and_call_original
...
...
lib/banzai/filter/math_filter.rb
View file @
1050ef73
...
...
@@ -39,7 +39,7 @@ module Banzai
code
[
:class
]
=
INLINE_CLASSES
code
[
STYLE_ATTRIBUTE
]
=
'inline'
closing
.
content
=
closing
.
content
[
1
..
-
1
]
closing
.
content
=
closing
.
content
[
1
..
]
opening
.
content
=
opening
.
content
[
0
..-
2
]
end
end
...
...
lib/banzai/filter/repository_link_filter.rb
View file @
1050ef73
...
...
@@ -174,7 +174,7 @@ module Banzai
def
build_relative_path
(
path
,
request_path
)
return
request_path
if
path
.
empty?
return
path
unless
request_path
return
path
[
1
..
-
1
]
if
path
.
start_with?
(
'/'
)
return
path
[
1
..
]
if
path
.
start_with?
(
'/'
)
parts
=
request_path
.
split
(
'/'
)
...
...
lib/extracts_ref.rb
View file @
1050ef73
...
...
@@ -113,7 +113,7 @@ module ExtractsRef
best_match
=
valid_refs
.
max_by
(
&
:length
)
# Partition the string into the ref and the path, ignoring the empty first value
id
.
partition
(
best_match
)[
1
..
-
1
]
id
.
partition
(
best_match
)[
1
..
]
end
def
use_first_path_segment?
(
ref
)
...
...
lib/flowdock/git/builder.rb
View file @
1050ef73
...
...
@@ -51,7 +51,7 @@ module Flowdock
end
def
body
content
=
@commit
[
:message
][
first_line
.
size
..
-
1
]
content
=
@commit
[
:message
][
first_line
.
size
..
]
content
.
strip!
if
content
"<pre>
#{
content
}
</pre>"
unless
content
.
empty?
end
...
...
lib/gitlab/chat/output.rb
View file @
1050ef73
...
...
@@ -48,10 +48,10 @@ module Gitlab
# follows it will produce a nil. For example:
#
# "\n".split("\n") # => []
# "\n".split("\n")[1..
-1
] # => nil
# "\n".split("\n")[1..] # => nil
#
# To work around this we only "join" if we're given an Array.
if
(
converted
=
output
.
split
(
"
\n
"
)[
1
..
-
1
])
if
(
converted
=
output
.
split
(
"
\n
"
)[
1
..
])
converted
.
join
(
"
\n
"
)
else
''
...
...
lib/gitlab/ci/reports/security/report.rb
View file @
1050ef73
...
...
@@ -51,7 +51,7 @@ module Gitlab
def
replace_with!
(
other
)
instance_variables
.
each
do
|
ivar
|
instance_variable_set
(
ivar
,
other
.
public_send
(
ivar
.
to_s
[
1
..
-
1
]))
# rubocop:disable GitlabSecurity/PublicSend
instance_variable_set
(
ivar
,
other
.
public_send
(
ivar
.
to_s
[
1
..
]))
# rubocop:disable GitlabSecurity/PublicSend
end
end
...
...
lib/gitlab/diff/custom_diff.rb
View file @
1050ef73
...
...
@@ -36,7 +36,7 @@ module Gitlab
end
def
strip_diff_frontmatter
(
diff_content
)
diff_content
.
scan
(
/.*\n/
)[
2
..
-
1
]
&
.
join
(
''
)
if
diff_content
.
present?
diff_content
.
scan
(
/.*\n/
)[
2
..
]
&
.
join
(
''
)
if
diff_content
.
present?
end
def
blobs_with_transformed_diffs
...
...
lib/gitlab/diff/inline_diff.rb
View file @
1050ef73
...
...
@@ -6,8 +6,8 @@ module Gitlab
attr_accessor
:old_line
,
:new_line
,
:offset
def
initialize
(
old_line
,
new_line
,
offset:
0
)
@old_line
=
old_line
[
offset
..
-
1
]
@new_line
=
new_line
[
offset
..
-
1
]
@old_line
=
old_line
[
offset
..
]
@new_line
=
new_line
[
offset
..
]
@offset
=
offset
end
...
...
lib/gitlab/gfm/reference_rewriter.rb
View file @
1050ef73
...
...
@@ -57,7 +57,7 @@ module Gitlab
def
unfold_reference
(
reference
,
match
,
target_parent
)
before
=
@text
[
0
...
match
.
begin
(
0
)]
after
=
@text
[
match
.
end
(
0
)
..
-
1
]
after
=
@text
[
match
.
end
(
0
)
..
]
referable
=
find_referable
(
reference
)
return
reference
unless
referable
...
...
lib/gitlab/gpg.rb
View file @
1050ef73
...
...
@@ -48,7 +48,7 @@ module Gitlab
raw_keys
.
each_with_object
({})
do
|
raw_key
,
grouped_subkeys
|
primary_subkey_id
=
raw_key
.
primary_subkey
.
keyid
grouped_subkeys
[
primary_subkey_id
]
=
raw_key
.
subkeys
[
1
..
-
1
].
map
do
|
s
|
grouped_subkeys
[
primary_subkey_id
]
=
raw_key
.
subkeys
[
1
..
].
map
do
|
s
|
{
keyid:
s
.
keyid
,
fingerprint:
s
.
fingerprint
}
end
end
...
...
lib/gitlab/search/query.rb
View file @
1050ef73
...
...
@@ -44,7 +44,7 @@ module Gitlab
next
unless
match
input
=
match
.
split
(
':'
)[
1
..
-
1
].
join
input
=
match
.
split
(
':'
)[
1
..
].
join
next
if
input
.
empty?
filter
[
:negated
]
=
match
.
start_with?
(
"-"
)
...
...
lib/gitlab/sherlock/line_profiler.rb
View file @
1050ef73
...
...
@@ -70,7 +70,7 @@ module Gitlab
next
if
total_duration
<=
MINIMUM_DURATION
stats
[
1
..
-
1
].
each_with_index
do
|
data
,
index
|
stats
[
1
..
].
each_with_index
do
|
data
,
index
|
next
unless
source_lines
[
index
]
duration
=
microsec_to_millisec
(
data
[
0
])
...
...
lib/gitlab/string_range_marker.rb
View file @
1050ef73
...
...
@@ -99,7 +99,7 @@ module Gitlab
start
=
prev
=
positions
[
0
]
range
=
MarkerRange
.
new
(
start
,
prev
,
mode:
mode
)
positions
[
1
..
-
1
].
each
do
|
pos
|
positions
[
1
..
].
each
do
|
pos
|
if
pos
==
prev
+
1
range
=
MarkerRange
.
new
(
start
,
pos
,
mode:
mode
)
prev
=
pos
...
...
lib/gitlab/utils/nokogiri.rb
View file @
1050ef73
...
...
@@ -16,7 +16,7 @@ module Gitlab
# we remove the leading `//` and add `descendant-or-self::`
# in order to ensure we're searching from this node and all
# descendants.
xpath
.
map
{
|
t
|
"descendant-or-self::
#{
t
[
2
..
-
1
]
}
"
}.
join
(
'|'
)
xpath
.
map
{
|
t
|
"descendant-or-self::
#{
t
[
2
..
]
}
"
}.
join
(
'|'
)
end
end
end
...
...
lib/tasks/gitlab/seed/group_seed.rake
View file @
1050ef73
...
...
@@ -184,7 +184,7 @@ class GroupSeeder
group
=
Group
.
find
(
group_id
)
@resource_count
.
times
do
|
i
|
_
,
project_path
=
PROJECT_URL
.
split
(
'/'
)[
-
2
..
-
1
]
_
,
project_path
=
PROJECT_URL
.
split
(
'/'
)[
-
2
..
]
project_path
.
gsub!
(
'.git'
,
''
)
...
...
rubocop/cop/migration/schedule_async.rb
View file @
1050ef73
...
...
@@ -46,7 +46,7 @@ module RuboCop
end
def
arguments
(
node
)
node
.
children
[
2
..
-
1
]
node
.
children
[
2
..
]
end
end
end
...
...
rubocop/cop/project_path_helper.rb
View file @
1050ef73
...
...
@@ -46,7 +46,7 @@ module RuboCop
end
def
arguments
(
node
)
node
.
children
[
2
..
-
1
]
node
.
children
[
2
..
]
end
end
end
...
...
spec/controllers/projects/serverless/functions_controller_spec.rb
View file @
1050ef73
...
...
@@ -128,7 +128,7 @@ RSpec.describe Projects::Serverless::FunctionsController do
expect
(
json_response
[
"functions"
]).
to
all
(
include
(
'url'
=>
"https://
#{
function_name
}
-
#{
serverless_domain_cluster
.
uuid
[
0
..
1
]
}
a1
#{
serverless_domain_cluster
.
uuid
[
2
..-
3
]
}
f2
#{
serverless_domain_cluster
.
uuid
[
-
2
..
-
1
]
}#{
"%x"
%
environment
.
id
}
-
#{
environment
.
slug
}
.
#{
serverless_domain_cluster
.
domain
}
"
'url'
=>
"https://
#{
function_name
}
-
#{
serverless_domain_cluster
.
uuid
[
0
..
1
]
}
a1
#{
serverless_domain_cluster
.
uuid
[
2
..-
3
]
}
f2
#{
serverless_domain_cluster
.
uuid
[
-
2
..
]
}#{
"%x"
%
environment
.
id
}
-
#{
environment
.
slug
}
.
#{
serverless_domain_cluster
.
domain
}
"
)
)
end
...
...
@@ -166,7 +166,7 @@ RSpec.describe Projects::Serverless::FunctionsController do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
).
to
include
(
'url'
=>
"https://
#{
function_name
}
-
#{
serverless_domain_cluster
.
uuid
[
0
..
1
]
}
a1
#{
serverless_domain_cluster
.
uuid
[
2
..-
3
]
}
f2
#{
serverless_domain_cluster
.
uuid
[
-
2
..
-
1
]
}#{
"%x"
%
environment
.
id
}
-
#{
environment
.
slug
}
.
#{
serverless_domain_cluster
.
domain
}
"
'url'
=>
"https://
#{
function_name
}
-
#{
serverless_domain_cluster
.
uuid
[
0
..
1
]
}
a1
#{
serverless_domain_cluster
.
uuid
[
2
..-
3
]
}
f2
#{
serverless_domain_cluster
.
uuid
[
-
2
..
]
}#{
"%x"
%
environment
.
id
}
-
#{
environment
.
slug
}
.
#{
serverless_domain_cluster
.
domain
}
"
)
end
...
...
spec/features/merge_request/user_views_open_merge_request_spec.rb
View file @
1050ef73
...
...
@@ -20,7 +20,7 @@ RSpec.describe 'User views an open merge request' do
# Work around a weird Capybara behavior where calling `parent` on a node
# returns the whole document, not the node's actual parent element
expect
(
find
(
:xpath
,
"
#{
node
.
path
}
/.."
).
text
).
to
eq
(
merge_request
.
description
[
2
..
-
1
])
expect
(
find
(
:xpath
,
"
#{
node
.
path
}
/.."
).
text
).
to
eq
(
merge_request
.
description
[
2
..
])
expect
(
page
).
to
have_content
(
merge_request
.
title
)
end
...
...
spec/features/projects/labels/issues_sorted_by_priority_spec.rb
View file @
1050ef73
...
...
@@ -80,7 +80,7 @@ RSpec.describe 'Issue prioritization' do
expect
(
issue_titles
[
0
..
1
]).
to
contain_exactly
(
'issue_5'
,
'issue_8'
)
expect
(
issue_titles
[
2
..
4
]).
to
contain_exactly
(
'issue_1'
,
'issue_3'
,
'issue_7'
)
expect
(
issue_titles
[
5
..
-
1
]).
to
eq
(
%w(issue_2 issue_4 issue_6)
)
expect
(
issue_titles
[
5
..
]).
to
eq
(
%w(issue_2 issue_4 issue_6)
)
end
end
end
spec/finders/packages/nuget/package_finder_spec.rb
View file @
1050ef73
...
...
@@ -71,7 +71,7 @@ RSpec.describe Packages::Nuget::PackageFinder do
end
context
'with prefix wildcard'
do
let
(
:package_name
)
{
"%
#{
package1
.
name
[
3
..
-
1
]
}
"
}
let
(
:package_name
)
{
"%
#{
package1
.
name
[
3
..
]
}
"
}
it
{
is_expected
.
to
match_array
([
package1
,
package2
])
}
end
...
...
spec/lib/gitlab/gitaly_client/conflict_files_stitcher_spec.rb
View file @
1050ef73
...
...
@@ -43,10 +43,10 @@ RSpec.describe Gitlab::GitalyClient::ConflictFilesStitcher do
messages
=
[
double
(
files:
[
double
(
header:
header_1
),
double
(
header:
nil
,
content:
content_1
[
0
..
5
])]),
double
(
files:
[
double
(
header:
nil
,
content:
content_1
[
6
..
-
1
])]),
double
(
files:
[
double
(
header:
nil
,
content:
content_1
[
6
..
])]),
double
(
files:
[
double
(
header:
header_2
)]),
double
(
files:
[
double
(
header:
nil
,
content:
content_2
[
0
..
5
]),
double
(
header:
nil
,
content:
content_2
[
6
..
10
])]),
double
(
files:
[
double
(
header:
nil
,
content:
content_2
[
11
..
-
1
])])
double
(
files:
[
double
(
header:
nil
,
content:
content_2
[
11
..
])])
]
conflict_files
=
described_class
.
new
(
messages
,
target_repository
.
gitaly_repository
).
to_a
...
...
spec/lib/gitlab/gitaly_client/diff_stitcher_spec.rb
View file @
1050ef73
...
...
@@ -41,7 +41,7 @@ RSpec.describe Gitlab::GitalyClient::DiffStitcher do
msg_2
.
raw_patch_data
=
diff_2
.
patch
[
0
..
100
]
msg_2
.
end_of_patch
=
false
msg_3
=
OpenStruct
.
new
(
raw_patch_data:
diff_2
.
patch
[
101
..
-
1
],
end_of_patch:
true
)
msg_3
=
OpenStruct
.
new
(
raw_patch_data:
diff_2
.
patch
[
101
..
],
end_of_patch:
true
)
msg_4
=
OpenStruct
.
new
(
diff_3
.
to_h
.
except
(
:patch
))
msg_4
.
raw_patch_data
=
diff_3
.
patch
...
...
spec/lib/gitlab/gpg/invalid_gpg_signature_updater_spec.rb
View file @
1050ef73
...
...
@@ -192,7 +192,7 @@ RSpec.describe Gitlab::Gpg::InvalidGpgSignatureUpdater do
project:
project
,
commit_sha:
commit_sha
,
gpg_key:
nil
,
gpg_key_primary_keyid:
GpgHelpers
::
User3
.
subkey_fingerprints
.
last
[
24
..
-
1
],
gpg_key_primary_keyid:
GpgHelpers
::
User3
.
subkey_fingerprints
.
last
[
24
..
],
verification_status:
'unknown_key'
end
...
...
spec/lib/gitlab/graphql/pagination/keyset/connection_generic_keyset_spec.rb
View file @
1050ef73
...
...
@@ -98,7 +98,7 @@ RSpec.describe Gitlab::Graphql::Pagination::Keyset::Connection do
let
(
:nodes
)
{
Project
.
all
.
order
(
Gitlab
::
Pagination
::
Keyset
::
Order
.
build
([
column_order_id_desc
]))
}
it
'returns the correct nodes'
do
expect
(
subject
.
sliced_nodes
).
to
contain_exactly
(
*
projects
[
2
..
-
1
])
expect
(
subject
.
sliced_nodes
).
to
contain_exactly
(
*
projects
[
2
..
])
end
end
end
...
...
@@ -107,7 +107,7 @@ RSpec.describe Gitlab::Graphql::Pagination::Keyset::Connection do
let
(
:arguments
)
{
{
after:
encoded_cursor
(
projects
[
1
])
}
}
it
'only returns the project before the selected one'
do
expect
(
subject
.
sliced_nodes
).
to
contain_exactly
(
*
projects
[
2
..
-
1
])
expect
(
subject
.
sliced_nodes
).
to
contain_exactly
(
*
projects
[
2
..
])
end
context
'when the sort order is descending'
do
...
...
spec/lib/gitlab/graphql/pagination/keyset/connection_spec.rb
View file @
1050ef73
...
...
@@ -120,7 +120,7 @@ RSpec.describe Gitlab::Graphql::Pagination::Keyset::Connection do
let
(
:nodes
)
{
Project
.
all
.
order
(
id: :desc
)
}
it
'returns the correct nodes'
do
expect
(
subject
.
sliced_nodes
).
to
contain_exactly
(
*
projects
[
2
..
-
1
])
expect
(
subject
.
sliced_nodes
).
to
contain_exactly
(
*
projects
[
2
..
])
end
end
end
...
...
@@ -129,7 +129,7 @@ RSpec.describe Gitlab::Graphql::Pagination::Keyset::Connection do
let
(
:arguments
)
{
{
after:
encoded_cursor
(
projects
[
1
])
}
}
it
'only returns the project before the selected one'
do
expect
(
subject
.
sliced_nodes
).
to
contain_exactly
(
*
projects
[
2
..
-
1
])
expect
(
subject
.
sliced_nodes
).
to
contain_exactly
(
*
projects
[
2
..
])
end
context
'when the sort order is descending'
do
...
...
spec/lib/gitlab/multi_collection_paginator_spec.rb
View file @
1050ef73
...
...
@@ -40,7 +40,7 @@ RSpec.describe Gitlab::MultiCollectionPaginator do
end
it
'fils the last page with elements from the second collection'
do
expected_collection
=
all_groups
[
-
2
..
-
1
]
expected_collection
=
all_groups
[
-
2
..
]
expect
(
paginator
.
paginate
(
3
)).
to
eq
(
expected_collection
)
end
...
...
spec/lib/gitlab/pagination/keyset/order_spec.rb
View file @
1050ef73
...
...
@@ -127,7 +127,7 @@ RSpec.describe Gitlab::Pagination::Keyset::Order do
end
it
do
expect
(
subject
).
to
eq
(
expected
.
reverse
[
1
..
-
1
])
# removing one item because we used it to calculate cursor data for the "last" page in subject
expect
(
subject
).
to
eq
(
expected
.
reverse
[
1
..
])
# removing one item because we used it to calculate cursor data for the "last" page in subject
end
end
end
...
...
spec/lib/gitlab/rack_attack_spec.rb
View file @
1050ef73
...
...
@@ -78,7 +78,7 @@ RSpec.describe Gitlab::RackAttack, :aggregate_failures do
it
'configures tracks and throttles with a selected set of dry-runs'
do
dry_run_throttles
=
throttles
.
each_key
.
first
(
2
)
regular_throttles
=
throttles
.
keys
[
2
..
-
1
]
regular_throttles
=
throttles
.
keys
[
2
..
]
stub_env
(
'GITLAB_THROTTLE_DRY_RUN'
,
dry_run_throttles
.
join
(
','
))
described_class
.
configure
(
fake_rack_attack
)
...
...
spec/models/ci/build_spec.rb
View file @
1050ef73
...
...
@@ -2506,7 +2506,7 @@ RSpec.describe Ci::Build do
it
{
is_expected
.
to
start_with
(
project
.
web_url
[
0
..
6
])
}
it
{
is_expected
.
to
include
(
build
.
token
)
}
it
{
is_expected
.
to
include
(
'gitlab-ci-token'
)
}
it
{
is_expected
.
to
include
(
project
.
web_url
[
7
..
-
1
])
}
it
{
is_expected
.
to
include
(
project
.
web_url
[
7
..
])
}
end
context
'when token is empty'
do
...
...
spec/services/system_notes/commit_service_spec.rb
View file @
1050ef73
...
...
@@ -57,7 +57,7 @@ RSpec.describe SystemNotes::CommitService do
end
context
'with multiple existing commits'
do
let
(
:old_commits
)
{
noteable
.
commits
[
3
..
-
1
]
}
let
(
:old_commits
)
{
noteable
.
commits
[
3
..
]
}
context
'with oldrev'
do
let
(
:oldrev
)
{
noteable
.
commits
[
2
].
id
}
...
...
spec/support/helpers/gpg_helpers.rb
View file @
1050ef73
...
...
@@ -138,7 +138,7 @@ module GpgHelpers
end
def
primary_keyid
fingerprint
[
-
16
..
-
1
]
fingerprint
[
-
16
..
]
end
def
fingerprint
...
...
@@ -281,7 +281,7 @@ module GpgHelpers
end
def
primary_keyid2
fingerprint2
[
-
16
..
-
1
]
fingerprint2
[
-
16
..
]
end
def
fingerprint2
...
...
@@ -374,7 +374,7 @@ module GpgHelpers
end
def
primary_keyid
fingerprint
[
-
16
..
-
1
]
fingerprint
[
-
16
..
]
end
def
fingerprint
...
...
@@ -776,7 +776,7 @@ module GpgHelpers
end
def
primary_keyid
fingerprint
[
-
16
..
-
1
]
fingerprint
[
-
16
..
]
end
def
fingerprint
...
...
spec/support/helpers/memory_usage_helper.rb
View file @
1050ef73
...
...
@@ -23,7 +23,7 @@ module MemoryUsageHelper
output
,
status
=
Gitlab
::
Popen
.
popen
(
%w(free -m)
)
abort
"`free -m` return code is
#{
status
}
:
#{
output
}
"
unless
status
==
0
result
=
output
.
split
(
"
\n
"
)[
1
].
split
(
" "
)[
1
..
-
1
]
result
=
output
.
split
(
"
\n
"
)[
1
].
split
(
" "
)[
1
..
]
attrs
=
%i(m_total m_used m_free m_shared m_buffers_cache m_available)
.
freeze
attrs
.
zip
(
result
).
to_h
...
...
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