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
ae832eef
Commit
ae832eef
authored
Oct 29, 2020
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
91f8b22c
4ca0e8e7
Changes
55
Hide whitespace changes
Inline
Side-by-side
Showing
55 changed files
with
318 additions
and
113 deletions
+318
-113
app/assets/javascripts/boards/components/board_settings_sidebar.vue
.../javascripts/boards/components/board_settings_sidebar.vue
+7
-1
app/assets/javascripts/diffs/components/collapsed_files_warning.vue
.../javascripts/diffs/components/collapsed_files_warning.vue
+2
-4
app/assets/javascripts/diffs/components/compare_versions.vue
app/assets/javascripts/diffs/components/compare_versions.vue
+4
-1
app/assets/javascripts/diffs/components/diff_file.vue
app/assets/javascripts/diffs/components/diff_file.vue
+12
-2
app/assets/javascripts/diffs/event_hub.js
app/assets/javascripts/diffs/event_hub.js
+3
-0
app/assets/javascripts/diffs/store/actions.js
app/assets/javascripts/diffs/store/actions.js
+0
-4
app/assets/javascripts/diffs/store/mutation_types.js
app/assets/javascripts/diffs/store/mutation_types.js
+0
-1
app/assets/javascripts/diffs/store/mutations.js
app/assets/javascripts/diffs/store/mutations.js
+0
-11
app/assets/javascripts/frequent_items/index.js
app/assets/javascripts/frequent_items/index.js
+36
-46
changelogs/unreleased/Add-Caching-To-BitBucket-Server-Importer.yml
...s/unreleased/Add-Caching-To-BitBucket-Server-Importer.yml
+5
-0
changelogs/unreleased/revert-tz-defer-frequent-item-init.yml
changelogs/unreleased/revert-tz-defer-frequent-item-init.yml
+5
-0
changelogs/unreleased/ss-add-wip-limits-license-check.yml
changelogs/unreleased/ss-add-wip-limits-license-check.yml
+5
-0
ee/spec/frontend/boards/components/board_settings_sidebar_spec.js
...frontend/boards/components/board_settings_sidebar_spec.js
+7
-2
lib/api/badges.rb
lib/api/badges.rb
+2
-0
lib/api/boards.rb
lib/api/boards.rb
+2
-0
lib/api/branches.rb
lib/api/branches.rb
+2
-0
lib/api/broadcast_messages.rb
lib/api/broadcast_messages.rb
+2
-0
lib/api/ci/pipeline_schedules.rb
lib/api/ci/pipeline_schedules.rb
+2
-0
lib/api/ci/pipelines.rb
lib/api/ci/pipelines.rb
+2
-0
lib/api/ci/runner.rb
lib/api/ci/runner.rb
+2
-0
lib/api/ci/runners.rb
lib/api/ci/runners.rb
+2
-0
lib/api/commit_statuses.rb
lib/api/commit_statuses.rb
+2
-0
lib/api/commits.rb
lib/api/commits.rb
+2
-0
lib/api/container_registry_event.rb
lib/api/container_registry_event.rb
+2
-0
lib/api/deploy_keys.rb
lib/api/deploy_keys.rb
+2
-0
lib/api/deploy_tokens.rb
lib/api/deploy_tokens.rb
+2
-0
lib/api/deployments.rb
lib/api/deployments.rb
+2
-0
lib/api/environments.rb
lib/api/environments.rb
+2
-0
lib/api/error_tracking.rb
lib/api/error_tracking.rb
+2
-0
lib/api/events.rb
lib/api/events.rb
+2
-0
lib/api/feature_flag_scopes.rb
lib/api/feature_flag_scopes.rb
+2
-0
lib/api/feature_flags.rb
lib/api/feature_flags.rb
+2
-0
lib/api/feature_flags_user_lists.rb
lib/api/feature_flags_user_lists.rb
+2
-0
lib/api/features.rb
lib/api/features.rb
+2
-0
lib/api/files.rb
lib/api/files.rb
+2
-0
lib/api/freeze_periods.rb
lib/api/freeze_periods.rb
+2
-0
lib/api/group_boards.rb
lib/api/group_boards.rb
+2
-0
lib/api/group_clusters.rb
lib/api/group_clusters.rb
+2
-0
lib/api/group_container_repositories.rb
lib/api/group_container_repositories.rb
+2
-0
lib/api/group_export.rb
lib/api/group_export.rb
+2
-0
lib/api/group_import.rb
lib/api/group_import.rb
+2
-0
lib/api/group_labels.rb
lib/api/group_labels.rb
+2
-0
lib/api/group_milestones.rb
lib/api/group_milestones.rb
+2
-0
lib/api/group_variables.rb
lib/api/group_variables.rb
+2
-0
lib/api/groups.rb
lib/api/groups.rb
+2
-0
lib/gitlab/bitbucket_server_import/importer.rb
lib/gitlab/bitbucket_server_import/importer.rb
+31
-2
spec/crystalball_env.rb
spec/crystalball_env.rb
+1
-1
spec/features/frequently_visited_projects_and_groups_spec.rb
spec/features/frequently_visited_projects_and_groups_spec.rb
+47
-0
spec/features/issues/user_interacts_with_awards_spec.rb
spec/features/issues/user_interacts_with_awards_spec.rb
+1
-1
spec/frontend/diffs/components/collapsed_files_warning_spec.js
...frontend/diffs/components/collapsed_files_warning_spec.js
+4
-3
spec/frontend/diffs/components/diff_file_spec.js
spec/frontend/diffs/components/diff_file_spec.js
+26
-0
spec/frontend/diffs/store/actions_spec.js
spec/frontend/diffs/store/actions_spec.js
+0
-18
spec/frontend/diffs/store/mutations_spec.js
spec/frontend/diffs/store/mutations_spec.js
+0
-15
spec/lib/api/every_api_endpoint_spec.rb
spec/lib/api/every_api_endpoint_spec.rb
+11
-1
spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
+47
-0
No files found.
app/assets/javascripts/boards/components/board_settings_sidebar.vue
View file @
ae832eef
...
@@ -36,6 +36,9 @@ export default {
...
@@ -36,6 +36,9 @@ export default {
computed
:
{
computed
:
{
...
mapGetters
([
'
isSidebarOpen
'
,
'
shouldUseGraphQL
'
]),
...
mapGetters
([
'
isSidebarOpen
'
,
'
shouldUseGraphQL
'
]),
...
mapState
([
'
activeId
'
,
'
sidebarType
'
,
'
boardLists
'
]),
...
mapState
([
'
activeId
'
,
'
sidebarType
'
,
'
boardLists
'
]),
isWipLimitsOn
()
{
return
this
.
glFeatures
.
wipLimits
;
},
activeList
()
{
activeList
()
{
/*
/*
Warning: Though a computed property it is not reactive because we are
Warning: Though a computed property it is not reactive because we are
...
@@ -105,7 +108,10 @@ export default {
...
@@ -105,7 +108,10 @@ export default {
:active-list=
"activeList"
:active-list=
"activeList"
:board-list-type=
"boardListType"
:board-list-type=
"boardListType"
/>
/>
<board-settings-sidebar-wip-limit
:max-issue-count=
"activeList.maxIssueCount"
/>
<board-settings-sidebar-wip-limit
v-if=
"isWipLimitsOn"
:max-issue-count=
"activeList.maxIssueCount"
/>
<div
v-if=
"canAdminList && !activeList.preset && activeList.id"
class=
"gl-m-4"
>
<div
v-if=
"canAdminList && !activeList.preset && activeList.id"
class=
"gl-m-4"
>
<gl-button
<gl-button
variant=
"danger"
variant=
"danger"
...
...
app/assets/javascripts/diffs/components/collapsed_files_warning.vue
View file @
ae832eef
<
script
>
<
script
>
import
{
mapActions
}
from
'
vuex
'
;
import
{
GlAlert
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
CENTERED_LIMITED_CONTAINER_CLASSES
}
from
'
../constants
'
;
import
{
CENTERED_LIMITED_CONTAINER_CLASSES
}
from
'
../constants
'
;
import
eventHub
from
'
../event_hub
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -36,13 +35,12 @@ export default {
...
@@ -36,13 +35,12 @@ export default {
},
},
methods
:
{
methods
:
{
...
mapActions
(
'
diffs
'
,
[
'
expandAllFiles
'
]),
dismiss
()
{
dismiss
()
{
this
.
isDismissed
=
true
;
this
.
isDismissed
=
true
;
this
.
$emit
(
'
dismiss
'
);
this
.
$emit
(
'
dismiss
'
);
},
},
expand
()
{
expand
()
{
this
.
expandAllFiles
(
);
eventHub
.
$emit
(
'
mr:diffs:expandAllFiles
'
);
this
.
dismiss
();
this
.
dismiss
();
},
},
},
},
...
...
app/assets/javascripts/diffs/components/compare_versions.vue
View file @
ae832eef
...
@@ -7,6 +7,7 @@ import CompareDropdownLayout from './compare_dropdown_layout.vue';
...
@@ -7,6 +7,7 @@ import CompareDropdownLayout from './compare_dropdown_layout.vue';
import
SettingsDropdown
from
'
./settings_dropdown.vue
'
;
import
SettingsDropdown
from
'
./settings_dropdown.vue
'
;
import
DiffStats
from
'
./diff_stats.vue
'
;
import
DiffStats
from
'
./diff_stats.vue
'
;
import
{
CENTERED_LIMITED_CONTAINER_CLASSES
}
from
'
../constants
'
;
import
{
CENTERED_LIMITED_CONTAINER_CLASSES
}
from
'
../constants
'
;
import
eventHub
from
'
../event_hub
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -67,9 +68,11 @@ export default {
...
@@ -67,9 +68,11 @@ export default {
...
mapActions
(
'
diffs
'
,
[
...
mapActions
(
'
diffs
'
,
[
'
setInlineDiffViewType
'
,
'
setInlineDiffViewType
'
,
'
setParallelDiffViewType
'
,
'
setParallelDiffViewType
'
,
'
expandAllFiles
'
,
'
toggleShowTreeList
'
,
'
toggleShowTreeList
'
,
]),
]),
expandAllFiles
()
{
eventHub
.
$emit
(
'
mr:diffs:expandAllFiles
'
);
},
},
},
};
};
</
script
>
</
script
>
...
...
app/assets/javascripts/diffs/components/diff_file.vue
View file @
ae832eef
...
@@ -6,13 +6,14 @@ import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
...
@@ -6,13 +6,14 @@ import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import
{
sprintf
}
from
'
~/locale
'
;
import
{
sprintf
}
from
'
~/locale
'
;
import
{
deprecatedCreateFlash
as
createFlash
}
from
'
~/flash
'
;
import
{
deprecatedCreateFlash
as
createFlash
}
from
'
~/flash
'
;
import
{
hasDiff
}
from
'
~/helpers/diffs_helper
'
;
import
{
hasDiff
}
from
'
~/helpers/diffs_helper
'
;
import
e
ventHub
from
'
../../notes/event_hub
'
;
import
notesE
ventHub
from
'
../../notes/event_hub
'
;
import
DiffFileHeader
from
'
./diff_file_header.vue
'
;
import
DiffFileHeader
from
'
./diff_file_header.vue
'
;
import
DiffContent
from
'
./diff_content.vue
'
;
import
DiffContent
from
'
./diff_content.vue
'
;
import
{
diffViewerErrors
}
from
'
~/ide/constants
'
;
import
{
diffViewerErrors
}
from
'
~/ide/constants
'
;
import
{
collapsedType
,
isCollapsed
}
from
'
../diff_file
'
;
import
{
collapsedType
,
isCollapsed
}
from
'
../diff_file
'
;
import
{
DIFF_FILE_AUTOMATIC_COLLAPSE
,
DIFF_FILE_MANUAL_COLLAPSE
}
from
'
../constants
'
;
import
{
DIFF_FILE_AUTOMATIC_COLLAPSE
,
DIFF_FILE_MANUAL_COLLAPSE
}
from
'
../constants
'
;
import
{
DIFF_FILE
,
GENERIC_ERROR
}
from
'
../i18n
'
;
import
{
DIFF_FILE
,
GENERIC_ERROR
}
from
'
../i18n
'
;
import
eventHub
from
'
../event_hub
'
;
export
default
{
export
default
{
components
:
{
components
:
{
...
@@ -151,7 +152,11 @@ export default {
...
@@ -151,7 +152,11 @@ export default {
},
},
},
},
created
()
{
created
()
{
eventHub
.
$on
(
`loadCollapsedDiff/
${
this
.
file
.
file_hash
}
`
,
this
.
requestDiff
);
notesEventHub
.
$on
(
`loadCollapsedDiff/
${
this
.
file
.
file_hash
}
`
,
this
.
requestDiff
);
eventHub
.
$on
(
'
mr:diffs:expandAllFiles
'
,
this
.
expandAllListener
);
},
beforeDestroy
()
{
eventHub
.
$off
(
'
mr:diffs:expandAllFiles
'
,
this
.
expandAllListener
);
},
},
methods
:
{
methods
:
{
...
mapActions
(
'
diffs
'
,
[
...
mapActions
(
'
diffs
'
,
[
...
@@ -160,6 +165,11 @@ export default {
...
@@ -160,6 +165,11 @@ export default {
'
setRenderIt
'
,
'
setRenderIt
'
,
'
setFileCollapsedByUser
'
,
'
setFileCollapsedByUser
'
,
]),
]),
expandAllListener
()
{
if
(
this
.
isCollapsed
)
{
this
.
handleToggle
();
}
},
handleToggle
()
{
handleToggle
()
{
const
currentCollapsedFlag
=
this
.
isCollapsed
;
const
currentCollapsedFlag
=
this
.
isCollapsed
;
...
...
app/assets/javascripts/diffs/event_hub.js
0 → 100644
View file @
ae832eef
import
eventHubFactory
from
'
~/helpers/event_hub_factory
'
;
export
default
eventHubFactory
();
app/assets/javascripts/diffs/store/actions.js
View file @
ae832eef
...
@@ -364,10 +364,6 @@ export const loadCollapsedDiff = ({ commit, getters, state }, file) =>
...
@@ -364,10 +364,6 @@ export const loadCollapsedDiff = ({ commit, getters, state }, file) =>
});
});
});
});
export
const
expandAllFiles
=
({
commit
})
=>
{
commit
(
types
.
EXPAND_ALL_FILES
);
};
/**
/**
* Toggles the file discussions after user clicked on the toggle discussions button.
* Toggles the file discussions after user clicked on the toggle discussions button.
*
*
...
...
app/assets/javascripts/diffs/store/mutation_types.js
View file @
ae832eef
...
@@ -13,7 +13,6 @@ export const SET_MERGE_REQUEST_DIFFS = 'SET_MERGE_REQUEST_DIFFS';
...
@@ -13,7 +13,6 @@ export const SET_MERGE_REQUEST_DIFFS = 'SET_MERGE_REQUEST_DIFFS';
export
const
TOGGLE_LINE_HAS_FORM
=
'
TOGGLE_LINE_HAS_FORM
'
;
export
const
TOGGLE_LINE_HAS_FORM
=
'
TOGGLE_LINE_HAS_FORM
'
;
export
const
ADD_CONTEXT_LINES
=
'
ADD_CONTEXT_LINES
'
;
export
const
ADD_CONTEXT_LINES
=
'
ADD_CONTEXT_LINES
'
;
export
const
ADD_COLLAPSED_DIFFS
=
'
ADD_COLLAPSED_DIFFS
'
;
export
const
ADD_COLLAPSED_DIFFS
=
'
ADD_COLLAPSED_DIFFS
'
;
export
const
EXPAND_ALL_FILES
=
'
EXPAND_ALL_FILES
'
;
export
const
RENDER_FILE
=
'
RENDER_FILE
'
;
export
const
RENDER_FILE
=
'
RENDER_FILE
'
;
export
const
SET_LINE_DISCUSSIONS_FOR_FILE
=
'
SET_LINE_DISCUSSIONS_FOR_FILE
'
;
export
const
SET_LINE_DISCUSSIONS_FOR_FILE
=
'
SET_LINE_DISCUSSIONS_FOR_FILE
'
;
export
const
REMOVE_LINE_DISCUSSIONS_FOR_FILE
=
'
REMOVE_LINE_DISCUSSIONS_FOR_FILE
'
;
export
const
REMOVE_LINE_DISCUSSIONS_FOR_FILE
=
'
REMOVE_LINE_DISCUSSIONS_FOR_FILE
'
;
...
...
app/assets/javascripts/diffs/store/mutations.js
View file @
ae832eef
...
@@ -176,17 +176,6 @@ export default {
...
@@ -176,17 +176,6 @@ export default {
Object
.
assign
(
selectedFile
,
{
...
newFileData
});
Object
.
assign
(
selectedFile
,
{
...
newFileData
});
},
},
[
types
.
EXPAND_ALL_FILES
](
state
)
{
state
.
diffFiles
.
forEach
(
file
=>
{
Object
.
assign
(
file
,
{
viewer
:
Object
.
assign
(
file
.
viewer
,
{
automaticallyCollapsed
:
false
,
manuallyCollapsed
:
false
,
}),
});
});
},
[
types
.
SET_LINE_DISCUSSIONS_FOR_FILE
](
state
,
{
discussion
,
diffPositionByLineCode
,
hash
})
{
[
types
.
SET_LINE_DISCUSSIONS_FOR_FILE
](
state
,
{
discussion
,
diffPositionByLineCode
,
hash
})
{
const
{
latestDiff
}
=
state
;
const
{
latestDiff
}
=
state
;
...
...
app/assets/javascripts/frequent_items/index.js
View file @
ae832eef
...
@@ -16,63 +16,53 @@ const frequentItemDropdowns = [
...
@@ -16,63 +16,53 @@ const frequentItemDropdowns = [
},
},
];
];
const
initFrequentItemList
=
(
namespace
,
key
)
=>
{
const
el
=
document
.
getElementById
(
`js-
${
namespace
}
-dropdown`
);
// Don't do anything if element doesn't exist (No groups dropdown)
// This is for when the user accesses GitLab without logging in
if
(
!
el
)
{
return
;
}
import
(
'
./components/app.vue
'
)
.
then
(({
default
:
FrequentItems
})
=>
{
// eslint-disable-next-line no-new
new
Vue
({
el
,
data
()
{
const
{
dataset
}
=
this
.
$options
.
el
;
const
item
=
{
id
:
Number
(
dataset
[
`
${
key
}
Id`
]),
name
:
dataset
[
`
${
key
}
Name`
],
namespace
:
dataset
[
`
${
key
}
Namespace`
],
webUrl
:
dataset
[
`
${
key
}
WebUrl`
],
avatarUrl
:
dataset
[
`
${
key
}
AvatarUrl`
]
||
null
,
lastAccessedOn
:
Date
.
now
(),
};
return
{
currentUserName
:
dataset
.
userName
,
currentItem
:
item
,
};
},
render
(
createElement
)
{
return
createElement
(
FrequentItems
,
{
props
:
{
namespace
,
currentUserName
:
this
.
currentUserName
,
currentItem
:
this
.
currentItem
,
},
});
},
});
})
.
catch
(()
=>
{});
};
export
default
function
initFrequentItemDropdowns
()
{
export
default
function
initFrequentItemDropdowns
()
{
frequentItemDropdowns
.
forEach
(
dropdown
=>
{
frequentItemDropdowns
.
forEach
(
dropdown
=>
{
const
{
namespace
,
key
}
=
dropdown
;
const
{
namespace
,
key
}
=
dropdown
;
const
el
=
document
.
getElementById
(
`js-
${
namespace
}
-dropdown`
);
const
navEl
=
document
.
getElementById
(
`nav-
${
namespace
}
-dropdown`
);
const
navEl
=
document
.
getElementById
(
`nav-
${
namespace
}
-dropdown`
);
// Don't do anything if element doesn't exist (No groups dropdown)
// Don't do anything if element doesn't exist (No groups dropdown)
// This is for when the user accesses GitLab without logging in
// This is for when the user accesses GitLab without logging in
if
(
!
navEl
)
{
if
(
!
el
||
!
navEl
)
{
return
;
return
;
}
}
import
(
'
./components/app.vue
'
)
.
then
(({
default
:
FrequentItems
})
=>
{
// eslint-disable-next-line no-new
new
Vue
({
el
,
data
()
{
const
{
dataset
}
=
this
.
$options
.
el
;
const
item
=
{
id
:
Number
(
dataset
[
`
${
key
}
Id`
]),
name
:
dataset
[
`
${
key
}
Name`
],
namespace
:
dataset
[
`
${
key
}
Namespace`
],
webUrl
:
dataset
[
`
${
key
}
WebUrl`
],
avatarUrl
:
dataset
[
`
${
key
}
AvatarUrl`
]
||
null
,
lastAccessedOn
:
Date
.
now
(),
};
return
{
currentUserName
:
dataset
.
userName
,
currentItem
:
item
,
};
},
render
(
createElement
)
{
return
createElement
(
FrequentItems
,
{
props
:
{
namespace
,
currentUserName
:
this
.
currentUserName
,
currentItem
:
this
.
currentItem
,
},
});
},
});
})
.
catch
(()
=>
{});
$
(
navEl
).
on
(
'
shown.bs.dropdown
'
,
()
=>
{
$
(
navEl
).
on
(
'
shown.bs.dropdown
'
,
()
=>
{
initFrequentItemList
(
namespace
,
key
);
eventHub
.
$emit
(
`
${
namespace
}
-dropdownOpen`
);
eventHub
.
$emit
(
`
${
namespace
}
-dropdownOpen`
);
});
});
});
});
...
...
changelogs/unreleased/Add-Caching-To-BitBucket-Server-Importer.yml
0 → 100644
View file @
ae832eef
---
title
:
Add Caching to BitBucket Server Import for pull requests
merge_request
:
45790
author
:
Simon Schrottner
type
:
performance
changelogs/unreleased/revert-tz-defer-frequent-item-init.yml
0 → 100644
View file @
ae832eef
---
title
:
Fix tracking of frequently visited projects / groups
merge_request
:
46348
author
:
type
:
fixed
changelogs/unreleased/ss-add-wip-limits-license-check.yml
0 → 100644
View file @
ae832eef
---
title
:
Add licensed check for wip limits
merge_request
:
46387
author
:
type
:
fixed
ee/spec/frontend/boards/components/board_settings_sidebar_spec.js
View file @
ae832eef
...
@@ -22,7 +22,7 @@ describe('ee/BoardSettingsSidebar', () => {
...
@@ -22,7 +22,7 @@ describe('ee/BoardSettingsSidebar', () => {
const
listId
=
1
;
const
listId
=
1
;
let
mock
;
let
mock
;
const
createComponent
=
(
actions
=
{})
=>
{
const
createComponent
=
(
actions
=
{}
,
isWipLimitsOn
=
false
)
=>
{
storeActions
=
actions
;
storeActions
=
actions
;
const
store
=
new
Vuex
.
Store
({
const
store
=
new
Vuex
.
Store
({
...
@@ -34,6 +34,11 @@ describe('ee/BoardSettingsSidebar', () => {
...
@@ -34,6 +34,11 @@ describe('ee/BoardSettingsSidebar', () => {
wrapper
=
shallowMount
(
BoardSettingsSidebar
,
{
wrapper
=
shallowMount
(
BoardSettingsSidebar
,
{
store
,
store
,
localVue
,
localVue
,
provide
:
{
glFeatures
:
{
wipLimits
:
isWipLimitsOn
,
},
},
stubs
:
{
stubs
:
{
'
board-settings-sidebar-wip-limit
'
:
BoardSettingsWipLimit
,
'
board-settings-sidebar-wip-limit
'
:
BoardSettingsWipLimit
,
'
board-settings-list-types
'
:
BoardSettingsListTypes
,
'
board-settings-list-types
'
:
BoardSettingsListTypes
,
...
@@ -59,7 +64,7 @@ describe('ee/BoardSettingsSidebar', () => {
...
@@ -59,7 +64,7 @@ describe('ee/BoardSettingsSidebar', () => {
list_type
:
'
label
'
,
list_type
:
'
label
'
,
});
});
createComponent
();
createComponent
(
{},
true
);
expect
(
wrapper
.
find
(
BoardSettingsWipLimit
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
BoardSettingsWipLimit
).
exists
()).
toBe
(
true
);
});
});
...
...
lib/api/badges.rb
View file @
ae832eef
...
@@ -8,6 +8,8 @@ module API
...
@@ -8,6 +8,8 @@ module API
helpers
::
API
::
Helpers
::
BadgesHelpers
helpers
::
API
::
Helpers
::
BadgesHelpers
feature_category
:continuous_integration
helpers
do
helpers
do
def
find_source_if_admin
(
source_type
)
def
find_source_if_admin
(
source_type
)
source
=
find_source
(
source_type
,
params
[
:id
])
source
=
find_source
(
source_type
,
params
[
:id
])
...
...
lib/api/boards.rb
View file @
ae832eef
...
@@ -9,6 +9,8 @@ module API
...
@@ -9,6 +9,8 @@ module API
before
{
authenticate!
}
before
{
authenticate!
}
feature_category
:boards
helpers
do
helpers
do
def
board_parent
def
board_parent
user_project
user_project
...
...
lib/api/branches.rb
View file @
ae832eef
...
@@ -10,6 +10,8 @@ module API
...
@@ -10,6 +10,8 @@ module API
after_validation
{
content_type
"application/json"
}
after_validation
{
content_type
"application/json"
}
feature_category
:source_code_management
before
do
before
do
require_repository_enabled!
require_repository_enabled!
authorize!
:download_code
,
user_project
authorize!
:download_code
,
user_project
...
...
lib/api/broadcast_messages.rb
View file @
ae832eef
...
@@ -4,6 +4,8 @@ module API
...
@@ -4,6 +4,8 @@ module API
class
BroadcastMessages
<
::
API
::
Base
class
BroadcastMessages
<
::
API
::
Base
include
PaginationParams
include
PaginationParams
feature_category
:navigation
resource
:broadcast_messages
do
resource
:broadcast_messages
do
helpers
do
helpers
do
def
find_message
def
find_message
...
...
lib/api/ci/pipeline_schedules.rb
View file @
ae832eef
...
@@ -7,6 +7,8 @@ module API
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate!
}
before
{
authenticate!
}
feature_category
:continuous_integration
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
...
...
lib/api/ci/pipelines.rb
View file @
ae832eef
...
@@ -7,6 +7,8 @@ module API
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate_non_get!
}
before
{
authenticate_non_get!
}
feature_category
:continuous_integration
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
requires
:id
,
type:
String
,
desc:
'The project ID'
end
end
...
...
lib/api/ci/runner.rb
View file @
ae832eef
...
@@ -7,6 +7,8 @@ module API
...
@@ -7,6 +7,8 @@ module API
content_type
:txt
,
'text/plain'
content_type
:txt
,
'text/plain'
feature_category
:continuous_integration
resource
:runners
do
resource
:runners
do
desc
'Registers a new Runner'
do
desc
'Registers a new Runner'
do
success
Entities
::
RunnerRegistrationDetails
success
Entities
::
RunnerRegistrationDetails
...
...
lib/api/ci/runners.rb
View file @
ae832eef
...
@@ -7,6 +7,8 @@ module API
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate!
}
before
{
authenticate!
}
feature_category
:continuous_integration
resource
:runners
do
resource
:runners
do
desc
'Get runners available for user'
do
desc
'Get runners available for user'
do
success
Entities
::
Runner
success
Entities
::
Runner
...
...
lib/api/commit_statuses.rb
View file @
ae832eef
...
@@ -4,6 +4,8 @@ require 'mime/types'
...
@@ -4,6 +4,8 @@ require 'mime/types'
module
API
module
API
class
CommitStatuses
<
::
API
::
Base
class
CommitStatuses
<
::
API
::
Base
feature_category
:continuous_integration
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
...
...
lib/api/commits.rb
View file @
ae832eef
...
@@ -6,6 +6,8 @@ module API
...
@@ -6,6 +6,8 @@ module API
class
Commits
<
::
API
::
Base
class
Commits
<
::
API
::
Base
include
PaginationParams
include
PaginationParams
feature_category
:source_code_management
before
do
before
do
require_repository_enabled!
require_repository_enabled!
authorize!
:download_code
,
user_project
authorize!
:download_code
,
user_project
...
...
lib/api/container_registry_event.rb
View file @
ae832eef
...
@@ -4,6 +4,8 @@ module API
...
@@ -4,6 +4,8 @@ module API
class
ContainerRegistryEvent
<
::
API
::
Base
class
ContainerRegistryEvent
<
::
API
::
Base
DOCKER_DISTRIBUTION_EVENTS_V1_JSON
=
'application/vnd.docker.distribution.events.v1+json'
DOCKER_DISTRIBUTION_EVENTS_V1_JSON
=
'application/vnd.docker.distribution.events.v1+json'
feature_category
:package_registry
before
{
authenticate_registry_notification!
}
before
{
authenticate_registry_notification!
}
resource
:container_registry_event
do
resource
:container_registry_event
do
...
...
lib/api/deploy_keys.rb
View file @
ae832eef
...
@@ -6,6 +6,8 @@ module API
...
@@ -6,6 +6,8 @@ module API
before
{
authenticate!
}
before
{
authenticate!
}
feature_category
:continuous_delivery
helpers
do
helpers
do
def
add_deploy_keys_project
(
project
,
attrs
=
{})
def
add_deploy_keys_project
(
project
,
attrs
=
{})
project
.
deploy_keys_projects
.
create
(
attrs
)
project
.
deploy_keys_projects
.
create
(
attrs
)
...
...
lib/api/deploy_tokens.rb
View file @
ae832eef
...
@@ -4,6 +4,8 @@ module API
...
@@ -4,6 +4,8 @@ module API
class
DeployTokens
<
::
API
::
Base
class
DeployTokens
<
::
API
::
Base
include
PaginationParams
include
PaginationParams
feature_category
:continuous_delivery
helpers
do
helpers
do
def
scope_params
def
scope_params
scopes
=
params
.
delete
(
:scopes
)
scopes
=
params
.
delete
(
:scopes
)
...
...
lib/api/deployments.rb
View file @
ae832eef
...
@@ -7,6 +7,8 @@ module API
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate!
}
before
{
authenticate!
}
feature_category
:continuous_delivery
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
requires
:id
,
type:
String
,
desc:
'The project ID'
end
end
...
...
lib/api/environments.rb
View file @
ae832eef
...
@@ -7,6 +7,8 @@ module API
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate!
}
before
{
authenticate!
}
feature_category
:continuous_delivery
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
requires
:id
,
type:
String
,
desc:
'The project ID'
end
end
...
...
lib/api/error_tracking.rb
View file @
ae832eef
...
@@ -4,6 +4,8 @@ module API
...
@@ -4,6 +4,8 @@ module API
class
ErrorTracking
<
::
API
::
Base
class
ErrorTracking
<
::
API
::
Base
before
{
authenticate!
}
before
{
authenticate!
}
feature_category
:error_tracking
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
...
...
lib/api/events.rb
View file @
ae832eef
...
@@ -8,6 +8,8 @@ module API
...
@@ -8,6 +8,8 @@ module API
allow_access_with_scope
:read_user
,
if:
->
(
request
)
{
request
.
get?
}
allow_access_with_scope
:read_user
,
if:
->
(
request
)
{
request
.
get?
}
feature_category
:users
resource
:events
do
resource
:events
do
desc
"List currently authenticated user's events"
do
desc
"List currently authenticated user's events"
do
detail
'This feature was introduced in GitLab 9.3.'
detail
'This feature was introduced in GitLab 9.3.'
...
...
lib/api/feature_flag_scopes.rb
View file @
ae832eef
...
@@ -7,6 +7,8 @@ module API
...
@@ -7,6 +7,8 @@ module API
ENVIRONMENT_SCOPE_ENDPOINT_REQUIREMENTS
=
FeatureFlags
::
FEATURE_FLAG_ENDPOINT_REQUIREMENTS
ENVIRONMENT_SCOPE_ENDPOINT_REQUIREMENTS
=
FeatureFlags
::
FEATURE_FLAG_ENDPOINT_REQUIREMENTS
.
merge
(
environment_scope:
API
::
NO_SLASH_URL_PART_REGEX
)
.
merge
(
environment_scope:
API
::
NO_SLASH_URL_PART_REGEX
)
feature_category
:feature_flags
before
do
before
do
authorize_read_feature_flags!
authorize_read_feature_flags!
end
end
...
...
lib/api/feature_flags.rb
View file @
ae832eef
...
@@ -7,6 +7,8 @@ module API
...
@@ -7,6 +7,8 @@ module API
FEATURE_FLAG_ENDPOINT_REQUIREMENTS
=
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
FEATURE_FLAG_ENDPOINT_REQUIREMENTS
=
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
.
merge
(
name:
API
::
NO_SLASH_URL_PART_REGEX
)
.
merge
(
name:
API
::
NO_SLASH_URL_PART_REGEX
)
feature_category
:feature_flags
before
do
before
do
authorize_read_feature_flags!
authorize_read_feature_flags!
end
end
...
...
lib/api/feature_flags_user_lists.rb
View file @
ae832eef
...
@@ -8,6 +8,8 @@ module API
...
@@ -8,6 +8,8 @@ module API
message
.
is_a?
(
String
)
?
{
message:
message
}.
to_json
:
message
.
to_json
message
.
is_a?
(
String
)
?
{
message:
message
}.
to_json
:
message
.
to_json
}
}
feature_category
:feature_flags
before
do
before
do
authorize_admin_feature_flags_user_lists!
authorize_admin_feature_flags_user_lists!
end
end
...
...
lib/api/features.rb
View file @
ae832eef
...
@@ -4,6 +4,8 @@ module API
...
@@ -4,6 +4,8 @@ module API
class
Features
<
::
API
::
Base
class
Features
<
::
API
::
Base
before
{
authenticated_as_admin!
}
before
{
authenticated_as_admin!
}
feature_category
:feature_flags
helpers
do
helpers
do
def
gate_value
(
params
)
def
gate_value
(
params
)
case
params
[
:value
]
case
params
[
:value
]
...
...
lib/api/files.rb
View file @
ae832eef
...
@@ -9,6 +9,8 @@ module API
...
@@ -9,6 +9,8 @@ module API
# Prevents returning plain/text responses for files with .txt extension
# Prevents returning plain/text responses for files with .txt extension
after_validation
{
content_type
"application/json"
}
after_validation
{
content_type
"application/json"
}
feature_category
:source_code_management
helpers
::
API
::
Helpers
::
HeadersHelpers
helpers
::
API
::
Helpers
::
HeadersHelpers
helpers
do
helpers
do
...
...
lib/api/freeze_periods.rb
View file @
ae832eef
...
@@ -6,6 +6,8 @@ module API
...
@@ -6,6 +6,8 @@ module API
before
{
authenticate!
}
before
{
authenticate!
}
feature_category
:continuous_delivery
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
end
...
...
lib/api/group_boards.rb
View file @
ae832eef
...
@@ -7,6 +7,8 @@ module API
...
@@ -7,6 +7,8 @@ module API
prepend_if_ee
(
'EE::API::BoardsResponses'
)
# rubocop: disable Cop/InjectEnterpriseEditionModule
prepend_if_ee
(
'EE::API::BoardsResponses'
)
# rubocop: disable Cop/InjectEnterpriseEditionModule
feature_category
:boards
before
do
before
do
authenticate!
authenticate!
end
end
...
...
lib/api/group_clusters.rb
View file @
ae832eef
...
@@ -6,6 +6,8 @@ module API
...
@@ -6,6 +6,8 @@ module API
before
{
authenticate!
}
before
{
authenticate!
}
feature_category
:kubernetes_management
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of the group'
requires
:id
,
type:
String
,
desc:
'The ID of the group'
end
end
...
...
lib/api/group_container_repositories.rb
View file @
ae832eef
...
@@ -8,6 +8,8 @@ module API
...
@@ -8,6 +8,8 @@ module API
before
{
authorize_read_group_container_images!
}
before
{
authorize_read_group_container_images!
}
feature_category
:package_registry
REPOSITORY_ENDPOINT_REQUIREMENTS
=
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
.
merge
(
REPOSITORY_ENDPOINT_REQUIREMENTS
=
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
.
merge
(
tag_name:
API
::
NO_SLASH_URL_PART_REGEX
)
tag_name:
API
::
NO_SLASH_URL_PART_REGEX
)
...
...
lib/api/group_export.rb
View file @
ae832eef
...
@@ -10,6 +10,8 @@ module API
...
@@ -10,6 +10,8 @@ module API
authorize!
:admin_group
,
user_group
authorize!
:admin_group
,
user_group
end
end
feature_category
:importers
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
end
...
...
lib/api/group_import.rb
View file @
ae832eef
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
module
API
module
API
class
GroupImport
<
::
API
::
Base
class
GroupImport
<
::
API
::
Base
feature_category
:importers
helpers
Helpers
::
FileUploadHelpers
helpers
Helpers
::
FileUploadHelpers
helpers
do
helpers
do
...
...
lib/api/group_labels.rb
View file @
ae832eef
...
@@ -7,6 +7,8 @@ module API
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate!
}
before
{
authenticate!
}
feature_category
:issue_tracking
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
end
...
...
lib/api/group_milestones.rb
View file @
ae832eef
...
@@ -7,6 +7,8 @@ module API
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate!
}
before
{
authenticate!
}
feature_category
:issue_tracking
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
end
...
...
lib/api/group_variables.rb
View file @
ae832eef
...
@@ -7,6 +7,8 @@ module API
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate!
}
before
{
authenticate!
}
before
{
authorize!
:admin_build
,
user_group
}
before
{
authorize!
:admin_build
,
user_group
}
feature_category
:continuous_integration
params
do
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
end
...
...
lib/api/groups.rb
View file @
ae832eef
...
@@ -7,6 +7,8 @@ module API
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate_non_get!
}
before
{
authenticate_non_get!
}
feature_category
:subgroups
helpers
Helpers
::
GroupsHelpers
helpers
Helpers
::
GroupsHelpers
helpers
do
helpers
do
...
...
lib/gitlab/bitbucket_server_import/importer.rb
View file @
ae832eef
...
@@ -4,11 +4,14 @@ module Gitlab
...
@@ -4,11 +4,14 @@ module Gitlab
module
BitbucketServerImport
module
BitbucketServerImport
class
Importer
class
Importer
attr_reader
:recover_missing_commits
attr_reader
:recover_missing_commits
attr_reader
:project
,
:project_key
,
:repository_slug
,
:client
,
:errors
,
:users
attr_reader
:project
,
:project_key
,
:repository_slug
,
:client
,
:errors
,
:users
,
:already_imported_cache_key
attr_accessor
:logger
attr_accessor
:logger
REMOTE_NAME
=
'bitbucket_server'
REMOTE_NAME
=
'bitbucket_server'
BATCH_SIZE
=
100
BATCH_SIZE
=
100
# The base cache key to use for tracking already imported objects.
ALREADY_IMPORTED_CACHE_KEY
=
'bitbucket_server-importer/already-imported/%{project}/%{collection}'
TempBranch
=
Struct
.
new
(
:name
,
:sha
)
TempBranch
=
Struct
.
new
(
:name
,
:sha
)
...
@@ -36,6 +39,12 @@ module Gitlab
...
@@ -36,6 +39,12 @@ module Gitlab
@users
=
{}
@users
=
{}
@temp_branches
=
[]
@temp_branches
=
[]
@logger
=
Gitlab
::
Import
::
Logger
.
build
@logger
=
Gitlab
::
Import
::
Logger
.
build
@already_imported_cache_key
=
ALREADY_IMPORTED_CACHE_KEY
%
{
project:
project
.
id
,
collection:
collection_method
}
end
def
collection_method
:pull_requests
end
end
def
execute
def
execute
...
@@ -48,6 +57,7 @@ module Gitlab
...
@@ -48,6 +57,7 @@ module Gitlab
log_info
(
stage:
"complete"
)
log_info
(
stage:
"complete"
)
Gitlab
::
Cache
::
Import
::
Caching
.
expire
(
already_imported_cache_key
,
15
.
minutes
.
to_i
)
true
true
end
end
...
@@ -167,6 +177,7 @@ module Gitlab
...
@@ -167,6 +177,7 @@ module Gitlab
# on the remote server. Then we have to issue a `git fetch` to download these
# on the remote server. Then we have to issue a `git fetch` to download these
# branches.
# branches.
def
import_pull_requests
def
import_pull_requests
log_info
(
stage:
'import_pull_requests'
,
message:
'starting'
)
pull_requests
=
client
.
pull_requests
(
project_key
,
repository_slug
).
to_a
pull_requests
=
client
.
pull_requests
(
project_key
,
repository_slug
).
to_a
# Creating branches on the server and fetching the newly-created branches
# Creating branches on the server and fetching the newly-created branches
...
@@ -176,7 +187,11 @@ module Gitlab
...
@@ -176,7 +187,11 @@ module Gitlab
restore_branches
(
batch
)
if
recover_missing_commits
restore_branches
(
batch
)
if
recover_missing_commits
batch
.
each
do
|
pull_request
|
batch
.
each
do
|
pull_request
|
import_bitbucket_pull_request
(
pull_request
)
if
already_imported?
(
pull_request
)
log_info
(
stage:
'import_pull_requests'
,
message:
'already imported'
,
iid:
pull_request
.
iid
)
else
import_bitbucket_pull_request
(
pull_request
)
end
rescue
StandardError
=>
e
rescue
StandardError
=>
e
Gitlab
::
ErrorTracking
.
log_exception
(
Gitlab
::
ErrorTracking
.
log_exception
(
e
,
e
,
...
@@ -189,6 +204,19 @@ module Gitlab
...
@@ -189,6 +204,19 @@ module Gitlab
end
end
end
end
# Returns true if the given object has already been imported, false
# otherwise.
#
# object - The object to check.
def
already_imported?
(
pull_request
)
Gitlab
::
Cache
::
Import
::
Caching
.
set_includes?
(
already_imported_cache_key
,
pull_request
.
iid
)
end
# Marks the given object as "already imported".
def
mark_as_imported
(
pull_request
)
Gitlab
::
Cache
::
Import
::
Caching
.
set_add
(
already_imported_cache_key
,
pull_request
.
iid
)
end
def
delete_temp_branches
def
delete_temp_branches
@temp_branches
.
each
do
|
branch
|
@temp_branches
.
each
do
|
branch
|
client
.
delete_branch
(
project_key
,
repository_slug
,
branch
.
name
,
branch
.
sha
)
client
.
delete_branch
(
project_key
,
repository_slug
,
branch
.
name
,
branch
.
sha
)
...
@@ -236,6 +264,7 @@ module Gitlab
...
@@ -236,6 +264,7 @@ module Gitlab
end
end
log_info
(
stage:
'import_bitbucket_pull_requests'
,
message:
'finished'
,
iid:
pull_request
.
iid
)
log_info
(
stage:
'import_bitbucket_pull_requests'
,
message:
'finished'
,
iid:
pull_request
.
iid
)
mark_as_imported
(
pull_request
)
end
end
def
import_pull_request_comments
(
pull_request
,
merge_request
)
def
import_pull_request_comments
(
pull_request
,
merge_request
)
...
...
spec/crystalball_env.rb
View file @
ae832eef
...
@@ -6,7 +6,7 @@ module CrystalballEnv
...
@@ -6,7 +6,7 @@ module CrystalballEnv
extend
self
extend
self
def
start!
def
start!
return
unless
ENV
[
'CRYSTALBALL'
]
&&
ENV
[
'CI_PIPELINE_SOURCE'
]
==
'schedule'
return
unless
ENV
[
'CRYSTALBALL'
]
&&
ENV
[
'CI_PIPELINE_SOURCE'
]
==
'schedule'
&&
ENV
[
'FREQUENCY'
]
==
'2-hourly'
require
'crystalball'
require
'crystalball'
require_relative
'../tooling/lib/tooling/crystalball/coverage_lines_execution_detector'
require_relative
'../tooling/lib/tooling/crystalball/coverage_lines_execution_detector'
...
...
spec/features/frequently_visited_projects_and_groups_spec.rb
0 → 100644
View file @
ae832eef
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'Frequently visited items'
,
:js
do
let_it_be
(
:user
)
{
create
(
:user
)
}
before
do
sign_in
(
user
)
end
context
'for projects'
do
let_it_be
(
:project
)
{
create
(
:project
,
:public
)
}
it
'increments localStorage counter when visiting the project'
do
visit
project_path
(
project
)
frequent_projects
=
nil
wait_for
(
'localStorage frequent-projects'
)
do
frequent_projects
=
page
.
evaluate_script
(
"localStorage['
#{
user
.
username
}
/frequent-projects']"
)
frequent_projects
.
present?
end
expect
(
Gitlab
::
Json
.
parse
(
frequent_projects
)).
to
contain_exactly
(
a_hash_including
(
'id'
=>
project
.
id
,
'frequency'
=>
1
))
end
end
context
'for groups'
do
let_it_be
(
:group
)
{
create
(
:group
,
:public
)
}
it
'increments localStorage counter when visiting the group'
do
visit
group_path
(
group
)
frequent_groups
=
nil
wait_for
(
'localStorage frequent-groups'
)
do
frequent_groups
=
page
.
evaluate_script
(
"localStorage['
#{
user
.
username
}
/frequent-groups']"
)
frequent_groups
.
present?
end
expect
(
Gitlab
::
Json
.
parse
(
frequent_groups
)).
to
contain_exactly
(
a_hash_including
(
'id'
=>
group
.
id
,
'frequency'
=>
1
))
end
end
end
spec/features/issues/user_interacts_with_awards_spec.rb
View file @
ae832eef
...
@@ -294,7 +294,7 @@ RSpec.describe 'User interacts with awards' do
...
@@ -294,7 +294,7 @@ RSpec.describe 'User interacts with awards' do
end
end
end
end
it
'toggles the smiley emoji on a note'
,
:js
do
it
'toggles the smiley emoji on a note'
,
:js
,
quarantine:
'https://gitlab.com/gitlab-org/gitlab/-/issues/267525'
do
toggle_smiley_emoji
(
true
)
toggle_smiley_emoji
(
true
)
within
(
'.note-body'
)
do
within
(
'.note-body'
)
do
...
...
spec/frontend/diffs/components/collapsed_files_warning_spec.js
View file @
ae832eef
...
@@ -3,6 +3,7 @@ import { shallowMount, mount, createLocalVue } from '@vue/test-utils';
...
@@ -3,6 +3,7 @@ import { shallowMount, mount, createLocalVue } from '@vue/test-utils';
import
createStore
from
'
~/diffs/store/modules
'
;
import
createStore
from
'
~/diffs/store/modules
'
;
import
CollapsedFilesWarning
from
'
~/diffs/components/collapsed_files_warning.vue
'
;
import
CollapsedFilesWarning
from
'
~/diffs/components/collapsed_files_warning.vue
'
;
import
{
CENTERED_LIMITED_CONTAINER_CLASSES
}
from
'
~/diffs/constants
'
;
import
{
CENTERED_LIMITED_CONTAINER_CLASSES
}
from
'
~/diffs/constants
'
;
import
eventHub
from
'
~/diffs/event_hub
'
;
const
propsData
=
{
const
propsData
=
{
limited
:
true
,
limited
:
true
,
...
@@ -76,13 +77,13 @@ describe('CollapsedFilesWarning', () => {
...
@@ -76,13 +77,13 @@ describe('CollapsedFilesWarning', () => {
expect
(
wrapper
.
find
(
'
[data-testid="root"]
'
).
exists
()).
toBe
(
false
);
expect
(
wrapper
.
find
(
'
[data-testid="root"]
'
).
exists
()).
toBe
(
false
);
});
});
it
(
'
triggers the expandAllFiles action
when the alert action button is clicked
'
,
()
=>
{
it
(
'
emits the `mr:diffs:expandAllFiles` event
when the alert action button is clicked
'
,
()
=>
{
createComponent
({},
{
full
:
true
});
createComponent
({},
{
full
:
true
});
jest
.
spyOn
(
wrapper
.
vm
.
$store
,
'
dispatch
'
).
mockReturnValue
(
undefined
);
jest
.
spyOn
(
eventHub
,
'
$emit
'
);
getAlertActionButton
().
vm
.
$emit
(
'
click
'
);
getAlertActionButton
().
vm
.
$emit
(
'
click
'
);
expect
(
wrapper
.
vm
.
$store
.
dispatch
).
toHaveBeenCalledWith
(
'
diffs/expandAllFiles
'
,
undefined
);
expect
(
eventHub
.
$emit
).
toHaveBeenCalledWith
(
'
mr:diffs:expandAllFiles
'
);
});
});
});
});
spec/frontend/diffs/components/diff_file_spec.js
View file @
ae832eef
...
@@ -9,6 +9,8 @@ import DiffFileComponent from '~/diffs/components/diff_file.vue';
...
@@ -9,6 +9,8 @@ import DiffFileComponent from '~/diffs/components/diff_file.vue';
import
DiffFileHeaderComponent
from
'
~/diffs/components/diff_file_header.vue
'
;
import
DiffFileHeaderComponent
from
'
~/diffs/components/diff_file_header.vue
'
;
import
DiffContentComponent
from
'
~/diffs/components/diff_content.vue
'
;
import
DiffContentComponent
from
'
~/diffs/components/diff_content.vue
'
;
import
eventHub
from
'
~/diffs/event_hub
'
;
import
{
diffViewerModes
,
diffViewerErrors
}
from
'
~/ide/constants
'
;
import
{
diffViewerModes
,
diffViewerErrors
}
from
'
~/ide/constants
'
;
function
changeViewer
(
store
,
index
,
{
automaticallyCollapsed
,
manuallyCollapsed
,
name
})
{
function
changeViewer
(
store
,
index
,
{
automaticallyCollapsed
,
manuallyCollapsed
,
name
})
{
...
@@ -138,6 +140,30 @@ describe('DiffFile', () => {
...
@@ -138,6 +140,30 @@ describe('DiffFile', () => {
});
});
describe
(
'
collapsing
'
,
()
=>
{
describe
(
'
collapsing
'
,
()
=>
{
describe
(
'
`mr:diffs:expandAllFiles` event
'
,
()
=>
{
beforeEach
(()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
handleToggle
'
).
mockImplementation
(()
=>
{});
});
it
(
'
performs the normal file toggle when the file is collapsed
'
,
async
()
=>
{
makeFileAutomaticallyCollapsed
(
store
);
await
wrapper
.
vm
.
$nextTick
();
eventHub
.
$emit
(
'
mr:diffs:expandAllFiles
'
);
expect
(
wrapper
.
vm
.
handleToggle
).
toHaveBeenCalledTimes
(
1
);
});
it
(
'
does nothing when the file is not collapsed
'
,
async
()
=>
{
eventHub
.
$emit
(
'
mr:diffs:expandAllFiles
'
);
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
vm
.
handleToggle
).
not
.
toHaveBeenCalled
();
});
});
describe
(
'
user collapsed
'
,
()
=>
{
describe
(
'
user collapsed
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
makeFileManuallyCollapsed
(
store
);
makeFileManuallyCollapsed
(
store
);
...
...
spec/frontend/diffs/store/actions_spec.js
View file @
ae832eef
...
@@ -27,7 +27,6 @@ import {
...
@@ -27,7 +27,6 @@ import {
scrollToLineIfNeededInline
,
scrollToLineIfNeededInline
,
scrollToLineIfNeededParallel
,
scrollToLineIfNeededParallel
,
loadCollapsedDiff
,
loadCollapsedDiff
,
expandAllFiles
,
toggleFileDiscussions
,
toggleFileDiscussions
,
saveDiffDiscussion
,
saveDiffDiscussion
,
setHighlightedRow
,
setHighlightedRow
,
...
@@ -658,23 +657,6 @@ describe('DiffsStoreActions', () => {
...
@@ -658,23 +657,6 @@ describe('DiffsStoreActions', () => {
});
});
});
});
describe
(
'
expandAllFiles
'
,
()
=>
{
it
(
'
should change the collapsed prop from the diffFiles
'
,
done
=>
{
testAction
(
expandAllFiles
,
null
,
{},
[
{
type
:
types
.
EXPAND_ALL_FILES
,
},
],
[],
done
,
);
});
});
describe
(
'
toggleFileDiscussions
'
,
()
=>
{
describe
(
'
toggleFileDiscussions
'
,
()
=>
{
it
(
'
should dispatch collapseDiscussion when all discussions are expanded
'
,
()
=>
{
it
(
'
should dispatch collapseDiscussion when all discussions are expanded
'
,
()
=>
{
const
getters
=
{
const
getters
=
{
...
...
spec/frontend/diffs/store/mutations_spec.js
View file @
ae832eef
...
@@ -126,21 +126,6 @@ describe('DiffsStoreMutations', () => {
...
@@ -126,21 +126,6 @@ describe('DiffsStoreMutations', () => {
});
});
});
});
describe
(
'
EXPAND_ALL_FILES
'
,
()
=>
{
it
(
'
should change the collapsed prop from diffFiles
'
,
()
=>
{
const
diffFile
=
{
viewer
:
{
automaticallyCollapsed
:
true
,
},
};
const
state
=
{
expandAllFiles
:
true
,
diffFiles
:
[
diffFile
]
};
mutations
[
types
.
EXPAND_ALL_FILES
](
state
);
expect
(
state
.
diffFiles
[
0
].
viewer
.
automaticallyCollapsed
).
toEqual
(
false
);
});
});
describe
(
'
ADD_CONTEXT_LINES
'
,
()
=>
{
describe
(
'
ADD_CONTEXT_LINES
'
,
()
=>
{
it
(
'
should call utils.addContextLines with proper params
'
,
()
=>
{
it
(
'
should call utils.addContextLines with proper params
'
,
()
=>
{
const
options
=
{
const
options
=
{
...
...
spec/lib/api/every_api_endpoint_spec.rb
View file @
ae832eef
...
@@ -22,7 +22,17 @@ RSpec.describe 'Every API endpoint' do
...
@@ -22,7 +22,17 @@ RSpec.describe 'Every API endpoint' do
completed_classes
=
[
completed_classes
=
[
::
API
::
Users
,
::
API
::
Issues
,
::
API
::
AccessRequests
,
::
API
::
Admin
::
Ci
::
Variables
,
::
API
::
Users
,
::
API
::
Issues
,
::
API
::
AccessRequests
,
::
API
::
Admin
::
Ci
::
Variables
,
::
API
::
Admin
::
InstanceClusters
,
::
API
::
Admin
::
Sidekiq
,
::
API
::
Appearance
,
::
API
::
Admin
::
InstanceClusters
,
::
API
::
Admin
::
Sidekiq
,
::
API
::
Appearance
,
::
API
::
Applications
,
::
API
::
Avatar
,
::
API
::
AwardEmoji
::
API
::
Applications
,
::
API
::
Avatar
,
::
API
::
AwardEmoji
,
API
::
Badges
,
::
API
::
Boards
,
::
API
::
Branches
,
::
API
::
BroadcastMessages
,
::
API
::
Ci
::
Pipelines
,
::
API
::
Ci
::
PipelineSchedules
,
::
API
::
Ci
::
Runners
,
::
API
::
Ci
::
Runner
,
::
API
::
Commits
,
::
API
::
CommitStatuses
,
::
API
::
ContainerRegistryEvent
,
::
API
::
DeployKeys
,
::
API
::
DeployTokens
,
::
API
::
Deployments
,
::
API
::
Environments
,
::
API
::
ErrorTracking
,
::
API
::
Events
,
::
API
::
FeatureFlags
,
::
API
::
FeatureFlagScopes
,
::
API
::
FeatureFlagsUserLists
,
::
API
::
Features
,
::
API
::
Files
,
::
API
::
FreezePeriods
,
::
API
::
GroupBoards
,
::
API
::
GroupClusters
,
::
API
::
GroupExport
,
::
API
::
GroupImport
,
::
API
::
GroupLabels
,
::
API
::
GroupMilestones
,
::
API
::
Groups
,
::
API
::
GroupContainerRepositories
,
::
API
::
GroupVariables
]
]
next
unless
completed_classes
.
include?
(
klass
)
next
unless
completed_classes
.
include?
(
klass
)
...
...
spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
View file @
ae832eef
...
@@ -115,6 +115,12 @@ RSpec.describe Gitlab::BitbucketServerImport::Importer do
...
@@ -115,6 +115,12 @@ RSpec.describe Gitlab::BitbucketServerImport::Importer do
allow
(
subject
.
client
).
to
receive
(
:pull_requests
).
and_return
([
pull_request
])
allow
(
subject
.
client
).
to
receive
(
:pull_requests
).
and_return
([
pull_request
])
end
end
# As we are using Caching with redis, it is best to clean the cache after each test run, else we need to wait for
# the expiration by the importer
after
do
Gitlab
::
Cache
::
Import
::
Caching
.
expire
(
subject
.
already_imported_cache_key
,
0
)
end
it
'imports merge event'
do
it
'imports merge event'
do
expect
(
subject
.
client
).
to
receive
(
:activities
).
and_return
([
merge_event
])
expect
(
subject
.
client
).
to
receive
(
:activities
).
and_return
([
merge_event
])
...
@@ -463,6 +469,47 @@ RSpec.describe Gitlab::BitbucketServerImport::Importer do
...
@@ -463,6 +469,47 @@ RSpec.describe Gitlab::BitbucketServerImport::Importer do
subject
.
execute
subject
.
execute
end
end
describe
'import pull requests with caching'
do
let
(
:pull_request_already_imported
)
do
instance_double
(
BitbucketServer
::
Representation
::
PullRequest
,
iid:
11
)
end
let
(
:pull_request_to_be_imported
)
do
instance_double
(
BitbucketServer
::
Representation
::
PullRequest
,
iid:
12
,
source_branch_sha:
sample
.
commits
.
last
,
source_branch_name:
Gitlab
::
Git
::
BRANCH_REF_PREFIX
+
sample
.
source_branch
,
target_branch_sha:
sample
.
commits
.
first
,
target_branch_name:
Gitlab
::
Git
::
BRANCH_REF_PREFIX
+
sample
.
target_branch
,
title:
'This is a title'
,
description:
'This is a test pull request'
,
state:
'merged'
,
author:
'Test Author'
,
author_email:
pull_request_author
.
email
,
author_username:
pull_request_author
.
username
,
created_at:
Time
.
now
,
updated_at:
Time
.
now
,
raw:
{},
merged?:
true
)
end
before
do
Gitlab
::
Cache
::
Import
::
Caching
.
set_add
(
subject
.
already_imported_cache_key
,
pull_request_already_imported
.
iid
)
allow
(
subject
.
client
).
to
receive
(
:pull_requests
).
and_return
([
pull_request_to_be_imported
,
pull_request_already_imported
])
end
it
'only imports one Merge Request, as the other on is in the cache'
do
expect
(
subject
.
client
).
to
receive
(
:activities
).
and_return
([
merge_event
])
expect
{
subject
.
execute
}.
to
change
{
MergeRequest
.
count
}.
by
(
1
)
expect
(
Gitlab
::
Cache
::
Import
::
Caching
.
set_includes?
(
subject
.
already_imported_cache_key
,
pull_request_already_imported
.
iid
)).
to
eq
(
true
)
expect
(
Gitlab
::
Cache
::
Import
::
Caching
.
set_includes?
(
subject
.
already_imported_cache_key
,
pull_request_to_be_imported
.
iid
)).
to
eq
(
true
)
end
end
end
end
describe
'inaccessible branches'
do
describe
'inaccessible branches'
do
...
...
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