Changeset - d4061c6cc0e2
[Not reviewed]
default
0 5 0
Mads Kiilerich - 9 years ago 2016-07-28 16:34:29
madski@unity3d.com
notifications: tweak PR mail subject lines

The subject line is used for mail threading in gmail and can thus not be
changed without impacting users ... but now we do it.

* The tag '[Review]' is more spot-on than '[Added]'.
* The subject should be short so it fits on one line, so abbreviate "pull
request" to PR.
* Add the PR owner - convenient for filtering comments on own PRs from comments
on other PRs.
5 files changed with 15 insertions and 12 deletions:
0 comments (0 inline, 0 general)
kallithea/model/comment.py
Show inline comments
 
@@ -153,6 +153,7 @@ class ChangesetCommentsModel(BaseModel):
 
                                   repo_name=pull_request.org_repo.repo_name),
 
                'pr_source_branch': org_ref_name,
 
                'pr_owner': pull_request.owner,
 
                'pr_owner_username': pull_request.owner.username,
 
                'repo_name': pull_request.other_repo.repo_name,
 
                'comment_username': user.username,
 
                'threading': threading,
kallithea/model/notification.py
Show inline comments
 
@@ -304,8 +304,8 @@ class EmailNotificationModel(BaseModel):
 
            # self.TYPE_PASSWORD_RESET
 
            self.TYPE_REGISTRATION: _('New user %(new_username)s registered'),
 
            # self.TYPE_DEFAULT
 
            self.TYPE_PULL_REQUEST: _('[Added] %(repo_name)s pull request %(pr_nice_id)s "%(pr_title_short)s" from %(pr_source_branch)s'),
 
            self.TYPE_PULL_REQUEST_COMMENT: _('[Comment] %(repo_name)s pull request %(pr_nice_id)s "%(pr_title_short)s" from %(pr_source_branch)s'),
 
            self.TYPE_PULL_REQUEST: _('[Review] %(repo_name)s PR %(pr_nice_id)s "%(pr_title_short)s" from %(pr_source_branch)s by %(pr_owner_username)s'),
 
            self.TYPE_PULL_REQUEST_COMMENT: _('[Comment] %(repo_name)s PR %(pr_nice_id)s "%(pr_title_short)s" from %(pr_source_branch)s by %(pr_owner_username)s'),
 
        }
 

	
 
    def get_email_description(self, type_, **kwargs):
kallithea/model/pull_request.py
Show inline comments
 
@@ -171,6 +171,7 @@ class PullRequestModel(BaseModel):
 
                               repo_name=pr.org_repo.repo_name),
 
            'pr_source_branch': org_ref_name,
 
            'pr_owner': pr.owner,
 
            'pr_owner_username': pr.owner.username,
 
            'pr_username': user.username,
 
            'threading': threading,
 
            'is_mention': False,
kallithea/tests/models/test_dump_html_mails.ref.html
Show inline comments
 
@@ -286,7 +286,7 @@ This is an automatic notification. Don&#
 

	
 
From: u1
 
To: u2@example.com
 
Subject: [Added] repo/name pull request #7 "The Title" from devbranch
 
Subject: [Review] repo/name PR #7 "The Title" from devbranch by u2
 

	
 
--------------------
 

	
 
@@ -351,7 +351,7 @@ This is an automatic notification. Don&#
 

	
 
From: u1
 
To: u2@example.com
 
Subject: [Added] repo/name pull request #7 "The Title" from devbranch
 
Subject: [Review] repo/name PR #7 "The Title" from devbranch by u2
 

	
 
--------------------
 

	
 
@@ -416,7 +416,7 @@ This is an automatic notification. Don&#
 

	
 
From: u1
 
To: u2@example.com
 
Subject: [Comment] repo/name pull request #7 "The Title" from devbranch
 
Subject: [Comment] repo/name PR #7 "The Title" from devbranch by u2
 

	
 
--------------------
 

	
 
@@ -459,7 +459,7 @@ This is an automatic notification. Don&#
 

	
 
From: u1
 
To: u2@example.com
 
Subject: [Comment] repo/name pull request #7 "The Title" from devbranch
 
Subject: [Comment] repo/name PR #7 "The Title" from devbranch by u2
 

	
 
--------------------
 

	
 
@@ -502,7 +502,7 @@ This is an automatic notification. Don&#
 

	
 
From: u1
 
To: u2@example.com
 
Subject: [Under Review: Comment] repo/name pull request #7 "The Title" from devbranch
 
Subject: [Under Review: Comment] repo/name PR #7 "The Title" from devbranch by u2
 

	
 
--------------------
 

	
 
@@ -547,7 +547,7 @@ This is an automatic notification. Don&#
 

	
 
From: u1
 
To: u2@example.com
 
Subject: [Under Review: Comment] repo/name pull request #7 "The Title" from devbranch
 
Subject: [Under Review: Comment] repo/name PR #7 "The Title" from devbranch by u2
 

	
 
--------------------
 

	
 
@@ -592,7 +592,7 @@ This is an automatic notification. Don&#
 

	
 
From: u1
 
To: u2@example.com
 
Subject: [Closing: Comment] repo/name pull request #7 "The Title" from devbranch
 
Subject: [Closing: Comment] repo/name PR #7 "The Title" from devbranch by u2
 

	
 
--------------------
 

	
 
@@ -635,7 +635,7 @@ This is an automatic notification. Don&#
 

	
 
From: u1
 
To: u2@example.com
 
Subject: [Closing: Comment] repo/name pull request #7 "The Title" from devbranch
 
Subject: [Closing: Comment] repo/name PR #7 "The Title" from devbranch by u2
 

	
 
--------------------
 

	
 
@@ -678,7 +678,7 @@ This is an automatic notification. Don&#
 

	
 
From: u1
 
To: u2@example.com
 
Subject: [Under Review, Closing: Comment] repo/name pull request #7 "The Title" from devbranch
 
Subject: [Under Review, Closing: Comment] repo/name PR #7 "The Title" from devbranch by u2
 

	
 
--------------------
 

	
 
@@ -723,7 +723,7 @@ This is an automatic notification. Don&#
 

	
 
From: u1
 
To: u2@example.com
 
Subject: [Under Review, Closing: Comment] repo/name pull request #7 "The Title" from devbranch
 
Subject: [Under Review, Closing: Comment] repo/name PR #7 "The Title" from devbranch by u2
 

	
 
--------------------
 

	
kallithea/tests/models/test_notifications.py
Show inline comments
 
@@ -192,6 +192,7 @@ class TestNotifications(TestController):
 
                pr_source_repo='https://dev.org/repo',
 
                pr_source_branch='devbranch',
 
                pr_owner=User.get(self.u2),
 
                pr_owner_username='u2'
 
                )
 

	
 
            for type_, body, kwargs in [
0 comments (0 inline, 0 general)