Skip to content

Commit

Permalink
chore: use towncrier for CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLauC committed Oct 7, 2023
1 parent e7c877a commit 9c4d1e4
Show file tree
Hide file tree
Showing 20 changed files with 86 additions and 77 deletions.
70 changes: 1 addition & 69 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,75 +1,7 @@
# Change Log

All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased] - ReleaseDate

### Fixed
- Fix `SigSet` incorrect implementation of `Eq`, `PartialEq` and `Hash`
([#1946](https://github.com/nix-rust/nix/pull/1946))

- Fixed the function signature of `recvmmsg`, potentially causing UB
([#2119](https://github.com/nix-rust/nix/issues/2119))
### Added

- Added `impl From<Signal> for SigSet`.
([#1959](https://github.com/nix-rust/nix/pull/1959))

- Added `impl std::ops::BitOr for SigSet`.
([#1959](https://github.com/nix-rust/nix/pull/1959))

- Added `impl std::ops::BitOr for Signal`.
([#1959](https://github.com/nix-rust/nix/pull/1959))

- Added `impl std::ops::BitOr<Signal> for SigSet`
([#1959](https://github.com/nix-rust/nix/pull/1959))

- Fix `SignalFd::set_mask`. In 0.27.0 it would actually close the file
descriptor.
([#2141](https://github.com/nix-rust/nix/pull/2141))

- Added `Icmp` and `IcmpV6` to `SockProtocol`.
(#[2103](https://github.com/nix-rust/nix/pull/2103))

- Added `F_GETPATH` FcntlFlags entry on Apple/NetBSD/DragonflyBSD for `::nix::fcntl`.
([#2142](https://github.com/nix-rust/nix/pull/2142))

- Added `Ipv6HopLimit` to `::nix::sys::socket::ControlMessage` for Linux,
MacOS, FreeBSD, DragonflyBSD, Android, iOS and Haiku.
([#2074](https://github.com/nix-rust/nix/pull/2074))

- Added `F_KINFO` FcntlFlags entry on FreeBSD for `::nix::fcntl`.
([#2152](https://github.com/nix-rust/nix/pull/2152))

### Changed

- The MSRV is now 1.69
([#2144](https://github.com/nix-rust/nix/pull/2144))

- The following APIs now take an implementation of `AsFd` rather than a
`RawFd`:

- `unistd::tcgetpgrp`
- `unistd::tcsetpgrp`
- `unistd::fpathconf`
- `unistd::ttyname`
- `unistd::getpeereid`

([#2137](https://github.com/nix-rust/nix/pull/2137))

- Changed `openat()` and `Dir::openat()`, now take optional `dirfd`s
([#2139](https://github.com/nix-rust/nix/pull/2139))

- `PollFd::new` now takes a `BorrowedFd` argument, with relaxed lifetime
requirements relative to the previous version.
([#2134](https://github.com/nix-rust/nix/pull/2134))

- `FdSet::{insert, remove, contains}` now take `BorrowedFd` arguments, and have
relaxed lifetime requirements relative to 0.27.1.
([#2136](https://github.com/nix-rust/nix/pull/2136))

- Simplified the function signatures of `recvmmsg` and `sendmmsg`
# Change Log

## [0.27.1] - 2023-08-28

Expand Down
27 changes: 23 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,30 @@ pull' model described there.
Please make pull requests against the `master` branch.

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

[cl]: https://github.com/nix-rust/nix/blob/master/CHANGELOG.md
[kacl]: https://github.com/olivierlacan/keep-a-changelog/tree/18adb5f5be7a898d046f6a4acb93e39dcf40c4ad
```
<PULL_REQUEST_ID>.<TYPE>.md
```

These are 4 `TYPE`s available:

1. `added`
2. `changed`
3. `fixed`
4. `removed`

Let's say you have added a new API to nix, then a change log like this should
be added (assume it is PR #0)

```md
# file: 0.added.md
Added a new API xxx
```

[cl]: https://github.com/nix-rust/nix/tree/master/changelog
[pr-docs]: https://help.github.com/articles/using-pull-requests/

## Testing
Expand Down
3 changes: 3 additions & 0 deletions RELEASE_PROCEDURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ The release is prepared as follows:

- Ask for a new libc version if, necessary. It usually is. Then update the
dependency in Cargo.toml accordingly.
- Update the version number in `Cargo.toml`
- Generate `CHANGELOG.md` for this release by
`towncrier build --version=<VERSION> --yes`
- Confirm that everything's ready for a release by running
`cargo release <patch|minor|major>`
- Create the release with `cargo release -x <patch|minor|major>`
Expand Down
5 changes: 5 additions & 0 deletions changelog/.keep
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Do not remove this file. This is used to keep the `changelog` dir around after
generating new changelog file.

Without this, `towncrier` would remove the changelog files as well as the
directory if it is empty.
1 change: 1 addition & 0 deletions changelog/1946.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix `SigSet` incorrect implementation of `Eq`, `PartialEq` and `Hash`
4 changes: 4 additions & 0 deletions changelog/1959.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Added `impl From<Signal> for SigSet`.
- Added `impl std::ops::BitOr for SigSet`.
- Added `impl std::ops::BitOr for Signal`.
- Added `impl std::ops::BitOr<Signal> for SigSet`
2 changes: 2 additions & 0 deletions changelog/2074.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Added `Ipv6HopLimit` to `::nix::sys::socket::ControlMessage` for Linux,
MacOS, FreeBSD, DragonflyBSD, Android, iOS and Haiku.
1 change: 1 addition & 0 deletions changelog/2103.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added `Icmp` and `IcmpV6` to `SockProtocol`
1 change: 1 addition & 0 deletions changelog/2119.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Simplified the function signatures of `recvmmsg` and `sendmmsg`
1 change: 1 addition & 0 deletions changelog/2119.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed the function signature of `recvmmsg`, potentially causing UB
2 changes: 2 additions & 0 deletions changelog/2134.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`PollFd::new` now takes a `BorrowedFd` argument, with relaxed lifetime
requirements relative to the previous version.
2 changes: 2 additions & 0 deletions changelog/2136.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
`FdSet::{insert, remove, contains}` now take `BorrowedFd` arguments, and have
relaxed lifetime requirements relative to 0.27.1.
8 changes: 8 additions & 0 deletions changelog/2137.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
The following APIs now take an implementation of `AsFd` rather than a
`RawFd`:

- `unistd::tcgetpgrp`
- `unistd::tcsetpgrp`
- `unistd::fpathconf`
- `unistd::ttyname`
- `unistd::getpeereid`
1 change: 1 addition & 0 deletions changelog/2139.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Changed `openat()` and `Dir::openat()`, now take optional `dirfd`s
1 change: 1 addition & 0 deletions changelog/2141.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix `SignalFd::set_mask`. In 0.27.0 it would actually close the file descriptor.
1 change: 1 addition & 0 deletions changelog/2142.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added `F_GETPATH` FcntlFlags entry on Apple/NetBSD/DragonflyBSD for `::nix::fcntl`.
1 change: 1 addition & 0 deletions changelog/2144.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The MSRV is now 1.69
1 change: 1 addition & 0 deletions changelog/2152.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added `F_KINFO` FcntlFlags entry on FreeBSD for `::nix::fcntl`.
4 changes: 0 additions & 4 deletions release.toml

This file was deleted.

27 changes: 27 additions & 0 deletions towncrier.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# towncrier configuration document:
# https://towncrier.readthedocs.io/en/stable/configuration.html

[tool.towncrier]
# Read news fragments from this directory
directory = "changelog"
# Concatenate fragments, and prepend to this file
filename = "CHANGELOG.md"
title_format = "## [{version}] - {project_date}"
# Used to disable towncrier's "=====" title header
underlines = ["", "", ""]
# Wrap news fragments to a line length of 79
wrap = true
# Every news fragement under the `changelog` directory is named "<id>.<type>.md",
# this `id` field, is called issue/ticket number in towncrier's term
# `issue_format` controls how this will be rendered in the final CHANGELOG
# We use this for Pull Request even though it is called "issue"
issue_format = "[#{issue}](https://github.com/nix-rust/nix/pull/{issue})"
# Ask towncrier to add new notes after this
start_string = "# Change Log\n"

# nix's change log typs (in alphabetical order)
# These types will be capitalized by default.
[tool.towncrier.fragment.added]
[tool.towncrier.fragment.changed]
[tool.towncrier.fragment.fixed]
[tool.towncrier.fragment.removed]

0 comments on commit 9c4d1e4

Please sign in to comment.