From 5591ec8a5204afe553d6135e80058e21bb5846ce Mon Sep 17 00:00:00 2001 From: Vaclav Petras Date: Tue, 18 Jun 2024 12:55:36 -0400 Subject: [PATCH] contributing: Add monthly financial supporters to release notes (#3883) The generated release notes now contain members of supporters tier on Open Collective. We want to highlight financial contributions in the release notes. Monthly supporters seem like a fitting category in context of release. Current (draft) release notes are already updated. The list is randomized when generated. Images are not included because that would require generating content for the missing images and making them circular (more work and circular did not work for me). They are included under a heading at the end of highlights section, so not at the end, but not at the very beginning either. Also: Specify number of highlight items. Add heading for new addons. Use title case. Use 'tools' not 'modules' for heading. Add requests as pip dependency to get the URL --- .github/workflows/additional_checks.yml | 2 +- utils/generate_release_notes.py | 24 +++++++++++++++++++++++- utils/release.yml | 2 +- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/additional_checks.yml b/.github/workflows/additional_checks.yml index 3d69e356853..98ceb8cab8c 100644 --- a/.github/workflows/additional_checks.yml +++ b/.github/workflows/additional_checks.yml @@ -59,7 +59,7 @@ jobs: - name: Generate release notes using git log run: | - python -m pip install PyYAML + python -m pip install PyYAML requests # Git works without any special permissions. # Using current branch or the branch against the PR is open. # Using the last 30 commits (for branches, tags, and PRs). diff --git a/utils/generate_release_notes.py b/utils/generate_release_notes.py index d68bb7fa8a7..edddf325350 100755 --- a/utils/generate_release_notes.py +++ b/utils/generate_release_notes.py @@ -9,12 +9,14 @@ import csv import itertools import json +import random import re import subprocess import sys from collections import defaultdict from pathlib import Path +import requests import yaml PRETTY_TEMPLATE = ( @@ -128,6 +130,20 @@ def binder_badge(tag): return f"[![Binder]({binder_image_url})]({binder_url})" +def print_support(file=None): + url = "https://opencollective.com/grass/tiers/supporter/all.json" + response = requests.get(url=url) + data = response.json() + if data: + print_section_heading_3("Monthly Financial Supporters", file=file) + random.shuffle(data) + supporters = [] + for member in data: + supporters.append(f"""[{member['name']}]({member['profile']})""") + print(", ".join(supporters)) + print("") + + def adjust_after(lines): """Adjust new contributor lines in the last part of the generated notes""" bot_file = Path("utils") / "known_bot_names.txt" @@ -170,7 +186,13 @@ def print_notes( if before: print(before) print_section_heading_2("Highlights", file=file) - print("* _Put handcrafted list of items here._\n") + print("* _Put handcrafted list of 2-15 items here._\n") + print_section_heading_2("New Addon Tools", file=file) + print( + "* _Put here a list of new addos since last release " + "or delete the section if there are none._\n" + ) + print_support(file=file) print_section_heading_2("What's Changed", file=file) changes_by_category = split_to_categories(changes, categories=categories) print_by_category(changes_by_category, categories=categories, file=file) diff --git a/utils/release.yml b/utils/release.yml index 0e70ef30888..252ede724b8 100644 --- a/utils/release.yml +++ b/utils/release.yml @@ -1,7 +1,7 @@ --- notes: categories: - - title: Modules + - title: Tools regexp: '((d|db|g|i|m|ps|r|r3|t|v)\.[^ ]*)(, (d|db|g|i|m|ps|r|r3|t|v)\.[^ ]*)?: |(modules|tools|temporal): ' - title: Graphical User Interface