Skip to content
Snippets Groups Projects
Commit 7dc0ad44 authored by Phil Hughes's avatar Phil Hughes
Browse files

Merge branch 'feature-flag-license-compliance-extension' into 'master'

Feature flag out license compliance extension

See merge request !84128
parents 04d20746 1b3b3b87
No related branches found
No related tags found
1 merge request!84128Feature flag out license compliance extension
Pipeline #526968032 passed
......@@ -24,8 +24,8 @@ export default {
computed: {
summary() {
if (
this.collapsedData[0].new_licenses.length > 0 &&
this.collapsedData[0].removed_licenses.length > 0
this.collapsedData[0].new_licenses?.length > 0 &&
this.collapsedData[0].removed_licenses?.length > 0
) {
const newLicenses = n__(
'%d new license',
......@@ -40,13 +40,13 @@ export default {
);
return sprintf(__(`License Compliance detected ${newLicenses} and ${removedLicenses}`));
} else if (this.collapsedData[0].new_licenses.length > 0) {
} else if (this.collapsedData[0].new_licenses?.length > 0) {
return n__(
'LicenseCompliance|License Compliance detected %d new license',
'LicenseCompliance|License Compliance detected %d new licenses',
this.collapsedData[0].new_licenses.length,
);
} else if (this.collapsedData[0].removed_licenses.length > 0) {
} else if (this.collapsedData[0].removed_licenses?.length > 0) {
return n__(
'LicenseCompliance|License Compliance detected %d removed license',
'LicenseCompliance|License Compliance detected %d removed licenses',
......@@ -57,7 +57,7 @@ export default {
return s__('LicenseCompliance|License Compliance detected no new licenses');
},
statusIcon() {
if (this.collapsedData[0].new_licenses.length === 0) {
if (this.collapsedData[0].new_licenses?.length === 0) {
return EXTENSION_ICONS.success;
}
return EXTENSION_ICONS.warning;
......
......@@ -91,6 +91,9 @@ export default {
!this.shouldShowExtension
);
},
shouldShowLicenseComplianceExtension() {
return window.gon?.features?.refactorLicenseComplianceExtension;
},
hasLoadPerformanceMetrics() {
return (
this.mr.loadPerformanceMetrics?.degraded?.length > 0 ||
......@@ -220,7 +223,7 @@ export default {
},
methods: {
registerLicenseCompliance() {
if (this.shouldShowExtension) {
if (this.shouldShowLicenseComplianceExtension) {
registerExtension(licenseComplianceExtension);
}
},
......@@ -475,7 +478,7 @@ export default {
</mr-widget-enable-feature-prompt>
<mr-widget-licenses
v-if="shouldRenderLicenseReport && !shouldShowExtension"
v-if="shouldRenderLicenseReport && !shouldShowLicenseComplianceExtension"
:api-url="mr.licenseScanning.managed_licenses_path"
:approvals-api-path="mr.apiApprovalsPath"
:licenses-api-path="licensesApiPath"
......
......@@ -19,6 +19,7 @@ module MergeRequestsController
push_frontend_feature_flag(:refactor_mr_widgets_extensions, @project, default_enabled: :yaml)
push_frontend_feature_flag(:refactor_mr_widget_test_summary, @project, default_enabled: :yaml)
push_frontend_feature_flag(:refactor_mr_widgets_extensions_user, current_user, default_enabled: :yaml)
push_frontend_feature_flag(:refactor_license_compliance_extension, @project, default_enabled: :yaml)
push_frontend_feature_flag(:status_checks_add_status_field, default_enabled: :yaml)
push_frontend_feature_flag(:lc_remove_legacy_approval_status, @project, default_enabled: :yaml)
end
......
---
name: refactor_license_compliance_extension
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/84128
rollout_issue_url:
milestone: '15.0'
type: development
group: group::composition analysis
default_enabled: false
......@@ -25,6 +25,7 @@
stub_licensed_features(external_status_checks: true)
stub_feature_flags(refactor_mr_widgets_extensions: false)
stub_feature_flags(refactor_mr_widgets_extensions_user: false)
stub_feature_flags(refactor_license_compliance_extension: false)
end
context 'user is authorized' do
......
......@@ -4,7 +4,7 @@ module QA
# Leaving :global scope out of feature_flag metadata
# This will allow test to still run in staging since we are only checking if the feature is enabled
RSpec.describe 'Secure', :runner, feature_flag: { name: 'lc_remove_legacy_approval_status' } do
describe 'License merge request widget' do
describe 'License merge request widget', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/360307' do
let(:approved_license_name) { "MIT License" }
let(:denied_license_name) { "zlib License" }
let(:executor) { "qa-runner-#{Time.now.to_i}" }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment