Skip to content

Commit

Permalink
fix(owners): Correct various cases in committers
Browse files Browse the repository at this point in the history
- Handle errors in finding committers
- Correctly return iterator from tokenize_path
  • Loading branch information
dcramer committed Mar 6, 2018
1 parent 1564d4d commit ab19caa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/sentry/plugins/sentry_mail/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ def add_unsubscribe_link(self, context, user_id, project):
)

def notify(self, notification):
from sentry.models import Commit, Release

event = notification.event
group = event.group
project = group.project
Expand All @@ -166,6 +168,8 @@ def notify(self, notification):
if features.has('organizations:suggested-commits', org):
try:
committers = get_event_file_committers(project, event)
except (Commit.DoesNotExist, Release.DoesNotExist):
pass
except Exception as exc:
logging.exception(six.text_type(exc))
else:
Expand Down
3 changes: 2 additions & 1 deletion src/sentry/utils/committers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def tokenize_path(path):
for sep in PATH_SEPERATORS:
if sep in path:
return reversed(path.split(sep))
return [path]
else:
return iter([path])


def score_path_match_length(path_a, path_b):
Expand Down

0 comments on commit ab19caa

Please sign in to comment.