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
5514099c
Commit
5514099c
authored
Jan 24, 2018
by
Gabriel Mazetto
Committed by
Nick Thomas
Jan 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo: sync .gitattributes to info/attributes in secondary nodes
parent
858e6698
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
changelogs/unreleased-ee/4101-sync-gitattributes-geo.yml
changelogs/unreleased-ee/4101-sync-gitattributes-geo.yml
+5
-0
ee/app/services/geo/repository_sync_service.rb
ee/app/services/geo/repository_sync_service.rb
+9
-0
spec/ee/spec/services/geo/repository_sync_service_spec.rb
spec/ee/spec/services/geo/repository_sync_service_spec.rb
+10
-0
No files found.
changelogs/unreleased-ee/4101-sync-gitattributes-geo.yml
0 → 100644
View file @
5514099c
---
title
:
'
Geo:
sync
.gitattributes
to
info/attributes
in
secondary
nodes'
merge_request
:
4159
author
:
type
:
changed
ee/app/services/geo/repository_sync_service.rb
View file @
5514099c
...
@@ -22,6 +22,8 @@ module Geo
...
@@ -22,6 +22,8 @@ module Geo
fetch_geo_mirror
(
project
.
repository
)
fetch_geo_mirror
(
project
.
repository
)
end
end
update_gitattributes
update_registry!
(
finished_at:
DateTime
.
now
,
attrs:
{
last_repository_sync_failure:
nil
})
update_registry!
(
finished_at:
DateTime
.
now
,
attrs:
{
last_repository_sync_failure:
nil
})
log_info
(
'Finished repository sync'
,
log_info
(
'Finished repository sync'
,
update_delay_s:
update_delay_in_seconds
,
update_delay_s:
update_delay_in_seconds
,
...
@@ -52,6 +54,13 @@ module Geo
...
@@ -52,6 +54,13 @@ module Geo
project
.
repository
project
.
repository
end
end
# Update info/attributes file using the contents of .gitattributes file from the default branch
def
update_gitattributes
return
if
project
.
default_branch
.
nil?
repository
.
copy_gitattributes
(
project
.
default_branch
)
end
def
retry_count
def
retry_count
registry
.
public_send
(
"
#{
type
}
_retry_count"
)
||
-
1
# rubocop:disable GitlabSecurity/PublicSend
registry
.
public_send
(
"
#{
type
}
_retry_count"
)
||
-
1
# rubocop:disable GitlabSecurity/PublicSend
end
end
...
...
spec/ee/spec/services/geo/repository_sync_service_spec.rb
View file @
5514099c
...
@@ -145,6 +145,16 @@ describe Geo::RepositorySyncService do
...
@@ -145,6 +145,16 @@ describe Geo::RepositorySyncService do
expect
(
registry
.
reload
.
repository_retry_count
).
to
be_nil
expect
(
registry
.
reload
.
repository_retry_count
).
to
be_nil
expect
(
registry
.
repository_retry_at
).
to
be_nil
expect
(
registry
.
repository_retry_at
).
to
be_nil
end
end
context
'with non empty repositories'
do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
it
'syncs gitattributes to info/attributes'
do
expect
(
repository
).
to
receive
(
:copy_gitattributes
)
subject
.
execute
end
end
end
end
context
'when repository sync fail'
do
context
'when repository sync fail'
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