From 1314f75219a5d0b951e80b4d3891b907717396d0 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Wed, 6 Feb 2019 09:51:09 -0500 Subject: [PATCH] release script shows PRs that did not get included in changelog --- scripts/release.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/scripts/release.py b/scripts/release.py index 0220c593c..d4906e193 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -19,7 +19,8 @@ except ImportError: AREA_RENAME = { - 'api': 'API' + 'api': 'API', + 'dht': 'DHT' } @@ -151,17 +152,22 @@ def release(args): incompats = [] release_texts = [] + unlabeled = [] areas = {} for pr in gh.search_issues(f"merged:>={previous_release._json_data['created_at']} repo:lbryio/lbry"): - for area_name in get_labels(pr, 'area'): - area = areas.setdefault(area_name, []) - type_label = get_label(pr, "type") - for incompat in get_backwards_incompatible(pr.body): - incompats.append(f' * [{area_name}] {incompat.strip()} ({pr.html_url})') - for release_text in get_release_text(pr.body): - release_texts.append(f'{release_text.strip()} ({pr.html_url})') - if not (args.action == '*-rc' and type_label == 'fixup'): - area.append(f' * [{type_label}] {pr.title} ({pr.html_url}) by {pr.user["login"]}') + area_labels = list(get_labels(pr, 'area')) + type_label = get_label(pr, 'type') + if area_labels and type_label: + for area_name in area_labels: + for incompat in get_backwards_incompatible(pr.body): + incompats.append(f' * [{area_name}] {incompat.strip()} ({pr.html_url})') + for release_text in get_release_text(pr.body): + release_texts.append(f'{release_text.strip()} ({pr.html_url})') + if not (args.action == '*-rc' and type_label == 'fixup'): + area = areas.setdefault(area_name, []) + area.append(f' * [{type_label}] {pr.title} ({pr.html_url}) by {pr.user["login"]}') + else: + unlabeled.append(f' * {pr.title} ({pr.html_url}) by {pr.user["login"]}') area_names = list(areas.keys()) area_names.sort() @@ -182,7 +188,7 @@ def release(args): w(incompat) for area in area_names: prs = areas[area] - area = AREA_RENAME.get(area, area.capitalize()) + area = AREA_RENAME.get(area.lower(), area.capitalize()) w('') w(f'### {area}') for pr in prs: @@ -190,6 +196,11 @@ def release(args): print(body.getvalue()) + if unlabeled: + print('The following PRs were skipped and not included in changelog:') + for skipped in unlabeled: + print(skipped) + if not args.dry_run: commit = version_file.update(