Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #3297 - Adjust changelog for dependabot #3301

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions tests/unit/test_tools_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,14 @@ def test_normalize_title(self):
'Fixes #101 — Everything you can imagine is real.')
expected = 'Fixes #101 - Everything you can imagine is real.'
self.assertEqual(actual, expected)
# GreenKeeper title style
actual = changelog.normalize_title('Greenkeeper style 🚀')
expected = 'NPM update - Greenkeeper style.'
# # GreenKeeper title style
# actual = changelog.normalize_title('Greenkeeper style 🚀')
# expected = 'NPM update - Greenkeeper style.'
# self.assertEqual(actual, expected)

# Dependabot-review title style
actual = changelog.normalize_title('Bump grunt from 1.0.4 to 1.1.0')
expected = 'NPM update - grunt from 1.0.4 to 1.1.0.'
self.assertEqual(actual, expected)


Expand Down
15 changes: 12 additions & 3 deletions tools/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,18 @@ def normalize_title(title):
See the test suite for the potential matches.
GitHub sends us a unicode string.
"""
if '🚀' in title:
title = title.replace('🚀', '')
title = title.strip()
# if '🚀' in title:
# title = title.replace('🚀', '')
# title = title.strip()
# title = 'NPM update - {title}.'.format(title=title)

if 'Bump' in title:
"""
index [0] -> Bump always for dependabot
index [1:] -> name of package and version info
"""
title = title.split()[1:]
title = ' '.join(title)
title = 'NPM update - {title}.'.format(title=title)
else:
regex = r"[^ ]?\#(?P<number>\d+)[^\w]+(?P<prose>.*)"
Expand Down