Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-11-05 12:09:05 +00:00
parent 015890a1b7
commit a662b146ac
125 changed files with 126434 additions and 20456 deletions

View File

@ -616,12 +616,12 @@ const Api = {
return axios.get(url);
},
pipelineJobs(projectId, pipelineId) {
pipelineJobs(projectId, pipelineId, params) {
const url = Api.buildUrl(this.pipelineJobsPath)
.replace(':id', encodeURIComponent(projectId))
.replace(':pipeline_id', encodeURIComponent(pipelineId));
return axios.get(url);
return axios.get(url, { params });
},
// Return all pipelines for a project or filter by query params

View File

@ -1,5 +1,5 @@
<script>
import { GlIcon } from '@gitlab/ui';
import { GlButtonGroup, GlButton } from '@gitlab/ui';
const SCALE_STEP_SIZE = 0.2;
const DEFAULT_SCALE = 1;
@ -8,7 +8,8 @@ const MAX_SCALE = 2;
export default {
components: {
GlIcon,
GlButtonGroup,
GlButton,
},
data() {
return {
@ -49,17 +50,9 @@ export default {
</script>
<template>
<div class="design-scaler btn-group" role="group">
<button class="btn" :disabled="disableDecrease" @click="decrementScale">
<span class="gl-display-flex gl-justify-content-center gl-align-items-center gl-icon s16">
</span>
</button>
<button class="btn" :disabled="disableReset" @click="resetScale">
<gl-icon name="redo" />
</button>
<button class="btn" :disabled="disableIncrease" @click="incrementScale">
<gl-icon name="plus" />
</button>
</div>
<gl-button-group class="gl-z-index-1">
<gl-button icon="dash" :disabled="disableDecrease" @click="decrementScale" />
<gl-button icon="redo" :disabled="disableReset" @click="resetScale" />
<gl-button icon="plus" :disabled="disableIncrease" @click="incrementScale" />
</gl-button-group>
</template>

View File

@ -68,6 +68,11 @@ export default {
required: false,
default: false,
},
requirementsAvailable: {
type: Boolean,
required: false,
default: false,
},
visibilityHelpPath: {
type: String,
required: false,
@ -132,6 +137,7 @@ export default {
snippetsAccessLevel: featureAccessLevel.EVERYONE,
pagesAccessLevel: featureAccessLevel.EVERYONE,
metricsDashboardAccessLevel: featureAccessLevel.PROJECT_MEMBERS,
requirementsAccessLevel: featureAccessLevel.EVERYONE,
containerRegistryEnabled: true,
lfsEnabled: true,
requestAccessEnabled: true,
@ -234,6 +240,10 @@ export default {
featureAccessLevel.PROJECT_MEMBERS,
this.metricsDashboardAccessLevel,
);
this.requirementsAccessLevel = Math.min(
featureAccessLevel.PROJECT_MEMBERS,
this.requirementsAccessLevel,
);
if (this.pagesAccessLevel === featureAccessLevel.EVERYONE) {
// When from Internal->Private narrow access for only members
this.pagesAccessLevel = featureAccessLevel.PROJECT_MEMBERS;
@ -257,6 +267,9 @@ export default {
this.pagesAccessLevel = featureAccessLevel.EVERYONE;
if (this.metricsDashboardAccessLevel === featureAccessLevel.PROJECT_MEMBERS)
this.metricsDashboardAccessLevel = featureAccessLevel.EVERYONE;
if (this.requirementsAccessLevel === featureAccessLevel.PROJECT_MEMBERS)
this.requirementsAccessLevel = featureAccessLevel.EVERYONE;
this.highlightChanges();
}
},
@ -481,6 +494,18 @@ export default {
/>
</project-setting-row>
</div>
<project-setting-row
v-if="requirementsAvailable"
ref="requirements-settings"
:label="s__('ProjectSettings|Requirements')"
:help-text="s__('ProjectSettings|Requirements management system for this project')"
>
<project-feature-setting
v-model="requirementsAccessLevel"
:options="featureAccessLevelOptions"
name="project[project_feature_attributes][requirements_access_level]"
/>
</project-setting-row>
<project-setting-row
ref="wiki-settings"
:label="s__('ProjectSettings|Wiki')"

View File

@ -2,6 +2,7 @@ export default {
data() {
return {
packagesEnabled: false,
requirementsEnabled: false,
};
},
watch: {

View File

@ -41,7 +41,11 @@ export default {
primaryProps() {
return {
text: this.$options.i18n.deletePageText,
attributes: { variant: 'danger', 'data-qa-selector': 'confirm_deletion_button' },
attributes: {
variant: 'danger',
'data-qa-selector': 'confirm_deletion_button',
'data-testid': 'confirm_deletion_button',
},
};
},
cancelProps() {

View File

@ -1,6 +1,7 @@
import { GlBreakpointInstance as bp } from '@gitlab/ui/dist/utils';
import { s__, sprintf } from '~/locale';
import Tracking from '~/tracking';
import showToast from '~/vue_shared/plugins/global_toast';
const MARKDOWN_LINK_TEXT = {
markdown: '[Link Title](page-slug)',
@ -63,6 +64,7 @@ export default class Wikis {
}
Wikis.trackPageView();
Wikis.showToasts();
}
handleWikiTitleChange(e) {
@ -116,4 +118,9 @@ export default class Wikis {
},
});
}
static showToasts() {
const toasts = document.querySelectorAll('.js-toast-message');
toasts.forEach(toast => showToast(toast.dataset.message));
}
}

View File

@ -3,6 +3,7 @@ import { GlIcon, GlLink, GlSprintf } from '@gitlab/ui';
import ReportSection from '~/reports/components/report_section.vue';
import { status } from '~/reports/constants';
import { s__ } from '~/locale';
import { normalizeHeaders, parseIntPagination } from '~/lib/utils/common_utils';
import Flash from '~/flash';
import Api from '~/api';
@ -52,12 +53,27 @@ export default {
});
},
methods: {
checkHasSecurityReports(reportTypes) {
return Api.pipelineJobs(this.projectId, this.pipelineId).then(({ data: jobs }) =>
jobs.some(({ artifacts = [] }) =>
async checkHasSecurityReports(reportTypes) {
let page = 1;
while (page) {
// eslint-disable-next-line no-await-in-loop
const { data: jobs, headers } = await Api.pipelineJobs(this.projectId, this.pipelineId, {
per_page: 100,
page,
});
const hasSecurityReports = jobs.some(({ artifacts = [] }) =>
artifacts.some(({ file_type }) => reportTypes.includes(file_type)),
),
);
);
if (hasSecurityReports) {
return true;
}
page = parseIntPagination(normalizeHeaders(headers)).nextPage;
}
return false;
},
activatePipelinesTab() {
if (window.mrTabs) {

View File

@ -75,10 +75,6 @@ $t-gray-a-16-design-pin: rgba($black, 0.16);
left: 0;
}
.design-scaler {
z-index: 1;
}
.design-scaler-wrapper {
bottom: 0;
left: 50%;

View File

@ -103,9 +103,10 @@ module WikiActions
@page = response.payload[:page]
if response.success?
flash[:toast] = _('Wiki page was successfully updated.')
redirect_to(
wiki_page_path(wiki, page),
notice: _('Wiki was successfully updated.')
wiki_page_path(wiki, page)
)
else
render 'shared/wikis/edit'
@ -122,9 +123,10 @@ module WikiActions
@page = response.payload[:page]
if response.success?
flash[:toast] = _('Wiki page was successfully created.')
redirect_to(
wiki_page_path(wiki, page),
notice: _('Wiki was successfully updated.')
wiki_page_path(wiki, page)
)
else
render 'shared/wikis/edit'
@ -169,9 +171,10 @@ module WikiActions
response = WikiPages::DestroyService.new(container: container, current_user: current_user).execute(page)
if response.success?
flash[:toast] = _("Wiki page was successfully deleted.")
redirect_to wiki_path(wiki),
status: :found,
notice: _("Page was successfully deleted")
status: :found
else
@error = response
render 'shared/wikis/edit'

View File

@ -381,6 +381,20 @@ class ProjectsController < Projects::ApplicationController
.merge(import_url_params)
end
def project_feature_attributes
%i[
builds_access_level
issues_access_level
forking_access_level
merge_requests_access_level
repository_access_level
snippets_access_level
wiki_access_level
pages_access_level
metrics_dashboard_access_level
]
end
def project_params_attributes
[
:allow_merge_on_skipped_pipeline,
@ -418,23 +432,11 @@ class ProjectsController < Projects::ApplicationController
:suggestion_commit_message,
:packages_enabled,
:service_desk_enabled,
project_feature_attributes: %i[
builds_access_level
issues_access_level
forking_access_level
merge_requests_access_level
repository_access_level
snippets_access_level
wiki_access_level
pages_access_level
metrics_dashboard_access_level
],
project_setting_attributes: %i[
show_default_award_emojis
squash_option
]
]
] + [project_feature_attributes: project_feature_attributes]
end
def project_params_create_attributes

View File

@ -29,7 +29,7 @@ module IssueResolverArguments
description: 'Usernames of users assigned to the issue'
argument :assignee_id, GraphQL::STRING_TYPE,
required: false,
description: 'ID of a user assigned to the issues, "none" and "any" values supported'
description: 'ID of a user assigned to the issues, "none" and "any" values are supported'
argument :created_before, Types::TimeType,
required: false,
description: 'Issues created before this date'

View File

@ -1,6 +1,8 @@
# frozen_string_literal: true
module PageLayoutHelper
include Gitlab::Utils::StrongMemoize
def page_title(*titles)
@page_title ||= []
@ -44,7 +46,7 @@ module PageLayoutHelper
if link
@page_canonical_link = link
else
@page_canonical_link
@page_canonical_link ||= generic_canonical_url
end
end
@ -147,4 +149,31 @@ module PageLayoutHelper
css_class.join(' ')
end
private
def generic_canonical_url
strong_memoize(:generic_canonical_url) do
next unless request.get? || request.head?
next unless generate_generic_canonical_url?
next unless Feature.enabled?(:generic_canonical, current_user)
# Request#url builds the url without the trailing slash
request.url
end
end
def generate_generic_canonical_url?
# For the main domain it doesn't matter whether there is
# a trailing slash or not, they're not considered different
# pages
return false if request.path == '/'
# We only need to generate the canonical url when the request has a trailing
# slash. In the request object, only the `original_fullpath` and
# `original_url` keep the slash if it's present. Both `path` and
# `fullpath` would return the path without the slash.
# Therefore, we need to process `original_fullpath`
request.original_fullpath.sub(request.path, '')[0] == '/'
end
end

View File

@ -37,7 +37,8 @@ module Featurable
class_methods do
def set_available_features(available_features = [])
@available_features = available_features
@available_features ||= []
@available_features += available_features
class_eval do
available_features.each do |feature|

View File

@ -88,3 +88,5 @@ module ProjectFeaturesCompatibility
project_feature.__send__(:write_attribute, field, value) # rubocop:disable GitlabSecurity/PublicSend
end
end
ProjectFeaturesCompatibility.prepend_if_ee('EE::ProjectFeaturesCompatibility')

View File

@ -90,7 +90,7 @@ module Storage
end
def old_repository_storages
@old_repository_storage_paths ||= repository_storages
@old_repository_storage_paths ||= repository_storages(legacy_only: true)
end
def repository_storages(legacy_only: false)

View File

@ -31,7 +31,7 @@
- if retried
%span.has-tooltip{ title: _('Status was retried.') }
= sprite_icon('warning-solid', class: 'text-warning')
= sprite_icon('warning-solid', css_class: 'text-warning')
.label-container
- if generic_commit_status.tags.any?

View File

@ -0,0 +1,5 @@
---
title: Ensure security report is displayed correctly in merge requests with a lot of CI jobs
merge_request: 46870
author:
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Generate canonical url and remove trailing slash
merge_request: 46435
author:
type: changed

View File

@ -0,0 +1,5 @@
---
title: Add Batch Support for Importing Pull Requests from Bitbucket
merge_request: 46696
author: Simon Schrottner
type: performance

View File

@ -0,0 +1,5 @@
---
title: Fix retried builds icon sprite to use css_class
merge_request: 46955
author:
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Remove graphql_lazy_authorization feature flag
merge_request: 46819
author:
type: added

View File

@ -0,0 +1,5 @@
---
title: Fix group destroy not working with Gitaly Cluster
merge_request: 46934
author:
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Skip disabled features when importing a project from Gitea
merge_request: 46800
author: John Kristensen (@jerrykan)
type: fixed

View File

@ -0,0 +1,5 @@
---
title: Refresh design zooming buttons
merge_request: 46205
author:
type: changed

View File

@ -0,0 +1,5 @@
---
title: Use toasts for wiki notifications
merge_request: 46201
author:
type: changed

View File

@ -1,7 +1,7 @@
---
name: graphql_lazy_authorization
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45263
rollout_issue_url:
name: generic_canonical
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46435
rollout_issue_url:
type: development
group: group::plan
group: group::editor
default_enabled: false

View File

@ -0,0 +1,8 @@
---
name: gitlab_org_sitemap
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46661
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/276915
milestone: '13.6'
type: development
group: group::editor
default_enabled: false

View File

@ -275,6 +275,10 @@ Rails.application.routes.draw do
draw :profile
end
Gitlab.ee do
get '/sitemap' => 'sitemap#show', format: :xml
end
root to: "root#index"
get '*unmatched_route', to: 'application#route_not_found'

View File

@ -0,0 +1,19 @@
# frozen_string_literal: true
class AddRequirementsAccessLevelToProjectFeatures < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
with_lock_retries do
add_column :project_features, :requirements_access_level, :integer, default: 20, null: false
end
end
def down
with_lock_retries do
remove_column :project_features, :requirements_access_level, :integer
end
end
end

View File

@ -0,0 +1,17 @@
# frozen_string_literal: true
class AddIssuesClosedAtIndex < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index(:issues, [:project_id, :closed_at])
end
def down
remove_concurrent_index_by_name(:issues, 'index_issues_on_project_id_and_closed_at')
end
end

View File

@ -0,0 +1 @@
ced03562d300f99abf687c258a25bf280a6c4f1798a893ee8a79189c09f19e6e

View File

@ -0,0 +1 @@
3427cf92dc785f399329b00a3dded01dd2a6386cafbd0ef4b732bfcf522ce615

View File

@ -14993,7 +14993,8 @@ CREATE TABLE project_features (
repository_access_level integer DEFAULT 20 NOT NULL,
pages_access_level integer NOT NULL,
forking_access_level integer,
metrics_dashboard_access_level integer
metrics_dashboard_access_level integer,
requirements_access_level integer DEFAULT 20 NOT NULL
);
CREATE SEQUENCE project_features_id_seq
@ -20956,6 +20957,8 @@ CREATE INDEX index_issues_on_milestone_id ON issues USING btree (milestone_id);
CREATE INDEX index_issues_on_moved_to_id ON issues USING btree (moved_to_id) WHERE (moved_to_id IS NOT NULL);
CREATE INDEX index_issues_on_project_id_and_closed_at ON issues USING btree (project_id, closed_at);
CREATE UNIQUE INDEX index_issues_on_project_id_and_external_key ON issues USING btree (project_id, external_key) WHERE (external_key IS NOT NULL);
CREATE UNIQUE INDEX index_issues_on_project_id_and_iid ON issues USING btree (project_id, iid);

View File

@ -349,7 +349,9 @@ PUT /groups/:id/epics/:epic_iid
| `title` | string | no | The title of an epic |
| `description` | string | no | The description of an epic. Limited to 1,048,576 characters. |
| `confidential` | boolean | no | Whether the epic should be confidential |
| `labels` | string | no | The comma separated list of labels |
| `labels` | string | no | Comma-separated label names for an issue. Set to an empty string to unassign all labels. |
| `add_labels` | string | no | Comma-separated label names to add to an issue. |
| `remove_labels` | string | no | Comma-separated label names to remove from an issue. |
| `updated_at` | string | no | When the epic was updated. Date time string, ISO 8601 formatted, for example `2016-03-11T03:45:40Z` . Requires administrator or project/group owner privileges ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/255309) in GitLab 13.5) |
| `start_date_is_fixed` | boolean | no | Whether start date should be sourced from `start_date_fixed` or from milestones (since 11.3) |
| `start_date_fixed` | string | no | The fixed start date of an epic (since 11.3) |

View File

@ -8387,7 +8387,7 @@ type Group {
after: String
"""
ID of a user assigned to the issues, "none" and "any" values supported
ID of a user assigned to the issues, "none" and "any" values are supported
"""
assigneeId: String
@ -8431,6 +8431,11 @@ type Group {
"""
createdBefore: Time
"""
ID of an epic associated with the issues, "none" and "any" values are supported
"""
epicId: String
"""
Returns the first _n_ elements from the list.
"""
@ -14695,7 +14700,7 @@ type Project {
"""
issue(
"""
ID of a user assigned to the issues, "none" and "any" values supported
ID of a user assigned to the issues, "none" and "any" values are supported
"""
assigneeId: String
@ -14734,6 +14739,11 @@ type Project {
"""
createdBefore: Time
"""
ID of an epic associated with the issues, "none" and "any" values are supported
"""
epicId: String
"""
IID of the issue. For example, "1"
"""
@ -14795,7 +14805,7 @@ type Project {
"""
issueStatusCounts(
"""
ID of a user assigned to the issues, "none" and "any" values supported
ID of a user assigned to the issues, "none" and "any" values are supported
"""
assigneeId: String
@ -14885,7 +14895,7 @@ type Project {
after: String
"""
ID of a user assigned to the issues, "none" and "any" values supported
ID of a user assigned to the issues, "none" and "any" values are supported
"""
assigneeId: String
@ -14929,6 +14939,11 @@ type Project {
"""
createdBefore: Time
"""
ID of an epic associated with the issues, "none" and "any" values are supported
"""
epicId: String
"""
Returns the first _n_ elements from the list.
"""

View File

@ -23095,7 +23095,7 @@
},
{
"name": "assigneeId",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values are supported",
"type": {
"kind": "SCALAR",
"name": "String",
@ -23225,6 +23225,16 @@
},
"defaultValue": null
},
{
"name": "epicId",
"description": "ID of an epic associated with the issues, \"none\" and \"any\" values are supported",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "includeSubgroups",
"description": "Include issues belonging to subgroups",
@ -43209,7 +43219,7 @@
},
{
"name": "assigneeId",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values are supported",
"type": {
"kind": "SCALAR",
"name": "String",
@ -43338,6 +43348,16 @@
}
},
"defaultValue": null
},
{
"name": "epicId",
"description": "ID of an epic associated with the issues, \"none\" and \"any\" values are supported",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
}
],
"type": {
@ -43448,7 +43468,7 @@
},
{
"name": "assigneeId",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values are supported",
"type": {
"kind": "SCALAR",
"name": "String",
@ -43653,7 +43673,7 @@
},
{
"name": "assigneeId",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values supported",
"description": "ID of a user assigned to the issues, \"none\" and \"any\" values are supported",
"type": {
"kind": "SCALAR",
"name": "String",
@ -43783,6 +43803,16 @@
},
"defaultValue": null
},
{
"name": "epicId",
"description": "ID of an epic associated with the issues, \"none\" and \"any\" values are supported",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null
},
{
"name": "after",
"description": "Returns the elements in the list that come after the specified cursor.",

View File

@ -1081,6 +1081,7 @@ POST /projects
| `only_allow_merge_if_pipeline_succeeds` | boolean | **{dotted-circle}** No | Set whether merge requests can only be merged with successful jobs. |
| `packages_enabled` | boolean | **{dotted-circle}** No | Enable or disable packages repository feature. |
| `pages_access_level` | string | **{dotted-circle}** No | One of `disabled`, `private`, `enabled`, or `public`. |
| `requirements_access_level` | string | **{dotted-circle}** No | One of `disabled`, `private`, `enabled` or `public` |
| `path` | string | **{check-circle}** Yes (if name isn't provided) | Repository name for new project. Generated based on name if not provided (generated as lowercase with dashes). |
| `printing_merge_request_link_enabled` | boolean | **{dotted-circle}** No | Show link to create/view merge request when pushing from the command line. |
| `public_builds` | boolean | **{dotted-circle}** No | If `true`, jobs can be viewed by non-project members. |
@ -1150,6 +1151,7 @@ POST /projects/user/:user_id
| `only_allow_merge_if_pipeline_succeeds` | boolean | **{dotted-circle}** No | Set whether merge requests can only be merged with successful jobs. |
| `packages_enabled` | boolean | **{dotted-circle}** No | Enable or disable packages repository feature. |
| `pages_access_level` | string | **{dotted-circle}** No | One of `disabled`, `private`, `enabled`, or `public`. |
| `requirements_access_level` | string | **{dotted-circle}** No | One of `disabled`, `private`, `enabled` or `public` |
| `path` | string | **{dotted-circle}** No | Custom repository name for new project. By default generated based on name. |
| `printing_merge_request_link_enabled` | boolean | **{dotted-circle}** No | Show link to create/view merge request when pushing from the command line. |
| `public_builds` | boolean | **{dotted-circle}** No | If `true`, jobs can be viewed by non-project-members. |
@ -1225,6 +1227,7 @@ PUT /projects/:id
| `only_mirror_protected_branches` **(STARTER)** | boolean | **{dotted-circle}** No | Only mirror protected branches. |
| `packages_enabled` | boolean | **{dotted-circle}** No | Enable or disable packages repository feature. |
| `pages_access_level` | string | **{dotted-circle}** No | One of `disabled`, `private`, `enabled`, or `public`. |
| `requirements_access_level` | string | **{dotted-circle}** No | One of `disabled`, `private`, `enabled` or `public` |
| `path` | string | **{dotted-circle}** No | Custom repository name for the project. By default generated based on name. |
| `public_builds` | boolean | **{dotted-circle}** No | If `true`, jobs can be viewed by non-project members. |
| `remove_source_branch_after_merge` | boolean | **{dotted-circle}** No | Enable `Delete source branch` option by default for all new merge requests. |

View File

@ -72,6 +72,7 @@ Use the switches to enable or disable the following features:
| **Snippets** | ✓ | Enables [sharing of code and text](../../snippets.md) |
| **Pages** | ✓ | Allows you to [publish static websites](../pages/) |
| **Metrics Dashboard** | ✓ | Control access to [metrics dashboard](../integrations/prometheus.md)
| **Requirements** | ✓ | Control access to [Requirements Management](../requirements/index.md)
Some features depend on others:

View File

@ -8,9 +8,9 @@ module BitbucketServer
@connection = Connection.new(options)
end
def pull_requests(project_key, repo)
def pull_requests(project_key, repo, page_offset: 0, limit: nil)
path = "/projects/#{project_key}/repos/#{repo}/pull-requests?state=ALL"
get_collection(path, :pull_request)
get_collection(path, :pull_request, page_offset: page_offset, limit: limit)
end
def activities(project_key, repo, pull_request_id)

View File

@ -177,16 +177,24 @@ 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
page = 0
# Creating branches on the server and fetching the newly-created branches
# may take a number of network round-trips. Do this in batches so that we can
# avoid doing a git fetch for every new branch.
pull_requests.each_slice(BATCH_SIZE) do |batch|
restore_branches(batch) if recover_missing_commits
log_info(stage: 'import_pull_requests', message: "starting")
batch.each do |pull_request|
loop do
log_debug(stage: 'import_pull_requests', message: "importing page #{page} and batch-size #{BATCH_SIZE} from #{page * BATCH_SIZE} to #{(page + 1) * BATCH_SIZE}")
pull_requests = client.pull_requests(project_key, repository_slug, page_offset: page, limit: BATCH_SIZE).to_a
break if pull_requests.empty?
# Creating branches on the server and fetching the newly-created branches
# may take a number of network round-trips. This used to be done in batches to
# avoid doing a git fetch for every new branch, as the whole process is now
# batched, we do not need to separately do this in batches.
restore_branches(pull_requests) if recover_missing_commits
pull_requests.each do |pull_request|
if already_imported?(pull_request)
log_info(stage: 'import_pull_requests', message: 'already imported', iid: pull_request.iid)
else
@ -201,6 +209,9 @@ module Gitlab
backtrace = Gitlab::BacktraceCleaner.clean_backtrace(e.backtrace)
errors << { type: :pull_request, iid: pull_request.iid, errors: e.message, backtrace: backtrace.join("\n"), raw_response: pull_request.raw }
end
log_debug(stage: 'import_pull_requests', message: "finished page #{page} and batch-size #{BATCH_SIZE}")
page += 1
end
end
@ -416,6 +427,10 @@ module Gitlab
}
end
def log_debug(details)
logger.debug(log_base_data.merge(details))
end
def log_info(details)
logger.info(log_base_data.merge(details))
end

View File

@ -36,11 +36,7 @@ module Gitlab
end
def self.with_value(unforced, &block)
if Feature.enabled?(:graphql_lazy_authorization)
self.new { unforced }.then(&block)
else
block.call(unforced)
end
self.new { unforced }.then(&block)
end
end
end

View File

@ -303,6 +303,8 @@ module Gitlab
end
imported!(resource_type)
rescue ::Octokit::NotFound => e
errors << { type: resource_type, errors: e.message }
end
def imported?(resource_type)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -19284,9 +19284,6 @@ msgstr ""
msgid "Page settings"
msgstr ""
msgid "Page was successfully deleted"
msgstr ""
msgid "PagerDutySettings|Active"
msgstr ""
@ -21135,6 +21132,12 @@ msgstr ""
msgid "ProjectSettings|Require"
msgstr ""
msgid "ProjectSettings|Requirements"
msgstr ""
msgid "ProjectSettings|Requirements management system for this project"
msgstr ""
msgid "ProjectSettings|Set the default behavior and availability of this option in merge requests. Changes made are also applied to existing merge requests."
msgstr ""
@ -30185,7 +30188,13 @@ msgstr ""
msgid "Wiki"
msgstr ""
msgid "Wiki was successfully updated."
msgid "Wiki page was successfully created."
msgstr ""
msgid "Wiki page was successfully deleted."
msgstr ""
msgid "Wiki page was successfully updated."
msgstr ""
msgid "WikiClone|Clone your wiki"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

32619
locale/mk_MK/gitlab.po Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More