Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2020-07-24 06:09:38 +00:00
parent 3261f18a4b
commit fe9cb6b25a
13 changed files with 94 additions and 40 deletions

View File

@ -45,7 +45,10 @@ export const fetchTestSuite = ({ state, commit, dispatch }, index) => {
const { name = '', build_ids = [] } = state.testReports?.test_suites?.[index] || {};
// Replacing `/:suite_name.json` with the name of the suite. Including the extra characters
// to ensure that we replace exactly the template part of the URL string
const endpoint = state.suiteEndpoint?.replace('/:suite_name.json', `/${name}.json`);
const endpoint = state.suiteEndpoint?.replace(
'/:suite_name.json',
`/${encodeURIComponent(name)}.json`,
);
return axios
.get(endpoint, { params: { build_ids } })

View File

@ -33,7 +33,7 @@
height: $gl-padding-32;
&-arrow {
color: $gray-300;
color: $gray-200;
}
&-downstream {

View File

@ -40,7 +40,7 @@
color: $gl-gray-dark;
&:hover {
background-color: $gray-300;
background-color: $gray-200;
}
}

View File

@ -187,7 +187,7 @@
tr {
th {
border-bottom: solid 2px $gray-300;
border-bottom: solid 2px $gray-200;
}
}

View File

@ -165,7 +165,7 @@ $gray-10: #fafafa !default;
$gray-50: #f0f0f0 !default;
$gray-100: #dbdbdb !default;
$gray-200: #bfbfbf !default;
$gray-300: #ccc !default;
$gray-300: #999 !default;
$gray-400: #bababa !default;
$gray-500: #a7a7a7 !default;
$gray-600: #919191 !default;

View File

@ -809,7 +809,7 @@
&.ci-status-icon-created,
&.ci-status-icon-skipped {
@include mini-pipeline-graph-color($white, $gray-100, $gray-300, $gray-500, $gray-600, $gray-700);
@include mini-pipeline-graph-color($white, $gray-100, $gray-200, $gray-500, $gray-600, $gray-700);
}
}

View File

@ -1,15 +1,15 @@
- breadcrumb_title _("Dashboard")
- page_title _("Dashboard")
- if show_license_breakdown?
= render_if_exists 'admin/licenses/breakdown', license: @license
- if @notices
- @notices.each do |notice|
.js-vue-alert{ 'v-cloak': true, data: { variant: notice[:type],
dismissible: true.to_s } }
= notice[:message].html_safe
- if show_license_breakdown?
= render_if_exists 'admin/licenses/breakdown', license: @license
.admin-dashboard.gl-mt-3
.row
.col-sm-4

View File

@ -218,6 +218,7 @@ Only available to [administrators](../user/permissions.md).
All API requests support performing an API call as if you were another user,
provided you are authenticated as an administrator with an OAuth or Personal Access Token that has the `sudo` scope.
The API requests are executed with the permissions of the impersonated user.
You need to pass the `sudo` parameter either via query string or a header with an ID/username of
the user you want to perform the operation as. If passed as a header, the

View File

@ -15,7 +15,7 @@ module QA
disable_optional_jobs(project)
end
describe 'Auto DevOps support', :orchestrated, :kubernetes do
describe 'Auto DevOps support', :orchestrated, :kubernetes, quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/230927', type: :stale } do
context 'when rbac is enabled' do
let(:cluster) { Service::KubernetesCluster.new.create! }

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
module QA
RSpec.describe 'Monitor' do
RSpec.describe 'Monitor', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/230927', type: :stale } do
describe 'with Prometheus in a Gitlab-managed cluster', :orchestrated, :kubernetes, :requires_admin do
before :all do
@cluster = Service::KubernetesCluster.new(provider_class: Service::ClusterProvider::K3s).create!

View File

@ -2,39 +2,46 @@ import { shallowMount } from '@vue/test-utils';
import DiffStats from '~/diffs/components/diff_stats.vue';
import Icon from '~/vue_shared/components/icon.vue';
const TEST_ADDED_LINES = 100;
const TEST_REMOVED_LINES = 200;
const DIFF_FILES_LENGTH = 300;
describe('diff_stats', () => {
it('does not render a group if diffFileLengths is empty', () => {
const wrapper = shallowMount(DiffStats, {
let wrapper;
const createComponent = (props = {}) => {
wrapper = shallowMount(DiffStats, {
propsData: {
addedLines: 1,
removedLines: 2,
addedLines: TEST_ADDED_LINES,
removedLines: TEST_REMOVED_LINES,
...props,
},
});
const groups = wrapper.findAll('.diff-stats-group');
};
expect(groups.length).toBe(2);
});
describe('diff stats group', () => {
const findDiffStatsGroup = () => wrapper.findAll('.diff-stats-group');
it('does not render a group if diffFileLengths is not a number', () => {
const wrapper = shallowMount(DiffStats, {
propsData: {
addedLines: 1,
removedLines: 2,
it('is not rendered if diffFileLengths is empty', () => {
createComponent();
expect(findDiffStatsGroup().length).toBe(2);
});
it('is not rendered if diffFileLengths is not a number', () => {
createComponent({
diffFilesLength: Number.NaN,
},
});
const groups = wrapper.findAll('.diff-stats-group');
});
expect(groups.length).toBe(2);
expect(findDiffStatsGroup().length).toBe(2);
});
});
it('shows amount of files changed, lines added and lines removed when passed all props', () => {
const wrapper = shallowMount(DiffStats, {
propsData: {
addedLines: 100,
removedLines: 200,
diffFilesLength: 300,
},
describe('amount displayed', () => {
beforeEach(() => {
createComponent({
diffFilesLength: DIFF_FILES_LENGTH,
});
});
const findFileLine = name => wrapper.find(name);
@ -43,12 +50,17 @@ describe('diff_stats', () => {
.findAll(Icon)
.filter(c => c.attributes('name') === name)
.at(0).element.parentNode;
const additions = findFileLine('.js-file-addition-line');
const deletions = findFileLine('.js-file-deletion-line');
const filesChanged = findIcon('doc-code');
expect(additions.text()).toBe('100');
expect(deletions.text()).toBe('200');
expect(filesChanged.textContent).toContain('300');
it('shows the amount of lines added', () => {
expect(findFileLine('.js-file-addition-line').text()).toBe(TEST_ADDED_LINES.toString());
});
it('shows the amount of lines removed', () => {
expect(findFileLine('.js-file-deletion-line').text()).toBe(TEST_REMOVED_LINES.toString());
});
it('shows the amount of files changed', () => {
expect(findIcon('doc-code').textContent).toContain(DIFF_FILES_LENGTH);
});
});
});

View File

@ -159,6 +159,35 @@ describe('Actions TestReports Store', () => {
testAction(actions.fetchTestSuite, index, { ...state, testReports }, [], [], done);
});
});
describe('when the suite name has a `/` in it', () => {
it('sets test suite, shows tests, and encodes the suite name', done => {
const index = 0;
const suite = testReports.test_suites[0];
const { name } = suite;
const slashName = `${name}/8`;
testReports.test_suites[0].name = slashName;
const buildIds = [1];
testReports.test_suites[0].hasFullSuite = false;
testReports.test_suites[0].build_ids = buildIds;
const endpoint = suiteEndpoint.replace(':suite_name', encodeURIComponent(slashName));
mock
.onGet(endpoint, { params: { build_ids: buildIds } })
.replyOnce(200, testReports.test_suites[0], {});
testAction(
actions.fetchTestSuite,
index,
{ ...state, testReports },
[{ type: types.SET_SUITE, payload: { suite, index } }],
[{ type: 'toggleLoading' }, { type: 'toggleLoading' }],
() => {
expect(mock.history.get.map(x => x.url)).toEqual([endpoint]);
done();
},
);
});
});
});
describe('fetch full report', () => {

View File

@ -32,4 +32,13 @@ RSpec.describe 'admin/dashboard/index.html.haml' do
expect(rendered).to have_content "#{Gitlab::VERSION} (#{Gitlab.revision})"
end
it 'does not include license breakdown' do
render
expect(rendered).not_to have_content "Users in License"
expect(rendered).not_to have_content "Active Users"
expect(rendered).not_to have_content "Maximum Users"
expect(rendered).not_to have_content "Users over License"
end
end