Skip to content
Snippets Groups Projects
Verified Commit b099360d authored by Harsimar Sandhu's avatar Harsimar Sandhu :three: Committed by GitLab
Browse files

Remove enable_adherence_check_for_scanners feature flag

This commit removes feature flag enable_adherence_check_for_scanners

Changelog: changed
parent 50d53e5d
No related branches found
No related tags found
1 merge request!172352Remove enable_adherence_check_for_scanners feature flag
......@@ -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_.
......
......@@ -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 })
......
---
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
......@@ -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
......
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