Skip to content

Commit

Permalink
Bug 1372581 - Handle latin characters in commit author names
Browse files Browse the repository at this point in the history
We use python .format() to concatenate the commit author’s name and
email address.  When we hit an author name with non-ASCII
characters, it would bomb out trying to format it into a String.
So this makes sure to put those fields into a Unicode field to preserve
them.
  • Loading branch information
Cameron Dawson committed Jul 20, 2017
1 parent 0c4387f commit 9183e56
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/sample_data/pulse_consumer/github_push_commits.json
Expand Up @@ -73,8 +73,8 @@
"sha": "ef46fa00eb0919e92f11ffdfe6a6926541ab409c",
"commit": {
"author": {
"name": "Roy C",
"email": "crosscent@gmail.com",
"name": "Fausto Núñez Alberro",
"email": "fausto.nunez@outlook.com",
"date": "2016-07-28T16:59:27Z"
},
"committer": {
Expand Down
2 changes: 1 addition & 1 deletion tests/sample_data/pulse_consumer/transformed_gh_push.json
Expand Up @@ -5,7 +5,7 @@
{"author": "KWierso <kwierso@users.noreply.github.com>",
"comment": "Bug 1287911 - Add the ability to tag revisions with metadata (#1706) r=camd\n\n* Bug 1287911 - Add the ability to tag revisions with metadata\r\n\r\n* Bug 1287911 - Make backout commit text be red in the list of revisions",
"revision": "09ef55394535acd453eb7728ef8981a96aa0aef6"},
{"author": "Roy C <crosscent@gmail.com>",
{"author": "Fausto Núñez Alberro <fausto.nunez@outlook.com>",
"comment": "Bug 1288530 - Update classifier unconditionally, and move classifier tooltip in AlertView (#1742)",
"revision": "ef46fa00eb0919e92f11ffdfe6a6926541ab409c"},
{"author": "KWierso <kwierso@users.noreply.github.com>",
Expand Down
2 changes: 1 addition & 1 deletion treeherder/etl/resultset_loader.py
Expand Up @@ -104,7 +104,7 @@ def fetch_resultset(self, url, repository, sha=None):
for commit in commits:
revisions.append({
"comment": commit["commit"]["message"],
"author": "{} <{}>".format(
"author": u"{} <{}>".format(
commit["commit"]["author"]["name"],
commit["commit"]["author"]["email"]),
"revision": commit["sha"]
Expand Down

0 comments on commit 9183e56

Please sign in to comment.