Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
35144b7075
commit
f7ae5366cc
3
Gemfile
3
Gemfile
|
@ -4,9 +4,6 @@ gem 'rails', '~> 6.0.3.1'
|
|||
|
||||
gem 'bootsnap', '~> 1.4.6'
|
||||
|
||||
# Improves copy-on-write performance for MRI
|
||||
gem 'nakayoshi_fork', '~> 0.0.4'
|
||||
|
||||
# Responders respond_to and respond_with
|
||||
gem 'responders', '~> 3.0'
|
||||
|
||||
|
|
|
@ -727,7 +727,6 @@ GEM
|
|||
ruby2_keywords (~> 0.0.1)
|
||||
mustermann-grape (1.0.1)
|
||||
mustermann (>= 1.0.0)
|
||||
nakayoshi_fork (0.0.4)
|
||||
nap (1.1.0)
|
||||
nenv (0.3.0)
|
||||
net-http-persistent (4.0.0)
|
||||
|
@ -1426,7 +1425,6 @@ DEPENDENCIES
|
|||
mini_magick (~> 4.10.1)
|
||||
minitest (~> 5.11.0)
|
||||
multi_json (~> 1.14.1)
|
||||
nakayoshi_fork (~> 0.0.4)
|
||||
net-ldap (~> 0.16.3)
|
||||
net-ntp
|
||||
net-ssh (~> 6.0)
|
||||
|
|
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
Before Width: | Height: | Size: 36 KiB |
|
@ -76,7 +76,12 @@ export default {
|
|||
parallelViewLeftLineType() {
|
||||
return utils.parallelViewLeftLineType(this.line, this.isHighlighted || this.isCommented);
|
||||
},
|
||||
coverageState() {
|
||||
coverageStateLeft() {
|
||||
if (!this.inline || !this.line.left) return {};
|
||||
return this.fileLineCoverage(this.filePath, this.line.left.new_line);
|
||||
},
|
||||
coverageStateRight() {
|
||||
if (!this.line.right) return {};
|
||||
return this.fileLineCoverage(this.filePath, this.line.right.new_line);
|
||||
},
|
||||
classNameMapCellLeft() {
|
||||
|
@ -243,7 +248,12 @@ export default {
|
|||
>
|
||||
</a>
|
||||
</div>
|
||||
<div :class="parallelViewLeftLineType" class="diff-td line-coverage left-side"></div>
|
||||
<div
|
||||
v-gl-tooltip.hover
|
||||
:title="coverageStateLeft.text"
|
||||
:class="[...parallelViewLeftLineType, coverageStateLeft.class]"
|
||||
class="diff-td line-coverage left-side"
|
||||
></div>
|
||||
<div
|
||||
:id="line.left.line_code"
|
||||
:key="line.left.line_code"
|
||||
|
@ -333,8 +343,12 @@ export default {
|
|||
</div>
|
||||
<div
|
||||
v-gl-tooltip.hover
|
||||
:title="coverageState.text"
|
||||
:class="[line.right.type, coverageState.class, { hll: isHighlighted, hll: isCommented }]"
|
||||
:title="coverageStateRight.text"
|
||||
:class="[
|
||||
line.right.type,
|
||||
coverageStateRight.class,
|
||||
{ hll: isHighlighted, hll: isCommented },
|
||||
]"
|
||||
class="diff-td line-coverage right-side"
|
||||
></div>
|
||||
<div
|
||||
|
|
|
@ -38,7 +38,6 @@ module MergeRequests
|
|||
# error otherwise.
|
||||
def execute(recheck: false, retry_lease: true)
|
||||
return service_error if service_error
|
||||
return check_mergeability(recheck) unless merge_ref_auto_sync_lock_enabled?
|
||||
|
||||
in_write_lock(retry_lease: retry_lease) do |retried|
|
||||
# When multiple calls are waiting for the same lock (retry_lease),
|
||||
|
@ -157,10 +156,6 @@ module MergeRequests
|
|||
result[:status] == :success
|
||||
end
|
||||
|
||||
def merge_ref_auto_sync_lock_enabled?
|
||||
Feature.enabled?(:merge_ref_auto_sync_lock, project, default_enabled: true)
|
||||
end
|
||||
|
||||
def service_error
|
||||
strong_memoize(:service_error) do
|
||||
if !merge_request
|
||||
|
|
|
@ -11,5 +11,5 @@
|
|||
= s_('DeployTokens|You are about to revoke %{b_start}%{name}%{b_end}.').html_safe % { b_start: '<b>'.html_safe, name: token.name, b_end: '</b>'.html_safe }
|
||||
= s_('DeployTokens|This action cannot be undone.')
|
||||
.modal-footer.gl-flex-direction-row
|
||||
%a{ href: '#', data: { dismiss: 'modal' }, class: 'btn btn-default' }= _('Cancel')
|
||||
= link_to s_('DeployTokens|Revoke %{name}') % { name: token.name }, revoke_deploy_token_path(group_or_project, token), method: :put, class: 'btn btn-danger text-truncate'
|
||||
%a{ href: '#', data: { dismiss: 'modal' }, class: 'gl-button btn btn-default' }= _('Cancel')
|
||||
= link_to s_('DeployTokens|Revoke %{name}') % { name: token.name }, revoke_deploy_token_path(group_or_project, token), method: :put, class: 'gl-button btn btn-danger text-truncate'
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Fix coverage not showing for inline diffs
|
||||
merge_request: 51652
|
||||
author:
|
||||
type: fixed
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Update button style of Revoke button on Deploy Tokens page
|
||||
merge_request: 51079
|
||||
author: nuwe1
|
||||
type: other
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Use Puma `nakayoshi_fork`
|
||||
merge_request: 51467
|
||||
author:
|
||||
type: performance
|
|
@ -1,8 +0,0 @@
|
|||
---
|
||||
name: merge_ref_auto_sync_lock
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/31082
|
||||
rollout_issue_url:
|
||||
milestone: '12.2'
|
||||
type: development
|
||||
group: group::code review
|
||||
default_enabled: true
|
|
@ -84,6 +84,11 @@ if defined?(wait_for_less_busy_worker)
|
|||
wait_for_less_busy_worker ENV.fetch('PUMA_WAIT_FOR_LESS_BUSY_WORKER', 0.001).to_f
|
||||
end
|
||||
|
||||
# https://github.com/puma/puma/blob/master/5.0-Upgrade.md#nakayoshi_fork
|
||||
if defined?(nakayoshi_fork)
|
||||
nakayoshi_fork unless ENV['DISABLE_PUMA_NAKAYOSHI_FORK'] == 'true'
|
||||
end
|
||||
|
||||
# Use json formatter
|
||||
require_relative "/home/git/gitlab/lib/gitlab/puma_logging/json_formatter"
|
||||
|
||||
|
|
|
@ -74,6 +74,11 @@ if defined?(wait_for_less_busy_worker)
|
|||
wait_for_less_busy_worker ENV.fetch('PUMA_WAIT_FOR_LESS_BUSY_WORKER', 0.001).to_f
|
||||
end
|
||||
|
||||
# https://github.com/puma/puma/blob/master/5.0-Upgrade.md#nakayoshi_fork
|
||||
if defined?(nakayoshi_fork)
|
||||
nakayoshi_fork unless ENV['DISABLE_PUMA_NAKAYOSHI_FORK'] == 'true'
|
||||
end
|
||||
|
||||
# Use json formatter
|
||||
require_relative "/home/git/gitlab/lib/gitlab/puma_logging/json_formatter"
|
||||
|
||||
|
|
|
@ -84,6 +84,11 @@ if defined?(wait_for_less_busy_worker)
|
|||
wait_for_less_busy_worker ENV.fetch('PUMA_WAIT_FOR_LESS_BUSY_WORKER', 0.001).to_f
|
||||
end
|
||||
|
||||
# https://github.com/puma/puma/blob/master/5.0-Upgrade.md#nakayoshi_fork
|
||||
if defined?(nakayoshi_fork)
|
||||
nakayoshi_fork unless ENV['DISABLE_PUMA_NAKAYOSHI_FORK'] == 'true'
|
||||
end
|
||||
|
||||
# Use json formatter
|
||||
require_relative "/home/git/gitlab/lib/gitlab/puma_logging/json_formatter"
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@ import { getByTestId, fireEvent } from '@testing-library/dom';
|
|||
import Vuex from 'vuex';
|
||||
import diffsModule from '~/diffs/store/modules';
|
||||
import DiffRow from '~/diffs/components/diff_row.vue';
|
||||
import diffFileMockData from '../mock_data/diff_file';
|
||||
import { mapParallel } from '~/diffs/components/diff_row_utils';
|
||||
|
||||
describe('DiffRow', () => {
|
||||
const testLines = [
|
||||
|
@ -157,4 +159,56 @@ describe('DiffRow', () => {
|
|||
expect(wrapper.emitted().stopdragging).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('sets coverage title and class', () => {
|
||||
const thisLine = diffFileMockData.parallel_diff_lines[2];
|
||||
const rightLine = diffFileMockData.parallel_diff_lines[2].right;
|
||||
|
||||
const mockDiffContent = {
|
||||
diffFile: diffFileMockData,
|
||||
shouldRenderDraftRow: jest.fn(),
|
||||
hasParallelDraftLeft: jest.fn(),
|
||||
hasParallelDraftRight: jest.fn(),
|
||||
draftForLine: jest.fn(),
|
||||
};
|
||||
|
||||
const applyMap = mapParallel(mockDiffContent);
|
||||
const props = {
|
||||
line: applyMap(thisLine),
|
||||
fileHash: diffFileMockData.file_hash,
|
||||
filePath: diffFileMockData.file_path,
|
||||
contextLinesPath: 'contextLinesPath',
|
||||
isHighlighted: false,
|
||||
};
|
||||
const name = diffFileMockData.file_path;
|
||||
const line = rightLine.new_line;
|
||||
|
||||
it('for lines with coverage', () => {
|
||||
const coverageFiles = { files: { [name]: { [line]: 5 } } };
|
||||
const wrapper = createWrapper({ props, state: { coverageFiles } });
|
||||
const coverage = wrapper.find('.line-coverage.right-side');
|
||||
|
||||
expect(coverage.attributes('title')).toContain('Test coverage: 5 hits');
|
||||
expect(coverage.classes('coverage')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('for lines without coverage', () => {
|
||||
const coverageFiles = { files: { [name]: { [line]: 0 } } };
|
||||
const wrapper = createWrapper({ props, state: { coverageFiles } });
|
||||
const coverage = wrapper.find('.line-coverage.right-side');
|
||||
|
||||
expect(coverage.attributes('title')).toContain('No test coverage');
|
||||
expect(coverage.classes('no-coverage')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('for unknown lines', () => {
|
||||
const coverageFiles = {};
|
||||
const wrapper = createWrapper({ props, state: { coverageFiles } });
|
||||
const coverage = wrapper.find('.line-coverage.right-side');
|
||||
|
||||
expect(coverage.attributes('title')).toBeFalsy();
|
||||
expect(coverage.classes('coverage')).toBeFalsy();
|
||||
expect(coverage.classes('no-coverage')).toBeFalsy();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -124,14 +124,6 @@ RSpec.describe MergeRequests::MergeabilityCheckService, :clean_gitlab_redis_shar
|
|||
|
||||
it_behaves_like 'mergeable merge request'
|
||||
|
||||
context 'when lock is disabled' do
|
||||
before do
|
||||
stub_feature_flags(merge_ref_auto_sync_lock: false)
|
||||
end
|
||||
|
||||
it_behaves_like 'mergeable merge request'
|
||||
end
|
||||
|
||||
context 'when concurrent calls' do
|
||||
it 'waits first lock and returns "cached" result in subsequent calls' do
|
||||
threads = execute_within_threads(amount: 3)
|
||||
|
|
Loading…
Reference in New Issue