Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-10-20 18:08:54 +00:00
parent 6b5e293c6d
commit 2f852fc2eb
40 changed files with 211 additions and 257 deletions

View file

@ -2,7 +2,6 @@
import { mapGetters, mapActions } from 'vuex';
import Sortable from 'sortablejs';
import BoardListHeader from 'ee_else_ce/boards/components/board_list_header.vue';
import Tooltip from '~/vue_shared/directives/tooltip';
import EmptyComponent from '~/vue_shared/components/empty_component';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import BoardList from './board_list.vue';
@ -18,9 +17,6 @@ export default {
BoardListHeader,
BoardList: gon.features?.graphqlBoardLists ? BoardListNew : BoardList,
},
directives: {
Tooltip,
},
mixins: [glFeatureFlagMixin()],
props: {
list: {

View file

@ -1,6 +1,7 @@
import $ from 'jquery';
import Vue from 'vue';
import { GlIcon } from '@gitlab/ui';
import { hide } from '~/tooltips';
export default (ModalStore, boardsStore) => {
const issueBoardsContent = document.querySelector('.content-wrapper > .js-focus-mode-board');
@ -17,7 +18,9 @@ export default (ModalStore, boardsStore) => {
},
methods: {
toggleFocusMode() {
$(this.$refs.toggleFocusModeButton).tooltip('hide');
const $el = $(this.$refs.toggleFocusModeButton);
hide($el);
issueBoardsContent.classList.toggle('is-focused');
this.isFullscreen = !this.isFullscreen;

View file

@ -5,6 +5,7 @@ import { __ } from './locale';
import axios from './lib/utils/axios_utils';
import { deprecatedCreateFlash as flash } from './flash';
import { capitalizeFirstCharacter } from './lib/utils/text_utility';
import { fixTitle } from '~/tooltips';
import initDeprecatedJQueryDropdown from '~/deprecated_jquery_dropdown';
export default function initCompareAutocomplete(limitTo = null, clickHandler = () => {}) {
@ -76,7 +77,7 @@ export default function initCompareAutocomplete(limitTo = null, clickHandler = (
$dropdownContainer.on('click', '.dropdown-content a', e => {
$dropdown.prop('title', e.target.text.replace(/_+?/g, '-'));
if ($dropdown.hasClass('has-tooltip')) {
$dropdown.tooltip('_fixTitle');
fixTitle($dropdown);
}
});
});

View file

@ -488,7 +488,9 @@ export default {
:target="rolloutPercentageId(index)"
>
{{
s__('FeatureFlags|Percent rollout must be a whole number between 0 and 100')
s__(
'FeatureFlags|Percent rollout must be an integer number between 0 and 100',
)
}}
</gl-tooltip>
<span class="ml-1">%</span>

View file

@ -17,8 +17,8 @@ export default {
},
},
i18n: {
percentageDescription: __('Enter a whole number between 0 and 100'),
percentageInvalid: __('Percent rollout must be a whole number between 0 and 100'),
percentageDescription: __('Enter an integer number number between 0 and 100'),
percentageInvalid: __('Percent rollout must be an integer number between 0 and 100'),
percentageLabel: __('Percentage'),
stickinessDescription: __('Consistency guarantee method'),
stickinessLabel: __('Based on'),

View file

@ -16,9 +16,9 @@ export default {
},
},
i18n: {
rolloutPercentageDescription: __('Enter a whole number between 0 and 100'),
rolloutPercentageDescription: __('Enter an integer number between 0 and 100'),
rolloutPercentageInvalid: s__(
'FeatureFlags|Percent rollout must be a whole number between 0 and 100',
'FeatureFlags|Percent rollout must be an integer number between 0 and 100',
),
rolloutPercentageLabel: s__('FeatureFlag|Percentage'),
},

View file

@ -1,7 +1,6 @@
<script>
import { mapActions } from 'vuex';
import { GlIcon } from '@gitlab/ui';
import tooltip from '~/vue_shared/directives/tooltip';
import { GlIcon, GlTooltipDirective } from '@gitlab/ui';
import FileIcon from '~/vue_shared/components/file_icon.vue';
import { viewerTypes } from '../../constants';
import getCommitIconMap from '../../commit_icon';
@ -12,7 +11,7 @@ export default {
FileIcon,
},
directives: {
tooltip,
GlTooltip: GlTooltipDirective,
},
props: {
file: {
@ -77,7 +76,7 @@ export default {
<template>
<div class="multi-file-commit-list-item position-relative">
<div
v-tooltip
v-gl-tooltip
:title="tooltipTitle"
:class="{
'is-active': isActive,

View file

@ -1,24 +1,6 @@
<script>
import linkifyHtml from 'linkifyjs/html';
import { sanitize } from '~/lib/dompurify';
import { isAbsolute } from '~/lib/utils/url_utility';
import LineNumber from './line_number.vue';
const linkifyOptions = {
attributes: {
// eslint-disable-next-line @gitlab/require-i18n-strings
rel: 'nofollow noopener',
},
className: 'gl-reset-color!',
defaultProtocol: 'https',
validate: {
email: false,
url(value) {
return isAbsolute(value);
},
},
};
export default {
functional: true,
props: {
@ -35,15 +17,13 @@ export default {
const { line, path } = props;
const chars = line.content.map(content => {
const linkfied = linkifyHtml(content.text, linkifyOptions);
return h('span', {
class: ['gl-white-space-pre-wrap', content.style],
domProps: {
innerHTML: sanitize(linkfied, {
ALLOWED_TAGS: ['a'],
}),
return h(
'span',
{
class: ['gl-white-space-pre-wrap', content.style],
},
});
content.text,
);
});
return h('div', { class: 'js-line log-line' }, [

View file

@ -1,5 +1,4 @@
export const BYTES_IN_KIB = 1024;
export const BYTES_IN_KB = 1000;
export const HIDDEN_CLASS = 'hidden';
export const TRUNCATE_WIDTH_DEFAULT_WIDTH = 80;
export const TRUNCATE_WIDTH_DEFAULT_FONT_SIZE = 12;

View file

@ -1,4 +1,4 @@
import { BYTES_IN_KIB, BYTES_IN_KB } from './constants';
import { BYTES_IN_KIB } from './constants';
import { sprintf, __ } from '~/locale';
/**
@ -34,18 +34,6 @@ export function formatRelevantDigits(number) {
return formattedNumber;
}
/**
* Utility function that calculates KB of the given bytes.
* Note: This method calculates KiloBytes as opposed to
* Kibibytes. For Kibibytes, bytesToKiB should be used.
*
* @param {Number} number bytes
* @return {Number} KiB
*/
export function bytesToKB(number) {
return number / BYTES_IN_KB;
}
/**
* Utility function that calculates KiB of the given bytes.
*

View file

@ -125,9 +125,6 @@ export default class ActivityCalendar {
this.renderMonths();
this.renderDayTitles();
this.renderKey();
// Init tooltips
$(`${container} .js-tooltip`).tooltip({ html: true });
}
// Add extra padding for the last month label if it is also the last column
@ -191,7 +188,8 @@ export default class ActivityCalendar {
stamp.count !== 0 ? this.color(Math.min(stamp.count, 40)) : '#ededed',
)
.attr('title', stamp => formatTooltipText(stamp))
.attr('class', 'user-contrib-cell js-tooltip')
.attr('class', 'user-contrib-cell has-tooltip')
.attr('data-html', true)
.attr('data-container', 'body')
.on('click', this.clickDay);
}
@ -279,9 +277,10 @@ export default class ActivityCalendar {
.attr('x', (color, i) => this.daySizeWithSpace * i)
.attr('y', 0)
.attr('fill', color => color)
.attr('class', 'js-tooltip')
.attr('class', 'has-tooltip')
.attr('title', (color, i) => keyValues[i])
.attr('data-container', 'body');
.attr('data-container', 'body')
.attr('data-html', true);
}
initColor() {

View file

@ -76,17 +76,17 @@ module IconsHelper
content_tag(:span, "", class: "gl-snippet-icon gl-snippet-icon-#{name}")
end
def audit_icon(names, options = {})
case names
def audit_icon(name, css_class: nil)
case name
when "standard"
names = "key"
name = "key"
when "two-factor"
names = "key"
name = "key"
when "google_oauth2"
names = "google"
name = "google"
end
options.include?(:base) ? fa_stacked_icon(names, options) : fa_icon(names, options)
sprite_icon(name, css_class: css_class)
end
def spinner(text = nil, visible = false)

View file

@ -3,7 +3,7 @@
module Clusters
module Applications
class Runner < ApplicationRecord
VERSION = '0.21.1'
VERSION = '0.22.0'
self.table_name = 'clusters_applications_runners'

View file

@ -5,7 +5,7 @@
- events.each do |event|
%li
%span.description
= audit_icon(event.details[:with], class: "gl-mr-2")
= audit_icon(event.details[:with], css_class: 'gl-mr-2')
= _('Signed in with %{authentication} authentication') % { authentication: event.details[:with]}
%span.float-right= time_ago_with_tooltip(event.created_at)

View file

@ -4,7 +4,6 @@
= form_for [@project, @merge_request], url: project_new_merge_request_path(@project), method: :get, html: { class: "merge-request-form js-requires-input" } do |f|
- if params[:nav_source].present?
= hidden_field_tag(:nav_source, params[:nav_source])
.hide.alert.alert-danger.mr-compare-errors
.js-merge-request-new-compare.row{ 'data-source-branch-url': project_new_merge_request_branch_from_path(@source_project), 'data-target-branch-url': project_new_merge_request_branch_to_path(@source_project) }
.col-lg-6
.card.card-new-merge-request

View file

@ -0,0 +1,6 @@
---
title: Do not convert unicode versions of trademark, copyright,
and registered trademark to emoji
merge_request: 45457
author:
type: fixed

View file

@ -1,5 +0,0 @@
---
title: Make URL links in job logs clickable
merge_request: 40175
author: Łukasz Groszkowski @falxcerebri
type: added

View file

@ -0,0 +1,5 @@
---
title: Use GitLab SVGs in audit_icon helper
merge_request: 45562
author:
type: changed

View file

@ -0,0 +1,5 @@
---
title: Update GitLab Runner Helm Chart to 0.22.0
merge_request: 45664
author:
type: other

View file

@ -0,0 +1,5 @@
---
title: Rename "a whole number" to "an integer number" in feature flags strategies
merge_request: 45444
author:
type: changed

View file

@ -304,7 +304,7 @@ Dynamic environments are a fundamental part of [Review apps](../review_apps/inde
#### Allowed variables
The `name` and `url` parameters for dynamic environments can use most available CI/CD variables,
The `name` and `url` keywords for dynamic environments can use most available CI/CD variables,
including:
- [Predefined environment variables](../variables/README.md#predefined-environment-variables)

View file

@ -56,7 +56,7 @@ below.
When you use this method, you have to specify `only: - merge_requests` for each job. In this
example, the pipeline contains a `test` job that is configured to run on merge requests.
The `build` and `deploy` jobs don't have the `only: - merge_requests` parameter,
The `build` and `deploy` jobs don't have the `only: - merge_requests` keyword,
so they will not run on merge requests.
```yaml
@ -81,8 +81,8 @@ deploy:
#### Excluding certain jobs
The behavior of the `only: [merge_requests]` parameter is such that _only_ jobs with
that parameter are run in the context of a merge request; no other jobs will be run.
The behavior of the `only: [merge_requests]` keyword is such that _only_ jobs with
that keyword are run in the context of a merge request; no other jobs will be run.
However, you can invert this behavior and have all of your jobs run _except_
for one or two.

View file

@ -27,7 +27,7 @@ CircleCI's `config.yml` configuration file defines scripts, jobs, and workflows
### Jobs
In CircleCI, jobs are a collection of steps to perform a specific task. In GitLab, [jobs](../yaml/README.md#introduction) are also a fundamental element in the configuration file. The `checkout` parameter is not necessary in GitLab CI/CD as the repository is automatically fetched.
In CircleCI, jobs are a collection of steps to perform a specific task. In GitLab, [jobs](../yaml/README.md#introduction) are also a fundamental element in the configuration file. The `checkout` keyword is not necessary in GitLab CI/CD as the repository is automatically fetched.
CircleCI example job definition:

View file

@ -157,7 +157,7 @@ For each `var` or `file_var`, a key and value are required.
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/7931) in GitLab 8.15.
Manual actions, configured using the [`when:manual`](../yaml/README.md#whenmanual) parameter,
Manual actions, configured using the [`when:manual`](../yaml/README.md#whenmanual) keyword,
allow you to require manual interaction before moving forward in the pipeline.
You can do this straight from the pipeline graph. Just click the play button
@ -394,7 +394,7 @@ for a single run of the manual job.
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/21767) in GitLab 11.4.
When you do not want to run a job immediately, you can use the [`when:delayed`](../yaml/README.md#whendelayed) parameter to
When you do not want to run a job immediately, you can use the [`when:delayed`](../yaml/README.md#whendelayed) keyword to
delay a job's execution for a certain period.
This is especially useful for timed incremental rollout where new code is rolled out gradually.

View file

@ -44,7 +44,7 @@ are relative to the repository that was cloned during the build.
By default, the artifacts upload when the job succeeds. You can also set artifacts to upload
when the job fails, or always, by using [`artifacts:when`](../yaml/README.md#artifactswhen)
parameter. GitLab keeps these uploaded artifacts for 1 week, as defined
keyword. GitLab keeps these uploaded artifacts for 1 week, as defined
by the `expire_in` definition. You can keep the artifacts from expiring
via the [web interface](#browsing-artifacts). If the expiry time is not defined, it defaults
to the [instance wide setting](../../user/admin_area/settings/continuous_integration.md#default-artifacts-expiration).

View file

@ -93,11 +93,11 @@ If you get validation error when using specific values (for example, `true` or `
- Quote them.
- Change them to a different form. For example, `/bin/true`.
## Configuration parameters
## Job keywords
A job is defined as a list of parameters that define the job's behavior.
A job is defined as a list of keywords that define the job's behavior.
The following table lists available parameters for jobs:
The following table lists available keywords for jobs:
| Keyword | Description |
|:---------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@ -130,17 +130,17 @@ The following table lists available parameters for jobs:
| [`variables`](#variables) | Define job variables on a job level. |
| [`when`](#when) | When to run job. Also available: `when:manual` and `when:delayed`. |
## Global parameters
## Global keywords
Some parameters must be defined at a global level, affecting all jobs in the pipeline.
Some keywords must be defined at a global level, affecting all jobs in the pipeline.
### Global defaults
Some parameters can be set globally as the default for all jobs using the
`default:` keyword. Default parameters can then be overridden by job-specific
Some keywords can be set globally as the default for all jobs using the
`default:` keyword. Default keywords can then be overridden by job-specific
configuration.
The following job parameters can be defined inside a `default:` block:
The following job keywords can be defined inside a `default:` block:
- [`image`](#image)
- [`services`](#services)
@ -173,20 +173,20 @@ rspec 2.6:
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/207484) in GitLab 12.9.
You can disable inheritance of globally defined defaults
and variables with the `inherit:` parameter.
and variables with the `inherit:` keyword.
To enable or disable the inheritance of all `variables:` or `default:` parameters, use the following format:
To enable or disable the inheritance of all `variables:` or `default:` keywords, use the following format:
- `default: true` or `default: false`
- `variables: true` or `variables: false`
To inherit only a subset of `default:` parameters or `variables:`, specify what
To inherit only a subset of `default:` keywords or `variables:`, specify what
you wish to inherit. Anything not listed is **not** inherited. Use
one of the following formats:
```yaml
inherit:
default: [parameter1, parameter2]
default: [keyword1, keyword2]
variables: [VARIABLE1, VARIABLE2]
```
@ -195,8 +195,8 @@ Or:
```yaml
inherit:
default:
- parameter1
- parameter2
- keyword1
- keyword2
variables:
- VARIABLE1
- VARIABLE2
@ -405,7 +405,7 @@ of using YAML anchors, you can use the [`extends` keyword](#extends).
`include` supports the following inclusion methods:
| Method | Description |
| Keyword | Method |
|:--------------------------------|:------------------------------------------------------------------|
| [`local`](#includelocal) | Include a file from the local project repository. |
| [`file`](#includefile) | Include a file from a different project repository. |
@ -548,9 +548,9 @@ for resolving all files is 30 seconds.
There is a list of [additional `includes` examples](includes.md) available.
## Parameter details
## Keyword details
The following are detailed explanations for parameters used to configure CI/CD pipelines.
The following are detailed explanations for keywords used to configure CI/CD pipelines.
### `image`
@ -619,7 +619,7 @@ job:
[YAML anchors for scripts](#yaml-anchors-for-script) are available.
This parameter can also contain several commands using an array:
This keyword can also contain several commands using an array:
```yaml
job:
@ -1567,7 +1567,7 @@ The [`rules`](#rules) syntax is an improved, more powerful solution for defining
when jobs should run or not. Consider using `rules` instead of `only/except` to get
the most out of your pipelines.
`only` and `except` are two parameters that set a job policy to limit when
`only` and `except` are two keywords that set a job policy to limit when
jobs are created:
1. `only` defines the names of branches and tags the job runs for.
@ -1695,7 +1695,7 @@ while just `/issue/` would also match a branch called `severe-issues`.
#### Supported `only`/`except` regexp syntax
In GitLab 11.9.4, GitLab began internally converting the regexp used
in `only` and `except` parameters to [RE2](https://github.com/google/re2/wiki/Syntax).
in `only` and `except` keywords to [RE2](https://github.com/google/re2/wiki/Syntax).
[RE2](https://github.com/google/re2/wiki/Syntax) limits the set of available features
due to computational complexity, and some features, like negative lookaheads, became unavailable.
@ -2489,7 +2489,7 @@ deployment to the `production` environment.
> - Before GitLab 8.11, the name of an environment could be defined as a string like
> `environment: production`. The recommended way now is to define it under the
> `name` keyword.
> - The `name` parameter can use any of the defined CI variables,
> - The `name` keyword can use any of the defined CI variables,
> including predefined, secure variables and `.gitlab-ci.yml` [`variables`](#variables).
> You however can't use variables defined under `script`.
@ -2525,7 +2525,7 @@ deploy to production:
> - Introduced in GitLab 8.11.
> - Before GitLab 8.11, the URL could be added only in GitLab's UI. The
> recommended way now is to define it in `.gitlab-ci.yml`.
> - The `url` parameter can use any of the defined CI variables,
> - The `url` keyword can use any of the defined CI variables,
> including predefined, secure variables and `.gitlab-ci.yml` [`variables`](#variables).
> You however can't use variables defined under `script`.
@ -2679,7 +2679,7 @@ To follow progress on support for GitLab-managed clusters, see the
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/21971) in GitLab 8.12 and GitLab Runner 1.6.
> - The `$CI_ENVIRONMENT_SLUG` was [introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/22864) in GitLab 8.15.
> - The `name` and `url` parameters can use any of the defined CI variables,
> - The `name` and `url` keywords can use any of the defined CI variables,
> including predefined, secure variables and `.gitlab-ci.yml` [`variables`](#variables).
> You however can't use variables defined under `script`.
@ -2778,7 +2778,7 @@ The cache is shared between jobs, so if you're using different
paths for different jobs, you should also set a different `cache:key`.
Otherwise cache content can be overwritten.
The `key` parameter defines the affinity of caching between jobs.
The `key` keyword defines the affinity of caching between jobs.
You can have a single cache for all jobs, cache per-job, cache per-branch,
or any other way that fits your workflow. This way, you can fine tune caching,
including caching data between different jobs or even different branches.
@ -2847,7 +2847,7 @@ use the new cache, instead of rebuilding the dependencies.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/18986) in GitLab v12.5.
When you want to combine a prefix with the SHA computed for `cache:key:files`,
use the `prefix` parameter with `key:files`.
use the `prefix` keyword with `key:files`.
For example, if you add a `prefix` of `test`, the resulting key is: `test-feef9576d21ee9b6a32e30c5c79d0a0ceb68d1e5`.
If neither file was changed in any commits, the prefix is added to `default`, so the
key in the example would be `test-default`.
@ -3307,7 +3307,7 @@ It also exposes these reports in GitLab's UI (merge requests, pipeline views, an
These are the available report types:
| Parameter | Description |
| Keyword | Description |
|--------------------------------------------------------------------------------------------------------------------------------------|-------------|
| [`artifacts:reports:cobertura`](../pipelines/job_artifacts.md#artifactsreportscobertura) | The `cobertura` report collects Cobertura coverage XML files. |
| [`artifacts:reports:codequality`](../pipelines/job_artifacts.md#artifactsreportscodequality) | The `codequality` report collects CodeQuality issues. |
@ -3329,7 +3329,7 @@ These are the available report types:
> Introduced in GitLab 8.6 and GitLab Runner v1.1.1.
By default, all [`artifacts`](#artifacts) from previous [stages](#stages)
are passed to each job. However, you can use the `dependencies` parameter to
are passed to each job. However, you can use the `dependencies` keyword to
define a limited list of jobs to fetch artifacts from. You can also set a job to download no artifacts at all.
To use this feature, define `dependencies` in context of the job and pass
@ -3784,7 +3784,7 @@ starting, which reduces parallelization.
To force a rebuild of a specific branch, tag, or commit, you can use an API call
with a trigger token.
The trigger token is different than the [`trigger`](#trigger) parameter.
The trigger token is different than the [`trigger`](#trigger) keyword.
[Read more in the triggers documentation.](../triggers/README.md)
@ -4573,7 +4573,7 @@ feature. Anchors are only valid within the file they were defined in. Instead
of using YAML anchors, you can use the [`extends` keyword](#extends).
The following example uses anchors and map merging. It creates two jobs,
`test1` and `test2`, that inherit the parameters of `.job_template`, each
`test1` and `test2`, that inherit the `.job_template` configuration, each
with their own custom `script` defined:
```yaml
@ -4809,9 +4809,9 @@ This limitation does not affect any of the updated merge request pipelines.
All updated merge requests have a pipeline created when using
[pipelines for merge requests](../merge_request_pipelines/index.md).
## Deprecated parameters
## Deprecated keywords
The following parameters are deprecated.
The following keywords are deprecated.
### Globally-defined `types`

View file

@ -658,16 +658,20 @@ Review the general punctuation rules for the GitLab documentation in the
following table. Check specific punctuation rules for [lists](#lists) below.
Additional examples are available in the [Pajamas guide for punctuation](https://design.gitlab.com/content/punctuation/).
<!-- vale gitlab.Repetition = NO -->
| Rule | Example |
|------------------------------------------------------------------|--------------------------------------------------------|
| Always end full sentences with a period. | _For a complete overview, read through this document._ |
| Always add a space after a period when beginning a new sentence. | _For a complete overview, check this doc. For other references, check out this guide._ |
| Do not use double spaces. (Tested in [`SentenceSpacing.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/.vale/gitlab/SentenceSpacing.yml).) | --- |
| Do not use tabs for indentation. Use spaces instead. You can configure your code editor to output spaces instead of tabs when pressing the tab key. | --- |
| Use serial commas ("Oxford commas") before the final 'and/or' in a list. (Tested in [`OxfordComma.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/.vale/gitlab/OxfordComma.yml).) | _You can create new issues, merge requests, and milestones._ |
| Use serial commas (_Oxford commas_) before the final _and_ or _or_ in a list of three or more items. (Tested in [`OxfordComma.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/.vale/gitlab/OxfordComma.yml).) | _You can create new issues, merge requests, and milestones._ |
| Always add a space before and after dashes when using it in a sentence (for replacing a comma, for example). | _You should try this - or not._ |
| Always use lowercase after a colon. | _Related Issues: a way to create a relationship between issues._ |
<!-- vale gitlab.Repetition = YES -->
### Placeholder text
Often in examples, a writer will provide a command or configuration that

View file

@ -618,7 +618,7 @@ each pipeline includes default variables defined in
Most of the jobs [extend from a few CI definitions](../ci/yaml/README.md#extends)
defined in [`.gitlab/ci/global.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/blob/master/.gitlab/ci/global.gitlab-ci.yml)
that are scoped to a single [configuration parameter](../ci/yaml/README.md#configuration-parameters).
that are scoped to a single [configuration keyword](../ci/yaml/README.md#job-keywords).
| Job definitions | Description |
|------------------|-------------|

View file

@ -8,6 +8,7 @@ module Banzai
# Based on HTML::Pipeline::EmojiFilter
class EmojiFilter < HTML::Pipeline::Filter
IGNORED_ANCESTOR_TAGS = %w(pre code tt).to_set
IGNORE_UNICODE_EMOJIS = %w(™ © ®).freeze
def call
doc.search(".//text()").each do |node|
@ -60,7 +61,11 @@ module Banzai
# Build a regexp that matches all valid unicode emojis names.
def self.emoji_unicode_pattern
@emoji_unicode_pattern ||= /(#{Gitlab::Emoji.emojis_unicodes.map { |moji| Regexp.escape(moji) }.join('|')})/
@emoji_unicode_pattern ||=
begin
filtered_emojis = Gitlab::Emoji.emojis_unicodes - IGNORE_UNICODE_EMOJIS
/(#{filtered_emojis.map { |moji| Regexp.escape(moji) }.join('|')})/
end
end
private

View file

@ -5501,6 +5501,9 @@ msgstr ""
msgid "Cluster type must be specificed for Stages::ClusterEndpointInserter"
msgstr ""
msgid "ClusterAgents|An error occurred while loading your GitLab Agents"
msgstr ""
msgid "ClusterAgents|Configuration"
msgstr ""
@ -9982,7 +9985,10 @@ msgstr ""
msgid "Enter a number"
msgstr ""
msgid "Enter a whole number between 0 and 100"
msgid "Enter an integer number between 0 and 100"
msgstr ""
msgid "Enter an integer number number between 0 and 100"
msgstr ""
msgid "Enter at least three characters to search"
@ -11343,7 +11349,7 @@ msgstr ""
msgid "FeatureFlags|Percent rollout (logged in users)"
msgstr ""
msgid "FeatureFlags|Percent rollout must be a whole number between 0 and 100"
msgid "FeatureFlags|Percent rollout must be an integer number between 0 and 100"
msgstr ""
msgid "FeatureFlags|Protected"
@ -19102,7 +19108,7 @@ msgstr ""
msgid "People without permission will never get a notification."
msgstr ""
msgid "Percent rollout must be a whole number between 0 and 100"
msgid "Percent rollout must be an integer number between 0 and 100"
msgstr ""
msgid "Percentage"

View file

@ -105,7 +105,6 @@
"jszip": "^3.1.3",
"jszip-utils": "^0.0.2",
"katex": "^0.10.0",
"linkifyjs": "^2.1.9",
"lodash": "^4.17.20",
"marked": "^0.3.12",
"mermaid": "^8.5.2",

View file

@ -42,7 +42,7 @@ RSpec.describe 'Contributions Calendar', :js do
"#{contributions} #{'contribution'.pluralize(contributions)}"
end
"#{get_cell_color_selector(contributions)}[data-original-title='#{contribution_text}<br />#{date}']"
"#{get_cell_color_selector(contributions)}[title='#{contribution_text}<br />#{date}']"
end
def push_code_contribution

View file

@ -100,7 +100,7 @@ describe('feature_flags/components/strategies/flexible_rollout.vue', () => {
});
});
describe('with percentage that is not a whole number', () => {
describe('with percentage that is not an integer number', () => {
beforeEach(() => {
wrapper = factory({ strategy: { parameters: { rollout: '3.14' } } });
});

View file

@ -63,7 +63,7 @@ describe('~/feature_flags/components/strategies/percent_rollout.vue', () => {
});
});
describe('with percentage that is not a whole number', () => {
describe('with percentage that is not an integer number', () => {
beforeEach(() => {
wrapper = factory({ strategy: { parameters: { percentage: '3.14' } } });

View file

@ -2,25 +2,21 @@ import { shallowMount } from '@vue/test-utils';
import Line from '~/jobs/components/log/line.vue';
import LineNumber from '~/jobs/components/log/line_number.vue';
const httpUrl = 'http://example.com';
const httpsUrl = 'https://example.com';
const mockProps = ({ text = 'Running with gitlab-runner 12.1.0 (de7731dd)' } = {}) => ({
line: {
content: [
{
text,
style: 'term-fg-l-green',
},
],
lineNumber: 0,
},
path: '/jashkenas/underscore/-/jobs/335',
});
describe('Job Log Line', () => {
let wrapper;
let data;
const data = {
line: {
content: [
{
text: 'Running with gitlab-runner 12.1.0 (de7731dd)',
style: 'term-fg-l-green',
},
],
lineNumber: 0,
},
path: '/jashkenas/underscore/-/jobs/335',
};
const createComponent = (props = {}) => {
wrapper = shallowMount(Line, {
@ -31,7 +27,6 @@ describe('Job Log Line', () => {
};
beforeEach(() => {
data = mockProps();
createComponent(data);
});
@ -50,38 +45,4 @@ describe('Job Log Line', () => {
it('renders the provided style as a class attribute', () => {
expect(wrapper.find('span').classes()).toContain(data.line.content[0].style);
});
describe('when the line contains a link', () => {
const findLink = () => wrapper.find('span a');
it('renders an http link', () => {
createComponent(mockProps({ text: httpUrl }));
expect(findLink().text()).toBe(httpUrl);
expect(findLink().attributes().href).toEqual(httpUrl);
});
it('renders an https link', () => {
createComponent(mockProps({ text: httpsUrl }));
expect(findLink().text()).toBe(httpsUrl);
expect(findLink().attributes().href).toEqual(httpsUrl);
});
it('renders a link with rel nofollow and noopener', () => {
createComponent(mockProps({ text: httpsUrl }));
expect(findLink().attributes().rel).toBe('nofollow noopener');
});
test.each`
type | text
${'ftp'} | ${'ftp://example.com/file'}
${'email'} | ${'email@example.com'}
${'no scheme'} | ${'example.com/page'}
`('does not render a $type link', ({ text }) => {
createComponent(mockProps({ text }));
expect(findLink().exists()).toBe(false);
});
});
});

View file

@ -1,6 +1,5 @@
import {
formatRelevantDigits,
bytesToKB,
bytesToKiB,
bytesToMiB,
bytesToGiB,
@ -55,16 +54,6 @@ describe('Number Utils', () => {
});
});
describe('bytesToKB', () => {
it.each`
input | output
${1000} | ${1}
${1024} | ${1.024}
`('returns $output KB for $input bytes', ({ input, output }) => {
expect(bytesToKB(input)).toBe(output);
});
});
describe('bytesToKiB', () => {
it('calculates KiB for the given bytes', () => {
expect(bytesToKiB(1024)).toEqual(1);

View file

@ -97,19 +97,19 @@ RSpec.describe IconsHelper do
it 'returns right icon name for standard auth' do
icon_name = 'standard'
expect(audit_icon(icon_name).to_s)
.to eq '<i class="fa fa-key"></i>'
.to eq sprite_icon('key')
end
it 'returns right icon name for two-factor auth' do
icon_name = 'two-factor'
expect(audit_icon(icon_name).to_s)
.to eq '<i class="fa fa-key"></i>'
.to eq sprite_icon('key')
end
it 'returns right icon name for google_oauth2 auth' do
icon_name = 'google_oauth2'
expect(audit_icon(icon_name).to_s)
.to eq '<i class="fa fa-google"></i>'
.to eq sprite_icon('google')
end
end

View file

@ -21,6 +21,20 @@ RSpec.describe Banzai::Filter::EmojiFilter do
expect(doc.to_html).to match Regexp.escape(exp)
end
it 'ignores unicode versions of trademark, copyright, and registered trademark' do
exp = act = '<p>™ © ®</p>'
doc = filter(act)
expect(doc.to_html).to match Regexp.escape(exp)
end
it 'replaces name versions of trademark, copyright, and registered trademark' do
doc = filter('<p>:tm: :copyright: :registered:</p>')
expect(doc.css('gl-emoji')[0].text).to eq '™'
expect(doc.css('gl-emoji')[1].text).to eq '©'
expect(doc.css('gl-emoji')[2].text).to eq '®'
end
it 'correctly encodes the URL' do
doc = filter('<p>:+1:</p>')
expect(doc.css('gl-emoji').first.text).to eq '👍'

View file

@ -135,7 +135,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
describe '#full_access_token' do
let(:project) { create(:project) }
let_it_be(:project) { create(:project) }
let(:token) { described_class.full_access_token(project.full_path) }
subject { { token: token } }
@ -148,7 +148,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
describe '#pull_access_token' do
let(:project) { create(:project) }
let_it_be(:project) { create(:project) }
let(:token) { described_class.pull_access_token(project.full_path) }
subject { { token: token } }
@ -161,7 +161,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'user authorization' do
let(:current_user) { create(:user) }
let_it_be(:current_user) { create(:user) }
context 'for registry catalog' do
let(:current_params) do
@ -175,14 +175,14 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for private project' do
let(:project) { create(:project) }
let_it_be(:project) { create(:project) }
context 'allow to use scope-less authentication' do
it_behaves_like 'a valid token'
end
context 'allow developer to push images' do
before do
before_all do
project.add_developer(current_user)
end
@ -195,7 +195,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'disallow developer to delete images' do
before do
before_all do
project.add_developer(current_user)
end
@ -222,7 +222,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'disallow developer to delete images since registry 2.7' do
before do
before_all do
project.add_developer(current_user)
end
@ -235,7 +235,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'allow reporter to pull images' do
before do
before_all do
project.add_reporter(current_user)
end
@ -250,7 +250,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'disallow reporter to delete images' do
before do
before_all do
project.add_reporter(current_user)
end
@ -263,7 +263,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'disallow reporter to delete images since registry 2.7' do
before do
before_all do
project.add_reporter(current_user)
end
@ -276,7 +276,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'return a least of privileges' do
before do
before_all do
project.add_reporter(current_user)
end
@ -289,7 +289,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'disallow guest to pull or push images' do
before do
before_all do
project.add_guest(current_user)
end
@ -302,7 +302,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'disallow guest to delete images' do
before do
before_all do
project.add_guest(current_user)
end
@ -315,7 +315,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'disallow guest to delete images since registry 2.7' do
before do
before_all do
project.add_guest(current_user)
end
@ -329,7 +329,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for public project' do
let(:project) { create(:project, :public) }
let_it_be(:project) { create(:project, :public) }
context 'allow anyone to pull images' do
let(:current_params) do
@ -378,7 +378,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for internal project' do
let(:project) { create(:project, :internal) }
let_it_be(:project) { create(:project, :internal) }
context 'for internal user' do
context 'allow anyone to pull images' do
@ -420,7 +420,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
context 'for external user' do
context 'disallow anyone to pull or push images' do
let(:current_user) { create(:user, external: true) }
let_it_be(:current_user) { create(:user, external: true) }
let(:current_params) do
{ scopes: ["repository:#{project.full_path}:pull,push"] }
end
@ -430,7 +430,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'disallow anyone to delete images' do
let(:current_user) { create(:user, external: true) }
let_it_be(:current_user) { create(:user, external: true) }
let(:current_params) do
{ scopes: ["repository:#{project.full_path}:*"] }
end
@ -440,7 +440,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'disallow anyone to delete images since registry 2.7' do
let(:current_user) { create(:user, external: true) }
let_it_be(:current_user) { create(:user, external: true) }
let(:current_params) do
{ scopes: ["repository:#{project.full_path}:delete"] }
end
@ -453,14 +453,14 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'delete authorized as maintainer' do
let(:current_project) { create(:project) }
let(:current_user) { create(:user) }
let_it_be(:current_project) { create(:project) }
let_it_be(:current_user) { create(:user) }
let(:authentication_abilities) do
[:admin_container_image]
end
before do
before_all do
current_project.add_maintainer(current_user)
end
@ -488,14 +488,14 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'build authorized as user' do
let(:current_project) { create(:project) }
let(:current_user) { create(:user) }
let_it_be(:current_project) { create(:project) }
let_it_be(:current_user) { create(:user) }
let(:authentication_abilities) do
[:build_read_container_image, :build_create_container_image, :build_destroy_container_image]
end
before do
before_all do
current_project.add_developer(current_user)
end
@ -550,7 +550,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'allow for public' do
let(:project) { create(:project, :public) }
let_it_be(:project) { create(:project, :public) }
it_behaves_like 'a pullable'
it_behaves_like 'not a container repository factory'
@ -563,7 +563,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'when you are member' do
before do
before_all do
project.add_developer(current_user)
end
@ -572,7 +572,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'when you are owner' do
let(:project) { create(:project, namespace: current_user.namespace) }
let_it_be(:project) { create(:project, namespace: current_user.namespace) }
it_behaves_like 'a pullable'
it_behaves_like 'not a container repository factory'
@ -580,12 +580,12 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for private' do
let(:project) { create(:project, :private) }
let_it_be(:project) { create(:project, :private) }
it_behaves_like 'pullable for being team member'
context 'when you are admin' do
let(:current_user) { create(:admin) }
let_it_be(:current_user) { create(:admin) }
context 'when you are not member' do
it_behaves_like 'an inaccessible'
@ -593,7 +593,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'when you are member' do
before do
before_all do
project.add_developer(current_user)
end
@ -602,7 +602,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'when you are owner' do
let(:project) { create(:project, namespace: current_user.namespace) }
let_it_be(:project) { create(:project, namespace: current_user.namespace) }
it_behaves_like 'a pullable'
it_behaves_like 'not a container repository factory'
@ -618,9 +618,9 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
context 'disallow for all' do
context 'when you are member' do
let(:project) { create(:project, :public) }
let_it_be(:project) { create(:project, :public) }
before do
before_all do
project.add_developer(current_user)
end
@ -629,7 +629,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'when you are owner' do
let(:project) { create(:project, :public, namespace: current_user.namespace) }
let_it_be(:project) { create(:project, :public, namespace: current_user.namespace) }
it_behaves_like 'an inaccessible'
it_behaves_like 'not a container repository factory'
@ -639,7 +639,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for project without container registry' do
let(:project) { create(:project, :public, container_registry_enabled: false) }
let_it_be(:project) { create(:project, :public, container_registry_enabled: false) }
before do
project.update(container_registry_enabled: false)
@ -656,7 +656,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for project that disables repository' do
let(:project) { create(:project, :public, :repository_disabled) }
let_it_be(:project) { create(:project, :public, :repository_disabled) }
context 'disallow when pulling' do
let(:current_params) do
@ -670,8 +670,8 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'registry catalog browsing authorized as admin' do
let(:current_user) { create(:user, :admin) }
let(:project) { create(:project, :public) }
let_it_be(:current_user) { create(:user, :admin) }
let_it_be(:project) { create(:project, :public) }
let(:current_params) do
{ scopes: ["registry:catalog:*"] }
@ -681,8 +681,8 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'support for multiple scopes' do
let(:internal_project) { create(:project, :internal) }
let(:private_project) { create(:project, :private) }
let_it_be(:internal_project) { create(:project, :internal) }
let_it_be(:private_project) { create(:project, :private) }
let(:current_params) do
{
@ -694,7 +694,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'user has access to all projects' do
let(:current_user) { create(:user, :admin) }
let_it_be(:current_user) { create(:user, :admin) }
it_behaves_like 'a browsable' do
let(:access) do
@ -711,7 +711,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'user only has access to internal project' do
let(:current_user) { create(:user) }
let_it_be(:current_user) { create(:user) }
it_behaves_like 'a browsable' do
let(:access) do
@ -747,7 +747,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for private project' do
let(:project) { create(:project, :private) }
let_it_be(:project) { create(:project, :private) }
let(:current_params) do
{ scopes: ["repository:#{project.full_path}:pull"] }
@ -757,7 +757,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for public project' do
let(:project) { create(:project, :public) }
let_it_be(:project) { create(:project, :public) }
context 'when pulling and pushing' do
let(:current_params) do
@ -806,7 +806,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for public project' do
let(:project) { create(:project, :public) }
let_it_be(:project) { create(:project, :public) }
context 'when pulling' do
it_behaves_like 'a pullable'
@ -824,7 +824,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for internal project' do
let(:project) { create(:project, :internal) }
let_it_be(:project) { create(:project, :internal) }
context 'when pulling' do
it_behaves_like 'a pullable'
@ -842,7 +842,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for private project' do
let(:project) { create(:project, :private) }
let_it_be(:project) { create(:project, :private) }
context 'when pulling' do
it_behaves_like 'a pullable'
@ -880,7 +880,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for public project' do
let(:project) { create(:project, :public) }
let_it_be(:project) { create(:project, :public) }
context 'when pulling' do
it_behaves_like 'a pullable'
@ -890,7 +890,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for internal project' do
let(:project) { create(:project, :internal) }
let_it_be(:project) { create(:project, :internal) }
context 'when pulling' do
it_behaves_like 'an inaccessible'
@ -900,7 +900,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for private project' do
let(:project) { create(:project, :internal) }
let_it_be(:project) { create(:project, :internal) }
context 'when pulling' do
it_behaves_like 'an inaccessible'
@ -918,10 +918,10 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'when deploy token is not related to the project' do
let(:current_user) { create(:deploy_token, read_registry: false) }
let_it_be(:current_user) { create(:deploy_token, read_registry: false) }
context 'for public project' do
let(:project) { create(:project, :public) }
let_it_be(:project) { create(:project, :public) }
context 'when pulling' do
it_behaves_like 'a pullable'
@ -929,7 +929,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for internal project' do
let(:project) { create(:project, :internal) }
let_it_be(:project) { create(:project, :internal) }
context 'when pulling' do
it_behaves_like 'an inaccessible'
@ -937,7 +937,7 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'for private project' do
let(:project) { create(:project, :internal) }
let_it_be(:project) { create(:project, :internal) }
context 'when pulling' do
it_behaves_like 'an inaccessible'
@ -949,19 +949,19 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
let(:current_user) { create(:deploy_token, :revoked, projects: [project]) }
context 'for public project' do
let(:project) { create(:project, :public) }
let_it_be(:project) { create(:project, :public) }
it_behaves_like 'a pullable'
end
context 'for internal project' do
let(:project) { create(:project, :internal) }
let_it_be(:project) { create(:project, :internal) }
it_behaves_like 'an inaccessible'
end
context 'for private project' do
let(:project) { create(:project, :internal) }
let_it_be(:project) { create(:project, :internal) }
it_behaves_like 'an inaccessible'
end
@ -969,14 +969,13 @@ RSpec.describe Auth::ContainerRegistryAuthenticationService do
end
context 'user authorization' do
let(:current_user) { create(:user) }
let_it_be(:current_user) { create(:user) }
context 'with multiple scopes' do
let(:project) { create(:project) }
let(:project2) { create }
let_it_be(:project) { create(:project) }
context 'allow developer to push images' do
before do
before_all do
project.add_developer(current_user)
end

View file

@ -7550,11 +7550,6 @@ linkify-it@^2.0.0:
dependencies:
uc.micro "^1.0.1"
linkifyjs@^2.1.9:
version "2.1.9"
resolved "https://registry.yarnpkg.com/linkifyjs/-/linkifyjs-2.1.9.tgz#af06e45a2866ff06c4766582590d098a4d584702"
integrity sha512-74ivurkK6WHvHFozVaGtQWV38FzBwSTGNmJolEgFp7QgR2bl6ArUWlvT4GcHKbPe1z3nWYi+VUdDZk16zDOVug==
load-json-file@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0"