Skip to content

Instantly share code, notes, and snippets.

@kan-bayashi
Last active September 5, 2019 04:27
Show Gist options
  • Save kan-bayashi/773235a661bafa65e9037d2e75e4c8a6 to your computer and use it in GitHub Desktop.
Save kan-bayashi/773235a661bafa65e9037d2e75e4c8a6 to your computer and use it in GitHub Desktop.
Make release note from milestone
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Create release note from milestone with PyGithub."""
import argparse
from collections import defaultdict
import github
if __name__ == "__main__":
parser = argparse.ArgumentParser("release note generator")
parser.add_argument("--user", default="espnet", type=str)
parser.add_argument("--repo", default="espnet", type=str)
parser.add_argument("token", default=None, type=str)
parser.add_argument("milestone", default=None, type=str)
args = parser.parse_args()
g = github.Github(args.token)
repo = g.get_organization(args.user).get_repo(args.repo)
# get milestone object
for m in repo.get_milestones(state="all"):
if m.title == args.milestone:
milestone = m
break
# get pull requests
pull_requests = []
for i in repo.get_issues(milestone, state="closed"):
try:
pr = i.as_pull_request()
if pr.merged:
pull_requests += [pr]
except github.UnknownObjectException:
continue
# make dict of closed pull requests per label and contributor list
pull_request_dict = defaultdict(list)
contributors = []
for pr in pull_requests:
if pr.user.login not in contributors:
contributors.append(pr.user.login)
if len(pr.labels) == 0:
# skip pull request without label
continue
else:
# use first label as label
pull_request_dict[pr.labels[0].name].append(pr)
# make release note
for label, pull_requests in pull_request_dict.items():
print(f'# {label}')
for pr in pull_requests:
print(f'- [**{label}**] {pr.title} #{pr.number} by @{pr.user.login}')
print()
print("# Acknowledgements")
print("Special thanks to ", end="")
for idx, contributor in enumerate(sorted(contributors), 1):
print("@" + contributor, end="")
if idx != len(contributors):
print(", ", end="")
else:
print(".")
print()
@kan-bayashi
Copy link
Author

Usage:

$ python make_release_note_from_milestone.py --user espnet --repo espnet <token> v.0.5.0

# CI
- [**CI**] Integration test with mini AN4 #1035 by @ShigekiKarita
- [**CI**] codecov support #850 by @ShigekiKarita

# Bugfix
- [**Bugfix**] [Bug] Fix error calculator for report false #1032 by @Fhrozen
- [**Bugfix**] fix unk scoring #1002 by @sw005320
- [**Bugfix**] make tensorboard logging done every 100 iters #996 by @sw005320

# Refactoring
- [**Refactoring**] TTS: avoid using asr module in TTS #1031 by @r9y9
- [**Refactoring**] Exit 1 when source command return 1 #1030 by @kan-bayashi
- [**Refactoring**] Refactor  FileReaderWrapper and  FileWriterWrapper #947 by @kamo-naoyuki

# Enhancement
- [**Enhancement**] Use pypi sentencepiece #1029 by @ShigekiKarita
- [**Enhancement**] Add log of the inference speed of TTS models #1027 by @kan-bayashi
- [**Enhancement**] Add GPU decodable test for TTS modules #1025 by @kan-bayashi
- [**Enhancement**] Support multi-speaker FastSpeech #1006 by @kan-bayashi
- [**Enhancement**] Custom Training extensions for ASR chainer #1004 by @Fhrozen
- [**Enhancement**] Support multi-speaker Transformer #1001 by @kan-bayashi
- [**Enhancement**] RFC: Add keep_all_data_on_mem option #999 by @r9y9
- [**Enhancement**] Support saving of attention weights and probability in decoding #995 by @kan-bayashi
- [**Enhancement**] Implement Fast Speech #848 by @kan-bayashi
- [**Enhancement**] Transformer Chainer #774 by @Fhrozen
- [**Enhancement**] Neural Machine Translation #563 by @hirofumi0810

# Recipe
- [**Recipe**] fix bugs to make a swbd recipe run #1024 by @sw005320
- [**Recipe**] Add multi-speaker Transformer config in LibriTTS #1022 by @kan-bayashi
- [**Recipe**] Rename RESULTS to RESULTS.md #1021 by @kan-bayashi
- [**Recipe**] Clean LibriTTS RESULTS.md #1020 by @kan-bayashi
- [**Recipe**] Clean LJSPeech RESULTS.md #1019 by @kan-bayashi
- [**Recipe**] Update JSUT TTS RESULTS.md #1018 by @kan-bayashi
- [**Recipe**] Add Transformer config in JSUT #1009 by @kan-bayashi
- [**Recipe**] Update libri trans #949 by @hirofumi0810
- [**Recipe**] iwslt18 NMT recipe #937 by @hirofumi0810
- [**Recipe**] libri_trans NMT recipe #931 by @hirofumi0810
- [**Recipe**] Add fastspeech.v2 result #925 by @kan-bayashi

# Documentation
- [**Documentation**] [Docstrings] Removing empty init files to avoid docs #1016 by @Fhrozen
- [**Documentation**] add egs info #1015 by @sw005320
- [**Documentation**] Update docstrings in espnet.nets.chainer_backend #974 by @Masao-Someki
- [**Documentation**] Reformat docstrings in espnet/asr #914 by @Masao-Someki
- [**Documentation**] Update TTS module’s docstrings and refactor some modules #898 by @kan-bayashi

# Acknowledgements
Special thanks to @Fhrozen, @Masao-Someki, @ShigekiKarita, @hirofumi0810, @kamo-naoyuki, @kan-bayashi, @r9y9, @sw005320.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment