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
Show 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 {
computed
:
{
...
mapGetters
([
'
isSidebarOpen
'
,
'
shouldUseGraphQL
'
]),
...
mapState
([
'
activeId
'
,
'
sidebarType
'
,
'
boardLists
'
]),
isWipLimitsOn
()
{
return
this
.
glFeatures
.
wipLimits
;
},
activeList
()
{
/*
Warning: Though a computed property it is not reactive because we are
...
...
@@ -105,7 +108,10 @@ export default {
:active-list=
"activeList"
: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"
>
<gl-button
variant=
"danger"
...
...
app/assets/javascripts/diffs/components/collapsed_files_warning.vue
View file @
ae832eef
<
script
>
import
{
mapActions
}
from
'
vuex
'
;
import
{
GlAlert
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
CENTERED_LIMITED_CONTAINER_CLASSES
}
from
'
../constants
'
;
import
eventHub
from
'
../event_hub
'
;
export
default
{
components
:
{
...
...
@@ -36,13 +35,12 @@ export default {
},
methods
:
{
...
mapActions
(
'
diffs
'
,
[
'
expandAllFiles
'
]),
dismiss
()
{
this
.
isDismissed
=
true
;
this
.
$emit
(
'
dismiss
'
);
},
expand
()
{
this
.
expandAllFiles
(
);
eventHub
.
$emit
(
'
mr:diffs:expandAllFiles
'
);
this
.
dismiss
();
},
},
...
...
app/assets/javascripts/diffs/components/compare_versions.vue
View file @
ae832eef
...
...
@@ -7,6 +7,7 @@ import CompareDropdownLayout from './compare_dropdown_layout.vue';
import
SettingsDropdown
from
'
./settings_dropdown.vue
'
;
import
DiffStats
from
'
./diff_stats.vue
'
;
import
{
CENTERED_LIMITED_CONTAINER_CLASSES
}
from
'
../constants
'
;
import
eventHub
from
'
../event_hub
'
;
export
default
{
components
:
{
...
...
@@ -67,9 +68,11 @@ export default {
...
mapActions
(
'
diffs
'
,
[
'
setInlineDiffViewType
'
,
'
setParallelDiffViewType
'
,
'
expandAllFiles
'
,
'
toggleShowTreeList
'
,
]),
expandAllFiles
()
{
eventHub
.
$emit
(
'
mr:diffs:expandAllFiles
'
);
},
},
};
</
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';
import
{
sprintf
}
from
'
~/locale
'
;
import
{
deprecatedCreateFlash
as
createFlash
}
from
'
~/flash
'
;
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
DiffContent
from
'
./diff_content.vue
'
;
import
{
diffViewerErrors
}
from
'
~/ide/constants
'
;
import
{
collapsedType
,
isCollapsed
}
from
'
../diff_file
'
;
import
{
DIFF_FILE_AUTOMATIC_COLLAPSE
,
DIFF_FILE_MANUAL_COLLAPSE
}
from
'
../constants
'
;
import
{
DIFF_FILE
,
GENERIC_ERROR
}
from
'
../i18n
'
;
import
eventHub
from
'
../event_hub
'
;
export
default
{
components
:
{
...
...
@@ -151,7 +152,11 @@ export default {
},
},
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
:
{
...
mapActions
(
'
diffs
'
,
[
...
...
@@ -160,6 +165,11 @@ export default {
'
setRenderIt
'
,
'
setFileCollapsedByUser
'
,
]),
expandAllListener
()
{
if
(
this
.
isCollapsed
)
{
this
.
handleToggle
();
}
},
handleToggle
()
{
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) =>
});
});
export
const
expandAllFiles
=
({
commit
})
=>
{
commit
(
types
.
EXPAND_ALL_FILES
);
};
/**
* 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';
export
const
TOGGLE_LINE_HAS_FORM
=
'
TOGGLE_LINE_HAS_FORM
'
;
export
const
ADD_CONTEXT_LINES
=
'
ADD_CONTEXT_LINES
'
;
export
const
ADD_COLLAPSED_DIFFS
=
'
ADD_COLLAPSED_DIFFS
'
;
export
const
EXPAND_ALL_FILES
=
'
EXPAND_ALL_FILES
'
;
export
const
RENDER_FILE
=
'
RENDER_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
'
;
...
...
app/assets/javascripts/diffs/store/mutations.js
View file @
ae832eef
...
...
@@ -176,17 +176,6 @@ export default {
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
})
{
const
{
latestDiff
}
=
state
;
...
...
app/assets/javascripts/frequent_items/index.js
View file @
ae832eef
...
...
@@ -16,12 +16,15 @@ const frequentItemDropdowns = [
},
];
const
initFrequentItemList
=
(
namespace
,
key
)
=>
{
export
default
function
initFrequentItemDropdowns
()
{
frequentItemDropdowns
.
forEach
(
dropdown
=>
{
const
{
namespace
,
key
}
=
dropdown
;
const
el
=
document
.
getElementById
(
`js-
${
namespace
}
-dropdown`
);
const
navEl
=
document
.
getElementById
(
`nav-
${
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
(
!
e
l
)
{
if
(
!
el
||
!
navE
l
)
{
return
;
}
...
...
@@ -58,21 +61,8 @@ const initFrequentItemList = (namespace, key) => {
});
})
.
catch
(()
=>
{});
};
export
default
function
initFrequentItemDropdowns
()
{
frequentItemDropdowns
.
forEach
(
dropdown
=>
{
const
{
namespace
,
key
}
=
dropdown
;
const
navEl
=
document
.
getElementById
(
`nav-
${
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
(
!
navEl
)
{
return
;
}
$
(
navEl
).
on
(
'
shown.bs.dropdown
'
,
()
=>
{
initFrequentItemList
(
namespace
,
key
);
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', () => {
const
listId
=
1
;
let
mock
;
const
createComponent
=
(
actions
=
{})
=>
{
const
createComponent
=
(
actions
=
{}
,
isWipLimitsOn
=
false
)
=>
{
storeActions
=
actions
;
const
store
=
new
Vuex
.
Store
({
...
...
@@ -34,6 +34,11 @@ describe('ee/BoardSettingsSidebar', () => {
wrapper
=
shallowMount
(
BoardSettingsSidebar
,
{
store
,
localVue
,
provide
:
{
glFeatures
:
{
wipLimits
:
isWipLimitsOn
,
},
},
stubs
:
{
'
board-settings-sidebar-wip-limit
'
:
BoardSettingsWipLimit
,
'
board-settings-list-types
'
:
BoardSettingsListTypes
,
...
...
@@ -59,7 +64,7 @@ describe('ee/BoardSettingsSidebar', () => {
list_type
:
'
label
'
,
});
createComponent
();
createComponent
(
{},
true
);
expect
(
wrapper
.
find
(
BoardSettingsWipLimit
).
exists
()).
toBe
(
true
);
});
...
...
lib/api/badges.rb
View file @
ae832eef
...
...
@@ -8,6 +8,8 @@ module API
helpers
::
API
::
Helpers
::
BadgesHelpers
feature_category
:continuous_integration
helpers
do
def
find_source_if_admin
(
source_type
)
source
=
find_source
(
source_type
,
params
[
:id
])
...
...
lib/api/boards.rb
View file @
ae832eef
...
...
@@ -9,6 +9,8 @@ module API
before
{
authenticate!
}
feature_category
:boards
helpers
do
def
board_parent
user_project
...
...
lib/api/branches.rb
View file @
ae832eef
...
...
@@ -10,6 +10,8 @@ module API
after_validation
{
content_type
"application/json"
}
feature_category
:source_code_management
before
do
require_repository_enabled!
authorize!
:download_code
,
user_project
...
...
lib/api/broadcast_messages.rb
View file @
ae832eef
...
...
@@ -4,6 +4,8 @@ module API
class
BroadcastMessages
<
::
API
::
Base
include
PaginationParams
feature_category
:navigation
resource
:broadcast_messages
do
helpers
do
def
find_message
...
...
lib/api/ci/pipeline_schedules.rb
View file @
ae832eef
...
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate!
}
feature_category
:continuous_integration
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
...
...
lib/api/ci/pipelines.rb
View file @
ae832eef
...
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate_non_get!
}
feature_category
:continuous_integration
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
end
...
...
lib/api/ci/runner.rb
View file @
ae832eef
...
...
@@ -7,6 +7,8 @@ module API
content_type
:txt
,
'text/plain'
feature_category
:continuous_integration
resource
:runners
do
desc
'Registers a new Runner'
do
success
Entities
::
RunnerRegistrationDetails
...
...
lib/api/ci/runners.rb
View file @
ae832eef
...
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate!
}
feature_category
:continuous_integration
resource
:runners
do
desc
'Get runners available for user'
do
success
Entities
::
Runner
...
...
lib/api/commit_statuses.rb
View file @
ae832eef
...
...
@@ -4,6 +4,8 @@ require 'mime/types'
module
API
class
CommitStatuses
<
::
API
::
Base
feature_category
:continuous_integration
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
...
...
lib/api/commits.rb
View file @
ae832eef
...
...
@@ -6,6 +6,8 @@ module API
class
Commits
<
::
API
::
Base
include
PaginationParams
feature_category
:source_code_management
before
do
require_repository_enabled!
authorize!
:download_code
,
user_project
...
...
lib/api/container_registry_event.rb
View file @
ae832eef
...
...
@@ -4,6 +4,8 @@ module API
class
ContainerRegistryEvent
<
::
API
::
Base
DOCKER_DISTRIBUTION_EVENTS_V1_JSON
=
'application/vnd.docker.distribution.events.v1+json'
feature_category
:package_registry
before
{
authenticate_registry_notification!
}
resource
:container_registry_event
do
...
...
lib/api/deploy_keys.rb
View file @
ae832eef
...
...
@@ -6,6 +6,8 @@ module API
before
{
authenticate!
}
feature_category
:continuous_delivery
helpers
do
def
add_deploy_keys_project
(
project
,
attrs
=
{})
project
.
deploy_keys_projects
.
create
(
attrs
)
...
...
lib/api/deploy_tokens.rb
View file @
ae832eef
...
...
@@ -4,6 +4,8 @@ module API
class
DeployTokens
<
::
API
::
Base
include
PaginationParams
feature_category
:continuous_delivery
helpers
do
def
scope_params
scopes
=
params
.
delete
(
:scopes
)
...
...
lib/api/deployments.rb
View file @
ae832eef
...
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate!
}
feature_category
:continuous_delivery
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
end
...
...
lib/api/environments.rb
View file @
ae832eef
...
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate!
}
feature_category
:continuous_delivery
params
do
requires
:id
,
type:
String
,
desc:
'The project ID'
end
...
...
lib/api/error_tracking.rb
View file @
ae832eef
...
...
@@ -4,6 +4,8 @@ module API
class
ErrorTracking
<
::
API
::
Base
before
{
authenticate!
}
feature_category
:error_tracking
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
...
...
lib/api/events.rb
View file @
ae832eef
...
...
@@ -8,6 +8,8 @@ module API
allow_access_with_scope
:read_user
,
if:
->
(
request
)
{
request
.
get?
}
feature_category
:users
resource
:events
do
desc
"List currently authenticated user's events"
do
detail
'This feature was introduced in GitLab 9.3.'
...
...
lib/api/feature_flag_scopes.rb
View file @
ae832eef
...
...
@@ -7,6 +7,8 @@ module API
ENVIRONMENT_SCOPE_ENDPOINT_REQUIREMENTS
=
FeatureFlags
::
FEATURE_FLAG_ENDPOINT_REQUIREMENTS
.
merge
(
environment_scope:
API
::
NO_SLASH_URL_PART_REGEX
)
feature_category
:feature_flags
before
do
authorize_read_feature_flags!
end
...
...
lib/api/feature_flags.rb
View file @
ae832eef
...
...
@@ -7,6 +7,8 @@ module API
FEATURE_FLAG_ENDPOINT_REQUIREMENTS
=
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
.
merge
(
name:
API
::
NO_SLASH_URL_PART_REGEX
)
feature_category
:feature_flags
before
do
authorize_read_feature_flags!
end
...
...
lib/api/feature_flags_user_lists.rb
View file @
ae832eef
...
...
@@ -8,6 +8,8 @@ module API
message
.
is_a?
(
String
)
?
{
message:
message
}.
to_json
:
message
.
to_json
}
feature_category
:feature_flags
before
do
authorize_admin_feature_flags_user_lists!
end
...
...
lib/api/features.rb
View file @
ae832eef
...
...
@@ -4,6 +4,8 @@ module API
class
Features
<
::
API
::
Base
before
{
authenticated_as_admin!
}
feature_category
:feature_flags
helpers
do
def
gate_value
(
params
)
case
params
[
:value
]
...
...
lib/api/files.rb
View file @
ae832eef
...
...
@@ -9,6 +9,8 @@ module API
# Prevents returning plain/text responses for files with .txt extension
after_validation
{
content_type
"application/json"
}
feature_category
:source_code_management
helpers
::
API
::
Helpers
::
HeadersHelpers
helpers
do
...
...
lib/api/freeze_periods.rb
View file @
ae832eef
...
...
@@ -6,6 +6,8 @@ module API
before
{
authenticate!
}
feature_category
:continuous_delivery
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a project'
end
...
...
lib/api/group_boards.rb
View file @
ae832eef
...
...
@@ -7,6 +7,8 @@ module API
prepend_if_ee
(
'EE::API::BoardsResponses'
)
# rubocop: disable Cop/InjectEnterpriseEditionModule
feature_category
:boards
before
do
authenticate!
end
...
...
lib/api/group_clusters.rb
View file @
ae832eef
...
...
@@ -6,6 +6,8 @@ module API
before
{
authenticate!
}
feature_category
:kubernetes_management
params
do
requires
:id
,
type:
String
,
desc:
'The ID of the group'
end
...
...
lib/api/group_container_repositories.rb
View file @
ae832eef
...
...
@@ -8,6 +8,8 @@ module API
before
{
authorize_read_group_container_images!
}
feature_category
:package_registry
REPOSITORY_ENDPOINT_REQUIREMENTS
=
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
.
merge
(
tag_name:
API
::
NO_SLASH_URL_PART_REGEX
)
...
...
lib/api/group_export.rb
View file @
ae832eef
...
...
@@ -10,6 +10,8 @@ module API
authorize!
:admin_group
,
user_group
end
feature_category
:importers
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
...
...
lib/api/group_import.rb
View file @
ae832eef
...
...
@@ -2,6 +2,8 @@
module
API
class
GroupImport
<
::
API
::
Base
feature_category
:importers
helpers
Helpers
::
FileUploadHelpers
helpers
do
...
...
lib/api/group_labels.rb
View file @
ae832eef
...
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate!
}
feature_category
:issue_tracking
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
...
...
lib/api/group_milestones.rb
View file @
ae832eef
...
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate!
}
feature_category
:issue_tracking
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
...
...
lib/api/group_variables.rb
View file @
ae832eef
...
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate!
}
before
{
authorize!
:admin_build
,
user_group
}
feature_category
:continuous_integration
params
do
requires
:id
,
type:
String
,
desc:
'The ID of a group'
end
...
...
lib/api/groups.rb
View file @
ae832eef
...
...
@@ -7,6 +7,8 @@ module API
before
{
authenticate_non_get!
}
feature_category
:subgroups
helpers
Helpers
::
GroupsHelpers
helpers
do
...
...
lib/gitlab/bitbucket_server_import/importer.rb
View file @
ae832eef
...
...
@@ -4,11 +4,14 @@ module Gitlab
module
BitbucketServerImport
class
Importer
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
REMOTE_NAME
=
'bitbucket_server'
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
)
...
...
@@ -36,6 +39,12 @@ module Gitlab
@users
=
{}
@temp_branches
=
[]
@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
def
execute
...
...
@@ -48,6 +57,7 @@ module Gitlab
log_info
(
stage:
"complete"
)
Gitlab
::
Cache
::
Import
::
Caching
.
expire
(
already_imported_cache_key
,
15
.
minutes
.
to_i
)
true
end
...
...
@@ -167,6 +177,7 @@ module Gitlab
# on the remote server. Then we have to issue a `git fetch` to download these
# branches.
def
import_pull_requests
log_info
(
stage:
'import_pull_requests'
,
message:
'starting'
)
pull_requests
=
client
.
pull_requests
(
project_key
,
repository_slug
).
to_a
# Creating branches on the server and fetching the newly-created branches
...
...
@@ -176,7 +187,11 @@ module Gitlab
restore_branches
(
batch
)
if
recover_missing_commits
batch
.
each
do
|
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
Gitlab
::
ErrorTracking
.
log_exception
(
e
,
...
...
@@ -189,6 +204,19 @@ module Gitlab
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
@temp_branches
.
each
do
|
branch
|
client
.
delete_branch
(
project_key
,
repository_slug
,
branch
.
name
,
branch
.
sha
)
...
...
@@ -236,6 +264,7 @@ module Gitlab
end
log_info
(
stage:
'import_bitbucket_pull_requests'
,
message:
'finished'
,
iid:
pull_request
.
iid
)
mark_as_imported
(
pull_request
)
end
def
import_pull_request_comments
(
pull_request
,
merge_request
)
...
...
spec/crystalball_env.rb
View file @
ae832eef
...
...
@@ -6,7 +6,7 @@ module CrystalballEnv
extend
self
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_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
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
)
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';
import
createStore
from
'
~/diffs/store/modules
'
;
import
CollapsedFilesWarning
from
'
~/diffs/components/collapsed_files_warning.vue
'
;
import
{
CENTERED_LIMITED_CONTAINER_CLASSES
}
from
'
~/diffs/constants
'
;
import
eventHub
from
'
~/diffs/event_hub
'
;
const
propsData
=
{
limited
:
true
,
...
...
@@ -76,13 +77,13 @@ describe('CollapsedFilesWarning', () => {
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
});
jest
.
spyOn
(
wrapper
.
vm
.
$store
,
'
dispatch
'
).
mockReturnValue
(
undefined
);
jest
.
spyOn
(
eventHub
,
'
$emit
'
);
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';
import
DiffFileHeaderComponent
from
'
~/diffs/components/diff_file_header.vue
'
;
import
DiffContentComponent
from
'
~/diffs/components/diff_content.vue
'
;
import
eventHub
from
'
~/diffs/event_hub
'
;
import
{
diffViewerModes
,
diffViewerErrors
}
from
'
~/ide/constants
'
;
function
changeViewer
(
store
,
index
,
{
automaticallyCollapsed
,
manuallyCollapsed
,
name
})
{
...
...
@@ -138,6 +140,30 @@ describe('DiffFile', () => {
});
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
'
,
()
=>
{
beforeEach
(()
=>
{
makeFileManuallyCollapsed
(
store
);
...
...
spec/frontend/diffs/store/actions_spec.js
View file @
ae832eef
...
...
@@ -27,7 +27,6 @@ import {
scrollToLineIfNeededInline
,
scrollToLineIfNeededParallel
,
loadCollapsedDiff
,
expandAllFiles
,
toggleFileDiscussions
,
saveDiffDiscussion
,
setHighlightedRow
,
...
...
@@ -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
'
,
()
=>
{
it
(
'
should dispatch collapseDiscussion when all discussions are expanded
'
,
()
=>
{
const
getters
=
{
...
...
spec/frontend/diffs/store/mutations_spec.js
View file @
ae832eef
...
...
@@ -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
'
,
()
=>
{
it
(
'
should call utils.addContextLines with proper params
'
,
()
=>
{
const
options
=
{
...
...
spec/lib/api/every_api_endpoint_spec.rb
View file @
ae832eef
...
...
@@ -22,7 +22,17 @@ RSpec.describe 'Every API endpoint' do
completed_classes
=
[
::
API
::
Users
,
::
API
::
Issues
,
::
API
::
AccessRequests
,
::
API
::
Admin
::
Ci
::
Variables
,
::
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
)
...
...
spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
View file @
ae832eef
...
...
@@ -115,6 +115,12 @@ RSpec.describe Gitlab::BitbucketServerImport::Importer do
allow
(
subject
.
client
).
to
receive
(
:pull_requests
).
and_return
([
pull_request
])
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
expect
(
subject
.
client
).
to
receive
(
:activities
).
and_return
([
merge_event
])
...
...
@@ -463,6 +469,47 @@ RSpec.describe Gitlab::BitbucketServerImport::Importer do
subject
.
execute
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
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