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
c97edbb7
Commit
c97edbb7
authored
Apr 09, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
3e637812
7b0f9f82
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
76 additions
and
47 deletions
+76
-47
.gitlab-ci.yml
.gitlab-ci.yml
+6
-2
app/controllers/help_controller.rb
app/controllers/help_controller.rb
+1
-32
lib/gitlab/background_migration.rb
lib/gitlab/background_migration.rb
+22
-6
qa/spec/spec_helper.rb
qa/spec/spec_helper.rb
+1
-1
spec/features/issuables/shortcuts_issuable_spec.rb
spec/features/issuables/shortcuts_issuable_spec.rb
+1
-1
spec/features/profiles/user_visits_profile_preferences_page_spec.rb
...res/profiles/user_visits_profile_preferences_page_spec.rb
+1
-1
spec/lib/gitlab/background_migration_spec.rb
spec/lib/gitlab/background_migration_spec.rb
+40
-0
spec/lib/gitlab/ci/yaml_processor_spec.rb
spec/lib/gitlab/ci/yaml_processor_spec.rb
+1
-1
spec/spec_helper.rb
spec/spec_helper.rb
+2
-2
spec/support/shared_examples/wiki_file_attachments_examples.rb
...support/shared_examples/wiki_file_attachments_examples.rb
+1
-1
No files found.
.gitlab-ci.yml
View file @
c97edbb7
...
...
@@ -4,7 +4,12 @@ include:
-
local
:
/lib/gitlab/ci/templates/Code-Quality.gitlab-ci.yml
.dedicated-runner
:
&dedicated-runner
retry
:
1
retry
:
max
:
1
# This is confusing but this means "2 runs at max".
when
:
-
unknown_failure
-
api_failure
-
runner_system_failure
tags
:
-
gitlab-org
...
...
@@ -1339,4 +1344,3 @@ schedule:review-performance:
<<
:
*review-schedules-only
script
:
-
wait_for_job_to_be_done "schedule:review-deploy"
app/controllers/help_controller.rb
View file @
c97edbb7
...
...
@@ -22,7 +22,7 @@ class HelpController < ApplicationController
end
def
show
@path
=
clean_path_info
(
path_params
[
:path
])
@path
=
Rack
::
Utils
.
clean_path_info
(
path_params
[
:path
])
respond_to
do
|
format
|
format
.
any
(
:markdown
,
:md
,
:html
)
do
...
...
@@ -75,35 +75,4 @@ class HelpController < ApplicationController
params
end
PATH_SEPS
=
Regexp
.
union
(
*
[
::
File
::
SEPARATOR
,
::
File
::
ALT_SEPARATOR
].
compact
)
# Taken from ActionDispatch::FileHandler
# Cleans up the path, to prevent directory traversal outside the doc folder.
def
clean_path_info
(
path_info
)
parts
=
path_info
.
split
(
PATH_SEPS
)
clean
=
[]
# Walk over each part of the path
parts
.
each
do
|
part
|
# Turn `one//two` or `one/./two` into `one/two`.
next
if
part
.
empty?
||
part
==
'.'
if
part
==
'..'
# Turn `one/two/../` into `one`
clean
.
pop
else
# Add simple folder names to the clean path.
clean
<<
part
end
end
# If the path was an absolute path (i.e. `/` or `/one/two`),
# add `/` to the front of the clean path.
clean
.
unshift
'/'
if
parts
.
empty?
||
parts
.
first
.
empty?
# Join all the clean path parts by the path separator.
::
File
.
join
(
*
clean
)
end
end
lib/gitlab/background_migration.rb
View file @
c97edbb7
...
...
@@ -58,11 +58,31 @@ module Gitlab
migration_class_for
(
class_name
).
new
.
perform
(
*
arguments
)
end
def
self
.
exists?
(
migration_class
)
def
self
.
exists?
(
migration_class
,
additional_queues
=
[]
)
enqueued
=
Sidekiq
::
Queue
.
new
(
self
.
queue
)
scheduled
=
Sidekiq
::
ScheduledSet
.
new
[
enqueued
,
scheduled
].
each
do
|
queue
|
enqueued_job?
([
enqueued
,
scheduled
],
migration_class
)
end
def
self
.
dead_jobs?
(
migration_class
)
dead_set
=
Sidekiq
::
DeadSet
.
new
enqueued_job?
([
dead_set
],
migration_class
)
end
def
self
.
retrying_jobs?
(
migration_class
)
retry_set
=
Sidekiq
::
RetrySet
.
new
enqueued_job?
([
retry_set
],
migration_class
)
end
def
self
.
migration_class_for
(
class_name
)
const_get
(
class_name
)
end
def
self
.
enqueued_job?
(
queues
,
migration_class
)
queues
.
each
do
|
queue
|
queue
.
each
do
|
job
|
return
true
if
job
.
queue
==
self
.
queue
&&
job
.
args
.
first
==
migration_class
end
...
...
@@ -70,9 +90,5 @@ module Gitlab
false
end
def
self
.
migration_class_for
(
class_name
)
const_get
(
class_name
)
end
end
end
qa/spec/spec_helper.rb
View file @
c97edbb7
...
...
@@ -34,7 +34,7 @@ RSpec.configure do |config|
config
.
display_try_failure_messages
=
true
config
.
around
do
|
example
|
retry_times
=
example
.
metadata
.
keys
.
include?
(
:quarantine
)
?
1
:
3
retry_times
=
example
.
metadata
.
keys
.
include?
(
:quarantine
)
?
1
:
2
example
.
run_with_retry
retry:
retry_times
end
end
spec/features/issuables/shortcuts_issuable_spec.rb
View file @
c97edbb7
...
...
@@ -13,7 +13,7 @@ describe 'Blob shortcuts', :js do
end
shared_examples
"quotes the selected text"
do
it
"quotes the selected text"
do
it
"quotes the selected text"
,
:quarantine
do
select_element
(
'.note-text'
)
find
(
'body'
).
native
.
send_key
(
'r'
)
...
...
spec/features/profiles/user_visits_profile_preferences_page_spec.rb
View file @
c97edbb7
...
...
@@ -63,7 +63,7 @@ describe 'User visits the profile preferences page' do
end
describe
'User changes their language'
,
:js
do
it
'creates a flash message'
do
it
'creates a flash message'
,
:quarantine
do
select2
(
'en'
,
from:
'#user_preferred_language'
)
click_button
'Save'
...
...
spec/lib/gitlab/background_migration_spec.rb
View file @
c97edbb7
...
...
@@ -195,4 +195,44 @@ describe Gitlab::BackgroundMigration do
end
end
end
describe
'.dead_jobs?'
do
let
(
:queue
)
do
[
double
(
args:
[
'Foo'
,
[
10
,
20
]],
queue:
described_class
.
queue
)]
end
context
'when there are dead jobs present'
do
before
do
allow
(
Sidekiq
::
DeadSet
).
to
receive
(
:new
).
and_return
(
queue
)
end
it
'returns true if specific job exists'
do
expect
(
described_class
.
dead_jobs?
(
'Foo'
)).
to
eq
(
true
)
end
it
'returns false if specific job does not exist'
do
expect
(
described_class
.
dead_jobs?
(
'Bar'
)).
to
eq
(
false
)
end
end
end
describe
'.retrying_jobs?'
do
let
(
:queue
)
do
[
double
(
args:
[
'Foo'
,
[
10
,
20
]],
queue:
described_class
.
queue
)]
end
context
'when there are dead jobs present'
do
before
do
allow
(
Sidekiq
::
RetrySet
).
to
receive
(
:new
).
and_return
(
queue
)
end
it
'returns true if specific job exists'
do
expect
(
described_class
.
retrying_jobs?
(
'Foo'
)).
to
eq
(
true
)
end
it
'returns false if specific job does not exist'
do
expect
(
described_class
.
retrying_jobs?
(
'Bar'
)).
to
eq
(
false
)
end
end
end
end
spec/lib/gitlab/ci/yaml_processor_spec.rb
View file @
c97edbb7
...
...
@@ -615,7 +615,7 @@ module Gitlab
subject
{
Gitlab
::
Ci
::
YamlProcessor
.
new
(
YAML
.
dump
(
config
),
opts
)
}
context
"when validating a ci config file with no project context"
do
context
"when a single string is provided"
do
context
"when a single string is provided"
,
:quarantine
do
let
(
:include_content
)
{
"/local.gitlab-ci.yml"
}
it
"does not return any error"
do
...
...
spec/spec_helper.rb
View file @
c97edbb7
...
...
@@ -102,8 +102,8 @@ RSpec.configure do |config|
config
.
include
PolicyHelpers
,
type: :policy
if
ENV
[
'CI'
]
# This includes the first try, i.e. tests will be run
4
times before failing.
config
.
default_retry_count
=
4
# This includes the first try, i.e. tests will be run
2
times before failing.
config
.
default_retry_count
=
2
config
.
reporter
.
register_listener
(
RspecFlaky
::
Listener
.
new
,
:example_passed
,
...
...
spec/support/shared_examples/wiki_file_attachments_examples.rb
View file @
c97edbb7
...
...
@@ -42,7 +42,7 @@ shared_examples 'wiki file attachments' do
end
end
context
'uploading is complete'
do
context
'uploading is complete'
,
:quarantine
do
it
'shows "Attach a file" button on uploading complete'
do
attach_with_dropzone
wait_for_requests
...
...
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