You need to sign in or sign up before continuing.
Unverified Commit 8097370e authored by Joao Gomes's avatar Joao Gomes Committed by GitHub
Browse files

Make small improvements to the release notes scripts (#5457)

* Make small improvements to the release notes scripts

Add release tags as parameters, exclude prototype stuff from release notes and
automate contributors list
parent efb07368
# In[1]: # In[1]:
# imports and set configuration
import pandas as pd import pandas as pd
from retrieve_prs_data import run
exclude_prototype = True
data_filename = "10.0_to_11.0-rc2.json"
previous_release = "v10.0"
current_release = "v11.0-rc2"
# In[2]: # In[2]:
df = pd.read_json("10.0_to_11.0-rc2.json").T df = pd.read_json(data_filename).T
df.tail() df.tail()
...@@ -76,6 +81,8 @@ mod_df[mod_df["enhancement"] & mod_df["module: transforms"]] ...@@ -76,6 +81,8 @@ mod_df[mod_df["enhancement"] & mod_df["module: transforms"]]
def format_prs(mod_df): def format_prs(mod_df):
out = [] out = []
for idx, row in mod_df.iterrows(): for idx, row in mod_df.iterrows():
if exclude_prototype and row["prototype"]:
continue
modules = idx modules = idx
# Put "documentation" and "tests" first for sorting to be dece # Put "documentation" and "tests" first for sorting to be dece
for last_module in ("documentation", "tests"): for last_module in ("documentation", "tests"):
...@@ -119,3 +126,13 @@ for section_title, module_idx in ( ...@@ -119,3 +126,13 @@ for section_title, module_idx in (
# Missing PRs are these ones... classify them manually # Missing PRs are these ones... classify them manually
missing_prs = pd.concat([mod_df, included_prs]).drop_duplicates(subset="pr_number", keep=False) missing_prs = pd.concat([mod_df, included_prs]).drop_duplicates(subset="pr_number", keep=False)
print(format_prs(missing_prs)) print(format_prs(missing_prs))
# In[12]:
# Generate list of contributors
print()
print("## Contributors")
command_to_run = f"{{ git shortlog -s {previous_release}..{current_release} | cut -f2- & git log -s {previous_release}..{current_release} | grep Co-authored | cut -f2- -d: | cut -f1 -d\\< | sed 's/^ *//;s/ *$//' ; }} | sort --ignore-case | uniq | tr '\\n' ';' | sed 's/;/, /g;s/, $//' | fold -s"
rc, output, err = run(command_to_run)
print(output)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment