Skip to content

Add PR link to highlights file #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 12 additions & 15 deletions site/generate_release_notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,19 @@ def update_release_highlights_template(template_filepath, documentation_highligh
frontend_release_notes = ""

for pr in documentation_highlight_pull_requests:
title = pr['title']
external_notes = extract_external_release_notes(pr['body'])
if external_notes:
documentation_release_notes += f"- **{title}**\n\n{external_notes}\n\n"
external_release_notes = extract_external_release_notes(pr['body'])
if external_release_notes:
documentation_release_notes += f"<!---{pr['title']} by @{pr['author']} in [#{pr['number']}]({pr['url']})--->\n- **{pr['title']}**. {external_release_notes}\n\n\n"

for pr in python_highlight_pull_requests:
title = pr['title']
external_notes = extract_external_release_notes(pr['body'])
if external_notes:
python_release_notes += f"- **{title}**\n\n{external_notes}\n\n"
external_release_notes = extract_external_release_notes(pr['body'])
if external_release_notes:
python_release_notes += f"<!---{pr['title']} by @{pr['author']} in [#{pr['number']}]({pr['url']})--->\n- **{pr['title']}**. {external_release_notes}\n\n\n"

for pr in frontend_highlight_pull_requests:
title = pr['title']
external_notes = extract_external_release_notes(pr['body'])
if external_notes:
frontend_release_notes += f"- **{title}**\n\n{external_notes}\n\n"
external_release_notes = extract_external_release_notes(pr['body'])
if external_release_notes:
frontend_release_notes += f"<!---{pr['title']} by @{pr['author']} in [#{pr['number']}]({pr['url']})--->\n- **{pr['title']}**. {external_release_notes}\n\n\n"

# Update the section for PRs from the documentation repo
template_content = re.sub(r"(?<=## Release highlights\n\n).*?(?=\n..)", documentation_release_notes, template_content, flags=re.DOTALL)
Expand Down Expand Up @@ -158,7 +155,7 @@ def write_documentation_prs_to_qmd_files(pr_number, documentation_highlight_pull
if label_name in qmd_files:
external_release_notes = extract_external_release_notes(pr_data['body'])
if external_release_notes:
qmd_files[label_name] += f"<!---{pr_data['title']} by @{pr_data['author']} in [#{pr_number}]({pr_data['url']}) --->\n- **{pr_data['title']}**. {external_release_notes}\n\n\n"
qmd_files[label_name] += f"<!---{pr_data['title']} by @{pr_data['author']} in [#{pr_number}]({pr_data['url']})--->\n- **{pr_data['title']}**. {external_release_notes}\n\n\n"
# Adds the PR to the highlights list if it has the 'highlight' label
if label_name == "highlight":
documentation_highlight_pull_requests.append(pr_data)
Expand All @@ -181,7 +178,7 @@ def write_python_prs_to_qmd_files(pr_number, python_highlight_pull_requests):
if label_name in qmd_files:
external_release_notes = extract_external_release_notes(pr_data['body'])
if external_release_notes:
qmd_files[label_name] += f"<!---{pr_data['title']} by @{pr_data['author']} in [#{pr_number}]({pr_data['url']}) --->\n- **{pr_data['title']}**. {external_release_notes}\n\n\n"
qmd_files[label_name] += f"<!---{pr_data['title']} by @{pr_data['author']} in [#{pr_number}]({pr_data['url']})--->\n- **{pr_data['title']}**. {external_release_notes}\n\n\n"
# Adds the PR to the highlights list if it has the 'highlight' label
if label_name == "highlight":
python_highlight_pull_requests.append(pr_data)
Expand All @@ -204,7 +201,7 @@ def write_frontend_prs_to_qmd_files(pr_number, frontend_highlight_pull_requests)
if label_name in qmd_files:
external_release_notes = extract_external_release_notes(pr_data['body'])
if external_release_notes:
qmd_files[label_name] += f"<!---{pr_data['title']} by @{pr_data['author']} in [#{pr_number}]({pr_data['url']}) --->\n- **{pr_data['title']}**. {external_release_notes}\n\n\n"
qmd_files[label_name] += f"<!---{pr_data['title']} by @{pr_data['author']} in [#{pr_number}]({pr_data['url']})--->\n- **{pr_data['title']}**. {external_release_notes}\n\n\n"
# Adds the PR to the highlights list if it has the 'highlight' label
if label_name == "highlight":
frontend_highlight_pull_requests.append(pr_data)
Expand Down