Skip to content
Snippets Groups Projects
Verified Commit cfd8100a authored by Leaminn Ma's avatar Leaminn Ma :two:
Browse files

Enable internal Repository X-Ray service

On projects that have Duo code suggestions enabled,
the Repository X-Ray is automatically executed (via
background sidekiq job) when a new commit is pushed to
the default branch of the repo. The X-Ray scans the
repository for supported dependency manager configuration
files and extracts a list of libraries from them. The list
is saved to 'xray_reports' table where it is later used
to augment the context for the Code Generation prompt.

Feature flag removed 'ai_enable_internal_repository_xray_service'

Changelog: added
parent 03bfd4b4
No related branches found
No related tags found
1 merge request!171878Remove feature flag `ai_enable_internal_repository_xray_service`
......@@ -40,16 +40,9 @@ When a code generation request is made, a maximum of 300 libraries from the pars
## Enable Repository X-Ray
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/476180) in GitLab 17.4 [with a flag](../../../feature_flags.md) named `ai_enable_internal_repository_xray_service`. Disabled by default.
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/483928) in GitLab 17.6. Feature flag `ai_enable_internal_repository_xray_service` removed.
FLAG:
The availability of this feature is controlled by a feature flag.
For more information, see the history.
This feature is available for testing, but not ready for production use.
The Repository X-Ray service is automatically enabled if:
- You have enabled the `ai_enable_internal_repository_xray_service` feature flag.
- Your project has access to [GitLab Duo Code Suggestions](index.md).
The Repository X-Ray service is automatically enabled if your project has access to [GitLab Duo Code Suggestions](index.md).
## Supported languages and dependency managers
......
......@@ -65,15 +65,6 @@ module Pipeline
end
end
after_transition any => ::Ci::Pipeline.completed_statuses do |pipeline|
next if ::Feature.enabled?(:ai_enable_internal_repository_xray_service, pipeline.project)
next unless pipeline.has_repository_xray_reports?
pipeline.run_after_commit do
::Ai::StoreRepositoryXrayWorker.perform_async(pipeline.id)
end
end
after_transition any => ::Ci::Pipeline.completed_with_manual_statuses do |pipeline|
pipeline.run_after_commit do
::Ci::SyncReportsToReportApprovalRulesWorker.perform_async(pipeline.id)
......
......@@ -57,7 +57,6 @@ def should_index_commits?
end
def enqueue_repository_xray
return unless ::Feature.enabled?(:ai_enable_internal_repository_xray_service, project)
return if removing_branch?
return unless default_branch? && project.duo_features_enabled
......
---
name: ai_enable_internal_repository_xray_service
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/476180
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/165391
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/483928
milestone: '17.4'
group: group::code creation
type: gitlab_com_derisk
default_enabled: false
......@@ -228,64 +228,6 @@
end
end
describe '::Ai::StoreRepositoryXrayWorker' do
shared_examples_for 'storing the xray reports' do |transition|
subject(:transition_pipeline) { pipeline.update!(status_event: transition) }
before do
allow(pipeline).to receive(:has_repository_xray_reports?).and_return(has_repository_xray_reports)
end
context 'when the xray reports can be stored for the pipeline' do
let(:has_repository_xray_reports) { true }
it 'does not schedule store security scans job' do
expect(::Ai::StoreRepositoryXrayWorker).not_to receive(:perform_async)
transition_pipeline
end
context 'when FF `ai_enable_internal_repository_xray_service` is disabled' do
before do
stub_feature_flags(ai_enable_internal_repository_xray_service: false)
end
it 'schedules store security scans job' do
expect(::Ai::StoreRepositoryXrayWorker).to receive(:perform_async).with(pipeline.id)
transition_pipeline
end
end
end
context 'when the xray reports can not be stored for the pipeline' do
let(:has_repository_xray_reports) { false }
it 'does not schedule store security scans job' do
expect(::Ai::StoreRepositoryXrayWorker).not_to receive(:perform_async)
transition_pipeline
end
end
end
context 'when pipeline is succeeded' do
it_behaves_like 'storing the xray reports', :succeed
end
context 'when pipeline is dropped' do
it_behaves_like 'storing the xray reports', :drop
end
context 'when pipeline is skipped' do
it_behaves_like 'storing the xray reports', :skip
end
context 'when pipeline is canceled' do
it_behaves_like 'storing the xray reports', :cancel
end
end
describe '::Security::UnenforceablePolicyRulesPipelineNotificationWorker' do
shared_examples_for 'notification for unenforceable policy rules' do |transition|
subject(:transition_pipeline) { pipeline.update!(status_event: transition) }
......
......@@ -243,14 +243,6 @@
it_behaves_like 'does not enqueue the X-Ray worker'
end
context 'when the FF `ai_enable_internal_repository_xray_service` is disabled' do
before do
stub_feature_flags(ai_enable_internal_repository_xray_service: false)
end
it_behaves_like 'does not enqueue the X-Ray worker'
end
end
context 'when pushing to a non-default branch' do
......
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