This is an automated email from the ASF dual-hosted git repository. reiabreu pushed a commit to branch improve-release-notes-script in repository https://gitbox.apache.org/repos/asf/storm.git
commit cbc5c434f954378f3359f69b4e3817e97184c82e Author: Rui Abreu <[email protected]> AuthorDate: Sat Jul 18 21:36:06 2026 +0100 improve release_notes.py: ignore github_actions/skip-changelog labels and guard against stale GH index - Skip issues labeled github_actions or skip-changelog from the changelog output, logging them to stderr so the omission is visible - Re-fetch each open issue individually before flagging it as unresolved, working around a known GitHub API inconsistency where the milestone filter can return issues whose milestone was already removed - Label automated license-update PRs with skip-changelog so they are automatically excluded from future release notes runs Co-Authored-By: Claude Sonnet 5 <[email protected]> --- .github/workflows/update-license-files.yml | 4 +++- dev-tools/release_notes.py | 27 ++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-license-files.yml b/.github/workflows/update-license-files.yml index 5d48bdd33..eb0fbf13f 100644 --- a/.github/workflows/update-license-files.yml +++ b/.github/workflows/update-license-files.yml @@ -79,4 +79,6 @@ jobs: - `LICENSE-binary` (binary dependencies section) Please review the changes and merge if correct. - labels: dependencies + labels: | + dependencies + skip-changelog diff --git a/dev-tools/release_notes.py b/dev-tools/release_notes.py index 2e8f8392c..21fcda027 100755 --- a/dev-tools/release_notes.py +++ b/dev-tools/release_notes.py @@ -102,13 +102,38 @@ if __name__ == "__main__": print("No issues found for the specified milestone.", file=sys.stderr) sys.exit(1) - unresolved_issues = [issue for issue in issues if issue["state"] != "closed"] + def is_truly_open(issue): + if issue["state"] == "closed": + return False + # Re-fetch the issue directly to guard against stale index returning issues + # whose milestone was already removed (known GitHub API inconsistency) + url = f"{GITHUB_API_BASE_URL}/repos/{owner}/{repo}/issues/{issue['number']}" + r = requests.get(url, headers=headers) + if r.status_code != 200: + return True # conservative: treat as unresolved if we can't verify + return r.json().get("milestone") is not None + + unresolved_issues = [issue for issue in issues if is_truly_open(issue)] if unresolved_issues: print("The release is not completed since unresolved issues were found:", file=sys.stderr) for issue in unresolved_issues: print(f"Unresolved issue: {issue['number']:5d} {issue['state']:10s} {issue_link(issue)}", file=sys.stderr) sys.exit(1) + IGNORED_LABELS = {"github_actions", "skip-changelog"} + + ignored = [ + issue for issue in issues + if any(l["name"] in IGNORED_LABELS for l in issue["labels"]) + ] + if ignored: + print(f"Ignoring {len(ignored)} issue(s) with excluded labels ({', '.join(IGNORED_LABELS)}):", file=sys.stderr) + for issue in ignored: + matched = [l["name"] for l in issue["labels"] if l["name"] in IGNORED_LABELS] + print(f" #{issue['number']} [{', '.join(matched)}] - {issue['title']}", file=sys.stderr) + + issues = [issue for issue in issues if issue not in ignored] + # Group issues by labels, assigning each issue to only its first label # to avoid duplicates when an issue has multiple labels issues_by_label = {}
