Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f78b53e0
Commit
f78b53e0
authored
Jan 26, 2022
by
Marius Bobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove feature flag for bulk inserting job tags
Changelog: other
parent
e09a291d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
57 deletions
+2
-57
config/feature_flags/development/ci_bulk_insert_tags.yml
config/feature_flags/development/ci_bulk_insert_tags.yml
+0
-8
lib/gitlab/ci/pipeline/chain/create.rb
lib/gitlab/ci/pipeline/chain/create.rb
+2
-8
spec/lib/gitlab/ci/pipeline/chain/create_spec.rb
spec/lib/gitlab/ci/pipeline/chain/create_spec.rb
+0
-16
spec/services/ci/create_pipeline_service/tags_spec.rb
spec/services/ci/create_pipeline_service/tags_spec.rb
+0
-25
No files found.
config/feature_flags/development/ci_bulk_insert_tags.yml
deleted
100644 → 0
View file @
e09a291d
---
name
:
ci_bulk_insert_tags
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/73198
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/346124
milestone
:
'
14.6'
type
:
development
group
:
group::pipeline execution
default_enabled
:
true
lib/gitlab/ci/pipeline/chain/create.rb
View file @
f78b53e0
...
...
@@ -14,7 +14,7 @@ module Gitlab
with_bulk_insert_tags
do
pipeline
.
transaction
do
pipeline
.
save!
CommitStatus
.
bulk_insert_tags!
(
statuses
)
if
bulk_insert_tags?
CommitStatus
.
bulk_insert_tags!
(
statuses
)
end
end
end
...
...
@@ -29,15 +29,9 @@ module Gitlab
private
def
bulk_insert_tags?
strong_memoize
(
:bulk_insert_tags
)
do
::
Feature
.
enabled?
(
:ci_bulk_insert_tags
,
project
,
default_enabled: :yaml
)
end
end
def
with_bulk_insert_tags
previous
=
Thread
.
current
[
'ci_bulk_insert_tags'
]
Thread
.
current
[
'ci_bulk_insert_tags'
]
=
bulk_insert_tags?
Thread
.
current
[
'ci_bulk_insert_tags'
]
=
true
yield
ensure
Thread
.
current
[
'ci_bulk_insert_tags'
]
=
previous
...
...
spec/lib/gitlab/ci/pipeline/chain/create_spec.rb
View file @
f78b53e0
...
...
@@ -106,21 +106,5 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Create do
expect
(
job
.
reload
.
tag_list
).
to
match_array
(
%w[tag1 tag2]
)
end
end
context
'when the feature flag is disabled'
do
before
do
job
.
tag_list
=
%w[tag1 tag2]
stub_feature_flags
(
ci_bulk_insert_tags:
false
)
end
it
'follows the old code path'
do
expect
(
CommitStatus
).
not_to
receive
(
:bulk_insert_tags!
)
step
.
perform!
expect
(
job
).
to
be_persisted
expect
(
job
.
reload
.
tag_list
).
to
match_array
(
%w[tag1 tag2]
)
end
end
end
end
spec/services/ci/create_pipeline_service/tags_spec.rb
View file @
f78b53e0
...
...
@@ -81,31 +81,6 @@ RSpec.describe Ci::CreatePipelineService do
end
end
context
'when the feature flag is disabled'
do
before
do
stub_feature_flags
(
ci_bulk_insert_tags:
false
)
end
it
'executes N+1s queries'
do
stub_yaml_config
(
config_without_tags
)
# warm up the cached objects so we get a more accurate count
create_pipeline
control
=
ActiveRecord
::
QueryRecorder
.
new
(
skip_cached:
false
)
do
create_pipeline
end
stub_yaml_config
(
config
)
expect
{
pipeline
}
.
to
exceed_all_query_limit
(
control
)
.
with_threshold
(
4
)
expect
(
pipeline
).
to
be_created_successfully
end
end
context
'when tags are already persisted'
do
it
'does not execute N+1 queries'
do
# warm up the cached objects so we get a more accurate count
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment