Commit 43e4f9d6 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab master

parents ee20371c 068b13ed
import initIntegrationsList from '~/integrations/index';
import PersistentUserCallout from '~/persistent_user_callout'; import PersistentUserCallout from '~/persistent_user_callout';
document.addEventListener('DOMContentLoaded', () => { const callout = document.querySelector('.js-admin-integrations-moved');
const callout = document.querySelector('.js-admin-integrations-moved');
PersistentUserCallout.factory(callout); PersistentUserCallout.factory(callout);
});
initIntegrationsList();
...@@ -15,11 +15,6 @@ export default { ...@@ -15,11 +15,6 @@ export default {
TestSummary, TestSummary,
TestSummaryTable, TestSummaryTable,
}, },
inject: {
hasTestReport: {
default: false,
},
},
computed: { computed: {
...mapState(['isLoading', 'selectedSuiteIndex', 'testReports']), ...mapState(['isLoading', 'selectedSuiteIndex', 'testReports']),
...mapGetters(['getSelectedSuite']), ...mapGetters(['getSelectedSuite']),
...@@ -32,9 +27,7 @@ export default { ...@@ -32,9 +27,7 @@ export default {
}, },
}, },
created() { created() {
if (this.hasTestReport) { this.fetchSummary();
this.fetchSummary();
}
}, },
methods: { methods: {
...mapActions([ ...mapActions([
......
---
title: Fix bug where test report was not showing while pipeline was running
merge_request: 60416
author:
type: fixed
---
title: Fix Instance-level Project Integration Management page for GitLab FOSS
merge_request: 60354
author:
type: fixed
...@@ -3,6 +3,7 @@ import { GlEmptyState } from '@gitlab/ui'; ...@@ -3,6 +3,7 @@ import { GlEmptyState } from '@gitlab/ui';
import { mapActions } from 'vuex'; import { mapActions } from 'vuex';
import { fetchPolicies } from '~/lib/graphql'; import { fetchPolicies } from '~/lib/graphql';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import pipelineSecurityReportSummaryQuery from '../graphql/queries/pipeline_security_report_summary.query.graphql'; import pipelineSecurityReportSummaryQuery from '../graphql/queries/pipeline_security_report_summary.query.graphql';
import SecurityDashboard from './security_dashboard_vuex.vue'; import SecurityDashboard from './security_dashboard_vuex.vue';
import SecurityReportsSummary from './security_reports_summary.vue'; import SecurityReportsSummary from './security_reports_summary.vue';
...@@ -14,6 +15,7 @@ export default { ...@@ -14,6 +15,7 @@ export default {
SecurityReportsSummary, SecurityReportsSummary,
SecurityDashboard, SecurityDashboard,
}, },
mixins: [glFeatureFlagMixin()],
apollo: { apollo: {
securityReportSummary: { securityReportSummary: {
query: pipelineSecurityReportSummaryQuery, query: pipelineSecurityReportSummaryQuery,
...@@ -75,6 +77,9 @@ export default { ...@@ -75,6 +77,9 @@ export default {
}, },
}, },
computed: { computed: {
shouldShowGraphqlVulnerabilityReport() {
return this.glFeatures.pipelineSecurityDashboardGraphql;
},
emptyStateProps() { emptyStateProps() {
return { return {
svgPath: this.emptyStateSvgPath, svgPath: this.emptyStateSvgPath,
...@@ -107,6 +112,7 @@ export default { ...@@ -107,6 +112,7 @@ export default {
class="gl-my-5" class="gl-my-5"
/> />
<security-dashboard <security-dashboard
v-if="!shouldShowGraphqlVulnerabilityReport"
:vulnerabilities-endpoint="vulnerabilitiesEndpoint" :vulnerabilities-endpoint="vulnerabilitiesEndpoint"
:lock-to-project="{ id: projectId }" :lock-to-project="{ id: projectId }"
:pipeline-id="pipelineId" :pipeline-id="pipelineId"
......
...@@ -10,6 +10,7 @@ module EE ...@@ -10,6 +10,7 @@ module EE
before_action :authorize_read_licenses!, only: [:licenses] before_action :authorize_read_licenses!, only: [:licenses]
before_action do before_action do
push_frontend_feature_flag(:usage_data_i_testing_full_code_quality_report_total, project, default_enabled: true) push_frontend_feature_flag(:usage_data_i_testing_full_code_quality_report_total, project, default_enabled: true)
push_frontend_feature_flag(:pipeline_security_dashboard_graphql, project, type: :development, default_enabled: :yaml)
end end
end end
......
---
name: pipeline_security_dashboard_graphql
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/60138
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/328818
milestone: '13.12'
type: development
group: group::threat insights
default_enabled: false
...@@ -153,6 +153,7 @@ RSpec.describe 'Pipeline', :js do ...@@ -153,6 +153,7 @@ RSpec.describe 'Pipeline', :js do
before do before do
stub_licensed_features(sast: true, security_dashboard: true) stub_licensed_features(sast: true, security_dashboard: true)
stub_feature_flags(pipeline_security_dashboard_graphql: false)
end end
context 'with a sast artifact' do context 'with a sast artifact' do
......
...@@ -24,6 +24,8 @@ describe('Pipeline Security Dashboard component', () => { ...@@ -24,6 +24,8 @@ describe('Pipeline Security Dashboard component', () => {
let store; let store;
let wrapper; let wrapper;
const findSecurityDashboard = () => wrapper.findComponent(SecurityDashboard);
const factory = (options) => { const factory = (options) => {
store = new Vuex.Store({ store = new Vuex.Store({
modules: { modules: {
...@@ -85,15 +87,39 @@ describe('Pipeline Security Dashboard component', () => { ...@@ -85,15 +87,39 @@ describe('Pipeline Security Dashboard component', () => {
}); });
it('renders the security dashboard', () => { it('renders the security dashboard', () => {
const dashboard = wrapper.find(SecurityDashboard); expect(findSecurityDashboard().props()).toMatchObject({
expect(dashboard.exists()).toBe(true);
expect(dashboard.props()).toMatchObject({
pipelineId, pipelineId,
vulnerabilitiesEndpoint, vulnerabilitiesEndpoint,
}); });
}); });
}); });
describe(':pipeline_security_dashboard_graphql feature flag', () => {
it('does not show the security layout when the feature flag is on', () => {
factory({
provide: {
glFeatures: {
pipelineSecurityDashboardGraphql: true,
},
},
});
expect(findSecurityDashboard().exists()).toBe(false);
});
it('shows the security layout when the feature flag is off', () => {
factory({
provide: {
glFeatures: {
pipelineSecurityDashboardGraphql: false,
},
},
});
expect(findSecurityDashboard().exists()).toBe(true);
});
});
describe('with a stubbed dashboard for slot testing', () => { describe('with a stubbed dashboard for slot testing', () => {
beforeEach(() => { beforeEach(() => {
factory({ factory({
......
...@@ -305,6 +305,10 @@ RSpec.describe 'Admin updates settings' do ...@@ -305,6 +305,10 @@ RSpec.describe 'Admin updates settings' do
expect(page).not_to have_content('Some settings have moved') expect(page).not_to have_content('Some settings have moved')
end end
it 'shows integrations table' do
expect(page).to have_selector '[data-testid="inactive-integrations-table"]'
end
end end
context 'CI/CD page' do context 'CI/CD page' do
......
...@@ -31,7 +31,7 @@ describe('Test reports app', () => { ...@@ -31,7 +31,7 @@ describe('Test reports app', () => {
removeSelectedSuiteIndex: jest.fn(), removeSelectedSuiteIndex: jest.fn(),
}; };
const createComponent = ({ state = {}, hasTestReport = true } = {}) => { const createComponent = ({ state = {} } = {}) => {
store = new Vuex.Store({ store = new Vuex.Store({
state: { state: {
isLoading: false, isLoading: false,
...@@ -47,9 +47,6 @@ describe('Test reports app', () => { ...@@ -47,9 +47,6 @@ describe('Test reports app', () => {
shallowMount(TestReports, { shallowMount(TestReports, {
store, store,
localVue, localVue,
provide: {
hasTestReport,
},
}), }),
); );
}; };
...@@ -64,12 +61,6 @@ describe('Test reports app', () => { ...@@ -64,12 +61,6 @@ describe('Test reports app', () => {
expect(actionSpies.fetchSummary).toHaveBeenCalled(); expect(actionSpies.fetchSummary).toHaveBeenCalled();
}); });
it('should not call fetchSummary when pipeline does not have test report', () => {
createComponent({ state: {}, hasTestReport: false });
expect(actionSpies.fetchSummary).not.toHaveBeenCalled();
});
}); });
describe('when loading', () => { describe('when loading', () => {
......
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