提交 a1aeaba2 编写于 作者: G GitLab Bot

Add latest changes from gitlab-org/gitlab@master

上级 d72fedf1
......@@ -548,13 +548,6 @@ Style/EachWithObject:
Style/EmptyElse:
Enabled: false
# Offense count: 11
# Cop supports --auto-correct.
Style/EmptyLambdaParameter:
Exclude:
- 'app/models/ci/build.rb'
- 'app/models/ci/runner.rb'
# Offense count: 170
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
......@@ -638,22 +631,6 @@ Style/ParallelAssignment:
Style/PercentLiteralDelimiters:
Enabled: false
# Offense count: 15
# Cop supports --auto-correct.
Style/PerlBackrefs:
Exclude:
- 'app/controllers/projects/application_controller.rb'
- 'app/helpers/submodule_helper.rb'
- 'lib/backup/manager.rb'
- 'lib/banzai/filter/abstract_reference_filter.rb'
- 'lib/banzai/filter/autolink_filter.rb'
- 'lib/banzai/filter/emoji_filter.rb'
- 'lib/banzai/filter/gollum_tags_filter.rb'
- 'lib/expand_variables.rb'
- 'lib/gitlab/diff/highlight.rb'
- 'lib/gitlab/search_results.rb'
- 'lib/gitlab/sherlock/query.rb'
# Offense count: 200
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
......
import { slugify } from '~/lib/utils/text_utility';
const renderersByType = {
divider(element) {
element.classList.add('divider');
......@@ -95,15 +97,22 @@ function checkSelected(data, options) {
return options.parent.querySelector(`input[name='${options.fieldName}']`) == null;
}
function createLink(url, selected, options) {
function createLink(data, selected, options, index) {
const link = document.createElement('a');
link.href = url;
link.href = getPropertyWithDefault(data, options, 'url', '#');
if (options.icon) {
link.classList.add('d-flex', 'align-items-center');
}
if (options.trackSuggestionClickedLabel) {
link.setAttribute('data-track-event', 'click_text');
link.setAttribute('data-track-label', options.trackSuggestionClickedLabel);
link.setAttribute('data-track-value', index);
link.setAttribute('data-track-property', slugify(data.category || 'no-category'));
}
link.classList.toggle('is-active', selected);
return link;
......@@ -123,8 +132,7 @@ function assignTextToLink(el, data, options) {
function renderLink(row, data, { options, group, index }) {
const selected = checkSelected(data, options);
const url = getPropertyWithDefault(data, options, 'url', '#');
const link = createLink(url, selected, options);
const link = createLink(data, selected, options, index);
assignTextToLink(link, data, options);
......
<script>
/* eslint-disable vue/no-v-html */
/*
* This is tightly coupled to projects/issues/_issue.html.haml,
* any changes done to the haml need to be reflected here.
......@@ -7,7 +6,14 @@
// TODO: need to move this component to graphql - https://gitlab.com/gitlab-org/gitlab/-/issues/221246
import { escape, isNumber } from 'lodash';
import { GlLink, GlTooltipDirective as GlTooltip, GlSprintf, GlLabel, GlIcon } from '@gitlab/ui';
import {
GlLink,
GlTooltipDirective as GlTooltip,
GlSprintf,
GlLabel,
GlIcon,
GlSafeHtmlDirective as SafeHtml,
} from '@gitlab/ui';
import jiraLogo from '@gitlab/svgs/dist/illustrations/logos/jira.svg';
import {
dateInWords,
......@@ -42,6 +48,7 @@ export default {
},
directives: {
GlTooltip,
SafeHtml,
},
mixins: [glFeatureFlagsMixin()],
props: {
......@@ -299,9 +306,9 @@ export default {
<span class="js-ref-path gl-mr-4 mr-sm-0">
<span
v-if="isJiraIssue"
v-safe-html="jiraLogo"
class="svg-container jira-logo-container"
data-testid="jira-logo"
v-html="jiraLogo"
></span>
{{ referencePath }}
</span>
......
......@@ -64,7 +64,7 @@ Once you confirm %{deleteAccount}, it cannot be undone or recovered.`),
return {
text: s__('Delete account'),
attributes: [
{ variant: 'danger', 'data-qa-selector': 'confirm_deletion_button' },
{ variant: 'danger', 'data-qa-selector': 'confirm_delete_account_button' },
{ category: 'primary' },
{ disabled: !this.canSubmit },
],
......
......@@ -135,6 +135,7 @@ export class SearchAutocomplete {
data: this.getData.bind(this),
selectable: true,
clicked: this.onClick.bind(this),
trackSuggestionClickedLabel: 'search_autocomplete_suggestion',
});
}
......
import Vue from 'vue';
import createEventHub from '~/helpers/event_hub_factory';
const eventHub = new Vue();
const eventHub = createEventHub();
// TODO: remove eventHub hack after code splitting refactor
window.emitSidebarEvent = (...args) => eventHub.$emit(...args);
......
<script>
/* eslint-disable vue/no-v-html */
import { GlDeprecatedButton, GlIcon } from '@gitlab/ui';
import { GlButton } from '@gitlab/ui';
import { escape } from 'lodash';
import { __, n__, sprintf, s__ } from '~/locale';
export default {
components: {
GlIcon,
GlDeprecatedButton,
GlButton,
},
props: {
isSquashEnabled: {
......@@ -80,20 +79,19 @@ export default {
class="js-mr-widget-commits-count mr-widget-extension clickable d-flex align-items-center px-3 py-2"
@click="toggle()"
>
<gl-deprecated-button
<gl-button
:aria-label="ariaLabel"
variant="blank"
class="commit-edit-toggle square s24 gl-mr-3"
category="tertiary"
class="commit-edit-toggle gl-mr-3"
:icon="collapseIcon"
@click.stop="toggle()"
>
<gl-icon :name="collapseIcon" :size="16" />
</gl-deprecated-button>
/>
<span v-if="expanded">{{ __('Collapse') }}</span>
<span v-else>
<span class="vertical-align-middle" v-html="message"></span>
<gl-deprecated-button variant="link" class="modify-message-button">
<gl-button variant="link" class="modify-message-button">
{{ modifyLinkMessage }}
</gl-deprecated-button>
</gl-button>
</span>
</div>
<div v-show="expanded"><slot></slot></div>
......
......@@ -58,9 +58,9 @@ class Projects::ApplicationController < ApplicationController
def method_missing(method_sym, *arguments, &block)
case method_sym.to_s
when /\Aauthorize_(.*)!\z/
authorize_action!($1.to_sym)
authorize_action!(Regexp.last_match(1).to_sym)
when /\Acheck_(.*)_available!\z/
check_project_feature_available!($1.to_sym)
check_project_feature_available!(Regexp.last_match(1).to_sym)
else
super
end
......
......@@ -18,7 +18,7 @@ module SubmoduleHelper
end
if url =~ %r{([^/:]+)/([^/]+(?:\.git)?)\Z}
namespace, project = $1, $2
namespace, project = Regexp.last_match(1), Regexp.last_match(2)
gitlab_hosts = [Gitlab.config.gitlab.url,
Gitlab.config.gitlab_shell.ssh_path_prefix]
......
......@@ -90,9 +90,9 @@ module Ci
Ci::BuildMetadata.scoped_build.with_interruptible.select(:id))
end
scope :unstarted, ->() { where(runner_id: nil) }
scope :ignore_failures, ->() { where(allow_failure: false) }
scope :with_downloadable_artifacts, ->() do
scope :unstarted, -> { where(runner_id: nil) }
scope :ignore_failures, -> { where(allow_failure: false) }
scope :with_downloadable_artifacts, -> do
where('EXISTS (?)',
Ci::JobArtifact.select(1)
.where('ci_builds.id = ci_job_artifacts.job_id')
......@@ -104,11 +104,11 @@ module Ci
where('EXISTS (?)', ::Ci::JobArtifact.select(1).where('ci_builds.id = ci_job_artifacts.job_id').merge(query))
end
scope :with_archived_trace, ->() do
scope :with_archived_trace, -> do
with_existing_job_artifacts(Ci::JobArtifact.trace)
end
scope :without_archived_trace, ->() do
scope :without_archived_trace, -> do
where('NOT EXISTS (?)', Ci::JobArtifact.select(1).where('ci_builds.id = ci_job_artifacts.job_id').trace)
end
......@@ -139,11 +139,11 @@ module Ci
.includes(:metadata, :job_artifacts_metadata)
end
scope :with_artifacts_not_expired, ->() { with_downloadable_artifacts.where('artifacts_expire_at IS NULL OR artifacts_expire_at > ?', Time.current) }
scope :with_expired_artifacts, ->() { with_downloadable_artifacts.where('artifacts_expire_at < ?', Time.current) }
scope :last_month, ->() { where('created_at > ?', Date.today - 1.month) }
scope :manual_actions, ->() { where(when: :manual, status: COMPLETED_STATUSES + %i[manual]) }
scope :scheduled_actions, ->() { where(when: :delayed, status: COMPLETED_STATUSES + %i[scheduled]) }
scope :with_artifacts_not_expired, -> { with_downloadable_artifacts.where('artifacts_expire_at IS NULL OR artifacts_expire_at > ?', Time.current) }
scope :with_expired_artifacts, -> { with_downloadable_artifacts.where('artifacts_expire_at < ?', Time.current) }
scope :last_month, -> { where('created_at > ?', Date.today - 1.month) }
scope :manual_actions, -> { where(when: :manual, status: COMPLETED_STATUSES + %i[manual]) }
scope :scheduled_actions, -> { where(when: :delayed, status: COMPLETED_STATUSES + %i[scheduled]) }
scope :ref_protected, -> { where(protected: true) }
scope :with_live_trace, -> { where('EXISTS (?)', Ci::BuildTraceChunk.where('ci_builds.id = ci_build_trace_chunks.build_id').select(1)) }
scope :with_stale_live_trace, -> { with_live_trace.finished_before(12.hours.ago) }
......
......@@ -52,7 +52,7 @@ module Ci
has_many :runner_namespaces, inverse_of: :runner
has_many :groups, through: :runner_namespaces
has_one :last_build, ->() { order('id DESC') }, class_name: 'Ci::Build'
has_one :last_build, -> { order('id DESC') }, class_name: 'Ci::Build'
before_save :ensure_token
......
......@@ -1350,7 +1350,6 @@ class MergeRequest < ApplicationRecord
variables.append(key: 'CI_MERGE_REQUEST_PROJECT_URL', value: project.web_url)
variables.append(key: 'CI_MERGE_REQUEST_TARGET_BRANCH_NAME', value: target_branch.to_s)
variables.append(key: 'CI_MERGE_REQUEST_TITLE', value: title)
variables.append(key: 'CI_MERGE_REQUEST_DESCRIPTION', value: description) if Gitlab::Ci::Features.expose_mr_description_predefined_variable?
variables.append(key: 'CI_MERGE_REQUEST_ASSIGNEES', value: assignee_username_list) if assignees.present?
variables.append(key: 'CI_MERGE_REQUEST_MILESTONE', value: milestone.title) if milestone
variables.append(key: 'CI_MERGE_REQUEST_LABELS', value: label_names.join(',')) if labels.present?
......
......@@ -31,8 +31,6 @@ module AlertManagement
def issue_summary_markdown
<<~MARKDOWN.chomp
#### Summary
#{metadata_list}
#{alert_details}#{metric_embed_for_alert}
MARKDOWN
......
......@@ -51,8 +51,6 @@ module Projects
def issue_summary_markdown
<<~MARKDOWN.chomp
#### Summary
#{metadata_list}
#{alert_details}#{metric_embed_for_alert}
MARKDOWN
......
---
title: Add CI_MERGE_REQUEST_DESCRIPTION env variable
merge_request: 40771
author: Paul Spooren @aparcar
type: added
---
title: Fix Style/EmptyLambdaParameter cop
merge_request: 41248
author: Rajendra Kadam
type: fixed
---
title: Fix Style/PerlBackrefs cop
merge_request: 41246
author: Rajendra Kadam
type: fixed
---
name: expose_mr_description_predefined_variable
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40771
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/243556
group: group::continuous integration
type: development
default_enabled: true
......@@ -16560,6 +16560,11 @@ input UpdateIssueInput {
"""
dueDate: Time
"""
The ID of the parent epic. NULL when removing the association
"""
epicId: ID
"""
The desired health status
"""
......
......@@ -48797,6 +48797,16 @@
},
"defaultValue": null
},
{
"name": "epicId",
"description": "The ID of the parent epic. NULL when removing the association",
"type": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
},
"defaultValue": null
},
{
"name": "clientMutationId",
"description": "A unique identifier for the client performing the mutation.",
......@@ -89,8 +89,7 @@ Kubernetes-specific environment variables are detailed in the
| `CI_MERGE_REQUEST_SOURCE_PROJECT_URL` | 11.6 | all | The URL of the source project of the merge request if [the pipelines are for merge requests](../merge_request_pipelines/index.md). Available only if `only: [merge_requests]` or [`rules`](../yaml/README.md#rules) syntax is used and the merge request is created. |
| `CI_MERGE_REQUEST_TARGET_BRANCH_NAME` | 11.6 | all | The target branch name of the merge request if [the pipelines are for merge requests](../merge_request_pipelines/index.md). Available only if `only: [merge_requests]` or [`rules`](../yaml/README.md#rules) syntax is used and the merge request is created. |
| `CI_MERGE_REQUEST_TARGET_BRANCH_SHA` | 11.9 | all | The HEAD SHA of the target branch of the merge request if [the pipelines are for merge requests](../merge_request_pipelines/index.md). Available only if `only: [merge_requests]` or [`rules`](../yaml/README.md#rules) syntax is used, the merge request is created, and the pipeline is a [merged result pipeline](../merge_request_pipelines/pipelines_for_merged_results/index.md). **(PREMIUM)** |
| `CI_MERGE_REQUEST_TITLE` | 11.9 | all | The title of the merge request if [the pipelines are for merge requests](../merge_request_pipelines/index.md). Available only if `only: [merge_requests]` or [`rules`](../yaml/README.md#rules) syntax is used and the merge request is created. |
| `CI_MERGE_REQUEST_DESCRIPTION` | 13.3 | all | The description of the merge request if [the pipelines are for merge requests](../merge_request_pipelines/index.md). Available only if `only: [merge_requests]` or [`rules`](../yaml/README.md#rules) syntax is used and the merge request is created. |
| `CI_MERGE_REQUEST_TITLE` | 11.9 | all | The title of the merge request if [the pipelines are for merge requests](../merge_request_pipelines/index.md). Available only if `only: [merge_requests]` or [`rules`](../yaml/README.md#rules) syntax is used and the merge request is created. |
| `CI_MERGE_REQUEST_EVENT_TYPE` | 12.3 | all | The event type of the merge request, if [the pipelines are for merge requests](../merge_request_pipelines/index.md). Can be `detached`, `merged_result` or `merge_train`. |
| `CI_NODE_INDEX` | 11.5 | all | Index of the job in the job set. If the job is not parallelized, this variable is not set. |
| `CI_NODE_TOTAL` | 11.5 | all | Total number of instances of this job running in parallel. If the job is not parallelized, this variable is set to `1`. |
......
......@@ -26,10 +26,9 @@ Enable code intelligence for a project by adding a GitLab CI/CD job to the proje
```yaml
code_navigation:
image: golang:1.14.0
image: sourcegraph/lsif-go:v1
allow_failure: true # recommended
script:
- go get github.com/sourcegraph/lsif-go/cmd/lsif-go
- lsif-go
artifacts:
reports:
......
......@@ -88,7 +88,7 @@ module Backup
# - 1495527097_2017_05_23_9.3.0-pre_gitlab_backup.tar
next unless file =~ /^(\d{10})(?:_\d{4}_\d{2}_\d{2}(_\d+\.\d+\.\d+((-|\.)(pre|rc\d))?(-ee)?)?)?_gitlab_backup\.tar$/
timestamp = $1.to_i
timestamp = Regexp.last_match(1).to_i
if Time.at(timestamp) < (Time.now - keep_time)
begin
......
......@@ -265,7 +265,7 @@ module Banzai
extras = []
if matches.names.include?("anchor") && matches[:anchor] && matches[:anchor] =~ /\A\#note_(\d+)\z/
extras << "comment #{$1}"
extras << "comment #{Regexp.last_match(1)}"
end
extension = matches[:extension] if matches.names.include?("extension")
......@@ -436,7 +436,7 @@ module Banzai
escaped = escape_html_entities(text)
escaped.gsub(REFERENCE_PLACEHOLDER_PATTERN) do |match|
placeholder_data[$1.to_i]
placeholder_data[Regexp.last_match(1).to_i]
end
end
end
......
......@@ -86,7 +86,7 @@ module Banzai
# outside the link element. The entity must be marked HTML safe in
# order to be output literally rather than escaped.
match.gsub!(/((?:&[\w#]+;)+)\z/, '')
dropped = ($1 || '').html_safe
dropped = (Regexp.last_match(1) || '').html_safe
# To match the behaviour of Rinku, if the matched link ends with a
# closing part of a matched pair of punctuation, we remove that trailing
......
......@@ -33,7 +33,7 @@ module Banzai
# Returns a String with :emoji: replaced with gl-emoji unicode.
def emoji_name_element_unicode_filter(text)
text.gsub(emoji_pattern) do |match|
name = $1
name = Regexp.last_match(1)
Gitlab::Emoji.gl_emoji_tag(name)
end
end
......
......@@ -64,7 +64,7 @@ module Banzai
next if has_ancestor?(node, IGNORED_ANCESTOR_TAGS)
next unless node.content =~ TAGS_PATTERN
html = process_tag($1)
html = process_tag(Regexp.last_match(1))
node.replace(html) if html && html != node.content
end
......
......@@ -7,7 +7,7 @@ module ExpandVariables
value.gsub(/\$([a-zA-Z_][a-zA-Z0-9_]*)|\${\g<1>}|%\g<1>%/) do
variables_hash ||= transform_variables(variables)
variables_hash[$1 || $2]
variables_hash[Regexp.last_match(1) || Regexp.last_match(2)]
end
end
......
......@@ -79,10 +79,6 @@ module Gitlab
def self.coverage_report_view?(project)
::Feature.enabled?(:coverage_report_view, project)
end
def self.expose_mr_description_predefined_variable?
::Feature.enabled?(:ci_expose_mr_description_predefined_variable, default_enabled: true)
end
end
end
end
......
......@@ -60,7 +60,7 @@ module Gitlab
# Only update text if line is found. This will prevent
# issues with submodules given the line only exists in diff content.
if rich_line
line_prefix = diff_line.text =~ /\A(.)/ ? $1 : ' '
line_prefix = diff_line.text =~ /\A(.)/ ? Regexp.last_match(1) : ' '
"#{line_prefix}#{rich_line}".html_safe
end
end
......
......@@ -186,7 +186,7 @@ module Gitlab
params[:sort] = 'updated_desc'
if query =~ /#(\d+)\z/
params[:iids] = $1
params[:iids] = Regexp.last_match(1)
else
params[:search] = query
end
......
......@@ -105,7 +105,7 @@ module Gitlab
query.each_line
.map { |line| line.strip }
.join("\n")
.gsub(PREFIX_NEWLINE) { "\n#{$1} " }
.gsub(PREFIX_NEWLINE) { "\n#{Regexp.last_match(1)} " }
end
end
end
......
......@@ -11,14 +11,14 @@ module QA
view 'app/assets/javascripts/profile/account/components/delete_account_modal.vue' do
element :password_confirmation_field
element :confirm_deletion_button
element :confirm_delete_account_button
end
def delete_account(password)
click_element(:delete_account_button)
find_element(:password_confirmation_field).set password
click_element(:confirm_deletion_button)
click_element(:confirm_delete_account_button)
end
end
end
......
......@@ -313,6 +313,42 @@ describe('deprecatedJQueryDropdown', () => {
expect(li.childNodes.length).toEqual(1);
expect(li.textContent).toEqual(text);
});
describe('with a trackSuggestionsClickedLabel', () => {
it('it includes data-track attributes', () => {
const dropdown = dropdownWithOptions({
trackSuggestionClickedLabel: 'some_value_for_label',
});
const item = {
id: 'some-element-id',
text: 'the link text',
url: 'http://example.com',
category: 'Suggestion category',
};
const li = dropdown.renderItem(item, null, 3);
const link = li.querySelector('a');
expect(link).toHaveAttr('data-track-event', 'click_text');
expect(link).toHaveAttr('data-track-label', 'some_value_for_label');
expect(link).toHaveAttr('data-track-value', '3');
expect(link).toHaveAttr('data-track-property', 'suggestion-category');
});
it('it defaults property to no_category when category not provided', () => {
const dropdown = dropdownWithOptions({
trackSuggestionClickedLabel: 'some_value_for_label',
});
const item = {
id: 'some-element-id',
text: 'the link text',
url: 'http://example.com',
};
const li = dropdown.renderItem(item);
const link = li.querySelector('a');
expect(link).toHaveAttr('data-track-property', 'no-category');
});
});
});
it('should keep selected item after selecting a second time', () => {
......
import { shallowMount } from '@vue/test-utils';
import { GlIcon } from '@gitlab/ui';
import CommitsHeader from '~/vue_merge_request_widget/components/states/commits_header.vue';
describe('Commits header component', () => {
......@@ -23,7 +22,6 @@ describe('Commits header component', () => {
const findHeaderWrapper = () => wrapper.find('.js-mr-widget-commits-count');
const findCommitToggle = () => wrapper.find('.commit-edit-toggle');
const findIcon = () => wrapper.find(GlIcon);
const findCommitsCountMessage = () => wrapper.find('.commits-count-message');
const findTargetBranchMessage = () => wrapper.find('.label-branch');
const findModifyButton = () => wrapper.find('.modify-message-button');
......@@ -61,7 +59,7 @@ describe('Commits header component', () => {
wrapper.setData({ expanded: false });
return wrapper.vm.$nextTick().then(() => {
expect(findIcon().props('name')).toBe('chevron-right');
expect(findCommitToggle().props('icon')).toBe('chevron-right');
});
});
......@@ -119,7 +117,7 @@ describe('Commits header component', () => {
it('has a chevron-down icon', done => {
wrapper.vm.$nextTick(() => {
expect(findIcon().props('name')).toBe('chevron-down');
expect(findCommitToggle().props('icon')).toBe('chevron-down');
done();
});
});
......
......@@ -760,7 +760,6 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
'CI_MERGE_REQUEST_SOURCE_BRANCH_NAME' => merge_request.source_branch.to_s,
'CI_MERGE_REQUEST_SOURCE_BRANCH_SHA' => pipeline.source_sha.to_s,
'CI_MERGE_REQUEST_TITLE' => merge_request.title,
'CI_MERGE_REQUEST_DESCRIPTION' => merge_request.description,
'CI_MERGE_REQUEST_ASSIGNEES' => merge_request.assignee_username_list,
'CI_MERGE_REQUEST_MILESTONE' => milestone.title,
'CI_MERGE_REQUEST_LABELS' => labels.map(&:title).sort.join(','),
......
......@@ -27,8 +27,6 @@ RSpec.describe AlertManagement::AlertPresenter do
it 'returns an alert issue description' do
expect(presenter.issue_description).to eq(
<<~MARKDOWN.chomp
#### Summary
**Start time:** #{presenter.start_time}#{markdown_line_break}
**Severity:** #{presenter.severity}#{markdown_line_break}
**Service:** #{alert.service}#{markdown_line_break}
......
......@@ -30,8 +30,6 @@ RSpec.describe AlertManagement::PrometheusAlertPresenter do
it 'returns an alert issue description' do
expect(presenter.issue_description).to eq(
<<~MARKDOWN.chomp
#### Summary
**Start time:** #{presenter.start_time}#{markdown_line_break}
**Severity:** #{presenter.severity}#{markdown_line_break}
**full_query:** `vector(1)`#{markdown_line_break}
......
......@@ -63,8 +63,6 @@ RSpec.describe Projects::Prometheus::AlertPresenter do
it do
is_expected.to eq(
<<~MARKDOWN.chomp
#### Summary
**Start time:** #{presenter.start_time}
MARKDOWN
......@@ -80,8 +78,6 @@ RSpec.describe Projects::Prometheus::AlertPresenter do
it do
is_expected.to eq(
<<~MARKDOWN.chomp
#### Summary
**Start time:** #{presenter.start_time}
#### Alert Details
......@@ -101,8 +97,6 @@ RSpec.describe Projects::Prometheus::AlertPresenter do
it do
is_expected.to eq(
<<~MARKDOWN.chomp
#### Summary
**Start time:** #{presenter.start_time}#{markdown_line_break}
**full_query:** `query`
......@@ -129,8 +123,6 @@ RSpec.describe Projects::Prometheus::AlertPresenter do
it do
is_expected.to eq(
<<~MARKDOWN.chomp
#### Summary
**Start time:** #{presenter.start_time}#{markdown_line_break}
**Service:** service_name#{markdown_line_break}
**Monitoring tool:** monitoring_tool_name#{markdown_line_break}
......@@ -151,8 +143,6 @@ RSpec.describe Projects::Prometheus::AlertPresenter do
it do
is_expected.to eq(
<<~MARKDOWN.chomp
#### Summary
**Start time:** #{presenter.start_time}#{markdown_line_break}
**Hosts:** http://localhost:3000
......@@ -168,8 +158,6 @@ RSpec.describe Projects::Prometheus::AlertPresenter do
shared_examples_for 'markdown with metrics embed' do
let(:expected_markdown) do
<<~MARKDOWN.chomp
#### Summary
**Start time:** #{presenter.start_time}#{markdown_line_break}
**full_query:** `avg(metric) > 1.0`
......@@ -222,8 +210,6 @@ RSpec.describe Projects::Prometheus::AlertPresenter do
context 'when not enough information is present for an embed' do
let(:expected_markdown) do
<<~MARKDOWN.chomp
#### Summary
**Start time:** #{presenter.start_time}#{markdown_line_break}
**full_query:** `avg(metric) > 1.0`
......@@ -249,8 +235,6 @@ RSpec.describe Projects::Prometheus::AlertPresenter do
context 'without full_query' do
let(:expected_markdown) do
<<~MARKDOWN.chomp
#### Summary
**Start time:** #{presenter.start_time}
MARKDOWN
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册