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
eeeb2d38
Commit
eeeb2d38
authored
Feb 23, 2018
by
Tiago Botelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sends a notification to mirror_user when mirror hard fails
parent
f0a8d67a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
app/mailers/emails/projects.rb
app/mailers/emails/projects.rb
+8
-0
ee/app/models/ee/project/import_status_state_machine.rb
ee/app/models/ee/project/import_status_state_machine.rb
+4
-1
ee/app/services/ee/notification_service.rb
ee/app/services/ee/notification_service.rb
+6
-0
No files found.
app/mailers/emails/projects.rb
View file @
eeeb2d38
...
...
@@ -38,5 +38,13 @@ module Emails
reply_to:
@message
.
reply_to
,
subject:
@message
.
subject
)
end
def
mirror_hard_failed
(
project_id
,
user_id
)
@current_user
=
@user
=
User
.
find
user_id
@project
=
Project
.
find
project_id
mail
(
to:
@user
.
notification_email
,
subject:
subject
(
'Mirror hard failed'
))
end
end
end
ee/app/models/ee/project/import_status_state_machine.rb
View file @
eeeb2d38
...
...
@@ -21,7 +21,10 @@ module EE
end
after_transition
[
:scheduled
,
:started
]
=>
[
:finished
,
:failed
]
do
|
project
,
_
|
::
Gitlab
::
Mirror
.
decrement_capacity
(
project
.
id
)
if
project
.
mirror?
if
project
.
mirror?
::
Gitlab
::
Mirror
.
decrement_capacity
(
project
.
id
)
::
NotificationService
.
new
.
mirror_was_hard_failed
(
project
)
end
end
before_transition
started: :failed
do
|
project
,
_
|
...
...
ee/app/services/ee/notification_service.rb
View file @
eeeb2d38
...
...
@@ -22,5 +22,11 @@ module EE
Notify
.
service_desk_new_note_email
(
issue
.
id
,
note
.
id
).
deliver_later
end
def
mirror_was_hard_failed
(
project
)
recepient
=
project
.
mirror_user
mailer
.
mirror_hard_failed
(
project
.
id
,
recepient
.
id
).
deliver_later
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