Commit 3ec3b6b0 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'sh-remove-job-logs-from-notification-emails' into 'master'

Remove job logs from notification e-mails

See merge request gitlab-org/gitlab!42395
parents 2f4cbc3f 9aa64b62
...@@ -23,10 +23,3 @@ ...@@ -23,10 +23,3 @@
= build.stage = build.stage
%td{ align: "right", style: "font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; padding: 16px 0; color: #8c8c8c; font-weight: 500; font-size: 14px;" } %td{ align: "right", style: "font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; padding: 16px 0; color: #8c8c8c; font-weight: 500; font-size: 14px;" }
= render "notify/links/#{build.to_partial_path}", pipeline: pipeline, build: build = render "notify/links/#{build.to_partial_path}", pipeline: pipeline, build: build
%tr.build-log
- if build.has_trace?
%td{ colspan: "2", style: "font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; padding: 0 0 16px;" }
%pre{ style: "font-family: Monaco,'Lucida Console','Courier New',Courier,monospace; background-color: #fafafa; border-radius: 4px; overflow: hidden; white-space: pre-wrap; word-break: break-all; font-size:13px; line-height: 1.4; padding: 16px 8px; color: #333333; margin: 0;" }
= build.trace.html(last_lines: 30).html_safe
- else
%td{ colspan: "2" }
...@@ -14,7 +14,4 @@ had <%= failed.size %> failed <%= 'build'.pluralize(failed.size) %>. ...@@ -14,7 +14,4 @@ had <%= failed.size %> failed <%= 'build'.pluralize(failed.size) %>.
<%= render "notify/links/#{build.to_partial_path}", pipeline: @pipeline, build: build %> <%= render "notify/links/#{build.to_partial_path}", pipeline: @pipeline, build: build %>
Stage: <%= build.stage %> Stage: <%= build.stage %>
Name: <%= build.name %> Name: <%= build.name %>
<% if build.has_trace? -%>
Trace: <%= build.trace.raw(last_lines: 30) %>
<% end -%>
<% end -%> <% end -%>
...@@ -34,8 +34,4 @@ had <%= failed.size %> failed <%= 'build'.pluralize(failed.size) %>. ...@@ -34,8 +34,4 @@ had <%= failed.size %> failed <%= 'build'.pluralize(failed.size) %>.
<%= render "notify/links/#{build.to_partial_path}", pipeline: @pipeline, build: build %> <%= render "notify/links/#{build.to_partial_path}", pipeline: @pipeline, build: build %>
Stage: <%= build.stage %> Stage: <%= build.stage %>
Name: <%= build.name %> Name: <%= build.name %>
<% if build.has_trace? -%>
Trace: <%= build.trace.raw(last_lines: 30) %>
<% end -%>
<% end -%> <% end -%>
---
title: Remove job logs from notification e-mails
merge_request: 42395
author:
type: changed
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'notify/autodevops_disabled_email.text.erb' do
include Devise::Test::ControllerHelpers
let(:user) { create(:user, developer_projects: [project]) }
let(:project) { create(:project, :repository) }
let(:pipeline) do
create(:ci_pipeline,
:failed,
project: project,
user: user,
ref: project.default_branch,
sha: project.commit.sha)
end
before do
assign(:project, project)
assign(:pipeline, pipeline)
end
context 'when the pipeline contains a failed job' do
let!(:build) { create(:ci_build, :failed, :trace_live, pipeline: pipeline, project: pipeline.project) }
it 'renders the email correctly' do
render
expect(rendered).to have_content("Auto DevOps pipeline was disabled for #{project.name}")
expect(rendered).to match(/Pipeline ##{pipeline.id} .* triggered by #{pipeline.user.name}/)
expect(rendered).to have_content("Stage: #{build.stage}")
expect(rendered).to have_content("Name: #{build.name}")
expect(rendered).not_to have_content("Trace:")
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment