Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-02-29 00:07:44 +00:00
parent 8831c2df7f
commit e56fd47150
11 changed files with 93 additions and 50 deletions

View file

@ -419,7 +419,8 @@ end
gem 'octokit', '~> 4.15'
gem 'mail_room', '~> 0.10.0'
# https://gitlab.com/gitlab-org/gitlab/issues/207207
gem 'gitlab-mail_room', '~> 0.0.2', require: 'mail_room'
gem 'email_reply_trimmer', '~> 0.1'
gem 'html2text'

View file

@ -388,6 +388,7 @@ GEM
opentracing (~> 0.4)
redis (> 3.0.0, < 5.0.0)
gitlab-license (1.0.0)
gitlab-mail_room (0.0.2)
gitlab-markup (1.7.0)
gitlab-net-dns (0.9.1)
gitlab-puma (4.3.1.gitlab.2)
@ -616,7 +617,6 @@ GEM
lumberjack (1.0.13)
mail (2.7.1)
mini_mime (>= 0.1.1)
mail_room (0.10.0)
marcel (0.3.3)
mimemagic (~> 0.3.2)
marginalia (1.8.0)
@ -1235,6 +1235,7 @@ DEPENDENCIES
gitlab-chronic (~> 0.10.5)
gitlab-labkit (= 0.10.0)
gitlab-license (~> 1.0)
gitlab-mail_room (~> 0.0.2)
gitlab-markup (~> 1.7.0)
gitlab-net-dns (~> 0.9.1)
gitlab-puma (~> 4.3.1.gitlab.2)
@ -1284,7 +1285,6 @@ DEPENDENCIES
loofah (~> 2.2)
lru_redux
mail (= 2.7.1)
mail_room (~> 0.10.0)
marginalia (~> 1.8.0)
memory_profiler (~> 0.9)
method_source (~> 0.8)

View file

@ -19,7 +19,7 @@ get_mail_room_pid()
start()
{
bin/daemon_with_pidfile $mail_room_pidfile bundle exec mail_room -q -c $mail_room_config >> $mail_room_logfile 2>&1
bin/daemon_with_pidfile $mail_room_pidfile bundle exec mail_room --log-exit-as json -q -c $mail_room_config >> $mail_room_logfile 2>&1
}
stop()

View file

@ -0,0 +1,5 @@
---
title: Replace content_viewer_spec setTimeouts with semantic actions / events
merge_request:
author: Oregand
type: other

View file

@ -121,10 +121,7 @@ Rails.application.routes.draw do
draw :country
draw :country_state
draw :subscription
constraints(-> (*) { Gitlab::Analytics.any_features_enabled? }) do
draw :analytics
end
draw :analytics
end
if ENV['GITLAB_CHAOS_SECRET'] || Rails.env.development? || Rails.env.test?

View file

@ -85,7 +85,11 @@ module Gitlab
job['pid'] = ::Process.pid
job.delete('args') unless ENV['SIDEKIQ_LOG_ARGUMENTS']
job['args'] = Gitlab::Utils::LogLimitedArray.log_limited_array(job['args']) if job['args']
if job['args']
job['args'].map!(&:to_s)
job['args'] = Gitlab::Utils::LogLimitedArray.log_limited_array(job['args'])
end
job
end

View file

@ -73,5 +73,20 @@ describe 'Group navbar' do
it_behaves_like 'verified navigation bar'
end
context 'when value stream analytics is available' do
before do
stub_licensed_features(cycle_analytics_for_groups: true)
analytics_nav_item[:nav_sub_items] << _('Value Stream Analytics')
group.add_maintainer(user)
sign_in(user)
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
end
end

View file

@ -1,6 +1,7 @@
import Vue from 'vue';
import MockAdapter from 'axios-mock-adapter';
import mountComponent from 'spec/helpers/vue_mount_component_helper';
import waitForPromises from 'spec/helpers/wait_for_promises';
import { GREEN_BOX_IMAGE_URL } from 'spec/test_constants';
import axios from '~/lib/utils/axios_utils';
import contentViewer from '~/vue_shared/components/content_viewer/content_viewer.vue';
@ -22,7 +23,7 @@ describe('ContentViewer', () => {
it('markdown preview renders + loads rendered markdown from server', done => {
mock = new MockAdapter(axios);
mock.onPost(`${gon.relative_url_root}/testproject/preview_markdown`).reply(200, {
mock.onPost(`${gon.relative_url_root}/testproject/preview_markdown`).replyOnce(200, {
body: '<b>testing</b>',
});
@ -33,13 +34,12 @@ describe('ContentViewer', () => {
type: 'markdown',
});
const previewContainer = vm.$el.querySelector('.md-previewer');
setTimeout(() => {
expect(previewContainer.textContent).toContain('testing');
done();
});
waitForPromises()
.then(() => {
expect(vm.$el.querySelector('.md-previewer').textContent).toContain('testing');
})
.then(done)
.catch(done.fail);
});
it('renders image preview', done => {
@ -49,11 +49,12 @@ describe('ContentViewer', () => {
type: 'image',
});
setTimeout(() => {
expect(vm.$el.querySelector('img').getAttribute('src')).toBe(GREEN_BOX_IMAGE_URL);
done();
});
vm.$nextTick()
.then(() => {
expect(vm.$el.querySelector('img').getAttribute('src')).toBe(GREEN_BOX_IMAGE_URL);
})
.then(done)
.catch(done.fail);
});
it('renders fallback download control', done => {
@ -62,18 +63,19 @@ describe('ContentViewer', () => {
fileSize: 1024,
});
setTimeout(() => {
expect(
vm.$el
.querySelector('.file-info')
.textContent.trim()
.replace(/\s+/, ' '),
).toEqual('test.abc (1.00 KiB)');
vm.$nextTick()
.then(() => {
expect(
vm.$el
.querySelector('.file-info')
.textContent.trim()
.replace(/\s+/, ' '),
).toEqual('test.abc (1.00 KiB)');
expect(vm.$el.querySelector('.btn.btn-default').textContent.trim()).toEqual('Download');
done();
});
expect(vm.$el.querySelector('.btn.btn-default').textContent.trim()).toEqual('Download');
})
.then(done)
.catch(done.fail);
});
it('renders fallback download control for file with a data URL path properly', done => {
@ -82,13 +84,14 @@ describe('ContentViewer', () => {
filePath: 'somepath/test.abc',
});
setTimeout(() => {
expect(vm.$el.querySelector('.file-info').textContent.trim()).toEqual('test.abc');
expect(vm.$el.querySelector('.btn.btn-default')).toHaveAttr('download', 'test.abc');
expect(vm.$el.querySelector('.btn.btn-default').textContent.trim()).toEqual('Download');
done();
});
vm.$nextTick()
.then(() => {
expect(vm.$el.querySelector('.file-info').textContent.trim()).toEqual('test.abc');
expect(vm.$el.querySelector('.btn.btn-default')).toHaveAttr('download', 'test.abc');
expect(vm.$el.querySelector('.btn.btn-default').textContent.trim()).toEqual('Download');
})
.then(done)
.catch(done.fail);
});
it('markdown preview receives the file path as a parameter', done => {
@ -106,14 +109,15 @@ describe('ContentViewer', () => {
filePath: 'foo/test.md',
});
setTimeout(() => {
expect(axios.post).toHaveBeenCalledWith(
`${gon.relative_url_root}/testproject/preview_markdown`,
{ path: 'foo/test.md', text: '* Test' },
jasmine.any(Object),
);
done();
});
vm.$nextTick()
.then(() => {
expect(axios.post).toHaveBeenCalledWith(
`${gon.relative_url_root}/testproject/preview_markdown`,
{ path: 'foo/test.md', text: '* Test' },
jasmine.any(Object),
);
})
.then(done)
.catch(done.fail);
});
});

View file

@ -30,6 +30,7 @@ describe Gitlab::SidekiqLogging::StructuredLogger do
let(:clock_thread_cputime_end) { 1.333333799 }
let(:start_payload) do
job.except('error_backtrace', 'error_class', 'error_message').merge(
'args' => job['args'].map(&:to_s),
'message' => 'TestWorker JID-da883554ee4fe414012f5f42: start',
'job_status' => 'start',
'pid' => Process.pid,
@ -99,13 +100,29 @@ describe Gitlab::SidekiqLogging::StructuredLogger do
end
end
context 'when the job args contain non-string objects' do
it 'converts them to strings' do
Timecop.freeze(timestamp) do
job['args'] = [2, true, 'foo', { "foo" => "bar" }]
expected_args = ['2', 'true', 'foo', '{"foo"=>"bar"}']
expect(logger).to receive(:info).with(start_payload.merge('args' => expected_args)).ordered
expect(logger).to receive(:info).with(end_payload.merge('args' => expected_args)).ordered
expect(subject).to receive(:log_job_start).and_call_original
expect(subject).to receive(:log_job_done).and_call_original
subject.call(job, 'test_queue') { }
end
end
end
context 'when the job args are bigger than the maximum allowed' do
it 'keeps args from the front until they exceed the limit' do
Timecop.freeze(timestamp) do
half_limit = Gitlab::Utils::LogLimitedArray::MAXIMUM_ARRAY_LENGTH / 2
job['args'] = [1, 2, 'a' * half_limit, 'b' * half_limit, 3]
expected_args = job['args'].take(3) + ['...']
expected_args = job['args'].map(&:to_s).take(3) + ['...']
expect(logger).to receive(:info).with(start_payload.merge('args' => expected_args)).ordered
expect(logger).to receive(:info).with(end_payload.merge('args' => expected_args)).ordered

0
vendor/gitignore/C++.gitignore vendored Normal file → Executable file
View file

0
vendor/gitignore/Java.gitignore vendored Normal file → Executable file
View file