Skip to content

Commit b28132b

Browse files
authored
chore: use towncrier for CHANGELOG (#2149)
1 parent e7c877a commit b28132b

20 files changed

+86
-77
lines changed

CHANGELOG.md

+1-69
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,7 @@
1-
# Change Log
2-
31
All notable changes to this project will be documented in this file.
42
This project adheres to [Semantic Versioning](https://semver.org/).
53

6-
## [Unreleased] - ReleaseDate
7-
8-
### Fixed
9-
- Fix `SigSet` incorrect implementation of `Eq`, `PartialEq` and `Hash`
10-
([#1946](https://github.com/nix-rust/nix/pull/1946))
11-
12-
- Fixed the function signature of `recvmmsg`, potentially causing UB
13-
([#2119](https://github.com/nix-rust/nix/issues/2119))
14-
### Added
15-
16-
- Added `impl From<Signal> for SigSet`.
17-
([#1959](https://github.com/nix-rust/nix/pull/1959))
18-
19-
- Added `impl std::ops::BitOr for SigSet`.
20-
([#1959](https://github.com/nix-rust/nix/pull/1959))
21-
22-
- Added `impl std::ops::BitOr for Signal`.
23-
([#1959](https://github.com/nix-rust/nix/pull/1959))
24-
25-
- Added `impl std::ops::BitOr<Signal> for SigSet`
26-
([#1959](https://github.com/nix-rust/nix/pull/1959))
27-
28-
- Fix `SignalFd::set_mask`. In 0.27.0 it would actually close the file
29-
descriptor.
30-
([#2141](https://github.com/nix-rust/nix/pull/2141))
31-
32-
- Added `Icmp` and `IcmpV6` to `SockProtocol`.
33-
(#[2103](https://github.com/nix-rust/nix/pull/2103))
34-
35-
- Added `F_GETPATH` FcntlFlags entry on Apple/NetBSD/DragonflyBSD for `::nix::fcntl`.
36-
([#2142](https://github.com/nix-rust/nix/pull/2142))
37-
38-
- Added `Ipv6HopLimit` to `::nix::sys::socket::ControlMessage` for Linux,
39-
MacOS, FreeBSD, DragonflyBSD, Android, iOS and Haiku.
40-
([#2074](https://github.com/nix-rust/nix/pull/2074))
41-
42-
- Added `F_KINFO` FcntlFlags entry on FreeBSD for `::nix::fcntl`.
43-
([#2152](https://github.com/nix-rust/nix/pull/2152))
44-
45-
### Changed
46-
47-
- The MSRV is now 1.69
48-
([#2144](https://github.com/nix-rust/nix/pull/2144))
49-
50-
- The following APIs now take an implementation of `AsFd` rather than a
51-
`RawFd`:
52-
53-
- `unistd::tcgetpgrp`
54-
- `unistd::tcsetpgrp`
55-
- `unistd::fpathconf`
56-
- `unistd::ttyname`
57-
- `unistd::getpeereid`
58-
59-
([#2137](https://github.com/nix-rust/nix/pull/2137))
60-
61-
- Changed `openat()` and `Dir::openat()`, now take optional `dirfd`s
62-
([#2139](https://github.com/nix-rust/nix/pull/2139))
63-
64-
- `PollFd::new` now takes a `BorrowedFd` argument, with relaxed lifetime
65-
requirements relative to the previous version.
66-
([#2134](https://github.com/nix-rust/nix/pull/2134))
67-
68-
- `FdSet::{insert, remove, contains}` now take `BorrowedFd` arguments, and have
69-
relaxed lifetime requirements relative to 0.27.1.
70-
([#2136](https://github.com/nix-rust/nix/pull/2136))
71-
72-
- Simplified the function signatures of `recvmmsg` and `sendmmsg`
4+
# Change Log
735

746
## [0.27.1] - 2023-08-28
757

CONTRIBUTING.md

+23-4
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,30 @@ pull' model described there.
6161
Please make pull requests against the `master` branch.
6262

6363
If you change the API by way of adding, removing or changing something or if
64-
you fix a bug, please add an appropriate note to the [change log][cl]. We
65-
follow the conventions of [Keep A CHANGELOG][kacl].
64+
you fix a bug, please add an appropriate note, every note should be a new markdown
65+
file under the [changelog directory][cl] stating the change made by your pull request,
66+
the filename should be in the following foramt:
6667

67-
[cl]: https://github.com/nix-rust/nix/blob/master/CHANGELOG.md
68-
[kacl]: https://github.com/olivierlacan/keep-a-changelog/tree/18adb5f5be7a898d046f6a4acb93e39dcf40c4ad
68+
```
69+
<PULL_REQUEST_ID>.<TYPE>.md
70+
```
71+
72+
These are 4 `TYPE`s available:
73+
74+
1. `added`
75+
2. `changed`
76+
3. `fixed`
77+
4. `removed`
78+
79+
Let's say you have added a new API to nix, then a change log like this should
80+
be added (assume it is PR #0)
81+
82+
```md
83+
# file: 0.added.md
84+
Added a new API xxx
85+
```
86+
87+
[cl]: https://github.com/nix-rust/nix/tree/master/changelog
6988
[pr-docs]: https://help.github.com/articles/using-pull-requests/
7089

7190
## Testing

RELEASE_PROCEDURE.md

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ The release is prepared as follows:
1313

1414
- Ask for a new libc version if, necessary. It usually is. Then update the
1515
dependency in Cargo.toml accordingly.
16+
- Update the version number in `Cargo.toml`
17+
- Generate `CHANGELOG.md` for this release by
18+
`towncrier build --version=<VERSION> --yes`
1619
- Confirm that everything's ready for a release by running
1720
`cargo release <patch|minor|major>`
1821
- Create the release with `cargo release -x <patch|minor|major>`

changelog/.keep

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Do not remove this file. This is used to keep the `changelog` dir around after
2+
generating new changelog file.
3+
4+
Without this, `towncrier` would remove the changelog files as well as the
5+
directory if it is empty.

changelog/1946.fixed.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix `SigSet` incorrect implementation of `Eq`, `PartialEq` and `Hash`

changelog/1959.added.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- Added `impl From<Signal> for SigSet`.
2+
- Added `impl std::ops::BitOr for SigSet`.
3+
- Added `impl std::ops::BitOr for Signal`.
4+
- Added `impl std::ops::BitOr<Signal> for SigSet`

changelog/2074.added.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Added `Ipv6HopLimit` to `::nix::sys::socket::ControlMessage` for Linux,
2+
MacOS, FreeBSD, DragonflyBSD, Android, iOS and Haiku.

changelog/2103.added.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added `Icmp` and `IcmpV6` to `SockProtocol`

changelog/2119.changed.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Simplified the function signatures of `recvmmsg` and `sendmmsg`

changelog/2119.fixed.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed the function signature of `recvmmsg`, potentially causing UB

changelog/2134.changed.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
`PollFd::new` now takes a `BorrowedFd` argument, with relaxed lifetime
2+
requirements relative to the previous version.

changelog/2136.changed.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
`FdSet::{insert, remove, contains}` now take `BorrowedFd` arguments, and have
2+
relaxed lifetime requirements relative to 0.27.1.

changelog/2137.changed.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The following APIs now take an implementation of `AsFd` rather than a
2+
`RawFd`:
3+
4+
- `unistd::tcgetpgrp`
5+
- `unistd::tcsetpgrp`
6+
- `unistd::fpathconf`
7+
- `unistd::ttyname`
8+
- `unistd::getpeereid`

changelog/2139.changed.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Changed `openat()` and `Dir::openat()`, now take optional `dirfd`s

changelog/2141.fixed.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix `SignalFd::set_mask`. In 0.27.0 it would actually close the file descriptor.

changelog/2142.added.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added `F_GETPATH` FcntlFlags entry on Apple/NetBSD/DragonflyBSD for `::nix::fcntl`.

changelog/2144.changed.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The MSRV is now 1.69

changelog/2152.added.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added `F_KINFO` FcntlFlags entry on FreeBSD for `::nix::fcntl`.

release.toml

-4
This file was deleted.

towncrier.toml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# towncrier configuration document:
2+
# https://towncrier.readthedocs.io/en/stable/configuration.html
3+
4+
[tool.towncrier]
5+
# Read news fragments from this directory
6+
directory = "changelog"
7+
# Concatenate fragments, and prepend to this file
8+
filename = "CHANGELOG.md"
9+
title_format = "## [{version}] - {project_date}"
10+
# Used to disable towncrier's "=====" title header
11+
underlines = ["", "", ""]
12+
# Wrap news fragments to a line length of 79
13+
wrap = true
14+
# Every news fragement under the `changelog` directory is named "<id>.<type>.md",
15+
# this `id` field, is called issue/ticket number in towncrier's term
16+
# `issue_format` controls how this will be rendered in the final CHANGELOG
17+
# We use this for Pull Request even though it is called "issue"
18+
issue_format = "[#{issue}](https://github.com/nix-rust/nix/pull/{issue})"
19+
# Ask towncrier to add new notes after this
20+
start_string = "# Change Log\n"
21+
22+
# nix's change log typs (in alphabetical order)
23+
# These types will be capitalized by default.
24+
[tool.towncrier.fragment.added]
25+
[tool.towncrier.fragment.changed]
26+
[tool.towncrier.fragment.fixed]
27+
[tool.towncrier.fragment.removed]

0 commit comments

Comments
 (0)