You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/09/19 17:32:03 UTC
[21/23] git commit: [#6535] ticket:424 Fix user link formatting
[#6535] ticket:424 Fix user link formatting
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/42b6445e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/42b6445e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/42b6445e
Branch: refs/heads/master
Commit: 42b6445e9e0893da5b44ff04ea3911dd4f7d205c
Parents: be9d119
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Sep 17 15:18:04 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:52 2013 +0000
----------------------------------------------------------------------
ForgeImporters/forgeimporters/github/tracker.py | 9 +++++----
ForgeImporters/forgeimporters/tests/github/test_tracker.py | 8 ++++----
2 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/42b6445e/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index d068e47..655980a 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -130,7 +130,8 @@ class GitHubTrackerImporter(ToolImporter):
ticket.created_date = self.parse_datetime(issue['created_at'])
ticket.mod_date = self.parse_datetime(issue['updated_at'])
if issue['assignee']:
- owner_line = '*Originally owned by:* {}\n'.format(issue['assignee']['login'])
+ owner_line = '*Originally owned by:* {}\n'.format(
+ self.get_user_link(issue['assignee']['login']))
else:
owner_line = ''
# body processing happens here
@@ -141,7 +142,7 @@ class GitHubTrackerImporter(ToolImporter):
u'{owner}'
u'\n'
u'{body}').format(
- creator=issue['user']['login'],
+ creator=self.get_user_link(issue['user']['login']),
owner=owner_line,
body=body,
)
@@ -151,7 +152,7 @@ class GitHubTrackerImporter(ToolImporter):
for comment in extractor.iter_comments(issue):
body, attachments = self._get_attachments(comment['body'])
if comment['user']:
- posted_by = u'*Originally posted by: {}*\n'.format(
+ posted_by = u'*Originally posted by:* {}\n'.format(
self.get_user_link(comment['user']['login']))
posted_by += body
body = posted_by
@@ -166,7 +167,7 @@ class GitHubTrackerImporter(ToolImporter):
for event in extractor.iter_events(issue):
prefix = text = ''
if event['event'] in ('reopened', 'closed'):
- prefix = '*Ticket changed by: {}*\n\n'.format(
+ prefix = '*Ticket changed by:* {}\n\n'.format(
self.get_user_link(event['actor']['login']))
if event['event'] == 'reopened':
text = '- **status**: closed --> open'
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/42b6445e/ForgeImporters/forgeimporters/tests/github/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/github/test_tracker.py b/ForgeImporters/forgeimporters/tests/github/test_tracker.py
index 7ff8c9b..876c71e 100644
--- a/ForgeImporters/forgeimporters/tests/github/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/github/test_tracker.py
@@ -74,7 +74,7 @@ class TestTrackerImporter(TestCase):
dt.strptime.side_effect = lambda s,f: s
importer.process_fields(ticket, issue)
self.assertEqual(ticket.summary, 'title')
- self.assertEqual(ticket.description, '*Originally created by:* creator\n*Originally owned by:* owner\n\nhello')
+ self.assertEqual(ticket.description, '*Originally created by:* [creator](https://github.com/creator)\n*Originally owned by:* [owner](https://github.com/owner)\n\nhello')
self.assertEqual(ticket.status, 'New')
self.assertEqual(ticket.created_date, 'created_at')
self.assertEqual(ticket.mod_date, 'updated_at')
@@ -127,7 +127,7 @@ class TestTrackerImporter(TestCase):
importer = tracker.GitHubTrackerImporter()
importer.process_comments(extractor, ticket, issue)
self.assertEqual(ticket.discussion_thread.add_post.call_args_list[0], mock.call(
- text='*Originally posted by: [me](https://github.com/me)*\nhello',
+ text='*Originally posted by:* [me](https://github.com/me)\nhello',
timestamp=datetime(2013, 8, 26, 16, 57, 53),
ignore_security=True,
))
@@ -157,12 +157,12 @@ class TestTrackerImporter(TestCase):
importer.process_events(extractor, ticket, issue)
args = ticket.discussion_thread.add_post.call_args_list
self.assertEqual(args[0], mock.call(
- text='*Ticket changed by: [darth](https://github.com/darth)*\n\n'
+ text='*Ticket changed by:* [darth](https://github.com/darth)\n\n'
'- **status**: open --> closed',
timestamp=datetime(2013, 9, 12, 9, 58, 49),
ignore_security=True))
self.assertEqual(args[1], mock.call(
- text='*Ticket changed by: [yoda](https://github.com/yoda)*\n\n'
+ text='*Ticket changed by:* [yoda](https://github.com/yoda)\n\n'
'- **status**: closed --> open',
timestamp=datetime(2013, 9, 12, 10, 13, 20),
ignore_security=True))