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
0
Merge Requests
0
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
iv
gitlab-ce
Commits
b2de30c5
Commit
b2de30c5
authored
Apr 03, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'patch/6-7-2' into '6-7-stable'
6.7.3 patch release
parents
fcbebcb6
60fc9348
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
51 additions
and
12 deletions
+51
-12
CHANGELOG
CHANGELOG
+5
-1
app/mailers/emails/merge_requests.rb
app/mailers/emails/merge_requests.rb
+2
-2
app/services/merge_requests/auto_merge_service.rb
app/services/merge_requests/auto_merge_service.rb
+1
-1
app/services/merge_requests/merge_service.rb
app/services/merge_requests/merge_service.rb
+1
-1
app/services/notification_service.rb
app/services/notification_service.rb
+2
-2
lib/backup/database.rb
lib/backup/database.rb
+3
-2
lib/tasks/gitlab/db/drop_all_tables.rake
lib/tasks/gitlab/db/drop_all_tables.rake
+10
-0
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+24
-0
spec/services/notification_service_spec.rb
spec/services/notification_service_spec.rb
+3
-3
No files found.
CHANGELOG
View file @
b2de30c5
v6.7.2
v 6.7.3
- Fix the merge notification email not being sent (Pierre de La Morinerie)
- Drop all tables before restoring a Postgres backup
v 6.7.2
- Fix upgrader script
- Fix upgrader script
v6.7.1
v6.7.1
...
...
app/mailers/emails/merge_requests.rb
View file @
b2de30c5
...
@@ -29,11 +29,11 @@ module Emails
...
@@ -29,11 +29,11 @@ module Emails
subject:
subject
(
"
#{
@merge_request
.
title
}
(!
#{
@merge_request
.
iid
}
)"
))
subject:
subject
(
"
#{
@merge_request
.
title
}
(!
#{
@merge_request
.
iid
}
)"
))
end
end
def
merged_merge_request_email
(
recipient_id
,
merge_request_id
)
def
merged_merge_request_email
(
recipient_id
,
merge_request_id
,
updated_by_user_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@project
=
@merge_request
.
project
@project
=
@merge_request
.
project
@target_url
=
project_merge_request_url
(
@project
,
@merge_request
)
@target_url
=
project_merge_request_url
(
@project
,
@merge_request
)
mail
(
from:
sender
(
@merge_request
.
author_id_of_changes
),
mail
(
from:
sender
(
updated_by_user_id
),
to:
recipient
(
recipient_id
),
to:
recipient
(
recipient_id
),
subject:
subject
(
"
#{
@merge_request
.
title
}
(!
#{
@merge_request
.
iid
}
)"
))
subject:
subject
(
"
#{
@merge_request
.
title
}
(!
#{
@merge_request
.
iid
}
)"
))
end
end
...
...
app/services/merge_requests/auto_merge_service.rb
View file @
b2de30c5
...
@@ -12,7 +12,7 @@ module MergeRequests
...
@@ -12,7 +12,7 @@ module MergeRequests
merge_request
.
author_id_of_changes
=
current_user
.
id
merge_request
.
author_id_of_changes
=
current_user
.
id
merge_request
.
merge
merge_request
.
merge
notification
.
merge_mr
(
merge_request
)
notification
.
merge_mr
(
merge_request
,
current_user
)
create_merge_event
(
merge_request
)
create_merge_event
(
merge_request
)
execute_project_hooks
(
merge_request
)
execute_project_hooks
(
merge_request
)
...
...
app/services/merge_requests/merge_service.rb
View file @
b2de30c5
...
@@ -10,7 +10,7 @@ module MergeRequests
...
@@ -10,7 +10,7 @@ module MergeRequests
merge_request
.
author_id_of_changes
=
current_user
.
id
merge_request
.
author_id_of_changes
=
current_user
.
id
merge_request
.
merge
merge_request
.
merge
notification
.
merge_mr
(
merge_request
)
notification
.
merge_mr
(
merge_request
,
current_user
)
create_merge_event
(
merge_request
)
create_merge_event
(
merge_request
)
execute_project_hooks
(
merge_request
)
execute_project_hooks
(
merge_request
)
...
...
app/services/notification_service.rb
View file @
b2de30c5
...
@@ -86,12 +86,12 @@ class NotificationService
...
@@ -86,12 +86,12 @@ class NotificationService
# * merge_request assignee if their notification level is not Disabled
# * merge_request assignee if their notification level is not Disabled
# * project team members with notification level higher then Participating
# * project team members with notification level higher then Participating
#
#
def
merge_mr
(
merge_request
)
def
merge_mr
(
merge_request
,
current_user
)
recipients
=
reject_muted_users
([
merge_request
.
author
,
merge_request
.
assignee
],
merge_request
.
target_project
)
recipients
=
reject_muted_users
([
merge_request
.
author
,
merge_request
.
assignee
],
merge_request
.
target_project
)
recipients
=
recipients
.
concat
(
project_watchers
(
merge_request
.
target_project
)).
uniq
recipients
=
recipients
.
concat
(
project_watchers
(
merge_request
.
target_project
)).
uniq
recipients
.
each
do
|
recipient
|
recipients
.
each
do
|
recipient
|
mailer
.
merged_merge_request_email
(
recipient
.
id
,
merge_request
.
id
)
mailer
.
merged_merge_request_email
(
recipient
.
id
,
merge_request
.
id
,
current_user
.
id
)
end
end
end
end
...
...
lib/backup/database.rb
View file @
b2de30c5
...
@@ -29,9 +29,10 @@ module Backup
...
@@ -29,9 +29,10 @@ module Backup
print
"Restoring MySQL database
#{
config
[
'database'
]
}
... "
print
"Restoring MySQL database
#{
config
[
'database'
]
}
... "
system
(
'mysql'
,
*
mysql_args
,
config
[
'database'
],
in:
db_file_name
)
system
(
'mysql'
,
*
mysql_args
,
config
[
'database'
],
in:
db_file_name
)
when
"postgresql"
then
when
"postgresql"
then
puts
"Destructively rebuilding database schema for RAILS_ENV
#{
Rails
.
env
}
"
Rake
::
Task
[
"db:schema:load"
].
invoke
print
"Restoring PostgreSQL database
#{
config
[
'database'
]
}
... "
print
"Restoring PostgreSQL database
#{
config
[
'database'
]
}
... "
# Drop all tables because PostgreSQL DB dumps do not contain DROP TABLE
# statements like MySQL.
Rake
::
Task
[
"gitlab:db:drop_all_tables"
].
invoke
pg_env
pg_env
system
(
'psql'
,
config
[
'database'
],
'-f'
,
db_file_name
)
system
(
'psql'
,
config
[
'database'
],
'-f'
,
db_file_name
)
end
end
...
...
lib/tasks/gitlab/db/drop_all_tables.rake
0 → 100644
View file @
b2de30c5
namespace
:gitlab
do
namespace
:db
do
task
drop_all_tables: :environment
do
connection
=
ActiveRecord
::
Base
.
connection
connection
.
tables
.
each
do
|
table
|
connection
.
drop_table
(
table
)
end
end
end
end
spec/mailers/notify_spec.rb
View file @
b2de30c5
...
@@ -229,6 +229,7 @@ describe Notify do
...
@@ -229,6 +229,7 @@ describe Notify do
end
end
context
'for merge requests'
do
context
'for merge requests'
do
let
(
:merge_author
)
{
create
(
:user
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
author:
current_user
,
assignee:
assignee
,
source_project:
project
,
target_project:
project
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
author:
current_user
,
assignee:
assignee
,
source_project:
project
,
target_project:
project
)
}
let
(
:merge_request_with_description
)
{
create
(
:merge_request
,
author:
current_user
,
assignee:
assignee
,
source_project:
project
,
target_project:
project
,
description:
Faker
::
Lorem
.
sentence
)
}
let
(
:merge_request_with_description
)
{
create
(
:merge_request
,
author:
current_user
,
assignee:
assignee
,
source_project:
project
,
target_project:
project
,
description:
Faker
::
Lorem
.
sentence
)
}
...
@@ -288,7 +289,30 @@ describe Notify do
...
@@ -288,7 +289,30 @@ describe Notify do
it
'contains a link to the merge request'
do
it
'contains a link to the merge request'
do
should
have_body_text
/
#{
project_merge_request_path
project
,
merge_request
}
/
should
have_body_text
/
#{
project_merge_request_path
project
,
merge_request
}
/
end
end
end
describe
'that are merged'
do
subject
{
Notify
.
merged_merge_request_email
(
recipient
.
id
,
merge_request
.
id
,
merge_author
.
id
)
}
it_behaves_like
'a multiple recipients email'
it
'is sent as the merge author'
do
sender
=
subject
.
header
[
:from
].
addrs
[
0
]
sender
.
display_name
.
should
eq
(
merge_author
.
name
)
sender
.
address
.
should
eq
(
gitlab_sender
)
end
it
'has the correct subject'
do
should
have_subject
/
#{
merge_request
.
title
}
\(!
#{
merge_request
.
iid
}
\)/
end
it
'contains the new status'
do
should
have_body_text
/merged/i
end
it
'contains a link to the merge request'
do
should
have_body_text
/
#{
project_merge_request_path
project
,
merge_request
}
/
end
end
end
end
end
end
end
...
...
spec/services/notification_service_spec.rb
View file @
b2de30c5
...
@@ -233,15 +233,15 @@ describe NotificationService do
...
@@ -233,15 +233,15 @@ describe NotificationService do
should_email
(
@u_watcher
.
id
)
should_email
(
@u_watcher
.
id
)
should_not_email
(
@u_participating
.
id
)
should_not_email
(
@u_participating
.
id
)
should_not_email
(
@u_disabled
.
id
)
should_not_email
(
@u_disabled
.
id
)
notification
.
merge_mr
(
merge_request
)
notification
.
merge_mr
(
merge_request
,
@u_disabled
)
end
end
def
should_email
(
user_id
)
def
should_email
(
user_id
)
Notify
.
should_receive
(
:merged_merge_request_email
).
with
(
user_id
,
merge_request
.
id
)
Notify
.
should_receive
(
:merged_merge_request_email
).
with
(
user_id
,
merge_request
.
id
,
@u_disabled
.
id
)
end
end
def
should_not_email
(
user_id
)
def
should_not_email
(
user_id
)
Notify
.
should_not_receive
(
:merged_merge_request_email
).
with
(
user_id
,
merge_request
.
id
)
Notify
.
should_not_receive
(
:merged_merge_request_email
).
with
(
user_id
,
merge_request
.
id
,
@u_disabled
.
id
)
end
end
end
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