Commit 154416fd authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '283850-feature-flag-enable-jira-for-vulnerabilities' into 'master'

Remove jira_for_vulnerabilities feature flag [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!55952
parents 2b11c0c4 19e52066
<script> <script>
import { GlFormGroup, GlFormCheckbox, GlFormInput, GlSprintf, GlLink } from '@gitlab/ui'; import { GlFormGroup, GlFormCheckbox, GlFormInput, GlSprintf, GlLink } from '@gitlab/ui';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
import JiraUpgradeCta from './jira_upgrade_cta.vue'; import JiraUpgradeCta from './jira_upgrade_cta.vue';
...@@ -16,7 +15,6 @@ export default { ...@@ -16,7 +15,6 @@ export default {
JiraIssueCreationVulnerabilities: () => JiraIssueCreationVulnerabilities: () =>
import('ee_component/integrations/edit/components/jira_issue_creation_vulnerabilities.vue'), import('ee_component/integrations/edit/components/jira_issue_creation_vulnerabilities.vue'),
}, },
mixins: [glFeatureFlagsMixin()],
props: { props: {
showJiraIssuesIntegration: { showJiraIssuesIntegration: {
type: Boolean, type: Boolean,
...@@ -76,7 +74,7 @@ export default { ...@@ -76,7 +74,7 @@ export default {
return !this.enableJiraIssues || Boolean(this.projectKey) || !this.validated; return !this.enableJiraIssues || Boolean(this.projectKey) || !this.validated;
}, },
showJiraVulnerabilitiesOptions() { showJiraVulnerabilitiesOptions() {
return this.showJiraVulnerabilitiesIntegration && this.glFeatures.jiraForVulnerabilities; return this.showJiraVulnerabilitiesIntegration;
}, },
showUltimateUpgrade() { showUltimateUpgrade() {
return this.showJiraIssuesIntegration && !this.showJiraVulnerabilitiesIntegration; return this.showJiraIssuesIntegration && !this.showJiraVulnerabilitiesIntegration;
......
...@@ -17,7 +17,6 @@ class Projects::PipelinesController < Projects::ApplicationController ...@@ -17,7 +17,6 @@ class Projects::PipelinesController < Projects::ApplicationController
push_frontend_feature_flag(:pipeline_filter_jobs, project, default_enabled: :yaml) push_frontend_feature_flag(:pipeline_filter_jobs, project, default_enabled: :yaml)
push_frontend_feature_flag(:graphql_pipeline_details, project, type: :development, default_enabled: :yaml) push_frontend_feature_flag(:graphql_pipeline_details, project, type: :development, default_enabled: :yaml)
push_frontend_feature_flag(:graphql_pipeline_details_users, current_user, type: :development, default_enabled: :yaml) push_frontend_feature_flag(:graphql_pipeline_details_users, current_user, type: :development, default_enabled: :yaml)
push_frontend_feature_flag(:jira_for_vulnerabilities, project, type: :development, default_enabled: :yaml)
end end
before_action :ensure_pipeline, only: [:show, :downloadable_artifacts] before_action :ensure_pipeline, only: [:show, :downloadable_artifacts]
......
...@@ -11,9 +11,6 @@ class Projects::ServicesController < Projects::ApplicationController ...@@ -11,9 +11,6 @@ class Projects::ServicesController < Projects::ApplicationController
before_action :web_hook_logs, only: [:edit, :update] before_action :web_hook_logs, only: [:edit, :update]
before_action :set_deprecation_notice_for_prometheus_service, only: [:edit, :update] before_action :set_deprecation_notice_for_prometheus_service, only: [:edit, :update]
before_action :redirect_deprecated_prometheus_service, only: [:update] before_action :redirect_deprecated_prometheus_service, only: [:update]
before_action only: :edit do
push_frontend_feature_flag(:jira_for_vulnerabilities, @project, type: :development, default_enabled: :yaml)
end
respond_to :html respond_to :html
......
---
name: jira_for_vulnerabilities
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46982
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/276893
type: development
group: group::threat insights
default_enabled: true
...@@ -5,7 +5,6 @@ import { VULNERABILITY_MODAL_ID } from 'ee/vue_shared/security_reports/component ...@@ -5,7 +5,6 @@ import { VULNERABILITY_MODAL_ID } from 'ee/vue_shared/security_reports/component
import { BV_SHOW_MODAL } from '~/lib/utils/constants'; import { BV_SHOW_MODAL } from '~/lib/utils/constants';
import { visitUrl } from '~/lib/utils/url_utility'; import { visitUrl } from '~/lib/utils/url_utility';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
export const i18n = { export const i18n = {
moreInfo: s__('SecurityReports|More info'), moreInfo: s__('SecurityReports|More info'),
...@@ -24,7 +23,6 @@ export default { ...@@ -24,7 +23,6 @@ export default {
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
}, },
mixins: [glFeatureFlagsMixin()],
props: { props: {
vulnerability: { vulnerability: {
type: Object, type: Object,
...@@ -49,10 +47,7 @@ export default { ...@@ -49,10 +47,7 @@ export default {
computed: { computed: {
...mapState('vulnerabilities', ['isCreatingIssue', 'isDismissingVulnerability']), ...mapState('vulnerabilities', ['isCreatingIssue', 'isDismissingVulnerability']),
isJiraVulnerabilityIssuesEnabled() { isJiraVulnerabilityIssuesEnabled() {
return ( return Boolean(this?.vulnerability?.create_jira_issue_url);
this.glFeatures?.jiraForVulnerabilities &&
Boolean(this?.vulnerability?.create_jira_issue_url)
);
}, },
createIssueButtonLabel() { createIssueButtonLabel() {
const { $options } = this; const { $options } = this;
......
...@@ -11,7 +11,6 @@ import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; ...@@ -11,7 +11,6 @@ import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import Poll from '~/lib/utils/poll'; import Poll from '~/lib/utils/poll';
import { s__, __ } from '~/locale'; import { s__, __ } from '~/locale';
import initUserPopovers from '~/user_popovers'; import initUserPopovers from '~/user_popovers';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import GenericReportSection from './generic_report/report_section.vue'; import GenericReportSection from './generic_report/report_section.vue';
import HistoryEntry from './history_entry.vue'; import HistoryEntry from './history_entry.vue';
import RelatedIssues from './related_issues.vue'; import RelatedIssues from './related_issues.vue';
...@@ -30,7 +29,6 @@ export default { ...@@ -30,7 +29,6 @@ export default {
GlIcon, GlIcon,
StatusDescription, StatusDescription,
}, },
mixins: [glFeatureFlagMixin()],
inject: { inject: {
createJiraIssueUrl: { createJiraIssueUrl: {
default: '', default: '',
...@@ -222,10 +220,7 @@ export default { ...@@ -222,10 +220,7 @@ export default {
class="card-body" class="card-body"
/> />
</div> </div>
<related-jira-issues <related-jira-issues v-if="createJiraIssueUrl" class="gl-mt-6" />
v-if="glFeatures.jiraForVulnerabilities && createJiraIssueUrl"
class="gl-mt-6"
/>
<related-issues <related-issues
v-else v-else
:endpoint="issueLinksEndpoint" :endpoint="issueLinksEndpoint"
......
...@@ -8,10 +8,6 @@ module Projects ...@@ -8,10 +8,6 @@ module Projects
include IssuableActions include IssuableActions
include RendersNotes include RendersNotes
before_action do
push_frontend_feature_flag(:jira_for_vulnerabilities, @project, default_enabled: :yaml)
end
before_action :vulnerability, except: :index before_action :vulnerability, except: :index
alias_method :vulnerable, :project alias_method :vulnerable, :project
......
...@@ -12,10 +12,7 @@ module EE ...@@ -12,10 +12,7 @@ module EE
end end
def jira_vulnerabilities_integration_available? def jira_vulnerabilities_integration_available?
feature_enabled = ::Feature.enabled?(:jira_for_vulnerabilities, parent, default_enabled: :yaml) parent.present? ? parent.licensed_feature_available?(:jira_vulnerabilities_integration) : License.feature_available?(:jira_vulnerabilities_integration)
feature_available = parent.present? ? parent&.feature_available?(:jira_vulnerabilities_integration) : License.feature_available?(:jira_vulnerabilities_integration)
feature_enabled && feature_available
end end
def jira_vulnerabilities_integration_enabled? def jira_vulnerabilities_integration_enabled?
......
---
title: Allow using Jira for tracking vulnerabilities
merge_request: 55952
author:
type: changed
...@@ -104,9 +104,6 @@ describe('Security Dashboard Action Buttons', () => { ...@@ -104,9 +104,6 @@ describe('Security Dashboard Action Buttons', () => {
vulnerability: mockDataVulnerabilities[8], vulnerability: mockDataVulnerabilities[8],
canCreateIssue: true, canCreateIssue: true,
}, },
provide: {
glFeatures: { jiraForVulnerabilities: true },
},
}); });
}); });
......
...@@ -301,7 +301,6 @@ describe('Vulnerability Footer', () => { ...@@ -301,7 +301,6 @@ describe('Vulnerability Footer', () => {
{ {
provide: { provide: {
createJiraIssueUrl: 'http://foo', createJiraIssueUrl: 'http://foo',
glFeatures: { jiraForVulnerabilities: true },
}, },
}, },
); );
......
...@@ -62,21 +62,9 @@ RSpec.describe EE::ServicesHelper do ...@@ -62,21 +62,9 @@ RSpec.describe EE::ServicesHelper do
end end
end end
context 'when flag is disabled for jira_for_vulnerabilities' do
before do
stub_licensed_features(jira_issues_integration: true, jira_vulnerabilities_integration: true)
stub_feature_flags(jira_for_vulnerabilities: false)
end
it 'includes show_jira_issues_integration' do
is_expected.to include(jira_fields.merge(show_jira_issues_integration: 'true'))
end
end
context 'when all flags are enabled' do context 'when all flags are enabled' do
before do before do
stub_licensed_features(jira_issues_integration: true, jira_vulnerabilities_integration: true) stub_licensed_features(jira_issues_integration: true, jira_vulnerabilities_integration: true)
stub_feature_flags(jira_for_vulnerabilities: true)
end end
it 'includes all Jira fields' do it 'includes all Jira fields' do
......
...@@ -52,24 +52,6 @@ RSpec.describe JiraService do ...@@ -52,24 +52,6 @@ RSpec.describe JiraService do
it { is_expected.to be_falsey } it { is_expected.to be_falsey }
end end
context 'when jira integration is not available for the project' do
before do
stub_feature_flags(jira_for_vulnerabilities: false)
end
context 'when vulnerabilities_enabled is set to false' do
it { is_expected.to be_falsey }
end
context 'when vulnerabilities_enabled is set to true' do
before do
jira_service.vulnerabilities_enabled = true
end
it { is_expected.to eq(false) }
end
end
context 'when jira integration is available for the project' do context 'when jira integration is available for the project' do
before do before do
stub_licensed_features(jira_vulnerabilities_integration: true) stub_licensed_features(jira_vulnerabilities_integration: true)
......
...@@ -136,7 +136,7 @@ describe('JiraIssuesFields', () => { ...@@ -136,7 +136,7 @@ describe('JiraIssuesFields', () => {
describe('Vulnerabilities creation', () => { describe('Vulnerabilities creation', () => {
beforeEach(() => { beforeEach(() => {
createComponent({ provide: { glFeatures: { jiraForVulnerabilities: true } } }); createComponent();
}); });
it.each([true, false])( it.each([true, false])(
...@@ -178,18 +178,6 @@ describe('JiraIssuesFields', () => { ...@@ -178,18 +178,6 @@ describe('JiraIssuesFields', () => {
expect(eventHubEmitSpy).toHaveBeenCalledWith('getJiraIssueTypes'); expect(eventHubEmitSpy).toHaveBeenCalledWith('getJiraIssueTypes');
}); });
describe('with "jiraForVulnerabilities" feature flag disabled', () => {
beforeEach(async () => {
createComponent({
provide: { glFeatures: { jiraForVulnerabilities: false } },
});
});
it('does not show section', () => {
expect(findJiraForVulnerabilities().exists()).toBe(false);
});
});
}); });
}); });
}); });
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