Jens Geyer created THRIFT-6077:
----------------------------------
Summary: improve CHANGES.md generator section assignment
Key: THRIFT-6077
URL: https://issues.apache.org/jira/browse/THRIFT-6077
Project: Thrift
Issue Type: Improvement
Components: Build Process
Reporter: Jens Geyer
build/generate-changes.py filed several classes of entries under "(No Section)"
in the generated CHANGES.md draft even though a usable signal was available:
1. dependabot and CI/workflow PRs whose only GitHub labels are github_actions,
dependencies, testsuite or doc were unmapped and fell through to (No Section).
2. Rebase-merged PRs land several commits under one PR number. The PR->label
write-back keyed a dict by PR number, so only one commit of such a PR received
the fetched label section; the other commits fell through to (No Section), and
a sibling commit's Client: trailer section could be overwritten.
3. JIRA tickets referenced by an in-range commit but carrying no component were
filed under (No Section) even though the commit's Client: trailer named the
correct section.
Changes to build/generate-changes.py:
- Map github_actions, dependencies, testsuite -> Build Process and doc ->
Documentation.
- Propagate a PR's labels to every section-less commit that shares the PR
number, and stop clobbering commits that already carry a Client: trailer
section.
- Fall back to the commit Client: trailer when a JIRA ticket has no usable
component.
On the current master draft, items 1 and 2 reduce the (No Section) list from 28
entries to 3 (the remaining three carry neither a label nor a Client: trailer,
e.g. CODEOWNERS edits). Item 3 (the Client: trailer fallback) does not change
today's output because every referenced ticket currently has a JIRA component;
it is a robustness change that prevents componentless tickets from landing in
(No Section), as happened in earlier drafts.
Where a PR carries both a CI label and a language label it is listed under both
sections (deduplicated).
Adds build/test_generate_changes.py with unit tests for the section-assignment
helpers (no network access required). flake8 excludes build/ and Thrift's
Python test suite lives under lib/py, so no CI job currently collects this
module; it is intended to be run directly (python3 -m unittest
build.test_generate_changes). No functional/library code is affected.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)