Commit 1d7e69e3 authored by Mark Florian's avatar Mark Florian

Merge branch 'remove-legacy-license-management' into 'master'

Remove legacy license management dropdown

See merge request gitlab-org/gitlab!31553
parents 0f45ad73 1198cf60
- return unless @project.feature_available?(:license_scanning)
- expanded = expanded_by_default?
%section.settings.no-animate#js-license-management{ class: ('expanded' if expanded), data: { qa_selector: 'license_compliance_settings_content' } }
.settings-header
%h4
= s_('LicenseCompliance|License Compliance')
= link_to icon('question-circle'), help_page_path('user/compliance/license_compliance/index'), target: '_blank', rel: 'noopener noreferrer'
%button.btn.js-settings-toggle{ type: 'button' }
= expanded ? _('Collapse') : _('Expand')
%p
- ci = link_to(s_('Gitlab CI/CD'), 'https://docs.gitlab.com/ee/ci/', target: '_blank', rel: 'noopener noreferrer')
- license = link_to(s_('Auto License Compliance'), 'https://docs.gitlab.com/ee/topics/autodevops/index.html#auto-license-management-ultimate', target: '_blank', rel: 'noopener noreferrer')
= s_('LicenseCompliance|Here you can allow or deny licenses for this project. Using %{ci} or %{license} will allow you to see if there are any unmanaged licenses and allow or deny them in merge request.').html_safe % { ci: ci, license: license }
.settings-content
#js-managed-licenses{ data: { api_url: @license_management_url } }
= render_ce 'projects/settings/ci_cd/show'
= render 'projects/settings/ci_cd/managed_licenses'
= render 'projects/settings/ci_cd/pipeline_subscriptions'
---
title: Remove license management from CI/CD settings
merge_request: 31553
author:
type: changed
......@@ -3091,9 +3091,6 @@ msgstr ""
msgid "Auto DevOps, runners and job artifacts"
msgstr ""
msgid "Auto License Compliance"
msgstr ""
msgid "Auto stop successfully canceled."
msgstr ""
......@@ -10634,9 +10631,6 @@ msgstr ""
msgid "Gitea Import"
msgstr ""
msgid "Gitlab CI/CD"
msgstr ""
msgid "Gitlab Pages"
msgstr ""
......@@ -12931,15 +12925,9 @@ msgstr ""
msgid "LicenseCompliance|Deny"
msgstr ""
msgid "LicenseCompliance|Here you can allow or deny licenses for this project. Using %{ci} or %{license} will allow you to see if there are any unmanaged licenses and allow or deny them in merge request."
msgstr ""
msgid "LicenseCompliance|License"
msgstr ""
msgid "LicenseCompliance|License Compliance"
msgstr ""
msgid "LicenseCompliance|License Compliance detected %d license and policy violation for the source branch only; approval required"
msgid_plural "LicenseCompliance|License Compliance detected %d licenses and policy violations for the source branch only; approval required"
msgstr[0] ""
......
......@@ -123,7 +123,6 @@ module QA
autoload :Integrations, 'qa/ee/page/project/settings/integrations'
autoload :Repository, 'qa/ee/page/project/settings/repository'
autoload :PushRules, 'qa/ee/page/project/settings/push_rules'
autoload :CICD, 'qa/ee/page/project/settings/ci_cd'
autoload :LicenseCompliance, 'qa/ee/page/project/settings/license_compliance'
module Services
......
# frozen_string_literal: true
module QA
module EE
module Page
module Project
module Settings
module CICD
extend QA::Page::PageConcern
def self.prepended(base)
super
base.class_eval do
view 'ee/app/views/projects/settings/ci_cd/_managed_licenses.html.haml' do
element :license_compliance_settings_content
end
end
end
def expand_license_compliance(&block)
expand_section(:license_compliance_settings_content) do
Settings::LicenseCompliance.perform(&block)
end
end
end
end
end
end
end
end
......@@ -42,5 +42,3 @@ module QA
end
end
end
QA::Page::Project::Settings::CICD.prepend_if_ee('QA::EE::Page::Project::Settings::CICD')
# frozen_string_literal: true
require 'pathname'
module QA
context 'Secure', :docker, :runner do
let(:approved_license_name) { "MIT License" }
let(:denied_license_name) { "WTFPL" }
describe 'License Compliance settings page' do
before do
Flow::Login.sign_in
@project = Resource::Project.fabricate_via_api! do |project|
project.name = Runtime::Env.auto_devops_project_name || 'project-with-secure'
project.description = 'Project with Secure'
end
@project.visit!
Page::Project::Menu.perform(&:go_to_ci_cd_settings)
Page::Project::Settings::CICD.perform(&:expand_license_compliance)
end
it 'can approve a license in the settings page' do
QA::EE::Page::Project::Settings::LicenseCompliance.perform do |license_compliance|
license_compliance.approve_license approved_license_name
expect(license_compliance).to have_approved_license approved_license_name
end
end
it 'can deny a license in the settings page' do
QA::EE::Page::Project::Settings::LicenseCompliance.perform do |license_compliance|
license_compliance.deny_license denied_license_name
expect(license_compliance).to have_denied_license denied_license_name
end
end
end
describe 'License Compliance pipeline reports' do
let(:number_of_licenses_in_fixture) { 2 }
after do
@runner.remove_via_api!
end
before do
@executor = "qa-runner-#{Time.now.to_i}"
Flow::Login.sign_in
@project = Resource::Project.fabricate_via_api! do |project|
project.name = Runtime::Env.auto_devops_project_name || 'project-with-secure'
project.description = 'Project with Secure'
end
@runner = Resource::Runner.fabricate! do |runner|
runner.project = @project
runner.name = @executor
runner.tags = %w[qa test]
end
# Push fixture to generate Secure reports
Resource::Repository::ProjectPush.fabricate! do |project_push|
project_push.project = @project
project_push.directory = Pathname
.new(__dir__)
.join('../../../../../ee/fixtures/secure_premade_reports')
project_push.commit_message = 'Create Secure compatible application to serve premade reports'
end.project.visit!
Page::Project::Menu.perform(&:go_to_ci_cd_settings)
Page::Project::Settings::CICD.perform(&:expand_license_compliance)
QA::EE::Page::Project::Settings::LicenseCompliance.perform do |license_compliance|
license_compliance.approve_license approved_license_name
license_compliance.deny_license denied_license_name
end
Page::Project::Menu.perform(&:click_ci_cd_pipelines)
Page::Project::Pipeline::Index.perform(&:wait_for_latest_pipeline_success)
end
it 'displays license approval status in the pipeline' do
Page::Project::Menu.perform(&:click_ci_cd_pipelines)
Page::Project::Pipeline::Index.perform(&:click_on_latest_pipeline)
Page::Project::Pipeline::Show.perform do |pipeline|
pipeline.click_on_licenses
expect(pipeline).to have_license_count_of number_of_licenses_in_fixture
expect(pipeline).to have_approved_license approved_license_name
expect(pipeline).to have_blacklisted_license denied_license_name
end
end
end
end
end
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