diff --git a/doc/user/compliance/compliance_center/compliance_standards_adherence_dashboard.md b/doc/user/compliance/compliance_center/compliance_standards_adherence_dashboard.md index 8405eb81429a15700077d7b3821ac511f57a0f6a..2203032121f41f7b49f49a033dbaafafea8654c9 100644 --- a/doc/user/compliance/compliance_center/compliance_standards_adherence_dashboard.md +++ b/doc/user/compliance/compliance_center/compliance_standards_adherence_dashboard.md @@ -18,8 +18,8 @@ DETAILS: > - Standards adherence grouping [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/413735) in GitLab 16.9. > - Standards adherence grouping by standards that a check belongs to and grouping by projects that a check belongs to [added](https://gitlab.com/gitlab-org/gitlab/-/issues/413735) in GitLab 16.10. > - **Last Scanned** column [renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/439545) to **Date since last status change** in GitLab 16.10. -> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/440721) DAST scanner check to GitLab Standard in GitLab 17.6 [with a flag](../../../administration/feature_flags.md) named `enable_adherence_check_for_scanners`. Disabled by default. -> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/440722) SAST scanner check to GitLab Standard in GitLab 17.6 [with a flag](../../../administration/feature_flags.md) named `enable_adherence_check_for_scanners`. Disabled by default. +> - DAST scanner check [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/440721) to GitLab Standard in GitLab 17.6. +> - SAST scanner check [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/440722) to GitLab Standard in GitLab 17.6. The compliance standards adherence dashboard lists the adherence status of projects complying to the _GitLab standard_. diff --git a/ee/app/services/ee/ci/job_artifacts/create_service.rb b/ee/app/services/ee/ci/job_artifacts/create_service.rb index 2c85bbc5a845451803fdd5c3983c9627320b4f94..79f0fe1710e5e6705dd6009686b1c3b2068b58b8 100644 --- a/ee/app/services/ee/ci/job_artifacts/create_service.rb +++ b/ee/app/services/ee/ci/job_artifacts/create_service.rb @@ -14,8 +14,7 @@ def track_artifact_uploader(artifact) if artifact.file_type == 'metrics' track_usage_event(METRICS_REPORT_UPLOAD_EVENT_NAME, job.user_id) - elsif ::Feature.enabled?(:enable_adherence_check_for_scanners, project) && - artifact.job.pipeline.ref == artifact.project.default_branch + elsif artifact.job.pipeline.ref == artifact.project.default_branch if artifact.file_type == 'sast' ::ComplianceManagement::Standards::Gitlab::SastWorker .perform_async({ 'project_id' => project.id, 'user_id' => job.user_id }) diff --git a/ee/config/feature_flags/gitlab_com_derisk/enable_adherence_check_for_scanners.yml b/ee/config/feature_flags/gitlab_com_derisk/enable_adherence_check_for_scanners.yml deleted file mode 100644 index fe91ece259c7c2f459f7a91f1a46edcaa132951f..0000000000000000000000000000000000000000 --- a/ee/config/feature_flags/gitlab_com_derisk/enable_adherence_check_for_scanners.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -name: enable_adherence_check_for_scanners -feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/440722 -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/163579/ -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/492118 -milestone: '17.6' -group: group::compliance -type: gitlab_com_derisk -default_enabled: false diff --git a/ee/spec/services/ee/ci/job_artifacts/create_service_spec.rb b/ee/spec/services/ee/ci/job_artifacts/create_service_spec.rb index 9cc09159652b3227580ecee7083c158d4e485e2e..0a47f570ffba457c42119badfccfd2ab6efe68bd 100644 --- a/ee/spec/services/ee/ci/job_artifacts/create_service_spec.rb +++ b/ee/spec/services/ee/ci/job_artifacts/create_service_spec.rb @@ -70,41 +70,27 @@ def unique_metrics_report_uploaders allow(job).to receive(:user_id).and_return(123) end - context 'when enable_adherence_check_for_scanners is enabled' do - context 'when the artifact is for project default branch' do - it 'triggers the adherence worker' do - expect(::ComplianceManagement::Standards::Gitlab::SastWorker).to receive(:perform_async) - .with({ 'project_id' => project.id, 'user_id' => 123 }) - - subject - end - end - - context 'when the artifact is not for project default branch' do - let(:merge_request) do - create( - :merge_request, source_project: project - ) - end - - let(:pipeline) { create(:ci_pipeline, :detached_merge_request_pipeline, merge_request: merge_request) } - - let(:job) { create(:ci_build, pipeline: pipeline, project: project) } - - it 'does not trigger the adherence worker' do - expect(::ComplianceManagement::Standards::Gitlab::SastWorker).not_to receive(:perform_async) + context 'when the artifact is for project default branch' do + it 'triggers the adherence worker' do + expect(::ComplianceManagement::Standards::Gitlab::SastWorker).to receive(:perform_async) + .with({ 'project_id' => project.id, 'user_id' => 123 }) - subject - end + subject end end - context 'when enable_adherence_check_for_scanners is disabled' do - before do - stub_feature_flags(enable_adherence_check_for_scanners: false) + context 'when the artifact is not for project default branch' do + let(:merge_request) do + create( + :merge_request, source_project: project + ) end - it 'does not trigger adherence worker' do + let(:pipeline) { create(:ci_pipeline, :detached_merge_request_pipeline, merge_request: merge_request) } + + let(:job) { create(:ci_build, pipeline: pipeline, project: project) } + + it 'does not trigger the adherence worker' do expect(::ComplianceManagement::Standards::Gitlab::SastWorker).not_to receive(:perform_async) subject @@ -119,41 +105,27 @@ def unique_metrics_report_uploaders allow(job).to receive(:user_id).and_return(123) end - context 'when enable_adherence_check_for_scanners is enabled' do - context 'when the artifact is for project default branch' do - it 'triggers the adherence worker' do - expect(::ComplianceManagement::Standards::Gitlab::DastWorker).to receive(:perform_async) - .with({ 'project_id' => project.id, 'user_id' => 123 }) + context 'when the artifact is for project default branch' do + it 'triggers the adherence worker' do + expect(::ComplianceManagement::Standards::Gitlab::DastWorker).to receive(:perform_async) + .with({ 'project_id' => project.id, 'user_id' => 123 }) - subject - end - end - - context 'when the artifact is not for project default branch' do - let(:merge_request) do - create( - :merge_request, source_project: project - ) - end - - let(:pipeline) { create(:ci_pipeline, :detached_merge_request_pipeline, merge_request: merge_request) } - - let(:job) { create(:ci_build, pipeline: pipeline, project: project) } - - it 'does not trigger the adherence worker' do - expect(::ComplianceManagement::Standards::Gitlab::DastWorker).not_to receive(:perform_async) - - subject - end + subject end end - context 'when enable_adherence_check_for_scanners is disabled' do - before do - stub_feature_flags(enable_adherence_check_for_scanners: false) + context 'when the artifact is not for project default branch' do + let(:merge_request) do + create( + :merge_request, source_project: project + ) end - it 'does not trigger adherence worker' do + let(:pipeline) { create(:ci_pipeline, :detached_merge_request_pipeline, merge_request: merge_request) } + + let(:job) { create(:ci_build, pipeline: pipeline, project: project) } + + it 'does not trigger the adherence worker' do expect(::ComplianceManagement::Standards::Gitlab::DastWorker).not_to receive(:perform_async) subject