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
36dba7e8
Commit
36dba7e8
authored
Mar 26, 2021
by
Nikola Milojevic
Committed by
Kamil Trzciński
Mar 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds data consistency for BuildHooksWorker
- Introduces load_balancing_for_build_hooks_worker ff
parent
ada427b8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
0 deletions
+41
-0
app/workers/build_hooks_worker.rb
app/workers/build_hooks_worker.rb
+1
-0
config/feature_flags/development/load_balancing_for_build_hooks_worker.yml
...ags/development/load_balancing_for_build_hooks_worker.yml
+8
-0
spec/support/shared_examples/workers/worker_with_data_consistency_shared_example.rb
...es/workers/worker_with_data_consistency_shared_example.rb
+27
-0
spec/workers/build_hooks_worker_spec.rb
spec/workers/build_hooks_worker_spec.rb
+5
-0
No files found.
app/workers/build_hooks_worker.rb
View file @
36dba7e8
...
...
@@ -7,6 +7,7 @@ class BuildHooksWorker # rubocop:disable Scalability/IdempotentWorker
queue_namespace
:pipeline_hooks
feature_category
:continuous_integration
urgency
:high
data_consistency
:delayed
,
feature_flag: :load_balancing_for_build_hooks_worker
# rubocop: disable CodeReuse/ActiveRecord
def
perform
(
build_id
)
...
...
config/feature_flags/development/load_balancing_for_build_hooks_worker.yml
0 → 100644
View file @
36dba7e8
---
name
:
load_balancing_for_build_hooks_worker
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57575
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/326095
milestone
:
'
13.11'
type
:
development
group
:
group::memory
default_enabled
:
false
spec/support/shared_examples/workers/worker_with_data_consistency_shared_example.rb
0 → 100644
View file @
36dba7e8
# frozen_string_literal: true
RSpec
.
shared_examples
'worker with data consistency'
do
|
worker_class
,
data_consistency: :always
,
feature_flag:
nil
|
describe
'.get_data_consistency_feature_flag_enabled?'
do
it
'returns true'
do
expect
(
worker_class
.
get_data_consistency_feature_flag_enabled?
).
to
be
(
true
)
end
if
feature_flag
context
"when feature flag :
#{
feature_flag
}
is disabled"
do
before
do
stub_feature_flags
(
feature_flag
=>
false
)
end
it
'returns false'
do
expect
(
worker_class
.
get_data_consistency_feature_flag_enabled?
).
to
be
(
false
)
end
end
end
end
describe
'.get_data_consistency'
do
it
'returns correct data consistency'
do
expect
(
worker_class
.
get_data_consistency
).
to
eq
(
data_consistency
)
end
end
end
spec/workers/build_hooks_worker_spec.rb
View file @
36dba7e8
...
...
@@ -22,4 +22,9 @@ RSpec.describe BuildHooksWorker do
end
end
end
it_behaves_like
'worker with data consistency'
,
described_class
,
feature_flag: :load_balancing_for_build_hooks_worker
,
data_consistency: :delayed
end
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