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
1d880b4b
Commit
1d880b4b
authored
May 03, 2017
by
Gabriel Mazetto
Committed by
Robert Speicher
May 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed left-overs from previous implementation
parent
671b20bc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
20 deletions
+6
-20
app/models/geo_node.rb
app/models/geo_node.rb
+3
-2
app/models/hooks/system_hook.rb
app/models/hooks/system_hook.rb
+0
-4
app/workers/post_receive.rb
app/workers/post_receive.rb
+0
-12
spec/models/geo_node_spec.rb
spec/models/geo_node_spec.rb
+3
-2
No files found.
app/models/geo_node.rb
View file @
1d880b4b
...
...
@@ -159,8 +159,9 @@ class GeoNode < ActiveRecord::Base
self
.
build_system_hook
if
system_hook
.
nil?
self
.
system_hook
.
token
=
SecureRandom
.
hex
(
20
)
unless
self
.
system_hook
.
token
.
present?
self
.
system_hook
.
url
=
geo_events_url
if
uri
.
present?
self
.
system_hook
.
push_events
=
true
self
.
system_hook
.
tag_push_events
=
true
self
.
system_hook
.
push_events
=
false
self
.
system_hook
.
tag_push_events
=
false
self
.
system_hook
.
repository_update_events
=
true
end
def
expire_cache!
...
...
app/models/hooks/system_hook.rb
View file @
1d880b4b
...
...
@@ -7,8 +7,4 @@ class SystemHook < WebHook
def
async_execute
(
data
,
hook_name
)
Sidekiq
::
Client
.
enqueue
(
SystemHookWorker
,
id
,
data
,
hook_name
)
end
def
self
.
repository_update_hooks
GeoNode
.
where
(
primary:
false
).
map
(
&
:system_hook
)
end
end
app/workers/post_receive.rb
View file @
1d880b4b
...
...
@@ -23,18 +23,6 @@ class PostReceive
# Triggers repository update on secondary nodes when Geo is enabled
Gitlab
::
Geo
.
notify_wiki_update
(
post_received
.
project
)
if
Gitlab
::
Geo
.
enabled?
else
# TODO: gitlab-org/gitlab-ce#26325. Remove this.
if
Gitlab
::
Geo
.
enabled?
hook_data
=
{
event_name:
'repository_update'
,
project_id:
post_received
.
project
.
id
,
project:
post_received
.
project
.
hook_attrs
,
remote_url:
post_received
.
project
.
ssh_url_to_repo
}
SystemHooksService
.
new
.
execute_hooks
(
hook_data
,
:repository_update_hooks
)
end
process_project_changes
(
post_received
)
process_repository_update
(
post_received
)
end
...
...
spec/models/geo_node_spec.rb
View file @
1d880b4b
...
...
@@ -89,8 +89,9 @@ describe GeoNode, type: :model do
expect
(
node
.
system_hook
.
url
).
to
be_present
expect
(
node
.
system_hook
.
url
).
to
eq
(
node
.
geo_events_url
)
expect
(
node
.
system_hook
.
token
).
to
be_present
expect
(
node
.
system_hook
.
push_events
).
to
be_truthy
expect
(
node
.
system_hook
.
tag_push_events
).
to
be_truthy
expect
(
node
.
system_hook
.
push_events
).
to
be_falsey
expect
(
node
.
system_hook
.
tag_push_events
).
to
be_falsey
expect
(
node
.
system_hook
.
repository_update_events
).
to
be_truthy
end
end
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