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
a3a201e2
Commit
a3a201e2
authored
Aug 24, 2020
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename count_failed to failed_count
Rename this method make the finder class closer to a Geo replicator.
parent
22224c63
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
19 additions
and
19 deletions
+19
-19
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
+3
-3
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 @
a3a201e2
...
...
@@ -67,10 +67,10 @@ module Geo
registry_class
.
synced
.
count
end
# @!method
count_failed
# @!method
failed_count
# Return a count of the registry records for the tracked type
# that are sync failed
def
count_failed
def
failed_count
registry_class
.
failed
.
count
end
...
...
ee/app/models/geo_node_status.rb
View file @
a3a201e2
...
...
@@ -461,7 +461,7 @@ class GeoNodeStatus < ApplicationRecord
self
.
lfs_objects_count
=
lfs_objects_finder
.
registry_count
self
.
lfs_objects_synced_count
=
lfs_objects_finder
.
synced_count
self
.
lfs_objects_failed_count
=
lfs_objects_finder
.
count_failed
self
.
lfs_objects_failed_count
=
lfs_objects_finder
.
failed_count
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
end
...
...
@@ -471,7 +471,7 @@ class GeoNodeStatus < ApplicationRecord
self
.
job_artifacts_count
=
job_artifacts_finder
.
registry_count
self
.
job_artifacts_synced_count
=
job_artifacts_finder
.
synced_count
self
.
job_artifacts_failed_count
=
job_artifacts_finder
.
count_failed
self
.
job_artifacts_failed_count
=
job_artifacts_finder
.
failed_count
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
end
...
...
@@ -481,7 +481,7 @@ class GeoNodeStatus < ApplicationRecord
self
.
attachments_count
=
attachments_finder
.
registry_count
self
.
attachments_synced_count
=
attachments_finder
.
synced_count
self
.
attachments_failed_count
=
attachments_finder
.
count_failed
self
.
attachments_failed_count
=
attachments_finder
.
failed_count
self
.
attachments_registry_count
=
attachments_finder
.
count_registry
self
.
attachments_synced_missing_on_primary_count
=
attachments_finder
.
count_synced_missing_on_primary
end
...
...
@@ -491,7 +491,7 @@ class GeoNodeStatus < ApplicationRecord
self
.
container_repositories_count
=
container_registry_finder
.
registry_count
self
.
container_repositories_synced_count
=
container_registry_finder
.
synced_count
self
.
container_repositories_failed_count
=
container_registry_finder
.
count_failed
self
.
container_repositories_failed_count
=
container_registry_finder
.
failed_count
self
.
container_repositories_registry_count
=
container_registry_finder
.
count_registry
end
...
...
@@ -500,7 +500,7 @@ class GeoNodeStatus < ApplicationRecord
self
.
design_repositories_count
=
design_registry_finder
.
registry_count
self
.
design_repositories_synced_count
=
design_registry_finder
.
synced_count
self
.
design_repositories_failed_count
=
design_registry_finder
.
count_failed
self
.
design_repositories_failed_count
=
design_registry_finder
.
failed_count
self
.
design_repositories_registry_count
=
design_registry_finder
.
count_registry
end
...
...
ee/spec/finders/geo/attachment_registry_finder_spec.rb
View file @
a3a201e2
...
...
@@ -75,7 +75,7 @@ RSpec.describe Geo::AttachmentRegistryFinder, :geo do
end
end
describe
'#
count_failed
'
do
describe
'#
failed_count
'
do
it
'counts registries that sync has failed'
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
)
...
...
@@ -86,7 +86,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_failed
).
to
eq
3
expect
(
subject
.
failed_count
).
to
eq
3
end
end
...
...
@@ -101,7 +101,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
_missing_on_primary
).
to
eq
3
expect
(
subject
.
synced_count
_missing_on_primary
).
to
eq
3
end
end
...
...
ee/spec/finders/geo/container_repository_registry_finder_spec.rb
View file @
a3a201e2
...
...
@@ -39,12 +39,12 @@ RSpec.describe Geo::ContainerRepositoryRegistryFinder, :geo do
end
end
describe
'#
count_failed
'
do
describe
'#
failed_count
'
do
it
'returns only failed 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_failed
).
to
eq
(
1
)
expect
(
subject
.
failed_count
).
to
eq
(
1
)
end
end
...
...
ee/spec/finders/geo/design_registry_finder_spec.rb
View file @
a3a201e2
...
...
@@ -42,12 +42,12 @@ RSpec.describe Geo::DesignRegistryFinder, :geo do
end
end
describe
'#
count_failed
'
do
describe
'#
failed_count
'
do
it
'returns number of failed 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_failed
).
to
eq
(
1
)
expect
(
subject
.
failed_count
).
to
eq
(
1
)
end
end
...
...
ee/spec/finders/geo/job_artifact_registry_finder_spec.rb
View file @
a3a201e2
...
...
@@ -75,7 +75,7 @@ RSpec.describe Geo::JobArtifactRegistryFinder, :geo do
end
end
describe
'#
count_failed
'
do
describe
'#
failed_count
'
do
it
'counts registries that sync has failed'
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
)
...
...
@@ -86,7 +86,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_failed
).
to
eq
3
expect
(
subject
.
failed_count
).
to
eq
3
end
end
...
...
ee/spec/finders/geo/lfs_object_registry_finder_spec.rb
View file @
a3a201e2
...
...
@@ -65,7 +65,7 @@ RSpec.describe Geo::LfsObjectRegistryFinder, :geo do
end
end
describe
'#
count_failed
'
do
describe
'#
failed_count
'
do
it
'counts registries that sync has failed'
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
)
...
...
@@ -76,7 +76,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_failed
).
to
eq
3
expect
(
subject
.
failed_count
).
to
eq
3
end
end
...
...
ee/spec/support/shared_examples/finders/geo/file_registry_finders_shared_examples.rb
View file @
a3a201e2
...
...
@@ -6,7 +6,7 @@ RSpec.shared_examples 'a file registry finder' do
registry_class
registry_count
synced_count
count_failed
failed_count
count_synced_missing_on_primary
count_registry
find_retryable_failed_registries
...
...
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