Commit 27b453cb authored by Sean McGivern's avatar Sean McGivern

Merge branch '212869-rename-lm-reports' into 'master'

Rename license_scanning_reports route

See merge request gitlab-org/gitlab!28932
parents b1d56b02 6acd97af
...@@ -46,8 +46,8 @@ module EE ...@@ -46,8 +46,8 @@ module EE
render_approvals_json render_approvals_json
end end
def license_management_reports def license_scanning_reports
reports_response(merge_request.compare_license_management_reports(current_user)) reports_response(merge_request.compare_license_scanning_reports(current_user))
end end
def container_scanning_reports def container_scanning_reports
......
...@@ -183,7 +183,7 @@ module EE ...@@ -183,7 +183,7 @@ module EE
compare_reports(::Ci::CompareDependencyScanningReportsService, current_user) compare_reports(::Ci::CompareDependencyScanningReportsService, current_user)
end end
def has_license_management_reports? def has_license_scanning_reports?
!!(actual_head_pipeline&.has_reports?(::Ci::JobArtifact.license_scanning_reports)) !!(actual_head_pipeline&.has_reports?(::Ci::JobArtifact.license_scanning_reports))
end end
...@@ -217,8 +217,8 @@ module EE ...@@ -217,8 +217,8 @@ module EE
compare_reports(::Ci::CompareDastReportsService, current_user) compare_reports(::Ci::CompareDastReportsService, current_user)
end end
def compare_license_management_reports(current_user) def compare_license_scanning_reports(current_user)
return missing_report_error("license management") unless has_license_management_reports? return missing_report_error("license scanning") unless has_license_scanning_reports?
compare_reports(::Ci::CompareLicenseScanningReportsService, current_user) compare_reports(::Ci::CompareLicenseScanningReportsService, current_user)
end end
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
window.gl.mrWidgetData.approvals_help_path = '#{help_page_path("user/project/merge_requests/merge_request_approvals")}'; window.gl.mrWidgetData.approvals_help_path = '#{help_page_path("user/project/merge_requests/merge_request_approvals")}';
window.gl.mrWidgetData.codequality_help_path = '#{help_page_path("user/project/merge_requests/code_quality", anchor: "code-quality-reports")}'; window.gl.mrWidgetData.codequality_help_path = '#{help_page_path("user/project/merge_requests/code_quality", anchor: "code-quality-reports")}';
window.gl.mrWidgetData.visual_review_app_available = '#{@project.feature_available?(:visual_review_app)}' === 'true'; window.gl.mrWidgetData.visual_review_app_available = '#{@project.feature_available?(:visual_review_app)}' === 'true';
window.gl.mrWidgetData.license_scanning_comparison_path = '#{license_management_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:license_management)}' window.gl.mrWidgetData.license_scanning_comparison_path = '#{license_scanning_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:license_management)}'
window.gl.mrWidgetData.container_scanning_comparison_path = '#{container_scanning_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:container_scanning)}' window.gl.mrWidgetData.container_scanning_comparison_path = '#{container_scanning_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:container_scanning)}'
window.gl.mrWidgetData.dependency_scanning_comparison_path = '#{dependency_scanning_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:dependency_scanning)}' window.gl.mrWidgetData.dependency_scanning_comparison_path = '#{dependency_scanning_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:dependency_scanning)}'
window.gl.mrWidgetData.sast_comparison_path = '#{sast_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:sast)}' window.gl.mrWidgetData.sast_comparison_path = '#{sast_reports_project_merge_request_path(@project, @merge_request) if @project.feature_available?(:sast)}'
......
...@@ -5,7 +5,7 @@ resources :merge_requests, only: [], constraints: { id: /\d+/ } do ...@@ -5,7 +5,7 @@ resources :merge_requests, only: [], constraints: { id: /\d+/ } do
get '/descriptions/:version_id/diff', action: :description_diff, as: :description_diff get '/descriptions/:version_id/diff', action: :description_diff, as: :description_diff
delete '/descriptions/:version_id', action: :delete_description_version, as: :delete_description_version delete '/descriptions/:version_id', action: :delete_description_version, as: :delete_description_version
get :metrics_reports get :metrics_reports
get :license_management_reports get :license_scanning_reports
get :container_scanning_reports get :container_scanning_reports
get :dependency_scanning_reports get :dependency_scanning_reports
get :sast_reports get :sast_reports
......
...@@ -698,8 +698,9 @@ describe Projects::MergeRequestsController do ...@@ -698,8 +698,9 @@ describe Projects::MergeRequestsController do
it_behaves_like 'authorize read pipeline' it_behaves_like 'authorize read pipeline'
end end
describe 'GET #license_management_reports' do describe 'GET #license_scanning_reports' do
let(:merge_request) { create(:ee_merge_request, :with_license_scanning_reports, source_project: project, author: create(:user)) } let(:merge_request) { create(:ee_merge_request, :with_license_scanning_reports, source_project: project, author: create(:user)) }
let(:params) do let(:params) do
{ {
namespace_id: project.namespace.to_param, namespace_id: project.namespace.to_param,
...@@ -708,7 +709,7 @@ describe Projects::MergeRequestsController do ...@@ -708,7 +709,7 @@ describe Projects::MergeRequestsController do
} }
end end
subject { get :license_management_reports, params: params, format: :json } subject { get :license_scanning_reports, params: params, format: :json }
before do before do
allow_any_instance_of(::MergeRequest).to receive(:compare_reports) allow_any_instance_of(::MergeRequest).to receive(:compare_reports)
......
...@@ -115,9 +115,9 @@ describe MergeRequest do ...@@ -115,9 +115,9 @@ describe MergeRequest do
:container_scanning | :with_container_scanning_reports | :container_scanning :container_scanning | :with_container_scanning_reports | :container_scanning
:dast | :with_dast_reports | :dast :dast | :with_dast_reports | :dast
:dependency_scanning | :with_dependency_scanning_reports | :dependency_scanning :dependency_scanning | :with_dependency_scanning_reports | :dependency_scanning
:license_management | :with_license_management_reports | :license_management :license_management | :with_license_management_reports | :license_scanning
:license_management | :with_license_scanning_reports | :license_management :license_management | :with_license_scanning_reports | :license_scanning
:license_scanning | :with_license_scanning_reports | :license_management :license_scanning | :with_license_scanning_reports | :license_scanning
end end
with_them do with_them do
...@@ -162,22 +162,22 @@ describe MergeRequest do ...@@ -162,22 +162,22 @@ describe MergeRequest do
end end
end end
describe '#has_license_management_reports?' do describe '#has_license_scanning_reports?' do
subject { merge_request.has_license_management_reports? } subject { merge_request.has_license_scanning_reports? }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
before do before do
stub_licensed_features(license_management: true) stub_licensed_features(license_scanning: true)
end end
context 'when head pipeline has license management reports' do context 'when head pipeline has license scanning reports' do
let(:merge_request) { create(:ee_merge_request, :with_license_management_reports, source_project: project) } let(:merge_request) { create(:ee_merge_request, :with_license_scanning_reports, source_project: project) }
it { is_expected.to be_truthy } it { is_expected.to be_truthy }
end end
context 'when head pipeline does not have license management reports' do context 'when head pipeline does not have license scanning reports' do
let(:merge_request) { create(:ee_merge_request, source_project: project) } let(:merge_request) { create(:ee_merge_request, source_project: project) }
it { is_expected.to be_falsey } it { is_expected.to be_falsey }
...@@ -294,7 +294,7 @@ describe MergeRequest do ...@@ -294,7 +294,7 @@ describe MergeRequest do
it { is_expected.to be_truthy } it { is_expected.to be_truthy }
end end
context 'when head pipeline does not have license management reports' do context 'when head pipeline does not have license scanning reports' do
let(:merge_request) { create(:ee_merge_request, source_project: project) } let(:merge_request) { create(:ee_merge_request, source_project: project) }
it { is_expected.to be_falsey } it { is_expected.to be_falsey }
...@@ -439,8 +439,8 @@ describe MergeRequest do ...@@ -439,8 +439,8 @@ describe MergeRequest do
end end
end end
describe '#compare_license_management_reports' do describe '#compare_license_scanning_reports' do
subject { merge_request.compare_license_management_reports(current_user) } subject { merge_request.compare_license_scanning_reports(current_user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:current_user) { project.users.first } let(:current_user) { project.users.first }
...@@ -448,7 +448,7 @@ describe MergeRequest do ...@@ -448,7 +448,7 @@ describe MergeRequest do
let!(:base_pipeline) do let!(:base_pipeline) do
create(:ee_ci_pipeline, create(:ee_ci_pipeline,
:with_license_management_report, :with_license_scanning_report,
project: project, project: project,
ref: merge_request.target_branch, ref: merge_request.target_branch,
sha: merge_request.diff_base_sha) sha: merge_request.diff_base_sha)
...@@ -458,10 +458,10 @@ describe MergeRequest do ...@@ -458,10 +458,10 @@ describe MergeRequest do
merge_request.update!(head_pipeline_id: head_pipeline.id) merge_request.update!(head_pipeline_id: head_pipeline.id)
end end
context 'when head pipeline has license management reports' do context 'when head pipeline has license scanning reports' do
let!(:head_pipeline) do let!(:head_pipeline) do
create(:ee_ci_pipeline, create(:ee_ci_pipeline,
:with_license_management_report, :with_license_scanning_report,
project: project, project: project,
ref: merge_request.source_branch, ref: merge_request.source_branch,
sha: merge_request.diff_head_sha) sha: merge_request.diff_head_sha)
...@@ -510,7 +510,7 @@ describe MergeRequest do ...@@ -510,7 +510,7 @@ describe MergeRequest do
end end
end end
context 'when head pipeline does not have license management reports' do context 'when head pipeline does not have license scanning reports' do
let!(:head_pipeline) do let!(:head_pipeline) do
create(:ci_pipeline, create(:ci_pipeline,
project: project, project: project,
...@@ -520,7 +520,7 @@ describe MergeRequest do ...@@ -520,7 +520,7 @@ describe MergeRequest do
it 'returns status and error message' do it 'returns status and error message' do
expect(subject[:status]).to eq(:error) expect(subject[:status]).to eq(:error)
expect(subject[:status_reason]).to eq('This merge request does not have license management reports') expect(subject[:status_reason]).to eq('This merge request does not have license scanning reports')
end 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