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
a83e9640
Commit
a83e9640
authored
Nov 27, 2018
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Put repository re-verification behind feature flag
parent
a6e469f9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
13 deletions
+49
-13
ee/app/workers/geo/repository_verification/primary/shard_worker.rb
...rkers/geo/repository_verification/primary/shard_worker.rb
+4
-0
ee/spec/workers/geo/repository_verification/primary/shard_worker_spec.rb
.../geo/repository_verification/primary/shard_worker_spec.rb
+45
-13
No files found.
ee/app/workers/geo/repository_verification/primary/shard_worker.rb
View file @
a83e9640
...
@@ -110,6 +110,10 @@ module Geo
...
@@ -110,6 +110,10 @@ module Geo
def
minimum_reverification_interval
def
minimum_reverification_interval
::
Gitlab
::
Geo
.
current_node
.
minimum_reverification_interval
.
days
::
Gitlab
::
Geo
.
current_node
.
minimum_reverification_interval
.
days
end
end
def
reverification_enabled?
::
Feature
.
enabled?
(
:geo_repository_reverification
,
default_enabled:
true
)
end
end
end
end
end
end
end
...
...
ee/spec/workers/geo/repository_verification/primary/shard_worker_spec.rb
View file @
a83e9640
...
@@ -91,26 +91,58 @@ describe Geo::RepositoryVerification::Primary::ShardWorker, :postgresql, :clean_
...
@@ -91,26 +91,58 @@ describe Geo::RepositoryVerification::Primary::ShardWorker, :postgresql, :clean_
subject
.
perform
(
shard_name
)
subject
.
perform
(
shard_name
)
end
end
it
'performs Geo::RepositoryVerification::Primary::SingleWorker for projects where repository should be reverified'
do
context
'reverification'
do
project_to_be_reverified
=
create
(
:project
)
context
'feature geo_repository_reverification flag is enabled'
do
before
do
stub_feature_flags
(
geo_repository_reverification:
true
)
end
create
(
:repository_state
,
:repository_verified
,
:wiki_verified
,
it
'performs Geo::RepositoryVerification::Primary::SingleWorker for projects where repository should be reverified'
do
project:
project_to_be_reverified
,
last_repository_verification_ran_at:
10
.
days
.
ago
)
project_to_be_reverified
=
create
(
:project
)
expect
(
primary_singleworker
).
to
receive
(
:perform_async
).
with
(
project_to_be_reverified
.
id
)
create
(
:repository_state
,
:repository_verified
,
:wiki_verified
,
project:
project_to_be_reverified
,
last_repository_verification_ran_at:
10
.
days
.
ago
)
subject
.
perform
(
shard_name
)
expect
(
primary_singleworker
).
to
receive
(
:perform_async
).
with
(
project_to_be_reverified
.
id
)
end
it
'performs Geo::RepositoryVerification::Primary::SingleWorker for projects where wiki should be reverified'
do
subject
.
perform
(
shard_name
)
project_to_be_reverified
=
create
(
:project
)
end
create
(
:repository_state
,
:repository_verified
,
:wiki_verified
,
it
'performs Geo::RepositoryVerification::Primary::SingleWorker for projects where wiki should be reverified'
do
project:
project_to_be_reverified
,
last_wiki_verification_ran_at:
10
.
days
.
ago
)
project_to_be_reverified
=
create
(
:project
)
expect
(
primary_singleworker
).
to
receive
(
:perform_async
).
with
(
project_to_be_reverified
.
id
)
create
(
:repository_state
,
:repository_verified
,
:wiki_verified
,
project:
project_to_be_reverified
,
last_wiki_verification_ran_at:
10
.
days
.
ago
)
subject
.
perform
(
shard_name
)
expect
(
primary_singleworker
).
to
receive
(
:perform_async
).
with
(
project_to_be_reverified
.
id
)
subject
.
perform
(
shard_name
)
end
end
context
'feature geo_repository_reverification flag is disabled'
do
before
do
stub_feature_flags
(
geo_repository_reverification:
false
)
end
it
'does not perform Geo::RepositoryVerification::Primary::SingleWorker for projects where repository should be reverified'
do
create
(
:repository_state
,
:repository_verified
,
:wiki_verified
,
last_repository_verification_ran_at:
10
.
days
.
ago
)
expect
(
primary_singleworker
).
not_to
receive
(
:perform_async
)
subject
.
perform
(
shard_name
)
end
it
'does not Geo::RepositoryVerification::Primary::SingleWorker for projects where wiki should be reverified'
do
create
(
:repository_state
,
:repository_verified
,
:wiki_verified
,
last_wiki_verification_ran_at:
10
.
days
.
ago
)
expect
(
primary_singleworker
).
not_to
receive
(
:perform_async
)
subject
.
perform
(
shard_name
)
end
end
end
end
it
'does not perform Geo::RepositoryVerification::Primary::SingleWorker when shard becomes unhealthy'
do
it
'does not perform Geo::RepositoryVerification::Primary::SingleWorker when shard becomes unhealthy'
do
...
...
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