Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2021-03-18 15:09:04 +00:00
parent 19d46f60a3
commit dfda8b7e77
147 changed files with 850 additions and 520 deletions

View file

@ -19,6 +19,17 @@ export default class FileTemplateSelector {
this.$dropdownToggleText = this.$wrapper.find('.dropdown-toggle-text');
this.initDropdown();
this.selectInitialTemplate();
}
selectInitialTemplate() {
const template = this.$dropdown.data('selected');
if (!template) {
return;
}
this.mediator.selectTemplateFile(this, template);
}
show() {

View file

@ -485,9 +485,7 @@ export default {
<template #upload-text="{ openFileUpload }">
<gl-sprintf :message="$options.i18n.dropzoneDescriptionText">
<template #link="{ content }">
<gl-link @click.stop="openFileUpload">
{{ content }}
</gl-link>
<gl-link @click.stop="openFileUpload">{{ content }}</gl-link>
</template>
</gl-sprintf>
</template>

View file

@ -2,7 +2,7 @@ import { escape, minBy } from 'lodash';
import emojiAliases from 'emojis/aliases.json';
import AccessorUtilities from '../lib/utils/accessor';
import axios from '../lib/utils/axios_utils';
import { CATEGORY_ICON_MAP } from './constants';
import { CATEGORY_ICON_MAP, FREQUENTLY_USED_KEY } from './constants';
let emojiMap = null;
let validEmojiNames = null;
@ -162,6 +162,9 @@ let emojiCategoryMap;
export function getEmojiCategoryMap() {
if (!emojiCategoryMap) {
emojiCategoryMap = CATEGORY_NAMES.reduce((acc, category) => {
if (category === FREQUENTLY_USED_KEY) {
return acc;
}
return { ...acc, [category]: [] };
}, {});
Object.keys(emojiMap).forEach((name) => {

View file

@ -481,18 +481,6 @@ export default {
name="project[project_feature_attributes][forking_access_level]"
/>
</project-setting-row>
<project-setting-row
ref="pipeline-settings"
:label="s__('ProjectSettings|Pipelines')"
:help-text="s__('ProjectSettings|Build, test, and deploy your changes.')"
>
<project-feature-setting
v-model="buildsAccessLevel"
:options="repoFeatureAccessLevelOptions"
:disabled-input="!repositoryEnabled"
name="project[project_feature_attributes][builds_access_level]"
/>
</project-setting-row>
<project-setting-row
v-if="registryAvailable"
ref="container-registry-settings"
@ -566,6 +554,18 @@ export default {
/>
</project-setting-row>
</div>
<project-setting-row
ref="pipeline-settings"
:label="__('CI/CD')"
:help-text="s__('ProjectSettings|Build, test, and deploy your changes.')"
>
<project-feature-setting
v-model="buildsAccessLevel"
:options="repoFeatureAccessLevelOptions"
:disabled-input="!repositoryEnabled"
name="project[project_feature_attributes][builds_access_level]"
/>
</project-setting-row>
<project-setting-row
ref="analytics-settings"
:label="s__('ProjectSettings|Analytics')"

View file

@ -447,7 +447,7 @@ export default {
<gl-button
type="submit"
category="primary"
variant="success"
variant="confirm"
class="js-no-auto-disable"
data-qa-selector="run_pipeline_button"
data-testid="run_pipeline_button"

View file

@ -0,0 +1,35 @@
/**
* Return the union of the given components' props options. Required props take
* precendence over non-required props of the same name.
*
* This makes two assumptions:
* - All given components define their props in verbose object format.
* - The components all agree on the `type` of a common prop.
*
* @param {object[]} components The components to derive the union from.
* @returns {object} The union of the props of the given components.
*/
export const propsUnion = (components) =>
components.reduce((acc, component) => {
Object.entries(component.props ?? {}).forEach(([propName, propOptions]) => {
if (process.env.NODE_ENV !== 'production') {
if (typeof propOptions !== 'object' || !('type' in propOptions)) {
throw new Error(
`Cannot create props union: expected verbose prop options for prop "${propName}"`,
);
}
if (propName in acc && acc[propName]?.type !== propOptions?.type) {
throw new Error(
`Cannot create props union: incompatible prop types for prop "${propName}"`,
);
}
}
if (!(propName in acc) || propOptions.required) {
acc[propName] = propOptions;
}
});
return acc;
}, {});

View file

@ -17,6 +17,7 @@ class NotesFinder
# target_id: integer
# last_fetched_at: time
# search: string
# sort: string
#
def initialize(current_user, params = {})
@project = params[:project]
@ -29,8 +30,7 @@ class NotesFinder
notes = init_collection
notes = since_fetch_at(notes)
notes = notes.with_notes_filter(@params[:notes_filter]) if notes_filter?
notes.fresh
sort(notes)
end
def target
@ -173,6 +173,14 @@ class NotesFinder
def notes_filter?
@params[:notes_filter].present?
end
def sort(notes)
sort = @params[:sort].presence
return notes.fresh unless sort
notes.order_by(sort)
end
end
NotesFinder.prepend_if_ee('EE::NotesFinder')

View file

@ -68,25 +68,6 @@ class BulkImports::Entity < ApplicationRecord
end
end
def update_tracker_for(relation:, has_next_page:, next_page: nil)
attributes = {
relation: relation,
has_next_page: has_next_page,
next_page: next_page,
bulk_import_entity_id: id
}
trackers.upsert(attributes, unique_by: %i[bulk_import_entity_id relation])
end
def has_next_page?(relation)
trackers.find_by(relation: relation)&.has_next_page
end
def next_page_for(relation)
trackers.find_by(relation: relation)&.next_page
end
private
def validate_parent_is_a_group

View file

@ -3,6 +3,8 @@
class BulkImports::Tracker < ApplicationRecord
self.table_name = 'bulk_import_trackers'
alias_attribute :pipeline_name, :relation
belongs_to :entity,
class_name: 'BulkImports::Entity',
foreign_key: :bulk_import_entity_id,
@ -28,6 +30,10 @@ class BulkImports::Tracker < ApplicationRecord
end
event :finish do
# When applying the concurrent model,
# remove the created => finished transaction
# https://gitlab.com/gitlab-org/gitlab/-/issues/323384
transition created: :finished
transition started: :finished
transition failed: :failed
transition skipped: :skipped

View file

@ -9,6 +9,7 @@ module Sortable
included do
scope :with_order_id_desc, -> { order(self.arel_table['id'].desc) }
scope :with_order_id_asc, -> { order(self.arel_table['id'].asc) }
scope :order_id_desc, -> { reorder(self.arel_table['id'].desc) }
scope :order_id_asc, -> { reorder(self.arel_table['id'].asc) }
scope :order_created_desc, -> { reorder(self.arel_table['created_at'].desc) }

View file

@ -19,6 +19,7 @@ class Note < ApplicationRecord
include Gitlab::SQL::Pattern
include ThrottledTouch
include FromUnion
include Sortable
cache_markdown_field :note, pipeline: :note, issuable_state_filter_enabled: true
@ -103,10 +104,9 @@ class Note < ApplicationRecord
scope :system, -> { where(system: true) }
scope :user, -> { where(system: false) }
scope :common, -> { where(noteable_type: ["", nil]) }
scope :fresh, -> { order(created_at: :asc, id: :asc) }
scope :fresh, -> { order_created_asc.with_order_id_asc }
scope :updated_after, ->(time) { where('updated_at > ?', time) }
scope :with_updated_at, ->(time) { where(updated_at: time) }
scope :by_updated_at, -> { reorder(:updated_at, :id) }
scope :inc_author_project, -> { includes(:project, :author) }
scope :inc_author, -> { includes(:author) }
scope :inc_relations_for_view, -> do
@ -148,6 +148,8 @@ class Note < ApplicationRecord
after_commit :notify_after_destroy, on: :destroy
class << self
extend Gitlab::Utils::Override
def model_name
ActiveModel::Name.new(self, nil, 'note')
end
@ -204,6 +206,13 @@ class Note < ApplicationRecord
def search(query)
fuzzy_search(query, [:note])
end
# Override the `Sortable` module's `.simple_sorts` to remove name sorting,
# as a `Note` does not have any property that correlates to a "name".
override :simple_sorts
def simple_sorts
super.except('name_asc', 'name_desc')
end
end
# rubocop: disable CodeReuse/ServiceClass

View file

@ -196,10 +196,20 @@ class Wiki
def delete_page(page, message = nil)
return unless page
wiki.delete_page(page.path, commit_details(:deleted, message, page.title))
after_wiki_activity
if Feature.enabled?(:gitaly_replace_wiki_delete_page, user, default_enabled: :yaml)
capture_git_error(:deleted) do
repository.delete_file(user, page.path, **multi_commit_options(:deleted, message, page.title))
true
after_wiki_activity
true
end
else
wiki.delete_page(page.path, commit_details(:deleted, message, page.title))
after_wiki_activity
true
end
end
def page_title_and_dir(title)
@ -276,8 +286,20 @@ class Wiki
private
def multi_commit_options(action, message = nil, title = nil)
commit_message = build_commit_message(action, message, title)
git_user = Gitlab::Git::User.from_gitlab(user)
{
branch_name: repository.root_ref,
message: commit_message,
author_email: git_user.email,
author_name: git_user.name
}
end
def commit_details(action, message = nil, title = nil)
commit_message = message.presence || default_message(action, title)
commit_message = build_commit_message(action, message, title)
git_user = Gitlab::Git::User.from_gitlab(user)
Gitlab::Git::Wiki::CommitDetails.new(user.id,
@ -287,9 +309,26 @@ class Wiki
commit_message)
end
def build_commit_message(action, message, title)
message.presence || default_message(action, title)
end
def default_message(action, title)
"#{user.username} #{action} page: #{title}"
end
def capture_git_error(action, &block)
yield block
rescue Gitlab::Git::Index::IndexError,
Gitlab::Git::CommitError,
Gitlab::Git::PreReceiveError,
Gitlab::Git::CommandError,
ArgumentError => error
Gitlab::ErrorTracking.log_exception(error, action: action, wiki_id: id)
false
end
end
Wiki.prepend_if_ee('EE::Wiki')

View file

@ -24,7 +24,7 @@ module Ci
def execute(params = {})
@metrics.increment_queue_operation(:queue_attempt)
@metrics.observe_queue_time do
@metrics.observe_queue_time(:process) do
process_queue(params)
end
end
@ -110,7 +110,7 @@ module Ci
end
if Feature.enabled?(:ci_register_job_service_one_by_one, runner, default_enabled: true)
build_ids = builds.pluck(:id)
build_ids = retrieve_queue(-> { builds.pluck(:id) })
@metrics.observe_queue_size(-> { build_ids.size })
@ -118,13 +118,21 @@ module Ci
yield Ci::Build.find(build_id)
end
else
@metrics.observe_queue_size(-> { builds.to_a.size })
builds_array = retrieve_queue(-> { builds.to_a })
builds.each(&blk)
@metrics.observe_queue_size(-> { builds_array.size })
builds_array.each(&blk)
end
end
# rubocop: enable CodeReuse/ActiveRecord
def retrieve_queue(queue_query_proc)
@metrics.observe_queue_time(:retrieve) do
queue_query_proc.call
end
end
def process_build(build, params)
unless build.pending?
@metrics.increment_queue_operation(:build_not_pending)

View file

@ -9,7 +9,7 @@ module Integrations
end
def note_events_data
note = NotesFinder.new(current_user, project: project, target: project).execute.reorder(nil).last # rubocop: disable CodeReuse/ActiveRecord
note = NotesFinder.new(current_user, project: project, target: project, sort: 'id_desc').execute.first
return { error: s_('TestHooks|Ensure the project has notes.') } unless note.present?

View file

@ -10,7 +10,7 @@
.metrics-dashboard-selector.js-metrics-dashboard-selector-wrap.js-template-selector-wrap.hidden
= dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-metrics-dashboard-selector qa-metrics-dashboard-dropdown', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: metrics_dashboard_ymls(@project) } } )
#gitlab-ci-yml-selector.gitlab-ci-yml-selector.js-gitlab-ci-yml-selector-wrap.js-template-selector-wrap.hidden
= dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-gitlab-ci-yml-selector qa-gitlab-ci-yml-dropdown', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: gitlab_ci_ymls(@project) } } )
= dropdown_tag(_("Apply a template"), options: { toggle_class: 'js-gitlab-ci-yml-selector qa-gitlab-ci-yml-dropdown', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: gitlab_ci_ymls(@project), selected: params[:template] } } )
- if experiment_enabled?(:ci_syntax_templates_b, subject: current_user) && @project.namespace.recent?
.gitlab-ci-syntax-yml-selector.js-gitlab-ci-syntax-yml-selector-wrap.js-template-selector-wrap.hidden
= dropdown_tag(_("Learn CI/CD syntax"), options: { toggle_class: 'js-gitlab-ci-syntax-yml-selector qa-gitlab-ci-syntax-yml-dropdown', dropdown_class: 'dropdown-menu-selectable', filter: true, placeholder: "Filter", data: { data: gitlab_ci_syntax_ymls(@project) } } )

View file

@ -5,11 +5,5 @@
- build_path_proc = ->(scope) { project_jobs_path(@project, scope: scope) }
= render "shared/builds/tabs", build_path_proc: build_path_proc, all_builds: @all_builds, scope: @scope
.nav-controls
- if can?(current_user, :update_build, @project)
= link_to project_ci_lint_path(@project), class: 'btn gl-button btn-default' do
%span
= _('CI Lint')
.content-list.builds-content-list
= render "table", builds: @builds, project: @project

View file

@ -11,4 +11,4 @@
%p.state-description.text-center
= s_('Logs|To see the logs, deploy your code to an environment.')
.text-center
= link_to s_('Environments|Learn about environments'), help_page_path('ci/environments/index.md'), class: 'gl-button btn btn-success'
= link_to s_('Environments|Learn about environments'), help_page_path('ci/environments/index.md'), class: 'gl-button btn btn-confirm'

View file

@ -1,2 +1,2 @@
= link_to project_settings_operations_path(@project), title: _('Configure Tracing'), class: 'gl-button btn btn-success' do
= link_to project_settings_operations_path(@project), title: _('Configure Tracing'), class: 'gl-button btn btn-confirm' do
= _('Add Jaeger URL')

View file

@ -0,0 +1,5 @@
---
title: Add created_at to job webhooks
merge_request: 56835
author:
type: changed

View file

@ -0,0 +1,5 @@
---
title: Move from btn-success to btn-confirm in logs directory
merge_request: 56211
author: Yogi (@yo)
type: changed

View file

@ -0,0 +1,5 @@
---
title: Move to confirm variant from success in pipeline_new directory
merge_request: 56199
author: Yogi (@yo)
type: changed

View file

@ -0,0 +1,5 @@
---
title: Move from btn-success to btn-confirm in tracings directory
merge_request: 56209
author: Yogi (@yo)
type: changed

View file

@ -0,0 +1,5 @@
---
title: 'BulkImports: Track pipeline worker with BulkImports::Tracker#status'
merge_request: 56242
author:
type: changed

View file

@ -0,0 +1,5 @@
---
title: Returns deep stringified keys for merged_yaml in linting endpoint
merge_request: 54336
author:
type: changed

View file

@ -0,0 +1,5 @@
---
title: Allow selecting a CI template by providing the template name as a URL param gitlab_ci_yml
merge_request: 56861
author:
type: added

View file

@ -0,0 +1,5 @@
---
title: Remove CI lint button from Jobs page nav
merge_request: 56854
author:
type: removed

View file

@ -0,0 +1,5 @@
---
title: Rename pipelines setting to CI/CD and move out from under repository section
merge_request: 56857
author:
type: changed

View file

@ -0,0 +1,8 @@
---
name: ci_runner_builds_queue_on_replicas
introduced_by_url:
rollout_issue_url:
milestone: '13.10'
type: development
group: group::continuous integration
default_enabled: false

View file

@ -0,0 +1,8 @@
---
name: gitaly_replace_wiki_delete_page
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56495
rollout_issue_url:
milestone: '13.10'
type: development
group: group::editor
default_enabled: false

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
type: concepts, howto
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
type: concepts, howto
---

View file

@ -92,3 +92,15 @@ GitLab provides the following information in its response for a given Agent acce
- Agent configuration Git repository. (The agent doesn't support per-folder authorization.)
- Agent name.
## Create an agent
You can create an agent by following the [user documentation](../../user/clusters/agent/index.md#create-an-agent-record-in-gitlab), or via Rails console:
```ruby
project = ::Project.find_by_full_path("path-to/your-configuration-project")
# agent-name should be the same as specified above in the config.yaml
agent = ::Clusters::Agent.create(name: "<agent-name>", project: project)
token = ::Clusters::AgentToken.create(agent: agent)
token.token # this will print out the token you need to use on the next step
```

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -381,7 +381,7 @@ Use `webpackChunkName` when generating dynamic imports as
it provides a deterministic filename for the chunk which can then be cached
in the browser across GitLab versions.
More information is available in [webpack's code splitting documentation](https://webpack.js.org/guides/code-splitting/#dynamic-imports).
More information is available in [webpack's code splitting documentation](https://webpack.js.org/guides/code-splitting/#dynamic-imports) and [vue's dynamic component documentation](https://vuejs.org/v2/guide/components-dynamic-async.html).
### Minimizing page size

View file

@ -255,7 +255,44 @@ For example use `%{created_at}` in Ruby but `%{createdAt}` in JavaScript. Make s
- In Vue:
See the section on [Vue component interpolation](#vue-components-interpolation).
Use the [`GlSprintf`](https://gitlab-org.gitlab.io/gitlab-ui/?path=/docs/utilities-sprintf--sentence-with-link) component if:
- you need to include child components in the translation string.
- you need to include HTML in your translation string.
- you are using `sprintf` and need to pass `false` as the third argument to
prevent it from escaping placeholder values.
For example:
```html
<gl-sprintf :message="s__('ClusterIntegration|Learn more about %{linkStart}zones%{linkEnd}')">
<template #link="{ content }">
<gl-link :href="somePath">{{ content }}</gl-link>
</template>
</gl-sprintf>
```
In other cases it may be simpler to use `sprintf`, perhaps in a computed
property. For example:
```html
<script>
import { __, sprintf } from '~/locale';
export default {
...
computed: {
userWelcome() {
sprintf(__('Hello %{username}'), { username: this.user.name });
}
}
...
}
</script>
<template>
<span>{{ userWelcome }}</span>
</template>
```
- In JavaScript (when Vue cannot be used):
@ -265,12 +302,10 @@ For example use `%{created_at}` in Ruby but `%{createdAt}` in JavaScript. Make s
sprintf(__('Hello %{username}'), { username: 'Joe' }); // => 'Hello Joe'
```
If you want to use markup within the translation and are using Vue, you
**must** use the [`gl-sprintf`](#vue-components-interpolation) component. If
for some reason you cannot use Vue, use `sprintf` and stop it from escaping
placeholder values by passing `false` as its third argument. You **must**
escape any interpolated dynamic values yourself, for instance using
`escape` from `lodash`.
If you need to use markup within the translation, use `sprintf` and stop it
from escaping placeholder values by passing `false` as its third argument.
You **must** escape any interpolated dynamic values yourself, for instance
using `escape` from `lodash`.
```javascript
import { escape } from 'lodash';
@ -632,7 +667,7 @@ This also applies when using links in between translated sentences, otherwise th
{{
sprintf(s__("ClusterIntegration|Learn more about %{link}"), {
link: '<a href="https://cloud.google.com/compute/docs/regions-zones/regions-zones" target="_blank" rel="noopener noreferrer">zones</a>'
})
}, false)
}}
```
@ -643,7 +678,7 @@ This also applies when using links in between translated sentences, otherwise th
sprintf(s__("ClusterIntegration|Learn more about %{linkStart}zones%{linkEnd}"), {
linkStart: '<a href="https://cloud.google.com/compute/docs/regions-zones/regions-zones" target="_blank" rel="noopener noreferrer">',
linkEnd: '</a>',
})
}, false)
}}
```
@ -652,45 +687,6 @@ The reasoning behind this is that in some languages words change depending on co
When in doubt, try to follow the best practices described in this [Mozilla
Developer documentation](https://developer.mozilla.org/en-US/docs/Mozilla/Localization/Localization_content_best_practices#Splitting).
##### Vue components interpolation
When translating UI text in Vue components, you might want to include child components inside
the translation string.
You could not use a JavaScript-only solution to render the translation,
because Vue would not be aware of the child components and would render them as plain text.
For this use case, you should use the `gl-sprintf` component which is maintained
in **GitLab UI**.
The `gl-sprintf` component accepts a `message` property, which is the translatable string,
and it exposes a named slot for every placeholder in the string, which lets you include Vue
components easily.
Assume you want to print the translatable string
`Pipeline %{pipelineId} triggered %{timeago} by %{author}`. To replace the `%{timeago}` and
`%{author}` placeholders with Vue components, here's how you would do that with `gl-sprintf`:
```html
<template>
<div>
<gl-sprintf :message="__('Pipeline %{pipelineId} triggered %{timeago} by %{author}')">
<template #pipelineId>{{ pipeline.id }}</template>
<template #timeago>
<timeago :time="pipeline.triggerTime" />
</template>
<template #author>
<gl-avatar-labeled
:src="pipeline.triggeredBy.avatarPath"
:label="pipeline.triggeredBy.name"
/>
</template>
</gl-sprintf>
</div>
</template>
```
For more information, see the [`gl-sprintf`](https://gitlab-org.gitlab.io/gitlab-ui/?path=/story/base-sprintf--default) documentation.
## Updating the PO files with the new content
Now that the new content is marked for translation, we need to update

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -176,23 +176,9 @@ documentation on the [Kubernetes Agent configuration repository](repository.md).
### Create an Agent record in GitLab
Next, create an GitLab Rails Agent record so the Agent can associate itself with
Next, create a GitLab Rails Agent record to associate it with
the configuration repository project. Creating this record also creates a Secret needed to configure
the Agent in subsequent steps. You can create an Agent record either:
- Through the Rails console:
```ruby
project = ::Project.find_by_full_path("path-to/your-configuration-project")
# agent-name should be the same as specified above in the config.yaml
agent = ::Clusters::Agent.create(name: "<agent-name>", project: project)
token = ::Clusters::AgentToken.create(agent: agent)
token.token # this will print out the token you need to use on the next step
```
For full details, read [Starting a Rails console session](../../../administration/operations/rails_console.md#starting-a-rails-console-session).
- Through GraphQL: **(PREMIUM SELF)**
the Agent in subsequent steps. You can create an Agent record with GraphQL:
```graphql
mutation createAgent {

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1,6 +1,6 @@
---
stage: Monitor
group: Health
group: Monitor
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
---

View file

@ -1297,6 +1297,7 @@ X-Gitlab-Event: Job Hook
"build_name": "test",
"build_stage": "test",
"build_status": "created",
"build_created_at": "2021-02-23T02:41:37.886Z",
"build_started_at": null,
"build_finished_at": null,
"build_duration": null,

View file

@ -31,7 +31,7 @@ module BulkImports
def variables(context)
{
full_path: context.entity.source_full_path,
cursor: context.entity.next_page_for(:labels)
cursor: context.tracker.next_page
}
end

View file

@ -34,7 +34,7 @@ module BulkImports
def variables(context)
{
full_path: context.entity.source_full_path,
cursor: context.entity.next_page_for(:group_members)
cursor: context.tracker.next_page
}
end

View file

@ -33,7 +33,7 @@ module BulkImports
def variables(context)
{
full_path: context.entity.source_full_path,
cursor: context.entity.next_page_for(:milestones)
cursor: context.tracker.next_page
}
end

View file

@ -16,8 +16,7 @@ module BulkImports
end
def after_run(extracted_data)
context.entity.update_tracker_for(
relation: :labels,
tracker.update(
has_next_page: extracted_data.has_next_page?,
next_page: extracted_data.next_page
)

View file

@ -19,8 +19,7 @@ module BulkImports
end
def after_run(extracted_data)
context.entity.update_tracker_for(
relation: :group_members,
tracker.update(
has_next_page: extracted_data.has_next_page?,
next_page: extracted_data.next_page
)

View file

@ -20,8 +20,7 @@ module BulkImports
end
def after_run(extracted_data)
context.entity.update_tracker_for(
relation: :milestones,
tracker.update(
has_next_page: extracted_data.has_next_page?,
next_page: extracted_data.next_page
)

View file

@ -8,9 +8,18 @@ module BulkImports
end
def execute
context = BulkImports::Pipeline::Context.new(entity)
pipelines.each.with_index do |pipeline, stage|
pipeline_tracker = entity.trackers.create!(
pipeline_name: pipeline,
stage: stage
)
pipelines.each { |pipeline| pipeline.new(context).run }
context = BulkImports::Pipeline::Context.new(pipeline_tracker)
pipeline.new(context).run
pipeline_tracker.finish!
end
entity.finish!
end

View file

@ -15,6 +15,10 @@ module BulkImports
@context = context
end
def tracker
@tracker ||= context.tracker
end
included do
private

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