Skip to content

Commit

Permalink
[apps] List contributors using the changelog generation script (#2456)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbakholdina authored Sep 21, 2022
1 parent 90d2f07 commit 0bc3b03
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 26 deletions.
18 changes: 0 additions & 18 deletions scripts/changelog/README.md

This file was deleted.

18 changes: 18 additions & 0 deletions scripts/release-notes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Script Description

Script designed to generate release notes template with main sections, contributors list, and detailed changelog out of `.csv` SRT git log file. The output `release-notes.md` file is generated in the root folder.

In order to obtain the git log file since the previous release (e.g., v1.4.0), use the following command:

```
git log --pretty=format:"%h|%s|%an|%ae" v1.4.0...HEAD^ > commits.csv
```

## Requirements

* Python 3.6+

To install Python libraries use:
```
pip install -r requirements.txt
```
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,42 @@ def write_into_changelog(df, f):
type=click.Path(exists=True)
)
def main(git_log):
""" Script designed to create changelog out of .csv SRT git log """

"""
Script designed to generate release notes template with main sections,
contributors list, and detailed changelog out of .csv SRT git log file.
"""
df = pd.read_csv(git_log, sep = '|', names = ['commit', 'message', 'author', 'email'])
df['area'] = df['message'].apply(define_area)
df['message'] = df['message'].apply(delete_prefix)

core = df[df['area']=='core']
tests = df[df['area']=='tests']
build = df[df['area']=='build']
apps = df[df['area']=='apps']
docs = df[df['area']=='docs']
# Split commits by areas
core = df[df['area']==Area.core.value]
tests = df[df['area']==Area.tests.value]
build = df[df['area']==Area.build.value]
apps = df[df['area']==Area.apps.value]
docs = df[df['area']==Area.docs.value]
other = df[df['area'].isna()]

with open('changelog.md', 'w') as f:
# Define individual contributors
contributors = df.groupby(['author', 'email'])
contributors = list(contributors.groups.keys())

with open('release-notes.md', 'w') as f:
f.write('# Release Notes\n')

f.write('\n## API / ABI / Integration Changes\n')
f.write('\n**API/ABI version: 1.x.**\n')

f.write('\n## New Features and Improvements\n')
f.write('\n## Important Bug Fixes\n')
f.write('\n## Build\n')
f.write('\n## Documentation\n')

f.write('\n## Contributors\n')
for name, email in contributors:
f.write(f'\n{name} <{email}>')
f.write('\n')

f.write('\n## Changelog\n')
f.write('\n<details><summary>Click to expand/collapse</summary>')
f.write('\n<p>')
Expand Down
File renamed without changes.

0 comments on commit 0bc3b03

Please sign in to comment.