From b11ead58041f6618b4d585dda32f2d71ef0da46a Mon Sep 17 00:00:00 2001 From: Ewen Cheslack-Postava Date: Tue, 29 Nov 2016 11:36:06 -0800 Subject: [PATCH] MINOR: Make release notes script check resolutions to avoid spurious inclusion of non-fix 'fixes' in release notes. Author: Ewen Cheslack-Postava Reviewers: Ismael Juma Closes #2174 from ewencp/release-notes-resolution-filters --- release_notes.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/release_notes.py b/release_notes.py index b8b2ea15cd3e6..432b06c40eef1 100755 --- a/release_notes.py +++ b/release_notes.py @@ -61,11 +61,28 @@ def issue_link(issue): print >>sys.stderr, "Didn't find any issues for the target fix version" sys.exit(1) - unresolved_issues = [issue for issue in issues if issue.fields.resolution is None] + # Some resolutions, including a lack of resolution, indicate that the bug hasn't actually been addressed and we shouldn't even be able to create a release until they are fixed + UNRESOLVED_RESOLUTIONS = [None, + "Unresolved", + "Duplicate", + "Invalid", + "Not A Problem", + "Not A Bug", + "Won't Fix", + "Incomplete", + "Cannot Reproduce", + "Later", + "Works for Me", + "Workaround", + "Information Provided" + ] + unresolved_issues = [issue for issue in issues if issue.fields.resolution in UNRESOLVED_RESOLUTIONS or issue.fields.resolution.name in UNRESOLVED_RESOLUTIONS] if unresolved_issues: - print >>sys.stderr, "The release is not completed since unresolved issues were found still tagged with this release as the fix version:" + print >>sys.stderr, "The release is not completed since unresolved issues or improperly resolved issues were found still tagged with this release as the fix version:" for issue in unresolved_issues: - print >>sys.stderr, "Unresolved issue: %s %s" % (issue.key, issue_link(issue)) + print >>sys.stderr, "Unresolved issue: %15s %20s %s" % (issue.key, issue.fields.resolution, issue_link(issue)) + print >>sys.stderr + print >>sys.stderr, "Note that for some resolutions, you should simply remove the fix version as they have not been truly fixed in this release." sys.exit(1) # Get list of (issue type, [issues]) sorted by the issue ID type, with each subset of issues sorted by their key so they