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
22224c63
Commit
22224c63
authored
Aug 24, 2020
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename count_synced to synced_count
Rename this method make the finder class closer to a Geo replicator.
parent
1f1bec52
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
18 deletions
+18
-18
ee/app/finders/geo/registry_finder.rb
ee/app/finders/geo/registry_finder.rb
+2
-2
ee/app/models/geo_node_status.rb
ee/app/models/geo_node_status.rb
+5
-5
ee/spec/finders/geo/attachment_registry_finder_spec.rb
ee/spec/finders/geo/attachment_registry_finder_spec.rb
+2
-2
ee/spec/finders/geo/container_repository_registry_finder_spec.rb
.../finders/geo/container_repository_registry_finder_spec.rb
+2
-2
ee/spec/finders/geo/design_registry_finder_spec.rb
ee/spec/finders/geo/design_registry_finder_spec.rb
+2
-2
ee/spec/finders/geo/job_artifact_registry_finder_spec.rb
ee/spec/finders/geo/job_artifact_registry_finder_spec.rb
+2
-2
ee/spec/finders/geo/lfs_object_registry_finder_spec.rb
ee/spec/finders/geo/lfs_object_registry_finder_spec.rb
+2
-2
ee/spec/support/shared_examples/finders/geo/file_registry_finders_shared_examples.rb
...ples/finders/geo/file_registry_finders_shared_examples.rb
+1
-1
No files found.
ee/app/finders/geo/registry_finder.rb
View file @
22224c63
...
...
@@ -60,10 +60,10 @@ module Geo
end
alias_method
:count_registry
,
:registry_count
# @!method
count_synced
# @!method
synced_count
# Return a count of the registry records for the tracked type
# that are synced
def
count_synced
def
synced_count
registry_class
.
synced
.
count
end
...
...
ee/app/models/geo_node_status.rb
View file @
22224c63
...
...
@@ -460,7 +460,7 @@ class GeoNodeStatus < ApplicationRecord
return
unless
lfs_objects_replication_enabled
self
.
lfs_objects_count
=
lfs_objects_finder
.
registry_count
self
.
lfs_objects_synced_count
=
lfs_objects_finder
.
count_synced
self
.
lfs_objects_synced_count
=
lfs_objects_finder
.
synced_count
self
.
lfs_objects_failed_count
=
lfs_objects_finder
.
count_failed
self
.
lfs_objects_registry_count
=
lfs_objects_finder
.
count_registry
self
.
lfs_objects_synced_missing_on_primary_count
=
lfs_objects_finder
.
count_synced_missing_on_primary
...
...
@@ -470,7 +470,7 @@ class GeoNodeStatus < ApplicationRecord
return
unless
job_artifacts_replication_enabled
self
.
job_artifacts_count
=
job_artifacts_finder
.
registry_count
self
.
job_artifacts_synced_count
=
job_artifacts_finder
.
count_synced
self
.
job_artifacts_synced_count
=
job_artifacts_finder
.
synced_count
self
.
job_artifacts_failed_count
=
job_artifacts_finder
.
count_failed
self
.
job_artifacts_registry_count
=
job_artifacts_finder
.
count_registry
self
.
job_artifacts_synced_missing_on_primary_count
=
job_artifacts_finder
.
count_synced_missing_on_primary
...
...
@@ -480,7 +480,7 @@ class GeoNodeStatus < ApplicationRecord
return
unless
attachments_replication_enabled
self
.
attachments_count
=
attachments_finder
.
registry_count
self
.
attachments_synced_count
=
attachments_finder
.
count_synced
self
.
attachments_synced_count
=
attachments_finder
.
synced_count
self
.
attachments_failed_count
=
attachments_finder
.
count_failed
self
.
attachments_registry_count
=
attachments_finder
.
count_registry
self
.
attachments_synced_missing_on_primary_count
=
attachments_finder
.
count_synced_missing_on_primary
...
...
@@ -490,7 +490,7 @@ class GeoNodeStatus < ApplicationRecord
return
unless
container_repositories_replication_enabled
self
.
container_repositories_count
=
container_registry_finder
.
registry_count
self
.
container_repositories_synced_count
=
container_registry_finder
.
count_synced
self
.
container_repositories_synced_count
=
container_registry_finder
.
synced_count
self
.
container_repositories_failed_count
=
container_registry_finder
.
count_failed
self
.
container_repositories_registry_count
=
container_registry_finder
.
count_registry
end
...
...
@@ -499,7 +499,7 @@ class GeoNodeStatus < ApplicationRecord
return
unless
design_repositories_replication_enabled
self
.
design_repositories_count
=
design_registry_finder
.
registry_count
self
.
design_repositories_synced_count
=
design_registry_finder
.
count_synced
self
.
design_repositories_synced_count
=
design_registry_finder
.
synced_count
self
.
design_repositories_failed_count
=
design_registry_finder
.
count_failed
self
.
design_repositories_registry_count
=
design_registry_finder
.
count_registry
end
...
...
ee/spec/finders/geo/attachment_registry_finder_spec.rb
View file @
22224c63
...
...
@@ -60,7 +60,7 @@ RSpec.describe Geo::AttachmentRegistryFinder, :geo do
end
end
describe
'#
count_synced
'
do
describe
'#
synced_count
'
do
it
'counts registries that has been synced'
do
create
(
:geo_upload_registry
,
:attachment
,
:failed
,
file_id:
upload_1
.
id
)
create
(
:geo_upload_registry
,
:attachment
,
file_id:
upload_2
.
id
,
missing_on_primary:
true
)
...
...
@@ -71,7 +71,7 @@ RSpec.describe Geo::AttachmentRegistryFinder, :geo do
create
(
:geo_upload_registry
,
:attachment
,
file_id:
upload_7
.
id
,
missing_on_primary:
true
)
create
(
:geo_upload_registry
,
:attachment
,
:never_synced
,
file_id:
upload_8
.
id
)
expect
(
subject
.
count_synced
).
to
eq
3
expect
(
subject
.
synced_count
).
to
eq
3
end
end
...
...
ee/spec/finders/geo/container_repository_registry_finder_spec.rb
View file @
22224c63
...
...
@@ -30,12 +30,12 @@ RSpec.describe Geo::ContainerRepositoryRegistryFinder, :geo do
end
end
describe
'#
count_synced
'
do
describe
'#
synced_count
'
do
it
'returns only synced registry'
do
create
(
:container_repository_registry
,
:synced
,
container_repository_id:
container_repository_1
.
id
)
create
(
:container_repository_registry
,
:sync_failed
,
container_repository_id:
container_repository_3
.
id
)
expect
(
subject
.
count_synced
).
to
eq
(
1
)
expect
(
subject
.
synced_count
).
to
eq
(
1
)
end
end
...
...
ee/spec/finders/geo/design_registry_finder_spec.rb
View file @
22224c63
...
...
@@ -33,12 +33,12 @@ RSpec.describe Geo::DesignRegistryFinder, :geo do
end
end
describe
'#
count_synced
'
do
describe
'#
synced_count
'
do
it
'returns number of synced registries'
do
create
(
:geo_design_registry
,
:synced
,
project_id:
project_1
.
id
)
create
(
:geo_design_registry
,
:sync_failed
,
project_id:
project_2
.
id
)
expect
(
subject
.
count_synced
).
to
eq
(
1
)
expect
(
subject
.
synced_count
).
to
eq
(
1
)
end
end
...
...
ee/spec/finders/geo/job_artifact_registry_finder_spec.rb
View file @
22224c63
...
...
@@ -60,7 +60,7 @@ RSpec.describe Geo::JobArtifactRegistryFinder, :geo do
end
end
describe
'#
count_synced
'
do
describe
'#
synced_count
'
do
it
'counts registries that has been synced'
do
create
(
:geo_job_artifact_registry
,
:failed
,
artifact_id:
ci_job_artifact_1
.
id
)
create
(
:geo_job_artifact_registry
,
artifact_id:
ci_job_artifact_2
.
id
,
missing_on_primary:
true
)
...
...
@@ -71,7 +71,7 @@ RSpec.describe Geo::JobArtifactRegistryFinder, :geo do
create
(
:geo_job_artifact_registry
,
artifact_id:
ci_job_artifact_remote_2
.
id
,
missing_on_primary:
true
)
create
(
:geo_job_artifact_registry
,
:never_synced
,
artifact_id:
ci_job_artifact_remote_3
.
id
)
expect
(
subject
.
count_synced
).
to
eq
3
expect
(
subject
.
synced_count
).
to
eq
3
end
end
...
...
ee/spec/finders/geo/lfs_object_registry_finder_spec.rb
View file @
22224c63
...
...
@@ -50,7 +50,7 @@ RSpec.describe Geo::LfsObjectRegistryFinder, :geo do
end
end
describe
'#
count_synced
'
do
describe
'#
synced_count
'
do
it
'counts registries that has been synced'
do
create
(
:geo_lfs_object_registry
,
:failed
,
lfs_object_id:
lfs_object_1
.
id
)
create
(
:geo_lfs_object_registry
,
lfs_object_id:
lfs_object_2
.
id
,
missing_on_primary:
true
)
...
...
@@ -61,7 +61,7 @@ RSpec.describe Geo::LfsObjectRegistryFinder, :geo do
create
(
:geo_lfs_object_registry
,
lfs_object_id:
lfs_object_remote_2
.
id
,
missing_on_primary:
true
)
create
(
:geo_lfs_object_registry
,
:never_synced
,
lfs_object_id:
lfs_object_remote_3
.
id
)
expect
(
subject
.
count_synced
).
to
eq
3
expect
(
subject
.
synced_count
).
to
eq
3
end
end
...
...
ee/spec/support/shared_examples/finders/geo/file_registry_finders_shared_examples.rb
View file @
22224c63
...
...
@@ -5,7 +5,7 @@ RSpec.shared_examples 'a file registry finder' do
file_registry_finder_methods
=
%i{
registry_class
registry_count
count_synced
synced_count
count_failed
count_synced_missing_on_primary
count_registry
...
...
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