Repository: DeterminateSystems/nix-src
Pull request #41: Generate release notes when proposing a release, clean up templates
Author: login: grahamc
Created: 2025-04-27T21:21:20Z | Merged: 2025-04-29T15:58:07Z

## Motivation

The first bit is automating the generation of, at minimum, draft release notes / changes for the release proposal process.

Example diff: https://github.com/DeterminateSystems/nix-src/pull/43

...

but more fleshed out, the `rl-...` file looks like this:

> # Release 3.5.0 (2025-04-27)
> 
> * Based on [upstream Nix 2.28.2](../release-notes/rl-2.28.md).
> 
> ## What's Changed
> * Sync with upstream 2.28.2 by @edolstra in [dnix#31](https://github.com/DeterminateSystems/nix-src/pull/31)
> * Improve the "dirty" message, by clarifying what the jargon means by @grahamc in [dnix#32](https://github.com/DeterminateSystems/nix-src/pull/32)
> * Hide the "dirty" notice when running nix develop by @grahamc in [dnix#33](https://github.com/DeterminateSystems/nix-src/pull/33)
> * Emit a warning about channel deprecation. by @grahamc in [dnix#35](https://github.com/DeterminateSystems/nix-src/pull/35)
> * Warn about the use of channel URLs by @edolstra in [dnix#36](https://github.com/DeterminateSystems/nix-src/pull/36)
> * Warn against the use of indirect flakerefs in flake inputs by @edolstra in [dnix#38](https://github.com/DeterminateSystems/nix-src/pull/38)
> * Prep 3.4.0 release notes by @grahamc in [dnix#40](https://github.com/DeterminateSystems/nix-src/pull/40)
> * Release v3.4.0 by @github-actions in [dnix#39](https://github.com/DeterminateSystems/nix-src/pull/39)
> 
> 
> **Full Changelog**: [v3.3.1...v3.5.0](https://github.com/DeterminateSystems/nix-src/compare/v3.3.1...v3.5.0)


...the changes.md looks ilke this:

> * Warnings around "dirty trees" are updated to reduce "dirty" jargon, and now refers to "uncommitted changes".
> 
> <!-- Determinate Nix version 3.5.0 -->
> 
> * Sync with upstream 2.28.2 by @edolstra in [dnix#31](https://github.com/DeterminateSystems/nix-src/pull/31)
> 
> * Improve the "dirty" message, by clarifying what the jargon means by @grahamc in [dnix#32](https://github.com/DeterminateSystems/nix-src/pull/32)
> 
> * Hide the "dirty" notice when running nix develop by @grahamc in [dnix#33](https://github.com/DeterminateSystems/nix-src/pull/33)
> 
> * Emit a warning about channel deprecation. by @grahamc in [dnix#35](https://github.com/DeterminateSystems/nix-src/pull/35)
> 
> * Warn about the use of channel URLs by @edolstra in [dnix#36](https://github.com/DeterminateSystems/nix-src/pull/36)
> 
> * Warn against the use of indirect flakerefs in flake inputs by @edolstra in [dnix#38](https://github.com/DeterminateSystems/nix-src/pull/38)
> 
> * Prep 3.4.0 release notes by @grahamc in [dnix#40](https://github.com/DeterminateSystems/nix-src/pull/40)
>

---

the second bit is cleaning up the issue / pr template code to be about Determinate Nix, and not errantly refer to upstream.



Diff:
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
deleted file mode 100644
index a9ca74c17cc9..000000000000
--- a/.github/CODEOWNERS
+++ /dev/null
@@ -1,26 +0,0 @@
-# Pull requests concerning the listed files will automatically invite the respective maintainers as reviewers.
-# This file is not used for denoting any kind of ownership, but is merely a tool for handling notifications.
-#
-# Merge permissions are required for maintaining an entry in this file.
-# For documentation on this mechanism, see https://help.github.com/articles/about-codeowners/
-
-# Default reviewers if nothing else matches
-* @edolstra
-
-# This file
-.github/CODEOWNERS @edolstra
-
-# Documentation of built-in functions
-src/libexpr/primops.cc @roberth @fricklerhandwerk
-
-# Documentation of settings
-src/libexpr/eval-settings.hh @fricklerhandwerk
-src/libstore/globals.hh @fricklerhandwerk
-
-# Documentation
-doc/manual @fricklerhandwerk
-maintainers/*.md @fricklerhandwerk
-src/**/*.md @fricklerhandwerk
-
-# Libstore layer
-/src/libstore @ericson2314
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index a5005f8a002e..58ef1690feb6 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -1,10 +1,9 @@
 ---
 name: Bug report
 about: Report unexpected or incorrect behaviour
-title: ''
+title: ""
 labels: bug
-assignees: ''
-
+assignees: ""
 ---
 
 ## Describe the bug
@@ -32,7 +31,9 @@ assignees: ''
 
 ## Metadata
 
-<!-- Please insert the output of running `nix-env --version` below this line -->
+<!-- Please insert the output of running `determinate-nixd version` below this line -->
+
+<!-- Please insert the output of running `nix --version` below this line -->
 
 ## Additional context
 
@@ -42,13 +43,9 @@ assignees: ''
 
 <!-- make sure this issue is not redundant or obsolete -->
 
-- [ ] checked [latest Nix manual] \([source])
+- [ ] checked [latest Determinate Nix manual] \([source])
 - [ ] checked [open bug issues and pull requests] for possible duplicates
 
-[latest Nix manual]: https://nixos.org/manual/nix/unstable/
-[source]: https://github.com/NixOS/nix/tree/master/doc/manual/source
-[open bug issues and pull requests]: https://github.com/NixOS/nix/labels/bug
-
----
-
-Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
+[latest Determinate Nix manual]: https://manual.determinate.systems/
+[source]: https://github.com/DeterminateSystems/nix-src/tree/detsys-main/doc/manual/source
+[open bug issues and pull requests]: https://github.com/DeterminateSystems/nix-src/labels/bug
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index c75a46951704..345a05c533e5 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -1,10 +1,9 @@
 ---
 name: Feature request
 about: Suggest a new feature
-title: ''
+title: ""
 labels: feature
-assignees: ''
-
+assignees: ""
 ---
 
 ## Is your feature request related to a problem?
@@ -27,13 +26,9 @@ assignees: ''
 
 <!-- make sure this issue is not redundant or obsolete -->
 
-- [ ] checked [latest Nix manual] \([source])
-- [ ] checked [open feature issues and pull requests] for possible duplicates
-
-[latest Nix manual]: https://nixos.org/manual/nix/unstable/
-[source]: https://github.com/NixOS/nix/tree/master/doc/manual/source
-[open feature issues and pull requests]: https://github.com/NixOS/nix/labels/feature
-
----
+- [ ] checked [latest Determinate Nix manual] \([source])
+- [ ] checked [open bug issues and pull requests] for possible duplicates
 
-Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
+[latest Determinate Nix manual]: https://manual.determinate.systems/
+[source]: https://github.com/DeterminateSystems/nix-src/tree/detsys-main/doc/manual/source
+[open bug issues and pull requests]: https://github.com/DeterminateSystems/nix-src/labels/bug
diff --git a/.github/ISSUE_TEMPLATE/installer.md b/.github/ISSUE_TEMPLATE/installer.md
index ed5e1ce87b9f..9bf6541c78e2 100644
--- a/.github/ISSUE_TEMPLATE/installer.md
+++ b/.github/ISSUE_TEMPLATE/installer.md
@@ -1,18 +1,17 @@
 ---
 name: Installer issue
 about: Report problems with installation
-title: ''
+title: ""
 labels: installer
-assignees: ''
-
+assignees: ""
 ---
 
 ## Platform
 
-<!-- select the platform on which you tried to install Nix -->
+<!-- select the platform on which you tried to install Determinate Nix -->
 
-- [ ] Linux: <!-- state your distribution, e.g. Arch Linux, Ubuntu, ... -->
 - [ ] macOS
+- [ ] Linux: <!-- state your distribution, e.g. Arch Linux, Ubuntu, ... -->
 - [ ] WSL
 
 ## Additional information
@@ -35,13 +34,9 @@ assignees: ''
 
 <!-- make sure this issue is not redundant or obsolete -->
 
-- [ ] checked [latest Nix manual] \([source])
-- [ ] checked [open installer issues and pull requests] for possible duplicates
-
-[latest Nix manual]: https://nixos.org/manual/nix/unstable/
-[source]: https://github.com/NixOS/nix/tree/master/doc/manual/source
-[open installer issues and pull requests]: https://github.com/NixOS/nix/labels/installer
-
----
+- [ ] checked [latest Determinate Nix manual] \([source])
+- [ ] checked [open bug issues and pull requests] for possible duplicates
 
-Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
+[latest Determinate Nix manual]: https://manual.determinate.systems/
+[source]: https://github.com/DeterminateSystems/nix-src/tree/detsys-main/doc/manual/source
+[open bug issues and pull requests]: https://github.com/DeterminateSystems/nix-src/labels/bug
diff --git a/.github/ISSUE_TEMPLATE/missing_documentation.md b/.github/ISSUE_TEMPLATE/missing_documentation.md
index 6c334b722069..eaa6b11709aa 100644
--- a/.github/ISSUE_TEMPLATE/missing_documentation.md
+++ b/.github/ISSUE_TEMPLATE/missing_documentation.md
@@ -1,10 +1,9 @@
 ---
 name: Missing or incorrect documentation
 about: Help us improve the reference manual
-title: ''
+title: ""
 labels: documentation
-assignees: ''
-
+assignees: ""
 ---
 
 ## Problem
@@ -19,13 +18,9 @@ assignees: ''
 
 <!-- make sure this issue is not redundant or obsolete -->
 
-- [ ] checked [latest Nix manual] \([source])
-- [ ] checked [open documentation issues and pull requests] for possible duplicates
-
-[latest Nix manual]: https://nixos.org/manual/nix/unstable/
-[source]: https://github.com/NixOS/nix/tree/master/doc/manual/source
-[open documentation issues and pull requests]: https://github.com/NixOS/nix/labels/documentation
-
----
+- [ ] checked [latest Determinate Nix manual] \([source])
+- [ ] checked [open bug issues and pull requests] for possible duplicates
 
-Add :+1: to [issues you find important](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).
+[latest Determinate Nix manual]: https://manual.determinate.systems/
+[source]: https://github.com/DeterminateSystems/nix-src/tree/detsys-main/doc/manual/source
+[open bug issues and pull requests]: https://github.com/DeterminateSystems/nix-src/labels/bug
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index c6843d86fa7e..d3e1f8177364 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -1,22 +1,3 @@
-<!--
-
-IMPORTANT
-
-Nix is a non-trivial project, so for your contribution to be successful,
-it really is important to follow the contributing guidelines:
-
-https://github.com/NixOS/nix/blob/master/CONTRIBUTING.md
-
-Even if you've contributed to open source before, take a moment to read it,
-so you understand the process and the expectations.
-
-- what information to include in commit messages
-- proper attribution
-- volunteering contributions effectively
-- how to get help and our review process.
-
--->
-
 ## Motivation
 
 <!-- Briefly explain what the change is about and why it is desirable. -->
@@ -30,9 +11,3 @@ so you understand the process and the expectations.
 <!-- Invasive change: Discuss alternative designs or approaches you considered. -->
 
 <!-- Large change: Provide instructions to reviewers how to read the diff. -->
-
----
-
-Add :+1: to [pull requests you find important](https://github.com/NixOS/nix/pulls?q=is%3Aopen+sort%3Areactions-%2B1-desc).
-
-The Nix maintainer team uses a [GitHub project board](https://github.com/orgs/NixOS/projects/19) to [schedule and track reviews](https://github.com/NixOS/nix/tree/master/maintainers#project-board-protocol). 
diff --git a/.github/STALE-BOT.md b/.github/STALE-BOT.md
index 383717bfc1d9..281d0f79a8b7 100644
--- a/.github/STALE-BOT.md
+++ b/.github/STALE-BOT.md
@@ -2,34 +2,21 @@
 
 - Thanks for your contribution!
 - To remove the stale label, just leave a new comment.
-- _How to find the right people to ping?_ &rarr; [`git blame`](https://git-scm.com/docs/git-blame) to the rescue! (or GitHub's history and blame buttons.)
-- You can always ask for help on [our Discourse Forum](https://discourse.nixos.org/) or on [Matrix - #nix:nixos.org](https://matrix.to/#/#nix:nixos.org).
+- You can always ask for help on [Discord](https://determinate.systems/discord).
 
 ## Suggestions for PRs
 
-1. GitHub sometimes doesn't notify people who commented / reviewed a PR previously, when you (force) push commits. If you have addressed the reviews you can [officially ask for a review](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/requesting-a-pull-request-review) from those who commented to you or anyone else.
-2. If it is unfinished but you plan to finish it, please mark it as a draft.
-3. If you don't expect to work on it any time soon, closing it with a short comment may encourage someone else to pick up your work.
-4. To get things rolling again, rebase the PR against the target branch and address valid comments.
-5. If you need a review to move forward, ask in [the Discourse thread for PRs that need help](https://discourse.nixos.org/t/prs-in-distress/3604).
-6. If all you need is a merge, check the git history to find and [request reviews](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/requesting-a-pull-request-review) from people who usually merge related contributions.
+1. If it is unfinished but you plan to finish it, please mark it as a draft.
+1. If you don't expect to work on it any time soon, closing it with a short comment may encourage someone else to pick up your work.
+1. To get things rolling again, rebase the PR against the target branch and address valid comments.
+1. If you need a review to move forward, ask in [Discord](https://determinate.systems/discord).
 
 ## Suggestions for issues
 
 1. If it is resolved (either for you personally, or in general), please consider closing it.
 2. If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough.
-3. If you still have interest in resolving it, try to ping somebody who you believe might have an interest in the topic. Consider discussing the problem in [our Discourse Forum](https://discourse.nixos.org/).
-4. As with all open source projects, your best option is to submit a Pull Request that addresses this issue. We :heart: this attitude!
+3. If you still have interest in resolving it, try to ping somebody who you believe might have an interest in the topic. Consider discussing the problem in [Discord](https://determinate.systems/discord).
 
 **Memorandum on closing issues**
 
 Don't be afraid to close an issue that holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen--nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.
-
-## Useful GitHub search queries
-
-- [Open PRs with any stale-bot interaction](https://github.com/NixOS/nix/pulls?q=is%3Apr+is%3Aopen+commenter%3Aapp%2Fstale+)
-- [Open PRs with any stale-bot interaction and `stale`](https://github.com/NixOS/nix/pulls?q=is%3Apr+is%3Aopen+commenter%3Aapp%2Fstale+label%3A%22stale%22)
-- [Open PRs with any stale-bot interaction and NOT `stale`](https://github.com/NixOS/nix/pulls?q=is%3Apr+is%3Aopen+commenter%3Aapp%2Fstale+-label%3A%22stale%22+)
-- [Open Issues with any stale-bot interaction](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+commenter%3Aapp%2Fstale+)
-- [Open Issues with any stale-bot interaction and `stale`](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+commenter%3Aapp%2Fstale+label%3A%22stale%22+)
-- [Open Issues with any stale-bot interaction and NOT `stale`](https://github.com/NixOS/nix/issues?q=is%3Aissue+is%3Aopen+commenter%3Aapp%2Fstale+-label%3A%22stale%22+)
diff --git a/.github/release-notes.sh b/.github/release-notes.sh
new file mode 100755
index 000000000000..3fe3f6b17b2d
--- /dev/null
+++ b/.github/release-notes.sh
@@ -0,0 +1,68 @@
+#!/usr/bin/env bash
+
+# SC2002 disables "useless cat" warnings.
+# I prefer pipelines that start with an explicit input, and go from there.
+# Overly fussy.
+# shellcheck disable=SC2002
+
+scratch=$(mktemp -d -t tmp.XXXXXXXXXX)
+finish() {
+  rm -rf "$scratch"
+}
+trap finish EXIT
+
+DATE=$(date +%Y-%m-%d)
+DETERMINATE_NIX_VERSION=$(cat .version-determinate)
+TAG_NAME="v${DETERMINATE_NIX_VERSION}"
+NIX_VERSION=$(cat .version)
+NIX_VERSION_MAJOR_MINOR=$(echo "$NIX_VERSION" | cut -d. -f1,2)
+GITHUB_REPOSITORY="${GITHUB_REPOSITORY:-DeterminateSystems/nix-src}"
+
+gh api "/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \
+        -f "tag_name=${TAG_NAME}" > "$scratch/notes.json"
+
+trim_trailing_newlines() {
+    local text
+    text="$(cat)"
+    echo -n "${text//$'\n'}"
+}
+
+linkify_gh() {
+    sed \
+        -e 's!\(https://github.com/DeterminateSystems/nix-src/\(pull\|issue\)/\([[:digit:]]\+\)\)![DeterminateSystems/nix-src#\3](\1)!' \
+        -e 's#\(https://github.com/DeterminateSystems/nix-src/compare/\([^ ]\+\)\)#[\2](\1)#'
+}
+
+(
+    cat doc/manual/source/release-notes-determinate/changes.md \
+        | sed 's/^.*\(<!-- differences -->\)$/This section lists the differences between upstream Nix '"$NIX_VERSION_MAJOR_MINOR"' and Determinate Nix '"$DETERMINATE_NIX_VERSION"'.\1/' \
+
+    printf "\n<!-- Determinate Nix version %s -->\n" "$DETERMINATE_NIX_VERSION"
+    cat "$scratch/notes.json" \
+        | jq -r .body \
+        | grep -v '^#' \
+        | grep -v "Full Changelog" \
+        | trim_trailing_newlines \
+        | sed -e 's/^\* /\n* /' \
+        | linkify_gh
+) > "$scratch/changes.md"
+
+(
+    printf "# Release %s (%s)\n\n" \
+        "$DETERMINATE_NIX_VERSION" \
+        "$DATE"
+    printf "* Based on [upstream Nix %s](../release-notes/rl-%s.md).\n\n" \
+        "$NIX_VERSION" \
+        "$NIX_VERSION_MAJOR_MINOR"
+
+    cat "$scratch/notes.json" | jq -r .body | linkify_gh
+) > "$scratch/rl.md"
+
+(
+    cat doc/manual/source/SUMMARY.md.in \
+        | sed 's/\(<!-- next -->\)$/\1\n  - [Release '"$DETERMINATE_NIX_VERSION"' ('"$DATE"')](release-notes-determinate\/rl-'"$DETERMINATE_NIX_VERSION"'.md)/'
+) > "$scratch/summary.md"
+
+mv "$scratch/changes.md" doc/manual/source/release-notes-determinate/changes.md
+mv "$scratch/rl.md" "doc/manual/source/release-notes-determinate/rl-${DETERMINATE_NIX_VERSION}.md"
+mv "$scratch/summary.md" doc/manual/source/SUMMARY.md.in
diff --git a/.github/workflows/propose-release.yml b/.github/workflows/propose-release.yml
index 8b897072cc77..c01167994f22 100644
--- a/.github/workflows/propose-release.yml
+++ b/.github/workflows/propose-release.yml
@@ -26,4 +26,6 @@ jobs:
       extra-commands-early: |
         echo ${{ inputs.version }} > .version-determinate
         git add .version-determinate
+        ./.github/release-notes.sh
+        git add doc
         git commit -m "Set .version-determinate to ${{ inputs.version }}" || true
diff --git a/doc/manual/source/SUMMARY.md.in b/doc/manual/source/SUMMARY.md.in
index 1492abb62d9d..8cce1113c323 100644
--- a/doc/manual/source/SUMMARY.md.in
+++ b/doc/manual/source/SUMMARY.md.in
@@ -127,7 +127,7 @@
   - [Experimental Features](development/experimental-features.md)
   - [Contributing](development/contributing.md)
 - [Determinate Nix Release Notes](release-notes-determinate/index.md)
-  - [Changes between Nix and Determinate Nix](release-notes-determinate/changes.md)
+  - [Changes between Nix and Determinate Nix](release-notes-determinate/changes.md)<!-- next -->
   - [Release 3.4.0 (2025-04-25)](release-notes-determinate/rl-3.4.0.md)
   - [Release 3.3.0 (2025-04-11)](release-notes-determinate/rl-3.3.0.md)
   - [Release 3.1.0 (2025-03-27)](release-notes-determinate/rl-3.1.0.md)
diff --git a/doc/manual/source/release-notes-determinate/changes.md b/doc/manual/source/release-notes-determinate/changes.md
index f0cc1af54636..5816ef87157a 100644
--- a/doc/manual/source/release-notes-determinate/changes.md
+++ b/doc/manual/source/release-notes-determinate/changes.md
@@ -1,6 +1,6 @@
 # Changes between Nix and Determinate Nix
 
-This section lists the differences between upstream Nix 2.24 and Determinate Nix 3.4.0.
+This section lists the differences between upstream Nix 2.24 and Determinate Nix 3.4.0.<!-- differences -->
 
 * In Determinate Nix, flakes are stable. You no longer need to enable the `flakes` experimental feature.
 


Reviews:
user: login: grahamc
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-27T21:40:45Z
user: login: gustavderdrache
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-28T13:02:27Z
user: login: gustavderdrache
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-28T13:04:54Z
user: login: grahamc
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-28T14:30:01Z
user: login: gustavderdrache
state: COMMENTED
author_association: NONE
submitted_at: 2025-04-28T14:34:32Z
user: login: grahamc
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-28T16:58:59Z
user: login: edolstra
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-04-29T08:01:17Z

Review comments:
diff_hunk: @@ -0,0 +1,68 @@
+#!/bin/sh
+
+# SC2002 disables "useless cat" warnings.
+# I prefer pipelines that start with an explicit input, and go from there.
+# Overly fussy.
+# shellcheck disable=SC2002
+
+scratch=$(mktemp -d -t tmp.XXXXXXXXXX)
+finish() {
+  rm -rf "$scratch"
+}
+trap finish EXIT
+
+DATE=$(date +%Y-%m-%d)
+DETERMINATE_NIX_VERSION=$(cat .version-determinate)
+TAG_NAME="v${DETERMINATE_NIX_VERSION}"
+NIX_VERSION=$(cat .version)
+NIX_VERSION_MAJOR_MINOR=$(echo "$NIX_VERSION" | cut -d. -f1,2)
+GITHUB_REPOSITORY="${GITHUB_REPOSITORY:-DeterminateSystems/nix-src}"
+
+gh api "/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \
+        -f "tag_name=${TAG_NAME}" > "$scratch/notes.json"
+
+trim_trailing_newlines() {
+    tac \
+        | awk 'flag {print} {if(NF) flag=1}' \
+        | tac
+}
+
+linkify_gh() {
+    sed \
+        -e 's#\(https://github.com/DeterminateSystems/nix-src/\(pull\|issue\)/\([[:digit:]]\+\)\)#[dnix\#\3](\1)#' \
path: .github/release-notes.sh
user: login: grahamc
body: ```suggestion
        -e 's#\(https://github.com/DeterminateSystems/nix-src/\(pull\|issue\)/\([[:digit:]]\+\)\)#[DeterminateSystems/nix-src\#\3](\1)#' \
```
created_at: 2025-04-27T21:40:44Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,68 @@
+#!/bin/sh
+
+# SC2002 disables "useless cat" warnings.
+# I prefer pipelines that start with an explicit input, and go from there.
+# Overly fussy.
+# shellcheck disable=SC2002
+
+scratch=$(mktemp -d -t tmp.XXXXXXXXXX)
+finish() {
+  rm -rf "$scratch"
+}
+trap finish EXIT
+
+DATE=$(date +%Y-%m-%d)
+DETERMINATE_NIX_VERSION=$(cat .version-determinate)
+TAG_NAME="v${DETERMINATE_NIX_VERSION}"
+NIX_VERSION=$(cat .version)
+NIX_VERSION_MAJOR_MINOR=$(echo "$NIX_VERSION" | cut -d. -f1,2)
+GITHUB_REPOSITORY="${GITHUB_REPOSITORY:-DeterminateSystems/nix-src}"
+
+gh api "/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \
+        -f "tag_name=${TAG_NAME}" > "$scratch/notes.json"
+
+trim_trailing_newlines() {
+    tac \
+        | awk 'flag {print} {if(NF) flag=1}' \
+        | tac
path: .github/release-notes.sh
user: login: gustavderdrache
body: ```
$ trim_trailing_newlines() {
> local s="$(cat)"
> echo -n "${s//$'\n'}"
> }

$ echo $'foo\n\n\n' | trim_trailing_newlines | xxd
00000000: 666f 6f                                  foo
```
created_at: 2025-04-28T13:02:27Z
author_association: NONE
diff_hunk: @@ -0,0 +1,68 @@
+#!/bin/sh
+
+# SC2002 disables "useless cat" warnings.
+# I prefer pipelines that start with an explicit input, and go from there.
+# Overly fussy.
+# shellcheck disable=SC2002
+
+scratch=$(mktemp -d -t tmp.XXXXXXXXXX)
+finish() {
+  rm -rf "$scratch"
+}
+trap finish EXIT
+
+DATE=$(date +%Y-%m-%d)
+DETERMINATE_NIX_VERSION=$(cat .version-determinate)
+TAG_NAME="v${DETERMINATE_NIX_VERSION}"
+NIX_VERSION=$(cat .version)
+NIX_VERSION_MAJOR_MINOR=$(echo "$NIX_VERSION" | cut -d. -f1,2)
+GITHUB_REPOSITORY="${GITHUB_REPOSITORY:-DeterminateSystems/nix-src}"
+
+gh api "/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \
+        -f "tag_name=${TAG_NAME}" > "$scratch/notes.json"
+
+trim_trailing_newlines() {
+    tac \
+        | awk 'flag {print} {if(NF) flag=1}' \
+        | tac
+}
+
+linkify_gh() {
+    sed \
+        -e 's#\(https://github.com/DeterminateSystems/nix-src/\(pull\|issue\)/\([[:digit:]]\+\)\)#[dnix\#\3](\1)#' \
path: .github/release-notes.sh
user: login: gustavderdrache
body: If you need to escape your delimiter, please pick a different one:
```suggestion
        -e 's!\(https://github.com/DeterminateSystems/nix-src/\(pull\|issue\)/\([[:digit:]]\+\)\)![DeterminateSystems/nix-src#\3](\1)!' \
```
created_at: 2025-04-28T13:04:54Z
author_association: NONE
diff_hunk: @@ -0,0 +1,68 @@
+#!/bin/sh
+
+# SC2002 disables "useless cat" warnings.
+# I prefer pipelines that start with an explicit input, and go from there.
+# Overly fussy.
+# shellcheck disable=SC2002
+
+scratch=$(mktemp -d -t tmp.XXXXXXXXXX)
+finish() {
+  rm -rf "$scratch"
+}
+trap finish EXIT
+
+DATE=$(date +%Y-%m-%d)
+DETERMINATE_NIX_VERSION=$(cat .version-determinate)
+TAG_NAME="v${DETERMINATE_NIX_VERSION}"
+NIX_VERSION=$(cat .version)
+NIX_VERSION_MAJOR_MINOR=$(echo "$NIX_VERSION" | cut -d. -f1,2)
+GITHUB_REPOSITORY="${GITHUB_REPOSITORY:-DeterminateSystems/nix-src}"
+
+gh api "/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \
+        -f "tag_name=${TAG_NAME}" > "$scratch/notes.json"
+
+trim_trailing_newlines() {
+    tac \
+        | awk 'flag {print} {if(NF) flag=1}' \
+        | tac
path: .github/release-notes.sh
user: login: grahamc
body: Hm. I was thinking this was used in a place where the argument could be very large, but I don't think that is a problem. Want to make a `suggestion` block? :)
created_at: 2025-04-28T14:18:10Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,68 @@
+#!/bin/sh
+
+# SC2002 disables "useless cat" warnings.
+# I prefer pipelines that start with an explicit input, and go from there.
+# Overly fussy.
+# shellcheck disable=SC2002
+
+scratch=$(mktemp -d -t tmp.XXXXXXXXXX)
+finish() {
+  rm -rf "$scratch"
+}
+trap finish EXIT
+
+DATE=$(date +%Y-%m-%d)
+DETERMINATE_NIX_VERSION=$(cat .version-determinate)
+TAG_NAME="v${DETERMINATE_NIX_VERSION}"
+NIX_VERSION=$(cat .version)
+NIX_VERSION_MAJOR_MINOR=$(echo "$NIX_VERSION" | cut -d. -f1,2)
+GITHUB_REPOSITORY="${GITHUB_REPOSITORY:-DeterminateSystems/nix-src}"
+
+gh api "/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \
+        -f "tag_name=${TAG_NAME}" > "$scratch/notes.json"
+
+trim_trailing_newlines() {
+    tac \
+        | awk 'flag {print} {if(NF) flag=1}' \
+        | tac
path: .github/release-notes.sh
user: login: gustavderdrache
body: (Note: this requires changing the shebang line to `/bin/bash`, or else shellcheck will complain.)

```suggestion
    local text
    text="$(cat)"
    echo -n "${text//$'\n'}"
```
created_at: 2025-04-28T14:34:32Z
author_association: NONE
diff_hunk: @@ -0,0 +1,68 @@
+#!/bin/sh
path: .github/release-notes.sh
user: login: grahamc
body: ```suggestion
#!/usr/bin/env bash
```
created_at: 2025-04-28T16:58:58Z
author_association: MEMBER

PR comments:
user: login: github-actions[bot]
created_at: 2025-04-27T21:32:00Z
body: <!-- NETLIFY DEPLOY COMMENT GENERATED BY ACTIONS_NETLIFY - APP ID SHA256: 92f886fed0de09a60ca5afe503f6adf5da4b0f5f8801fcb5e634980d835a5772 -->
🚀 Deployed on https://680fb5f46163204925f9e3f3--determinate-nix.netlify.app
author_association: NONE
user: login: edolstra
created_at: 2025-04-28T12:56:46Z
body: This is quite different from the upstream release notes script (`maintainers/release-notes`), which concatenates the release notes in `doc/manual/rl-next`. Using PR titles can be useful as a first start, but it can also include a lot of cruft that isn't useful for readers (e.g. a PR that fixes a bug in a preceding PR).
author_association: COLLABORATOR
user: login: grahamc
created_at: 2025-04-28T14:43:07Z
body: @edolstra yeah! I agree the automatically generated list isn't best out of the box. A few notes:

1. We can configure it to ignore PRs with specific tags, or split commits out into sections by tag: https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#example-configurations this would make it a bit better.

1. This change will put the release notes into an opened pull request which needs to be approved/merged. That means we'll have the opportunity to edit / update the notes as needed to extend and prune what is generated. ie: It doesn't need to be perfect out of the gate.

1. What this generates reuses what is generated by GitHub to write to the tag's release: https://github.com/DeterminateSystems/nix-src/releases/tag/v3.4.0 so if we go make the auto-generated text better, that'll get better at the same time. We could get this anyway by making the release workflow update the tag's release notes with the generated markdown, though.

I think if we go to using the rl-next approach we'll need to update the tooling to split out / support the determinate specific changes, yeah? I'm okay with that if you'd prefer it!
author_association: MEMBER
user: login: edolstra
created_at: 2025-04-29T08:03:56Z
body: Sounds good. A problem with the `rl-next` approach is that people tend to forget to write them, and they tend to duplicate the PR description. So maybe this script could copy not just the PR titles but also their descriptions. 
author_association: COLLABORATOR