11# changelist
22
3- Prepare an automatic changelog from GitHub pull requests.
3+ Changelist helps you write better release notes by automating as much of the
4+ process as possible. For example, see
5+ https://github.com/scientific-python/changelist/blob/main/CHANGELOG.md .
6+
7+ ** Features**
8+
9+ - Compile a list of pull requests, code authors and reviewers between any two
10+ valid Git objects (refs).
11+ - Categorize pull requests into sections based on GitHub labels.
12+ - Point it at any repository on GitHub. No need to clone or checkout a
13+ repository locally, a Python package is all that's needed.
14+
15+ We recommend to treat the generated document as a first draft to build
16+ on and not as an already perfect documentation of the release.
417
518_ This project is currently in its alpha stage and might be incomplete or change a lot!_
619
@@ -10,26 +23,101 @@ _This project is currently in its alpha stage and might be incomplete or change
1023pip install changelist
1124```
1225
13- ## Set up your repository
26+ ## Usage
27+
28+ The script requires a [ GitHub personal access
29+ token] ( https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens ) .
30+ The token does not need any permissions, since it is used only to
31+ increase query limits.
32+
33+ ``` sh
34+ export GH_TOKEN=' ...'
35+ changelist scientific-python/changelist v0.2.0 main
36+ ```
1437
15- To categorize merged PRs in the changelist, each PR
16- must have have one of the following labels:
38+ This will list all pull requests, authors and reviewers that touched commits
39+ between ` v0.2.0 ` and ` main ` (excluding ` v0.2.0 ` ).
40+ Pull requests are sorted into section according to the configuration in
41+ ` tool.changelist.label_section_map ` .
42+
43+ ## Configuration
44+
45+ changelist can be configured from two sources, in order of precedence:
46+
47+ - A local TOML file specified with the ` --config ` option
48+ - A remote ` pyproject.toml ` at ` stop_rev `
49+
50+ If a configuration option is not specified in either file above, changelist
51+ falls back to the following configuration:
52+
53+ ```` toml
54+ # Default changelist configuration as supported in pyproject.toml
55+ [tool .changelist ]
56+
57+ # A template string that is included as the title of the generated notes.
58+ # "{repo_name}" and "{version}", if given, are replaced by the respective
59+ # values given in the command line.
60+ title_template = " {repo_name} {version}"
61+
62+ # A template string that is included as introductory text after the title.
63+ # "{repo_name}" and "{version}", if given, are replaced by the respective
64+ # values given in the command line.
65+ intro_template = """
66+ We're happy to announce the release of {repo_name} {version}!
67+ """
68+
69+ # A template string that is included at the end of the generated notes.
70+ # "{repo_name}" and "{version}", if given, are replaced by the respective
71+ # values given in the command line.
72+ outro_template = """
73+ _These lists are automatically generated, and may not be complete or may contain
74+ duplicates._
75+ """
76+
77+ # Profiles that are excluded from the contributor list.
78+ ignored_user_logins = [
79+ " web-flow" ,
80+ ]
81+
82+ # If this regex matches a pull requests description, the captured content
83+ # is included instead of the pull request title.
84+ # E.g. the default regex below is matched by
85+ #
86+ # ```release-note
87+ # An ideally expressive description of the change that is included as a single
88+ # bullet point. Newlines are removed.
89+ # ```
90+ #
91+ # If you modify this regex, make sure to match the content with a capture
92+ # group named "summary".
93+ pr_summary_regex = " ^```release-note\\ s*(?P<summary>[\\ s\\ S]*?\\ w[\\ s\\ S]*?)\\ s*^```"
94+
95+ # If any of a pull request's labels matches one of the regexes on the left side
96+ # its summary will appear in the appropriate section with the title given on
97+ # the right side. If a pull request doesn't match one of these categories it is
98+ # sorted into a section titled "Other". Pull request can appear in multiple
99+ # sections as long as their labels match.
100+ [tool .changelist .label_section_map ]
101+ ".*Highlight.*" = " Highlights"
102+ ".*New feature.*" = " New Features"
103+ ".*API.*" = " API Changes"
104+ ".*Enhancement.*" = " Enhancements"
105+ ".*Performance.*" = " Performance"
106+ ".*Bug fix.*" = " Bug Fixes"
107+ ".*Documentation.*" = " Documentation"
108+ ".*Infrastructure.*" = " Infrastructure"
109+ ".*Maintenance.*" = " Maintenance"
110+ ````
17111
18- - ` type: Highlights `
19- - ` type: New features `
20- - ` type: Enhancements `
21- - ` type: Performance `
22- - ` type: Bug fix `
23- - ` type: API `
24- - ` type: Maintenance `
25- - ` type: Documentation `
26- - ` type: Infrastructure `
112+ ## Set up your repository
27113
28- This list will soon be configurable.
114+ To categorize merged PRs in the changelist with the default configuration, each
115+ PR must have a label that matches one of the regexes on the left side of the
116+ ` label_section_map ` table, e.g. ` type: Highlights ` .
29117
30118### Label checking
31119
32- To ensure that each PR has an associated ` type: ` label,
120+ You may want to ensure that each PR has an associated ` type: ` label,
33121we recommend adding an action that fails CI if the label is missing.
34122
35123To do so, place the following in ` .github/workflows/label-check.yaml ` :
41129 pull_request :
42130 types :
43131 - opened
132+ - repoened
44133 - labeled
45134 - unlabeled
135+ - synchronize
46136
47137env :
48138 LABELS : ${{ join( github.event.pull_request.labels.*.name, ' ' ) }}
@@ -79,22 +169,10 @@ jobs:
79169 name: attach to PR
80170 runs-on: ubuntu-latest
81171 steps:
82- - uses: scientific-python/attach-next-milestone-action@f94a5235518d4d34911c41e19d780b8e79d42238
172+ - uses: scientific-python/attach-next-milestone-action@bc07be829f693829263e57d5e8489f4e57d3d420
83173 with:
84174 token: ${{ secrets.MILESTONE_LABELER_TOKEN }}
85175 force: true
86176` ` `
87177
88178See https://github.com/scientific-python/attach-next-milestone-action for more information.
89-
90- # # Usage
91-
92- ` ` ` sh
93- export GH_TOKEN='...'
94- changelist scikit-image/scikit-image v0.21.0 main
95- ` ` `
96-
97- The script requires a [GitHub personal access
98- token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).
99- The token does not need any permissions, since it is used only to
100- increase query limits.
0 commit comments