diff --git a/maintainers/this-month-in-nix-docs/README.md b/maintainers/this-month-in-nix-docs/README.md new file mode 100644 index 0000000..880bd8c --- /dev/null +++ b/maintainers/this-month-in-nix-docs/README.md @@ -0,0 +1,9 @@ +# This Month in Nix Docs +This is a script and template for compiling "This Month in Nix Docs". The process is semi-automated. The script queries a collection of Nix repositories, looking for merged PRs with documentation-related labels, RFCs (you have to look through these manually), and tracking issues in this repository. + +A new post is created via: +``` +$ ./new-post.sh >new-post.md +``` + +After this invocation a template post (`new-post.md`) will be filled out with the GitHub query results formatted as markdown at the end of the file. You'll also need to fill in the number and year/month at the top of the post. \ No newline at end of file diff --git a/maintainers/this-month-in-nix-docs/make-post.sh b/maintainers/this-month-in-nix-docs/make-post.sh new file mode 100755 index 0000000..3568bce --- /dev/null +++ b/maintainers/this-month-in-nix-docs/make-post.sh @@ -0,0 +1,80 @@ +#! /usr/bin/env nix-shell +#! nix-shell -i bash -p gh + +set -euo pipefail + +if [ $# -eq 0 ]; then + echo "Usage: query-prs.sh " + exit 1 +fi + +from_date="$1" +to_date="$2" +pr_fields="number,title,author,url" +pr_template="{{range .}}- [#{{.number}}]({{.url}}) {{.title}} ([@{{.author.login}}](https://github.com/{{.author.login}})){{printf \"\n\"}}{{end}}" +tracking_issue_template="{{range .}}- [#{{.number}}]({{.url}}) {{.title}}{{printf \"\n\"}}{{end}}" + +# Lists the PRs merged from a repository between certain dates, optionally filtered by labels +list_merged_prs() { + if [ $# -gt 1 ]; then + repo="$1" + labels="$2" + gh pr list -R "$repo" --search "is:merged merged:$from_date..$to_date label:\"$labels\"" --json "$pr_fields" --template "$pr_template" + else + repo="$1" + gh pr list -R "$repo" --search "is:merged merged:$from_date..$to_date" --json "$pr_fields" --template "$pr_template" + fi +} + +# Lists the PRs opened on a repository +list_opened_prs() { + if [ $# -gt 1 ]; then + repo="$1" + labels="$2" + gh pr list -R "$repo" --search "is:unmerged created:$from_date..$to_date label:\"$labels\"" --json "$pr_fields" --template "$pr_template" + else + repo="$1" + gh pr list -R "$repo" --search "is:unmerged created:$from_date..$to_date" --json "$pr_fields" --template "$pr_template" + fi +} + +# Lists all of the tracking issues opened on nix.dev within the specified dates +list_new_tracking_issues() { + gh issue list -R "nixos/nix.dev" --search "created:$from_date..$to_date label:tracking" --json "$pr_fields" --template "$tracking_issue_template" +} + +cat template.md + +echo "## PRs" +echo + +echo "### NixOS/nix" +list_merged_prs "nixos/nix" "documentation" +echo + +echo "### NixOS/nixpkgs" +list_merged_prs "nixos/nixpkgs" "6.topic: documentation" +echo + +echo "### NixOS/nix-pills" +list_merged_prs "nixos/nix-pills" +echo + +echo "### NixOS/nix.dev" +list_merged_prs "nixos/nix.dev" +echo + +echo "## RFCs" +echo + +echo "### Opened (manually check for relevance)" +list_opened_prs "nixos/rfcs" +echo + +echo "### Accepted (manually check for relevance)" +list_merged_prs "nixos/rfcs" +echo + +echo "## New Tracking Issues" +list_new_tracking_issues +echo \ No newline at end of file diff --git a/maintainers/this-month-in-nix-docs/template.md b/maintainers/this-month-in-nix-docs/template.md new file mode 100644 index 0000000..cb997e9 --- /dev/null +++ b/maintainers/this-month-in-nix-docs/template.md @@ -0,0 +1,12 @@ +# This Month in Nix Docs - #**NUMBER** - **MONTH** **YEAR** + +## Community +You can always find the Documentation Team on Matrix: [Nix Documentation](https://matrix.to/#/#docs:nixos.org). Drop in if you'd like to contribute! + +## Projects + +## RFCs + +## Documentation PRs Merged + +# AUTOGENERATED