From 1147b31a8b508b961d8ba367ed3f958434bb9615 Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Thu, 9 Jan 2025 17:05:21 +0100 Subject: [PATCH 1/3] integration + minimum --- .github/workflows/integration.yml | 4 ++++ .github/workflows/minimum.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index c9afc669..9e66c905 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -5,6 +5,10 @@ on: pull_request: types: [opened, reopened] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: integration: runs-on: ${{ matrix.os }} diff --git a/.github/workflows/minimum.yml b/.github/workflows/minimum.yml index 56390695..a664cb93 100644 --- a/.github/workflows/minimum.yml +++ b/.github/workflows/minimum.yml @@ -5,6 +5,10 @@ on: pull_request: types: [opened, reopened] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: minimum: runs-on: ${{ matrix.os }} From 9131d08406330f7231f6615255614b6aeebc722f Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Thu, 9 Jan 2025 17:05:43 +0100 Subject: [PATCH 2/3] unit --- .github/workflows/unit.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 20cbabd9..d0873c59 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -5,6 +5,10 @@ on: pull_request: types: [opened, reopened] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: unit: runs-on: ${{ matrix.os }} From 534a8536952bf6f6462dae743c4b69de1d606ef6 Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Thu, 9 Jan 2025 18:15:14 +0100 Subject: [PATCH 3/3] use sdv enterprise list --- scripts/release_notes_generator.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/scripts/release_notes_generator.py b/scripts/release_notes_generator.py index 7347f2c7..b692b5b1 100644 --- a/scripts/release_notes_generator.py +++ b/scripts/release_notes_generator.py @@ -23,6 +23,14 @@ 'feature request', 'customer success', ] +ISSUE_LABELS_ORDERED_BY_IMPORTANCE = [ + 'feature request', + 'customer success', + 'bug', + 'documentation', + 'internal', + 'maintenance', +] NEW_LINE = '\n' GITHUB_URL = 'https://api.github.com/repos/sdv-dev/sdmetrics' GITHUB_TOKEN = os.getenv('GH_ACCESS_TOKEN') @@ -36,10 +44,12 @@ def _get_milestone_number(milestone_title): body = response.json() if response.status_code != 200: raise Exception(str(body)) + milestones = body for milestone in milestones: if milestone.get('title') == milestone_title: return milestone.get('number') + raise ValueError(f'Milestone {milestone_title} not found in past 100 milestones.') @@ -57,16 +67,22 @@ def _get_issues_by_milestone(milestone): body = response.json() if response.status_code != 200: raise Exception(str(body)) + issues_on_page = body if not issues_on_page: break + + # Filter our PRs + issues_on_page = [issue for issue in issues_on_page if issue.get('pull_request') is None] issues.extend(issues_on_page) page += 1 + return issues def _get_issues_by_category(release_issues): category_to_issues = defaultdict(list) + for issue in release_issues: issue_title = issue['title'] issue_number = issue['number'] @@ -76,6 +92,7 @@ def _get_issues_by_category(release_issues): if assignee: login = assignee['login'] line += f' by @{login}' + # Check if any known label is marked on the issue labels = [label['name'] for label in issue['labels']] found_category = False @@ -84,22 +101,27 @@ def _get_issues_by_category(release_issues): category_to_issues[category].append(line) found_category = True break + if not found_category: category_to_issues['misc'].append(line) + return category_to_issues def _create_release_notes(issues_by_category, version, date): title = f'## v{version} - {date}' release_notes = f'{title}{NEW_LINE}{NEW_LINE}' - for category in ISSUE_LABELS + ['misc']: + + for category in ISSUE_LABELS_ORDERED_BY_IMPORTANCE + ['misc']: issues = issues_by_category.get(category) if issues: section_text = ( f'### {LABEL_TO_HEADER[category]}{NEW_LINE}{NEW_LINE}' f'{NEW_LINE.join(issues)}{NEW_LINE}{NEW_LINE}' ) + release_notes += section_text + return release_notes @@ -108,10 +130,12 @@ def update_release_notes(release_notes): file_path = 'HISTORY.md' with open(file_path, 'r') as history_file: history = history_file.read() + token = '# HISTORY\n\n' split_index = history.find(token) + len(token) + 1 header = history[:split_index] new_notes = f'{header}{release_notes}{history[split_index:]}' + with open(file_path, 'w') as new_history_file: new_history_file.write(new_notes)