Skip to content
Snippets Groups Projects
Commit 792a54c3 authored by Robert Speicher's avatar Robert Speicher
Browse files

Merge branch '11-8-stable-prepare-rc3' into '11-8-stable'

Prepare 11.8.0-rc3 release

See merge request gitlab-org/gitlab-ce!25167
parents e0d9b882 8ab9c356
No related branches found
No related tags found
No related merge requests found
Showing
with 26666 additions and 4875 deletions
Loading
Loading
@@ -36,13 +36,20 @@ export class CopyAsGFM {
div.appendChild(el.cloneNode(true));
const html = div.innerHTML;
 
clipboardData.setData('text/plain', el.textContent);
clipboardData.setData('text/html', html);
// We are also setting this as fallback to transform the selection to gfm on paste
clipboardData.setData('text/x-gfm-html', html);
CopyAsGFM.nodeToGFM(el)
.then(res => {
clipboardData.setData('text/plain', el.textContent);
clipboardData.setData('text/x-gfm', res);
clipboardData.setData('text/html', html);
})
.catch(() => {});
.catch(() => {
// Not showing the error as Firefox might doesn't allow
// it or other browsers who have a time limit on the execution
// of the copy event
});
}
 
static pasteGFM(e) {
Loading
Loading
@@ -51,11 +58,28 @@ export class CopyAsGFM {
 
const text = clipboardData.getData('text/plain');
const gfm = clipboardData.getData('text/x-gfm');
if (!gfm) return;
const gfmHtml = clipboardData.getData('text/x-gfm-html');
if (!gfm && !gfmHtml) return;
 
e.preventDefault();
 
window.gl.utils.insertText(e.target, textBefore => {
// We have the original selection already converted to gfm
if (gfm) {
CopyAsGFM.insertPastedText(e.target, text, gfm);
} else {
// Due to the async copy call we are not able to produce gfm so we transform the cached HTML
const div = document.createElement('div');
div.innerHTML = gfmHtml;
CopyAsGFM.nodeToGFM(div)
.then(transformedGfm => {
CopyAsGFM.insertPastedText(e.target, text, transformedGfm);
})
.catch(() => {});
}
}
static insertPastedText(target, text, gfm) {
window.gl.utils.insertText(target, textBefore => {
// If the text before the cursor contains an odd number of backticks,
// we are either inside an inline code span that starts with 1 backtick
// or a code block that starts with 3 backticks.
Loading
Loading
Loading
Loading
@@ -221,7 +221,7 @@ export default {
</script>
 
<template>
<div class="board-list-component d-flex flex-column">
<div class="board-list-component">
<div v-if="loading" class="board-list-loading text-center" aria-label="Loading issues">
<gl-loading-icon />
</div>
Loading
Loading
Loading
Loading
@@ -164,6 +164,13 @@
display: none;
}
}
&:not(.is-collapsed) {
.board-list-component {
display: flex;
flex-direction: column;
}
}
}
 
.board-inner {
Loading
Loading
---
title: Create the source branch for a GitHub import
merge_request: 25064
author:
type: fixed
Loading
Loading
@@ -56,6 +56,49 @@ The same tag is shown on the pipeline's details:
 
![Pipeline's details](img/pipeline_detail.png)
 
## Excluding certain jobs
The behavior of the `only: merge_requests` rule is such that _only_ jobs with
that rule are run in the context of a merge request; no other jobs will be run.
However, you may want to reverse this behaviour, having all of your jobs to run _except_
for one or two. Consider the following pipeline, with jobs `A`, `B`, and `C`. If you want
all pipelines to always run `A` and `B`, but only want `C` to run for a merge request,
you can configure your `.gitlab-ci.yml` file as follows:
``` yaml
.only-default: &only-default
only:
- master
- merge_requests
- tags
A:
<<: *only-default
script:
- ...
B:
<<: *only-default
script:
- ...
C:
script:
- ...
only:
- merge_requests
```
Since `A` and `B` are getting the `only:` rule to execute in all cases, they will
always run. `C` specifies that it should only run for merge requests, so for any
pipeline except a merge request pipeline, it will not run.
As you can see, this will help you avoid a lot of boilerplate where you'd need
to add that `only:` rule to all of your jobs in order to make them always run. You
can use this for scenarios like having only pipelines with merge requests get a
Review App set up, helping to save resources.
## Important notes about merge requests from forked projects
 
Note that the current behavior is subject to change. In the usual contribution
Loading
Loading
Loading
Loading
@@ -67,6 +67,36 @@ module Gitlab
 
def insert_git_data(merge_request, already_exists)
insert_or_replace_git_data(merge_request, pull_request.source_branch_sha, pull_request.target_branch_sha, already_exists)
# We need to create the branch after the merge request is
# populated to ensure the merge request is in the right state
# when the branch is created.
create_source_branch_if_not_exists(merge_request)
end
# An imported merge request will not be mergeable unless the
# source branch exists. For pull requests from forks, the source
# branch will be in the form of
# "github/fork/{project-name}/{source_branch}". This branch will never
# exist, so we create it here.
#
# Note that we only create the branch if the merge request is still open.
# For projects that have many pull requests, we assume that if it's closed
# the branch has already been deleted.
def create_source_branch_if_not_exists(merge_request)
return unless merge_request.open?
source_branch = pull_request.formatted_source_branch
return if project.repository.branch_exists?(source_branch)
project.repository.add_branch(merge_request.author, source_branch, pull_request.source_branch_sha)
rescue Gitlab::Git::CommandError => e
Gitlab::Sentry.track_acceptable_exception(e,
extra: {
source_branch: source_branch,
project_id: merge_request.project.id,
merge_request_id: merge_request.id
})
end
end
end
Loading
Loading
Loading
Loading
@@ -76,10 +76,10 @@ module Gitlab
# Returns a formatted source branch.
#
# For cross-project pull requests the branch name will be in the format
# `owner-name:branch-name`.
# `github/fork/owner-name/branch-name`.
def formatted_source_branch
if cross_project? && source_repository_owner
"#{source_repository_owner}:#{source_branch}"
"github/fork/#{source_repository_owner}/#{source_branch}"
elsif source_branch == target_branch
# Sometimes the source and target branch are the same, but GitLab
# doesn't support this. This can happen when both the user and
Loading
Loading
Loading
Loading
@@ -90,8 +90,14 @@ module Gitlab
todos: count(Todo),
uploads: count(Upload),
web_hooks: count(WebHook)
}.merge(services_usage).merge(approximate_counts)
}
}
.merge(services_usage)
.merge(approximate_counts)
}.tap do |data|
if Feature.enabled?(:group_overview_security_dashboard)
data[:counts][:user_preferences] = user_preferences_usage
end
end
end
# rubocop: enable CodeReuse/ActiveRecord
 
Loading
Loading
@@ -159,6 +165,10 @@ module Gitlab
}
end
 
def user_preferences_usage
{} # augmented in EE
end
def count(relation, fallback: -1)
relation.count
rescue ActiveRecord::StatementInvalid
Loading
Loading
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment