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
f2a30d69
Commit
f2a30d69
authored
Aug 03, 2017
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 2501-trial-and-license-purchases-inside-gitlab-ee
parents
bd2e1297
451943c0
Changes
54
Hide whitespace changes
Inline
Side-by-side
Showing
54 changed files
with
181 additions
and
32 deletions
+181
-32
app/assets/javascripts/awards_handler.js
app/assets/javascripts/awards_handler.js
+1
-1
app/assets/javascripts/behaviors/requires_input.js
app/assets/javascripts/behaviors/requires_input.js
+6
-3
app/assets/javascripts/behaviors/toggler_behavior.js
app/assets/javascripts/behaviors/toggler_behavior.js
+0
-1
app/assets/javascripts/boards/boards_bundle.js
app/assets/javascripts/boards/boards_bundle.js
+1
-0
app/assets/javascripts/boards/components/board_blank_state.js
...assets/javascripts/boards/components/board_blank_state.js
+1
-0
app/assets/javascripts/boards/components/new_list_dropdown.js
...assets/javascripts/boards/components/new_list_dropdown.js
+1
-0
app/assets/javascripts/boards/stores/boards_store.js
app/assets/javascripts/boards/stores/boards_store.js
+1
-1
app/assets/javascripts/commons/index.js
app/assets/javascripts/commons/index.js
+1
-0
app/assets/javascripts/copy_as_gfm.js
app/assets/javascripts/copy_as_gfm.js
+1
-1
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+4
-4
app/assets/javascripts/dropzone_input.js
app/assets/javascripts/dropzone_input.js
+1
-2
app/assets/javascripts/emoji/index.js
app/assets/javascripts/emoji/index.js
+1
-0
app/assets/javascripts/filterable_list.js
app/assets/javascripts/filterable_list.js
+2
-0
app/assets/javascripts/filtered_search/dropdown_utils.js
app/assets/javascripts/filtered_search/dropdown_utils.js
+1
-0
app/assets/javascripts/gfm_auto_complete.js
app/assets/javascripts/gfm_auto_complete.js
+1
-0
app/assets/javascripts/gl_dropdown.js
app/assets/javascripts/gl_dropdown.js
+1
-0
app/assets/javascripts/graphs/stat_graph_contributors.js
app/assets/javascripts/graphs/stat_graph_contributors.js
+1
-0
app/assets/javascripts/graphs/stat_graph_contributors_graph.js
...ssets/javascripts/graphs/stat_graph_contributors_graph.js
+1
-1
app/assets/javascripts/graphs/stat_graph_contributors_util.js
...assets/javascripts/graphs/stat_graph_contributors_util.js
+1
-0
app/assets/javascripts/issuable_bulk_update_actions.js
app/assets/javascripts/issuable_bulk_update_actions.js
+1
-0
app/assets/javascripts/issuable_index.js
app/assets/javascripts/issuable_index.js
+1
-1
app/assets/javascripts/labels_select.js
app/assets/javascripts/labels_select.js
+1
-1
app/assets/javascripts/lib/utils/pretty_time.js
app/assets/javascripts/lib/utils/pretty_time.js
+2
-0
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+7
-4
app/assets/javascripts/milestone_select.js
app/assets/javascripts/milestone_select.js
+1
-0
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+1
-0
app/assets/javascripts/pipeline_schedules/components/interval_pattern_input.vue
.../pipeline_schedules/components/interval_pattern_input.vue
+2
-0
app/assets/javascripts/profile/gl_crop.js
app/assets/javascripts/profile/gl_crop.js
+1
-1
app/assets/javascripts/project_edit.js
app/assets/javascripts/project_edit.js
+1
-1
app/assets/javascripts/protected_branches/protected_branch_dropdown.js
...vascripts/protected_branches/protected_branch_dropdown.js
+2
-0
app/assets/javascripts/protected_tags/protected_tag_dropdown.js
...sets/javascripts/protected_tags/protected_tag_dropdown.js
+2
-0
app/assets/javascripts/right_sidebar.js
app/assets/javascripts/right_sidebar.js
+1
-0
app/assets/javascripts/shortcuts_issuable.js
app/assets/javascripts/shortcuts_issuable.js
+2
-1
app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.js
...sidebar/components/time_tracking/sidebar_time_tracking.js
+2
-0
app/assets/javascripts/sidebar_height_manager.js
app/assets/javascripts/sidebar_height_manager.js
+2
-1
app/assets/javascripts/todos.js
app/assets/javascripts/todos.js
+3
-0
app/assets/javascripts/u2f/authenticate.js
app/assets/javascripts/u2f/authenticate.js
+2
-0
app/assets/javascripts/u2f/register.js
app/assets/javascripts/u2f/register.js
+2
-0
app/assets/javascripts/username_validator.js
app/assets/javascripts/username_validator.js
+2
-0
app/assets/javascripts/users/activity_calendar.js
app/assets/javascripts/users/activity_calendar.js
+1
-0
app/assets/javascripts/users_select.js
app/assets/javascripts/users_select.js
+1
-0
app/helpers/defer_script_tag_helper.rb
app/helpers/defer_script_tag_helper.rb
+6
-0
app/views/layouts/_bootlint.haml
app/views/layouts/_bootlint.haml
+4
-3
app/views/layouts/_init_auto_complete.html.haml
app/views/layouts/_init_auto_complete.html.haml
+1
-0
app/views/projects/merge_requests/show.html.haml
app/views/projects/merge_requests/show.html.haml
+1
-0
bin/sidekiq-cluster
bin/sidekiq-cluster
+1
-0
changelogs/unreleased-ee/2893-exclude-sidekiq-queues-from-execution-in-sidekiq-cluster.yml
...lude-sidekiq-queues-from-execution-in-sidekiq-cluster.yml
+4
-0
config/initializers/sidekiq.rb
config/initializers/sidekiq.rb
+2
-4
doc/administration/operations/extra_sidekiq_processes.md
doc/administration/operations/extra_sidekiq_processes.md
+18
-0
lib/gitlab/sidekiq_cluster/cli.rb
lib/gitlab/sidekiq_cluster/cli.rb
+12
-1
lib/gitlab/sidekiq_config.rb
lib/gitlab/sidekiq_config.rb
+14
-0
spec/helpers/defer_script_tag_helper_spec.rb
spec/helpers/defer_script_tag_helper_spec.rb
+13
-0
spec/lib/gitlab/sidekiq_cluster/cli_spec.rb
spec/lib/gitlab/sidekiq_cluster/cli_spec.rb
+14
-0
spec/lib/gitlab/sidekiq_config_spec.rb
spec/lib/gitlab/sidekiq_config_spec.rb
+24
-0
No files found.
app/assets/javascripts/awards_handler.js
View file @
f2a30d69
/* eslint-disable class-methods-use-this */
/* eslint-disable class-methods-use-this */
/* global Flash */
/* global Flash */
import
_
from
'
underscore
'
;
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
const
animationEndEventString
=
'
animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd
'
;
const
animationEndEventString
=
'
animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd
'
;
...
...
app/assets/javascripts/behaviors/requires_input.js
View file @
f2a30d69
import
_
from
'
underscore
'
;
import
'
../commons/bootstrap
'
;
import
'
../commons/bootstrap
'
;
// Requires Input behavior
// Requires Input behavior
...
@@ -48,7 +49,9 @@ function hideOrShowHelpBlock(form) {
...
@@ -48,7 +49,9 @@ function hideOrShowHelpBlock(form) {
$
(()
=>
{
$
(()
=>
{
const
$form
=
$
(
'
form.js-requires-input
'
);
const
$form
=
$
(
'
form.js-requires-input
'
);
$form
.
requiresInput
();
if
(
$form
)
{
hideOrShowHelpBlock
(
$form
);
$form
.
requiresInput
();
$
(
'
.select2.js-select-namespace
'
).
change
(()
=>
hideOrShowHelpBlock
(
$form
));
hideOrShowHelpBlock
(
$form
);
$
(
'
.select2.js-select-namespace
'
).
change
(()
=>
hideOrShowHelpBlock
(
$form
));
}
});
});
app/assets/javascripts/behaviors/toggler_behavior.js
View file @
f2a30d69
// Toggle button. Show/hide content inside parent container.
// Toggle button. Show/hide content inside parent container.
// Button does not change visibility. If button has icon - it changes chevron style.
// Button does not change visibility. If button has icon - it changes chevron style.
//
//
...
...
app/assets/javascripts/boards/boards_bundle.js
View file @
f2a30d69
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
/* global BoardService */
/* global BoardService */
/* global Flash */
/* global Flash */
import
_
from
'
underscore
'
;
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
VueResource
from
'
vue-resource
'
;
import
VueResource
from
'
vue-resource
'
;
import
FilteredSearchBoards
from
'
./filtered_search_boards
'
;
import
FilteredSearchBoards
from
'
./filtered_search_boards
'
;
...
...
app/assets/javascripts/boards/components/board_blank_state.js
View file @
f2a30d69
/* global ListLabel */
/* global ListLabel */
import
_
from
'
underscore
'
;
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
const
Store
=
gl
.
issueBoards
.
BoardsStore
;
...
...
app/assets/javascripts/boards/components/new_list_dropdown.js
View file @
f2a30d69
/* eslint-disable comma-dangle, func-names, no-new, space-before-function-paren, one-var,
/* eslint-disable comma-dangle, func-names, no-new, space-before-function-paren, one-var,
promise/catch-or-return */
promise/catch-or-return */
import
_
from
'
underscore
'
;
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
window
.
gl
.
issueBoards
=
window
.
gl
.
issueBoards
||
{};
...
...
app/assets/javascripts/boards/stores/boards_store.js
View file @
f2a30d69
/* eslint-disable comma-dangle, space-before-function-paren, one-var, no-shadow, dot-notation, max-len */
/* eslint-disable comma-dangle, space-before-function-paren, one-var, no-shadow, dot-notation, max-len */
/* global List */
/* global List */
import
_
from
'
underscore
'
;
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
...
...
app/assets/javascripts/commons/index.js
View file @
f2a30d69
import
'
underscore
'
;
import
'
./polyfills
'
;
import
'
./polyfills
'
;
import
'
./jquery
'
;
import
'
./jquery
'
;
import
'
./bootstrap
'
;
import
'
./bootstrap
'
;
app/assets/javascripts/copy_as_gfm.js
View file @
f2a30d69
/* eslint-disable class-methods-use-this, object-shorthand, no-unused-vars, no-use-before-define, no-new, max-len, no-restricted-syntax, guard-for-in, no-continue */
/* eslint-disable class-methods-use-this, object-shorthand, no-unused-vars, no-use-before-define, no-new, max-len, no-restricted-syntax, guard-for-in, no-continue */
import
_
from
'
underscore
'
;
import
'
./lib/utils/common_utils
'
;
import
'
./lib/utils/common_utils
'
;
import
{
placeholderImage
}
from
'
./lazy_loader
'
;
import
{
placeholderImage
}
from
'
./lazy_loader
'
;
...
...
app/assets/javascripts/dispatcher.js
View file @
f2a30d69
...
@@ -88,10 +88,6 @@ import initGroupAnalytics from './init_group_analytics';
...
@@ -88,10 +88,6 @@ import initGroupAnalytics from './init_group_analytics';
(
function
()
{
(
function
()
{
var
Dispatcher
;
var
Dispatcher
;
$
(
function
()
{
return
new
Dispatcher
();
});
Dispatcher
=
(
function
()
{
Dispatcher
=
(
function
()
{
function
Dispatcher
()
{
function
Dispatcher
()
{
this
.
initSearch
();
this
.
initSearch
();
...
@@ -704,4 +700,8 @@ import initGroupAnalytics from './init_group_analytics';
...
@@ -704,4 +700,8 @@ import initGroupAnalytics from './init_group_analytics';
return
Dispatcher
;
return
Dispatcher
;
})();
})();
$
(
function
()
{
new
Dispatcher
();
});
}).
call
(
window
);
}).
call
(
window
);
app/assets/javascripts/dropzone_input.js
View file @
f2a30d69
/* eslint-disable func-names, space-before-function-paren, wrap-iife, max-len, one-var, no-var, one-var-declaration-per-line, no-unused-vars, camelcase, quotes, no-useless-concat, prefer-template, quote-props, comma-dangle, object-shorthand, consistent-return, prefer-arrow-callback */
/* eslint-disable func-names, space-before-function-paren, wrap-iife, max-len, one-var, no-var, one-var-declaration-per-line, no-unused-vars, camelcase, quotes, no-useless-concat, prefer-template, quote-props, comma-dangle, object-shorthand, consistent-return, prefer-arrow-callback */
/* global Dropzone */
/* global Dropzone */
import
_
from
'
underscore
'
;
import
'
./preview_markdown
'
;
import
'
./preview_markdown
'
;
window
.
DropzoneInput
=
(
function
()
{
window
.
DropzoneInput
=
(
function
()
{
function
DropzoneInput
(
form
)
{
function
DropzoneInput
(
form
)
{
Dropzone
.
autoDiscover
=
false
;
const
divHover
=
'
<div class="div-dropzone-hover"></div>
'
;
const
divHover
=
'
<div class="div-dropzone-hover"></div>
'
;
const
iconPaperclip
=
'
<i class="fa fa-paperclip div-dropzone-icon"></i>
'
;
const
iconPaperclip
=
'
<i class="fa fa-paperclip div-dropzone-icon"></i>
'
;
const
$attachButton
=
form
.
find
(
'
.button-attach-file
'
);
const
$attachButton
=
form
.
find
(
'
.button-attach-file
'
);
...
...
app/assets/javascripts/emoji/index.js
View file @
f2a30d69
import
_
from
'
underscore
'
;
import
emojiMap
from
'
emojis/digests.json
'
;
import
emojiMap
from
'
emojis/digests.json
'
;
import
emojiAliases
from
'
emojis/aliases.json
'
;
import
emojiAliases
from
'
emojis/aliases.json
'
;
...
...
app/assets/javascripts/filterable_list.js
View file @
f2a30d69
import
_
from
'
underscore
'
;
/**
/**
* Makes search request for content when user types a value in the search input.
* Makes search request for content when user types a value in the search input.
* Updates the html content of the page with the received one.
* Updates the html content of the page with the received one.
...
...
app/assets/javascripts/filtered_search/dropdown_utils.js
View file @
f2a30d69
import
_
from
'
underscore
'
;
import
FilteredSearchContainer
from
'
./container
'
;
import
FilteredSearchContainer
from
'
./container
'
;
class
DropdownUtils
{
class
DropdownUtils
{
...
...
app/assets/javascripts/gfm_auto_complete.js
View file @
f2a30d69
import
_
from
'
underscore
'
;
import
glRegexp
from
'
./lib/utils/regexp
'
;
import
glRegexp
from
'
./lib/utils/regexp
'
;
import
AjaxCache
from
'
./lib/utils/ajax_cache
'
;
import
AjaxCache
from
'
./lib/utils/ajax_cache
'
;
...
...
app/assets/javascripts/gl_dropdown.js
View file @
f2a30d69
/* eslint-disable func-names, space-before-function-paren, no-var, one-var, one-var-declaration-per-line, prefer-rest-params, max-len, vars-on-top, wrap-iife, no-unused-vars, quotes, no-shadow, no-cond-assign, prefer-arrow-callback, no-return-assign, no-else-return, camelcase, comma-dangle, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, prefer-template, no-param-reassign, no-loop-func, no-mixed-operators */
/* eslint-disable func-names, space-before-function-paren, no-var, one-var, one-var-declaration-per-line, prefer-rest-params, max-len, vars-on-top, wrap-iife, no-unused-vars, quotes, no-shadow, no-cond-assign, prefer-arrow-callback, no-return-assign, no-else-return, camelcase, comma-dangle, no-lonely-if, guard-for-in, no-restricted-syntax, consistent-return, prefer-template, no-param-reassign, no-loop-func, no-mixed-operators */
/* global fuzzaldrinPlus */
/* global fuzzaldrinPlus */
import
_
from
'
underscore
'
;
import
{
isObject
}
from
'
./lib/utils/type_utility
'
;
import
{
isObject
}
from
'
./lib/utils/type_utility
'
;
var
GitLabDropdown
,
GitLabDropdownFilter
,
GitLabDropdownRemote
;
var
GitLabDropdown
,
GitLabDropdownFilter
,
GitLabDropdownRemote
;
...
...
app/assets/javascripts/graphs/stat_graph_contributors.js
View file @
f2a30d69
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, one-var, camelcase, one-var-declaration-per-line, quotes, no-param-reassign, quote-props, comma-dangle, prefer-template, max-len, no-return-assign, no-shadow */
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, one-var, camelcase, one-var-declaration-per-line, quotes, no-param-reassign, quote-props, comma-dangle, prefer-template, max-len, no-return-assign, no-shadow */
import
_
from
'
underscore
'
;
import
d3
from
'
d3
'
;
import
d3
from
'
d3
'
;
import
{
ContributorsGraph
,
ContributorsAuthorGraph
,
ContributorsMasterGraph
}
from
'
./stat_graph_contributors_graph
'
;
import
{
ContributorsGraph
,
ContributorsAuthorGraph
,
ContributorsMasterGraph
}
from
'
./stat_graph_contributors_graph
'
;
import
ContributorsStatGraphUtil
from
'
./stat_graph_contributors_util
'
;
import
ContributorsStatGraphUtil
from
'
./stat_graph_contributors_util
'
;
...
...
app/assets/javascripts/graphs/stat_graph_contributors_graph.js
View file @
f2a30d69
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, max-len, no-restricted-syntax, vars-on-top, no-use-before-define, no-param-reassign, new-cap, no-underscore-dangle, wrap-iife, comma-dangle, no-return-assign, prefer-arrow-callback, quotes, prefer-template, newline-per-chained-call, no-else-return, no-shadow */
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, max-len, no-restricted-syntax, vars-on-top, no-use-before-define, no-param-reassign, new-cap, no-underscore-dangle, wrap-iife, comma-dangle, no-return-assign, prefer-arrow-callback, quotes, prefer-template, newline-per-chained-call, no-else-return, no-shadow */
import
_
from
'
underscore
'
;
import
d3
from
'
d3
'
;
import
d3
from
'
d3
'
;
const
extend
=
function
(
child
,
parent
)
{
for
(
var
key
in
parent
)
{
if
(
hasProp
.
call
(
parent
,
key
))
child
[
key
]
=
parent
[
key
];
}
function
ctor
()
{
this
.
constructor
=
child
;
}
ctor
.
prototype
=
parent
.
prototype
;
child
.
prototype
=
new
ctor
();
child
.
__super__
=
parent
.
prototype
;
return
child
;
};
const
extend
=
function
(
child
,
parent
)
{
for
(
var
key
in
parent
)
{
if
(
hasProp
.
call
(
parent
,
key
))
child
[
key
]
=
parent
[
key
];
}
function
ctor
()
{
this
.
constructor
=
child
;
}
ctor
.
prototype
=
parent
.
prototype
;
child
.
prototype
=
new
ctor
();
child
.
__super__
=
parent
.
prototype
;
return
child
;
};
...
...
app/assets/javascripts/graphs/stat_graph_contributors_util.js
View file @
f2a30d69
/* eslint-disable func-names, space-before-function-paren, object-shorthand, no-var, one-var, camelcase, one-var-declaration-per-line, comma-dangle, no-param-reassign, no-return-assign, quotes, prefer-arrow-callback, wrap-iife, consistent-return, no-unused-vars, max-len, no-cond-assign, no-else-return, max-len */
/* eslint-disable func-names, space-before-function-paren, object-shorthand, no-var, one-var, camelcase, one-var-declaration-per-line, comma-dangle, no-param-reassign, no-return-assign, quotes, prefer-arrow-callback, wrap-iife, consistent-return, no-unused-vars, max-len, no-cond-assign, no-else-return, max-len */
import
_
from
'
underscore
'
;
export
default
{
export
default
{
parse_log
:
function
(
log
)
{
parse_log
:
function
(
log
)
{
...
...
app/assets/javascripts/issuable_bulk_update_actions.js
View file @
f2a30d69
/* eslint-disable comma-dangle, quotes, consistent-return, func-names, array-callback-return, space-before-function-paren, prefer-arrow-callback, max-len, no-unused-expressions, no-sequences, no-underscore-dangle, no-unused-vars, no-param-reassign */
/* eslint-disable comma-dangle, quotes, consistent-return, func-names, array-callback-return, space-before-function-paren, prefer-arrow-callback, max-len, no-unused-expressions, no-sequences, no-underscore-dangle, no-unused-vars, no-param-reassign */
/* global IssuableIndex */
/* global IssuableIndex */
/* global Flash */
/* global Flash */
import
_
from
'
underscore
'
;
export
default
{
export
default
{
init
({
container
,
form
,
issues
,
prefixId
}
=
{})
{
init
({
container
,
form
,
issues
,
prefixId
}
=
{})
{
...
...
app/assets/javascripts/issuable_index.js
View file @
f2a30d69
/* eslint-disable no-param-reassign, func-names, no-var, camelcase, no-unused-vars, object-shorthand, space-before-function-paren, no-return-assign, comma-dangle, consistent-return, one-var, one-var-declaration-per-line, quotes, prefer-template, prefer-arrow-callback, wrap-iife, max-len */
/* eslint-disable no-param-reassign, func-names, no-var, camelcase, no-unused-vars, object-shorthand, space-before-function-paren, no-return-assign, comma-dangle, consistent-return, one-var, one-var-declaration-per-line, quotes, prefer-template, prefer-arrow-callback, wrap-iife, max-len */
/* global IssuableIndex */
/* global IssuableIndex */
import
_
from
'
underscore
'
;
import
IssuableBulkUpdateSidebar
from
'
./issuable_bulk_update_sidebar
'
;
import
IssuableBulkUpdateSidebar
from
'
./issuable_bulk_update_sidebar
'
;
import
IssuableBulkUpdateActions
from
'
./issuable_bulk_update_actions
'
;
import
IssuableBulkUpdateActions
from
'
./issuable_bulk_update_actions
'
;
...
...
app/assets/javascripts/labels_select.js
View file @
f2a30d69
/* eslint-disable no-useless-return, func-names, space-before-function-paren, wrap-iife, no-var, no-underscore-dangle, prefer-arrow-callback, max-len, one-var, no-unused-vars, one-var-declaration-per-line, prefer-template, no-new, consistent-return, object-shorthand, comma-dangle, no-shadow, no-param-reassign, brace-style, vars-on-top, quotes, no-lonely-if, no-else-return, dot-notation, no-empty, no-return-assign, camelcase, prefer-spread */
/* eslint-disable no-useless-return, func-names, space-before-function-paren, wrap-iife, no-var, no-underscore-dangle, prefer-arrow-callback, max-len, one-var, no-unused-vars, one-var-declaration-per-line, prefer-template, no-new, consistent-return, object-shorthand, comma-dangle, no-shadow, no-param-reassign, brace-style, vars-on-top, quotes, no-lonely-if, no-else-return, dot-notation, no-empty, no-return-assign, camelcase, prefer-spread */
/* global Issuable */
/* global Issuable */
/* global ListLabel */
/* global ListLabel */
import
_
from
'
underscore
'
;
import
IssuableBulkUpdateActions
from
'
./issuable_bulk_update_actions
'
;
import
IssuableBulkUpdateActions
from
'
./issuable_bulk_update_actions
'
;
import
DropdownUtils
from
'
./filtered_search/dropdown_utils
'
;
import
DropdownUtils
from
'
./filtered_search/dropdown_utils
'
;
...
...
app/assets/javascripts/lib/utils/pretty_time.js
View file @
f2a30d69
import
_
from
'
underscore
'
;
(()
=>
{
(()
=>
{
/*
/*
* TODO: Make these methods more configurable (e.g. parseSeconds timePeriodContstraints,
* TODO: Make these methods more configurable (e.g. parseSeconds timePeriodContstraints,
...
...
app/assets/javascripts/main.js
View file @
f2a30d69
...
@@ -36,9 +36,6 @@ import './shortcuts_find_file';
...
@@ -36,9 +36,6 @@ import './shortcuts_find_file';
import
'
./shortcuts_issuable
'
;
import
'
./shortcuts_issuable
'
;
import
'
./shortcuts_network
'
;
import
'
./shortcuts_network
'
;
// behaviors
import
'
./behaviors/
'
;
// templates
// templates
import
'
./templates/issuable_template_selector
'
;
import
'
./templates/issuable_template_selector
'
;
import
'
./templates/issuable_template_selectors
'
;
import
'
./templates/issuable_template_selectors
'
;
...
@@ -56,6 +53,9 @@ import './lib/utils/pretty_time';
...
@@ -56,6 +53,9 @@ import './lib/utils/pretty_time';
import
'
./lib/utils/text_utility
'
;
import
'
./lib/utils/text_utility
'
;
import
'
./lib/utils/url_utility
'
;
import
'
./lib/utils/url_utility
'
;
// behaviors
import
'
./behaviors/
'
;
// u2f
// u2f
import
'
./u2f/authenticate
'
;
import
'
./u2f/authenticate
'
;
import
'
./u2f/error
'
;
import
'
./u2f/error
'
;
...
@@ -86,7 +86,6 @@ import './copy_as_gfm';
...
@@ -86,7 +86,6 @@ import './copy_as_gfm';
import
'
./copy_to_clipboard
'
;
import
'
./copy_to_clipboard
'
;
import
'
./create_label
'
;
import
'
./create_label
'
;
import
'
./diff
'
;
import
'
./diff
'
;
import
'
./dispatcher
'
;
import
'
./dropzone_input
'
;
import
'
./dropzone_input
'
;
import
'
./due_date_select
'
;
import
'
./due_date_select
'
;
import
'
./files_comment_button
'
;
import
'
./files_comment_button
'
;
...
@@ -150,6 +149,8 @@ import './subscription';
...
@@ -150,6 +149,8 @@ import './subscription';
import
'
./subscription_select
'
;
import
'
./subscription_select
'
;
import
'
./syntax_highlight
'
;
import
'
./syntax_highlight
'
;
import
'
./dispatcher
'
;
// EE-only scripts
// EE-only scripts
import
'
./admin_email_select
'
;
import
'
./admin_email_select
'
;
import
'
./application_settings
'
;
import
'
./application_settings
'
;
...
@@ -162,6 +163,8 @@ import './weight_select';
...
@@ -162,6 +163,8 @@ import './weight_select';
// eslint-disable-next-line global-require, import/no-commonjs
// eslint-disable-next-line global-require, import/no-commonjs
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
require
(
'
./test_utils/
'
);
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
require
(
'
./test_utils/
'
);
Dropzone
.
autoDiscover
=
false
;
document
.
addEventListener
(
'
beforeunload
'
,
function
()
{
document
.
addEventListener
(
'
beforeunload
'
,
function
()
{
// Unbind scroll events
// Unbind scroll events
$
(
document
).
off
(
'
scroll
'
);
$
(
document
).
off
(
'
scroll
'
);
...
...
app/assets/javascripts/milestone_select.js
View file @
f2a30d69
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-underscore-dangle, prefer-arrow-callback, max-len, one-var, one-var-declaration-per-line, no-unused-vars, object-shorthand, comma-dangle, no-else-return, no-self-compare, consistent-return, no-param-reassign, no-shadow */
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-underscore-dangle, prefer-arrow-callback, max-len, one-var, one-var-declaration-per-line, no-unused-vars, object-shorthand, comma-dangle, no-else-return, no-self-compare, consistent-return, no-param-reassign, no-shadow */
/* global Issuable */
/* global Issuable */
/* global ListMilestone */
/* global ListMilestone */
import
_
from
'
underscore
'
;
(
function
()
{
(
function
()
{
this
.
MilestoneSelect
=
(
function
()
{
this
.
MilestoneSelect
=
(
function
()
{
...
...
app/assets/javascripts/notes.js
View file @
f2a30d69
...
@@ -11,6 +11,7 @@ newline-per-chained-call, no-useless-escape, class-methods-use-this */
...
@@ -11,6 +11,7 @@ newline-per-chained-call, no-useless-escape, class-methods-use-this */
/* global mrRefreshWidgetUrl */
/* global mrRefreshWidgetUrl */
import
$
from
'
jquery
'
;
import
$
from
'
jquery
'
;
import
_
from
'
underscore
'
;
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
import
autosize
from
'
vendor/autosize
'
;
import
autosize
from
'
vendor/autosize
'
;
import
Dropzone
from
'
dropzone
'
;
import
Dropzone
from
'
dropzone
'
;
...
...
app/assets/javascripts/pipeline_schedules/components/interval_pattern_input.vue
View file @
f2a30d69
<
script
>
<
script
>
import
_
from
'
underscore
'
;
export
default
{
export
default
{
props
:
{
props
:
{
initialCronInterval
:
{
initialCronInterval
:
{
...
...
app/assets/javascripts/profile/gl_crop.js
View file @
f2a30d69
/* eslint-disable no-useless-escape, max-len, quotes, no-var, no-underscore-dangle, func-names, space-before-function-paren, no-unused-vars, no-return-assign, object-shorthand, one-var, one-var-declaration-per-line, comma-dangle, consistent-return, class-methods-use-this, new-parens */
/* eslint-disable no-useless-escape, max-len, quotes, no-var, no-underscore-dangle, func-names, space-before-function-paren, no-unused-vars, no-return-assign, object-shorthand, one-var, one-var-declaration-per-line, comma-dangle, consistent-return, class-methods-use-this, new-parens */
import
_
from
'
underscore
'
;
import
'
vendor/cropper
'
;
import
'
vendor/cropper
'
;
((
global
)
=>
{
((
global
)
=>
{
...
...
app/assets/javascripts/project_edit.js
View file @
f2a30d69
export
default
function
setupProjectEdit
()
{
export
default
function
setupProjectEdit
()
{
const
$transferForm
=
$
(
'
.js-project-transfer-form
'
);
const
$transferForm
=
$
(
'
.js-project-transfer-form
'
);
const
$selectNamespace
=
$transferForm
.
find
(
'
.select2
'
);
const
$selectNamespace
=
$transferForm
.
find
(
'
select
.select2
'
);
$selectNamespace
.
on
(
'
change
'
,
()
=>
{
$selectNamespace
.
on
(
'
change
'
,
()
=>
{
$transferForm
.
find
(
'
:submit
'
).
prop
(
'
disabled
'
,
!
$selectNamespace
.
val
());
$transferForm
.
find
(
'
:submit
'
).
prop
(
'
disabled
'
,
!
$selectNamespace
.
val
());
...
...
app/assets/javascripts/protected_branches/protected_branch_dropdown.js
View file @
f2a30d69
import
_
from
'
underscore
'
;
export
default
class
ProtectedBranchDropdown
{
export
default
class
ProtectedBranchDropdown
{
/**
/**
* @param {Object} options containing
* @param {Object} options containing
...
...
app/assets/javascripts/protected_tags/protected_tag_dropdown.js
View file @
f2a30d69
import
_
from
'
underscore
'
;
export
default
class
ProtectedTagDropdown
{
export
default
class
ProtectedTagDropdown
{
/**
/**
* @param {Object} options containing
* @param {Object} options containing
...
...
app/assets/javascripts/right_sidebar.js
View file @
f2a30d69
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-unused-vars, consistent-return, one-var, one-var-declaration-per-line, quotes, prefer-template, object-shorthand, comma-dangle, no-else-return, no-param-reassign, max-len */
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-unused-vars, consistent-return, one-var, one-var-declaration-per-line, quotes, prefer-template, object-shorthand, comma-dangle, no-else-return, no-param-reassign, max-len */
import
_
from
'
underscore
'
;
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
import
SidebarHeightManager
from
'
./sidebar_height_manager
'
;
import
SidebarHeightManager
from
'
./sidebar_height_manager
'
;
...
...
app/assets/javascripts/shortcuts_issuable.js
View file @
f2a30d69
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
/* global ShortcutsNavigation */
/* global ShortcutsNavigation */
/* global sidebar */
/* global sidebar */
import
_
from
'
underscore
'
;
import
'
mousetrap
'
;
import
'
mousetrap
'
;
import
'
./shortcuts_navigation
'
;
import
'
./shortcuts_navigation
'
;
...
@@ -58,7 +59,7 @@ import './shortcuts_navigation';
...
@@ -58,7 +59,7 @@ import './shortcuts_navigation';
});
});
// If replyField already has some content, add a newline before our quote
// If replyField already has some content, add a newline before our quote
separator
=
replyField
.
val
().
trim
()
!==
""
&&
"
\n\n
"
||
''
;
separator
=
replyField
.
val
().
trim
()
!==
""
&&
"
\n\n
"
||
''
;
replyField
.
val
(
function
(
_
,
current
)
{
replyField
.
val
(
function
(
a
,
current
)
{
return
current
+
separator
+
quote
.
join
(
''
)
+
"
\n
"
;
return
current
+
separator
+
quote
.
join
(
''
)
+
"
\n
"
;
});
});
...
...
app/assets/javascripts/sidebar/components/time_tracking/sidebar_time_tracking.js
View file @
f2a30d69
import
_
from
'
underscore
'
;
import
'
~/smart_interval
'
;
import
'
~/smart_interval
'
;
import
timeTracker
from
'
./time_tracker
'
;
import
timeTracker
from
'
./time_tracker
'
;
...
...
app/assets/javascripts/sidebar_height_manager.js
View file @
f2a30d69
import
_
from
'
underscore
'
;
export
default
{
export
default
{
init
()
{
init
()
{
if
(
!
this
.
initialized
)
{
if
(
!
this
.
initialized
)
{
...
@@ -30,4 +32,3 @@ export default {
...
@@ -30,4 +32,3 @@ export default {
}
}
},
},
};
};
app/assets/javascripts/todos.js
View file @
f2a30d69
...
@@ -52,6 +52,7 @@ export default class Todos {
...
@@ -52,6 +52,7 @@ export default class Todos {
}
}
updateRowStateClicked
(
e
)
{
updateRowStateClicked
(
e
)
{
e
.
stopPropagation
();
e
.
preventDefault
();
e
.
preventDefault
();
const
target
=
e
.
target
;
const
target
=
e
.
target
;
...
@@ -92,6 +93,7 @@ export default class Todos {
...
@@ -92,6 +93,7 @@ export default class Todos {
}
}
updateAllStateClicked
(
e
)
{
updateAllStateClicked
(
e
)
{
e
.
stopPropagation
();
e
.
preventDefault
();
e
.
preventDefault
();
const
target
=
e
.
currentTarget
;
const
target
=
e
.
currentTarget
;
...
@@ -142,6 +144,7 @@ export default class Todos {
...
@@ -142,6 +144,7 @@ export default class Todos {
if
(
gl
.
utils
.
isMetaClick
(
e
))
{
if
(
gl
.
utils
.
isMetaClick
(
e
))
{
const
windowTarget
=
'
_blank
'
;
const
windowTarget
=
'
_blank
'
;
const
selected
=
e
.
target
;
const
selected
=
e
.
target
;
e
.
stopPropagation
();
e
.
preventDefault
();
e
.
preventDefault
();
if
(
selected
.
tagName
===
'
IMG
'
)
{
if
(
selected
.
tagName
===
'
IMG
'
)
{
...
...
app/assets/javascripts/u2f/authenticate.js
View file @
f2a30d69
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
/* global U2FError */
/* global U2FError */
/* global U2FUtil */
/* global U2FUtil */
import
_
from
'
underscore
'
;
// Authenticate U2F (universal 2nd factor) devices for users to authenticate with.
// Authenticate U2F (universal 2nd factor) devices for users to authenticate with.
//
//
// State Flow #1: setup -> in_progress -> authenticated -> POST to server
// State Flow #1: setup -> in_progress -> authenticated -> POST to server
...
...
app/assets/javascripts/u2f/register.js
View file @
f2a30d69
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
/* global U2FError */
/* global U2FError */
/* global U2FUtil */
/* global U2FUtil */
import
_
from
'
underscore
'
;
// Register U2F (universal 2nd factor) devices for users to authenticate with.
// Register U2F (universal 2nd factor) devices for users to authenticate with.
//
//
// State Flow #1: setup -> in_progress -> registered -> POST to server
// State Flow #1: setup -> in_progress -> registered -> POST to server
...
...
app/assets/javascripts/username_validator.js
View file @
f2a30d69
/* eslint-disable comma-dangle, consistent-return, class-methods-use-this, arrow-parens, no-param-reassign, max-len */
/* eslint-disable comma-dangle, consistent-return, class-methods-use-this, arrow-parens, no-param-reassign, max-len */
import
_
from
'
underscore
'
;
const
debounceTimeoutDuration
=
1000
;
const
debounceTimeoutDuration
=
1000
;
const
invalidInputClass
=
'
gl-field-error-outline
'
;
const
invalidInputClass
=
'
gl-field-error-outline
'
;
const
successInputClass
=
'
gl-field-success-outline
'
;
const
successInputClass
=
'
gl-field-success-outline
'
;
...
...
app/assets/javascripts/users/activity_calendar.js
View file @
f2a30d69
import
_
from
'
underscore
'
;
import
d3
from
'
d3
'
;
import
d3
from
'
d3
'
;
const
LOADING_HTML
=
`
const
LOADING_HTML
=
`
...
...
app/assets/javascripts/users_select.js
View file @
f2a30d69
/* eslint-disable func-names, space-before-function-paren, one-var, no-var, prefer-rest-params, wrap-iife, quotes, max-len, one-var-declaration-per-line, vars-on-top, prefer-arrow-callback, consistent-return, comma-dangle, object-shorthand, no-shadow, no-unused-vars, no-else-return, no-self-compare, prefer-template, no-unused-expressions, no-lonely-if, yoda, prefer-spread, no-void, camelcase, no-param-reassign */
/* eslint-disable func-names, space-before-function-paren, one-var, no-var, prefer-rest-params, wrap-iife, quotes, max-len, one-var-declaration-per-line, vars-on-top, prefer-arrow-callback, consistent-return, comma-dangle, object-shorthand, no-shadow, no-unused-vars, no-else-return, no-self-compare, prefer-template, no-unused-expressions, no-lonely-if, yoda, prefer-spread, no-void, camelcase, no-param-reassign */
/* global Issuable */
/* global Issuable */
/* global emitSidebarEvent */
/* global emitSidebarEvent */
import
_
from
'
underscore
'
;
// TODO: remove eventHub hack after code splitting refactor
// TODO: remove eventHub hack after code splitting refactor
window
.
emitSidebarEvent
=
window
.
emitSidebarEvent
||
$
.
noop
;
window
.
emitSidebarEvent
=
window
.
emitSidebarEvent
||
$
.
noop
;
...
...
app/helpers/defer_script_tag_helper.rb
0 → 100644
View file @
f2a30d69
module
DeferScriptTagHelper
# Override the default ActionView `javascript_include_tag` helper to support page specific deferred loading
def
javascript_include_tag
(
*
sources
)
super
(
*
sources
,
defer:
true
)
end
end
app/views/layouts/_bootlint.haml
View file @
f2a30d69
-# haml-lint:disable InlineJavaScript
:javascript
:javascript
jQuery
(
document
).
ready
(
function
()
{
window
.
onload
=
function
()
{
javascript
:(
function
(){
var
s
=
document
.
createElement
(
"
script
"
);
s
.
onload
=
function
(){
bootlint
.
showLintReportForCurrentDocument
([],
{
hasProblems
:
false
,
problemFree
:
false
});};
s
.
src
=
"
https://maxcdn.bootstrapcdn.com/bootlint/latest/bootlint.min.js
"
;
document
.
body
.
appendChild
(
s
)})(
);
var
s
=
document
.
createElement
(
"
script
"
);
s
.
onload
=
function
(){
bootlint
.
showLintReportForCurrentDocument
([],
{
hasProblems
:
false
,
problemFree
:
false
});};
s
.
src
=
"
https://maxcdn.bootstrapcdn.com/bootlint/latest/bootlint.min.js
"
;
document
.
body
.
appendChild
(
s
);
}
);
}
app/views/layouts/_init_auto_complete.html.haml
View file @
f2a30d69
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
-
if
project
-
if
project
-# haml-lint:disable InlineJavaScript
-# haml-lint:disable InlineJavaScript
:javascript
:javascript
gl
=
window
.
gl
||
{};
gl
.
GfmAutoComplete
=
gl
.
GfmAutoComplete
||
{};
gl
.
GfmAutoComplete
=
gl
.
GfmAutoComplete
||
{};
gl
.
GfmAutoComplete
.
dataSources
=
{
gl
.
GfmAutoComplete
.
dataSources
=
{
members
:
"
#{
members_project_autocomplete_sources_path
(
project
,
type:
noteable_type
,
type_id:
params
[
:id
])
}
"
,
members
:
"
#{
members_project_autocomplete_sources_path
(
project
,
type:
noteable_type
,
type_id:
params
[
:id
])
}
"
,
...
...
app/views/projects/merge_requests/show.html.haml
View file @
f2a30d69
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
-# haml-lint:disable InlineJavaScript
-# haml-lint:disable InlineJavaScript
:javascript
:javascript
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
mrWidgetData
=
#{
serialize_issuable
(
@merge_request
)
}
window
.
gl
.
mrWidgetData
=
#{
serialize_issuable
(
@merge_request
)
}
// Append static, server-generated data not included in merge request entity (EE-Only)
// Append static, server-generated data not included in merge request entity (EE-Only)
...
...
bin/sidekiq-cluster
View file @
f2a30d69
#!/usr/bin/env ruby
#!/usr/bin/env ruby
require
'optparse'
require
'optparse'
require_relative
'../lib/gitlab/sidekiq_config'
require_relative
'../lib/gitlab/sidekiq_cluster'
require_relative
'../lib/gitlab/sidekiq_cluster'
require_relative
'../lib/gitlab/sidekiq_cluster/cli'
require_relative
'../lib/gitlab/sidekiq_cluster/cli'
...
...
changelogs/unreleased-ee/2893-exclude-sidekiq-queues-from-execution-in-sidekiq-cluster.yml
0 → 100644
View file @
f2a30d69
---
title
:
Allow excluding sidekiq queues from execution in sidekiq-cluster
merge_request
:
2571
author
:
config/initializers/sidekiq.rb
View file @
f2a30d69
...
@@ -68,14 +68,12 @@ end
...
@@ -68,14 +68,12 @@ end
# The Sidekiq client API always adds the queue to the Sidekiq queue
# The Sidekiq client API always adds the queue to the Sidekiq queue
# list, but mail_room and gitlab-shell do not. This is only necessary
# list, but mail_room and gitlab-shell do not. This is only necessary
# for monitoring.
# for monitoring.
config
=
YAML
.
load_file
(
Rails
.
root
.
join
(
'config'
,
'sidekiq_queues.yml'
).
to_s
)
queues
=
Gitlab
::
SidekiqConfig
.
queues
begin
begin
Sidekiq
.
redis
do
|
conn
|
Sidekiq
.
redis
do
|
conn
|
conn
.
pipelined
do
conn
.
pipelined
do
config
[
:queues
].
each
do
|
queue
|
queues
.
each
{
|
queue
|
conn
.
sadd
(
'queues'
,
queue
)
}
conn
.
sadd
(
'queues'
,
queue
[
0
])
end
end
end
end
end
rescue
Redis
::
BaseError
,
SocketError
,
Errno
::
ENOENT
,
Errno
::
EADDRNOTAVAIL
,
Errno
::
EAFNOSUPPORT
,
Errno
::
ECONNRESET
,
Errno
::
ECONNREFUSED
rescue
Redis
::
BaseError
,
SocketError
,
Errno
::
ENOENT
,
Errno
::
EADDRNOTAVAIL
,
Errno
::
EAFNOSUPPORT
,
Errno
::
ECONNRESET
,
Errno
::
ECONNREFUSED
...
...
doc/administration/operations/extra_sidekiq_processes.md
View file @
f2a30d69
...
@@ -87,3 +87,21 @@ command, and not the PID(s) of the started Sidekiq processes.
...
@@ -87,3 +87,21 @@ command, and not the PID(s) of the started Sidekiq processes.
The Rails environment can be set by passing the
`--environment`
flag to the
The Rails environment can be set by passing the
`--environment`
flag to the
`sidekiq-cluster`
command, or by setting
`RAILS_ENV`
to a non-empty value. The
`sidekiq-cluster`
command, or by setting
`RAILS_ENV`
to a non-empty value. The
default value is "development".
default value is "development".
## All Queues With Exceptions
You're able to run all queues in
`sidekiq_queues.yml`
file on a single or
multiple processes with exceptions using the
`--negate`
flag.
For example, say you want to run a single process for all queues,
except "process_commit" and "post_receive". You can do so by executing:
```
bash
sidekiq-cluster process_commit,post_receive
--negate
```
For multiple processes of all queues (except "process_commit" and "post_receive"):
```
bash
sidekiq-cluster process_commit,post_receive process_commit,post_receive
--negate
```
lib/gitlab/sidekiq_cluster/cli.rb
View file @
f2a30d69
...
@@ -30,7 +30,14 @@ module Gitlab
...
@@ -30,7 +30,14 @@ module Gitlab
option_parser
.
parse!
(
argv
)
option_parser
.
parse!
(
argv
)
queues
=
SidekiqCluster
.
parse_queues
(
argv
)
parsed_queues
=
SidekiqCluster
.
parse_queues
(
argv
)
queues
=
if
@negate_queues
parsed_queues
.
map
{
|
queues
|
SidekiqConfig
.
queues
(
@rails_path
,
except:
queues
)
}
else
parsed_queues
end
@logger
.
info
(
"Starting cluster with
#{
queues
.
length
}
processes"
)
@logger
.
info
(
"Starting cluster with
#{
queues
.
length
}
processes"
)
...
@@ -93,6 +100,10 @@ module Gitlab
...
@@ -93,6 +100,10 @@ module Gitlab
@rails_path
=
path
@rails_path
=
path
end
end
opt
.
on
(
'-n'
,
'--negate'
,
'Run workers for all queues in sidekiq_queues.yml except the given ones'
)
do
@negate_queues
=
true
end
opt
.
on
(
'-i'
,
'--interval INT'
,
'The number of seconds to wait between worker checks'
)
do
|
int
|
opt
.
on
(
'-i'
,
'--interval INT'
,
'The number of seconds to wait between worker checks'
)
do
|
int
|
@interval
=
int
.
to_i
@interval
=
int
.
to_i
end
end
...
...
lib/gitlab/sidekiq_config.rb
0 → 100644
View file @
f2a30d69
require
'yaml'
module
Gitlab
module
SidekiqConfig
def
self
.
queues
(
rails_path
=
Rails
.
root
.
to_s
,
except:
[])
queues_file_path
=
File
.
join
(
rails_path
,
'config'
,
'sidekiq_queues.yml'
)
@queues_file
=
{}
@queues_file
[
queues_file_path
]
||=
YAML
.
load_file
(
queues_file_path
)
@queues_file
[
queues_file_path
].
fetch
(
:queues
).
map
{
|
queue
,
_
|
queue
}
-
except
end
end
end
spec/helpers/defer_script_tag_helper_spec.rb
0 → 100644
View file @
f2a30d69
# coding: utf-8
require
'spec_helper'
describe
DeferScriptTagHelper
do
describe
'script tag'
do
script_url
=
'test.js'
it
'returns an script tag with defer=true'
do
expect
(
javascript_include_tag
(
script_url
).
to_s
)
.
to
eq
"<script src=
\"
/javascripts/
#{
script_url
}
\"
defer=
\"
defer
\"
></script>"
end
end
end
spec/lib/gitlab/sidekiq_cluster/cli_spec.rb
View file @
f2a30d69
...
@@ -19,6 +19,20 @@ describe Gitlab::SidekiqCluster::CLI do
...
@@ -19,6 +19,20 @@ describe Gitlab::SidekiqCluster::CLI do
cli
.
run
(
%w(foo)
)
cli
.
run
(
%w(foo)
)
end
end
context
'with --negate flag'
do
it
'starts Sidekiq workers for all queues on sidekiq_queues.yml except the ones on argv'
do
expect
(
Gitlab
::
SidekiqConfig
).
to
receive
(
:queues
).
and_return
([
'baz'
])
expect
(
Gitlab
::
SidekiqCluster
).
to
receive
(
:start
)
.
with
([[
'baz'
]],
'test'
,
Dir
.
pwd
)
.
and_return
([])
expect
(
cli
).
to
receive
(
:write_pid
)
expect
(
cli
).
to
receive
(
:trap_signals
)
expect
(
cli
).
to
receive
(
:start_loop
)
cli
.
run
(
%w(foo -n)
)
end
end
end
end
end
end
...
...
spec/lib/gitlab/sidekiq_config_spec.rb
0 → 100644
View file @
f2a30d69
require
'rails_helper'
describe
Gitlab
::
SidekiqConfig
do
describe
'.queues'
do
let
(
:queues_file_path
)
{
Rails
.
root
.
join
(
'config'
,
'sidekiq_queues.yml'
)
}
context
'without except argument'
do
it
'returns all queues defined on config/sidekiq_queues.yml file'
do
expected_queues
=
YAML
.
load_file
(
queues_file_path
)[
:queues
].
map
{
|
queue
,
_
|
queue
}
expect
(
described_class
.
queues
).
to
eq
(
expected_queues
)
end
end
context
'with except argument'
do
it
'returns queues on config/sidekiq_queues.yml filtering out excluded ones'
do
expected_queues
=
YAML
.
load_file
(
queues_file_path
)[
:queues
].
map
{
|
queue
,
_
|
queue
}
-
[
'webhook'
]
expect
(
described_class
.
queues
(
except:
[
'webhook'
])).
to
eq
(
expected_queues
)
end
end
end
end
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