Commit c1b0422c authored by Kerri Miller's avatar Kerri Miller

Merge branch 'remove-preload_associations_jobs_request_api_endpoint-feature-flag' into 'master'

Remove by default enabled feature flag

See merge request gitlab-org/gitlab!68165
parents 5fbd7155 044d6166
......@@ -169,11 +169,7 @@ module Ci
end
def all_dependencies
if Feature.enabled?(:preload_associations_jobs_request_api_endpoint, project, default_enabled: :yaml)
strong_memoize(:all_dependencies) do
dependencies.all
end
else
strong_memoize(:all_dependencies) do
dependencies.all
end
end
......
......@@ -58,11 +58,7 @@ module Ci
# rubocop: disable CodeReuse/ActiveRecord
def all_dependencies
dependencies = super
if Feature.enabled?(:preload_associations_jobs_request_api_endpoint, project, default_enabled: :yaml)
ActiveRecord::Associations::Preloader.new.preload(dependencies, :job_artifacts_archive)
end
ActiveRecord::Associations::Preloader.new.preload(dependencies, :job_artifacts_archive)
dependencies
end
# rubocop: enable CodeReuse/ActiveRecord
......
---
name: preload_associations_jobs_request_api_endpoint
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57694
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/326477
milestone: "13.11"
type: development
group: group::pipeline execution
default_enabled: true
......@@ -506,32 +506,12 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state do
end
describe 'preloading job_artifacts_archive' do
context 'when the feature flag is disabled' do
before do
stub_feature_flags(preload_associations_jobs_request_api_endpoint: false)
end
it 'queries the ci_job_artifacts table multiple times' do
expect { request_job }.to exceed_all_query_limit(1).for_model(::Ci::JobArtifact)
end
it 'queries the ci_builds table more than three times' do
expect { request_job }.to exceed_all_query_limit(3).for_model(::Ci::Build)
end
it 'queries the ci_job_artifacts table once only' do
expect { request_job }.not_to exceed_all_query_limit(1).for_model(::Ci::JobArtifact)
end
context 'when the feature flag is enabled' do
before do
stub_feature_flags(preload_associations_jobs_request_api_endpoint: true)
end
it 'queries the ci_job_artifacts table once only' do
expect { request_job }.not_to exceed_all_query_limit(1).for_model(::Ci::JobArtifact)
end
it 'queries the ci_builds table five times' do
expect { request_job }.not_to exceed_all_query_limit(5).for_model(::Ci::Build)
end
it 'queries the ci_builds table five times' do
expect { request_job }.not_to exceed_all_query_limit(5).for_model(::Ci::Build)
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